Fourth step at renaming patches: renumber all patches with a 10-step.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jul 28 21:32:33 2008 +0000 (2008-07-28)
changeset 747d3e603e7c17c
parent 746 b150d6f590fc
child 748 61cd4eb6034d
Fourth step at renaming patches: renumber all patches with a 10-step.
patches/binutils/2.15/002-uclibc.patch
patches/binutils/2.15/100-uclibc-conf.patch
patches/binutils/2.15/100-uclibc.patch
patches/binutils/2.15/110-uclibc-conf.patch
patches/binutils/2.15/120-cflags.patch
patches/binutils/2.15/130-mips-ELF_MAXPAGESIZE-4K.patch
patches/binutils/2.15/140-arm-textrel.patch
patches/binutils/2.15/150-bfd-hash-tweak.patch
patches/binutils/2.15/160-allow-gcc-4.0.patch
patches/binutils/2.15/170-psignal.patch
patches/binutils/2.15/180-solaris-qsort.patch
patches/binutils/2.15/190-vmx.patch
patches/binutils/2.15/200-arm-undef-imm.patch
patches/binutils/2.15/210-cflags.patch
patches/binutils/2.15/210-skip-comments.patch
patches/binutils/2.15/220-cross-gprof.patch
patches/binutils/2.15/230-gccpr15247-fix.patch
patches/binutils/2.15/240-ld-callahan.patch
patches/binutils/2.15/250-ld-stabs-tweak.patch
patches/binutils/2.15/260-s390-invalid-insn-format.patch
patches/binutils/2.15/400-mips-ELF_MAXPAGESIZE-4K.patch
patches/binutils/2.15/600-arm-textrel.patch
patches/binutils/2.15/700-bfd-hash-tweak.patch
patches/binutils/2.15/710-allow-gcc-4.0.patch
patches/binutils/2.15/720-psignal.patch
patches/binutils/2.15/730-solaris-qsort.patch
patches/binutils/2.15/740-vmx.patch
patches/binutils/2.15/750-arm-undef-imm.patch
patches/binutils/2.15/760-skip-comments.patch
patches/binutils/2.15/770-cross-gprof.patch
patches/binutils/2.15/780-gccpr15247-fix.patch
patches/binutils/2.15/790-ld-callahan.patch
patches/binutils/2.15/800-ld-stabs-tweak.patch
patches/binutils/2.15/810-s390-invalid-insn-format.patch
patches/binutils/2.17/130-ld_makefile_patch.patch
patches/binutils/2.17/140-better_file_error.patch
patches/binutils/2.17/150-check_ldrunpath_length.patch
patches/binutils/2.17/160-mips-ELF_MAXPAGESIZE-4K.patch
patches/binutils/2.17/170-bfd-hash-tweak.patch
patches/binutils/2.17/180-psignal.patch
patches/binutils/2.17/190-skip-comments.patch
patches/binutils/2.17/200-cross-gprof.patch
patches/binutils/2.17/300-ld_makefile_patch.patch
patches/binutils/2.17/301-better_file_error.patch
patches/binutils/2.17/302-check_ldrunpath_length.patch
patches/binutils/2.17/400-mips-ELF_MAXPAGESIZE-4K.patch
patches/binutils/2.17/500-bfd-hash-tweak.patch
patches/binutils/2.17/501-psignal.patch
patches/binutils/2.17/502-skip-comments.patch
patches/binutils/2.17/503-cross-gprof.patch
patches/binutils/2.18.50.0.4/110-ld-makefile-path.patch
patches/binutils/2.18.50.0.4/120-check-ldrunpath-length.patch
patches/binutils/2.18.50.0.4/200-ld-makefile-path.patch
patches/binutils/2.18.50.0.4/300-check-ldrunpath-length.patch
patches/binutils/2.18.50.0.6/110-ld-makefile-path.patch
patches/binutils/2.18.50.0.6/120-check-ldrunpath-length.patch
patches/binutils/2.18.50.0.6/200-ld-makefile-path.patch
patches/binutils/2.18.50.0.6/300-check-ldrunpath-length.patch
patches/binutils/2.18.50.0.7/110-ld-makefile-path.patch
patches/binutils/2.18.50.0.7/120-check-ldrunpath-length.patch
patches/binutils/2.18.50.0.7/200-ld-makefile-path.patch
patches/binutils/2.18.50.0.7/300-check-ldrunpath-length.patch
patches/binutils/2.18.50.0.8/110-ld-makefile-path.patch
patches/binutils/2.18.50.0.8/120-check-ldrunpath-length.patch
patches/binutils/2.18.50.0.8/200-ld-makefile-path.patch
patches/binutils/2.18.50.0.8/300-check-ldrunpath-length.patch
patches/dmalloc/5.5.2/130-mips.patch
patches/dmalloc/5.5.2/140-shared_library.patch
patches/dmalloc/5.5.2/150-use_DESTDIR.patch
patches/dmalloc/5.5.2/160-strdup_macro.patch
patches/dmalloc/5.5.2/200-mips.patch
patches/dmalloc/5.5.2/300-shared_library.patch
patches/dmalloc/5.5.2/400-use_DESTDIR.patch
patches/dmalloc/5.5.2/500-strdup_macro.patch
patches/duma/2_5_1/110-separate_cpp.patch
patches/duma/2_5_1/200-separate_cpp.patch
patches/duma/2_5_12/110-separate_cpp.patch
patches/duma/2_5_12/200-separate_cpp.patch
patches/duma/2_5_14/110-separate_cpp.patch
patches/duma/2_5_14/200-separate_cpp.patch
patches/duma/2_5_8/110-separate_cpp.patch
patches/duma/2_5_8/200-separate_cpp.patch
patches/gcc/3.4.6/110-uclibc-locale.patch
patches/gcc/3.4.6/120-libstdc++-pic.patch
patches/gcc/3.4.6/130-index_macro.patch
patches/gcc/3.4.6/140-arm-ldm-peephole.patch
patches/gcc/3.4.6/150-arm-ldm.patch
patches/gcc/3.4.6/160-arm-ldm-peephole2.patch
patches/gcc/3.4.6/170-sdk-libstdc++-includes.patch
patches/gcc/3.4.6/180-pr15068-fix.patch
patches/gcc/3.4.6/190-all_sh-pr16665-fix.patch
patches/gcc/3.4.6/200-all_sh-no-reorder-blocks.patch
patches/gcc/3.4.6/200-uclibc-locale.patch
patches/gcc/3.4.6/210-all_sh-pr20617.patch
patches/gcc/3.4.6/220-arm-bigendian.patch
patches/gcc/3.4.6/230-powerpc-libc_stack_end-uclibc.patch
patches/gcc/3.4.6/240-mips-xgot.patch
patches/gcc/3.4.6/250-nios2.patch
patches/gcc/3.4.6/260-arm-softfloat.patch
patches/gcc/3.4.6/300-libstdc++-pic.patch
patches/gcc/3.4.6/304-index_macro.patch
patches/gcc/3.4.6/600-arm-ldm-peephole.patch
patches/gcc/3.4.6/601-arm-ldm.patch
patches/gcc/3.4.6/602-arm-ldm-peephole2.patch
patches/gcc/3.4.6/602-sdk-libstdc++-includes.patch
patches/gcc/3.4.6/700-pr15068-fix.patch
patches/gcc/3.4.6/710-all_sh-pr16665-fix.patch
patches/gcc/3.4.6/720-all_sh-no-reorder-blocks.patch
patches/gcc/3.4.6/730-all_sh-pr20617.patch
patches/gcc/3.4.6/800-arm-bigendian.patch
patches/gcc/3.4.6/800-powerpc-libc_stack_end-uclibc.patch
patches/gcc/3.4.6/810-mips-xgot.patch
patches/gcc/3.4.6/900-nios2.patch
patches/gcc/3.4.6/910-arm-softfloat.patch
patches/gcc/4.0.3/110-uclibc-locale.patch
patches/gcc/4.0.3/120-libstdc++-pic.patch
patches/gcc/4.0.3/130-missing-execinfo_h.patch
patches/gcc/4.0.3/140-c99-snprintf.patch
patches/gcc/4.0.3/150-c99-complex-ugly-hack.patch
patches/gcc/4.0.3/160-index_macro.patch
patches/gcc/4.0.3/170-sdk-libstdc++-includes.patch
patches/gcc/4.0.3/180-arm-bigendian.patch
patches/gcc/4.0.3/200-uclibc-locale.patch
patches/gcc/4.0.3/300-libstdc++-pic.patch
patches/gcc/4.0.3/301-missing-execinfo_h.patch
patches/gcc/4.0.3/302-c99-snprintf.patch
patches/gcc/4.0.3/303-c99-complex-ugly-hack.patch
patches/gcc/4.0.3/304-index_macro.patch
patches/gcc/4.0.3/602-sdk-libstdc++-includes.patch
patches/gcc/4.0.3/800-arm-bigendian.patch
patches/gcc/4.0.4/110-uclibc-locale.patch
patches/gcc/4.0.4/120-libstdc++-pic.patch
patches/gcc/4.0.4/130-missing-execinfo_h.patch
patches/gcc/4.0.4/140-c99-snprintf.patch
patches/gcc/4.0.4/150-c99-complex-ugly-hack.patch
patches/gcc/4.0.4/160-index_macro.patch
patches/gcc/4.0.4/170-libmudflap-susv3-legacy.patch
patches/gcc/4.0.4/180-sdk-libstdc++-includes.patch
patches/gcc/4.0.4/190-arm-bigendian.patch
patches/gcc/4.0.4/200-arm-softfloat.patch
patches/gcc/4.0.4/200-uclibc-locale.patch
patches/gcc/4.0.4/300-libstdc++-pic.patch
patches/gcc/4.0.4/301-missing-execinfo_h.patch
patches/gcc/4.0.4/302-c99-snprintf.patch
patches/gcc/4.0.4/303-c99-complex-ugly-hack.patch
patches/gcc/4.0.4/304-index_macro.patch
patches/gcc/4.0.4/305-libmudflap-susv3-legacy.patch
patches/gcc/4.0.4/602-sdk-libstdc++-includes.patch
patches/gcc/4.0.4/800-arm-bigendian.patch
patches/gcc/4.0.4/801-arm-softfloat.patch
patches/gcc/4.1.1/120-uclibc-locale.patch
patches/gcc/4.1.1/130-libstdc++-pic.patch
patches/gcc/4.1.1/140-missing-execinfo_h.patch
patches/gcc/4.1.1/150-c99-snprintf.patch
patches/gcc/4.1.1/160-c99-complex-ugly-hack.patch
patches/gcc/4.1.1/170-index_macro.patch
patches/gcc/4.1.1/180-sh-pr24836.patch
patches/gcc/4.1.1/190-arm-bigendian.patch
patches/gcc/4.1.1/200-softfloat-fix.patch
patches/gcc/4.1.1/200-uclibc-locale.patch
patches/gcc/4.1.1/300-libstdc++-pic.patch
patches/gcc/4.1.1/301-missing-execinfo_h.patch
patches/gcc/4.1.1/302-c99-snprintf.patch
patches/gcc/4.1.1/303-c99-complex-ugly-hack.patch
patches/gcc/4.1.1/304-index_macro.patch
patches/gcc/4.1.1/740-sh-pr24836.patch
patches/gcc/4.1.1/800-arm-bigendian.patch
patches/gcc/4.1.1/801-softfloat-fix.patch
patches/gcc/4.1.2/120-uclibc-locale.patch
patches/gcc/4.1.2/130-libstdc++-pic.patch
patches/gcc/4.1.2/140-missing-execinfo_h.patch
patches/gcc/4.1.2/150-c99-snprintf.patch
patches/gcc/4.1.2/160-c99-complex-ugly-hack.patch
patches/gcc/4.1.2/170-index_macro.patch
patches/gcc/4.1.2/180-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.1.2/190-sh-pr24836.patch
patches/gcc/4.1.2/200-arm-bigendian.patch
patches/gcc/4.1.2/200-uclibc-locale.patch
patches/gcc/4.1.2/210-softfloat-fix.patch
patches/gcc/4.1.2/300-libstdc++-pic.patch
patches/gcc/4.1.2/301-missing-execinfo_h.patch
patches/gcc/4.1.2/302-c99-snprintf.patch
patches/gcc/4.1.2/303-c99-complex-ugly-hack.patch
patches/gcc/4.1.2/304-index_macro.patch
patches/gcc/4.1.2/402-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.1.2/740-sh-pr24836.patch
patches/gcc/4.1.2/800-arm-bigendian.patch
patches/gcc/4.1.2/801-softfloat-fix.patch
patches/gcc/4.2.0/103-uclibc-conf-noupstream.patch
patches/gcc/4.2.0/110-uclibc-conf-noupstream.patch
patches/gcc/4.2.0/120-uclibc-locale.patch
patches/gcc/4.2.0/130-uclibc-locale-no__x.patch
patches/gcc/4.2.0/140-uclibc-locale-wchar_fix.patch
patches/gcc/4.2.0/150-uclibc-locale-update.patch
patches/gcc/4.2.0/160-libstdc++-pic.patch
patches/gcc/4.2.0/170-missing-execinfo_h.patch
patches/gcc/4.2.0/180-c99-snprintf.patch
patches/gcc/4.2.0/190-c99-complex-ugly-hack.patch
patches/gcc/4.2.0/200-index_macro.patch
patches/gcc/4.2.0/200-uclibc-locale.patch
patches/gcc/4.2.0/203-uclibc-locale-no__x.patch
patches/gcc/4.2.0/204-uclibc-locale-wchar_fix.patch
patches/gcc/4.2.0/205-uclibc-locale-update.patch
patches/gcc/4.2.0/210-libmudflap-susv3-legacy.patch
patches/gcc/4.2.0/220-libstdc++-namespace.patch
patches/gcc/4.2.0/230-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.2.0/240-arm-bigendian.patch
patches/gcc/4.2.0/250-softfloat-fix.patch
patches/gcc/4.2.0/260-flatten-switch-stmt-00.patch
patches/gcc/4.2.0/270-soft-float.patch
patches/gcc/4.2.0/280-alpha-signal_h.patch
patches/gcc/4.2.0/300-libstdc++-pic.patch
patches/gcc/4.2.0/301-missing-execinfo_h.patch
patches/gcc/4.2.0/302-c99-snprintf.patch
patches/gcc/4.2.0/303-c99-complex-ugly-hack.patch
patches/gcc/4.2.0/304-index_macro.patch
patches/gcc/4.2.0/305-libmudflap-susv3-legacy.patch
patches/gcc/4.2.0/306-libstdc++-namespace.patch
patches/gcc/4.2.0/402-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.2.0/800-arm-bigendian.patch
patches/gcc/4.2.0/801-softfloat-fix.patch
patches/gcc/4.2.0/904-flatten-switch-stmt-00.patch
patches/gcc/4.2.0/920-soft-float.patch
patches/gcc/4.2.0/940-alpha-signal_h.patch
patches/gcc/4.2.1/103-uclibc-conf-noupstream.patch
patches/gcc/4.2.1/110-uclibc-conf-noupstream.patch
patches/gcc/4.2.1/120-uclibc-locale.patch
patches/gcc/4.2.1/130-uclibc-locale-no__x.patch
patches/gcc/4.2.1/140-uclibc-locale-wchar_fix.patch
patches/gcc/4.2.1/150-uclibc-locale-update.patch
patches/gcc/4.2.1/160-libstdc++-pic.patch
patches/gcc/4.2.1/170-missing-execinfo_h.patch
patches/gcc/4.2.1/180-c99-snprintf.patch
patches/gcc/4.2.1/190-c99-complex-ugly-hack.patch
patches/gcc/4.2.1/200-index_macro.patch
patches/gcc/4.2.1/200-uclibc-locale.patch
patches/gcc/4.2.1/203-uclibc-locale-no__x.patch
patches/gcc/4.2.1/204-uclibc-locale-wchar_fix.patch
patches/gcc/4.2.1/205-uclibc-locale-update.patch
patches/gcc/4.2.1/210-libmudflap-susv3-legacy.patch
patches/gcc/4.2.1/220-libstdc++-namespace.patch
patches/gcc/4.2.1/230-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.2.1/240-arm-bigendian.patch
patches/gcc/4.2.1/250-softfloat-fix.patch
patches/gcc/4.2.1/260-flatten-switch-stmt-00.patch
patches/gcc/4.2.1/270-soft-float.patch
patches/gcc/4.2.1/280-alpha-signal_h.patch
patches/gcc/4.2.1/300-libstdc++-pic.patch
patches/gcc/4.2.1/301-missing-execinfo_h.patch
patches/gcc/4.2.1/302-c99-snprintf.patch
patches/gcc/4.2.1/303-c99-complex-ugly-hack.patch
patches/gcc/4.2.1/304-index_macro.patch
patches/gcc/4.2.1/305-libmudflap-susv3-legacy.patch
patches/gcc/4.2.1/306-libstdc++-namespace.patch
patches/gcc/4.2.1/402-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.2.1/800-arm-bigendian.patch
patches/gcc/4.2.1/801-softfloat-fix.patch
patches/gcc/4.2.1/904-flatten-switch-stmt-00.patch
patches/gcc/4.2.1/920-soft-float.patch
patches/gcc/4.2.1/940-alpha-signal_h.patch
patches/gcc/4.2.2/103-uclibc-conf-noupstream.patch
patches/gcc/4.2.2/110-uclibc-conf-noupstream.patch
patches/gcc/4.2.2/120-uclibc-locale.patch
patches/gcc/4.2.2/130-uclibc-locale-no__x.patch
patches/gcc/4.2.2/140-uclibc-locale-wchar_fix.patch
patches/gcc/4.2.2/150-uclibc-locale-update.patch
patches/gcc/4.2.2/160-libstdc++-pic.patch
patches/gcc/4.2.2/170-missing-execinfo_h.patch
patches/gcc/4.2.2/180-c99-snprintf.patch
patches/gcc/4.2.2/190-c99-complex-ugly-hack.patch
patches/gcc/4.2.2/200-index_macro.patch
patches/gcc/4.2.2/200-uclibc-locale.patch
patches/gcc/4.2.2/203-uclibc-locale-no__x.patch
patches/gcc/4.2.2/204-uclibc-locale-wchar_fix.patch
patches/gcc/4.2.2/205-uclibc-locale-update.patch
patches/gcc/4.2.2/210-libmudflap-susv3-legacy.patch
patches/gcc/4.2.2/220-libstdc++-namespace.patch
patches/gcc/4.2.2/230-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.2.2/240-arm-bigendian.patch
patches/gcc/4.2.2/250-softfloat-fix.patch
patches/gcc/4.2.2/260-flatten-switch-stmt-00.patch
patches/gcc/4.2.2/270-soft-float.patch
patches/gcc/4.2.2/280-alpha-signal_h.patch
patches/gcc/4.2.2/300-libstdc++-pic.patch
patches/gcc/4.2.2/301-missing-execinfo_h.patch
patches/gcc/4.2.2/302-c99-snprintf.patch
patches/gcc/4.2.2/303-c99-complex-ugly-hack.patch
patches/gcc/4.2.2/304-index_macro.patch
patches/gcc/4.2.2/305-libmudflap-susv3-legacy.patch
patches/gcc/4.2.2/306-libstdc++-namespace.patch
patches/gcc/4.2.2/402-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.2.2/800-arm-bigendian.patch
patches/gcc/4.2.2/801-softfloat-fix.patch
patches/gcc/4.2.2/904-flatten-switch-stmt-00.patch
patches/gcc/4.2.2/920-soft-float.patch
patches/gcc/4.2.2/940-alpha-signal_h.patch
patches/gcc/4.2.3/103-uclibc-conf-noupstream.patch
patches/gcc/4.2.3/110-uclibc-conf-noupstream.patch
patches/gcc/4.2.3/120-uclibc-locale.patch
patches/gcc/4.2.3/130-uclibc-locale-no__x.patch
patches/gcc/4.2.3/140-uclibc-locale-wchar_fix.patch
patches/gcc/4.2.3/150-uclibc-locale-update.patch
patches/gcc/4.2.3/160-libstdc++-pic.patch
patches/gcc/4.2.3/170-missing-execinfo_h.patch
patches/gcc/4.2.3/180-c99-snprintf.patch
patches/gcc/4.2.3/190-c99-complex-ugly-hack.patch
patches/gcc/4.2.3/200-index_macro.patch
patches/gcc/4.2.3/200-uclibc-locale.patch
patches/gcc/4.2.3/203-uclibc-locale-no__x.patch
patches/gcc/4.2.3/204-uclibc-locale-wchar_fix.patch
patches/gcc/4.2.3/205-uclibc-locale-update.patch
patches/gcc/4.2.3/210-libmudflap-susv3-legacy.patch
patches/gcc/4.2.3/220-libstdc++-namespace.patch
patches/gcc/4.2.3/230-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.2.3/240-arm-bigendian.patch
patches/gcc/4.2.3/250-softfloat-fix.patch
patches/gcc/4.2.3/260-flatten-switch-stmt-00.patch
patches/gcc/4.2.3/270-soft-float.patch
patches/gcc/4.2.3/280-eabi_fixes.patch
patches/gcc/4.2.3/290-alpha-signal_h.patch
patches/gcc/4.2.3/300-fortran-signed-TImode.patch
patches/gcc/4.2.3/300-libstdc++-pic.patch
patches/gcc/4.2.3/301-missing-execinfo_h.patch
patches/gcc/4.2.3/302-c99-snprintf.patch
patches/gcc/4.2.3/303-c99-complex-ugly-hack.patch
patches/gcc/4.2.3/304-index_macro.patch
patches/gcc/4.2.3/305-libmudflap-susv3-legacy.patch
patches/gcc/4.2.3/306-libstdc++-namespace.patch
patches/gcc/4.2.3/402-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.2.3/800-arm-bigendian.patch
patches/gcc/4.2.3/801-softfloat-fix.patch
patches/gcc/4.2.3/904-flatten-switch-stmt-00.patch
patches/gcc/4.2.3/920-soft-float.patch
patches/gcc/4.2.3/930-eabi_fixes.patch
patches/gcc/4.2.3/940-alpha-signal_h.patch
patches/gcc/4.2.3/950-fortran-signed-TImode.patch
patches/gcc/4.2.4/103-uclibc-conf-noupstream.patch
patches/gcc/4.2.4/110-uclibc-conf-noupstream.patch
patches/gcc/4.2.4/120-uclibc-locale.patch
patches/gcc/4.2.4/130-uclibc-locale-no__x.patch
patches/gcc/4.2.4/140-uclibc-locale-wchar_fix.patch
patches/gcc/4.2.4/150-uclibc-locale-update.patch
patches/gcc/4.2.4/160-libstdc++-pic.patch
patches/gcc/4.2.4/170-missing-execinfo_h.patch
patches/gcc/4.2.4/180-c99-snprintf.patch
patches/gcc/4.2.4/190-c99-complex-ugly-hack.patch
patches/gcc/4.2.4/200-index_macro.patch
patches/gcc/4.2.4/200-uclibc-locale.patch
patches/gcc/4.2.4/203-uclibc-locale-no__x.patch
patches/gcc/4.2.4/204-uclibc-locale-wchar_fix.patch
patches/gcc/4.2.4/205-uclibc-locale-update.patch
patches/gcc/4.2.4/210-libmudflap-susv3-legacy.patch
patches/gcc/4.2.4/220-libstdc++-namespace.patch
patches/gcc/4.2.4/230-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.2.4/240-arm-bigendian.patch
patches/gcc/4.2.4/250-softfloat-fix.patch
patches/gcc/4.2.4/260-flatten-switch-stmt-00.patch
patches/gcc/4.2.4/270-soft-float.patch
patches/gcc/4.2.4/280-eabi_fixes.patch
patches/gcc/4.2.4/290-alpha-signal_h.patch
patches/gcc/4.2.4/300-fortran-signed-TImode.patch
patches/gcc/4.2.4/300-libstdc++-pic.patch
patches/gcc/4.2.4/301-missing-execinfo_h.patch
patches/gcc/4.2.4/302-c99-snprintf.patch
patches/gcc/4.2.4/303-c99-complex-ugly-hack.patch
patches/gcc/4.2.4/304-index_macro.patch
patches/gcc/4.2.4/305-libmudflap-susv3-legacy.patch
patches/gcc/4.2.4/306-libstdc++-namespace.patch
patches/gcc/4.2.4/402-libbackend_dep_gcov-iov.h.patch
patches/gcc/4.2.4/800-arm-bigendian.patch
patches/gcc/4.2.4/801-softfloat-fix.patch
patches/gcc/4.2.4/904-flatten-switch-stmt-00.patch
patches/gcc/4.2.4/920-soft-float.patch
patches/gcc/4.2.4/930-eabi_fixes.patch
patches/gcc/4.2.4/940-alpha-signal_h.patch
patches/gcc/4.2.4/950-fortran-signed-TImode.patch
patches/gcc/4.3.0/110-trampolinewarn.patch
patches/gcc/4.3.0/120-java-nomulti.patch
patches/gcc/4.3.0/125-trampolinewarn.patch
patches/gcc/4.3.0/130-cross-compile.patch
patches/gcc/4.3.0/140-netbsd-symbolic.patch
patches/gcc/4.3.0/150-java-nomulti.patch
patches/gcc/4.3.0/150-sparc64-bsd.patch
patches/gcc/4.3.0/160-flatten-switch-stmt-00.patch
patches/gcc/4.3.0/170-x86-emit-cld.patch
patches/gcc/4.3.0/175-cross-compile.patch
patches/gcc/4.3.0/180-libiberty-pic.patch
patches/gcc/4.3.0/190-superh-default-multilib.patch
patches/gcc/4.3.0/200-libstdc++-pic.patch
patches/gcc/4.3.0/200-netbsd-symbolic.patch
patches/gcc/4.3.0/210-pr35440.patch
patches/gcc/4.3.0/220-pr24170.patch
patches/gcc/4.3.0/225-sparc64-bsd.patch
patches/gcc/4.3.0/230-noteGNUstack-00.patch
patches/gcc/4.3.0/240-noteGNUstack-01.patch
patches/gcc/4.3.0/250-flatten-switch-stmt-00.patch
patches/gcc/4.3.0/250-pr35705.patch
patches/gcc/4.3.0/260-pr34571.patch
patches/gcc/4.3.0/270-pr35982.patch
patches/gcc/4.3.0/275-x86-emit-cld.patch
patches/gcc/4.3.0/280-pr25343.patch
patches/gcc/4.3.0/290-sh-pr24836.patch
patches/gcc/4.3.0/300-ca-translation-typo.patch
patches/gcc/4.3.0/300-libiberty-pic.patch
patches/gcc/4.3.0/310-uclibc-conf-noupstream.patch
patches/gcc/4.3.0/320-uclibc-locale.patch
patches/gcc/4.3.0/325-superh-default-multilib.patch
patches/gcc/4.3.0/330-uclibc-locale-no__x.patch
patches/gcc/4.3.0/340-uclibc-locale-wchar_fix.patch
patches/gcc/4.3.0/350-libstdc++-pic.patch
patches/gcc/4.3.0/350-uclibc-locale-update.patch
patches/gcc/4.3.0/360-missing-execinfo_h.patch
patches/gcc/4.3.0/370-c99-complex-ugly-hack.patch
patches/gcc/4.3.0/375-pr35440.patch
patches/gcc/4.3.0/380-index_macro.patch
patches/gcc/4.3.0/390-libmudflap-susv3-legacy.patch
patches/gcc/4.3.0/400-libstdc++-namespace.patch
patches/gcc/4.3.0/400-pr24170.patch
patches/gcc/4.3.0/410-arm-softfloat.patch
patches/gcc/4.3.0/420-alpha-signal_h.patch
patches/gcc/4.3.0/425-noteGNUstack-00.patch
patches/gcc/4.3.0/450-noteGNUstack-01.patch
patches/gcc/4.3.0/475-pr35705.patch
patches/gcc/4.3.0/500-pr34571.patch
patches/gcc/4.3.0/525-pr35982.patch
patches/gcc/4.3.0/550-pr25343.patch
patches/gcc/4.3.0/575-sh-pr24836.patch
patches/gcc/4.3.0/600-ca-translation-typo.patch
patches/gcc/4.3.0/625-uclibc-conf-noupstream.patch
patches/gcc/4.3.0/650-uclibc-locale.patch
patches/gcc/4.3.0/675-uclibc-locale-no__x.patch
patches/gcc/4.3.0/700-uclibc-locale-wchar_fix.patch
patches/gcc/4.3.0/725-uclibc-locale-update.patch
patches/gcc/4.3.0/750-missing-execinfo_h.patch
patches/gcc/4.3.0/775-c99-complex-ugly-hack.patch
patches/gcc/4.3.0/800-index_macro.patch
patches/gcc/4.3.0/825-libmudflap-susv3-legacy.patch
patches/gcc/4.3.0/850-libstdc++-namespace.patch
patches/gcc/4.3.0/875-arm-softfloat.patch
patches/gcc/4.3.0/940-alpha-signal_h.patch
patches/gcc/4.3.1/110-trampolinewarn.patch
patches/gcc/4.3.1/120-java-nomulti.patch
patches/gcc/4.3.1/125-trampolinewarn.patch
patches/gcc/4.3.1/130-cross-compile.patch
patches/gcc/4.3.1/140-netbsd-symbolic.patch
patches/gcc/4.3.1/150-java-nomulti.patch
patches/gcc/4.3.1/150-sparc64-bsd.patch
patches/gcc/4.3.1/160-flatten-switch-stmt-00.patch
patches/gcc/4.3.1/170-libiberty-pic.patch
patches/gcc/4.3.1/175-cross-compile.patch
patches/gcc/4.3.1/180-superh-default-multilib.patch
patches/gcc/4.3.1/190-libstdc++-pic.patch
patches/gcc/4.3.1/200-netbsd-symbolic.patch
patches/gcc/4.3.1/200-pr24170.patch
patches/gcc/4.3.1/210-noteGNUstack-00.patch
patches/gcc/4.3.1/220-noteGNUstack-01.patch
patches/gcc/4.3.1/225-sparc64-bsd.patch
patches/gcc/4.3.1/230-pr34571.patch
patches/gcc/4.3.1/240-pr25343.patch
patches/gcc/4.3.1/250-flatten-switch-stmt-00.patch
patches/gcc/4.3.1/250-sh-pr24836.patch
patches/gcc/4.3.1/260-uclibc-conf-noupstream.patch
patches/gcc/4.3.1/270-uclibc-locale.patch
patches/gcc/4.3.1/275-libiberty-pic.patch
patches/gcc/4.3.1/280-uclibc-locale-no__x.patch
patches/gcc/4.3.1/290-uclibc-locale-wchar_fix.patch
patches/gcc/4.3.1/300-superh-default-multilib.patch
patches/gcc/4.3.1/300-uclibc-locale-update.patch
patches/gcc/4.3.1/310-missing-execinfo_h.patch
patches/gcc/4.3.1/320-c99-complex-ugly-hack.patch
patches/gcc/4.3.1/325-libstdc++-pic.patch
patches/gcc/4.3.1/330-index_macro.patch
patches/gcc/4.3.1/340-libmudflap-susv3-legacy.patch
patches/gcc/4.3.1/350-libstdc++-namespace.patch
patches/gcc/4.3.1/350-pr24170.patch
patches/gcc/4.3.1/360-arm-softfloat.patch
patches/gcc/4.3.1/370-alpha-signal_h.patch
patches/gcc/4.3.1/375-noteGNUstack-00.patch
patches/gcc/4.3.1/400-noteGNUstack-01.patch
patches/gcc/4.3.1/425-pr34571.patch
patches/gcc/4.3.1/450-pr25343.patch
patches/gcc/4.3.1/475-sh-pr24836.patch
patches/gcc/4.3.1/500-uclibc-conf-noupstream.patch
patches/gcc/4.3.1/525-uclibc-locale.patch
patches/gcc/4.3.1/550-uclibc-locale-no__x.patch
patches/gcc/4.3.1/575-uclibc-locale-wchar_fix.patch
patches/gcc/4.3.1/600-uclibc-locale-update.patch
patches/gcc/4.3.1/625-missing-execinfo_h.patch
patches/gcc/4.3.1/650-c99-complex-ugly-hack.patch
patches/gcc/4.3.1/675-index_macro.patch
patches/gcc/4.3.1/700-libmudflap-susv3-legacy.patch
patches/gcc/4.3.1/725-libstdc++-namespace.patch
patches/gcc/4.3.1/750-arm-softfloat.patch
patches/gcc/4.3.1/940-alpha-signal_h.patch
patches/gdb/6.4/110-uclibc-readline-conf.patch
patches/gdb/6.4/120-thread-timeout.patch
patches/gdb/6.4/130-fix-compile-flag-mismatch.patch
patches/gdb/6.4/200-uclibc-readline-conf.patch
patches/gdb/6.4/500-thread-timeout.patch
patches/gdb/6.4/600-fix-compile-flag-mismatch.patch
patches/gdb/6.5/110-uclibc-readline-conf.patch
patches/gdb/6.5/120-thread-timeout.patch
patches/gdb/6.5/130-fix-compile-flag-mismatch.patch
patches/gdb/6.5/200-uclibc-readline-conf.patch
patches/gdb/6.5/500-thread-timeout.patch
patches/gdb/6.5/600-fix-compile-flag-mismatch.patch
patches/gdb/6.6/110-fix-compile-flag-mismatch.patch
patches/gdb/6.6/600-fix-compile-flag-mismatch.patch
patches/gdb/6.7.1/100-security-errata-20050610.patch
patches/gdb/6.7.1/110-hppa-offsets.patch
patches/gdb/6.7.1/120-deleted-children.patch
patches/gdb/6.7.1/130-dwarf-stack-overflow.patch
patches/gdb/6.7.1/150-security-errata-20050610.patch
patches/gdb/6.7.1/175-hppa-offsets.patch
patches/gdb/6.7.1/200-deleted-children.patch
patches/gdb/6.7.1/225-dwarf-stack-overflow.patch
patches/gdb/6.7/110-hppa-offsets.patch
patches/gdb/6.7/120-dwarf-stack-overflow.patch
patches/gdb/6.7/125-hppa-offsets.patch
patches/gdb/6.7/150-dwarf-stack-overflow.patch
patches/gdb/6.8/110-security-errata-20050610.patch
patches/gdb/6.8/120-tdep-opcode-include-workaround.patch
patches/gdb/6.8/150-security-errata-20050610.patch
patches/gdb/6.8/200-tdep-opcode-include-workaround.patch
patches/glibc/2.3.6/195-use_short_for_fnstsw.patch
patches/glibc/2.3.6/200-fix-pr631.patch
patches/glibc/2.3.6/200-use_short_for_fnstsw.patch
patches/glibc/2.3.6/210-fix-pr631.patch
patches/glibc/2.3.6/210-fp-byteorder.patch
patches/glibc/2.3.6/220-fp-byteorder.patch
patches/glibc/2.3.6/220-mips-bootstrap-gcc-header-install.patch
patches/glibc/2.3.6/230-make-install-lib-all.patch
patches/glibc/2.3.6/230-mips-bootstrap-gcc-header-install.patch
patches/glibc/2.3.6/240-make-install-lib-all.patch
patches/glibc/2.3.6/240-weakalias.patch
patches/glibc/2.3.6/250-csu-Makefile.patch
patches/glibc/2.3.6/250-weakalias.patch
patches/glibc/2.3.6/260-alpha-asm_page.patch
patches/glibc/2.3.6/260-csu-Makefile.patch
patches/glibc/2.3.6/270-alpha-asm_elf.patch
patches/glibc/2.3.6/270-alpha-asm_page.patch
patches/glibc/2.3.6/280-alpha-asm_elf.patch
patches/glibc/2.5.1/100-cygwin.patch
patches/glibc/2.5.1/110-configure-apple-as.patch
patches/glibc/2.5.1/120-cygwin.patch
patches/glibc/2.5.1/120-fix-pr631.patch
patches/glibc/2.5.1/130-i686-assembler.patch
patches/glibc/2.5.1/140-configure-apple-as.patch
patches/glibc/2.5.1/140-i386-preferred-stack-boundary.patch
patches/glibc/2.5.1/150-alpha-asm_page.patch
patches/glibc/2.5.1/150-fix-pr631.patch
patches/glibc/2.5.1/160-i686-assembler.patch
patches/glibc/2.5.1/160-use_short_for_fnstsw.patch
patches/glibc/2.5.1/170-alpha-asm_elf.patch
patches/glibc/2.5.1/170-i386-preferred-stack-boundary.patch
patches/glibc/2.5.1/180-alpha-asm_page.patch
patches/glibc/2.5.1/180-alpha-cfi.patch
patches/glibc/2.5.1/190-alpha-sigsuspend.patch
patches/glibc/2.5.1/190-use_short_for_fnstsw.patch
patches/glibc/2.5.1/260-alpha-asm_elf.patch
patches/glibc/2.5.1/270-alpha-cfi.patch
patches/glibc/2.5.1/280-alpha-sigsuspend.patch
patches/glibc/2.5/100-cygwin.patch
patches/glibc/2.5/110-configure-apple-as.patch
patches/glibc/2.5/120-cygwin.patch
patches/glibc/2.5/120-fix-pr631.patch
patches/glibc/2.5/130-i686-assembler.patch
patches/glibc/2.5/140-configure-apple-as.patch
patches/glibc/2.5/140-i386-preferred-stack-boundary.patch
patches/glibc/2.5/150-alpha-asm_page.patch
patches/glibc/2.5/150-fix-pr631.patch
patches/glibc/2.5/160-i686-assembler.patch
patches/glibc/2.5/160-use_short_for_fnstsw.patch
patches/glibc/2.5/170-alpha-asm_elf.patch
patches/glibc/2.5/170-i386-preferred-stack-boundary.patch
patches/glibc/2.5/180-alpha-asm_page.patch
patches/glibc/2.5/180-alpha-cfi.patch
patches/glibc/2.5/190-alpha-sigsuspend.patch
patches/glibc/2.5/190-use_short_for_fnstsw.patch
patches/glibc/2.5/260-alpha-asm_elf.patch
patches/glibc/2.5/270-alpha-cfi.patch
patches/glibc/2.5/280-alpha-sigsuspend.patch
patches/glibc/2.6.1/100-cygwin.patch
patches/glibc/2.6.1/110-configure-apple-as.patch
patches/glibc/2.6.1/120-cygwin.patch
patches/glibc/2.6.1/120-fix-pr631.patch
patches/glibc/2.6.1/130-i686-assembler.patch
patches/glibc/2.6.1/140-configure-apple-as.patch
patches/glibc/2.6.1/140-i386-preferred-stack-boundary.patch
patches/glibc/2.6.1/150-alpha-asm_page.patch
patches/glibc/2.6.1/150-fix-pr631.patch
patches/glibc/2.6.1/160-i686-assembler.patch
patches/glibc/2.6.1/160-use_short_for_fnstsw.patch
patches/glibc/2.6.1/170-alpha-asm_elf.patch
patches/glibc/2.6.1/170-i386-preferred-stack-boundary.patch
patches/glibc/2.6.1/180-alpha-asm_page.patch
patches/glibc/2.6.1/190-use_short_for_fnstsw.patch
patches/glibc/2.6.1/200-alpha-asm_elf.patch
patches/glibc/2.6/100-cygwin.patch
patches/glibc/2.6/110-configure-apple-as.patch
patches/glibc/2.6/120-cygwin.patch
patches/glibc/2.6/120-fix-pr631.patch
patches/glibc/2.6/130-i686-assembler.patch
patches/glibc/2.6/140-configure-apple-as.patch
patches/glibc/2.6/140-i386-preferred-stack-boundary.patch
patches/glibc/2.6/150-alpha-asm_page.patch
patches/glibc/2.6/150-fix-pr631.patch
patches/glibc/2.6/160-i686-assembler.patch
patches/glibc/2.6/160-use_short_for_fnstsw.patch
patches/glibc/2.6/170-alpha-asm_elf.patch
patches/glibc/2.6/170-i386-preferred-stack-boundary.patch
patches/glibc/2.6/180-alpha-asm_page.patch
patches/glibc/2.6/190-use_short_for_fnstsw.patch
patches/glibc/2.6/200-alpha-asm_elf.patch
patches/glibc/2.7/100-cygwin.patch
patches/glibc/2.7/110-configure-apple-as.patch
patches/glibc/2.7/120-cygwin.patch
patches/glibc/2.7/120-fix-pr631.patch
patches/glibc/2.7/130-i686-assembler.patch
patches/glibc/2.7/140-configure-apple-as.patch
patches/glibc/2.7/140-i386-preferred-stack-boundary.patch
patches/glibc/2.7/150-alpha-asm_page.patch
patches/glibc/2.7/150-fix-pr631.patch
patches/glibc/2.7/160-build_wcs_upper_buffer.patch
patches/glibc/2.7/160-i686-assembler.patch
patches/glibc/2.7/170-i386-preferred-stack-boundary.patch
patches/glibc/2.7/170-use_short_for_fnstsw.patch
patches/glibc/2.7/180-alpha-asm_page.patch
patches/glibc/2.7/180-gcc-4.3_sysinclude_path.patch
patches/glibc/2.7/190-alpha-asm_elf.patch
patches/glibc/2.7/190-build_wcs_upper_buffer.patch
patches/glibc/2.7/200-alpha-atfcts.patch
patches/glibc/2.7/200-use_short_for_fnstsw.patch
patches/glibc/2.7/210-alpha-ptr_mangle.patch
patches/glibc/2.7/210-gcc-4.3_sysinclude_path.patch
patches/glibc/2.7/220-alpha-asm_elf.patch
patches/glibc/2.7/230-alpha-atfcts.patch
patches/glibc/2.7/240-alpha-ptr_mangle.patch
patches/glibc/linuxthreads-2.3.6/110-alpha-cfi.patch
patches/glibc/linuxthreads-2.3.6/270-alpha-cfi.patch
patches/glibc/ports-2.6.1/110-ARM-asm_page_h.patch
patches/glibc/ports-2.6.1/200-ARM-asm_page_h.patch
patches/strace/4.5.15/110-dont-use-REG_SYSCALL-for-sh.patch
patches/strace/4.5.15/120-fix-arm-bad-syscall.patch
patches/strace/4.5.15/130-fix-disabled-largefile-syscalls.patch
patches/strace/4.5.15/140-mips-sprintsigmask-fix.patch
patches/strace/4.5.15/150-dont-use-REG_SYSCALL-for-sh.patch
patches/strace/4.5.15/150-statfs64-check.patch
patches/strace/4.5.15/160-superh-update.ac.patch
patches/strace/4.5.15/170-undef-CTL_PROC.patch
patches/strace/4.5.15/180-undef-PACKET_MEMBERSHIP.patch
patches/strace/4.5.15/190-undef-syscall.patch
patches/strace/4.5.15/200-fix-arm-bad-syscall.patch
patches/strace/4.5.15/250-fix-disabled-largefile-syscalls.patch
patches/strace/4.5.15/300-mips-sprintsigmask-fix.patch
patches/strace/4.5.15/350-statfs64-check.patch
patches/strace/4.5.15/400-superh-update.ac.patch
patches/strace/4.5.15/450-undef-CTL_PROC.patch
patches/strace/4.5.15/500-undef-PACKET_MEMBERSHIP.patch
patches/strace/4.5.15/550-undef-syscall.patch
patches/strace/4.5.16/110-dont-use-REG_SYSCALL-for-sh.patch
patches/strace/4.5.16/120-fix-arm-bad-syscall.patch
patches/strace/4.5.16/130-fix-disabled-largefile-syscalls.patch
patches/strace/4.5.16/140-statfs64-check.patch
patches/strace/4.5.16/150-dont-use-REG_SYSCALL-for-sh.patch
patches/strace/4.5.16/150-superh-update.ac.patch
patches/strace/4.5.16/160-undef-CTL_PROC.patch
patches/strace/4.5.16/170-undef-PACKET_MEMBERSHIP.patch
patches/strace/4.5.16/180-undef-syscall.patch
patches/strace/4.5.16/200-fix-arm-bad-syscall.patch
patches/strace/4.5.16/250-fix-disabled-largefile-syscalls.patch
patches/strace/4.5.16/350-statfs64-check.patch
patches/strace/4.5.16/400-superh-update.ac.patch
patches/strace/4.5.16/450-undef-CTL_PROC.patch
patches/strace/4.5.16/500-undef-PACKET_MEMBERSHIP.patch
patches/strace/4.5.16/550-undef-syscall.patch
patches/uClibc/0.9.28.1/000-string-functions.patch
patches/uClibc/0.9.28.1/001-install_dev.patch
patches/uClibc/0.9.28.1/002-no_LFS-no_readahead.patch
patches/uClibc/0.9.28.1/003-time-locale.patch
patches/uClibc/0.9.28.1/004-ctype.patch
patches/uClibc/0.9.28.1/100-string-functions.patch
patches/uClibc/0.9.28.1/110-install_dev.patch
patches/uClibc/0.9.28.1/120-no_LFS-no_readahead.patch
patches/uClibc/0.9.28.1/130-time-locale.patch
patches/uClibc/0.9.28.1/140-ctype.patch
patches/uClibc/0.9.28.1/150-custom-ISA.patch
patches/uClibc/0.9.28.1/160-mips-asm.h.patch
patches/uClibc/0.9.28.1/200-custom-ISA.patch
patches/uClibc/0.9.28.1/201-mips-asm.h.patch
patches/uClibc/0.9.28.2/000-string-functions.patch
patches/uClibc/0.9.28.2/001-install_dev.patch
patches/uClibc/0.9.28.2/002-no_LFS-no_readahead.patch
patches/uClibc/0.9.28.2/004-ctype.patch
patches/uClibc/0.9.28.2/100-string-functions.patch
patches/uClibc/0.9.28.2/110-install_dev.patch
patches/uClibc/0.9.28.2/120-no_LFS-no_readahead.patch
patches/uClibc/0.9.28.2/130-ctype.patch
patches/uClibc/0.9.28.2/140-custom-ISA.patch
patches/uClibc/0.9.28.2/150-mips-asm.h.patch
patches/uClibc/0.9.28.2/200-custom-ISA.patch
patches/uClibc/0.9.28.2/201-mips-asm.h.patch
patches/uClibc/0.9.28.3/000-string-functions.patch
patches/uClibc/0.9.28.3/001-install_dev.patch
patches/uClibc/0.9.28.3/002-no_LFS-no_readahead.patch
patches/uClibc/0.9.28.3/004-ctype.patch
patches/uClibc/0.9.28.3/100-string-functions.patch
patches/uClibc/0.9.28.3/110-install_dev.patch
patches/uClibc/0.9.28.3/120-no_LFS-no_readahead.patch
patches/uClibc/0.9.28.3/130-ctype.patch
patches/uClibc/0.9.28.3/140-custom-ISA.patch
patches/uClibc/0.9.28.3/150-mips-asm.h.patch
patches/uClibc/0.9.28.3/200-custom-ISA.patch
patches/uClibc/0.9.28.3/201-mips-asm.h.patch
patches/uClibc/0.9.28/000-string-functions.patch
patches/uClibc/0.9.28/001-install_dev.patch
patches/uClibc/0.9.28/002-no_LFS-no_readahead.patch
patches/uClibc/0.9.28/004-ctype.patch
patches/uClibc/0.9.28/005-fix_includes.sh.patch
patches/uClibc/0.9.28/100-string-functions.patch
patches/uClibc/0.9.28/110-install_dev.patch
patches/uClibc/0.9.28/120-no_LFS-no_readahead.patch
patches/uClibc/0.9.28/130-ctype.patch
patches/uClibc/0.9.28/140-fix_includes.sh.patch
patches/uClibc/0.9.28/150-custom-ISA.patch
patches/uClibc/0.9.28/160-mips-asm.h.patch
patches/uClibc/0.9.28/200-custom-ISA.patch
patches/uClibc/0.9.28/201-mips-asm.h.patch
patches/uClibc/0.9.29/000-fix-mmap.patch
patches/uClibc/0.9.29/100-conditional-sched_affinity.patch
patches/uClibc/0.9.29/100-fix-mmap.patch
patches/uClibc/0.9.29/110-conditional-sched_affinity.patch
patches/uClibc/0.9.29/120-fix-internal_function-definition.patch
patches/uClibc/0.9.29/130-fix-gethostent_r-failure-retval.patch
patches/uClibc/0.9.29/140-bits_sysnum_h.patch
patches/uClibc/0.9.29/150-bits_sysnum_h2.patch
patches/uClibc/0.9.29/160-custom-ISA.patch
patches/uClibc/0.9.29/170-filter-gnu99-from-assembly-flags.patch
patches/uClibc/0.9.29/180-linuxthreads.patch
patches/uClibc/0.9.29/190-rm-whitespace.patch
patches/uClibc/0.9.29/200-fix-internal_function-definition.patch
patches/uClibc/0.9.29/300-fix-gethostent_r-failure-retval.patch
patches/uClibc/0.9.29/400-bits_sysnum_h.patch
patches/uClibc/0.9.29/401-bits_sysnum_h2.patch
patches/uClibc/0.9.29/500-custom-ISA.patch
patches/uClibc/0.9.29/600-filter-gnu99-from-assembly-flags.patch
patches/uClibc/0.9.29/700-linuxthreads.patch
patches/uClibc/0.9.29/800-rm-whitespace.patch
     1.1 --- a/patches/binutils/2.15/002-uclibc.patch	Mon Jul 28 21:08:01 2008 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,144 +0,0 @@
     1.4 -diff -uNr binutils-2.15-pristine/bfd/configure binutils-2.15/bfd/configure
     1.5 ---- binutils-2.15-pristine/bfd/configure	2004-05-17 12:35:57.000000000 -0700
     1.6 -+++ binutils-2.15/bfd/configure	2004-07-19 16:36:19.000000000 -0700
     1.7 -@@ -1009,7 +1009,7 @@
     1.8 - bfd_version_string="\"${VERSION}\""
     1.9 - if test x${is_release} = x; then
    1.10 -   bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h`
    1.11 --  bfd_version_string="\"${VERSION} ${bfd_version_date}\""
    1.12 -+  bfd_version_string="\"${VERSION} ${bfd_version_date} uClibc\""
    1.13 - fi
    1.14 - 
    1.15 - 
    1.16 -diff -uNr binutils-2.15-pristine/bfd/elf32-arm.h binutils-2.15/bfd/elf32-arm.h
    1.17 ---- binutils-2.15-pristine/bfd/elf32-arm.h	2004-05-17 12:35:58.000000000 -0700
    1.18 -+++ binutils-2.15/bfd/elf32-arm.h	2004-07-19 16:37:06.000000000 -0700
    1.19 -@@ -124,7 +124,7 @@
    1.20 - 
    1.21 - /* The name of the dynamic interpreter.  This is put in the .interp
    1.22 -    section.  */
    1.23 --#define ELF_DYNAMIC_INTERPRETER     "/usr/lib/ld.so.1"
    1.24 -+#define ELF_DYNAMIC_INTERPRETER     "/lib/ld-uClibc.so.0"
    1.25 - 
    1.26 - #ifdef FOUR_WORD_PLT
    1.27 - 
    1.28 -diff -uNr binutils-2.15-pristine/bfd/elf32-cris.c binutils-2.15/bfd/elf32-cris.c
    1.29 ---- binutils-2.15-pristine/bfd/elf32-cris.c	2004-05-17 12:35:58.000000000 -0700
    1.30 -+++ binutils-2.15/bfd/elf32-cris.c	2004-07-19 16:49:59.000000000 -0700
    1.31 -@@ -536,7 +536,7 @@
    1.32 - /* The name of the dynamic interpreter.  This is put in the .interp
    1.33 -    section.  */
    1.34 - 
    1.35 --#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
    1.36 -+#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    1.37 - 
    1.38 - /* The size in bytes of an entry in the procedure linkage table.  */
    1.39 - 
    1.40 -diff -uNr binutils-2.15-pristine/bfd/elf32-frv.c binutils-2.15/bfd/elf32-frv.c
    1.41 ---- binutils-2.15-pristine/bfd/elf32-frv.c	2004-05-17 12:35:58.000000000 -0700
    1.42 -+++ binutils-2.15/bfd/elf32-frv.c	2004-07-19 16:49:59.000000000 -0700
    1.43 -@@ -2913,7 +2913,7 @@
    1.44 - /* The name of the dynamic interpreter.  This is put in the .interp
    1.45 -    section.  */
    1.46 - 
    1.47 --#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
    1.48 -+#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    1.49 - 
    1.50 - #define DEFAULT_STACK_SIZE 0x20000
    1.51 - 
    1.52 -diff -uNr binutils-2.15-pristine/bfd/elf32-hppa.c binutils-2.15/bfd/elf32-hppa.c
    1.53 ---- binutils-2.15-pristine/bfd/elf32-hppa.c	2004-05-17 12:35:58.000000000 -0700
    1.54 -+++ binutils-2.15/bfd/elf32-hppa.c	2004-07-19 16:49:59.000000000 -0700
    1.55 -@@ -115,7 +115,7 @@
    1.56 - 
    1.57 - #define PLT_ENTRY_SIZE 8
    1.58 - #define GOT_ENTRY_SIZE 4
    1.59 --#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
    1.60 -+#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    1.61 - 
    1.62 - static const bfd_byte plt_stub[] =
    1.63 - {
    1.64 -diff -uNr binutils-2.15-pristine/bfd/elf32-ppc.c binutils-2.15/bfd/elf32-ppc.c
    1.65 ---- binutils-2.15-pristine/bfd/elf32-ppc.c	2004-05-17 12:35:59.000000000 -0700
    1.66 -+++ binutils-2.15/bfd/elf32-ppc.c	2004-07-19 16:49:59.000000000 -0700
    1.67 -@@ -49,7 +49,7 @@
    1.68 - 
    1.69 - /* The name of the dynamic interpreter.  This is put in the .interp
    1.70 -    section.  */
    1.71 --#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
    1.72 -+#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    1.73 - 
    1.74 - /* The size in bytes of an entry in the procedure linkage table.  */
    1.75 - #define PLT_ENTRY_SIZE 12
    1.76 -diff -uNr binutils-2.15-pristine/bfd/elf32-s390.c binutils-2.15/bfd/elf32-s390.c
    1.77 ---- binutils-2.15-pristine/bfd/elf32-s390.c	2004-05-17 12:35:59.000000000 -0700
    1.78 -+++ binutils-2.15/bfd/elf32-s390.c	2004-07-19 16:49:59.000000000 -0700
    1.79 -@@ -452,7 +452,7 @@
    1.80 - /* The name of the dynamic interpreter.  This is put in the .interp
    1.81 -    section.  */
    1.82 - 
    1.83 --#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
    1.84 -+#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    1.85 - 
    1.86 - /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
    1.87 -    copying dynamic variables from a shared lib into an app's dynbss
    1.88 -diff -uNr binutils-2.15-pristine/bfd/elf32-sparc.c binutils-2.15/bfd/elf32-sparc.c
    1.89 ---- binutils-2.15-pristine/bfd/elf32-sparc.c	2004-05-17 12:36:00.000000000 -0700
    1.90 -+++ binutils-2.15/bfd/elf32-sparc.c	2004-07-19 16:49:59.000000000 -0700
    1.91 -@@ -536,7 +536,7 @@
    1.92 - /* The name of the dynamic interpreter.  This is put in the .interp
    1.93 -    section.  */
    1.94 - 
    1.95 --#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
    1.96 -+#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    1.97 - 
    1.98 - /* The nop opcode we use.  */
    1.99 - 
   1.100 -diff -uNr binutils-2.15-pristine/bfd/elf64-ppc.c binutils-2.15/bfd/elf64-ppc.c
   1.101 ---- binutils-2.15-pristine/bfd/elf64-ppc.c	2004-05-17 12:36:01.000000000 -0700
   1.102 -+++ binutils-2.15/bfd/elf64-ppc.c	2004-07-19 16:49:59.000000000 -0700
   1.103 -@@ -99,7 +99,7 @@
   1.104 - 
   1.105 - /* The name of the dynamic interpreter.  This is put in the .interp
   1.106 -    section.  */
   1.107 --#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
   1.108 -+#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
   1.109 - 
   1.110 - /* The size in bytes of an entry in the procedure linkage table.  */
   1.111 - #define PLT_ENTRY_SIZE 24
   1.112 -diff -uNr binutils-2.15-pristine/bfd/elf64-s390.c binutils-2.15/bfd/elf64-s390.c
   1.113 ---- binutils-2.15-pristine/bfd/elf64-s390.c	2004-05-17 12:36:01.000000000 -0700
   1.114 -+++ binutils-2.15/bfd/elf64-s390.c	2004-07-19 16:49:59.000000000 -0700
   1.115 -@@ -473,7 +473,7 @@
   1.116 - /* The name of the dynamic interpreter.  This is put in the .interp
   1.117 -    section.  */
   1.118 - 
   1.119 --#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
   1.120 -+#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
   1.121 - 
   1.122 - /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
   1.123 -    copying dynamic variables from a shared lib into an app's dynbss
   1.124 -diff -uNr binutils-2.15-pristine/bfd/elf-m10300.c binutils-2.15/bfd/elf-m10300.c
   1.125 ---- binutils-2.15-pristine/bfd/elf-m10300.c	2004-05-17 12:35:57.000000000 -0700
   1.126 -+++ binutils-2.15/bfd/elf-m10300.c	2004-07-19 16:49:59.000000000 -0700
   1.127 -@@ -4026,7 +4026,7 @@
   1.128 - /* The name of the dynamic interpreter.  This is put in the .interp
   1.129 -    section.  */
   1.130 - 
   1.131 --#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
   1.132 -+#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
   1.133 - 
   1.134 - /* Create dynamic sections when linking against a dynamic object.  */
   1.135 - 
   1.136 -diff -uNr binutils-2.15-pristine/bfd/elfxx-ia64.c binutils-2.15/bfd/elfxx-ia64.c
   1.137 ---- binutils-2.15-pristine/bfd/elfxx-ia64.c	2004-05-17 12:36:02.000000000 -0700
   1.138 -+++ binutils-2.15/bfd/elfxx-ia64.c	2004-07-19 16:49:59.000000000 -0700
   1.139 -@@ -643,7 +643,7 @@
   1.140 -   0x60, 0x00, 0x80, 0x00               /*               br.few b6;;        */
   1.141 - };
   1.142 - 
   1.143 --#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
   1.144 -+#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
   1.145 - 
   1.146 - static const bfd_byte oor_brl[16] =
   1.147 - {
     2.1 --- a/patches/binutils/2.15/100-uclibc-conf.patch	Mon Jul 28 21:08:01 2008 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,692 +0,0 @@
     2.4 -diff -urN binutils-2.15-dist/bfd/config.bfd binutils-2.15/bfd/config.bfd
     2.5 ---- binutils-2.15-dist/bfd/config.bfd	2004-05-17 14:35:56.000000000 -0500
     2.6 -+++ binutils-2.15/bfd/config.bfd	2004-08-04 12:01:44.000000000 -0500
     2.7 -@@ -126,7 +126,7 @@
     2.8 -     targ_defvec=ecoffalpha_little_vec
     2.9 -     targ_selvecs=bfd_elf64_alpha_vec
    2.10 -     ;;
    2.11 --  alpha*-*-linux-gnu* | alpha*-*-elf*)
    2.12 -+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
    2.13 -     targ_defvec=bfd_elf64_alpha_vec
    2.14 -     targ_selvecs=ecoffalpha_little_vec
    2.15 -     ;;
    2.16 -@@ -136,7 +136,7 @@
    2.17 -   alpha*-*-*)
    2.18 -     targ_defvec=ecoffalpha_little_vec
    2.19 -     ;;
    2.20 --  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
    2.21 -+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
    2.22 -     targ_defvec=bfd_elf64_ia64_little_vec
    2.23 -     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
    2.24 -     ;;
    2.25 -@@ -213,7 +213,7 @@
    2.26 -     targ_defvec=bfd_elf32_littlearm_vec
    2.27 -     targ_selvecs=bfd_elf32_bigarm_vec
    2.28 -     ;;
    2.29 --  armeb-*-elf | arm*b-*-linux-gnu*)
    2.30 -+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
    2.31 -     targ_defvec=bfd_elf32_bigarm_vec
    2.32 -     targ_selvecs=bfd_elf32_littlearm_vec
    2.33 -     ;;
    2.34 -@@ -221,7 +221,7 @@
    2.35 -     targ_defvec=bfd_elf32_littlearm_vec
    2.36 -     targ_selvecs=bfd_elf32_bigarm_vec
    2.37 -     ;;
    2.38 --  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
    2.39 -+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
    2.40 -   arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
    2.41 -     targ_defvec=bfd_elf32_littlearm_vec
    2.42 -     targ_selvecs=bfd_elf32_bigarm_vec
    2.43 -@@ -360,7 +360,7 @@
    2.44 -     ;;
    2.45 - 
    2.46 - #ifdef BFD64
    2.47 --  hppa*64*-*-linux-gnu*)
    2.48 -+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
    2.49 -     targ_defvec=bfd_elf64_hppa_linux_vec
    2.50 -     targ_selvecs=bfd_elf64_hppa_vec
    2.51 -     ;;
    2.52 -@@ -371,7 +371,7 @@
    2.53 -     ;;
    2.54 - #endif
    2.55 - 
    2.56 --  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
    2.57 -+  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
    2.58 -     targ_defvec=bfd_elf32_hppa_linux_vec
    2.59 -     targ_selvecs=bfd_elf32_hppa_vec
    2.60 -     ;;
    2.61 -@@ -494,7 +494,7 @@
    2.62 -     targ_selvecs=bfd_elf32_i386_vec
    2.63 -     targ_underscore=yes
    2.64 -     ;;
    2.65 --  i[3-7]86-*-linux-gnu*)
    2.66 -+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
    2.67 -     targ_defvec=bfd_elf32_i386_vec
    2.68 -     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
    2.69 -     targ64_selvecs=bfd_elf64_x86_64_vec
    2.70 -@@ -508,7 +508,7 @@
    2.71 -     targ_defvec=bfd_elf64_x86_64_vec
    2.72 -     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
    2.73 -     ;;
    2.74 --  x86_64-*-linux-gnu*)
    2.75 -+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
    2.76 -     targ_defvec=bfd_elf64_x86_64_vec
    2.77 -     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
    2.78 -     ;;
    2.79 -@@ -683,7 +683,7 @@
    2.80 -     targ_selvecs=bfd_elf32_m68k_vec
    2.81 -     targ_underscore=yes
    2.82 -     ;;
    2.83 --  m68*-*-linux-gnu*)
    2.84 -+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
    2.85 -     targ_defvec=bfd_elf32_m68k_vec
    2.86 -     targ_selvecs=m68klinux_vec
    2.87 -     ;;
    2.88 -@@ -955,7 +955,8 @@
    2.89 -     ;;
    2.90 - #endif
    2.91 -   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
    2.92 --  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
    2.93 -+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
    2.94 -+  powerpc-*-rtems* | \
    2.95 -   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
    2.96 -     targ_defvec=bfd_elf32_powerpc_vec
    2.97 -     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
    2.98 -@@ -987,8 +988,8 @@
    2.99 -     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
   2.100 -     ;;
   2.101 -   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
   2.102 --  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
   2.103 --  powerpcle-*-rtems*)
   2.104 -+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
   2.105 -+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
   2.106 -     targ_defvec=bfd_elf32_powerpcle_vec
   2.107 -     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
   2.108 -     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
   2.109 -@@ -1149,7 +1150,7 @@
   2.110 -     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
   2.111 -     targ_underscore=yes
   2.112 -     ;;
   2.113 --  sparc-*-linux-gnu*)
   2.114 -+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
   2.115 -     targ_defvec=bfd_elf32_sparc_vec
   2.116 -     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
   2.117 -     ;;
   2.118 -@@ -1196,7 +1197,7 @@
   2.119 -     targ_defvec=sunos_big_vec
   2.120 -     targ_underscore=yes
   2.121 -     ;;
   2.122 --  sparc64-*-linux-gnu*)
   2.123 -+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
   2.124 -     targ_defvec=bfd_elf64_sparc_vec
   2.125 -     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
   2.126 -     ;;
   2.127 -@@ -1265,7 +1266,7 @@
   2.128 -     targ_underscore=yes
   2.129 -     ;;
   2.130 - 
   2.131 --  vax-*-linux-gnu*)
   2.132 -+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
   2.133 -     targ_defvec=bfd_elf32_vax_vec
   2.134 -     ;;
   2.135 - 
   2.136 -diff -urN binutils-2.15-dist/bfd/configure binutils-2.15/bfd/configure
   2.137 ---- binutils-2.15-dist/bfd/configure	2004-05-17 14:35:57.000000000 -0500
   2.138 -+++ binutils-2.15/bfd/configure	2004-08-04 12:01:44.000000000 -0500
   2.139 -@@ -1699,6 +1699,11 @@
   2.140 -   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   2.141 -   ;;
   2.142 - 
   2.143 -+linux-uclibc*)
   2.144 -+  lt_cv_deplibs_check_method=pass_all
   2.145 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   2.146 -+  ;;
   2.147 -+
   2.148 - netbsd*)
   2.149 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   2.150 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   2.151 -@@ -5278,7 +5283,7 @@
   2.152 -   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
   2.153 - 	COREFILE=''
   2.154 - 	;;
   2.155 --  alpha*-*-linux-gnu*)
   2.156 -+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
   2.157 - 	COREFILE=trad-core.lo
   2.158 - 	TRAD_HEADER='"hosts/alphalinux.h"'
   2.159 - 	;;
   2.160 -@@ -5338,7 +5343,7 @@
   2.161 - 	COREFILE=trad-core.lo
   2.162 - 	TRAD_HEADER='"hosts/i386mach3.h"'
   2.163 - 	;;
   2.164 --  i[3-7]86-*-linux-gnu*)
   2.165 -+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
   2.166 - 	COREFILE=trad-core.lo
   2.167 - 	TRAD_HEADER='"hosts/i386linux.h"'
   2.168 - 	;;
   2.169 -@@ -5376,7 +5381,7 @@
   2.170 - 	COREFILE=trad-core.lo
   2.171 - 	TRAD_HEADER='"hosts/hp300bsd.h"'
   2.172 - 	;;
   2.173 --  m68*-*-linux-gnu*)
   2.174 -+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
   2.175 - 	COREFILE=trad-core.lo
   2.176 - 	TRAD_HEADER='"hosts/m68klinux.h"'
   2.177 - 	;;
   2.178 -@@ -5477,7 +5482,7 @@
   2.179 - 	COREFILE=trad-core.lo
   2.180 - 	TRAD_HEADER='"hosts/vaxult2.h"'
   2.181 - 	;;
   2.182 --  vax-*-linux-gnu*)
   2.183 -+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
   2.184 - 	COREFILE=trad-core.lo
   2.185 - 	TRAD_HEADER='"hosts/vaxlinux.h"'
   2.186 - 	;;
   2.187 -diff -urN binutils-2.15-dist/bfd/configure.in binutils-2.15/bfd/configure.in
   2.188 ---- binutils-2.15-dist/bfd/configure.in	2004-05-17 14:35:57.000000000 -0500
   2.189 -+++ binutils-2.15/bfd/configure.in	2004-08-04 12:01:44.000000000 -0500
   2.190 -@@ -178,7 +178,7 @@
   2.191 -   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
   2.192 - 	COREFILE=''
   2.193 - 	;;
   2.194 --  alpha*-*-linux-gnu*)
   2.195 -+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
   2.196 - 	COREFILE=trad-core.lo
   2.197 - 	TRAD_HEADER='"hosts/alphalinux.h"'
   2.198 - 	;;
   2.199 -@@ -259,7 +259,7 @@
   2.200 - 	TRAD_HEADER='"hosts/i386mach3.h"'
   2.201 - 	;;
   2.202 - changequote(,)dnl
   2.203 --  i[3-7]86-*-linux-gnu*)
   2.204 -+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
   2.205 - changequote([,])dnl
   2.206 - 	COREFILE=trad-core.lo
   2.207 - 	TRAD_HEADER='"hosts/i386linux.h"'
   2.208 -@@ -300,7 +300,7 @@
   2.209 - 	COREFILE=trad-core.lo
   2.210 - 	TRAD_HEADER='"hosts/hp300bsd.h"'
   2.211 - 	;;
   2.212 --  m68*-*-linux-gnu*)
   2.213 -+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
   2.214 - 	COREFILE=trad-core.lo
   2.215 - 	TRAD_HEADER='"hosts/m68klinux.h"'
   2.216 - 	;;
   2.217 -@@ -385,7 +385,7 @@
   2.218 - 	COREFILE=trad-core.lo
   2.219 - 	TRAD_HEADER='"hosts/vaxult2.h"'
   2.220 - 	;;
   2.221 --  vax-*-linux-gnu*)
   2.222 -+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
   2.223 - 	COREFILE=trad-core.lo
   2.224 - 	TRAD_HEADER='"hosts/vaxlinux.h"'
   2.225 - 	;;
   2.226 -diff -urN binutils-2.15-dist/binutils/configure binutils-2.15/binutils/configure
   2.227 ---- binutils-2.15-dist/binutils/configure	2004-01-02 11:08:04.000000000 -0600
   2.228 -+++ binutils-2.15/binutils/configure	2004-08-04 12:01:44.000000000 -0500
   2.229 -@@ -1585,6 +1585,11 @@
   2.230 -   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   2.231 -   ;;
   2.232 - 
   2.233 -+linux-uclibc*)
   2.234 -+  lt_cv_deplibs_check_method=pass_all
   2.235 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   2.236 -+  ;;
   2.237 -+
   2.238 - netbsd*)
   2.239 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   2.240 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   2.241 -diff -urN binutils-2.15-dist/configure binutils-2.15/configure
   2.242 ---- binutils-2.15-dist/configure	2004-05-17 14:36:20.000000000 -0500
   2.243 -+++ binutils-2.15/configure	2004-08-04 12:01:44.000000000 -0500
   2.244 -@@ -1288,6 +1288,18 @@
   2.245 -   i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
   2.246 -     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
   2.247 -     ;;
   2.248 -+  i[3456789]86-*-linux-uclibc*)
   2.249 -+    # This section makes it possible to build newlib natively on linux.
   2.250 -+    # If we are using a cross compiler then don't configure newlib.
   2.251 -+    if test x${is_cross_compiler} != xno ; then
   2.252 -+      noconfigdirs="$noconfigdirs target-newlib"
   2.253 -+    fi
   2.254 -+    noconfigdirs="$noconfigdirs target-libgloss"
   2.255 -+    # If we are not using a cross compiler, do configure newlib.
   2.256 -+    # Note however, that newlib will only be configured in this situation
   2.257 -+    # if the --with-newlib option has been given, because otherwise
   2.258 -+    # 'target-newlib' will appear in skipdirs.
   2.259 -+    ;;
   2.260 -   i[3456789]86-*-linux*)
   2.261 -     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
   2.262 -     # not build java stuff by default.
   2.263 -diff -urN binutils-2.15-dist/configure.in binutils-2.15/configure.in
   2.264 ---- binutils-2.15-dist/configure.in	2004-05-17 14:40:54.000000000 -0500
   2.265 -+++ binutils-2.15/configure.in	2004-08-04 12:01:44.000000000 -0500
   2.266 -@@ -521,6 +521,18 @@
   2.267 -   i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
   2.268 -     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
   2.269 -     ;;
   2.270 -+  i[[3456789]]86-*-linux-uclibc*)
   2.271 -+    # This section makes it possible to build newlib natively on linux.
   2.272 -+    # If we are using a cross compiler then don't configure newlib.
   2.273 -+    if test x${is_cross_compiler} != xno ; then
   2.274 -+      noconfigdirs="$noconfigdirs target-newlib"
   2.275 -+    fi
   2.276 -+    noconfigdirs="$noconfigdirs target-libgloss"
   2.277 -+    # If we are not using a cross compiler, do configure newlib.
   2.278 -+    # Note however, that newlib will only be configured in this situation
   2.279 -+    # if the --with-newlib option has been given, because otherwise
   2.280 -+    # 'target-newlib' will appear in skipdirs.
   2.281 -+    ;;
   2.282 -   i[[3456789]]86-*-linux*)
   2.283 -     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
   2.284 -     # not build java stuff by default.
   2.285 -diff -urN binutils-2.15-dist/gas/configure binutils-2.15/gas/configure
   2.286 ---- binutils-2.15-dist/gas/configure	2004-05-17 14:36:07.000000000 -0500
   2.287 -+++ binutils-2.15/gas/configure	2004-08-04 12:07:50.000000000 -0500
   2.288 -@@ -3400,6 +3400,11 @@
   2.289 -   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   2.290 -   ;;
   2.291 - 
   2.292 -+linux-uclibc*)
   2.293 -+  lt_cv_deplibs_check_method=pass_all
   2.294 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   2.295 -+  ;;
   2.296 -+
   2.297 - netbsd*)
   2.298 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   2.299 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   2.300 -@@ -4224,6 +4229,7 @@
   2.301 -       alpha*-*-osf*)			fmt=ecoff ;;
   2.302 -       alpha*-*-linuxecoff*)		fmt=ecoff ;;
   2.303 -       alpha*-*-linux-gnu*)		fmt=elf em=linux ;;
   2.304 -+      alpha*-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.305 -       alpha*-*-netbsd*)			fmt=elf em=nbsd ;;
   2.306 -       alpha*-*-openbsd*)		fmt=elf em=obsd ;;
   2.307 - 
   2.308 -@@ -4240,6 +4246,7 @@
   2.309 -       arm*-*-conix*)			fmt=elf ;;
   2.310 -       arm-*-linux*aout*)		fmt=aout em=linux ;;
   2.311 -       arm*-*-linux-gnu*)		fmt=elf  em=linux ;;
   2.312 -+      arm*-*-linux-uclibc*)		fmt=elf  em=linux ;;
   2.313 -       arm*-*-uclinux*)			fmt=elf  em=linux ;;
   2.314 -       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
   2.315 -       arm-*-*n*bsd*)			fmt=aout em=nbsd ;;
   2.316 -@@ -4253,6 +4260,7 @@
   2.317 -       avr-*-*)				fmt=elf ;;
   2.318 - 
   2.319 -       cris-*-linux-gnu*)		fmt=multi bfd_gas=yes em=linux ;;
   2.320 -+      cris-*-linux-uclibc*)		fmt=multi bfd_gas=yes em=linux ;;
   2.321 -       cris-*-*)				fmt=multi bfd_gas=yes ;;
   2.322 - 
   2.323 -       d10v-*-*)				fmt=elf ;;
   2.324 -@@ -4310,7 +4318,9 @@
   2.325 -       i386-*-linux*oldld)		fmt=aout em=linux ;;
   2.326 -       i386-*-linux*coff*)		fmt=coff em=linux ;;
   2.327 -       i386-*-linux-gnu*)		fmt=elf em=linux ;;
   2.328 -+      i386-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.329 -       x86_64-*-linux-gnu*)		fmt=elf em=linux ;;
   2.330 -+      x86_64-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.331 -       i386-*-lynxos*)			fmt=coff em=lynx ;;
   2.332 -       i386-*-sysv[45]*)			fmt=elf ;;
   2.333 -       i386-*-solaris*)			fmt=elf ;;
   2.334 -@@ -4370,6 +4380,7 @@
   2.335 -       ia64-*-elf*)			fmt=elf ;;
   2.336 -       ia64-*-aix*)			fmt=elf em=ia64aix ;;
   2.337 -       ia64-*-linux-gnu*)		fmt=elf em=linux ;;
   2.338 -+      ia64-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.339 -       ia64-*-hpux*)			fmt=elf em=hpux ;;
   2.340 -       ia64-*-netbsd*)			fmt=elf em=nbsd ;;
   2.341 - 
   2.342 -@@ -4397,6 +4408,7 @@
   2.343 -       m68k-*-hpux*)			fmt=hp300 em=hp300 ;;
   2.344 -       m68k-*-linux*aout*)		fmt=aout em=linux ;;
   2.345 -       m68k-*-linux-gnu*)		fmt=elf em=linux ;;
   2.346 -+      m68k-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.347 -       m68k-*-uclinux*)			fmt=elf ;;
   2.348 -       m68k-*-gnu*)			fmt=elf ;;
   2.349 -       m68k-*-lynxos*)			fmt=coff em=lynx ;;
   2.350 -@@ -4459,6 +4471,7 @@
   2.351 -       ppc-*-beos*)			fmt=coff ;;
   2.352 -       ppc-*-*n*bsd* | ppc-*-elf*)	fmt=elf ;;
   2.353 -       ppc-*-eabi* | ppc-*-sysv4*)	fmt=elf ;;
   2.354 -+      ppc-*-linux-uclibc* | \
   2.355 -       ppc-*-linux-gnu*)			fmt=elf em=linux
   2.356 - 	    case "$endian" in
   2.357 - 		big)  ;;
   2.358 -@@ -4486,7 +4499,9 @@
   2.359 -       ppc-*-kaos*)			fmt=elf ;;
   2.360 - 
   2.361 -       s390x-*-linux-gnu*)		fmt=elf em=linux ;;
   2.362 -+      s390x-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.363 -       s390-*-linux-gnu*)		fmt=elf em=linux ;;
   2.364 -+      s390-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.365 - 
   2.366 -       sh*-*-linux*)			fmt=elf em=linux
   2.367 - 	    case ${cpu} in
   2.368 -@@ -4519,6 +4534,7 @@
   2.369 -       sparc-*-coff)			fmt=coff ;;
   2.370 -       sparc-*-linux*aout*)		fmt=aout em=linux ;;
   2.371 -       sparc-*-linux-gnu*)		fmt=elf em=linux ;;
   2.372 -+      sparc-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.373 -       sparc-*-lynxos*)			fmt=coff em=lynx ;;
   2.374 -       sparc-fujitsu-none)		fmt=aout ;;
   2.375 -       sparc-*-elf)			fmt=elf ;;
   2.376 -diff -urN binutils-2.15-dist/gas/configure.in binutils-2.15/gas/configure.in
   2.377 ---- binutils-2.15-dist/gas/configure.in	2004-05-17 14:36:07.000000000 -0500
   2.378 -+++ binutils-2.15/gas/configure.in	2004-08-04 12:07:21.000000000 -0500
   2.379 -@@ -194,6 +194,7 @@
   2.380 -       alpha*-*-osf*)			fmt=ecoff ;;
   2.381 -       alpha*-*-linuxecoff*)		fmt=ecoff ;;
   2.382 -       alpha*-*-linux-gnu*)		fmt=elf em=linux ;;
   2.383 -+      alpha*-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.384 -       alpha*-*-netbsd*)			fmt=elf em=nbsd ;;
   2.385 -       alpha*-*-openbsd*)		fmt=elf em=obsd ;;
   2.386 - 
   2.387 -@@ -210,6 +211,7 @@
   2.388 -       arm*-*-conix*)			fmt=elf ;;
   2.389 -       arm-*-linux*aout*)		fmt=aout em=linux ;;
   2.390 -       arm*-*-linux-gnu*)		fmt=elf  em=linux ;;
   2.391 -+      arm*-*-linux-uclibc*)		fmt=elf  em=linux ;;
   2.392 -       arm*-*-uclinux*)			fmt=elf  em=linux ;;
   2.393 -       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
   2.394 -       arm-*-*n*bsd*)			fmt=aout em=nbsd ;;
   2.395 -@@ -223,6 +225,7 @@
   2.396 -       avr-*-*)				fmt=elf ;;
   2.397 - 
   2.398 -       cris-*-linux-gnu*)		fmt=multi bfd_gas=yes em=linux ;;
   2.399 -+      cris-*-linux-uclibc*)		fmt=multi bfd_gas=yes em=linux ;;
   2.400 -       cris-*-*)				fmt=multi bfd_gas=yes ;;
   2.401 - 
   2.402 -       d10v-*-*)				fmt=elf ;;
   2.403 -@@ -280,7 +283,9 @@
   2.404 -       i386-*-linux*oldld)		fmt=aout em=linux ;;
   2.405 -       i386-*-linux*coff*)		fmt=coff em=linux ;;
   2.406 -       i386-*-linux-gnu*)		fmt=elf em=linux ;;
   2.407 -+      i386-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.408 -       x86_64-*-linux-gnu*)		fmt=elf em=linux ;;
   2.409 -+      x86_64-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.410 -       i386-*-lynxos*)			fmt=coff em=lynx ;;
   2.411 - changequote(,)dnl
   2.412 -       i386-*-sysv[45]*)			fmt=elf ;;
   2.413 -@@ -333,6 +338,7 @@
   2.414 -       ia64-*-elf*)			fmt=elf ;;
   2.415 -       ia64-*-aix*)			fmt=elf em=ia64aix ;;
   2.416 -       ia64-*-linux-gnu*)		fmt=elf em=linux ;;
   2.417 -+      ia64-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.418 -       ia64-*-hpux*)			fmt=elf em=hpux ;;
   2.419 -       ia64-*-netbsd*)			fmt=elf em=nbsd ;;
   2.420 - 
   2.421 -@@ -360,6 +366,7 @@
   2.422 -       m68k-*-hpux*)			fmt=hp300 em=hp300 ;;
   2.423 -       m68k-*-linux*aout*)		fmt=aout em=linux ;;
   2.424 -       m68k-*-linux-gnu*)		fmt=elf em=linux ;;
   2.425 -+      m68k-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.426 -       m68k-*-uclinux*)			fmt=elf ;;
   2.427 -       m68k-*-gnu*)			fmt=elf ;;
   2.428 -       m68k-*-lynxos*)			fmt=coff em=lynx ;;
   2.429 -@@ -419,6 +426,7 @@
   2.430 -       ppc-*-beos*)			fmt=coff ;;
   2.431 -       ppc-*-*n*bsd* | ppc-*-elf*)	fmt=elf ;;
   2.432 -       ppc-*-eabi* | ppc-*-sysv4*)	fmt=elf ;;
   2.433 -+      ppc-*-linux-uclibc* | \
   2.434 -       ppc-*-linux-gnu*)			fmt=elf em=linux
   2.435 - 	    case "$endian" in
   2.436 - 		big)  ;;
   2.437 -@@ -439,7 +447,9 @@
   2.438 -       ppc-*-kaos*)			fmt=elf ;;
   2.439 - 
   2.440 -       s390x-*-linux-gnu*)		fmt=elf em=linux ;;
   2.441 -+      s390x-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.442 -       s390-*-linux-gnu*)		fmt=elf em=linux ;;
   2.443 -+      s390-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.444 - 
   2.445 -       sh*-*-linux*)			fmt=elf em=linux
   2.446 - 	    case ${cpu} in
   2.447 -@@ -472,6 +482,7 @@
   2.448 -       sparc-*-coff)			fmt=coff ;;
   2.449 -       sparc-*-linux*aout*)		fmt=aout em=linux ;;
   2.450 -       sparc-*-linux-gnu*)		fmt=elf em=linux ;;
   2.451 -+      sparc-*-linux-uclibc*)		fmt=elf em=linux ;;
   2.452 -       sparc-*-lynxos*)			fmt=coff em=lynx ;;
   2.453 -       sparc-fujitsu-none)		fmt=aout ;;
   2.454 -       sparc-*-elf)			fmt=elf ;;
   2.455 -diff -urN binutils-2.15-dist/gprof/configure binutils-2.15/gprof/configure
   2.456 ---- binutils-2.15-dist/gprof/configure	2003-08-26 12:19:19.000000000 -0500
   2.457 -+++ binutils-2.15/gprof/configure	2004-08-04 12:01:45.000000000 -0500
   2.458 -@@ -1581,6 +1581,11 @@
   2.459 -   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   2.460 -   ;;
   2.461 - 
   2.462 -+linux-uclibc*)
   2.463 -+  lt_cv_deplibs_check_method=pass_all
   2.464 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   2.465 -+  ;;
   2.466 -+
   2.467 - netbsd*)
   2.468 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   2.469 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   2.470 -diff -urN binutils-2.15-dist/ld/configure binutils-2.15/ld/configure
   2.471 ---- binutils-2.15-dist/ld/configure	2003-04-24 07:36:07.000000000 -0500
   2.472 -+++ binutils-2.15/ld/configure	2004-08-04 12:01:45.000000000 -0500
   2.473 -@@ -1589,6 +1589,11 @@
   2.474 -   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   2.475 -   ;;
   2.476 - 
   2.477 -+linux-uclibc*)
   2.478 -+  lt_cv_deplibs_check_method=pass_all
   2.479 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   2.480 -+  ;;
   2.481 -+
   2.482 - netbsd*)
   2.483 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   2.484 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   2.485 -diff -urN binutils-2.15-dist/ld/configure.tgt binutils-2.15/ld/configure.tgt
   2.486 ---- binutils-2.15-dist/ld/configure.tgt	2004-05-17 14:36:15.000000000 -0500
   2.487 -+++ binutils-2.15/ld/configure.tgt	2004-08-04 12:01:45.000000000 -0500
   2.488 -@@ -30,6 +30,7 @@
   2.489 - 			targ_extra_emuls="criself crislinux"
   2.490 - 			targ_extra_libpath=$targ_extra_emuls ;;
   2.491 - cris-*-linux-gnu*)	targ_emul=crislinux ;;
   2.492 -+cris-*-linux-uclibc*)	targ_emul=crislinux ;;
   2.493 - cris-*-*)		targ_emul=criself
   2.494 - 			targ_extra_emuls="crisaout crislinux"
   2.495 - 			targ_extra_libpath=$targ_extra_emuls ;;
   2.496 -@@ -59,14 +60,16 @@
   2.497 - 			tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
   2.498 - 			tdir_sun4=sparc-sun-sunos4
   2.499 - 			;;
   2.500 --sparc64-*-linux-gnu*)	targ_emul=elf64_sparc
   2.501 -+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)	 \
   2.502 -+			targ_emul=elf64_sparc
   2.503 - 			targ_extra_emuls="elf32_sparc sparclinux sun4"
   2.504 - 			targ_extra_libpath=elf32_sparc
   2.505 - 			tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
   2.506 - 			tdir_sparclinux=${tdir_elf32_sparc}aout
   2.507 - 			tdir_sun4=sparc-sun-sunos4
   2.508 - 			;;
   2.509 --sparc*-*-linux-gnu*)	targ_emul=elf32_sparc
   2.510 -+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
   2.511 -+			targ_emul=elf32_sparc
   2.512 - 			targ_extra_emuls="sparclinux elf64_sparc sun4"
   2.513 - 			targ_extra_libpath=elf64_sparc
   2.514 - 			tdir_sparclinux=${targ_alias}aout
   2.515 -@@ -118,7 +121,9 @@
   2.516 - m32r*le-*-elf*)         targ_emul=m32rlelf ;;
   2.517 - m32r*-*-elf*)           targ_emul=m32relf ;;
   2.518 - m32r*le-*-linux-gnu*)   targ_emul=m32rlelf_linux ;;
   2.519 -+m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
   2.520 - m32r*-*-linux-gnu*)     targ_emul=m32relf_linux ;;
   2.521 -+m32r*-*-linux-uclibc*)  targ_emul=m32relf_linux ;;
   2.522 - m68hc11-*-*|m6811-*-*)	targ_emul=m68hc11elf 
   2.523 - 			targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
   2.524 - m68hc12-*-*|m6812-*-*)	targ_emul=m68hc12elf 
   2.525 -@@ -128,7 +133,7 @@
   2.526 - m68*-ericsson-ose)	targ_emul=sun3 ;;
   2.527 - m68*-apple-aux*)	targ_emul=m68kaux ;;
   2.528 - *-tandem-none)		targ_emul=st2000 ;;
   2.529 --i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
   2.530 -+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
   2.531 - i[3-7]86-*-nto-qnx*)	targ_emul=i386nto ;;
   2.532 - i[3-7]86-*-vsta)	targ_emul=vsta ;;
   2.533 - i[3-7]86-go32-rtems*)	targ_emul=i386go32 ;;
   2.534 -@@ -152,14 +157,16 @@
   2.535 - 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
   2.536 - 			;;
   2.537 - i[3-7]86-*-linux*oldld)	targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
   2.538 --i[3-7]86-*-linux-gnu*)	targ_emul=elf_i386
   2.539 -+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
   2.540 -+			targ_emul=elf_i386
   2.541 - 			targ_extra_emuls=i386linux
   2.542 - 			if test x${want64} = xtrue; then
   2.543 - 			  targ_extra_emuls="$targ_extra_emuls elf_x86_64"
   2.544 - 			fi
   2.545 - 			tdir_i386linux=${targ_alias}aout
   2.546 - 			;;
   2.547 --x86_64-*-linux-gnu*)	targ_emul=elf_x86_64
   2.548 -+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
   2.549 -+			targ_emul=elf_x86_64
   2.550 - 			targ_extra_emuls="elf_i386 i386linux"
   2.551 - 			targ_extra_libpath=elf_i386
   2.552 - 			tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
   2.553 -@@ -259,10 +266,13 @@
   2.554 - arm9e-*-elf)		targ_emul=armelf ;;
   2.555 - arm-*-oabi)		targ_emul=armelf_oabi ;;
   2.556 - arm*b-*-linux-gnu*)	targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
   2.557 -+arm*b-*-linux-uclibc*)	targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
   2.558 - arm*-*-linux-gnu*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
   2.559 -+arm*-*-linux-uclibc*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
   2.560 - arm*-*-uclinux*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
   2.561 - arm*-*-conix*)		targ_emul=armelf ;;
   2.562 --thumb-*-linux-gnu* | thumb-*-uclinux*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
   2.563 -+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
   2.564 -+			targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
   2.565 - strongarm-*-coff)	targ_emul=armcoff ;;
   2.566 - strongarm-*-elf)	targ_emul=armelf ;;
   2.567 - strongarm-*-kaos*)	targ_emul=armelf ;;
   2.568 -@@ -364,7 +374,8 @@
   2.569 - 			targ_extra_emuls=m68kelf
   2.570 - 			tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
   2.571 - 			;;
   2.572 --m68k-*-linux-gnu*)	targ_emul=m68kelf
   2.573 -+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
   2.574 -+			targ_emul=m68kelf
   2.575 - 			targ_extra_emuls=m68klinux
   2.576 - 			tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
   2.577 - 			;;
   2.578 -@@ -381,9 +392,9 @@
   2.579 - m68*-*-psos*)		targ_emul=m68kpsos ;;
   2.580 - m68*-*-rtemscoff*)	targ_emul=m68kcoff ;;
   2.581 - m68*-*-rtems*)		targ_emul=m68kelf ;;
   2.582 --hppa*64*-*-linux-gnu*)	targ_emul=hppa64linux ;;
   2.583 -+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
   2.584 - hppa*64*-*)		targ_emul=elf64hppa ;;
   2.585 --hppa*-*-linux-gnu*)	targ_emul=hppalinux ;;
   2.586 -+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)	targ_emul=hppalinux ;;
   2.587 - hppa*-*-*elf*)		targ_emul=hppaelf ;;
   2.588 - hppa*-*-lites*)		targ_emul=hppaelf ;;
   2.589 - hppa*-*-netbsd*)	targ_emul=hppanbsd ;;
   2.590 -@@ -396,6 +407,7 @@
   2.591 - 			targ_emul=vaxnbsd
   2.592 - 			targ_extra_emuls=elf32vax ;;
   2.593 - vax-*-linux-gnu*)	targ_emul=elf32vax ;;
   2.594 -+vax-*-linux-uclibc*)	targ_emul=elf32vax ;;
   2.595 - mips*-*-pe)		targ_emul=mipspe ;
   2.596 - 			targ_extra_ofiles="deffilep.o pe-dll.o" ;;
   2.597 - mips*-dec-ultrix*)	targ_emul=mipslit ;;
   2.598 -@@ -429,16 +441,16 @@
   2.599 - mips*-*-vxworks*)	targ_emul=elf32ebmip
   2.600 - 		        targ_extra_emuls="elf32elmip" ;;
   2.601 - mips*-*-windiss)	targ_emul=elf32mipswindiss ;;
   2.602 --mips64*el-*-linux-gnu*)	targ_emul=elf32ltsmipn32
   2.603 -+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)	targ_emul=elf32ltsmipn32
   2.604 - 			targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
   2.605 - 			;;
   2.606 --mips64*-*-linux-gnu*)	targ_emul=elf32btsmipn32
   2.607 -+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)	targ_emul=elf32btsmipn32
   2.608 - 			targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
   2.609 - 			;;
   2.610 --mips*el-*-linux-gnu*)	targ_emul=elf32ltsmip
   2.611 -+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)	targ_emul=elf32ltsmip
   2.612 - 			targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
   2.613 - 			;;
   2.614 --mips*-*-linux-gnu*)	targ_emul=elf32btsmip
   2.615 -+mips*-*-linux-gnu* | mips*-*-linux-uclibc*)	targ_emul=elf32btsmip
   2.616 - 			targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
   2.617 - 			;;
   2.618 - mips*-*-lnews*)		targ_emul=mipslnews ;;
   2.619 -@@ -461,6 +473,10 @@
   2.620 - alpha*-*-linux-gnu*)	targ_emul=elf64alpha targ_extra_emuls=alpha
   2.621 - 			tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
   2.622 - 			;;
   2.623 -+alpha*-*-linux-uclibc*)	targ_emul=elf64alpha targ_extra_emuls=alpha
   2.624 -+			# The following needs to be checked...
   2.625 -+			tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
   2.626 -+			;;
   2.627 - alpha*-*-osf*)		targ_emul=alpha ;;
   2.628 - alpha*-*-gnu*)		targ_emul=elf64alpha ;;
   2.629 - alpha*-*-netware*)	targ_emul=alpha ;;
   2.630 -diff -urN binutils-2.15-dist/libtool.m4 binutils-2.15/libtool.m4
   2.631 ---- binutils-2.15-dist/libtool.m4	2003-04-10 22:58:39.000000000 -0500
   2.632 -+++ binutils-2.15/libtool.m4	2004-08-04 12:01:45.000000000 -0500
   2.633 -@@ -645,6 +645,11 @@
   2.634 -   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   2.635 -   ;;
   2.636 - 
   2.637 -+linux-uclibc*)
   2.638 -+  lt_cv_deplibs_check_method=pass_all
   2.639 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   2.640 -+  ;;
   2.641 -+
   2.642 - netbsd*)
   2.643 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   2.644 -     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
   2.645 -diff -urN binutils-2.15-dist/ltconfig binutils-2.15/ltconfig
   2.646 ---- binutils-2.15-dist/ltconfig	2003-10-03 23:54:47.000000000 -0500
   2.647 -+++ binutils-2.15/ltconfig	2004-08-04 12:01:45.000000000 -0500
   2.648 -@@ -603,6 +603,7 @@
   2.649 - # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
   2.650 - case $host_os in
   2.651 - linux-gnu*) ;;
   2.652 -+linux-uclibc*) ;;
   2.653 - linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
   2.654 - esac
   2.655 - 
   2.656 -@@ -1259,6 +1260,24 @@
   2.657 -   dynamic_linker='GNU/Linux ld.so'
   2.658 -   ;;
   2.659 - 
   2.660 -+linux-uclibc*)
   2.661 -+  version_type=linux
   2.662 -+  need_lib_prefix=no
   2.663 -+  need_version=no
   2.664 -+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
   2.665 -+  soname_spec='${libname}${release}.so$major'
   2.666 -+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   2.667 -+  shlibpath_var=LD_LIBRARY_PATH
   2.668 -+  shlibpath_overrides_runpath=no
   2.669 -+  # This implies no fast_install, which is unacceptable.
   2.670 -+  # Some rework will be needed to allow for fast_install
   2.671 -+  # before this can be enabled.
   2.672 -+  # Note: copied from linux-gnu, and may not be appropriate.
   2.673 -+  hardcode_into_libs=yes
   2.674 -+  # Assume using the uClibc dynamic linker.
   2.675 -+  dynamic_linker="uClibc ld.so"
   2.676 -+  ;;
   2.677 -+
   2.678 - netbsd*)
   2.679 -   need_lib_prefix=no
   2.680 -   need_version=no
   2.681 -diff -urN binutils-2.15-dist/opcodes/configure binutils-2.15/opcodes/configure
   2.682 ---- binutils-2.15-dist/opcodes/configure	2003-08-05 04:39:31.000000000 -0500
   2.683 -+++ binutils-2.15/opcodes/configure	2004-08-04 12:01:45.000000000 -0500
   2.684 -@@ -1700,6 +1700,11 @@
   2.685 -   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   2.686 -   ;;
   2.687 - 
   2.688 -+linux-uclibc*)
   2.689 -+  lt_cv_deplibs_check_method=pass_all
   2.690 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   2.691 -+  ;;
   2.692 -+
   2.693 - netbsd*)
   2.694 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   2.695 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/patches/binutils/2.15/100-uclibc.patch	Mon Jul 28 21:32:33 2008 +0000
     3.3 @@ -0,0 +1,144 @@
     3.4 +diff -uNr binutils-2.15-pristine/bfd/configure binutils-2.15/bfd/configure
     3.5 +--- binutils-2.15-pristine/bfd/configure	2004-05-17 12:35:57.000000000 -0700
     3.6 ++++ binutils-2.15/bfd/configure	2004-07-19 16:36:19.000000000 -0700
     3.7 +@@ -1009,7 +1009,7 @@
     3.8 + bfd_version_string="\"${VERSION}\""
     3.9 + if test x${is_release} = x; then
    3.10 +   bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h`
    3.11 +-  bfd_version_string="\"${VERSION} ${bfd_version_date}\""
    3.12 ++  bfd_version_string="\"${VERSION} ${bfd_version_date} uClibc\""
    3.13 + fi
    3.14 + 
    3.15 + 
    3.16 +diff -uNr binutils-2.15-pristine/bfd/elf32-arm.h binutils-2.15/bfd/elf32-arm.h
    3.17 +--- binutils-2.15-pristine/bfd/elf32-arm.h	2004-05-17 12:35:58.000000000 -0700
    3.18 ++++ binutils-2.15/bfd/elf32-arm.h	2004-07-19 16:37:06.000000000 -0700
    3.19 +@@ -124,7 +124,7 @@
    3.20 + 
    3.21 + /* The name of the dynamic interpreter.  This is put in the .interp
    3.22 +    section.  */
    3.23 +-#define ELF_DYNAMIC_INTERPRETER     "/usr/lib/ld.so.1"
    3.24 ++#define ELF_DYNAMIC_INTERPRETER     "/lib/ld-uClibc.so.0"
    3.25 + 
    3.26 + #ifdef FOUR_WORD_PLT
    3.27 + 
    3.28 +diff -uNr binutils-2.15-pristine/bfd/elf32-cris.c binutils-2.15/bfd/elf32-cris.c
    3.29 +--- binutils-2.15-pristine/bfd/elf32-cris.c	2004-05-17 12:35:58.000000000 -0700
    3.30 ++++ binutils-2.15/bfd/elf32-cris.c	2004-07-19 16:49:59.000000000 -0700
    3.31 +@@ -536,7 +536,7 @@
    3.32 + /* The name of the dynamic interpreter.  This is put in the .interp
    3.33 +    section.  */
    3.34 + 
    3.35 +-#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
    3.36 ++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    3.37 + 
    3.38 + /* The size in bytes of an entry in the procedure linkage table.  */
    3.39 + 
    3.40 +diff -uNr binutils-2.15-pristine/bfd/elf32-frv.c binutils-2.15/bfd/elf32-frv.c
    3.41 +--- binutils-2.15-pristine/bfd/elf32-frv.c	2004-05-17 12:35:58.000000000 -0700
    3.42 ++++ binutils-2.15/bfd/elf32-frv.c	2004-07-19 16:49:59.000000000 -0700
    3.43 +@@ -2913,7 +2913,7 @@
    3.44 + /* The name of the dynamic interpreter.  This is put in the .interp
    3.45 +    section.  */
    3.46 + 
    3.47 +-#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
    3.48 ++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    3.49 + 
    3.50 + #define DEFAULT_STACK_SIZE 0x20000
    3.51 + 
    3.52 +diff -uNr binutils-2.15-pristine/bfd/elf32-hppa.c binutils-2.15/bfd/elf32-hppa.c
    3.53 +--- binutils-2.15-pristine/bfd/elf32-hppa.c	2004-05-17 12:35:58.000000000 -0700
    3.54 ++++ binutils-2.15/bfd/elf32-hppa.c	2004-07-19 16:49:59.000000000 -0700
    3.55 +@@ -115,7 +115,7 @@
    3.56 + 
    3.57 + #define PLT_ENTRY_SIZE 8
    3.58 + #define GOT_ENTRY_SIZE 4
    3.59 +-#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
    3.60 ++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    3.61 + 
    3.62 + static const bfd_byte plt_stub[] =
    3.63 + {
    3.64 +diff -uNr binutils-2.15-pristine/bfd/elf32-ppc.c binutils-2.15/bfd/elf32-ppc.c
    3.65 +--- binutils-2.15-pristine/bfd/elf32-ppc.c	2004-05-17 12:35:59.000000000 -0700
    3.66 ++++ binutils-2.15/bfd/elf32-ppc.c	2004-07-19 16:49:59.000000000 -0700
    3.67 +@@ -49,7 +49,7 @@
    3.68 + 
    3.69 + /* The name of the dynamic interpreter.  This is put in the .interp
    3.70 +    section.  */
    3.71 +-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
    3.72 ++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    3.73 + 
    3.74 + /* The size in bytes of an entry in the procedure linkage table.  */
    3.75 + #define PLT_ENTRY_SIZE 12
    3.76 +diff -uNr binutils-2.15-pristine/bfd/elf32-s390.c binutils-2.15/bfd/elf32-s390.c
    3.77 +--- binutils-2.15-pristine/bfd/elf32-s390.c	2004-05-17 12:35:59.000000000 -0700
    3.78 ++++ binutils-2.15/bfd/elf32-s390.c	2004-07-19 16:49:59.000000000 -0700
    3.79 +@@ -452,7 +452,7 @@
    3.80 + /* The name of the dynamic interpreter.  This is put in the .interp
    3.81 +    section.  */
    3.82 + 
    3.83 +-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
    3.84 ++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    3.85 + 
    3.86 + /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
    3.87 +    copying dynamic variables from a shared lib into an app's dynbss
    3.88 +diff -uNr binutils-2.15-pristine/bfd/elf32-sparc.c binutils-2.15/bfd/elf32-sparc.c
    3.89 +--- binutils-2.15-pristine/bfd/elf32-sparc.c	2004-05-17 12:36:00.000000000 -0700
    3.90 ++++ binutils-2.15/bfd/elf32-sparc.c	2004-07-19 16:49:59.000000000 -0700
    3.91 +@@ -536,7 +536,7 @@
    3.92 + /* The name of the dynamic interpreter.  This is put in the .interp
    3.93 +    section.  */
    3.94 + 
    3.95 +-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
    3.96 ++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
    3.97 + 
    3.98 + /* The nop opcode we use.  */
    3.99 + 
   3.100 +diff -uNr binutils-2.15-pristine/bfd/elf64-ppc.c binutils-2.15/bfd/elf64-ppc.c
   3.101 +--- binutils-2.15-pristine/bfd/elf64-ppc.c	2004-05-17 12:36:01.000000000 -0700
   3.102 ++++ binutils-2.15/bfd/elf64-ppc.c	2004-07-19 16:49:59.000000000 -0700
   3.103 +@@ -99,7 +99,7 @@
   3.104 + 
   3.105 + /* The name of the dynamic interpreter.  This is put in the .interp
   3.106 +    section.  */
   3.107 +-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
   3.108 ++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
   3.109 + 
   3.110 + /* The size in bytes of an entry in the procedure linkage table.  */
   3.111 + #define PLT_ENTRY_SIZE 24
   3.112 +diff -uNr binutils-2.15-pristine/bfd/elf64-s390.c binutils-2.15/bfd/elf64-s390.c
   3.113 +--- binutils-2.15-pristine/bfd/elf64-s390.c	2004-05-17 12:36:01.000000000 -0700
   3.114 ++++ binutils-2.15/bfd/elf64-s390.c	2004-07-19 16:49:59.000000000 -0700
   3.115 +@@ -473,7 +473,7 @@
   3.116 + /* The name of the dynamic interpreter.  This is put in the .interp
   3.117 +    section.  */
   3.118 + 
   3.119 +-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
   3.120 ++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
   3.121 + 
   3.122 + /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
   3.123 +    copying dynamic variables from a shared lib into an app's dynbss
   3.124 +diff -uNr binutils-2.15-pristine/bfd/elf-m10300.c binutils-2.15/bfd/elf-m10300.c
   3.125 +--- binutils-2.15-pristine/bfd/elf-m10300.c	2004-05-17 12:35:57.000000000 -0700
   3.126 ++++ binutils-2.15/bfd/elf-m10300.c	2004-07-19 16:49:59.000000000 -0700
   3.127 +@@ -4026,7 +4026,7 @@
   3.128 + /* The name of the dynamic interpreter.  This is put in the .interp
   3.129 +    section.  */
   3.130 + 
   3.131 +-#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
   3.132 ++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
   3.133 + 
   3.134 + /* Create dynamic sections when linking against a dynamic object.  */
   3.135 + 
   3.136 +diff -uNr binutils-2.15-pristine/bfd/elfxx-ia64.c binutils-2.15/bfd/elfxx-ia64.c
   3.137 +--- binutils-2.15-pristine/bfd/elfxx-ia64.c	2004-05-17 12:36:02.000000000 -0700
   3.138 ++++ binutils-2.15/bfd/elfxx-ia64.c	2004-07-19 16:49:59.000000000 -0700
   3.139 +@@ -643,7 +643,7 @@
   3.140 +   0x60, 0x00, 0x80, 0x00               /*               br.few b6;;        */
   3.141 + };
   3.142 + 
   3.143 +-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
   3.144 ++#define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0"
   3.145 + 
   3.146 + static const bfd_byte oor_brl[16] =
   3.147 + {
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/patches/binutils/2.15/110-uclibc-conf.patch	Mon Jul 28 21:32:33 2008 +0000
     4.3 @@ -0,0 +1,692 @@
     4.4 +diff -urN binutils-2.15-dist/bfd/config.bfd binutils-2.15/bfd/config.bfd
     4.5 +--- binutils-2.15-dist/bfd/config.bfd	2004-05-17 14:35:56.000000000 -0500
     4.6 ++++ binutils-2.15/bfd/config.bfd	2004-08-04 12:01:44.000000000 -0500
     4.7 +@@ -126,7 +126,7 @@
     4.8 +     targ_defvec=ecoffalpha_little_vec
     4.9 +     targ_selvecs=bfd_elf64_alpha_vec
    4.10 +     ;;
    4.11 +-  alpha*-*-linux-gnu* | alpha*-*-elf*)
    4.12 ++  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
    4.13 +     targ_defvec=bfd_elf64_alpha_vec
    4.14 +     targ_selvecs=ecoffalpha_little_vec
    4.15 +     ;;
    4.16 +@@ -136,7 +136,7 @@
    4.17 +   alpha*-*-*)
    4.18 +     targ_defvec=ecoffalpha_little_vec
    4.19 +     ;;
    4.20 +-  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
    4.21 ++  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
    4.22 +     targ_defvec=bfd_elf64_ia64_little_vec
    4.23 +     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
    4.24 +     ;;
    4.25 +@@ -213,7 +213,7 @@
    4.26 +     targ_defvec=bfd_elf32_littlearm_vec
    4.27 +     targ_selvecs=bfd_elf32_bigarm_vec
    4.28 +     ;;
    4.29 +-  armeb-*-elf | arm*b-*-linux-gnu*)
    4.30 ++  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
    4.31 +     targ_defvec=bfd_elf32_bigarm_vec
    4.32 +     targ_selvecs=bfd_elf32_littlearm_vec
    4.33 +     ;;
    4.34 +@@ -221,7 +221,7 @@
    4.35 +     targ_defvec=bfd_elf32_littlearm_vec
    4.36 +     targ_selvecs=bfd_elf32_bigarm_vec
    4.37 +     ;;
    4.38 +-  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
    4.39 ++  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
    4.40 +   arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
    4.41 +     targ_defvec=bfd_elf32_littlearm_vec
    4.42 +     targ_selvecs=bfd_elf32_bigarm_vec
    4.43 +@@ -360,7 +360,7 @@
    4.44 +     ;;
    4.45 + 
    4.46 + #ifdef BFD64
    4.47 +-  hppa*64*-*-linux-gnu*)
    4.48 ++  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
    4.49 +     targ_defvec=bfd_elf64_hppa_linux_vec
    4.50 +     targ_selvecs=bfd_elf64_hppa_vec
    4.51 +     ;;
    4.52 +@@ -371,7 +371,7 @@
    4.53 +     ;;
    4.54 + #endif
    4.55 + 
    4.56 +-  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
    4.57 ++  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
    4.58 +     targ_defvec=bfd_elf32_hppa_linux_vec
    4.59 +     targ_selvecs=bfd_elf32_hppa_vec
    4.60 +     ;;
    4.61 +@@ -494,7 +494,7 @@
    4.62 +     targ_selvecs=bfd_elf32_i386_vec
    4.63 +     targ_underscore=yes
    4.64 +     ;;
    4.65 +-  i[3-7]86-*-linux-gnu*)
    4.66 ++  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
    4.67 +     targ_defvec=bfd_elf32_i386_vec
    4.68 +     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
    4.69 +     targ64_selvecs=bfd_elf64_x86_64_vec
    4.70 +@@ -508,7 +508,7 @@
    4.71 +     targ_defvec=bfd_elf64_x86_64_vec
    4.72 +     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
    4.73 +     ;;
    4.74 +-  x86_64-*-linux-gnu*)
    4.75 ++  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
    4.76 +     targ_defvec=bfd_elf64_x86_64_vec
    4.77 +     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
    4.78 +     ;;
    4.79 +@@ -683,7 +683,7 @@
    4.80 +     targ_selvecs=bfd_elf32_m68k_vec
    4.81 +     targ_underscore=yes
    4.82 +     ;;
    4.83 +-  m68*-*-linux-gnu*)
    4.84 ++  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
    4.85 +     targ_defvec=bfd_elf32_m68k_vec
    4.86 +     targ_selvecs=m68klinux_vec
    4.87 +     ;;
    4.88 +@@ -955,7 +955,8 @@
    4.89 +     ;;
    4.90 + #endif
    4.91 +   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
    4.92 +-  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
    4.93 ++  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
    4.94 ++  powerpc-*-rtems* | \
    4.95 +   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
    4.96 +     targ_defvec=bfd_elf32_powerpc_vec
    4.97 +     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
    4.98 +@@ -987,8 +988,8 @@
    4.99 +     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
   4.100 +     ;;
   4.101 +   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
   4.102 +-  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
   4.103 +-  powerpcle-*-rtems*)
   4.104 ++  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
   4.105 ++  powerpcle-*-vxworks* | powerpcle-*-rtems*)
   4.106 +     targ_defvec=bfd_elf32_powerpcle_vec
   4.107 +     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
   4.108 +     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
   4.109 +@@ -1149,7 +1150,7 @@
   4.110 +     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
   4.111 +     targ_underscore=yes
   4.112 +     ;;
   4.113 +-  sparc-*-linux-gnu*)
   4.114 ++  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
   4.115 +     targ_defvec=bfd_elf32_sparc_vec
   4.116 +     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
   4.117 +     ;;
   4.118 +@@ -1196,7 +1197,7 @@
   4.119 +     targ_defvec=sunos_big_vec
   4.120 +     targ_underscore=yes
   4.121 +     ;;
   4.122 +-  sparc64-*-linux-gnu*)
   4.123 ++  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
   4.124 +     targ_defvec=bfd_elf64_sparc_vec
   4.125 +     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
   4.126 +     ;;
   4.127 +@@ -1265,7 +1266,7 @@
   4.128 +     targ_underscore=yes
   4.129 +     ;;
   4.130 + 
   4.131 +-  vax-*-linux-gnu*)
   4.132 ++  vax-*-linux-gnu* | vax-*-linux-uclibc*)
   4.133 +     targ_defvec=bfd_elf32_vax_vec
   4.134 +     ;;
   4.135 + 
   4.136 +diff -urN binutils-2.15-dist/bfd/configure binutils-2.15/bfd/configure
   4.137 +--- binutils-2.15-dist/bfd/configure	2004-05-17 14:35:57.000000000 -0500
   4.138 ++++ binutils-2.15/bfd/configure	2004-08-04 12:01:44.000000000 -0500
   4.139 +@@ -1699,6 +1699,11 @@
   4.140 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   4.141 +   ;;
   4.142 + 
   4.143 ++linux-uclibc*)
   4.144 ++  lt_cv_deplibs_check_method=pass_all
   4.145 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   4.146 ++  ;;
   4.147 ++
   4.148 + netbsd*)
   4.149 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   4.150 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   4.151 +@@ -5278,7 +5283,7 @@
   4.152 +   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
   4.153 + 	COREFILE=''
   4.154 + 	;;
   4.155 +-  alpha*-*-linux-gnu*)
   4.156 ++  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
   4.157 + 	COREFILE=trad-core.lo
   4.158 + 	TRAD_HEADER='"hosts/alphalinux.h"'
   4.159 + 	;;
   4.160 +@@ -5338,7 +5343,7 @@
   4.161 + 	COREFILE=trad-core.lo
   4.162 + 	TRAD_HEADER='"hosts/i386mach3.h"'
   4.163 + 	;;
   4.164 +-  i[3-7]86-*-linux-gnu*)
   4.165 ++  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
   4.166 + 	COREFILE=trad-core.lo
   4.167 + 	TRAD_HEADER='"hosts/i386linux.h"'
   4.168 + 	;;
   4.169 +@@ -5376,7 +5381,7 @@
   4.170 + 	COREFILE=trad-core.lo
   4.171 + 	TRAD_HEADER='"hosts/hp300bsd.h"'
   4.172 + 	;;
   4.173 +-  m68*-*-linux-gnu*)
   4.174 ++  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
   4.175 + 	COREFILE=trad-core.lo
   4.176 + 	TRAD_HEADER='"hosts/m68klinux.h"'
   4.177 + 	;;
   4.178 +@@ -5477,7 +5482,7 @@
   4.179 + 	COREFILE=trad-core.lo
   4.180 + 	TRAD_HEADER='"hosts/vaxult2.h"'
   4.181 + 	;;
   4.182 +-  vax-*-linux-gnu*)
   4.183 ++  vax-*-linux-gnu* | vax-*-linux-uclibc*)
   4.184 + 	COREFILE=trad-core.lo
   4.185 + 	TRAD_HEADER='"hosts/vaxlinux.h"'
   4.186 + 	;;
   4.187 +diff -urN binutils-2.15-dist/bfd/configure.in binutils-2.15/bfd/configure.in
   4.188 +--- binutils-2.15-dist/bfd/configure.in	2004-05-17 14:35:57.000000000 -0500
   4.189 ++++ binutils-2.15/bfd/configure.in	2004-08-04 12:01:44.000000000 -0500
   4.190 +@@ -178,7 +178,7 @@
   4.191 +   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
   4.192 + 	COREFILE=''
   4.193 + 	;;
   4.194 +-  alpha*-*-linux-gnu*)
   4.195 ++  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
   4.196 + 	COREFILE=trad-core.lo
   4.197 + 	TRAD_HEADER='"hosts/alphalinux.h"'
   4.198 + 	;;
   4.199 +@@ -259,7 +259,7 @@
   4.200 + 	TRAD_HEADER='"hosts/i386mach3.h"'
   4.201 + 	;;
   4.202 + changequote(,)dnl
   4.203 +-  i[3-7]86-*-linux-gnu*)
   4.204 ++  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
   4.205 + changequote([,])dnl
   4.206 + 	COREFILE=trad-core.lo
   4.207 + 	TRAD_HEADER='"hosts/i386linux.h"'
   4.208 +@@ -300,7 +300,7 @@
   4.209 + 	COREFILE=trad-core.lo
   4.210 + 	TRAD_HEADER='"hosts/hp300bsd.h"'
   4.211 + 	;;
   4.212 +-  m68*-*-linux-gnu*)
   4.213 ++  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
   4.214 + 	COREFILE=trad-core.lo
   4.215 + 	TRAD_HEADER='"hosts/m68klinux.h"'
   4.216 + 	;;
   4.217 +@@ -385,7 +385,7 @@
   4.218 + 	COREFILE=trad-core.lo
   4.219 + 	TRAD_HEADER='"hosts/vaxult2.h"'
   4.220 + 	;;
   4.221 +-  vax-*-linux-gnu*)
   4.222 ++  vax-*-linux-gnu* | vax-*-linux-uclibc*)
   4.223 + 	COREFILE=trad-core.lo
   4.224 + 	TRAD_HEADER='"hosts/vaxlinux.h"'
   4.225 + 	;;
   4.226 +diff -urN binutils-2.15-dist/binutils/configure binutils-2.15/binutils/configure
   4.227 +--- binutils-2.15-dist/binutils/configure	2004-01-02 11:08:04.000000000 -0600
   4.228 ++++ binutils-2.15/binutils/configure	2004-08-04 12:01:44.000000000 -0500
   4.229 +@@ -1585,6 +1585,11 @@
   4.230 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   4.231 +   ;;
   4.232 + 
   4.233 ++linux-uclibc*)
   4.234 ++  lt_cv_deplibs_check_method=pass_all
   4.235 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   4.236 ++  ;;
   4.237 ++
   4.238 + netbsd*)
   4.239 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   4.240 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   4.241 +diff -urN binutils-2.15-dist/configure binutils-2.15/configure
   4.242 +--- binutils-2.15-dist/configure	2004-05-17 14:36:20.000000000 -0500
   4.243 ++++ binutils-2.15/configure	2004-08-04 12:01:44.000000000 -0500
   4.244 +@@ -1288,6 +1288,18 @@
   4.245 +   i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
   4.246 +     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
   4.247 +     ;;
   4.248 ++  i[3456789]86-*-linux-uclibc*)
   4.249 ++    # This section makes it possible to build newlib natively on linux.
   4.250 ++    # If we are using a cross compiler then don't configure newlib.
   4.251 ++    if test x${is_cross_compiler} != xno ; then
   4.252 ++      noconfigdirs="$noconfigdirs target-newlib"
   4.253 ++    fi
   4.254 ++    noconfigdirs="$noconfigdirs target-libgloss"
   4.255 ++    # If we are not using a cross compiler, do configure newlib.
   4.256 ++    # Note however, that newlib will only be configured in this situation
   4.257 ++    # if the --with-newlib option has been given, because otherwise
   4.258 ++    # 'target-newlib' will appear in skipdirs.
   4.259 ++    ;;
   4.260 +   i[3456789]86-*-linux*)
   4.261 +     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
   4.262 +     # not build java stuff by default.
   4.263 +diff -urN binutils-2.15-dist/configure.in binutils-2.15/configure.in
   4.264 +--- binutils-2.15-dist/configure.in	2004-05-17 14:40:54.000000000 -0500
   4.265 ++++ binutils-2.15/configure.in	2004-08-04 12:01:44.000000000 -0500
   4.266 +@@ -521,6 +521,18 @@
   4.267 +   i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
   4.268 +     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
   4.269 +     ;;
   4.270 ++  i[[3456789]]86-*-linux-uclibc*)
   4.271 ++    # This section makes it possible to build newlib natively on linux.
   4.272 ++    # If we are using a cross compiler then don't configure newlib.
   4.273 ++    if test x${is_cross_compiler} != xno ; then
   4.274 ++      noconfigdirs="$noconfigdirs target-newlib"
   4.275 ++    fi
   4.276 ++    noconfigdirs="$noconfigdirs target-libgloss"
   4.277 ++    # If we are not using a cross compiler, do configure newlib.
   4.278 ++    # Note however, that newlib will only be configured in this situation
   4.279 ++    # if the --with-newlib option has been given, because otherwise
   4.280 ++    # 'target-newlib' will appear in skipdirs.
   4.281 ++    ;;
   4.282 +   i[[3456789]]86-*-linux*)
   4.283 +     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
   4.284 +     # not build java stuff by default.
   4.285 +diff -urN binutils-2.15-dist/gas/configure binutils-2.15/gas/configure
   4.286 +--- binutils-2.15-dist/gas/configure	2004-05-17 14:36:07.000000000 -0500
   4.287 ++++ binutils-2.15/gas/configure	2004-08-04 12:07:50.000000000 -0500
   4.288 +@@ -3400,6 +3400,11 @@
   4.289 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   4.290 +   ;;
   4.291 + 
   4.292 ++linux-uclibc*)
   4.293 ++  lt_cv_deplibs_check_method=pass_all
   4.294 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   4.295 ++  ;;
   4.296 ++
   4.297 + netbsd*)
   4.298 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   4.299 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   4.300 +@@ -4224,6 +4229,7 @@
   4.301 +       alpha*-*-osf*)			fmt=ecoff ;;
   4.302 +       alpha*-*-linuxecoff*)		fmt=ecoff ;;
   4.303 +       alpha*-*-linux-gnu*)		fmt=elf em=linux ;;
   4.304 ++      alpha*-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.305 +       alpha*-*-netbsd*)			fmt=elf em=nbsd ;;
   4.306 +       alpha*-*-openbsd*)		fmt=elf em=obsd ;;
   4.307 + 
   4.308 +@@ -4240,6 +4246,7 @@
   4.309 +       arm*-*-conix*)			fmt=elf ;;
   4.310 +       arm-*-linux*aout*)		fmt=aout em=linux ;;
   4.311 +       arm*-*-linux-gnu*)		fmt=elf  em=linux ;;
   4.312 ++      arm*-*-linux-uclibc*)		fmt=elf  em=linux ;;
   4.313 +       arm*-*-uclinux*)			fmt=elf  em=linux ;;
   4.314 +       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
   4.315 +       arm-*-*n*bsd*)			fmt=aout em=nbsd ;;
   4.316 +@@ -4253,6 +4260,7 @@
   4.317 +       avr-*-*)				fmt=elf ;;
   4.318 + 
   4.319 +       cris-*-linux-gnu*)		fmt=multi bfd_gas=yes em=linux ;;
   4.320 ++      cris-*-linux-uclibc*)		fmt=multi bfd_gas=yes em=linux ;;
   4.321 +       cris-*-*)				fmt=multi bfd_gas=yes ;;
   4.322 + 
   4.323 +       d10v-*-*)				fmt=elf ;;
   4.324 +@@ -4310,7 +4318,9 @@
   4.325 +       i386-*-linux*oldld)		fmt=aout em=linux ;;
   4.326 +       i386-*-linux*coff*)		fmt=coff em=linux ;;
   4.327 +       i386-*-linux-gnu*)		fmt=elf em=linux ;;
   4.328 ++      i386-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.329 +       x86_64-*-linux-gnu*)		fmt=elf em=linux ;;
   4.330 ++      x86_64-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.331 +       i386-*-lynxos*)			fmt=coff em=lynx ;;
   4.332 +       i386-*-sysv[45]*)			fmt=elf ;;
   4.333 +       i386-*-solaris*)			fmt=elf ;;
   4.334 +@@ -4370,6 +4380,7 @@
   4.335 +       ia64-*-elf*)			fmt=elf ;;
   4.336 +       ia64-*-aix*)			fmt=elf em=ia64aix ;;
   4.337 +       ia64-*-linux-gnu*)		fmt=elf em=linux ;;
   4.338 ++      ia64-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.339 +       ia64-*-hpux*)			fmt=elf em=hpux ;;
   4.340 +       ia64-*-netbsd*)			fmt=elf em=nbsd ;;
   4.341 + 
   4.342 +@@ -4397,6 +4408,7 @@
   4.343 +       m68k-*-hpux*)			fmt=hp300 em=hp300 ;;
   4.344 +       m68k-*-linux*aout*)		fmt=aout em=linux ;;
   4.345 +       m68k-*-linux-gnu*)		fmt=elf em=linux ;;
   4.346 ++      m68k-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.347 +       m68k-*-uclinux*)			fmt=elf ;;
   4.348 +       m68k-*-gnu*)			fmt=elf ;;
   4.349 +       m68k-*-lynxos*)			fmt=coff em=lynx ;;
   4.350 +@@ -4459,6 +4471,7 @@
   4.351 +       ppc-*-beos*)			fmt=coff ;;
   4.352 +       ppc-*-*n*bsd* | ppc-*-elf*)	fmt=elf ;;
   4.353 +       ppc-*-eabi* | ppc-*-sysv4*)	fmt=elf ;;
   4.354 ++      ppc-*-linux-uclibc* | \
   4.355 +       ppc-*-linux-gnu*)			fmt=elf em=linux
   4.356 + 	    case "$endian" in
   4.357 + 		big)  ;;
   4.358 +@@ -4486,7 +4499,9 @@
   4.359 +       ppc-*-kaos*)			fmt=elf ;;
   4.360 + 
   4.361 +       s390x-*-linux-gnu*)		fmt=elf em=linux ;;
   4.362 ++      s390x-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.363 +       s390-*-linux-gnu*)		fmt=elf em=linux ;;
   4.364 ++      s390-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.365 + 
   4.366 +       sh*-*-linux*)			fmt=elf em=linux
   4.367 + 	    case ${cpu} in
   4.368 +@@ -4519,6 +4534,7 @@
   4.369 +       sparc-*-coff)			fmt=coff ;;
   4.370 +       sparc-*-linux*aout*)		fmt=aout em=linux ;;
   4.371 +       sparc-*-linux-gnu*)		fmt=elf em=linux ;;
   4.372 ++      sparc-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.373 +       sparc-*-lynxos*)			fmt=coff em=lynx ;;
   4.374 +       sparc-fujitsu-none)		fmt=aout ;;
   4.375 +       sparc-*-elf)			fmt=elf ;;
   4.376 +diff -urN binutils-2.15-dist/gas/configure.in binutils-2.15/gas/configure.in
   4.377 +--- binutils-2.15-dist/gas/configure.in	2004-05-17 14:36:07.000000000 -0500
   4.378 ++++ binutils-2.15/gas/configure.in	2004-08-04 12:07:21.000000000 -0500
   4.379 +@@ -194,6 +194,7 @@
   4.380 +       alpha*-*-osf*)			fmt=ecoff ;;
   4.381 +       alpha*-*-linuxecoff*)		fmt=ecoff ;;
   4.382 +       alpha*-*-linux-gnu*)		fmt=elf em=linux ;;
   4.383 ++      alpha*-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.384 +       alpha*-*-netbsd*)			fmt=elf em=nbsd ;;
   4.385 +       alpha*-*-openbsd*)		fmt=elf em=obsd ;;
   4.386 + 
   4.387 +@@ -210,6 +211,7 @@
   4.388 +       arm*-*-conix*)			fmt=elf ;;
   4.389 +       arm-*-linux*aout*)		fmt=aout em=linux ;;
   4.390 +       arm*-*-linux-gnu*)		fmt=elf  em=linux ;;
   4.391 ++      arm*-*-linux-uclibc*)		fmt=elf  em=linux ;;
   4.392 +       arm*-*-uclinux*)			fmt=elf  em=linux ;;
   4.393 +       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
   4.394 +       arm-*-*n*bsd*)			fmt=aout em=nbsd ;;
   4.395 +@@ -223,6 +225,7 @@
   4.396 +       avr-*-*)				fmt=elf ;;
   4.397 + 
   4.398 +       cris-*-linux-gnu*)		fmt=multi bfd_gas=yes em=linux ;;
   4.399 ++      cris-*-linux-uclibc*)		fmt=multi bfd_gas=yes em=linux ;;
   4.400 +       cris-*-*)				fmt=multi bfd_gas=yes ;;
   4.401 + 
   4.402 +       d10v-*-*)				fmt=elf ;;
   4.403 +@@ -280,7 +283,9 @@
   4.404 +       i386-*-linux*oldld)		fmt=aout em=linux ;;
   4.405 +       i386-*-linux*coff*)		fmt=coff em=linux ;;
   4.406 +       i386-*-linux-gnu*)		fmt=elf em=linux ;;
   4.407 ++      i386-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.408 +       x86_64-*-linux-gnu*)		fmt=elf em=linux ;;
   4.409 ++      x86_64-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.410 +       i386-*-lynxos*)			fmt=coff em=lynx ;;
   4.411 + changequote(,)dnl
   4.412 +       i386-*-sysv[45]*)			fmt=elf ;;
   4.413 +@@ -333,6 +338,7 @@
   4.414 +       ia64-*-elf*)			fmt=elf ;;
   4.415 +       ia64-*-aix*)			fmt=elf em=ia64aix ;;
   4.416 +       ia64-*-linux-gnu*)		fmt=elf em=linux ;;
   4.417 ++      ia64-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.418 +       ia64-*-hpux*)			fmt=elf em=hpux ;;
   4.419 +       ia64-*-netbsd*)			fmt=elf em=nbsd ;;
   4.420 + 
   4.421 +@@ -360,6 +366,7 @@
   4.422 +       m68k-*-hpux*)			fmt=hp300 em=hp300 ;;
   4.423 +       m68k-*-linux*aout*)		fmt=aout em=linux ;;
   4.424 +       m68k-*-linux-gnu*)		fmt=elf em=linux ;;
   4.425 ++      m68k-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.426 +       m68k-*-uclinux*)			fmt=elf ;;
   4.427 +       m68k-*-gnu*)			fmt=elf ;;
   4.428 +       m68k-*-lynxos*)			fmt=coff em=lynx ;;
   4.429 +@@ -419,6 +426,7 @@
   4.430 +       ppc-*-beos*)			fmt=coff ;;
   4.431 +       ppc-*-*n*bsd* | ppc-*-elf*)	fmt=elf ;;
   4.432 +       ppc-*-eabi* | ppc-*-sysv4*)	fmt=elf ;;
   4.433 ++      ppc-*-linux-uclibc* | \
   4.434 +       ppc-*-linux-gnu*)			fmt=elf em=linux
   4.435 + 	    case "$endian" in
   4.436 + 		big)  ;;
   4.437 +@@ -439,7 +447,9 @@
   4.438 +       ppc-*-kaos*)			fmt=elf ;;
   4.439 + 
   4.440 +       s390x-*-linux-gnu*)		fmt=elf em=linux ;;
   4.441 ++      s390x-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.442 +       s390-*-linux-gnu*)		fmt=elf em=linux ;;
   4.443 ++      s390-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.444 + 
   4.445 +       sh*-*-linux*)			fmt=elf em=linux
   4.446 + 	    case ${cpu} in
   4.447 +@@ -472,6 +482,7 @@
   4.448 +       sparc-*-coff)			fmt=coff ;;
   4.449 +       sparc-*-linux*aout*)		fmt=aout em=linux ;;
   4.450 +       sparc-*-linux-gnu*)		fmt=elf em=linux ;;
   4.451 ++      sparc-*-linux-uclibc*)		fmt=elf em=linux ;;
   4.452 +       sparc-*-lynxos*)			fmt=coff em=lynx ;;
   4.453 +       sparc-fujitsu-none)		fmt=aout ;;
   4.454 +       sparc-*-elf)			fmt=elf ;;
   4.455 +diff -urN binutils-2.15-dist/gprof/configure binutils-2.15/gprof/configure
   4.456 +--- binutils-2.15-dist/gprof/configure	2003-08-26 12:19:19.000000000 -0500
   4.457 ++++ binutils-2.15/gprof/configure	2004-08-04 12:01:45.000000000 -0500
   4.458 +@@ -1581,6 +1581,11 @@
   4.459 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   4.460 +   ;;
   4.461 + 
   4.462 ++linux-uclibc*)
   4.463 ++  lt_cv_deplibs_check_method=pass_all
   4.464 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   4.465 ++  ;;
   4.466 ++
   4.467 + netbsd*)
   4.468 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   4.469 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   4.470 +diff -urN binutils-2.15-dist/ld/configure binutils-2.15/ld/configure
   4.471 +--- binutils-2.15-dist/ld/configure	2003-04-24 07:36:07.000000000 -0500
   4.472 ++++ binutils-2.15/ld/configure	2004-08-04 12:01:45.000000000 -0500
   4.473 +@@ -1589,6 +1589,11 @@
   4.474 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   4.475 +   ;;
   4.476 + 
   4.477 ++linux-uclibc*)
   4.478 ++  lt_cv_deplibs_check_method=pass_all
   4.479 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   4.480 ++  ;;
   4.481 ++
   4.482 + netbsd*)
   4.483 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   4.484 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   4.485 +diff -urN binutils-2.15-dist/ld/configure.tgt binutils-2.15/ld/configure.tgt
   4.486 +--- binutils-2.15-dist/ld/configure.tgt	2004-05-17 14:36:15.000000000 -0500
   4.487 ++++ binutils-2.15/ld/configure.tgt	2004-08-04 12:01:45.000000000 -0500
   4.488 +@@ -30,6 +30,7 @@
   4.489 + 			targ_extra_emuls="criself crislinux"
   4.490 + 			targ_extra_libpath=$targ_extra_emuls ;;
   4.491 + cris-*-linux-gnu*)	targ_emul=crislinux ;;
   4.492 ++cris-*-linux-uclibc*)	targ_emul=crislinux ;;
   4.493 + cris-*-*)		targ_emul=criself
   4.494 + 			targ_extra_emuls="crisaout crislinux"
   4.495 + 			targ_extra_libpath=$targ_extra_emuls ;;
   4.496 +@@ -59,14 +60,16 @@
   4.497 + 			tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
   4.498 + 			tdir_sun4=sparc-sun-sunos4
   4.499 + 			;;
   4.500 +-sparc64-*-linux-gnu*)	targ_emul=elf64_sparc
   4.501 ++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)	 \
   4.502 ++			targ_emul=elf64_sparc
   4.503 + 			targ_extra_emuls="elf32_sparc sparclinux sun4"
   4.504 + 			targ_extra_libpath=elf32_sparc
   4.505 + 			tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
   4.506 + 			tdir_sparclinux=${tdir_elf32_sparc}aout
   4.507 + 			tdir_sun4=sparc-sun-sunos4
   4.508 + 			;;
   4.509 +-sparc*-*-linux-gnu*)	targ_emul=elf32_sparc
   4.510 ++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
   4.511 ++			targ_emul=elf32_sparc
   4.512 + 			targ_extra_emuls="sparclinux elf64_sparc sun4"
   4.513 + 			targ_extra_libpath=elf64_sparc
   4.514 + 			tdir_sparclinux=${targ_alias}aout
   4.515 +@@ -118,7 +121,9 @@
   4.516 + m32r*le-*-elf*)         targ_emul=m32rlelf ;;
   4.517 + m32r*-*-elf*)           targ_emul=m32relf ;;
   4.518 + m32r*le-*-linux-gnu*)   targ_emul=m32rlelf_linux ;;
   4.519 ++m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
   4.520 + m32r*-*-linux-gnu*)     targ_emul=m32relf_linux ;;
   4.521 ++m32r*-*-linux-uclibc*)  targ_emul=m32relf_linux ;;
   4.522 + m68hc11-*-*|m6811-*-*)	targ_emul=m68hc11elf 
   4.523 + 			targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
   4.524 + m68hc12-*-*|m6812-*-*)	targ_emul=m68hc12elf 
   4.525 +@@ -128,7 +133,7 @@
   4.526 + m68*-ericsson-ose)	targ_emul=sun3 ;;
   4.527 + m68*-apple-aux*)	targ_emul=m68kaux ;;
   4.528 + *-tandem-none)		targ_emul=st2000 ;;
   4.529 +-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
   4.530 ++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
   4.531 + i[3-7]86-*-nto-qnx*)	targ_emul=i386nto ;;
   4.532 + i[3-7]86-*-vsta)	targ_emul=vsta ;;
   4.533 + i[3-7]86-go32-rtems*)	targ_emul=i386go32 ;;
   4.534 +@@ -152,14 +157,16 @@
   4.535 + 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
   4.536 + 			;;
   4.537 + i[3-7]86-*-linux*oldld)	targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
   4.538 +-i[3-7]86-*-linux-gnu*)	targ_emul=elf_i386
   4.539 ++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
   4.540 ++			targ_emul=elf_i386
   4.541 + 			targ_extra_emuls=i386linux
   4.542 + 			if test x${want64} = xtrue; then
   4.543 + 			  targ_extra_emuls="$targ_extra_emuls elf_x86_64"
   4.544 + 			fi
   4.545 + 			tdir_i386linux=${targ_alias}aout
   4.546 + 			;;
   4.547 +-x86_64-*-linux-gnu*)	targ_emul=elf_x86_64
   4.548 ++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
   4.549 ++			targ_emul=elf_x86_64
   4.550 + 			targ_extra_emuls="elf_i386 i386linux"
   4.551 + 			targ_extra_libpath=elf_i386
   4.552 + 			tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
   4.553 +@@ -259,10 +266,13 @@
   4.554 + arm9e-*-elf)		targ_emul=armelf ;;
   4.555 + arm-*-oabi)		targ_emul=armelf_oabi ;;
   4.556 + arm*b-*-linux-gnu*)	targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
   4.557 ++arm*b-*-linux-uclibc*)	targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
   4.558 + arm*-*-linux-gnu*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
   4.559 ++arm*-*-linux-uclibc*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
   4.560 + arm*-*-uclinux*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
   4.561 + arm*-*-conix*)		targ_emul=armelf ;;
   4.562 +-thumb-*-linux-gnu* | thumb-*-uclinux*)	targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
   4.563 ++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
   4.564 ++			targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
   4.565 + strongarm-*-coff)	targ_emul=armcoff ;;
   4.566 + strongarm-*-elf)	targ_emul=armelf ;;
   4.567 + strongarm-*-kaos*)	targ_emul=armelf ;;
   4.568 +@@ -364,7 +374,8 @@
   4.569 + 			targ_extra_emuls=m68kelf
   4.570 + 			tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
   4.571 + 			;;
   4.572 +-m68k-*-linux-gnu*)	targ_emul=m68kelf
   4.573 ++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
   4.574 ++			targ_emul=m68kelf
   4.575 + 			targ_extra_emuls=m68klinux
   4.576 + 			tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
   4.577 + 			;;
   4.578 +@@ -381,9 +392,9 @@
   4.579 + m68*-*-psos*)		targ_emul=m68kpsos ;;
   4.580 + m68*-*-rtemscoff*)	targ_emul=m68kcoff ;;
   4.581 + m68*-*-rtems*)		targ_emul=m68kelf ;;
   4.582 +-hppa*64*-*-linux-gnu*)	targ_emul=hppa64linux ;;
   4.583 ++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
   4.584 + hppa*64*-*)		targ_emul=elf64hppa ;;
   4.585 +-hppa*-*-linux-gnu*)	targ_emul=hppalinux ;;
   4.586 ++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)	targ_emul=hppalinux ;;
   4.587 + hppa*-*-*elf*)		targ_emul=hppaelf ;;
   4.588 + hppa*-*-lites*)		targ_emul=hppaelf ;;
   4.589 + hppa*-*-netbsd*)	targ_emul=hppanbsd ;;
   4.590 +@@ -396,6 +407,7 @@
   4.591 + 			targ_emul=vaxnbsd
   4.592 + 			targ_extra_emuls=elf32vax ;;
   4.593 + vax-*-linux-gnu*)	targ_emul=elf32vax ;;
   4.594 ++vax-*-linux-uclibc*)	targ_emul=elf32vax ;;
   4.595 + mips*-*-pe)		targ_emul=mipspe ;
   4.596 + 			targ_extra_ofiles="deffilep.o pe-dll.o" ;;
   4.597 + mips*-dec-ultrix*)	targ_emul=mipslit ;;
   4.598 +@@ -429,16 +441,16 @@
   4.599 + mips*-*-vxworks*)	targ_emul=elf32ebmip
   4.600 + 		        targ_extra_emuls="elf32elmip" ;;
   4.601 + mips*-*-windiss)	targ_emul=elf32mipswindiss ;;
   4.602 +-mips64*el-*-linux-gnu*)	targ_emul=elf32ltsmipn32
   4.603 ++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)	targ_emul=elf32ltsmipn32
   4.604 + 			targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
   4.605 + 			;;
   4.606 +-mips64*-*-linux-gnu*)	targ_emul=elf32btsmipn32
   4.607 ++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)	targ_emul=elf32btsmipn32
   4.608 + 			targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
   4.609 + 			;;
   4.610 +-mips*el-*-linux-gnu*)	targ_emul=elf32ltsmip
   4.611 ++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)	targ_emul=elf32ltsmip
   4.612 + 			targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
   4.613 + 			;;
   4.614 +-mips*-*-linux-gnu*)	targ_emul=elf32btsmip
   4.615 ++mips*-*-linux-gnu* | mips*-*-linux-uclibc*)	targ_emul=elf32btsmip
   4.616 + 			targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
   4.617 + 			;;
   4.618 + mips*-*-lnews*)		targ_emul=mipslnews ;;
   4.619 +@@ -461,6 +473,10 @@
   4.620 + alpha*-*-linux-gnu*)	targ_emul=elf64alpha targ_extra_emuls=alpha
   4.621 + 			tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
   4.622 + 			;;
   4.623 ++alpha*-*-linux-uclibc*)	targ_emul=elf64alpha targ_extra_emuls=alpha
   4.624 ++			# The following needs to be checked...
   4.625 ++			tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
   4.626 ++			;;
   4.627 + alpha*-*-osf*)		targ_emul=alpha ;;
   4.628 + alpha*-*-gnu*)		targ_emul=elf64alpha ;;
   4.629 + alpha*-*-netware*)	targ_emul=alpha ;;
   4.630 +diff -urN binutils-2.15-dist/libtool.m4 binutils-2.15/libtool.m4
   4.631 +--- binutils-2.15-dist/libtool.m4	2003-04-10 22:58:39.000000000 -0500
   4.632 ++++ binutils-2.15/libtool.m4	2004-08-04 12:01:45.000000000 -0500
   4.633 +@@ -645,6 +645,11 @@
   4.634 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   4.635 +   ;;
   4.636 + 
   4.637 ++linux-uclibc*)
   4.638 ++  lt_cv_deplibs_check_method=pass_all
   4.639 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   4.640 ++  ;;
   4.641 ++
   4.642 + netbsd*)
   4.643 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   4.644 +     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
   4.645 +diff -urN binutils-2.15-dist/ltconfig binutils-2.15/ltconfig
   4.646 +--- binutils-2.15-dist/ltconfig	2003-10-03 23:54:47.000000000 -0500
   4.647 ++++ binutils-2.15/ltconfig	2004-08-04 12:01:45.000000000 -0500
   4.648 +@@ -603,6 +603,7 @@
   4.649 + # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
   4.650 + case $host_os in
   4.651 + linux-gnu*) ;;
   4.652 ++linux-uclibc*) ;;
   4.653 + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
   4.654 + esac
   4.655 + 
   4.656 +@@ -1259,6 +1260,24 @@
   4.657 +   dynamic_linker='GNU/Linux ld.so'
   4.658 +   ;;
   4.659 + 
   4.660 ++linux-uclibc*)
   4.661 ++  version_type=linux
   4.662 ++  need_lib_prefix=no
   4.663 ++  need_version=no
   4.664 ++  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
   4.665 ++  soname_spec='${libname}${release}.so$major'
   4.666 ++  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   4.667 ++  shlibpath_var=LD_LIBRARY_PATH
   4.668 ++  shlibpath_overrides_runpath=no
   4.669 ++  # This implies no fast_install, which is unacceptable.
   4.670 ++  # Some rework will be needed to allow for fast_install
   4.671 ++  # before this can be enabled.
   4.672 ++  # Note: copied from linux-gnu, and may not be appropriate.
   4.673 ++  hardcode_into_libs=yes
   4.674 ++  # Assume using the uClibc dynamic linker.
   4.675 ++  dynamic_linker="uClibc ld.so"
   4.676 ++  ;;
   4.677 ++
   4.678 + netbsd*)
   4.679 +   need_lib_prefix=no
   4.680 +   need_version=no
   4.681 +diff -urN binutils-2.15-dist/opcodes/configure binutils-2.15/opcodes/configure
   4.682 +--- binutils-2.15-dist/opcodes/configure	2003-08-05 04:39:31.000000000 -0500
   4.683 ++++ binutils-2.15/opcodes/configure	2004-08-04 12:01:45.000000000 -0500
   4.684 +@@ -1700,6 +1700,11 @@
   4.685 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   4.686 +   ;;
   4.687 + 
   4.688 ++linux-uclibc*)
   4.689 ++  lt_cv_deplibs_check_method=pass_all
   4.690 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   4.691 ++  ;;
   4.692 ++
   4.693 + netbsd*)
   4.694 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   4.695 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/patches/binutils/2.15/120-cflags.patch	Mon Jul 28 21:32:33 2008 +0000
     5.3 @@ -0,0 +1,32 @@
     5.4 +diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.am binutils-2.14.90.0.6.new/bfd/doc/Makefile.am
     5.5 +--- binutils-2.14.90.0.6/bfd/doc/Makefile.am	2003-07-23 10:08:09.000000000 -0500
     5.6 ++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.am	2004-03-01 16:05:16.000000000 -0600
     5.7 +@@ -55,10 +55,10 @@
     5.8 + MKDOC = chew$(EXEEXT_FOR_BUILD)
     5.9 + 
    5.10 + $(MKDOC): chew.o
    5.11 +-	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
    5.12 ++	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
    5.13 + 
    5.14 + chew.o: chew.c
    5.15 +-	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
    5.16 ++	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
    5.17 + 
    5.18 + protos: libbfd.h libcoff.h bfd.h
    5.19 + 
    5.20 +diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.in binutils-2.14.90.0.6.new/bfd/doc/Makefile.in
    5.21 +--- binutils-2.14.90.0.6/bfd/doc/Makefile.in	2003-07-23 10:08:09.000000000 -0500
    5.22 ++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.in	2004-03-01 16:05:03.000000000 -0600
    5.23 +@@ -469,10 +469,10 @@
    5.24 + 
    5.25 + 
    5.26 + $(MKDOC): chew.o
    5.27 +-	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
    5.28 ++	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
    5.29 + 
    5.30 + chew.o: chew.c
    5.31 +-	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
    5.32 ++	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
    5.33 + 
    5.34 + protos: libbfd.h libcoff.h bfd.h
    5.35 + 
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/patches/binutils/2.15/130-mips-ELF_MAXPAGESIZE-4K.patch	Mon Jul 28 21:32:33 2008 +0000
     6.3 @@ -0,0 +1,26 @@
     6.4 +--- binutils/bfd/elf32-mips.c~
     6.5 ++++ binutils/bfd/elf32-mips.c
     6.6 +@@ -1611,7 +1611,9 @@
     6.7 + 
     6.8 + /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
     6.9 +    page sizes of up to that limit, so we need to respect it.  */
    6.10 +-#define ELF_MAXPAGESIZE			0x10000
    6.11 ++/*#define ELF_MAXPAGESIZE			0x10000*/
    6.12 ++/* Use 4K to shrink the elf header.  NOT for general use! */
    6.13 ++#define ELF_MAXPAGESIZE			0x1000
    6.14 + #define elf32_bed			elf32_tradbed
    6.15 + 
    6.16 + /* Include the target file again for this target.  */
    6.17 +--- binutils/bfd/elfn32-mips.c~
    6.18 ++++ binutils/bfd/elfn32-mips.c
    6.19 +@@ -1976,7 +1976,9 @@
    6.20 + 
    6.21 + /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
    6.22 +    page sizes of up to that limit, so we need to respect it.  */
    6.23 +-#define ELF_MAXPAGESIZE			0x10000
    6.24 ++/*#define ELF_MAXPAGESIZE			0x10000*/
    6.25 ++/* Use 4K to shrink the elf header.  NOT for general use! */
    6.26 ++#define ELF_MAXPAGESIZE			0x1000
    6.27 + #define elf32_bed			elf32_tradbed
    6.28 + 
    6.29 + /* Include the target file again for this target.  */
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/patches/binutils/2.15/140-arm-textrel.patch	Mon Jul 28 21:32:33 2008 +0000
     7.3 @@ -0,0 +1,63 @@
     7.4 +http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
     7.5 +--- binutils-2.15.90.0.3-old/bfd/elf32-arm.h	2004-04-12 14:56:33.000000000 -0500
     7.6 ++++ binutils-2.15.90.0.3/bfd/elf32-arm.h	2004-09-03 06:56:40.000000000 -0500
     7.7 +@@ -87,6 +87,8 @@
     7.8 + #endif
     7.9 + static bfd_boolean allocate_dynrelocs 
    7.10 +   PARAMS ((struct elf_link_hash_entry *h, PTR inf));
    7.11 ++static bfd_boolean elf32_arm_readonly_dynrelocs
    7.12 ++  PARAMS ((struct elf_link_hash_entry *, PTR));
    7.13 + static bfd_boolean create_got_section 
    7.14 +   PARAMS ((bfd * dynobj, struct bfd_link_info * info));
    7.15 + static bfd_boolean elf32_arm_create_dynamic_sections 
    7.16 +@@ -3531,6 +3533,37 @@
    7.17 +   return TRUE;
    7.18 + }
    7.19 + 
    7.20 ++/* Find any dynamic relocs that apply to read-only sections.  */
    7.21 ++
    7.22 ++static bfd_boolean
    7.23 ++elf32_arm_readonly_dynrelocs (h, inf)
    7.24 ++     struct elf_link_hash_entry *h;
    7.25 ++     PTR inf;
    7.26 ++{
    7.27 ++  struct elf32_arm_link_hash_entry *eh;
    7.28 ++  struct elf32_arm_relocs_copied *p;
    7.29 ++
    7.30 ++  if (h->root.type == bfd_link_hash_warning)
    7.31 ++    h = (struct elf_link_hash_entry *) h->root.u.i.link;
    7.32 ++
    7.33 ++  eh = (struct elf32_arm_link_hash_entry *) h;
    7.34 ++  for (p = eh->relocs_copied; p != NULL; p = p->next)
    7.35 ++    {
    7.36 ++      asection *s = p->section;
    7.37 ++
    7.38 ++      if (s != NULL && (s->flags & SEC_READONLY) != 0)
    7.39 ++       {
    7.40 ++         struct bfd_link_info *info = (struct bfd_link_info *) inf;
    7.41 ++
    7.42 ++         info->flags |= DF_TEXTREL;
    7.43 ++
    7.44 ++         /* Not an error, just cut short the traversal.  */
    7.45 ++         return FALSE;
    7.46 ++       }
    7.47 ++    }
    7.48 ++  return TRUE;
    7.49 ++}
    7.50 ++
    7.51 + /* Set the sizes of the dynamic sections.  */
    7.52 + 
    7.53 + static bfd_boolean
    7.54 +@@ -3740,6 +3773,12 @@
    7.55 + 	    return FALSE;
    7.56 + 	}
    7.57 + 
    7.58 ++      /* If any dynamic relocs apply to a read-only section,
    7.59 ++         then we need a DT_TEXTREL entry.  */
    7.60 ++      if ((info->flags & DF_TEXTREL) == 0)
    7.61 ++        elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
    7.62 ++                                (PTR) info);
    7.63 ++
    7.64 +       if ((info->flags & DF_TEXTREL) != 0)
    7.65 + 	{
    7.66 + 	  if (!add_dynamic_entry (DT_TEXTREL, 0))
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/patches/binutils/2.15/150-bfd-hash-tweak.patch	Mon Jul 28 21:32:33 2008 +0000
     8.3 @@ -0,0 +1,24 @@
     8.4 +Signed-off-by: dank@kegel.com
     8.5 +
     8.6 +Raising the size of the hash table is a noticable win when linking 
     8.7 +at least one large app.  
     8.8 +
     8.9 +There was a patch,
    8.10 +http://sources.redhat.com/ml/binutils/2004-06/msg00165.html
    8.11 +to do this dynamically.  No idea why that didn't make it in.
    8.12 +So this tiny change to raise the default size is just
    8.13 +a stopgap for now.
    8.14 +
    8.15 +
    8.16 +--- binutils-2.15/bfd/hash.c.old	2003-12-01 01:33:01.000000000 -0500
    8.17 ++++ binutils-2.15/bfd/hash.c	2006-03-01 16:26:26.701991000 -0500
    8.18 +@@ -295,7 +295,7 @@
    8.19 + */
    8.20 + 
    8.21 + /* The default number of entries to use when creating a hash table.  */
    8.22 +-#define DEFAULT_SIZE (4051)
    8.23 ++#define DEFAULT_SIZE (32749)
    8.24 + 
    8.25 + /* Create a new hash table, given a number of entries.  */
    8.26 + 
    8.27 +
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/patches/binutils/2.15/160-allow-gcc-4.0.patch	Mon Jul 28 21:32:33 2008 +0000
     9.3 @@ -0,0 +1,75 @@
     9.4 +Fix found here: http://www.freelists.org/archives/openbeos/11-2005/msg00090.html
     9.5 +
     9.6 +Fixes:
     9.7 +In file included from ./targ-cpu.h:1,
     9.8 +                 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,
     9.9 +                 from ./obj-format.h:1,
    9.10 +                 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,
    9.11 +                 from ./targ-env.h:1,
    9.12 +                 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,
    9.13 +                 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:
    9.14 +/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
    9.15 +make[3]: *** [app.o] Error 1
    9.16 +make[3]: Leaving directory `/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/build-binutils/gas'
    9.17 +
    9.18 +when building binutils-2.15 with gcc-4.0
    9.19 +
    9.20 +
    9.21 +diff -ur binutils-2.15.old/gas/as.h binutils-2.15/gas/as.h
    9.22 +--- binutils-2.15.old/gas/as.h	2003-11-22 18:14:21.000000000 -0800
    9.23 ++++ binutils-2.15/gas/as.h	2006-02-14 22:05:35.000000000 -0800
    9.24 +@@ -605,7 +605,26 @@
    9.25 + struct expressionS;
    9.26 + struct fix;
    9.27 + typedef struct symbol symbolS;
    9.28 +-struct relax_type;
    9.29 ++
    9.30 ++/* JF moved this here from as.h under the theory that nobody except MACHINE.c
    9.31 ++   and write.c care about it anyway.  */
    9.32 ++/* [zooey]: the above no longer holds with gcc4, as it keeps bugging about
    9.33 ++            incomplete element types in arrays, if relax_type isn't defined
    9.34 ++            here. So I moved the definition back from tc.h to here. */
    9.35 ++struct relax_type
    9.36 ++{
    9.37 ++  /* Forward reach. Signed number. > 0.  */
    9.38 ++  long rlx_forward;
    9.39 ++  /* Backward reach. Signed number. < 0.  */
    9.40 ++  long rlx_backward;
    9.41 ++
    9.42 ++  /* Bytes length of this address.  */
    9.43 ++  unsigned char rlx_length;
    9.44 ++
    9.45 ++  /* Next longer relax-state.  0 means there is no 'next' relax-state.  */
    9.46 ++  relax_substateT rlx_more;
    9.47 ++};
    9.48 ++
    9.49 + typedef struct frag fragS;
    9.50 + 
    9.51 + #ifdef BFD_ASSEMBLER
    9.52 +diff -ur binutils-2.15.old/gas/tc.h binutils-2.15/gas/tc.h
    9.53 +--- binutils-2.15.old/gas/tc.h	2003-12-03 15:39:38.000000000 -0800
    9.54 ++++ binutils-2.15/gas/tc.h	2006-02-14 22:03:35.000000000 -0800
    9.55 +@@ -24,23 +24,6 @@
    9.56 + 
    9.57 + extern const pseudo_typeS md_pseudo_table[];
    9.58 + 
    9.59 +-/* JF moved this here from as.h under the theory that nobody except MACHINE.c
    9.60 +-   and write.c care about it anyway.  */
    9.61 +-
    9.62 +-struct relax_type
    9.63 +-{
    9.64 +-  /* Forward reach. Signed number. > 0.  */
    9.65 +-  long rlx_forward;
    9.66 +-  /* Backward reach. Signed number. < 0.  */
    9.67 +-  long rlx_backward;
    9.68 +-
    9.69 +-  /* Bytes length of this address.  */
    9.70 +-  unsigned char rlx_length;
    9.71 +-
    9.72 +-  /* Next longer relax-state.  0 means there is no 'next' relax-state.  */
    9.73 +-  relax_substateT rlx_more;
    9.74 +-};
    9.75 +-
    9.76 + typedef struct relax_type relax_typeS;
    9.77 + 
    9.78 + extern const int md_reloc_size;	/* Size of a relocation record */
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/patches/binutils/2.15/170-psignal.patch	Mon Jul 28 21:32:33 2008 +0000
    10.3 @@ -0,0 +1,40 @@
    10.4 +Make psignal prototype in libiberty match that in glibc.
    10.5 +
    10.6 +Fixes:
    10.7 +
    10.8 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
    10.9 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
   10.10 +/usr/include/signal.h:131: prototype declaration
   10.11 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
   10.12 +/usr/include/signal.h:131: prototype declaration
   10.13 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
   10.14 +mprotect... make[1]: *** [strsignal.o] Error 1
   10.15 +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'
   10.16 +make: *** [all-libiberty] Error 2
   10.17 +
   10.18 +when building on red hat 7.1
   10.19 +though it's a bit of a mystery why libiberty's psignal is being compiled at
   10.20 +all, since red hat 7.1's glibc supports psignal (hence the error message)
   10.21 +
   10.22 +--- binutils-2.15/libiberty/strsignal.c.old	2005-04-18 13:57:40.000000000 -0700
   10.23 ++++ binutils-2.15/libiberty/strsignal.c	2005-04-18 13:59:09.000000000 -0700
   10.24 +@@ -544,7 +544,7 @@
   10.25 + 
   10.26 + /*
   10.27 + 
   10.28 +-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
   10.29 ++@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
   10.30 + 
   10.31 + Print @var{message} to the standard error, followed by a colon,
   10.32 + followed by the description of the signal specified by @var{signo},
   10.33 +@@ -557,9 +557,7 @@
   10.34 + #ifndef HAVE_PSIGNAL
   10.35 + 
   10.36 + void
   10.37 +-psignal (signo, message)
   10.38 +-  unsigned signo;
   10.39 +-  char *message;
   10.40 ++psignal (int signo, const char *message)
   10.41 + {
   10.42 +   if (signal_names == NULL)
   10.43 +     {
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/patches/binutils/2.15/180-solaris-qsort.patch	Mon Jul 28 21:32:33 2008 +0000
    11.3 @@ -0,0 +1,22 @@
    11.4 +See http://sources.redhat.com/ml/binutils/2004-06/msg00114.html
    11.5 +
    11.6 +--- src/bfd/elflink.c.org	2004-07-05 09:11:42.920597000 -0400
    11.7 ++++ src/bfd/elflink.c	2004-07-05 09:12:59.240847000 -0400
    11.8 +@@ -2700,7 +2700,7 @@
    11.9 +     return vdiff > 0 ? 1 : -1;
   11.10 +   else
   11.11 +     {
   11.12 +-      long sdiff = h1->root.u.def.section - h2->root.u.def.section;
   11.13 ++      long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;
   11.14 +       if (sdiff != 0)
   11.15 + 	return sdiff > 0 ? 1 : -1;
   11.16 +     }
   11.17 +@@ -3954,7 +3954,7 @@
   11.18 + 		i = idx + 1;
   11.19 + 	      else
   11.20 + 		{
   11.21 +-		  long sdiff = slook - h->root.u.def.section;
   11.22 ++		  long sdiff = slook->id - h->root.u.def.section->id;
   11.23 + 		  if (sdiff < 0)
   11.24 + 		    j = idx;
   11.25 + 		  else if (sdiff > 0)
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/patches/binutils/2.15/190-vmx.patch	Mon Jul 28 21:32:33 2008 +0000
    12.3 @@ -0,0 +1,45 @@
    12.4 +Grabbed with
    12.5 +wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/ppc-opc.c.diff?r1=1.70&r2=1.71&cvsroot=src'
    12.6 +See 
    12.7 +http://mail.gnu.org/archive/html/bug-binutils/2004-05/msg00071.html
    12.8 +and
    12.9 +http://sources.redhat.com/ml/binutils-cvs/2004-05/msg00111.html
   12.10 +
   12.11 +This fixes problems like
   12.12 +{standard input}: Assembler messages:
   12.13 +{standard input}:1: Error: Unrecognized opcode: `dssall' 
   12.14 +which show up in binutils-2.15 when building the Linux kernel,
   12.15 +or possibly failed compilations when building setjmp/longjmp in glibc.
   12.16 +
   12.17 +An alternative fix would be to pass -many to the assembler.
   12.18 +A patch to do that for glibc is at
   12.19 +wget 'http://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2004-05&msgid=40B36E8C.9030609%40us.ibm.com'
   12.20 +Yet another, better, fix would be for gcc to generate assembly
   12.21 +that told the assembler which processor type to use.
   12.22 +Presumably the Linux kernel sources would need a fix, too.
   12.23 +Probably better to just fix binutils to accept sources that it used to.
   12.24 +
   12.25 +
   12.26 +===================================================================
   12.27 +RCS file: /cvs/src/src/opcodes/ppc-opc.c,v
   12.28 +retrieving revision 1.70
   12.29 +retrieving revision 1.71
   12.30 +diff -u -r1.70 -r1.71
   12.31 +--- src/opcodes/ppc-opc.c	2004/05/05 13:43:36	1.70
   12.32 ++++ src/opcodes/ppc-opc.c	2004/05/19 05:11:48	1.71
   12.33 +@@ -1004,8 +1004,13 @@
   12.34 + 
   12.35 +   /* If only one bit of the FXM field is set, we can use the new form
   12.36 +      of the instruction, which is faster.  Unlike the Power4 branch hint
   12.37 +-     encoding, this is not backward compatible.  */
   12.38 +-  else if ((dialect & PPC_OPCODE_POWER4) != 0 && (value & -value) == value)
   12.39 ++     encoding, this is not backward compatible.  Do not generate the
   12.40 ++     new form unless -mpower4 has been given, or -many and the two
   12.41 ++     operand form of mfcr was used.  */
   12.42 ++  else if ((value & -value) == value
   12.43 ++	   && ((dialect & PPC_OPCODE_POWER4) != 0
   12.44 ++	       || ((dialect & PPC_OPCODE_ANY) != 0
   12.45 ++		   && (insn & (0x3ff << 1)) == 19 << 1)))
   12.46 +     insn |= 1 << 20;
   12.47 + 
   12.48 +   /* Any other value on mfcr is an error.  */
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/patches/binutils/2.15/200-arm-undef-imm.patch	Mon Jul 28 21:32:33 2008 +0000
    13.3 @@ -0,0 +1,51 @@
    13.4 +From http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/config/tc-arm.c.diff?r1=1.168&r2=1.169&cvsroot=src
    13.5 +See also http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-July/023128.html,
    13.6 +"[CRITICAL PATCH] 2.6: fix silent build error]"
    13.7 +
    13.8 +Revision 1.169, Fri Jul 2 11:12:29 2004 UTC (19 hours, 4 minutes ago) by nickc
    13.9 +Branch: MAIN
   13.10 +CVS Tags: binutils_latest_snapshot, HEAD
   13.11 +Changes since 1.168: +14 -1 lines
   13.12 +
   13.13 +(md_apply_fix3:BFD_RELOC_ARM_IMMEDIATE): Do not allow values which have come
   13.14 +from undefined symbols.
   13.15 +Always consider this fixup to have been processed as a reloc cannot be
   13.16 +generated for it.
   13.17 +
   13.18 +
   13.19 +===================================================================
   13.20 +RCS file: /cvs/src/src/gas/config/tc-arm.c,v
   13.21 +retrieving revision 1.168
   13.22 +retrieving revision 1.169
   13.23 +diff -u -r1.168 -r1.169
   13.24 +--- src/gas/config/tc-arm.c	2004/04/30 10:51:12	1.168
   13.25 ++++ src/gas/config/tc-arm.c	2004/07/02 11:12:29	1.169
   13.26 +@@ -12186,6 +12186,20 @@
   13.27 +   switch (fixP->fx_r_type)
   13.28 +     {
   13.29 +     case BFD_RELOC_ARM_IMMEDIATE:
   13.30 ++      /* We claim that this fixup has been processed here,
   13.31 ++	 even if in fact we generate an error because we do
   13.32 ++	 not have a reloc for it, so tc_gen_reloc will reject it.  */
   13.33 ++      fixP->fx_done = 1;
   13.34 ++
   13.35 ++      if (fixP->fx_addsy
   13.36 ++	  && ! S_IS_DEFINED (fixP->fx_addsy))
   13.37 ++	{
   13.38 ++	  as_bad_where (fixP->fx_file, fixP->fx_line,
   13.39 ++			_("undefined symbol %s used as an immediate value"),
   13.40 ++			S_GET_NAME (fixP->fx_addsy));
   13.41 ++	  break;
   13.42 ++	}
   13.43 ++
   13.44 +       newimm = validate_immediate (value);
   13.45 +       temp = md_chars_to_number (buf, INSN_SIZE);
   13.46 + 
   13.47 +@@ -12202,7 +12216,6 @@
   13.48 + 
   13.49 +       newimm |= (temp & 0xfffff000);
   13.50 +       md_number_to_chars (buf, (valueT) newimm, INSN_SIZE);
   13.51 +-      fixP->fx_done = 1;
   13.52 +       break;
   13.53 + 
   13.54 +     case BFD_RELOC_ARM_ADRL_IMMEDIATE:
    14.1 --- a/patches/binutils/2.15/210-cflags.patch	Mon Jul 28 21:08:01 2008 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,32 +0,0 @@
    14.4 -diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.am binutils-2.14.90.0.6.new/bfd/doc/Makefile.am
    14.5 ---- binutils-2.14.90.0.6/bfd/doc/Makefile.am	2003-07-23 10:08:09.000000000 -0500
    14.6 -+++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.am	2004-03-01 16:05:16.000000000 -0600
    14.7 -@@ -55,10 +55,10 @@
    14.8 - MKDOC = chew$(EXEEXT_FOR_BUILD)
    14.9 - 
   14.10 - $(MKDOC): chew.o
   14.11 --	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
   14.12 -+	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
   14.13 - 
   14.14 - chew.o: chew.c
   14.15 --	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
   14.16 -+	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
   14.17 - 
   14.18 - protos: libbfd.h libcoff.h bfd.h
   14.19 - 
   14.20 -diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.in binutils-2.14.90.0.6.new/bfd/doc/Makefile.in
   14.21 ---- binutils-2.14.90.0.6/bfd/doc/Makefile.in	2003-07-23 10:08:09.000000000 -0500
   14.22 -+++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.in	2004-03-01 16:05:03.000000000 -0600
   14.23 -@@ -469,10 +469,10 @@
   14.24 - 
   14.25 - 
   14.26 - $(MKDOC): chew.o
   14.27 --	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
   14.28 -+	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
   14.29 - 
   14.30 - chew.o: chew.c
   14.31 --	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
   14.32 -+	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
   14.33 - 
   14.34 - protos: libbfd.h libcoff.h bfd.h
   14.35 - 
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/patches/binutils/2.15/210-skip-comments.patch	Mon Jul 28 21:32:33 2008 +0000
    15.3 @@ -0,0 +1,101 @@
    15.4 +Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
    15.5 +Fixes
    15.6 +localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
    15.7 +when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
    15.8 +
    15.9 +Paths adjusted to match crosstool's patcher.
   15.10 +
   15.11 +Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
   15.12 +From: Andreas Schwab <schwab at suse dot de>
   15.13 +To: Nathan Sidwell <nathan at codesourcery dot com>
   15.14 +Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
   15.15 +Date: Fri, 23 Apr 2004 22:27:19 +0200
   15.16 +Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
   15.17 +
   15.18 +Nathan Sidwell <nathan@codesourcery.com> writes:
   15.19 +
   15.20 +> Index: read.c
   15.21 +> ===================================================================
   15.22 +> RCS file: /cvs/src/src/gas/read.c,v
   15.23 +> retrieving revision 1.76
   15.24 +> diff -c -3 -p -r1.76 read.c
   15.25 +> *** read.c	12 Mar 2004 17:48:12 -0000	1.76
   15.26 +> --- read.c	18 Mar 2004 09:56:05 -0000
   15.27 +> *************** read_a_source_file (char *name)
   15.28 +> *** 1053,1059 ****
   15.29 +>   #endif
   15.30 +>   	  input_line_pointer--;
   15.31 +>   	  /* Report unknown char as ignored.  */
   15.32 +> ! 	  ignore_rest_of_line ();
   15.33 +>   	}
   15.34 +>   
   15.35 +>   #ifdef md_after_pass_hook
   15.36 +> --- 1053,1059 ----
   15.37 +>   #endif
   15.38 +>   	  input_line_pointer--;
   15.39 +>   	  /* Report unknown char as ignored.  */
   15.40 +> ! 	  demand_empty_rest_of_line ();
   15.41 +>   	}
   15.42 +>   
   15.43 +>   #ifdef md_after_pass_hook
   15.44 +
   15.45 +This means that the unknown character is no longer ignored, despite the
   15.46 +comment.  As a side effect a line starting with a line comment character
   15.47 +not followed by APP in NO_APP mode now triggers an error instead of just a
   15.48 +warning, breaking builds of glibc on m68k-linux.  Earlier in
   15.49 +read_a_source_file where #APP is handled there is another comment that
   15.50 +claims that unknown comments are ignored, when in fact they aren't (only
   15.51 +the initial line comment character is skipped).
   15.52 +
   15.53 +Note that the presence of #APP will mess up the line counters, but
   15.54 +that appears to be difficult to fix.
   15.55 +
   15.56 +Andreas.
   15.57 +
   15.58 +2004-04-23  Andreas Schwab  <schwab@suse.de>
   15.59 +
   15.60 +	* read.c (read_a_source_file): Ignore unknown text after line
   15.61 +	comment character.  Fix misleading comment.
   15.62 +
   15.63 +--- binutils/gas/read.c.~1.78.~	2004-04-23 08:58:23.000000000 +0200
   15.64 ++++ binutils/gas/read.c	2004-04-23 21:49:01.000000000 +0200
   15.65 +@@ -1,6 +1,6 @@
   15.66 + /* read.c - read a source file -
   15.67 +    Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
   15.68 +-   1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
   15.69 ++   1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
   15.70 + 
   15.71 + This file is part of GAS, the GNU Assembler.
   15.72 + 
   15.73 +@@ -950,10 +950,14 @@ read_a_source_file (char *name)
   15.74 + 	      unsigned int new_length;
   15.75 + 	      char *tmp_buf = 0;
   15.76 + 
   15.77 +-	      bump_line_counters ();
   15.78 + 	      s = input_line_pointer;
   15.79 + 	      if (strncmp (s, "APP\n", 4))
   15.80 +-		continue;	/* We ignore it */
   15.81 ++		{
   15.82 ++		  /* We ignore it */
   15.83 ++		  ignore_rest_of_line ();
   15.84 ++		  continue;
   15.85 ++		}
   15.86 ++	      bump_line_counters ();
   15.87 + 	      s += 4;
   15.88 + 
   15.89 + 	      sb_new (&sbuf);
   15.90 +@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
   15.91 + 	    continue;
   15.92 + #endif
   15.93 + 	  input_line_pointer--;
   15.94 +-	  /* Report unknown char as ignored.  */
   15.95 ++	  /* Report unknown char as error.  */
   15.96 + 	  demand_empty_rest_of_line ();
   15.97 + 	}
   15.98 + 
   15.99 +
  15.100 +-- 
  15.101 +Andreas Schwab, SuSE Labs, schwab@suse.de
  15.102 +SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
  15.103 +Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
  15.104 +"And now for something completely different."
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/patches/binutils/2.15/220-cross-gprof.patch	Mon Jul 28 21:32:33 2008 +0000
    16.3 @@ -0,0 +1,22 @@
    16.4 +--- binutils-2.15/configure.old	2004-07-21 21:36:47.000000000 -0700
    16.5 ++++ binutils-2.15/configure	2004-07-21 21:37:08.000000000 -0700
    16.6 +@@ -999,7 +999,7 @@
    16.7 + 
    16.8 + # Some tools are only suitable for building in a "native" situation.
    16.9 + # Remove these if host!=target.  
   16.10 +-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"
   16.11 ++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"
   16.12 + 
   16.13 + # Similarly, some are only suitable for cross toolchains.
   16.14 + # Remove these if host=target.
   16.15 +--- binutils-2.15/configure.in.old	2004-07-21 21:37:19.000000000 -0700
   16.16 ++++ binutils-2.15/configure.in	2004-07-21 21:37:34.000000000 -0700
   16.17 +@@ -236,7 +236,7 @@
   16.18 + 
   16.19 + # Some tools are only suitable for building in a "native" situation.
   16.20 + # Remove these if host!=target.  
   16.21 +-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"
   16.22 ++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"
   16.23 + 
   16.24 + # Similarly, some are only suitable for cross toolchains.
   16.25 + # Remove these if host=target.
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/patches/binutils/2.15/230-gccpr15247-fix.patch	Mon Jul 28 21:32:33 2008 +0000
    17.3 @@ -0,0 +1,192 @@
    17.4 +See
    17.5 +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15247
    17.6 +
    17.7 +Fixes spurious error
    17.8 +/tmp/ccvNi4ou.s: Assembler messages:
    17.9 +/tmp/ccvNi4ou.s:2310: Error: Illegal operands: There are only 32 single precision f registers; [0-31]
   17.10 +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
   17.11 +
   17.12 +when compiling glibc's dosincos.c with gcc-3.4.0
   17.13 +
   17.14 +===================================================================
   17.15 +RCS file: /cvs/src/src/opcodes/sparc-opc.c,v
   17.16 +retrieving revision 1.9
   17.17 +retrieving revision 1.10
   17.18 +diff -u -r1.9 -r1.10
   17.19 +--- src/opcodes/sparc-opc.c	2004/01/18 23:46:32	1.9
   17.20 ++++ src/opcodes/sparc-opc.c	2004/04/20 10:23:51	1.10
   17.21 +@@ -1273,110 +1273,72 @@
   17.22 + #define FM_DF 2		/* v9 */
   17.23 + #define FM_QF 3		/* v9 */
   17.24 + 
   17.25 +-#define fmovicc(opcode, fpsize, cond, flags) /* v9 */ \
   17.26 +-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z,f,g", flags, v9 }, \
   17.27 +-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z,f,g", flags, v9 }
   17.28 +-
   17.29 +-#define fmovfcc(opcode, fpsize, fcond, flags) /* v9 */ \
   17.30 +-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags, v9 }, \
   17.31 +-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags, v9 }, \
   17.32 +-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags, v9 }, \
   17.33 +-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags, v9 }
   17.34 ++#define fmoviccx(opcode, fpsize, args, cond, flags) /* v9 */ \
   17.35 ++{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z," args, flags, v9 }, \
   17.36 ++{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z," args, flags, v9 }
   17.37 ++
   17.38 ++#define fmovfccx(opcode, fpsize, args, fcond, flags) /* v9 */ \
   17.39 ++{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags, v9 }, \
   17.40 ++{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags, v9 }, \
   17.41 ++{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags, v9 }, \
   17.42 ++{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags, v9 }
   17.43 + 
   17.44 + /* FIXME: use fmovicc/fmovfcc? */ /* v9 */
   17.45 +-#define fmovcc(opcode, fpsize, cond, fcond, flags) /* v9 */ \
   17.46 +-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z,f,g", flags | F_FLOAT, v9 }, \
   17.47 +-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags | F_FLOAT, v9 }, \
   17.48 +-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z,f,g", flags | F_FLOAT, v9 }, \
   17.49 +-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags | F_FLOAT, v9 }, \
   17.50 +-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags | F_FLOAT, v9 }, \
   17.51 +-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags | F_FLOAT, v9 }
   17.52 +-
   17.53 +-/* v9 */ fmovcc  ("fmovda",	FM_DF, CONDA, FCONDA, 0),
   17.54 +-/* v9 */ fmovcc  ("fmovqa",	FM_QF, CONDA, FCONDA, 0),
   17.55 +-/* v9 */ fmovcc  ("fmovsa",	FM_SF, CONDA, FCONDA, 0),
   17.56 +-/* v9 */ fmovicc ("fmovdcc",	FM_DF, CONDCC, 0),
   17.57 +-/* v9 */ fmovicc ("fmovqcc",	FM_QF, CONDCC, 0),
   17.58 +-/* v9 */ fmovicc ("fmovscc",	FM_SF, CONDCC, 0),
   17.59 +-/* v9 */ fmovicc ("fmovdcs",	FM_DF, CONDCS, 0),
   17.60 +-/* v9 */ fmovicc ("fmovqcs",	FM_QF, CONDCS, 0),
   17.61 +-/* v9 */ fmovicc ("fmovscs",	FM_SF, CONDCS, 0),
   17.62 +-/* v9 */ fmovcc  ("fmovde",	FM_DF, CONDE, FCONDE, 0),
   17.63 +-/* v9 */ fmovcc  ("fmovqe",	FM_QF, CONDE, FCONDE, 0),
   17.64 +-/* v9 */ fmovcc  ("fmovse",	FM_SF, CONDE, FCONDE, 0),
   17.65 +-/* v9 */ fmovcc  ("fmovdg",	FM_DF, CONDG, FCONDG, 0),
   17.66 +-/* v9 */ fmovcc  ("fmovqg",	FM_QF, CONDG, FCONDG, 0),
   17.67 +-/* v9 */ fmovcc  ("fmovsg",	FM_SF, CONDG, FCONDG, 0),
   17.68 +-/* v9 */ fmovcc  ("fmovdge",	FM_DF, CONDGE, FCONDGE, 0),
   17.69 +-/* v9 */ fmovcc  ("fmovqge",	FM_QF, CONDGE, FCONDGE, 0),
   17.70 +-/* v9 */ fmovcc  ("fmovsge",	FM_SF, CONDGE, FCONDGE, 0),
   17.71 +-/* v9 */ fmovicc ("fmovdgeu",	FM_DF, CONDGEU, F_ALIAS),
   17.72 +-/* v9 */ fmovicc ("fmovqgeu",	FM_QF, CONDGEU, F_ALIAS),
   17.73 +-/* v9 */ fmovicc ("fmovsgeu",	FM_SF, CONDGEU, F_ALIAS),
   17.74 +-/* v9 */ fmovicc ("fmovdgu",	FM_DF, CONDGU, 0),
   17.75 +-/* v9 */ fmovicc ("fmovqgu",	FM_QF, CONDGU, 0),
   17.76 +-/* v9 */ fmovicc ("fmovsgu",	FM_SF, CONDGU, 0),
   17.77 +-/* v9 */ fmovcc  ("fmovdl",	FM_DF, CONDL, FCONDL, 0),
   17.78 +-/* v9 */ fmovcc  ("fmovql",	FM_QF, CONDL, FCONDL, 0),
   17.79 +-/* v9 */ fmovcc  ("fmovsl",	FM_SF, CONDL, FCONDL, 0),
   17.80 +-/* v9 */ fmovcc  ("fmovdle",	FM_DF, CONDLE, FCONDLE, 0),
   17.81 +-/* v9 */ fmovcc  ("fmovqle",	FM_QF, CONDLE, FCONDLE, 0),
   17.82 +-/* v9 */ fmovcc  ("fmovsle",	FM_SF, CONDLE, FCONDLE, 0),
   17.83 +-/* v9 */ fmovicc ("fmovdleu",	FM_DF, CONDLEU, 0),
   17.84 +-/* v9 */ fmovicc ("fmovqleu",	FM_QF, CONDLEU, 0),
   17.85 +-/* v9 */ fmovicc ("fmovsleu",	FM_SF, CONDLEU, 0),
   17.86 +-/* v9 */ fmovfcc ("fmovdlg",	FM_DF, FCONDLG, 0),
   17.87 +-/* v9 */ fmovfcc ("fmovqlg",	FM_QF, FCONDLG, 0),
   17.88 +-/* v9 */ fmovfcc ("fmovslg",	FM_SF, FCONDLG, 0),
   17.89 +-/* v9 */ fmovicc ("fmovdlu",	FM_DF, CONDLU, F_ALIAS),
   17.90 +-/* v9 */ fmovicc ("fmovqlu",	FM_QF, CONDLU, F_ALIAS),
   17.91 +-/* v9 */ fmovicc ("fmovslu",	FM_SF, CONDLU, F_ALIAS),
   17.92 +-/* v9 */ fmovcc  ("fmovdn",	FM_DF, CONDN, FCONDN, 0),
   17.93 +-/* v9 */ fmovcc  ("fmovqn",	FM_QF, CONDN, FCONDN, 0),
   17.94 +-/* v9 */ fmovcc  ("fmovsn",	FM_SF, CONDN, FCONDN, 0),
   17.95 +-/* v9 */ fmovcc  ("fmovdne",	FM_DF, CONDNE, FCONDNE, 0),
   17.96 +-/* v9 */ fmovcc  ("fmovqne",	FM_QF, CONDNE, FCONDNE, 0),
   17.97 +-/* v9 */ fmovcc  ("fmovsne",	FM_SF, CONDNE, FCONDNE, 0),
   17.98 +-/* v9 */ fmovicc ("fmovdneg",	FM_DF, CONDNEG, 0),
   17.99 +-/* v9 */ fmovicc ("fmovqneg",	FM_QF, CONDNEG, 0),
  17.100 +-/* v9 */ fmovicc ("fmovsneg",	FM_SF, CONDNEG, 0),
  17.101 +-/* v9 */ fmovcc  ("fmovdnz",	FM_DF, CONDNZ, FCONDNZ, F_ALIAS),
  17.102 +-/* v9 */ fmovcc  ("fmovqnz",	FM_QF, CONDNZ, FCONDNZ, F_ALIAS),
  17.103 +-/* v9 */ fmovcc  ("fmovsnz",	FM_SF, CONDNZ, FCONDNZ, F_ALIAS),
  17.104 +-/* v9 */ fmovfcc ("fmovdo",	FM_DF, FCONDO, 0),
  17.105 +-/* v9 */ fmovfcc ("fmovqo",	FM_QF, FCONDO, 0),
  17.106 +-/* v9 */ fmovfcc ("fmovso",	FM_SF, FCONDO, 0),
  17.107 +-/* v9 */ fmovicc ("fmovdpos",	FM_DF, CONDPOS, 0),
  17.108 +-/* v9 */ fmovicc ("fmovqpos",	FM_QF, CONDPOS, 0),
  17.109 +-/* v9 */ fmovicc ("fmovspos",	FM_SF, CONDPOS, 0),
  17.110 +-/* v9 */ fmovfcc ("fmovdu",	FM_DF, FCONDU, 0),
  17.111 +-/* v9 */ fmovfcc ("fmovqu",	FM_QF, FCONDU, 0),
  17.112 +-/* v9 */ fmovfcc ("fmovsu",	FM_SF, FCONDU, 0),
  17.113 +-/* v9 */ fmovfcc ("fmovdue",	FM_DF, FCONDUE, 0),
  17.114 +-/* v9 */ fmovfcc ("fmovque",	FM_QF, FCONDUE, 0),
  17.115 +-/* v9 */ fmovfcc ("fmovsue",	FM_SF, FCONDUE, 0),
  17.116 +-/* v9 */ fmovfcc ("fmovdug",	FM_DF, FCONDUG, 0),
  17.117 +-/* v9 */ fmovfcc ("fmovqug",	FM_QF, FCONDUG, 0),
  17.118 +-/* v9 */ fmovfcc ("fmovsug",	FM_SF, FCONDUG, 0),
  17.119 +-/* v9 */ fmovfcc ("fmovduge",	FM_DF, FCONDUGE, 0),
  17.120 +-/* v9 */ fmovfcc ("fmovquge",	FM_QF, FCONDUGE, 0),
  17.121 +-/* v9 */ fmovfcc ("fmovsuge",	FM_SF, FCONDUGE, 0),
  17.122 +-/* v9 */ fmovfcc ("fmovdul",	FM_DF, FCONDUL, 0),
  17.123 +-/* v9 */ fmovfcc ("fmovqul",	FM_QF, FCONDUL, 0),
  17.124 +-/* v9 */ fmovfcc ("fmovsul",	FM_SF, FCONDUL, 0),
  17.125 +-/* v9 */ fmovfcc ("fmovdule",	FM_DF, FCONDULE, 0),
  17.126 +-/* v9 */ fmovfcc ("fmovqule",	FM_QF, FCONDULE, 0),
  17.127 +-/* v9 */ fmovfcc ("fmovsule",	FM_SF, FCONDULE, 0),
  17.128 +-/* v9 */ fmovicc ("fmovdvc",	FM_DF, CONDVC, 0),
  17.129 +-/* v9 */ fmovicc ("fmovqvc",	FM_QF, CONDVC, 0),
  17.130 +-/* v9 */ fmovicc ("fmovsvc",	FM_SF, CONDVC, 0),
  17.131 +-/* v9 */ fmovicc ("fmovdvs",	FM_DF, CONDVS, 0),
  17.132 +-/* v9 */ fmovicc ("fmovqvs",	FM_QF, CONDVS, 0),
  17.133 +-/* v9 */ fmovicc ("fmovsvs",	FM_SF, CONDVS, 0),
  17.134 +-/* v9 */ fmovcc  ("fmovdz",	FM_DF, CONDZ, FCONDZ, F_ALIAS),
  17.135 +-/* v9 */ fmovcc  ("fmovqz",	FM_QF, CONDZ, FCONDZ, F_ALIAS),
  17.136 +-/* v9 */ fmovcc  ("fmovsz",	FM_SF, CONDZ, FCONDZ, F_ALIAS),
  17.137 +-
  17.138 ++#define fmovccx(opcode, fpsize, args, cond, fcond, flags) /* v9 */ \
  17.139 ++{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z," args, flags | F_FLOAT, v9 }, \
  17.140 ++{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags | F_FLOAT, v9 }, \
  17.141 ++{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z," args, flags | F_FLOAT, v9 }, \
  17.142 ++{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags | F_FLOAT, v9 }, \
  17.143 ++{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags | F_FLOAT, v9 }, \
  17.144 ++{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags | F_FLOAT, v9 }
  17.145 ++
  17.146 ++#define fmovicc(suffix, cond, flags) /* v9 */ \
  17.147 ++fmoviccx("fmovd" suffix, FM_DF, "B,H", cond, flags),		\
  17.148 ++fmoviccx("fmovq" suffix, FM_QF, "R,J", cond, flags),		\
  17.149 ++fmoviccx("fmovs" suffix, FM_SF, "f,g", cond, flags)
  17.150 ++
  17.151 ++#define fmovfcc(suffix, fcond, flags) /* v9 */ \
  17.152 ++fmovfccx("fmovd" suffix, FM_DF, "B,H", fcond, flags),		\
  17.153 ++fmovfccx("fmovq" suffix, FM_QF, "R,J", fcond, flags),		\
  17.154 ++fmovfccx("fmovs" suffix, FM_SF, "f,g", fcond, flags)
  17.155 ++
  17.156 ++#define fmovcc(suffix, cond, fcond, flags) /* v9 */ \
  17.157 ++fmovccx("fmovd" suffix, FM_DF, "B,H", cond, fcond, flags),	\
  17.158 ++fmovccx("fmovq" suffix, FM_QF, "R,J", cond, fcond, flags),	\
  17.159 ++fmovccx("fmovs" suffix, FM_SF, "f,g", cond, fcond, flags)
  17.160 ++
  17.161 ++/* v9 */ fmovcc  ("a", CONDA, FCONDA, 0),
  17.162 ++/* v9 */ fmovicc ("cc", CONDCC, 0),
  17.163 ++/* v9 */ fmovicc ("cs", CONDCS, 0),
  17.164 ++/* v9 */ fmovcc  ("e", CONDE, FCONDE, 0),
  17.165 ++/* v9 */ fmovcc  ("g", CONDG, FCONDG, 0),
  17.166 ++/* v9 */ fmovcc  ("ge", CONDGE, FCONDGE, 0),
  17.167 ++/* v9 */ fmovicc ("geu", CONDGEU, F_ALIAS),
  17.168 ++/* v9 */ fmovicc ("gu", CONDGU, 0),
  17.169 ++/* v9 */ fmovcc  ("l", CONDL, FCONDL, 0),
  17.170 ++/* v9 */ fmovcc  ("le", CONDLE, FCONDLE, 0),
  17.171 ++/* v9 */ fmovicc ("leu", CONDLEU, 0),
  17.172 ++/* v9 */ fmovfcc ("lg", FCONDLG, 0),
  17.173 ++/* v9 */ fmovicc ("lu", CONDLU, F_ALIAS),
  17.174 ++/* v9 */ fmovcc  ("n", CONDN, FCONDN, 0),
  17.175 ++/* v9 */ fmovcc  ("ne", CONDNE, FCONDNE, 0),
  17.176 ++/* v9 */ fmovicc ("neg", CONDNEG, 0),
  17.177 ++/* v9 */ fmovcc  ("nz", CONDNZ, FCONDNZ, F_ALIAS),
  17.178 ++/* v9 */ fmovfcc ("o", FCONDO, 0),
  17.179 ++/* v9 */ fmovicc ("pos", CONDPOS, 0),
  17.180 ++/* v9 */ fmovfcc ("u", FCONDU, 0),
  17.181 ++/* v9 */ fmovfcc ("ue", FCONDUE, 0),
  17.182 ++/* v9 */ fmovfcc ("ug", FCONDUG, 0),
  17.183 ++/* v9 */ fmovfcc ("uge", FCONDUGE, 0),
  17.184 ++/* v9 */ fmovfcc ("ul", FCONDUL, 0),
  17.185 ++/* v9 */ fmovfcc ("ule", FCONDULE, 0),
  17.186 ++/* v9 */ fmovicc ("vc", CONDVC, 0),
  17.187 ++/* v9 */ fmovicc ("vs", CONDVS, 0),
  17.188 ++/* v9 */ fmovcc  ("z", CONDZ, FCONDZ, F_ALIAS),
  17.189 ++
  17.190 ++#undef fmoviccx /* v9 */
  17.191 ++#undef fmovfccx /* v9 */
  17.192 ++#undef fmovccx /* v9 */
  17.193 + #undef fmovicc /* v9 */
  17.194 + #undef fmovfcc /* v9 */
  17.195 + #undef fmovcc /* v9 */
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/patches/binutils/2.15/240-ld-callahan.patch	Mon Jul 28 21:32:33 2008 +0000
    18.3 @@ -0,0 +1,677 @@
    18.4 +Signed-off-by: dank@kegel.com
    18.5 +Fixes ld speed issue. 
    18.6 +See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html
    18.7 +See thread "Re: optimizations for 3x speedup in ld",
    18.8 +http://sources.redhat.com/ml/binutils/2005-03/msg00847.html
    18.9 +
   18.10 +Wildcard section matching enhancement, backported from the binutils CVS tree.
   18.11 +Here's the CVS log comment from the original change to ldlang.c:
   18.12 +
   18.13 +revision 1.177
   18.14 +date: 2005/04/06 15:33:02;  author: jakub;  state: Exp;  lines: +438 -51
   18.15 +2005-04-06  Jakub Jelinek  <jakub@redhat.com>
   18.16 +
   18.17 +        * ldlang.c: Formatting.
   18.18 +        (walk_wild_consider_section): Remember return value from wildcardp.
   18.19 +        (is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen.
   18.20 +        (wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen.
   18.21 +
   18.22 +2005-04-06  Robert O'Callahan  <rocallahan@novell.com>
   18.23 +
   18.24 +        * ld.h (lean_section_userdata_type): Remove.
   18.25 +        (fat_section_userdata_type): Remove file field.
   18.26 +        (SECTION_USERDATA_SIZE): Remove.
   18.27 +        * ldlang.c (init_os): Eliminate initialization of unused
   18.28 +        lean_section_userdata_type.
   18.29 +
   18.30 +        * ldlang.h (callback_t, walk_wild_section_handler_t): New
   18.31 +        typedefs.
   18.32 +        (struct lang_wild_statement_struct): Add walk_wild_section_handler
   18.33 +        and handler_data fields.
   18.34 +        * ldlang.c (callback_t): Removed.
   18.35 +        (walk_wild_consider_section, walk_wild_section_general,
   18.36 +        section_iterator_callback, find_section, is_simple_wild,
   18.37 +        match_simple_wild, walk_wild_section_specs1_wild0,
   18.38 +        walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1,
   18.39 +        walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2,
   18.40 +        wild_spec_can_overlap, analyze_walk_wild_section_handler): New
   18.41 +        functions.
   18.42 +        (lang_add_wild): Call analyze_walk_wild_section_handler.
   18.43 +        (walk_wild_section): Renamed to walk_wild_section_general and
   18.44 +        created a wrapper function.
   18.45 +        (section_iterator_callback_data): New typedef.
   18.46 +
   18.47 +Note that bfd_get_section_by_name_if didn't exist in 2.15, so it was backported
   18.48 +as well.
   18.49 +
   18.50 +--- binutils-2.15/bfd/bfd-in2.h.old	2004-05-17 15:35:56.000000000 -0400
   18.51 ++++ binutils-2.15/bfd/bfd-in2.h	2006-02-09 11:54:45.989940000 -0500
   18.52 +@@ -1425,6 +1425,10 @@
   18.53 + 
   18.54 + asection *bfd_get_section_by_name (bfd *abfd, const char *name);
   18.55 + 
   18.56 ++asection *bfd_get_section_by_name_if (bfd *abfd, const char *name,
   18.57 ++   bfd_boolean (*operation) (bfd *, asection *, void *),
   18.58 ++   void *user_storage);
   18.59 ++
   18.60 + char *bfd_get_unique_section_name
   18.61 +    (bfd *abfd, const char *templat, int *count);
   18.62 + 
   18.63 +--- binutils-2.15/bfd/section.c.old	2003-12-01 01:33:01.000000000 -0500
   18.64 ++++ binutils-2.15/bfd/section.c	2006-01-23 14:16:54.768993000 -0500
   18.65 +@@ -801,6 +801,57 @@
   18.66 + 
   18.67 + /*
   18.68 + FUNCTION
   18.69 ++	bfd_get_section_by_name_if
   18.70 ++
   18.71 ++SYNOPSIS
   18.72 ++	asection *bfd_get_section_by_name_if
   18.73 ++	  (bfd *abfd,
   18.74 ++	   const char *name,
   18.75 ++	   bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
   18.76 ++	   void *obj);
   18.77 ++
   18.78 ++DESCRIPTION
   18.79 ++	Call the provided function @var{func} for each section
   18.80 ++	attached to the BFD @var{abfd} whose name matches @var{name},
   18.81 ++	passing @var{obj} as an argument. The function will be called
   18.82 ++	as if by
   18.83 ++
   18.84 ++|	func (abfd, the_section, obj);
   18.85 ++
   18.86 ++	It returns the first section for which @var{func} returns true,
   18.87 ++	otherwise <<NULL>>.
   18.88 ++
   18.89 ++*/
   18.90 ++
   18.91 ++asection *
   18.92 ++bfd_get_section_by_name_if (bfd *abfd, const char *name,
   18.93 ++			    bfd_boolean (*operation) (bfd *,
   18.94 ++						      asection *,
   18.95 ++						      void *),
   18.96 ++			    void *user_storage)
   18.97 ++{
   18.98 ++  struct section_hash_entry *sh;
   18.99 ++  unsigned long hash;
  18.100 ++
  18.101 ++  sh = section_hash_lookup (&abfd->section_htab, name, FALSE, FALSE);
  18.102 ++  if (sh == NULL)
  18.103 ++    return NULL;
  18.104 ++
  18.105 ++  hash = sh->root.hash;
  18.106 ++  do
  18.107 ++    {
  18.108 ++      if ((*operation) (abfd, &sh->section, user_storage))
  18.109 ++	return &sh->section;
  18.110 ++      sh = (struct section_hash_entry *) sh->root.next;
  18.111 ++    }
  18.112 ++  while (sh != NULL && sh->root.hash == hash
  18.113 ++	 && strcmp (sh->root.string, name) == 0);
  18.114 ++
  18.115 ++  return NULL;
  18.116 ++}
  18.117 ++
  18.118 ++/*
  18.119 ++FUNCTION
  18.120 + 	bfd_get_unique_section_name
  18.121 + 
  18.122 + SYNOPSIS
  18.123 +--- binutils-2.15/ld/ldlang.c.old	2004-05-17 15:36:16.000000000 -0400
  18.124 ++++ binutils-2.15/ld/ldlang.c	2006-01-23 13:40:12.745499000 -0500
  18.125 +@@ -81,9 +81,6 @@
  18.126 + static void lang_record_phdrs (void);
  18.127 + static void lang_do_version_exports_section (void);
  18.128 + 
  18.129 +-typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
  18.130 +-			    asection *, lang_input_statement_type *, void *);
  18.131 +-
  18.132 + /* Exported variables.  */
  18.133 + lang_output_section_statement_type *abs_output_section;
  18.134 + lang_statement_list_type lang_output_section_statement;
  18.135 +@@ -138,21 +135,71 @@
  18.136 + 
  18.137 + /* Generic traversal routines for finding matching sections.  */
  18.138 + 
  18.139 ++/* Try processing a section against a wildcard.  This just calls
  18.140 ++   the callback unless the filename exclusion list is present
  18.141 ++   and excludes the file.  It's hardly ever present so this
  18.142 ++   function is very fast.  */
  18.143 ++
  18.144 ++static void
  18.145 ++walk_wild_consider_section (lang_wild_statement_type *ptr,
  18.146 ++			    lang_input_statement_type *file,
  18.147 ++			    asection *s,
  18.148 ++			    struct wildcard_list *sec,
  18.149 ++			    callback_t callback,
  18.150 ++			    void *data)
  18.151 ++{
  18.152 ++  bfd_boolean skip = FALSE;
  18.153 ++  struct name_list *list_tmp;
  18.154 ++
  18.155 ++  /* Don't process sections from files which were
  18.156 ++     excluded.  */
  18.157 ++  for (list_tmp = sec->spec.exclude_name_list;
  18.158 ++       list_tmp;
  18.159 ++       list_tmp = list_tmp->next)
  18.160 ++    {
  18.161 ++      bfd_boolean is_wildcard = wildcardp (list_tmp->name);
  18.162 ++      if (is_wildcard)
  18.163 ++	skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
  18.164 ++      else
  18.165 ++	skip = strcmp (list_tmp->name, file->filename) == 0;
  18.166 ++
  18.167 ++      /* If this file is part of an archive, and the archive is
  18.168 ++	 excluded, exclude this file.  */
  18.169 ++      if (! skip && file->the_bfd != NULL
  18.170 ++	  && file->the_bfd->my_archive != NULL
  18.171 ++	  && file->the_bfd->my_archive->filename != NULL)
  18.172 ++	{
  18.173 ++	  if (is_wildcard)
  18.174 ++	    skip = fnmatch (list_tmp->name,
  18.175 ++			    file->the_bfd->my_archive->filename,
  18.176 ++			    0) == 0;
  18.177 ++	  else
  18.178 ++	    skip = strcmp (list_tmp->name,
  18.179 ++			   file->the_bfd->my_archive->filename) == 0;
  18.180 ++	}
  18.181 ++
  18.182 ++      if (skip)
  18.183 ++	break;
  18.184 ++    }
  18.185 ++
  18.186 ++  if (!skip)
  18.187 ++    (*callback) (ptr, sec, s, file, data);
  18.188 ++}
  18.189 ++
  18.190 ++/* Lowest common denominator routine that can handle everything correctly,
  18.191 ++   but slowly.  */
  18.192 ++
  18.193 + static void
  18.194 +-walk_wild_section (lang_wild_statement_type *ptr,
  18.195 +-		   lang_input_statement_type *file,
  18.196 +-		   callback_t callback,
  18.197 +-		   void *data)
  18.198 ++walk_wild_section_general (lang_wild_statement_type *ptr,
  18.199 ++			   lang_input_statement_type *file,
  18.200 ++			   callback_t callback,
  18.201 ++			   void *data)
  18.202 + {
  18.203 +   asection *s;
  18.204 +-
  18.205 +-  if (file->just_syms_flag)
  18.206 +-    return;
  18.207 ++  struct wildcard_list *sec;
  18.208 + 
  18.209 +   for (s = file->the_bfd->sections; s != NULL; s = s->next)
  18.210 +     {
  18.211 +-      struct wildcard_list *sec;
  18.212 +-
  18.213 +       sec = ptr->section_list;
  18.214 +       if (sec == NULL)
  18.215 + 	(*callback) (ptr, sec, s, file, data);
  18.216 +@@ -160,39 +207,8 @@
  18.217 +       while (sec != NULL)
  18.218 + 	{
  18.219 + 	  bfd_boolean skip = FALSE;
  18.220 +-	  struct name_list *list_tmp;
  18.221 +-
  18.222 +-	  /* Don't process sections from files which were
  18.223 +-	     excluded.  */
  18.224 +-	  for (list_tmp = sec->spec.exclude_name_list;
  18.225 +-	       list_tmp;
  18.226 +-	       list_tmp = list_tmp->next)
  18.227 +-	    {
  18.228 +-	      if (wildcardp (list_tmp->name))
  18.229 +-		skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
  18.230 +-	      else
  18.231 +-		skip = strcmp (list_tmp->name, file->filename) == 0;
  18.232 +-
  18.233 +-	      /* If this file is part of an archive, and the archive is
  18.234 +-		 excluded, exclude this file.  */
  18.235 +-	      if (! skip && file->the_bfd != NULL
  18.236 +-		  && file->the_bfd->my_archive != NULL
  18.237 +-		  && file->the_bfd->my_archive->filename != NULL)
  18.238 +-		{
  18.239 +-		  if (wildcardp (list_tmp->name))
  18.240 +-		    skip = fnmatch (list_tmp->name,
  18.241 +-				    file->the_bfd->my_archive->filename,
  18.242 +-				    0) == 0;
  18.243 +-		  else
  18.244 +-		    skip = strcmp (list_tmp->name,
  18.245 +-				   file->the_bfd->my_archive->filename) == 0;
  18.246 +-		}
  18.247 +-
  18.248 +-	      if (skip)
  18.249 +-		break;
  18.250 +-	    }
  18.251 + 
  18.252 +-	  if (!skip && sec->spec.name != NULL)
  18.253 ++	  if (sec->spec.name != NULL)
  18.254 + 	    {
  18.255 + 	      const char *sname = bfd_get_section_name (file->the_bfd, s);
  18.256 + 
  18.257 +@@ -203,13 +219,381 @@
  18.258 + 	    }
  18.259 + 
  18.260 + 	  if (!skip)
  18.261 +-	    (*callback) (ptr, sec, s, file, data);
  18.262 ++	    walk_wild_consider_section (ptr, file, s, sec, callback, data);
  18.263 + 
  18.264 + 	  sec = sec->next;
  18.265 + 	}
  18.266 +     }
  18.267 + }
  18.268 + 
  18.269 ++/* Routines to find a single section given its name.  If there's more
  18.270 ++   than one section with that name, we report that.  */
  18.271 ++
  18.272 ++typedef struct
  18.273 ++{
  18.274 ++  asection *found_section;
  18.275 ++  bfd_boolean multiple_sections_found;
  18.276 ++} section_iterator_callback_data;
  18.277 ++
  18.278 ++static bfd_boolean
  18.279 ++section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data)
  18.280 ++{
  18.281 ++  section_iterator_callback_data *d = data;
  18.282 ++
  18.283 ++  if (d->found_section != NULL)
  18.284 ++    {
  18.285 ++      d->multiple_sections_found = TRUE;
  18.286 ++      return TRUE;
  18.287 ++    }
  18.288 ++
  18.289 ++  d->found_section = s;
  18.290 ++  return FALSE;
  18.291 ++}
  18.292 ++
  18.293 ++static asection *
  18.294 ++find_section (lang_input_statement_type *file,
  18.295 ++	      struct wildcard_list *sec,
  18.296 ++	      bfd_boolean *multiple_sections_found)
  18.297 ++{
  18.298 ++  section_iterator_callback_data cb_data = { NULL, FALSE };
  18.299 ++
  18.300 ++  bfd_get_section_by_name_if (file->the_bfd, sec->spec.name, 
  18.301 ++			      section_iterator_callback, &cb_data);
  18.302 ++  *multiple_sections_found = cb_data.multiple_sections_found;
  18.303 ++  return cb_data.found_section;
  18.304 ++}
  18.305 ++
  18.306 ++/* Code for handling simple wildcards without going through fnmatch,
  18.307 ++   which can be expensive because of charset translations etc.  */
  18.308 ++
  18.309 ++/* A simple wild is a literal string followed by a single '*',
  18.310 ++   where the literal part is at least 4 characters long.  */
  18.311 ++
  18.312 ++static bfd_boolean
  18.313 ++is_simple_wild (const char *name)
  18.314 ++{
  18.315 ++  size_t len = strcspn (name, "*?[");
  18.316 ++  return len >= 4 && name[len] == '*' && name[len + 1] == '\0';
  18.317 ++}
  18.318 ++
  18.319 ++static bfd_boolean
  18.320 ++match_simple_wild (const char *pattern, const char *name)
  18.321 ++{
  18.322 ++  /* The first four characters of the pattern are guaranteed valid
  18.323 ++     non-wildcard characters.  So we can go faster.  */
  18.324 ++  if (pattern[0] != name[0] || pattern[1] != name[1]
  18.325 ++      || pattern[2] != name[2] || pattern[3] != name[3])
  18.326 ++    return FALSE;
  18.327 ++
  18.328 ++  pattern += 4;
  18.329 ++  name += 4;
  18.330 ++  while (*pattern != '*')
  18.331 ++    if (*name++ != *pattern++)
  18.332 ++      return FALSE;
  18.333 ++
  18.334 ++  return TRUE;
  18.335 ++}
  18.336 ++
  18.337 ++/* Specialized, optimized routines for handling different kinds of
  18.338 ++   wildcards */
  18.339 ++
  18.340 ++static void
  18.341 ++walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr,
  18.342 ++				lang_input_statement_type *file,
  18.343 ++				callback_t callback,
  18.344 ++				void *data)
  18.345 ++{
  18.346 ++  /* We can just do a hash lookup for the section with the right name.
  18.347 ++     But if that lookup discovers more than one section with the name
  18.348 ++     (should be rare), we fall back to the general algorithm because
  18.349 ++     we would otherwise have to sort the sections to make sure they
  18.350 ++     get processed in the bfd's order.  */
  18.351 ++  bfd_boolean multiple_sections_found;
  18.352 ++  struct wildcard_list *sec0 = ptr->handler_data[0];
  18.353 ++  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  18.354 ++
  18.355 ++  if (multiple_sections_found)
  18.356 ++    walk_wild_section_general (ptr, file, callback, data);
  18.357 ++  else if (s0)
  18.358 ++    walk_wild_consider_section (ptr, file, s0, sec0, callback, data);
  18.359 ++}
  18.360 ++
  18.361 ++static void
  18.362 ++walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr,
  18.363 ++				lang_input_statement_type *file,
  18.364 ++				callback_t callback,
  18.365 ++				void *data)
  18.366 ++{
  18.367 ++  asection *s;
  18.368 ++  struct wildcard_list *wildsec0 = ptr->handler_data[0];
  18.369 ++
  18.370 ++  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  18.371 ++    {
  18.372 ++      const char *sname = bfd_get_section_name (file->the_bfd, s);
  18.373 ++      bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname);
  18.374 ++
  18.375 ++      if (!skip)
  18.376 ++	walk_wild_consider_section (ptr, file, s, wildsec0, callback, data);
  18.377 ++    }
  18.378 ++}
  18.379 ++
  18.380 ++static void
  18.381 ++walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr,
  18.382 ++				lang_input_statement_type *file,
  18.383 ++				callback_t callback,
  18.384 ++				void *data)
  18.385 ++{
  18.386 ++  asection *s;
  18.387 ++  struct wildcard_list *sec0 = ptr->handler_data[0];
  18.388 ++  struct wildcard_list *wildsec1 = ptr->handler_data[1];
  18.389 ++  bfd_boolean multiple_sections_found;
  18.390 ++  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  18.391 ++
  18.392 ++  if (multiple_sections_found)
  18.393 ++    {
  18.394 ++      walk_wild_section_general (ptr, file, callback, data);
  18.395 ++      return;
  18.396 ++    }
  18.397 ++
  18.398 ++  /* Note that if the section was not found, s0 is NULL and
  18.399 ++     we'll simply never succeed the s == s0 test below.  */
  18.400 ++  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  18.401 ++    {
  18.402 ++      /* Recall that in this code path, a section cannot satisfy more
  18.403 ++	 than one spec, so if s == s0 then it cannot match
  18.404 ++	 wildspec1.  */
  18.405 ++      if (s == s0)
  18.406 ++	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  18.407 ++      else
  18.408 ++	{
  18.409 ++	  const char *sname = bfd_get_section_name (file->the_bfd, s);
  18.410 ++	  bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
  18.411 ++
  18.412 ++	  if (!skip)
  18.413 ++	    walk_wild_consider_section (ptr, file, s, wildsec1, callback,
  18.414 ++					data);
  18.415 ++	}
  18.416 ++    }
  18.417 ++}
  18.418 ++
  18.419 ++static void
  18.420 ++walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr,
  18.421 ++				lang_input_statement_type *file,
  18.422 ++				callback_t callback,
  18.423 ++				void *data)
  18.424 ++{
  18.425 ++  asection *s;
  18.426 ++  struct wildcard_list *sec0 = ptr->handler_data[0];
  18.427 ++  struct wildcard_list *wildsec1 = ptr->handler_data[1];
  18.428 ++  struct wildcard_list *wildsec2 = ptr->handler_data[2];
  18.429 ++  bfd_boolean multiple_sections_found;
  18.430 ++  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  18.431 ++
  18.432 ++  if (multiple_sections_found)
  18.433 ++    {
  18.434 ++      walk_wild_section_general (ptr, file, callback, data);
  18.435 ++      return;
  18.436 ++    }
  18.437 ++
  18.438 ++  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  18.439 ++    {
  18.440 ++      if (s == s0)
  18.441 ++	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  18.442 ++      else
  18.443 ++	{
  18.444 ++	  const char *sname = bfd_get_section_name (file->the_bfd, s);
  18.445 ++	  bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
  18.446 ++
  18.447 ++	  if (!skip)
  18.448 ++	    walk_wild_consider_section (ptr, file, s, wildsec1, callback, data);
  18.449 ++	  else
  18.450 ++	    {
  18.451 ++	      skip = !match_simple_wild (wildsec2->spec.name, sname);
  18.452 ++	      if (!skip)
  18.453 ++		walk_wild_consider_section (ptr, file, s, wildsec2, callback,
  18.454 ++					    data);
  18.455 ++	    }
  18.456 ++	}
  18.457 ++    }
  18.458 ++}
  18.459 ++
  18.460 ++static void
  18.461 ++walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr,
  18.462 ++				lang_input_statement_type *file,
  18.463 ++				callback_t callback,
  18.464 ++				void *data)
  18.465 ++{
  18.466 ++  asection *s;
  18.467 ++  struct wildcard_list *sec0 = ptr->handler_data[0];
  18.468 ++  struct wildcard_list *sec1 = ptr->handler_data[1];
  18.469 ++  struct wildcard_list *wildsec2 = ptr->handler_data[2];
  18.470 ++  struct wildcard_list *wildsec3 = ptr->handler_data[3];
  18.471 ++  bfd_boolean multiple_sections_found;
  18.472 ++  asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1;
  18.473 ++
  18.474 ++  if (multiple_sections_found)
  18.475 ++    {
  18.476 ++      walk_wild_section_general (ptr, file, callback, data);
  18.477 ++      return;
  18.478 ++    }
  18.479 ++
  18.480 ++  s1 = find_section (file, sec1, &multiple_sections_found);
  18.481 ++  if (multiple_sections_found)
  18.482 ++    {
  18.483 ++      walk_wild_section_general (ptr, file, callback, data);
  18.484 ++      return;
  18.485 ++    }
  18.486 ++
  18.487 ++  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  18.488 ++    {
  18.489 ++      if (s == s0)
  18.490 ++	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  18.491 ++      else
  18.492 ++	if (s == s1)
  18.493 ++	  walk_wild_consider_section (ptr, file, s, sec1, callback, data);
  18.494 ++	else
  18.495 ++	  {
  18.496 ++	    const char *sname = bfd_get_section_name (file->the_bfd, s);
  18.497 ++	    bfd_boolean skip = !match_simple_wild (wildsec2->spec.name,
  18.498 ++						   sname);
  18.499 ++
  18.500 ++	    if (!skip)
  18.501 ++	      walk_wild_consider_section (ptr, file, s, wildsec2, callback,
  18.502 ++					  data);
  18.503 ++	    else
  18.504 ++	      {
  18.505 ++		skip = !match_simple_wild (wildsec3->spec.name, sname);
  18.506 ++		if (!skip)
  18.507 ++		  walk_wild_consider_section (ptr, file, s, wildsec3,
  18.508 ++					      callback, data);
  18.509 ++	      }
  18.510 ++	  }
  18.511 ++    }
  18.512 ++}
  18.513 ++
  18.514 ++static void
  18.515 ++walk_wild_section (lang_wild_statement_type *ptr,
  18.516 ++		   lang_input_statement_type *file,
  18.517 ++		   callback_t callback,
  18.518 ++		   void *data)
  18.519 ++{
  18.520 ++  if (file->just_syms_flag)
  18.521 ++    return;
  18.522 ++
  18.523 ++  (*ptr->walk_wild_section_handler) (ptr, file, callback, data);
  18.524 ++}
  18.525 ++
  18.526 ++/* Returns TRUE when name1 is a wildcard spec that might match
  18.527 ++   something name2 can match.  We're conservative: we return FALSE
  18.528 ++   only if the prefixes of name1 and name2 are different up to the
  18.529 ++   first wildcard character.  */
  18.530 ++
  18.531 ++static bfd_boolean
  18.532 ++wild_spec_can_overlap (const char *name1, const char *name2)
  18.533 ++{
  18.534 ++  size_t prefix1_len = strcspn (name1, "?*[");
  18.535 ++  size_t prefix2_len = strcspn (name2, "?*[");
  18.536 ++  size_t min_prefix_len;
  18.537 ++
  18.538 ++  /* Note that if there is no wildcard character, then we treat the
  18.539 ++     terminating 0 as part of the prefix.  Thus ".text" won't match
  18.540 ++     ".text." or ".text.*", for example.  */
  18.541 ++  if (name1[prefix1_len] == '\0')
  18.542 ++    prefix1_len++;
  18.543 ++  if (name2[prefix2_len] == '\0')
  18.544 ++    prefix2_len++;
  18.545 ++
  18.546 ++  min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len;
  18.547 ++
  18.548 ++  return memcmp (name1, name2, min_prefix_len) == 0;
  18.549 ++}
  18.550 ++
  18.551 ++/* Select specialized code to handle various kinds of wildcard
  18.552 ++   statements.  */
  18.553 ++
  18.554 ++static void
  18.555 ++analyze_walk_wild_section_handler (lang_wild_statement_type *ptr)
  18.556 ++{
  18.557 ++  int sec_count = 0;
  18.558 ++  int wild_name_count = 0;
  18.559 ++  struct wildcard_list *sec;
  18.560 ++  int signature;
  18.561 ++  int data_counter;
  18.562 ++
  18.563 ++  ptr->walk_wild_section_handler = walk_wild_section_general;
  18.564 ++
  18.565 ++  /* Count how many wildcard_specs there are, and how many of those
  18.566 ++     actually use wildcards in the name.  Also, bail out if any of the
  18.567 ++     wildcard names are NULL. (Can this actually happen?
  18.568 ++     walk_wild_section used to test for it.)  And bail out if any
  18.569 ++     of the wildcards are more complex than a simple string
  18.570 ++     ending in a single '*'.  */
  18.571 ++  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  18.572 ++    {
  18.573 ++      ++sec_count;
  18.574 ++      if (sec->spec.name == NULL)
  18.575 ++	return;
  18.576 ++      if (wildcardp (sec->spec.name))
  18.577 ++	{
  18.578 ++	  ++wild_name_count;
  18.579 ++	  if (!is_simple_wild (sec->spec.name))
  18.580 ++	    return;
  18.581 ++	}
  18.582 ++    }
  18.583 ++
  18.584 ++  /* The zero-spec case would be easy to optimize but it doesn't
  18.585 ++     happen in practice.  Likewise, more than 4 specs doesn't
  18.586 ++     happen in practice.  */
  18.587 ++  if (sec_count == 0 || sec_count > 4)
  18.588 ++    return;
  18.589 ++
  18.590 ++  /* Check that no two specs can match the same section.  */
  18.591 ++  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  18.592 ++    {
  18.593 ++      struct wildcard_list *sec2;
  18.594 ++      for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next)
  18.595 ++	{
  18.596 ++	  if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name))
  18.597 ++	    return;
  18.598 ++	}
  18.599 ++    }
  18.600 ++
  18.601 ++  signature = (sec_count << 8) + wild_name_count;
  18.602 ++  switch (signature)
  18.603 ++    {
  18.604 ++    case 0x0100:
  18.605 ++      ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0;
  18.606 ++      break;
  18.607 ++    case 0x0101:
  18.608 ++      ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1;
  18.609 ++      break;
  18.610 ++    case 0x0201:
  18.611 ++      ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1;
  18.612 ++      break;
  18.613 ++    case 0x0302:
  18.614 ++      ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2;
  18.615 ++      break;
  18.616 ++    case 0x0402:
  18.617 ++      ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2;
  18.618 ++      break;
  18.619 ++    default:
  18.620 ++      return;
  18.621 ++    }
  18.622 ++
  18.623 ++  /* Now fill the data array with pointers to the specs, first the
  18.624 ++     specs with non-wildcard names, then the specs with wildcard
  18.625 ++     names.  It's OK to process the specs in different order from the
  18.626 ++     given order, because we've already determined that no section
  18.627 ++     will match more than one spec.  */
  18.628 ++  data_counter = 0;
  18.629 ++  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  18.630 ++    if (!wildcardp (sec->spec.name))
  18.631 ++      ptr->handler_data[data_counter++] = sec;
  18.632 ++  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  18.633 ++    if (wildcardp (sec->spec.name))
  18.634 ++      ptr->handler_data[data_counter++] = sec;
  18.635 ++}
  18.636 ++
  18.637 + /* Handle a wild statement for a single file F.  */
  18.638 + 
  18.639 + static void
  18.640 +@@ -4353,6 +4737,7 @@
  18.641 +   new->section_list = section_list;
  18.642 +   new->keep_sections = keep_sections;
  18.643 +   lang_list_init (&new->children);
  18.644 ++  analyze_walk_wild_section_handler (new);
  18.645 + }
  18.646 + 
  18.647 + void
  18.648 +--- binutils-2.15/ld/ldlang.h.old	2004-05-17 15:36:16.000000000 -0400
  18.649 ++++ binutils-2.15/ld/ldlang.h	2006-01-23 13:32:33.653292000 -0500
  18.650 +@@ -295,7 +295,17 @@
  18.651 +   union lang_statement_union *file;
  18.652 + } lang_afile_asection_pair_statement_type;
  18.653 + 
  18.654 +-typedef struct lang_wild_statement_struct
  18.655 ++typedef struct lang_wild_statement_struct lang_wild_statement_type;
  18.656 ++
  18.657 ++typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
  18.658 ++			    asection *, lang_input_statement_type *, void *);
  18.659 ++
  18.660 ++typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
  18.661 ++					     lang_input_statement_type *,
  18.662 ++					     callback_t callback,
  18.663 ++					     void *data);
  18.664 ++
  18.665 ++struct lang_wild_statement_struct
  18.666 + {
  18.667 +   lang_statement_header_type header;
  18.668 +   const char *filename;
  18.669 +@@ -303,7 +313,10 @@
  18.670 +   struct wildcard_list *section_list;
  18.671 +   bfd_boolean keep_sections;
  18.672 +   lang_statement_list_type children;
  18.673 +-} lang_wild_statement_type;
  18.674 ++
  18.675 ++  walk_wild_section_handler_t walk_wild_section_handler;
  18.676 ++  struct wildcard_list *handler_data[4];
  18.677 ++};
  18.678 + 
  18.679 + typedef struct lang_address_statement_struct
  18.680 + {
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/patches/binutils/2.15/250-ld-stabs-tweak.patch	Mon Jul 28 21:32:33 2008 +0000
    19.3 @@ -0,0 +1,33 @@
    19.4 +Signed-off-by: dank@kegel.com
    19.5 +
    19.6 +See http://sourceware.org/ml/binutils/2005-12/msg00270.html
    19.7 +http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html
    19.8 +
    19.9 +STABS hash table size change, backported from the binutils CVS tree.  Here's
   19.10 +the CVS log comment for the original change:
   19.11 +
   19.12 +revision 1.25
   19.13 +date: 2005/12/29 10:29:23;  author: nickc;  state: Exp;  lines: +2 -3
   19.14 +(_bfd_link_section_stabs): Use bfd_hash_table_init rather than
   19.15 +bfd_hash_table_init_n(...,251) so that the size of the hash table can be
   19.16 +controlled by the user.
   19.17 +
   19.18 +Note that tunable hash table size changes were added after 2.15.  The effect
   19.19 +of this change is to make bfd use its default hash table size for the stabs
   19.20 +hash as well.
   19.21 +
   19.22 +
   19.23 +--- binutils-2.15/bfd/stabs.c.old	2004-05-17 15:36:04.000000000 -0400
   19.24 ++++ binutils-2.15/bfd/stabs.c	2006-02-09 15:21:56.567014000 -0500
   19.25 +@@ -241,9 +241,8 @@
   19.26 + 	goto error_return;
   19.27 +       /* Make sure the first byte is zero.  */
   19.28 +       (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
   19.29 +-      if (! bfd_hash_table_init_n (&sinfo->includes.root,
   19.30 +-				   stab_link_includes_newfunc,
   19.31 +-				   251))
   19.32 ++      if (! bfd_hash_table_init (&sinfo->includes.root,
   19.33 ++				   stab_link_includes_newfunc))
   19.34 + 	goto error_return;
   19.35 +       sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
   19.36 +       sinfo->stabstr->flags |= SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING;
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/patches/binutils/2.15/260-s390-invalid-insn-format.patch	Mon Jul 28 21:32:33 2008 +0000
    20.3 @@ -0,0 +1,42 @@
    20.4 +Message-ID: <000801c48f60$cec16630$9103a8c0@ULOC5012>
    20.5 +From: "Michael Geiger" <mcgege@gmx.de>
    20.6 +To: <dank@kegel.com>
    20.7 +Subject: Patch for cross compiling s/390 kernel on linux host
    20.8 +Date: Tue, 31 Aug 2004 15:45:41 +0200
    20.9 +
   20.10 +Dear Dan,
   20.11 +
   20.12 +I had big problems compiling a kernel for s/390 on my linux host - I tried
   20.13 +different chains from crosstool-0.28-rc34 and finally succeded with
   20.14 +gcc-3.3.4-glibc-2.3.2 after applying another patch to binutils-2.15
   20.15 +(attached).
   20.16 +All compilations of the different kernel versions I tried stopped with
   20.17 +"Invalid .insn format" somewhere. I checked the recent cvs version of
   20.18 +binutils and applied the latest diff to gas/config/tc-s390.c and that solved
   20.19 +it.
   20.20 +
   20.21 +Greetings
   20.22 +
   20.23 +Michael Geiger
   20.24 +
   20.25 +
   20.26 +diff -u -r1.39 -r1.40
   20.27 +--- src/gas/config/tc-s390.c	2004/05/06 11:01:48	1.39
   20.28 ++++ src/gas/config/tc-s390.c	2004/06/15 12:38:08	1.40
   20.29 +@@ -1596,13 +1596,13 @@
   20.30 +   if (exp.X_op == O_constant)
   20.31 +     {
   20.32 +       if (   (   opformat->oplen == 6
   20.33 +-	      && exp.X_add_number >= 0
   20.34 ++	      && (addressT) exp.X_add_number >= 0
   20.35 + 	      && (addressT) exp.X_add_number < (1ULL << 48))
   20.36 + 	  || (   opformat->oplen == 4
   20.37 +-	      && exp.X_add_number >= 0
   20.38 ++	      && (addressT) exp.X_add_number >= 0
   20.39 + 	      && (addressT) exp.X_add_number < (1ULL << 32))
   20.40 + 	  || (   opformat->oplen == 2
   20.41 +-	      && exp.X_add_number >= 0
   20.42 ++	      && (addressT) exp.X_add_number >= 0
   20.43 + 	      && (addressT) exp.X_add_number < (1ULL << 16)))
   20.44 + 	md_number_to_chars (insn, exp.X_add_number, opformat->oplen);
   20.45 +       else
    21.1 --- a/patches/binutils/2.15/400-mips-ELF_MAXPAGESIZE-4K.patch	Mon Jul 28 21:08:01 2008 +0000
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,26 +0,0 @@
    21.4 ---- binutils/bfd/elf32-mips.c~
    21.5 -+++ binutils/bfd/elf32-mips.c
    21.6 -@@ -1611,7 +1611,9 @@
    21.7 - 
    21.8 - /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
    21.9 -    page sizes of up to that limit, so we need to respect it.  */
   21.10 --#define ELF_MAXPAGESIZE			0x10000
   21.11 -+/*#define ELF_MAXPAGESIZE			0x10000*/
   21.12 -+/* Use 4K to shrink the elf header.  NOT for general use! */
   21.13 -+#define ELF_MAXPAGESIZE			0x1000
   21.14 - #define elf32_bed			elf32_tradbed
   21.15 - 
   21.16 - /* Include the target file again for this target.  */
   21.17 ---- binutils/bfd/elfn32-mips.c~
   21.18 -+++ binutils/bfd/elfn32-mips.c
   21.19 -@@ -1976,7 +1976,9 @@
   21.20 - 
   21.21 - /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
   21.22 -    page sizes of up to that limit, so we need to respect it.  */
   21.23 --#define ELF_MAXPAGESIZE			0x10000
   21.24 -+/*#define ELF_MAXPAGESIZE			0x10000*/
   21.25 -+/* Use 4K to shrink the elf header.  NOT for general use! */
   21.26 -+#define ELF_MAXPAGESIZE			0x1000
   21.27 - #define elf32_bed			elf32_tradbed
   21.28 - 
   21.29 - /* Include the target file again for this target.  */
    22.1 --- a/patches/binutils/2.15/600-arm-textrel.patch	Mon Jul 28 21:08:01 2008 +0000
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,63 +0,0 @@
    22.4 -http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
    22.5 ---- binutils-2.15.90.0.3-old/bfd/elf32-arm.h	2004-04-12 14:56:33.000000000 -0500
    22.6 -+++ binutils-2.15.90.0.3/bfd/elf32-arm.h	2004-09-03 06:56:40.000000000 -0500
    22.7 -@@ -87,6 +87,8 @@
    22.8 - #endif
    22.9 - static bfd_boolean allocate_dynrelocs 
   22.10 -   PARAMS ((struct elf_link_hash_entry *h, PTR inf));
   22.11 -+static bfd_boolean elf32_arm_readonly_dynrelocs
   22.12 -+  PARAMS ((struct elf_link_hash_entry *, PTR));
   22.13 - static bfd_boolean create_got_section 
   22.14 -   PARAMS ((bfd * dynobj, struct bfd_link_info * info));
   22.15 - static bfd_boolean elf32_arm_create_dynamic_sections 
   22.16 -@@ -3531,6 +3533,37 @@
   22.17 -   return TRUE;
   22.18 - }
   22.19 - 
   22.20 -+/* Find any dynamic relocs that apply to read-only sections.  */
   22.21 -+
   22.22 -+static bfd_boolean
   22.23 -+elf32_arm_readonly_dynrelocs (h, inf)
   22.24 -+     struct elf_link_hash_entry *h;
   22.25 -+     PTR inf;
   22.26 -+{
   22.27 -+  struct elf32_arm_link_hash_entry *eh;
   22.28 -+  struct elf32_arm_relocs_copied *p;
   22.29 -+
   22.30 -+  if (h->root.type == bfd_link_hash_warning)
   22.31 -+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
   22.32 -+
   22.33 -+  eh = (struct elf32_arm_link_hash_entry *) h;
   22.34 -+  for (p = eh->relocs_copied; p != NULL; p = p->next)
   22.35 -+    {
   22.36 -+      asection *s = p->section;
   22.37 -+
   22.38 -+      if (s != NULL && (s->flags & SEC_READONLY) != 0)
   22.39 -+       {
   22.40 -+         struct bfd_link_info *info = (struct bfd_link_info *) inf;
   22.41 -+
   22.42 -+         info->flags |= DF_TEXTREL;
   22.43 -+
   22.44 -+         /* Not an error, just cut short the traversal.  */
   22.45 -+         return FALSE;
   22.46 -+       }
   22.47 -+    }
   22.48 -+  return TRUE;
   22.49 -+}
   22.50 -+
   22.51 - /* Set the sizes of the dynamic sections.  */
   22.52 - 
   22.53 - static bfd_boolean
   22.54 -@@ -3740,6 +3773,12 @@
   22.55 - 	    return FALSE;
   22.56 - 	}
   22.57 - 
   22.58 -+      /* If any dynamic relocs apply to a read-only section,
   22.59 -+         then we need a DT_TEXTREL entry.  */
   22.60 -+      if ((info->flags & DF_TEXTREL) == 0)
   22.61 -+        elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
   22.62 -+                                (PTR) info);
   22.63 -+
   22.64 -       if ((info->flags & DF_TEXTREL) != 0)
   22.65 - 	{
   22.66 - 	  if (!add_dynamic_entry (DT_TEXTREL, 0))
    23.1 --- a/patches/binutils/2.15/700-bfd-hash-tweak.patch	Mon Jul 28 21:08:01 2008 +0000
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,24 +0,0 @@
    23.4 -Signed-off-by: dank@kegel.com
    23.5 -
    23.6 -Raising the size of the hash table is a noticable win when linking 
    23.7 -at least one large app.  
    23.8 -
    23.9 -There was a patch,
   23.10 -http://sources.redhat.com/ml/binutils/2004-06/msg00165.html
   23.11 -to do this dynamically.  No idea why that didn't make it in.
   23.12 -So this tiny change to raise the default size is just
   23.13 -a stopgap for now.
   23.14 -
   23.15 -
   23.16 ---- binutils-2.15/bfd/hash.c.old	2003-12-01 01:33:01.000000000 -0500
   23.17 -+++ binutils-2.15/bfd/hash.c	2006-03-01 16:26:26.701991000 -0500
   23.18 -@@ -295,7 +295,7 @@
   23.19 - */
   23.20 - 
   23.21 - /* The default number of entries to use when creating a hash table.  */
   23.22 --#define DEFAULT_SIZE (4051)
   23.23 -+#define DEFAULT_SIZE (32749)
   23.24 - 
   23.25 - /* Create a new hash table, given a number of entries.  */
   23.26 - 
   23.27 -
    24.1 --- a/patches/binutils/2.15/710-allow-gcc-4.0.patch	Mon Jul 28 21:08:01 2008 +0000
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,75 +0,0 @@
    24.4 -Fix found here: http://www.freelists.org/archives/openbeos/11-2005/msg00090.html
    24.5 -
    24.6 -Fixes:
    24.7 -In file included from ./targ-cpu.h:1,
    24.8 -                 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,
    24.9 -                 from ./obj-format.h:1,
   24.10 -                 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,
   24.11 -                 from ./targ-env.h:1,
   24.12 -                 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,
   24.13 -                 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:
   24.14 -/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
   24.15 -make[3]: *** [app.o] Error 1
   24.16 -make[3]: Leaving directory `/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/build-binutils/gas'
   24.17 -
   24.18 -when building binutils-2.15 with gcc-4.0
   24.19 -
   24.20 -
   24.21 -diff -ur binutils-2.15.old/gas/as.h binutils-2.15/gas/as.h
   24.22 ---- binutils-2.15.old/gas/as.h	2003-11-22 18:14:21.000000000 -0800
   24.23 -+++ binutils-2.15/gas/as.h	2006-02-14 22:05:35.000000000 -0800
   24.24 -@@ -605,7 +605,26 @@
   24.25 - struct expressionS;
   24.26 - struct fix;
   24.27 - typedef struct symbol symbolS;
   24.28 --struct relax_type;
   24.29 -+
   24.30 -+/* JF moved this here from as.h under the theory that nobody except MACHINE.c
   24.31 -+   and write.c care about it anyway.  */
   24.32 -+/* [zooey]: the above no longer holds with gcc4, as it keeps bugging about
   24.33 -+            incomplete element types in arrays, if relax_type isn't defined
   24.34 -+            here. So I moved the definition back from tc.h to here. */
   24.35 -+struct relax_type
   24.36 -+{
   24.37 -+  /* Forward reach. Signed number. > 0.  */
   24.38 -+  long rlx_forward;
   24.39 -+  /* Backward reach. Signed number. < 0.  */
   24.40 -+  long rlx_backward;
   24.41 -+
   24.42 -+  /* Bytes length of this address.  */
   24.43 -+  unsigned char rlx_length;
   24.44 -+
   24.45 -+  /* Next longer relax-state.  0 means there is no 'next' relax-state.  */
   24.46 -+  relax_substateT rlx_more;
   24.47 -+};
   24.48 -+
   24.49 - typedef struct frag fragS;
   24.50 - 
   24.51 - #ifdef BFD_ASSEMBLER
   24.52 -diff -ur binutils-2.15.old/gas/tc.h binutils-2.15/gas/tc.h
   24.53 ---- binutils-2.15.old/gas/tc.h	2003-12-03 15:39:38.000000000 -0800
   24.54 -+++ binutils-2.15/gas/tc.h	2006-02-14 22:03:35.000000000 -0800
   24.55 -@@ -24,23 +24,6 @@
   24.56 - 
   24.57 - extern const pseudo_typeS md_pseudo_table[];
   24.58 - 
   24.59 --/* JF moved this here from as.h under the theory that nobody except MACHINE.c
   24.60 --   and write.c care about it anyway.  */
   24.61 --
   24.62 --struct relax_type
   24.63 --{
   24.64 --  /* Forward reach. Signed number. > 0.  */
   24.65 --  long rlx_forward;
   24.66 --  /* Backward reach. Signed number. < 0.  */
   24.67 --  long rlx_backward;
   24.68 --
   24.69 --  /* Bytes length of this address.  */
   24.70 --  unsigned char rlx_length;
   24.71 --
   24.72 --  /* Next longer relax-state.  0 means there is no 'next' relax-state.  */
   24.73 --  relax_substateT rlx_more;
   24.74 --};
   24.75 --
   24.76 - typedef struct relax_type relax_typeS;
   24.77 - 
   24.78 - extern const int md_reloc_size;	/* Size of a relocation record */
    25.1 --- a/patches/binutils/2.15/720-psignal.patch	Mon Jul 28 21:08:01 2008 +0000
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,40 +0,0 @@
    25.4 -Make psignal prototype in libiberty match that in glibc.
    25.5 -
    25.6 -Fixes:
    25.7 -
    25.8 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
    25.9 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
   25.10 -/usr/include/signal.h:131: prototype declaration
   25.11 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
   25.12 -/usr/include/signal.h:131: prototype declaration
   25.13 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
   25.14 -mprotect... make[1]: *** [strsignal.o] Error 1
   25.15 -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'
   25.16 -make: *** [all-libiberty] Error 2
   25.17 -
   25.18 -when building on red hat 7.1
   25.19 -though it's a bit of a mystery why libiberty's psignal is being compiled at
   25.20 -all, since red hat 7.1's glibc supports psignal (hence the error message)
   25.21 -
   25.22 ---- binutils-2.15/libiberty/strsignal.c.old	2005-04-18 13:57:40.000000000 -0700
   25.23 -+++ binutils-2.15/libiberty/strsignal.c	2005-04-18 13:59:09.000000000 -0700
   25.24 -@@ -544,7 +544,7 @@
   25.25 - 
   25.26 - /*
   25.27 - 
   25.28 --@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
   25.29 -+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
   25.30 - 
   25.31 - Print @var{message} to the standard error, followed by a colon,
   25.32 - followed by the description of the signal specified by @var{signo},
   25.33 -@@ -557,9 +557,7 @@
   25.34 - #ifndef HAVE_PSIGNAL
   25.35 - 
   25.36 - void
   25.37 --psignal (signo, message)
   25.38 --  unsigned signo;
   25.39 --  char *message;
   25.40 -+psignal (int signo, const char *message)
   25.41 - {
   25.42 -   if (signal_names == NULL)
   25.43 -     {
    26.1 --- a/patches/binutils/2.15/730-solaris-qsort.patch	Mon Jul 28 21:08:01 2008 +0000
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,22 +0,0 @@
    26.4 -See http://sources.redhat.com/ml/binutils/2004-06/msg00114.html
    26.5 -
    26.6 ---- src/bfd/elflink.c.org	2004-07-05 09:11:42.920597000 -0400
    26.7 -+++ src/bfd/elflink.c	2004-07-05 09:12:59.240847000 -0400
    26.8 -@@ -2700,7 +2700,7 @@
    26.9 -     return vdiff > 0 ? 1 : -1;
   26.10 -   else
   26.11 -     {
   26.12 --      long sdiff = h1->root.u.def.section - h2->root.u.def.section;
   26.13 -+      long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;
   26.14 -       if (sdiff != 0)
   26.15 - 	return sdiff > 0 ? 1 : -1;
   26.16 -     }
   26.17 -@@ -3954,7 +3954,7 @@
   26.18 - 		i = idx + 1;
   26.19 - 	      else
   26.20 - 		{
   26.21 --		  long sdiff = slook - h->root.u.def.section;
   26.22 -+		  long sdiff = slook->id - h->root.u.def.section->id;
   26.23 - 		  if (sdiff < 0)
   26.24 - 		    j = idx;
   26.25 - 		  else if (sdiff > 0)
    27.1 --- a/patches/binutils/2.15/740-vmx.patch	Mon Jul 28 21:08:01 2008 +0000
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,45 +0,0 @@
    27.4 -Grabbed with
    27.5 -wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/ppc-opc.c.diff?r1=1.70&r2=1.71&cvsroot=src'
    27.6 -See 
    27.7 -http://mail.gnu.org/archive/html/bug-binutils/2004-05/msg00071.html
    27.8 -and
    27.9 -http://sources.redhat.com/ml/binutils-cvs/2004-05/msg00111.html
   27.10 -
   27.11 -This fixes problems like
   27.12 -{standard input}: Assembler messages:
   27.13 -{standard input}:1: Error: Unrecognized opcode: `dssall' 
   27.14 -which show up in binutils-2.15 when building the Linux kernel,
   27.15 -or possibly failed compilations when building setjmp/longjmp in glibc.
   27.16 -
   27.17 -An alternative fix would be to pass -many to the assembler.
   27.18 -A patch to do that for glibc is at
   27.19 -wget 'http://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2004-05&msgid=40B36E8C.9030609%40us.ibm.com'
   27.20 -Yet another, better, fix would be for gcc to generate assembly
   27.21 -that told the assembler which processor type to use.
   27.22 -Presumably the Linux kernel sources would need a fix, too.
   27.23 -Probably better to just fix binutils to accept sources that it used to.
   27.24 -
   27.25 -
   27.26 -===================================================================
   27.27 -RCS file: /cvs/src/src/opcodes/ppc-opc.c,v
   27.28 -retrieving revision 1.70
   27.29 -retrieving revision 1.71
   27.30 -diff -u -r1.70 -r1.71
   27.31 ---- src/opcodes/ppc-opc.c	2004/05/05 13:43:36	1.70
   27.32 -+++ src/opcodes/ppc-opc.c	2004/05/19 05:11:48	1.71
   27.33 -@@ -1004,8 +1004,13 @@
   27.34 - 
   27.35 -   /* If only one bit of the FXM field is set, we can use the new form
   27.36 -      of the instruction, which is faster.  Unlike the Power4 branch hint
   27.37 --     encoding, this is not backward compatible.  */
   27.38 --  else if ((dialect & PPC_OPCODE_POWER4) != 0 && (value & -value) == value)
   27.39 -+     encoding, this is not backward compatible.  Do not generate the
   27.40 -+     new form unless -mpower4 has been given, or -many and the two
   27.41 -+     operand form of mfcr was used.  */
   27.42 -+  else if ((value & -value) == value
   27.43 -+	   && ((dialect & PPC_OPCODE_POWER4) != 0
   27.44 -+	       || ((dialect & PPC_OPCODE_ANY) != 0
   27.45 -+		   && (insn & (0x3ff << 1)) == 19 << 1)))
   27.46 -     insn |= 1 << 20;
   27.47 - 
   27.48 -   /* Any other value on mfcr is an error.  */
    28.1 --- a/patches/binutils/2.15/750-arm-undef-imm.patch	Mon Jul 28 21:08:01 2008 +0000
    28.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.3 @@ -1,51 +0,0 @@
    28.4 -From http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/config/tc-arm.c.diff?r1=1.168&r2=1.169&cvsroot=src
    28.5 -See also http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-July/023128.html,
    28.6 -"[CRITICAL PATCH] 2.6: fix silent build error]"
    28.7 -
    28.8 -Revision 1.169, Fri Jul 2 11:12:29 2004 UTC (19 hours, 4 minutes ago) by nickc
    28.9 -Branch: MAIN
   28.10 -CVS Tags: binutils_latest_snapshot, HEAD
   28.11 -Changes since 1.168: +14 -1 lines
   28.12 -
   28.13 -(md_apply_fix3:BFD_RELOC_ARM_IMMEDIATE): Do not allow values which have come
   28.14 -from undefined symbols.
   28.15 -Always consider this fixup to have been processed as a reloc cannot be
   28.16 -generated for it.
   28.17 -
   28.18 -
   28.19 -===================================================================
   28.20 -RCS file: /cvs/src/src/gas/config/tc-arm.c,v
   28.21 -retrieving revision 1.168
   28.22 -retrieving revision 1.169
   28.23 -diff -u -r1.168 -r1.169
   28.24 ---- src/gas/config/tc-arm.c	2004/04/30 10:51:12	1.168
   28.25 -+++ src/gas/config/tc-arm.c	2004/07/02 11:12:29	1.169
   28.26 -@@ -12186,6 +12186,20 @@
   28.27 -   switch (fixP->fx_r_type)
   28.28 -     {
   28.29 -     case BFD_RELOC_ARM_IMMEDIATE:
   28.30 -+      /* We claim that this fixup has been processed here,
   28.31 -+	 even if in fact we generate an error because we do
   28.32 -+	 not have a reloc for it, so tc_gen_reloc will reject it.  */
   28.33 -+      fixP->fx_done = 1;
   28.34 -+
   28.35 -+      if (fixP->fx_addsy
   28.36 -+	  && ! S_IS_DEFINED (fixP->fx_addsy))
   28.37 -+	{
   28.38 -+	  as_bad_where (fixP->fx_file, fixP->fx_line,
   28.39 -+			_("undefined symbol %s used as an immediate value"),
   28.40 -+			S_GET_NAME (fixP->fx_addsy));
   28.41 -+	  break;
   28.42 -+	}
   28.43 -+
   28.44 -       newimm = validate_immediate (value);
   28.45 -       temp = md_chars_to_number (buf, INSN_SIZE);
   28.46 - 
   28.47 -@@ -12202,7 +12216,6 @@
   28.48 - 
   28.49 -       newimm |= (temp & 0xfffff000);
   28.50 -       md_number_to_chars (buf, (valueT) newimm, INSN_SIZE);
   28.51 --      fixP->fx_done = 1;
   28.52 -       break;
   28.53 - 
   28.54 -     case BFD_RELOC_ARM_ADRL_IMMEDIATE:
    29.1 --- a/patches/binutils/2.15/760-skip-comments.patch	Mon Jul 28 21:08:01 2008 +0000
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,101 +0,0 @@
    29.4 -Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
    29.5 -Fixes
    29.6 -localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
    29.7 -when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
    29.8 -
    29.9 -Paths adjusted to match crosstool's patcher.
   29.10 -
   29.11 -Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
   29.12 -From: Andreas Schwab <schwab at suse dot de>
   29.13 -To: Nathan Sidwell <nathan at codesourcery dot com>
   29.14 -Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
   29.15 -Date: Fri, 23 Apr 2004 22:27:19 +0200
   29.16 -Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
   29.17 -
   29.18 -Nathan Sidwell <nathan@codesourcery.com> writes:
   29.19 -
   29.20 -> Index: read.c
   29.21 -> ===================================================================
   29.22 -> RCS file: /cvs/src/src/gas/read.c,v
   29.23 -> retrieving revision 1.76
   29.24 -> diff -c -3 -p -r1.76 read.c
   29.25 -> *** read.c	12 Mar 2004 17:48:12 -0000	1.76
   29.26 -> --- read.c	18 Mar 2004 09:56:05 -0000
   29.27 -> *************** read_a_source_file (char *name)
   29.28 -> *** 1053,1059 ****
   29.29 ->   #endif
   29.30 ->   	  input_line_pointer--;
   29.31 ->   	  /* Report unknown char as ignored.  */
   29.32 -> ! 	  ignore_rest_of_line ();
   29.33 ->   	}
   29.34 ->   
   29.35 ->   #ifdef md_after_pass_hook
   29.36 -> --- 1053,1059 ----
   29.37 ->   #endif
   29.38 ->   	  input_line_pointer--;
   29.39 ->   	  /* Report unknown char as ignored.  */
   29.40 -> ! 	  demand_empty_rest_of_line ();
   29.41 ->   	}
   29.42 ->   
   29.43 ->   #ifdef md_after_pass_hook
   29.44 -
   29.45 -This means that the unknown character is no longer ignored, despite the
   29.46 -comment.  As a side effect a line starting with a line comment character
   29.47 -not followed by APP in NO_APP mode now triggers an error instead of just a
   29.48 -warning, breaking builds of glibc on m68k-linux.  Earlier in
   29.49 -read_a_source_file where #APP is handled there is another comment that
   29.50 -claims that unknown comments are ignored, when in fact they aren't (only
   29.51 -the initial line comment character is skipped).
   29.52 -
   29.53 -Note that the presence of #APP will mess up the line counters, but
   29.54 -that appears to be difficult to fix.
   29.55 -
   29.56 -Andreas.
   29.57 -
   29.58 -2004-04-23  Andreas Schwab  <schwab@suse.de>
   29.59 -
   29.60 -	* read.c (read_a_source_file): Ignore unknown text after line
   29.61 -	comment character.  Fix misleading comment.
   29.62 -
   29.63 ---- binutils/gas/read.c.~1.78.~	2004-04-23 08:58:23.000000000 +0200
   29.64 -+++ binutils/gas/read.c	2004-04-23 21:49:01.000000000 +0200
   29.65 -@@ -1,6 +1,6 @@
   29.66 - /* read.c - read a source file -
   29.67 -    Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
   29.68 --   1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
   29.69 -+   1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
   29.70 - 
   29.71 - This file is part of GAS, the GNU Assembler.
   29.72 - 
   29.73 -@@ -950,10 +950,14 @@ read_a_source_file (char *name)
   29.74 - 	      unsigned int new_length;
   29.75 - 	      char *tmp_buf = 0;
   29.76 - 
   29.77 --	      bump_line_counters ();
   29.78 - 	      s = input_line_pointer;
   29.79 - 	      if (strncmp (s, "APP\n", 4))
   29.80 --		continue;	/* We ignore it */
   29.81 -+		{
   29.82 -+		  /* We ignore it */
   29.83 -+		  ignore_rest_of_line ();
   29.84 -+		  continue;
   29.85 -+		}
   29.86 -+	      bump_line_counters ();
   29.87 - 	      s += 4;
   29.88 - 
   29.89 - 	      sb_new (&sbuf);
   29.90 -@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
   29.91 - 	    continue;
   29.92 - #endif
   29.93 - 	  input_line_pointer--;
   29.94 --	  /* Report unknown char as ignored.  */
   29.95 -+	  /* Report unknown char as error.  */
   29.96 - 	  demand_empty_rest_of_line ();
   29.97 - 	}
   29.98 - 
   29.99 -
  29.100 --- 
  29.101 -Andreas Schwab, SuSE Labs, schwab@suse.de
  29.102 -SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
  29.103 -Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
  29.104 -"And now for something completely different."
    30.1 --- a/patches/binutils/2.15/770-cross-gprof.patch	Mon Jul 28 21:08:01 2008 +0000
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,22 +0,0 @@
    30.4 ---- binutils-2.15/configure.old	2004-07-21 21:36:47.000000000 -0700
    30.5 -+++ binutils-2.15/configure	2004-07-21 21:37:08.000000000 -0700
    30.6 -@@ -999,7 +999,7 @@
    30.7 - 
    30.8 - # Some tools are only suitable for building in a "native" situation.
    30.9 - # Remove these if host!=target.  
   30.10 --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"
   30.11 -+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"
   30.12 - 
   30.13 - # Similarly, some are only suitable for cross toolchains.
   30.14 - # Remove these if host=target.
   30.15 ---- binutils-2.15/configure.in.old	2004-07-21 21:37:19.000000000 -0700
   30.16 -+++ binutils-2.15/configure.in	2004-07-21 21:37:34.000000000 -0700
   30.17 -@@ -236,7 +236,7 @@
   30.18 - 
   30.19 - # Some tools are only suitable for building in a "native" situation.
   30.20 - # Remove these if host!=target.  
   30.21 --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"
   30.22 -+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"
   30.23 - 
   30.24 - # Similarly, some are only suitable for cross toolchains.
   30.25 - # Remove these if host=target.
    31.1 --- a/patches/binutils/2.15/780-gccpr15247-fix.patch	Mon Jul 28 21:08:01 2008 +0000
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,192 +0,0 @@
    31.4 -See
    31.5 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15247
    31.6 -
    31.7 -Fixes spurious error
    31.8 -/tmp/ccvNi4ou.s: Assembler messages:
    31.9 -/tmp/ccvNi4ou.s:2310: Error: Illegal operands: There are only 32 single precision f registers; [0-31]
   31.10 -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
   31.11 -
   31.12 -when compiling glibc's dosincos.c with gcc-3.4.0
   31.13 -
   31.14 -===================================================================
   31.15 -RCS file: /cvs/src/src/opcodes/sparc-opc.c,v
   31.16 -retrieving revision 1.9
   31.17 -retrieving revision 1.10
   31.18 -diff -u -r1.9 -r1.10
   31.19 ---- src/opcodes/sparc-opc.c	2004/01/18 23:46:32	1.9
   31.20 -+++ src/opcodes/sparc-opc.c	2004/04/20 10:23:51	1.10
   31.21 -@@ -1273,110 +1273,72 @@
   31.22 - #define FM_DF 2		/* v9 */
   31.23 - #define FM_QF 3		/* v9 */
   31.24 - 
   31.25 --#define fmovicc(opcode, fpsize, cond, flags) /* v9 */ \
   31.26 --{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z,f,g", flags, v9 }, \
   31.27 --{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z,f,g", flags, v9 }
   31.28 --
   31.29 --#define fmovfcc(opcode, fpsize, fcond, flags) /* v9 */ \
   31.30 --{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags, v9 }, \
   31.31 --{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags, v9 }, \
   31.32 --{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags, v9 }, \
   31.33 --{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags, v9 }
   31.34 -+#define fmoviccx(opcode, fpsize, args, cond, flags) /* v9 */ \
   31.35 -+{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z," args, flags, v9 }, \
   31.36 -+{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z," args, flags, v9 }
   31.37 -+
   31.38 -+#define fmovfccx(opcode, fpsize, args, fcond, flags) /* v9 */ \
   31.39 -+{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags, v9 }, \
   31.40 -+{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags, v9 }, \
   31.41 -+{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags, v9 }, \
   31.42 -+{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags, v9 }
   31.43 - 
   31.44 - /* FIXME: use fmovicc/fmovfcc? */ /* v9 */
   31.45 --#define fmovcc(opcode, fpsize, cond, fcond, flags) /* v9 */ \
   31.46 --{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z,f,g", flags | F_FLOAT, v9 }, \
   31.47 --{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags | F_FLOAT, v9 }, \
   31.48 --{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z,f,g", flags | F_FLOAT, v9 }, \
   31.49 --{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags | F_FLOAT, v9 }, \
   31.50 --{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags | F_FLOAT, v9 }, \
   31.51 --{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags | F_FLOAT, v9 }
   31.52 --
   31.53 --/* v9 */ fmovcc  ("fmovda",	FM_DF, CONDA, FCONDA, 0),
   31.54 --/* v9 */ fmovcc  ("fmovqa",	FM_QF, CONDA, FCONDA, 0),
   31.55 --/* v9 */ fmovcc  ("fmovsa",	FM_SF, CONDA, FCONDA, 0),
   31.56 --/* v9 */ fmovicc ("fmovdcc",	FM_DF, CONDCC, 0),
   31.57 --/* v9 */ fmovicc ("fmovqcc",	FM_QF, CONDCC, 0),
   31.58 --/* v9 */ fmovicc ("fmovscc",	FM_SF, CONDCC, 0),
   31.59 --/* v9 */ fmovicc ("fmovdcs",	FM_DF, CONDCS, 0),
   31.60 --/* v9 */ fmovicc ("fmovqcs",	FM_QF, CONDCS, 0),
   31.61 --/* v9 */ fmovicc ("fmovscs",	FM_SF, CONDCS, 0),
   31.62 --/* v9 */ fmovcc  ("fmovde",	FM_DF, CONDE, FCONDE, 0),
   31.63 --/* v9 */ fmovcc  ("fmovqe",	FM_QF, CONDE, FCONDE, 0),
   31.64 --/* v9 */ fmovcc  ("fmovse",	FM_SF, CONDE, FCONDE, 0),
   31.65 --/* v9 */ fmovcc  ("fmovdg",	FM_DF, CONDG, FCONDG, 0),
   31.66 --/* v9 */ fmovcc  ("fmovqg",	FM_QF, CONDG, FCONDG, 0),
   31.67 --/* v9 */ fmovcc  ("fmovsg",	FM_SF, CONDG, FCONDG, 0),
   31.68 --/* v9 */ fmovcc  ("fmovdge",	FM_DF, CONDGE, FCONDGE, 0),
   31.69 --/* v9 */ fmovcc  ("fmovqge",	FM_QF, CONDGE, FCONDGE, 0),
   31.70 --/* v9 */ fmovcc  ("fmovsge",	FM_SF, CONDGE, FCONDGE, 0),
   31.71 --/* v9 */ fmovicc ("fmovdgeu",	FM_DF, CONDGEU, F_ALIAS),
   31.72 --/* v9 */ fmovicc ("fmovqgeu",	FM_QF, CONDGEU, F_ALIAS),
   31.73 --/* v9 */ fmovicc ("fmovsgeu",	FM_SF, CONDGEU, F_ALIAS),
   31.74 --/* v9 */ fmovicc ("fmovdgu",	FM_DF, CONDGU, 0),
   31.75 --/* v9 */ fmovicc ("fmovqgu",	FM_QF, CONDGU, 0),
   31.76 --/* v9 */ fmovicc ("fmovsgu",	FM_SF, CONDGU, 0),
   31.77 --/* v9 */ fmovcc  ("fmovdl",	FM_DF, CONDL, FCONDL, 0),
   31.78 --/* v9 */ fmovcc  ("fmovql",	FM_QF, CONDL, FCONDL, 0),
   31.79 --/* v9 */ fmovcc  ("fmovsl",	FM_SF, CONDL, FCONDL, 0),
   31.80 --/* v9 */ fmovcc  ("fmovdle",	FM_DF, CONDLE, FCONDLE, 0),
   31.81 --/* v9 */ fmovcc  ("fmovqle",	FM_QF, CONDLE, FCONDLE, 0),
   31.82 --/* v9 */ fmovcc  ("fmovsle",	FM_SF, CONDLE, FCONDLE, 0),
   31.83 --/* v9 */ fmovicc ("fmovdleu",	FM_DF, CONDLEU, 0),
   31.84 --/* v9 */ fmovicc ("fmovqleu",	FM_QF, CONDLEU, 0),
   31.85 --/* v9 */ fmovicc ("fmovsleu",	FM_SF, CONDLEU, 0),
   31.86 --/* v9 */ fmovfcc ("fmovdlg",	FM_DF, FCONDLG, 0),
   31.87 --/* v9 */ fmovfcc ("fmovqlg",	FM_QF, FCONDLG, 0),
   31.88 --/* v9 */ fmovfcc ("fmovslg",	FM_SF, FCONDLG, 0),
   31.89 --/* v9 */ fmovicc ("fmovdlu",	FM_DF, CONDLU, F_ALIAS),
   31.90 --/* v9 */ fmovicc ("fmovqlu",	FM_QF, CONDLU, F_ALIAS),
   31.91 --/* v9 */ fmovicc ("fmovslu",	FM_SF, CONDLU, F_ALIAS),
   31.92 --/* v9 */ fmovcc  ("fmovdn",	FM_DF, CONDN, FCONDN, 0),
   31.93 --/* v9 */ fmovcc  ("fmovqn",	FM_QF, CONDN, FCONDN, 0),
   31.94 --/* v9 */ fmovcc  ("fmovsn",	FM_SF, CONDN, FCONDN, 0),
   31.95 --/* v9 */ fmovcc  ("fmovdne",	FM_DF, CONDNE, FCONDNE, 0),
   31.96 --/* v9 */ fmovcc  ("fmovqne",	FM_QF, CONDNE, FCONDNE, 0),
   31.97 --/* v9 */ fmovcc  ("fmovsne",	FM_SF, CONDNE, FCONDNE, 0),
   31.98 --/* v9 */ fmovicc ("fmovdneg",	FM_DF, CONDNEG, 0),
   31.99 --/* v9 */ fmovicc ("fmovqneg",	FM_QF, CONDNEG, 0),
  31.100 --/* v9 */ fmovicc ("fmovsneg",	FM_SF, CONDNEG, 0),
  31.101 --/* v9 */ fmovcc  ("fmovdnz",	FM_DF, CONDNZ, FCONDNZ, F_ALIAS),
  31.102 --/* v9 */ fmovcc  ("fmovqnz",	FM_QF, CONDNZ, FCONDNZ, F_ALIAS),
  31.103 --/* v9 */ fmovcc  ("fmovsnz",	FM_SF, CONDNZ, FCONDNZ, F_ALIAS),
  31.104 --/* v9 */ fmovfcc ("fmovdo",	FM_DF, FCONDO, 0),
  31.105 --/* v9 */ fmovfcc ("fmovqo",	FM_QF, FCONDO, 0),
  31.106 --/* v9 */ fmovfcc ("fmovso",	FM_SF, FCONDO, 0),
  31.107 --/* v9 */ fmovicc ("fmovdpos",	FM_DF, CONDPOS, 0),
  31.108 --/* v9 */ fmovicc ("fmovqpos",	FM_QF, CONDPOS, 0),
  31.109 --/* v9 */ fmovicc ("fmovspos",	FM_SF, CONDPOS, 0),
  31.110 --/* v9 */ fmovfcc ("fmovdu",	FM_DF, FCONDU, 0),
  31.111 --/* v9 */ fmovfcc ("fmovqu",	FM_QF, FCONDU, 0),
  31.112 --/* v9 */ fmovfcc ("fmovsu",	FM_SF, FCONDU, 0),
  31.113 --/* v9 */ fmovfcc ("fmovdue",	FM_DF, FCONDUE, 0),
  31.114 --/* v9 */ fmovfcc ("fmovque",	FM_QF, FCONDUE, 0),
  31.115 --/* v9 */ fmovfcc ("fmovsue",	FM_SF, FCONDUE, 0),
  31.116 --/* v9 */ fmovfcc ("fmovdug",	FM_DF, FCONDUG, 0),
  31.117 --/* v9 */ fmovfcc ("fmovqug",	FM_QF, FCONDUG, 0),
  31.118 --/* v9 */ fmovfcc ("fmovsug",	FM_SF, FCONDUG, 0),
  31.119 --/* v9 */ fmovfcc ("fmovduge",	FM_DF, FCONDUGE, 0),
  31.120 --/* v9 */ fmovfcc ("fmovquge",	FM_QF, FCONDUGE, 0),
  31.121 --/* v9 */ fmovfcc ("fmovsuge",	FM_SF, FCONDUGE, 0),
  31.122 --/* v9 */ fmovfcc ("fmovdul",	FM_DF, FCONDUL, 0),
  31.123 --/* v9 */ fmovfcc ("fmovqul",	FM_QF, FCONDUL, 0),
  31.124 --/* v9 */ fmovfcc ("fmovsul",	FM_SF, FCONDUL, 0),
  31.125 --/* v9 */ fmovfcc ("fmovdule",	FM_DF, FCONDULE, 0),
  31.126 --/* v9 */ fmovfcc ("fmovqule",	FM_QF, FCONDULE, 0),
  31.127 --/* v9 */ fmovfcc ("fmovsule",	FM_SF, FCONDULE, 0),
  31.128 --/* v9 */ fmovicc ("fmovdvc",	FM_DF, CONDVC, 0),
  31.129 --/* v9 */ fmovicc ("fmovqvc",	FM_QF, CONDVC, 0),
  31.130 --/* v9 */ fmovicc ("fmovsvc",	FM_SF, CONDVC, 0),
  31.131 --/* v9 */ fmovicc ("fmovdvs",	FM_DF, CONDVS, 0),
  31.132 --/* v9 */ fmovicc ("fmovqvs",	FM_QF, CONDVS, 0),
  31.133 --/* v9 */ fmovicc ("fmovsvs",	FM_SF, CONDVS, 0),
  31.134 --/* v9 */ fmovcc  ("fmovdz",	FM_DF, CONDZ, FCONDZ, F_ALIAS),
  31.135 --/* v9 */ fmovcc  ("fmovqz",	FM_QF, CONDZ, FCONDZ, F_ALIAS),
  31.136 --/* v9 */ fmovcc  ("fmovsz",	FM_SF, CONDZ, FCONDZ, F_ALIAS),
  31.137 --
  31.138 -+#define fmovccx(opcode, fpsize, args, cond, fcond, flags) /* v9 */ \
  31.139 -+{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z," args, flags | F_FLOAT, v9 }, \
  31.140 -+{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags | F_FLOAT, v9 }, \
  31.141 -+{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z," args, flags | F_FLOAT, v9 }, \
  31.142 -+{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags | F_FLOAT, v9 }, \
  31.143 -+{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags | F_FLOAT, v9 }, \
  31.144 -+{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags | F_FLOAT, v9 }
  31.145 -+
  31.146 -+#define fmovicc(suffix, cond, flags) /* v9 */ \
  31.147 -+fmoviccx("fmovd" suffix, FM_DF, "B,H", cond, flags),		\
  31.148 -+fmoviccx("fmovq" suffix, FM_QF, "R,J", cond, flags),		\
  31.149 -+fmoviccx("fmovs" suffix, FM_SF, "f,g", cond, flags)
  31.150 -+
  31.151 -+#define fmovfcc(suffix, fcond, flags) /* v9 */ \
  31.152 -+fmovfccx("fmovd" suffix, FM_DF, "B,H", fcond, flags),		\
  31.153 -+fmovfccx("fmovq" suffix, FM_QF, "R,J", fcond, flags),		\
  31.154 -+fmovfccx("fmovs" suffix, FM_SF, "f,g", fcond, flags)
  31.155 -+
  31.156 -+#define fmovcc(suffix, cond, fcond, flags) /* v9 */ \
  31.157 -+fmovccx("fmovd" suffix, FM_DF, "B,H", cond, fcond, flags),	\
  31.158 -+fmovccx("fmovq" suffix, FM_QF, "R,J", cond, fcond, flags),	\
  31.159 -+fmovccx("fmovs" suffix, FM_SF, "f,g", cond, fcond, flags)
  31.160 -+
  31.161 -+/* v9 */ fmovcc  ("a", CONDA, FCONDA, 0),
  31.162 -+/* v9 */ fmovicc ("cc", CONDCC, 0),
  31.163 -+/* v9 */ fmovicc ("cs", CONDCS, 0),
  31.164 -+/* v9 */ fmovcc  ("e", CONDE, FCONDE, 0),
  31.165 -+/* v9 */ fmovcc  ("g", CONDG, FCONDG, 0),
  31.166 -+/* v9 */ fmovcc  ("ge", CONDGE, FCONDGE, 0),
  31.167 -+/* v9 */ fmovicc ("geu", CONDGEU, F_ALIAS),
  31.168 -+/* v9 */ fmovicc ("gu", CONDGU, 0),
  31.169 -+/* v9 */ fmovcc  ("l", CONDL, FCONDL, 0),
  31.170 -+/* v9 */ fmovcc  ("le", CONDLE, FCONDLE, 0),
  31.171 -+/* v9 */ fmovicc ("leu", CONDLEU, 0),
  31.172 -+/* v9 */ fmovfcc ("lg", FCONDLG, 0),
  31.173 -+/* v9 */ fmovicc ("lu", CONDLU, F_ALIAS),
  31.174 -+/* v9 */ fmovcc  ("n", CONDN, FCONDN, 0),
  31.175 -+/* v9 */ fmovcc  ("ne", CONDNE, FCONDNE, 0),
  31.176 -+/* v9 */ fmovicc ("neg", CONDNEG, 0),
  31.177 -+/* v9 */ fmovcc  ("nz", CONDNZ, FCONDNZ, F_ALIAS),
  31.178 -+/* v9 */ fmovfcc ("o", FCONDO, 0),
  31.179 -+/* v9 */ fmovicc ("pos", CONDPOS, 0),
  31.180 -+/* v9 */ fmovfcc ("u", FCONDU, 0),
  31.181 -+/* v9 */ fmovfcc ("ue", FCONDUE, 0),
  31.182 -+/* v9 */ fmovfcc ("ug", FCONDUG, 0),
  31.183 -+/* v9 */ fmovfcc ("uge", FCONDUGE, 0),
  31.184 -+/* v9 */ fmovfcc ("ul", FCONDUL, 0),
  31.185 -+/* v9 */ fmovfcc ("ule", FCONDULE, 0),
  31.186 -+/* v9 */ fmovicc ("vc", CONDVC, 0),
  31.187 -+/* v9 */ fmovicc ("vs", CONDVS, 0),
  31.188 -+/* v9 */ fmovcc  ("z", CONDZ, FCONDZ, F_ALIAS),
  31.189 -+
  31.190 -+#undef fmoviccx /* v9 */
  31.191 -+#undef fmovfccx /* v9 */
  31.192 -+#undef fmovccx /* v9 */
  31.193 - #undef fmovicc /* v9 */
  31.194 - #undef fmovfcc /* v9 */
  31.195 - #undef fmovcc /* v9 */
    32.1 --- a/patches/binutils/2.15/790-ld-callahan.patch	Mon Jul 28 21:08:01 2008 +0000
    32.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.3 @@ -1,677 +0,0 @@
    32.4 -Signed-off-by: dank@kegel.com
    32.5 -Fixes ld speed issue. 
    32.6 -See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html
    32.7 -See thread "Re: optimizations for 3x speedup in ld",
    32.8 -http://sources.redhat.com/ml/binutils/2005-03/msg00847.html
    32.9 -
   32.10 -Wildcard section matching enhancement, backported from the binutils CVS tree.
   32.11 -Here's the CVS log comment from the original change to ldlang.c:
   32.12 -
   32.13 -revision 1.177
   32.14 -date: 2005/04/06 15:33:02;  author: jakub;  state: Exp;  lines: +438 -51
   32.15 -2005-04-06  Jakub Jelinek  <jakub@redhat.com>
   32.16 -
   32.17 -        * ldlang.c: Formatting.
   32.18 -        (walk_wild_consider_section): Remember return value from wildcardp.
   32.19 -        (is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen.
   32.20 -        (wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen.
   32.21 -
   32.22 -2005-04-06  Robert O'Callahan  <rocallahan@novell.com>
   32.23 -
   32.24 -        * ld.h (lean_section_userdata_type): Remove.
   32.25 -        (fat_section_userdata_type): Remove file field.
   32.26 -        (SECTION_USERDATA_SIZE): Remove.
   32.27 -        * ldlang.c (init_os): Eliminate initialization of unused
   32.28 -        lean_section_userdata_type.
   32.29 -
   32.30 -        * ldlang.h (callback_t, walk_wild_section_handler_t): New
   32.31 -        typedefs.
   32.32 -        (struct lang_wild_statement_struct): Add walk_wild_section_handler
   32.33 -        and handler_data fields.
   32.34 -        * ldlang.c (callback_t): Removed.
   32.35 -        (walk_wild_consider_section, walk_wild_section_general,
   32.36 -        section_iterator_callback, find_section, is_simple_wild,
   32.37 -        match_simple_wild, walk_wild_section_specs1_wild0,
   32.38 -        walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1,
   32.39 -        walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2,
   32.40 -        wild_spec_can_overlap, analyze_walk_wild_section_handler): New
   32.41 -        functions.
   32.42 -        (lang_add_wild): Call analyze_walk_wild_section_handler.
   32.43 -        (walk_wild_section): Renamed to walk_wild_section_general and
   32.44 -        created a wrapper function.
   32.45 -        (section_iterator_callback_data): New typedef.
   32.46 -
   32.47 -Note that bfd_get_section_by_name_if didn't exist in 2.15, so it was backported
   32.48 -as well.
   32.49 -
   32.50 ---- binutils-2.15/bfd/bfd-in2.h.old	2004-05-17 15:35:56.000000000 -0400
   32.51 -+++ binutils-2.15/bfd/bfd-in2.h	2006-02-09 11:54:45.989940000 -0500
   32.52 -@@ -1425,6 +1425,10 @@
   32.53 - 
   32.54 - asection *bfd_get_section_by_name (bfd *abfd, const char *name);
   32.55 - 
   32.56 -+asection *bfd_get_section_by_name_if (bfd *abfd, const char *name,
   32.57 -+   bfd_boolean (*operation) (bfd *, asection *, void *),
   32.58 -+   void *user_storage);
   32.59 -+
   32.60 - char *bfd_get_unique_section_name
   32.61 -    (bfd *abfd, const char *templat, int *count);
   32.62 - 
   32.63 ---- binutils-2.15/bfd/section.c.old	2003-12-01 01:33:01.000000000 -0500
   32.64 -+++ binutils-2.15/bfd/section.c	2006-01-23 14:16:54.768993000 -0500
   32.65 -@@ -801,6 +801,57 @@
   32.66 - 
   32.67 - /*
   32.68 - FUNCTION
   32.69 -+	bfd_get_section_by_name_if
   32.70 -+
   32.71 -+SYNOPSIS
   32.72 -+	asection *bfd_get_section_by_name_if
   32.73 -+	  (bfd *abfd,
   32.74 -+	   const char *name,
   32.75 -+	   bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
   32.76 -+	   void *obj);
   32.77 -+
   32.78 -+DESCRIPTION
   32.79 -+	Call the provided function @var{func} for each section
   32.80 -+	attached to the BFD @var{abfd} whose name matches @var{name},
   32.81 -+	passing @var{obj} as an argument. The function will be called
   32.82 -+	as if by
   32.83 -+
   32.84 -+|	func (abfd, the_section, obj);
   32.85 -+
   32.86 -+	It returns the first section for which @var{func} returns true,
   32.87 -+	otherwise <<NULL>>.
   32.88 -+
   32.89 -+*/
   32.90 -+
   32.91 -+asection *
   32.92 -+bfd_get_section_by_name_if (bfd *abfd, const char *name,
   32.93 -+			    bfd_boolean (*operation) (bfd *,
   32.94 -+						      asection *,
   32.95 -+						      void *),
   32.96 -+			    void *user_storage)
   32.97 -+{
   32.98 -+  struct section_hash_entry *sh;
   32.99 -+  unsigned long hash;
  32.100 -+
  32.101 -+  sh = section_hash_lookup (&abfd->section_htab, name, FALSE, FALSE);
  32.102 -+  if (sh == NULL)
  32.103 -+    return NULL;
  32.104 -+
  32.105 -+  hash = sh->root.hash;
  32.106 -+  do
  32.107 -+    {
  32.108 -+      if ((*operation) (abfd, &sh->section, user_storage))
  32.109 -+	return &sh->section;
  32.110 -+      sh = (struct section_hash_entry *) sh->root.next;
  32.111 -+    }
  32.112 -+  while (sh != NULL && sh->root.hash == hash
  32.113 -+	 && strcmp (sh->root.string, name) == 0);
  32.114 -+
  32.115 -+  return NULL;
  32.116 -+}
  32.117 -+
  32.118 -+/*
  32.119 -+FUNCTION
  32.120 - 	bfd_get_unique_section_name
  32.121 - 
  32.122 - SYNOPSIS
  32.123 ---- binutils-2.15/ld/ldlang.c.old	2004-05-17 15:36:16.000000000 -0400
  32.124 -+++ binutils-2.15/ld/ldlang.c	2006-01-23 13:40:12.745499000 -0500
  32.125 -@@ -81,9 +81,6 @@
  32.126 - static void lang_record_phdrs (void);
  32.127 - static void lang_do_version_exports_section (void);
  32.128 - 
  32.129 --typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
  32.130 --			    asection *, lang_input_statement_type *, void *);
  32.131 --
  32.132 - /* Exported variables.  */
  32.133 - lang_output_section_statement_type *abs_output_section;
  32.134 - lang_statement_list_type lang_output_section_statement;
  32.135 -@@ -138,21 +135,71 @@
  32.136 - 
  32.137 - /* Generic traversal routines for finding matching sections.  */
  32.138 - 
  32.139 -+/* Try processing a section against a wildcard.  This just calls
  32.140 -+   the callback unless the filename exclusion list is present
  32.141 -+   and excludes the file.  It's hardly ever present so this
  32.142 -+   function is very fast.  */
  32.143 -+
  32.144 -+static void
  32.145 -+walk_wild_consider_section (lang_wild_statement_type *ptr,
  32.146 -+			    lang_input_statement_type *file,
  32.147 -+			    asection *s,
  32.148 -+			    struct wildcard_list *sec,
  32.149 -+			    callback_t callback,
  32.150 -+			    void *data)
  32.151 -+{
  32.152 -+  bfd_boolean skip = FALSE;
  32.153 -+  struct name_list *list_tmp;
  32.154 -+
  32.155 -+  /* Don't process sections from files which were
  32.156 -+     excluded.  */
  32.157 -+  for (list_tmp = sec->spec.exclude_name_list;
  32.158 -+       list_tmp;
  32.159 -+       list_tmp = list_tmp->next)
  32.160 -+    {
  32.161 -+      bfd_boolean is_wildcard = wildcardp (list_tmp->name);
  32.162 -+      if (is_wildcard)
  32.163 -+	skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
  32.164 -+      else
  32.165 -+	skip = strcmp (list_tmp->name, file->filename) == 0;
  32.166 -+
  32.167 -+      /* If this file is part of an archive, and the archive is
  32.168 -+	 excluded, exclude this file.  */
  32.169 -+      if (! skip && file->the_bfd != NULL
  32.170 -+	  && file->the_bfd->my_archive != NULL
  32.171 -+	  && file->the_bfd->my_archive->filename != NULL)
  32.172 -+	{
  32.173 -+	  if (is_wildcard)
  32.174 -+	    skip = fnmatch (list_tmp->name,
  32.175 -+			    file->the_bfd->my_archive->filename,
  32.176 -+			    0) == 0;
  32.177 -+	  else
  32.178 -+	    skip = strcmp (list_tmp->name,
  32.179 -+			   file->the_bfd->my_archive->filename) == 0;
  32.180 -+	}
  32.181 -+
  32.182 -+      if (skip)
  32.183 -+	break;
  32.184 -+    }
  32.185 -+
  32.186 -+  if (!skip)
  32.187 -+    (*callback) (ptr, sec, s, file, data);
  32.188 -+}
  32.189 -+
  32.190 -+/* Lowest common denominator routine that can handle everything correctly,
  32.191 -+   but slowly.  */
  32.192 -+
  32.193 - static void
  32.194 --walk_wild_section (lang_wild_statement_type *ptr,
  32.195 --		   lang_input_statement_type *file,
  32.196 --		   callback_t callback,
  32.197 --		   void *data)
  32.198 -+walk_wild_section_general (lang_wild_statement_type *ptr,
  32.199 -+			   lang_input_statement_type *file,
  32.200 -+			   callback_t callback,
  32.201 -+			   void *data)
  32.202 - {
  32.203 -   asection *s;
  32.204 --
  32.205 --  if (file->just_syms_flag)
  32.206 --    return;
  32.207 -+  struct wildcard_list *sec;
  32.208 - 
  32.209 -   for (s = file->the_bfd->sections; s != NULL; s = s->next)
  32.210 -     {
  32.211 --      struct wildcard_list *sec;
  32.212 --
  32.213 -       sec = ptr->section_list;
  32.214 -       if (sec == NULL)
  32.215 - 	(*callback) (ptr, sec, s, file, data);
  32.216 -@@ -160,39 +207,8 @@
  32.217 -       while (sec != NULL)
  32.218 - 	{
  32.219 - 	  bfd_boolean skip = FALSE;
  32.220 --	  struct name_list *list_tmp;
  32.221 --
  32.222 --	  /* Don't process sections from files which were
  32.223 --	     excluded.  */
  32.224 --	  for (list_tmp = sec->spec.exclude_name_list;
  32.225 --	       list_tmp;
  32.226 --	       list_tmp = list_tmp->next)
  32.227 --	    {
  32.228 --	      if (wildcardp (list_tmp->name))
  32.229 --		skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
  32.230 --	      else
  32.231 --		skip = strcmp (list_tmp->name, file->filename) == 0;
  32.232 --
  32.233 --	      /* If this file is part of an archive, and the archive is
  32.234 --		 excluded, exclude this file.  */
  32.235 --	      if (! skip && file->the_bfd != NULL
  32.236 --		  && file->the_bfd->my_archive != NULL
  32.237 --		  && file->the_bfd->my_archive->filename != NULL)
  32.238 --		{
  32.239 --		  if (wildcardp (list_tmp->name))
  32.240 --		    skip = fnmatch (list_tmp->name,
  32.241 --				    file->the_bfd->my_archive->filename,
  32.242 --				    0) == 0;
  32.243 --		  else
  32.244 --		    skip = strcmp (list_tmp->name,
  32.245 --				   file->the_bfd->my_archive->filename) == 0;
  32.246 --		}
  32.247 --
  32.248 --	      if (skip)
  32.249 --		break;
  32.250 --	    }
  32.251 - 
  32.252 --	  if (!skip && sec->spec.name != NULL)
  32.253 -+	  if (sec->spec.name != NULL)
  32.254 - 	    {
  32.255 - 	      const char *sname = bfd_get_section_name (file->the_bfd, s);
  32.256 - 
  32.257 -@@ -203,13 +219,381 @@
  32.258 - 	    }
  32.259 - 
  32.260 - 	  if (!skip)
  32.261 --	    (*callback) (ptr, sec, s, file, data);
  32.262 -+	    walk_wild_consider_section (ptr, file, s, sec, callback, data);
  32.263 - 
  32.264 - 	  sec = sec->next;
  32.265 - 	}
  32.266 -     }
  32.267 - }
  32.268 - 
  32.269 -+/* Routines to find a single section given its name.  If there's more
  32.270 -+   than one section with that name, we report that.  */
  32.271 -+
  32.272 -+typedef struct
  32.273 -+{
  32.274 -+  asection *found_section;
  32.275 -+  bfd_boolean multiple_sections_found;
  32.276 -+} section_iterator_callback_data;
  32.277 -+
  32.278 -+static bfd_boolean
  32.279 -+section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data)
  32.280 -+{
  32.281 -+  section_iterator_callback_data *d = data;
  32.282 -+
  32.283 -+  if (d->found_section != NULL)
  32.284 -+    {
  32.285 -+      d->multiple_sections_found = TRUE;
  32.286 -+      return TRUE;
  32.287 -+    }
  32.288 -+
  32.289 -+  d->found_section = s;
  32.290 -+  return FALSE;
  32.291 -+}
  32.292 -+
  32.293 -+static asection *
  32.294 -+find_section (lang_input_statement_type *file,
  32.295 -+	      struct wildcard_list *sec,
  32.296 -+	      bfd_boolean *multiple_sections_found)
  32.297 -+{
  32.298 -+  section_iterator_callback_data cb_data = { NULL, FALSE };
  32.299 -+
  32.300 -+  bfd_get_section_by_name_if (file->the_bfd, sec->spec.name, 
  32.301 -+			      section_iterator_callback, &cb_data);
  32.302 -+  *multiple_sections_found = cb_data.multiple_sections_found;
  32.303 -+  return cb_data.found_section;
  32.304 -+}
  32.305 -+
  32.306 -+/* Code for handling simple wildcards without going through fnmatch,
  32.307 -+   which can be expensive because of charset translations etc.  */
  32.308 -+
  32.309 -+/* A simple wild is a literal string followed by a single '*',
  32.310 -+   where the literal part is at least 4 characters long.  */
  32.311 -+
  32.312 -+static bfd_boolean
  32.313 -+is_simple_wild (const char *name)
  32.314 -+{
  32.315 -+  size_t len = strcspn (name, "*?[");
  32.316 -+  return len >= 4 && name[len] == '*' && name[len + 1] == '\0';
  32.317 -+}
  32.318 -+
  32.319 -+static bfd_boolean
  32.320 -+match_simple_wild (const char *pattern, const char *name)
  32.321 -+{
  32.322 -+  /* The first four characters of the pattern are guaranteed valid
  32.323 -+     non-wildcard characters.  So we can go faster.  */
  32.324 -+  if (pattern[0] != name[0] || pattern[1] != name[1]
  32.325 -+      || pattern[2] != name[2] || pattern[3] != name[3])
  32.326 -+    return FALSE;
  32.327 -+
  32.328 -+  pattern += 4;
  32.329 -+  name += 4;
  32.330 -+  while (*pattern != '*')
  32.331 -+    if (*name++ != *pattern++)
  32.332 -+      return FALSE;
  32.333 -+
  32.334 -+  return TRUE;
  32.335 -+}
  32.336 -+
  32.337 -+/* Specialized, optimized routines for handling different kinds of
  32.338 -+   wildcards */
  32.339 -+
  32.340 -+static void
  32.341 -+walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr,
  32.342 -+				lang_input_statement_type *file,
  32.343 -+				callback_t callback,
  32.344 -+				void *data)
  32.345 -+{
  32.346 -+  /* We can just do a hash lookup for the section with the right name.
  32.347 -+     But if that lookup discovers more than one section with the name
  32.348 -+     (should be rare), we fall back to the general algorithm because
  32.349 -+     we would otherwise have to sort the sections to make sure they
  32.350 -+     get processed in the bfd's order.  */
  32.351 -+  bfd_boolean multiple_sections_found;
  32.352 -+  struct wildcard_list *sec0 = ptr->handler_data[0];
  32.353 -+  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  32.354 -+
  32.355 -+  if (multiple_sections_found)
  32.356 -+    walk_wild_section_general (ptr, file, callback, data);
  32.357 -+  else if (s0)
  32.358 -+    walk_wild_consider_section (ptr, file, s0, sec0, callback, data);
  32.359 -+}
  32.360 -+
  32.361 -+static void
  32.362 -+walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr,
  32.363 -+				lang_input_statement_type *file,
  32.364 -+				callback_t callback,
  32.365 -+				void *data)
  32.366 -+{
  32.367 -+  asection *s;
  32.368 -+  struct wildcard_list *wildsec0 = ptr->handler_data[0];
  32.369 -+
  32.370 -+  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  32.371 -+    {
  32.372 -+      const char *sname = bfd_get_section_name (file->the_bfd, s);
  32.373 -+      bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname);
  32.374 -+
  32.375 -+      if (!skip)
  32.376 -+	walk_wild_consider_section (ptr, file, s, wildsec0, callback, data);
  32.377 -+    }
  32.378 -+}
  32.379 -+
  32.380 -+static void
  32.381 -+walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr,
  32.382 -+				lang_input_statement_type *file,
  32.383 -+				callback_t callback,
  32.384 -+				void *data)
  32.385 -+{
  32.386 -+  asection *s;
  32.387 -+  struct wildcard_list *sec0 = ptr->handler_data[0];
  32.388 -+  struct wildcard_list *wildsec1 = ptr->handler_data[1];
  32.389 -+  bfd_boolean multiple_sections_found;
  32.390 -+  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  32.391 -+
  32.392 -+  if (multiple_sections_found)
  32.393 -+    {
  32.394 -+      walk_wild_section_general (ptr, file, callback, data);
  32.395 -+      return;
  32.396 -+    }
  32.397 -+
  32.398 -+  /* Note that if the section was not found, s0 is NULL and
  32.399 -+     we'll simply never succeed the s == s0 test below.  */
  32.400 -+  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  32.401 -+    {
  32.402 -+      /* Recall that in this code path, a section cannot satisfy more
  32.403 -+	 than one spec, so if s == s0 then it cannot match
  32.404 -+	 wildspec1.  */
  32.405 -+      if (s == s0)
  32.406 -+	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  32.407 -+      else
  32.408 -+	{
  32.409 -+	  const char *sname = bfd_get_section_name (file->the_bfd, s);
  32.410 -+	  bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
  32.411 -+
  32.412 -+	  if (!skip)
  32.413 -+	    walk_wild_consider_section (ptr, file, s, wildsec1, callback,
  32.414 -+					data);
  32.415 -+	}
  32.416 -+    }
  32.417 -+}
  32.418 -+
  32.419 -+static void
  32.420 -+walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr,
  32.421 -+				lang_input_statement_type *file,
  32.422 -+				callback_t callback,
  32.423 -+				void *data)
  32.424 -+{
  32.425 -+  asection *s;
  32.426 -+  struct wildcard_list *sec0 = ptr->handler_data[0];
  32.427 -+  struct wildcard_list *wildsec1 = ptr->handler_data[1];
  32.428 -+  struct wildcard_list *wildsec2 = ptr->handler_data[2];
  32.429 -+  bfd_boolean multiple_sections_found;
  32.430 -+  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  32.431 -+
  32.432 -+  if (multiple_sections_found)
  32.433 -+    {
  32.434 -+      walk_wild_section_general (ptr, file, callback, data);
  32.435 -+      return;
  32.436 -+    }
  32.437 -+
  32.438 -+  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  32.439 -+    {
  32.440 -+      if (s == s0)
  32.441 -+	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  32.442 -+      else
  32.443 -+	{
  32.444 -+	  const char *sname = bfd_get_section_name (file->the_bfd, s);
  32.445 -+	  bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
  32.446 -+
  32.447 -+	  if (!skip)
  32.448 -+	    walk_wild_consider_section (ptr, file, s, wildsec1, callback, data);
  32.449 -+	  else
  32.450 -+	    {
  32.451 -+	      skip = !match_simple_wild (wildsec2->spec.name, sname);
  32.452 -+	      if (!skip)
  32.453 -+		walk_wild_consider_section (ptr, file, s, wildsec2, callback,
  32.454 -+					    data);
  32.455 -+	    }
  32.456 -+	}
  32.457 -+    }
  32.458 -+}
  32.459 -+
  32.460 -+static void
  32.461 -+walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr,
  32.462 -+				lang_input_statement_type *file,
  32.463 -+				callback_t callback,
  32.464 -+				void *data)
  32.465 -+{
  32.466 -+  asection *s;
  32.467 -+  struct wildcard_list *sec0 = ptr->handler_data[0];
  32.468 -+  struct wildcard_list *sec1 = ptr->handler_data[1];
  32.469 -+  struct wildcard_list *wildsec2 = ptr->handler_data[2];
  32.470 -+  struct wildcard_list *wildsec3 = ptr->handler_data[3];
  32.471 -+  bfd_boolean multiple_sections_found;
  32.472 -+  asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1;
  32.473 -+
  32.474 -+  if (multiple_sections_found)
  32.475 -+    {
  32.476 -+      walk_wild_section_general (ptr, file, callback, data);
  32.477 -+      return;
  32.478 -+    }
  32.479 -+
  32.480 -+  s1 = find_section (file, sec1, &multiple_sections_found);
  32.481 -+  if (multiple_sections_found)
  32.482 -+    {
  32.483 -+      walk_wild_section_general (ptr, file, callback, data);
  32.484 -+      return;
  32.485 -+    }
  32.486 -+
  32.487 -+  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  32.488 -+    {
  32.489 -+      if (s == s0)
  32.490 -+	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  32.491 -+      else
  32.492 -+	if (s == s1)
  32.493 -+	  walk_wild_consider_section (ptr, file, s, sec1, callback, data);
  32.494 -+	else
  32.495 -+	  {
  32.496 -+	    const char *sname = bfd_get_section_name (file->the_bfd, s);
  32.497 -+	    bfd_boolean skip = !match_simple_wild (wildsec2->spec.name,
  32.498 -+						   sname);
  32.499 -+
  32.500 -+	    if (!skip)
  32.501 -+	      walk_wild_consider_section (ptr, file, s, wildsec2, callback,
  32.502 -+					  data);
  32.503 -+	    else
  32.504 -+	      {
  32.505 -+		skip = !match_simple_wild (wildsec3->spec.name, sname);
  32.506 -+		if (!skip)
  32.507 -+		  walk_wild_consider_section (ptr, file, s, wildsec3,
  32.508 -+					      callback, data);
  32.509 -+	      }
  32.510 -+	  }
  32.511 -+    }
  32.512 -+}
  32.513 -+
  32.514 -+static void
  32.515 -+walk_wild_section (lang_wild_statement_type *ptr,
  32.516 -+		   lang_input_statement_type *file,
  32.517 -+		   callback_t callback,
  32.518 -+		   void *data)
  32.519 -+{
  32.520 -+  if (file->just_syms_flag)
  32.521 -+    return;
  32.522 -+
  32.523 -+  (*ptr->walk_wild_section_handler) (ptr, file, callback, data);
  32.524 -+}
  32.525 -+
  32.526 -+/* Returns TRUE when name1 is a wildcard spec that might match
  32.527 -+   something name2 can match.  We're conservative: we return FALSE
  32.528 -+   only if the prefixes of name1 and name2 are different up to the
  32.529 -+   first wildcard character.  */
  32.530 -+
  32.531 -+static bfd_boolean
  32.532 -+wild_spec_can_overlap (const char *name1, const char *name2)
  32.533 -+{
  32.534 -+  size_t prefix1_len = strcspn (name1, "?*[");
  32.535 -+  size_t prefix2_len = strcspn (name2, "?*[");
  32.536 -+  size_t min_prefix_len;
  32.537 -+
  32.538 -+  /* Note that if there is no wildcard character, then we treat the
  32.539 -+     terminating 0 as part of the prefix.  Thus ".text" won't match
  32.540 -+     ".text." or ".text.*", for example.  */
  32.541 -+  if (name1[prefix1_len] == '\0')
  32.542 -+    prefix1_len++;
  32.543 -+  if (name2[prefix2_len] == '\0')
  32.544 -+    prefix2_len++;
  32.545 -+
  32.546 -+  min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len;
  32.547 -+
  32.548 -+  return memcmp (name1, name2, min_prefix_len) == 0;
  32.549 -+}
  32.550 -+
  32.551 -+/* Select specialized code to handle various kinds of wildcard
  32.552 -+   statements.  */
  32.553 -+
  32.554 -+static void
  32.555 -+analyze_walk_wild_section_handler (lang_wild_statement_type *ptr)
  32.556 -+{
  32.557 -+  int sec_count = 0;
  32.558 -+  int wild_name_count = 0;
  32.559 -+  struct wildcard_list *sec;
  32.560 -+  int signature;
  32.561 -+  int data_counter;
  32.562 -+
  32.563 -+  ptr->walk_wild_section_handler = walk_wild_section_general;
  32.564 -+
  32.565 -+  /* Count how many wildcard_specs there are, and how many of those
  32.566 -+     actually use wildcards in the name.  Also, bail out if any of the
  32.567 -+     wildcard names are NULL. (Can this actually happen?
  32.568 -+     walk_wild_section used to test for it.)  And bail out if any
  32.569 -+     of the wildcards are more complex than a simple string
  32.570 -+     ending in a single '*'.  */
  32.571 -+  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  32.572 -+    {
  32.573 -+      ++sec_count;
  32.574 -+      if (sec->spec.name == NULL)
  32.575 -+	return;
  32.576 -+      if (wildcardp (sec->spec.name))
  32.577 -+	{
  32.578 -+	  ++wild_name_count;
  32.579 -+	  if (!is_simple_wild (sec->spec.name))
  32.580 -+	    return;
  32.581 -+	}
  32.582 -+    }
  32.583 -+
  32.584 -+  /* The zero-spec case would be easy to optimize but it doesn't
  32.585 -+     happen in practice.  Likewise, more than 4 specs doesn't
  32.586 -+     happen in practice.  */
  32.587 -+  if (sec_count == 0 || sec_count > 4)
  32.588 -+    return;
  32.589 -+
  32.590 -+  /* Check that no two specs can match the same section.  */
  32.591 -+  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  32.592 -+    {
  32.593 -+      struct wildcard_list *sec2;
  32.594 -+      for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next)
  32.595 -+	{
  32.596 -+	  if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name))
  32.597 -+	    return;
  32.598 -+	}
  32.599 -+    }
  32.600 -+
  32.601 -+  signature = (sec_count << 8) + wild_name_count;
  32.602 -+  switch (signature)
  32.603 -+    {
  32.604 -+    case 0x0100:
  32.605 -+      ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0;
  32.606 -+      break;
  32.607 -+    case 0x0101:
  32.608 -+      ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1;
  32.609 -+      break;
  32.610 -+    case 0x0201:
  32.611 -+      ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1;
  32.612 -+      break;
  32.613 -+    case 0x0302:
  32.614 -+      ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2;
  32.615 -+      break;
  32.616 -+    case 0x0402:
  32.617 -+      ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2;
  32.618 -+      break;
  32.619 -+    default:
  32.620 -+      return;
  32.621 -+    }
  32.622 -+
  32.623 -+  /* Now fill the data array with pointers to the specs, first the
  32.624 -+     specs with non-wildcard names, then the specs with wildcard
  32.625 -+     names.  It's OK to process the specs in different order from the
  32.626 -+     given order, because we've already determined that no section
  32.627 -+     will match more than one spec.  */
  32.628 -+  data_counter = 0;
  32.629 -+  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  32.630 -+    if (!wildcardp (sec->spec.name))
  32.631 -+      ptr->handler_data[data_counter++] = sec;
  32.632 -+  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  32.633 -+    if (wildcardp (sec->spec.name))
  32.634 -+      ptr->handler_data[data_counter++] = sec;
  32.635 -+}
  32.636 -+
  32.637 - /* Handle a wild statement for a single file F.  */
  32.638 - 
  32.639 - static void
  32.640 -@@ -4353,6 +4737,7 @@
  32.641 -   new->section_list = section_list;
  32.642 -   new->keep_sections = keep_sections;
  32.643 -   lang_list_init (&new->children);
  32.644 -+  analyze_walk_wild_section_handler (new);
  32.645 - }
  32.646 - 
  32.647 - void
  32.648 ---- binutils-2.15/ld/ldlang.h.old	2004-05-17 15:36:16.000000000 -0400
  32.649 -+++ binutils-2.15/ld/ldlang.h	2006-01-23 13:32:33.653292000 -0500
  32.650 -@@ -295,7 +295,17 @@
  32.651 -   union lang_statement_union *file;
  32.652 - } lang_afile_asection_pair_statement_type;
  32.653 - 
  32.654 --typedef struct lang_wild_statement_struct
  32.655 -+typedef struct lang_wild_statement_struct lang_wild_statement_type;
  32.656 -+
  32.657 -+typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
  32.658 -+			    asection *, lang_input_statement_type *, void *);
  32.659 -+
  32.660 -+typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
  32.661 -+					     lang_input_statement_type *,
  32.662 -+					     callback_t callback,
  32.663 -+					     void *data);
  32.664 -+
  32.665 -+struct lang_wild_statement_struct
  32.666 - {
  32.667 -   lang_statement_header_type header;
  32.668 -   const char *filename;
  32.669 -@@ -303,7 +313,10 @@
  32.670 -   struct wildcard_list *section_list;
  32.671 -   bfd_boolean keep_sections;
  32.672 -   lang_statement_list_type children;
  32.673 --} lang_wild_statement_type;
  32.674 -+
  32.675 -+  walk_wild_section_handler_t walk_wild_section_handler;
  32.676 -+  struct wildcard_list *handler_data[4];
  32.677 -+};
  32.678 - 
  32.679 - typedef struct lang_address_statement_struct
  32.680 - {
    33.1 --- a/patches/binutils/2.15/800-ld-stabs-tweak.patch	Mon Jul 28 21:08:01 2008 +0000
    33.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.3 @@ -1,33 +0,0 @@
    33.4 -Signed-off-by: dank@kegel.com
    33.5 -
    33.6 -See http://sourceware.org/ml/binutils/2005-12/msg00270.html
    33.7 -http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html
    33.8 -
    33.9 -STABS hash table size change, backported from the binutils CVS tree.  Here's
   33.10 -the CVS log comment for the original change:
   33.11 -
   33.12 -revision 1.25
   33.13 -date: 2005/12/29 10:29:23;  author: nickc;  state: Exp;  lines: +2 -3
   33.14 -(_bfd_link_section_stabs): Use bfd_hash_table_init rather than
   33.15 -bfd_hash_table_init_n(...,251) so that the size of the hash table can be
   33.16 -controlled by the user.
   33.17 -
   33.18 -Note that tunable hash table size changes were added after 2.15.  The effect
   33.19 -of this change is to make bfd use its default hash table size for the stabs
   33.20 -hash as well.
   33.21 -
   33.22 -
   33.23 ---- binutils-2.15/bfd/stabs.c.old	2004-05-17 15:36:04.000000000 -0400
   33.24 -+++ binutils-2.15/bfd/stabs.c	2006-02-09 15:21:56.567014000 -0500
   33.25 -@@ -241,9 +241,8 @@
   33.26 - 	goto error_return;
   33.27 -       /* Make sure the first byte is zero.  */
   33.28 -       (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
   33.29 --      if (! bfd_hash_table_init_n (&sinfo->includes.root,
   33.30 --				   stab_link_includes_newfunc,
   33.31 --				   251))
   33.32 -+      if (! bfd_hash_table_init (&sinfo->includes.root,
   33.33 -+				   stab_link_includes_newfunc))
   33.34 - 	goto error_return;
   33.35 -       sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
   33.36 -       sinfo->stabstr->flags |= SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING;
    34.1 --- a/patches/binutils/2.15/810-s390-invalid-insn-format.patch	Mon Jul 28 21:08:01 2008 +0000
    34.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.3 @@ -1,42 +0,0 @@
    34.4 -Message-ID: <000801c48f60$cec16630$9103a8c0@ULOC5012>
    34.5 -From: "Michael Geiger" <mcgege@gmx.de>
    34.6 -To: <dank@kegel.com>
    34.7 -Subject: Patch for cross compiling s/390 kernel on linux host
    34.8 -Date: Tue, 31 Aug 2004 15:45:41 +0200
    34.9 -
   34.10 -Dear Dan,
   34.11 -
   34.12 -I had big problems compiling a kernel for s/390 on my linux host - I tried
   34.13 -different chains from crosstool-0.28-rc34 and finally succeded with
   34.14 -gcc-3.3.4-glibc-2.3.2 after applying another patch to binutils-2.15
   34.15 -(attached).
   34.16 -All compilations of the different kernel versions I tried stopped with
   34.17 -"Invalid .insn format" somewhere. I checked the recent cvs version of
   34.18 -binutils and applied the latest diff to gas/config/tc-s390.c and that solved
   34.19 -it.
   34.20 -
   34.21 -Greetings
   34.22 -
   34.23 -Michael Geiger
   34.24 -
   34.25 -
   34.26 -diff -u -r1.39 -r1.40
   34.27 ---- src/gas/config/tc-s390.c	2004/05/06 11:01:48	1.39
   34.28 -+++ src/gas/config/tc-s390.c	2004/06/15 12:38:08	1.40
   34.29 -@@ -1596,13 +1596,13 @@
   34.30 -   if (exp.X_op == O_constant)
   34.31 -     {
   34.32 -       if (   (   opformat->oplen == 6
   34.33 --	      && exp.X_add_number >= 0
   34.34 -+	      && (addressT) exp.X_add_number >= 0
   34.35 - 	      && (addressT) exp.X_add_number < (1ULL << 48))
   34.36 - 	  || (   opformat->oplen == 4
   34.37 --	      && exp.X_add_number >= 0
   34.38 -+	      && (addressT) exp.X_add_number >= 0
   34.39 - 	      && (addressT) exp.X_add_number < (1ULL << 32))
   34.40 - 	  || (   opformat->oplen == 2
   34.41 --	      && exp.X_add_number >= 0
   34.42 -+	      && (addressT) exp.X_add_number >= 0
   34.43 - 	      && (addressT) exp.X_add_number < (1ULL << 16)))
   34.44 - 	md_number_to_chars (insn, exp.X_add_number, opformat->oplen);
   34.45 -       else
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/patches/binutils/2.17/130-ld_makefile_patch.patch	Mon Jul 28 21:32:33 2008 +0000
    35.3 @@ -0,0 +1,24 @@
    35.4 +diff -dur binutils-2.17.old/ld/Makefile.am binutils-2.17/ld/Makefile.am
    35.5 +--- binutils-2.17.old/ld/Makefile.am	2006-06-03 06:45:50.000000000 +0200
    35.6 ++++ binutils-2.17/ld/Makefile.am	2007-05-01 18:26:09.000000000 +0200
    35.7 +@@ -20,7 +20,7 @@
    35.8 + # We put the scripts in the directory $(scriptdir)/ldscripts.
    35.9 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   35.10 + # directives need to be different for native and cross linkers.
   35.11 +-scriptdir = $(tooldir)/lib
   35.12 ++scriptdir = $(libdir)
   35.13 + 
   35.14 + EMUL = @EMUL@
   35.15 + EMULATION_OFILES = @EMULATION_OFILES@
   35.16 +diff -dur binutils-2.17.old/ld/Makefile.in binutils-2.17/ld/Makefile.in
   35.17 +--- binutils-2.17.old/ld/Makefile.in	2006-06-03 06:45:50.000000000 +0200
   35.18 ++++ binutils-2.17/ld/Makefile.in	2007-05-01 18:26:09.000000000 +0200
   35.19 +@@ -269,7 +269,7 @@
   35.20 + # We put the scripts in the directory $(scriptdir)/ldscripts.
   35.21 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   35.22 + # directives need to be different for native and cross linkers.
   35.23 +-scriptdir = $(tooldir)/lib
   35.24 ++scriptdir = $(libdir)
   35.25 + BASEDIR = $(srcdir)/..
   35.26 + BFDDIR = $(BASEDIR)/bfd
   35.27 + INCDIR = $(BASEDIR)/include
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/patches/binutils/2.17/140-better_file_error.patch	Mon Jul 28 21:32:33 2008 +0000
    36.3 @@ -0,0 +1,17 @@
    36.4 +diff -dur binutils-2.17.old/bfd/opncls.c binutils-2.17/bfd/opncls.c
    36.5 +--- binutils-2.17.old/bfd/opncls.c	2006-03-16 13:20:16.000000000 +0100
    36.6 ++++ binutils-2.17/bfd/opncls.c	2007-05-01 18:26:11.000000000 +0200
    36.7 +@@ -158,6 +158,13 @@
    36.8 + {
    36.9 +   bfd *nbfd;
   36.10 +   const bfd_target *target_vec;
   36.11 ++  struct stat s;
   36.12 ++
   36.13 ++  if (stat (filename, &s) == 0)
   36.14 ++    if (S_ISDIR(s.st_mode)) {
   36.15 ++      bfd_set_error (bfd_error_file_not_recognized);
   36.16 ++      return NULL;
   36.17 ++    }
   36.18 + 
   36.19 +   nbfd = _bfd_new_bfd ();
   36.20 +   if (nbfd == NULL)
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/patches/binutils/2.17/150-check_ldrunpath_length.patch	Mon Jul 28 21:32:33 2008 +0000
    37.3 @@ -0,0 +1,21 @@
    37.4 +diff -dur binutils-2.17.old/ld/emultempl/elf32.em binutils-2.17/ld/emultempl/elf32.em
    37.5 +--- binutils-2.17.old/ld/emultempl/elf32.em	2006-06-12 15:05:04.000000000 +0200
    37.6 ++++ binutils-2.17/ld/emultempl/elf32.em	2007-05-01 18:26:13.000000000 +0200
    37.7 +@@ -970,6 +970,8 @@
    37.8 + 	      && command_line.rpath == NULL)
    37.9 + 	    {
   37.10 + 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   37.11 ++	      if ((lib_path) && (strlen (lib_path) == 0))
   37.12 ++		  lib_path = NULL;
   37.13 + 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   37.14 + 						      force))
   37.15 + 		break;
   37.16 +@@ -1154,6 +1156,8 @@
   37.17 +   rpath = command_line.rpath;
   37.18 +   if (rpath == NULL)
   37.19 +     rpath = (const char *) getenv ("LD_RUN_PATH");
   37.20 ++  if ((rpath) && (strlen (rpath) == 0))
   37.21 ++      rpath = NULL;
   37.22 +   if (! (bfd_elf_size_dynamic_sections
   37.23 + 	 (output_bfd, command_line.soname, rpath,
   37.24 + 	  command_line.filter_shlib,
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/patches/binutils/2.17/160-mips-ELF_MAXPAGESIZE-4K.patch	Mon Jul 28 21:32:33 2008 +0000
    38.3 @@ -0,0 +1,28 @@
    38.4 +diff -dur binutils-2.17.old/bfd/elf32-mips.c binutils-2.17/bfd/elf32-mips.c
    38.5 +--- binutils-2.17.old/bfd/elf32-mips.c	2006-03-22 10:28:13.000000000 +0100
    38.6 ++++ binutils-2.17/bfd/elf32-mips.c	2007-05-01 18:26:15.000000000 +0200
    38.7 +@@ -1617,7 +1617,9 @@
    38.8 + 
    38.9 + /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
   38.10 +    page sizes of up to that limit, so we need to respect it.  */
   38.11 +-#define ELF_MAXPAGESIZE			0x10000
   38.12 ++/*#define ELF_MAXPAGESIZE			0x10000*/
   38.13 ++/* Use 4K to shrink the elf header.  NOT for general use! */
   38.14 ++#define ELF_MAXPAGESIZE			0x1000
   38.15 + #define elf32_bed			elf32_tradbed
   38.16 + 
   38.17 + /* Include the target file again for this target.  */
   38.18 +diff -dur binutils-2.17.old/bfd/elfn32-mips.c binutils-2.17/bfd/elfn32-mips.c
   38.19 +--- binutils-2.17.old/bfd/elfn32-mips.c	2005-11-23 15:04:17.000000000 +0100
   38.20 ++++ binutils-2.17/bfd/elfn32-mips.c	2007-05-01 18:26:15.000000000 +0200
   38.21 +@@ -2402,7 +2402,9 @@
   38.22 + 
   38.23 + /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
   38.24 +    page sizes of up to that limit, so we need to respect it.  */
   38.25 +-#define ELF_MAXPAGESIZE			0x10000
   38.26 ++/*#define ELF_MAXPAGESIZE			0x10000*/
   38.27 ++/* Use 4K to shrink the elf header.  NOT for general use! */
   38.28 ++#define ELF_MAXPAGESIZE			0x1000
   38.29 + #define elf32_bed			elf32_tradbed
   38.30 + 
   38.31 + /* Include the target file again for this target.  */
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/patches/binutils/2.17/170-bfd-hash-tweak.patch	Mon Jul 28 21:32:33 2008 +0000
    39.3 @@ -0,0 +1,23 @@
    39.4 +Signed-off-by: dank@kegel.com
    39.5 +
    39.6 +Raising the size of the hash table is a noticable win when linking 
    39.7 +at least one large app.  
    39.8 +
    39.9 +There was a patch,
   39.10 +http://sources.redhat.com/ml/binutils/2004-06/msg00165.html
   39.11 +to do this dynamically.  No idea why that didn't make it in.
   39.12 +So this tiny change to raise the default size is just
   39.13 +a stopgap for now.
   39.14 +
   39.15 +
   39.16 +--- binutils-2.17/bfd/hash.c.old	2006-03-02 23:01:39.000000000 -0800
   39.17 ++++ binutils-2.17/bfd/hash.c	2006-03-02 23:01:58.000000000 -0800
   39.18 +@@ -298,7 +298,7 @@
   39.19 + */
   39.20 + 
   39.21 + /* The default number of entries to use when creating a hash table.  */
   39.22 +-#define DEFAULT_SIZE 4051
   39.23 ++#define DEFAULT_SIZE 32749
   39.24 + static size_t bfd_default_hash_table_size = DEFAULT_SIZE;
   39.25 + 
   39.26 + /* Create a new hash table, given a number of entries.  */
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/patches/binutils/2.17/180-psignal.patch	Mon Jul 28 21:32:33 2008 +0000
    40.3 @@ -0,0 +1,29 @@
    40.4 +Make psignal prototype in libiberty match that in glibc.
    40.5 +
    40.6 +Fixes:
    40.7 +
    40.8 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
    40.9 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
   40.10 +/usr/include/signal.h:131: prototype declaration
   40.11 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
   40.12 +/usr/include/signal.h:131: prototype declaration
   40.13 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
   40.14 +mprotect... make[1]: *** [strsignal.o] Error 1
   40.15 +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'
   40.16 +make: *** [all-libiberty] Error 2
   40.17 +
   40.18 +when building on red hat 7.1
   40.19 +though it's a bit of a mystery why libiberty's psignal is being compiled at
   40.20 +all, since red hat 7.1's glibc supports psignal (hence the error message)
   40.21 +
   40.22 +--- binutils-2.17/libiberty/strsignal.c.old	2005-04-18 13:57:40.000000000 -0700
   40.23 ++++ binutils-2.17/libiberty/strsignal.c	2005-04-18 13:59:09.000000000 -0700
   40.24 +@@ -536,7 +536,7 @@
   40.25 + 
   40.26 + /*
   40.27 + 
   40.28 +-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
   40.29 ++@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
   40.30 + 
   40.31 + Print @var{message} to the standard error, followed by a colon,
   40.32 + followed by the description of the signal specified by @var{signo},
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/patches/binutils/2.17/190-skip-comments.patch	Mon Jul 28 21:32:33 2008 +0000
    41.3 @@ -0,0 +1,95 @@
    41.4 +[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
    41.5 +
    41.6 +Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
    41.7 +Fixes
    41.8 +localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
    41.9 +when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
   41.10 +
   41.11 +Paths adjusted to match crosstool's patcher.
   41.12 +
   41.13 +Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
   41.14 +From: Andreas Schwab <schwab at suse dot de>
   41.15 +To: Nathan Sidwell <nathan at codesourcery dot com>
   41.16 +Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
   41.17 +Date: Fri, 23 Apr 2004 22:27:19 +0200
   41.18 +Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
   41.19 +
   41.20 +Nathan Sidwell <nathan@codesourcery.com> writes:
   41.21 +
   41.22 +> Index: read.c
   41.23 +> ===================================================================
   41.24 +> RCS file: /cvs/src/src/gas/read.c,v
   41.25 +> retrieving revision 1.76
   41.26 +> diff -c -3 -p -r1.76 read.c
   41.27 +> *** read.c	12 Mar 2004 17:48:12 -0000	1.76
   41.28 +> --- read.c	18 Mar 2004 09:56:05 -0000
   41.29 +> *************** read_a_source_file (char *name)
   41.30 +> *** 1053,1059 ****
   41.31 +>   #endif
   41.32 +>   	  input_line_pointer--;
   41.33 +>   	  /* Report unknown char as ignored.  */
   41.34 +> ! 	  ignore_rest_of_line ();
   41.35 +>   	}
   41.36 +>   
   41.37 +>   #ifdef md_after_pass_hook
   41.38 +> --- 1053,1059 ----
   41.39 +>   #endif
   41.40 +>   	  input_line_pointer--;
   41.41 +>   	  /* Report unknown char as ignored.  */
   41.42 +> ! 	  demand_empty_rest_of_line ();
   41.43 +>   	}
   41.44 +>   
   41.45 +>   #ifdef md_after_pass_hook
   41.46 +
   41.47 +This means that the unknown character is no longer ignored, despite the
   41.48 +comment.  As a side effect a line starting with a line comment character
   41.49 +not followed by APP in NO_APP mode now triggers an error instead of just a
   41.50 +warning, breaking builds of glibc on m68k-linux.  Earlier in
   41.51 +read_a_source_file where #APP is handled there is another comment that
   41.52 +claims that unknown comments are ignored, when in fact they aren't (only
   41.53 +the initial line comment character is skipped).
   41.54 +
   41.55 +Note that the presence of #APP will mess up the line counters, but
   41.56 +that appears to be difficult to fix.
   41.57 +
   41.58 +Andreas.
   41.59 +
   41.60 +2004-04-23  Andreas Schwab  <schwab@suse.de>
   41.61 +
   41.62 +	* read.c (read_a_source_file): Ignore unknown text after line
   41.63 +	comment character.  Fix misleading comment.
   41.64 +
   41.65 +--- binutils/gas/read.c.~1.78.~	2004-04-23 08:58:23.000000000 +0200
   41.66 ++++ binutils/gas/read.c	2004-04-23 21:49:01.000000000 +0200
   41.67 +@@ -1008,10 +1008,14 @@ read_a_source_file (char *name)
   41.68 + 	      unsigned int new_length;
   41.69 + 	      char *tmp_buf = 0;
   41.70 + 
   41.71 +-	      bump_line_counters ();
   41.72 + 	      s = input_line_pointer;
   41.73 + 	      if (strncmp (s, "APP\n", 4))
   41.74 +-		continue;	/* We ignore it */
   41.75 ++		{
   41.76 ++		  /* We ignore it */
   41.77 ++		  ignore_rest_of_line ();
   41.78 ++		  continue;
   41.79 ++		}
   41.80 ++	      bump_line_counters ();
   41.81 + 	      s += 4;
   41.82 + 
   41.83 + 	      sb_new (&sbuf);
   41.84 +@@ -1110,7 +1110,7 @@ read_a_source_file (char *name)
   41.85 + 	    continue;
   41.86 + #endif
   41.87 + 	  input_line_pointer--;
   41.88 +-	  /* Report unknown char as ignored.  */
   41.89 ++	  /* Report unknown char as error.  */
   41.90 + 	  demand_empty_rest_of_line ();
   41.91 + 	}
   41.92 + 
   41.93 +
   41.94 +-- 
   41.95 +Andreas Schwab, SuSE Labs, schwab@suse.de
   41.96 +SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
   41.97 +Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
   41.98 +"And now for something completely different."
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/patches/binutils/2.17/200-cross-gprof.patch	Mon Jul 28 21:32:33 2008 +0000
    42.3 @@ -0,0 +1,22 @@
    42.4 +--- binutils-2.17/configure.old	2004-07-21 21:36:47.000000000 -0700
    42.5 ++++ binutils-2.17/configure	2004-07-21 21:37:08.000000000 -0700
    42.6 +@@ -1022,7 +1022,7 @@
    42.7 + 
    42.8 + # Some tools are only suitable for building in a "native" situation.
    42.9 + # Remove these if host!=target.  
   42.10 +-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"
   42.11 ++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"
   42.12 + 
   42.13 + # Similarly, some are only suitable for cross toolchains.
   42.14 + # Remove these if host=target.
   42.15 +--- binutils-2.17/configure.in.old	2004-07-21 21:37:19.000000000 -0700
   42.16 ++++ binutils-2.17/configure.in	2004-07-21 21:37:34.000000000 -0700
   42.17 +@@ -227,7 +227,7 @@
   42.18 + 
   42.19 + # Some tools are only suitable for building in a "native" situation.
   42.20 + # Remove these if host!=target.  
   42.21 +-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"
   42.22 ++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"
   42.23 + 
   42.24 + # Similarly, some are only suitable for cross toolchains.
   42.25 + # Remove these if host=target.
    43.1 --- a/patches/binutils/2.17/300-ld_makefile_patch.patch	Mon Jul 28 21:08:01 2008 +0000
    43.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.3 @@ -1,24 +0,0 @@
    43.4 -diff -dur binutils-2.17.old/ld/Makefile.am binutils-2.17/ld/Makefile.am
    43.5 ---- binutils-2.17.old/ld/Makefile.am	2006-06-03 06:45:50.000000000 +0200
    43.6 -+++ binutils-2.17/ld/Makefile.am	2007-05-01 18:26:09.000000000 +0200
    43.7 -@@ -20,7 +20,7 @@
    43.8 - # We put the scripts in the directory $(scriptdir)/ldscripts.
    43.9 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   43.10 - # directives need to be different for native and cross linkers.
   43.11 --scriptdir = $(tooldir)/lib
   43.12 -+scriptdir = $(libdir)
   43.13 - 
   43.14 - EMUL = @EMUL@
   43.15 - EMULATION_OFILES = @EMULATION_OFILES@
   43.16 -diff -dur binutils-2.17.old/ld/Makefile.in binutils-2.17/ld/Makefile.in
   43.17 ---- binutils-2.17.old/ld/Makefile.in	2006-06-03 06:45:50.000000000 +0200
   43.18 -+++ binutils-2.17/ld/Makefile.in	2007-05-01 18:26:09.000000000 +0200
   43.19 -@@ -269,7 +269,7 @@
   43.20 - # We put the scripts in the directory $(scriptdir)/ldscripts.
   43.21 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   43.22 - # directives need to be different for native and cross linkers.
   43.23 --scriptdir = $(tooldir)/lib
   43.24 -+scriptdir = $(libdir)
   43.25 - BASEDIR = $(srcdir)/..
   43.26 - BFDDIR = $(BASEDIR)/bfd
   43.27 - INCDIR = $(BASEDIR)/include
    44.1 --- a/patches/binutils/2.17/301-better_file_error.patch	Mon Jul 28 21:08:01 2008 +0000
    44.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.3 @@ -1,17 +0,0 @@
    44.4 -diff -dur binutils-2.17.old/bfd/opncls.c binutils-2.17/bfd/opncls.c
    44.5 ---- binutils-2.17.old/bfd/opncls.c	2006-03-16 13:20:16.000000000 +0100
    44.6 -+++ binutils-2.17/bfd/opncls.c	2007-05-01 18:26:11.000000000 +0200
    44.7 -@@ -158,6 +158,13 @@
    44.8 - {
    44.9 -   bfd *nbfd;
   44.10 -   const bfd_target *target_vec;
   44.11 -+  struct stat s;
   44.12 -+
   44.13 -+  if (stat (filename, &s) == 0)
   44.14 -+    if (S_ISDIR(s.st_mode)) {
   44.15 -+      bfd_set_error (bfd_error_file_not_recognized);
   44.16 -+      return NULL;
   44.17 -+    }
   44.18 - 
   44.19 -   nbfd = _bfd_new_bfd ();
   44.20 -   if (nbfd == NULL)
    45.1 --- a/patches/binutils/2.17/302-check_ldrunpath_length.patch	Mon Jul 28 21:08:01 2008 +0000
    45.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.3 @@ -1,21 +0,0 @@
    45.4 -diff -dur binutils-2.17.old/ld/emultempl/elf32.em binutils-2.17/ld/emultempl/elf32.em
    45.5 ---- binutils-2.17.old/ld/emultempl/elf32.em	2006-06-12 15:05:04.000000000 +0200
    45.6 -+++ binutils-2.17/ld/emultempl/elf32.em	2007-05-01 18:26:13.000000000 +0200
    45.7 -@@ -970,6 +970,8 @@
    45.8 - 	      && command_line.rpath == NULL)
    45.9 - 	    {
   45.10 - 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   45.11 -+	      if ((lib_path) && (strlen (lib_path) == 0))
   45.12 -+		  lib_path = NULL;
   45.13 - 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   45.14 - 						      force))
   45.15 - 		break;
   45.16 -@@ -1154,6 +1156,8 @@
   45.17 -   rpath = command_line.rpath;
   45.18 -   if (rpath == NULL)
   45.19 -     rpath = (const char *) getenv ("LD_RUN_PATH");
   45.20 -+  if ((rpath) && (strlen (rpath) == 0))
   45.21 -+      rpath = NULL;
   45.22 -   if (! (bfd_elf_size_dynamic_sections
   45.23 - 	 (output_bfd, command_line.soname, rpath,
   45.24 - 	  command_line.filter_shlib,
    46.1 --- a/patches/binutils/2.17/400-mips-ELF_MAXPAGESIZE-4K.patch	Mon Jul 28 21:08:01 2008 +0000
    46.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.3 @@ -1,28 +0,0 @@
    46.4 -diff -dur binutils-2.17.old/bfd/elf32-mips.c binutils-2.17/bfd/elf32-mips.c
    46.5 ---- binutils-2.17.old/bfd/elf32-mips.c	2006-03-22 10:28:13.000000000 +0100
    46.6 -+++ binutils-2.17/bfd/elf32-mips.c	2007-05-01 18:26:15.000000000 +0200
    46.7 -@@ -1617,7 +1617,9 @@
    46.8 - 
    46.9 - /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
   46.10 -    page sizes of up to that limit, so we need to respect it.  */
   46.11 --#define ELF_MAXPAGESIZE			0x10000
   46.12 -+/*#define ELF_MAXPAGESIZE			0x10000*/
   46.13 -+/* Use 4K to shrink the elf header.  NOT for general use! */
   46.14 -+#define ELF_MAXPAGESIZE			0x1000
   46.15 - #define elf32_bed			elf32_tradbed
   46.16 - 
   46.17 - /* Include the target file again for this target.  */
   46.18 -diff -dur binutils-2.17.old/bfd/elfn32-mips.c binutils-2.17/bfd/elfn32-mips.c
   46.19 ---- binutils-2.17.old/bfd/elfn32-mips.c	2005-11-23 15:04:17.000000000 +0100
   46.20 -+++ binutils-2.17/bfd/elfn32-mips.c	2007-05-01 18:26:15.000000000 +0200
   46.21 -@@ -2402,7 +2402,9 @@
   46.22 - 
   46.23 - /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
   46.24 -    page sizes of up to that limit, so we need to respect it.  */
   46.25 --#define ELF_MAXPAGESIZE			0x10000
   46.26 -+/*#define ELF_MAXPAGESIZE			0x10000*/
   46.27 -+/* Use 4K to shrink the elf header.  NOT for general use! */
   46.28 -+#define ELF_MAXPAGESIZE			0x1000
   46.29 - #define elf32_bed			elf32_tradbed
   46.30 - 
   46.31 - /* Include the target file again for this target.  */
    47.1 --- a/patches/binutils/2.17/500-bfd-hash-tweak.patch	Mon Jul 28 21:08:01 2008 +0000
    47.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.3 @@ -1,23 +0,0 @@
    47.4 -Signed-off-by: dank@kegel.com
    47.5 -
    47.6 -Raising the size of the hash table is a noticable win when linking 
    47.7 -at least one large app.  
    47.8 -
    47.9 -There was a patch,
   47.10 -http://sources.redhat.com/ml/binutils/2004-06/msg00165.html
   47.11 -to do this dynamically.  No idea why that didn't make it in.
   47.12 -So this tiny change to raise the default size is just
   47.13 -a stopgap for now.
   47.14 -
   47.15 -
   47.16 ---- binutils-2.17/bfd/hash.c.old	2006-03-02 23:01:39.000000000 -0800
   47.17 -+++ binutils-2.17/bfd/hash.c	2006-03-02 23:01:58.000000000 -0800
   47.18 -@@ -298,7 +298,7 @@
   47.19 - */
   47.20 - 
   47.21 - /* The default number of entries to use when creating a hash table.  */
   47.22 --#define DEFAULT_SIZE 4051
   47.23 -+#define DEFAULT_SIZE 32749
   47.24 - static size_t bfd_default_hash_table_size = DEFAULT_SIZE;
   47.25 - 
   47.26 - /* Create a new hash table, given a number of entries.  */
    48.1 --- a/patches/binutils/2.17/501-psignal.patch	Mon Jul 28 21:08:01 2008 +0000
    48.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.3 @@ -1,29 +0,0 @@
    48.4 -Make psignal prototype in libiberty match that in glibc.
    48.5 -
    48.6 -Fixes:
    48.7 -
    48.8 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
    48.9 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
   48.10 -/usr/include/signal.h:131: prototype declaration
   48.11 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
   48.12 -/usr/include/signal.h:131: prototype declaration
   48.13 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
   48.14 -mprotect... make[1]: *** [strsignal.o] Error 1
   48.15 -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'
   48.16 -make: *** [all-libiberty] Error 2
   48.17 -
   48.18 -when building on red hat 7.1
   48.19 -though it's a bit of a mystery why libiberty's psignal is being compiled at
   48.20 -all, since red hat 7.1's glibc supports psignal (hence the error message)
   48.21 -
   48.22 ---- binutils-2.17/libiberty/strsignal.c.old	2005-04-18 13:57:40.000000000 -0700
   48.23 -+++ binutils-2.17/libiberty/strsignal.c	2005-04-18 13:59:09.000000000 -0700
   48.24 -@@ -536,7 +536,7 @@
   48.25 - 
   48.26 - /*
   48.27 - 
   48.28 --@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
   48.29 -+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
   48.30 - 
   48.31 - Print @var{message} to the standard error, followed by a colon,
   48.32 - followed by the description of the signal specified by @var{signo},
    49.1 --- a/patches/binutils/2.17/502-skip-comments.patch	Mon Jul 28 21:08:01 2008 +0000
    49.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.3 @@ -1,95 +0,0 @@
    49.4 -[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
    49.5 -
    49.6 -Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
    49.7 -Fixes
    49.8 -localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
    49.9 -when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
   49.10 -
   49.11 -Paths adjusted to match crosstool's patcher.
   49.12 -
   49.13 -Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
   49.14 -From: Andreas Schwab <schwab at suse dot de>
   49.15 -To: Nathan Sidwell <nathan at codesourcery dot com>
   49.16 -Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
   49.17 -Date: Fri, 23 Apr 2004 22:27:19 +0200
   49.18 -Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
   49.19 -
   49.20 -Nathan Sidwell <nathan@codesourcery.com> writes:
   49.21 -
   49.22 -> Index: read.c
   49.23 -> ===================================================================
   49.24 -> RCS file: /cvs/src/src/gas/read.c,v
   49.25 -> retrieving revision 1.76
   49.26 -> diff -c -3 -p -r1.76 read.c
   49.27 -> *** read.c	12 Mar 2004 17:48:12 -0000	1.76
   49.28 -> --- read.c	18 Mar 2004 09:56:05 -0000
   49.29 -> *************** read_a_source_file (char *name)
   49.30 -> *** 1053,1059 ****
   49.31 ->   #endif
   49.32 ->   	  input_line_pointer--;
   49.33 ->   	  /* Report unknown char as ignored.  */
   49.34 -> ! 	  ignore_rest_of_line ();
   49.35 ->   	}
   49.36 ->   
   49.37 ->   #ifdef md_after_pass_hook
   49.38 -> --- 1053,1059 ----
   49.39 ->   #endif
   49.40 ->   	  input_line_pointer--;
   49.41 ->   	  /* Report unknown char as ignored.  */
   49.42 -> ! 	  demand_empty_rest_of_line ();
   49.43 ->   	}
   49.44 ->   
   49.45 ->   #ifdef md_after_pass_hook
   49.46 -
   49.47 -This means that the unknown character is no longer ignored, despite the
   49.48 -comment.  As a side effect a line starting with a line comment character
   49.49 -not followed by APP in NO_APP mode now triggers an error instead of just a
   49.50 -warning, breaking builds of glibc on m68k-linux.  Earlier in
   49.51 -read_a_source_file where #APP is handled there is another comment that
   49.52 -claims that unknown comments are ignored, when in fact they aren't (only
   49.53 -the initial line comment character is skipped).
   49.54 -
   49.55 -Note that the presence of #APP will mess up the line counters, but
   49.56 -that appears to be difficult to fix.
   49.57 -
   49.58 -Andreas.
   49.59 -
   49.60 -2004-04-23  Andreas Schwab  <schwab@suse.de>
   49.61 -
   49.62 -	* read.c (read_a_source_file): Ignore unknown text after line
   49.63 -	comment character.  Fix misleading comment.
   49.64 -
   49.65 ---- binutils/gas/read.c.~1.78.~	2004-04-23 08:58:23.000000000 +0200
   49.66 -+++ binutils/gas/read.c	2004-04-23 21:49:01.000000000 +0200
   49.67 -@@ -1008,10 +1008,14 @@ read_a_source_file (char *name)
   49.68 - 	      unsigned int new_length;
   49.69 - 	      char *tmp_buf = 0;
   49.70 - 
   49.71 --	      bump_line_counters ();
   49.72 - 	      s = input_line_pointer;
   49.73 - 	      if (strncmp (s, "APP\n", 4))
   49.74 --		continue;	/* We ignore it */
   49.75 -+		{
   49.76 -+		  /* We ignore it */
   49.77 -+		  ignore_rest_of_line ();
   49.78 -+		  continue;
   49.79 -+		}
   49.80 -+	      bump_line_counters ();
   49.81 - 	      s += 4;
   49.82 - 
   49.83 - 	      sb_new (&sbuf);
   49.84 -@@ -1110,7 +1110,7 @@ read_a_source_file (char *name)
   49.85 - 	    continue;
   49.86 - #endif
   49.87 - 	  input_line_pointer--;
   49.88 --	  /* Report unknown char as ignored.  */
   49.89 -+	  /* Report unknown char as error.  */
   49.90 - 	  demand_empty_rest_of_line ();
   49.91 - 	}
   49.92 - 
   49.93 -
   49.94 --- 
   49.95 -Andreas Schwab, SuSE Labs, schwab@suse.de
   49.96 -SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
   49.97 -Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
   49.98 -"And now for something completely different."
    50.1 --- a/patches/binutils/2.17/503-cross-gprof.patch	Mon Jul 28 21:08:01 2008 +0000
    50.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.3 @@ -1,22 +0,0 @@
    50.4 ---- binutils-2.17/configure.old	2004-07-21 21:36:47.000000000 -0700
    50.5 -+++ binutils-2.17/configure	2004-07-21 21:37:08.000000000 -0700
    50.6 -@@ -1022,7 +1022,7 @@
    50.7 - 
    50.8 - # Some tools are only suitable for building in a "native" situation.
    50.9 - # Remove these if host!=target.  
   50.10 --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"
   50.11 -+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"
   50.12 - 
   50.13 - # Similarly, some are only suitable for cross toolchains.
   50.14 - # Remove these if host=target.
   50.15 ---- binutils-2.17/configure.in.old	2004-07-21 21:37:19.000000000 -0700
   50.16 -+++ binutils-2.17/configure.in	2004-07-21 21:37:34.000000000 -0700
   50.17 -@@ -227,7 +227,7 @@
   50.18 - 
   50.19 - # Some tools are only suitable for building in a "native" situation.
   50.20 - # Remove these if host!=target.  
   50.21 --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"
   50.22 -+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"
   50.23 - 
   50.24 - # Similarly, some are only suitable for cross toolchains.
   50.25 - # Remove these if host=target.
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/patches/binutils/2.18.50.0.4/110-ld-makefile-path.patch	Mon Jul 28 21:32:33 2008 +0000
    51.3 @@ -0,0 +1,30 @@
    51.4 +Fix ld scripts path, copied from buildroot.
    51.5 +
    51.6 + binutils-2.18.50.0.6/ld/Makefile.am |    2     1     1     0 +-
    51.7 + binutils-2.18.50.0.6/ld/Makefile.in |    2     1     1     0 +-
    51.8 + 2 files changed, 2 insertions(+), 2 deletions(-)
    51.9 +
   51.10 +diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.am binutils-2.18.50.0.6/ld/Makefile.am
   51.11 +--- binutils-2.18.50.0.6.orig/ld/Makefile.am	2008-04-03 18:54:05.000000000 +0200
   51.12 ++++ binutils-2.18.50.0.6/ld/Makefile.am	2008-05-02 23:25:14.000000000 +0200
   51.13 +@@ -18,7 +18,7 @@
   51.14 + # We put the scripts in the directory $(scriptdir)/ldscripts.
   51.15 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   51.16 + # directives need to be different for native and cross linkers.
   51.17 +-scriptdir = $(tooldir)/lib
   51.18 ++scriptdir = $(libdir)
   51.19 + 
   51.20 + EMUL = @EMUL@
   51.21 + EMULATION_OFILES = @EMULATION_OFILES@
   51.22 +diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.in binutils-2.18.50.0.6/ld/Makefile.in
   51.23 +--- binutils-2.18.50.0.6.orig/ld/Makefile.in	2008-04-03 18:54:05.000000000 +0200
   51.24 ++++ binutils-2.18.50.0.6/ld/Makefile.in	2008-05-02 23:25:14.000000000 +0200
   51.25 +@@ -288,7 +288,7 @@
   51.26 + # We put the scripts in the directory $(scriptdir)/ldscripts.
   51.27 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   51.28 + # directives need to be different for native and cross linkers.
   51.29 +-scriptdir = $(tooldir)/lib
   51.30 ++scriptdir = $(libdir)
   51.31 + BASEDIR = $(srcdir)/..
   51.32 + BFDDIR = $(BASEDIR)/bfd
   51.33 + INCDIR = $(BASEDIR)/include
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/patches/binutils/2.18.50.0.4/120-check-ldrunpath-length.patch	Mon Jul 28 21:32:33 2008 +0000
    52.3 @@ -0,0 +1,26 @@
    52.4 +Check LD_RUN_PATH length, copied from buildroot.
    52.5 +
    52.6 + binutils-2.18.50.0.6/ld/emultempl/elf32.em |    4     4     0     0 ++++
    52.7 + 1 file changed, 4 insertions(+)
    52.8 +
    52.9 +diff -durN binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em binutils-2.18.50.0.6/ld/emultempl/elf32.em
   52.10 +--- binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em	2008-04-03 18:54:25.000000000 +0200
   52.11 ++++ binutils-2.18.50.0.6/ld/emultempl/elf32.em	2008-05-02 23:30:08.000000000 +0200
   52.12 +@@ -1220,6 +1220,8 @@
   52.13 + 	      && command_line.rpath == NULL)
   52.14 + 	    {
   52.15 + 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   52.16 ++	      if ((lib_path) && (strlen (lib_path) == 0))
   52.17 ++		  lib_path = NULL;
   52.18 + 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   52.19 + 						      force))
   52.20 + 		break;
   52.21 +@@ -1405,6 +1407,8 @@
   52.22 +   rpath = command_line.rpath;
   52.23 +   if (rpath == NULL)
   52.24 +     rpath = (const char *) getenv ("LD_RUN_PATH");
   52.25 ++  if ((rpath) && (strlen (rpath) == 0))
   52.26 ++      rpath = NULL;
   52.27 +   if (! (bfd_elf_size_dynamic_sections
   52.28 + 	 (link_info.output_bfd, command_line.soname, rpath,
   52.29 + 	  command_line.filter_shlib,
    53.1 --- a/patches/binutils/2.18.50.0.4/200-ld-makefile-path.patch	Mon Jul 28 21:08:01 2008 +0000
    53.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.3 @@ -1,30 +0,0 @@
    53.4 -Fix ld scripts path, copied from buildroot.
    53.5 -
    53.6 - binutils-2.18.50.0.6/ld/Makefile.am |    2     1     1     0 +-
    53.7 - binutils-2.18.50.0.6/ld/Makefile.in |    2     1     1     0 +-
    53.8 - 2 files changed, 2 insertions(+), 2 deletions(-)
    53.9 -
   53.10 -diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.am binutils-2.18.50.0.6/ld/Makefile.am
   53.11 ---- binutils-2.18.50.0.6.orig/ld/Makefile.am	2008-04-03 18:54:05.000000000 +0200
   53.12 -+++ binutils-2.18.50.0.6/ld/Makefile.am	2008-05-02 23:25:14.000000000 +0200
   53.13 -@@ -18,7 +18,7 @@
   53.14 - # We put the scripts in the directory $(scriptdir)/ldscripts.
   53.15 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   53.16 - # directives need to be different for native and cross linkers.
   53.17 --scriptdir = $(tooldir)/lib
   53.18 -+scriptdir = $(libdir)
   53.19 - 
   53.20 - EMUL = @EMUL@
   53.21 - EMULATION_OFILES = @EMULATION_OFILES@
   53.22 -diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.in binutils-2.18.50.0.6/ld/Makefile.in
   53.23 ---- binutils-2.18.50.0.6.orig/ld/Makefile.in	2008-04-03 18:54:05.000000000 +0200
   53.24 -+++ binutils-2.18.50.0.6/ld/Makefile.in	2008-05-02 23:25:14.000000000 +0200
   53.25 -@@ -288,7 +288,7 @@
   53.26 - # We put the scripts in the directory $(scriptdir)/ldscripts.
   53.27 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   53.28 - # directives need to be different for native and cross linkers.
   53.29 --scriptdir = $(tooldir)/lib
   53.30 -+scriptdir = $(libdir)
   53.31 - BASEDIR = $(srcdir)/..
   53.32 - BFDDIR = $(BASEDIR)/bfd
   53.33 - INCDIR = $(BASEDIR)/include
    54.1 --- a/patches/binutils/2.18.50.0.4/300-check-ldrunpath-length.patch	Mon Jul 28 21:08:01 2008 +0000
    54.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.3 @@ -1,26 +0,0 @@
    54.4 -Check LD_RUN_PATH length, copied from buildroot.
    54.5 -
    54.6 - binutils-2.18.50.0.6/ld/emultempl/elf32.em |    4     4     0     0 ++++
    54.7 - 1 file changed, 4 insertions(+)
    54.8 -
    54.9 -diff -durN binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em binutils-2.18.50.0.6/ld/emultempl/elf32.em
   54.10 ---- binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em	2008-04-03 18:54:25.000000000 +0200
   54.11 -+++ binutils-2.18.50.0.6/ld/emultempl/elf32.em	2008-05-02 23:30:08.000000000 +0200
   54.12 -@@ -1220,6 +1220,8 @@
   54.13 - 	      && command_line.rpath == NULL)
   54.14 - 	    {
   54.15 - 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   54.16 -+	      if ((lib_path) && (strlen (lib_path) == 0))
   54.17 -+		  lib_path = NULL;
   54.18 - 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   54.19 - 						      force))
   54.20 - 		break;
   54.21 -@@ -1405,6 +1407,8 @@
   54.22 -   rpath = command_line.rpath;
   54.23 -   if (rpath == NULL)
   54.24 -     rpath = (const char *) getenv ("LD_RUN_PATH");
   54.25 -+  if ((rpath) && (strlen (rpath) == 0))
   54.26 -+      rpath = NULL;
   54.27 -   if (! (bfd_elf_size_dynamic_sections
   54.28 - 	 (link_info.output_bfd, command_line.soname, rpath,
   54.29 - 	  command_line.filter_shlib,
    55.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.2 +++ b/patches/binutils/2.18.50.0.6/110-ld-makefile-path.patch	Mon Jul 28 21:32:33 2008 +0000
    55.3 @@ -0,0 +1,30 @@
    55.4 +Fix ld scripts path, copied from buildroot.
    55.5 +
    55.6 + binutils-2.18.50.0.6/ld/Makefile.am |    2     1     1     0 +-
    55.7 + binutils-2.18.50.0.6/ld/Makefile.in |    2     1     1     0 +-
    55.8 + 2 files changed, 2 insertions(+), 2 deletions(-)
    55.9 +
   55.10 +diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.am binutils-2.18.50.0.6/ld/Makefile.am
   55.11 +--- binutils-2.18.50.0.6.orig/ld/Makefile.am	2008-04-03 18:54:05.000000000 +0200
   55.12 ++++ binutils-2.18.50.0.6/ld/Makefile.am	2008-05-02 23:25:14.000000000 +0200
   55.13 +@@ -18,7 +18,7 @@
   55.14 + # We put the scripts in the directory $(scriptdir)/ldscripts.
   55.15 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   55.16 + # directives need to be different for native and cross linkers.
   55.17 +-scriptdir = $(tooldir)/lib
   55.18 ++scriptdir = $(libdir)
   55.19 + 
   55.20 + EMUL = @EMUL@
   55.21 + EMULATION_OFILES = @EMULATION_OFILES@
   55.22 +diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.in binutils-2.18.50.0.6/ld/Makefile.in
   55.23 +--- binutils-2.18.50.0.6.orig/ld/Makefile.in	2008-04-03 18:54:05.000000000 +0200
   55.24 ++++ binutils-2.18.50.0.6/ld/Makefile.in	2008-05-02 23:25:14.000000000 +0200
   55.25 +@@ -288,7 +288,7 @@
   55.26 + # We put the scripts in the directory $(scriptdir)/ldscripts.
   55.27 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   55.28 + # directives need to be different for native and cross linkers.
   55.29 +-scriptdir = $(tooldir)/lib
   55.30 ++scriptdir = $(libdir)
   55.31 + BASEDIR = $(srcdir)/..
   55.32 + BFDDIR = $(BASEDIR)/bfd
   55.33 + INCDIR = $(BASEDIR)/include
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/patches/binutils/2.18.50.0.6/120-check-ldrunpath-length.patch	Mon Jul 28 21:32:33 2008 +0000
    56.3 @@ -0,0 +1,26 @@
    56.4 +Check LD_RUN_PATH length, copied from buildroot.
    56.5 +
    56.6 + binutils-2.18.50.0.6/ld/emultempl/elf32.em |    4     4     0     0 ++++
    56.7 + 1 file changed, 4 insertions(+)
    56.8 +
    56.9 +diff -durN binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em binutils-2.18.50.0.6/ld/emultempl/elf32.em
   56.10 +--- binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em	2008-04-03 18:54:25.000000000 +0200
   56.11 ++++ binutils-2.18.50.0.6/ld/emultempl/elf32.em	2008-05-02 23:30:08.000000000 +0200
   56.12 +@@ -1220,6 +1220,8 @@
   56.13 + 	      && command_line.rpath == NULL)
   56.14 + 	    {
   56.15 + 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   56.16 ++	      if ((lib_path) && (strlen (lib_path) == 0))
   56.17 ++		  lib_path = NULL;
   56.18 + 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   56.19 + 						      force))
   56.20 + 		break;
   56.21 +@@ -1405,6 +1407,8 @@
   56.22 +   rpath = command_line.rpath;
   56.23 +   if (rpath == NULL)
   56.24 +     rpath = (const char *) getenv ("LD_RUN_PATH");
   56.25 ++  if ((rpath) && (strlen (rpath) == 0))
   56.26 ++      rpath = NULL;
   56.27 +   if (! (bfd_elf_size_dynamic_sections
   56.28 + 	 (link_info.output_bfd, command_line.soname, rpath,
   56.29 + 	  command_line.filter_shlib,
    57.1 --- a/patches/binutils/2.18.50.0.6/200-ld-makefile-path.patch	Mon Jul 28 21:08:01 2008 +0000
    57.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.3 @@ -1,30 +0,0 @@
    57.4 -Fix ld scripts path, copied from buildroot.
    57.5 -
    57.6 - binutils-2.18.50.0.6/ld/Makefile.am |    2     1     1     0 +-
    57.7 - binutils-2.18.50.0.6/ld/Makefile.in |    2     1     1     0 +-
    57.8 - 2 files changed, 2 insertions(+), 2 deletions(-)
    57.9 -
   57.10 -diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.am binutils-2.18.50.0.6/ld/Makefile.am
   57.11 ---- binutils-2.18.50.0.6.orig/ld/Makefile.am	2008-04-03 18:54:05.000000000 +0200
   57.12 -+++ binutils-2.18.50.0.6/ld/Makefile.am	2008-05-02 23:25:14.000000000 +0200
   57.13 -@@ -18,7 +18,7 @@
   57.14 - # We put the scripts in the directory $(scriptdir)/ldscripts.
   57.15 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   57.16 - # directives need to be different for native and cross linkers.
   57.17 --scriptdir = $(tooldir)/lib
   57.18 -+scriptdir = $(libdir)
   57.19 - 
   57.20 - EMUL = @EMUL@
   57.21 - EMULATION_OFILES = @EMULATION_OFILES@
   57.22 -diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.in binutils-2.18.50.0.6/ld/Makefile.in
   57.23 ---- binutils-2.18.50.0.6.orig/ld/Makefile.in	2008-04-03 18:54:05.000000000 +0200
   57.24 -+++ binutils-2.18.50.0.6/ld/Makefile.in	2008-05-02 23:25:14.000000000 +0200
   57.25 -@@ -288,7 +288,7 @@
   57.26 - # We put the scripts in the directory $(scriptdir)/ldscripts.
   57.27 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   57.28 - # directives need to be different for native and cross linkers.
   57.29 --scriptdir = $(tooldir)/lib
   57.30 -+scriptdir = $(libdir)
   57.31 - BASEDIR = $(srcdir)/..
   57.32 - BFDDIR = $(BASEDIR)/bfd
   57.33 - INCDIR = $(BASEDIR)/include
    58.1 --- a/patches/binutils/2.18.50.0.6/300-check-ldrunpath-length.patch	Mon Jul 28 21:08:01 2008 +0000
    58.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.3 @@ -1,26 +0,0 @@
    58.4 -Check LD_RUN_PATH length, copied from buildroot.
    58.5 -
    58.6 - binutils-2.18.50.0.6/ld/emultempl/elf32.em |    4     4     0     0 ++++
    58.7 - 1 file changed, 4 insertions(+)
    58.8 -
    58.9 -diff -durN binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em binutils-2.18.50.0.6/ld/emultempl/elf32.em
   58.10 ---- binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em	2008-04-03 18:54:25.000000000 +0200
   58.11 -+++ binutils-2.18.50.0.6/ld/emultempl/elf32.em	2008-05-02 23:30:08.000000000 +0200
   58.12 -@@ -1220,6 +1220,8 @@
   58.13 - 	      && command_line.rpath == NULL)
   58.14 - 	    {
   58.15 - 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   58.16 -+	      if ((lib_path) && (strlen (lib_path) == 0))
   58.17 -+		  lib_path = NULL;
   58.18 - 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   58.19 - 						      force))
   58.20 - 		break;
   58.21 -@@ -1405,6 +1407,8 @@
   58.22 -   rpath = command_line.rpath;
   58.23 -   if (rpath == NULL)
   58.24 -     rpath = (const char *) getenv ("LD_RUN_PATH");
   58.25 -+  if ((rpath) && (strlen (rpath) == 0))
   58.26 -+      rpath = NULL;
   58.27 -   if (! (bfd_elf_size_dynamic_sections
   58.28 - 	 (link_info.output_bfd, command_line.soname, rpath,
   58.29 - 	  command_line.filter_shlib,
    59.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.2 +++ b/patches/binutils/2.18.50.0.7/110-ld-makefile-path.patch	Mon Jul 28 21:32:33 2008 +0000
    59.3 @@ -0,0 +1,30 @@
    59.4 +Fix ld scripts path, copied from buildroot.
    59.5 +
    59.6 + binutils-2.18.50.0.6/ld/Makefile.am |    2     1     1     0 +-
    59.7 + binutils-2.18.50.0.6/ld/Makefile.in |    2     1     1     0 +-
    59.8 + 2 files changed, 2 insertions(+), 2 deletions(-)
    59.9 +
   59.10 +diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.am binutils-2.18.50.0.6/ld/Makefile.am
   59.11 +--- binutils-2.18.50.0.6.orig/ld/Makefile.am	2008-04-03 18:54:05.000000000 +0200
   59.12 ++++ binutils-2.18.50.0.6/ld/Makefile.am	2008-05-02 23:25:14.000000000 +0200
   59.13 +@@ -18,7 +18,7 @@
   59.14 + # We put the scripts in the directory $(scriptdir)/ldscripts.
   59.15 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   59.16 + # directives need to be different for native and cross linkers.
   59.17 +-scriptdir = $(tooldir)/lib
   59.18 ++scriptdir = $(libdir)
   59.19 + 
   59.20 + EMUL = @EMUL@
   59.21 + EMULATION_OFILES = @EMULATION_OFILES@
   59.22 +diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.in binutils-2.18.50.0.6/ld/Makefile.in
   59.23 +--- binutils-2.18.50.0.6.orig/ld/Makefile.in	2008-04-03 18:54:05.000000000 +0200
   59.24 ++++ binutils-2.18.50.0.6/ld/Makefile.in	2008-05-02 23:25:14.000000000 +0200
   59.25 +@@ -288,7 +288,7 @@
   59.26 + # We put the scripts in the directory $(scriptdir)/ldscripts.
   59.27 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   59.28 + # directives need to be different for native and cross linkers.
   59.29 +-scriptdir = $(tooldir)/lib
   59.30 ++scriptdir = $(libdir)
   59.31 + BASEDIR = $(srcdir)/..
   59.32 + BFDDIR = $(BASEDIR)/bfd
   59.33 + INCDIR = $(BASEDIR)/include
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/patches/binutils/2.18.50.0.7/120-check-ldrunpath-length.patch	Mon Jul 28 21:32:33 2008 +0000
    60.3 @@ -0,0 +1,26 @@
    60.4 +Check LD_RUN_PATH length, copied from buildroot.
    60.5 +
    60.6 + binutils-2.18.50.0.6/ld/emultempl/elf32.em |    4     4     0     0 ++++
    60.7 + 1 file changed, 4 insertions(+)
    60.8 +
    60.9 +diff -durN binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em binutils-2.18.50.0.6/ld/emultempl/elf32.em
   60.10 +--- binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em	2008-04-03 18:54:25.000000000 +0200
   60.11 ++++ binutils-2.18.50.0.6/ld/emultempl/elf32.em	2008-05-02 23:30:08.000000000 +0200
   60.12 +@@ -1220,6 +1220,8 @@
   60.13 + 	      && command_line.rpath == NULL)
   60.14 + 	    {
   60.15 + 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   60.16 ++	      if ((lib_path) && (strlen (lib_path) == 0))
   60.17 ++		  lib_path = NULL;
   60.18 + 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   60.19 + 						      force))
   60.20 + 		break;
   60.21 +@@ -1405,6 +1407,8 @@
   60.22 +   rpath = command_line.rpath;
   60.23 +   if (rpath == NULL)
   60.24 +     rpath = (const char *) getenv ("LD_RUN_PATH");
   60.25 ++  if ((rpath) && (strlen (rpath) == 0))
   60.26 ++      rpath = NULL;
   60.27 +   if (! (bfd_elf_size_dynamic_sections
   60.28 + 	 (link_info.output_bfd, command_line.soname, rpath,
   60.29 + 	  command_line.filter_shlib,
    61.1 --- a/patches/binutils/2.18.50.0.7/200-ld-makefile-path.patch	Mon Jul 28 21:08:01 2008 +0000
    61.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.3 @@ -1,30 +0,0 @@
    61.4 -Fix ld scripts path, copied from buildroot.
    61.5 -
    61.6 - binutils-2.18.50.0.6/ld/Makefile.am |    2     1     1     0 +-
    61.7 - binutils-2.18.50.0.6/ld/Makefile.in |    2     1     1     0 +-
    61.8 - 2 files changed, 2 insertions(+), 2 deletions(-)
    61.9 -
   61.10 -diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.am binutils-2.18.50.0.6/ld/Makefile.am
   61.11 ---- binutils-2.18.50.0.6.orig/ld/Makefile.am	2008-04-03 18:54:05.000000000 +0200
   61.12 -+++ binutils-2.18.50.0.6/ld/Makefile.am	2008-05-02 23:25:14.000000000 +0200
   61.13 -@@ -18,7 +18,7 @@
   61.14 - # We put the scripts in the directory $(scriptdir)/ldscripts.
   61.15 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   61.16 - # directives need to be different for native and cross linkers.
   61.17 --scriptdir = $(tooldir)/lib
   61.18 -+scriptdir = $(libdir)
   61.19 - 
   61.20 - EMUL = @EMUL@
   61.21 - EMULATION_OFILES = @EMULATION_OFILES@
   61.22 -diff -durN binutils-2.18.50.0.6.orig/ld/Makefile.in binutils-2.18.50.0.6/ld/Makefile.in
   61.23 ---- binutils-2.18.50.0.6.orig/ld/Makefile.in	2008-04-03 18:54:05.000000000 +0200
   61.24 -+++ binutils-2.18.50.0.6/ld/Makefile.in	2008-05-02 23:25:14.000000000 +0200
   61.25 -@@ -288,7 +288,7 @@
   61.26 - # We put the scripts in the directory $(scriptdir)/ldscripts.
   61.27 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   61.28 - # directives need to be different for native and cross linkers.
   61.29 --scriptdir = $(tooldir)/lib
   61.30 -+scriptdir = $(libdir)
   61.31 - BASEDIR = $(srcdir)/..
   61.32 - BFDDIR = $(BASEDIR)/bfd
   61.33 - INCDIR = $(BASEDIR)/include
    62.1 --- a/patches/binutils/2.18.50.0.7/300-check-ldrunpath-length.patch	Mon Jul 28 21:08:01 2008 +0000
    62.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.3 @@ -1,26 +0,0 @@
    62.4 -Check LD_RUN_PATH length, copied from buildroot.
    62.5 -
    62.6 - binutils-2.18.50.0.6/ld/emultempl/elf32.em |    4     4     0     0 ++++
    62.7 - 1 file changed, 4 insertions(+)
    62.8 -
    62.9 -diff -durN binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em binutils-2.18.50.0.6/ld/emultempl/elf32.em
   62.10 ---- binutils-2.18.50.0.6.orig/ld/emultempl/elf32.em	2008-04-03 18:54:25.000000000 +0200
   62.11 -+++ binutils-2.18.50.0.6/ld/emultempl/elf32.em	2008-05-02 23:30:08.000000000 +0200
   62.12 -@@ -1220,6 +1220,8 @@
   62.13 - 	      && command_line.rpath == NULL)
   62.14 - 	    {
   62.15 - 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   62.16 -+	      if ((lib_path) && (strlen (lib_path) == 0))
   62.17 -+		  lib_path = NULL;
   62.18 - 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   62.19 - 						      force))
   62.20 - 		break;
   62.21 -@@ -1405,6 +1407,8 @@
   62.22 -   rpath = command_line.rpath;
   62.23 -   if (rpath == NULL)
   62.24 -     rpath = (const char *) getenv ("LD_RUN_PATH");
   62.25 -+  if ((rpath) && (strlen (rpath) == 0))
   62.26 -+      rpath = NULL;
   62.27 -   if (! (bfd_elf_size_dynamic_sections
   62.28 - 	 (link_info.output_bfd, command_line.soname, rpath,
   62.29 - 	  command_line.filter_shlib,
    63.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.2 +++ b/patches/binutils/2.18.50.0.8/110-ld-makefile-path.patch	Mon Jul 28 21:32:33 2008 +0000
    63.3 @@ -0,0 +1,24 @@
    63.4 +diff -durN binutils-2.18.50.0.8.orig/ld/Makefile.am binutils-2.18.50.0.8/ld/Makefile.am
    63.5 +--- binutils-2.18.50.0.8.orig/ld/Makefile.am	2008-04-03 18:54:05.000000000 +0200
    63.6 ++++ binutils-2.18.50.0.8/ld/Makefile.am	2008-07-13 23:15:40.000000000 +0200
    63.7 +@@ -18,7 +18,7 @@
    63.8 + # We put the scripts in the directory $(scriptdir)/ldscripts.
    63.9 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   63.10 + # directives need to be different for native and cross linkers.
   63.11 +-scriptdir = $(tooldir)/lib
   63.12 ++scriptdir = $(libdir)
   63.13 + 
   63.14 + EMUL = @EMUL@
   63.15 + EMULATION_OFILES = @EMULATION_OFILES@
   63.16 +diff -durN binutils-2.18.50.0.8.orig/ld/Makefile.in binutils-2.18.50.0.8/ld/Makefile.in
   63.17 +--- binutils-2.18.50.0.8.orig/ld/Makefile.in	2008-07-10 17:32:58.000000000 +0200
   63.18 ++++ binutils-2.18.50.0.8/ld/Makefile.in	2008-07-13 23:15:40.000000000 +0200
   63.19 +@@ -290,7 +290,7 @@
   63.20 + # We put the scripts in the directory $(scriptdir)/ldscripts.
   63.21 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   63.22 + # directives need to be different for native and cross linkers.
   63.23 +-scriptdir = $(tooldir)/lib
   63.24 ++scriptdir = $(libdir)
   63.25 + BASEDIR = $(srcdir)/..
   63.26 + BFDDIR = $(BASEDIR)/bfd
   63.27 + INCDIR = $(BASEDIR)/include
    64.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.2 +++ b/patches/binutils/2.18.50.0.8/120-check-ldrunpath-length.patch	Mon Jul 28 21:32:33 2008 +0000
    64.3 @@ -0,0 +1,21 @@
    64.4 +diff -durN binutils-2.18.50.0.8.orig/ld/emultempl/elf32.em binutils-2.18.50.0.8/ld/emultempl/elf32.em
    64.5 +--- binutils-2.18.50.0.8.orig/ld/emultempl/elf32.em	2008-07-10 17:33:23.000000000 +0200
    64.6 ++++ binutils-2.18.50.0.8/ld/emultempl/elf32.em	2008-07-13 23:19:29.000000000 +0200
    64.7 +@@ -1220,6 +1220,8 @@
    64.8 + 	      && command_line.rpath == NULL)
    64.9 + 	    {
   64.10 + 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   64.11 ++	      if ((lib_path) && (strlen (lib_path) == 0))
   64.12 ++		  lib_path = NULL;
   64.13 + 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   64.14 + 						      force))
   64.15 + 		break;
   64.16 +@@ -1405,6 +1407,8 @@
   64.17 +   rpath = command_line.rpath;
   64.18 +   if (rpath == NULL)
   64.19 +     rpath = (const char *) getenv ("LD_RUN_PATH");
   64.20 ++  if ((rpath) && (strlen (rpath) == 0))
   64.21 ++      rpath = NULL;
   64.22 +   if (! (bfd_elf_size_dynamic_sections
   64.23 + 	 (link_info.output_bfd, command_line.soname, rpath,
   64.24 + 	  command_line.filter_shlib,
    65.1 --- a/patches/binutils/2.18.50.0.8/200-ld-makefile-path.patch	Mon Jul 28 21:08:01 2008 +0000
    65.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.3 @@ -1,24 +0,0 @@
    65.4 -diff -durN binutils-2.18.50.0.8.orig/ld/Makefile.am binutils-2.18.50.0.8/ld/Makefile.am
    65.5 ---- binutils-2.18.50.0.8.orig/ld/Makefile.am	2008-04-03 18:54:05.000000000 +0200
    65.6 -+++ binutils-2.18.50.0.8/ld/Makefile.am	2008-07-13 23:15:40.000000000 +0200
    65.7 -@@ -18,7 +18,7 @@
    65.8 - # We put the scripts in the directory $(scriptdir)/ldscripts.
    65.9 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   65.10 - # directives need to be different for native and cross linkers.
   65.11 --scriptdir = $(tooldir)/lib
   65.12 -+scriptdir = $(libdir)
   65.13 - 
   65.14 - EMUL = @EMUL@
   65.15 - EMULATION_OFILES = @EMULATION_OFILES@
   65.16 -diff -durN binutils-2.18.50.0.8.orig/ld/Makefile.in binutils-2.18.50.0.8/ld/Makefile.in
   65.17 ---- binutils-2.18.50.0.8.orig/ld/Makefile.in	2008-07-10 17:32:58.000000000 +0200
   65.18 -+++ binutils-2.18.50.0.8/ld/Makefile.in	2008-07-13 23:15:40.000000000 +0200
   65.19 -@@ -290,7 +290,7 @@
   65.20 - # We put the scripts in the directory $(scriptdir)/ldscripts.
   65.21 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   65.22 - # directives need to be different for native and cross linkers.
   65.23 --scriptdir = $(tooldir)/lib
   65.24 -+scriptdir = $(libdir)
   65.25 - BASEDIR = $(srcdir)/..
   65.26 - BFDDIR = $(BASEDIR)/bfd
   65.27 - INCDIR = $(BASEDIR)/include
    66.1 --- a/patches/binutils/2.18.50.0.8/300-check-ldrunpath-length.patch	Mon Jul 28 21:08:01 2008 +0000
    66.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.3 @@ -1,21 +0,0 @@
    66.4 -diff -durN binutils-2.18.50.0.8.orig/ld/emultempl/elf32.em binutils-2.18.50.0.8/ld/emultempl/elf32.em
    66.5 ---- binutils-2.18.50.0.8.orig/ld/emultempl/elf32.em	2008-07-10 17:33:23.000000000 +0200
    66.6 -+++ binutils-2.18.50.0.8/ld/emultempl/elf32.em	2008-07-13 23:19:29.000000000 +0200
    66.7 -@@ -1220,6 +1220,8 @@
    66.8 - 	      && command_line.rpath == NULL)
    66.9 - 	    {
   66.10 - 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   66.11 -+	      if ((lib_path) && (strlen (lib_path) == 0))
   66.12 -+		  lib_path = NULL;
   66.13 - 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   66.14 - 						      force))
   66.15 - 		break;
   66.16 -@@ -1405,6 +1407,8 @@
   66.17 -   rpath = command_line.rpath;
   66.18 -   if (rpath == NULL)
   66.19 -     rpath = (const char *) getenv ("LD_RUN_PATH");
   66.20 -+  if ((rpath) && (strlen (rpath) == 0))
   66.21 -+      rpath = NULL;
   66.22 -   if (! (bfd_elf_size_dynamic_sections
   66.23 - 	 (link_info.output_bfd, command_line.soname, rpath,
   66.24 - 	  command_line.filter_shlib,
    67.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.2 +++ b/patches/dmalloc/5.5.2/130-mips.patch	Mon Jul 28 21:32:33 2008 +0000
    67.3 @@ -0,0 +1,64 @@
    67.4 +Patch to correctly handle the MIPS case.
    67.5 +
    67.6 +It was build up by Yann E. MORIN <yann.morin.1998@anciens.enib.fr> from some
    67.7 +bits gathered from buildroot, which is LGPL v2.1
    67.8 +License for dmalloc is:
    67.9 + * Permission to use, copy, modify, and distribute this software for
   67.10 + * any purpose and without fee is hereby granted, provided that the
   67.11 + * above copyright notice and this permission notice appear in all
   67.12 + * copies, and that the name of Gray Watson not be used in advertising
   67.13 + * or publicity pertaining to distribution of the document or software
   67.14 + * without specific, written prior permission.
   67.15 + *
   67.16 + * Gray Watson makes no representations about the suitability of the
   67.17 + * software described herein for any purpose.  It is provided "as is"
   67.18 + * without express or implied warranty.
   67.19 +
   67.20 +I personnaly believe that the resulting code should therefore be
   67.21 +LGPL v2.1, but don't believe me, ask your lawyers!
   67.22 +
   67.23 +diff -dur dmalloc-5.5.2.orig/configure dmalloc-5.5.2/configure
   67.24 +--- dmalloc-5.5.2.orig/configure	2007-05-18 12:15:39.000000000 +0200
   67.25 ++++ dmalloc-5.5.2/configure	2007-05-18 12:15:48.000000000 +0200
   67.26 +@@ -7107,7 +7107,7 @@
   67.27 + echo $ECHO_N "checking return.h macros work... $ECHO_C" >&6
   67.28 + if test "$cross_compiling" = yes; then
   67.29 +    cat >>confdefs.h <<\_ACEOF
   67.30 +-#define RETURN_MACROS_WORK 0
   67.31 ++#define RETURN_MACROS_WORK 1
   67.32 + _ACEOF
   67.33 +  echo "$as_me:$LINENO: result: no" >&5
   67.34 + echo "${ECHO_T}no" >&6
   67.35 +diff -dur dmalloc-5.5.2.orig/return.h dmalloc-5.5.2/return.h
   67.36 +--- dmalloc-5.5.2.orig/return.h	2007-05-14 19:26:14.000000000 +0200
   67.37 ++++ dmalloc-5.5.2/return.h	2007-05-18 12:15:48.000000000 +0200
   67.38 +@@ -106,26 +106,16 @@
   67.39 + /*************************************/
   67.40 + 
   67.41 + /*
   67.42 +- * For DEC Mips machines running Ultrix
   67.43 ++ * For Mips machines running Linux
   67.44 +  */
   67.45 + #if __mips
   67.46 + 
   67.47 + /*
   67.48 +- * I have no idea how to get inline assembly with the default cc.
   67.49 +- * Anyone know how?
   67.50 +- */
   67.51 +-
   67.52 +-#if 0
   67.53 +-
   67.54 +-/*
   67.55 +  * NOTE: we assume here that file is global.
   67.56 +  *
   67.57 +- * $31 is the frame pointer.  $2 looks to be the return address but maybe
   67.58 +- * not consistently.
   67.59 ++ * $31 is the return address.
   67.60 +  */
   67.61 +-#define GET_RET_ADDR(file)	asm("sw $2, file")
   67.62 +-
   67.63 +-#endif
   67.64 ++#define GET_RET_ADDR(file)	asm("sw $31, %0" : "=m" (file))
   67.65 + 
   67.66 + #endif /* __mips */
   67.67 + 
    68.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.2 +++ b/patches/dmalloc/5.5.2/140-shared_library.patch	Mon Jul 28 21:32:33 2008 +0000
    68.3 @@ -0,0 +1,44 @@
    68.4 +This patch makes building the shared library possible.
    68.5 +
    68.6 +Copyright 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
    68.7 +Licensed to you as dmalloc-5.5.2 is.
    68.8 +
    68.9 +diff -dur dmalloc-5.5.2.orig/Makefile.in dmalloc-5.5.2/Makefile.in
   68.10 +--- dmalloc-5.5.2.orig/Makefile.in	2007-05-14 19:26:14.000000000 +0200
   68.11 ++++ dmalloc-5.5.2/Makefile.in	2007-05-18 15:54:04.000000000 +0200
   68.12 +@@ -257,7 +257,7 @@
   68.13 + # via: http://256.com/gray/email.html
   68.14 + $(LIB_SL) : $(LIBRARY)
   68.15 + 	rm -f $@ $@.t
   68.16 +-	@shlinkargs@ $(LIBRARY) $(OBJS) $(NORMAL_OBJS)
   68.17 ++	@shlinkargs@ $(LIBRARY)
   68.18 + 	mv $@.t $@
   68.19 + 
   68.20 + $(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
   68.21 +@@ -270,7 +270,7 @@
   68.22 + 
   68.23 + $(LIB_TH_SL) : $(LIB_TH)
   68.24 + 	rm -f $@ $@.t
   68.25 +-	@shlinkargs@ $(LIB_TH) $(OBJS) $(THREAD_OBJS)
   68.26 ++	@shlinkargs@ $(LIB_TH)
   68.27 + 	mv $@.t $@
   68.28 + 
   68.29 + $(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
   68.30 +@@ -279,7 +279,7 @@
   68.31 + 
   68.32 + $(LIB_CXX_SL) : $(LIB_CXX)
   68.33 + 	rm -f $@ $@.t
   68.34 +-	@shlinkargs@ $(LIB_CXX) $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
   68.35 ++	@shlinkargs@ $(LIB_CXX)
   68.36 + 	mv $@.t $@
   68.37 + 
   68.38 + $(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
   68.39 +@@ -288,7 +288,7 @@
   68.40 + 
   68.41 + $(LIB_TH_CXX_SL) : $(LIB_TH_CXX)
   68.42 + 	rm -f $@ $@.t
   68.43 +-	@shlinkargs@ $(LIB_TH_CXX) $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
   68.44 ++	@shlinkargs@ $(LIB_TH_CXX)
   68.45 + 	mv $@.t $@
   68.46 + 
   68.47 + threadssl : $(LIB_TH_SL)
    69.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.2 +++ b/patches/dmalloc/5.5.2/150-use_DESTDIR.patch	Mon Jul 28 21:32:33 2008 +0000
    69.3 @@ -0,0 +1,105 @@
    69.4 +Make install rules use DESTDIR.
    69.5 +Split installation of the utilitity from the global install.
    69.6 +
    69.7 +Copyright 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
    69.8 +Licensed to you as dmalloc-5.5.2 is.
    69.9 +
   69.10 +diff -dur dmalloc-5.5.2.orig/Makefile.in dmalloc-5.5.2/Makefile.in
   69.11 +--- dmalloc-5.5.2.orig/Makefile.in	2007-05-18 16:03:31.000000000 +0200
   69.12 ++++ dmalloc-5.5.2/Makefile.in	2007-05-18 16:22:59.000000000 +0200
   69.13 +@@ -174,66 +174,67 @@
   69.14 + #	rm -f configure
   69.15 + 
   69.16 + installdirs :
   69.17 +-	$(srcdir)/mkinstalldirs $(includedir) $(libdir) $(bindir)
   69.18 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(includedir) $(DESTDIR)/$(libdir) $(DESTDIR)/$(bindir)
   69.19 + 
   69.20 + installincs : $(HFLS)
   69.21 +-	$(srcdir)/mkinstalldirs $(includedir)
   69.22 +-	$(INSTALL_DATA) $(HFLS) $(includedir)
   69.23 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(includedir)
   69.24 ++	$(INSTALL_DATA) $(HFLS) $(DESTDIR)/$(includedir)
   69.25 + 
   69.26 + installthsl : $(LIB_TH_SL)
   69.27 +-	$(srcdir)/mkinstalldirs $(libdir)
   69.28 +-	$(INSTALL_PROGRAM) $(LIB_TH_SL) $(libdir)
   69.29 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   69.30 ++	$(INSTALL_PROGRAM) $(LIB_TH_SL) $(DESTDIR)/$(libdir)
   69.31 + 
   69.32 + installth : $(INSTALL_THREADS)
   69.33 +-	$(srcdir)/mkinstalldirs $(libdir)
   69.34 +-	$(INSTALL_PROGRAM) $(LIB_TH) $(libdir)
   69.35 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   69.36 ++	$(INSTALL_PROGRAM) $(LIB_TH) $(DESTDIR)/$(libdir)
   69.37 + @CXX_OFF@	@echo "Enter 'make installthcxx' to install the threaded C++ library"
   69.38 + @SL_OFF@	@echo "Enter 'make installthsl' to install the threaded shared-library"
   69.39 + 
   69.40 + installthcxxsl : $(LIB_TH_CXX_SL)
   69.41 +-	$(srcdir)/mkinstalldirs $(shlibdir)
   69.42 +-	$(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(shlibdir)
   69.43 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
   69.44 ++	$(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(DESTDIR)/$(shlibdir)
   69.45 + 
   69.46 + installthcxx : $(INSTALL_TH_CXX)
   69.47 +-	$(srcdir)/mkinstalldirs $(libdir)
   69.48 +-	$(INSTALL_PROGRAM) $(LIB_TH_CXX) $(libdir)
   69.49 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   69.50 ++	$(INSTALL_PROGRAM) $(LIB_TH_CXX) $(DESTDIR)/$(libdir)
   69.51 + @SL_OFF@	@echo "Enter 'make installthcxxsl' to install the threaded C++ shared-library"
   69.52 + 
   69.53 + installcxxsl : $(LIB_CXX_SL)
   69.54 +-	$(srcdir)/mkinstalldirs $(libdir)
   69.55 +-	$(INSTALL_PROGRAM) $(LIB_CXX_SL) $(libdir)
   69.56 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   69.57 ++	$(INSTALL_PROGRAM) $(LIB_CXX_SL) $(DESTDIR)/$(libdir)
   69.58 + 
   69.59 + installcxx : $(INSTALL_CXX)
   69.60 +-	$(srcdir)/mkinstalldirs $(libdir)
   69.61 +-	$(INSTALL_PROGRAM) $(LIB_CXX) $(libdir)
   69.62 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   69.63 ++	$(INSTALL_PROGRAM) $(LIB_CXX) $(DESTDIR)/$(libdir)
   69.64 + @TH_OFF@	@echo "Enter 'make installthcxx' to install the threaded C++ library"
   69.65 + @SL_OFF@	@echo "Enter 'make installcxxsl' to install the C++ shared-library"
   69.66 + 
   69.67 + installsl : $(LIB_SL)
   69.68 +-	$(srcdir)/mkinstalldirs $(shlibdir)
   69.69 +-	$(INSTALL_PROGRAM) $(LIB_SL) $(shlibdir)
   69.70 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
   69.71 ++	$(INSTALL_PROGRAM) $(LIB_SL) $(DESTDIR)/$(shlibdir)
   69.72 + @CXX_OFF@	@echo "Enter 'make installcxxsl' to install the C++ shared-library"
   69.73 + @TH_OFF@	@echo "Enter 'make installthsl' to install thread shared-library"
   69.74 + 
   69.75 + installlib : $(INSTALL_LIB)
   69.76 +-	$(srcdir)/mkinstalldirs $(libdir)
   69.77 +-	$(INSTALL_PROGRAM) $(LIBRARY) $(libdir)
   69.78 +-	@RANLIB@ $(libdir)/$(LIBRARY)
   69.79 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   69.80 ++	$(INSTALL_PROGRAM) $(LIBRARY) $(DESTDIR)/$(libdir)
   69.81 ++	@RANLIB@ $(DESTDIR)/$(libdir)/$(LIBRARY)
   69.82 + @SL_OFF@	@echo "Enter 'make installsl' to install $(LIB_SL) in $(shlibdir)"
   69.83 + @CXX_OFF@	@echo "Enter 'make installcxx' to install the C++ library"
   69.84 + @TH_OFF@	@echo "Enter 'make installth' to install thread library"
   69.85 + 
   69.86 + installdocs : $(srcdir)/docs/$(HTMLFILE) $(srcdir)/docs/$(TEXIFILE) \
   69.87 + 		$(srcdir)/docs/$(PDFFILE)
   69.88 +-	$(srcdir)/mkinstalldirs $(docdir)
   69.89 +-	$(INSTALL_DATA) $(srcdir)/docs/$(HTMLFILE) $(docdir)
   69.90 +-	$(INSTALL_DATA) $(srcdir)/docs/$(TEXIFILE) $(docdir)
   69.91 +-	$(INSTALL_DATA) $(srcdir)/docs/$(PDFFILE) $(docdir)
   69.92 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(docdir)
   69.93 ++	$(INSTALL_DATA) $(srcdir)/docs/$(HTMLFILE) $(DESTDIR)/$(docdir)
   69.94 ++	$(INSTALL_DATA) $(srcdir)/docs/$(TEXIFILE) $(DESTDIR)/$(docdir)
   69.95 ++	$(INSTALL_DATA) $(srcdir)/docs/$(PDFFILE) $(DESTDIR)/$(docdir)
   69.96 + 
   69.97 +-install : installincs installlib $(UTIL)
   69.98 +-	$(srcdir)/mkinstalldirs $(bindir)
   69.99 +-	$(INSTALL_PROGRAM) $(UTIL) $(bindir)
  69.100 +-	@echo "Enter 'make installdocs' to install $(DOCFILES) in $(docdir)"
  69.101 ++installutil : $(UTIL)
  69.102 ++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(bindir)
  69.103 ++	$(INSTALL_PROGRAM) $(UTIL) $(DESTDIR)/$(bindir)
  69.104 ++
  69.105 ++install : installincs installlib installutil installdocs
  69.106 + 
  69.107 + dmalloc.h.2 : $(srcdir)/configure
  69.108 + 	$(SHELL) $(srcdir)/configure
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/patches/dmalloc/5.5.2/160-strdup_macro.patch	Mon Jul 28 21:32:33 2008 +0000
    70.3 @@ -0,0 +1,39 @@
    70.4 +--- dmalloc-5.5.2.orig/configure	2008-06-17 13:10:09.000000000 +0200
    70.5 ++++ dmalloc-5.5.2/configure	2008-06-17 13:11:25.000000000 +0200
    70.6 +@@ -4691,8 +4691,35 @@
    70.7 + echo "$as_me:$LINENO: checking strdup macro" >&5
    70.8 + echo $ECHO_N "checking strdup macro... $ECHO_C" >&6
    70.9 + if test "$cross_compiling" = yes; then
   70.10 +-  ac_cv_strdup_macro=no
   70.11 ++  cat >conftest.$ac_ext <<_ACEOF
   70.12 ++/* confdefs.h */
   70.13 ++_ACEOF
   70.14 ++cat confdefs.h >>conftest.$ac_ext
   70.15 ++cat >>conftest.$ac_ext <<_ACEOF
   70.16 ++/* end confdefs.h.  */
   70.17 ++
   70.18 ++#if HAVE_STDLIB_H
   70.19 ++#  include <string.h>
   70.20 ++#endif
   70.21 ++
   70.22 ++#ifndef strdup
   70.23 ++       choke me
   70.24 ++#endif
   70.25 + 
   70.26 ++main() { exit(0); }
   70.27 ++
   70.28 ++_ACEOF
   70.29 ++rm -f conftest.o conftest.obj
   70.30 ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   70.31 ++  (eval $ac_compile) 2>&5
   70.32 ++  ac_status=$?
   70.33 ++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   70.34 ++  (exit $ac_status); }; then
   70.35 ++  ac_cv_strdup_macro=yes
   70.36 ++else
   70.37 ++  ac_cv_strdup_macro=no
   70.38 ++fi
   70.39 ++  
   70.40 + else
   70.41 +   cat >conftest.$ac_ext <<_ACEOF
   70.42 + /* confdefs.h.  */
    71.1 --- a/patches/dmalloc/5.5.2/200-mips.patch	Mon Jul 28 21:08:01 2008 +0000
    71.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.3 @@ -1,64 +0,0 @@
    71.4 -Patch to correctly handle the MIPS case.
    71.5 -
    71.6 -It was build up by Yann E. MORIN <yann.morin.1998@anciens.enib.fr> from some
    71.7 -bits gathered from buildroot, which is LGPL v2.1
    71.8 -License for dmalloc is:
    71.9 - * Permission to use, copy, modify, and distribute this software for
   71.10 - * any purpose and without fee is hereby granted, provided that the
   71.11 - * above copyright notice and this permission notice appear in all
   71.12 - * copies, and that the name of Gray Watson not be used in advertising
   71.13 - * or publicity pertaining to distribution of the document or software
   71.14 - * without specific, written prior permission.
   71.15 - *
   71.16 - * Gray Watson makes no representations about the suitability of the
   71.17 - * software described herein for any purpose.  It is provided "as is"
   71.18 - * without express or implied warranty.
   71.19 -
   71.20 -I personnaly believe that the resulting code should therefore be
   71.21 -LGPL v2.1, but don't believe me, ask your lawyers!
   71.22 -
   71.23 -diff -dur dmalloc-5.5.2.orig/configure dmalloc-5.5.2/configure
   71.24 ---- dmalloc-5.5.2.orig/configure	2007-05-18 12:15:39.000000000 +0200
   71.25 -+++ dmalloc-5.5.2/configure	2007-05-18 12:15:48.000000000 +0200
   71.26 -@@ -7107,7 +7107,7 @@
   71.27 - echo $ECHO_N "checking return.h macros work... $ECHO_C" >&6
   71.28 - if test "$cross_compiling" = yes; then
   71.29 -    cat >>confdefs.h <<\_ACEOF
   71.30 --#define RETURN_MACROS_WORK 0
   71.31 -+#define RETURN_MACROS_WORK 1
   71.32 - _ACEOF
   71.33 -  echo "$as_me:$LINENO: result: no" >&5
   71.34 - echo "${ECHO_T}no" >&6
   71.35 -diff -dur dmalloc-5.5.2.orig/return.h dmalloc-5.5.2/return.h
   71.36 ---- dmalloc-5.5.2.orig/return.h	2007-05-14 19:26:14.000000000 +0200
   71.37 -+++ dmalloc-5.5.2/return.h	2007-05-18 12:15:48.000000000 +0200
   71.38 -@@ -106,26 +106,16 @@
   71.39 - /*************************************/
   71.40 - 
   71.41 - /*
   71.42 -- * For DEC Mips machines running Ultrix
   71.43 -+ * For Mips machines running Linux
   71.44 -  */
   71.45 - #if __mips
   71.46 - 
   71.47 - /*
   71.48 -- * I have no idea how to get inline assembly with the default cc.
   71.49 -- * Anyone know how?
   71.50 -- */
   71.51 --
   71.52 --#if 0
   71.53 --
   71.54 --/*
   71.55 -  * NOTE: we assume here that file is global.
   71.56 -  *
   71.57 -- * $31 is the frame pointer.  $2 looks to be the return address but maybe
   71.58 -- * not consistently.
   71.59 -+ * $31 is the return address.
   71.60 -  */
   71.61 --#define GET_RET_ADDR(file)	asm("sw $2, file")
   71.62 --
   71.63 --#endif
   71.64 -+#define GET_RET_ADDR(file)	asm("sw $31, %0" : "=m" (file))
   71.65 - 
   71.66 - #endif /* __mips */
   71.67 - 
    72.1 --- a/patches/dmalloc/5.5.2/300-shared_library.patch	Mon Jul 28 21:08:01 2008 +0000
    72.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.3 @@ -1,44 +0,0 @@
    72.4 -This patch makes building the shared library possible.
    72.5 -
    72.6 -Copyright 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
    72.7 -Licensed to you as dmalloc-5.5.2 is.
    72.8 -
    72.9 -diff -dur dmalloc-5.5.2.orig/Makefile.in dmalloc-5.5.2/Makefile.in
   72.10 ---- dmalloc-5.5.2.orig/Makefile.in	2007-05-14 19:26:14.000000000 +0200
   72.11 -+++ dmalloc-5.5.2/Makefile.in	2007-05-18 15:54:04.000000000 +0200
   72.12 -@@ -257,7 +257,7 @@
   72.13 - # via: http://256.com/gray/email.html
   72.14 - $(LIB_SL) : $(LIBRARY)
   72.15 - 	rm -f $@ $@.t
   72.16 --	@shlinkargs@ $(LIBRARY) $(OBJS) $(NORMAL_OBJS)
   72.17 -+	@shlinkargs@ $(LIBRARY)
   72.18 - 	mv $@.t $@
   72.19 - 
   72.20 - $(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
   72.21 -@@ -270,7 +270,7 @@
   72.22 - 
   72.23 - $(LIB_TH_SL) : $(LIB_TH)
   72.24 - 	rm -f $@ $@.t
   72.25 --	@shlinkargs@ $(LIB_TH) $(OBJS) $(THREAD_OBJS)
   72.26 -+	@shlinkargs@ $(LIB_TH)
   72.27 - 	mv $@.t $@
   72.28 - 
   72.29 - $(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
   72.30 -@@ -279,7 +279,7 @@
   72.31 - 
   72.32 - $(LIB_CXX_SL) : $(LIB_CXX)
   72.33 - 	rm -f $@ $@.t
   72.34 --	@shlinkargs@ $(LIB_CXX) $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
   72.35 -+	@shlinkargs@ $(LIB_CXX)
   72.36 - 	mv $@.t $@
   72.37 - 
   72.38 - $(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
   72.39 -@@ -288,7 +288,7 @@
   72.40 - 
   72.41 - $(LIB_TH_CXX_SL) : $(LIB_TH_CXX)
   72.42 - 	rm -f $@ $@.t
   72.43 --	@shlinkargs@ $(LIB_TH_CXX) $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
   72.44 -+	@shlinkargs@ $(LIB_TH_CXX)
   72.45 - 	mv $@.t $@
   72.46 - 
   72.47 - threadssl : $(LIB_TH_SL)
    73.1 --- a/patches/dmalloc/5.5.2/400-use_DESTDIR.patch	Mon Jul 28 21:08:01 2008 +0000
    73.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.3 @@ -1,105 +0,0 @@
    73.4 -Make install rules use DESTDIR.
    73.5 -Split installation of the utilitity from the global install.
    73.6 -
    73.7 -Copyright 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
    73.8 -Licensed to you as dmalloc-5.5.2 is.
    73.9 -
   73.10 -diff -dur dmalloc-5.5.2.orig/Makefile.in dmalloc-5.5.2/Makefile.in
   73.11 ---- dmalloc-5.5.2.orig/Makefile.in	2007-05-18 16:03:31.000000000 +0200
   73.12 -+++ dmalloc-5.5.2/Makefile.in	2007-05-18 16:22:59.000000000 +0200
   73.13 -@@ -174,66 +174,67 @@
   73.14 - #	rm -f configure
   73.15 - 
   73.16 - installdirs :
   73.17 --	$(srcdir)/mkinstalldirs $(includedir) $(libdir) $(bindir)
   73.18 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(includedir) $(DESTDIR)/$(libdir) $(DESTDIR)/$(bindir)
   73.19 - 
   73.20 - installincs : $(HFLS)
   73.21 --	$(srcdir)/mkinstalldirs $(includedir)
   73.22 --	$(INSTALL_DATA) $(HFLS) $(includedir)
   73.23 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(includedir)
   73.24 -+	$(INSTALL_DATA) $(HFLS) $(DESTDIR)/$(includedir)
   73.25 - 
   73.26 - installthsl : $(LIB_TH_SL)
   73.27 --	$(srcdir)/mkinstalldirs $(libdir)
   73.28 --	$(INSTALL_PROGRAM) $(LIB_TH_SL) $(libdir)
   73.29 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   73.30 -+	$(INSTALL_PROGRAM) $(LIB_TH_SL) $(DESTDIR)/$(libdir)
   73.31 - 
   73.32 - installth : $(INSTALL_THREADS)
   73.33 --	$(srcdir)/mkinstalldirs $(libdir)
   73.34 --	$(INSTALL_PROGRAM) $(LIB_TH) $(libdir)
   73.35 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   73.36 -+	$(INSTALL_PROGRAM) $(LIB_TH) $(DESTDIR)/$(libdir)
   73.37 - @CXX_OFF@	@echo "Enter 'make installthcxx' to install the threaded C++ library"
   73.38 - @SL_OFF@	@echo "Enter 'make installthsl' to install the threaded shared-library"
   73.39 - 
   73.40 - installthcxxsl : $(LIB_TH_CXX_SL)
   73.41 --	$(srcdir)/mkinstalldirs $(shlibdir)
   73.42 --	$(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(shlibdir)
   73.43 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
   73.44 -+	$(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(DESTDIR)/$(shlibdir)
   73.45 - 
   73.46 - installthcxx : $(INSTALL_TH_CXX)
   73.47 --	$(srcdir)/mkinstalldirs $(libdir)
   73.48 --	$(INSTALL_PROGRAM) $(LIB_TH_CXX) $(libdir)
   73.49 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   73.50 -+	$(INSTALL_PROGRAM) $(LIB_TH_CXX) $(DESTDIR)/$(libdir)
   73.51 - @SL_OFF@	@echo "Enter 'make installthcxxsl' to install the threaded C++ shared-library"
   73.52 - 
   73.53 - installcxxsl : $(LIB_CXX_SL)
   73.54 --	$(srcdir)/mkinstalldirs $(libdir)
   73.55 --	$(INSTALL_PROGRAM) $(LIB_CXX_SL) $(libdir)
   73.56 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   73.57 -+	$(INSTALL_PROGRAM) $(LIB_CXX_SL) $(DESTDIR)/$(libdir)
   73.58 - 
   73.59 - installcxx : $(INSTALL_CXX)
   73.60 --	$(srcdir)/mkinstalldirs $(libdir)
   73.61 --	$(INSTALL_PROGRAM) $(LIB_CXX) $(libdir)
   73.62 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   73.63 -+	$(INSTALL_PROGRAM) $(LIB_CXX) $(DESTDIR)/$(libdir)
   73.64 - @TH_OFF@	@echo "Enter 'make installthcxx' to install the threaded C++ library"
   73.65 - @SL_OFF@	@echo "Enter 'make installcxxsl' to install the C++ shared-library"
   73.66 - 
   73.67 - installsl : $(LIB_SL)
   73.68 --	$(srcdir)/mkinstalldirs $(shlibdir)
   73.69 --	$(INSTALL_PROGRAM) $(LIB_SL) $(shlibdir)
   73.70 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
   73.71 -+	$(INSTALL_PROGRAM) $(LIB_SL) $(DESTDIR)/$(shlibdir)
   73.72 - @CXX_OFF@	@echo "Enter 'make installcxxsl' to install the C++ shared-library"
   73.73 - @TH_OFF@	@echo "Enter 'make installthsl' to install thread shared-library"
   73.74 - 
   73.75 - installlib : $(INSTALL_LIB)
   73.76 --	$(srcdir)/mkinstalldirs $(libdir)
   73.77 --	$(INSTALL_PROGRAM) $(LIBRARY) $(libdir)
   73.78 --	@RANLIB@ $(libdir)/$(LIBRARY)
   73.79 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
   73.80 -+	$(INSTALL_PROGRAM) $(LIBRARY) $(DESTDIR)/$(libdir)
   73.81 -+	@RANLIB@ $(DESTDIR)/$(libdir)/$(LIBRARY)
   73.82 - @SL_OFF@	@echo "Enter 'make installsl' to install $(LIB_SL) in $(shlibdir)"
   73.83 - @CXX_OFF@	@echo "Enter 'make installcxx' to install the C++ library"
   73.84 - @TH_OFF@	@echo "Enter 'make installth' to install thread library"
   73.85 - 
   73.86 - installdocs : $(srcdir)/docs/$(HTMLFILE) $(srcdir)/docs/$(TEXIFILE) \
   73.87 - 		$(srcdir)/docs/$(PDFFILE)
   73.88 --	$(srcdir)/mkinstalldirs $(docdir)
   73.89 --	$(INSTALL_DATA) $(srcdir)/docs/$(HTMLFILE) $(docdir)
   73.90 --	$(INSTALL_DATA) $(srcdir)/docs/$(TEXIFILE) $(docdir)
   73.91 --	$(INSTALL_DATA) $(srcdir)/docs/$(PDFFILE) $(docdir)
   73.92 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(docdir)
   73.93 -+	$(INSTALL_DATA) $(srcdir)/docs/$(HTMLFILE) $(DESTDIR)/$(docdir)
   73.94 -+	$(INSTALL_DATA) $(srcdir)/docs/$(TEXIFILE) $(DESTDIR)/$(docdir)
   73.95 -+	$(INSTALL_DATA) $(srcdir)/docs/$(PDFFILE) $(DESTDIR)/$(docdir)
   73.96 - 
   73.97 --install : installincs installlib $(UTIL)
   73.98 --	$(srcdir)/mkinstalldirs $(bindir)
   73.99 --	$(INSTALL_PROGRAM) $(UTIL) $(bindir)
  73.100 --	@echo "Enter 'make installdocs' to install $(DOCFILES) in $(docdir)"
  73.101 -+installutil : $(UTIL)
  73.102 -+	$(srcdir)/mkinstalldirs $(DESTDIR)/$(bindir)
  73.103 -+	$(INSTALL_PROGRAM) $(UTIL) $(DESTDIR)/$(bindir)
  73.104 -+
  73.105 -+install : installincs installlib installutil installdocs
  73.106 - 
  73.107 - dmalloc.h.2 : $(srcdir)/configure
  73.108 - 	$(SHELL) $(srcdir)/configure
    74.1 --- a/patches/dmalloc/5.5.2/500-strdup_macro.patch	Mon Jul 28 21:08:01 2008 +0000
    74.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.3 @@ -1,39 +0,0 @@
    74.4 ---- dmalloc-5.5.2.orig/configure	2008-06-17 13:10:09.000000000 +0200
    74.5 -+++ dmalloc-5.5.2/configure	2008-06-17 13:11:25.000000000 +0200
    74.6 -@@ -4691,8 +4691,35 @@
    74.7 - echo "$as_me:$LINENO: checking strdup macro" >&5
    74.8 - echo $ECHO_N "checking strdup macro... $ECHO_C" >&6
    74.9 - if test "$cross_compiling" = yes; then
   74.10 --  ac_cv_strdup_macro=no
   74.11 -+  cat >conftest.$ac_ext <<_ACEOF
   74.12 -+/* confdefs.h */
   74.13 -+_ACEOF
   74.14 -+cat confdefs.h >>conftest.$ac_ext
   74.15 -+cat >>conftest.$ac_ext <<_ACEOF
   74.16 -+/* end confdefs.h.  */
   74.17 -+
   74.18 -+#if HAVE_STDLIB_H
   74.19 -+#  include <string.h>
   74.20 -+#endif
   74.21 -+
   74.22 -+#ifndef strdup
   74.23 -+       choke me
   74.24 -+#endif
   74.25 - 
   74.26 -+main() { exit(0); }
   74.27 -+
   74.28 -+_ACEOF
   74.29 -+rm -f conftest.o conftest.obj
   74.30 -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   74.31 -+  (eval $ac_compile) 2>&5
   74.32 -+  ac_status=$?
   74.33 -+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   74.34 -+  (exit $ac_status); }; then
   74.35 -+  ac_cv_strdup_macro=yes
   74.36 -+else
   74.37 -+  ac_cv_strdup_macro=no
   74.38 -+fi
   74.39 -+  
   74.40 - else
   74.41 -   cat >conftest.$ac_ext <<_ACEOF
   74.42 - /* confdefs.h.  */
    75.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.2 +++ b/patches/duma/2_5_1/110-separate_cpp.patch	Mon Jul 28 21:32:33 2008 +0000
    75.3 @@ -0,0 +1,20 @@
    75.4 +diff -dur duma_2_5_1.orig/Makefile duma_2_5_1/Makefile
    75.5 +--- duma_2_5_1.orig/Makefile	2007-07-11 17:49:43.000000000 +0200
    75.6 ++++ duma_2_5_1/Makefile	2007-07-11 17:50:46.000000000 +0200
    75.7 +@@ -115,9 +115,14 @@
    75.8 + 	dumatest.c tstheap.c dumatestpp.cpp testoperators.cpp \
    75.9 + 	createconf.c
   75.10 + 
   75.11 +-OBJECTS = dumapp.o duma.o sem_inc.o print.o
   75.12 ++OBJECTS = duma.o sem_inc.o print.o
   75.13 ++SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
   75.14 ++
   75.15 ++ifeq ($(DUMA_CPP),1)
   75.16 ++OBJECTS += dumapp.o
   75.17 ++SO_OBJECTS += dumapp_so.o
   75.18 ++endif
   75.19 + 
   75.20 +-SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
   75.21 + 
   75.22 + all:	libduma.a $(DUMASO) tstheap dumatest dumatestpp testoperators tstheap_so dumatestpp_so
   75.23 + 	@ echo "Testing DUMA."
    76.1 --- a/patches/duma/2_5_1/200-separate_cpp.patch	Mon Jul 28 21:08:01 2008 +0000
    76.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.3 @@ -1,20 +0,0 @@
    76.4 -diff -dur duma_2_5_1.orig/Makefile duma_2_5_1/Makefile
    76.5 ---- duma_2_5_1.orig/Makefile	2007-07-11 17:49:43.000000000 +0200
    76.6 -+++ duma_2_5_1/Makefile	2007-07-11 17:50:46.000000000 +0200
    76.7 -@@ -115,9 +115,14 @@
    76.8 - 	dumatest.c tstheap.c dumatestpp.cpp testoperators.cpp \
    76.9 - 	createconf.c
   76.10 - 
   76.11 --OBJECTS = dumapp.o duma.o sem_inc.o print.o
   76.12 -+OBJECTS = duma.o sem_inc.o print.o
   76.13 -+SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
   76.14 -+
   76.15 -+ifeq ($(DUMA_CPP),1)
   76.16 -+OBJECTS += dumapp.o
   76.17 -+SO_OBJECTS += dumapp_so.o
   76.18 -+endif
   76.19 - 
   76.20 --SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
   76.21 - 
   76.22 - all:	libduma.a $(DUMASO) tstheap dumatest dumatestpp testoperators tstheap_so dumatestpp_so
   76.23 - 	@ echo "Testing DUMA."
    77.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.2 +++ b/patches/duma/2_5_12/110-separate_cpp.patch	Mon Jul 28 21:32:33 2008 +0000
    77.3 @@ -0,0 +1,19 @@
    77.4 +diff -durN duma_2_5_12.orig/Makefile duma_2_5_12/Makefile
    77.5 +--- duma_2_5_12.orig/Makefile	2007-09-07 21:57:45.000000000 +0200
    77.6 ++++ duma_2_5_12/Makefile	2007-09-07 21:58:35.000000000 +0200
    77.7 +@@ -231,9 +231,13 @@
    77.8 + 	dumatest.c tstheap.c thread-test.c testmt.c dumatestpp.cpp testoperators.cpp \
    77.9 + 	createconf.c
   77.10 +
   77.11 +-OBJECTS = dumapp.o duma.o sem_inc.o print.o
   77.12 ++OBJECTS = duma.o sem_inc.o print.o
   77.13 ++SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
   77.14 +
   77.15 +-SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
   77.16 ++ifeq ($(DUMA_CPP),1)
   77.17 ++OBJECTS += dumapp.o
   77.18 ++SO_OBJECTS += dumapp_so.o
   77.19 ++endif
   77.20 +
   77.21 + all:	libduma.a tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS)
   77.22 + 	@ $(ECHOLF)
    78.1 --- a/patches/duma/2_5_12/200-separate_cpp.patch	Mon Jul 28 21:08:01 2008 +0000
    78.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.3 @@ -1,19 +0,0 @@
    78.4 -diff -durN duma_2_5_12.orig/Makefile duma_2_5_12/Makefile
    78.5 ---- duma_2_5_12.orig/Makefile	2007-09-07 21:57:45.000000000 +0200
    78.6 -+++ duma_2_5_12/Makefile	2007-09-07 21:58:35.000000000 +0200
    78.7 -@@ -231,9 +231,13 @@
    78.8 - 	dumatest.c tstheap.c thread-test.c testmt.c dumatestpp.cpp testoperators.cpp \
    78.9 - 	createconf.c
   78.10 -
   78.11 --OBJECTS = dumapp.o duma.o sem_inc.o print.o
   78.12 -+OBJECTS = duma.o sem_inc.o print.o
   78.13 -+SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
   78.14 -
   78.15 --SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
   78.16 -+ifeq ($(DUMA_CPP),1)
   78.17 -+OBJECTS += dumapp.o
   78.18 -+SO_OBJECTS += dumapp_so.o
   78.19 -+endif
   78.20 -
   78.21 - all:	libduma.a tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS)
   78.22 - 	@ $(ECHOLF)
    79.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.2 +++ b/patches/duma/2_5_14/110-separate_cpp.patch	Mon Jul 28 21:32:33 2008 +0000
    79.3 @@ -0,0 +1,19 @@
    79.4 +diff -durN duma_2_5_14.orig/Makefile duma_2_5_14/Makefile
    79.5 +--- duma_2_5_14.orig/Makefile	2008-06-17 10:30:40.000000000 +0200
    79.6 ++++ duma_2_5_14/Makefile	2008-06-17 10:30:17.000000000 +0200
    79.7 +@@ -228,9 +228,13 @@
    79.8 + 	dumatest.c tstheap.c thread-test.c testmt.c dumatestpp.cpp testoperators.cpp \
    79.9 + 	createconf.c
   79.10 + 
   79.11 +-OBJECTS = dumapp.o duma.o sem_inc.o print.o
   79.12 ++OBJECTS = duma.o sem_inc.o print.o
   79.13 ++SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
   79.14 + 
   79.15 +-SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
   79.16 ++ifeq ($(DUMA_CPP),1)
   79.17 ++OBJECTS += dumapp.o
   79.18 ++SO_OBJECTS += dumapp_so.o
   79.19 ++endif
   79.20 + 
   79.21 + all:	libduma.a tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS)
   79.22 + 
    80.1 --- a/patches/duma/2_5_14/200-separate_cpp.patch	Mon Jul 28 21:08:01 2008 +0000
    80.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.3 @@ -1,19 +0,0 @@
    80.4 -diff -durN duma_2_5_14.orig/Makefile duma_2_5_14/Makefile
    80.5 ---- duma_2_5_14.orig/Makefile	2008-06-17 10:30:40.000000000 +0200
    80.6 -+++ duma_2_5_14/Makefile	2008-06-17 10:30:17.000000000 +0200
    80.7 -@@ -228,9 +228,13 @@
    80.8 - 	dumatest.c tstheap.c thread-test.c testmt.c dumatestpp.cpp testoperators.cpp \
    80.9 - 	createconf.c
   80.10 - 
   80.11 --OBJECTS = dumapp.o duma.o sem_inc.o print.o
   80.12 -+OBJECTS = duma.o sem_inc.o print.o
   80.13 -+SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
   80.14 - 
   80.15 --SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
   80.16 -+ifeq ($(DUMA_CPP),1)
   80.17 -+OBJECTS += dumapp.o
   80.18 -+SO_OBJECTS += dumapp_so.o
   80.19 -+endif
   80.20 - 
   80.21 - all:	libduma.a tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS)
   80.22 - 
    81.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.2 +++ b/patches/duma/2_5_8/110-separate_cpp.patch	Mon Jul 28 21:32:33 2008 +0000
    81.3 @@ -0,0 +1,19 @@
    81.4 +diff -durN duma_2_5_8.orig/Makefile duma_2_5_8/Makefile
    81.5 +--- duma_2_5_8.orig/Makefile	2007-09-07 21:57:45.000000000 +0200
    81.6 ++++ duma_2_5_8/Makefile	2007-09-07 21:58:35.000000000 +0200
    81.7 +@@ -216,9 +216,13 @@
    81.8 + 	dumatest.c tstheap.c testmt.c dumatestpp.cpp testoperators.cpp \
    81.9 + 	createconf.c
   81.10 + 
   81.11 +-OBJECTS = dumapp.o duma.o sem_inc.o print.o
   81.12 ++OBJECTS = duma.o sem_inc.o print.o
   81.13 ++SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
   81.14 + 
   81.15 +-SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
   81.16 ++ifeq ($(DUMA_CPP),1)
   81.17 ++OBJECTS += dumapp.o
   81.18 ++SO_OBJECTS += dumapp_so.o
   81.19 ++endif
   81.20 + 
   81.21 + all:	libduma.a tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS)
   81.22 + 	@ $(ECHOLF)
    82.1 --- a/patches/duma/2_5_8/200-separate_cpp.patch	Mon Jul 28 21:08:01 2008 +0000
    82.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.3 @@ -1,19 +0,0 @@
    82.4 -diff -durN duma_2_5_8.orig/Makefile duma_2_5_8/Makefile
    82.5 ---- duma_2_5_8.orig/Makefile	2007-09-07 21:57:45.000000000 +0200
    82.6 -+++ duma_2_5_8/Makefile	2007-09-07 21:58:35.000000000 +0200
    82.7 -@@ -216,9 +216,13 @@
    82.8 - 	dumatest.c tstheap.c testmt.c dumatestpp.cpp testoperators.cpp \
    82.9 - 	createconf.c
   82.10 - 
   82.11 --OBJECTS = dumapp.o duma.o sem_inc.o print.o
   82.12 -+OBJECTS = duma.o sem_inc.o print.o
   82.13 -+SO_OBJECTS = duma_so.o sem_inc_so.o print_so.o
   82.14 - 
   82.15 --SO_OBJECTS = dumapp_so.o duma_so.o sem_inc_so.o print_so.o
   82.16 -+ifeq ($(DUMA_CPP),1)
   82.17 -+OBJECTS += dumapp.o
   82.18 -+SO_OBJECTS += dumapp_so.o
   82.19 -+endif
   82.20 - 
   82.21 - all:	libduma.a tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS)
   82.22 - 	@ $(ECHOLF)
    83.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.2 +++ b/patches/gcc/3.4.6/110-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
    83.3 @@ -0,0 +1,3255 @@
    83.4 +diff -durN gcc-3.4.6.orig/libstdc++-v3/acinclude.m4 gcc-3.4.6/libstdc++-v3/acinclude.m4
    83.5 +--- gcc-3.4.6.orig/libstdc++-v3/acinclude.m4	2004-10-28 23:52:41.000000000 +0200
    83.6 ++++ gcc-3.4.6/libstdc++-v3/acinclude.m4	2007-08-15 22:51:01.000000000 +0200
    83.7 +@@ -1015,7 +1015,7 @@
    83.8 +   AC_MSG_CHECKING([for C locale to use])
    83.9 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
   83.10 +     [use MODEL for target locale package],
   83.11 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
   83.12 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
   83.13 +   
   83.14 +   # If they didn't use this option switch, or if they specified --enable
   83.15 +   # with no specific model, we'll have to look for one.  If they
   83.16 +@@ -1031,6 +1031,9 @@
   83.17 +   # Default to "generic".
   83.18 +   if test $enable_clocale_flag = auto; then
   83.19 +     case x${target_os} in
   83.20 ++      x*-uclibc*)
   83.21 ++        enable_clocale_flag=uclibc
   83.22 ++        ;;
   83.23 +       xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
   83.24 +         AC_EGREP_CPP([_GLIBCXX_ok], [
   83.25 +         #include <features.h>
   83.26 +@@ -1157,6 +1160,41 @@
   83.27 +       CTIME_CC=config/locale/generic/time_members.cc
   83.28 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
   83.29 +       ;;
   83.30 ++    uclibc)
   83.31 ++      AC_MSG_RESULT(uclibc)
   83.32 ++
   83.33 ++      # Declare intention to use gettext, and add support for specific
   83.34 ++      # languages.
   83.35 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
   83.36 ++      ALL_LINGUAS="de fr"
   83.37 ++
   83.38 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
   83.39 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
   83.40 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
   83.41 ++        USE_NLS=yes
   83.42 ++      fi
   83.43 ++      # Export the build objects.
   83.44 ++      for ling in $ALL_LINGUAS; do \
   83.45 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
   83.46 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
   83.47 ++      done
   83.48 ++      AC_SUBST(glibcxx_MOFILES)
   83.49 ++      AC_SUBST(glibcxx_POFILES)
   83.50 ++
   83.51 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
   83.52 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
   83.53 ++      CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
   83.54 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
   83.55 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
   83.56 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
   83.57 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
   83.58 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
   83.59 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
   83.60 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
   83.61 ++      CTIME_H=config/locale/uclibc/time_members.h
   83.62 ++      CTIME_CC=config/locale/uclibc/time_members.cc
   83.63 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
   83.64 ++      ;;
   83.65 +   esac
   83.66 + 
   83.67 +   # This is where the testsuite looks for locale catalogs, using the
   83.68 +diff -durN gcc-3.4.6.orig/libstdc++-v3/aclocal.m4 gcc-3.4.6/libstdc++-v3/aclocal.m4
   83.69 +--- gcc-3.4.6.orig/libstdc++-v3/aclocal.m4	2004-10-28 23:52:41.000000000 +0200
   83.70 ++++ gcc-3.4.6/libstdc++-v3/aclocal.m4	2007-08-15 22:51:01.000000000 +0200
   83.71 +@@ -1044,6 +1044,9 @@
   83.72 +   # Default to "generic".
   83.73 +   if test $enable_clocale_flag = auto; then
   83.74 +     case x${target_os} in
   83.75 ++      x*-uclibc*)
   83.76 ++	enable_clocale_flag=uclibc
   83.77 ++	;;
   83.78 +       xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
   83.79 +         AC_EGREP_CPP([_GLIBCXX_ok], [
   83.80 +         #include <features.h>
   83.81 +@@ -1170,6 +1173,41 @@
   83.82 +       CTIME_CC=config/locale/generic/time_members.cc
   83.83 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
   83.84 +       ;;
   83.85 ++    uclibc)
   83.86 ++      AC_MSG_RESULT(uclibc)
   83.87 ++
   83.88 ++      # Declare intention to use gettext, and add support for specific
   83.89 ++      # languages.
   83.90 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
   83.91 ++      ALL_LINGUAS="de fr"
   83.92 ++
   83.93 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
   83.94 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
   83.95 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
   83.96 ++        USE_NLS=yes
   83.97 ++      fi
   83.98 ++      # Export the build objects.
   83.99 ++      for ling in $ALL_LINGUAS; do \
  83.100 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  83.101 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  83.102 ++      done
  83.103 ++      AC_SUBST(glibcxx_MOFILES)
  83.104 ++      AC_SUBST(glibcxx_POFILES)
  83.105 ++
  83.106 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  83.107 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  83.108 ++      CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
  83.109 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  83.110 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  83.111 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  83.112 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  83.113 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  83.114 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  83.115 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  83.116 ++      CTIME_H=config/locale/uclibc/time_members.h
  83.117 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  83.118 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  83.119 ++      ;;
  83.120 +   esac
  83.121 + 
  83.122 +   # This is where the testsuite looks for locale catalogs, using the
  83.123 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c_locale.cc
  83.124 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  83.125 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-15 22:51:01.000000000 +0200
  83.126 +@@ -0,0 +1,160 @@
  83.127 ++// Wrapper for underlying C-language localization -*- C++ -*-
  83.128 ++
  83.129 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  83.130 ++//
  83.131 ++// This file is part of the GNU ISO C++ Library.  This library is free
  83.132 ++// software; you can redistribute it and/or modify it under the
  83.133 ++// terms of the GNU General Public License as published by the
  83.134 ++// Free Software Foundation; either version 2, or (at your option)
  83.135 ++// any later version.
  83.136 ++
  83.137 ++// This library is distributed in the hope that it will be useful,
  83.138 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  83.139 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  83.140 ++// GNU General Public License for more details.
  83.141 ++
  83.142 ++// You should have received a copy of the GNU General Public License along
  83.143 ++// with this library; see the file COPYING.  If not, write to the Free
  83.144 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  83.145 ++// USA.
  83.146 ++
  83.147 ++// As a special exception, you may use this file as part of a free software
  83.148 ++// library without restriction.  Specifically, if other files instantiate
  83.149 ++// templates or use macros or inline functions from this file, or you compile
  83.150 ++// this file and link it with other files to produce an executable, this
  83.151 ++// file does not by itself cause the resulting executable to be covered by
  83.152 ++// the GNU General Public License.  This exception does not however
  83.153 ++// invalidate any other reasons why the executable file might be covered by
  83.154 ++// the GNU General Public License.
  83.155 ++
  83.156 ++//
  83.157 ++// ISO C++ 14882: 22.8  Standard locale categories.
  83.158 ++//
  83.159 ++
  83.160 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
  83.161 ++
  83.162 ++#include <cerrno>  // For errno
  83.163 ++#include <locale>
  83.164 ++#include <stdexcept>
  83.165 ++#include <langinfo.h>
  83.166 ++#include <bits/c++locale_internal.h>
  83.167 ++
  83.168 ++#ifndef __UCLIBC_HAS_XLOCALE__
  83.169 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  83.170 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  83.171 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  83.172 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  83.173 ++#define __strtof_l(S, E, L)         strtof((S), (E))
  83.174 ++#define __strtod_l(S, E, L)         strtod((S), (E))
  83.175 ++#define __strtold_l(S, E, L)        strtold((S), (E))
  83.176 ++#warning should dummy __newlocale check for C|POSIX ?
  83.177 ++#define __newlocale(a, b, c)        NULL
  83.178 ++#define __freelocale(a)             ((void)0)
  83.179 ++#define __duplocale(a)              __c_locale()
  83.180 ++#endif
  83.181 ++
  83.182 ++namespace std 
  83.183 ++{
  83.184 ++  template<>
  83.185 ++    void
  83.186 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
  83.187 ++		   const __c_locale& __cloc)
  83.188 ++    {
  83.189 ++      if (!(__err & ios_base::failbit))
  83.190 ++	{
  83.191 ++	  char* __sanity;
  83.192 ++	  errno = 0;
  83.193 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
  83.194 ++          if (__sanity != __s && errno != ERANGE)
  83.195 ++	    __v = __f;
  83.196 ++	  else
  83.197 ++	    __err |= ios_base::failbit;
  83.198 ++	}
  83.199 ++    }
  83.200 ++
  83.201 ++  template<>
  83.202 ++    void
  83.203 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  83.204 ++		   const __c_locale& __cloc)
  83.205 ++    {
  83.206 ++      if (!(__err & ios_base::failbit))
  83.207 ++	{
  83.208 ++	  char* __sanity;
  83.209 ++	  errno = 0;
  83.210 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
  83.211 ++          if (__sanity != __s && errno != ERANGE)
  83.212 ++	    __v = __d;
  83.213 ++	  else
  83.214 ++	    __err |= ios_base::failbit;
  83.215 ++	}
  83.216 ++    }
  83.217 ++
  83.218 ++  template<>
  83.219 ++    void
  83.220 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  83.221 ++		   const __c_locale& __cloc)
  83.222 ++    {
  83.223 ++      if (!(__err & ios_base::failbit))
  83.224 ++	{
  83.225 ++	  char* __sanity;
  83.226 ++	  errno = 0;
  83.227 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  83.228 ++          if (__sanity != __s && errno != ERANGE)
  83.229 ++	    __v = __ld;
  83.230 ++	  else
  83.231 ++	    __err |= ios_base::failbit;
  83.232 ++	}
  83.233 ++    }
  83.234 ++
  83.235 ++  void
  83.236 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
  83.237 ++				    __c_locale __old)
  83.238 ++  {
  83.239 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
  83.240 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.241 ++    if (!__cloc)
  83.242 ++      {
  83.243 ++	// This named locale is not supported by the underlying OS.
  83.244 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
  83.245 ++			      "name not valid"));
  83.246 ++      }
  83.247 ++#endif
  83.248 ++  }
  83.249 ++  
  83.250 ++  void
  83.251 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  83.252 ++  {
  83.253 ++    if (_S_get_c_locale() != __cloc)
  83.254 ++      __freelocale(__cloc); 
  83.255 ++  }
  83.256 ++
  83.257 ++  __c_locale
  83.258 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
  83.259 ++  { return __duplocale(__cloc); }
  83.260 ++} // namespace std
  83.261 ++
  83.262 ++namespace __gnu_cxx
  83.263 ++{
  83.264 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
  83.265 ++    {
  83.266 ++      "LC_CTYPE", 
  83.267 ++      "LC_NUMERIC",
  83.268 ++      "LC_TIME", 
  83.269 ++      "LC_COLLATE", 
  83.270 ++      "LC_MONETARY",
  83.271 ++      "LC_MESSAGES", 
  83.272 ++#if _GLIBCXX_NUM_CATEGORIES != 0
  83.273 ++      "LC_PAPER", 
  83.274 ++      "LC_NAME", 
  83.275 ++      "LC_ADDRESS",
  83.276 ++      "LC_TELEPHONE", 
  83.277 ++      "LC_MEASUREMENT", 
  83.278 ++      "LC_IDENTIFICATION" 
  83.279 ++#endif
  83.280 ++    };
  83.281 ++}
  83.282 ++
  83.283 ++namespace std
  83.284 ++{
  83.285 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
  83.286 ++}  // namespace std
  83.287 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c_locale.h
  83.288 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
  83.289 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-15 22:51:01.000000000 +0200
  83.290 +@@ -0,0 +1,115 @@
  83.291 ++// Wrapper for underlying C-language localization -*- C++ -*-
  83.292 ++
  83.293 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  83.294 ++//
  83.295 ++// This file is part of the GNU ISO C++ Library.  This library is free
  83.296 ++// software; you can redistribute it and/or modify it under the
  83.297 ++// terms of the GNU General Public License as published by the
  83.298 ++// Free Software Foundation; either version 2, or (at your option)
  83.299 ++// any later version.
  83.300 ++
  83.301 ++// This library is distributed in the hope that it will be useful,
  83.302 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  83.303 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  83.304 ++// GNU General Public License for more details.
  83.305 ++
  83.306 ++// You should have received a copy of the GNU General Public License along
  83.307 ++// with this library; see the file COPYING.  If not, write to the Free
  83.308 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  83.309 ++// USA.
  83.310 ++
  83.311 ++// As a special exception, you may use this file as part of a free software
  83.312 ++// library without restriction.  Specifically, if other files instantiate
  83.313 ++// templates or use macros or inline functions from this file, or you compile
  83.314 ++// this file and link it with other files to produce an executable, this
  83.315 ++// file does not by itself cause the resulting executable to be covered by
  83.316 ++// the GNU General Public License.  This exception does not however
  83.317 ++// invalidate any other reasons why the executable file might be covered by
  83.318 ++// the GNU General Public License.
  83.319 ++
  83.320 ++//
  83.321 ++// ISO C++ 14882: 22.8  Standard locale categories.
  83.322 ++//
  83.323 ++
  83.324 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
  83.325 ++
  83.326 ++#ifndef _C_LOCALE_H
  83.327 ++#define _C_LOCALE_H 1
  83.328 ++
  83.329 ++#pragma GCC system_header
  83.330 ++
  83.331 ++#include <cstring>              // get std::strlen
  83.332 ++#include <cstdio>               // get std::snprintf or std::sprintf
  83.333 ++#include <clocale>
  83.334 ++#include <langinfo.h>		// For codecvt
  83.335 ++#ifdef __UCLIBC_MJN3_ONLY__
  83.336 ++#warning fix this
  83.337 ++#endif
  83.338 ++#ifdef __UCLIBC_HAS_LOCALE__
  83.339 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
  83.340 ++#endif
  83.341 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  83.342 ++#include <libintl.h> 		// For messages
  83.343 ++#endif
  83.344 ++
  83.345 ++#ifdef __UCLIBC_MJN3_ONLY__
  83.346 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
  83.347 ++#endif
  83.348 ++#define _GLIBCXX_C_LOCALE_GNU 1
  83.349 ++
  83.350 ++#ifdef __UCLIBC_MJN3_ONLY__
  83.351 ++#warning fix categories
  83.352 ++#endif
  83.353 ++// #define _GLIBCXX_NUM_CATEGORIES 6
  83.354 ++#define _GLIBCXX_NUM_CATEGORIES 0
  83.355 ++ 
  83.356 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.357 ++namespace __gnu_cxx
  83.358 ++{
  83.359 ++  extern "C" __typeof(uselocale) __uselocale;
  83.360 ++}
  83.361 ++#endif
  83.362 ++
  83.363 ++namespace std
  83.364 ++{
  83.365 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.366 ++  typedef __locale_t		__c_locale;
  83.367 ++#else
  83.368 ++  typedef int*			__c_locale;
  83.369 ++#endif
  83.370 ++
  83.371 ++  // Convert numeric value of type _Tv to string and return length of
  83.372 ++  // string.  If snprintf is available use it, otherwise fall back to
  83.373 ++  // the unsafe sprintf which, in general, can be dangerous and should
  83.374 ++  // be avoided.
  83.375 ++  template<typename _Tv>
  83.376 ++    int
  83.377 ++    __convert_from_v(char* __out, const int __size, const char* __fmt,
  83.378 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.379 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
  83.380 ++    {
  83.381 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
  83.382 ++#else
  83.383 ++		     _Tv __v, const __c_locale&, int __prec)
  83.384 ++    {
  83.385 ++# ifdef __UCLIBC_HAS_LOCALE__
  83.386 ++      char* __old = std::setlocale(LC_ALL, NULL);
  83.387 ++      char* __sav = new char[std::strlen(__old) + 1];
  83.388 ++      std::strcpy(__sav, __old);
  83.389 ++      std::setlocale(LC_ALL, "C");
  83.390 ++# endif
  83.391 ++#endif
  83.392 ++
  83.393 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
  83.394 ++
  83.395 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.396 ++      __gnu_cxx::__uselocale(__old);
  83.397 ++#elif defined __UCLIBC_HAS_LOCALE__
  83.398 ++      std::setlocale(LC_ALL, __sav);
  83.399 ++      delete [] __sav;
  83.400 ++#endif
  83.401 ++      return __ret;
  83.402 ++    }
  83.403 ++}
  83.404 ++
  83.405 ++#endif
  83.406 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  83.407 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
  83.408 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-15 22:51:01.000000000 +0200
  83.409 +@@ -0,0 +1,59 @@
  83.410 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  83.411 ++
  83.412 ++// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
  83.413 ++//
  83.414 ++// This file is part of the GNU ISO C++ Library.  This library is free
  83.415 ++// software; you can redistribute it and/or modify it under the
  83.416 ++// terms of the GNU General Public License as published by the
  83.417 ++// Free Software Foundation; either version 2, or (at your option)
  83.418 ++// any later version.
  83.419 ++
  83.420 ++// This library is distributed in the hope that it will be useful,
  83.421 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  83.422 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  83.423 ++// GNU General Public License for more details.
  83.424 ++
  83.425 ++// You should have received a copy of the GNU General Public License along
  83.426 ++// with this library; see the file COPYING.  If not, write to the Free
  83.427 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  83.428 ++// USA.
  83.429 ++
  83.430 ++// As a special exception, you may use this file as part of a free software
  83.431 ++// library without restriction.  Specifically, if other files instantiate
  83.432 ++// templates or use macros or inline functions from this file, or you compile
  83.433 ++// this file and link it with other files to produce an executable, this
  83.434 ++// file does not by itself cause the resulting executable to be covered by
  83.435 ++// the GNU General Public License.  This exception does not however
  83.436 ++// invalidate any other reasons why the executable file might be covered by
  83.437 ++// the GNU General Public License.
  83.438 ++
  83.439 ++// Written by Jakub Jelinek <jakub@redhat.com>
  83.440 ++
  83.441 ++#include <clocale>
  83.442 ++
  83.443 ++#ifdef __UCLIBC_MJN3_ONLY__
  83.444 ++#warning clean this up
  83.445 ++#endif
  83.446 ++
  83.447 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.448 ++                                                  
  83.449 ++extern "C" __typeof(iswctype_l) __iswctype_l;
  83.450 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
  83.451 ++extern "C" __typeof(strcoll_l) __strcoll_l;
  83.452 ++extern "C" __typeof(strftime_l) __strftime_l;
  83.453 ++extern "C" __typeof(strtod_l) __strtod_l;
  83.454 ++extern "C" __typeof(strtof_l) __strtof_l;
  83.455 ++extern "C" __typeof(strtold_l) __strtold_l;
  83.456 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
  83.457 ++extern "C" __typeof(towlower_l) __towlower_l;
  83.458 ++extern "C" __typeof(towupper_l) __towupper_l;
  83.459 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
  83.460 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
  83.461 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
  83.462 ++extern "C" __typeof(wctype_l) __wctype_l;
  83.463 ++extern "C" __typeof(newlocale) __newlocale;
  83.464 ++extern "C" __typeof(freelocale) __freelocale;
  83.465 ++extern "C" __typeof(duplocale) __duplocale;
  83.466 ++extern "C" __typeof(uselocale) __uselocale;
  83.467 ++
  83.468 ++#endif // GLIBC 2.3 and later
  83.469 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
  83.470 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
  83.471 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-08-15 22:51:01.000000000 +0200
  83.472 +@@ -0,0 +1,306 @@
  83.473 ++// std::codecvt implementation details, GNU version -*- C++ -*-
  83.474 ++
  83.475 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
  83.476 ++//
  83.477 ++// This file is part of the GNU ISO C++ Library.  This library is free
  83.478 ++// software; you can redistribute it and/or modify it under the
  83.479 ++// terms of the GNU General Public License as published by the
  83.480 ++// Free Software Foundation; either version 2, or (at your option)
  83.481 ++// any later version.
  83.482 ++
  83.483 ++// This library is distributed in the hope that it will be useful,
  83.484 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  83.485 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  83.486 ++// GNU General Public License for more details.
  83.487 ++
  83.488 ++// You should have received a copy of the GNU General Public License along
  83.489 ++// with this library; see the file COPYING.  If not, write to the Free
  83.490 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  83.491 ++// USA.
  83.492 ++
  83.493 ++// As a special exception, you may use this file as part of a free software
  83.494 ++// library without restriction.  Specifically, if other files instantiate
  83.495 ++// templates or use macros or inline functions from this file, or you compile
  83.496 ++// this file and link it with other files to produce an executable, this
  83.497 ++// file does not by itself cause the resulting executable to be covered by
  83.498 ++// the GNU General Public License.  This exception does not however
  83.499 ++// invalidate any other reasons why the executable file might be covered by
  83.500 ++// the GNU General Public License.
  83.501 ++
  83.502 ++//
  83.503 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
  83.504 ++//
  83.505 ++
  83.506 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
  83.507 ++
  83.508 ++#include <locale>
  83.509 ++#include <bits/c++locale_internal.h>
  83.510 ++
  83.511 ++namespace std
  83.512 ++{
  83.513 ++  // Specializations.
  83.514 ++#ifdef _GLIBCXX_USE_WCHAR_T
  83.515 ++  codecvt_base::result
  83.516 ++  codecvt<wchar_t, char, mbstate_t>::
  83.517 ++  do_out(state_type& __state, const intern_type* __from, 
  83.518 ++	 const intern_type* __from_end, const intern_type*& __from_next,
  83.519 ++	 extern_type* __to, extern_type* __to_end,
  83.520 ++	 extern_type*& __to_next) const
  83.521 ++  {
  83.522 ++    result __ret = ok;
  83.523 ++    state_type __tmp_state(__state);
  83.524 ++
  83.525 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.526 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  83.527 ++#endif
  83.528 ++
  83.529 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
  83.530 ++    // in case we fall back to wcrtomb and then continue, in a loop.
  83.531 ++    // NB: wcsnrtombs is a GNU extension
  83.532 ++    for (__from_next = __from, __to_next = __to;
  83.533 ++	 __from_next < __from_end && __to_next < __to_end
  83.534 ++	 && __ret == ok;)
  83.535 ++      {
  83.536 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
  83.537 ++						      __from_end - __from_next);
  83.538 ++	if (!__from_chunk_end)
  83.539 ++	  __from_chunk_end = __from_end;
  83.540 ++
  83.541 ++	__from = __from_next;
  83.542 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
  83.543 ++					 __from_chunk_end - __from_next,
  83.544 ++					 __to_end - __to_next, &__state);
  83.545 ++	if (__conv == static_cast<size_t>(-1))
  83.546 ++	  {
  83.547 ++	    // In case of error, in order to stop at the exact place we
  83.548 ++	    // have to start again from the beginning with a series of
  83.549 ++	    // wcrtomb.
  83.550 ++	    for (; __from < __from_next; ++__from)
  83.551 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
  83.552 ++	    __state = __tmp_state;
  83.553 ++	    __ret = error;
  83.554 ++	  }
  83.555 ++	else if (__from_next && __from_next < __from_chunk_end)
  83.556 ++	  {
  83.557 ++	    __to_next += __conv;
  83.558 ++	    __ret = partial;
  83.559 ++	  }
  83.560 ++	else
  83.561 ++	  {
  83.562 ++	    __from_next = __from_chunk_end;
  83.563 ++	    __to_next += __conv;
  83.564 ++	  }
  83.565 ++
  83.566 ++	if (__from_next < __from_end && __ret == ok)
  83.567 ++	  {
  83.568 ++	    extern_type __buf[MB_LEN_MAX];
  83.569 ++	    __tmp_state = __state;
  83.570 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
  83.571 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
  83.572 ++	      __ret = partial;
  83.573 ++	    else
  83.574 ++	      {
  83.575 ++		memcpy(__to_next, __buf, __conv);
  83.576 ++		__state = __tmp_state;
  83.577 ++		__to_next += __conv;
  83.578 ++		++__from_next;
  83.579 ++	      }
  83.580 ++	  }
  83.581 ++      }
  83.582 ++
  83.583 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.584 ++    __uselocale(__old);
  83.585 ++#endif
  83.586 ++
  83.587 ++    return __ret; 
  83.588 ++  }
  83.589 ++  
  83.590 ++  codecvt_base::result
  83.591 ++  codecvt<wchar_t, char, mbstate_t>::
  83.592 ++  do_in(state_type& __state, const extern_type* __from, 
  83.593 ++	const extern_type* __from_end, const extern_type*& __from_next,
  83.594 ++	intern_type* __to, intern_type* __to_end,
  83.595 ++	intern_type*& __to_next) const
  83.596 ++  {
  83.597 ++    result __ret = ok;
  83.598 ++    state_type __tmp_state(__state);
  83.599 ++
  83.600 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.601 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  83.602 ++#endif
  83.603 ++
  83.604 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
  83.605 ++    // in case we store a L'\0' and then continue, in a loop.
  83.606 ++    // NB: mbsnrtowcs is a GNU extension
  83.607 ++    for (__from_next = __from, __to_next = __to;
  83.608 ++	 __from_next < __from_end && __to_next < __to_end
  83.609 ++	 && __ret == ok;)
  83.610 ++      {
  83.611 ++	const extern_type* __from_chunk_end;
  83.612 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
  83.613 ++								  __from_end
  83.614 ++								  - __from_next));
  83.615 ++	if (!__from_chunk_end)
  83.616 ++	  __from_chunk_end = __from_end;
  83.617 ++
  83.618 ++	__from = __from_next;
  83.619 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
  83.620 ++				   __from_chunk_end - __from_next,
  83.621 ++				   __to_end - __to_next, &__state);
  83.622 ++	if (__conv == static_cast<size_t>(-1))
  83.623 ++	  {
  83.624 ++	    // In case of error, in order to stop at the exact place we
  83.625 ++	    // have to start again from the beginning with a series of
  83.626 ++	    // mbrtowc.
  83.627 ++	    for (;; ++__to_next, __from += __conv)
  83.628 ++	      {
  83.629 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
  83.630 ++				 &__tmp_state);
  83.631 ++		if (__conv == static_cast<size_t>(-1)
  83.632 ++		    || __conv == static_cast<size_t>(-2))
  83.633 ++		  break;
  83.634 ++	      }
  83.635 ++	    __from_next = __from;
  83.636 ++	    __state = __tmp_state;	    
  83.637 ++	    __ret = error;
  83.638 ++	  }
  83.639 ++	else if (__from_next && __from_next < __from_chunk_end)
  83.640 ++	  {
  83.641 ++	    // It is unclear what to return in this case (see DR 382). 
  83.642 ++	    __to_next += __conv;
  83.643 ++	    __ret = partial;
  83.644 ++	  }
  83.645 ++	else
  83.646 ++	  {
  83.647 ++	    __from_next = __from_chunk_end;
  83.648 ++	    __to_next += __conv;
  83.649 ++	  }
  83.650 ++
  83.651 ++	if (__from_next < __from_end && __ret == ok)
  83.652 ++	  {
  83.653 ++	    if (__to_next < __to_end)
  83.654 ++	      {
  83.655 ++		// XXX Probably wrong for stateful encodings
  83.656 ++		__tmp_state = __state;		
  83.657 ++		++__from_next;
  83.658 ++		*__to_next++ = L'\0';
  83.659 ++	      }
  83.660 ++	    else
  83.661 ++	      __ret = partial;
  83.662 ++	  }
  83.663 ++      }
  83.664 ++
  83.665 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.666 ++    __uselocale(__old);
  83.667 ++#endif
  83.668 ++
  83.669 ++    return __ret; 
  83.670 ++  }
  83.671 ++
  83.672 ++  int 
  83.673 ++  codecvt<wchar_t, char, mbstate_t>::
  83.674 ++  do_encoding() const throw()
  83.675 ++  {
  83.676 ++    // XXX This implementation assumes that the encoding is
  83.677 ++    // stateless and is either single-byte or variable-width.
  83.678 ++    int __ret = 0;
  83.679 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.680 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  83.681 ++#endif
  83.682 ++    if (MB_CUR_MAX == 1)
  83.683 ++      __ret = 1;
  83.684 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.685 ++    __uselocale(__old);
  83.686 ++#endif
  83.687 ++    return __ret;
  83.688 ++  }  
  83.689 ++
  83.690 ++  int 
  83.691 ++  codecvt<wchar_t, char, mbstate_t>::
  83.692 ++  do_max_length() const throw()
  83.693 ++  {
  83.694 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.695 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  83.696 ++#endif
  83.697 ++    // XXX Probably wrong for stateful encodings.
  83.698 ++    int __ret = MB_CUR_MAX;
  83.699 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.700 ++    __uselocale(__old);
  83.701 ++#endif
  83.702 ++    return __ret;
  83.703 ++  }
  83.704 ++  
  83.705 ++  int 
  83.706 ++  codecvt<wchar_t, char, mbstate_t>::
  83.707 ++  do_length(state_type& __state, const extern_type* __from,
  83.708 ++	    const extern_type* __end, size_t __max) const
  83.709 ++  {
  83.710 ++    int __ret = 0;
  83.711 ++    state_type __tmp_state(__state);
  83.712 ++
  83.713 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.714 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  83.715 ++#endif
  83.716 ++
  83.717 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
  83.718 ++    // in case we advance past it and then continue, in a loop.
  83.719 ++    // NB: mbsnrtowcs is a GNU extension
  83.720 ++  
  83.721 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
  83.722 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
  83.723 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
  83.724 ++							   * __max));
  83.725 ++    while (__from < __end && __max)
  83.726 ++      {
  83.727 ++	const extern_type* __from_chunk_end;
  83.728 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
  83.729 ++								  __end
  83.730 ++								  - __from));
  83.731 ++	if (!__from_chunk_end)
  83.732 ++	  __from_chunk_end = __end;
  83.733 ++
  83.734 ++	const extern_type* __tmp_from = __from;
  83.735 ++	size_t __conv = mbsnrtowcs(__to, &__from,
  83.736 ++				   __from_chunk_end - __from,
  83.737 ++				   __max, &__state);
  83.738 ++	if (__conv == static_cast<size_t>(-1))
  83.739 ++	  {
  83.740 ++	    // In case of error, in order to stop at the exact place we
  83.741 ++	    // have to start again from the beginning with a series of
  83.742 ++	    // mbrtowc.
  83.743 ++	    for (__from = __tmp_from;; __from += __conv)
  83.744 ++	      {
  83.745 ++		__conv = mbrtowc(NULL, __from, __end - __from,
  83.746 ++				 &__tmp_state);
  83.747 ++		if (__conv == static_cast<size_t>(-1)
  83.748 ++		    || __conv == static_cast<size_t>(-2))
  83.749 ++		  break;
  83.750 ++	      }
  83.751 ++	    __state = __tmp_state;
  83.752 ++	    __ret += __from - __tmp_from;
  83.753 ++	    break;
  83.754 ++	  }
  83.755 ++	if (!__from)
  83.756 ++	  __from = __from_chunk_end;
  83.757 ++	
  83.758 ++	__ret += __from - __tmp_from;
  83.759 ++	__max -= __conv;
  83.760 ++
  83.761 ++	if (__from < __end && __max)
  83.762 ++	  {
  83.763 ++	    // XXX Probably wrong for stateful encodings
  83.764 ++	    __tmp_state = __state;
  83.765 ++	    ++__from;
  83.766 ++	    ++__ret;
  83.767 ++	    --__max;
  83.768 ++	  }
  83.769 ++      }
  83.770 ++
  83.771 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.772 ++    __uselocale(__old);
  83.773 ++#endif
  83.774 ++
  83.775 ++    return __ret; 
  83.776 ++  }
  83.777 ++#endif
  83.778 ++}
  83.779 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/collate_members.cc
  83.780 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
  83.781 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-15 22:51:01.000000000 +0200
  83.782 +@@ -0,0 +1,80 @@
  83.783 ++// std::collate implementation details, GNU version -*- C++ -*-
  83.784 ++
  83.785 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
  83.786 ++//
  83.787 ++// This file is part of the GNU ISO C++ Library.  This library is free
  83.788 ++// software; you can redistribute it and/or modify it under the
  83.789 ++// terms of the GNU General Public License as published by the
  83.790 ++// Free Software Foundation; either version 2, or (at your option)
  83.791 ++// any later version.
  83.792 ++
  83.793 ++// This library is distributed in the hope that it will be useful,
  83.794 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  83.795 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  83.796 ++// GNU General Public License for more details.
  83.797 ++
  83.798 ++// You should have received a copy of the GNU General Public License along
  83.799 ++// with this library; see the file COPYING.  If not, write to the Free
  83.800 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  83.801 ++// USA.
  83.802 ++
  83.803 ++// As a special exception, you may use this file as part of a free software
  83.804 ++// library without restriction.  Specifically, if other files instantiate
  83.805 ++// templates or use macros or inline functions from this file, or you compile
  83.806 ++// this file and link it with other files to produce an executable, this
  83.807 ++// file does not by itself cause the resulting executable to be covered by
  83.808 ++// the GNU General Public License.  This exception does not however
  83.809 ++// invalidate any other reasons why the executable file might be covered by
  83.810 ++// the GNU General Public License.
  83.811 ++
  83.812 ++//
  83.813 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
  83.814 ++//
  83.815 ++
  83.816 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
  83.817 ++
  83.818 ++#include <locale>
  83.819 ++#include <bits/c++locale_internal.h>
  83.820 ++
  83.821 ++#ifndef __UCLIBC_HAS_XLOCALE__
  83.822 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  83.823 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  83.824 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  83.825 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  83.826 ++#endif
  83.827 ++
  83.828 ++namespace std
  83.829 ++{
  83.830 ++  // These are basically extensions to char_traits, and perhaps should
  83.831 ++  // be put there instead of here.
  83.832 ++  template<>
  83.833 ++    int 
  83.834 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
  83.835 ++    { 
  83.836 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
  83.837 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
  83.838 ++    }
  83.839 ++  
  83.840 ++  template<>
  83.841 ++    size_t
  83.842 ++    collate<char>::_M_transform(char* __to, const char* __from, 
  83.843 ++				size_t __n) const 
  83.844 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
  83.845 ++
  83.846 ++#ifdef _GLIBCXX_USE_WCHAR_T
  83.847 ++  template<>
  83.848 ++    int 
  83.849 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
  83.850 ++				 const wchar_t* __two) const
  83.851 ++    {
  83.852 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
  83.853 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
  83.854 ++    }
  83.855 ++  
  83.856 ++  template<>
  83.857 ++    size_t
  83.858 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
  83.859 ++				   size_t __n) const
  83.860 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
  83.861 ++#endif
  83.862 ++}
  83.863 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/ctype_members.cc
  83.864 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
  83.865 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-15 22:51:01.000000000 +0200
  83.866 +@@ -0,0 +1,300 @@
  83.867 ++// std::ctype implementation details, GNU version -*- C++ -*-
  83.868 ++
  83.869 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  83.870 ++//
  83.871 ++// This file is part of the GNU ISO C++ Library.  This library is free
  83.872 ++// software; you can redistribute it and/or modify it under the
  83.873 ++// terms of the GNU General Public License as published by the
  83.874 ++// Free Software Foundation; either version 2, or (at your option)
  83.875 ++// any later version.
  83.876 ++
  83.877 ++// This library is distributed in the hope that it will be useful,
  83.878 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  83.879 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  83.880 ++// GNU General Public License for more details.
  83.881 ++
  83.882 ++// You should have received a copy of the GNU General Public License along
  83.883 ++// with this library; see the file COPYING.  If not, write to the Free
  83.884 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  83.885 ++// USA.
  83.886 ++
  83.887 ++// As a special exception, you may use this file as part of a free software
  83.888 ++// library without restriction.  Specifically, if other files instantiate
  83.889 ++// templates or use macros or inline functions from this file, or you compile
  83.890 ++// this file and link it with other files to produce an executable, this
  83.891 ++// file does not by itself cause the resulting executable to be covered by
  83.892 ++// the GNU General Public License.  This exception does not however
  83.893 ++// invalidate any other reasons why the executable file might be covered by
  83.894 ++// the GNU General Public License.
  83.895 ++
  83.896 ++//
  83.897 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
  83.898 ++//
  83.899 ++
  83.900 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
  83.901 ++
  83.902 ++#define _LIBC
  83.903 ++#include <locale>
  83.904 ++#undef _LIBC
  83.905 ++#include <bits/c++locale_internal.h>
  83.906 ++
  83.907 ++#ifndef __UCLIBC_HAS_XLOCALE__
  83.908 ++#define __wctype_l(S, L)           wctype((S))
  83.909 ++#define __towupper_l(C, L)         towupper((C))
  83.910 ++#define __towlower_l(C, L)         towlower((C))
  83.911 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
  83.912 ++#endif
  83.913 ++
  83.914 ++namespace std
  83.915 ++{
  83.916 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
  83.917 ++  // various /config/os/* files.
  83.918 ++  template<>
  83.919 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
  83.920 ++    : ctype<char>(0, false, __refs) 
  83.921 ++    { 		
  83.922 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
  83.923 ++	{
  83.924 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
  83.925 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
  83.926 ++#ifdef __UCLIBC_HAS_XLOCALE__
  83.927 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
  83.928 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
  83.929 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
  83.930 ++#endif
  83.931 ++	}
  83.932 ++    }
  83.933 ++
  83.934 ++#ifdef _GLIBCXX_USE_WCHAR_T  
  83.935 ++  ctype<wchar_t>::__wmask_type
  83.936 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
  83.937 ++  {
  83.938 ++    __wmask_type __ret;
  83.939 ++    switch (__m)
  83.940 ++      {
  83.941 ++      case space:
  83.942 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
  83.943 ++	break;
  83.944 ++      case print:
  83.945 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
  83.946 ++	break;
  83.947 ++      case cntrl:
  83.948 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
  83.949 ++	break;
  83.950 ++      case upper:
  83.951 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
  83.952 ++	break;
  83.953 ++      case lower:
  83.954 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
  83.955 ++	break;
  83.956 ++      case alpha:
  83.957 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
  83.958 ++	break;
  83.959 ++      case digit:
  83.960 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
  83.961 ++	break;
  83.962 ++      case punct:
  83.963 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
  83.964 ++	break;
  83.965 ++      case xdigit:
  83.966 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
  83.967 ++	break;
  83.968 ++      case alnum:
  83.969 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
  83.970 ++	break;
  83.971 ++      case graph:
  83.972 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
  83.973 ++	break;
  83.974 ++      default:
  83.975 ++	__ret = 0;
  83.976 ++      }
  83.977 ++    return __ret;
  83.978 ++  }
  83.979 ++  
  83.980 ++  wchar_t
  83.981 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
  83.982 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
  83.983 ++
  83.984 ++  const wchar_t*
  83.985 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
  83.986 ++  {
  83.987 ++    while (__lo < __hi)
  83.988 ++      {
  83.989 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
  83.990 ++        ++__lo;
  83.991 ++      }
  83.992 ++    return __hi;
  83.993 ++  }
  83.994 ++  
  83.995 ++  wchar_t
  83.996 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
  83.997 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
  83.998 ++  
  83.999 ++  const wchar_t*
 83.1000 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 83.1001 ++  {
 83.1002 ++    while (__lo < __hi)
 83.1003 ++      {
 83.1004 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 83.1005 ++        ++__lo;
 83.1006 ++      }
 83.1007 ++    return __hi;
 83.1008 ++  }
 83.1009 ++
 83.1010 ++  bool
 83.1011 ++  ctype<wchar_t>::
 83.1012 ++  do_is(mask __m, wchar_t __c) const
 83.1013 ++  { 
 83.1014 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
 83.1015 ++    // library for blank.
 83.1016 ++    bool __ret = false;
 83.1017 ++    const size_t __bitmasksize = 11; 
 83.1018 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 83.1019 ++      if (__m & _M_bit[__bitcur]
 83.1020 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 83.1021 ++	{
 83.1022 ++	  __ret = true;
 83.1023 ++	  break;
 83.1024 ++	}
 83.1025 ++    return __ret;    
 83.1026 ++  }
 83.1027 ++  
 83.1028 ++  const wchar_t* 
 83.1029 ++  ctype<wchar_t>::
 83.1030 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 83.1031 ++  {
 83.1032 ++    for (; __lo < __hi; ++__vec, ++__lo)
 83.1033 ++      {
 83.1034 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 83.1035 ++	// library for blank.
 83.1036 ++	const size_t __bitmasksize = 11; 
 83.1037 ++	mask __m = 0;
 83.1038 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 83.1039 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 83.1040 ++	    __m |= _M_bit[__bitcur];
 83.1041 ++	*__vec = __m;
 83.1042 ++      }
 83.1043 ++    return __hi;
 83.1044 ++  }
 83.1045 ++  
 83.1046 ++  const wchar_t* 
 83.1047 ++  ctype<wchar_t>::
 83.1048 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 83.1049 ++  {
 83.1050 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
 83.1051 ++      ++__lo;
 83.1052 ++    return __lo;
 83.1053 ++  }
 83.1054 ++
 83.1055 ++  const wchar_t*
 83.1056 ++  ctype<wchar_t>::
 83.1057 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
 83.1058 ++  {
 83.1059 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
 83.1060 ++      ++__lo;
 83.1061 ++    return __lo;
 83.1062 ++  }
 83.1063 ++
 83.1064 ++  wchar_t
 83.1065 ++  ctype<wchar_t>::
 83.1066 ++  do_widen(char __c) const
 83.1067 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
 83.1068 ++
 83.1069 ++  const char* 
 83.1070 ++  ctype<wchar_t>::
 83.1071 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
 83.1072 ++  {
 83.1073 ++    while (__lo < __hi)
 83.1074 ++      {
 83.1075 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
 83.1076 ++	++__lo;
 83.1077 ++	++__dest;
 83.1078 ++      }
 83.1079 ++    return __hi;
 83.1080 ++  }
 83.1081 ++
 83.1082 ++  char
 83.1083 ++  ctype<wchar_t>::
 83.1084 ++  do_narrow(wchar_t __wc, char __dfault) const
 83.1085 ++  {
 83.1086 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
 83.1087 ++      return _M_narrow[__wc];
 83.1088 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1089 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
 83.1090 ++#endif
 83.1091 ++    const int __c = wctob(__wc);
 83.1092 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1093 ++    __uselocale(__old);
 83.1094 ++#endif
 83.1095 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
 83.1096 ++  }
 83.1097 ++
 83.1098 ++  const wchar_t*
 83.1099 ++  ctype<wchar_t>::
 83.1100 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
 83.1101 ++	    char* __dest) const
 83.1102 ++  {
 83.1103 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1104 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
 83.1105 ++#endif
 83.1106 ++    if (_M_narrow_ok)
 83.1107 ++      while (__lo < __hi)
 83.1108 ++	{
 83.1109 ++	  if (*__lo >= 0 && *__lo < 128)
 83.1110 ++	    *__dest = _M_narrow[*__lo];
 83.1111 ++	  else
 83.1112 ++	    {
 83.1113 ++	      const int __c = wctob(*__lo);
 83.1114 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
 83.1115 ++	    }
 83.1116 ++	  ++__lo;
 83.1117 ++	  ++__dest;
 83.1118 ++	}
 83.1119 ++    else
 83.1120 ++      while (__lo < __hi)
 83.1121 ++	{
 83.1122 ++	  const int __c = wctob(*__lo);
 83.1123 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
 83.1124 ++	  ++__lo;
 83.1125 ++	  ++__dest;
 83.1126 ++	}
 83.1127 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1128 ++    __uselocale(__old);
 83.1129 ++#endif
 83.1130 ++    return __hi;
 83.1131 ++  }
 83.1132 ++
 83.1133 ++  void
 83.1134 ++  ctype<wchar_t>::_M_initialize_ctype()
 83.1135 ++  {
 83.1136 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1137 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
 83.1138 ++#endif
 83.1139 ++    wint_t __i;
 83.1140 ++    for (__i = 0; __i < 128; ++__i)
 83.1141 ++      {
 83.1142 ++	const int __c = wctob(__i);
 83.1143 ++	if (__c == EOF)
 83.1144 ++	  break;
 83.1145 ++	else
 83.1146 ++	  _M_narrow[__i] = static_cast<char>(__c);
 83.1147 ++      }
 83.1148 ++    if (__i == 128)
 83.1149 ++      _M_narrow_ok = true;
 83.1150 ++    else
 83.1151 ++      _M_narrow_ok = false;
 83.1152 ++    for (size_t __j = 0;
 83.1153 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
 83.1154 ++      _M_widen[__j] = btowc(__j);
 83.1155 ++
 83.1156 ++    for (size_t __k = 0; __k <= 11; ++__k)
 83.1157 ++      { 
 83.1158 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
 83.1159 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
 83.1160 ++      }
 83.1161 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1162 ++    __uselocale(__old);
 83.1163 ++#endif
 83.1164 ++  }
 83.1165 ++#endif //  _GLIBCXX_USE_WCHAR_T
 83.1166 ++}
 83.1167 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/messages_members.cc
 83.1168 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
 83.1169 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-15 22:51:01.000000000 +0200
 83.1170 +@@ -0,0 +1,100 @@
 83.1171 ++// std::messages implementation details, GNU version -*- C++ -*-
 83.1172 ++
 83.1173 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 83.1174 ++//
 83.1175 ++// This file is part of the GNU ISO C++ Library.  This library is free
 83.1176 ++// software; you can redistribute it and/or modify it under the
 83.1177 ++// terms of the GNU General Public License as published by the
 83.1178 ++// Free Software Foundation; either version 2, or (at your option)
 83.1179 ++// any later version.
 83.1180 ++
 83.1181 ++// This library is distributed in the hope that it will be useful,
 83.1182 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 83.1183 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 83.1184 ++// GNU General Public License for more details.
 83.1185 ++
 83.1186 ++// You should have received a copy of the GNU General Public License along
 83.1187 ++// with this library; see the file COPYING.  If not, write to the Free
 83.1188 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 83.1189 ++// USA.
 83.1190 ++
 83.1191 ++// As a special exception, you may use this file as part of a free software
 83.1192 ++// library without restriction.  Specifically, if other files instantiate
 83.1193 ++// templates or use macros or inline functions from this file, or you compile
 83.1194 ++// this file and link it with other files to produce an executable, this
 83.1195 ++// file does not by itself cause the resulting executable to be covered by
 83.1196 ++// the GNU General Public License.  This exception does not however
 83.1197 ++// invalidate any other reasons why the executable file might be covered by
 83.1198 ++// the GNU General Public License.
 83.1199 ++
 83.1200 ++//
 83.1201 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
 83.1202 ++//
 83.1203 ++
 83.1204 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 83.1205 ++
 83.1206 ++#include <locale>
 83.1207 ++#include <bits/c++locale_internal.h>
 83.1208 ++
 83.1209 ++#ifdef __UCLIBC_MJN3_ONLY__
 83.1210 ++#warning fix gettext stuff
 83.1211 ++#endif
 83.1212 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 83.1213 ++extern "C" char *__dcgettext(const char *domainname,
 83.1214 ++			     const char *msgid, int category);
 83.1215 ++#undef gettext
 83.1216 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 83.1217 ++#else
 83.1218 ++#undef gettext
 83.1219 ++#define gettext(msgid) (msgid)
 83.1220 ++#endif
 83.1221 ++
 83.1222 ++namespace std
 83.1223 ++{
 83.1224 ++  // Specializations.
 83.1225 ++  template<>
 83.1226 ++    string
 83.1227 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
 83.1228 ++    {
 83.1229 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1230 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
 83.1231 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
 83.1232 ++      __uselocale(__old);
 83.1233 ++      return string(__msg);
 83.1234 ++#elif defined __UCLIBC_HAS_LOCALE__
 83.1235 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
 83.1236 ++      setlocale(LC_ALL, _M_name_messages);
 83.1237 ++      const char* __msg = gettext(__dfault.c_str());
 83.1238 ++      setlocale(LC_ALL, __old);
 83.1239 ++      free(__old);
 83.1240 ++      return string(__msg);
 83.1241 ++#else
 83.1242 ++      const char* __msg = gettext(__dfault.c_str());
 83.1243 ++      return string(__msg);
 83.1244 ++#endif
 83.1245 ++    }
 83.1246 ++
 83.1247 ++#ifdef _GLIBCXX_USE_WCHAR_T
 83.1248 ++  template<>
 83.1249 ++    wstring
 83.1250 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
 83.1251 ++    {
 83.1252 ++# ifdef __UCLIBC_HAS_XLOCALE__
 83.1253 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
 83.1254 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
 83.1255 ++      __uselocale(__old);
 83.1256 ++      return _M_convert_from_char(__msg);
 83.1257 ++# elif defined __UCLIBC_HAS_LOCALE__
 83.1258 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
 83.1259 ++      setlocale(LC_ALL, _M_name_messages);
 83.1260 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
 83.1261 ++      setlocale(LC_ALL, __old);
 83.1262 ++      free(__old);
 83.1263 ++      return _M_convert_from_char(__msg);
 83.1264 ++# else
 83.1265 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
 83.1266 ++      return _M_convert_from_char(__msg);
 83.1267 ++# endif
 83.1268 ++    }
 83.1269 ++#endif
 83.1270 ++}
 83.1271 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.4.6/libstdc++-v3/config/locale/uclibc/messages_members.h
 83.1272 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
 83.1273 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-15 22:51:01.000000000 +0200
 83.1274 +@@ -0,0 +1,118 @@
 83.1275 ++// std::messages implementation details, GNU version -*- C++ -*-
 83.1276 ++
 83.1277 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 83.1278 ++//
 83.1279 ++// This file is part of the GNU ISO C++ Library.  This library is free
 83.1280 ++// software; you can redistribute it and/or modify it under the
 83.1281 ++// terms of the GNU General Public License as published by the
 83.1282 ++// Free Software Foundation; either version 2, or (at your option)
 83.1283 ++// any later version.
 83.1284 ++
 83.1285 ++// This library is distributed in the hope that it will be useful,
 83.1286 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 83.1287 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 83.1288 ++// GNU General Public License for more details.
 83.1289 ++
 83.1290 ++// You should have received a copy of the GNU General Public License along
 83.1291 ++// with this library; see the file COPYING.  If not, write to the Free
 83.1292 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 83.1293 ++// USA.
 83.1294 ++
 83.1295 ++// As a special exception, you may use this file as part of a free software
 83.1296 ++// library without restriction.  Specifically, if other files instantiate
 83.1297 ++// templates or use macros or inline functions from this file, or you compile
 83.1298 ++// this file and link it with other files to produce an executable, this
 83.1299 ++// file does not by itself cause the resulting executable to be covered by
 83.1300 ++// the GNU General Public License.  This exception does not however
 83.1301 ++// invalidate any other reasons why the executable file might be covered by
 83.1302 ++// the GNU General Public License.
 83.1303 ++
 83.1304 ++//
 83.1305 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
 83.1306 ++//
 83.1307 ++
 83.1308 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 83.1309 ++
 83.1310 ++#ifdef __UCLIBC_MJN3_ONLY__
 83.1311 ++#warning fix prototypes for *textdomain funcs
 83.1312 ++#endif
 83.1313 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 83.1314 ++extern "C" char *__textdomain(const char *domainname);
 83.1315 ++extern "C" char *__bindtextdomain(const char *domainname,
 83.1316 ++				  const char *dirname);
 83.1317 ++#else
 83.1318 ++#undef __textdomain
 83.1319 ++#undef __bindtextdomain
 83.1320 ++#define __textdomain(D)           ((void)0)
 83.1321 ++#define __bindtextdomain(D,P)     ((void)0)
 83.1322 ++#endif
 83.1323 ++
 83.1324 ++  // Non-virtual member functions.
 83.1325 ++  template<typename _CharT>
 83.1326 ++     messages<_CharT>::messages(size_t __refs)
 83.1327 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 83.1328 ++     _M_name_messages(_S_get_c_name())
 83.1329 ++     { }
 83.1330 ++
 83.1331 ++  template<typename _CharT>
 83.1332 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 83.1333 ++				size_t __refs) 
 83.1334 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 83.1335 ++     _M_name_messages(__s)
 83.1336 ++     {
 83.1337 ++       char* __tmp = new char[std::strlen(__s) + 1];
 83.1338 ++       std::strcpy(__tmp, __s);
 83.1339 ++       _M_name_messages = __tmp;
 83.1340 ++     }
 83.1341 ++
 83.1342 ++  template<typename _CharT>
 83.1343 ++    typename messages<_CharT>::catalog 
 83.1344 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 83.1345 ++			   const char* __dir) const
 83.1346 ++    { 
 83.1347 ++      __bindtextdomain(__s.c_str(), __dir);
 83.1348 ++      return this->do_open(__s, __loc); 
 83.1349 ++    }
 83.1350 ++
 83.1351 ++  // Virtual member functions.
 83.1352 ++  template<typename _CharT>
 83.1353 ++    messages<_CharT>::~messages()
 83.1354 ++    { 
 83.1355 ++      if (_M_name_messages != _S_get_c_name())
 83.1356 ++	delete [] _M_name_messages;
 83.1357 ++      _S_destroy_c_locale(_M_c_locale_messages); 
 83.1358 ++    }
 83.1359 ++
 83.1360 ++  template<typename _CharT>
 83.1361 ++    typename messages<_CharT>::catalog 
 83.1362 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
 83.1363 ++			      const locale&) const
 83.1364 ++    { 
 83.1365 ++      // No error checking is done, assume the catalog exists and can
 83.1366 ++      // be used.
 83.1367 ++      __textdomain(__s.c_str());
 83.1368 ++      return 0;
 83.1369 ++    }
 83.1370 ++
 83.1371 ++  template<typename _CharT>
 83.1372 ++    void    
 83.1373 ++    messages<_CharT>::do_close(catalog) const 
 83.1374 ++    { }
 83.1375 ++
 83.1376 ++   // messages_byname
 83.1377 ++   template<typename _CharT>
 83.1378 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
 83.1379 ++     : messages<_CharT>(__refs) 
 83.1380 ++     { 
 83.1381 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
 83.1382 ++	 delete [] this->_M_name_messages;
 83.1383 ++       char* __tmp = new char[std::strlen(__s) + 1];
 83.1384 ++       std::strcpy(__tmp, __s);
 83.1385 ++       this->_M_name_messages = __tmp;
 83.1386 ++
 83.1387 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 83.1388 ++	 {
 83.1389 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
 83.1390 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
 83.1391 ++	 }
 83.1392 ++     }
 83.1393 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 83.1394 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
 83.1395 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-15 22:51:01.000000000 +0200
 83.1396 +@@ -0,0 +1,698 @@
 83.1397 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
 83.1398 ++
 83.1399 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 83.1400 ++//
 83.1401 ++// This file is part of the GNU ISO C++ Library.  This library is free
 83.1402 ++// software; you can redistribute it and/or modify it under the
 83.1403 ++// terms of the GNU General Public License as published by the
 83.1404 ++// Free Software Foundation; either version 2, or (at your option)
 83.1405 ++// any later version.
 83.1406 ++
 83.1407 ++// This library is distributed in the hope that it will be useful,
 83.1408 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 83.1409 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 83.1410 ++// GNU General Public License for more details.
 83.1411 ++
 83.1412 ++// You should have received a copy of the GNU General Public License along
 83.1413 ++// with this library; see the file COPYING.  If not, write to the Free
 83.1414 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 83.1415 ++// USA.
 83.1416 ++
 83.1417 ++// As a special exception, you may use this file as part of a free software
 83.1418 ++// library without restriction.  Specifically, if other files instantiate
 83.1419 ++// templates or use macros or inline functions from this file, or you compile
 83.1420 ++// this file and link it with other files to produce an executable, this
 83.1421 ++// file does not by itself cause the resulting executable to be covered by
 83.1422 ++// the GNU General Public License.  This exception does not however
 83.1423 ++// invalidate any other reasons why the executable file might be covered by
 83.1424 ++// the GNU General Public License.
 83.1425 ++
 83.1426 ++//
 83.1427 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
 83.1428 ++//
 83.1429 ++
 83.1430 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 83.1431 ++
 83.1432 ++#define _LIBC
 83.1433 ++#include <locale>
 83.1434 ++#undef _LIBC
 83.1435 ++#include <bits/c++locale_internal.h>
 83.1436 ++
 83.1437 ++#ifdef __UCLIBC_MJN3_ONLY__
 83.1438 ++#warning optimize this for uclibc
 83.1439 ++#warning tailor for stub locale support
 83.1440 ++#endif
 83.1441 ++
 83.1442 ++#ifndef __UCLIBC_HAS_XLOCALE__
 83.1443 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 83.1444 ++#endif
 83.1445 ++
 83.1446 ++namespace std
 83.1447 ++{
 83.1448 ++  // Construct and return valid pattern consisting of some combination of:
 83.1449 ++  // space none symbol sign value
 83.1450 ++  money_base::pattern
 83.1451 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
 83.1452 ++  { 
 83.1453 ++    pattern __ret;
 83.1454 ++
 83.1455 ++    // This insanely complicated routine attempts to construct a valid
 83.1456 ++    // pattern for use with monyepunct. A couple of invariants:
 83.1457 ++
 83.1458 ++    // if (__precedes) symbol -> value
 83.1459 ++    // else value -> symbol
 83.1460 ++    
 83.1461 ++    // if (__space) space
 83.1462 ++    // else none
 83.1463 ++
 83.1464 ++    // none == never first
 83.1465 ++    // space never first or last
 83.1466 ++
 83.1467 ++    // Any elegant implementations of this are welcome.
 83.1468 ++    switch (__posn)
 83.1469 ++      {
 83.1470 ++      case 0:
 83.1471 ++      case 1:
 83.1472 ++	// 1 The sign precedes the value and symbol.
 83.1473 ++	__ret.field[0] = sign;
 83.1474 ++	if (__space)
 83.1475 ++	  {
 83.1476 ++	    // Pattern starts with sign.
 83.1477 ++	    if (__precedes)
 83.1478 ++	      {
 83.1479 ++		__ret.field[1] = symbol;
 83.1480 ++		__ret.field[3] = value;
 83.1481 ++	      }
 83.1482 ++	    else
 83.1483 ++	      {
 83.1484 ++		__ret.field[1] = value;
 83.1485 ++		__ret.field[3] = symbol;
 83.1486 ++	      }
 83.1487 ++	    __ret.field[2] = space;
 83.1488 ++	  }
 83.1489 ++	else
 83.1490 ++	  {
 83.1491 ++	    // Pattern starts with sign and ends with none.
 83.1492 ++	    if (__precedes)
 83.1493 ++	      {
 83.1494 ++		__ret.field[1] = symbol;
 83.1495 ++		__ret.field[2] = value;
 83.1496 ++	      }
 83.1497 ++	    else
 83.1498 ++	      {
 83.1499 ++		__ret.field[1] = value;
 83.1500 ++		__ret.field[2] = symbol;
 83.1501 ++	      }
 83.1502 ++	    __ret.field[3] = none;
 83.1503 ++	  }
 83.1504 ++	break;
 83.1505 ++      case 2:
 83.1506 ++	// 2 The sign follows the value and symbol.
 83.1507 ++	if (__space)
 83.1508 ++	  {
 83.1509 ++	    // Pattern either ends with sign.
 83.1510 ++	    if (__precedes)
 83.1511 ++	      {
 83.1512 ++		__ret.field[0] = symbol;
 83.1513 ++		__ret.field[2] = value;
 83.1514 ++	      }
 83.1515 ++	    else
 83.1516 ++	      {
 83.1517 ++		__ret.field[0] = value;
 83.1518 ++		__ret.field[2] = symbol;
 83.1519 ++	      }
 83.1520 ++	    __ret.field[1] = space;
 83.1521 ++	    __ret.field[3] = sign;
 83.1522 ++	  }
 83.1523 ++	else
 83.1524 ++	  {
 83.1525 ++	    // Pattern ends with sign then none.
 83.1526 ++	    if (__precedes)
 83.1527 ++	      {
 83.1528 ++		__ret.field[0] = symbol;
 83.1529 ++		__ret.field[1] = value;
 83.1530 ++	      }
 83.1531 ++	    else
 83.1532 ++	      {
 83.1533 ++		__ret.field[0] = value;
 83.1534 ++		__ret.field[1] = symbol;
 83.1535 ++	      }
 83.1536 ++	    __ret.field[2] = sign;
 83.1537 ++	    __ret.field[3] = none;
 83.1538 ++	  }
 83.1539 ++	break;
 83.1540 ++      case 3:
 83.1541 ++	// 3 The sign immediately precedes the symbol.
 83.1542 ++	if (__precedes)
 83.1543 ++	  {
 83.1544 ++	    __ret.field[0] = sign;
 83.1545 ++	    __ret.field[1] = symbol;	    
 83.1546 ++	    if (__space)
 83.1547 ++	      {
 83.1548 ++		__ret.field[2] = space;
 83.1549 ++		__ret.field[3] = value;
 83.1550 ++	      }
 83.1551 ++	    else
 83.1552 ++	      {
 83.1553 ++		__ret.field[2] = value;		
 83.1554 ++		__ret.field[3] = none;
 83.1555 ++	      }
 83.1556 ++	  }
 83.1557 ++	else
 83.1558 ++	  {
 83.1559 ++	    __ret.field[0] = value;
 83.1560 ++	    if (__space)
 83.1561 ++	      {
 83.1562 ++		__ret.field[1] = space;
 83.1563 ++		__ret.field[2] = sign;
 83.1564 ++		__ret.field[3] = symbol;
 83.1565 ++	      }
 83.1566 ++	    else
 83.1567 ++	      {
 83.1568 ++		__ret.field[1] = sign;
 83.1569 ++		__ret.field[2] = symbol;
 83.1570 ++		__ret.field[3] = none;
 83.1571 ++	      }
 83.1572 ++	  }
 83.1573 ++	break;
 83.1574 ++      case 4:
 83.1575 ++	// 4 The sign immediately follows the symbol.
 83.1576 ++	if (__precedes)
 83.1577 ++	  {
 83.1578 ++	    __ret.field[0] = symbol;
 83.1579 ++	    __ret.field[1] = sign;
 83.1580 ++	    if (__space)
 83.1581 ++	      {
 83.1582 ++		__ret.field[2] = space;
 83.1583 ++		__ret.field[3] = value;
 83.1584 ++	      }
 83.1585 ++	    else
 83.1586 ++	      {
 83.1587 ++		__ret.field[2] = value;
 83.1588 ++		__ret.field[3] = none;
 83.1589 ++	      }
 83.1590 ++	  }
 83.1591 ++	else
 83.1592 ++	  {
 83.1593 ++	    __ret.field[0] = value;
 83.1594 ++	    if (__space)
 83.1595 ++	      {
 83.1596 ++		__ret.field[1] = space;
 83.1597 ++		__ret.field[2] = symbol;
 83.1598 ++		__ret.field[3] = sign;
 83.1599 ++	      }
 83.1600 ++	    else
 83.1601 ++	      {
 83.1602 ++		__ret.field[1] = symbol;
 83.1603 ++		__ret.field[2] = sign;
 83.1604 ++		__ret.field[3] = none;
 83.1605 ++	      }
 83.1606 ++	  }
 83.1607 ++	break;
 83.1608 ++      default:
 83.1609 ++	;
 83.1610 ++      }
 83.1611 ++    return __ret;
 83.1612 ++  }
 83.1613 ++
 83.1614 ++  template<> 
 83.1615 ++    void
 83.1616 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
 83.1617 ++						     const char*)
 83.1618 ++    {
 83.1619 ++      if (!_M_data)
 83.1620 ++	_M_data = new __moneypunct_cache<char, true>;
 83.1621 ++
 83.1622 ++      if (!__cloc)
 83.1623 ++	{
 83.1624 ++	  // "C" locale
 83.1625 ++	  _M_data->_M_decimal_point = '.';
 83.1626 ++	  _M_data->_M_thousands_sep = ',';
 83.1627 ++	  _M_data->_M_grouping = "";
 83.1628 ++	  _M_data->_M_grouping_size = 0;
 83.1629 ++	  _M_data->_M_curr_symbol = "";
 83.1630 ++	  _M_data->_M_curr_symbol_size = 0;
 83.1631 ++	  _M_data->_M_positive_sign = "";
 83.1632 ++	  _M_data->_M_positive_sign_size = 0;
 83.1633 ++	  _M_data->_M_negative_sign = "";
 83.1634 ++	  _M_data->_M_negative_sign_size = 0;
 83.1635 ++	  _M_data->_M_frac_digits = 0;
 83.1636 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 83.1637 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 83.1638 ++
 83.1639 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 83.1640 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
 83.1641 ++	}
 83.1642 ++      else
 83.1643 ++	{
 83.1644 ++	  // Named locale.
 83.1645 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
 83.1646 ++							__cloc));
 83.1647 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
 83.1648 ++							__cloc));
 83.1649 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 83.1650 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 83.1651 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 83.1652 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
 83.1653 ++
 83.1654 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
 83.1655 ++	  if (!__nposn)
 83.1656 ++	    _M_data->_M_negative_sign = "()";
 83.1657 ++	  else
 83.1658 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
 83.1659 ++							__cloc);
 83.1660 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
 83.1661 ++
 83.1662 ++	  // _Intl == true
 83.1663 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
 83.1664 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
 83.1665 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
 83.1666 ++						      __cloc));
 83.1667 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
 83.1668 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
 83.1669 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
 83.1670 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 83.1671 ++							__pposn);
 83.1672 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
 83.1673 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
 83.1674 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 83.1675 ++							__nposn);
 83.1676 ++	}
 83.1677 ++    }
 83.1678 ++
 83.1679 ++  template<> 
 83.1680 ++    void
 83.1681 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
 83.1682 ++						      const char*)
 83.1683 ++    {
 83.1684 ++      if (!_M_data)
 83.1685 ++	_M_data = new __moneypunct_cache<char, false>;
 83.1686 ++
 83.1687 ++      if (!__cloc)
 83.1688 ++	{
 83.1689 ++	  // "C" locale
 83.1690 ++	  _M_data->_M_decimal_point = '.';
 83.1691 ++	  _M_data->_M_thousands_sep = ',';
 83.1692 ++	  _M_data->_M_grouping = "";
 83.1693 ++	  _M_data->_M_grouping_size = 0;
 83.1694 ++	  _M_data->_M_curr_symbol = "";
 83.1695 ++	  _M_data->_M_curr_symbol_size = 0;
 83.1696 ++	  _M_data->_M_positive_sign = "";
 83.1697 ++	  _M_data->_M_positive_sign_size = 0;
 83.1698 ++	  _M_data->_M_negative_sign = "";
 83.1699 ++	  _M_data->_M_negative_sign_size = 0;
 83.1700 ++	  _M_data->_M_frac_digits = 0;
 83.1701 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 83.1702 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 83.1703 ++
 83.1704 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 83.1705 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
 83.1706 ++	}
 83.1707 ++      else
 83.1708 ++	{
 83.1709 ++	  // Named locale.
 83.1710 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
 83.1711 ++							__cloc));
 83.1712 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
 83.1713 ++							__cloc));
 83.1714 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 83.1715 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 83.1716 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 83.1717 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
 83.1718 ++
 83.1719 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
 83.1720 ++	  if (!__nposn)
 83.1721 ++	    _M_data->_M_negative_sign = "()";
 83.1722 ++	  else
 83.1723 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
 83.1724 ++							__cloc);
 83.1725 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
 83.1726 ++
 83.1727 ++	  // _Intl == false
 83.1728 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
 83.1729 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
 83.1730 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
 83.1731 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
 83.1732 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
 83.1733 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
 83.1734 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 83.1735 ++							__pposn);
 83.1736 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
 83.1737 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
 83.1738 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 83.1739 ++							__nposn);
 83.1740 ++	}
 83.1741 ++    }
 83.1742 ++
 83.1743 ++  template<> 
 83.1744 ++    moneypunct<char, true>::~moneypunct()
 83.1745 ++    { delete _M_data; }
 83.1746 ++
 83.1747 ++  template<> 
 83.1748 ++    moneypunct<char, false>::~moneypunct()
 83.1749 ++    { delete _M_data; }
 83.1750 ++
 83.1751 ++#ifdef _GLIBCXX_USE_WCHAR_T
 83.1752 ++  template<> 
 83.1753 ++    void
 83.1754 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
 83.1755 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1756 ++							const char*)
 83.1757 ++#else
 83.1758 ++							const char* __name)
 83.1759 ++#endif
 83.1760 ++    {
 83.1761 ++      if (!_M_data)
 83.1762 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
 83.1763 ++
 83.1764 ++      if (!__cloc)
 83.1765 ++	{
 83.1766 ++	  // "C" locale
 83.1767 ++	  _M_data->_M_decimal_point = L'.';
 83.1768 ++	  _M_data->_M_thousands_sep = L',';
 83.1769 ++	  _M_data->_M_grouping = "";
 83.1770 ++	  _M_data->_M_grouping_size = 0;
 83.1771 ++	  _M_data->_M_curr_symbol = L"";
 83.1772 ++	  _M_data->_M_curr_symbol_size = 0;
 83.1773 ++	  _M_data->_M_positive_sign = L"";
 83.1774 ++	  _M_data->_M_positive_sign_size = 0;
 83.1775 ++	  _M_data->_M_negative_sign = L"";
 83.1776 ++	  _M_data->_M_negative_sign_size = 0;
 83.1777 ++	  _M_data->_M_frac_digits = 0;
 83.1778 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 83.1779 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 83.1780 ++
 83.1781 ++	  // Use ctype::widen code without the facet...
 83.1782 ++	  unsigned char uc;
 83.1783 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 83.1784 ++	    {
 83.1785 ++	      uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
 83.1786 ++	      _M_data->_M_atoms[__i] = btowc(uc);
 83.1787 ++	    }
 83.1788 ++	}
 83.1789 ++      else
 83.1790 ++	{
 83.1791 ++	  // Named locale.
 83.1792 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1793 ++	  __c_locale __old = __uselocale(__cloc);
 83.1794 ++#else
 83.1795 ++	  // Switch to named locale so that mbsrtowcs will work.
 83.1796 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
 83.1797 ++	  setlocale(LC_ALL, __name);
 83.1798 ++#endif
 83.1799 ++
 83.1800 ++#ifdef __UCLIBC_MJN3_ONLY__
 83.1801 ++#warning fix this... should be monetary
 83.1802 ++#endif
 83.1803 ++#ifdef __UCLIBC__
 83.1804 ++# ifdef __UCLIBC_HAS_XLOCALE__
 83.1805 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
 83.1806 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
 83.1807 ++# else
 83.1808 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
 83.1809 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
 83.1810 ++# endif
 83.1811 ++#else
 83.1812 ++	  union __s_and_w { const char *__s; unsigned int __w; } __u;
 83.1813 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
 83.1814 ++	  _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
 83.1815 ++
 83.1816 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
 83.1817 ++	  _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
 83.1818 ++#endif
 83.1819 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 83.1820 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 83.1821 ++
 83.1822 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 83.1823 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
 83.1824 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
 83.1825 ++
 83.1826 ++	  wchar_t* __wcs_ps = 0;
 83.1827 ++	  wchar_t* __wcs_ns = 0;
 83.1828 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
 83.1829 ++	  try
 83.1830 ++	    {
 83.1831 ++	      mbstate_t __state;
 83.1832 ++	      size_t __len = strlen(__cpossign);
 83.1833 ++	      if (__len)
 83.1834 ++		{
 83.1835 ++		  ++__len;
 83.1836 ++		  memset(&__state, 0, sizeof(mbstate_t));
 83.1837 ++		  __wcs_ps = new wchar_t[__len];
 83.1838 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
 83.1839 ++		  _M_data->_M_positive_sign = __wcs_ps;
 83.1840 ++		}
 83.1841 ++	      else
 83.1842 ++		_M_data->_M_positive_sign = L"";
 83.1843 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
 83.1844 ++	      
 83.1845 ++	      __len = strlen(__cnegsign);
 83.1846 ++	      if (!__nposn)
 83.1847 ++		_M_data->_M_negative_sign = L"()";
 83.1848 ++	      else if (__len)
 83.1849 ++		{ 
 83.1850 ++		  ++__len;
 83.1851 ++		  memset(&__state, 0, sizeof(mbstate_t));
 83.1852 ++		  __wcs_ns = new wchar_t[__len];
 83.1853 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
 83.1854 ++		  _M_data->_M_negative_sign = __wcs_ns;
 83.1855 ++		}
 83.1856 ++	      else
 83.1857 ++		_M_data->_M_negative_sign = L"";
 83.1858 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
 83.1859 ++	      
 83.1860 ++	      // _Intl == true.
 83.1861 ++	      __len = strlen(__ccurr);
 83.1862 ++	      if (__len)
 83.1863 ++		{
 83.1864 ++		  ++__len;
 83.1865 ++		  memset(&__state, 0, sizeof(mbstate_t));
 83.1866 ++		  wchar_t* __wcs = new wchar_t[__len];
 83.1867 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
 83.1868 ++		  _M_data->_M_curr_symbol = __wcs;
 83.1869 ++		}
 83.1870 ++	      else
 83.1871 ++		_M_data->_M_curr_symbol = L"";
 83.1872 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
 83.1873 ++	    }
 83.1874 ++	  catch (...)
 83.1875 ++	    {
 83.1876 ++	      delete _M_data;
 83.1877 ++	      _M_data = 0;
 83.1878 ++	      delete __wcs_ps;
 83.1879 ++	      delete __wcs_ns;	      
 83.1880 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1881 ++	      __uselocale(__old);
 83.1882 ++#else
 83.1883 ++	      setlocale(LC_ALL, __old);
 83.1884 ++	      free(__old);
 83.1885 ++#endif
 83.1886 ++	      __throw_exception_again;
 83.1887 ++	    } 
 83.1888 ++	  
 83.1889 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
 83.1890 ++						      __cloc));
 83.1891 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
 83.1892 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
 83.1893 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
 83.1894 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 83.1895 ++							__pposn);
 83.1896 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
 83.1897 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
 83.1898 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 83.1899 ++							__nposn);
 83.1900 ++
 83.1901 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1902 ++	  __uselocale(__old);
 83.1903 ++#else
 83.1904 ++	  setlocale(LC_ALL, __old);
 83.1905 ++	  free(__old);
 83.1906 ++#endif
 83.1907 ++	}
 83.1908 ++    }
 83.1909 ++
 83.1910 ++  template<> 
 83.1911 ++  void
 83.1912 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
 83.1913 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1914 ++						       const char*)
 83.1915 ++#else
 83.1916 ++                                                       const char* __name)
 83.1917 ++#endif
 83.1918 ++  {
 83.1919 ++    if (!_M_data)
 83.1920 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
 83.1921 ++
 83.1922 ++    if (!__cloc)
 83.1923 ++	{
 83.1924 ++	  // "C" locale
 83.1925 ++	  _M_data->_M_decimal_point = L'.';
 83.1926 ++	  _M_data->_M_thousands_sep = L',';
 83.1927 ++	  _M_data->_M_grouping = "";
 83.1928 ++          _M_data->_M_grouping_size = 0;
 83.1929 ++	  _M_data->_M_curr_symbol = L"";
 83.1930 ++	  _M_data->_M_curr_symbol_size = 0;
 83.1931 ++	  _M_data->_M_positive_sign = L"";
 83.1932 ++	  _M_data->_M_positive_sign_size = 0;
 83.1933 ++	  _M_data->_M_negative_sign = L"";
 83.1934 ++	  _M_data->_M_negative_sign_size = 0;
 83.1935 ++	  _M_data->_M_frac_digits = 0;
 83.1936 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 83.1937 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 83.1938 ++
 83.1939 ++	  // Use ctype::widen code without the facet...
 83.1940 ++	  unsigned char uc;
 83.1941 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 83.1942 ++	    {
 83.1943 ++	      uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
 83.1944 ++	      _M_data->_M_atoms[__i] = btowc(uc);
 83.1945 ++	    }
 83.1946 ++	}
 83.1947 ++      else
 83.1948 ++	{
 83.1949 ++	  // Named locale.
 83.1950 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.1951 ++	  __c_locale __old = __uselocale(__cloc);
 83.1952 ++#else
 83.1953 ++	  // Switch to named locale so that mbsrtowcs will work.
 83.1954 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
 83.1955 ++	  setlocale(LC_ALL, __name);
 83.1956 ++#endif
 83.1957 ++
 83.1958 ++#ifdef __UCLIBC_MJN3_ONLY__
 83.1959 ++#warning fix this... should be monetary
 83.1960 ++#endif
 83.1961 ++#ifdef __UCLIBC__
 83.1962 ++# ifdef __UCLIBC_HAS_XLOCALE__
 83.1963 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
 83.1964 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
 83.1965 ++# else
 83.1966 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
 83.1967 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
 83.1968 ++# endif
 83.1969 ++#else
 83.1970 ++	  union __s_and_w { const char *__s; unsigned int __w; } __u;
 83.1971 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
 83.1972 ++	  _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
 83.1973 ++
 83.1974 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
 83.1975 ++	  _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
 83.1976 ++#endif
 83.1977 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 83.1978 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 83.1979 ++
 83.1980 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 83.1981 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
 83.1982 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
 83.1983 ++
 83.1984 ++	  wchar_t* __wcs_ps = 0;
 83.1985 ++	  wchar_t* __wcs_ns = 0;
 83.1986 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
 83.1987 ++	  try
 83.1988 ++            {
 83.1989 ++              mbstate_t __state;
 83.1990 ++              size_t __len;
 83.1991 ++              __len = strlen(__cpossign);
 83.1992 ++              if (__len)
 83.1993 ++                {
 83.1994 ++		  ++__len;
 83.1995 ++		  memset(&__state, 0, sizeof(mbstate_t));
 83.1996 ++		  __wcs_ps = new wchar_t[__len];
 83.1997 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
 83.1998 ++		  _M_data->_M_positive_sign = __wcs_ps;
 83.1999 ++		}
 83.2000 ++	      else
 83.2001 ++		_M_data->_M_positive_sign = L"";
 83.2002 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
 83.2003 ++	      
 83.2004 ++	      __len = strlen(__cnegsign);
 83.2005 ++	      if (!__nposn)
 83.2006 ++		_M_data->_M_negative_sign = L"()";
 83.2007 ++	      else if (__len)
 83.2008 ++		{ 
 83.2009 ++		  ++__len;
 83.2010 ++		  memset(&__state, 0, sizeof(mbstate_t));
 83.2011 ++		  __wcs_ns = new wchar_t[__len];
 83.2012 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
 83.2013 ++		  _M_data->_M_negative_sign = __wcs_ns;
 83.2014 ++		}
 83.2015 ++	      else
 83.2016 ++		_M_data->_M_negative_sign = L"";
 83.2017 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
 83.2018 ++
 83.2019 ++	      // _Intl == true.
 83.2020 ++	      __len = strlen(__ccurr);
 83.2021 ++	      if (__len)
 83.2022 ++		{
 83.2023 ++		  ++__len;
 83.2024 ++		  memset(&__state, 0, sizeof(mbstate_t));
 83.2025 ++		  wchar_t* __wcs = new wchar_t[__len];
 83.2026 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
 83.2027 ++		  _M_data->_M_curr_symbol = __wcs;
 83.2028 ++		}
 83.2029 ++	      else
 83.2030 ++		_M_data->_M_curr_symbol = L"";
 83.2031 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
 83.2032 ++	    }
 83.2033 ++          catch (...)
 83.2034 ++	    {
 83.2035 ++	      delete _M_data;
 83.2036 ++              _M_data = 0;
 83.2037 ++	      delete __wcs_ps;
 83.2038 ++	      delete __wcs_ns;	      
 83.2039 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.2040 ++	      __uselocale(__old);
 83.2041 ++#else
 83.2042 ++	      setlocale(LC_ALL, __old);
 83.2043 ++	      free(__old);
 83.2044 ++#endif
 83.2045 ++              __throw_exception_again;
 83.2046 ++	    }
 83.2047 ++
 83.2048 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
 83.2049 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
 83.2050 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
 83.2051 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
 83.2052 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 83.2053 ++	                                                __pposn);
 83.2054 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
 83.2055 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
 83.2056 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 83.2057 ++	                                                __nposn);
 83.2058 ++
 83.2059 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.2060 ++	  __uselocale(__old);
 83.2061 ++#else
 83.2062 ++	  setlocale(LC_ALL, __old);
 83.2063 ++	  free(__old);
 83.2064 ++#endif
 83.2065 ++	}
 83.2066 ++    }
 83.2067 ++
 83.2068 ++  template<> 
 83.2069 ++    moneypunct<wchar_t, true>::~moneypunct()
 83.2070 ++    {
 83.2071 ++      if (_M_data->_M_positive_sign_size)
 83.2072 ++	delete [] _M_data->_M_positive_sign;
 83.2073 ++      if (_M_data->_M_negative_sign_size
 83.2074 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
 83.2075 ++	delete [] _M_data->_M_negative_sign;
 83.2076 ++      if (_M_data->_M_curr_symbol_size)
 83.2077 ++	delete [] _M_data->_M_curr_symbol;
 83.2078 ++      delete _M_data;
 83.2079 ++    }
 83.2080 ++
 83.2081 ++  template<> 
 83.2082 ++    moneypunct<wchar_t, false>::~moneypunct()
 83.2083 ++    {
 83.2084 ++      if (_M_data->_M_positive_sign_size)
 83.2085 ++	delete [] _M_data->_M_positive_sign;
 83.2086 ++      if (_M_data->_M_negative_sign_size
 83.2087 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
 83.2088 ++	delete [] _M_data->_M_negative_sign;
 83.2089 ++      if (_M_data->_M_curr_symbol_size)
 83.2090 ++	delete [] _M_data->_M_curr_symbol;
 83.2091 ++      delete _M_data;
 83.2092 ++    }
 83.2093 ++#endif
 83.2094 ++}
 83.2095 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 83.2096 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
 83.2097 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-15 22:51:01.000000000 +0200
 83.2098 +@@ -0,0 +1,183 @@
 83.2099 ++// std::numpunct implementation details, GNU version -*- C++ -*-
 83.2100 ++
 83.2101 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 83.2102 ++//
 83.2103 ++// This file is part of the GNU ISO C++ Library.  This library is free
 83.2104 ++// software; you can redistribute it and/or modify it under the
 83.2105 ++// terms of the GNU General Public License as published by the
 83.2106 ++// Free Software Foundation; either version 2, or (at your option)
 83.2107 ++// any later version.
 83.2108 ++
 83.2109 ++// This library is distributed in the hope that it will be useful,
 83.2110 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 83.2111 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 83.2112 ++// GNU General Public License for more details.
 83.2113 ++
 83.2114 ++// You should have received a copy of the GNU General Public License along
 83.2115 ++// with this library; see the file COPYING.  If not, write to the Free
 83.2116 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 83.2117 ++// USA.
 83.2118 ++
 83.2119 ++// As a special exception, you may use this file as part of a free software
 83.2120 ++// library without restriction.  Specifically, if other files instantiate
 83.2121 ++// templates or use macros or inline functions from this file, or you compile
 83.2122 ++// this file and link it with other files to produce an executable, this
 83.2123 ++// file does not by itself cause the resulting executable to be covered by
 83.2124 ++// the GNU General Public License.  This exception does not however
 83.2125 ++// invalidate any other reasons why the executable file might be covered by
 83.2126 ++// the GNU General Public License.
 83.2127 ++
 83.2128 ++//
 83.2129 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
 83.2130 ++//
 83.2131 ++
 83.2132 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 83.2133 ++
 83.2134 ++#define _LIBC
 83.2135 ++#include <locale>
 83.2136 ++#undef _LIBC
 83.2137 ++#include <bits/c++locale_internal.h>
 83.2138 ++
 83.2139 ++#ifdef __UCLIBC_MJN3_ONLY__
 83.2140 ++#warning tailor for stub locale support
 83.2141 ++#endif
 83.2142 ++#ifndef __UCLIBC_HAS_XLOCALE__
 83.2143 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 83.2144 ++#endif
 83.2145 ++
 83.2146 ++namespace std
 83.2147 ++{
 83.2148 ++  template<> 
 83.2149 ++    void
 83.2150 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
 83.2151 ++    {
 83.2152 ++      if (!_M_data)
 83.2153 ++	_M_data = new __numpunct_cache<char>;
 83.2154 ++
 83.2155 ++      if (!__cloc)
 83.2156 ++	{
 83.2157 ++	  // "C" locale
 83.2158 ++	  _M_data->_M_grouping = "";
 83.2159 ++	  _M_data->_M_grouping_size = 0;
 83.2160 ++	  _M_data->_M_use_grouping = false;
 83.2161 ++
 83.2162 ++	  _M_data->_M_decimal_point = '.';
 83.2163 ++	  _M_data->_M_thousands_sep = ',';
 83.2164 ++
 83.2165 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
 83.2166 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
 83.2167 ++
 83.2168 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
 83.2169 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
 83.2170 ++	}
 83.2171 ++      else
 83.2172 ++	{
 83.2173 ++	  // Named locale.
 83.2174 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
 83.2175 ++							__cloc));
 83.2176 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
 83.2177 ++							__cloc));
 83.2178 ++
 83.2179 ++	  // Check for NULL, which implies no grouping.
 83.2180 ++	  if (_M_data->_M_thousands_sep == '\0')
 83.2181 ++	    _M_data->_M_grouping = "";
 83.2182 ++	  else
 83.2183 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
 83.2184 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 83.2185 ++	}
 83.2186 ++
 83.2187 ++      // NB: There is no way to extact this info from posix locales.
 83.2188 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
 83.2189 ++      _M_data->_M_truename = "true";
 83.2190 ++      _M_data->_M_truename_size = strlen(_M_data->_M_truename);
 83.2191 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
 83.2192 ++      _M_data->_M_falsename = "false";
 83.2193 ++      _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
 83.2194 ++    }
 83.2195 ++ 
 83.2196 ++  template<> 
 83.2197 ++    numpunct<char>::~numpunct()
 83.2198 ++    { delete _M_data; }
 83.2199 ++   
 83.2200 ++#ifdef _GLIBCXX_USE_WCHAR_T
 83.2201 ++  template<> 
 83.2202 ++    void
 83.2203 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
 83.2204 ++    {
 83.2205 ++      if (!_M_data)
 83.2206 ++	_M_data = new __numpunct_cache<wchar_t>;
 83.2207 ++
 83.2208 ++      if (!__cloc)
 83.2209 ++	{
 83.2210 ++	  // "C" locale
 83.2211 ++	  _M_data->_M_grouping = "";
 83.2212 ++	  _M_data->_M_grouping_size = 0;
 83.2213 ++	  _M_data->_M_use_grouping = false;
 83.2214 ++
 83.2215 ++	  _M_data->_M_decimal_point = L'.';
 83.2216 ++	  _M_data->_M_thousands_sep = L',';
 83.2217 ++
 83.2218 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.2219 ++	  __c_locale __old = __uselocale(_S_get_c_locale());
 83.2220 ++#endif
 83.2221 ++	  // Use ctype::widen code without the facet...
 83.2222 ++	  unsigned char uc;
 83.2223 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
 83.2224 ++	    {
 83.2225 ++	      uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
 83.2226 ++	      _M_data->_M_atoms_out[__i] = btowc(uc);
 83.2227 ++	    }
 83.2228 ++
 83.2229 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
 83.2230 ++	    {
 83.2231 ++	      uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__j]);
 83.2232 ++	      _M_data->_M_atoms_in[__j] = btowc(uc);
 83.2233 ++	    }
 83.2234 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.2235 ++	  __uselocale(__old);
 83.2236 ++#endif
 83.2237 ++	}
 83.2238 ++      else
 83.2239 ++	{
 83.2240 ++	  // Named locale.
 83.2241 ++#ifdef __UCLIBC_MJN3_ONLY__
 83.2242 ++#warning fix this
 83.2243 ++#endif
 83.2244 ++#ifdef __UCLIBC__
 83.2245 ++# ifdef __UCLIBC_HAS_XLOCALE__
 83.2246 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
 83.2247 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
 83.2248 ++# else
 83.2249 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
 83.2250 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
 83.2251 ++# endif
 83.2252 ++#else
 83.2253 ++	  union __s_and_w { const char *__s; unsigned int __w; } __u;
 83.2254 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
 83.2255 ++	  _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
 83.2256 ++
 83.2257 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
 83.2258 ++	  _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
 83.2259 ++#endif
 83.2260 ++
 83.2261 ++	  if (_M_data->_M_thousands_sep == L'\0')
 83.2262 ++	    _M_data->_M_grouping = "";
 83.2263 ++	  else
 83.2264 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
 83.2265 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 83.2266 ++	}
 83.2267 ++
 83.2268 ++      // NB: There is no way to extact this info from posix locales.
 83.2269 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
 83.2270 ++      _M_data->_M_truename = L"true";
 83.2271 ++      _M_data->_M_truename_size = wcslen(_M_data->_M_truename);
 83.2272 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
 83.2273 ++      _M_data->_M_falsename = L"false";
 83.2274 ++      _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
 83.2275 ++    }
 83.2276 ++
 83.2277 ++  template<> 
 83.2278 ++    numpunct<wchar_t>::~numpunct()
 83.2279 ++    { delete _M_data; }
 83.2280 ++ #endif
 83.2281 ++}
 83.2282 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/time_members.cc
 83.2283 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
 83.2284 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-15 22:51:01.000000000 +0200
 83.2285 +@@ -0,0 +1,356 @@
 83.2286 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
 83.2287 ++
 83.2288 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 83.2289 ++//
 83.2290 ++// This file is part of the GNU ISO C++ Library.  This library is free
 83.2291 ++// software; you can redistribute it and/or modify it under the
 83.2292 ++// terms of the GNU General Public License as published by the
 83.2293 ++// Free Software Foundation; either version 2, or (at your option)
 83.2294 ++// any later version.
 83.2295 ++
 83.2296 ++// This library is distributed in the hope that it will be useful,
 83.2297 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 83.2298 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 83.2299 ++// GNU General Public License for more details.
 83.2300 ++
 83.2301 ++// You should have received a copy of the GNU General Public License along
 83.2302 ++// with this library; see the file COPYING.  If not, write to the Free
 83.2303 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 83.2304 ++// USA.
 83.2305 ++
 83.2306 ++// As a special exception, you may use this file as part of a free software
 83.2307 ++// library without restriction.  Specifically, if other files instantiate
 83.2308 ++// templates or use macros or inline functions from this file, or you compile
 83.2309 ++// this file and link it with other files to produce an executable, this
 83.2310 ++// file does not by itself cause the resulting executable to be covered by
 83.2311 ++// the GNU General Public License.  This exception does not however
 83.2312 ++// invalidate any other reasons why the executable file might be covered by
 83.2313 ++// the GNU General Public License.
 83.2314 ++
 83.2315 ++//
 83.2316 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
 83.2317 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
 83.2318 ++//
 83.2319 ++
 83.2320 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 83.2321 ++
 83.2322 ++#include <locale>
 83.2323 ++#include <bits/c++locale_internal.h>
 83.2324 ++
 83.2325 ++#ifdef __UCLIBC_MJN3_ONLY__
 83.2326 ++#warning tailor for stub locale support
 83.2327 ++#endif
 83.2328 ++#ifndef __UCLIBC_HAS_XLOCALE__
 83.2329 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 83.2330 ++#endif
 83.2331 ++
 83.2332 ++namespace std
 83.2333 ++{
 83.2334 ++  template<>
 83.2335 ++    void
 83.2336 ++    __timepunct<char>::
 83.2337 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
 83.2338 ++	   const tm* __tm) const
 83.2339 ++    {
 83.2340 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.2341 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
 83.2342 ++					_M_c_locale_timepunct);
 83.2343 ++#else
 83.2344 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
 83.2345 ++      setlocale(LC_ALL, _M_name_timepunct);
 83.2346 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
 83.2347 ++      setlocale(LC_ALL, __old);
 83.2348 ++      free(__old);
 83.2349 ++#endif
 83.2350 ++      // Make sure __s is null terminated.
 83.2351 ++      if (__len == 0)
 83.2352 ++	__s[0] = '\0';
 83.2353 ++    }
 83.2354 ++
 83.2355 ++  template<> 
 83.2356 ++    void
 83.2357 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
 83.2358 ++    {
 83.2359 ++      if (!_M_data)
 83.2360 ++	_M_data = new __timepunct_cache<char>;
 83.2361 ++
 83.2362 ++      if (!__cloc)
 83.2363 ++	{
 83.2364 ++	  // "C" locale
 83.2365 ++	  _M_c_locale_timepunct = _S_get_c_locale();
 83.2366 ++
 83.2367 ++	  _M_data->_M_date_format = "%m/%d/%y";
 83.2368 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
 83.2369 ++	  _M_data->_M_time_format = "%H:%M:%S";
 83.2370 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
 83.2371 ++	  _M_data->_M_date_time_format = "";
 83.2372 ++	  _M_data->_M_date_time_era_format = "";
 83.2373 ++	  _M_data->_M_am = "AM";
 83.2374 ++	  _M_data->_M_pm = "PM";
 83.2375 ++	  _M_data->_M_am_pm_format = "";
 83.2376 ++
 83.2377 ++	  // Day names, starting with "C"'s Sunday.
 83.2378 ++	  _M_data->_M_day1 = "Sunday";
 83.2379 ++	  _M_data->_M_day2 = "Monday";
 83.2380 ++	  _M_data->_M_day3 = "Tuesday";
 83.2381 ++	  _M_data->_M_day4 = "Wednesday";
 83.2382 ++	  _M_data->_M_day5 = "Thursday";
 83.2383 ++	  _M_data->_M_day6 = "Friday";
 83.2384 ++	  _M_data->_M_day7 = "Saturday";
 83.2385 ++
 83.2386 ++	  // Abbreviated day names, starting with "C"'s Sun.
 83.2387 ++	  _M_data->_M_aday1 = "Sun";
 83.2388 ++	  _M_data->_M_aday2 = "Mon";
 83.2389 ++	  _M_data->_M_aday3 = "Tue";
 83.2390 ++	  _M_data->_M_aday4 = "Wed";
 83.2391 ++	  _M_data->_M_aday5 = "Thu";
 83.2392 ++	  _M_data->_M_aday6 = "Fri";
 83.2393 ++	  _M_data->_M_aday7 = "Sat";
 83.2394 ++
 83.2395 ++	  // Month names, starting with "C"'s January.
 83.2396 ++	  _M_data->_M_month01 = "January";
 83.2397 ++	  _M_data->_M_month02 = "February";
 83.2398 ++	  _M_data->_M_month03 = "March";
 83.2399 ++	  _M_data->_M_month04 = "April";
 83.2400 ++	  _M_data->_M_month05 = "May";
 83.2401 ++	  _M_data->_M_month06 = "June";
 83.2402 ++	  _M_data->_M_month07 = "July";
 83.2403 ++	  _M_data->_M_month08 = "August";
 83.2404 ++	  _M_data->_M_month09 = "September";
 83.2405 ++	  _M_data->_M_month10 = "October";
 83.2406 ++	  _M_data->_M_month11 = "November";
 83.2407 ++	  _M_data->_M_month12 = "December";
 83.2408 ++
 83.2409 ++	  // Abbreviated month names, starting with "C"'s Jan.
 83.2410 ++	  _M_data->_M_amonth01 = "Jan";
 83.2411 ++	  _M_data->_M_amonth02 = "Feb";
 83.2412 ++	  _M_data->_M_amonth03 = "Mar";
 83.2413 ++	  _M_data->_M_amonth04 = "Apr";
 83.2414 ++	  _M_data->_M_amonth05 = "May";
 83.2415 ++	  _M_data->_M_amonth06 = "Jun";
 83.2416 ++	  _M_data->_M_amonth07 = "Jul";
 83.2417 ++	  _M_data->_M_amonth08 = "Aug";
 83.2418 ++	  _M_data->_M_amonth09 = "Sep";
 83.2419 ++	  _M_data->_M_amonth10 = "Oct";
 83.2420 ++	  _M_data->_M_amonth11 = "Nov";
 83.2421 ++	  _M_data->_M_amonth12 = "Dec";
 83.2422 ++	}
 83.2423 ++      else
 83.2424 ++	{
 83.2425 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
 83.2426 ++
 83.2427 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
 83.2428 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
 83.2429 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
 83.2430 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
 83.2431 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
 83.2432 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
 83.2433 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
 83.2434 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
 83.2435 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
 83.2436 ++
 83.2437 ++	  // Day names, starting with "C"'s Sunday.
 83.2438 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
 83.2439 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
 83.2440 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
 83.2441 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
 83.2442 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
 83.2443 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
 83.2444 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
 83.2445 ++
 83.2446 ++	  // Abbreviated day names, starting with "C"'s Sun.
 83.2447 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
 83.2448 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
 83.2449 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
 83.2450 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
 83.2451 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
 83.2452 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
 83.2453 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
 83.2454 ++
 83.2455 ++	  // Month names, starting with "C"'s January.
 83.2456 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
 83.2457 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
 83.2458 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
 83.2459 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
 83.2460 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
 83.2461 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
 83.2462 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
 83.2463 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
 83.2464 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
 83.2465 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
 83.2466 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
 83.2467 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
 83.2468 ++
 83.2469 ++	  // Abbreviated month names, starting with "C"'s Jan.
 83.2470 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
 83.2471 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
 83.2472 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
 83.2473 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
 83.2474 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
 83.2475 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
 83.2476 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
 83.2477 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
 83.2478 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
 83.2479 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
 83.2480 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
 83.2481 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
 83.2482 ++	}
 83.2483 ++    }
 83.2484 ++
 83.2485 ++#ifdef _GLIBCXX_USE_WCHAR_T
 83.2486 ++  template<>
 83.2487 ++    void
 83.2488 ++    __timepunct<wchar_t>::
 83.2489 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
 83.2490 ++	   const tm* __tm) const
 83.2491 ++    {
 83.2492 ++#ifdef __UCLIBC_HAS_XLOCALE__
 83.2493 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
 83.2494 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
 83.2495 ++					_M_c_locale_timepunct);
 83.2496 ++#else
 83.2497 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
 83.2498 ++      setlocale(LC_ALL, _M_name_timepunct);
 83.2499 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
 83.2500 ++      setlocale(LC_ALL, __old);
 83.2501 ++      free(__old);
 83.2502 ++#endif
 83.2503 ++      // Make sure __s is null terminated.
 83.2504 ++      if (__len == 0)
 83.2505 ++	__s[0] = L'\0';
 83.2506 ++    }
 83.2507 ++
 83.2508 ++  template<> 
 83.2509 ++    void
 83.2510 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
 83.2511 ++    {
 83.2512 ++      if (!_M_data)
 83.2513 ++	_M_data = new __timepunct_cache<wchar_t>;
 83.2514 ++
 83.2515 ++#warning wide time stuff
 83.2516 ++//       if (!__cloc)
 83.2517 ++	{
 83.2518 ++	  // "C" locale
 83.2519 ++	  _M_c_locale_timepunct = _S_get_c_locale();
 83.2520 ++
 83.2521 ++	  _M_data->_M_date_format = L"%m/%d/%y";
 83.2522 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
 83.2523 ++	  _M_data->_M_time_format = L"%H:%M:%S";
 83.2524 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
 83.2525 ++	  _M_data->_M_date_time_format = L"";
 83.2526 ++	  _M_data->_M_date_time_era_format = L"";
 83.2527 ++	  _M_data->_M_am = L"AM";
 83.2528 ++	  _M_data->_M_pm = L"PM";
 83.2529 ++	  _M_data->_M_am_pm_format = L"";
 83.2530 ++
 83.2531 ++	  // Day names, starting with "C"'s Sunday.
 83.2532 ++	  _M_data->_M_day1 = L"Sunday";
 83.2533 ++	  _M_data->_M_day2 = L"Monday";
 83.2534 ++	  _M_data->_M_day3 = L"Tuesday";
 83.2535 ++	  _M_data->_M_day4 = L"Wednesday";
 83.2536 ++	  _M_data->_M_day5 = L"Thursday";
 83.2537 ++	  _M_data->_M_day6 = L"Friday";
 83.2538 ++	  _M_data->_M_day7 = L"Saturday";
 83.2539 ++
 83.2540 ++	  // Abbreviated day names, starting with "C"'s Sun.
 83.2541 ++	  _M_data->_M_aday1 = L"Sun";
 83.2542 ++	  _M_data->_M_aday2 = L"Mon";
 83.2543 ++	  _M_data->_M_aday3 = L"Tue";
 83.2544 ++	  _M_data->_M_aday4 = L"Wed";
 83.2545 ++	  _M_data->_M_aday5 = L"Thu";
 83.2546 ++	  _M_data->_M_aday6 = L"Fri";
 83.2547 ++	  _M_data->_M_aday7 = L"Sat";
 83.2548 ++
 83.2549 ++	  // Month names, starting with "C"'s January.
 83.2550 ++	  _M_data->_M_month01 = L"January";
 83.2551 ++	  _M_data->_M_month02 = L"February";
 83.2552 ++	  _M_data->_M_month03 = L"March";
 83.2553 ++	  _M_data->_M_month04 = L"April";
 83.2554 ++	  _M_data->_M_month05 = L"May";
 83.2555 ++	  _M_data->_M_month06 = L"June";
 83.2556 ++	  _M_data->_M_month07 = L"July";
 83.2557 ++	  _M_data->_M_month08 = L"August";
 83.2558 ++	  _M_data->_M_month09 = L"September";
 83.2559 ++	  _M_data->_M_month10 = L"October";
 83.2560 ++	  _M_data->_M_month11 = L"November";
 83.2561 ++	  _M_data->_M_month12 = L"December";
 83.2562 ++
 83.2563 ++	  // Abbreviated month names, starting with "C"'s Jan.
 83.2564 ++	  _M_data->_M_amonth01 = L"Jan";
 83.2565 ++	  _M_data->_M_amonth02 = L"Feb";
 83.2566 ++	  _M_data->_M_amonth03 = L"Mar";
 83.2567 ++	  _M_data->_M_amonth04 = L"Apr";
 83.2568 ++	  _M_data->_M_amonth05 = L"May";
 83.2569 ++	  _M_data->_M_amonth06 = L"Jun";
 83.2570 ++	  _M_data->_M_amonth07 = L"Jul";
 83.2571 ++	  _M_data->_M_amonth08 = L"Aug";
 83.2572 ++	  _M_data->_M_amonth09 = L"Sep";
 83.2573 ++	  _M_data->_M_amonth10 = L"Oct";
 83.2574 ++	  _M_data->_M_amonth11 = L"Nov";
 83.2575 ++	  _M_data->_M_amonth12 = L"Dec";
 83.2576 ++	}
 83.2577 ++#if 0
 83.2578 ++      else
 83.2579 ++	{
 83.2580 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
 83.2581 ++
 83.2582 ++	  _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
 83.2583 ++	  _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
 83.2584 ++	  _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
 83.2585 ++	  _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
 83.2586 ++	  _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
 83.2587 ++	  _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
 83.2588 ++	  _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
 83.2589 ++	  _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
 83.2590 ++	  _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
 83.2591 ++
 83.2592 ++	  // Day names, starting with "C"'s Sunday.
 83.2593 ++	  _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
 83.2594 ++	  _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
 83.2595 ++	  _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
 83.2596 ++	  _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
 83.2597 ++	  _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
 83.2598 ++	  _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
 83.2599 ++	  _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
 83.2600 ++
 83.2601 ++	  // Abbreviated day names, starting with "C"'s Sun.
 83.2602 ++	  _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
 83.2603 ++	  _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
 83.2604 ++	  _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
 83.2605 ++	  _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
 83.2606 ++	  _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
 83.2607 ++	  _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
 83.2608 ++	  _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
 83.2609 ++
 83.2610 ++	  // Month names, starting with "C"'s January.
 83.2611 ++	  _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
 83.2612 ++	  _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
 83.2613 ++	  _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
 83.2614 ++	  _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
 83.2615 ++	  _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
 83.2616 ++	  _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
 83.2617 ++	  _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
 83.2618 ++	  _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
 83.2619 ++	  _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
 83.2620 ++	  _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
 83.2621 ++	  _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
 83.2622 ++	  _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
 83.2623 ++
 83.2624 ++	  // Abbreviated month names, starting with "C"'s Jan.
 83.2625 ++	  _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
 83.2626 ++	  _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
 83.2627 ++	  _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
 83.2628 ++	  _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
 83.2629 ++	  _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
 83.2630 ++	  _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
 83.2631 ++	  _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
 83.2632 ++	  _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
 83.2633 ++	  _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
 83.2634 ++	  _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
 83.2635 ++	  _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
 83.2636 ++	  _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
 83.2637 ++	}
 83.2638 ++#endif // 0
 83.2639 ++    }
 83.2640 ++#endif
 83.2641 ++}
 83.2642 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.4.6/libstdc++-v3/config/locale/uclibc/time_members.h
 83.2643 +--- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
 83.2644 ++++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-15 22:51:01.000000000 +0200
 83.2645 +@@ -0,0 +1,68 @@
 83.2646 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
 83.2647 ++
 83.2648 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 83.2649 ++//
 83.2650 ++// This file is part of the GNU ISO C++ Library.  This library is free
 83.2651 ++// software; you can redistribute it and/or modify it under the
 83.2652 ++// terms of the GNU General Public License as published by the
 83.2653 ++// Free Software Foundation; either version 2, or (at your option)
 83.2654 ++// any later version.
 83.2655 ++
 83.2656 ++// This library is distributed in the hope that it will be useful,
 83.2657 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 83.2658 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 83.2659 ++// GNU General Public License for more details.
 83.2660 ++
 83.2661 ++// You should have received a copy of the GNU General Public License along
 83.2662 ++// with this library; see the file COPYING.  If not, write to the Free
 83.2663 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 83.2664 ++// USA.
 83.2665 ++
 83.2666 ++// As a special exception, you may use this file as part of a free software
 83.2667 ++// library without restriction.  Specifically, if other files instantiate
 83.2668 ++// templates or use macros or inline functions from this file, or you compile
 83.2669 ++// this file and link it with other files to produce an executable, this
 83.2670 ++// file does not by itself cause the resulting executable to be covered by
 83.2671 ++// the GNU General Public License.  This exception does not however
 83.2672 ++// invalidate any other reasons why the executable file might be covered by
 83.2673 ++// the GNU General Public License.
 83.2674 ++
 83.2675 ++//
 83.2676 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
 83.2677 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
 83.2678 ++//
 83.2679 ++
 83.2680 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 83.2681 ++
 83.2682 ++  template<typename _CharT>
 83.2683 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
 83.2684 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 83.2685 ++    _M_name_timepunct(_S_get_c_name())
 83.2686 ++    { _M_initialize_timepunct(); }
 83.2687 ++
 83.2688 ++  template<typename _CharT>
 83.2689 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 83.2690 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 83.2691 ++    _M_name_timepunct(_S_get_c_name())
 83.2692 ++    { _M_initialize_timepunct(); }
 83.2693 ++
 83.2694 ++  template<typename _CharT>
 83.2695 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 83.2696 ++				     size_t __refs) 
 83.2697 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 83.2698 ++    _M_name_timepunct(__s)
 83.2699 ++    { 
 83.2700 ++      char* __tmp = new char[std::strlen(__s) + 1];
 83.2701 ++      std::strcpy(__tmp, __s);
 83.2702 ++      _M_name_timepunct = __tmp;
 83.2703 ++      _M_initialize_timepunct(__cloc); 
 83.2704 ++    }
 83.2705 ++
 83.2706 ++  template<typename _CharT>
 83.2707 ++    __timepunct<_CharT>::~__timepunct()
 83.2708 ++    { 
 83.2709 ++      if (_M_name_timepunct != _S_get_c_name())
 83.2710 ++	delete [] _M_name_timepunct;
 83.2711 ++      delete _M_data; 
 83.2712 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
 83.2713 ++    }
 83.2714 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_base.h
 83.2715 +--- gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_base.h	1970-01-01 01:00:00.000000000 +0100
 83.2716 ++++ gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_base.h	2007-08-15 22:51:01.000000000 +0200
 83.2717 +@@ -0,0 +1,58 @@
 83.2718 ++// Locale support -*- C++ -*-
 83.2719 ++
 83.2720 ++// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
 83.2721 ++// Free Software Foundation, Inc.
 83.2722 ++//
 83.2723 ++// This file is part of the GNU ISO C++ Library.  This library is free
 83.2724 ++// software; you can redistribute it and/or modify it under the
 83.2725 ++// terms of the GNU General Public License as published by the
 83.2726 ++// Free Software Foundation; either version 2, or (at your option)
 83.2727 ++// any later version.
 83.2728 ++
 83.2729 ++// This library is distributed in the hope that it will be useful,
 83.2730 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 83.2731 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 83.2732 ++// GNU General Public License for more details.
 83.2733 ++
 83.2734 ++// You should have received a copy of the GNU General Public License along
 83.2735 ++// with this library; see the file COPYING.  If not, write to the Free
 83.2736 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 83.2737 ++// USA.
 83.2738 ++
 83.2739 ++// As a special exception, you may use this file as part of a free software
 83.2740 ++// library without restriction.  Specifically, if other files instantiate
 83.2741 ++// templates or use macros or inline functions from this file, or you compile
 83.2742 ++// this file and link it with other files to produce an executable, this
 83.2743 ++// file does not by itself cause the resulting executable to be covered by
 83.2744 ++// the GNU General Public License.  This exception does not however
 83.2745 ++// invalidate any other reasons why the executable file might be covered by
 83.2746 ++// the GNU General Public License.
 83.2747 ++
 83.2748 ++//
 83.2749 ++// ISO C++ 14882: 22.1  Locales
 83.2750 ++//
 83.2751 ++  
 83.2752 ++// Information as gleaned from /usr/include/ctype.h
 83.2753 ++  
 83.2754 ++  struct ctype_base
 83.2755 ++  {
 83.2756 ++    // Note: In uClibc, the following two types depend on configuration.
 83.2757 ++ 
 83.2758 ++    // Non-standard typedefs.
 83.2759 ++    typedef const __ctype_touplow_t* __to_type;
 83.2760 ++
 83.2761 ++    // NB: Offsets into ctype<char>::_M_table force a particular size
 83.2762 ++    // on the mask type. Because of this, we don't use an enum.
 83.2763 ++    typedef __ctype_mask_t	mask;   
 83.2764 ++    static const mask upper    	= _ISupper;
 83.2765 ++    static const mask lower 	= _ISlower;
 83.2766 ++    static const mask alpha 	= _ISalpha;
 83.2767 ++    static const mask digit 	= _ISdigit;
 83.2768 ++    static const mask xdigit 	= _ISxdigit;
 83.2769 ++    static const mask space 	= _ISspace;
 83.2770 ++    static const mask print 	= _ISprint;
 83.2771 ++    static const mask graph 	= _ISalpha | _ISdigit | _ISpunct;
 83.2772 ++    static const mask cntrl 	= _IScntrl;
 83.2773 ++    static const mask punct 	= _ISpunct;
 83.2774 ++    static const mask alnum 	= _ISalpha | _ISdigit;
 83.2775 ++  };
 83.2776 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_inline.h
 83.2777 +--- gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_inline.h	1970-01-01 01:00:00.000000000 +0100
 83.2778 ++++ gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_inline.h	2007-08-15 22:51:01.000000000 +0200
 83.2779 +@@ -0,0 +1,69 @@
 83.2780 ++// Locale support -*- C++ -*-
 83.2781 ++
 83.2782 ++// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
 83.2783 ++//
 83.2784 ++// This file is part of the GNU ISO C++ Library.  This library is free
 83.2785 ++// software; you can redistribute it and/or modify it under the
 83.2786 ++// terms of the GNU General Public License as published by the
 83.2787 ++// Free Software Foundation; either version 2, or (at your option)
 83.2788 ++// any later version.
 83.2789 ++
 83.2790 ++// This library is distributed in the hope that it will be useful,
 83.2791 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 83.2792 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 83.2793 ++// GNU General Public License for more details.
 83.2794 ++
 83.2795 ++// You should have received a copy of the GNU General Public License along
 83.2796 ++// with this library; see the file COPYING.  If not, write to the Free
 83.2797 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 83.2798 ++// USA.
 83.2799 ++
 83.2800 ++// As a special exception, you may use this file as part of a free software
 83.2801 ++// library without restriction.  Specifically, if other files instantiate
 83.2802 ++// templates or use macros or inline functions from this file, or you compile
 83.2803 ++// this file and link it with other files to produce an executable, this
 83.2804 ++// file does not by itself cause the resulting executable to be covered by
 83.2805 ++// the GNU General Public License.  This exception does not however
 83.2806 ++// invalidate any other reasons why the executable file might be covered by
 83.2807 ++// the GNU General Public License.
 83.2808 ++
 83.2809 ++//
 83.2810 ++// ISO C++ 14882: 22.1  Locales
 83.2811 ++//
 83.2812 ++  
 83.2813 ++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
 83.2814 ++// functions go in ctype.cc
 83.2815 ++  
 83.2816 ++  bool
 83.2817 ++  ctype<char>::
 83.2818 ++  is(mask __m, char __c) const
 83.2819 ++  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
 83.2820 ++
 83.2821 ++  const char*
 83.2822 ++  ctype<char>::
 83.2823 ++  is(const char* __low, const char* __high, mask* __vec) const
 83.2824 ++  {
 83.2825 ++    while (__low < __high)
 83.2826 ++      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
 83.2827 ++    return __high;
 83.2828 ++  }
 83.2829 ++
 83.2830 ++  const char*
 83.2831 ++  ctype<char>::
 83.2832 ++  scan_is(mask __m, const char* __low, const char* __high) const
 83.2833 ++  {
 83.2834 ++    while (__low < __high 
 83.2835 ++	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
 83.2836 ++      ++__low;
 83.2837 ++    return __low;
 83.2838 ++  }
 83.2839 ++
 83.2840 ++  const char*
 83.2841 ++  ctype<char>::
 83.2842 ++  scan_not(mask __m, const char* __low, const char* __high) const
 83.2843 ++  {
 83.2844 ++    while (__low < __high 
 83.2845 ++	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
 83.2846 ++      ++__low;
 83.2847 ++    return __low;
 83.2848 ++  }
 83.2849 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_noninline.h
 83.2850 +--- gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_noninline.h	1970-01-01 01:00:00.000000000 +0100
 83.2851 ++++ gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_noninline.h	2007-08-15 22:51:01.000000000 +0200
 83.2852 +@@ -0,0 +1,92 @@
 83.2853 ++// Locale support -*- C++ -*-
 83.2854 ++
 83.2855 ++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
 83.2856 ++// Free Software Foundation, Inc.
 83.2857 ++//
 83.2858 ++// This file is part of the GNU ISO C++ Library.  This library is free
 83.2859 ++// software; you can redistribute it and/or modify it under the
 83.2860 ++// terms of the GNU General Public License as published by the
 83.2861 ++// Free Software Foundation; either version 2, or (at your option)
 83.2862 ++// any later version.
 83.2863 ++
 83.2864 ++// This library is distributed in the hope that it will be useful,
 83.2865 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 83.2866 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 83.2867 ++// GNU General Public License for more details.
 83.2868 ++
 83.2869 ++// You should have received a copy of the GNU General Public License along
 83.2870 ++// with this library; see the file COPYING.  If not, write to the Free
 83.2871 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 83.2872 ++// USA.
 83.2873 ++
 83.2874 ++// As a special exception, you may use this file as part of a free software
 83.2875 ++// library without restriction.  Specifically, if other files instantiate
 83.2876 ++// templates or use macros or inline functions from this file, or you compile
 83.2877 ++// this file and link it with other files to produce an executable, this
 83.2878 ++// file does not by itself cause the resulting executable to be covered by
 83.2879 ++// the GNU General Public License.  This exception does not however
 83.2880 ++// invalidate any other reasons why the executable file might be covered by
 83.2881 ++// the GNU General Public License.
 83.2882 ++
 83.2883 ++//
 83.2884 ++// ISO C++ 14882: 22.1  Locales
 83.2885 ++//
 83.2886 ++  
 83.2887 ++// Information as gleaned from /usr/include/ctype.h
 83.2888 ++
 83.2889 ++  const ctype_base::mask*
 83.2890 ++  ctype<char>::classic_table() throw()
 83.2891 ++  { return __C_ctype_b; }
 83.2892 ++
 83.2893 ++  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
 83.2894 ++		     size_t __refs) 
 83.2895 ++  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
 83.2896 ++  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
 83.2897 ++  {
 83.2898 ++    _M_toupper = __C_ctype_toupper;
 83.2899 ++    _M_tolower = __C_ctype_tolower;
 83.2900 ++    _M_table = __table ? __table : __C_ctype_b;
 83.2901 ++    memset(_M_widen, 0, sizeof(_M_widen));
 83.2902 ++    memset(_M_narrow, 0, sizeof(_M_narrow));
 83.2903 ++  }
 83.2904 ++
 83.2905 ++  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
 83.2906 ++  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
 83.2907 ++  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
 83.2908 ++  {
 83.2909 ++    _M_toupper = __C_ctype_toupper;
 83.2910 ++    _M_tolower = __C_ctype_tolower;
 83.2911 ++    _M_table = __table ? __table : __C_ctype_b;
 83.2912 ++    memset(_M_widen, 0, sizeof(_M_widen));
 83.2913 ++    memset(_M_narrow, 0, sizeof(_M_narrow));
 83.2914 ++  }
 83.2915 ++
 83.2916 ++  char
 83.2917 ++  ctype<char>::do_toupper(char __c) const
 83.2918 ++  { return _M_toupper[static_cast<unsigned char>(__c)]; }
 83.2919 ++
 83.2920 ++  const char*
 83.2921 ++  ctype<char>::do_toupper(char* __low, const char* __high) const
 83.2922 ++  {
 83.2923 ++    while (__low < __high)
 83.2924 ++      {
 83.2925 ++	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
 83.2926 ++	++__low;
 83.2927 ++      }
 83.2928 ++    return __high;
 83.2929 ++  }
 83.2930 ++
 83.2931 ++  char
 83.2932 ++  ctype<char>::do_tolower(char __c) const
 83.2933 ++  { return _M_tolower[static_cast<unsigned char>(__c)]; }
 83.2934 ++
 83.2935 ++  const char* 
 83.2936 ++  ctype<char>::do_tolower(char* __low, const char* __high) const
 83.2937 ++  {
 83.2938 ++    while (__low < __high)
 83.2939 ++      {
 83.2940 ++	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
 83.2941 ++	++__low;
 83.2942 ++      }
 83.2943 ++    return __high;
 83.2944 ++  }
 83.2945 +diff -durN gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.4.6/libstdc++-v3/config/os/uclibc/os_defines.h
 83.2946 +--- gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/os_defines.h	1970-01-01 01:00:00.000000000 +0100
 83.2947 ++++ gcc-3.4.6/libstdc++-v3/config/os/uclibc/os_defines.h	2007-08-15 22:51:01.000000000 +0200
 83.2948 +@@ -0,0 +1,44 @@
 83.2949 ++// Specific definitions for GNU/Linux  -*- C++ -*-
 83.2950 ++
 83.2951 ++// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 83.2952 ++//
 83.2953 ++// This file is part of the GNU ISO C++ Library.  This library is free
 83.2954 ++// software; you can redistribute it and/or modify it under the
 83.2955 ++// terms of the GNU General Public License as published by the
 83.2956 ++// Free Software Foundation; either version 2, or (at your option)
 83.2957 ++// any later version.
 83.2958 ++
 83.2959 ++// This library is distributed in the hope that it will be useful,
 83.2960 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 83.2961 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 83.2962 ++// GNU General Public License for more details.
 83.2963 ++
 83.2964 ++// You should have received a copy of the GNU General Public License along
 83.2965 ++// with this library; see the file COPYING.  If not, write to the Free
 83.2966 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 83.2967 ++// USA.
 83.2968 ++
 83.2969 ++// As a special exception, you may use this file as part of a free software
 83.2970 ++// library without restriction.  Specifically, if other files instantiate
 83.2971 ++// templates or use macros or inline functions from this file, or you compile
 83.2972 ++// this file and link it with other files to produce an executable, this
 83.2973 ++// file does not by itself cause the resulting executable to be covered by
 83.2974 ++// the GNU General Public License.  This exception does not however
 83.2975 ++// invalidate any other reasons why the executable file might be covered by
 83.2976 ++// the GNU General Public License.
 83.2977 ++
 83.2978 ++#ifndef _GLIBCXX_OS_DEFINES
 83.2979 ++#define _GLIBCXX_OS_DEFINES 1
 83.2980 ++
 83.2981 ++// System-specific #define, typedefs, corrections, etc, go here.  This
 83.2982 ++// file will come before all others.
 83.2983 ++
 83.2984 ++// This keeps isanum, et al from being propagated as macros.
 83.2985 ++#define __NO_CTYPE 1
 83.2986 ++
 83.2987 ++#include <features.h>
 83.2988 ++
 83.2989 ++// We must not see the optimized string functions GNU libc defines.
 83.2990 ++#define __NO_STRING_INLINES
 83.2991 ++
 83.2992 ++#endif
 83.2993 +diff -durN gcc-3.4.6.orig/libstdc++-v3/configure gcc-3.4.6/libstdc++-v3/configure
 83.2994 +--- gcc-3.4.6.orig/libstdc++-v3/configure	2005-02-01 07:31:23.000000000 +0100
 83.2995 ++++ gcc-3.4.6/libstdc++-v3/configure	2007-08-15 22:51:01.000000000 +0200
 83.2996 +@@ -4012,6 +4012,11 @@
 83.2997 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
 83.2998 +   ;;
 83.2999 + 
 83.3000 ++linux-uclibc*)
 83.3001 ++  lt_cv_deplibs_check_method=pass_all
 83.3002 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
 83.3003 ++  ;;
 83.3004 ++
 83.3005 + netbsd*)
 83.3006 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
 83.3007 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
 83.3008 +@@ -5679,7 +5684,7 @@
 83.3009 +   enableval="$enable_clocale"
 83.3010 + 
 83.3011 +       case "$enableval" in
 83.3012 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
 83.3013 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
 83.3014 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
 83.3015 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
 83.3016 +    { (exit 1); exit 1; }; } ;;
 83.3017 +@@ -5704,6 +5709,9 @@
 83.3018 +   # Default to "generic".
 83.3019 +   if test $enable_clocale_flag = auto; then
 83.3020 +     case x${target_os} in
 83.3021 ++      xlinux-uclibc*)
 83.3022 ++	enable_clocale_flag=uclibc
 83.3023 ++	;;
 83.3024 +       xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
 83.3025 +         cat >conftest.$ac_ext <<_ACEOF
 83.3026 + /* confdefs.h.  */
 83.3027 +@@ -5916,6 +5924,77 @@
 83.3028 +       CTIME_CC=config/locale/generic/time_members.cc
 83.3029 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
 83.3030 +       ;;
 83.3031 ++    uclibc)
 83.3032 ++      echo "$as_me:$LINENO: result: uclibc" >&5
 83.3033 ++echo "${ECHO_T}uclibc" >&6
 83.3034 ++
 83.3035 ++      # Declare intention to use gettext, and add support for specific
 83.3036 ++      # languages.
 83.3037 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
 83.3038 ++      ALL_LINGUAS="de fr"
 83.3039 ++
 83.3040 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
 83.3041 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
 83.3042 ++set dummy msgfmt; ac_word=$2
 83.3043 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
 83.3044 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 83.3045 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
 83.3046 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
 83.3047 ++else
 83.3048 ++  if test -n "$check_msgfmt"; then
 83.3049 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
 83.3050 ++else
 83.3051 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 83.3052 ++for as_dir in $PATH
 83.3053 ++do
 83.3054 ++  IFS=$as_save_IFS
 83.3055 ++  test -z "$as_dir" && as_dir=.
 83.3056 ++  for ac_exec_ext in '' $ac_executable_extensions; do
 83.3057 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 83.3058 ++    ac_cv_prog_check_msgfmt="yes"
 83.3059 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 83.3060 ++    break 2
 83.3061 ++  fi
 83.3062 ++done
 83.3063 ++done
 83.3064 ++
 83.3065 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
 83.3066 ++fi
 83.3067 ++fi
 83.3068 ++check_msgfmt=$ac_cv_prog_check_msgfmt
 83.3069 ++if test -n "$check_msgfmt"; then
 83.3070 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
 83.3071 ++echo "${ECHO_T}$check_msgfmt" >&6
 83.3072 ++else
 83.3073 ++  echo "$as_me:$LINENO: result: no" >&5
 83.3074 ++echo "${ECHO_T}no" >&6
 83.3075 ++fi
 83.3076 ++
 83.3077 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
 83.3078 ++        USE_NLS=yes
 83.3079 ++      fi
 83.3080 ++      # Export the build objects.
 83.3081 ++      for ling in $ALL_LINGUAS; do \
 83.3082 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
 83.3083 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
 83.3084 ++      done
 83.3085 ++
 83.3086 ++
 83.3087 ++
 83.3088 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
 83.3089 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
 83.3090 ++      CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
 83.3091 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
 83.3092 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
 83.3093 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
 83.3094 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
 83.3095 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
 83.3096 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
 83.3097 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
 83.3098 ++      CTIME_H=config/locale/uclibc/time_members.h
 83.3099 ++      CTIME_CC=config/locale/uclibc/time_members.cc
 83.3100 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
 83.3101 ++      ;;
 83.3102 +   esac
 83.3103 + 
 83.3104 +   # This is where the testsuite looks for locale catalogs, using the
 83.3105 +diff -durN gcc-3.4.6.orig/libstdc++-v3/configure.host gcc-3.4.6/libstdc++-v3/configure.host
 83.3106 +--- gcc-3.4.6.orig/libstdc++-v3/configure.host	2004-10-05 18:32:49.000000000 +0200
 83.3107 ++++ gcc-3.4.6/libstdc++-v3/configure.host	2007-08-15 22:51:01.000000000 +0200
 83.3108 +@@ -217,6 +217,12 @@
 83.3109 +     ;;
 83.3110 + esac
 83.3111 + 
 83.3112 ++# Override for uClibc since linux-uclibc gets mishandled above.
 83.3113 ++case "${host_os}" in
 83.3114 ++  *-uclibc*)
 83.3115 ++    os_include_dir="os/uclibc"
 83.3116 ++    ;;
 83.3117 ++esac
 83.3118 + 
 83.3119 + # Set any OS-dependent and CPU-dependent bits.
 83.3120 + # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
 83.3121 +diff -durN gcc-3.4.6.orig/libstdc++-v3/crossconfig.m4 gcc-3.4.6/libstdc++-v3/crossconfig.m4
 83.3122 +--- gcc-3.4.6.orig/libstdc++-v3/crossconfig.m4	2005-02-01 07:31:23.000000000 +0100
 83.3123 ++++ gcc-3.4.6/libstdc++-v3/crossconfig.m4	2007-08-15 22:51:01.000000000 +0200
 83.3124 +@@ -138,6 +138,99 @@
 83.3125 + 	;;
 83.3126 +     esac
 83.3127 +     ;;
 83.3128 ++  *-uclibc*)
 83.3129 ++# Temporary hack until we implement the float versions of the libm funcs
 83.3130 ++    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
 83.3131 ++      machine/endian.h machine/param.h sys/machine.h sys/types.h \
 83.3132 ++      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
 83.3133 ++    SECTION_FLAGS='-ffunction-sections -fdata-sections'
 83.3134 ++    AC_SUBST(SECTION_FLAGS)
 83.3135 ++    GLIBCXX_CHECK_LINKER_FEATURES
 83.3136 ++    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
 83.3137 ++    GLIBCXX_CHECK_WCHAR_T_SUPPORT
 83.3138 ++
 83.3139 ++    # For LFS.
 83.3140 ++    AC_DEFINE(HAVE_INT64_T)
 83.3141 ++    case "$target" in
 83.3142 ++      *-uclinux*)
 83.3143 ++        # Don't enable LFS with uClinux
 83.3144 ++        ;;
 83.3145 ++      *)
 83.3146 ++        AC_DEFINE(_GLIBCXX_USE_LFS)
 83.3147 ++    esac
 83.3148 ++
 83.3149 ++    # For showmanyc_helper().
 83.3150 ++    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
 83.3151 ++    GLIBCXX_CHECK_POLL
 83.3152 ++    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
 83.3153 ++
 83.3154 ++    # For xsputn_2().
 83.3155 ++    AC_CHECK_HEADERS(sys/uio.h)
 83.3156 ++    GLIBCXX_CHECK_WRITEV
 83.3157 ++
 83.3158 ++#     AC_DEFINE(HAVE_ACOSF)
 83.3159 ++#     AC_DEFINE(HAVE_ASINF)
 83.3160 ++#     AC_DEFINE(HAVE_ATANF)
 83.3161 ++#     AC_DEFINE(HAVE_ATAN2F)
 83.3162 ++    AC_DEFINE(HAVE_CEILF)
 83.3163 ++    AC_DEFINE(HAVE_COPYSIGN)
 83.3164 ++#     AC_DEFINE(HAVE_COPYSIGNF)
 83.3165 ++#     AC_DEFINE(HAVE_COSF)
 83.3166 ++#     AC_DEFINE(HAVE_COSHF)
 83.3167 ++#     AC_DEFINE(HAVE_EXPF)
 83.3168 ++#     AC_DEFINE(HAVE_FABSF)
 83.3169 ++    AC_DEFINE(HAVE_FINITE)
 83.3170 ++    AC_DEFINE(HAVE_FINITEF)
 83.3171 ++    AC_DEFINE(HAVE_FLOORF)
 83.3172 ++#     AC_DEFINE(HAVE_FMODF)
 83.3173 ++#     AC_DEFINE(HAVE_FREXPF)
 83.3174 ++    AC_DEFINE(HAVE_HYPOT)
 83.3175 ++#     AC_DEFINE(HAVE_HYPOTF)
 83.3176 ++    AC_DEFINE(HAVE_ISINF)
 83.3177 ++    AC_DEFINE(HAVE_ISINFF)
 83.3178 ++    AC_DEFINE(HAVE_ISNAN)
 83.3179 ++    AC_DEFINE(HAVE_ISNANF)
 83.3180 ++#     AC_DEFINE(HAVE_LOGF)
 83.3181 ++#     AC_DEFINE(HAVE_LOG10F)
 83.3182 ++#     AC_DEFINE(HAVE_MODFF)
 83.3183 ++#     AC_DEFINE(HAVE_SINF)
 83.3184 ++#     AC_DEFINE(HAVE_SINHF)
 83.3185 ++#     AC_DEFINE(HAVE_SINCOS)
 83.3186 ++#     AC_DEFINE(HAVE_SINCOSF)
 83.3187 ++    AC_DEFINE(HAVE_SQRTF)
 83.3188 ++#     AC_DEFINE(HAVE_TANF)
 83.3189 ++#     AC_DEFINE(HAVE_TANHF)
 83.3190 ++    if test x"long_double_math_on_this_cpu" = x"yes"; then
 83.3191 ++      AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
 83.3192 ++#       AC_DEFINE(HAVE_ACOSL)
 83.3193 ++#       AC_DEFINE(HAVE_ASINL)
 83.3194 ++#       AC_DEFINE(HAVE_ATANL)
 83.3195 ++#       AC_DEFINE(HAVE_ATAN2L)
 83.3196 ++#       AC_DEFINE(HAVE_CEILL)
 83.3197 ++#       AC_DEFINE(HAVE_COPYSIGNL)
 83.3198 ++#       AC_DEFINE(HAVE_COSL)
 83.3199 ++#       AC_DEFINE(HAVE_COSHL)
 83.3200 ++#       AC_DEFINE(HAVE_EXPL)
 83.3201 ++#       AC_DEFINE(HAVE_FABSL)
 83.3202 ++#       AC_DEFINE(HAVE_FINITEL)
 83.3203 ++#       AC_DEFINE(HAVE_FLOORL)
 83.3204 ++#       AC_DEFINE(HAVE_FMODL)
 83.3205 ++#       AC_DEFINE(HAVE_FREXPL)
 83.3206 ++#       AC_DEFINE(HAVE_HYPOTL)
 83.3207 ++#       AC_DEFINE(HAVE_ISINFL)
 83.3208 ++#       AC_DEFINE(HAVE_ISNANL)
 83.3209 ++#       AC_DEFINE(HAVE_LOGL)
 83.3210 ++#       AC_DEFINE(HAVE_LOG10L)
 83.3211 ++#       AC_DEFINE(HAVE_MODFL)
 83.3212 ++#       AC_DEFINE(HAVE_POWL)
 83.3213 ++#       AC_DEFINE(HAVE_SINL)
 83.3214 ++#       AC_DEFINE(HAVE_SINHL)
 83.3215 ++#       AC_DEFINE(HAVE_SINCOSL)
 83.3216 ++#       AC_DEFINE(HAVE_SQRTL)
 83.3217 ++#       AC_DEFINE(HAVE_TANL)
 83.3218 ++#       AC_DEFINE(HAVE_TANHL)
 83.3219 ++    fi
 83.3220 ++    ;;
 83.3221 +   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
 83.3222 +     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
 83.3223 +       machine/endian.h machine/param.h sys/machine.h sys/types.h \
 83.3224 +@@ -152,7 +245,7 @@
 83.3225 +     AC_DEFINE(HAVE_INT64_T)
 83.3226 +     case "$target" in
 83.3227 +       *-uclinux*)
 83.3228 +-        # Don't enable LFS with uClibc
 83.3229 ++        # Don't enable LFS with uClinux
 83.3230 +         ;;
 83.3231 +       *)
 83.3232 +         AC_DEFINE(_GLIBCXX_USE_LFS)
 83.3233 +diff -durN gcc-3.4.6.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-3.4.6/libstdc++-v3/include/c_compatibility/wchar.h
 83.3234 +--- gcc-3.4.6.orig/libstdc++-v3/include/c_compatibility/wchar.h	2003-12-09 04:51:46.000000000 +0100
 83.3235 ++++ gcc-3.4.6/libstdc++-v3/include/c_compatibility/wchar.h	2007-08-15 22:51:01.000000000 +0200
 83.3236 +@@ -101,7 +101,9 @@
 83.3237 + using std::wmemcpy;
 83.3238 + using std::wmemmove;
 83.3239 + using std::wmemset;
 83.3240 ++#if _GLIBCXX_HAVE_WCSFTIME
 83.3241 + using std::wcsftime;
 83.3242 ++#endif
 83.3243 + 
 83.3244 + #if _GLIBCXX_USE_C99
 83.3245 + using std::wcstold;
 83.3246 +diff -durN gcc-3.4.6.orig/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.4.6/libstdc++-v3/include/c_std/std_cwchar.h
 83.3247 +--- gcc-3.4.6.orig/libstdc++-v3/include/c_std/std_cwchar.h	2004-07-20 10:52:12.000000000 +0200
 83.3248 ++++ gcc-3.4.6/libstdc++-v3/include/c_std/std_cwchar.h	2007-08-15 22:51:01.000000000 +0200
 83.3249 +@@ -179,7 +179,9 @@
 83.3250 +   using ::wcscoll;
 83.3251 +   using ::wcscpy;
 83.3252 +   using ::wcscspn;
 83.3253 ++#if _GLIBCXX_HAVE_WCSFTIME
 83.3254 +   using ::wcsftime;
 83.3255 ++#endif
 83.3256 +   using ::wcslen;
 83.3257 +   using ::wcsncat;
 83.3258 +   using ::wcsncmp;
    84.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.2 +++ b/patches/gcc/3.4.6/120-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
    84.3 @@ -0,0 +1,46 @@
    84.4 +diff -durN gcc-3.4.6.orig/libstdc++-v3/src/Makefile.am gcc-3.4.6/libstdc++-v3/src/Makefile.am
    84.5 +--- gcc-3.4.6.orig/libstdc++-v3/src/Makefile.am	2004-04-16 21:08:35.000000000 +0200
    84.6 ++++ gcc-3.4.6/libstdc++-v3/src/Makefile.am	2007-08-15 22:52:23.000000000 +0200
    84.7 +@@ -210,6 +210,10 @@
    84.8 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
    84.9 + 
   84.10 + 
   84.11 ++install-exec-local:
   84.12 ++	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
   84.13 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
   84.14 ++
   84.15 + # Added bits to build debug library.
   84.16 + if GLIBCXX_BUILD_DEBUG
   84.17 + all-local: build_debug
   84.18 +diff -durN gcc-3.4.6.orig/libstdc++-v3/src/Makefile.in gcc-3.4.6/libstdc++-v3/src/Makefile.in
   84.19 +--- gcc-3.4.6.orig/libstdc++-v3/src/Makefile.in	2004-04-16 21:08:35.000000000 +0200
   84.20 ++++ gcc-3.4.6/libstdc++-v3/src/Makefile.in	2007-08-15 22:52:23.000000000 +0200
   84.21 +@@ -592,7 +592,7 @@
   84.22 + 
   84.23 + install-data-am: install-data-local
   84.24 + 
   84.25 +-install-exec-am: install-toolexeclibLTLIBRARIES
   84.26 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
   84.27 + 
   84.28 + install-info: install-info-am
   84.29 + 
   84.30 +@@ -625,6 +625,7 @@
   84.31 + 	distclean-tags distdir dvi dvi-am info info-am install \
   84.32 + 	install-am install-data install-data-am install-data-local \
   84.33 + 	install-exec install-exec-am install-info install-info-am \
   84.34 ++	install-exec-local \
   84.35 + 	install-man install-strip install-toolexeclibLTLIBRARIES \
   84.36 + 	installcheck installcheck-am installdirs maintainer-clean \
   84.37 + 	maintainer-clean-generic mostlyclean mostlyclean-compile \
   84.38 +@@ -709,6 +710,11 @@
   84.39 + install_debug:
   84.40 + 	(cd ${debugdir} && $(MAKE) \
   84.41 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
   84.42 ++
   84.43 ++install-exec-local:
   84.44 ++	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
   84.45 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
   84.46 ++
   84.47 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
   84.48 + # Otherwise a system limit (for SysV at least) may be exceeded.
   84.49 + .NOEXPORT:
    85.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.2 +++ b/patches/gcc/3.4.6/130-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
    85.3 @@ -0,0 +1,26 @@
    85.4 +diff -durN gcc-3.4.6.orig/libstdc++-v3/include/ext/rope gcc-3.4.6/libstdc++-v3/include/ext/rope
    85.5 +--- gcc-3.4.6.orig/libstdc++-v3/include/ext/rope	2005-01-16 23:08:43.000000000 +0100
    85.6 ++++ gcc-3.4.6/libstdc++-v3/include/ext/rope	2007-08-15 22:53:37.000000000 +0200
    85.7 +@@ -58,6 +58,9 @@
    85.8 + #include <bits/allocator.h>
    85.9 + #include <ext/hash_fun.h>
   85.10 + 
   85.11 ++/* cope w/ index defined as macro, SuSv3 proposal */
   85.12 ++#undef index
   85.13 ++
   85.14 + # ifdef __GC
   85.15 + #   define __GC_CONST const
   85.16 + # else
   85.17 +diff -durN gcc-3.4.6.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-3.4.6/libstdc++-v3/include/ext/ropeimpl.h
   85.18 +--- gcc-3.4.6.orig/libstdc++-v3/include/ext/ropeimpl.h	2004-09-08 15:36:04.000000000 +0200
   85.19 ++++ gcc-3.4.6/libstdc++-v3/include/ext/ropeimpl.h	2007-08-15 22:53:37.000000000 +0200
   85.20 +@@ -53,6 +53,9 @@
   85.21 + #include <ext/memory> // For uninitialized_copy_n
   85.22 + #include <ext/numeric> // For power
   85.23 + 
   85.24 ++/* cope w/ index defined as macro, SuSv3 proposal */
   85.25 ++#undef index
   85.26 ++
   85.27 + namespace __gnu_cxx
   85.28 + {
   85.29 +   using std::size_t;
    86.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.2 +++ b/patches/gcc/3.4.6/140-arm-ldm-peephole.patch	Mon Jul 28 21:32:33 2008 +0000
    86.3 @@ -0,0 +1,68 @@
    86.4 +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
    86.5 +--- gcc-3.4.6.orig/gcc/config/arm/arm.c	2005-10-01 15:31:38.000000000 +0200
    86.6 ++++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:54:59.000000000 +0200
    86.7 +@@ -4857,6 +4857,11 @@
    86.8 +       *load_offset = unsorted_offsets[order[0]];
    86.9 +     }
   86.10 + 
   86.11 ++  /* For XScale a two-word LDM is a performance loss, so only do this if
   86.12 ++     size is more important.  See comments in arm_gen_load_multiple.  */
   86.13 ++  if (nops == 2 && arm_tune_xscale && !optimize_size)
   86.14 ++    return 0;
   86.15 ++
   86.16 +   if (unsorted_offsets[order[0]] == 0)
   86.17 +     return 1; /* ldmia */
   86.18 + 
   86.19 +@@ -5083,6 +5088,11 @@
   86.20 +       *load_offset = unsorted_offsets[order[0]];
   86.21 +     }
   86.22 + 
   86.23 ++  /* For XScale a two-word LDM is a performance loss, so only do this if
   86.24 ++     size is more important.  See comments in arm_gen_load_multiple.  */
   86.25 ++  if (nops == 2 && arm_tune_xscale && !optimize_size)
   86.26 ++    return 0;
   86.27 ++
   86.28 +   if (unsorted_offsets[order[0]] == 0)
   86.29 +     return 1; /* stmia */
   86.30 + 
   86.31 +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.md gcc-3.4.6/gcc/config/arm/arm.md
   86.32 +--- gcc-3.4.6.orig/gcc/config/arm/arm.md	2005-10-01 15:31:38.000000000 +0200
   86.33 ++++ gcc-3.4.6/gcc/config/arm/arm.md	2007-08-15 22:54:59.000000000 +0200
   86.34 +@@ -8811,13 +8811,16 @@
   86.35 +    (set_attr "length" "4,8,8")]
   86.36 + )
   86.37 + 
   86.38 ++; Try to convert LDR+LDR+arith into [add+]LDM+arith
   86.39 ++; On XScale, LDM is always slower than two LDRs, so only do this if
   86.40 ++; optimising for size.
   86.41 + (define_insn "*arith_adjacentmem"
   86.42 +   [(set (match_operand:SI 0 "s_register_operand" "=r")
   86.43 + 	(match_operator:SI 1 "shiftable_operator"
   86.44 + 	 [(match_operand:SI 2 "memory_operand" "m")
   86.45 + 	  (match_operand:SI 3 "memory_operand" "m")]))
   86.46 +    (clobber (match_scratch:SI 4 "=r"))]
   86.47 +-  "TARGET_ARM && adjacent_mem_locations (operands[2], operands[3])"
   86.48 ++  "TARGET_ARM && (!arm_tune_xscale || optimize_size) && adjacent_mem_locations (operands[2], operands[3])"
   86.49 +   "*
   86.50 +   {
   86.51 +     rtx ldm[3];
   86.52 +@@ -8852,6 +8855,8 @@
   86.53 +       }
   86.54 +    if (val1 && val2)
   86.55 +       {
   86.56 ++	/* This would be a loss on a Harvard core, but adjacent_mem_locations()
   86.57 ++	   will prevent it from happening.  */
   86.58 + 	rtx ops[3];
   86.59 + 	ldm[0] = ops[0] = operands[4];
   86.60 + 	ops[1] = XEXP (XEXP (operands[2], 0), 0);
   86.61 +diff -durN gcc-3.4.6.orig/gcc/genpeep.c gcc-3.4.6/gcc/genpeep.c
   86.62 +--- gcc-3.4.6.orig/gcc/genpeep.c	2003-07-05 07:27:22.000000000 +0200
   86.63 ++++ gcc-3.4.6/gcc/genpeep.c	2007-08-15 22:54:59.000000000 +0200
   86.64 +@@ -381,6 +381,7 @@
   86.65 +   printf ("#include \"recog.h\"\n");
   86.66 +   printf ("#include \"except.h\"\n\n");
   86.67 +   printf ("#include \"function.h\"\n\n");
   86.68 ++  printf ("#include \"flags.h\"\n\n");
   86.69 + 
   86.70 +   printf ("#ifdef HAVE_peephole\n");
   86.71 +   printf ("extern rtx peep_operand[];\n\n");
    87.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.2 +++ b/patches/gcc/3.4.6/150-arm-ldm.patch	Mon Jul 28 21:32:33 2008 +0000
    87.3 @@ -0,0 +1,120 @@
    87.4 +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
    87.5 +--- gcc-3.4.6.orig/gcc/config/arm/arm.c	2007-08-15 22:56:20.000000000 +0200
    87.6 ++++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:56:20.000000000 +0200
    87.7 +@@ -8524,6 +8524,26 @@
    87.8 +   return_used_this_function = 0;  
    87.9 + }
   87.10 + 
   87.11 ++/* Return the number (counting from 0) of
   87.12 ++   the least significant set bit in MASK.  */
   87.13 ++
   87.14 ++#ifdef __GNUC__
   87.15 ++inline
   87.16 ++#endif
   87.17 ++static int
   87.18 ++number_of_first_bit_set (mask)
   87.19 ++     int mask;
   87.20 ++{
   87.21 ++  int bit;
   87.22 ++
   87.23 ++  for (bit = 0;
   87.24 ++       (mask & (1 << bit)) == 0;
   87.25 ++       ++bit)
   87.26 ++    continue;
   87.27 ++
   87.28 ++  return bit;
   87.29 ++}
   87.30 ++
   87.31 + const char *
   87.32 + arm_output_epilogue (rtx sibling)
   87.33 + {
   87.34 +@@ -8757,27 +8777,47 @@
   87.35 + 	  saved_regs_mask |=   (1 << PC_REGNUM);
   87.36 + 	}
   87.37 + 
   87.38 +-      /* Load the registers off the stack.  If we only have one register
   87.39 +-	 to load use the LDR instruction - it is faster.  */
   87.40 +-      if (saved_regs_mask == (1 << LR_REGNUM))
   87.41 +-	{
   87.42 +-	  /* The exception handler ignores the LR, so we do
   87.43 +-	     not really need to load it off the stack.  */
   87.44 +-	  if (eh_ofs)
   87.45 +-	    asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
   87.46 +-	  else
   87.47 +-	    asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM);
   87.48 +-	}
   87.49 +-      else if (saved_regs_mask)
   87.50 ++      if (saved_regs_mask)
   87.51 + 	{
   87.52 +-	  if (saved_regs_mask & (1 << SP_REGNUM))
   87.53 +-	    /* Note - write back to the stack register is not enabled
   87.54 +-	       (ie "ldmfd sp!...").  We know that the stack pointer is
   87.55 +-	       in the list of registers and if we add writeback the
   87.56 +-	       instruction becomes UNPREDICTABLE.  */
   87.57 +-	    print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
   87.58 ++	  /* Load the registers off the stack.  If we only have one register
   87.59 ++	     to load use the LDR instruction - it is faster.  */
   87.60 ++	  if (bit_count (saved_regs_mask) == 1)
   87.61 ++	    {
   87.62 ++	      int reg = number_of_first_bit_set (saved_regs_mask);
   87.63 ++
   87.64 ++	      switch (reg)
   87.65 ++		{
   87.66 ++		case SP_REGNUM:
   87.67 ++		  /* Mustn't use base writeback when loading SP.  */
   87.68 ++		  asm_fprintf (f, "\tldr\t%r, [%r]\n", SP_REGNUM, SP_REGNUM);
   87.69 ++		  break;
   87.70 ++		  
   87.71 ++		case LR_REGNUM:
   87.72 ++		  if (eh_ofs)
   87.73 ++		    {
   87.74 ++		      /* The exception handler ignores the LR, so we do
   87.75 ++			 not really need to load it off the stack.  */
   87.76 ++		      asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
   87.77 ++		      break;
   87.78 ++		    }
   87.79 ++		  /* else fall through */
   87.80 ++		  
   87.81 ++		default:
   87.82 ++		  asm_fprintf (f, "\tldr\t%r, [%r], #4\n", reg, SP_REGNUM);
   87.83 ++		  break;
   87.84 ++		}
   87.85 ++	    }
   87.86 + 	  else
   87.87 +-	    print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
   87.88 ++	    {
   87.89 ++	      if (saved_regs_mask & (1 << SP_REGNUM))
   87.90 ++		/* Note - write back to the stack register is not enabled
   87.91 ++		   (ie "ldmfd sp!...").  We know that the stack pointer is
   87.92 ++		   in the list of registers and if we add writeback the
   87.93 ++		   instruction becomes UNPREDICTABLE.  */
   87.94 ++		print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
   87.95 ++	      else
   87.96 ++		print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
   87.97 ++	    }
   87.98 + 	}
   87.99 + 
  87.100 +       if (current_function_pretend_args_size)
  87.101 +@@ -11405,22 +11445,6 @@
  87.102 +     }
  87.103 + }
  87.104 + 
  87.105 +-/* Return the number (counting from 0) of
  87.106 +-   the least significant set bit in MASK.  */
  87.107 +-
  87.108 +-inline static int
  87.109 +-number_of_first_bit_set (int mask)
  87.110 +-{
  87.111 +-  int bit;
  87.112 +-
  87.113 +-  for (bit = 0;
  87.114 +-       (mask & (1 << bit)) == 0;
  87.115 +-       ++bit)
  87.116 +-    continue;
  87.117 +-
  87.118 +-  return bit;
  87.119 +-}
  87.120 +-
  87.121 + /* Generate code to return from a thumb function.
  87.122 +    If 'reg_containing_return_addr' is -1, then the return address is
  87.123 +    actually on the stack, at the stack pointer.  */
    88.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.2 +++ b/patches/gcc/3.4.6/160-arm-ldm-peephole2.patch	Mon Jul 28 21:32:33 2008 +0000
    88.3 @@ -0,0 +1,32 @@
    88.4 +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
    88.5 +--- gcc-3.4.6.orig/gcc/config/arm/arm.c	2007-08-15 22:57:51.000000000 +0200
    88.6 ++++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:57:51.000000000 +0200
    88.7 +@@ -4572,6 +4572,10 @@
    88.8 + int
    88.9 + adjacent_mem_locations (rtx a, rtx b)
   88.10 + {
   88.11 ++  /* We don't guarantee to preserve the order of these memory refs.  */
   88.12 ++  if (volatile_refs_p (a) || volatile_refs_p (b))
   88.13 ++    return 0;
   88.14 ++
   88.15 +   if ((GET_CODE (XEXP (a, 0)) == REG
   88.16 +        || (GET_CODE (XEXP (a, 0)) == PLUS
   88.17 + 	   && GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT))
   88.18 +@@ -4611,6 +4615,17 @@
   88.19 + 	return 0;
   88.20 + 
   88.21 +       val_diff = val1 - val0;
   88.22 ++
   88.23 ++      if (arm_ld_sched)
   88.24 ++	{
   88.25 ++	  /* If the target has load delay slots, then there's no benefit
   88.26 ++	     to using an ldm instruction unless the offset is zero and
   88.27 ++	     we are optimizing for size.  */
   88.28 ++	  return (optimize_size && (REGNO (reg0) == REGNO (reg1))
   88.29 ++		  && (val0 == 0 || val1 == 0 || val0 == 4 || val1 == 4)
   88.30 ++		  && (val_diff == 4 || val_diff == -4));
   88.31 ++	}
   88.32 ++
   88.33 +       return ((REGNO (reg0) == REGNO (reg1))
   88.34 + 	      && (val_diff == 4 || val_diff == -4));
   88.35 +     }
    89.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.2 +++ b/patches/gcc/3.4.6/170-sdk-libstdc++-includes.patch	Mon Jul 28 21:32:33 2008 +0000
    89.3 @@ -0,0 +1,24 @@
    89.4 +diff -durN gcc-3.4.6.orig/libstdc++-v3/fragment.am gcc-3.4.6/libstdc++-v3/fragment.am
    89.5 +--- gcc-3.4.6.orig/libstdc++-v3/fragment.am	2003-08-27 02:38:28.000000000 +0200
    89.6 ++++ gcc-3.4.6/libstdc++-v3/fragment.am	2007-08-15 22:59:09.000000000 +0200
    89.7 +@@ -18,7 +18,7 @@
    89.8 + 	$(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
    89.9 + 
   89.10 + # -I/-D flags to pass when compiling.
   89.11 +-AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
   89.12 ++AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
   89.13 + 
   89.14 + 
   89.15 + 
   89.16 +diff -durN gcc-3.4.6.orig/libstdc++-v3/libmath/Makefile.am gcc-3.4.6/libstdc++-v3/libmath/Makefile.am
   89.17 +--- gcc-3.4.6.orig/libstdc++-v3/libmath/Makefile.am	2003-08-27 23:29:43.000000000 +0200
   89.18 ++++ gcc-3.4.6/libstdc++-v3/libmath/Makefile.am	2007-08-15 22:59:09.000000000 +0200
   89.19 +@@ -32,7 +32,7 @@
   89.20 + 
   89.21 + libmath_la_SOURCES = stubs.c
   89.22 + 
   89.23 +-AM_CPPFLAGS = $(CANADIAN_INCLUDES)
   89.24 ++AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
   89.25 + 
   89.26 + # Only compiling "C" sources in this directory.
   89.27 + LIBTOOL = @LIBTOOL@ --tag CC
    90.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.2 +++ b/patches/gcc/3.4.6/180-pr15068-fix.patch	Mon Jul 28 21:32:33 2008 +0000
    90.3 @@ -0,0 +1,27 @@
    90.4 +diff -durN gcc-3.4.6.orig/gcc/flow.c gcc-3.4.6/gcc/flow.c
    90.5 +--- gcc-3.4.6.orig/gcc/flow.c	2005-09-01 22:51:09.000000000 +0200
    90.6 ++++ gcc-3.4.6/gcc/flow.c	2007-08-15 23:00:30.000000000 +0200
    90.7 +@@ -1884,6 +1884,7 @@
    90.8 + 	  rtx set_src = SET_SRC (pc_set (BB_END (bb)));
    90.9 + 	  rtx cond_true = XEXP (set_src, 0);
   90.10 + 	  rtx reg = XEXP (cond_true, 0);
   90.11 ++ 	  enum rtx_code inv_cond;
   90.12 + 
   90.13 + 	  if (GET_CODE (reg) == SUBREG)
   90.14 + 	    reg = SUBREG_REG (reg);
   90.15 +@@ -1892,11 +1893,13 @@
   90.16 + 	     in the form of a comparison of a register against zero.  
   90.17 + 	     If the condition is more complex than that, then it is safe
   90.18 + 	     not to record any information.  */
   90.19 +-	  if (GET_CODE (reg) == REG
   90.20 ++ 	  inv_cond = reversed_comparison_code (cond_true, BB_END (bb));
   90.21 ++ 	  if (inv_cond != UNKNOWN
   90.22 ++	      && GET_CODE (reg) == REG
   90.23 + 	      && XEXP (cond_true, 1) == const0_rtx)
   90.24 + 	    {
   90.25 + 	      rtx cond_false
   90.26 +-		= gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond_true)),
   90.27 ++		= gen_rtx_fmt_ee (inv_cond,
   90.28 + 				  GET_MODE (cond_true), XEXP (cond_true, 0),
   90.29 + 				  XEXP (cond_true, 1));
   90.30 + 	      if (GET_CODE (XEXP (set_src, 1)) == PC)
    91.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.2 +++ b/patches/gcc/3.4.6/190-all_sh-pr16665-fix.patch	Mon Jul 28 21:32:33 2008 +0000
    91.3 @@ -0,0 +1,44 @@
    91.4 +diff -durN gcc-3.4.6.orig/gcc/config/sh/sh.c gcc-3.4.6/gcc/config/sh/sh.c
    91.5 +--- gcc-3.4.6.orig/gcc/config/sh/sh.c	2004-09-03 08:51:30.000000000 +0200
    91.6 ++++ gcc-3.4.6/gcc/config/sh/sh.c	2007-08-15 23:01:48.000000000 +0200
    91.7 +@@ -9107,6 +9107,15 @@
    91.8 +     }
    91.9 +   this = FUNCTION_ARG (cum, Pmode, ptr_type_node, 1);
   91.10 + 
   91.11 ++  /* In PIC case, we set PIC register to compute the target address.  We
   91.12 ++     can use a scratch register to save and restore the original value  
   91.13 ++     except for SHcompact.  For SHcompact, use stack.  */
   91.14 ++  if (flag_pic && TARGET_SHCOMPACT)
   91.15 ++    {
   91.16 ++      push (PIC_OFFSET_TABLE_REGNUM);
   91.17 ++      emit_insn (gen_GOTaddr2picreg ());
   91.18 ++    }
   91.19 ++
   91.20 +   /* For SHcompact, we only have r0 for a scratch register: r1 is the
   91.21 +      static chain pointer (even if you can't have nested virtual functions
   91.22 +      right now, someone might implement them sometime), and the rest of the
   91.23 +@@ -9189,8 +9198,24 @@
   91.24 +       assemble_external (function);
   91.25 +       TREE_USED (function) = 1;
   91.26 +     }
   91.27 ++  /* We can use scratch1 to save and restore the original value of
   91.28 ++     PIC register except for SHcompact.  */
   91.29 ++  if (flag_pic && ! TARGET_SHCOMPACT)
   91.30 ++    {
   91.31 ++      emit_move_insn (scratch1,
   91.32 ++		      gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM));
   91.33 ++      emit_insn (gen_GOTaddr2picreg ());
   91.34 ++    }
   91.35 +   funexp = XEXP (DECL_RTL (function), 0);
   91.36 +   emit_move_insn (scratch2, funexp);
   91.37 ++  if (flag_pic)
   91.38 ++    {
   91.39 ++      if (! TARGET_SHCOMPACT)
   91.40 ++	emit_move_insn (gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM),
   91.41 ++			scratch1);
   91.42 ++      else
   91.43 ++	pop (PIC_OFFSET_TABLE_REGNUM);
   91.44 ++    }
   91.45 +   funexp = gen_rtx_MEM (FUNCTION_MODE, scratch2);
   91.46 +   sibcall = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX));
   91.47 +   SIBLING_CALL_P (sibcall) = 1;
    92.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.2 +++ b/patches/gcc/3.4.6/200-all_sh-no-reorder-blocks.patch	Mon Jul 28 21:32:33 2008 +0000
    92.3 @@ -0,0 +1,14 @@
    92.4 +diff -durN gcc-3.4.6.orig/gcc/config/sh/sh.h gcc-3.4.6/gcc/config/sh/sh.h
    92.5 +--- gcc-3.4.6.orig/gcc/config/sh/sh.h	2006-01-12 02:20:32.000000000 +0100
    92.6 ++++ gcc-3.4.6/gcc/config/sh/sh.h	2007-08-15 23:03:09.000000000 +0200
    92.7 +@@ -422,6 +422,10 @@
    92.8 + do {									\
    92.9 +   if (LEVEL)								\
   92.10 +     flag_omit_frame_pointer = -1;					\
   92.11 ++  if (LEVEL <= 2)							\
   92.12 ++    {									\
   92.13 ++      flag_reorder_blocks = 0;						\
   92.14 ++    }									\
   92.15 +   if (SIZE)								\
   92.16 +     target_flags |= SPACE_BIT;						\
   92.17 +   if (TARGET_SHMEDIA && LEVEL > 1)					\
    93.1 --- a/patches/gcc/3.4.6/200-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
    93.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.3 @@ -1,3255 +0,0 @@
    93.4 -diff -durN gcc-3.4.6.orig/libstdc++-v3/acinclude.m4 gcc-3.4.6/libstdc++-v3/acinclude.m4
    93.5 ---- gcc-3.4.6.orig/libstdc++-v3/acinclude.m4	2004-10-28 23:52:41.000000000 +0200
    93.6 -+++ gcc-3.4.6/libstdc++-v3/acinclude.m4	2007-08-15 22:51:01.000000000 +0200
    93.7 -@@ -1015,7 +1015,7 @@
    93.8 -   AC_MSG_CHECKING([for C locale to use])
    93.9 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
   93.10 -     [use MODEL for target locale package],
   93.11 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
   93.12 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
   93.13 -   
   93.14 -   # If they didn't use this option switch, or if they specified --enable
   93.15 -   # with no specific model, we'll have to look for one.  If they
   93.16 -@@ -1031,6 +1031,9 @@
   93.17 -   # Default to "generic".
   93.18 -   if test $enable_clocale_flag = auto; then
   93.19 -     case x${target_os} in
   93.20 -+      x*-uclibc*)
   93.21 -+        enable_clocale_flag=uclibc
   93.22 -+        ;;
   93.23 -       xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
   93.24 -         AC_EGREP_CPP([_GLIBCXX_ok], [
   93.25 -         #include <features.h>
   93.26 -@@ -1157,6 +1160,41 @@
   93.27 -       CTIME_CC=config/locale/generic/time_members.cc
   93.28 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
   93.29 -       ;;
   93.30 -+    uclibc)
   93.31 -+      AC_MSG_RESULT(uclibc)
   93.32 -+
   93.33 -+      # Declare intention to use gettext, and add support for specific
   93.34 -+      # languages.
   93.35 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
   93.36 -+      ALL_LINGUAS="de fr"
   93.37 -+
   93.38 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
   93.39 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
   93.40 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
   93.41 -+        USE_NLS=yes
   93.42 -+      fi
   93.43 -+      # Export the build objects.
   93.44 -+      for ling in $ALL_LINGUAS; do \
   93.45 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
   93.46 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
   93.47 -+      done
   93.48 -+      AC_SUBST(glibcxx_MOFILES)
   93.49 -+      AC_SUBST(glibcxx_POFILES)
   93.50 -+
   93.51 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
   93.52 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
   93.53 -+      CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
   93.54 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
   93.55 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
   93.56 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
   93.57 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
   93.58 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
   93.59 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
   93.60 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
   93.61 -+      CTIME_H=config/locale/uclibc/time_members.h
   93.62 -+      CTIME_CC=config/locale/uclibc/time_members.cc
   93.63 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
   93.64 -+      ;;
   93.65 -   esac
   93.66 - 
   93.67 -   # This is where the testsuite looks for locale catalogs, using the
   93.68 -diff -durN gcc-3.4.6.orig/libstdc++-v3/aclocal.m4 gcc-3.4.6/libstdc++-v3/aclocal.m4
   93.69 ---- gcc-3.4.6.orig/libstdc++-v3/aclocal.m4	2004-10-28 23:52:41.000000000 +0200
   93.70 -+++ gcc-3.4.6/libstdc++-v3/aclocal.m4	2007-08-15 22:51:01.000000000 +0200
   93.71 -@@ -1044,6 +1044,9 @@
   93.72 -   # Default to "generic".
   93.73 -   if test $enable_clocale_flag = auto; then
   93.74 -     case x${target_os} in
   93.75 -+      x*-uclibc*)
   93.76 -+	enable_clocale_flag=uclibc
   93.77 -+	;;
   93.78 -       xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
   93.79 -         AC_EGREP_CPP([_GLIBCXX_ok], [
   93.80 -         #include <features.h>
   93.81 -@@ -1170,6 +1173,41 @@
   93.82 -       CTIME_CC=config/locale/generic/time_members.cc
   93.83 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
   93.84 -       ;;
   93.85 -+    uclibc)
   93.86 -+      AC_MSG_RESULT(uclibc)
   93.87 -+
   93.88 -+      # Declare intention to use gettext, and add support for specific
   93.89 -+      # languages.
   93.90 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
   93.91 -+      ALL_LINGUAS="de fr"
   93.92 -+
   93.93 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
   93.94 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
   93.95 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
   93.96 -+        USE_NLS=yes
   93.97 -+      fi
   93.98 -+      # Export the build objects.
   93.99 -+      for ling in $ALL_LINGUAS; do \
  93.100 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  93.101 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  93.102 -+      done
  93.103 -+      AC_SUBST(glibcxx_MOFILES)
  93.104 -+      AC_SUBST(glibcxx_POFILES)
  93.105 -+
  93.106 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  93.107 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  93.108 -+      CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
  93.109 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  93.110 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  93.111 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  93.112 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  93.113 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  93.114 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  93.115 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  93.116 -+      CTIME_H=config/locale/uclibc/time_members.h
  93.117 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  93.118 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  93.119 -+      ;;
  93.120 -   esac
  93.121 - 
  93.122 -   # This is where the testsuite looks for locale catalogs, using the
  93.123 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c_locale.cc
  93.124 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  93.125 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-15 22:51:01.000000000 +0200
  93.126 -@@ -0,0 +1,160 @@
  93.127 -+// Wrapper for underlying C-language localization -*- C++ -*-
  93.128 -+
  93.129 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  93.130 -+//
  93.131 -+// This file is part of the GNU ISO C++ Library.  This library is free
  93.132 -+// software; you can redistribute it and/or modify it under the
  93.133 -+// terms of the GNU General Public License as published by the
  93.134 -+// Free Software Foundation; either version 2, or (at your option)
  93.135 -+// any later version.
  93.136 -+
  93.137 -+// This library is distributed in the hope that it will be useful,
  93.138 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  93.139 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  93.140 -+// GNU General Public License for more details.
  93.141 -+
  93.142 -+// You should have received a copy of the GNU General Public License along
  93.143 -+// with this library; see the file COPYING.  If not, write to the Free
  93.144 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  93.145 -+// USA.
  93.146 -+
  93.147 -+// As a special exception, you may use this file as part of a free software
  93.148 -+// library without restriction.  Specifically, if other files instantiate
  93.149 -+// templates or use macros or inline functions from this file, or you compile
  93.150 -+// this file and link it with other files to produce an executable, this
  93.151 -+// file does not by itself cause the resulting executable to be covered by
  93.152 -+// the GNU General Public License.  This exception does not however
  93.153 -+// invalidate any other reasons why the executable file might be covered by
  93.154 -+// the GNU General Public License.
  93.155 -+
  93.156 -+//
  93.157 -+// ISO C++ 14882: 22.8  Standard locale categories.
  93.158 -+//
  93.159 -+
  93.160 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
  93.161 -+
  93.162 -+#include <cerrno>  // For errno
  93.163 -+#include <locale>
  93.164 -+#include <stdexcept>
  93.165 -+#include <langinfo.h>
  93.166 -+#include <bits/c++locale_internal.h>
  93.167 -+
  93.168 -+#ifndef __UCLIBC_HAS_XLOCALE__
  93.169 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  93.170 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  93.171 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  93.172 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  93.173 -+#define __strtof_l(S, E, L)         strtof((S), (E))
  93.174 -+#define __strtod_l(S, E, L)         strtod((S), (E))
  93.175 -+#define __strtold_l(S, E, L)        strtold((S), (E))
  93.176 -+#warning should dummy __newlocale check for C|POSIX ?
  93.177 -+#define __newlocale(a, b, c)        NULL
  93.178 -+#define __freelocale(a)             ((void)0)
  93.179 -+#define __duplocale(a)              __c_locale()
  93.180 -+#endif
  93.181 -+
  93.182 -+namespace std 
  93.183 -+{
  93.184 -+  template<>
  93.185 -+    void
  93.186 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
  93.187 -+		   const __c_locale& __cloc)
  93.188 -+    {
  93.189 -+      if (!(__err & ios_base::failbit))
  93.190 -+	{
  93.191 -+	  char* __sanity;
  93.192 -+	  errno = 0;
  93.193 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
  93.194 -+          if (__sanity != __s && errno != ERANGE)
  93.195 -+	    __v = __f;
  93.196 -+	  else
  93.197 -+	    __err |= ios_base::failbit;
  93.198 -+	}
  93.199 -+    }
  93.200 -+
  93.201 -+  template<>
  93.202 -+    void
  93.203 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  93.204 -+		   const __c_locale& __cloc)
  93.205 -+    {
  93.206 -+      if (!(__err & ios_base::failbit))
  93.207 -+	{
  93.208 -+	  char* __sanity;
  93.209 -+	  errno = 0;
  93.210 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
  93.211 -+          if (__sanity != __s && errno != ERANGE)
  93.212 -+	    __v = __d;
  93.213 -+	  else
  93.214 -+	    __err |= ios_base::failbit;
  93.215 -+	}
  93.216 -+    }
  93.217 -+
  93.218 -+  template<>
  93.219 -+    void
  93.220 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  93.221 -+		   const __c_locale& __cloc)
  93.222 -+    {
  93.223 -+      if (!(__err & ios_base::failbit))
  93.224 -+	{
  93.225 -+	  char* __sanity;
  93.226 -+	  errno = 0;
  93.227 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  93.228 -+          if (__sanity != __s && errno != ERANGE)
  93.229 -+	    __v = __ld;
  93.230 -+	  else
  93.231 -+	    __err |= ios_base::failbit;
  93.232 -+	}
  93.233 -+    }
  93.234 -+
  93.235 -+  void
  93.236 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
  93.237 -+				    __c_locale __old)
  93.238 -+  {
  93.239 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
  93.240 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.241 -+    if (!__cloc)
  93.242 -+      {
  93.243 -+	// This named locale is not supported by the underlying OS.
  93.244 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
  93.245 -+			      "name not valid"));
  93.246 -+      }
  93.247 -+#endif
  93.248 -+  }
  93.249 -+  
  93.250 -+  void
  93.251 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  93.252 -+  {
  93.253 -+    if (_S_get_c_locale() != __cloc)
  93.254 -+      __freelocale(__cloc); 
  93.255 -+  }
  93.256 -+
  93.257 -+  __c_locale
  93.258 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
  93.259 -+  { return __duplocale(__cloc); }
  93.260 -+} // namespace std
  93.261 -+
  93.262 -+namespace __gnu_cxx
  93.263 -+{
  93.264 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
  93.265 -+    {
  93.266 -+      "LC_CTYPE", 
  93.267 -+      "LC_NUMERIC",
  93.268 -+      "LC_TIME", 
  93.269 -+      "LC_COLLATE", 
  93.270 -+      "LC_MONETARY",
  93.271 -+      "LC_MESSAGES", 
  93.272 -+#if _GLIBCXX_NUM_CATEGORIES != 0
  93.273 -+      "LC_PAPER", 
  93.274 -+      "LC_NAME", 
  93.275 -+      "LC_ADDRESS",
  93.276 -+      "LC_TELEPHONE", 
  93.277 -+      "LC_MEASUREMENT", 
  93.278 -+      "LC_IDENTIFICATION" 
  93.279 -+#endif
  93.280 -+    };
  93.281 -+}
  93.282 -+
  93.283 -+namespace std
  93.284 -+{
  93.285 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
  93.286 -+}  // namespace std
  93.287 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c_locale.h
  93.288 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
  93.289 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-15 22:51:01.000000000 +0200
  93.290 -@@ -0,0 +1,115 @@
  93.291 -+// Wrapper for underlying C-language localization -*- C++ -*-
  93.292 -+
  93.293 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  93.294 -+//
  93.295 -+// This file is part of the GNU ISO C++ Library.  This library is free
  93.296 -+// software; you can redistribute it and/or modify it under the
  93.297 -+// terms of the GNU General Public License as published by the
  93.298 -+// Free Software Foundation; either version 2, or (at your option)
  93.299 -+// any later version.
  93.300 -+
  93.301 -+// This library is distributed in the hope that it will be useful,
  93.302 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  93.303 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  93.304 -+// GNU General Public License for more details.
  93.305 -+
  93.306 -+// You should have received a copy of the GNU General Public License along
  93.307 -+// with this library; see the file COPYING.  If not, write to the Free
  93.308 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  93.309 -+// USA.
  93.310 -+
  93.311 -+// As a special exception, you may use this file as part of a free software
  93.312 -+// library without restriction.  Specifically, if other files instantiate
  93.313 -+// templates or use macros or inline functions from this file, or you compile
  93.314 -+// this file and link it with other files to produce an executable, this
  93.315 -+// file does not by itself cause the resulting executable to be covered by
  93.316 -+// the GNU General Public License.  This exception does not however
  93.317 -+// invalidate any other reasons why the executable file might be covered by
  93.318 -+// the GNU General Public License.
  93.319 -+
  93.320 -+//
  93.321 -+// ISO C++ 14882: 22.8  Standard locale categories.
  93.322 -+//
  93.323 -+
  93.324 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
  93.325 -+
  93.326 -+#ifndef _C_LOCALE_H
  93.327 -+#define _C_LOCALE_H 1
  93.328 -+
  93.329 -+#pragma GCC system_header
  93.330 -+
  93.331 -+#include <cstring>              // get std::strlen
  93.332 -+#include <cstdio>               // get std::snprintf or std::sprintf
  93.333 -+#include <clocale>
  93.334 -+#include <langinfo.h>		// For codecvt
  93.335 -+#ifdef __UCLIBC_MJN3_ONLY__
  93.336 -+#warning fix this
  93.337 -+#endif
  93.338 -+#ifdef __UCLIBC_HAS_LOCALE__
  93.339 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
  93.340 -+#endif
  93.341 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  93.342 -+#include <libintl.h> 		// For messages
  93.343 -+#endif
  93.344 -+
  93.345 -+#ifdef __UCLIBC_MJN3_ONLY__
  93.346 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
  93.347 -+#endif
  93.348 -+#define _GLIBCXX_C_LOCALE_GNU 1
  93.349 -+
  93.350 -+#ifdef __UCLIBC_MJN3_ONLY__
  93.351 -+#warning fix categories
  93.352 -+#endif
  93.353 -+// #define _GLIBCXX_NUM_CATEGORIES 6
  93.354 -+#define _GLIBCXX_NUM_CATEGORIES 0
  93.355 -+ 
  93.356 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.357 -+namespace __gnu_cxx
  93.358 -+{
  93.359 -+  extern "C" __typeof(uselocale) __uselocale;
  93.360 -+}
  93.361 -+#endif
  93.362 -+
  93.363 -+namespace std
  93.364 -+{
  93.365 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.366 -+  typedef __locale_t		__c_locale;
  93.367 -+#else
  93.368 -+  typedef int*			__c_locale;
  93.369 -+#endif
  93.370 -+
  93.371 -+  // Convert numeric value of type _Tv to string and return length of
  93.372 -+  // string.  If snprintf is available use it, otherwise fall back to
  93.373 -+  // the unsafe sprintf which, in general, can be dangerous and should
  93.374 -+  // be avoided.
  93.375 -+  template<typename _Tv>
  93.376 -+    int
  93.377 -+    __convert_from_v(char* __out, const int __size, const char* __fmt,
  93.378 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.379 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
  93.380 -+    {
  93.381 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
  93.382 -+#else
  93.383 -+		     _Tv __v, const __c_locale&, int __prec)
  93.384 -+    {
  93.385 -+# ifdef __UCLIBC_HAS_LOCALE__
  93.386 -+      char* __old = std::setlocale(LC_ALL, NULL);
  93.387 -+      char* __sav = new char[std::strlen(__old) + 1];
  93.388 -+      std::strcpy(__sav, __old);
  93.389 -+      std::setlocale(LC_ALL, "C");
  93.390 -+# endif
  93.391 -+#endif
  93.392 -+
  93.393 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
  93.394 -+
  93.395 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.396 -+      __gnu_cxx::__uselocale(__old);
  93.397 -+#elif defined __UCLIBC_HAS_LOCALE__
  93.398 -+      std::setlocale(LC_ALL, __sav);
  93.399 -+      delete [] __sav;
  93.400 -+#endif
  93.401 -+      return __ret;
  93.402 -+    }
  93.403 -+}
  93.404 -+
  93.405 -+#endif
  93.406 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  93.407 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
  93.408 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-15 22:51:01.000000000 +0200
  93.409 -@@ -0,0 +1,59 @@
  93.410 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  93.411 -+
  93.412 -+// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
  93.413 -+//
  93.414 -+// This file is part of the GNU ISO C++ Library.  This library is free
  93.415 -+// software; you can redistribute it and/or modify it under the
  93.416 -+// terms of the GNU General Public License as published by the
  93.417 -+// Free Software Foundation; either version 2, or (at your option)
  93.418 -+// any later version.
  93.419 -+
  93.420 -+// This library is distributed in the hope that it will be useful,
  93.421 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  93.422 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  93.423 -+// GNU General Public License for more details.
  93.424 -+
  93.425 -+// You should have received a copy of the GNU General Public License along
  93.426 -+// with this library; see the file COPYING.  If not, write to the Free
  93.427 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  93.428 -+// USA.
  93.429 -+
  93.430 -+// As a special exception, you may use this file as part of a free software
  93.431 -+// library without restriction.  Specifically, if other files instantiate
  93.432 -+// templates or use macros or inline functions from this file, or you compile
  93.433 -+// this file and link it with other files to produce an executable, this
  93.434 -+// file does not by itself cause the resulting executable to be covered by
  93.435 -+// the GNU General Public License.  This exception does not however
  93.436 -+// invalidate any other reasons why the executable file might be covered by
  93.437 -+// the GNU General Public License.
  93.438 -+
  93.439 -+// Written by Jakub Jelinek <jakub@redhat.com>
  93.440 -+
  93.441 -+#include <clocale>
  93.442 -+
  93.443 -+#ifdef __UCLIBC_MJN3_ONLY__
  93.444 -+#warning clean this up
  93.445 -+#endif
  93.446 -+
  93.447 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.448 -+                                                  
  93.449 -+extern "C" __typeof(iswctype_l) __iswctype_l;
  93.450 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
  93.451 -+extern "C" __typeof(strcoll_l) __strcoll_l;
  93.452 -+extern "C" __typeof(strftime_l) __strftime_l;
  93.453 -+extern "C" __typeof(strtod_l) __strtod_l;
  93.454 -+extern "C" __typeof(strtof_l) __strtof_l;
  93.455 -+extern "C" __typeof(strtold_l) __strtold_l;
  93.456 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
  93.457 -+extern "C" __typeof(towlower_l) __towlower_l;
  93.458 -+extern "C" __typeof(towupper_l) __towupper_l;
  93.459 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
  93.460 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
  93.461 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
  93.462 -+extern "C" __typeof(wctype_l) __wctype_l;
  93.463 -+extern "C" __typeof(newlocale) __newlocale;
  93.464 -+extern "C" __typeof(freelocale) __freelocale;
  93.465 -+extern "C" __typeof(duplocale) __duplocale;
  93.466 -+extern "C" __typeof(uselocale) __uselocale;
  93.467 -+
  93.468 -+#endif // GLIBC 2.3 and later
  93.469 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
  93.470 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
  93.471 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-08-15 22:51:01.000000000 +0200
  93.472 -@@ -0,0 +1,306 @@
  93.473 -+// std::codecvt implementation details, GNU version -*- C++ -*-
  93.474 -+
  93.475 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
  93.476 -+//
  93.477 -+// This file is part of the GNU ISO C++ Library.  This library is free
  93.478 -+// software; you can redistribute it and/or modify it under the
  93.479 -+// terms of the GNU General Public License as published by the
  93.480 -+// Free Software Foundation; either version 2, or (at your option)
  93.481 -+// any later version.
  93.482 -+
  93.483 -+// This library is distributed in the hope that it will be useful,
  93.484 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  93.485 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  93.486 -+// GNU General Public License for more details.
  93.487 -+
  93.488 -+// You should have received a copy of the GNU General Public License along
  93.489 -+// with this library; see the file COPYING.  If not, write to the Free
  93.490 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  93.491 -+// USA.
  93.492 -+
  93.493 -+// As a special exception, you may use this file as part of a free software
  93.494 -+// library without restriction.  Specifically, if other files instantiate
  93.495 -+// templates or use macros or inline functions from this file, or you compile
  93.496 -+// this file and link it with other files to produce an executable, this
  93.497 -+// file does not by itself cause the resulting executable to be covered by
  93.498 -+// the GNU General Public License.  This exception does not however
  93.499 -+// invalidate any other reasons why the executable file might be covered by
  93.500 -+// the GNU General Public License.
  93.501 -+
  93.502 -+//
  93.503 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
  93.504 -+//
  93.505 -+
  93.506 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
  93.507 -+
  93.508 -+#include <locale>
  93.509 -+#include <bits/c++locale_internal.h>
  93.510 -+
  93.511 -+namespace std
  93.512 -+{
  93.513 -+  // Specializations.
  93.514 -+#ifdef _GLIBCXX_USE_WCHAR_T
  93.515 -+  codecvt_base::result
  93.516 -+  codecvt<wchar_t, char, mbstate_t>::
  93.517 -+  do_out(state_type& __state, const intern_type* __from, 
  93.518 -+	 const intern_type* __from_end, const intern_type*& __from_next,
  93.519 -+	 extern_type* __to, extern_type* __to_end,
  93.520 -+	 extern_type*& __to_next) const
  93.521 -+  {
  93.522 -+    result __ret = ok;
  93.523 -+    state_type __tmp_state(__state);
  93.524 -+
  93.525 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.526 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  93.527 -+#endif
  93.528 -+
  93.529 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
  93.530 -+    // in case we fall back to wcrtomb and then continue, in a loop.
  93.531 -+    // NB: wcsnrtombs is a GNU extension
  93.532 -+    for (__from_next = __from, __to_next = __to;
  93.533 -+	 __from_next < __from_end && __to_next < __to_end
  93.534 -+	 && __ret == ok;)
  93.535 -+      {
  93.536 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
  93.537 -+						      __from_end - __from_next);
  93.538 -+	if (!__from_chunk_end)
  93.539 -+	  __from_chunk_end = __from_end;
  93.540 -+
  93.541 -+	__from = __from_next;
  93.542 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
  93.543 -+					 __from_chunk_end - __from_next,
  93.544 -+					 __to_end - __to_next, &__state);
  93.545 -+	if (__conv == static_cast<size_t>(-1))
  93.546 -+	  {
  93.547 -+	    // In case of error, in order to stop at the exact place we
  93.548 -+	    // have to start again from the beginning with a series of
  93.549 -+	    // wcrtomb.
  93.550 -+	    for (; __from < __from_next; ++__from)
  93.551 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
  93.552 -+	    __state = __tmp_state;
  93.553 -+	    __ret = error;
  93.554 -+	  }
  93.555 -+	else if (__from_next && __from_next < __from_chunk_end)
  93.556 -+	  {
  93.557 -+	    __to_next += __conv;
  93.558 -+	    __ret = partial;
  93.559 -+	  }
  93.560 -+	else
  93.561 -+	  {
  93.562 -+	    __from_next = __from_chunk_end;
  93.563 -+	    __to_next += __conv;
  93.564 -+	  }
  93.565 -+
  93.566 -+	if (__from_next < __from_end && __ret == ok)
  93.567 -+	  {
  93.568 -+	    extern_type __buf[MB_LEN_MAX];
  93.569 -+	    __tmp_state = __state;
  93.570 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
  93.571 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
  93.572 -+	      __ret = partial;
  93.573 -+	    else
  93.574 -+	      {
  93.575 -+		memcpy(__to_next, __buf, __conv);
  93.576 -+		__state = __tmp_state;
  93.577 -+		__to_next += __conv;
  93.578 -+		++__from_next;
  93.579 -+	      }
  93.580 -+	  }
  93.581 -+      }
  93.582 -+
  93.583 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.584 -+    __uselocale(__old);
  93.585 -+#endif
  93.586 -+
  93.587 -+    return __ret; 
  93.588 -+  }
  93.589 -+  
  93.590 -+  codecvt_base::result
  93.591 -+  codecvt<wchar_t, char, mbstate_t>::
  93.592 -+  do_in(state_type& __state, const extern_type* __from, 
  93.593 -+	const extern_type* __from_end, const extern_type*& __from_next,
  93.594 -+	intern_type* __to, intern_type* __to_end,
  93.595 -+	intern_type*& __to_next) const
  93.596 -+  {
  93.597 -+    result __ret = ok;
  93.598 -+    state_type __tmp_state(__state);
  93.599 -+
  93.600 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.601 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  93.602 -+#endif
  93.603 -+
  93.604 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
  93.605 -+    // in case we store a L'\0' and then continue, in a loop.
  93.606 -+    // NB: mbsnrtowcs is a GNU extension
  93.607 -+    for (__from_next = __from, __to_next = __to;
  93.608 -+	 __from_next < __from_end && __to_next < __to_end
  93.609 -+	 && __ret == ok;)
  93.610 -+      {
  93.611 -+	const extern_type* __from_chunk_end;
  93.612 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
  93.613 -+								  __from_end
  93.614 -+								  - __from_next));
  93.615 -+	if (!__from_chunk_end)
  93.616 -+	  __from_chunk_end = __from_end;
  93.617 -+
  93.618 -+	__from = __from_next;
  93.619 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
  93.620 -+				   __from_chunk_end - __from_next,
  93.621 -+				   __to_end - __to_next, &__state);
  93.622 -+	if (__conv == static_cast<size_t>(-1))
  93.623 -+	  {
  93.624 -+	    // In case of error, in order to stop at the exact place we
  93.625 -+	    // have to start again from the beginning with a series of
  93.626 -+	    // mbrtowc.
  93.627 -+	    for (;; ++__to_next, __from += __conv)
  93.628 -+	      {
  93.629 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
  93.630 -+				 &__tmp_state);
  93.631 -+		if (__conv == static_cast<size_t>(-1)
  93.632 -+		    || __conv == static_cast<size_t>(-2))
  93.633 -+		  break;
  93.634 -+	      }
  93.635 -+	    __from_next = __from;
  93.636 -+	    __state = __tmp_state;	    
  93.637 -+	    __ret = error;
  93.638 -+	  }
  93.639 -+	else if (__from_next && __from_next < __from_chunk_end)
  93.640 -+	  {
  93.641 -+	    // It is unclear what to return in this case (see DR 382). 
  93.642 -+	    __to_next += __conv;
  93.643 -+	    __ret = partial;
  93.644 -+	  }
  93.645 -+	else
  93.646 -+	  {
  93.647 -+	    __from_next = __from_chunk_end;
  93.648 -+	    __to_next += __conv;
  93.649 -+	  }
  93.650 -+
  93.651 -+	if (__from_next < __from_end && __ret == ok)
  93.652 -+	  {
  93.653 -+	    if (__to_next < __to_end)
  93.654 -+	      {
  93.655 -+		// XXX Probably wrong for stateful encodings
  93.656 -+		__tmp_state = __state;		
  93.657 -+		++__from_next;
  93.658 -+		*__to_next++ = L'\0';
  93.659 -+	      }
  93.660 -+	    else
  93.661 -+	      __ret = partial;
  93.662 -+	  }
  93.663 -+      }
  93.664 -+
  93.665 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.666 -+    __uselocale(__old);
  93.667 -+#endif
  93.668 -+
  93.669 -+    return __ret; 
  93.670 -+  }
  93.671 -+
  93.672 -+  int 
  93.673 -+  codecvt<wchar_t, char, mbstate_t>::
  93.674 -+  do_encoding() const throw()
  93.675 -+  {
  93.676 -+    // XXX This implementation assumes that the encoding is
  93.677 -+    // stateless and is either single-byte or variable-width.
  93.678 -+    int __ret = 0;
  93.679 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.680 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  93.681 -+#endif
  93.682 -+    if (MB_CUR_MAX == 1)
  93.683 -+      __ret = 1;
  93.684 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.685 -+    __uselocale(__old);
  93.686 -+#endif
  93.687 -+    return __ret;
  93.688 -+  }  
  93.689 -+
  93.690 -+  int 
  93.691 -+  codecvt<wchar_t, char, mbstate_t>::
  93.692 -+  do_max_length() const throw()
  93.693 -+  {
  93.694 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.695 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  93.696 -+#endif
  93.697 -+    // XXX Probably wrong for stateful encodings.
  93.698 -+    int __ret = MB_CUR_MAX;
  93.699 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.700 -+    __uselocale(__old);
  93.701 -+#endif
  93.702 -+    return __ret;
  93.703 -+  }
  93.704 -+  
  93.705 -+  int 
  93.706 -+  codecvt<wchar_t, char, mbstate_t>::
  93.707 -+  do_length(state_type& __state, const extern_type* __from,
  93.708 -+	    const extern_type* __end, size_t __max) const
  93.709 -+  {
  93.710 -+    int __ret = 0;
  93.711 -+    state_type __tmp_state(__state);
  93.712 -+
  93.713 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.714 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  93.715 -+#endif
  93.716 -+
  93.717 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
  93.718 -+    // in case we advance past it and then continue, in a loop.
  93.719 -+    // NB: mbsnrtowcs is a GNU extension
  93.720 -+  
  93.721 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
  93.722 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
  93.723 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
  93.724 -+							   * __max));
  93.725 -+    while (__from < __end && __max)
  93.726 -+      {
  93.727 -+	const extern_type* __from_chunk_end;
  93.728 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
  93.729 -+								  __end
  93.730 -+								  - __from));
  93.731 -+	if (!__from_chunk_end)
  93.732 -+	  __from_chunk_end = __end;
  93.733 -+
  93.734 -+	const extern_type* __tmp_from = __from;
  93.735 -+	size_t __conv = mbsnrtowcs(__to, &__from,
  93.736 -+				   __from_chunk_end - __from,
  93.737 -+				   __max, &__state);
  93.738 -+	if (__conv == static_cast<size_t>(-1))
  93.739 -+	  {
  93.740 -+	    // In case of error, in order to stop at the exact place we
  93.741 -+	    // have to start again from the beginning with a series of
  93.742 -+	    // mbrtowc.
  93.743 -+	    for (__from = __tmp_from;; __from += __conv)
  93.744 -+	      {
  93.745 -+		__conv = mbrtowc(NULL, __from, __end - __from,
  93.746 -+				 &__tmp_state);
  93.747 -+		if (__conv == static_cast<size_t>(-1)
  93.748 -+		    || __conv == static_cast<size_t>(-2))
  93.749 -+		  break;
  93.750 -+	      }
  93.751 -+	    __state = __tmp_state;
  93.752 -+	    __ret += __from - __tmp_from;
  93.753 -+	    break;
  93.754 -+	  }
  93.755 -+	if (!__from)
  93.756 -+	  __from = __from_chunk_end;
  93.757 -+	
  93.758 -+	__ret += __from - __tmp_from;
  93.759 -+	__max -= __conv;
  93.760 -+
  93.761 -+	if (__from < __end && __max)
  93.762 -+	  {
  93.763 -+	    // XXX Probably wrong for stateful encodings
  93.764 -+	    __tmp_state = __state;
  93.765 -+	    ++__from;
  93.766 -+	    ++__ret;
  93.767 -+	    --__max;
  93.768 -+	  }
  93.769 -+      }
  93.770 -+
  93.771 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.772 -+    __uselocale(__old);
  93.773 -+#endif
  93.774 -+
  93.775 -+    return __ret; 
  93.776 -+  }
  93.777 -+#endif
  93.778 -+}
  93.779 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/collate_members.cc
  93.780 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
  93.781 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-15 22:51:01.000000000 +0200
  93.782 -@@ -0,0 +1,80 @@
  93.783 -+// std::collate implementation details, GNU version -*- C++ -*-
  93.784 -+
  93.785 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
  93.786 -+//
  93.787 -+// This file is part of the GNU ISO C++ Library.  This library is free
  93.788 -+// software; you can redistribute it and/or modify it under the
  93.789 -+// terms of the GNU General Public License as published by the
  93.790 -+// Free Software Foundation; either version 2, or (at your option)
  93.791 -+// any later version.
  93.792 -+
  93.793 -+// This library is distributed in the hope that it will be useful,
  93.794 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  93.795 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  93.796 -+// GNU General Public License for more details.
  93.797 -+
  93.798 -+// You should have received a copy of the GNU General Public License along
  93.799 -+// with this library; see the file COPYING.  If not, write to the Free
  93.800 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  93.801 -+// USA.
  93.802 -+
  93.803 -+// As a special exception, you may use this file as part of a free software
  93.804 -+// library without restriction.  Specifically, if other files instantiate
  93.805 -+// templates or use macros or inline functions from this file, or you compile
  93.806 -+// this file and link it with other files to produce an executable, this
  93.807 -+// file does not by itself cause the resulting executable to be covered by
  93.808 -+// the GNU General Public License.  This exception does not however
  93.809 -+// invalidate any other reasons why the executable file might be covered by
  93.810 -+// the GNU General Public License.
  93.811 -+
  93.812 -+//
  93.813 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
  93.814 -+//
  93.815 -+
  93.816 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
  93.817 -+
  93.818 -+#include <locale>
  93.819 -+#include <bits/c++locale_internal.h>
  93.820 -+
  93.821 -+#ifndef __UCLIBC_HAS_XLOCALE__
  93.822 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  93.823 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  93.824 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  93.825 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  93.826 -+#endif
  93.827 -+
  93.828 -+namespace std
  93.829 -+{
  93.830 -+  // These are basically extensions to char_traits, and perhaps should
  93.831 -+  // be put there instead of here.
  93.832 -+  template<>
  93.833 -+    int 
  93.834 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
  93.835 -+    { 
  93.836 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
  93.837 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
  93.838 -+    }
  93.839 -+  
  93.840 -+  template<>
  93.841 -+    size_t
  93.842 -+    collate<char>::_M_transform(char* __to, const char* __from, 
  93.843 -+				size_t __n) const 
  93.844 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
  93.845 -+
  93.846 -+#ifdef _GLIBCXX_USE_WCHAR_T
  93.847 -+  template<>
  93.848 -+    int 
  93.849 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
  93.850 -+				 const wchar_t* __two) const
  93.851 -+    {
  93.852 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
  93.853 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
  93.854 -+    }
  93.855 -+  
  93.856 -+  template<>
  93.857 -+    size_t
  93.858 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
  93.859 -+				   size_t __n) const
  93.860 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
  93.861 -+#endif
  93.862 -+}
  93.863 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/ctype_members.cc
  93.864 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
  93.865 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-15 22:51:01.000000000 +0200
  93.866 -@@ -0,0 +1,300 @@
  93.867 -+// std::ctype implementation details, GNU version -*- C++ -*-
  93.868 -+
  93.869 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  93.870 -+//
  93.871 -+// This file is part of the GNU ISO C++ Library.  This library is free
  93.872 -+// software; you can redistribute it and/or modify it under the
  93.873 -+// terms of the GNU General Public License as published by the
  93.874 -+// Free Software Foundation; either version 2, or (at your option)
  93.875 -+// any later version.
  93.876 -+
  93.877 -+// This library is distributed in the hope that it will be useful,
  93.878 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  93.879 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  93.880 -+// GNU General Public License for more details.
  93.881 -+
  93.882 -+// You should have received a copy of the GNU General Public License along
  93.883 -+// with this library; see the file COPYING.  If not, write to the Free
  93.884 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  93.885 -+// USA.
  93.886 -+
  93.887 -+// As a special exception, you may use this file as part of a free software
  93.888 -+// library without restriction.  Specifically, if other files instantiate
  93.889 -+// templates or use macros or inline functions from this file, or you compile
  93.890 -+// this file and link it with other files to produce an executable, this
  93.891 -+// file does not by itself cause the resulting executable to be covered by
  93.892 -+// the GNU General Public License.  This exception does not however
  93.893 -+// invalidate any other reasons why the executable file might be covered by
  93.894 -+// the GNU General Public License.
  93.895 -+
  93.896 -+//
  93.897 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
  93.898 -+//
  93.899 -+
  93.900 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
  93.901 -+
  93.902 -+#define _LIBC
  93.903 -+#include <locale>
  93.904 -+#undef _LIBC
  93.905 -+#include <bits/c++locale_internal.h>
  93.906 -+
  93.907 -+#ifndef __UCLIBC_HAS_XLOCALE__
  93.908 -+#define __wctype_l(S, L)           wctype((S))
  93.909 -+#define __towupper_l(C, L)         towupper((C))
  93.910 -+#define __towlower_l(C, L)         towlower((C))
  93.911 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
  93.912 -+#endif
  93.913 -+
  93.914 -+namespace std
  93.915 -+{
  93.916 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
  93.917 -+  // various /config/os/* files.
  93.918 -+  template<>
  93.919 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
  93.920 -+    : ctype<char>(0, false, __refs) 
  93.921 -+    { 		
  93.922 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
  93.923 -+	{
  93.924 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
  93.925 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
  93.926 -+#ifdef __UCLIBC_HAS_XLOCALE__
  93.927 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
  93.928 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
  93.929 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
  93.930 -+#endif
  93.931 -+	}
  93.932 -+    }
  93.933 -+
  93.934 -+#ifdef _GLIBCXX_USE_WCHAR_T  
  93.935 -+  ctype<wchar_t>::__wmask_type
  93.936 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
  93.937 -+  {
  93.938 -+    __wmask_type __ret;
  93.939 -+    switch (__m)
  93.940 -+      {
  93.941 -+      case space:
  93.942 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
  93.943 -+	break;
  93.944 -+      case print:
  93.945 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
  93.946 -+	break;
  93.947 -+      case cntrl:
  93.948 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
  93.949 -+	break;
  93.950 -+      case upper:
  93.951 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
  93.952 -+	break;
  93.953 -+      case lower:
  93.954 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
  93.955 -+	break;
  93.956 -+      case alpha:
  93.957 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
  93.958 -+	break;
  93.959 -+      case digit:
  93.960 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
  93.961 -+	break;
  93.962 -+      case punct:
  93.963 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
  93.964 -+	break;
  93.965 -+      case xdigit:
  93.966 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
  93.967 -+	break;
  93.968 -+      case alnum:
  93.969 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
  93.970 -+	break;
  93.971 -+      case graph:
  93.972 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
  93.973 -+	break;
  93.974 -+      default:
  93.975 -+	__ret = 0;
  93.976 -+      }
  93.977 -+    return __ret;
  93.978 -+  }
  93.979 -+  
  93.980 -+  wchar_t
  93.981 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
  93.982 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
  93.983 -+
  93.984 -+  const wchar_t*
  93.985 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
  93.986 -+  {
  93.987 -+    while (__lo < __hi)
  93.988 -+      {
  93.989 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
  93.990 -+        ++__lo;
  93.991 -+      }
  93.992 -+    return __hi;
  93.993 -+  }
  93.994 -+  
  93.995 -+  wchar_t
  93.996 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
  93.997 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
  93.998 -+  
  93.999 -+  const wchar_t*
 93.1000 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 93.1001 -+  {
 93.1002 -+    while (__lo < __hi)
 93.1003 -+      {
 93.1004 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 93.1005 -+        ++__lo;
 93.1006 -+      }
 93.1007 -+    return __hi;
 93.1008 -+  }
 93.1009 -+
 93.1010 -+  bool
 93.1011 -+  ctype<wchar_t>::
 93.1012 -+  do_is(mask __m, wchar_t __c) const
 93.1013 -+  { 
 93.1014 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
 93.1015 -+    // library for blank.
 93.1016 -+    bool __ret = false;
 93.1017 -+    const size_t __bitmasksize = 11; 
 93.1018 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 93.1019 -+      if (__m & _M_bit[__bitcur]
 93.1020 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 93.1021 -+	{
 93.1022 -+	  __ret = true;
 93.1023 -+	  break;
 93.1024 -+	}
 93.1025 -+    return __ret;    
 93.1026 -+  }
 93.1027 -+  
 93.1028 -+  const wchar_t* 
 93.1029 -+  ctype<wchar_t>::
 93.1030 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 93.1031 -+  {
 93.1032 -+    for (; __lo < __hi; ++__vec, ++__lo)
 93.1033 -+      {
 93.1034 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 93.1035 -+	// library for blank.
 93.1036 -+	const size_t __bitmasksize = 11; 
 93.1037 -+	mask __m = 0;
 93.1038 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 93.1039 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 93.1040 -+	    __m |= _M_bit[__bitcur];
 93.1041 -+	*__vec = __m;
 93.1042 -+      }
 93.1043 -+    return __hi;
 93.1044 -+  }
 93.1045 -+  
 93.1046 -+  const wchar_t* 
 93.1047 -+  ctype<wchar_t>::
 93.1048 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 93.1049 -+  {
 93.1050 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
 93.1051 -+      ++__lo;
 93.1052 -+    return __lo;
 93.1053 -+  }
 93.1054 -+
 93.1055 -+  const wchar_t*
 93.1056 -+  ctype<wchar_t>::
 93.1057 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
 93.1058 -+  {
 93.1059 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
 93.1060 -+      ++__lo;
 93.1061 -+    return __lo;
 93.1062 -+  }
 93.1063 -+
 93.1064 -+  wchar_t
 93.1065 -+  ctype<wchar_t>::
 93.1066 -+  do_widen(char __c) const
 93.1067 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
 93.1068 -+
 93.1069 -+  const char* 
 93.1070 -+  ctype<wchar_t>::
 93.1071 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
 93.1072 -+  {
 93.1073 -+    while (__lo < __hi)
 93.1074 -+      {
 93.1075 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
 93.1076 -+	++__lo;
 93.1077 -+	++__dest;
 93.1078 -+      }
 93.1079 -+    return __hi;
 93.1080 -+  }
 93.1081 -+
 93.1082 -+  char
 93.1083 -+  ctype<wchar_t>::
 93.1084 -+  do_narrow(wchar_t __wc, char __dfault) const
 93.1085 -+  {
 93.1086 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
 93.1087 -+      return _M_narrow[__wc];
 93.1088 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1089 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
 93.1090 -+#endif
 93.1091 -+    const int __c = wctob(__wc);
 93.1092 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1093 -+    __uselocale(__old);
 93.1094 -+#endif
 93.1095 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
 93.1096 -+  }
 93.1097 -+
 93.1098 -+  const wchar_t*
 93.1099 -+  ctype<wchar_t>::
 93.1100 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
 93.1101 -+	    char* __dest) const
 93.1102 -+  {
 93.1103 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1104 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
 93.1105 -+#endif
 93.1106 -+    if (_M_narrow_ok)
 93.1107 -+      while (__lo < __hi)
 93.1108 -+	{
 93.1109 -+	  if (*__lo >= 0 && *__lo < 128)
 93.1110 -+	    *__dest = _M_narrow[*__lo];
 93.1111 -+	  else
 93.1112 -+	    {
 93.1113 -+	      const int __c = wctob(*__lo);
 93.1114 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
 93.1115 -+	    }
 93.1116 -+	  ++__lo;
 93.1117 -+	  ++__dest;
 93.1118 -+	}
 93.1119 -+    else
 93.1120 -+      while (__lo < __hi)
 93.1121 -+	{
 93.1122 -+	  const int __c = wctob(*__lo);
 93.1123 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
 93.1124 -+	  ++__lo;
 93.1125 -+	  ++__dest;
 93.1126 -+	}
 93.1127 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1128 -+    __uselocale(__old);
 93.1129 -+#endif
 93.1130 -+    return __hi;
 93.1131 -+  }
 93.1132 -+
 93.1133 -+  void
 93.1134 -+  ctype<wchar_t>::_M_initialize_ctype()
 93.1135 -+  {
 93.1136 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1137 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
 93.1138 -+#endif
 93.1139 -+    wint_t __i;
 93.1140 -+    for (__i = 0; __i < 128; ++__i)
 93.1141 -+      {
 93.1142 -+	const int __c = wctob(__i);
 93.1143 -+	if (__c == EOF)
 93.1144 -+	  break;
 93.1145 -+	else
 93.1146 -+	  _M_narrow[__i] = static_cast<char>(__c);
 93.1147 -+      }
 93.1148 -+    if (__i == 128)
 93.1149 -+      _M_narrow_ok = true;
 93.1150 -+    else
 93.1151 -+      _M_narrow_ok = false;
 93.1152 -+    for (size_t __j = 0;
 93.1153 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
 93.1154 -+      _M_widen[__j] = btowc(__j);
 93.1155 -+
 93.1156 -+    for (size_t __k = 0; __k <= 11; ++__k)
 93.1157 -+      { 
 93.1158 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
 93.1159 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
 93.1160 -+      }
 93.1161 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1162 -+    __uselocale(__old);
 93.1163 -+#endif
 93.1164 -+  }
 93.1165 -+#endif //  _GLIBCXX_USE_WCHAR_T
 93.1166 -+}
 93.1167 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/messages_members.cc
 93.1168 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
 93.1169 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-15 22:51:01.000000000 +0200
 93.1170 -@@ -0,0 +1,100 @@
 93.1171 -+// std::messages implementation details, GNU version -*- C++ -*-
 93.1172 -+
 93.1173 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 93.1174 -+//
 93.1175 -+// This file is part of the GNU ISO C++ Library.  This library is free
 93.1176 -+// software; you can redistribute it and/or modify it under the
 93.1177 -+// terms of the GNU General Public License as published by the
 93.1178 -+// Free Software Foundation; either version 2, or (at your option)
 93.1179 -+// any later version.
 93.1180 -+
 93.1181 -+// This library is distributed in the hope that it will be useful,
 93.1182 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 93.1183 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 93.1184 -+// GNU General Public License for more details.
 93.1185 -+
 93.1186 -+// You should have received a copy of the GNU General Public License along
 93.1187 -+// with this library; see the file COPYING.  If not, write to the Free
 93.1188 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 93.1189 -+// USA.
 93.1190 -+
 93.1191 -+// As a special exception, you may use this file as part of a free software
 93.1192 -+// library without restriction.  Specifically, if other files instantiate
 93.1193 -+// templates or use macros or inline functions from this file, or you compile
 93.1194 -+// this file and link it with other files to produce an executable, this
 93.1195 -+// file does not by itself cause the resulting executable to be covered by
 93.1196 -+// the GNU General Public License.  This exception does not however
 93.1197 -+// invalidate any other reasons why the executable file might be covered by
 93.1198 -+// the GNU General Public License.
 93.1199 -+
 93.1200 -+//
 93.1201 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
 93.1202 -+//
 93.1203 -+
 93.1204 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 93.1205 -+
 93.1206 -+#include <locale>
 93.1207 -+#include <bits/c++locale_internal.h>
 93.1208 -+
 93.1209 -+#ifdef __UCLIBC_MJN3_ONLY__
 93.1210 -+#warning fix gettext stuff
 93.1211 -+#endif
 93.1212 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 93.1213 -+extern "C" char *__dcgettext(const char *domainname,
 93.1214 -+			     const char *msgid, int category);
 93.1215 -+#undef gettext
 93.1216 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 93.1217 -+#else
 93.1218 -+#undef gettext
 93.1219 -+#define gettext(msgid) (msgid)
 93.1220 -+#endif
 93.1221 -+
 93.1222 -+namespace std
 93.1223 -+{
 93.1224 -+  // Specializations.
 93.1225 -+  template<>
 93.1226 -+    string
 93.1227 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
 93.1228 -+    {
 93.1229 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1230 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
 93.1231 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
 93.1232 -+      __uselocale(__old);
 93.1233 -+      return string(__msg);
 93.1234 -+#elif defined __UCLIBC_HAS_LOCALE__
 93.1235 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
 93.1236 -+      setlocale(LC_ALL, _M_name_messages);
 93.1237 -+      const char* __msg = gettext(__dfault.c_str());
 93.1238 -+      setlocale(LC_ALL, __old);
 93.1239 -+      free(__old);
 93.1240 -+      return string(__msg);
 93.1241 -+#else
 93.1242 -+      const char* __msg = gettext(__dfault.c_str());
 93.1243 -+      return string(__msg);
 93.1244 -+#endif
 93.1245 -+    }
 93.1246 -+
 93.1247 -+#ifdef _GLIBCXX_USE_WCHAR_T
 93.1248 -+  template<>
 93.1249 -+    wstring
 93.1250 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
 93.1251 -+    {
 93.1252 -+# ifdef __UCLIBC_HAS_XLOCALE__
 93.1253 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
 93.1254 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
 93.1255 -+      __uselocale(__old);
 93.1256 -+      return _M_convert_from_char(__msg);
 93.1257 -+# elif defined __UCLIBC_HAS_LOCALE__
 93.1258 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
 93.1259 -+      setlocale(LC_ALL, _M_name_messages);
 93.1260 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
 93.1261 -+      setlocale(LC_ALL, __old);
 93.1262 -+      free(__old);
 93.1263 -+      return _M_convert_from_char(__msg);
 93.1264 -+# else
 93.1265 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
 93.1266 -+      return _M_convert_from_char(__msg);
 93.1267 -+# endif
 93.1268 -+    }
 93.1269 -+#endif
 93.1270 -+}
 93.1271 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.4.6/libstdc++-v3/config/locale/uclibc/messages_members.h
 93.1272 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
 93.1273 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-15 22:51:01.000000000 +0200
 93.1274 -@@ -0,0 +1,118 @@
 93.1275 -+// std::messages implementation details, GNU version -*- C++ -*-
 93.1276 -+
 93.1277 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 93.1278 -+//
 93.1279 -+// This file is part of the GNU ISO C++ Library.  This library is free
 93.1280 -+// software; you can redistribute it and/or modify it under the
 93.1281 -+// terms of the GNU General Public License as published by the
 93.1282 -+// Free Software Foundation; either version 2, or (at your option)
 93.1283 -+// any later version.
 93.1284 -+
 93.1285 -+// This library is distributed in the hope that it will be useful,
 93.1286 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 93.1287 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 93.1288 -+// GNU General Public License for more details.
 93.1289 -+
 93.1290 -+// You should have received a copy of the GNU General Public License along
 93.1291 -+// with this library; see the file COPYING.  If not, write to the Free
 93.1292 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 93.1293 -+// USA.
 93.1294 -+
 93.1295 -+// As a special exception, you may use this file as part of a free software
 93.1296 -+// library without restriction.  Specifically, if other files instantiate
 93.1297 -+// templates or use macros or inline functions from this file, or you compile
 93.1298 -+// this file and link it with other files to produce an executable, this
 93.1299 -+// file does not by itself cause the resulting executable to be covered by
 93.1300 -+// the GNU General Public License.  This exception does not however
 93.1301 -+// invalidate any other reasons why the executable file might be covered by
 93.1302 -+// the GNU General Public License.
 93.1303 -+
 93.1304 -+//
 93.1305 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
 93.1306 -+//
 93.1307 -+
 93.1308 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 93.1309 -+
 93.1310 -+#ifdef __UCLIBC_MJN3_ONLY__
 93.1311 -+#warning fix prototypes for *textdomain funcs
 93.1312 -+#endif
 93.1313 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 93.1314 -+extern "C" char *__textdomain(const char *domainname);
 93.1315 -+extern "C" char *__bindtextdomain(const char *domainname,
 93.1316 -+				  const char *dirname);
 93.1317 -+#else
 93.1318 -+#undef __textdomain
 93.1319 -+#undef __bindtextdomain
 93.1320 -+#define __textdomain(D)           ((void)0)
 93.1321 -+#define __bindtextdomain(D,P)     ((void)0)
 93.1322 -+#endif
 93.1323 -+
 93.1324 -+  // Non-virtual member functions.
 93.1325 -+  template<typename _CharT>
 93.1326 -+     messages<_CharT>::messages(size_t __refs)
 93.1327 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 93.1328 -+     _M_name_messages(_S_get_c_name())
 93.1329 -+     { }
 93.1330 -+
 93.1331 -+  template<typename _CharT>
 93.1332 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 93.1333 -+				size_t __refs) 
 93.1334 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 93.1335 -+     _M_name_messages(__s)
 93.1336 -+     {
 93.1337 -+       char* __tmp = new char[std::strlen(__s) + 1];
 93.1338 -+       std::strcpy(__tmp, __s);
 93.1339 -+       _M_name_messages = __tmp;
 93.1340 -+     }
 93.1341 -+
 93.1342 -+  template<typename _CharT>
 93.1343 -+    typename messages<_CharT>::catalog 
 93.1344 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 93.1345 -+			   const char* __dir) const
 93.1346 -+    { 
 93.1347 -+      __bindtextdomain(__s.c_str(), __dir);
 93.1348 -+      return this->do_open(__s, __loc); 
 93.1349 -+    }
 93.1350 -+
 93.1351 -+  // Virtual member functions.
 93.1352 -+  template<typename _CharT>
 93.1353 -+    messages<_CharT>::~messages()
 93.1354 -+    { 
 93.1355 -+      if (_M_name_messages != _S_get_c_name())
 93.1356 -+	delete [] _M_name_messages;
 93.1357 -+      _S_destroy_c_locale(_M_c_locale_messages); 
 93.1358 -+    }
 93.1359 -+
 93.1360 -+  template<typename _CharT>
 93.1361 -+    typename messages<_CharT>::catalog 
 93.1362 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
 93.1363 -+			      const locale&) const
 93.1364 -+    { 
 93.1365 -+      // No error checking is done, assume the catalog exists and can
 93.1366 -+      // be used.
 93.1367 -+      __textdomain(__s.c_str());
 93.1368 -+      return 0;
 93.1369 -+    }
 93.1370 -+
 93.1371 -+  template<typename _CharT>
 93.1372 -+    void    
 93.1373 -+    messages<_CharT>::do_close(catalog) const 
 93.1374 -+    { }
 93.1375 -+
 93.1376 -+   // messages_byname
 93.1377 -+   template<typename _CharT>
 93.1378 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
 93.1379 -+     : messages<_CharT>(__refs) 
 93.1380 -+     { 
 93.1381 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
 93.1382 -+	 delete [] this->_M_name_messages;
 93.1383 -+       char* __tmp = new char[std::strlen(__s) + 1];
 93.1384 -+       std::strcpy(__tmp, __s);
 93.1385 -+       this->_M_name_messages = __tmp;
 93.1386 -+
 93.1387 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 93.1388 -+	 {
 93.1389 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
 93.1390 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
 93.1391 -+	 }
 93.1392 -+     }
 93.1393 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 93.1394 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
 93.1395 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-15 22:51:01.000000000 +0200
 93.1396 -@@ -0,0 +1,698 @@
 93.1397 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
 93.1398 -+
 93.1399 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 93.1400 -+//
 93.1401 -+// This file is part of the GNU ISO C++ Library.  This library is free
 93.1402 -+// software; you can redistribute it and/or modify it under the
 93.1403 -+// terms of the GNU General Public License as published by the
 93.1404 -+// Free Software Foundation; either version 2, or (at your option)
 93.1405 -+// any later version.
 93.1406 -+
 93.1407 -+// This library is distributed in the hope that it will be useful,
 93.1408 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 93.1409 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 93.1410 -+// GNU General Public License for more details.
 93.1411 -+
 93.1412 -+// You should have received a copy of the GNU General Public License along
 93.1413 -+// with this library; see the file COPYING.  If not, write to the Free
 93.1414 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 93.1415 -+// USA.
 93.1416 -+
 93.1417 -+// As a special exception, you may use this file as part of a free software
 93.1418 -+// library without restriction.  Specifically, if other files instantiate
 93.1419 -+// templates or use macros or inline functions from this file, or you compile
 93.1420 -+// this file and link it with other files to produce an executable, this
 93.1421 -+// file does not by itself cause the resulting executable to be covered by
 93.1422 -+// the GNU General Public License.  This exception does not however
 93.1423 -+// invalidate any other reasons why the executable file might be covered by
 93.1424 -+// the GNU General Public License.
 93.1425 -+
 93.1426 -+//
 93.1427 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
 93.1428 -+//
 93.1429 -+
 93.1430 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 93.1431 -+
 93.1432 -+#define _LIBC
 93.1433 -+#include <locale>
 93.1434 -+#undef _LIBC
 93.1435 -+#include <bits/c++locale_internal.h>
 93.1436 -+
 93.1437 -+#ifdef __UCLIBC_MJN3_ONLY__
 93.1438 -+#warning optimize this for uclibc
 93.1439 -+#warning tailor for stub locale support
 93.1440 -+#endif
 93.1441 -+
 93.1442 -+#ifndef __UCLIBC_HAS_XLOCALE__
 93.1443 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 93.1444 -+#endif
 93.1445 -+
 93.1446 -+namespace std
 93.1447 -+{
 93.1448 -+  // Construct and return valid pattern consisting of some combination of:
 93.1449 -+  // space none symbol sign value
 93.1450 -+  money_base::pattern
 93.1451 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
 93.1452 -+  { 
 93.1453 -+    pattern __ret;
 93.1454 -+
 93.1455 -+    // This insanely complicated routine attempts to construct a valid
 93.1456 -+    // pattern for use with monyepunct. A couple of invariants:
 93.1457 -+
 93.1458 -+    // if (__precedes) symbol -> value
 93.1459 -+    // else value -> symbol
 93.1460 -+    
 93.1461 -+    // if (__space) space
 93.1462 -+    // else none
 93.1463 -+
 93.1464 -+    // none == never first
 93.1465 -+    // space never first or last
 93.1466 -+
 93.1467 -+    // Any elegant implementations of this are welcome.
 93.1468 -+    switch (__posn)
 93.1469 -+      {
 93.1470 -+      case 0:
 93.1471 -+      case 1:
 93.1472 -+	// 1 The sign precedes the value and symbol.
 93.1473 -+	__ret.field[0] = sign;
 93.1474 -+	if (__space)
 93.1475 -+	  {
 93.1476 -+	    // Pattern starts with sign.
 93.1477 -+	    if (__precedes)
 93.1478 -+	      {
 93.1479 -+		__ret.field[1] = symbol;
 93.1480 -+		__ret.field[3] = value;
 93.1481 -+	      }
 93.1482 -+	    else
 93.1483 -+	      {
 93.1484 -+		__ret.field[1] = value;
 93.1485 -+		__ret.field[3] = symbol;
 93.1486 -+	      }
 93.1487 -+	    __ret.field[2] = space;
 93.1488 -+	  }
 93.1489 -+	else
 93.1490 -+	  {
 93.1491 -+	    // Pattern starts with sign and ends with none.
 93.1492 -+	    if (__precedes)
 93.1493 -+	      {
 93.1494 -+		__ret.field[1] = symbol;
 93.1495 -+		__ret.field[2] = value;
 93.1496 -+	      }
 93.1497 -+	    else
 93.1498 -+	      {
 93.1499 -+		__ret.field[1] = value;
 93.1500 -+		__ret.field[2] = symbol;
 93.1501 -+	      }
 93.1502 -+	    __ret.field[3] = none;
 93.1503 -+	  }
 93.1504 -+	break;
 93.1505 -+      case 2:
 93.1506 -+	// 2 The sign follows the value and symbol.
 93.1507 -+	if (__space)
 93.1508 -+	  {
 93.1509 -+	    // Pattern either ends with sign.
 93.1510 -+	    if (__precedes)
 93.1511 -+	      {
 93.1512 -+		__ret.field[0] = symbol;
 93.1513 -+		__ret.field[2] = value;
 93.1514 -+	      }
 93.1515 -+	    else
 93.1516 -+	      {
 93.1517 -+		__ret.field[0] = value;
 93.1518 -+		__ret.field[2] = symbol;
 93.1519 -+	      }
 93.1520 -+	    __ret.field[1] = space;
 93.1521 -+	    __ret.field[3] = sign;
 93.1522 -+	  }
 93.1523 -+	else
 93.1524 -+	  {
 93.1525 -+	    // Pattern ends with sign then none.
 93.1526 -+	    if (__precedes)
 93.1527 -+	      {
 93.1528 -+		__ret.field[0] = symbol;
 93.1529 -+		__ret.field[1] = value;
 93.1530 -+	      }
 93.1531 -+	    else
 93.1532 -+	      {
 93.1533 -+		__ret.field[0] = value;
 93.1534 -+		__ret.field[1] = symbol;
 93.1535 -+	      }
 93.1536 -+	    __ret.field[2] = sign;
 93.1537 -+	    __ret.field[3] = none;
 93.1538 -+	  }
 93.1539 -+	break;
 93.1540 -+      case 3:
 93.1541 -+	// 3 The sign immediately precedes the symbol.
 93.1542 -+	if (__precedes)
 93.1543 -+	  {
 93.1544 -+	    __ret.field[0] = sign;
 93.1545 -+	    __ret.field[1] = symbol;	    
 93.1546 -+	    if (__space)
 93.1547 -+	      {
 93.1548 -+		__ret.field[2] = space;
 93.1549 -+		__ret.field[3] = value;
 93.1550 -+	      }
 93.1551 -+	    else
 93.1552 -+	      {
 93.1553 -+		__ret.field[2] = value;		
 93.1554 -+		__ret.field[3] = none;
 93.1555 -+	      }
 93.1556 -+	  }
 93.1557 -+	else
 93.1558 -+	  {
 93.1559 -+	    __ret.field[0] = value;
 93.1560 -+	    if (__space)
 93.1561 -+	      {
 93.1562 -+		__ret.field[1] = space;
 93.1563 -+		__ret.field[2] = sign;
 93.1564 -+		__ret.field[3] = symbol;
 93.1565 -+	      }
 93.1566 -+	    else
 93.1567 -+	      {
 93.1568 -+		__ret.field[1] = sign;
 93.1569 -+		__ret.field[2] = symbol;
 93.1570 -+		__ret.field[3] = none;
 93.1571 -+	      }
 93.1572 -+	  }
 93.1573 -+	break;
 93.1574 -+      case 4:
 93.1575 -+	// 4 The sign immediately follows the symbol.
 93.1576 -+	if (__precedes)
 93.1577 -+	  {
 93.1578 -+	    __ret.field[0] = symbol;
 93.1579 -+	    __ret.field[1] = sign;
 93.1580 -+	    if (__space)
 93.1581 -+	      {
 93.1582 -+		__ret.field[2] = space;
 93.1583 -+		__ret.field[3] = value;
 93.1584 -+	      }
 93.1585 -+	    else
 93.1586 -+	      {
 93.1587 -+		__ret.field[2] = value;
 93.1588 -+		__ret.field[3] = none;
 93.1589 -+	      }
 93.1590 -+	  }
 93.1591 -+	else
 93.1592 -+	  {
 93.1593 -+	    __ret.field[0] = value;
 93.1594 -+	    if (__space)
 93.1595 -+	      {
 93.1596 -+		__ret.field[1] = space;
 93.1597 -+		__ret.field[2] = symbol;
 93.1598 -+		__ret.field[3] = sign;
 93.1599 -+	      }
 93.1600 -+	    else
 93.1601 -+	      {
 93.1602 -+		__ret.field[1] = symbol;
 93.1603 -+		__ret.field[2] = sign;
 93.1604 -+		__ret.field[3] = none;
 93.1605 -+	      }
 93.1606 -+	  }
 93.1607 -+	break;
 93.1608 -+      default:
 93.1609 -+	;
 93.1610 -+      }
 93.1611 -+    return __ret;
 93.1612 -+  }
 93.1613 -+
 93.1614 -+  template<> 
 93.1615 -+    void
 93.1616 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
 93.1617 -+						     const char*)
 93.1618 -+    {
 93.1619 -+      if (!_M_data)
 93.1620 -+	_M_data = new __moneypunct_cache<char, true>;
 93.1621 -+
 93.1622 -+      if (!__cloc)
 93.1623 -+	{
 93.1624 -+	  // "C" locale
 93.1625 -+	  _M_data->_M_decimal_point = '.';
 93.1626 -+	  _M_data->_M_thousands_sep = ',';
 93.1627 -+	  _M_data->_M_grouping = "";
 93.1628 -+	  _M_data->_M_grouping_size = 0;
 93.1629 -+	  _M_data->_M_curr_symbol = "";
 93.1630 -+	  _M_data->_M_curr_symbol_size = 0;
 93.1631 -+	  _M_data->_M_positive_sign = "";
 93.1632 -+	  _M_data->_M_positive_sign_size = 0;
 93.1633 -+	  _M_data->_M_negative_sign = "";
 93.1634 -+	  _M_data->_M_negative_sign_size = 0;
 93.1635 -+	  _M_data->_M_frac_digits = 0;
 93.1636 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 93.1637 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 93.1638 -+
 93.1639 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 93.1640 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
 93.1641 -+	}
 93.1642 -+      else
 93.1643 -+	{
 93.1644 -+	  // Named locale.
 93.1645 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
 93.1646 -+							__cloc));
 93.1647 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
 93.1648 -+							__cloc));
 93.1649 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 93.1650 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 93.1651 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 93.1652 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
 93.1653 -+
 93.1654 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
 93.1655 -+	  if (!__nposn)
 93.1656 -+	    _M_data->_M_negative_sign = "()";
 93.1657 -+	  else
 93.1658 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
 93.1659 -+							__cloc);
 93.1660 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
 93.1661 -+
 93.1662 -+	  // _Intl == true
 93.1663 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
 93.1664 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
 93.1665 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
 93.1666 -+						      __cloc));
 93.1667 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
 93.1668 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
 93.1669 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
 93.1670 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 93.1671 -+							__pposn);
 93.1672 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
 93.1673 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
 93.1674 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 93.1675 -+							__nposn);
 93.1676 -+	}
 93.1677 -+    }
 93.1678 -+
 93.1679 -+  template<> 
 93.1680 -+    void
 93.1681 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
 93.1682 -+						      const char*)
 93.1683 -+    {
 93.1684 -+      if (!_M_data)
 93.1685 -+	_M_data = new __moneypunct_cache<char, false>;
 93.1686 -+
 93.1687 -+      if (!__cloc)
 93.1688 -+	{
 93.1689 -+	  // "C" locale
 93.1690 -+	  _M_data->_M_decimal_point = '.';
 93.1691 -+	  _M_data->_M_thousands_sep = ',';
 93.1692 -+	  _M_data->_M_grouping = "";
 93.1693 -+	  _M_data->_M_grouping_size = 0;
 93.1694 -+	  _M_data->_M_curr_symbol = "";
 93.1695 -+	  _M_data->_M_curr_symbol_size = 0;
 93.1696 -+	  _M_data->_M_positive_sign = "";
 93.1697 -+	  _M_data->_M_positive_sign_size = 0;
 93.1698 -+	  _M_data->_M_negative_sign = "";
 93.1699 -+	  _M_data->_M_negative_sign_size = 0;
 93.1700 -+	  _M_data->_M_frac_digits = 0;
 93.1701 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 93.1702 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 93.1703 -+
 93.1704 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 93.1705 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
 93.1706 -+	}
 93.1707 -+      else
 93.1708 -+	{
 93.1709 -+	  // Named locale.
 93.1710 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
 93.1711 -+							__cloc));
 93.1712 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
 93.1713 -+							__cloc));
 93.1714 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 93.1715 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 93.1716 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 93.1717 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
 93.1718 -+
 93.1719 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
 93.1720 -+	  if (!__nposn)
 93.1721 -+	    _M_data->_M_negative_sign = "()";
 93.1722 -+	  else
 93.1723 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
 93.1724 -+							__cloc);
 93.1725 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
 93.1726 -+
 93.1727 -+	  // _Intl == false
 93.1728 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
 93.1729 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
 93.1730 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
 93.1731 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
 93.1732 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
 93.1733 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
 93.1734 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 93.1735 -+							__pposn);
 93.1736 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
 93.1737 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
 93.1738 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 93.1739 -+							__nposn);
 93.1740 -+	}
 93.1741 -+    }
 93.1742 -+
 93.1743 -+  template<> 
 93.1744 -+    moneypunct<char, true>::~moneypunct()
 93.1745 -+    { delete _M_data; }
 93.1746 -+
 93.1747 -+  template<> 
 93.1748 -+    moneypunct<char, false>::~moneypunct()
 93.1749 -+    { delete _M_data; }
 93.1750 -+
 93.1751 -+#ifdef _GLIBCXX_USE_WCHAR_T
 93.1752 -+  template<> 
 93.1753 -+    void
 93.1754 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
 93.1755 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1756 -+							const char*)
 93.1757 -+#else
 93.1758 -+							const char* __name)
 93.1759 -+#endif
 93.1760 -+    {
 93.1761 -+      if (!_M_data)
 93.1762 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
 93.1763 -+
 93.1764 -+      if (!__cloc)
 93.1765 -+	{
 93.1766 -+	  // "C" locale
 93.1767 -+	  _M_data->_M_decimal_point = L'.';
 93.1768 -+	  _M_data->_M_thousands_sep = L',';
 93.1769 -+	  _M_data->_M_grouping = "";
 93.1770 -+	  _M_data->_M_grouping_size = 0;
 93.1771 -+	  _M_data->_M_curr_symbol = L"";
 93.1772 -+	  _M_data->_M_curr_symbol_size = 0;
 93.1773 -+	  _M_data->_M_positive_sign = L"";
 93.1774 -+	  _M_data->_M_positive_sign_size = 0;
 93.1775 -+	  _M_data->_M_negative_sign = L"";
 93.1776 -+	  _M_data->_M_negative_sign_size = 0;
 93.1777 -+	  _M_data->_M_frac_digits = 0;
 93.1778 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 93.1779 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 93.1780 -+
 93.1781 -+	  // Use ctype::widen code without the facet...
 93.1782 -+	  unsigned char uc;
 93.1783 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 93.1784 -+	    {
 93.1785 -+	      uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
 93.1786 -+	      _M_data->_M_atoms[__i] = btowc(uc);
 93.1787 -+	    }
 93.1788 -+	}
 93.1789 -+      else
 93.1790 -+	{
 93.1791 -+	  // Named locale.
 93.1792 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1793 -+	  __c_locale __old = __uselocale(__cloc);
 93.1794 -+#else
 93.1795 -+	  // Switch to named locale so that mbsrtowcs will work.
 93.1796 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
 93.1797 -+	  setlocale(LC_ALL, __name);
 93.1798 -+#endif
 93.1799 -+
 93.1800 -+#ifdef __UCLIBC_MJN3_ONLY__
 93.1801 -+#warning fix this... should be monetary
 93.1802 -+#endif
 93.1803 -+#ifdef __UCLIBC__
 93.1804 -+# ifdef __UCLIBC_HAS_XLOCALE__
 93.1805 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
 93.1806 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
 93.1807 -+# else
 93.1808 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
 93.1809 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
 93.1810 -+# endif
 93.1811 -+#else
 93.1812 -+	  union __s_and_w { const char *__s; unsigned int __w; } __u;
 93.1813 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
 93.1814 -+	  _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
 93.1815 -+
 93.1816 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
 93.1817 -+	  _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
 93.1818 -+#endif
 93.1819 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 93.1820 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 93.1821 -+
 93.1822 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 93.1823 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
 93.1824 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
 93.1825 -+
 93.1826 -+	  wchar_t* __wcs_ps = 0;
 93.1827 -+	  wchar_t* __wcs_ns = 0;
 93.1828 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
 93.1829 -+	  try
 93.1830 -+	    {
 93.1831 -+	      mbstate_t __state;
 93.1832 -+	      size_t __len = strlen(__cpossign);
 93.1833 -+	      if (__len)
 93.1834 -+		{
 93.1835 -+		  ++__len;
 93.1836 -+		  memset(&__state, 0, sizeof(mbstate_t));
 93.1837 -+		  __wcs_ps = new wchar_t[__len];
 93.1838 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
 93.1839 -+		  _M_data->_M_positive_sign = __wcs_ps;
 93.1840 -+		}
 93.1841 -+	      else
 93.1842 -+		_M_data->_M_positive_sign = L"";
 93.1843 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
 93.1844 -+	      
 93.1845 -+	      __len = strlen(__cnegsign);
 93.1846 -+	      if (!__nposn)
 93.1847 -+		_M_data->_M_negative_sign = L"()";
 93.1848 -+	      else if (__len)
 93.1849 -+		{ 
 93.1850 -+		  ++__len;
 93.1851 -+		  memset(&__state, 0, sizeof(mbstate_t));
 93.1852 -+		  __wcs_ns = new wchar_t[__len];
 93.1853 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
 93.1854 -+		  _M_data->_M_negative_sign = __wcs_ns;
 93.1855 -+		}
 93.1856 -+	      else
 93.1857 -+		_M_data->_M_negative_sign = L"";
 93.1858 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
 93.1859 -+	      
 93.1860 -+	      // _Intl == true.
 93.1861 -+	      __len = strlen(__ccurr);
 93.1862 -+	      if (__len)
 93.1863 -+		{
 93.1864 -+		  ++__len;
 93.1865 -+		  memset(&__state, 0, sizeof(mbstate_t));
 93.1866 -+		  wchar_t* __wcs = new wchar_t[__len];
 93.1867 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
 93.1868 -+		  _M_data->_M_curr_symbol = __wcs;
 93.1869 -+		}
 93.1870 -+	      else
 93.1871 -+		_M_data->_M_curr_symbol = L"";
 93.1872 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
 93.1873 -+	    }
 93.1874 -+	  catch (...)
 93.1875 -+	    {
 93.1876 -+	      delete _M_data;
 93.1877 -+	      _M_data = 0;
 93.1878 -+	      delete __wcs_ps;
 93.1879 -+	      delete __wcs_ns;	      
 93.1880 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1881 -+	      __uselocale(__old);
 93.1882 -+#else
 93.1883 -+	      setlocale(LC_ALL, __old);
 93.1884 -+	      free(__old);
 93.1885 -+#endif
 93.1886 -+	      __throw_exception_again;
 93.1887 -+	    } 
 93.1888 -+	  
 93.1889 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
 93.1890 -+						      __cloc));
 93.1891 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
 93.1892 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
 93.1893 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
 93.1894 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 93.1895 -+							__pposn);
 93.1896 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
 93.1897 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
 93.1898 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 93.1899 -+							__nposn);
 93.1900 -+
 93.1901 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1902 -+	  __uselocale(__old);
 93.1903 -+#else
 93.1904 -+	  setlocale(LC_ALL, __old);
 93.1905 -+	  free(__old);
 93.1906 -+#endif
 93.1907 -+	}
 93.1908 -+    }
 93.1909 -+
 93.1910 -+  template<> 
 93.1911 -+  void
 93.1912 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
 93.1913 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1914 -+						       const char*)
 93.1915 -+#else
 93.1916 -+                                                       const char* __name)
 93.1917 -+#endif
 93.1918 -+  {
 93.1919 -+    if (!_M_data)
 93.1920 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
 93.1921 -+
 93.1922 -+    if (!__cloc)
 93.1923 -+	{
 93.1924 -+	  // "C" locale
 93.1925 -+	  _M_data->_M_decimal_point = L'.';
 93.1926 -+	  _M_data->_M_thousands_sep = L',';
 93.1927 -+	  _M_data->_M_grouping = "";
 93.1928 -+          _M_data->_M_grouping_size = 0;
 93.1929 -+	  _M_data->_M_curr_symbol = L"";
 93.1930 -+	  _M_data->_M_curr_symbol_size = 0;
 93.1931 -+	  _M_data->_M_positive_sign = L"";
 93.1932 -+	  _M_data->_M_positive_sign_size = 0;
 93.1933 -+	  _M_data->_M_negative_sign = L"";
 93.1934 -+	  _M_data->_M_negative_sign_size = 0;
 93.1935 -+	  _M_data->_M_frac_digits = 0;
 93.1936 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 93.1937 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 93.1938 -+
 93.1939 -+	  // Use ctype::widen code without the facet...
 93.1940 -+	  unsigned char uc;
 93.1941 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 93.1942 -+	    {
 93.1943 -+	      uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
 93.1944 -+	      _M_data->_M_atoms[__i] = btowc(uc);
 93.1945 -+	    }
 93.1946 -+	}
 93.1947 -+      else
 93.1948 -+	{
 93.1949 -+	  // Named locale.
 93.1950 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.1951 -+	  __c_locale __old = __uselocale(__cloc);
 93.1952 -+#else
 93.1953 -+	  // Switch to named locale so that mbsrtowcs will work.
 93.1954 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
 93.1955 -+	  setlocale(LC_ALL, __name);
 93.1956 -+#endif
 93.1957 -+
 93.1958 -+#ifdef __UCLIBC_MJN3_ONLY__
 93.1959 -+#warning fix this... should be monetary
 93.1960 -+#endif
 93.1961 -+#ifdef __UCLIBC__
 93.1962 -+# ifdef __UCLIBC_HAS_XLOCALE__
 93.1963 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
 93.1964 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
 93.1965 -+# else
 93.1966 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
 93.1967 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
 93.1968 -+# endif
 93.1969 -+#else
 93.1970 -+	  union __s_and_w { const char *__s; unsigned int __w; } __u;
 93.1971 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
 93.1972 -+	  _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
 93.1973 -+
 93.1974 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
 93.1975 -+	  _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
 93.1976 -+#endif
 93.1977 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 93.1978 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 93.1979 -+
 93.1980 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 93.1981 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
 93.1982 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
 93.1983 -+
 93.1984 -+	  wchar_t* __wcs_ps = 0;
 93.1985 -+	  wchar_t* __wcs_ns = 0;
 93.1986 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
 93.1987 -+	  try
 93.1988 -+            {
 93.1989 -+              mbstate_t __state;
 93.1990 -+              size_t __len;
 93.1991 -+              __len = strlen(__cpossign);
 93.1992 -+              if (__len)
 93.1993 -+                {
 93.1994 -+		  ++__len;
 93.1995 -+		  memset(&__state, 0, sizeof(mbstate_t));
 93.1996 -+		  __wcs_ps = new wchar_t[__len];
 93.1997 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
 93.1998 -+		  _M_data->_M_positive_sign = __wcs_ps;
 93.1999 -+		}
 93.2000 -+	      else
 93.2001 -+		_M_data->_M_positive_sign = L"";
 93.2002 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
 93.2003 -+	      
 93.2004 -+	      __len = strlen(__cnegsign);
 93.2005 -+	      if (!__nposn)
 93.2006 -+		_M_data->_M_negative_sign = L"()";
 93.2007 -+	      else if (__len)
 93.2008 -+		{ 
 93.2009 -+		  ++__len;
 93.2010 -+		  memset(&__state, 0, sizeof(mbstate_t));
 93.2011 -+		  __wcs_ns = new wchar_t[__len];
 93.2012 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
 93.2013 -+		  _M_data->_M_negative_sign = __wcs_ns;
 93.2014 -+		}
 93.2015 -+	      else
 93.2016 -+		_M_data->_M_negative_sign = L"";
 93.2017 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
 93.2018 -+
 93.2019 -+	      // _Intl == true.
 93.2020 -+	      __len = strlen(__ccurr);
 93.2021 -+	      if (__len)
 93.2022 -+		{
 93.2023 -+		  ++__len;
 93.2024 -+		  memset(&__state, 0, sizeof(mbstate_t));
 93.2025 -+		  wchar_t* __wcs = new wchar_t[__len];
 93.2026 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
 93.2027 -+		  _M_data->_M_curr_symbol = __wcs;
 93.2028 -+		}
 93.2029 -+	      else
 93.2030 -+		_M_data->_M_curr_symbol = L"";
 93.2031 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
 93.2032 -+	    }
 93.2033 -+          catch (...)
 93.2034 -+	    {
 93.2035 -+	      delete _M_data;
 93.2036 -+              _M_data = 0;
 93.2037 -+	      delete __wcs_ps;
 93.2038 -+	      delete __wcs_ns;	      
 93.2039 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.2040 -+	      __uselocale(__old);
 93.2041 -+#else
 93.2042 -+	      setlocale(LC_ALL, __old);
 93.2043 -+	      free(__old);
 93.2044 -+#endif
 93.2045 -+              __throw_exception_again;
 93.2046 -+	    }
 93.2047 -+
 93.2048 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
 93.2049 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
 93.2050 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
 93.2051 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
 93.2052 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 93.2053 -+	                                                __pposn);
 93.2054 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
 93.2055 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
 93.2056 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 93.2057 -+	                                                __nposn);
 93.2058 -+
 93.2059 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.2060 -+	  __uselocale(__old);
 93.2061 -+#else
 93.2062 -+	  setlocale(LC_ALL, __old);
 93.2063 -+	  free(__old);
 93.2064 -+#endif
 93.2065 -+	}
 93.2066 -+    }
 93.2067 -+
 93.2068 -+  template<> 
 93.2069 -+    moneypunct<wchar_t, true>::~moneypunct()
 93.2070 -+    {
 93.2071 -+      if (_M_data->_M_positive_sign_size)
 93.2072 -+	delete [] _M_data->_M_positive_sign;
 93.2073 -+      if (_M_data->_M_negative_sign_size
 93.2074 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
 93.2075 -+	delete [] _M_data->_M_negative_sign;
 93.2076 -+      if (_M_data->_M_curr_symbol_size)
 93.2077 -+	delete [] _M_data->_M_curr_symbol;
 93.2078 -+      delete _M_data;
 93.2079 -+    }
 93.2080 -+
 93.2081 -+  template<> 
 93.2082 -+    moneypunct<wchar_t, false>::~moneypunct()
 93.2083 -+    {
 93.2084 -+      if (_M_data->_M_positive_sign_size)
 93.2085 -+	delete [] _M_data->_M_positive_sign;
 93.2086 -+      if (_M_data->_M_negative_sign_size
 93.2087 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
 93.2088 -+	delete [] _M_data->_M_negative_sign;
 93.2089 -+      if (_M_data->_M_curr_symbol_size)
 93.2090 -+	delete [] _M_data->_M_curr_symbol;
 93.2091 -+      delete _M_data;
 93.2092 -+    }
 93.2093 -+#endif
 93.2094 -+}
 93.2095 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 93.2096 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
 93.2097 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-15 22:51:01.000000000 +0200
 93.2098 -@@ -0,0 +1,183 @@
 93.2099 -+// std::numpunct implementation details, GNU version -*- C++ -*-
 93.2100 -+
 93.2101 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 93.2102 -+//
 93.2103 -+// This file is part of the GNU ISO C++ Library.  This library is free
 93.2104 -+// software; you can redistribute it and/or modify it under the
 93.2105 -+// terms of the GNU General Public License as published by the
 93.2106 -+// Free Software Foundation; either version 2, or (at your option)
 93.2107 -+// any later version.
 93.2108 -+
 93.2109 -+// This library is distributed in the hope that it will be useful,
 93.2110 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 93.2111 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 93.2112 -+// GNU General Public License for more details.
 93.2113 -+
 93.2114 -+// You should have received a copy of the GNU General Public License along
 93.2115 -+// with this library; see the file COPYING.  If not, write to the Free
 93.2116 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 93.2117 -+// USA.
 93.2118 -+
 93.2119 -+// As a special exception, you may use this file as part of a free software
 93.2120 -+// library without restriction.  Specifically, if other files instantiate
 93.2121 -+// templates or use macros or inline functions from this file, or you compile
 93.2122 -+// this file and link it with other files to produce an executable, this
 93.2123 -+// file does not by itself cause the resulting executable to be covered by
 93.2124 -+// the GNU General Public License.  This exception does not however
 93.2125 -+// invalidate any other reasons why the executable file might be covered by
 93.2126 -+// the GNU General Public License.
 93.2127 -+
 93.2128 -+//
 93.2129 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
 93.2130 -+//
 93.2131 -+
 93.2132 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 93.2133 -+
 93.2134 -+#define _LIBC
 93.2135 -+#include <locale>
 93.2136 -+#undef _LIBC
 93.2137 -+#include <bits/c++locale_internal.h>
 93.2138 -+
 93.2139 -+#ifdef __UCLIBC_MJN3_ONLY__
 93.2140 -+#warning tailor for stub locale support
 93.2141 -+#endif
 93.2142 -+#ifndef __UCLIBC_HAS_XLOCALE__
 93.2143 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 93.2144 -+#endif
 93.2145 -+
 93.2146 -+namespace std
 93.2147 -+{
 93.2148 -+  template<> 
 93.2149 -+    void
 93.2150 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
 93.2151 -+    {
 93.2152 -+      if (!_M_data)
 93.2153 -+	_M_data = new __numpunct_cache<char>;
 93.2154 -+
 93.2155 -+      if (!__cloc)
 93.2156 -+	{
 93.2157 -+	  // "C" locale
 93.2158 -+	  _M_data->_M_grouping = "";
 93.2159 -+	  _M_data->_M_grouping_size = 0;
 93.2160 -+	  _M_data->_M_use_grouping = false;
 93.2161 -+
 93.2162 -+	  _M_data->_M_decimal_point = '.';
 93.2163 -+	  _M_data->_M_thousands_sep = ',';
 93.2164 -+
 93.2165 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
 93.2166 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
 93.2167 -+
 93.2168 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
 93.2169 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
 93.2170 -+	}
 93.2171 -+      else
 93.2172 -+	{
 93.2173 -+	  // Named locale.
 93.2174 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
 93.2175 -+							__cloc));
 93.2176 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
 93.2177 -+							__cloc));
 93.2178 -+
 93.2179 -+	  // Check for NULL, which implies no grouping.
 93.2180 -+	  if (_M_data->_M_thousands_sep == '\0')
 93.2181 -+	    _M_data->_M_grouping = "";
 93.2182 -+	  else
 93.2183 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
 93.2184 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 93.2185 -+	}
 93.2186 -+
 93.2187 -+      // NB: There is no way to extact this info from posix locales.
 93.2188 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
 93.2189 -+      _M_data->_M_truename = "true";
 93.2190 -+      _M_data->_M_truename_size = strlen(_M_data->_M_truename);
 93.2191 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
 93.2192 -+      _M_data->_M_falsename = "false";
 93.2193 -+      _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
 93.2194 -+    }
 93.2195 -+ 
 93.2196 -+  template<> 
 93.2197 -+    numpunct<char>::~numpunct()
 93.2198 -+    { delete _M_data; }
 93.2199 -+   
 93.2200 -+#ifdef _GLIBCXX_USE_WCHAR_T
 93.2201 -+  template<> 
 93.2202 -+    void
 93.2203 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
 93.2204 -+    {
 93.2205 -+      if (!_M_data)
 93.2206 -+	_M_data = new __numpunct_cache<wchar_t>;
 93.2207 -+
 93.2208 -+      if (!__cloc)
 93.2209 -+	{
 93.2210 -+	  // "C" locale
 93.2211 -+	  _M_data->_M_grouping = "";
 93.2212 -+	  _M_data->_M_grouping_size = 0;
 93.2213 -+	  _M_data->_M_use_grouping = false;
 93.2214 -+
 93.2215 -+	  _M_data->_M_decimal_point = L'.';
 93.2216 -+	  _M_data->_M_thousands_sep = L',';
 93.2217 -+
 93.2218 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.2219 -+	  __c_locale __old = __uselocale(_S_get_c_locale());
 93.2220 -+#endif
 93.2221 -+	  // Use ctype::widen code without the facet...
 93.2222 -+	  unsigned char uc;
 93.2223 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
 93.2224 -+	    {
 93.2225 -+	      uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
 93.2226 -+	      _M_data->_M_atoms_out[__i] = btowc(uc);
 93.2227 -+	    }
 93.2228 -+
 93.2229 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
 93.2230 -+	    {
 93.2231 -+	      uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__j]);
 93.2232 -+	      _M_data->_M_atoms_in[__j] = btowc(uc);
 93.2233 -+	    }
 93.2234 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.2235 -+	  __uselocale(__old);
 93.2236 -+#endif
 93.2237 -+	}
 93.2238 -+      else
 93.2239 -+	{
 93.2240 -+	  // Named locale.
 93.2241 -+#ifdef __UCLIBC_MJN3_ONLY__
 93.2242 -+#warning fix this
 93.2243 -+#endif
 93.2244 -+#ifdef __UCLIBC__
 93.2245 -+# ifdef __UCLIBC_HAS_XLOCALE__
 93.2246 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
 93.2247 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
 93.2248 -+# else
 93.2249 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
 93.2250 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
 93.2251 -+# endif
 93.2252 -+#else
 93.2253 -+	  union __s_and_w { const char *__s; unsigned int __w; } __u;
 93.2254 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
 93.2255 -+	  _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
 93.2256 -+
 93.2257 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
 93.2258 -+	  _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
 93.2259 -+#endif
 93.2260 -+
 93.2261 -+	  if (_M_data->_M_thousands_sep == L'\0')
 93.2262 -+	    _M_data->_M_grouping = "";
 93.2263 -+	  else
 93.2264 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
 93.2265 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 93.2266 -+	}
 93.2267 -+
 93.2268 -+      // NB: There is no way to extact this info from posix locales.
 93.2269 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
 93.2270 -+      _M_data->_M_truename = L"true";
 93.2271 -+      _M_data->_M_truename_size = wcslen(_M_data->_M_truename);
 93.2272 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
 93.2273 -+      _M_data->_M_falsename = L"false";
 93.2274 -+      _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
 93.2275 -+    }
 93.2276 -+
 93.2277 -+  template<> 
 93.2278 -+    numpunct<wchar_t>::~numpunct()
 93.2279 -+    { delete _M_data; }
 93.2280 -+ #endif
 93.2281 -+}
 93.2282 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.4.6/libstdc++-v3/config/locale/uclibc/time_members.cc
 93.2283 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
 93.2284 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-15 22:51:01.000000000 +0200
 93.2285 -@@ -0,0 +1,356 @@
 93.2286 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
 93.2287 -+
 93.2288 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 93.2289 -+//
 93.2290 -+// This file is part of the GNU ISO C++ Library.  This library is free
 93.2291 -+// software; you can redistribute it and/or modify it under the
 93.2292 -+// terms of the GNU General Public License as published by the
 93.2293 -+// Free Software Foundation; either version 2, or (at your option)
 93.2294 -+// any later version.
 93.2295 -+
 93.2296 -+// This library is distributed in the hope that it will be useful,
 93.2297 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 93.2298 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 93.2299 -+// GNU General Public License for more details.
 93.2300 -+
 93.2301 -+// You should have received a copy of the GNU General Public License along
 93.2302 -+// with this library; see the file COPYING.  If not, write to the Free
 93.2303 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 93.2304 -+// USA.
 93.2305 -+
 93.2306 -+// As a special exception, you may use this file as part of a free software
 93.2307 -+// library without restriction.  Specifically, if other files instantiate
 93.2308 -+// templates or use macros or inline functions from this file, or you compile
 93.2309 -+// this file and link it with other files to produce an executable, this
 93.2310 -+// file does not by itself cause the resulting executable to be covered by
 93.2311 -+// the GNU General Public License.  This exception does not however
 93.2312 -+// invalidate any other reasons why the executable file might be covered by
 93.2313 -+// the GNU General Public License.
 93.2314 -+
 93.2315 -+//
 93.2316 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
 93.2317 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
 93.2318 -+//
 93.2319 -+
 93.2320 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 93.2321 -+
 93.2322 -+#include <locale>
 93.2323 -+#include <bits/c++locale_internal.h>
 93.2324 -+
 93.2325 -+#ifdef __UCLIBC_MJN3_ONLY__
 93.2326 -+#warning tailor for stub locale support
 93.2327 -+#endif
 93.2328 -+#ifndef __UCLIBC_HAS_XLOCALE__
 93.2329 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 93.2330 -+#endif
 93.2331 -+
 93.2332 -+namespace std
 93.2333 -+{
 93.2334 -+  template<>
 93.2335 -+    void
 93.2336 -+    __timepunct<char>::
 93.2337 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
 93.2338 -+	   const tm* __tm) const
 93.2339 -+    {
 93.2340 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.2341 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
 93.2342 -+					_M_c_locale_timepunct);
 93.2343 -+#else
 93.2344 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
 93.2345 -+      setlocale(LC_ALL, _M_name_timepunct);
 93.2346 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
 93.2347 -+      setlocale(LC_ALL, __old);
 93.2348 -+      free(__old);
 93.2349 -+#endif
 93.2350 -+      // Make sure __s is null terminated.
 93.2351 -+      if (__len == 0)
 93.2352 -+	__s[0] = '\0';
 93.2353 -+    }
 93.2354 -+
 93.2355 -+  template<> 
 93.2356 -+    void
 93.2357 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
 93.2358 -+    {
 93.2359 -+      if (!_M_data)
 93.2360 -+	_M_data = new __timepunct_cache<char>;
 93.2361 -+
 93.2362 -+      if (!__cloc)
 93.2363 -+	{
 93.2364 -+	  // "C" locale
 93.2365 -+	  _M_c_locale_timepunct = _S_get_c_locale();
 93.2366 -+
 93.2367 -+	  _M_data->_M_date_format = "%m/%d/%y";
 93.2368 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
 93.2369 -+	  _M_data->_M_time_format = "%H:%M:%S";
 93.2370 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
 93.2371 -+	  _M_data->_M_date_time_format = "";
 93.2372 -+	  _M_data->_M_date_time_era_format = "";
 93.2373 -+	  _M_data->_M_am = "AM";
 93.2374 -+	  _M_data->_M_pm = "PM";
 93.2375 -+	  _M_data->_M_am_pm_format = "";
 93.2376 -+
 93.2377 -+	  // Day names, starting with "C"'s Sunday.
 93.2378 -+	  _M_data->_M_day1 = "Sunday";
 93.2379 -+	  _M_data->_M_day2 = "Monday";
 93.2380 -+	  _M_data->_M_day3 = "Tuesday";
 93.2381 -+	  _M_data->_M_day4 = "Wednesday";
 93.2382 -+	  _M_data->_M_day5 = "Thursday";
 93.2383 -+	  _M_data->_M_day6 = "Friday";
 93.2384 -+	  _M_data->_M_day7 = "Saturday";
 93.2385 -+
 93.2386 -+	  // Abbreviated day names, starting with "C"'s Sun.
 93.2387 -+	  _M_data->_M_aday1 = "Sun";
 93.2388 -+	  _M_data->_M_aday2 = "Mon";
 93.2389 -+	  _M_data->_M_aday3 = "Tue";
 93.2390 -+	  _M_data->_M_aday4 = "Wed";
 93.2391 -+	  _M_data->_M_aday5 = "Thu";
 93.2392 -+	  _M_data->_M_aday6 = "Fri";
 93.2393 -+	  _M_data->_M_aday7 = "Sat";
 93.2394 -+
 93.2395 -+	  // Month names, starting with "C"'s January.
 93.2396 -+	  _M_data->_M_month01 = "January";
 93.2397 -+	  _M_data->_M_month02 = "February";
 93.2398 -+	  _M_data->_M_month03 = "March";
 93.2399 -+	  _M_data->_M_month04 = "April";
 93.2400 -+	  _M_data->_M_month05 = "May";
 93.2401 -+	  _M_data->_M_month06 = "June";
 93.2402 -+	  _M_data->_M_month07 = "July";
 93.2403 -+	  _M_data->_M_month08 = "August";
 93.2404 -+	  _M_data->_M_month09 = "September";
 93.2405 -+	  _M_data->_M_month10 = "October";
 93.2406 -+	  _M_data->_M_month11 = "November";
 93.2407 -+	  _M_data->_M_month12 = "December";
 93.2408 -+
 93.2409 -+	  // Abbreviated month names, starting with "C"'s Jan.
 93.2410 -+	  _M_data->_M_amonth01 = "Jan";
 93.2411 -+	  _M_data->_M_amonth02 = "Feb";
 93.2412 -+	  _M_data->_M_amonth03 = "Mar";
 93.2413 -+	  _M_data->_M_amonth04 = "Apr";
 93.2414 -+	  _M_data->_M_amonth05 = "May";
 93.2415 -+	  _M_data->_M_amonth06 = "Jun";
 93.2416 -+	  _M_data->_M_amonth07 = "Jul";
 93.2417 -+	  _M_data->_M_amonth08 = "Aug";
 93.2418 -+	  _M_data->_M_amonth09 = "Sep";
 93.2419 -+	  _M_data->_M_amonth10 = "Oct";
 93.2420 -+	  _M_data->_M_amonth11 = "Nov";
 93.2421 -+	  _M_data->_M_amonth12 = "Dec";
 93.2422 -+	}
 93.2423 -+      else
 93.2424 -+	{
 93.2425 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
 93.2426 -+
 93.2427 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
 93.2428 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
 93.2429 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
 93.2430 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
 93.2431 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
 93.2432 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
 93.2433 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
 93.2434 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
 93.2435 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
 93.2436 -+
 93.2437 -+	  // Day names, starting with "C"'s Sunday.
 93.2438 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
 93.2439 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
 93.2440 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
 93.2441 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
 93.2442 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
 93.2443 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
 93.2444 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
 93.2445 -+
 93.2446 -+	  // Abbreviated day names, starting with "C"'s Sun.
 93.2447 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
 93.2448 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
 93.2449 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
 93.2450 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
 93.2451 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
 93.2452 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
 93.2453 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
 93.2454 -+
 93.2455 -+	  // Month names, starting with "C"'s January.
 93.2456 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
 93.2457 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
 93.2458 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
 93.2459 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
 93.2460 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
 93.2461 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
 93.2462 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
 93.2463 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
 93.2464 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
 93.2465 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
 93.2466 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
 93.2467 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
 93.2468 -+
 93.2469 -+	  // Abbreviated month names, starting with "C"'s Jan.
 93.2470 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
 93.2471 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
 93.2472 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
 93.2473 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
 93.2474 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
 93.2475 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
 93.2476 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
 93.2477 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
 93.2478 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
 93.2479 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
 93.2480 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
 93.2481 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
 93.2482 -+	}
 93.2483 -+    }
 93.2484 -+
 93.2485 -+#ifdef _GLIBCXX_USE_WCHAR_T
 93.2486 -+  template<>
 93.2487 -+    void
 93.2488 -+    __timepunct<wchar_t>::
 93.2489 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
 93.2490 -+	   const tm* __tm) const
 93.2491 -+    {
 93.2492 -+#ifdef __UCLIBC_HAS_XLOCALE__
 93.2493 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
 93.2494 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
 93.2495 -+					_M_c_locale_timepunct);
 93.2496 -+#else
 93.2497 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
 93.2498 -+      setlocale(LC_ALL, _M_name_timepunct);
 93.2499 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
 93.2500 -+      setlocale(LC_ALL, __old);
 93.2501 -+      free(__old);
 93.2502 -+#endif
 93.2503 -+      // Make sure __s is null terminated.
 93.2504 -+      if (__len == 0)
 93.2505 -+	__s[0] = L'\0';
 93.2506 -+    }
 93.2507 -+
 93.2508 -+  template<> 
 93.2509 -+    void
 93.2510 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
 93.2511 -+    {
 93.2512 -+      if (!_M_data)
 93.2513 -+	_M_data = new __timepunct_cache<wchar_t>;
 93.2514 -+
 93.2515 -+#warning wide time stuff
 93.2516 -+//       if (!__cloc)
 93.2517 -+	{
 93.2518 -+	  // "C" locale
 93.2519 -+	  _M_c_locale_timepunct = _S_get_c_locale();
 93.2520 -+
 93.2521 -+	  _M_data->_M_date_format = L"%m/%d/%y";
 93.2522 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
 93.2523 -+	  _M_data->_M_time_format = L"%H:%M:%S";
 93.2524 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
 93.2525 -+	  _M_data->_M_date_time_format = L"";
 93.2526 -+	  _M_data->_M_date_time_era_format = L"";
 93.2527 -+	  _M_data->_M_am = L"AM";
 93.2528 -+	  _M_data->_M_pm = L"PM";
 93.2529 -+	  _M_data->_M_am_pm_format = L"";
 93.2530 -+
 93.2531 -+	  // Day names, starting with "C"'s Sunday.
 93.2532 -+	  _M_data->_M_day1 = L"Sunday";
 93.2533 -+	  _M_data->_M_day2 = L"Monday";
 93.2534 -+	  _M_data->_M_day3 = L"Tuesday";
 93.2535 -+	  _M_data->_M_day4 = L"Wednesday";
 93.2536 -+	  _M_data->_M_day5 = L"Thursday";
 93.2537 -+	  _M_data->_M_day6 = L"Friday";
 93.2538 -+	  _M_data->_M_day7 = L"Saturday";
 93.2539 -+
 93.2540 -+	  // Abbreviated day names, starting with "C"'s Sun.
 93.2541 -+	  _M_data->_M_aday1 = L"Sun";
 93.2542 -+	  _M_data->_M_aday2 = L"Mon";
 93.2543 -+	  _M_data->_M_aday3 = L"Tue";
 93.2544 -+	  _M_data->_M_aday4 = L"Wed";
 93.2545 -+	  _M_data->_M_aday5 = L"Thu";
 93.2546 -+	  _M_data->_M_aday6 = L"Fri";
 93.2547 -+	  _M_data->_M_aday7 = L"Sat";
 93.2548 -+
 93.2549 -+	  // Month names, starting with "C"'s January.
 93.2550 -+	  _M_data->_M_month01 = L"January";
 93.2551 -+	  _M_data->_M_month02 = L"February";
 93.2552 -+	  _M_data->_M_month03 = L"March";
 93.2553 -+	  _M_data->_M_month04 = L"April";
 93.2554 -+	  _M_data->_M_month05 = L"May";
 93.2555 -+	  _M_data->_M_month06 = L"June";
 93.2556 -+	  _M_data->_M_month07 = L"July";
 93.2557 -+	  _M_data->_M_month08 = L"August";
 93.2558 -+	  _M_data->_M_month09 = L"September";
 93.2559 -+	  _M_data->_M_month10 = L"October";
 93.2560 -+	  _M_data->_M_month11 = L"November";
 93.2561 -+	  _M_data->_M_month12 = L"December";
 93.2562 -+
 93.2563 -+	  // Abbreviated month names, starting with "C"'s Jan.
 93.2564 -+	  _M_data->_M_amonth01 = L"Jan";
 93.2565 -+	  _M_data->_M_amonth02 = L"Feb";
 93.2566 -+	  _M_data->_M_amonth03 = L"Mar";
 93.2567 -+	  _M_data->_M_amonth04 = L"Apr";
 93.2568 -+	  _M_data->_M_amonth05 = L"May";
 93.2569 -+	  _M_data->_M_amonth06 = L"Jun";
 93.2570 -+	  _M_data->_M_amonth07 = L"Jul";
 93.2571 -+	  _M_data->_M_amonth08 = L"Aug";
 93.2572 -+	  _M_data->_M_amonth09 = L"Sep";
 93.2573 -+	  _M_data->_M_amonth10 = L"Oct";
 93.2574 -+	  _M_data->_M_amonth11 = L"Nov";
 93.2575 -+	  _M_data->_M_amonth12 = L"Dec";
 93.2576 -+	}
 93.2577 -+#if 0
 93.2578 -+      else
 93.2579 -+	{
 93.2580 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
 93.2581 -+
 93.2582 -+	  _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
 93.2583 -+	  _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
 93.2584 -+	  _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
 93.2585 -+	  _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
 93.2586 -+	  _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
 93.2587 -+	  _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
 93.2588 -+	  _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
 93.2589 -+	  _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
 93.2590 -+	  _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
 93.2591 -+
 93.2592 -+	  // Day names, starting with "C"'s Sunday.
 93.2593 -+	  _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
 93.2594 -+	  _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
 93.2595 -+	  _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
 93.2596 -+	  _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
 93.2597 -+	  _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
 93.2598 -+	  _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
 93.2599 -+	  _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
 93.2600 -+
 93.2601 -+	  // Abbreviated day names, starting with "C"'s Sun.
 93.2602 -+	  _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
 93.2603 -+	  _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
 93.2604 -+	  _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
 93.2605 -+	  _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
 93.2606 -+	  _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
 93.2607 -+	  _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
 93.2608 -+	  _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
 93.2609 -+
 93.2610 -+	  // Month names, starting with "C"'s January.
 93.2611 -+	  _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
 93.2612 -+	  _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
 93.2613 -+	  _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
 93.2614 -+	  _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
 93.2615 -+	  _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
 93.2616 -+	  _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
 93.2617 -+	  _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
 93.2618 -+	  _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
 93.2619 -+	  _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
 93.2620 -+	  _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
 93.2621 -+	  _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
 93.2622 -+	  _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
 93.2623 -+
 93.2624 -+	  // Abbreviated month names, starting with "C"'s Jan.
 93.2625 -+	  _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
 93.2626 -+	  _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
 93.2627 -+	  _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
 93.2628 -+	  _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
 93.2629 -+	  _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
 93.2630 -+	  _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
 93.2631 -+	  _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
 93.2632 -+	  _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
 93.2633 -+	  _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
 93.2634 -+	  _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
 93.2635 -+	  _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
 93.2636 -+	  _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
 93.2637 -+	}
 93.2638 -+#endif // 0
 93.2639 -+    }
 93.2640 -+#endif
 93.2641 -+}
 93.2642 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.4.6/libstdc++-v3/config/locale/uclibc/time_members.h
 93.2643 ---- gcc-3.4.6.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
 93.2644 -+++ gcc-3.4.6/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-15 22:51:01.000000000 +0200
 93.2645 -@@ -0,0 +1,68 @@
 93.2646 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
 93.2647 -+
 93.2648 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 93.2649 -+//
 93.2650 -+// This file is part of the GNU ISO C++ Library.  This library is free
 93.2651 -+// software; you can redistribute it and/or modify it under the
 93.2652 -+// terms of the GNU General Public License as published by the
 93.2653 -+// Free Software Foundation; either version 2, or (at your option)
 93.2654 -+// any later version.
 93.2655 -+
 93.2656 -+// This library is distributed in the hope that it will be useful,
 93.2657 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 93.2658 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 93.2659 -+// GNU General Public License for more details.
 93.2660 -+
 93.2661 -+// You should have received a copy of the GNU General Public License along
 93.2662 -+// with this library; see the file COPYING.  If not, write to the Free
 93.2663 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 93.2664 -+// USA.
 93.2665 -+
 93.2666 -+// As a special exception, you may use this file as part of a free software
 93.2667 -+// library without restriction.  Specifically, if other files instantiate
 93.2668 -+// templates or use macros or inline functions from this file, or you compile
 93.2669 -+// this file and link it with other files to produce an executable, this
 93.2670 -+// file does not by itself cause the resulting executable to be covered by
 93.2671 -+// the GNU General Public License.  This exception does not however
 93.2672 -+// invalidate any other reasons why the executable file might be covered by
 93.2673 -+// the GNU General Public License.
 93.2674 -+
 93.2675 -+//
 93.2676 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
 93.2677 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
 93.2678 -+//
 93.2679 -+
 93.2680 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 93.2681 -+
 93.2682 -+  template<typename _CharT>
 93.2683 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
 93.2684 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 93.2685 -+    _M_name_timepunct(_S_get_c_name())
 93.2686 -+    { _M_initialize_timepunct(); }
 93.2687 -+
 93.2688 -+  template<typename _CharT>
 93.2689 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 93.2690 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 93.2691 -+    _M_name_timepunct(_S_get_c_name())
 93.2692 -+    { _M_initialize_timepunct(); }
 93.2693 -+
 93.2694 -+  template<typename _CharT>
 93.2695 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 93.2696 -+				     size_t __refs) 
 93.2697 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 93.2698 -+    _M_name_timepunct(__s)
 93.2699 -+    { 
 93.2700 -+      char* __tmp = new char[std::strlen(__s) + 1];
 93.2701 -+      std::strcpy(__tmp, __s);
 93.2702 -+      _M_name_timepunct = __tmp;
 93.2703 -+      _M_initialize_timepunct(__cloc); 
 93.2704 -+    }
 93.2705 -+
 93.2706 -+  template<typename _CharT>
 93.2707 -+    __timepunct<_CharT>::~__timepunct()
 93.2708 -+    { 
 93.2709 -+      if (_M_name_timepunct != _S_get_c_name())
 93.2710 -+	delete [] _M_name_timepunct;
 93.2711 -+      delete _M_data; 
 93.2712 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
 93.2713 -+    }
 93.2714 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_base.h
 93.2715 ---- gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_base.h	1970-01-01 01:00:00.000000000 +0100
 93.2716 -+++ gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_base.h	2007-08-15 22:51:01.000000000 +0200
 93.2717 -@@ -0,0 +1,58 @@
 93.2718 -+// Locale support -*- C++ -*-
 93.2719 -+
 93.2720 -+// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
 93.2721 -+// Free Software Foundation, Inc.
 93.2722 -+//
 93.2723 -+// This file is part of the GNU ISO C++ Library.  This library is free
 93.2724 -+// software; you can redistribute it and/or modify it under the
 93.2725 -+// terms of the GNU General Public License as published by the
 93.2726 -+// Free Software Foundation; either version 2, or (at your option)
 93.2727 -+// any later version.
 93.2728 -+
 93.2729 -+// This library is distributed in the hope that it will be useful,
 93.2730 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 93.2731 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 93.2732 -+// GNU General Public License for more details.
 93.2733 -+
 93.2734 -+// You should have received a copy of the GNU General Public License along
 93.2735 -+// with this library; see the file COPYING.  If not, write to the Free
 93.2736 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 93.2737 -+// USA.
 93.2738 -+
 93.2739 -+// As a special exception, you may use this file as part of a free software
 93.2740 -+// library without restriction.  Specifically, if other files instantiate
 93.2741 -+// templates or use macros or inline functions from this file, or you compile
 93.2742 -+// this file and link it with other files to produce an executable, this
 93.2743 -+// file does not by itself cause the resulting executable to be covered by
 93.2744 -+// the GNU General Public License.  This exception does not however
 93.2745 -+// invalidate any other reasons why the executable file might be covered by
 93.2746 -+// the GNU General Public License.
 93.2747 -+
 93.2748 -+//
 93.2749 -+// ISO C++ 14882: 22.1  Locales
 93.2750 -+//
 93.2751 -+  
 93.2752 -+// Information as gleaned from /usr/include/ctype.h
 93.2753 -+  
 93.2754 -+  struct ctype_base
 93.2755 -+  {
 93.2756 -+    // Note: In uClibc, the following two types depend on configuration.
 93.2757 -+ 
 93.2758 -+    // Non-standard typedefs.
 93.2759 -+    typedef const __ctype_touplow_t* __to_type;
 93.2760 -+
 93.2761 -+    // NB: Offsets into ctype<char>::_M_table force a particular size
 93.2762 -+    // on the mask type. Because of this, we don't use an enum.
 93.2763 -+    typedef __ctype_mask_t	mask;   
 93.2764 -+    static const mask upper    	= _ISupper;
 93.2765 -+    static const mask lower 	= _ISlower;
 93.2766 -+    static const mask alpha 	= _ISalpha;
 93.2767 -+    static const mask digit 	= _ISdigit;
 93.2768 -+    static const mask xdigit 	= _ISxdigit;
 93.2769 -+    static const mask space 	= _ISspace;
 93.2770 -+    static const mask print 	= _ISprint;
 93.2771 -+    static const mask graph 	= _ISalpha | _ISdigit | _ISpunct;
 93.2772 -+    static const mask cntrl 	= _IScntrl;
 93.2773 -+    static const mask punct 	= _ISpunct;
 93.2774 -+    static const mask alnum 	= _ISalpha | _ISdigit;
 93.2775 -+  };
 93.2776 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_inline.h
 93.2777 ---- gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_inline.h	1970-01-01 01:00:00.000000000 +0100
 93.2778 -+++ gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_inline.h	2007-08-15 22:51:01.000000000 +0200
 93.2779 -@@ -0,0 +1,69 @@
 93.2780 -+// Locale support -*- C++ -*-
 93.2781 -+
 93.2782 -+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
 93.2783 -+//
 93.2784 -+// This file is part of the GNU ISO C++ Library.  This library is free
 93.2785 -+// software; you can redistribute it and/or modify it under the
 93.2786 -+// terms of the GNU General Public License as published by the
 93.2787 -+// Free Software Foundation; either version 2, or (at your option)
 93.2788 -+// any later version.
 93.2789 -+
 93.2790 -+// This library is distributed in the hope that it will be useful,
 93.2791 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 93.2792 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 93.2793 -+// GNU General Public License for more details.
 93.2794 -+
 93.2795 -+// You should have received a copy of the GNU General Public License along
 93.2796 -+// with this library; see the file COPYING.  If not, write to the Free
 93.2797 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 93.2798 -+// USA.
 93.2799 -+
 93.2800 -+// As a special exception, you may use this file as part of a free software
 93.2801 -+// library without restriction.  Specifically, if other files instantiate
 93.2802 -+// templates or use macros or inline functions from this file, or you compile
 93.2803 -+// this file and link it with other files to produce an executable, this
 93.2804 -+// file does not by itself cause the resulting executable to be covered by
 93.2805 -+// the GNU General Public License.  This exception does not however
 93.2806 -+// invalidate any other reasons why the executable file might be covered by
 93.2807 -+// the GNU General Public License.
 93.2808 -+
 93.2809 -+//
 93.2810 -+// ISO C++ 14882: 22.1  Locales
 93.2811 -+//
 93.2812 -+  
 93.2813 -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
 93.2814 -+// functions go in ctype.cc
 93.2815 -+  
 93.2816 -+  bool
 93.2817 -+  ctype<char>::
 93.2818 -+  is(mask __m, char __c) const
 93.2819 -+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
 93.2820 -+
 93.2821 -+  const char*
 93.2822 -+  ctype<char>::
 93.2823 -+  is(const char* __low, const char* __high, mask* __vec) const
 93.2824 -+  {
 93.2825 -+    while (__low < __high)
 93.2826 -+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
 93.2827 -+    return __high;
 93.2828 -+  }
 93.2829 -+
 93.2830 -+  const char*
 93.2831 -+  ctype<char>::
 93.2832 -+  scan_is(mask __m, const char* __low, const char* __high) const
 93.2833 -+  {
 93.2834 -+    while (__low < __high 
 93.2835 -+	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
 93.2836 -+      ++__low;
 93.2837 -+    return __low;
 93.2838 -+  }
 93.2839 -+
 93.2840 -+  const char*
 93.2841 -+  ctype<char>::
 93.2842 -+  scan_not(mask __m, const char* __low, const char* __high) const
 93.2843 -+  {
 93.2844 -+    while (__low < __high 
 93.2845 -+	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
 93.2846 -+      ++__low;
 93.2847 -+    return __low;
 93.2848 -+  }
 93.2849 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_noninline.h
 93.2850 ---- gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/ctype_noninline.h	1970-01-01 01:00:00.000000000 +0100
 93.2851 -+++ gcc-3.4.6/libstdc++-v3/config/os/uclibc/ctype_noninline.h	2007-08-15 22:51:01.000000000 +0200
 93.2852 -@@ -0,0 +1,92 @@
 93.2853 -+// Locale support -*- C++ -*-
 93.2854 -+
 93.2855 -+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
 93.2856 -+// Free Software Foundation, Inc.
 93.2857 -+//
 93.2858 -+// This file is part of the GNU ISO C++ Library.  This library is free
 93.2859 -+// software; you can redistribute it and/or modify it under the
 93.2860 -+// terms of the GNU General Public License as published by the
 93.2861 -+// Free Software Foundation; either version 2, or (at your option)
 93.2862 -+// any later version.
 93.2863 -+
 93.2864 -+// This library is distributed in the hope that it will be useful,
 93.2865 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 93.2866 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 93.2867 -+// GNU General Public License for more details.
 93.2868 -+
 93.2869 -+// You should have received a copy of the GNU General Public License along
 93.2870 -+// with this library; see the file COPYING.  If not, write to the Free
 93.2871 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 93.2872 -+// USA.
 93.2873 -+
 93.2874 -+// As a special exception, you may use this file as part of a free software
 93.2875 -+// library without restriction.  Specifically, if other files instantiate
 93.2876 -+// templates or use macros or inline functions from this file, or you compile
 93.2877 -+// this file and link it with other files to produce an executable, this
 93.2878 -+// file does not by itself cause the resulting executable to be covered by
 93.2879 -+// the GNU General Public License.  This exception does not however
 93.2880 -+// invalidate any other reasons why the executable file might be covered by
 93.2881 -+// the GNU General Public License.
 93.2882 -+
 93.2883 -+//
 93.2884 -+// ISO C++ 14882: 22.1  Locales
 93.2885 -+//
 93.2886 -+  
 93.2887 -+// Information as gleaned from /usr/include/ctype.h
 93.2888 -+
 93.2889 -+  const ctype_base::mask*
 93.2890 -+  ctype<char>::classic_table() throw()
 93.2891 -+  { return __C_ctype_b; }
 93.2892 -+
 93.2893 -+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
 93.2894 -+		     size_t __refs) 
 93.2895 -+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
 93.2896 -+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
 93.2897 -+  {
 93.2898 -+    _M_toupper = __C_ctype_toupper;
 93.2899 -+    _M_tolower = __C_ctype_tolower;
 93.2900 -+    _M_table = __table ? __table : __C_ctype_b;
 93.2901 -+    memset(_M_widen, 0, sizeof(_M_widen));
 93.2902 -+    memset(_M_narrow, 0, sizeof(_M_narrow));
 93.2903 -+  }
 93.2904 -+
 93.2905 -+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
 93.2906 -+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
 93.2907 -+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
 93.2908 -+  {
 93.2909 -+    _M_toupper = __C_ctype_toupper;
 93.2910 -+    _M_tolower = __C_ctype_tolower;
 93.2911 -+    _M_table = __table ? __table : __C_ctype_b;
 93.2912 -+    memset(_M_widen, 0, sizeof(_M_widen));
 93.2913 -+    memset(_M_narrow, 0, sizeof(_M_narrow));
 93.2914 -+  }
 93.2915 -+
 93.2916 -+  char
 93.2917 -+  ctype<char>::do_toupper(char __c) const
 93.2918 -+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
 93.2919 -+
 93.2920 -+  const char*
 93.2921 -+  ctype<char>::do_toupper(char* __low, const char* __high) const
 93.2922 -+  {
 93.2923 -+    while (__low < __high)
 93.2924 -+      {
 93.2925 -+	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
 93.2926 -+	++__low;
 93.2927 -+      }
 93.2928 -+    return __high;
 93.2929 -+  }
 93.2930 -+
 93.2931 -+  char
 93.2932 -+  ctype<char>::do_tolower(char __c) const
 93.2933 -+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
 93.2934 -+
 93.2935 -+  const char* 
 93.2936 -+  ctype<char>::do_tolower(char* __low, const char* __high) const
 93.2937 -+  {
 93.2938 -+    while (__low < __high)
 93.2939 -+      {
 93.2940 -+	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
 93.2941 -+	++__low;
 93.2942 -+      }
 93.2943 -+    return __high;
 93.2944 -+  }
 93.2945 -diff -durN gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.4.6/libstdc++-v3/config/os/uclibc/os_defines.h
 93.2946 ---- gcc-3.4.6.orig/libstdc++-v3/config/os/uclibc/os_defines.h	1970-01-01 01:00:00.000000000 +0100
 93.2947 -+++ gcc-3.4.6/libstdc++-v3/config/os/uclibc/os_defines.h	2007-08-15 22:51:01.000000000 +0200
 93.2948 -@@ -0,0 +1,44 @@
 93.2949 -+// Specific definitions for GNU/Linux  -*- C++ -*-
 93.2950 -+
 93.2951 -+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 93.2952 -+//
 93.2953 -+// This file is part of the GNU ISO C++ Library.  This library is free
 93.2954 -+// software; you can redistribute it and/or modify it under the
 93.2955 -+// terms of the GNU General Public License as published by the
 93.2956 -+// Free Software Foundation; either version 2, or (at your option)
 93.2957 -+// any later version.
 93.2958 -+
 93.2959 -+// This library is distributed in the hope that it will be useful,
 93.2960 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 93.2961 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 93.2962 -+// GNU General Public License for more details.
 93.2963 -+
 93.2964 -+// You should have received a copy of the GNU General Public License along
 93.2965 -+// with this library; see the file COPYING.  If not, write to the Free
 93.2966 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 93.2967 -+// USA.
 93.2968 -+
 93.2969 -+// As a special exception, you may use this file as part of a free software
 93.2970 -+// library without restriction.  Specifically, if other files instantiate
 93.2971 -+// templates or use macros or inline functions from this file, or you compile
 93.2972 -+// this file and link it with other files to produce an executable, this
 93.2973 -+// file does not by itself cause the resulting executable to be covered by
 93.2974 -+// the GNU General Public License.  This exception does not however
 93.2975 -+// invalidate any other reasons why the executable file might be covered by
 93.2976 -+// the GNU General Public License.
 93.2977 -+
 93.2978 -+#ifndef _GLIBCXX_OS_DEFINES
 93.2979 -+#define _GLIBCXX_OS_DEFINES 1
 93.2980 -+
 93.2981 -+// System-specific #define, typedefs, corrections, etc, go here.  This
 93.2982 -+// file will come before all others.
 93.2983 -+
 93.2984 -+// This keeps isanum, et al from being propagated as macros.
 93.2985 -+#define __NO_CTYPE 1
 93.2986 -+
 93.2987 -+#include <features.h>
 93.2988 -+
 93.2989 -+// We must not see the optimized string functions GNU libc defines.
 93.2990 -+#define __NO_STRING_INLINES
 93.2991 -+
 93.2992 -+#endif
 93.2993 -diff -durN gcc-3.4.6.orig/libstdc++-v3/configure gcc-3.4.6/libstdc++-v3/configure
 93.2994 ---- gcc-3.4.6.orig/libstdc++-v3/configure	2005-02-01 07:31:23.000000000 +0100
 93.2995 -+++ gcc-3.4.6/libstdc++-v3/configure	2007-08-15 22:51:01.000000000 +0200
 93.2996 -@@ -4012,6 +4012,11 @@
 93.2997 -   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
 93.2998 -   ;;
 93.2999 - 
 93.3000 -+linux-uclibc*)
 93.3001 -+  lt_cv_deplibs_check_method=pass_all
 93.3002 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
 93.3003 -+  ;;
 93.3004 -+
 93.3005 - netbsd*)
 93.3006 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
 93.3007 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
 93.3008 -@@ -5679,7 +5684,7 @@
 93.3009 -   enableval="$enable_clocale"
 93.3010 - 
 93.3011 -       case "$enableval" in
 93.3012 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
 93.3013 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
 93.3014 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
 93.3015 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
 93.3016 -    { (exit 1); exit 1; }; } ;;
 93.3017 -@@ -5704,6 +5709,9 @@
 93.3018 -   # Default to "generic".
 93.3019 -   if test $enable_clocale_flag = auto; then
 93.3020 -     case x${target_os} in
 93.3021 -+      xlinux-uclibc*)
 93.3022 -+	enable_clocale_flag=uclibc
 93.3023 -+	;;
 93.3024 -       xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
 93.3025 -         cat >conftest.$ac_ext <<_ACEOF
 93.3026 - /* confdefs.h.  */
 93.3027 -@@ -5916,6 +5924,77 @@
 93.3028 -       CTIME_CC=config/locale/generic/time_members.cc
 93.3029 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
 93.3030 -       ;;
 93.3031 -+    uclibc)
 93.3032 -+      echo "$as_me:$LINENO: result: uclibc" >&5
 93.3033 -+echo "${ECHO_T}uclibc" >&6
 93.3034 -+
 93.3035 -+      # Declare intention to use gettext, and add support for specific
 93.3036 -+      # languages.
 93.3037 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
 93.3038 -+      ALL_LINGUAS="de fr"
 93.3039 -+
 93.3040 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
 93.3041 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
 93.3042 -+set dummy msgfmt; ac_word=$2
 93.3043 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
 93.3044 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 93.3045 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
 93.3046 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
 93.3047 -+else
 93.3048 -+  if test -n "$check_msgfmt"; then
 93.3049 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
 93.3050 -+else
 93.3051 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 93.3052 -+for as_dir in $PATH
 93.3053 -+do
 93.3054 -+  IFS=$as_save_IFS
 93.3055 -+  test -z "$as_dir" && as_dir=.
 93.3056 -+  for ac_exec_ext in '' $ac_executable_extensions; do
 93.3057 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 93.3058 -+    ac_cv_prog_check_msgfmt="yes"
 93.3059 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 93.3060 -+    break 2
 93.3061 -+  fi
 93.3062 -+done
 93.3063 -+done
 93.3064 -+
 93.3065 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
 93.3066 -+fi
 93.3067 -+fi
 93.3068 -+check_msgfmt=$ac_cv_prog_check_msgfmt
 93.3069 -+if test -n "$check_msgfmt"; then
 93.3070 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
 93.3071 -+echo "${ECHO_T}$check_msgfmt" >&6
 93.3072 -+else
 93.3073 -+  echo "$as_me:$LINENO: result: no" >&5
 93.3074 -+echo "${ECHO_T}no" >&6
 93.3075 -+fi
 93.3076 -+
 93.3077 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
 93.3078 -+        USE_NLS=yes
 93.3079 -+      fi
 93.3080 -+      # Export the build objects.
 93.3081 -+      for ling in $ALL_LINGUAS; do \
 93.3082 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
 93.3083 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
 93.3084 -+      done
 93.3085 -+
 93.3086 -+
 93.3087 -+
 93.3088 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
 93.3089 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
 93.3090 -+      CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
 93.3091 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
 93.3092 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
 93.3093 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
 93.3094 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
 93.3095 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
 93.3096 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
 93.3097 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
 93.3098 -+      CTIME_H=config/locale/uclibc/time_members.h
 93.3099 -+      CTIME_CC=config/locale/uclibc/time_members.cc
 93.3100 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
 93.3101 -+      ;;
 93.3102 -   esac
 93.3103 - 
 93.3104 -   # This is where the testsuite looks for locale catalogs, using the
 93.3105 -diff -durN gcc-3.4.6.orig/libstdc++-v3/configure.host gcc-3.4.6/libstdc++-v3/configure.host
 93.3106 ---- gcc-3.4.6.orig/libstdc++-v3/configure.host	2004-10-05 18:32:49.000000000 +0200
 93.3107 -+++ gcc-3.4.6/libstdc++-v3/configure.host	2007-08-15 22:51:01.000000000 +0200
 93.3108 -@@ -217,6 +217,12 @@
 93.3109 -     ;;
 93.3110 - esac
 93.3111 - 
 93.3112 -+# Override for uClibc since linux-uclibc gets mishandled above.
 93.3113 -+case "${host_os}" in
 93.3114 -+  *-uclibc*)
 93.3115 -+    os_include_dir="os/uclibc"
 93.3116 -+    ;;
 93.3117 -+esac
 93.3118 - 
 93.3119 - # Set any OS-dependent and CPU-dependent bits.
 93.3120 - # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
 93.3121 -diff -durN gcc-3.4.6.orig/libstdc++-v3/crossconfig.m4 gcc-3.4.6/libstdc++-v3/crossconfig.m4
 93.3122 ---- gcc-3.4.6.orig/libstdc++-v3/crossconfig.m4	2005-02-01 07:31:23.000000000 +0100
 93.3123 -+++ gcc-3.4.6/libstdc++-v3/crossconfig.m4	2007-08-15 22:51:01.000000000 +0200
 93.3124 -@@ -138,6 +138,99 @@
 93.3125 - 	;;
 93.3126 -     esac
 93.3127 -     ;;
 93.3128 -+  *-uclibc*)
 93.3129 -+# Temporary hack until we implement the float versions of the libm funcs
 93.3130 -+    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
 93.3131 -+      machine/endian.h machine/param.h sys/machine.h sys/types.h \
 93.3132 -+      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
 93.3133 -+    SECTION_FLAGS='-ffunction-sections -fdata-sections'
 93.3134 -+    AC_SUBST(SECTION_FLAGS)
 93.3135 -+    GLIBCXX_CHECK_LINKER_FEATURES
 93.3136 -+    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
 93.3137 -+    GLIBCXX_CHECK_WCHAR_T_SUPPORT
 93.3138 -+
 93.3139 -+    # For LFS.
 93.3140 -+    AC_DEFINE(HAVE_INT64_T)
 93.3141 -+    case "$target" in
 93.3142 -+      *-uclinux*)
 93.3143 -+        # Don't enable LFS with uClinux
 93.3144 -+        ;;
 93.3145 -+      *)
 93.3146 -+        AC_DEFINE(_GLIBCXX_USE_LFS)
 93.3147 -+    esac
 93.3148 -+
 93.3149 -+    # For showmanyc_helper().
 93.3150 -+    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
 93.3151 -+    GLIBCXX_CHECK_POLL
 93.3152 -+    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
 93.3153 -+
 93.3154 -+    # For xsputn_2().
 93.3155 -+    AC_CHECK_HEADERS(sys/uio.h)
 93.3156 -+    GLIBCXX_CHECK_WRITEV
 93.3157 -+
 93.3158 -+#     AC_DEFINE(HAVE_ACOSF)
 93.3159 -+#     AC_DEFINE(HAVE_ASINF)
 93.3160 -+#     AC_DEFINE(HAVE_ATANF)
 93.3161 -+#     AC_DEFINE(HAVE_ATAN2F)
 93.3162 -+    AC_DEFINE(HAVE_CEILF)
 93.3163 -+    AC_DEFINE(HAVE_COPYSIGN)
 93.3164 -+#     AC_DEFINE(HAVE_COPYSIGNF)
 93.3165 -+#     AC_DEFINE(HAVE_COSF)
 93.3166 -+#     AC_DEFINE(HAVE_COSHF)
 93.3167 -+#     AC_DEFINE(HAVE_EXPF)
 93.3168 -+#     AC_DEFINE(HAVE_FABSF)
 93.3169 -+    AC_DEFINE(HAVE_FINITE)
 93.3170 -+    AC_DEFINE(HAVE_FINITEF)
 93.3171 -+    AC_DEFINE(HAVE_FLOORF)
 93.3172 -+#     AC_DEFINE(HAVE_FMODF)
 93.3173 -+#     AC_DEFINE(HAVE_FREXPF)
 93.3174 -+    AC_DEFINE(HAVE_HYPOT)
 93.3175 -+#     AC_DEFINE(HAVE_HYPOTF)
 93.3176 -+    AC_DEFINE(HAVE_ISINF)
 93.3177 -+    AC_DEFINE(HAVE_ISINFF)
 93.3178 -+    AC_DEFINE(HAVE_ISNAN)
 93.3179 -+    AC_DEFINE(HAVE_ISNANF)
 93.3180 -+#     AC_DEFINE(HAVE_LOGF)
 93.3181 -+#     AC_DEFINE(HAVE_LOG10F)
 93.3182 -+#     AC_DEFINE(HAVE_MODFF)
 93.3183 -+#     AC_DEFINE(HAVE_SINF)
 93.3184 -+#     AC_DEFINE(HAVE_SINHF)
 93.3185 -+#     AC_DEFINE(HAVE_SINCOS)
 93.3186 -+#     AC_DEFINE(HAVE_SINCOSF)
 93.3187 -+    AC_DEFINE(HAVE_SQRTF)
 93.3188 -+#     AC_DEFINE(HAVE_TANF)
 93.3189 -+#     AC_DEFINE(HAVE_TANHF)
 93.3190 -+    if test x"long_double_math_on_this_cpu" = x"yes"; then
 93.3191 -+      AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
 93.3192 -+#       AC_DEFINE(HAVE_ACOSL)
 93.3193 -+#       AC_DEFINE(HAVE_ASINL)
 93.3194 -+#       AC_DEFINE(HAVE_ATANL)
 93.3195 -+#       AC_DEFINE(HAVE_ATAN2L)
 93.3196 -+#       AC_DEFINE(HAVE_CEILL)
 93.3197 -+#       AC_DEFINE(HAVE_COPYSIGNL)
 93.3198 -+#       AC_DEFINE(HAVE_COSL)
 93.3199 -+#       AC_DEFINE(HAVE_COSHL)
 93.3200 -+#       AC_DEFINE(HAVE_EXPL)
 93.3201 -+#       AC_DEFINE(HAVE_FABSL)
 93.3202 -+#       AC_DEFINE(HAVE_FINITEL)
 93.3203 -+#       AC_DEFINE(HAVE_FLOORL)
 93.3204 -+#       AC_DEFINE(HAVE_FMODL)
 93.3205 -+#       AC_DEFINE(HAVE_FREXPL)
 93.3206 -+#       AC_DEFINE(HAVE_HYPOTL)
 93.3207 -+#       AC_DEFINE(HAVE_ISINFL)
 93.3208 -+#       AC_DEFINE(HAVE_ISNANL)
 93.3209 -+#       AC_DEFINE(HAVE_LOGL)
 93.3210 -+#       AC_DEFINE(HAVE_LOG10L)
 93.3211 -+#       AC_DEFINE(HAVE_MODFL)
 93.3212 -+#       AC_DEFINE(HAVE_POWL)
 93.3213 -+#       AC_DEFINE(HAVE_SINL)
 93.3214 -+#       AC_DEFINE(HAVE_SINHL)
 93.3215 -+#       AC_DEFINE(HAVE_SINCOSL)
 93.3216 -+#       AC_DEFINE(HAVE_SQRTL)
 93.3217 -+#       AC_DEFINE(HAVE_TANL)
 93.3218 -+#       AC_DEFINE(HAVE_TANHL)
 93.3219 -+    fi
 93.3220 -+    ;;
 93.3221 -   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
 93.3222 -     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
 93.3223 -       machine/endian.h machine/param.h sys/machine.h sys/types.h \
 93.3224 -@@ -152,7 +245,7 @@
 93.3225 -     AC_DEFINE(HAVE_INT64_T)
 93.3226 -     case "$target" in
 93.3227 -       *-uclinux*)
 93.3228 --        # Don't enable LFS with uClibc
 93.3229 -+        # Don't enable LFS with uClinux
 93.3230 -         ;;
 93.3231 -       *)
 93.3232 -         AC_DEFINE(_GLIBCXX_USE_LFS)
 93.3233 -diff -durN gcc-3.4.6.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-3.4.6/libstdc++-v3/include/c_compatibility/wchar.h
 93.3234 ---- gcc-3.4.6.orig/libstdc++-v3/include/c_compatibility/wchar.h	2003-12-09 04:51:46.000000000 +0100
 93.3235 -+++ gcc-3.4.6/libstdc++-v3/include/c_compatibility/wchar.h	2007-08-15 22:51:01.000000000 +0200
 93.3236 -@@ -101,7 +101,9 @@
 93.3237 - using std::wmemcpy;
 93.3238 - using std::wmemmove;
 93.3239 - using std::wmemset;
 93.3240 -+#if _GLIBCXX_HAVE_WCSFTIME
 93.3241 - using std::wcsftime;
 93.3242 -+#endif
 93.3243 - 
 93.3244 - #if _GLIBCXX_USE_C99
 93.3245 - using std::wcstold;
 93.3246 -diff -durN gcc-3.4.6.orig/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.4.6/libstdc++-v3/include/c_std/std_cwchar.h
 93.3247 ---- gcc-3.4.6.orig/libstdc++-v3/include/c_std/std_cwchar.h	2004-07-20 10:52:12.000000000 +0200
 93.3248 -+++ gcc-3.4.6/libstdc++-v3/include/c_std/std_cwchar.h	2007-08-15 22:51:01.000000000 +0200
 93.3249 -@@ -179,7 +179,9 @@
 93.3250 -   using ::wcscoll;
 93.3251 -   using ::wcscpy;
 93.3252 -   using ::wcscspn;
 93.3253 -+#if _GLIBCXX_HAVE_WCSFTIME
 93.3254 -   using ::wcsftime;
 93.3255 -+#endif
 93.3256 -   using ::wcslen;
 93.3257 -   using ::wcsncat;
 93.3258 -   using ::wcsncmp;
    94.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.2 +++ b/patches/gcc/3.4.6/210-all_sh-pr20617.patch	Mon Jul 28 21:32:33 2008 +0000
    94.3 @@ -0,0 +1,24 @@
    94.4 +diff -durN gcc-3.4.6.orig/gcc/config/sh/lib1funcs.asm gcc-3.4.6/gcc/config/sh/lib1funcs.asm
    94.5 +--- gcc-3.4.6.orig/gcc/config/sh/lib1funcs.asm	2003-08-12 03:25:07.000000000 +0200
    94.6 ++++ gcc-3.4.6/gcc/config/sh/lib1funcs.asm	2007-08-15 23:04:26.000000000 +0200
    94.7 +@@ -37,9 +37,19 @@
    94.8 +    ELF local label prefixes by J"orn Rennecke
    94.9 +    amylaar@cygnus.com  */
   94.10 + 
   94.11 ++#define ALIAS(X,Y)	.global GLOBAL(X); .set GLOBAL(X),GLOBAL(Y)
   94.12 ++
   94.13 + #ifdef __ELF__
   94.14 + #define LOCAL(X)	.L_##X
   94.15 +-#define FUNC(X)		.type X,@function
   94.16 ++
   94.17 ++#if 1 /* ??? The export list mechanism is broken, everything that is not
   94.18 ++	 hidden is exported.  */
   94.19 ++#undef FUNC
   94.20 ++#define FUNC(X)		.type X,@function; .hidden X
   94.21 ++#undef ALIAS
   94.22 ++#define ALIAS(X,Y)	.global GLOBAL(X); .set GLOBAL(X),GLOBAL(Y); .hidden GLOBAL(X)
   94.23 ++#endif
   94.24 ++
   94.25 + #define ENDFUNC0(X)	.Lfe_##X: .size X,.Lfe_##X-X
   94.26 + #define ENDFUNC(X)	ENDFUNC0(X)
   94.27 + #else
    95.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.2 +++ b/patches/gcc/3.4.6/220-arm-bigendian.patch	Mon Jul 28 21:32:33 2008 +0000
    95.3 @@ -0,0 +1,65 @@
    95.4 +diff -durN gcc-3.4.6.orig/gcc/config/arm/linux-elf.h gcc-3.4.6/gcc/config/arm/linux-elf.h
    95.5 +--- gcc-3.4.6.orig/gcc/config/arm/linux-elf.h	2007-08-15 22:51:01.000000000 +0200
    95.6 ++++ gcc-3.4.6/gcc/config/arm/linux-elf.h	2007-08-15 23:05:42.000000000 +0200
    95.7 +@@ -30,17 +30,34 @@
    95.8 + /* Do not assume anything about header files.  */
    95.9 + #define NO_IMPLICIT_EXTERN_C
   95.10 + 
   95.11 ++/*
   95.12 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
   95.13 ++ * (big endian) configurations.
   95.14 ++ */
   95.15 ++#if TARGET_BIG_ENDIAN_DEFAULT
   95.16 ++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
   95.17 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
   95.18 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
   95.19 ++#else
   95.20 ++#define TARGET_ENDIAN_DEFAULT 0
   95.21 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
   95.22 ++#define TARGET_LINKER_EMULATION "armelf_linux"
   95.23 ++#endif
   95.24 ++
   95.25 + /* Default is to use APCS-32 mode.  */
   95.26 + #undef  TARGET_DEFAULT
   95.27 +-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
   95.28 ++#define TARGET_DEFAULT \
   95.29 ++		( ARM_FLAG_APCS_32 | \
   95.30 ++		  ARM_FLAG_MMU_TRAPS | \
   95.31 ++		  TARGET_ENDIAN_DEFAULT )
   95.32 + 
   95.33 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
   95.34 + 
   95.35 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
   95.36 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
   95.37 + 
   95.38 + #undef  MULTILIB_DEFAULTS
   95.39 + #define MULTILIB_DEFAULTS \
   95.40 +-	{ "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
   95.41 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
   95.42 + 
   95.43 + #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
   95.44 + 
   95.45 +@@ -94,7 +111,7 @@
   95.46 +    %{rdynamic:-export-dynamic} \
   95.47 +    %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "} \
   95.48 +    -X \
   95.49 +-   %{mbig-endian:-EB}" \
   95.50 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
   95.51 +    SUBTARGET_EXTRA_LINK_SPEC
   95.52 + 
   95.53 + #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
   95.54 +diff -durN gcc-3.4.6.orig/gcc/config.gcc gcc-3.4.6/gcc/config.gcc
   95.55 +--- gcc-3.4.6.orig/gcc/config.gcc	2007-08-15 22:51:01.000000000 +0200
   95.56 ++++ gcc-3.4.6/gcc/config.gcc	2007-08-15 23:05:42.000000000 +0200
   95.57 +@@ -678,6 +678,11 @@
   95.58 + 	;;
   95.59 + arm*-*-linux*)			# ARM GNU/Linux with ELF
   95.60 + 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
   95.61 ++	case $target in
   95.62 ++	arm*b-*)
   95.63 ++		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
   95.64 ++		;;
   95.65 ++	esac
   95.66 + 	tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
   95.67 + 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
   95.68 + 	gnu_ld=yes
    96.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.2 +++ b/patches/gcc/3.4.6/230-powerpc-libc_stack_end-uclibc.patch	Mon Jul 28 21:32:33 2008 +0000
    96.3 @@ -0,0 +1,16 @@
    96.4 +diff -durN gcc-3.4.6.orig/gcc/config/rs6000/linux-unwind.h gcc-3.4.6/gcc/config/rs6000/linux-unwind.h
    96.5 +--- gcc-3.4.6.orig/gcc/config/rs6000/linux-unwind.h	2005-03-17 11:41:18.000000000 +0100
    96.6 ++++ gcc-3.4.6/gcc/config/rs6000/linux-unwind.h	2007-08-15 23:07:00.000000000 +0200
    96.7 +@@ -32,6 +32,7 @@
    96.8 +    these structs elsewhere;  Many fields are missing, particularly
    96.9 +    from the end of the structures.  */
   96.10 + 
   96.11 ++#ifndef inhibit_libc
   96.12 + struct gcc_vregs
   96.13 + {
   96.14 +   __attribute__ ((vector_size (16))) int vr[32];
   96.15 +@@ -320,3 +321,4 @@
   96.16 + 									\
   96.17 +     goto SUCCESS;							\
   96.18 +   } while (0)
   96.19 ++#endif
    97.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.2 +++ b/patches/gcc/3.4.6/240-mips-xgot.patch	Mon Jul 28 21:32:33 2008 +0000
    97.3 @@ -0,0 +1,7 @@
    97.4 +diff -durN gcc-3.4.6.orig/gcc/config/mips/t-linux gcc-3.4.6/gcc/config/mips/t-linux
    97.5 +--- gcc-3.4.6.orig/gcc/config/mips/t-linux	1970-01-01 01:00:00.000000000 +0100
    97.6 ++++ gcc-3.4.6/gcc/config/mips/t-linux	2007-08-15 23:08:15.000000000 +0200
    97.7 +@@ -0,0 +1,3 @@
    97.8 ++# Compile crtbegin/end with xgot so it works for both
    97.9 ++# normal and large GOTs.
   97.10 ++CRTSTUFF_T_CFLAGS = -mxgot
    98.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.2 +++ b/patches/gcc/3.4.6/250-nios2.patch	Mon Jul 28 21:32:33 2008 +0000
    98.3 @@ -0,0 +1,10231 @@
    98.4 +diff -durN gcc-3.4.6.orig/gcc/combine.c gcc-3.4.6/gcc/combine.c
    98.5 +--- gcc-3.4.6.orig/gcc/combine.c	2005-08-08 20:41:04.000000000 +0200
    98.6 ++++ gcc-3.4.6/gcc/combine.c	2007-08-15 23:09:36.000000000 +0200
    98.7 +@@ -4381,6 +4381,14 @@
    98.8 + 					 mode);
    98.9 + 	    }
   98.10 + 
   98.11 ++#ifndef __nios2__
   98.12 ++/* This screws up Nios II in this test case:
   98.13 ++
   98.14 ++if (x & 1)
   98.15 ++  return 2;
   98.16 ++else
   98.17 ++  return 3;
   98.18 ++*/
   98.19 + 	  else if (STORE_FLAG_VALUE == 1
   98.20 + 		   && new_code == EQ && GET_MODE_CLASS (mode) == MODE_INT
   98.21 + 		   && op1 == const0_rtx
   98.22 +@@ -4392,6 +4400,7 @@
   98.23 + 				 gen_lowpart_for_combine (mode, op0),
   98.24 + 				 const1_rtx);
   98.25 + 	    }
   98.26 ++#endif
   98.27 + 
   98.28 + 	  else if (STORE_FLAG_VALUE == 1
   98.29 + 		   && new_code == EQ && GET_MODE_CLASS (mode) == MODE_INT
   98.30 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/crti.asm gcc-3.4.6/gcc/config/nios2/crti.asm
   98.31 +--- gcc-3.4.6.orig/gcc/config/nios2/crti.asm	1970-01-01 01:00:00.000000000 +0100
   98.32 ++++ gcc-3.4.6/gcc/config/nios2/crti.asm	2007-08-15 23:09:36.000000000 +0200
   98.33 +@@ -0,0 +1,88 @@
   98.34 ++/*
   98.35 ++  Copyright (C) 2003 
   98.36 ++ by Jonah Graham (jgraham@altera.com)
   98.37 ++
   98.38 ++This file is free software; you can redistribute it and/or modify it
   98.39 ++under the terms of the GNU General Public License as published by the
   98.40 ++Free Software Foundation; either version 2, or (at your option) any
   98.41 ++later version.
   98.42 ++
   98.43 ++In addition to the permissions in the GNU General Public License, the
   98.44 ++Free Software Foundation gives you unlimited permission to link the
   98.45 ++compiled version of this file with other programs, and to distribute
   98.46 ++those programs without any restriction coming from the use of this
   98.47 ++file.  (The General Public License restrictions do apply in other
   98.48 ++respects; for example, they cover modification of the file, and
   98.49 ++distribution when not linked into another program.)
   98.50 ++
   98.51 ++This file is distributed in the hope that it will be useful, but
   98.52 ++WITHOUT ANY WARRANTY; without even the implied warranty of
   98.53 ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   98.54 ++General Public License for more details.
   98.55 ++
   98.56 ++You should have received a copy of the GNU General Public License
   98.57 ++along with this program; see the file COPYING.  If not, write to
   98.58 ++the Free Software Foundation, 59 Temple Place - Suite 330,
   98.59 ++Boston, MA 02111-1307, USA.
   98.60 ++
   98.61 ++   As a special exception, if you link this library with files
   98.62 ++   compiled with GCC to produce an executable, this does not cause
   98.63 ++   the resulting executable to be covered by the GNU General Public License.
   98.64 ++   This exception does not however invalidate any other reasons why
   98.65 ++   the executable file might be covered by the GNU General Public License.
   98.66 ++
   98.67 ++
   98.68 ++This file just make a stack frame for the contents of the .fini and
   98.69 ++.init sections.  Users may put any desired instructions in those
   98.70 ++sections.
   98.71 ++
   98.72 ++
   98.73 ++While technically any code can be put in the init and fini sections
   98.74 ++most stuff will not work other than stuff which obeys the call frame
   98.75 ++and ABI. All the call-preserved registers are saved, the call clobbered
   98.76 ++registers should have been saved by the code calling init and fini.
   98.77 ++
   98.78 ++See crtstuff.c for an example of code that inserts itself in the 
   98.79 ++init and fini sections. 
   98.80 ++
   98.81 ++See crt0.s for the code that calls init and fini.
   98.82 ++*/
   98.83 ++
   98.84 ++	.file	"crti.asm"
   98.85 ++
   98.86 ++	.section	".init"
   98.87 ++	.align 2
   98.88 ++	.global	_init
   98.89 ++_init:
   98.90 ++	addi	sp, sp, -48
   98.91 ++	stw	ra, 44(sp)
   98.92 ++	stw	r23, 40(sp)
   98.93 ++	stw	r22, 36(sp)
   98.94 ++	stw	r21, 32(sp)
   98.95 ++	stw	r20, 28(sp)
   98.96 ++	stw	r19, 24(sp)
   98.97 ++	stw	r18, 20(sp)
   98.98 ++	stw	r17, 16(sp)
   98.99 ++	stw	r16, 12(sp)
  98.100 ++	stw	fp, 8(sp)
  98.101 ++	mov	fp, sp
  98.102 ++	
  98.103 ++	
  98.104 ++	.section	".fini"
  98.105 ++	.align	2
  98.106 ++	.global	_fini
  98.107 ++_fini:
  98.108 ++	addi	sp, sp, -48
  98.109 ++	stw	ra, 44(sp)
  98.110 ++	stw	r23, 40(sp)
  98.111 ++	stw	r22, 36(sp)
  98.112 ++	stw	r21, 32(sp)
  98.113 ++	stw	r20, 28(sp)
  98.114 ++	stw	r19, 24(sp)
  98.115 ++	stw	r18, 20(sp)
  98.116 ++	stw	r17, 16(sp)
  98.117 ++	stw	r16, 12(sp)
  98.118 ++	stw	fp, 8(sp)
  98.119 ++	mov	fp, sp
  98.120 ++	
  98.121 ++
  98.122 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/crtn.asm gcc-3.4.6/gcc/config/nios2/crtn.asm
  98.123 +--- gcc-3.4.6.orig/gcc/config/nios2/crtn.asm	1970-01-01 01:00:00.000000000 +0100
  98.124 ++++ gcc-3.4.6/gcc/config/nios2/crtn.asm	2007-08-15 23:09:36.000000000 +0200
  98.125 +@@ -0,0 +1,70 @@
  98.126 ++/*
  98.127 ++  Copyright (C) 2003 
  98.128 ++ by Jonah Graham (jgraham@altera.com)
  98.129 ++
  98.130 ++This file is free software; you can redistribute it and/or modify it
  98.131 ++under the terms of the GNU General Public License as published by the
  98.132 ++Free Software Foundation; either version 2, or (at your option) any
  98.133 ++later version.
  98.134 ++
  98.135 ++In addition to the permissions in the GNU General Public License, the
  98.136 ++Free Software Foundation gives you unlimited permission to link the
  98.137 ++compiled version of this file with other programs, and to distribute
  98.138 ++those programs without any restriction coming from the use of this
  98.139 ++file.  (The General Public License restrictions do apply in other
  98.140 ++respects; for example, they cover modification of the file, and
  98.141 ++distribution when not linked into another program.)
  98.142 ++
  98.143 ++This file is distributed in the hope that it will be useful, but
  98.144 ++WITHOUT ANY WARRANTY; without even the implied warranty of
  98.145 ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  98.146 ++General Public License for more details.
  98.147 ++
  98.148 ++You should have received a copy of the GNU General Public License
  98.149 ++along with this program; see the file COPYING.  If not, write to
  98.150 ++the Free Software Foundation, 59 Temple Place - Suite 330,
  98.151 ++Boston, MA 02111-1307, USA.
  98.152 ++
  98.153 ++   As a special exception, if you link this library with files
  98.154 ++   compiled with GCC to produce an executable, this does not cause
  98.155 ++   the resulting executable to be covered by the GNU General Public License.
  98.156 ++   This exception does not however invalidate any other reasons why
  98.157 ++   the executable file might be covered by the GNU General Public License.
  98.158 ++
  98.159 ++
  98.160 ++This file just makes sure that the .fini and .init sections do in
  98.161 ++fact return.  Users may put any desired instructions in those sections.
  98.162 ++This file is the last thing linked into any executable.
  98.163 ++*/	
  98.164 ++	.file	"crtn.asm"
  98.165 ++
  98.166 ++
  98.167 ++
  98.168 ++	.section	".init"
  98.169 ++	ldw	ra, 44(sp)
  98.170 ++	ldw	r23, 40(sp)
  98.171 ++	ldw	r22, 36(sp)
  98.172 ++	ldw	r21, 32(sp)
  98.173 ++	ldw	r20, 28(sp)
  98.174 ++	ldw	r19, 24(sp)
  98.175 ++	ldw	r18, 20(sp)
  98.176 ++	ldw	r17, 16(sp)
  98.177 ++	ldw	r16, 12(sp)
  98.178 ++	ldw	fp, 8(sp)
  98.179 ++	addi	sp, sp, -48
  98.180 ++	ret
  98.181 ++	
  98.182 ++	.section	".fini"
  98.183 ++	ldw	ra, 44(sp)
  98.184 ++	ldw	r23, 40(sp)
  98.185 ++	ldw	r22, 36(sp)
  98.186 ++	ldw	r21, 32(sp)
  98.187 ++	ldw	r20, 28(sp)
  98.188 ++	ldw	r19, 24(sp)
  98.189 ++	ldw	r18, 20(sp)
  98.190 ++	ldw	r17, 16(sp)
  98.191 ++	ldw	r16, 12(sp)
  98.192 ++	ldw	fp, 8(sp)
  98.193 ++	addi	sp, sp, -48
  98.194 ++	ret
  98.195 ++	
  98.196 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/lib2-divmod.c gcc-3.4.6/gcc/config/nios2/lib2-divmod.c
  98.197 +--- gcc-3.4.6.orig/gcc/config/nios2/lib2-divmod.c	1970-01-01 01:00:00.000000000 +0100
  98.198 ++++ gcc-3.4.6/gcc/config/nios2/lib2-divmod.c	2007-08-15 23:09:36.000000000 +0200
  98.199 +@@ -0,0 +1,126 @@
  98.200 ++
  98.201 ++/* We include auto-host.h here to get HAVE_GAS_HIDDEN.  This is
  98.202 ++   supposedly valid even though this is a "target" file.  */
  98.203 ++#include "auto-host.h"
  98.204 ++
  98.205 ++
  98.206 ++#include "tconfig.h"
  98.207 ++#include "tsystem.h"
  98.208 ++#include "coretypes.h"
  98.209 ++#include "tm.h"
  98.210 ++
  98.211 ++
  98.212 ++/* Don't use `fancy_abort' here even if config.h says to use it.  */
  98.213 ++#ifdef abort
  98.214 ++#undef abort
  98.215 ++#endif
  98.216 ++
  98.217 ++
  98.218 ++#ifdef HAVE_GAS_HIDDEN
  98.219 ++#define ATTRIBUTE_HIDDEN  __attribute__ ((__visibility__ ("hidden")))
  98.220 ++#else
  98.221 ++#define ATTRIBUTE_HIDDEN
  98.222 ++#endif
  98.223 ++
  98.224 ++#include "libgcc2.h"
  98.225 ++
  98.226 ++extern SItype __modsi3 (SItype, SItype);
  98.227 ++extern SItype __divsi3 (SItype, SItype);
  98.228 ++extern SItype __umodsi3 (SItype, SItype);
  98.229 ++extern SItype __udivsi3 (SItype, SItype);
  98.230 ++
  98.231 ++static USItype udivmodsi4(USItype, USItype, word_type);
  98.232 ++
  98.233 ++/* 16-bit SI divide and modulo as used in NIOS */
  98.234 ++
  98.235 ++
  98.236 ++static USItype
  98.237 ++udivmodsi4(USItype num, USItype den, word_type modwanted)
  98.238 ++{
  98.239 ++  USItype bit = 1;
  98.240 ++  USItype res = 0;
  98.241 ++
  98.242 ++  while (den < num && bit && !(den & (1L<<31)))
  98.243 ++    {
  98.244 ++      den <<=1;
  98.245 ++      bit <<=1;
  98.246 ++    }
  98.247 ++  while (bit)
  98.248 ++    {
  98.249 ++      if (num >= den)
  98.250 ++	{
  98.251 ++	  num -= den;
  98.252 ++	  res |= bit;
  98.253 ++	}
  98.254 ++      bit >>=1;
  98.255 ++      den >>=1;
  98.256 ++    }
  98.257 ++  if (modwanted) return num;
  98.258 ++  return res;
  98.259 ++}
  98.260 ++
  98.261 ++
  98.262 ++SItype
  98.263 ++__divsi3 (SItype a, SItype b)
  98.264 ++{
  98.265 ++  word_type neg = 0;
  98.266 ++  SItype res;
  98.267 ++
  98.268 ++  if (a < 0)
  98.269 ++    {
  98.270 ++      a = -a;
  98.271 ++      neg = !neg;
  98.272 ++    }
  98.273 ++
  98.274 ++  if (b < 0)
  98.275 ++    {
  98.276 ++      b = -b;
  98.277 ++      neg = !neg;
  98.278 ++    }
  98.279 ++
  98.280 ++  res = udivmodsi4 (a, b, 0);
  98.281 ++
  98.282 ++  if (neg)
  98.283 ++    res = -res;
  98.284 ++
  98.285 ++  return res;
  98.286 ++}
  98.287 ++
  98.288 ++
  98.289 ++SItype
  98.290 ++__modsi3 (SItype a, SItype b)
  98.291 ++{
  98.292 ++  word_type neg = 0;
  98.293 ++  SItype res;
  98.294 ++
  98.295 ++  if (a < 0)
  98.296 ++    {
  98.297 ++      a = -a;
  98.298 ++      neg = 1;
  98.299 ++    }
  98.300 ++
  98.301 ++  if (b < 0)
  98.302 ++    b = -b;
  98.303 ++
  98.304 ++  res = udivmodsi4 (a, b, 1);
  98.305 ++
  98.306 ++  if (neg)
  98.307 ++    res = -res;
  98.308 ++
  98.309 ++  return res;
  98.310 ++}
  98.311 ++
  98.312 ++
  98.313 ++SItype
  98.314 ++__udivsi3 (SItype a, SItype b)
  98.315 ++{
  98.316 ++  return udivmodsi4 (a, b, 0);
  98.317 ++}
  98.318 ++
  98.319 ++
  98.320 ++SItype
  98.321 ++__umodsi3 (SItype a, SItype b)
  98.322 ++{
  98.323 ++  return udivmodsi4 (a, b, 1);
  98.324 ++}
  98.325 ++
  98.326 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/lib2-divmod-hi.c gcc-3.4.6/gcc/config/nios2/lib2-divmod-hi.c
  98.327 +--- gcc-3.4.6.orig/gcc/config/nios2/lib2-divmod-hi.c	1970-01-01 01:00:00.000000000 +0100
  98.328 ++++ gcc-3.4.6/gcc/config/nios2/lib2-divmod-hi.c	2007-08-15 23:09:36.000000000 +0200
  98.329 +@@ -0,0 +1,123 @@
  98.330 ++
  98.331 ++/* We include auto-host.h here to get HAVE_GAS_HIDDEN.  This is
  98.332 ++   supposedly valid even though this is a "target" file.  */
  98.333 ++#include "auto-host.h"
  98.334 ++
  98.335 ++
  98.336 ++#include "tconfig.h"
  98.337 ++#include "tsystem.h"
  98.338 ++#include "coretypes.h"
  98.339 ++#include "tm.h"
  98.340 ++
  98.341 ++
  98.342 ++/* Don't use `fancy_abort' here even if config.h says to use it.  */
  98.343 ++#ifdef abort
  98.344 ++#undef abort
  98.345 ++#endif
  98.346 ++
  98.347 ++
  98.348 ++#ifdef HAVE_GAS_HIDDEN
  98.349 ++#define ATTRIBUTE_HIDDEN  __attribute__ ((__visibility__ ("hidden")))
  98.350 ++#else
  98.351 ++#define ATTRIBUTE_HIDDEN
  98.352 ++#endif
  98.353 ++
  98.354 ++#include "libgcc2.h"
  98.355 ++
  98.356 ++extern HItype __modhi3 (HItype, HItype);
  98.357 ++extern HItype __divhi3 (HItype, HItype);
  98.358 ++extern HItype __umodhi3 (HItype, HItype);
  98.359 ++extern HItype __udivhi3 (HItype, HItype);
  98.360 ++
  98.361 ++static UHItype udivmodhi4(UHItype, UHItype, word_type);
  98.362 ++
  98.363 ++static UHItype
  98.364 ++udivmodhi4(UHItype num, UHItype den, word_type modwanted)
  98.365 ++{
  98.366 ++  UHItype bit = 1;
  98.367 ++  UHItype res = 0;
  98.368 ++
  98.369 ++  while (den < num && bit && !(den & (1L<<15)))
  98.370 ++    {
  98.371 ++      den <<=1;
  98.372 ++      bit <<=1;
  98.373 ++    }
  98.374 ++  while (bit)
  98.375 ++    {
  98.376 ++      if (num >= den)
  98.377 ++	{
  98.378 ++	  num -= den;
  98.379 ++	  res |= bit;
  98.380 ++	}
  98.381 ++      bit >>=1;
  98.382 ++      den >>=1;
  98.383 ++    }
  98.384 ++  if (modwanted) return num;
  98.385 ++  return res;
  98.386 ++}
  98.387 ++
  98.388 ++
  98.389 ++HItype
  98.390 ++__divhi3 (HItype a, HItype b)
  98.391 ++{
  98.392 ++  word_type neg = 0;
  98.393 ++  HItype res;
  98.394 ++
  98.395 ++  if (a < 0)
  98.396 ++    {
  98.397 ++      a = -a;
  98.398 ++      neg = !neg;
  98.399 ++    }
  98.400 ++
  98.401 ++  if (b < 0)
  98.402 ++    {
  98.403 ++      b = -b;
  98.404 ++      neg = !neg;
  98.405 ++    }
  98.406 ++
  98.407 ++  res = udivmodhi4 (a, b, 0);
  98.408 ++
  98.409 ++  if (neg)
  98.410 ++    res = -res;
  98.411 ++
  98.412 ++  return res;
  98.413 ++}
  98.414 ++
  98.415 ++
  98.416 ++HItype
  98.417 ++__modhi3 (HItype a, HItype b)
  98.418 ++{
  98.419 ++  word_type neg = 0;
  98.420 ++  HItype res;
  98.421 ++
  98.422 ++  if (a < 0)
  98.423 ++    {
  98.424 ++      a = -a;
  98.425 ++      neg = 1;
  98.426 ++    }
  98.427 ++
  98.428 ++  if (b < 0)
  98.429 ++    b = -b;
  98.430 ++
  98.431 ++  res = udivmodhi4 (a, b, 1);
  98.432 ++
  98.433 ++  if (neg)
  98.434 ++    res = -res;
  98.435 ++
  98.436 ++  return res;
  98.437 ++}
  98.438 ++
  98.439 ++
  98.440 ++HItype
  98.441 ++__udivhi3 (HItype a, HItype b)
  98.442 ++{
  98.443 ++  return udivmodhi4 (a, b, 0);
  98.444 ++}
  98.445 ++
  98.446 ++
  98.447 ++HItype
  98.448 ++__umodhi3 (HItype a, HItype b)
  98.449 ++{
  98.450 ++  return udivmodhi4 (a, b, 1);
  98.451 ++}
  98.452 ++
  98.453 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/lib2-divtable.c gcc-3.4.6/gcc/config/nios2/lib2-divtable.c
  98.454 +--- gcc-3.4.6.orig/gcc/config/nios2/lib2-divtable.c	1970-01-01 01:00:00.000000000 +0100
  98.455 ++++ gcc-3.4.6/gcc/config/nios2/lib2-divtable.c	2007-08-15 23:09:36.000000000 +0200
  98.456 +@@ -0,0 +1,46 @@
  98.457 ++
  98.458 ++/* We include auto-host.h here to get HAVE_GAS_HIDDEN.  This is
  98.459 ++   supposedly valid even though this is a "target" file.  */
  98.460 ++#include "auto-host.h"
  98.461 ++
  98.462 ++
  98.463 ++#include "tconfig.h"
  98.464 ++#include "tsystem.h"
  98.465 ++#include "coretypes.h"
  98.466 ++#include "tm.h"
  98.467 ++
  98.468 ++
  98.469 ++/* Don't use `fancy_abort' here even if config.h says to use it.  */
  98.470 ++#ifdef abort
  98.471 ++#undef abort
  98.472 ++#endif
  98.473 ++
  98.474 ++
  98.475 ++#ifdef HAVE_GAS_HIDDEN
  98.476 ++#define ATTRIBUTE_HIDDEN  __attribute__ ((__visibility__ ("hidden")))
  98.477 ++#else
  98.478 ++#define ATTRIBUTE_HIDDEN
  98.479 ++#endif
  98.480 ++
  98.481 ++#include "libgcc2.h"
  98.482 ++
  98.483 ++UQItype __divsi3_table[] =
  98.484 ++{
  98.485 ++  0, 0/1, 0/2, 0/3, 0/4, 0/5, 0/6, 0/7, 0/8, 0/9, 0/10, 0/11, 0/12, 0/13, 0/14, 0/15,
  98.486 ++  0, 1/1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10, 1/11, 1/12, 1/13, 1/14, 1/15,
  98.487 ++  0, 2/1, 2/2, 2/3, 2/4, 2/5, 2/6, 2/7, 2/8, 2/9, 2/10, 2/11, 2/12, 2/13, 2/14, 2/15,
  98.488 ++  0, 3/1, 3/2, 3/3, 3/4, 3/5, 3/6, 3/7, 3/8, 3/9, 3/10, 3/11, 3/12, 3/13, 3/14, 3/15,
  98.489 ++  0, 4/1, 4/2, 4/3, 4/4, 4/5, 4/6, 4/7, 4/8, 4/9, 4/10, 4/11, 4/12, 4/13, 4/14, 4/15,
  98.490 ++  0, 5/1, 5/2, 5/3, 5/4, 5/5, 5/6, 5/7, 5/8, 5/9, 5/10, 5/11, 5/12, 5/13, 5/14, 5/15,
  98.491 ++  0, 6/1, 6/2, 6/3, 6/4, 6/5, 6/6, 6/7, 6/8, 6/9, 6/10, 6/11, 6/12, 6/13, 6/14, 6/15,
  98.492 ++  0, 7/1, 7/2, 7/3, 7/4, 7/5, 7/6, 7/7, 7/8, 7/9, 7/10, 7/11, 7/12, 7/13, 7/14, 7/15,
  98.493 ++  0, 8/1, 8/2, 8/3, 8/4, 8/5, 8/6, 8/7, 8/8, 8/9, 8/10, 8/11, 8/12, 8/13, 8/14, 8/15,
  98.494 ++  0, 9/1, 9/2, 9/3, 9/4, 9/5, 9/6, 9/7, 9/8, 9/9, 9/10, 9/11, 9/12, 9/13, 9/14, 9/15,
  98.495 ++  0, 10/1, 10/2, 10/3, 10/4, 10/5, 10/6, 10/7, 10/8, 10/9, 10/10, 10/11, 10/12, 10/13, 10/14, 10/15,
  98.496 ++  0, 11/1, 11/2, 11/3, 11/4, 11/5, 11/6, 11/7, 11/8, 11/9, 11/10, 11/11, 11/12, 11/13, 11/14, 11/15,
  98.497 ++  0, 12/1, 12/2, 12/3, 12/4, 12/5, 12/6, 12/7, 12/8, 12/9, 12/10, 12/11, 12/12, 12/13, 12/14, 12/15,
  98.498 ++  0, 13/1, 13/2, 13/3, 13/4, 13/5, 13/6, 13/7, 13/8, 13/9, 13/10, 13/11, 13/12, 13/13, 13/14, 13/15,
  98.499 ++  0, 14/1, 14/2, 14/3, 14/4, 14/5, 14/6, 14/7, 14/8, 14/9, 14/10, 14/11, 14/12, 14/13, 14/14, 14/15,
  98.500 ++  0, 15/1, 15/2, 15/3, 15/4, 15/5, 15/6, 15/7, 15/8, 15/9, 15/10, 15/11, 15/12, 15/13, 15/14, 15/15,
  98.501 ++};
  98.502 ++
  98.503 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/lib2-mul.c gcc-3.4.6/gcc/config/nios2/lib2-mul.c
  98.504 +--- gcc-3.4.6.orig/gcc/config/nios2/lib2-mul.c	1970-01-01 01:00:00.000000000 +0100
  98.505 ++++ gcc-3.4.6/gcc/config/nios2/lib2-mul.c	2007-08-15 23:09:36.000000000 +0200
  98.506 +@@ -0,0 +1,103 @@
  98.507 ++/* while we are debugging (ie compile outside of gcc build) 
  98.508 ++   disable gcc specific headers */
  98.509 ++#ifndef DEBUG_MULSI3
  98.510 ++
  98.511 ++
  98.512 ++/* We include auto-host.h here to get HAVE_GAS_HIDDEN.  This is
  98.513 ++   supposedly valid even though this is a "target" file.  */
  98.514 ++#include "auto-host.h"
  98.515 ++
  98.516 ++
  98.517 ++#include "tconfig.h"
  98.518 ++#include "tsystem.h"
  98.519 ++#include "coretypes.h"
  98.520 ++#include "tm.h"
  98.521 ++
  98.522 ++
  98.523 ++/* Don't use `fancy_abort' here even if config.h says to use it.  */
  98.524 ++#ifdef abort
  98.525 ++#undef abort
  98.526 ++#endif
  98.527 ++
  98.528 ++
  98.529 ++#ifdef HAVE_GAS_HIDDEN
  98.530 ++#define ATTRIBUTE_HIDDEN  __attribute__ ((__visibility__ ("hidden")))
  98.531 ++#else
  98.532 ++#define ATTRIBUTE_HIDDEN
  98.533 ++#endif
  98.534 ++
  98.535 ++#include "libgcc2.h"
  98.536 ++
  98.537 ++#else
  98.538 ++#define SItype int
  98.539 ++#define USItype unsigned int
  98.540 ++#endif
  98.541 ++
  98.542 ++
  98.543 ++extern SItype __mulsi3 (SItype, SItype);
  98.544 ++
  98.545 ++SItype
  98.546 ++__mulsi3 (SItype a, SItype b)
  98.547 ++{
  98.548 ++  SItype res = 0;
  98.549 ++  USItype cnt = a;
  98.550 ++  
  98.551 ++  while (cnt)
  98.552 ++    {
  98.553 ++      if (cnt & 1)
  98.554 ++        {
  98.555 ++	  res += b;	  
  98.556 ++	}
  98.557 ++      b <<= 1;
  98.558 ++      cnt >>= 1;
  98.559 ++    }
  98.560 ++    
  98.561 ++  return res;
  98.562 ++}
  98.563 ++/*
  98.564 ++TODO: Choose best alternative implementation.
  98.565 ++
  98.566 ++SItype
  98.567 ++__divsi3 (SItype a, SItype b)
  98.568 ++{
  98.569 ++  SItype res = 0;
  98.570 ++  USItype cnt = 0;
  98.571 ++  
  98.572 ++  while (cnt < 32)
  98.573 ++    {
  98.574 ++      if (a & (1L << cnt))
  98.575 ++        {
  98.576 ++	  res += b;	  
  98.577 ++	}
  98.578 ++      b <<= 1;
  98.579 ++      cnt++;
  98.580 ++    }
  98.581 ++    
  98.582 ++  return res;
  98.583 ++}
  98.584 ++*/
  98.585 ++
  98.586 ++
  98.587 ++#ifdef DEBUG_MULSI3
  98.588 ++
  98.589 ++int
  98.590 ++main ()
  98.591 ++{
  98.592 ++  int i, j;
  98.593 ++  int error = 0;
  98.594 ++  
  98.595 ++  for (i = -1000; i < 1000; i++)
  98.596 ++    for (j = -1000; j < 1000; j++)
  98.597 ++      {
  98.598 ++	int expect = i * j;
  98.599 ++	int actual = A__divsi3 (i, j);
  98.600 ++	if (expect != actual)
  98.601 ++	  {
  98.602 ++	    printf ("error: %d * %d = %d not %d\n", i, j, expect, actual);
  98.603 ++	    error = 1;
  98.604 ++	  }
  98.605 ++      }
  98.606 ++
  98.607 ++  return error;
  98.608 ++}
  98.609 ++#endif
  98.610 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2.c gcc-3.4.6/gcc/config/nios2/nios2.c
  98.611 +--- gcc-3.4.6.orig/gcc/config/nios2/nios2.c	1970-01-01 01:00:00.000000000 +0100
  98.612 ++++ gcc-3.4.6/gcc/config/nios2/nios2.c	2007-08-15 23:09:36.000000000 +0200
  98.613 +@@ -0,0 +1,2853 @@
  98.614 ++/* Subroutines for assembler code output for Altera NIOS 2G NIOS2 version.
  98.615 ++   Copyright (C) 2003 Altera
  98.616 ++   Contributed by Jonah Graham (jgraham@altera.com).
  98.617 ++
  98.618 ++This file is part of GNU CC.
  98.619 ++
  98.620 ++GNU CC is free software; you can redistribute it and/or modify
  98.621 ++it under the terms of the GNU General Public License as published by
  98.622 ++the Free Software Foundation; either version 2, or (at your option)
  98.623 ++any later version.
  98.624 ++
  98.625 ++GNU CC is distributed in the hope that it will be useful,
  98.626 ++but WITHOUT ANY WARRANTY; without even the implied warranty of
  98.627 ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  98.628 ++GNU General Public License for more details.
  98.629 ++
  98.630 ++You should have received a copy of the GNU General Public License
  98.631 ++along with GNU CC; see the file COPYING.  If not, write to
  98.632 ++the Free Software Foundation, 59 Temple Place - Suite 330,
  98.633 ++Boston, MA 02111-1307, USA.  */
  98.634 ++
  98.635 ++
  98.636 ++#include <stdio.h>
  98.637 ++#include "config.h"
  98.638 ++#include "system.h"
  98.639 ++#include "coretypes.h"
  98.640 ++#include "tm.h"
  98.641 ++#include "rtl.h"
  98.642 ++#include "tree.h"
  98.643 ++#include "tm_p.h"
  98.644 ++#include "regs.h"
  98.645 ++#include "hard-reg-set.h"
  98.646 ++#include "real.h"
  98.647 ++#include "insn-config.h"
  98.648 ++#include "conditions.h"
  98.649 ++#include "output.h"
  98.650 ++#include "insn-attr.h"
  98.651 ++#include "flags.h"
  98.652 ++#include "recog.h"
  98.653 ++#include "expr.h"
  98.654 ++#include "toplev.h"
  98.655 ++#include "basic-block.h"
  98.656 ++#include "function.h"
  98.657 ++#include "ggc.h"
  98.658 ++#include "reload.h"
  98.659 ++#include "debug.h"
  98.660 ++#include "optabs.h"
  98.661 ++#include "target.h"
  98.662 ++#include "target-def.h"
  98.663 ++
  98.664 ++/* local prototypes */
  98.665 ++static bool nios2_rtx_costs (rtx, int, int, int *);
  98.666 ++
  98.667 ++static void nios2_asm_function_prologue (FILE *, HOST_WIDE_INT);
  98.668 ++static int nios2_use_dfa_pipeline_interface (void);
  98.669 ++static int nios2_issue_rate (void);
  98.670 ++static struct machine_function *nios2_init_machine_status (void);
  98.671 ++static bool nios2_in_small_data_p (tree);
  98.672 ++static rtx save_reg (int, HOST_WIDE_INT, rtx);
  98.673 ++static rtx restore_reg (int, HOST_WIDE_INT);
  98.674 ++static unsigned int nios2_section_type_flags (tree, const char *, int);
  98.675 ++static void nios2_init_builtins (void);
  98.676 ++static rtx nios2_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
  98.677 ++static bool nios2_function_ok_for_sibcall (tree, tree);
  98.678 ++static void nios2_encode_section_info (tree, rtx, int);
  98.679 ++
  98.680 ++/* Initialize the GCC target structure.  */
  98.681 ++#undef TARGET_ASM_FUNCTION_PROLOGUE
  98.682 ++#define TARGET_ASM_FUNCTION_PROLOGUE nios2_asm_function_prologue
  98.683 ++
  98.684 ++#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
  98.685 ++#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE \
  98.686 ++ nios2_use_dfa_pipeline_interface
  98.687 ++#undef TARGET_SCHED_ISSUE_RATE
  98.688 ++#define TARGET_SCHED_ISSUE_RATE nios2_issue_rate
  98.689 ++#undef TARGET_IN_SMALL_DATA_P
  98.690 ++#define TARGET_IN_SMALL_DATA_P nios2_in_small_data_p
  98.691 ++#undef  TARGET_ENCODE_SECTION_INFO
  98.692 ++#define TARGET_ENCODE_SECTION_INFO nios2_encode_section_info
  98.693 ++#undef  TARGET_SECTION_TYPE_FLAGS
  98.694 ++#define TARGET_SECTION_TYPE_FLAGS  nios2_section_type_flags
  98.695 ++
  98.696 ++#undef TARGET_INIT_BUILTINS
  98.697 ++#define TARGET_INIT_BUILTINS nios2_init_builtins
  98.698 ++#undef TARGET_EXPAND_BUILTIN
  98.699 ++#define TARGET_EXPAND_BUILTIN nios2_expand_builtin
  98.700 ++
  98.701 ++#undef TARGET_FUNCTION_OK_FOR_SIBCALL
  98.702 ++#define TARGET_FUNCTION_OK_FOR_SIBCALL nios2_function_ok_for_sibcall
  98.703 ++
  98.704 ++#undef TARGET_RTX_COSTS
  98.705 ++#define TARGET_RTX_COSTS nios2_rtx_costs
  98.706 ++
  98.707 ++
  98.708 ++struct gcc_target targetm = TARGET_INITIALIZER;
  98.709 ++
  98.710 ++
  98.711 ++
  98.712 ++/* Threshold for data being put into the small data/bss area, instead
  98.713 ++   of the normal data area (references to the small data/bss area take
  98.714 ++   1 instruction, and use the global pointer, references to the normal
  98.715 ++   data area takes 2 instructions).  */
  98.716 ++unsigned HOST_WIDE_INT nios2_section_threshold = NIOS2_DEFAULT_GVALUE;
  98.717 ++
  98.718 ++
  98.719 ++/* Structure to be filled in by compute_frame_size with register
  98.720 ++   save masks, and offsets for the current function.  */
  98.721 ++
  98.722 ++struct nios2_frame_info
  98.723 ++GTY (())
  98.724 ++{
  98.725 ++  long total_size;		/* # bytes that the entire frame takes up */
  98.726 ++  long var_size;		/* # bytes that variables take up */
  98.727 ++  long args_size;		/* # bytes that outgoing arguments take up */
  98.728 ++  int save_reg_size;		/* # bytes needed to store gp regs */
  98.729 ++  int save_reg_rounded;		/* # bytes needed to store gp regs */
  98.730 ++  long save_regs_offset;	/* offset from new sp to store gp registers */
  98.731 ++  int initialized;		/* != 0 if frame size already calculated */
  98.732 ++  int num_regs;			/* number of gp registers saved */
  98.733 ++};
  98.734 ++
  98.735 ++struct machine_function
  98.736 ++GTY (())
  98.737 ++{
  98.738 ++
  98.739 ++  /* Current frame information, calculated by compute_frame_size.  */
  98.740 ++  struct nios2_frame_info frame;
  98.741 ++};
  98.742 ++
  98.743 ++
  98.744 ++/***************************************
  98.745 ++ * Section encodings
  98.746 ++ ***************************************/
  98.747 ++
  98.748 ++
  98.749 ++
  98.750 ++
  98.751 ++
  98.752 ++/***************************************
  98.753 ++ * Stack Layout and Calling Conventions
  98.754 ++ ***************************************/
  98.755 ++
  98.756 ++
  98.757 ++#define TOO_BIG_OFFSET(X) ((X) > ((1 << 15) - 1))
  98.758 ++#define TEMP_REG_NUM 8
  98.759 ++
  98.760 ++static void
  98.761 ++nios2_asm_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
  98.762 ++{
  98.763 ++  if (flag_verbose_asm || flag_debug_asm)
  98.764 ++    {
  98.765 ++      compute_frame_size ();
  98.766 ++      dump_frame_size (file);
  98.767 ++    }
  98.768 ++}
  98.769 ++
  98.770 ++static rtx
  98.771 ++save_reg (int regno, HOST_WIDE_INT offset, rtx cfa_store_reg)
  98.772 ++{
  98.773 ++  rtx insn, stack_slot;
  98.774 ++
  98.775 ++  stack_slot = gen_rtx_PLUS (SImode,
  98.776 ++			     cfa_store_reg,
  98.777 ++			     GEN_INT (offset));
  98.778 ++
  98.779 ++  insn = emit_insn (gen_rtx_SET (SImode,
  98.780 ++				 gen_rtx_MEM (SImode, stack_slot),
  98.781 ++				 gen_rtx_REG (SImode, regno)));
  98.782 ++
  98.783 ++  RTX_FRAME_RELATED_P (insn) = 1;
  98.784 ++
  98.785 ++  return insn;
  98.786 ++}
  98.787 ++
  98.788 ++static rtx
  98.789 ++restore_reg (int regno, HOST_WIDE_INT offset)
  98.790 ++{
  98.791 ++  rtx insn, stack_slot;
  98.792 ++
  98.793 ++  if (TOO_BIG_OFFSET (offset))
  98.794 ++    {
  98.795 ++      stack_slot = gen_rtx_REG (SImode, TEMP_REG_NUM);
  98.796 ++      insn = emit_insn (gen_rtx_SET (SImode,
  98.797 ++				     stack_slot,
  98.798 ++				     GEN_INT (offset)));
  98.799 ++
  98.800 ++      insn = emit_insn (gen_rtx_SET (SImode,
  98.801 ++				     stack_slot,
  98.802 ++                                     gen_rtx_PLUS (SImode,
  98.803 ++				                   stack_slot,
  98.804 ++				                   stack_pointer_rtx)));
  98.805 ++    }
  98.806 ++  else
  98.807 ++    {
  98.808 ++      stack_slot = gen_rtx_PLUS (SImode,
  98.809 ++			         stack_pointer_rtx,
  98.810 ++				 GEN_INT (offset));
  98.811 ++    }
  98.812 ++
  98.813 ++  stack_slot = gen_rtx_MEM (SImode, stack_slot);
  98.814 ++
  98.815 ++  insn = emit_move_insn (gen_rtx_REG (SImode, regno), stack_slot);
  98.816 ++
  98.817 ++  return insn;
  98.818 ++}
  98.819 ++
  98.820 ++
  98.821 ++/* There are two possible paths for prologue expansion,
  98.822 ++- the first is if the total frame size is < 2^15-1. In that
  98.823 ++case all the immediates will fit into the 16-bit immediate
  98.824 ++fields.
  98.825 ++- the second is when the frame size is too big, in that
  98.826 ++case an additional temporary register is used, first 
  98.827 ++as a cfa_temp to offset the sp, second as the cfa_store
  98.828 ++register.
  98.829 ++
  98.830 ++See the comment above dwarf2out_frame_debug_expr in 
  98.831 ++dwarf2out.c for more explanation of the "rules."
  98.832 ++
  98.833 ++
  98.834 ++Case 1:
  98.835 ++Rule #  Example Insn                       Effect
  98.836 ++2  	addi	sp, sp, -total_frame_size  cfa.reg=sp, cfa.offset=total_frame_size
  98.837 ++                                           cfa_store.reg=sp, cfa_store.offset=total_frame_size
  98.838 ++12  	stw	ra, offset(sp)		   
  98.839 ++12  	stw	r16, offset(sp)
  98.840 ++1  	mov	fp, sp
  98.841 ++  
  98.842 ++Case 2: 
  98.843 ++Rule #  Example Insn                       Effect
  98.844 ++6 	movi	r8, total_frame_size       cfa_temp.reg=r8, cfa_temp.offset=total_frame_size
  98.845 ++2  	sub	sp, sp, r8                 cfa.reg=sp, cfa.offset=total_frame_size
  98.846 ++                                           cfa_store.reg=sp, cfa_store.offset=total_frame_size
  98.847 ++5   	add	r8, r8, sp                 cfa_store.reg=r8, cfa_store.offset=0
  98.848 ++12  	stw	ra, offset(r8)
  98.849 ++12  	stw	r16, offset(r8)
  98.850 ++1  	mov	fp, sp
  98.851 ++
  98.852 ++*/
  98.853 ++
  98.854 ++void
  98.855 ++expand_prologue ()
  98.856 ++{
  98.857 ++  int i;
  98.858 ++  HOST_WIDE_INT total_frame_size;
  98.859 ++  int cfa_store_offset;
  98.860 ++  rtx insn;
  98.861 ++  rtx cfa_store_reg = 0;
  98.862 ++
  98.863 ++  total_frame_size = compute_frame_size ();
  98.864 ++
  98.865 ++  if (total_frame_size)
  98.866 ++    {
  98.867 ++
  98.868 ++      if (TOO_BIG_OFFSET (total_frame_size)) 
  98.869 ++	{
  98.870 ++	    /* cfa_temp and cfa_store_reg are the same register,
  98.871 ++	       cfa_store_reg overwrites cfa_temp */
  98.872 ++	    cfa_store_reg = gen_rtx_REG (SImode, TEMP_REG_NUM);
  98.873 ++	    insn = emit_insn (gen_rtx_SET (SImode,
  98.874 ++					   cfa_store_reg,
  98.875 ++					   GEN_INT (total_frame_size)));
  98.876 ++
  98.877 ++	    RTX_FRAME_RELATED_P (insn) = 1;
  98.878 ++
  98.879 ++
  98.880 ++	    insn = gen_rtx_SET (SImode,
  98.881 ++				stack_pointer_rtx,
  98.882 ++				gen_rtx_MINUS (SImode,
  98.883 ++					       stack_pointer_rtx,
  98.884 ++					       cfa_store_reg));
  98.885 ++
  98.886 ++	    insn = emit_insn (insn);
  98.887 ++	    RTX_FRAME_RELATED_P (insn) = 1;
  98.888 ++
  98.889 ++
  98.890 ++	    /* if there are no registers to save, I don't need to
  98.891 ++	       create a cfa_store */
  98.892 ++	    if (cfun->machine->frame.save_reg_size) 
  98.893 ++	      {
  98.894 ++		insn = gen_rtx_SET (SImode,
  98.895 ++				    cfa_store_reg,
  98.896 ++				    gen_rtx_PLUS (SImode,
  98.897 ++						  cfa_store_reg,
  98.898 ++						  stack_pointer_rtx));
  98.899 ++
  98.900 ++		insn = emit_insn (insn);
  98.901 ++		RTX_FRAME_RELATED_P (insn) = 1;
  98.902 ++	      }
  98.903 ++
  98.904 ++	    cfa_store_offset 
  98.905 ++	      = total_frame_size 
  98.906 ++		- (cfun->machine->frame.save_regs_offset
  98.907 ++		   + cfun->machine->frame.save_reg_rounded);
  98.908 ++	}
  98.909 ++      else
  98.910 ++	{
  98.911 ++	    insn = gen_rtx_SET (SImode,
  98.912 ++				stack_pointer_rtx,
  98.913 ++				gen_rtx_PLUS (SImode,
  98.914 ++					      stack_pointer_rtx,
  98.915 ++					      GEN_INT (-total_frame_size)));
  98.916 ++	    insn = emit_insn (insn);
  98.917 ++	    RTX_FRAME_RELATED_P (insn) = 1;
  98.918 ++
  98.919 ++	    cfa_store_reg = stack_pointer_rtx;
  98.920 ++	    cfa_store_offset 
  98.921 ++	      = cfun->machine->frame.save_regs_offset
  98.922 ++		+ cfun->machine->frame.save_reg_rounded;
  98.923 ++	}
  98.924 ++    }
  98.925 ++
  98.926 ++  if (MUST_SAVE_REGISTER (RA_REGNO))
  98.927 ++    {
  98.928 ++      cfa_store_offset -= 4;
  98.929 ++      save_reg (RA_REGNO, cfa_store_offset, cfa_store_reg);
  98.930 ++    }
  98.931 ++  if (MUST_SAVE_REGISTER (FP_REGNO))
  98.932 ++    {
  98.933 ++      cfa_store_offset -= 4;
  98.934 ++      save_reg (FP_REGNO, cfa_store_offset, cfa_store_reg);
  98.935 ++    }
  98.936 ++
  98.937 ++  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
  98.938 ++    {
  98.939 ++      if (MUST_SAVE_REGISTER (i) && i != FP_REGNO && i != RA_REGNO)
  98.940 ++	{
  98.941 ++	  cfa_store_offset -= 4;
  98.942 ++	  save_reg (i, cfa_store_offset, cfa_store_reg);
  98.943 ++	}
  98.944 ++    }
  98.945 ++
  98.946 ++  if (frame_pointer_needed)
  98.947 ++    {
  98.948 ++      insn = emit_insn (gen_rtx_SET (SImode,
  98.949 ++				     gen_rtx_REG (SImode, FP_REGNO),
  98.950 ++				     gen_rtx_REG (SImode, SP_REGNO)));
  98.951 ++
  98.952 ++      RTX_FRAME_RELATED_P (insn) = 1;
  98.953 ++    }
  98.954 ++
  98.955 ++  /* If we are profiling, make sure no instructions are scheduled before
  98.956 ++     the call to mcount.  */
  98.957 ++  if (current_function_profile)
  98.958 ++    emit_insn (gen_blockage ());
  98.959 ++}
  98.960 ++
  98.961 ++void
  98.962 ++expand_epilogue (bool sibcall_p)
  98.963 ++{
  98.964 ++  rtx insn;
  98.965 ++  int i;
  98.966 ++  HOST_WIDE_INT total_frame_size;
  98.967 ++  int register_store_offset;
  98.968 ++
  98.969 ++  total_frame_size = compute_frame_size ();
  98.970 ++
  98.971 ++  if (!sibcall_p && nios2_can_use_return_insn ())
  98.972 ++    {
  98.973 ++      insn = emit_jump_insn (gen_return ());
  98.974 ++      return;
  98.975 ++    }
  98.976 ++
  98.977 ++  emit_insn (gen_blockage ());
  98.978 ++
  98.979 ++  register_store_offset =
  98.980 ++    cfun->machine->frame.save_regs_offset +
  98.981 ++    cfun->machine->frame.save_reg_rounded;
  98.982 ++
  98.983 ++  if (MUST_SAVE_REGISTER (RA_REGNO))
  98.984 ++    {
  98.985 ++      register_store_offset -= 4;
  98.986 ++      restore_reg (RA_REGNO, register_store_offset);
  98.987 ++    }
  98.988 ++
  98.989 ++  if (MUST_SAVE_REGISTER (FP_REGNO))
  98.990 ++    {
  98.991 ++      register_store_offset -= 4;
  98.992 ++      restore_reg (FP_REGNO, register_store_offset);
  98.993 ++    }
  98.994 ++
  98.995 ++  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
  98.996 ++    {
  98.997 ++      if (MUST_SAVE_REGISTER (i) && i != FP_REGNO && i != RA_REGNO)
  98.998 ++	{
  98.999 ++	  register_store_offset -= 4;
 98.1000 ++	  restore_reg (i, register_store_offset);
 98.1001 ++	}
 98.1002 ++    }
 98.1003 ++
 98.1004 ++  if (total_frame_size)
 98.1005 ++    {
 98.1006 ++      rtx sp_adjust;
 98.1007 ++
 98.1008 ++      if (TOO_BIG_OFFSET (total_frame_size))
 98.1009 ++        {
 98.1010 ++	  sp_adjust = gen_rtx_REG (SImode, TEMP_REG_NUM);
 98.1011 ++	  insn = emit_insn (gen_rtx_SET (SImode,
 98.1012 ++					 sp_adjust,
 98.1013 ++					 GEN_INT (total_frame_size)));
 98.1014 ++
 98.1015 ++      	}
 98.1016 ++      else
 98.1017 ++        {
 98.1018 ++	  sp_adjust = GEN_INT (total_frame_size);
 98.1019 ++	}
 98.1020 ++
 98.1021 ++      insn = gen_rtx_SET (SImode,
 98.1022 ++			  stack_pointer_rtx,
 98.1023 ++			  gen_rtx_PLUS (SImode,
 98.1024 ++					stack_pointer_rtx,
 98.1025 ++					sp_adjust));
 98.1026 ++      insn = emit_insn (insn);
 98.1027 ++    }
 98.1028 ++
 98.1029 ++
 98.1030 ++  if (!sibcall_p)
 98.1031 ++    {
 98.1032 ++      insn = emit_jump_insn (gen_return_from_epilogue (gen_rtx (REG, Pmode,
 98.1033 ++								RA_REGNO)));
 98.1034 ++    }
 98.1035 ++}
 98.1036 ++
 98.1037 ++
 98.1038 ++bool
 98.1039 ++nios2_function_ok_for_sibcall (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED)
 98.1040 ++{
 98.1041 ++  return true;
 98.1042 ++}
 98.1043 ++
 98.1044 ++
 98.1045 ++
 98.1046 ++
 98.1047 ++
 98.1048 ++/* ----------------------- *
 98.1049 ++ * Profiling
 98.1050 ++ * ----------------------- */
 98.1051 ++
 98.1052 ++void
 98.1053 ++function_profiler (FILE *file, int labelno)
 98.1054 ++{
 98.1055 ++  fprintf (file, "\t%s mcount begin, label: .LP%d\n", 
 98.1056 ++           ASM_COMMENT_START, labelno);
 98.1057 ++  fprintf (file, "\tnextpc\tr8\n");
 98.1058 ++  fprintf (file, "\tmov\tr9, ra\n");
 98.1059 ++  fprintf (file, "\tmovhi\tr10, %%hiadj(.LP%d)\n", labelno);
 98.1060 ++  fprintf (file, "\taddi\tr10, r10, %%lo(.LP%d)\n", labelno);
 98.1061 ++  fprintf (file, "\tcall\tmcount\n");
 98.1062 ++  fprintf (file, "\tmov\tra, r9\n");
 98.1063 ++  fprintf (file, "\t%s mcount end\n", ASM_COMMENT_START);
 98.1064 ++}
 98.1065 ++
 98.1066 ++
 98.1067 ++/***************************************
 98.1068 ++ * Stack Layout
 98.1069 ++ ***************************************/
 98.1070 ++
 98.1071 ++
 98.1072 ++void
 98.1073 ++dump_frame_size (FILE *file)
 98.1074 ++{
 98.1075 ++  fprintf (file, "\t%s Current Frame Info\n", ASM_COMMENT_START);
 98.1076 ++
 98.1077 ++  fprintf (file, "\t%s total_size = %ld\n", ASM_COMMENT_START,
 98.1078 ++	   cfun->machine->frame.total_size);
 98.1079 ++  fprintf (file, "\t%s var_size = %ld\n", ASM_COMMENT_START,
 98.1080 ++	   cfun->machine->frame.var_size);
 98.1081 ++  fprintf (file, "\t%s args_size = %ld\n", ASM_COMMENT_START,
 98.1082 ++	   cfun->machine->frame.args_size);
 98.1083 ++  fprintf (file, "\t%s save_reg_size = %d\n", ASM_COMMENT_START,
 98.1084 ++	   cfun->machine->frame.save_reg_size);
 98.1085 ++  fprintf (file, "\t%s save_reg_rounded = %d\n", ASM_COMMENT_START,
 98.1086 ++	   cfun->machine->frame.save_reg_rounded);
 98.1087 ++  fprintf (file, "\t%s initialized = %d\n", ASM_COMMENT_START,
 98.1088 ++	   cfun->machine->frame.initialized);
 98.1089 ++  fprintf (file, "\t%s num_regs = %d\n", ASM_COMMENT_START,
 98.1090 ++	   cfun->machine->frame.num_regs);
 98.1091 ++  fprintf (file, "\t%s save_regs_offset = %ld\n", ASM_COMMENT_START,
 98.1092 ++	   cfun->machine->frame.save_regs_offset);
 98.1093 ++  fprintf (file, "\t%s current_function_is_leaf = %d\n", ASM_COMMENT_START,
 98.1094 ++	   current_function_is_leaf);
 98.1095 ++  fprintf (file, "\t%s frame_pointer_needed = %d\n", ASM_COMMENT_START,
 98.1096 ++	   frame_pointer_needed);
 98.1097 ++  fprintf (file, "\t%s pretend_args_size = %d\n", ASM_COMMENT_START,
 98.1098 ++	   current_function_pretend_args_size);
 98.1099 ++
 98.1100 ++}
 98.1101 ++
 98.1102 ++
 98.1103 ++/* Return the bytes needed to compute the frame pointer from the current
 98.1104 ++   stack pointer.
 98.1105 ++*/
 98.1106 ++
 98.1107 ++HOST_WIDE_INT
 98.1108 ++compute_frame_size ()
 98.1109 ++{
 98.1110 ++  unsigned int regno;
 98.1111 ++  HOST_WIDE_INT var_size;	/* # of var. bytes allocated */
 98.1112 ++  HOST_WIDE_INT total_size;	/* # bytes that the entire frame takes up */
 98.1113 ++  HOST_WIDE_INT save_reg_size;	/* # bytes needed to store callee save regs */
 98.1114 ++  HOST_WIDE_INT save_reg_rounded;	
 98.1115 ++    /* # bytes needed to store callee save regs (rounded) */
 98.1116 ++  HOST_WIDE_INT out_args_size;	/* # bytes needed for outgoing args */
 98.1117 ++
 98.1118 ++  save_reg_size = 0;
 98.1119 ++  var_size = STACK_ALIGN (get_frame_size ());
 98.1120 ++  out_args_size = STACK_ALIGN (current_function_outgoing_args_size);
 98.1121 ++
 98.1122 ++  total_size = var_size + out_args_size;
 98.1123 ++
 98.1124 ++  /* Calculate space needed for gp registers.  */
 98.1125 ++  for (regno = 0; regno <= FIRST_PSEUDO_REGISTER; regno++)
 98.1126 ++    {
 98.1127 ++      if (MUST_SAVE_REGISTER (regno))
 98.1128 ++	{
 98.1129 ++	  save_reg_size += 4;
 98.1130 ++	}
 98.1131 ++    }
 98.1132 ++
 98.1133 ++  save_reg_rounded = STACK_ALIGN (save_reg_size);
 98.1134 ++  total_size += save_reg_rounded;
 98.1135 ++
 98.1136 ++  total_size += STACK_ALIGN (current_function_pretend_args_size);
 98.1137 ++
 98.1138 ++  /* Save other computed information.  */
 98.1139 ++  cfun->machine->frame.total_size = total_size;
 98.1140 ++  cfun->machine->frame.var_size = var_size;
 98.1141 ++  cfun->machine->frame.args_size = current_function_outgoing_args_size;
 98.1142 ++  cfun->machine->frame.save_reg_size = save_reg_size;
 98.1143 ++  cfun->machine->frame.save_reg_rounded = save_reg_rounded;
 98.1144 ++  cfun->machine->frame.initialized = reload_completed;
 98.1145 ++  cfun->machine->frame.num_regs = save_reg_size / UNITS_PER_WORD;
 98.1146 ++
 98.1147 ++  cfun->machine->frame.save_regs_offset
 98.1148 ++    = save_reg_rounded ? current_function_outgoing_args_size + var_size : 0;
 98.1149 ++
 98.1150 ++  return total_size;
 98.1151 ++}
 98.1152 ++
 98.1153 ++
 98.1154 ++int
 98.1155 ++nios2_initial_elimination_offset (int from, int to ATTRIBUTE_UNUSED)
 98.1156 ++{
 98.1157 ++  int offset;
 98.1158 ++
 98.1159 ++  /* Set OFFSET to the offset from the stack pointer.  */
 98.1160 ++  switch (from)
 98.1161 ++    {
 98.1162 ++    case FRAME_POINTER_REGNUM:
 98.1163 ++      offset = 0;
 98.1164 ++      break;
 98.1165 ++
 98.1166 ++    case ARG_POINTER_REGNUM:
 98.1167 ++      compute_frame_size ();
 98.1168 ++      offset = cfun->machine->frame.total_size;
 98.1169 ++      offset -= current_function_pretend_args_size;
 98.1170 ++      break;
 98.1171 ++
 98.1172 ++    case RETURN_ADDRESS_POINTER_REGNUM:
 98.1173 ++      compute_frame_size ();
 98.1174 ++      /* since the return address is always the first of the
 98.1175 ++         saved registers, return the offset to the beginning
 98.1176 ++         of the saved registers block */
 98.1177 ++      offset = cfun->machine->frame.save_regs_offset;
 98.1178 ++      break;
 98.1179 ++
 98.1180 ++    default:
 98.1181 ++      abort ();
 98.1182 ++    }
 98.1183 ++
 98.1184 ++  return offset;
 98.1185 ++}
 98.1186 ++
 98.1187 ++/* Return nonzero if this function is known to have a null epilogue.
 98.1188 ++   This allows the optimizer to omit jumps to jumps if no stack
 98.1189 ++   was created.  */
 98.1190 ++int
 98.1191 ++nios2_can_use_return_insn ()
 98.1192 ++{
 98.1193 ++  if (!reload_completed)
 98.1194 ++    return 0;
 98.1195 ++
 98.1196 ++  if (regs_ever_live[RA_REGNO] || current_function_profile)
 98.1197 ++    return 0;
 98.1198 ++
 98.1199 ++  if (cfun->machine->frame.initialized)
 98.1200 ++    return cfun->machine->frame.total_size == 0;
 98.1201 ++
 98.1202 ++  return compute_frame_size () == 0;
 98.1203 ++}
 98.1204 ++
 98.1205 ++
 98.1206 ++
 98.1207 ++
 98.1208 ++
 98.1209 ++/***************************************
 98.1210 ++ *
 98.1211 ++ ***************************************/
 98.1212 ++
 98.1213 ++const char *nios2_sys_nosys_string;    /* for -msys=nosys */
 98.1214 ++const char *nios2_sys_lib_string;    /* for -msys-lib= */
 98.1215 ++const char *nios2_sys_crt0_string;    /* for -msys-crt0= */
 98.1216 ++
 98.1217 ++void
 98.1218 ++override_options ()
 98.1219 ++{
 98.1220 ++  /* Function to allocate machine-dependent function status.  */
 98.1221 ++  init_machine_status = &nios2_init_machine_status;
 98.1222 ++
 98.1223 ++  nios2_section_threshold 
 98.1224 ++    = g_switch_set ? g_switch_value : NIOS2_DEFAULT_GVALUE;
 98.1225 ++
 98.1226 ++  if (nios2_sys_nosys_string && *nios2_sys_nosys_string)
 98.1227 ++    {
 98.1228 ++      error ("invalid option '-msys=nosys%s'", nios2_sys_nosys_string);
 98.1229 ++    }
 98.1230 ++
 98.1231 ++  /* If we don't have mul, we don't have mulx either! */
 98.1232 ++  if (!TARGET_HAS_MUL && TARGET_HAS_MULX) 
 98.1233 ++    {
 98.1234 ++      target_flags &= ~HAS_MULX_FLAG;
 98.1235 ++    }
 98.1236 ++
 98.1237 ++}
 98.1238 ++
 98.1239 ++void
 98.1240 ++optimization_options (int level, int size)
 98.1241 ++{
 98.1242 ++  if (level || size)
 98.1243 ++    {
 98.1244 ++      target_flags |= INLINE_MEMCPY_FLAG;
 98.1245 ++    }
 98.1246 ++
 98.1247 ++  if (level >= 3 && !size)
 98.1248 ++    {
 98.1249 ++      target_flags |= FAST_SW_DIV_FLAG;
 98.1250 ++    }
 98.1251 ++}
 98.1252 ++
 98.1253 ++/* Allocate a chunk of memory for per-function machine-dependent data.  */
 98.1254 ++static struct machine_function *
 98.1255 ++nios2_init_machine_status ()
 98.1256 ++{
 98.1257 ++  return ((struct machine_function *)
 98.1258 ++	  ggc_alloc_cleared (sizeof (struct machine_function)));
 98.1259 ++}
 98.1260 ++
 98.1261 ++
 98.1262 ++
 98.1263 ++/*****************
 98.1264 ++ * Describing Relative Costs of Operations
 98.1265 ++ *****************/
 98.1266 ++
 98.1267 ++/* Compute a (partial) cost for rtx X.  Return true if the complete
 98.1268 ++   cost has been computed, and false if subexpressions should be
 98.1269 ++   scanned.  In either case, *TOTAL contains the cost result.  */
 98.1270 ++
 98.1271 ++
 98.1272 ++
 98.1273 ++static bool
 98.1274 ++nios2_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total)
 98.1275 ++{
 98.1276 ++  switch (code)
 98.1277 ++    {
 98.1278 ++      case CONST_INT:
 98.1279 ++	if (INTVAL (x) == 0)
 98.1280 ++	  {
 98.1281 ++	    *total = COSTS_N_INSNS (0);
 98.1282 ++	    return true;
 98.1283 ++	  }
 98.1284 ++	else if (SMALL_INT (INTVAL (x))
 98.1285 ++		|| SMALL_INT_UNSIGNED (INTVAL (x))
 98.1286 ++		|| UPPER16_INT (INTVAL (x)))
 98.1287 ++	  {
 98.1288 ++	    *total = COSTS_N_INSNS (2);
 98.1289 ++	    return true;
 98.1290 ++	  }
 98.1291 ++	else
 98.1292 ++	  {
 98.1293 ++	    *total = COSTS_N_INSNS (4);
 98.1294 ++	    return true;
 98.1295 ++	  }
 98.1296 ++
 98.1297 ++      case LABEL_REF:
 98.1298 ++      case SYMBOL_REF:
 98.1299 ++	/* ??? gp relative stuff will fit in here */
 98.1300 ++	/* fall through */
 98.1301 ++      case CONST:
 98.1302 ++      case CONST_DOUBLE:
 98.1303 ++	{
 98.1304 ++	  *total = COSTS_N_INSNS (4);
 98.1305 ++	  return true;
 98.1306 ++	}
 98.1307 ++
 98.1308 ++      case MULT:
 98.1309 ++	{
 98.1310 ++	  *total = COSTS_N_INSNS (1);
 98.1311 ++	  return false;
 98.1312 ++	}
 98.1313 ++      case SIGN_EXTEND:
 98.1314 ++	{
 98.1315 ++	  *total = COSTS_N_INSNS (3);
 98.1316 ++	  return false;
 98.1317 ++	}
 98.1318 ++      case ZERO_EXTEND:
 98.1319 ++	{
 98.1320 ++	  *total = COSTS_N_INSNS (1);
 98.1321 ++	  return false;
 98.1322 ++	}
 98.1323 ++
 98.1324 ++    default:
 98.1325 ++      return false;
 98.1326 ++    }
 98.1327 ++}
 98.1328 ++
 98.1329 ++
 98.1330 ++/***************************************
 98.1331 ++ * INSTRUCTION SUPPORT
 98.1332 ++ *
 98.1333 ++ * These functions are used within the Machine Description to
 98.1334 ++ * handle common or complicated output and expansions from
 98.1335 ++ * instructions.
 98.1336 ++ ***************************************/
 98.1337 ++
 98.1338 ++int
 98.1339 ++nios2_emit_move_sequence (rtx *operands, enum machine_mode mode)
 98.1340 ++{
 98.1341 ++  rtx to = operands[0];
 98.1342 ++  rtx from = operands[1];
 98.1343 ++
 98.1344 ++  if (!register_operand (to, mode) && !reg_or_0_operand (from, mode))
 98.1345 ++    {
 98.1346 ++      if (no_new_pseudos)
 98.1347 ++	internal_error ("Trying to force_reg no_new_pseudos == 1");
 98.1348 ++      from = copy_to_mode_reg (mode, from);
 98.1349 ++    }
 98.1350 ++
 98.1351 ++  operands[0] = to;
 98.1352 ++  operands[1] = from;
 98.1353 ++  return 0;
 98.1354 ++}
 98.1355 ++
 98.1356 ++/* Divide Support */
 98.1357 ++
 98.1358 ++/*
 98.1359 ++  If -O3 is used, we want to output a table lookup for
 98.1360 ++  divides between small numbers (both num and den >= 0
 98.1361 ++  and < 0x10). The overhead of this method in the worse
 98.1362 ++  case is 40 bytes in the text section (10 insns) and
 98.1363 ++  256 bytes in the data section. Additional divides do
 98.1364 ++  not incur additional penalties in the data section.
 98.1365 ++
 98.1366 ++  Code speed is improved for small divides by about 5x
 98.1367 ++  when using this method in the worse case (~9 cycles
 98.1368 ++  vs ~45). And in the worse case divides not within the
 98.1369 ++  table are penalized by about 10% (~5 cycles vs ~45).
 98.1370 ++  However in the typical case the penalty is not as bad
 98.1371 ++  because doing the long divide in only 45 cycles is
 98.1372 ++  quite optimistic.
 98.1373 ++
 98.1374 ++  ??? It would be nice to have some benchmarks other
 98.1375 ++  than Dhrystone to back this up.
 98.1376 ++
 98.1377 ++  This bit of expansion is to create this instruction
 98.1378 ++  sequence as rtl.
 98.1379 ++	or	$8, $4, $5
 98.1380 ++	slli	$9, $4, 4
 98.1381 ++	cmpgeui	$3, $8, 16
 98.1382 ++	beq	$3, $0, .L3
 98.1383 ++	or	$10, $9, $5
 98.1384 ++	add	$12, $11, divide_table
 98.1385 ++	ldbu	$2, 0($12)
 98.1386 ++	br	.L1
 98.1387 ++.L3:
 98.1388 ++	call	slow_div
 98.1389 ++.L1:
 98.1390 ++#	continue here with result in $2
 98.1391 ++
 98.1392 ++  ??? Ideally I would like the emit libcall block to contain
 98.1393 ++  all of this code, but I don't know how to do that. What it
 98.1394 ++  means is that if the divide can be eliminated, it may not
 98.1395 ++  completely disappear.
 98.1396 ++
 98.1397 ++  ??? The __divsi3_table label should ideally be moved out
 98.1398 ++  of this block and into a global. If it is placed into the
 98.1399 ++  sdata section we can save even more cycles by doing things
 98.1400 ++  gp relative.
 98.1401 ++*/
 98.1402 ++int
 98.1403 ++nios2_emit_expensive_div (rtx *operands, enum machine_mode mode)
 98.1404 ++{
 98.1405 ++  rtx or_result, shift_left_result;
 98.1406 ++  rtx lookup_value;
 98.1407 ++  rtx lab1, lab3;
 98.1408 ++  rtx insns;
 98.1409 ++  rtx libfunc;
 98.1410 ++  rtx final_result;
 98.1411 ++  rtx tmp;
 98.1412 ++
 98.1413 ++  /* it may look a little generic, but only SImode
 98.1414 ++     is supported for now */
 98.1415 ++  if (mode != SImode)
 98.1416 ++    abort ();
 98.1417 ++
 98.1418 ++  libfunc = sdiv_optab->handlers[(int) SImode].libfunc;
 98.1419 ++
 98.1420 ++
 98.1421 ++
 98.1422 ++  lab1 = gen_label_rtx ();
 98.1423 ++  lab3 = gen_label_rtx ();
 98.1424 ++
 98.1425 ++  or_result = expand_simple_binop (SImode, IOR,
 98.1426 ++				   operands[1], operands[2],
 98.1427 ++				   0, 0, OPTAB_LIB_WIDEN);
 98.1428 ++
 98.1429 ++  emit_cmp_and_jump_insns (or_result, GEN_INT (15), GTU, 0,
 98.1430 ++			   GET_MODE (or_result), 0, lab3);
 98.1431 ++  JUMP_LABEL (get_last_insn ()) = lab3;
 98.1432 ++
 98.1433 ++  shift_left_result = expand_simple_binop (SImode, ASHIFT,
 98.1434 ++					   operands[1], GEN_INT (4),
 98.1435 ++					   0, 0, OPTAB_LIB_WIDEN);
 98.1436 ++
 98.1437 ++  lookup_value = expand_simple_binop (SImode, IOR,
 98.1438 ++				      shift_left_result, operands[2],
 98.1439 ++				      0, 0, OPTAB_LIB_WIDEN);
 98.1440 ++
 98.1441 ++  convert_move (operands[0],
 98.1442 ++		gen_rtx (MEM, QImode,
 98.1443 ++			 gen_rtx (PLUS, SImode,
 98.1444 ++				  lookup_value,
 98.1445 ++				  gen_rtx_SYMBOL_REF (SImode, "__divsi3_table"))),
 98.1446 ++		1);
 98.1447 ++
 98.1448 ++
 98.1449 ++  tmp = emit_jump_insn (gen_jump (lab1));
 98.1450 ++  JUMP_LABEL (tmp) = lab1;
 98.1451 ++  emit_barrier ();
 98.1452 ++
 98.1453 ++  emit_label (lab3);
 98.1454 ++  LABEL_NUSES (lab3) = 1;
 98.1455 ++
 98.1456 ++  start_sequence ();
 98.1457 ++  final_result = emit_library_call_value (libfunc, NULL_RTX,
 98.1458 ++					  LCT_CONST, SImode, 2,
 98.1459 ++					  operands[1], SImode,
 98.1460 ++					  operands[2], SImode);
 98.1461 ++
 98.1462 ++
 98.1463 ++  insns = get_insns ();
 98.1464 ++  end_sequence ();
 98.1465 ++  emit_libcall_block (insns, operands[0], final_result,
 98.1466 ++		      gen_rtx (DIV, SImode, operands[1], operands[2]));
 98.1467 ++
 98.1468 ++  emit_label (lab1);
 98.1469 ++  LABEL_NUSES (lab1) = 1;
 98.1470 ++  return 1;
 98.1471 ++}
 98.1472 ++
 98.1473 ++/* Branches/Compares */
 98.1474 ++
 98.1475 ++/* the way of handling branches/compares
 98.1476 ++   in gcc is heavily borrowed from MIPS */
 98.1477 ++
 98.1478 ++enum internal_test
 98.1479 ++{
 98.1480 ++  ITEST_EQ,
 98.1481 ++  ITEST_NE,
 98.1482 ++  ITEST_GT,
 98.1483 ++  ITEST_GE,
 98.1484 ++  ITEST_LT,
 98.1485 ++  ITEST_LE,
 98.1486 ++  ITEST_GTU,
 98.1487 ++  ITEST_GEU,
 98.1488 ++  ITEST_LTU,
 98.1489 ++  ITEST_LEU,
 98.1490 ++  ITEST_MAX
 98.1491 ++};
 98.1492 ++
 98.1493 ++static enum internal_test map_test_to_internal_test (enum rtx_code);
 98.1494 ++
 98.1495 ++/* Cached operands, and operator to compare for use in set/branch/trap
 98.1496 ++   on condition codes.  */
 98.1497 ++rtx branch_cmp[2];
 98.1498 ++enum cmp_type branch_type;
 98.1499 ++
 98.1500 ++/* Make normal rtx_code into something we can index from an array */
 98.1501 ++
 98.1502 ++static enum internal_test
 98.1503 ++map_test_to_internal_test (enum rtx_code test_code)
 98.1504 ++{
 98.1505 ++  enum internal_test test = ITEST_MAX;
 98.1506 ++
 98.1507 ++  switch (test_code)
 98.1508 ++    {
 98.1509 ++    case EQ:
 98.1510 ++      test = ITEST_EQ;
 98.1511 ++      break;
 98.1512 ++    case NE:
 98.1513 ++      test = ITEST_NE;
 98.1514 ++      break;
 98.1515 ++    case GT:
 98.1516 ++      test = ITEST_GT;
 98.1517 ++      break;
 98.1518 ++    case GE:
 98.1519 ++      test = ITEST_GE;
 98.1520 ++      break;
 98.1521 ++    case LT:
 98.1522 ++      test = ITEST_LT;
 98.1523 ++      break;
 98.1524 ++    case LE:
 98.1525 ++      test = ITEST_LE;
 98.1526 ++      break;
 98.1527 ++    case GTU:
 98.1528 ++      test = ITEST_GTU;
 98.1529 ++      break;
 98.1530 ++    case GEU:
 98.1531 ++      test = ITEST_GEU;
 98.1532 ++      break;
 98.1533 ++    case LTU:
 98.1534 ++      test = ITEST_LTU;
 98.1535 ++      break;
 98.1536 ++    case LEU:
 98.1537 ++      test = ITEST_LEU;
 98.1538 ++      break;
 98.1539 ++    default:
 98.1540 ++      break;
 98.1541 ++    }
 98.1542 ++
 98.1543 ++  return test;
 98.1544 ++}
 98.1545 ++
 98.1546 ++/* Generate the code to compare (and possibly branch) two integer values
 98.1547 ++   TEST_CODE is the comparison code we are trying to emulate 
 98.1548 ++     (or implement directly)
 98.1549 ++   RESULT is where to store the result of the comparison, 
 98.1550 ++     or null to emit a branch
 98.1551 ++   CMP0 CMP1 are the two comparison operands
 98.1552 ++   DESTINATION is the destination of the branch, or null to only compare
 98.1553 ++   */
 98.1554 ++
 98.1555 ++void
 98.1556 ++gen_int_relational (enum rtx_code test_code, /* relational test (EQ, etc) */
 98.1557 ++		    rtx result,		/* result to store comp. or 0 if branch */
 98.1558 ++		    rtx cmp0,		/* first operand to compare */
 98.1559 ++		    rtx cmp1,		/* second operand to compare */
 98.1560 ++		    rtx destination)	/* destination of the branch, or 0 if compare */
 98.1561 ++{
 98.1562 ++  struct cmp_info
 98.1563 ++  {
 98.1564 ++    /* for register (or 0) compares */
 98.1565 ++    enum rtx_code test_code_reg;	/* code to use in instruction (LT vs. LTU) */
 98.1566 ++    int reverse_regs;		/* reverse registers in test */
 98.1567 ++
 98.1568 ++    /* for immediate compares */
 98.1569 ++    enum rtx_code test_code_const;	
 98.1570 ++         /* code to use in instruction (LT vs. LTU) */
 98.1571 ++    int const_low;		/* low bound of constant we can accept */
 98.1572 ++    int const_high;		/* high bound of constant we can accept */
 98.1573 ++    int const_add;		/* constant to add */
 98.1574 ++
 98.1575 ++    /* generic info */
 98.1576 ++    int unsignedp;		/* != 0 for unsigned comparisons.  */
 98.1577 ++  };
 98.1578 ++
 98.1579 ++  static const struct cmp_info info[(int) ITEST_MAX] = {
 98.1580 ++
 98.1581 ++    {EQ, 0, EQ, -32768, 32767, 0, 0}, /* EQ  */
 98.1582 ++    {NE, 0, NE, -32768, 32767, 0, 0}, /* NE  */
 98.1583 ++
 98.1584 ++    {LT, 1, GE, -32769, 32766, 1, 0}, /* GT  */
 98.1585 ++    {GE, 0, GE, -32768, 32767, 0, 0}, /* GE  */
 98.1586 ++    {LT, 0, LT, -32768, 32767, 0, 0}, /* LT  */
 98.1587 ++    {GE, 1, LT, -32769, 32766, 1, 0}, /* LE  */
 98.1588 ++
 98.1589 ++    {LTU, 1, GEU, 0, 65534, 1, 0}, /* GTU */
 98.1590 ++    {GEU, 0, GEU, 0, 65535, 0, 0}, /* GEU */
 98.1591 ++    {LTU, 0, LTU, 0, 65535, 0, 0}, /* LTU */
 98.1592 ++    {GEU, 1, LTU, 0, 65534, 1, 0}, /* LEU */
 98.1593 ++  };
 98.1594 ++
 98.1595 ++  enum internal_test test;
 98.1596 ++  enum machine_mode mode;
 98.1597 ++  const struct cmp_info *p_info;
 98.1598 ++  int branch_p;
 98.1599 ++
 98.1600 ++
 98.1601 ++
 98.1602 ++
 98.1603 ++  test = map_test_to_internal_test (test_code);
 98.1604 ++  if (test == ITEST_MAX)
 98.1605 ++    abort ();
 98.1606 ++
 98.1607 ++  p_info = &info[(int) test];
 98.1608 ++
 98.1609 ++  mode = GET_MODE (cmp0);
 98.1610 ++  if (mode == VOIDmode)
 98.1611 ++    mode = GET_MODE (cmp1);
 98.1612 ++
 98.1613 ++  branch_p = (destination != 0);
 98.1614 ++
 98.1615 ++  /* We can't, under any circumstances, have const_ints in cmp0
 98.1616 ++     ??? Actually we could have const0 */
 98.1617 ++  if (GET_CODE (cmp0) == CONST_INT)
 98.1618 ++    cmp0 = force_reg (mode, cmp0);
 98.1619 ++
 98.1620 ++  /* if the comparison is against an int not in legal range
 98.1621 ++     move it into a register */
 98.1622 ++  if (GET_CODE (cmp1) == CONST_INT)
 98.1623 ++    {
 98.1624 ++      HOST_WIDE_INT value = INTVAL (cmp1);
 98.1625 ++
 98.1626 ++      if (value < p_info->const_low || value > p_info->const_high)
 98.1627 ++	cmp1 = force_reg (mode, cmp1);
 98.1628 ++    }
 98.1629 ++
 98.1630 ++  /* Comparison to constants, may involve adding 1 to change a GT into GE.
 98.1631 ++     Comparison between two registers, may involve switching operands.  */
 98.1632 ++  if (GET_CODE (cmp1) == CONST_INT)
 98.1633 ++    {
 98.1634 ++      if (p_info->const_add != 0)
 98.1635 ++	{
 98.1636 ++	  HOST_WIDE_INT new = INTVAL (cmp1) + p_info->const_add;
 98.1637 ++
 98.1638 ++	  /* If modification of cmp1 caused overflow,
 98.1639 ++	     we would get the wrong answer if we follow the usual path;
 98.1640 ++	     thus, x > 0xffffffffU would turn into x > 0U.  */
 98.1641 ++	  if ((p_info->unsignedp
 98.1642 ++	       ? (unsigned HOST_WIDE_INT) new >
 98.1643 ++	       (unsigned HOST_WIDE_INT) INTVAL (cmp1)
 98.1644 ++	       : new > INTVAL (cmp1)) != (p_info->const_add > 0))
 98.1645 ++	    {
 98.1646 ++	      /* ??? This case can never happen with the current numbers,
 98.1647 ++	         but I am paranoid and would rather an abort than
 98.1648 ++	         a bug I will never find */
 98.1649 ++	      abort ();
 98.1650 ++	    }
 98.1651 ++	  else
 98.1652 ++	    cmp1 = GEN_INT (new);
 98.1653 ++	}
 98.1654 ++    }
 98.1655 ++
 98.1656 ++  else if (p_info->reverse_regs)
 98.1657 ++    {
 98.1658 ++      rtx temp = cmp0;
 98.1659 ++      cmp0 = cmp1;
 98.1660 ++      cmp1 = temp;
 98.1661 ++    }
 98.1662 ++
 98.1663 ++
 98.1664 ++
 98.1665 ++  if (branch_p)
 98.1666 ++    {
 98.1667 ++      if (register_operand (cmp0, mode) && register_operand (cmp1, mode))
 98.1668 ++	{
 98.1669 ++	  rtx insn;
 98.1670 ++	  rtx cond = gen_rtx (p_info->test_code_reg, mode, cmp0, cmp1);
 98.1671 ++	  rtx label = gen_rtx_LABEL_REF (VOIDmode, destination);
 98.1672 ++
 98.1673 ++	  insn = gen_rtx_SET (VOIDmode, pc_rtx,
 98.1674 ++			      gen_rtx_IF_THEN_ELSE (VOIDmode,
 98.1675 ++						    cond, label, pc_rtx));
 98.1676 ++	  emit_jump_insn (insn);
 98.1677 ++	}
 98.1678 ++      else
 98.1679 ++	{
 98.1680 ++	  rtx cond, label;
 98.1681 ++
 98.1682 ++	  result = gen_reg_rtx (mode);
 98.1683 ++
 98.1684 ++	  emit_move_insn (result,
 98.1685 ++			  gen_rtx (p_info->test_code_const, mode, cmp0,
 98.1686 ++				   cmp1));
 98.1687 ++
 98.1688 ++	  cond = gen_rtx (NE, mode, result, const0_rtx);
 98.1689 ++	  label = gen_rtx_LABEL_REF (VOIDmode, destination);
 98.1690 ++
 98.1691 ++	  emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
 98.1692 ++				       gen_rtx_IF_THEN_ELSE (VOIDmode,
 98.1693 ++							     cond,
 98.1694 ++							     label, pc_rtx)));
 98.1695 ++	}
 98.1696 ++    }
 98.1697 ++  else
 98.1698 ++    {
 98.1699 ++      if (register_operand (cmp0, mode) && register_operand (cmp1, mode))
 98.1700 ++	{
 98.1701 ++	  emit_move_insn (result,
 98.1702 ++			  gen_rtx (p_info->test_code_reg, mode, cmp0, cmp1));
 98.1703 ++	}
 98.1704 ++      else
 98.1705 ++	{
 98.1706 ++	  emit_move_insn (result,
 98.1707 ++			  gen_rtx (p_info->test_code_const, mode, cmp0,
 98.1708 ++				   cmp1));
 98.1709 ++	}
 98.1710 ++    }
 98.1711 ++
 98.1712 ++}
 98.1713 ++
 98.1714 ++
 98.1715 ++/* ??? For now conditional moves are only supported
 98.1716 ++   when the mode of the operands being compared are
 98.1717 ++   the same as the ones being moved */
 98.1718 ++
 98.1719 ++void
 98.1720 ++gen_conditional_move (rtx *operands, enum machine_mode mode)
 98.1721 ++{
 98.1722 ++  rtx insn, cond;
 98.1723 ++  rtx cmp_reg = gen_reg_rtx (mode);
 98.1724 ++  enum rtx_code cmp_code = GET_CODE (operands[1]);
 98.1725 ++  enum rtx_code move_code = EQ;
 98.1726 ++
 98.1727 ++  /* emit a comparison if it is not "simple".
 98.1728 ++     Simple comparisons are X eq 0 and X ne 0 */
 98.1729 ++  if ((cmp_code == EQ || cmp_code == NE) && branch_cmp[1] == const0_rtx)
 98.1730 ++    {
 98.1731 ++      cmp_reg = branch_cmp[0];
 98.1732 ++      move_code = cmp_code;
 98.1733 ++    }
 98.1734 ++  else if ((cmp_code == EQ || cmp_code == NE) && branch_cmp[0] == const0_rtx)
 98.1735 ++    {
 98.1736 ++      cmp_reg = branch_cmp[1];
 98.1737 ++      move_code = cmp_code == EQ ? NE : EQ;
 98.1738 ++    }
 98.1739 ++  else
 98.1740 ++    gen_int_relational (cmp_code, cmp_reg, branch_cmp[0], branch_cmp[1],
 98.1741 ++			NULL_RTX);
 98.1742 ++
 98.1743 ++  cond = gen_rtx (move_code, VOIDmode, cmp_reg, CONST0_RTX (mode));
 98.1744 ++  insn = gen_rtx_SET (mode, operands[0],
 98.1745 ++		      gen_rtx_IF_THEN_ELSE (mode,
 98.1746 ++					    cond, operands[2], operands[3]));
 98.1747 ++  emit_insn (insn);
 98.1748 ++}
 98.1749 ++
 98.1750 ++/*******************
 98.1751 ++ * Addressing Modes
 98.1752 ++ *******************/
 98.1753 ++
 98.1754 ++int
 98.1755 ++nios2_legitimate_address (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED, 
 98.1756 ++                          int strict)
 98.1757 ++{
 98.1758 ++  int ret_val = 0;
 98.1759 ++
 98.1760 ++  switch (GET_CODE (operand))
 98.1761 ++    {
 98.1762 ++      /* direct.  */
 98.1763 ++    case SYMBOL_REF:
 98.1764 ++      if (SYMBOL_REF_IN_NIOS2_SMALL_DATA_P (operand))
 98.1765 ++        {
 98.1766 ++          ret_val = 1;
 98.1767 ++          break;
 98.1768 ++	}
 98.1769 ++      /* else, fall through */
 98.1770 ++    case LABEL_REF:
 98.1771 ++    case CONST_INT:
 98.1772 ++    case CONST:
 98.1773 ++    case CONST_DOUBLE:
 98.1774 ++      /* ??? In here I need to add gp addressing */
 98.1775 ++      ret_val = 0;
 98.1776 ++
 98.1777 ++      break;
 98.1778 ++
 98.1779 ++      /* Register indirect.  */
 98.1780 ++    case REG:
 98.1781 ++      ret_val = REG_OK_FOR_BASE_P2 (operand, strict);
 98.1782 ++      break;
 98.1783 ++
 98.1784 ++      /* Register indirect with displacement */
 98.1785 ++    case PLUS:
 98.1786 ++      {
 98.1787 ++	rtx op0 = XEXP (operand, 0);
 98.1788 ++	rtx op1 = XEXP (operand, 1);
 98.1789 ++
 98.1790 ++	if (REG_P (op0) && REG_P (op1))
 98.1791 ++	  ret_val = 0;
 98.1792 ++	else if (REG_P (op0) && CONSTANT_P (op1))
 98.1793 ++	  ret_val = REG_OK_FOR_BASE_P2 (op0, strict)
 98.1794 ++	    && SMALL_INT (INTVAL (op1));
 98.1795 ++	else if (REG_P (op1) && CONSTANT_P (op0))
 98.1796 ++	  ret_val = REG_OK_FOR_BASE_P2 (op1, strict)
 98.1797 ++	    && SMALL_INT (INTVAL (op0));
 98.1798 ++	else
 98.1799 ++	  ret_val = 0;
 98.1800 ++      }
 98.1801 ++      break;
 98.1802 ++
 98.1803 ++    default:
 98.1804 ++      ret_val = 0;
 98.1805 ++      break;
 98.1806 ++    }
 98.1807 ++
 98.1808 ++  return ret_val;
 98.1809 ++}
 98.1810 ++
 98.1811 ++/* Return true if EXP should be placed in the small data section.  */
 98.1812 ++
 98.1813 ++static bool
 98.1814 ++nios2_in_small_data_p (tree exp)
 98.1815 ++{
 98.1816 ++  /* We want to merge strings, so we never consider them small data.  */
 98.1817 ++  if (TREE_CODE (exp) == STRING_CST)
 98.1818 ++    return false;
 98.1819 ++
 98.1820 ++  if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
 98.1821 ++    {
 98.1822 ++      const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
 98.1823 ++      /* ??? these string names need moving into 
 98.1824 ++         an array in some header file */
 98.1825 ++      if (nios2_section_threshold > 0
 98.1826 ++          && (strcmp (section, ".sbss") == 0
 98.1827 ++	      || strncmp (section, ".sbss.", 6) == 0
 98.1828 ++	      || strcmp (section, ".sdata") == 0
 98.1829 ++	      || strncmp (section, ".sdata.", 7) == 0))
 98.1830 ++	return true;
 98.1831 ++    }
 98.1832 ++  else if (TREE_CODE (exp) == VAR_DECL)
 98.1833 ++    {
 98.1834 ++      HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp));
 98.1835 ++
 98.1836 ++      /* If this is an incomplete type with size 0, then we can't put it
 98.1837 ++         in sdata because it might be too big when completed.  */
 98.1838 ++      if (size > 0 && size <= nios2_section_threshold)
 98.1839 ++	return true;
 98.1840 ++    }
 98.1841 ++
 98.1842 ++  return false;
 98.1843 ++}
 98.1844 ++
 98.1845 ++static void
 98.1846 ++nios2_encode_section_info (tree decl, rtx rtl, int first)
 98.1847 ++{
 98.1848 ++
 98.1849 ++  rtx symbol;
 98.1850 ++  int flags;
 98.1851 ++
 98.1852 ++  default_encode_section_info (decl, rtl, first);
 98.1853 ++  
 98.1854 ++  /* Careful not to prod global register variables.  */
 98.1855 ++  if (GET_CODE (rtl) != MEM)
 98.1856 ++    return;
 98.1857 ++  symbol = XEXP (rtl, 0);
 98.1858 ++  if (GET_CODE (symbol) != SYMBOL_REF)
 98.1859 ++    return;
 98.1860 ++
 98.1861 ++  flags = SYMBOL_REF_FLAGS (symbol);
 98.1862 ++    
 98.1863 ++  /* We don't want weak variables to be addressed with gp in case they end up with
 98.1864 ++     value 0 which is not within 2^15 of $gp */
 98.1865 ++  if (DECL_P (decl) && DECL_WEAK (decl))
 98.1866 ++    flags |= SYMBOL_FLAG_WEAK_DECL;
 98.1867 ++
 98.1868 ++  SYMBOL_REF_FLAGS (symbol) = flags;
 98.1869 ++}
 98.1870 ++
 98.1871 ++
 98.1872 ++static unsigned int
 98.1873 ++nios2_section_type_flags (tree decl, const char *name, int reloc)
 98.1874 ++{
 98.1875 ++  unsigned int flags;
 98.1876 ++
 98.1877 ++  flags = default_section_type_flags (decl, name, reloc);
 98.1878 ++
 98.1879 ++  /* ??? these string names need moving into an array in some header file */
 98.1880 ++  if (strcmp (name, ".sbss") == 0
 98.1881 ++      || strncmp (name, ".sbss.", 6) == 0
 98.1882 ++      || strcmp (name, ".sdata") == 0
 98.1883 ++      || strncmp (name, ".sdata.", 7) == 0)
 98.1884 ++    flags |= SECTION_SMALL;
 98.1885 ++
 98.1886 ++  return flags;
 98.1887 ++}
 98.1888 ++
 98.1889 ++
 98.1890 ++
 98.1891 ++
 98.1892 ++/*****************************************
 98.1893 ++ * Defining the Output Assembler Language
 98.1894 ++ *****************************************/
 98.1895 ++
 98.1896 ++/* -------------- *
 98.1897 ++ * Output of Data
 98.1898 ++ * -------------- */
 98.1899 ++
 98.1900 ++
 98.1901 ++/* -------------------------------- *
 98.1902 ++ * Output of Assembler Instructions
 98.1903 ++ * -------------------------------- */
 98.1904 ++
 98.1905 ++
 98.1906 ++/* print the operand OP to file stream
 98.1907 ++   FILE modified by LETTER. LETTER
 98.1908 ++   can be one of:
 98.1909 ++     i: print "i" if OP is an immediate, except 0
 98.1910 ++     o: print "io" if OP is volatile
 98.1911 ++
 98.1912 ++     z: for const0_rtx print $0 instead of 0
 98.1913 ++     H: for %hiadj
 98.1914 ++     L: for %lo
 98.1915 ++     U: for upper half of 32 bit value
 98.1916 ++ */
 98.1917 ++
 98.1918 ++void
 98.1919 ++nios2_print_operand (FILE *file, rtx op, int letter)
 98.1920 ++{
 98.1921 ++
 98.1922 ++  switch (letter)
 98.1923 ++    {
 98.1924 ++    case 'i':
 98.1925 ++      if (CONSTANT_P (op) && (op != const0_rtx))
 98.1926 ++	fprintf (file, "i");
 98.1927 ++      return;
 98.1928 ++
 98.1929 ++    case 'o':
 98.1930 ++      if (GET_CODE (op) == MEM
 98.1931 ++          && ((MEM_VOLATILE_P (op) && !TARGET_CACHE_VOLATILE)
 98.1932 ++              || TARGET_BYPASS_CACHE))
 98.1933 ++	fprintf (file, "io");
 98.1934 ++      return;
 98.1935 ++
 98.1936 ++    default:
 98.1937 ++      break;
 98.1938 ++    }
 98.1939 ++
 98.1940 ++  if (comparison_operator (op, VOIDmode))
 98.1941 ++    {
 98.1942 ++      if (letter == 0)
 98.1943 ++	{
 98.1944 ++	  fprintf (file, "%s", GET_RTX_NAME (GET_CODE (op)));
 98.1945 ++	  return;
 98.1946 ++	}
 98.1947 ++    }
 98.1948 ++
 98.1949 ++
 98.1950 ++  switch (GET_CODE (op))
 98.1951 ++    {
 98.1952 ++    case REG:
 98.1953 ++      if (letter == 0 || letter == 'z')
 98.1954 ++	{
 98.1955 ++	  fprintf (file, "%s", reg_names[REGNO (op)]);
 98.1956 ++	  return;
 98.1957 ++	}
 98.1958 ++
 98.1959 ++    case CONST_INT:
 98.1960 ++      if (INTVAL (op) == 0 && letter == 'z')
 98.1961 ++	{
 98.1962 ++	  fprintf (file, "zero");
 98.1963 ++	  return;
 98.1964 ++	}
 98.1965 ++      else if (letter == 'U')
 98.1966 ++	{
 98.1967 ++	  HOST_WIDE_INT val = INTVAL (op);
 98.1968 ++	  rtx new_op;
 98.1969 ++	  val = (val / 65536) & 0xFFFF;
 98.1970 ++	  new_op = GEN_INT (val);
 98.1971 ++	  output_addr_const (file, new_op);
 98.1972 ++	  return;
 98.1973 ++	}
 98.1974 ++
 98.1975 ++      /* else, fall through */
 98.1976 ++    case CONST:
 98.1977 ++    case LABEL_REF:
 98.1978 ++    case SYMBOL_REF:
 98.1979 ++    case CONST_DOUBLE:
 98.1980 ++      if (letter == 0 || letter == 'z')
 98.1981 ++	{
 98.1982 ++	  output_addr_const (file, op);
 98.1983 ++	  return;
 98.1984 ++	}
 98.1985 ++      else if (letter == 'H')
 98.1986 ++	{
 98.1987 ++	  fprintf (file, "%%hiadj(");
 98.1988 ++	  output_addr_const (file, op);
 98.1989 ++	  fprintf (file, ")");
 98.1990 ++	  return;
 98.1991 ++	}
 98.1992 ++      else if (letter == 'L')
 98.1993 ++	{
 98.1994 ++	  fprintf (file, "%%lo(");
 98.1995 ++	  output_addr_const (file, op);
 98.1996 ++	  fprintf (file, ")");
 98.1997 ++	  return;
 98.1998 ++	}
 98.1999 ++
 98.2000 ++
 98.2001 ++    case SUBREG:
 98.2002 ++    case MEM:
 98.2003 ++      if (letter == 0)
 98.2004 ++	{
 98.2005 ++	  output_address (op);
 98.2006 ++	  return;
 98.2007 ++	}
 98.2008 ++
 98.2009 ++    case CODE_LABEL:
 98.2010 ++      if (letter == 0)
 98.2011 ++	{
 98.2012 ++	  output_addr_const (file, op);
 98.2013 ++	  return;
 98.2014 ++	}
 98.2015 ++
 98.2016 ++    default:
 98.2017 ++      break;
 98.2018 ++    }
 98.2019 ++
 98.2020 ++  fprintf (stderr, "Missing way to print (%c) ", letter);
 98.2021 ++  debug_rtx (op);
 98.2022 ++  abort ();
 98.2023 ++}
 98.2024 ++
 98.2025 ++static int gprel_constant (rtx);
 98.2026 ++
 98.2027 ++static int
 98.2028 ++gprel_constant (rtx op)
 98.2029 ++{
 98.2030 ++  if (GET_CODE (op) == SYMBOL_REF
 98.2031 ++      && SYMBOL_REF_IN_NIOS2_SMALL_DATA_P (op))
 98.2032 ++    {
 98.2033 ++      return 1;
 98.2034 ++    }
 98.2035 ++  else if (GET_CODE (op) == CONST
 98.2036 ++           && GET_CODE (XEXP (op, 0)) == PLUS)
 98.2037 ++    {
 98.2038 ++      return gprel_constant (XEXP (XEXP (op, 0), 0));
 98.2039 ++    }
 98.2040 ++  else
 98.2041 ++    {
 98.2042 ++      return 0;
 98.2043 ++    }
 98.2044 ++}
 98.2045 ++
 98.2046 ++void
 98.2047 ++nios2_print_operand_address (FILE *file, rtx op)
 98.2048 ++{
 98.2049 ++  switch (GET_CODE (op))
 98.2050 ++    {
 98.2051 ++    case CONST:
 98.2052 ++    case CONST_INT:
 98.2053 ++    case LABEL_REF:
 98.2054 ++    case CONST_DOUBLE:
 98.2055 ++    case SYMBOL_REF:
 98.2056 ++      if (gprel_constant (op))
 98.2057 ++        {
 98.2058 ++          fprintf (file, "%%gprel(");
 98.2059 ++          output_addr_const (file, op);
 98.2060 ++          fprintf (file, ")(%s)", reg_names[GP_REGNO]);
 98.2061 ++          return;
 98.2062 ++        }
 98.2063 ++
 98.2064 ++      break;
 98.2065 ++
 98.2066 ++    case PLUS:
 98.2067 ++      {
 98.2068 ++	rtx op0 = XEXP (op, 0);
 98.2069 ++	rtx op1 = XEXP (op, 1);
 98.2070 ++
 98.2071 ++	if (REG_P (op0) && CONSTANT_P (op1))
 98.2072 ++	  {
 98.2073 ++	    output_addr_const (file, op1);
 98.2074 ++	    fprintf (file, "(%s)", reg_names[REGNO (op0)]);
 98.2075 ++	    return;
 98.2076 ++	  }
 98.2077 ++	else if (REG_P (op1) && CONSTANT_P (op0))
 98.2078 ++	  {
 98.2079 ++	    output_addr_const (file, op0);
 98.2080 ++	    fprintf (file, "(%s)", reg_names[REGNO (op1)]);
 98.2081 ++	    return;
 98.2082 ++	  }
 98.2083 ++      }
 98.2084 ++      break;
 98.2085 ++
 98.2086 ++    case REG:
 98.2087 ++      fprintf (file, "0(%s)", reg_names[REGNO (op)]);
 98.2088 ++      return;
 98.2089 ++
 98.2090 ++    case MEM:
 98.2091 ++      {
 98.2092 ++	rtx base = XEXP (op, 0);
 98.2093 ++	PRINT_OPERAND_ADDRESS (file, base);
 98.2094 ++	return;
 98.2095 ++      }
 98.2096 ++    default:
 98.2097 ++      break;
 98.2098 ++    }
 98.2099 ++
 98.2100 ++  fprintf (stderr, "Missing way to print address\n");
 98.2101 ++  debug_rtx (op);
 98.2102 ++  abort ();
 98.2103 ++}
 98.2104 ++
 98.2105 ++
 98.2106 ++
 98.2107 ++
 98.2108 ++
 98.2109 ++/****************************
 98.2110 ++ * Predicates
 98.2111 ++ ****************************/
 98.2112 ++
 98.2113 ++int
 98.2114 ++arith_operand (rtx op, enum machine_mode mode)
 98.2115 ++{
 98.2116 ++  if (GET_CODE (op) == CONST_INT && SMALL_INT (INTVAL (op)))
 98.2117 ++    return 1;
 98.2118 ++
 98.2119 ++  return register_operand (op, mode);
 98.2120 ++}
 98.2121 ++
 98.2122 ++int
 98.2123 ++uns_arith_operand (rtx op, enum machine_mode mode)
 98.2124 ++{
 98.2125 ++  if (GET_CODE (op) == CONST_INT && SMALL_INT_UNSIGNED (INTVAL (op)))
 98.2126 ++    return 1;
 98.2127 ++
 98.2128 ++  return register_operand (op, mode);
 98.2129 ++}
 98.2130 ++
 98.2131 ++int
 98.2132 ++logical_operand (rtx op, enum machine_mode mode)
 98.2133 ++{
 98.2134 ++  if (GET_CODE (op) == CONST_INT
 98.2135 ++      && (SMALL_INT_UNSIGNED (INTVAL (op)) || UPPER16_INT (INTVAL (op))))
 98.2136 ++    return 1;
 98.2137 ++
 98.2138 ++  return register_operand (op, mode);
 98.2139 ++}
 98.2140 ++
 98.2141 ++int
 98.2142 ++shift_operand (rtx op, enum machine_mode mode)
 98.2143 ++{
 98.2144 ++  if (GET_CODE (op) == CONST_INT && SHIFT_INT (INTVAL (op)))
 98.2145 ++    return 1;
 98.2146 ++
 98.2147 ++  return register_operand (op, mode);
 98.2148 ++}
 98.2149 ++
 98.2150 ++int
 98.2151 ++rdwrctl_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
 98.2152 ++{
 98.2153 ++  return GET_CODE (op) == CONST_INT && RDWRCTL_INT (INTVAL (op));
 98.2154 ++}
 98.2155 ++
 98.2156 ++/* Return truth value of whether OP is a register or the constant 0. */
 98.2157 ++
 98.2158 ++int
 98.2159 ++reg_or_0_operand (rtx op, enum machine_mode mode)
 98.2160 ++{
 98.2161 ++  switch (GET_CODE (op))
 98.2162 ++    {
 98.2163 ++    case CONST_INT:
 98.2164 ++      return INTVAL (op) == 0;
 98.2165 ++
 98.2166 ++    case CONST_DOUBLE:
 98.2167 ++      return op == CONST0_RTX (mode);
 98.2168 ++
 98.2169 ++    default:
 98.2170 ++      break;
 98.2171 ++    }
 98.2172 ++
 98.2173 ++  return register_operand (op, mode);
 98.2174 ++}
 98.2175 ++
 98.2176 ++
 98.2177 ++int
 98.2178 ++equality_op (rtx op, enum machine_mode mode)
 98.2179 ++{
 98.2180 ++  if (mode != GET_MODE (op))
 98.2181 ++    return 0;
 98.2182 ++
 98.2183 ++  return GET_CODE (op) == EQ || GET_CODE (op) == NE;
 98.2184 ++}
 98.2185 ++
 98.2186 ++int
 98.2187 ++custom_insn_opcode (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
 98.2188 ++{
 98.2189 ++  return GET_CODE (op) == CONST_INT && CUSTOM_INSN_OPCODE (INTVAL (op));
 98.2190 ++}
 98.2191 ++
 98.2192 ++
 98.2193 ++
 98.2194 ++
 98.2195 ++
 98.2196 ++
 98.2197 ++
 98.2198 ++/*****************************************************************************
 98.2199 ++**
 98.2200 ++** instruction scheduler
 98.2201 ++**
 98.2202 ++*****************************************************************************/
 98.2203 ++static int
 98.2204 ++nios2_use_dfa_pipeline_interface ()
 98.2205 ++{
 98.2206 ++  return 1;
 98.2207 ++}
 98.2208 ++
 98.2209 ++
 98.2210 ++static int
 98.2211 ++nios2_issue_rate ()
 98.2212 ++{
 98.2213 ++#ifdef MAX_DFA_ISSUE_RATE
 98.2214 ++  return MAX_DFA_ISSUE_RATE;
 98.2215 ++#else
 98.2216 ++  return 1;
 98.2217 ++#endif
 98.2218 ++}
 98.2219 ++
 98.2220 ++
 98.2221 ++const char *
 98.2222 ++asm_output_opcode (FILE *file ATTRIBUTE_UNUSED, 
 98.2223 ++                   const char *ptr ATTRIBUTE_UNUSED)
 98.2224 ++{
 98.2225 ++  const char *p;
 98.2226 ++
 98.2227 ++  p = ptr;
 98.2228 ++  return ptr;
 98.2229 ++}
 98.2230 ++
 98.2231 ++
 98.2232 ++
 98.2233 ++/*****************************************************************************
 98.2234 ++**
 98.2235 ++** function arguments
 98.2236 ++**
 98.2237 ++*****************************************************************************/
 98.2238 ++
 98.2239 ++void
 98.2240 ++init_cumulative_args (CUMULATIVE_ARGS *cum, 
 98.2241 ++                      tree fntype ATTRIBUTE_UNUSED, 
 98.2242 ++                      rtx libname ATTRIBUTE_UNUSED, 
 98.2243 ++                      tree fndecl ATTRIBUTE_UNUSED, 
 98.2244 ++                      int n_named_args ATTRIBUTE_UNUSED)
 98.2245 ++{
 98.2246 ++  cum->regs_used = 0;
 98.2247 ++}
 98.2248 ++
 98.2249 ++
 98.2250 ++/* Update the data in CUM to advance over an argument
 98.2251 ++   of mode MODE and data type TYPE.
 98.2252 ++   (TYPE is null for libcalls where that information may not be available.)  */
 98.2253 ++
 98.2254 ++void
 98.2255 ++function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, 
 98.2256 ++                      tree type ATTRIBUTE_UNUSED, int named ATTRIBUTE_UNUSED)
 98.2257 ++{
 98.2258 ++  HOST_WIDE_INT param_size;
 98.2259 ++
 98.2260 ++  if (mode == BLKmode)
 98.2261 ++    {
 98.2262 ++      param_size = int_size_in_bytes (type);
 98.2263 ++      if (param_size < 0)
 98.2264 ++	internal_error
 98.2265 ++	  ("Do not know how to handle large structs or variable length types");
 98.2266 ++    }
 98.2267 ++  else
 98.2268 ++    {
 98.2269 ++      param_size = GET_MODE_SIZE (mode);
 98.2270 ++    }
 98.2271 ++
 98.2272 ++  /* convert to words (round up) */
 98.2273 ++  param_size = (3 + param_size) / 4;
 98.2274 ++
 98.2275 ++  if (cum->regs_used + param_size > NUM_ARG_REGS)
 98.2276 ++    {
 98.2277 ++      cum->regs_used = NUM_ARG_REGS;
 98.2278 ++    }
 98.2279 ++  else
 98.2280 ++    {
 98.2281 ++      cum->regs_used += param_size;
 98.2282 ++    }
 98.2283 ++
 98.2284 ++  return;
 98.2285 ++}
 98.2286 ++
 98.2287 ++/* Define where to put the arguments to a function.  Value is zero to
 98.2288 ++   push the argument on the stack, or a hard register in which to
 98.2289 ++   store the argument.
 98.2290 ++
 98.2291 ++   MODE is the argument's machine mode.
 98.2292 ++   TYPE is the data type of the argument (as a tree).
 98.2293 ++   This is null for libcalls where that information may
 98.2294 ++   not be available.
 98.2295 ++   CUM is a variable of type CUMULATIVE_ARGS which gives info about
 98.2296 ++   the preceding args and about the function being called.
 98.2297 ++   NAMED is nonzero if this argument is a named parameter
 98.2298 ++   (otherwise it is an extra parameter matching an ellipsis).  */
 98.2299 ++rtx
 98.2300 ++function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode, 
 98.2301 ++              tree type ATTRIBUTE_UNUSED, int named ATTRIBUTE_UNUSED)
 98.2302 ++{
 98.2303 ++  rtx return_rtx = NULL_RTX;
 98.2304 ++
 98.2305 ++  if (cum->regs_used < NUM_ARG_REGS)
 98.2306 ++    {
 98.2307 ++      return_rtx = gen_rtx_REG (mode, FIRST_ARG_REGNO + cum->regs_used);
 98.2308 ++    }
 98.2309 ++
 98.2310 ++  return return_rtx;
 98.2311 ++}
 98.2312 ++
 98.2313 ++int
 98.2314 ++function_arg_partial_nregs (const CUMULATIVE_ARGS *cum,
 98.2315 ++                            enum machine_mode mode, tree type, 
 98.2316 ++                            int named ATTRIBUTE_UNUSED)
 98.2317 ++{
 98.2318 ++  HOST_WIDE_INT param_size;
 98.2319 ++
 98.2320 ++  if (mode == BLKmode)
 98.2321 ++    {
 98.2322 ++      param_size = int_size_in_bytes (type);
 98.2323 ++      if (param_size < 0)
 98.2324 ++	internal_error
 98.2325 ++	  ("Do not know how to handle large structs or variable length types");
 98.2326 ++    }
 98.2327 ++  else
 98.2328 ++    {
 98.2329 ++      param_size = GET_MODE_SIZE (mode);
 98.2330 ++    }
 98.2331 ++
 98.2332 ++  /* convert to words (round up) */
 98.2333 ++  param_size = (3 + param_size) / 4;
 98.2334 ++
 98.2335 ++  if (cum->regs_used < NUM_ARG_REGS
 98.2336 ++      && cum->regs_used + param_size > NUM_ARG_REGS)
 98.2337 ++    {
 98.2338 ++      return NUM_ARG_REGS - cum->regs_used;
 98.2339 ++    }
 98.2340 ++  else
 98.2341 ++    {
 98.2342 ++      return 0;
 98.2343 ++    }
 98.2344 ++}
 98.2345 ++
 98.2346 ++
 98.2347 ++int
 98.2348 ++nios2_return_in_memory (tree type)
 98.2349 ++{
 98.2350 ++  int res = ((int_size_in_bytes (type) > (2 * UNITS_PER_WORD))
 98.2351 ++  	     || (int_size_in_bytes (type) == -1));
 98.2352 ++
 98.2353 ++  return res;
 98.2354 ++}
 98.2355 ++
 98.2356 ++/* ??? It may be possible to eliminate the copyback and implement
 98.2357 ++       my own va_arg type, but that is more work for now. */
 98.2358 ++int
 98.2359 ++nios2_setup_incoming_varargs (const CUMULATIVE_ARGS *cum, 
 98.2360 ++                              enum machine_mode mode, tree type, 
 98.2361 ++                              int no_rtl)
 98.2362 ++{
 98.2363 ++  CUMULATIVE_ARGS local_cum;
 98.2364 ++  int regs_to_push;
 98.2365 ++
 98.2366 ++  local_cum = *cum;
 98.2367 ++  FUNCTION_ARG_ADVANCE (local_cum, mode, type, 1);
 98.2368 ++
 98.2369 ++  regs_to_push = NUM_ARG_REGS - local_cum.regs_used;
 98.2370 ++
 98.2371 ++  if (!no_rtl)
 98.2372 ++    {
 98.2373 ++      if (regs_to_push > 0)
 98.2374 ++	{
 98.2375 ++	  rtx ptr, mem;
 98.2376 ++
 98.2377 ++	  ptr = virtual_incoming_args_rtx;
 98.2378 ++	  mem = gen_rtx_MEM (BLKmode, ptr);
 98.2379 ++
 98.2380 ++	  /* va_arg is an array access in this case, which causes
 98.2381 ++	     it to get MEM_IN_STRUCT_P set.  We must set it here
 98.2382 ++	     so that the insn scheduler won't assume that these
 98.2383 ++	     stores can't possibly overlap with the va_arg loads.  */
 98.2384 ++	  MEM_SET_IN_STRUCT_P (mem, 1);
 98.2385 ++
 98.2386 ++	  emit_insn (gen_blockage ());
 98.2387 ++	  move_block_from_reg (local_cum.regs_used + FIRST_ARG_REGNO, mem,
 98.2388 ++			       regs_to_push);
 98.2389 ++	  emit_insn (gen_blockage ());
 98.2390 ++	}
 98.2391 ++    }
 98.2392 ++
 98.2393 ++  return regs_to_push * UNITS_PER_WORD;
 98.2394 ++
 98.2395 ++}
 98.2396 ++
 98.2397 ++
 98.2398 ++
 98.2399 ++/*****************************************************************************
 98.2400 ++**
 98.2401 ++** builtins
 98.2402 ++**
 98.2403 ++** This method for handling builtins is from CSP where _many_ more types of
 98.2404 ++** expanders have already been written. Check there first before writing
 98.2405 ++** new ones.
 98.2406 ++**
 98.2407 ++*****************************************************************************/
 98.2408 ++
 98.2409 ++enum nios2_builtins
 98.2410 ++{
 98.2411 ++  NIOS2_BUILTIN_LDBIO,
 98.2412 ++  NIOS2_BUILTIN_LDBUIO,
 98.2413 ++  NIOS2_BUILTIN_LDHIO,
 98.2414 ++  NIOS2_BUILTIN_LDHUIO,
 98.2415 ++  NIOS2_BUILTIN_LDWIO,
 98.2416 ++  NIOS2_BUILTIN_STBIO,
 98.2417 ++  NIOS2_BUILTIN_STHIO,
 98.2418 ++  NIOS2_BUILTIN_STWIO,
 98.2419 ++  NIOS2_BUILTIN_SYNC,
 98.2420 ++  NIOS2_BUILTIN_RDCTL,
 98.2421 ++  NIOS2_BUILTIN_WRCTL,
 98.2422 ++
 98.2423 ++  NIOS2_BUILTIN_CUSTOM_N,
 98.2424 ++  NIOS2_BUILTIN_CUSTOM_NI,
 98.2425 ++  NIOS2_BUILTIN_CUSTOM_NF,
 98.2426 ++  NIOS2_BUILTIN_CUSTOM_NP,
 98.2427 ++  NIOS2_BUILTIN_CUSTOM_NII,
 98.2428 ++  NIOS2_BUILTIN_CUSTOM_NIF,
 98.2429 ++  NIOS2_BUILTIN_CUSTOM_NIP,
 98.2430 ++  NIOS2_BUILTIN_CUSTOM_NFI,
 98.2431 ++  NIOS2_BUILTIN_CUSTOM_NFF,
 98.2432 ++  NIOS2_BUILTIN_CUSTOM_NFP,
 98.2433 ++  NIOS2_BUILTIN_CUSTOM_NPI,
 98.2434 ++  NIOS2_BUILTIN_CUSTOM_NPF,
 98.2435 ++  NIOS2_BUILTIN_CUSTOM_NPP,
 98.2436 ++  NIOS2_BUILTIN_CUSTOM_IN,
 98.2437 ++  NIOS2_BUILTIN_CUSTOM_INI,
 98.2438 ++  NIOS2_BUILTIN_CUSTOM_INF,
 98.2439 ++  NIOS2_BUILTIN_CUSTOM_INP,
 98.2440 ++  NIOS2_BUILTIN_CUSTOM_INII,
 98.2441 ++  NIOS2_BUILTIN_CUSTOM_INIF,
 98.2442 ++  NIOS2_BUILTIN_CUSTOM_INIP,
 98.2443 ++  NIOS2_BUILTIN_CUSTOM_INFI,
 98.2444 ++  NIOS2_BUILTIN_CUSTOM_INFF,
 98.2445 ++  NIOS2_BUILTIN_CUSTOM_INFP,
 98.2446 ++  NIOS2_BUILTIN_CUSTOM_INPI,
 98.2447 ++  NIOS2_BUILTIN_CUSTOM_INPF,
 98.2448 ++  NIOS2_BUILTIN_CUSTOM_INPP,
 98.2449 ++  NIOS2_BUILTIN_CUSTOM_FN,
 98.2450 ++  NIOS2_BUILTIN_CUSTOM_FNI,
 98.2451 ++  NIOS2_BUILTIN_CUSTOM_FNF,
 98.2452 ++  NIOS2_BUILTIN_CUSTOM_FNP,
 98.2453 ++  NIOS2_BUILTIN_CUSTOM_FNII,
 98.2454 ++  NIOS2_BUILTIN_CUSTOM_FNIF,
 98.2455 ++  NIOS2_BUILTIN_CUSTOM_FNIP,
 98.2456 ++  NIOS2_BUILTIN_CUSTOM_FNFI,
 98.2457 ++  NIOS2_BUILTIN_CUSTOM_FNFF,
 98.2458 ++  NIOS2_BUILTIN_CUSTOM_FNFP,
 98.2459 ++  NIOS2_BUILTIN_CUSTOM_FNPI,
 98.2460 ++  NIOS2_BUILTIN_CUSTOM_FNPF,
 98.2461 ++  NIOS2_BUILTIN_CUSTOM_FNPP,
 98.2462 ++  NIOS2_BUILTIN_CUSTOM_PN,
 98.2463 ++  NIOS2_BUILTIN_CUSTOM_PNI,
 98.2464 ++  NIOS2_BUILTIN_CUSTOM_PNF,
 98.2465 ++  NIOS2_BUILTIN_CUSTOM_PNP,
 98.2466 ++  NIOS2_BUILTIN_CUSTOM_PNII,
 98.2467 ++  NIOS2_BUILTIN_CUSTOM_PNIF,
 98.2468 ++  NIOS2_BUILTIN_CUSTOM_PNIP,
 98.2469 ++  NIOS2_BUILTIN_CUSTOM_PNFI,
 98.2470 ++  NIOS2_BUILTIN_CUSTOM_PNFF,
 98.2471 ++  NIOS2_BUILTIN_CUSTOM_PNFP,
 98.2472 ++  NIOS2_BUILTIN_CUSTOM_PNPI,
 98.2473 ++  NIOS2_BUILTIN_CUSTOM_PNPF,
 98.2474 ++  NIOS2_BUILTIN_CUSTOM_PNPP,
 98.2475 ++
 98.2476 ++
 98.2477 ++  LIM_NIOS2_BUILTINS
 98.2478 ++};
 98.2479 ++
 98.2480 ++struct builtin_description
 98.2481 ++{
 98.2482 ++    const enum insn_code icode;
 98.2483 ++    const char *const name;
 98.2484 ++    const enum nios2_builtins code;
 98.2485 ++    const tree *type;
 98.2486 ++    rtx (* expander) PARAMS ((const struct builtin_description *,
 98.2487 ++                              tree, rtx, rtx, enum machine_mode, int));
 98.2488 ++};
 98.2489 ++
 98.2490 ++static rtx nios2_expand_STXIO (const struct builtin_description *, 
 98.2491 ++                               tree, rtx, rtx, enum machine_mode, int);
 98.2492 ++static rtx nios2_expand_LDXIO (const struct builtin_description *, 
 98.2493 ++                               tree, rtx, rtx, enum machine_mode, int);
 98.2494 ++static rtx nios2_expand_sync (const struct builtin_description *, 
 98.2495 ++                              tree, rtx, rtx, enum machine_mode, int);
 98.2496 ++static rtx nios2_expand_rdctl (const struct builtin_description *, 
 98.2497 ++                               tree, rtx, rtx, enum machine_mode, int);
 98.2498 ++static rtx nios2_expand_wrctl (const struct builtin_description *, 
 98.2499 ++                               tree, rtx, rtx, enum machine_mode, int);
 98.2500 ++
 98.2501 ++static rtx nios2_expand_custom_n (const struct builtin_description *, 
 98.2502 ++                                  tree, rtx, rtx, enum machine_mode, int);
 98.2503 ++static rtx nios2_expand_custom_Xn (const struct builtin_description *, 
 98.2504 ++                                   tree, rtx, rtx, enum machine_mode, int);
 98.2505 ++static rtx nios2_expand_custom_nX (const struct builtin_description *, 
 98.2506 ++                                   tree, rtx, rtx, enum machine_mode, int);
 98.2507 ++static rtx nios2_expand_custom_XnX (const struct builtin_description *, 
 98.2508 ++                                    tree, rtx, rtx, enum machine_mode, int);
 98.2509 ++static rtx nios2_expand_custom_nXX (const struct builtin_description *, 
 98.2510 ++                                    tree, rtx, rtx, enum machine_mode, int);
 98.2511 ++static rtx nios2_expand_custom_XnXX (const struct builtin_description *, 
 98.2512 ++                                     tree, rtx, rtx, enum machine_mode, int);
 98.2513 ++
 98.2514 ++static tree endlink;
 98.2515 ++
 98.2516 ++/* int fn (volatile const void *)
 98.2517 ++ */
 98.2518 ++static tree int_ftype_volatile_const_void_p;
 98.2519 ++
 98.2520 ++/* int fn (int)
 98.2521 ++ */
 98.2522 ++static tree int_ftype_int;
 98.2523 ++
 98.2524 ++/* void fn (int, int)
 98.2525 ++ */
 98.2526 ++static tree void_ftype_int_int;
 98.2527 ++
 98.2528 ++/* void fn (volatile void *, int)
 98.2529 ++ */
 98.2530 ++static tree void_ftype_volatile_void_p_int;
 98.2531 ++
 98.2532 ++/* void fn (void)
 98.2533 ++ */
 98.2534 ++static tree void_ftype_void;
 98.2535 ++
 98.2536 ++static tree custom_n;
 98.2537 ++static tree custom_ni;
 98.2538 ++static tree custom_nf;
 98.2539 ++static tree custom_np;
 98.2540 ++static tree custom_nii;
 98.2541 ++static tree custom_nif;
 98.2542 ++static tree custom_nip;
 98.2543 ++static tree custom_nfi;
 98.2544 ++static tree custom_nff;
 98.2545 ++static tree custom_nfp;
 98.2546 ++static tree custom_npi;
 98.2547 ++static tree custom_npf;
 98.2548 ++static tree custom_npp;
 98.2549 ++static tree custom_in;
 98.2550 ++static tree custom_ini;
 98.2551 ++static tree custom_inf;
 98.2552 ++static tree custom_inp;
 98.2553 ++static tree custom_inii;
 98.2554 ++static tree custom_inif;
 98.2555 ++static tree custom_inip;
 98.2556 ++static tree custom_infi;
 98.2557 ++static tree custom_inff;
 98.2558 ++static tree custom_infp;
 98.2559 ++static tree custom_inpi;
 98.2560 ++static tree custom_inpf;
 98.2561 ++static tree custom_inpp;
 98.2562 ++static tree custom_fn;
 98.2563 ++static tree custom_fni;
 98.2564 ++static tree custom_fnf;
 98.2565 ++static tree custom_fnp;
 98.2566 ++static tree custom_fnii;
 98.2567 ++static tree custom_fnif;
 98.2568 ++static tree custom_fnip;
 98.2569 ++static tree custom_fnfi;
 98.2570 ++static tree custom_fnff;
 98.2571 ++static tree custom_fnfp;
 98.2572 ++static tree custom_fnpi;
 98.2573 ++static tree custom_fnpf;
 98.2574 ++static tree custom_fnpp;
 98.2575 ++static tree custom_pn;
 98.2576 ++static tree custom_pni;
 98.2577 ++static tree custom_pnf;
 98.2578 ++static tree custom_pnp;
 98.2579 ++static tree custom_pnii;
 98.2580 ++static tree custom_pnif;
 98.2581 ++static tree custom_pnip;
 98.2582 ++static tree custom_pnfi;
 98.2583 ++static tree custom_pnff;
 98.2584 ++static tree custom_pnfp;
 98.2585 ++static tree custom_pnpi;
 98.2586 ++static tree custom_pnpf;
 98.2587 ++static tree custom_pnpp;
 98.2588 ++
 98.2589 ++
 98.2590 ++static const struct builtin_description bdesc[] = {
 98.2591 ++    {CODE_FOR_ldbio, "__builtin_ldbio", NIOS2_BUILTIN_LDBIO, &int_ftype_volatile_const_void_p, nios2_expand_LDXIO},
 98.2592 ++    {CODE_FOR_ldbuio, "__builtin_ldbuio", NIOS2_BUILTIN_LDBUIO, &int_ftype_volatile_const_void_p, nios2_expand_LDXIO},
 98.2593 ++    {CODE_FOR_ldhio, "__builtin_ldhio", NIOS2_BUILTIN_LDHIO, &int_ftype_volatile_const_void_p, nios2_expand_LDXIO},
 98.2594 ++    {CODE_FOR_ldhuio, "__builtin_ldhuio", NIOS2_BUILTIN_LDHUIO, &int_ftype_volatile_const_void_p, nios2_expand_LDXIO},
 98.2595 ++    {CODE_FOR_ldwio, "__builtin_ldwio", NIOS2_BUILTIN_LDWIO, &int_ftype_volatile_const_void_p, nios2_expand_LDXIO},
 98.2596 ++
 98.2597 ++    {CODE_FOR_stbio, "__builtin_stbio", NIOS2_BUILTIN_STBIO, &void_ftype_volatile_void_p_int, nios2_expand_STXIO},
 98.2598 ++    {CODE_FOR_sthio, "__builtin_sthio", NIOS2_BUILTIN_STHIO, &void_ftype_volatile_void_p_int, nios2_expand_STXIO},
 98.2599 ++    {CODE_FOR_stwio, "__builtin_stwio", NIOS2_BUILTIN_STWIO, &void_ftype_volatile_void_p_int, nios2_expand_STXIO},
 98.2600 ++
 98.2601 ++    {CODE_FOR_sync, "__builtin_sync", NIOS2_BUILTIN_SYNC, &void_ftype_void, nios2_expand_sync},
 98.2602 ++    {CODE_FOR_rdctl, "__builtin_rdctl", NIOS2_BUILTIN_RDCTL, &int_ftype_int, nios2_expand_rdctl},
 98.2603 ++    {CODE_FOR_wrctl, "__builtin_wrctl", NIOS2_BUILTIN_WRCTL, &void_ftype_int_int, nios2_expand_wrctl},
 98.2604 ++
 98.2605 ++    {CODE_FOR_custom_n, "__builtin_custom_n", NIOS2_BUILTIN_CUSTOM_N, &custom_n, nios2_expand_custom_n},
 98.2606 ++    {CODE_FOR_custom_ni, "__builtin_custom_ni", NIOS2_BUILTIN_CUSTOM_NI, &custom_ni, nios2_expand_custom_nX},
 98.2607 ++    {CODE_FOR_custom_nf, "__builtin_custom_nf", NIOS2_BUILTIN_CUSTOM_NF, &custom_nf, nios2_expand_custom_nX},
 98.2608 ++    {CODE_FOR_custom_np, "__builtin_custom_np", NIOS2_BUILTIN_CUSTOM_NP, &custom_np, nios2_expand_custom_nX},
 98.2609 ++    {CODE_FOR_custom_nii, "__builtin_custom_nii", NIOS2_BUILTIN_CUSTOM_NII, &custom_nii, nios2_expand_custom_nXX},
 98.2610 ++    {CODE_FOR_custom_nif, "__builtin_custom_nif", NIOS2_BUILTIN_CUSTOM_NIF, &custom_nif, nios2_expand_custom_nXX},
 98.2611 ++    {CODE_FOR_custom_nip, "__builtin_custom_nip", NIOS2_BUILTIN_CUSTOM_NIP, &custom_nip, nios2_expand_custom_nXX},
 98.2612 ++    {CODE_FOR_custom_nfi, "__builtin_custom_nfi", NIOS2_BUILTIN_CUSTOM_NFI, &custom_nfi, nios2_expand_custom_nXX},
 98.2613 ++    {CODE_FOR_custom_nff, "__builtin_custom_nff", NIOS2_BUILTIN_CUSTOM_NFF, &custom_nff, nios2_expand_custom_nXX},
 98.2614 ++    {CODE_FOR_custom_nfp, "__builtin_custom_nfp", NIOS2_BUILTIN_CUSTOM_NFP, &custom_nfp, nios2_expand_custom_nXX},
 98.2615 ++    {CODE_FOR_custom_npi, "__builtin_custom_npi", NIOS2_BUILTIN_CUSTOM_NPI, &custom_npi, nios2_expand_custom_nXX},
 98.2616 ++    {CODE_FOR_custom_npf, "__builtin_custom_npf", NIOS2_BUILTIN_CUSTOM_NPF, &custom_npf, nios2_expand_custom_nXX},
 98.2617 ++    {CODE_FOR_custom_npp, "__builtin_custom_npp", NIOS2_BUILTIN_CUSTOM_NPP, &custom_npp, nios2_expand_custom_nXX},
 98.2618 ++    {CODE_FOR_custom_in, "__builtin_custom_in", NIOS2_BUILTIN_CUSTOM_IN, &custom_in, nios2_expand_custom_Xn},
 98.2619 ++    {CODE_FOR_custom_ini, "__builtin_custom_ini", NIOS2_BUILTIN_CUSTOM_INI, &custom_ini, nios2_expand_custom_XnX},
 98.2620 ++    {CODE_FOR_custom_inf, "__builtin_custom_inf", NIOS2_BUILTIN_CUSTOM_INF, &custom_inf, nios2_expand_custom_XnX},
 98.2621 ++    {CODE_FOR_custom_inp, "__builtin_custom_inp", NIOS2_BUILTIN_CUSTOM_INP, &custom_inp, nios2_expand_custom_XnX},
 98.2622 ++    {CODE_FOR_custom_inii, "__builtin_custom_inii", NIOS2_BUILTIN_CUSTOM_INII, &custom_inii, nios2_expand_custom_XnXX},
 98.2623 ++    {CODE_FOR_custom_inif, "__builtin_custom_inif", NIOS2_BUILTIN_CUSTOM_INIF, &custom_inif, nios2_expand_custom_XnXX},
 98.2624 ++    {CODE_FOR_custom_inip, "__builtin_custom_inip", NIOS2_BUILTIN_CUSTOM_INIP, &custom_inip, nios2_expand_custom_XnXX},
 98.2625 ++    {CODE_FOR_custom_infi, "__builtin_custom_infi", NIOS2_BUILTIN_CUSTOM_INFI, &custom_infi, nios2_expand_custom_XnXX},
 98.2626 ++    {CODE_FOR_custom_inff, "__builtin_custom_inff", NIOS2_BUILTIN_CUSTOM_INFF, &custom_inff, nios2_expand_custom_XnXX},
 98.2627 ++    {CODE_FOR_custom_infp, "__builtin_custom_infp", NIOS2_BUILTIN_CUSTOM_INFP, &custom_infp, nios2_expand_custom_XnXX},
 98.2628 ++    {CODE_FOR_custom_inpi, "__builtin_custom_inpi", NIOS2_BUILTIN_CUSTOM_INPI, &custom_inpi, nios2_expand_custom_XnXX},
 98.2629 ++    {CODE_FOR_custom_inpf, "__builtin_custom_inpf", NIOS2_BUILTIN_CUSTOM_INPF, &custom_inpf, nios2_expand_custom_XnXX},
 98.2630 ++    {CODE_FOR_custom_inpp, "__builtin_custom_inpp", NIOS2_BUILTIN_CUSTOM_INPP, &custom_inpp, nios2_expand_custom_XnXX},
 98.2631 ++    {CODE_FOR_custom_fn, "__builtin_custom_fn", NIOS2_BUILTIN_CUSTOM_FN, &custom_fn, nios2_expand_custom_Xn},
 98.2632 ++    {CODE_FOR_custom_fni, "__builtin_custom_fni", NIOS2_BUILTIN_CUSTOM_FNI, &custom_fni, nios2_expand_custom_XnX},
 98.2633 ++    {CODE_FOR_custom_fnf, "__builtin_custom_fnf", NIOS2_BUILTIN_CUSTOM_FNF, &custom_fnf, nios2_expand_custom_XnX},
 98.2634 ++    {CODE_FOR_custom_fnp, "__builtin_custom_fnp", NIOS2_BUILTIN_CUSTOM_FNP, &custom_fnp, nios2_expand_custom_XnX},
 98.2635 ++    {CODE_FOR_custom_fnii, "__builtin_custom_fnii", NIOS2_BUILTIN_CUSTOM_FNII, &custom_fnii, nios2_expand_custom_XnXX},
 98.2636 ++    {CODE_FOR_custom_fnif, "__builtin_custom_fnif", NIOS2_BUILTIN_CUSTOM_FNIF, &custom_fnif, nios2_expand_custom_XnXX},
 98.2637 ++    {CODE_FOR_custom_fnip, "__builtin_custom_fnip", NIOS2_BUILTIN_CUSTOM_FNIP, &custom_fnip, nios2_expand_custom_XnXX},
 98.2638 ++    {CODE_FOR_custom_fnfi, "__builtin_custom_fnfi", NIOS2_BUILTIN_CUSTOM_FNFI, &custom_fnfi, nios2_expand_custom_XnXX},
 98.2639 ++    {CODE_FOR_custom_fnff, "__builtin_custom_fnff", NIOS2_BUILTIN_CUSTOM_FNFF, &custom_fnff, nios2_expand_custom_XnXX},
 98.2640 ++    {CODE_FOR_custom_fnfp, "__builtin_custom_fnfp", NIOS2_BUILTIN_CUSTOM_FNFP, &custom_fnfp, nios2_expand_custom_XnXX},
 98.2641 ++    {CODE_FOR_custom_fnpi, "__builtin_custom_fnpi", NIOS2_BUILTIN_CUSTOM_FNPI, &custom_fnpi, nios2_expand_custom_XnXX},
 98.2642 ++    {CODE_FOR_custom_fnpf, "__builtin_custom_fnpf", NIOS2_BUILTIN_CUSTOM_FNPF, &custom_fnpf, nios2_expand_custom_XnXX},
 98.2643 ++    {CODE_FOR_custom_fnpp, "__builtin_custom_fnpp", NIOS2_BUILTIN_CUSTOM_FNPP, &custom_fnpp, nios2_expand_custom_XnXX},
 98.2644 ++    {CODE_FOR_custom_pn, "__builtin_custom_pn", NIOS2_BUILTIN_CUSTOM_PN, &custom_pn, nios2_expand_custom_Xn},
 98.2645 ++    {CODE_FOR_custom_pni, "__builtin_custom_pni", NIOS2_BUILTIN_CUSTOM_PNI, &custom_pni, nios2_expand_custom_XnX},
 98.2646 ++    {CODE_FOR_custom_pnf, "__builtin_custom_pnf", NIOS2_BUILTIN_CUSTOM_PNF, &custom_pnf, nios2_expand_custom_XnX},
 98.2647 ++    {CODE_FOR_custom_pnp, "__builtin_custom_pnp", NIOS2_BUILTIN_CUSTOM_PNP, &custom_pnp, nios2_expand_custom_XnX},
 98.2648 ++    {CODE_FOR_custom_pnii, "__builtin_custom_pnii", NIOS2_BUILTIN_CUSTOM_PNII, &custom_pnii, nios2_expand_custom_XnXX},
 98.2649 ++    {CODE_FOR_custom_pnif, "__builtin_custom_pnif", NIOS2_BUILTIN_CUSTOM_PNIF, &custom_pnif, nios2_expand_custom_XnXX},
 98.2650 ++    {CODE_FOR_custom_pnip, "__builtin_custom_pnip", NIOS2_BUILTIN_CUSTOM_PNIP, &custom_pnip, nios2_expand_custom_XnXX},
 98.2651 ++    {CODE_FOR_custom_pnfi, "__builtin_custom_pnfi", NIOS2_BUILTIN_CUSTOM_PNFI, &custom_pnfi, nios2_expand_custom_XnXX},
 98.2652 ++    {CODE_FOR_custom_pnff, "__builtin_custom_pnff", NIOS2_BUILTIN_CUSTOM_PNFF, &custom_pnff, nios2_expand_custom_XnXX},
 98.2653 ++    {CODE_FOR_custom_pnfp, "__builtin_custom_pnfp", NIOS2_BUILTIN_CUSTOM_PNFP, &custom_pnfp, nios2_expand_custom_XnXX},
 98.2654 ++    {CODE_FOR_custom_pnpi, "__builtin_custom_pnpi", NIOS2_BUILTIN_CUSTOM_PNPI, &custom_pnpi, nios2_expand_custom_XnXX},
 98.2655 ++    {CODE_FOR_custom_pnpf, "__builtin_custom_pnpf", NIOS2_BUILTIN_CUSTOM_PNPF, &custom_pnpf, nios2_expand_custom_XnXX},
 98.2656 ++    {CODE_FOR_custom_pnpp, "__builtin_custom_pnpp", NIOS2_BUILTIN_CUSTOM_PNPP, &custom_pnpp, nios2_expand_custom_XnXX},
 98.2657 ++
 98.2658 ++
 98.2659 ++    {0, 0, 0, 0, 0},
 98.2660 ++};
 98.2661 ++
 98.2662 ++/* This does not have a closing bracket on purpose (see use) */
 98.2663 ++#define def_param(TYPE) \
 98.2664 ++  tree_cons (NULL_TREE, TYPE,
 98.2665 ++
 98.2666 ++static void
 98.2667 ++nios2_init_builtins ()
 98.2668 ++{
 98.2669 ++  const struct builtin_description *d;
 98.2670 ++
 98.2671 ++
 98.2672 ++  endlink = void_list_node;
 98.2673 ++
 98.2674 ++  /* Special indenting here because one of the brackets is in def_param */
 98.2675 ++  /* *INDENT-OFF* */
 98.2676 ++
 98.2677 ++  /* int fn (volatile const void *)
 98.2678 ++   */
 98.2679 ++  int_ftype_volatile_const_void_p
 98.2680 ++    = build_function_type (integer_type_node,
 98.2681 ++			   def_param (build_qualified_type (ptr_type_node,
 98.2682 ++			                                    TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE))
 98.2683 ++			   endlink));
 98.2684 ++
 98.2685 ++
 98.2686 ++  /* void fn (volatile void *, int)
 98.2687 ++   */
 98.2688 ++  void_ftype_volatile_void_p_int
 98.2689 ++    = build_function_type (void_type_node,
 98.2690 ++			   def_param (build_qualified_type (ptr_type_node,
 98.2691 ++			                                    TYPE_QUAL_VOLATILE))
 98.2692 ++			   def_param (integer_type_node)
 98.2693 ++			   endlink)));
 98.2694 ++
 98.2695 ++  /* void fn (void)
 98.2696 ++   */
 98.2697 ++  void_ftype_void
 98.2698 ++      = build_function_type (void_type_node,
 98.2699 ++                             endlink);
 98.2700 ++
 98.2701 ++  /* int fn (int)
 98.2702 ++   */
 98.2703 ++  int_ftype_int
 98.2704 ++      = build_function_type (integer_type_node,
 98.2705 ++                             def_param (integer_type_node)
 98.2706 ++                             endlink));
 98.2707 ++
 98.2708 ++  /* void fn (int, int)
 98.2709 ++   */
 98.2710 ++  void_ftype_int_int
 98.2711 ++      = build_function_type (void_type_node,
 98.2712 ++                             def_param (integer_type_node)
 98.2713 ++                             def_param (integer_type_node)
 98.2714 ++                             endlink)));
 98.2715 ++
 98.2716 ++
 98.2717 ++#define CUSTOM_NUM def_param (integer_type_node)
 98.2718 ++
 98.2719 ++  custom_n
 98.2720 ++      = build_function_type (void_type_node,
 98.2721 ++  			     CUSTOM_NUM
 98.2722 ++  			     endlink));
 98.2723 ++  custom_ni
 98.2724 ++      = build_function_type (void_type_node,
 98.2725 ++  			     CUSTOM_NUM
 98.2726 ++  			     def_param (integer_type_node)
 98.2727 ++  			     endlink)));
 98.2728 ++  custom_nf
 98.2729 ++      = build_function_type (void_type_node,
 98.2730 ++  			     CUSTOM_NUM
 98.2731 ++  			     def_param (float_type_node)
 98.2732 ++  			     endlink)));
 98.2733 ++  custom_np
 98.2734 ++      = build_function_type (void_type_node,
 98.2735 ++  			     CUSTOM_NUM
 98.2736 ++  			     def_param (ptr_type_node)
 98.2737 ++  			     endlink)));
 98.2738 ++  custom_nii
 98.2739 ++      = build_function_type (void_type_node,
 98.2740 ++  			     CUSTOM_NUM
 98.2741 ++  			     def_param (integer_type_node)
 98.2742 ++  			     def_param (integer_type_node)
 98.2743 ++  			     endlink))));
 98.2744 ++  custom_nif
 98.2745 ++      = build_function_type (void_type_node,
 98.2746 ++  			     CUSTOM_NUM
 98.2747 ++  			     def_param (integer_type_node)
 98.2748 ++  			     def_param (float_type_node)
 98.2749 ++  			     endlink))));
 98.2750 ++  custom_nip
 98.2751 ++      = build_function_type (void_type_node,
 98.2752 ++  			     CUSTOM_NUM
 98.2753 ++  			     def_param (integer_type_node)
 98.2754 ++  			     def_param (ptr_type_node)
 98.2755 ++  			     endlink))));
 98.2756 ++  custom_nfi
 98.2757 ++      = build_function_type (void_type_node,
 98.2758 ++  			     CUSTOM_NUM
 98.2759 ++  			     def_param (float_type_node)
 98.2760 ++  			     def_param (integer_type_node)
 98.2761 ++  			     endlink))));
 98.2762 ++  custom_nff
 98.2763 ++      = build_function_type (void_type_node,
 98.2764 ++  			     CUSTOM_NUM
 98.2765 ++  			     def_param (float_type_node)
 98.2766 ++  			     def_param (float_type_node)
 98.2767 ++  			     endlink))));
 98.2768 ++  custom_nfp
 98.2769 ++      = build_function_type (void_type_node,
 98.2770 ++  			     CUSTOM_NUM
 98.2771 ++  			     def_param (float_type_node)
 98.2772 ++  			     def_param (ptr_type_node)
 98.2773 ++  			     endlink))));
 98.2774 ++  custom_npi
 98.2775 ++      = build_function_type (void_type_node,
 98.2776 ++  			     CUSTOM_NUM
 98.2777 ++  			     def_param (ptr_type_node)
 98.2778 ++  			     def_param (integer_type_node)
 98.2779 ++  			     endlink))));
 98.2780 ++  custom_npf
 98.2781 ++      = build_function_type (void_type_node,
 98.2782 ++  			     CUSTOM_NUM
 98.2783 ++  			     def_param (ptr_type_node)
 98.2784 ++  			     def_param (float_type_node)
 98.2785 ++  			     endlink))));
 98.2786 ++  custom_npp
 98.2787 ++      = build_function_type (void_type_node,
 98.2788 ++  			     CUSTOM_NUM
 98.2789 ++  			     def_param (ptr_type_node)
 98.2790 ++  			     def_param (ptr_type_node)
 98.2791 ++  			     endlink))));
 98.2792 ++
 98.2793 ++  custom_in
 98.2794 ++      = build_function_type (integer_type_node,
 98.2795 ++  			     CUSTOM_NUM
 98.2796 ++  			     endlink));
 98.2797 ++  custom_ini
 98.2798 ++      = build_function_type (integer_type_node,
 98.2799 ++  			     CUSTOM_NUM
 98.2800 ++  			     def_param (integer_type_node)
 98.2801 ++  			     endlink)));
 98.2802 ++  custom_inf
 98.2803 ++      = build_function_type (integer_type_node,
 98.2804 ++  			     CUSTOM_NUM
 98.2805 ++  			     def_param (float_type_node)
 98.2806 ++  			     endlink)));
 98.2807 ++  custom_inp
 98.2808 ++      = build_function_type (integer_type_node,
 98.2809 ++  			     CUSTOM_NUM
 98.2810 ++  			     def_param (ptr_type_node)
 98.2811 ++  			     endlink)));
 98.2812 ++  custom_inii
 98.2813 ++      = build_function_type (integer_type_node,
 98.2814 ++  			     CUSTOM_NUM
 98.2815 ++  			     def_param (integer_type_node)
 98.2816 ++  			     def_param (integer_type_node)
 98.2817 ++  			     endlink))));
 98.2818 ++  custom_inif
 98.2819 ++      = build_function_type (integer_type_node,
 98.2820 ++  			     CUSTOM_NUM
 98.2821 ++  			     def_param (integer_type_node)
 98.2822 ++  			     def_param (float_type_node)
 98.2823 ++  			     endlink))));
 98.2824 ++  custom_inip
 98.2825 ++      = build_function_type (integer_type_node,
 98.2826 ++  			     CUSTOM_NUM
 98.2827 ++  			     def_param (integer_type_node)
 98.2828 ++  			     def_param (ptr_type_node)
 98.2829 ++  			     endlink))));
 98.2830 ++  custom_infi
 98.2831 ++      = build_function_type (integer_type_node,
 98.2832 ++  			     CUSTOM_NUM
 98.2833 ++  			     def_param (float_type_node)
 98.2834 ++  			     def_param (integer_type_node)
 98.2835 ++  			     endlink))));
 98.2836 ++  custom_inff
 98.2837 ++      = build_function_type (integer_type_node,
 98.2838 ++  			     CUSTOM_NUM
 98.2839 ++  			     def_param (float_type_node)
 98.2840 ++  			     def_param (float_type_node)
 98.2841 ++  			     endlink))));
 98.2842 ++  custom_infp
 98.2843 ++      = build_function_type (integer_type_node,
 98.2844 ++  			     CUSTOM_NUM
 98.2845 ++  			     def_param (float_type_node)
 98.2846 ++  			     def_param (ptr_type_node)
 98.2847 ++  			     endlink))));
 98.2848 ++  custom_inpi
 98.2849 ++      = build_function_type (integer_type_node,
 98.2850 ++  			     CUSTOM_NUM
 98.2851 ++  			     def_param (ptr_type_node)
 98.2852 ++  			     def_param (integer_type_node)
 98.2853 ++  			     endlink))));
 98.2854 ++  custom_inpf
 98.2855 ++      = build_function_type (integer_type_node,
 98.2856 ++  			     CUSTOM_NUM
 98.2857 ++  			     def_param (ptr_type_node)
 98.2858 ++  			     def_param (float_type_node)
 98.2859 ++  			     endlink))));
 98.2860 ++  custom_inpp
 98.2861 ++      = build_function_type (integer_type_node,
 98.2862 ++  			     CUSTOM_NUM
 98.2863 ++  			     def_param (ptr_type_node)
 98.2864 ++  			     def_param (ptr_type_node)
 98.2865 ++  			     endlink))));
 98.2866 ++
 98.2867 ++  custom_fn
 98.2868 ++      = build_function_type (float_type_node,
 98.2869 ++  			     CUSTOM_NUM
 98.2870 ++  			     endlink));
 98.2871 ++  custom_fni
 98.2872 ++      = build_function_type (float_type_node,
 98.2873 ++  			     CUSTOM_NUM
 98.2874 ++  			     def_param (integer_type_node)
 98.2875 ++  			     endlink)));
 98.2876 ++  custom_fnf
 98.2877 ++      = build_function_type (float_type_node,
 98.2878 ++  			     CUSTOM_NUM
 98.2879 ++  			     def_param (float_type_node)
 98.2880 ++  			     endlink)));
 98.2881 ++  custom_fnp
 98.2882 ++      = build_function_type (float_type_node,
 98.2883 ++  			     CUSTOM_NUM
 98.2884 ++  			     def_param (ptr_type_node)
 98.2885 ++  			     endlink)));
 98.2886 ++  custom_fnii
 98.2887 ++      = build_function_type (float_type_node,
 98.2888 ++  			     CUSTOM_NUM
 98.2889 ++  			     def_param (integer_type_node)
 98.2890 ++  			     def_param (integer_type_node)
 98.2891 ++  			     endlink))));
 98.2892 ++  custom_fnif
 98.2893 ++      = build_function_type (float_type_node,
 98.2894 ++  			     CUSTOM_NUM
 98.2895 ++  			     def_param (integer_type_node)
 98.2896 ++  			     def_param (float_type_node)
 98.2897 ++  			     endlink))));
 98.2898 ++  custom_fnip
 98.2899 ++      = build_function_type (float_type_node,
 98.2900 ++  			     CUSTOM_NUM
 98.2901 ++  			     def_param (integer_type_node)
 98.2902 ++  			     def_param (ptr_type_node)
 98.2903 ++  			     endlink))));
 98.2904 ++  custom_fnfi
 98.2905 ++      = build_function_type (float_type_node,
 98.2906 ++  			     CUSTOM_NUM
 98.2907 ++  			     def_param (float_type_node)
 98.2908 ++  			     def_param (integer_type_node)
 98.2909 ++  			     endlink))));
 98.2910 ++  custom_fnff
 98.2911 ++      = build_function_type (float_type_node,
 98.2912 ++  			     CUSTOM_NUM
 98.2913 ++  			     def_param (float_type_node)
 98.2914 ++  			     def_param (float_type_node)
 98.2915 ++  			     endlink))));
 98.2916 ++  custom_fnfp
 98.2917 ++      = build_function_type (float_type_node,
 98.2918 ++  			     CUSTOM_NUM
 98.2919 ++  			     def_param (float_type_node)
 98.2920 ++  			     def_param (ptr_type_node)
 98.2921 ++  			     endlink))));
 98.2922 ++  custom_fnpi
 98.2923 ++      = build_function_type (float_type_node,
 98.2924 ++  			     CUSTOM_NUM
 98.2925 ++  			     def_param (ptr_type_node)
 98.2926 ++  			     def_param (integer_type_node)
 98.2927 ++  			     endlink))));
 98.2928 ++  custom_fnpf
 98.2929 ++      = build_function_type (float_type_node,
 98.2930 ++  			     CUSTOM_NUM
 98.2931 ++  			     def_param (ptr_type_node)
 98.2932 ++  			     def_param (float_type_node)
 98.2933 ++  			     endlink))));
 98.2934 ++  custom_fnpp
 98.2935 ++      = build_function_type (float_type_node,
 98.2936 ++  			     CUSTOM_NUM
 98.2937 ++  			     def_param (ptr_type_node)
 98.2938 ++  			     def_param (ptr_type_node)
 98.2939 ++  			     endlink))));
 98.2940 ++
 98.2941 ++
 98.2942 ++  custom_pn
 98.2943 ++      = build_function_type (ptr_type_node,
 98.2944 ++  			     CUSTOM_NUM
 98.2945 ++  			     endlink));
 98.2946 ++  custom_pni
 98.2947 ++      = build_function_type (ptr_type_node,
 98.2948 ++  			     CUSTOM_NUM
 98.2949 ++  			     def_param (integer_type_node)
 98.2950 ++  			     endlink)));
 98.2951 ++  custom_pnf
 98.2952 ++      = build_function_type (ptr_type_node,
 98.2953 ++  			     CUSTOM_NUM
 98.2954 ++  			     def_param (float_type_node)
 98.2955 ++  			     endlink)));
 98.2956 ++  custom_pnp
 98.2957 ++      = build_function_type (ptr_type_node,
 98.2958 ++  			     CUSTOM_NUM
 98.2959 ++  			     def_param (ptr_type_node)
 98.2960 ++  			     endlink)));
 98.2961 ++  custom_pnii
 98.2962 ++      = build_function_type (ptr_type_node,
 98.2963 ++  			     CUSTOM_NUM
 98.2964 ++  			     def_param (integer_type_node)
 98.2965 ++  			     def_param (integer_type_node)
 98.2966 ++  			     endlink))));
 98.2967 ++  custom_pnif
 98.2968 ++      = build_function_type (ptr_type_node,
 98.2969 ++  			     CUSTOM_NUM
 98.2970 ++  			     def_param (integer_type_node)
 98.2971 ++  			     def_param (float_type_node)
 98.2972 ++  			     endlink))));
 98.2973 ++  custom_pnip
 98.2974 ++      = build_function_type (ptr_type_node,
 98.2975 ++  			     CUSTOM_NUM
 98.2976 ++  			     def_param (integer_type_node)
 98.2977 ++  			     def_param (ptr_type_node)
 98.2978 ++  			     endlink))));
 98.2979 ++  custom_pnfi
 98.2980 ++      = build_function_type (ptr_type_node,
 98.2981 ++  			     CUSTOM_NUM
 98.2982 ++  			     def_param (float_type_node)
 98.2983 ++  			     def_param (integer_type_node)
 98.2984 ++  			     endlink))));
 98.2985 ++  custom_pnff
 98.2986 ++      = build_function_type (ptr_type_node,
 98.2987 ++  			     CUSTOM_NUM
 98.2988 ++  			     def_param (float_type_node)
 98.2989 ++  			     def_param (float_type_node)
 98.2990 ++  			     endlink))));
 98.2991 ++  custom_pnfp
 98.2992 ++      = build_function_type (ptr_type_node,
 98.2993 ++  			     CUSTOM_NUM
 98.2994 ++  			     def_param (float_type_node)
 98.2995 ++  			     def_param (ptr_type_node)
 98.2996 ++  			     endlink))));
 98.2997 ++  custom_pnpi
 98.2998 ++      = build_function_type (ptr_type_node,
 98.2999 ++  			     CUSTOM_NUM
 98.3000 ++  			     def_param (ptr_type_node)
 98.3001 ++  			     def_param (integer_type_node)
 98.3002 ++  			     endlink))));
 98.3003 ++  custom_pnpf
 98.3004 ++      = build_function_type (ptr_type_node,
 98.3005 ++  			     CUSTOM_NUM
 98.3006 ++  			     def_param (ptr_type_node)
 98.3007 ++  			     def_param (float_type_node)
 98.3008 ++  			     endlink))));
 98.3009 ++  custom_pnpp
 98.3010 ++      = build_function_type (ptr_type_node,
 98.3011 ++  			     CUSTOM_NUM
 98.3012 ++  			     def_param (ptr_type_node)
 98.3013 ++  			     def_param (ptr_type_node)
 98.3014 ++  			     endlink))));
 98.3015 ++
 98.3016 ++
 98.3017 ++
 98.3018 ++  /* *INDENT-ON* */
 98.3019 ++
 98.3020 ++
 98.3021 ++  for (d = bdesc; d->name; d++)
 98.3022 ++    {
 98.3023 ++      builtin_function (d->name, *d->type, d->code,
 98.3024 ++			BUILT_IN_MD, NULL, NULL);
 98.3025 ++    }
 98.3026 ++}
 98.3027 ++
 98.3028 ++/* Expand an expression EXP that calls a built-in function,
 98.3029 ++   with result going to TARGET if that's convenient
 98.3030 ++   (and in mode MODE if that's convenient).
 98.3031 ++   SUBTARGET may be used as the target for computing one of EXP's operands.
 98.3032 ++   IGNORE is nonzero if the value is to be ignored.  */
 98.3033 ++
 98.3034 ++static rtx
 98.3035 ++nios2_expand_builtin (tree exp, rtx target, rtx subtarget, 
 98.3036 ++                      enum machine_mode mode, int ignore)
 98.3037 ++{
 98.3038 ++  const struct builtin_description *d;
 98.3039 ++  tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
 98.3040 ++  unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
 98.3041 ++
 98.3042 ++  for (d = bdesc; d->name; d++)
 98.3043 ++    if (d->code == fcode)
 98.3044 ++      return (d->expander) (d, exp, target, subtarget, mode, ignore);
 98.3045 ++
 98.3046 ++  /* we should have seen one of the functins we registered */
 98.3047 ++  abort ();
 98.3048 ++}
 98.3049 ++
 98.3050 ++static rtx nios2_create_target (const struct builtin_description *, rtx);
 98.3051 ++
 98.3052 ++
 98.3053 ++static rtx
 98.3054 ++nios2_create_target (const struct builtin_description *d, rtx target)
 98.3055 ++{
 98.3056 ++  if (!target
 98.3057 ++      || !(*insn_data[d->icode].operand[0].predicate) (target,
 98.3058 ++                                                       insn_data[d->icode].operand[0].mode))
 98.3059 ++    {
 98.3060 ++      target = gen_reg_rtx (insn_data[d->icode].operand[0].mode);
 98.3061 ++    }
 98.3062 ++
 98.3063 ++  return target;
 98.3064 ++}
 98.3065 ++
 98.3066 ++
 98.3067 ++static rtx nios2_extract_opcode (const struct builtin_description *, int, tree);
 98.3068 ++static rtx nios2_extract_operand (const struct builtin_description *, int, int, tree);
 98.3069 ++
 98.3070 ++static rtx
 98.3071 ++nios2_extract_opcode (const struct builtin_description *d, int op, tree arglist)
 98.3072 ++{
 98.3073 ++  enum machine_mode mode = insn_data[d->icode].operand[op].mode;
 98.3074 ++  tree arg = TREE_VALUE (arglist);
 98.3075 ++  rtx opcode = expand_expr (arg, NULL_RTX, mode, 0);
 98.3076 ++  opcode = protect_from_queue (opcode, 0);
 98.3077 ++
 98.3078 ++  if (!(*insn_data[d->icode].operand[op].predicate) (opcode, mode))
 98.3079 ++    error ("Custom instruction opcode must be compile time constant in the range 0-255 for %s", d->name);
 98.3080 ++
 98.3081 ++  return opcode;
 98.3082 ++}
 98.3083 ++
 98.3084 ++static rtx
 98.3085 ++nios2_extract_operand (const struct builtin_description *d, int op, int argnum, tree arglist)
 98.3086 ++{
 98.3087 ++  enum machine_mode mode = insn_data[d->icode].operand[op].mode;
 98.3088 ++  tree arg = TREE_VALUE (arglist);
 98.3089 ++  rtx operand = expand_expr (arg, NULL_RTX, mode, 0);
 98.3090 ++  operand = protect_from_queue (operand, 0);
 98.3091 ++
 98.3092 ++  if (!(*insn_data[d->icode].operand[op].predicate) (operand, mode))
 98.3093 ++    operand = copy_to_mode_reg (mode, operand);
 98.3094 ++
 98.3095 ++  /* ??? Better errors would be nice */
 98.3096 ++  if (!(*insn_data[d->icode].operand[op].predicate) (operand, mode))
 98.3097 ++    error ("Invalid argument %d to %s", argnum, d->name);
 98.3098 ++
 98.3099 ++  return operand;
 98.3100 ++}
 98.3101 ++
 98.3102 ++
 98.3103 ++static rtx
 98.3104 ++nios2_expand_custom_n (const struct builtin_description *d, tree exp, 
 98.3105 ++                       rtx target ATTRIBUTE_UNUSED, rtx subtarget ATTRIBUTE_UNUSED, 
 98.3106 ++                       enum machine_mode mode ATTRIBUTE_UNUSED, int ignore ATTRIBUTE_UNUSED)
 98.3107 ++{
 98.3108 ++  tree arglist = TREE_OPERAND (exp, 1);
 98.3109 ++  rtx pat;
 98.3110 ++  rtx opcode;
 98.3111 ++
 98.3112 ++  /* custom_n should have exactly one operand */
 98.3113 ++  if (insn_data[d->icode].n_operands != 1)
 98.3114 ++    abort ();
 98.3115 ++
 98.3116 ++  opcode = nios2_extract_opcode (d, 0, arglist);
 98.3117 ++
 98.3118 ++  pat = GEN_FCN (d->icode) (opcode);
 98.3119 ++  if (!pat)
 98.3120 ++    return 0;
 98.3121 ++  emit_insn (pat);
 98.3122 ++  return 0;
 98.3123 ++}
 98.3124 ++
 98.3125 ++static rtx
 98.3126 ++nios2_expand_custom_Xn (const struct builtin_description *d, tree exp, 
 98.3127 ++                        rtx target, rtx subtarget ATTRIBUTE_UNUSED, 
 98.3128 ++                        enum machine_mode mode ATTRIBUTE_UNUSED, 
 98.3129 ++                        int ignore ATTRIBUTE_UNUSED)
 98.3130 ++{
 98.3131 ++  tree arglist = TREE_OPERAND (exp, 1);
 98.3132 ++  rtx pat;
 98.3133 ++  rtx opcode;
 98.3134 ++
 98.3135 ++  /* custom_Xn should have exactly two operands */
 98.3136 ++  if (insn_data[d->icode].n_operands != 2)
 98.3137 ++    abort ();
 98.3138 ++
 98.3139 ++  target = nios2_create_target (d, target);
 98.3140 ++  opcode = nios2_extract_opcode (d, 1, arglist);
 98.3141 ++
 98.3142 ++  pat = GEN_FCN (d->icode) (target, opcode);
 98.3143 ++  if (!pat)
 98.3144 ++    return 0;
 98.3145 ++  emit_insn (pat);
 98.3146 ++  return target;
 98.3147 ++}
 98.3148 ++
 98.3149 ++static rtx
 98.3150 ++nios2_expand_custom_nX (const struct builtin_description *d, tree exp, 
 98.3151 ++                        rtx target ATTRIBUTE_UNUSED, rtx subtarget ATTRIBUTE_UNUSED, 
 98.3152 ++                        enum machine_mode mode ATTRIBUTE_UNUSED, int ignore ATTRIBUTE_UNUSED)
 98.3153 ++{
 98.3154 ++  tree arglist = TREE_OPERAND (exp, 1);
 98.3155 ++  rtx pat;
 98.3156 ++  rtx opcode;
 98.3157 ++  rtx operands[1];
 98.3158 ++  int i;
 98.3159 ++
 98.3160 ++
 98.3161 ++  /* custom_nX should have exactly two operands */
 98.3162 ++  if (insn_data[d->icode].n_operands != 2)
 98.3163 ++    abort ();
 98.3164 ++
 98.3165 ++  opcode = nios2_extract_opcode (d, 0, arglist);
 98.3166 ++  for (i = 0; i < 1; i++)
 98.3167 ++    {
 98.3168 ++      arglist = TREE_CHAIN (arglist);
 98.3169 ++      operands[i] = nios2_extract_operand (d, i + 1, i + 1, arglist);
 98.3170 ++    }
 98.3171 ++
 98.3172 ++  pat = GEN_FCN (d->icode) (opcode, operands[0]);
 98.3173 ++  if (!pat)
 98.3174 ++    return 0;
 98.3175 ++  emit_insn (pat);
 98.3176 ++  return 0;
 98.3177 ++}
 98.3178 ++
 98.3179 ++static rtx
 98.3180 ++nios2_expand_custom_XnX (const struct builtin_description *d, tree exp, rtx target, 
 98.3181 ++                         rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, 
 98.3182 ++                         int ignore ATTRIBUTE_UNUSED)
 98.3183 ++{
 98.3184 ++  tree arglist = TREE_OPERAND (exp, 1);
 98.3185 ++  rtx pat;
 98.3186 ++  rtx opcode;
 98.3187 ++  rtx operands[1];
 98.3188 ++  int i;
 98.3189 ++
 98.3190 ++  /* custom_Xn should have exactly three operands */
 98.3191 ++  if (insn_data[d->icode].n_operands != 3)
 98.3192 ++    abort ();
 98.3193 ++
 98.3194 ++  target = nios2_create_target (d, target);
 98.3195 ++  opcode = nios2_extract_opcode (d, 1, arglist);
 98.3196 ++
 98.3197 ++  for (i = 0; i < 1; i++)
 98.3198 ++    {
 98.3199 ++      arglist = TREE_CHAIN (arglist);
 98.3200 ++      operands[i] = nios2_extract_operand (d, i + 2, i + 1, arglist);
 98.3201 ++    }
 98.3202 ++
 98.3203 ++  pat = GEN_FCN (d->icode) (target, opcode, operands[0]);
 98.3204 ++
 98.3205 ++  if (!pat)
 98.3206 ++    return 0;
 98.3207 ++  emit_insn (pat);
 98.3208 ++  return target;
 98.3209 ++}
 98.3210 ++
 98.3211 ++static rtx
 98.3212 ++nios2_expand_custom_nXX (const struct builtin_description *d, tree exp, rtx target ATTRIBUTE_UNUSED, 
 98.3213 ++                         rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, 
 98.3214 ++                         int ignore ATTRIBUTE_UNUSED)
 98.3215 ++{
 98.3216 ++  tree arglist = TREE_OPERAND (exp, 1);
 98.3217 ++  rtx pat;
 98.3218 ++  rtx opcode;
 98.3219 ++  rtx operands[2];
 98.3220 ++  int i;
 98.3221 ++
 98.3222 ++
 98.3223 ++  /* custom_nX should have exactly three operands */
 98.3224 ++  if (insn_data[d->icode].n_operands != 3)
 98.3225 ++    abort ();
 98.3226 ++
 98.3227 ++  opcode = nios2_extract_opcode (d, 0, arglist);
 98.3228 ++  for (i = 0; i < 2; i++)
 98.3229 ++    {
 98.3230 ++      arglist = TREE_CHAIN (arglist);
 98.3231 ++      operands[i] = nios2_extract_operand (d, i + 1, i + 1, arglist);
 98.3232 ++    }
 98.3233 ++
 98.3234 ++  pat = GEN_FCN (d->icode) (opcode, operands[0], operands[1]);
 98.3235 ++  if (!pat)
 98.3236 ++    return 0;
 98.3237 ++  emit_insn (pat);
 98.3238 ++  return 0;
 98.3239 ++}
 98.3240 ++
 98.3241 ++static rtx
 98.3242 ++nios2_expand_custom_XnXX (const struct builtin_description *d, tree exp, rtx target, 
 98.3243 ++                          rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, 
 98.3244 ++                          int ignore ATTRIBUTE_UNUSED)
 98.3245 ++{
 98.3246 ++  tree arglist = TREE_OPERAND (exp, 1);
 98.3247 ++  rtx pat;
 98.3248 ++  rtx opcode;
 98.3249 ++  rtx operands[2];
 98.3250 ++  int i;
 98.3251 ++
 98.3252 ++
 98.3253 ++  /* custom_XnX should have exactly four operands */
 98.3254 ++  if (insn_data[d->icode].n_operands != 4)
 98.3255 ++    abort ();
 98.3256 ++
 98.3257 ++  target = nios2_create_target (d, target);
 98.3258 ++  opcode = nios2_extract_opcode (d, 1, arglist);
 98.3259 ++  for (i = 0; i < 2; i++)
 98.3260 ++    {
 98.3261 ++      arglist = TREE_CHAIN (arglist);
 98.3262 ++      operands[i] = nios2_extract_operand (d, i + 2, i + 1, arglist);
 98.3263 ++    }
 98.3264 ++
 98.3265 ++  pat = GEN_FCN (d->icode) (target, opcode, operands[0], operands[1]);
 98.3266 ++
 98.3267 ++  if (!pat)
 98.3268 ++    return 0;
 98.3269 ++  emit_insn (pat);
 98.3270 ++  return target;
 98.3271 ++}
 98.3272 ++
 98.3273 ++
 98.3274 ++
 98.3275 ++static rtx
 98.3276 ++nios2_expand_STXIO (const struct builtin_description *d, tree exp, rtx target ATTRIBUTE_UNUSED, 
 98.3277 ++                    rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, 
 98.3278 ++                    int ignore ATTRIBUTE_UNUSED)
 98.3279 ++{
 98.3280 ++  tree arglist = TREE_OPERAND (exp, 1);
 98.3281 ++  rtx pat;
 98.3282 ++  rtx store_dest, store_val;
 98.3283 ++  enum insn_code icode = d->icode;
 98.3284 ++
 98.3285 ++  /* stores should have exactly two operands */
 98.3286 ++  if (insn_data[icode].n_operands != 2)
 98.3287 ++    abort ();
 98.3288 ++
 98.3289 ++  /* process the destination of the store */
 98.3290 ++  {
 98.3291 ++    enum machine_mode mode = insn_data[icode].operand[0].mode;
 98.3292 ++    tree arg = TREE_VALUE (arglist);
 98.3293 ++    store_dest = expand_expr (arg, NULL_RTX, VOIDmode, 0);
 98.3294 ++    store_dest = protect_from_queue (store_dest, 0);
 98.3295 ++
 98.3296 ++    store_dest = gen_rtx_MEM (mode, copy_to_mode_reg (Pmode, store_dest));
 98.3297 ++
 98.3298 ++    /* ??? Better errors would be nice */
 98.3299 ++    if (!(*insn_data[icode].operand[0].predicate) (store_dest, mode))
 98.3300 ++      error ("Invalid argument 1 to %s", d->name);
 98.3301 ++  }
 98.3302 ++
 98.3303 ++
 98.3304 ++  /* process the value to store */
 98.3305 ++  {
 98.3306 ++    enum machine_mode mode = insn_data[icode].operand[1].mode;
 98.3307 ++    tree arg = TREE_VALUE (TREE_CHAIN (arglist));
 98.3308 ++    store_val = expand_expr (arg, NULL_RTX, mode, 0);
 98.3309 ++    store_val = protect_from_queue (store_val, 0);
 98.3310 ++
 98.3311 ++    if (!(*insn_data[icode].operand[1].predicate) (store_val, mode))
 98.3312 ++      store_val = copy_to_mode_reg (mode, store_val);
 98.3313 ++
 98.3314 ++    /* ??? Better errors would be nice */
 98.3315 ++    if (!(*insn_data[icode].operand[1].predicate) (store_val, mode))
 98.3316 ++      error ("Invalid argument 2 to %s", d->name);
 98.3317 ++  }
 98.3318 ++
 98.3319 ++  pat = GEN_FCN (d->icode) (store_dest, store_val);
 98.3320 ++  if (!pat)
 98.3321 ++    return 0;
 98.3322 ++  emit_insn (pat);
 98.3323 ++  return 0;
 98.3324 ++}
 98.3325 ++
 98.3326 ++
 98.3327 ++static rtx
 98.3328 ++nios2_expand_LDXIO (const struct builtin_description * d, tree exp, rtx target, 
 98.3329 ++                    rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, 
 98.3330 ++                    int ignore ATTRIBUTE_UNUSED)
 98.3331 ++{
 98.3332 ++  tree arglist = TREE_OPERAND (exp, 1);
 98.3333 ++  rtx pat;
 98.3334 ++  rtx ld_src;
 98.3335 ++  enum insn_code icode = d->icode;
 98.3336 ++
 98.3337 ++  /* loads should have exactly two operands */
 98.3338 ++  if (insn_data[icode].n_operands != 2)
 98.3339 ++    abort ();
 98.3340 ++
 98.3341 ++  target = nios2_create_target (d, target);
 98.3342 ++
 98.3343 ++  {
 98.3344 ++    enum machine_mode mode = insn_data[icode].operand[1].mode;
 98.3345 ++    tree arg = TREE_VALUE (arglist);
 98.3346 ++    ld_src = expand_expr (arg, NULL_RTX, VOIDmode, 0);
 98.3347 ++    ld_src = protect_from_queue (ld_src, 0);
 98.3348 ++
 98.3349 ++    ld_src = gen_rtx_MEM (mode, copy_to_mode_reg (Pmode, ld_src));
 98.3350 ++
 98.3351 ++    /* ??? Better errors would be nice */
 98.3352 ++    if (!(*insn_data[icode].operand[1].predicate) (ld_src, mode))
 98.3353 ++      {
 98.3354 ++        error ("Invalid argument 1 to %s", d->name);
 98.3355 ++      }
 98.3356 ++  }
 98.3357 ++
 98.3358 ++  pat = GEN_FCN (d->icode) (target, ld_src);
 98.3359 ++  if (!pat)
 98.3360 ++    return 0;
 98.3361 ++  emit_insn (pat);
 98.3362 ++  return target;
 98.3363 ++}
 98.3364 ++
 98.3365 ++
 98.3366 ++static rtx
 98.3367 ++nios2_expand_sync (const struct builtin_description * d ATTRIBUTE_UNUSED, 
 98.3368 ++                   tree exp ATTRIBUTE_UNUSED, rtx target ATTRIBUTE_UNUSED, 
 98.3369 ++                   rtx subtarget ATTRIBUTE_UNUSED, 
 98.3370 ++                   enum machine_mode mode ATTRIBUTE_UNUSED, 
 98.3371 ++                   int ignore ATTRIBUTE_UNUSED)
 98.3372 ++{
 98.3373 ++  emit_insn (gen_sync ());
 98.3374 ++  return 0;
 98.3375 ++}
 98.3376 ++
 98.3377 ++static rtx
 98.3378 ++nios2_expand_rdctl (const struct builtin_description * d ATTRIBUTE_UNUSED, 
 98.3379 ++                   tree exp ATTRIBUTE_UNUSED, rtx target ATTRIBUTE_UNUSED, 
 98.3380 ++                   rtx subtarget ATTRIBUTE_UNUSED, 
 98.3381 ++                   enum machine_mode mode ATTRIBUTE_UNUSED, 
 98.3382 ++                   int ignore ATTRIBUTE_UNUSED)
 98.3383 ++{
 98.3384 ++  tree arglist = TREE_OPERAND (exp, 1);
 98.3385 ++  rtx pat;
 98.3386 ++  rtx rdctl_reg;
 98.3387 ++  enum insn_code icode = d->icode;
 98.3388 ++
 98.3389 ++  /* rdctl should have exactly two operands */
 98.3390 ++  if (insn_data[icode].n_operands != 2)
 98.3391 ++    abort ();
 98.3392 ++
 98.3393 ++  target = nios2_create_target (d, target);
 98.3394 ++
 98.3395 ++  {
 98.3396 ++    enum machine_mode mode = insn_data[icode].operand[1].mode;
 98.3397 ++    tree arg = TREE_VALUE (arglist);
 98.3398 ++    rdctl_reg = expand_expr (arg, NULL_RTX, VOIDmode, 0);
 98.3399 ++    rdctl_reg = protect_from_queue (rdctl_reg, 0);
 98.3400 ++
 98.3401 ++    if (!(*insn_data[icode].operand[1].predicate) (rdctl_reg, mode))
 98.3402 ++      {
 98.3403 ++        error ("Control register number must be in range 0-31 for %s", d->name);
 98.3404 ++      }
 98.3405 ++  }
 98.3406 ++
 98.3407 ++  pat = GEN_FCN (d->icode) (target, rdctl_reg);
 98.3408 ++  if (!pat)
 98.3409 ++    return 0;
 98.3410 ++  emit_insn (pat);
 98.3411 ++  return target;
 98.3412 ++}
 98.3413 ++
 98.3414 ++static rtx
 98.3415 ++nios2_expand_wrctl (const struct builtin_description * d ATTRIBUTE_UNUSED, 
 98.3416 ++                   tree exp ATTRIBUTE_UNUSED, rtx target ATTRIBUTE_UNUSED, 
 98.3417 ++                   rtx subtarget ATTRIBUTE_UNUSED, 
 98.3418 ++                   enum machine_mode mode ATTRIBUTE_UNUSED, 
 98.3419 ++                   int ignore ATTRIBUTE_UNUSED)
 98.3420 ++{
 98.3421 ++  tree arglist = TREE_OPERAND (exp, 1);
 98.3422 ++  rtx pat;
 98.3423 ++  rtx wrctl_reg, store_val;
 98.3424 ++  enum insn_code icode = d->icode;
 98.3425 ++
 98.3426 ++  /* stores should have exactly two operands */
 98.3427 ++  if (insn_data[icode].n_operands != 2)
 98.3428 ++    abort ();
 98.3429 ++
 98.3430 ++  /* process the destination of the store */
 98.3431 ++  {
 98.3432 ++    enum machine_mode mode = insn_data[icode].operand[0].mode;
 98.3433 ++    tree arg = TREE_VALUE (arglist);
 98.3434 ++    wrctl_reg = expand_expr (arg, NULL_RTX, VOIDmode, 0);
 98.3435 ++    wrctl_reg = protect_from_queue (wrctl_reg, 0);
 98.3436 ++
 98.3437 ++    if (!(*insn_data[icode].operand[0].predicate) (wrctl_reg, mode))
 98.3438 ++      error ("Control register number must be in range 0-31 for %s", d->name);
 98.3439 ++  }
 98.3440 ++
 98.3441 ++
 98.3442 ++  /* process the value to store */
 98.3443 ++  {
 98.3444 ++    enum machine_mode mode = insn_data[icode].operand[1].mode;
 98.3445 ++    tree arg = TREE_VALUE (TREE_CHAIN (arglist));
 98.3446 ++    store_val = expand_expr (arg, NULL_RTX, mode, 0);
 98.3447 ++    store_val = protect_from_queue (store_val, 0);
 98.3448 ++
 98.3449 ++    if (!(*insn_data[icode].operand[1].predicate) (store_val, mode))
 98.3450 ++      store_val = copy_to_mode_reg (mode, store_val);
 98.3451 ++
 98.3452 ++    /* ??? Better errors would be nice */
 98.3453 ++    if (!(*insn_data[icode].operand[1].predicate) (store_val, mode))
 98.3454 ++      error ("Invalid argument 2 to %s", d->name);
 98.3455 ++  }
 98.3456 ++
 98.3457 ++  pat = GEN_FCN (d->icode) (wrctl_reg, store_val);
 98.3458 ++  if (!pat)
 98.3459 ++    return 0;
 98.3460 ++  emit_insn (pat);
 98.3461 ++  return 0;
 98.3462 ++}
 98.3463 ++
 98.3464 ++
 98.3465 ++#include "gt-nios2.h"
 98.3466 ++
 98.3467 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2-dp-bit.c gcc-3.4.6/gcc/config/nios2/nios2-dp-bit.c
 98.3468 +--- gcc-3.4.6.orig/gcc/config/nios2/nios2-dp-bit.c	1970-01-01 01:00:00.000000000 +0100
 98.3469 ++++ gcc-3.4.6/gcc/config/nios2/nios2-dp-bit.c	2007-08-15 23:09:36.000000000 +0200
 98.3470 +@@ -0,0 +1,1652 @@
 98.3471 ++
 98.3472 ++/* This is a software floating point library which can be used
 98.3473 ++   for targets without hardware floating point. 
 98.3474 ++   Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004
 98.3475 ++   Free Software Foundation, Inc.
 98.3476 ++
 98.3477 ++This file is free software; you can redistribute it and/or modify it
 98.3478 ++under the terms of the GNU General Public License as published by the
 98.3479 ++Free Software Foundation; either version 2, or (at your option) any
 98.3480 ++later version.
 98.3481 ++
 98.3482 ++In addition to the permissions in the GNU General Public License, the
 98.3483 ++Free Software Foundation gives you unlimited permission to link the
 98.3484 ++compiled version of this file with other programs, and to distribute
 98.3485 ++those programs without any restriction coming from the use of this
 98.3486 ++file.  (The General Public License restrictions do apply in other
 98.3487 ++respects; for example, they cover modification of the file, and
 98.3488 ++distribution when not linked into another program.)
 98.3489 ++
 98.3490 ++This file is distributed in the hope that it will be useful, but
 98.3491 ++WITHOUT ANY WARRANTY; without even the implied warranty of
 98.3492 ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 98.3493 ++General Public License for more details.
 98.3494 ++
 98.3495 ++You should have received a copy of the GNU General Public License
 98.3496 ++along with this program; see the file COPYING.  If not, write to
 98.3497 ++the Free Software Foundation, 59 Temple Place - Suite 330,
 98.3498 ++Boston, MA 02111-1307, USA.  */
 98.3499 ++
 98.3500 ++/* As a special exception, if you link this library with other files,
 98.3501 ++   some of which are compiled with GCC, to produce an executable,
 98.3502 ++   this library does not by itself cause the resulting executable
 98.3503 ++   to be covered by the GNU General Public License.
 98.3504 ++   This exception does not however invalidate any other reasons why
 98.3505 ++   the executable file might be covered by the GNU General Public License.  */
 98.3506 ++
 98.3507 ++/* This implements IEEE 754 format arithmetic, but does not provide a
 98.3508 ++   mechanism for setting the rounding mode, or for generating or handling
 98.3509 ++   exceptions.
 98.3510 ++
 98.3511 ++   The original code by Steve Chamberlain, hacked by Mark Eichin and Jim
 98.3512 ++   Wilson, all of Cygnus Support.  */
 98.3513 ++
 98.3514 ++/* The intended way to use this file is to make two copies, add `#define FLOAT'
 98.3515 ++   to one copy, then compile both copies and add them to libgcc.a.  */
 98.3516 ++
 98.3517 ++#include "tconfig.h"
 98.3518 ++#include "coretypes.h"
 98.3519 ++#include "tm.h"
 98.3520 ++#include "config/fp-bit.h"
 98.3521 ++
 98.3522 ++/* The following macros can be defined to change the behavior of this file:
 98.3523 ++   FLOAT: Implement a `float', aka SFmode, fp library.  If this is not
 98.3524 ++     defined, then this file implements a `double', aka DFmode, fp library.
 98.3525 ++   FLOAT_ONLY: Used with FLOAT, to implement a `float' only library, i.e.
 98.3526 ++     don't include float->double conversion which requires the double library.
 98.3527 ++     This is useful only for machines which can't support doubles, e.g. some
 98.3528 ++     8-bit processors.
 98.3529 ++   CMPtype: Specify the type that floating point compares should return.
 98.3530 ++     This defaults to SItype, aka int.
 98.3531 ++   US_SOFTWARE_GOFAST: This makes all entry points use the same names as the
 98.3532 ++     US Software goFast library.
 98.3533 ++   _DEBUG_BITFLOAT: This makes debugging the code a little easier, by adding
 98.3534 ++     two integers to the FLO_union_type.
 98.3535 ++   NO_DENORMALS: Disable handling of denormals.
 98.3536 ++   NO_NANS: Disable nan and infinity handling
 98.3537 ++   SMALL_MACHINE: Useful when operations on QIs and HIs are faster
 98.3538 ++     than on an SI */
 98.3539 ++
 98.3540 ++/* We don't currently support extended floats (long doubles) on machines
 98.3541 ++   without hardware to deal with them.
 98.3542 ++
 98.3543 ++   These stubs are just to keep the linker from complaining about unresolved
 98.3544 ++   references which can be pulled in from libio & libstdc++, even if the
 98.3545 ++   user isn't using long doubles.  However, they may generate an unresolved
 98.3546 ++   external to abort if abort is not used by the function, and the stubs
 98.3547 ++   are referenced from within libc, since libgcc goes before and after the
 98.3548 ++   system library.  */
 98.3549 ++
 98.3550 ++#ifdef DECLARE_LIBRARY_RENAMES
 98.3551 ++  DECLARE_LIBRARY_RENAMES
 98.3552 ++#endif
 98.3553 ++
 98.3554 ++#ifdef EXTENDED_FLOAT_STUBS
 98.3555 ++extern void abort (void);
 98.3556 ++void __extendsfxf2 (void) { abort(); }
 98.3557 ++void __extenddfxf2 (void) { abort(); }
 98.3558 ++void __truncxfdf2 (void) { abort(); }
 98.3559 ++void __truncxfsf2 (void) { abort(); }
 98.3560 ++void __fixxfsi (void) { abort(); }
 98.3561 ++void __floatsixf (void) { abort(); }
 98.3562 ++void __addxf3 (void) { abort(); }
 98.3563 ++void __subxf3 (void) { abort(); }
 98.3564 ++void __mulxf3 (void) { abort(); }
 98.3565 ++void __divxf3 (void) { abort(); }
 98.3566 ++void __negxf2 (void) { abort(); }
 98.3567 ++void __eqxf2 (void) { abort(); }
 98.3568 ++void __nexf2 (void) { abort(); }
 98.3569 ++void __gtxf2 (void) { abort(); }
 98.3570 ++void __gexf2 (void) { abort(); }
 98.3571 ++void __lexf2 (void) { abort(); }
 98.3572 ++void __ltxf2 (void) { abort(); }
 98.3573 ++
 98.3574 ++void __extendsftf2 (void) { abort(); }
 98.3575 ++void __extenddftf2 (void) { abort(); }
 98.3576 ++void __trunctfdf2 (void) { abort(); }
 98.3577 ++void __trunctfsf2 (void) { abort(); }
 98.3578 ++void __fixtfsi (void) { abort(); }
 98.3579 ++void __floatsitf (void) { abort(); }
 98.3580 ++void __addtf3 (void) { abort(); }
 98.3581 ++void __subtf3 (void) { abort(); }
 98.3582 ++void __multf3 (void) { abort(); }
 98.3583 ++void __divtf3 (void) { abort(); }
 98.3584 ++void __negtf2 (void) { abort(); }
 98.3585 ++void __eqtf2 (void) { abort(); }
 98.3586 ++void __netf2 (void) { abort(); }
 98.3587 ++void __gttf2 (void) { abort(); }
 98.3588 ++void __getf2 (void) { abort(); }
 98.3589 ++void __letf2 (void) { abort(); }
 98.3590 ++void __lttf2 (void) { abort(); }
 98.3591 ++#else	/* !EXTENDED_FLOAT_STUBS, rest of file */
 98.3592 ++
 98.3593 ++/* IEEE "special" number predicates */
 98.3594 ++
 98.3595 ++#ifdef NO_NANS
 98.3596 ++
 98.3597 ++#define nan() 0
 98.3598 ++#define isnan(x) 0
 98.3599 ++#define isinf(x) 0
 98.3600 ++#else
 98.3601 ++
 98.3602 ++#if   defined L_thenan_sf
 98.3603 ++const fp_number_type __thenan_sf = { CLASS_SNAN, 0, 0, {(fractype) 0} };
 98.3604 ++#elif defined L_thenan_df
 98.3605 ++const fp_number_type __thenan_df = { CLASS_SNAN, 0, 0, {(fractype) 0} };
 98.3606 ++#elif defined L_thenan_tf
 98.3607 ++const fp_number_type __thenan_tf = { CLASS_SNAN, 0, 0, {(fractype) 0} };
 98.3608 ++#elif defined TFLOAT
 98.3609 ++extern const fp_number_type __thenan_tf;
 98.3610 ++#elif defined FLOAT
 98.3611 ++extern const fp_number_type __thenan_sf;
 98.3612 ++#else
 98.3613 ++extern const fp_number_type __thenan_df;
 98.3614 ++#endif
 98.3615 ++
 98.3616 ++INLINE
 98.3617 ++static fp_number_type *
 98.3618 ++nan (void)
 98.3619 ++{
 98.3620 ++  /* Discard the const qualifier...  */
 98.3621 ++#ifdef TFLOAT
 98.3622 ++  return (fp_number_type *) (& __thenan_tf);
 98.3623 ++#elif defined FLOAT  
 98.3624 ++  return (fp_number_type *) (& __thenan_sf);
 98.3625 ++#else
 98.3626 ++  return (fp_number_type *) (& __thenan_df);
 98.3627 ++#endif
 98.3628 ++}
 98.3629 ++
 98.3630 ++INLINE
 98.3631 ++static int
 98.3632 ++isnan ( fp_number_type *  x)
 98.3633 ++{
 98.3634 ++  return x->class == CLASS_SNAN || x->class == CLASS_QNAN;
 98.3635 ++}
 98.3636 ++
 98.3637 ++INLINE
 98.3638 ++static int
 98.3639 ++isinf ( fp_number_type *  x)
 98.3640 ++{
 98.3641 ++  return x->class == CLASS_INFINITY;
 98.3642 ++}
 98.3643 ++
 98.3644 ++#endif /* NO_NANS */
 98.3645 ++
 98.3646 ++INLINE
 98.3647 ++static int
 98.3648 ++iszero ( fp_number_type *  x)
 98.3649 ++{
 98.3650 ++  return x->class == CLASS_ZERO;
 98.3651 ++}
 98.3652 ++
 98.3653 ++INLINE 
 98.3654 ++static void
 98.3655 ++flip_sign ( fp_number_type *  x)
 98.3656 ++{
 98.3657 ++  x->sign = !x->sign;
 98.3658 ++}
 98.3659 ++
 98.3660 ++extern FLO_type pack_d ( fp_number_type * );
 98.3661 ++
 98.3662 ++#if defined(L_pack_df) || defined(L_pack_sf) || defined(L_pack_tf)
 98.3663 ++FLO_type
 98.3664 ++pack_d ( fp_number_type *  src)
 98.3665 ++{
 98.3666 ++  FLO_union_type dst;
 98.3667 ++  fractype fraction = src->fraction.ll;	/* wasn't unsigned before? */
 98.3668 ++  int sign = src->sign;
 98.3669 ++  int exp = 0;
 98.3670 ++
 98.3671 ++  if (LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && (isnan (src) || isinf (src)))
 98.3672 ++    {
 98.3673 ++      /* We can't represent these values accurately.  By using the
 98.3674 ++	 largest possible magnitude, we guarantee that the conversion
 98.3675 ++	 of infinity is at least as big as any finite number.  */
 98.3676 ++      exp = EXPMAX;
 98.3677 ++      fraction = ((fractype) 1 << FRACBITS) - 1;
 98.3678 ++    }
 98.3679 ++  else if (isnan (src))
 98.3680 ++    {
 98.3681 ++      exp = EXPMAX;
 98.3682 ++      if (src->class == CLASS_QNAN || 1)
 98.3683 ++	{
 98.3684 ++#ifdef QUIET_NAN_NEGATED
 98.3685 ++	  fraction |= QUIET_NAN - 1;
 98.3686 ++#else
 98.3687 ++	  fraction |= QUIET_NAN;
 98.3688 ++#endif
 98.3689 ++	}
 98.3690 ++    }
 98.3691 ++  else if (isinf (src))
 98.3692 ++    {
 98.3693 ++      exp = EXPMAX;
 98.3694 ++      fraction = 0;
 98.3695 ++    }
 98.3696 ++  else if (iszero (src))
 98.3697 ++    {
 98.3698 ++      exp = 0;
 98.3699 ++      fraction = 0;
 98.3700 ++    }
 98.3701 ++  else if (fraction == 0)
 98.3702 ++    {
 98.3703 ++      exp = 0;
 98.3704 ++    }
 98.3705 ++  else
 98.3706 ++    {
 98.3707 ++      if (src->normal_exp < NORMAL_EXPMIN)
 98.3708 ++	{
 98.3709 ++#ifdef NO_DENORMALS
 98.3710 ++	  /* Go straight to a zero representation if denormals are not
 98.3711 ++ 	     supported.  The denormal handling would be harmless but
 98.3712 ++ 	     isn't unnecessary.  */
 98.3713 ++	  exp = 0;
 98.3714 ++	  fraction = 0;
 98.3715 ++#else /* NO_DENORMALS */
 98.3716 ++	  /* This number's exponent is too low to fit into the bits
 98.3717 ++	     available in the number, so we'll store 0 in the exponent and
 98.3718 ++	     shift the fraction to the right to make up for it.  */
 98.3719 ++
 98.3720 ++	  int shift = NORMAL_EXPMIN - src->normal_exp;
 98.3721 ++
 98.3722 ++	  exp = 0;
 98.3723 ++
 98.3724 ++	  if (shift > FRAC_NBITS - NGARDS)
 98.3725 ++	    {
 98.3726 ++	      /* No point shifting, since it's more that 64 out.  */
 98.3727 ++	      fraction = 0;
 98.3728 ++	    }
 98.3729 ++	  else
 98.3730 ++	    {
 98.3731 ++	      int lowbit = (fraction & (((fractype)1 << shift) - 1)) ? 1 : 0;
 98.3732 ++	      fraction = (fraction >> shift) | lowbit;
 98.3733 ++	    }
 98.3734 ++	  if ((fraction & GARDMASK) == GARDMSB)
 98.3735 ++	    {
 98.3736 ++	      if ((fraction & (1 << NGARDS)))
 98.3737 ++		fraction += GARDROUND + 1;
 98.3738 ++	    }
 98.3739 ++	  else
 98.3740 ++	    {
 98.3741 ++	      /* Add to the guards to round up.  */
 98.3742 ++	      fraction += GARDROUND;
 98.3743 ++	    }
 98.3744 ++	  /* Perhaps the rounding means we now need to change the
 98.3745 ++             exponent, because the fraction is no longer denormal.  */
 98.3746 ++	  if (fraction >= IMPLICIT_1)
 98.3747 ++	    {
 98.3748 ++	      exp += 1;
 98.3749 ++	    }
 98.3750 ++	  fraction >>= NGARDS;
 98.3751 ++#endif /* NO_DENORMALS */
 98.3752 ++	}
 98.3753 ++      else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS)
 98.3754 ++	       && src->normal_exp > EXPBIAS)
 98.3755 ++	{
 98.3756 ++	  exp = EXPMAX;
 98.3757 ++	  fraction = 0;
 98.3758 ++	}
 98.3759 ++      else
 98.3760 ++	{
 98.3761 ++	  exp = src->normal_exp + EXPBIAS;
 98.3762 ++	  if (!ROUND_TOWARDS_ZERO)
 98.3763 ++	    {
 98.3764 ++	      /* IF the gard bits are the all zero, but the first, then we're
 98.3765 ++		 half way between two numbers, choose the one which makes the
 98.3766 ++		 lsb of the answer 0.  */
 98.3767 ++	      if ((fraction & GARDMASK) == GARDMSB)
 98.3768 ++		{
 98.3769 ++		  if (fraction & (1 << NGARDS))
 98.3770 ++		    fraction += GARDROUND + 1;
 98.3771 ++		}
 98.3772 ++	      else
 98.3773 ++		{
 98.3774 ++		  /* Add a one to the guards to round up */
 98.3775 ++		  fraction += GARDROUND;
 98.3776 ++		}
 98.3777 ++	      if (fraction >= IMPLICIT_2)
 98.3778 ++		{
 98.3779 ++		  fraction >>= 1;
 98.3780 ++		  exp += 1;
 98.3781 ++		}
 98.3782 ++	    }
 98.3783 ++	  fraction >>= NGARDS;
 98.3784 ++
 98.3785 ++	  if (LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && exp > EXPMAX)
 98.3786 ++	    {
 98.3787 ++	      /* Saturate on overflow.  */
 98.3788 ++	      exp = EXPMAX;
 98.3789 ++	      fraction = ((fractype) 1 << FRACBITS) - 1;
 98.3790 ++	    }
 98.3791 ++	}
 98.3792 ++    }
 98.3793 ++
 98.3794 ++  /* We previously used bitfields to store the number, but this doesn't
 98.3795 ++     handle little/big endian systems conveniently, so use shifts and
 98.3796 ++     masks */
 98.3797 ++#ifdef FLOAT_BIT_ORDER_MISMATCH
 98.3798 ++  dst.bits.fraction = fraction;
 98.3799 ++  dst.bits.exp = exp;
 98.3800 ++  dst.bits.sign = sign;
 98.3801 ++#else
 98.3802 ++# if defined TFLOAT && defined HALFFRACBITS
 98.3803 ++ {
 98.3804 ++   halffractype high, low, unity;
 98.3805 ++   int lowsign, lowexp;
 98.3806 ++
 98.3807 ++   unity = (halffractype) 1 << HALFFRACBITS;
 98.3808 ++
 98.3809 ++   /* Set HIGH to the high double's significand, masking out the implicit 1.
 98.3810 ++      Set LOW to the low double's full significand.  */
 98.3811 ++   high = (fraction >> (FRACBITS - HALFFRACBITS)) & (unity - 1);
 98.3812 ++   low = fraction & (unity * 2 - 1);
 98.3813 ++
 98.3814 ++   /* Get the initial sign and exponent of the low double.  */
 98.3815 ++   lowexp = exp - HALFFRACBITS - 1;
 98.3816 ++   lowsign = sign;
 98.3817 ++
 98.3818 ++   /* HIGH should be rounded like a normal double, making |LOW| <=
 98.3819 ++      0.5 ULP of HIGH.  Assume round-to-nearest.  */
 98.3820 ++   if (exp < EXPMAX)
 98.3821 ++     if (low > unity || (low == unity && (high & 1) == 1))
 98.3822 ++       {
 98.3823 ++	 /* Round HIGH up and adjust LOW to match.  */
 98.3824 ++	 high++;
 98.3825 ++	 if (high == unity)
 98.3826 ++	   {
 98.3827 ++	     /* May make it infinite, but that's OK.  */
 98.3828 ++	     high = 0;
 98.3829 ++	     exp++;
 98.3830 ++	   }
 98.3831 ++	 low = unity * 2 - low;
 98.3832 ++	 lowsign ^= 1;
 98.3833 ++       }
 98.3834 ++
 98.3835 ++   high |= (halffractype) exp << HALFFRACBITS;
 98.3836 ++   high |= (halffractype) sign << (HALFFRACBITS + EXPBITS);
 98.3837 ++
 98.3838 ++   if (exp == EXPMAX || exp == 0 || low == 0)
 98.3839 ++     low = 0;
 98.3840 ++   else
 98.3841 ++     {
 98.3842 ++       while (lowexp > 0 && low < unity)
 98.3843 ++	 {
 98.3844 ++	   low <<= 1;
 98.3845 ++	   lowexp--;
 98.3846 ++	 }
 98.3847 ++
 98.3848 ++       if (lowexp <= 0)
 98.3849 ++	 {
 98.3850 ++	   halffractype roundmsb, round;
 98.3851 ++	   int shift;
 98.3852 ++
 98.3853 ++	   shift = 1 - lowexp;
 98.3854 ++	   roundmsb = (1 << (shift - 1));
 98.3855 ++	   round = low & ((roundmsb << 1) - 1);
 98.3856 ++
 98.3857 ++	   low >>= shift;
 98.3858 ++	   lowexp = 0;
 98.3859 ++
 98.3860 ++	   if (round > roundmsb || (round == roundmsb && (low & 1) == 1))
 98.3861 ++	     {
 98.3862 ++	       low++;
 98.3863 ++	       if (low == unity)
 98.3864 ++		 /* LOW rounds up to the smallest normal number.  */
 98.3865 ++		 lowexp++;
 98.3866 ++	     }
 98.3867 ++	 }
 98.3868 ++
 98.3869 ++       low &= unity - 1;
 98.3870 ++       low |= (halffractype) lowexp << HALFFRACBITS;
 98.3871 ++       low |= (halffractype) lowsign << (HALFFRACBITS + EXPBITS);
 98.3872 ++     }
 98.3873 ++   dst.value_raw = ((fractype) high << HALFSHIFT) | low;
 98.3874 ++ }
 98.3875 ++# else
 98.3876 ++  dst.value_raw = fraction & ((((fractype)1) << FRACBITS) - (fractype)1);
 98.3877 ++  dst.value_raw |= ((fractype) (exp & ((1 << EXPBITS) - 1))) << FRACBITS;
 98.3878 ++  dst.value_raw |= ((fractype) (sign & 1)) << (FRACBITS | EXPBITS);
 98.3879 ++# endif
 98.3880 ++#endif
 98.3881 ++
 98.3882 ++#if defined(FLOAT_WORD_ORDER_MISMATCH) && !defined(FLOAT)
 98.3883 ++#ifdef TFLOAT
 98.3884 ++  {
 98.3885 ++    qrtrfractype tmp1 = dst.words[0];
 98.3886 ++    qrtrfractype tmp2 = dst.words[1];
 98.3887 ++    dst.words[0] = dst.words[3];
 98.3888 ++    dst.words[1] = dst.words[2];
 98.3889 ++    dst.words[2] = tmp2;
 98.3890 ++    dst.words[3] = tmp1;
 98.3891 ++  }
 98.3892 ++#else
 98.3893 ++  {
 98.3894 ++    halffractype tmp = dst.words[0];
 98.3895 ++    dst.words[0] = dst.words[1];
 98.3896 ++    dst.words[1] = tmp;
 98.3897 ++  }
 98.3898 ++#endif
 98.3899 ++#endif
 98.3900 ++
 98.3901 ++  return dst.value;
 98.3902 ++}
 98.3903 ++#endif
 98.3904 ++
 98.3905 ++#if defined(L_unpack_df) || defined(L_unpack_sf) || defined(L_unpack_tf)
 98.3906 ++void
 98.3907 ++unpack_d (FLO_union_type * src, fp_number_type * dst)
 98.3908 ++{
 98.3909 ++  /* We previously used bitfields to store the number, but this doesn't
 98.3910 ++     handle little/big endian systems conveniently, so use shifts and
 98.3911 ++     masks */
 98.3912 ++  fractype fraction;
 98.3913 ++  int exp;
 98.3914 ++  int sign;
 98.3915 ++
 98.3916 ++#if defined(FLOAT_WORD_ORDER_MISMATCH) && !defined(FLOAT)
 98.3917 ++  FLO_union_type swapped;
 98.3918 ++
 98.3919 ++#ifdef TFLOAT
 98.3920 ++  swapped.words[0] = src->words[3];
 98.3921 ++  swapped.words[1] = src->words[2];
 98.3922 ++  swapped.words[2] = src->words[1];
 98.3923 ++  swapped.words[3] = src->words[0];
 98.3924 ++#else
 98.3925 ++  swapped.words[0] = src->words[1];
 98.3926 ++  swapped.words[1] = src->words[0];
 98.3927 ++#endif
 98.3928 ++  src = &swapped;
 98.3929 ++#endif
 98.3930 ++  
 98.3931 ++#ifdef FLOAT_BIT_ORDER_MISMATCH
 98.3932 ++  fraction = src->bits.fraction;
 98.3933 ++  exp = src->bits.exp;
 98.3934 ++  sign = src->bits.sign;
 98.3935 ++#else
 98.3936 ++# if defined TFLOAT && defined HALFFRACBITS
 98.3937 ++ {
 98.3938 ++   halffractype high, low;
 98.3939 ++   
 98.3940 ++   high = src->value_raw >> HALFSHIFT;
 98.3941 ++   low = src->value_raw & (((fractype)1 << HALFSHIFT) - 1);
 98.3942 ++
 98.3943 ++   fraction = high & ((((fractype)1) << HALFFRACBITS) - 1);
 98.3944 ++   fraction <<= FRACBITS - HALFFRACBITS;
 98.3945 ++   exp = ((int)(high >> HALFFRACBITS)) & ((1 << EXPBITS) - 1);
 98.3946 ++   sign = ((int)(high >> (((HALFFRACBITS + EXPBITS))))) & 1;
 98.3947 ++
 98.3948 ++   if (exp != EXPMAX && exp != 0 && low != 0)
 98.3949 ++     {
 98.3950 ++       int lowexp = ((int)(low >> HALFFRACBITS)) & ((1 << EXPBITS) - 1);
 98.3951 ++       int lowsign = ((int)(low >> (((HALFFRACBITS + EXPBITS))))) & 1;
 98.3952 ++       int shift;
 98.3953 ++       fractype xlow;
 98.3954 ++
 98.3955 ++       xlow = low & ((((fractype)1) << HALFFRACBITS) - 1);
 98.3956 ++       if (lowexp)
 98.3957 ++	 xlow |= (((halffractype)1) << HALFFRACBITS);
 98.3958 ++       else
 98.3959 ++	 lowexp = 1;
 98.3960 ++       shift = (FRACBITS - HALFFRACBITS) - (exp - lowexp);
 98.3961 ++       if (shift > 0)
 98.3962 ++	 xlow <<= shift;
 98.3963 ++       else if (shift < 0)
 98.3964 ++	 xlow >>= -shift;
 98.3965 ++       if (sign == lowsign)
 98.3966 ++	 fraction += xlow;
 98.3967 ++       else if (fraction >= xlow)
 98.3968 ++	 fraction -= xlow;
 98.3969 ++       else
 98.3970 ++	 {
 98.3971 ++	   /* The high part is a power of two but the full number is lower.
 98.3972 ++	      This code will leave the implicit 1 in FRACTION, but we'd
 98.3973 ++	      have added that below anyway.  */
 98.3974 ++	   fraction = (((fractype) 1 << FRACBITS) - xlow) << 1;
 98.3975 ++	   exp--;
 98.3976 ++	 }
 98.3977 ++     }
 98.3978 ++ }
 98.3979 ++# else
 98.3980 ++  fraction = src->value_raw & ((((fractype)1) << FRACBITS) - 1);
 98.3981 ++  exp = ((int)(src->value_raw >> FRACBITS)) & ((1 << EXPBITS) - 1);
 98.3982 ++  sign = ((int)(src->value_raw >> (FRACBITS + EXPBITS))) & 1;
 98.3983 ++# endif
 98.3984 ++#endif
 98.3985 ++
 98.3986 ++  dst->sign = sign;
 98.3987 ++  if (exp == 0)
 98.3988 ++    {
 98.3989 ++      /* Hmm.  Looks like 0 */
 98.3990 ++      if (fraction == 0
 98.3991 ++#ifdef NO_DENORMALS
 98.3992 ++	  || 1
 98.3993 ++#endif
 98.3994 ++	  )
 98.3995 ++	{
 98.3996 ++	  /* tastes like zero */
 98.3997 ++	  dst->class = CLASS_ZERO;
 98.3998 ++	}
 98.3999 ++      else
 98.4000 ++	{
 98.4001 ++	  /* Zero exponent with nonzero fraction - it's denormalized,
 98.4002 ++	     so there isn't a leading implicit one - we'll shift it so
 98.4003 ++	     it gets one.  */
 98.4004 ++	  dst->normal_exp = exp - EXPBIAS + 1;
 98.4005 ++	  fraction <<= NGARDS;
 98.4006 ++
 98.4007 ++	  dst->class = CLASS_NUMBER;
 98.4008 ++#if 1
 98.4009 ++	  while (fraction < IMPLICIT_1)
 98.4010 ++	    {
 98.4011 ++	      fraction <<= 1;
 98.4012 ++	      dst->normal_exp--;
 98.4013 ++	    }
 98.4014 ++#endif
 98.4015 ++	  dst->fraction.ll = fraction;
 98.4016 ++	}
 98.4017 ++    }
 98.4018 ++  else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && exp == EXPMAX)
 98.4019 ++    {
 98.4020 ++      /* Huge exponent*/
 98.4021 ++      if (fraction == 0)
 98.4022 ++	{
 98.4023 ++	  /* Attached to a zero fraction - means infinity */
 98.4024 ++	  dst->class = CLASS_INFINITY;
 98.4025 ++	}
 98.4026 ++      else
 98.4027 ++	{
 98.4028 ++	  /* Nonzero fraction, means nan */
 98.4029 ++#ifdef QUIET_NAN_NEGATED
 98.4030 ++	  if ((fraction & QUIET_NAN) == 0)
 98.4031 ++#else
 98.4032 ++	  if (fraction & QUIET_NAN)
 98.4033 ++#endif
 98.4034 ++	    {
 98.4035 ++	      dst->class = CLASS_QNAN;
 98.4036 ++	    }
 98.4037 ++	  else
 98.4038 ++	    {
 98.4039 ++	      dst->class = CLASS_SNAN;
 98.4040 ++	    }
 98.4041 ++	  /* Keep the fraction part as the nan number */
 98.4042 ++	  dst->fraction.ll = fraction;
 98.4043 ++	}
 98.4044 ++    }
 98.4045 ++  else
 98.4046 ++    {
 98.4047 ++      /* Nothing strange about this number */
 98.4048 ++      dst->normal_exp = exp - EXPBIAS;
 98.4049 ++      dst->class = CLASS_NUMBER;
 98.4050 ++      dst->fraction.ll = (fraction << NGARDS) | IMPLICIT_1;
 98.4051 ++    }
 98.4052 ++}
 98.4053 ++#endif /* L_unpack_df || L_unpack_sf */
 98.4054 ++
 98.4055 ++#if defined(L_addsub_sf) || defined(L_addsub_df) || defined(L_addsub_tf)
 98.4056 ++static fp_number_type *
 98.4057 ++_fpadd_parts (fp_number_type * a,
 98.4058 ++	      fp_number_type * b,
 98.4059 ++	      fp_number_type * tmp)
 98.4060 ++{
 98.4061 ++  intfrac tfraction;
 98.4062 ++
 98.4063 ++  /* Put commonly used fields in local variables.  */
 98.4064 ++  int a_normal_exp;
 98.4065 ++  int b_normal_exp;
 98.4066 ++  fractype a_fraction;
 98.4067 ++  fractype b_fraction;
 98.4068 ++
 98.4069 ++  if (isnan (a))
 98.4070 ++    {
 98.4071 ++      return a;
 98.4072 ++    }
 98.4073 ++  if (isnan (b))
 98.4074 ++    {
 98.4075 ++      return b;
 98.4076 ++    }
 98.4077 ++  if (isinf (a))
 98.4078 ++    {
 98.4079 ++      /* Adding infinities with opposite signs yields a NaN.  */
 98.4080 ++      if (isinf (b) && a->sign != b->sign)
 98.4081 ++	return nan ();
 98.4082 ++      return a;
 98.4083 ++    }
 98.4084 ++  if (isinf (b))
 98.4085 ++    {
 98.4086 ++      return b;
 98.4087 ++    }
 98.4088 ++  if (iszero (b))
 98.4089 ++    {
 98.4090 ++      if (iszero (a))
 98.4091 ++	{
 98.4092 ++	  *tmp = *a;
 98.4093 ++	  tmp->sign = a->sign & b->sign;
 98.4094 ++	  return tmp;
 98.4095 ++	}
 98.4096 ++      return a;
 98.4097 ++    }
 98.4098 ++  if (iszero (a))
 98.4099 ++    {
 98.4100 ++      return b;
 98.4101 ++    }
 98.4102 ++
 98.4103 ++  /* Got two numbers. shift the smaller and increment the exponent till
 98.4104 ++     they're the same */
 98.4105 ++  {
 98.4106 ++    int diff;
 98.4107 ++
 98.4108 ++    a_normal_exp = a->normal_exp;
 98.4109 ++    b_normal_exp = b->normal_exp;
 98.4110 ++    a_fraction = a->fraction.ll;
 98.4111 ++    b_fraction = b->fraction.ll;
 98.4112 ++
 98.4113 ++    diff = a_normal_exp - b_normal_exp;
 98.4114 ++
 98.4115 ++    if (diff < 0)
 98.4116 ++      diff = -diff;
 98.4117 ++    if (diff < FRAC_NBITS)
 98.4118 ++      {
 98.4119 ++	/* ??? This does shifts one bit at a time.  Optimize.  */
 98.4120 ++	while (a_normal_exp > b_normal_exp)
 98.4121 ++	  {
 98.4122 ++	    b_normal_exp++;
 98.4123 ++	    LSHIFT (b_fraction);
 98.4124 ++	  }
 98.4125 ++	while (b_normal_exp > a_normal_exp)
 98.4126 ++	  {
 98.4127 ++	    a_normal_exp++;
 98.4128 ++	    LSHIFT (a_fraction);
 98.4129 ++	  }
 98.4130 ++      }
 98.4131 ++    else
 98.4132 ++      {
 98.4133 ++	/* Somethings's up.. choose the biggest */
 98.4134 ++	if (a_normal_exp > b_normal_exp)
 98.4135 ++	  {
 98.4136 ++	    b_normal_exp = a_normal_exp;
 98.4137 ++	    b_fraction = 0;
 98.4138 ++	  }
 98.4139 ++	else
 98.4140 ++	  {
 98.4141 ++	    a_normal_exp = b_normal_exp;
 98.4142 ++	    a_fraction = 0;
 98.4143 ++	  }
 98.4144 ++      }
 98.4145 ++  }
 98.4146 ++
 98.4147 ++  if (a->sign != b->sign)
 98.4148 ++    {
 98.4149 ++      if (a->sign)
 98.4150 ++	{
 98.4151 ++	  tfraction = -a_fraction + b_fraction;
 98.4152 ++	}
 98.4153 ++      else
 98.4154 ++	{
 98.4155 ++	  tfraction = a_fraction - b_fraction;
 98.4156 ++	}
 98.4157 ++      if (tfraction >= 0)
 98.4158 ++	{
 98.4159 ++	  tmp->sign = 0;
 98.4160 ++	  tmp->normal_exp = a_normal_exp;
 98.4161 ++	  tmp->fraction.ll = tfraction;
 98.4162 ++	}
 98.4163 ++      else
 98.4164 ++	{
 98.4165 ++	  tmp->sign = 1;
 98.4166 ++	  tmp->normal_exp = a_normal_exp;
 98.4167 ++	  tmp->fraction.ll = -tfraction;
 98.4168 ++	}
 98.4169 ++      /* and renormalize it */
 98.4170 ++
 98.4171 ++      while (tmp->fraction.ll < IMPLICIT_1 && tmp->fraction.ll)
 98.4172 ++	{
 98.4173 ++	  tmp->fraction.ll <<= 1;
 98.4174 ++	  tmp->normal_exp--;
 98.4175 ++	}
 98.4176 ++    }
 98.4177 ++  else
 98.4178 ++    {
 98.4179 ++      tmp->sign = a->sign;
 98.4180 ++      tmp->normal_exp = a_normal_exp;
 98.4181 ++      tmp->fraction.ll = a_fraction + b_fraction;
 98.4182 ++    }
 98.4183 ++  tmp->class = CLASS_NUMBER;
 98.4184 ++  /* Now the fraction is added, we have to shift down to renormalize the
 98.4185 ++     number */
 98.4186 ++
 98.4187 ++  if (tmp->fraction.ll >= IMPLICIT_2)
 98.4188 ++    {
 98.4189 ++      LSHIFT (tmp->fraction.ll);
 98.4190 ++      tmp->normal_exp++;
 98.4191 ++    }
 98.4192 ++  return tmp;
 98.4193 ++
 98.4194 ++}
 98.4195 ++
 98.4196 ++FLO_type
 98.4197 ++add (FLO_type arg_a, FLO_type arg_b)
 98.4198 ++{
 98.4199 ++  fp_number_type a;
 98.4200 ++  fp_number_type b;
 98.4201 ++  fp_number_type tmp;
 98.4202 ++  fp_number_type *res;
 98.4203 ++  FLO_union_type au, bu;
 98.4204 ++
 98.4205 ++  au.value = arg_a;
 98.4206 ++  bu.value = arg_b;
 98.4207 ++
 98.4208 ++  unpack_d (&au, &a);
 98.4209 ++  unpack_d (&bu, &b);
 98.4210 ++
 98.4211 ++  res = _fpadd_parts (&a, &b, &tmp);
 98.4212 ++
 98.4213 ++  return pack_d (res);
 98.4214 ++}
 98.4215 ++
 98.4216 ++FLO_type
 98.4217 ++sub (FLO_type arg_a, FLO_type arg_b)
 98.4218 ++{
 98.4219 ++  fp_number_type a;
 98.4220 ++  fp_number_type b;
 98.4221 ++  fp_number_type tmp;
 98.4222 ++  fp_number_type *res;
 98.4223 ++  FLO_union_type au, bu;
 98.4224 ++
 98.4225 ++  au.value = arg_a;
 98.4226 ++  bu.value = arg_b;
 98.4227 ++
 98.4228 ++  unpack_d (&au, &a);
 98.4229 ++  unpack_d (&bu, &b);
 98.4230 ++
 98.4231 ++  b.sign ^= 1;
 98.4232 ++
 98.4233 ++  res = _fpadd_parts (&a, &b, &tmp);
 98.4234 ++
 98.4235 ++  return pack_d (res);
 98.4236 ++}
 98.4237 ++#endif /* L_addsub_sf || L_addsub_df */
 98.4238 ++
 98.4239 ++#if defined(L_mul_sf) || defined(L_mul_df) || defined(L_mul_tf)
 98.4240 ++static inline __attribute__ ((__always_inline__)) fp_number_type *
 98.4241 ++_fpmul_parts ( fp_number_type *  a,
 98.4242 ++	       fp_number_type *  b,
 98.4243 ++	       fp_number_type * tmp)
 98.4244 ++{
 98.4245 ++  fractype low = 0;
 98.4246 ++  fractype high = 0;
 98.4247 ++
 98.4248 ++  if (isnan (a))
 98.4249 ++    {
 98.4250 ++      a->sign = a->sign != b->sign;
 98.4251 ++      return a;
 98.4252 ++    }
 98.4253 ++  if (isnan (b))
 98.4254 ++    {
 98.4255 ++      b->sign = a->sign != b->sign;
 98.4256 ++      return b;
 98.4257 ++    }
 98.4258 ++  if (isinf (a))
 98.4259 ++    {
 98.4260 ++      if (iszero (b))
 98.4261 ++	return nan ();
 98.4262 ++      a->sign = a->sign != b->sign;
 98.4263 ++      return a;
 98.4264 ++    }
 98.4265 ++  if (isinf (b))
 98.4266 ++    {
 98.4267 ++      if (iszero (a))
 98.4268 ++	{
 98.4269 ++	  return nan ();
 98.4270 ++	}
 98.4271 ++      b->sign = a->sign != b->sign;
 98.4272 ++      return b;
 98.4273 ++    }
 98.4274 ++  if (iszero (a))
 98.4275 ++    {
 98.4276 ++      a->sign = a->sign != b->sign;
 98.4277 ++      return a;
 98.4278 ++    }
 98.4279 ++  if (iszero (b))
 98.4280 ++    {
 98.4281 ++      b->sign = a->sign != b->sign;
 98.4282 ++      return b;
 98.4283 ++    }
 98.4284 ++
 98.4285 ++  /* Calculate the mantissa by multiplying both numbers to get a
 98.4286 ++     twice-as-wide number.  */
 98.4287 ++  {
 98.4288 ++#if defined(NO_DI_MODE) || defined(TFLOAT)
 98.4289 ++    {
 98.4290 ++      fractype x = a->fraction.ll;
 98.4291 ++      fractype ylow = b->fraction.ll;
 98.4292 ++      fractype yhigh = 0;
 98.4293 ++      int bit;
 98.4294 ++
 98.4295 ++      /* ??? This does multiplies one bit at a time.  Optimize.  */
 98.4296 ++      for (bit = 0; bit < FRAC_NBITS; bit++)
 98.4297 ++	{
 98.4298 ++	  int carry;
 98.4299 ++
 98.4300 ++	  if (x & 1)
 98.4301 ++	    {
 98.4302 ++	      carry = (low += ylow) < ylow;
 98.4303 ++	      high += yhigh + carry;
 98.4304 ++	    }
 98.4305 ++	  yhigh <<= 1;
 98.4306 ++	  if (ylow & FRACHIGH)
 98.4307 ++	    {
 98.4308 ++	      yhigh |= 1;
 98.4309 ++	    }
 98.4310 ++	  ylow <<= 1;
 98.4311 ++	  x >>= 1;
 98.4312 ++	}
 98.4313 ++    }
 98.4314 ++#elif defined(FLOAT) 
 98.4315 ++    /* Multiplying two USIs to get a UDI, we're safe.  */
 98.4316 ++    {
 98.4317 ++      UDItype answer = (UDItype)a->fraction.ll * (UDItype)b->fraction.ll;
 98.4318 ++      
 98.4319 ++      high = answer >> BITS_PER_SI;
 98.4320 ++      low = answer;
 98.4321 ++    }
 98.4322 ++#else
 98.4323 ++    /* fractype is DImode, but we need the result to be twice as wide.
 98.4324 ++       Assuming a widening multiply from DImode to TImode is not
 98.4325 ++       available, build one by hand.  */
 98.4326 ++    {
 98.4327 ++      USItype nl = a->fraction.ll;
 98.4328 ++      USItype nh = a->fraction.ll >> BITS_PER_SI;
 98.4329 ++      USItype ml = b->fraction.ll;
 98.4330 ++      USItype mh = b->fraction.ll >> BITS_PER_SI;
 98.4331 ++      UDItype pp_ll = (UDItype) ml * nl;
 98.4332 ++      UDItype pp_hl = (UDItype) mh * nl;
 98.4333 ++      UDItype pp_lh = (UDItype) ml * nh;
 98.4334 ++      UDItype pp_hh = (UDItype) mh * nh;
 98.4335 ++      UDItype res2 = 0;
 98.4336 ++      UDItype res0 = 0;
 98.4337 ++      UDItype ps_hh__ = pp_hl + pp_lh;
 98.4338 ++      if (ps_hh__ < pp_hl)
 98.4339 ++	res2 += (UDItype)1 << BITS_PER_SI;
 98.4340 ++      pp_hl = (UDItype)(USItype)ps_hh__ << BITS_PER_SI;
 98.4341 ++      res0 = pp_ll + pp_hl;
 98.4342 ++      if (res0 < pp_ll)
 98.4343 ++	res2++;
 98.4344 ++      res2 += (ps_hh__ >> BITS_PER_SI) + pp_hh;
 98.4345 ++      high = res2;
 98.4346 ++      low = res0;
 98.4347 ++    }
 98.4348 ++#endif
 98.4349 ++  }
 98.4350 ++
 98.4351 ++  tmp->normal_exp = a->normal_exp + b->normal_exp
 98.4352 ++    + FRAC_NBITS - (FRACBITS + NGARDS);
 98.4353 ++  tmp->sign = a->sign != b->sign;
 98.4354 ++  while (high >= IMPLICIT_2)
 98.4355 ++    {
 98.4356 ++      tmp->normal_exp++;
 98.4357 ++      if (high & 1)
 98.4358 ++	{
 98.4359 ++	  low >>= 1;
 98.4360 ++	  low |= FRACHIGH;
 98.4361 ++	}
 98.4362 ++      high >>= 1;
 98.4363 ++    }
 98.4364 ++  while (high < IMPLICIT_1)
 98.4365 ++    {
 98.4366 ++      tmp->normal_exp--;
 98.4367 ++
 98.4368 ++      high <<= 1;
 98.4369 ++      if (low & FRACHIGH)
 98.4370 ++	high |= 1;
 98.4371 ++      low <<= 1;
 98.4372 ++    }
 98.4373 ++  /* rounding is tricky. if we only round if it won't make us round later.  */
 98.4374 ++#if 0
 98.4375 ++  if (low & FRACHIGH2)
 98.4376 ++    {
 98.4377 ++      if (((high & GARDMASK) != GARDMSB)
 98.4378 ++	  && (((high + 1) & GARDMASK) == GARDMSB))
 98.4379 ++	{
 98.4380 ++	  /* don't round, it gets done again later.  */
 98.4381 ++	}
 98.4382 ++      else
 98.4383 ++	{
 98.4384 ++	  high++;
 98.4385 ++	}
 98.4386 ++    }
 98.4387 ++#endif
 98.4388 ++  if (!ROUND_TOWARDS_ZERO && (high & GARDMASK) == GARDMSB)
 98.4389 ++    {
 98.4390 ++      if (high & (1 << NGARDS))
 98.4391 ++	{
 98.4392 ++	  /* half way, so round to even */
 98.4393 ++	  high += GARDROUND + 1;
 98.4394 ++	}
 98.4395 ++      else if (low)
 98.4396 ++	{
 98.4397 ++	  /* but we really weren't half way */
 98.4398 ++	  high += GARDROUND + 1;
 98.4399 ++	}
 98.4400 ++    }
 98.4401 ++  tmp->fraction.ll = high;
 98.4402 ++  tmp->class = CLASS_NUMBER;
 98.4403 ++  return tmp;
 98.4404 ++}
 98.4405 ++
 98.4406 ++FLO_type
 98.4407 ++multiply (FLO_type arg_a, FLO_type arg_b)
 98.4408 ++{
 98.4409 ++  fp_number_type a;
 98.4410 ++  fp_number_type b;
 98.4411 ++  fp_number_type tmp;
 98.4412 ++  fp_number_type *res;
 98.4413 ++  FLO_union_type au, bu;
 98.4414 ++
 98.4415 ++  au.value = arg_a;
 98.4416 ++  bu.value = arg_b;
 98.4417 ++
 98.4418 ++  unpack_d (&au, &a);
 98.4419 ++  unpack_d (&bu, &b);
 98.4420 ++
 98.4421 ++  res = _fpmul_parts (&a, &b, &tmp);
 98.4422 ++
 98.4423 ++  return pack_d (res);
 98.4424 ++}
 98.4425 ++#endif /* L_mul_sf || L_mul_df */
 98.4426 ++
 98.4427 ++#if defined(L_div_sf) || defined(L_div_df) || defined(L_div_tf)
 98.4428 ++static inline __attribute__ ((__always_inline__)) fp_number_type *
 98.4429 ++_fpdiv_parts (fp_number_type * a,
 98.4430 ++	      fp_number_type * b)
 98.4431 ++{
 98.4432 ++  fractype bit;
 98.4433 ++  fractype numerator;
 98.4434 ++  fractype denominator;
 98.4435 ++  fractype quotient;
 98.4436 ++
 98.4437 ++  if (isnan (a))
 98.4438 ++    {
 98.4439 ++      return a;
 98.4440 ++    }
 98.4441 ++  if (isnan (b))
 98.4442 ++    {
 98.4443 ++      return b;
 98.4444 ++    }
 98.4445 ++
 98.4446 ++  a->sign = a->sign ^ b->sign;
 98.4447 ++
 98.4448 ++  if (isinf (a) || iszero (a))
 98.4449 ++    {
 98.4450 ++      if (a->class == b->class)
 98.4451 ++	return nan ();
 98.4452 ++      return a;
 98.4453 ++    }
 98.4454 ++
 98.4455 ++  if (isinf (b))
 98.4456 ++    {
 98.4457 ++      a->fraction.ll = 0;
 98.4458 ++      a->normal_exp = 0;
 98.4459 ++      return a;
 98.4460 ++    }
 98.4461 ++  if (iszero (b))
 98.4462 ++    {
 98.4463 ++      a->class = CLASS_INFINITY;
 98.4464 ++      return a;
 98.4465 ++    }
 98.4466 ++
 98.4467 ++  /* Calculate the mantissa by multiplying both 64bit numbers to get a
 98.4468 ++     128 bit number */
 98.4469 ++  {
 98.4470 ++    /* quotient =
 98.4471 ++       ( numerator / denominator) * 2^(numerator exponent -  denominator exponent)
 98.4472 ++     */
 98.4473 ++
 98.4474 ++    a->normal_exp = a->normal_exp - b->normal_exp;
 98.4475 ++    numerator = a->fraction.ll;
 98.4476 ++    denominator = b->fraction.ll;
 98.4477 ++
 98.4478 ++    if (numerator < denominator)
 98.4479 ++      {
 98.4480 ++	/* Fraction will be less than 1.0 */
 98.4481 ++	numerator *= 2;
 98.4482 ++	a->normal_exp--;
 98.4483 ++      }
 98.4484 ++    bit = IMPLICIT_1;
 98.4485 ++    quotient = 0;
 98.4486 ++    /* ??? Does divide one bit at a time.  Optimize.  */
 98.4487 ++    while (bit)
 98.4488 ++      {
 98.4489 ++	if (numerator >= denominator)
 98.4490 ++	  {
 98.4491 ++	    quotient |= bit;
 98.4492 ++	    numerator -= denominator;
 98.4493 ++	  }
 98.4494 ++	bit >>= 1;
 98.4495 ++	numerator *= 2;
 98.4496 ++      }
 98.4497 ++
 98.4498 ++    if (!ROUND_TOWARDS_ZERO && (quotient & GARDMASK) == GARDMSB)
 98.4499 ++      {
 98.4500 ++	if (quotient & (1 << NGARDS))
 98.4501 ++	  {
 98.4502 ++	    /* half way, so round to even */
 98.4503 ++	    quotient += GARDROUND + 1;
 98.4504 ++	  }
 98.4505 ++	else if (numerator)
 98.4506 ++	  {
 98.4507 ++	    /* but we really weren't half way, more bits exist */
 98.4508 ++	    quotient += GARDROUND + 1;
 98.4509 ++	  }
 98.4510 ++      }
 98.4511 ++
 98.4512 ++    a->fraction.ll = quotient;
 98.4513 ++    return (a);
 98.4514 ++  }
 98.4515 ++}
 98.4516 ++
 98.4517 ++FLO_type
 98.4518 ++divide (FLO_type arg_a, FLO_type arg_b)
 98.4519 ++{
 98.4520 ++  fp_number_type a;
 98.4521 ++  fp_number_type b;
 98.4522 ++  fp_number_type *res;
 98.4523 ++  FLO_union_type au, bu;
 98.4524 ++
 98.4525 ++  au.value = arg_a;
 98.4526 ++  bu.value = arg_b;
 98.4527 ++
 98.4528 ++  unpack_d (&au, &a);
 98.4529 ++  unpack_d (&bu, &b);
 98.4530 ++
 98.4531 ++  res = _fpdiv_parts (&a, &b);
 98.4532 ++
 98.4533 ++  return pack_d (res);
 98.4534 ++}
 98.4535 ++#endif /* L_div_sf || L_div_df */
 98.4536 ++
 98.4537 ++#if defined(L_fpcmp_parts_sf) || defined(L_fpcmp_parts_df) \
 98.4538 ++    || defined(L_fpcmp_parts_tf)
 98.4539 ++/* according to the demo, fpcmp returns a comparison with 0... thus
 98.4540 ++   a<b -> -1
 98.4541 ++   a==b -> 0
 98.4542 ++   a>b -> +1
 98.4543 ++ */
 98.4544 ++
 98.4545 ++int
 98.4546 ++__fpcmp_parts (fp_number_type * a, fp_number_type * b)
 98.4547 ++{
 98.4548 ++#if 0
 98.4549 ++  /* either nan -> unordered. Must be checked outside of this routine.  */
 98.4550 ++  if (isnan (a) && isnan (b))
 98.4551 ++    {
 98.4552 ++      return 1;			/* still unordered! */
 98.4553 ++    }
 98.4554 ++#endif
 98.4555 ++
 98.4556 ++  if (isnan (a) || isnan (b))
 98.4557 ++    {
 98.4558 ++      return 1;			/* how to indicate unordered compare? */
 98.4559 ++    }
 98.4560 ++  if (isinf (a) && isinf (b))
 98.4561 ++    {
 98.4562 ++      /* +inf > -inf, but +inf != +inf */
 98.4563 ++      /* b    \a| +inf(0)| -inf(1)
 98.4564 ++       ______\+--------+--------
 98.4565 ++       +inf(0)| a==b(0)| a<b(-1)
 98.4566 ++       -------+--------+--------
 98.4567 ++       -inf(1)| a>b(1) | a==b(0)
 98.4568 ++       -------+--------+--------
 98.4569 ++       So since unordered must be nonzero, just line up the columns...
 98.4570 ++       */
 98.4571 ++      return b->sign - a->sign;
 98.4572 ++    }
 98.4573 ++  /* but not both...  */
 98.4574 ++  if (isinf (a))
 98.4575 ++    {
 98.4576 ++      return a->sign ? -1 : 1;
 98.4577 ++    }
 98.4578 ++  if (isinf (b))
 98.4579 ++    {
 98.4580 ++      return b->sign ? 1 : -1;
 98.4581 ++    }
 98.4582 ++  if (iszero (a) && iszero (b))
 98.4583 ++    {
 98.4584 ++      return 0;
 98.4585 ++    }
 98.4586 ++  if (iszero (a))
 98.4587 ++    {
 98.4588 ++      return b->sign ? 1 : -1;
 98.4589 ++    }
 98.4590 ++  if (iszero (b))
 98.4591 ++    {
 98.4592 ++      return a->sign ? -1 : 1;
 98.4593 ++    }
 98.4594 ++  /* now both are "normal".  */
 98.4595 ++  if (a->sign != b->sign)
 98.4596 ++    {
 98.4597 ++      /* opposite signs */
 98.4598 ++      return a->sign ? -1 : 1;
 98.4599 ++    }
 98.4600 ++  /* same sign; exponents? */
 98.4601 ++  if (a->normal_exp > b->normal_exp)
 98.4602 ++    {
 98.4603 ++      return a->sign ? -1 : 1;
 98.4604 ++    }
 98.4605 ++  if (a->normal_exp < b->normal_exp)
 98.4606 ++    {
 98.4607 ++      return a->sign ? 1 : -1;
 98.4608 ++    }
 98.4609 ++  /* same exponents; check size.  */
 98.4610 ++  if (a->fraction.ll > b->fraction.ll)
 98.4611 ++    {
 98.4612 ++      return a->sign ? -1 : 1;
 98.4613 ++    }
 98.4614 ++  if (a->fraction.ll < b->fraction.ll)
 98.4615 ++    {
 98.4616 ++      return a->sign ? 1 : -1;
 98.4617 ++    }
 98.4618 ++  /* after all that, they're equal.  */
 98.4619 ++  return 0;
 98.4620 ++}
 98.4621 ++#endif
 98.4622 ++
 98.4623 ++#if defined(L_compare_sf) || defined(L_compare_df) || defined(L_compoare_tf)
 98.4624 ++CMPtype
 98.4625 ++compare (FLO_type arg_a, FLO_type arg_b)
 98.4626 ++{
 98.4627 ++  fp_number_type a;
 98.4628 ++  fp_number_type b;
 98.4629 ++  FLO_union_type au, bu;
 98.4630 ++
 98.4631 ++  au.value = arg_a;
 98.4632 ++  bu.value = arg_b;
 98.4633 ++
 98.4634 ++  unpack_d (&au, &a);
 98.4635 ++  unpack_d (&bu, &b);
 98.4636 ++
 98.4637 ++  return __fpcmp_parts (&a, &b);
 98.4638 ++}
 98.4639 ++#endif /* L_compare_sf || L_compare_df */
 98.4640 ++
 98.4641 ++#ifndef US_SOFTWARE_GOFAST
 98.4642 ++
 98.4643 ++/* These should be optimized for their specific tasks someday.  */
 98.4644 ++
 98.4645 ++#if defined(L_eq_sf) || defined(L_eq_df) || defined(L_eq_tf)
 98.4646 ++CMPtype
 98.4647 ++_eq_f2 (FLO_type arg_a, FLO_type arg_b)
 98.4648 ++{
 98.4649 ++  fp_number_type a;
 98.4650 ++  fp_number_type b;
 98.4651 ++  FLO_union_type au, bu;
 98.4652 ++
 98.4653 ++  au.value = arg_a;
 98.4654 ++  bu.value = arg_b;
 98.4655 ++
 98.4656 ++  unpack_d (&au, &a);
 98.4657 ++  unpack_d (&bu, &b);
 98.4658 ++
 98.4659 ++  if (isnan (&a) || isnan (&b))
 98.4660 ++    return 1;			/* false, truth == 0 */
 98.4661 ++
 98.4662 ++  return __fpcmp_parts (&a, &b) ;
 98.4663 ++}
 98.4664 ++#endif /* L_eq_sf || L_eq_df */
 98.4665 ++
 98.4666 ++#if defined(L_ne_sf) || defined(L_ne_df) || defined(L_ne_tf)
 98.4667 ++CMPtype
 98.4668 ++_ne_f2 (FLO_type arg_a, FLO_type arg_b)
 98.4669 ++{
 98.4670 ++  fp_number_type a;
 98.4671 ++  fp_number_type b;
 98.4672 ++  FLO_union_type au, bu;
 98.4673 ++
 98.4674 ++  au.value = arg_a;
 98.4675 ++  bu.value = arg_b;
 98.4676 ++
 98.4677 ++  unpack_d (&au, &a);
 98.4678 ++  unpack_d (&bu, &b);
 98.4679 ++
 98.4680 ++  if (isnan (&a) || isnan (&b))
 98.4681 ++    return 1;			/* true, truth != 0 */
 98.4682 ++
 98.4683 ++  return  __fpcmp_parts (&a, &b) ;
 98.4684 ++}
 98.4685 ++#endif /* L_ne_sf || L_ne_df */
 98.4686 ++
 98.4687 ++#if defined(L_gt_sf) || defined(L_gt_df) || defined(L_gt_tf)
 98.4688 ++CMPtype
 98.4689 ++_gt_f2 (FLO_type arg_a, FLO_type arg_b)
 98.4690 ++{
 98.4691 ++  fp_number_type a;
 98.4692 ++  fp_number_type b;
 98.4693 ++  FLO_union_type au, bu;
 98.4694 ++
 98.4695 ++  au.value = arg_a;
 98.4696 ++  bu.value = arg_b;
 98.4697 ++
 98.4698 ++  unpack_d (&au, &a);
 98.4699 ++  unpack_d (&bu, &b);
 98.4700 ++
 98.4701 ++  if (isnan (&a) || isnan (&b))
 98.4702 ++    return -1;			/* false, truth > 0 */
 98.4703 ++
 98.4704 ++  return __fpcmp_parts (&a, &b);
 98.4705 ++}
 98.4706 ++#endif /* L_gt_sf || L_gt_df */
 98.4707 ++
 98.4708 ++#if defined(L_ge_sf) || defined(L_ge_df) || defined(L_ge_tf)
 98.4709 ++CMPtype
 98.4710 ++_ge_f2 (FLO_type arg_a, FLO_type arg_b)
 98.4711 ++{
 98.4712 ++  fp_number_type a;
 98.4713 ++  fp_number_type b;
 98.4714 ++  FLO_union_type au, bu;
 98.4715 ++
 98.4716 ++  au.value = arg_a;
 98.4717 ++  bu.value = arg_b;
 98.4718 ++
 98.4719 ++  unpack_d (&au, &a);
 98.4720 ++  unpack_d (&bu, &b);
 98.4721 ++
 98.4722 ++  if (isnan (&a) || isnan (&b))
 98.4723 ++    return -1;			/* false, truth >= 0 */
 98.4724 ++  return __fpcmp_parts (&a, &b) ;
 98.4725 ++}
 98.4726 ++#endif /* L_ge_sf || L_ge_df */
 98.4727 ++
 98.4728 ++#if defined(L_lt_sf) || defined(L_lt_df) || defined(L_lt_tf)
 98.4729 ++CMPtype
 98.4730 ++_lt_f2 (FLO_type arg_a, FLO_type arg_b)
 98.4731 ++{
 98.4732 ++  fp_number_type a;
 98.4733 ++  fp_number_type b;
 98.4734 ++  FLO_union_type au, bu;
 98.4735 ++
 98.4736 ++  au.value = arg_a;
 98.4737 ++  bu.value = arg_b;
 98.4738 ++
 98.4739 ++  unpack_d (&au, &a);
 98.4740 ++  unpack_d (&bu, &b);
 98.4741 ++
 98.4742 ++  if (isnan (&a) || isnan (&b))
 98.4743 ++    return 1;			/* false, truth < 0 */
 98.4744 ++
 98.4745 ++  return __fpcmp_parts (&a, &b);
 98.4746 ++}
 98.4747 ++#endif /* L_lt_sf || L_lt_df */
 98.4748 ++
 98.4749 ++#if defined(L_le_sf) || defined(L_le_df) || defined(L_le_tf)
 98.4750 ++CMPtype
 98.4751 ++_le_f2 (FLO_type arg_a, FLO_type arg_b)
 98.4752 ++{
 98.4753 ++  fp_number_type a;
 98.4754 ++  fp_number_type b;
 98.4755 ++  FLO_union_type au, bu;
 98.4756 ++
 98.4757 ++  au.value = arg_a;
 98.4758 ++  bu.value = arg_b;
 98.4759 ++
 98.4760 ++  unpack_d (&au, &a);
 98.4761 ++  unpack_d (&bu, &b);
 98.4762 ++
 98.4763 ++  if (isnan (&a) || isnan (&b))
 98.4764 ++    return 1;			/* false, truth <= 0 */
 98.4765 ++
 98.4766 ++  return __fpcmp_parts (&a, &b) ;
 98.4767 ++}
 98.4768 ++#endif /* L_le_sf || L_le_df */
 98.4769 ++
 98.4770 ++#endif /* ! US_SOFTWARE_GOFAST */
 98.4771 ++
 98.4772 ++#if defined(L_unord_sf) || defined(L_unord_df) || defined(L_unord_tf)
 98.4773 ++CMPtype
 98.4774 ++_unord_f2 (FLO_type arg_a, FLO_type arg_b)
 98.4775 ++{
 98.4776 ++  fp_number_type a;
 98.4777 ++  fp_number_type b;
 98.4778 ++  FLO_union_type au, bu;
 98.4779 ++
 98.4780 ++  au.value = arg_a;
 98.4781 ++  bu.value = arg_b;
 98.4782 ++
 98.4783 ++  unpack_d (&au, &a);
 98.4784 ++  unpack_d (&bu, &b);
 98.4785 ++
 98.4786 ++  return (isnan (&a) || isnan (&b));
 98.4787 ++}
 98.4788 ++#endif /* L_unord_sf || L_unord_df */
 98.4789 ++
 98.4790 ++#if defined(L_si_to_sf) || defined(L_si_to_df) || defined(L_si_to_tf)
 98.4791 ++FLO_type
 98.4792 ++si_to_float (SItype arg_a)
 98.4793 ++{
 98.4794 ++  fp_number_type in;
 98.4795 ++
 98.4796 ++  in.class = CLASS_NUMBER;
 98.4797 ++  in.sign = arg_a < 0;
 98.4798 ++  if (!arg_a)
 98.4799 ++    {
 98.4800 ++      in.class = CLASS_ZERO;
 98.4801 ++    }
 98.4802 ++  else
 98.4803 ++    {
 98.4804 ++      in.normal_exp = FRACBITS + NGARDS;
 98.4805 ++      if (in.sign) 
 98.4806 ++	{
 98.4807 ++	  /* Special case for minint, since there is no +ve integer
 98.4808 ++	     representation for it */
 98.4809 ++	  if (arg_a == (- MAX_SI_INT - 1))
 98.4810 ++	    {
 98.4811 ++	      return (FLO_type)(- MAX_SI_INT - 1);
 98.4812 ++	    }
 98.4813 ++	  in.fraction.ll = (-arg_a);
 98.4814 ++	}
 98.4815 ++      else
 98.4816 ++	in.fraction.ll = arg_a;
 98.4817 ++
 98.4818 ++      while (in.fraction.ll < ((fractype)1 << (FRACBITS + NGARDS)))
 98.4819 ++	{
 98.4820 ++	  in.fraction.ll <<= 1;
 98.4821 ++	  in.normal_exp -= 1;
 98.4822 ++	}
 98.4823 ++    }
 98.4824 ++  return pack_d (&in);
 98.4825 ++}
 98.4826 ++#endif /* L_si_to_sf || L_si_to_df */
 98.4827 ++
 98.4828 ++#if defined(L_usi_to_sf) || defined(L_usi_to_df) || defined(L_usi_to_tf)
 98.4829 ++FLO_type
 98.4830 ++usi_to_float (USItype arg_a)
 98.4831 ++{
 98.4832 ++  fp_number_type in;
 98.4833 ++
 98.4834 ++  in.sign = 0;
 98.4835 ++  if (!arg_a)
 98.4836 ++    {
 98.4837 ++      in.class = CLASS_ZERO;
 98.4838 ++    }
 98.4839 ++  else
 98.4840 ++    {
 98.4841 ++      in.class = CLASS_NUMBER;
 98.4842 ++      in.normal_exp = FRACBITS + NGARDS;
 98.4843 ++      in.fraction.ll = arg_a;
 98.4844 ++
 98.4845 ++      while (in.fraction.ll > ((fractype)1 << (FRACBITS + NGARDS)))
 98.4846 ++        {
 98.4847 ++          in.fraction.ll >>= 1;
 98.4848 ++          in.normal_exp += 1;
 98.4849 ++        }
 98.4850 ++      while (in.fraction.ll < ((fractype)1 << (FRACBITS + NGARDS)))
 98.4851 ++	{
 98.4852 ++	  in.fraction.ll <<= 1;
 98.4853 ++	  in.normal_exp -= 1;
 98.4854 ++	}
 98.4855 ++    }
 98.4856 ++  return pack_d (&in);
 98.4857 ++}
 98.4858 ++#endif
 98.4859 ++
 98.4860 ++#if defined(L_sf_to_si) || defined(L_df_to_si) || defined(L_tf_to_si)
 98.4861 ++SItype
 98.4862 ++float_to_si (FLO_type arg_a)
 98.4863 ++{
 98.4864 ++  fp_number_type a;
 98.4865 ++  SItype tmp;
 98.4866 ++  FLO_union_type au;
 98.4867 ++
 98.4868 ++  au.value = arg_a;
 98.4869 ++  unpack_d (&au, &a);
 98.4870 ++
 98.4871 ++  if (iszero (&a))
 98.4872 ++    return 0;
 98.4873 ++  if (isnan (&a))
 98.4874 ++    return 0;
 98.4875 ++  /* get reasonable MAX_SI_INT...  */
 98.4876 ++  if (isinf (&a))
 98.4877 ++    return a.sign ? (-MAX_SI_INT)-1 : MAX_SI_INT;
 98.4878 ++  /* it is a number, but a small one */
 98.4879 ++  if (a.normal_exp < 0)
 98.4880 ++    return 0;
 98.4881 ++  if (a.normal_exp > BITS_PER_SI - 2)
 98.4882 ++    return a.sign ? (-MAX_SI_INT)-1 : MAX_SI_INT;
 98.4883 ++  tmp = a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp);
 98.4884 ++  return a.sign ? (-tmp) : (tmp);
 98.4885 ++}
 98.4886 ++#endif /* L_sf_to_si || L_df_to_si */
 98.4887 ++
 98.4888 ++#if defined(L_sf_to_usi) || defined(L_df_to_usi) || defined(L_tf_to_usi)
 98.4889 ++#if defined US_SOFTWARE_GOFAST || defined(L_tf_to_usi)
 98.4890 ++/* While libgcc2.c defines its own __fixunssfsi and __fixunsdfsi routines,
 98.4891 ++   we also define them for GOFAST because the ones in libgcc2.c have the
 98.4892 ++   wrong names and I'd rather define these here and keep GOFAST CYG-LOC's
 98.4893 ++   out of libgcc2.c.  We can't define these here if not GOFAST because then
 98.4894 ++   there'd be duplicate copies.  */
 98.4895 ++
 98.4896 ++USItype
 98.4897 ++float_to_usi (FLO_type arg_a)
 98.4898 ++{
 98.4899 ++  fp_number_type a;
 98.4900 ++  FLO_union_type au;
 98.4901 ++
 98.4902 ++  au.value = arg_a;
 98.4903 ++  unpack_d (&au, &a);
 98.4904 ++
 98.4905 ++  if (iszero (&a))
 98.4906 ++    return 0;
 98.4907 ++  if (isnan (&a))
 98.4908 ++    return 0;
 98.4909 ++  /* it is a negative number */
 98.4910 ++  if (a.sign)
 98.4911 ++    return 0;
 98.4912 ++  /* get reasonable MAX_USI_INT...  */
 98.4913 ++  if (isinf (&a))
 98.4914 ++    return MAX_USI_INT;
 98.4915 ++  /* it is a number, but a small one */
 98.4916 ++  if (a.normal_exp < 0)
 98.4917 ++    return 0;
 98.4918 ++  if (a.normal_exp > BITS_PER_SI - 1)
 98.4919 ++    return MAX_USI_INT;
 98.4920 ++  else if (a.normal_exp > (FRACBITS + NGARDS))
 98.4921 ++    return a.fraction.ll << (a.normal_exp - (FRACBITS + NGARDS));
 98.4922 ++  else
 98.4923 ++    return a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp);
 98.4924 ++}
 98.4925 ++#endif /* US_SOFTWARE_GOFAST */
 98.4926 ++#endif /* L_sf_to_usi || L_df_to_usi */
 98.4927 ++
 98.4928 ++#if defined(L_negate_sf) || defined(L_negate_df) || defined(L_negate_tf)
 98.4929 ++FLO_type
 98.4930 ++negate (FLO_type arg_a)
 98.4931 ++{
 98.4932 ++  fp_number_type a;
 98.4933 ++  FLO_union_type au;
 98.4934 ++
 98.4935 ++  au.value = arg_a;
 98.4936 ++  unpack_d (&au, &a);
 98.4937 ++
 98.4938 ++  flip_sign (&a);
 98.4939 ++  return pack_d (&a);
 98.4940 ++}
 98.4941 ++#endif /* L_negate_sf || L_negate_df */
 98.4942 ++
 98.4943 ++#ifdef FLOAT
 98.4944 ++
 98.4945 ++#if defined(L_make_sf)
 98.4946 ++SFtype
 98.4947 ++__make_fp(fp_class_type class,
 98.4948 ++	     unsigned int sign,
 98.4949 ++	     int exp, 
 98.4950 ++	     USItype frac)
 98.4951 ++{
 98.4952 ++  fp_number_type in;
 98.4953 ++
 98.4954 ++  in.class = class;
 98.4955 ++  in.sign = sign;
 98.4956 ++  in.normal_exp = exp;
 98.4957 ++  in.fraction.ll = frac;
 98.4958 ++  return pack_d (&in);
 98.4959 ++}
 98.4960 ++#endif /* L_make_sf */
 98.4961 ++
 98.4962 ++#ifndef FLOAT_ONLY
 98.4963 ++
 98.4964 ++/* This enables one to build an fp library that supports float but not double.
 98.4965 ++   Otherwise, we would get an undefined reference to __make_dp.
 98.4966 ++   This is needed for some 8-bit ports that can't handle well values that
 98.4967 ++   are 8-bytes in size, so we just don't support double for them at all.  */
 98.4968 ++
 98.4969 ++#if defined(L_sf_to_df)
 98.4970 ++DFtype
 98.4971 ++sf_to_df (SFtype arg_a)
 98.4972 ++{
 98.4973 ++  fp_number_type in;
 98.4974 ++  FLO_union_type au;
 98.4975 ++
 98.4976 ++  au.value = arg_a;
 98.4977 ++  unpack_d (&au, &in);
 98.4978 ++
 98.4979 ++  return __make_dp (in.class, in.sign, in.normal_exp,
 98.4980 ++		    ((UDItype) in.fraction.ll) << F_D_BITOFF);
 98.4981 ++}
 98.4982 ++#endif /* L_sf_to_df */
 98.4983 ++
 98.4984 ++#if defined(L_sf_to_tf) && defined(TMODES)
 98.4985 ++TFtype
 98.4986 ++sf_to_tf (SFtype arg_a)
 98.4987 ++{
 98.4988 ++  fp_number_type in;
 98.4989 ++  FLO_union_type au;
 98.4990 ++
 98.4991 ++  au.value = arg_a;
 98.4992 ++  unpack_d (&au, &in);
 98.4993 ++
 98.4994 ++  return __make_tp (in.class, in.sign, in.normal_exp,
 98.4995 ++		    ((UTItype) in.fraction.ll) << F_T_BITOFF);
 98.4996 ++}
 98.4997 ++#endif /* L_sf_to_df */
 98.4998 ++
 98.4999 ++#endif /* ! FLOAT_ONLY */
 98.5000 ++#endif /* FLOAT */
 98.5001 ++
 98.5002 ++#ifndef FLOAT
 98.5003 ++
 98.5004 ++extern SFtype __make_fp (fp_class_type, unsigned int, int, USItype);
 98.5005 ++
 98.5006 ++#if defined(L_make_df)
 98.5007 ++DFtype
 98.5008 ++__make_dp (fp_class_type class, unsigned int sign, int exp, UDItype frac)
 98.5009 ++{
 98.5010 ++  fp_number_type in;
 98.5011 ++
 98.5012 ++  in.class = class;
 98.5013 ++  in.sign = sign;
 98.5014 ++  in.normal_exp = exp;
 98.5015 ++  in.fraction.ll = frac;
 98.5016 ++  return pack_d (&in);
 98.5017 ++}
 98.5018 ++#endif /* L_make_df */
 98.5019 ++
 98.5020 ++#if defined(L_df_to_sf)
 98.5021 ++SFtype
 98.5022 ++df_to_sf (DFtype arg_a)
 98.5023 ++{
 98.5024 ++  fp_number_type in;
 98.5025 ++  USItype sffrac;
 98.5026 ++  FLO_union_type au;
 98.5027 ++
 98.5028 ++  au.value = arg_a;
 98.5029 ++  unpack_d (&au, &in);
 98.5030 ++
 98.5031 ++  sffrac = in.fraction.ll >> F_D_BITOFF;
 98.5032 ++
 98.5033 ++  /* We set the lowest guard bit in SFFRAC if we discarded any non
 98.5034 ++     zero bits.  */
 98.5035 ++  if ((in.fraction.ll & (((USItype) 1 << F_D_BITOFF) - 1)) != 0)
 98.5036 ++    sffrac |= 1;
 98.5037 ++
 98.5038 ++  return __make_fp (in.class, in.sign, in.normal_exp, sffrac);
 98.5039 ++}
 98.5040 ++#endif /* L_df_to_sf */
 98.5041 ++
 98.5042 ++#if defined(L_df_to_tf) && defined(TMODES) \
 98.5043 ++    && !defined(FLOAT) && !defined(TFLOAT)
 98.5044 ++TFtype
 98.5045 ++df_to_tf (DFtype arg_a)
 98.5046 ++{
 98.5047 ++  fp_number_type in;
 98.5048 ++  FLO_union_type au;
 98.5049 ++
 98.5050 ++  au.value = arg_a;
 98.5051 ++  unpack_d (&au, &in);
 98.5052 ++
 98.5053 ++  return __make_tp (in.class, in.sign, in.normal_exp,
 98.5054 ++		    ((UTItype) in.fraction.ll) << D_T_BITOFF);
 98.5055 ++}
 98.5056 ++#endif /* L_sf_to_df */
 98.5057 ++
 98.5058 ++#ifdef TFLOAT
 98.5059 ++#if defined(L_make_tf)
 98.5060 ++TFtype
 98.5061 ++__make_tp(fp_class_type class,
 98.5062 ++	     unsigned int sign,
 98.5063 ++	     int exp, 
 98.5064 ++	     UTItype frac)
 98.5065 ++{
 98.5066 ++  fp_number_type in;
 98.5067 ++
 98.5068 ++  in.class = class;
 98.5069 ++  in.sign = sign;
 98.5070 ++  in.normal_exp = exp;
 98.5071 ++  in.fraction.ll = frac;
 98.5072 ++  return pack_d (&in);
 98.5073 ++}
 98.5074 ++#endif /* L_make_tf */
 98.5075 ++
 98.5076 ++#if defined(L_tf_to_df)
 98.5077 ++DFtype
 98.5078 ++tf_to_df (TFtype arg_a)
 98.5079 ++{
 98.5080 ++  fp_number_type in;
 98.5081 ++  UDItype sffrac;
 98.5082 ++  FLO_union_type au;
 98.5083 ++
 98.5084 ++  au.value = arg_a;
 98.5085 ++  unpack_d (&au, &in);
 98.5086 ++
 98.5087 ++  sffrac = in.fraction.ll >> D_T_BITOFF;
 98.5088 ++
 98.5089 ++  /* We set the lowest guard bit in SFFRAC if we discarded any non
 98.5090 ++     zero bits.  */
 98.5091 ++  if ((in.fraction.ll & (((UTItype) 1 << D_T_BITOFF) - 1)) != 0)
 98.5092 ++    sffrac |= 1;
 98.5093 ++
 98.5094 ++  return __make_dp (in.class, in.sign, in.normal_exp, sffrac);
 98.5095 ++}
 98.5096 ++#endif /* L_tf_to_df */
 98.5097 ++
 98.5098 ++#if defined(L_tf_to_sf)
 98.5099 ++SFtype
 98.5100 ++tf_to_sf (TFtype arg_a)
 98.5101 ++{
 98.5102 ++  fp_number_type in;
 98.5103 ++  USItype sffrac;
 98.5104 ++  FLO_union_type au;
 98.5105 ++
 98.5106 ++  au.value = arg_a;
 98.5107 ++  unpack_d (&au, &in);
 98.5108 ++
 98.5109 ++  sffrac = in.fraction.ll >> F_T_BITOFF;
 98.5110 ++
 98.5111 ++  /* We set the lowest guard bit in SFFRAC if we discarded any non
 98.5112 ++     zero bits.  */
 98.5113 ++  if ((in.fraction.ll & (((UTItype) 1 << F_T_BITOFF) - 1)) != 0)
 98.5114 ++    sffrac |= 1;
 98.5115 ++
 98.5116 ++  return __make_fp (in.class, in.sign, in.normal_exp, sffrac);
 98.5117 ++}
 98.5118 ++#endif /* L_tf_to_sf */
 98.5119 ++#endif /* TFLOAT */
 98.5120 ++
 98.5121 ++#endif /* ! FLOAT */
 98.5122 ++#endif /* !EXTENDED_FLOAT_STUBS */
 98.5123 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2-fp-bit.c gcc-3.4.6/gcc/config/nios2/nios2-fp-bit.c
 98.5124 +--- gcc-3.4.6.orig/gcc/config/nios2/nios2-fp-bit.c	1970-01-01 01:00:00.000000000 +0100
 98.5125 ++++ gcc-3.4.6/gcc/config/nios2/nios2-fp-bit.c	2007-08-15 23:09:36.000000000 +0200
 98.5126 +@@ -0,0 +1,1652 @@
 98.5127 ++#define FLOAT
 98.5128 ++/* This is a software floating point library which can be used
 98.5129 ++   for targets without hardware floating point. 
 98.5130 ++   Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004
 98.5131 ++   Free Software Foundation, Inc.
 98.5132 ++
 98.5133 ++This file is free software; you can redistribute it and/or modify it
 98.5134 ++under the terms of the GNU General Public License as published by the
 98.5135 ++Free Software Foundation; either version 2, or (at your option) any
 98.5136 ++later version.
 98.5137 ++
 98.5138 ++In addition to the permissions in the GNU General Public License, the
 98.5139 ++Free Software Foundation gives you unlimited permission to link the
 98.5140 ++compiled version of this file with other programs, and to distribute
 98.5141 ++those programs without any restriction coming from the use of this
 98.5142 ++file.  (The General Public License restrictions do apply in other
 98.5143 ++respects; for example, they cover modification of the file, and
 98.5144 ++distribution when not linked into another program.)
 98.5145 ++
 98.5146 ++This file is distributed in the hope that it will be useful, but
 98.5147 ++WITHOUT ANY WARRANTY; without even the implied warranty of
 98.5148 ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 98.5149 ++General Public License for more details.
 98.5150 ++
 98.5151 ++You should have received a copy of the GNU General Public License
 98.5152 ++along with this program; see the file COPYING.  If not, write to
 98.5153 ++the Free Software Foundation, 59 Temple Place - Suite 330,
 98.5154 ++Boston, MA 02111-1307, USA.  */
 98.5155 ++
 98.5156 ++/* As a special exception, if you link this library with other files,
 98.5157 ++   some of which are compiled with GCC, to produce an executable,
 98.5158 ++   this library does not by itself cause the resulting executable
 98.5159 ++   to be covered by the GNU General Public License.
 98.5160 ++   This exception does not however invalidate any other reasons why
 98.5161 ++   the executable file might be covered by the GNU General Public License.  */
 98.5162 ++
 98.5163 ++/* This implements IEEE 754 format arithmetic, but does not provide a
 98.5164 ++   mechanism for setting the rounding mode, or for generating or handling
 98.5165 ++   exceptions.
 98.5166 ++
 98.5167 ++   The original code by Steve Chamberlain, hacked by Mark Eichin and Jim
 98.5168 ++   Wilson, all of Cygnus Support.  */
 98.5169 ++
 98.5170 ++/* The intended way to use this file is to make two copies, add `#define FLOAT'
 98.5171 ++   to one copy, then compile both copies and add them to libgcc.a.  */
 98.5172 ++
 98.5173 ++#include "tconfig.h"
 98.5174 ++#include "coretypes.h"
 98.5175 ++#include "tm.h"
 98.5176 ++#include "config/fp-bit.h"
 98.5177 ++
 98.5178 ++/* The following macros can be defined to change the behavior of this file:
 98.5179 ++   FLOAT: Implement a `float', aka SFmode, fp library.  If this is not
 98.5180 ++     defined, then this file implements a `double', aka DFmode, fp library.
 98.5181 ++   FLOAT_ONLY: Used with FLOAT, to implement a `float' only library, i.e.
 98.5182 ++     don't include float->double conversion which requires the double library.
 98.5183 ++     This is useful only for machines which can't support doubles, e.g. some
 98.5184 ++     8-bit processors.
 98.5185 ++   CMPtype: Specify the type that floating point compares should return.
 98.5186 ++     This defaults to SItype, aka int.
 98.5187 ++   US_SOFTWARE_GOFAST: This makes all entry points use the same names as the
 98.5188 ++     US Software goFast library.
 98.5189 ++   _DEBUG_BITFLOAT: This makes debugging the code a little easier, by adding
 98.5190 ++     two integers to the FLO_union_type.
 98.5191 ++   NO_DENORMALS: Disable handling of denormals.
 98.5192 ++   NO_NANS: Disable nan and infinity handling
 98.5193 ++   SMALL_MACHINE: Useful when operations on QIs and HIs are faster
 98.5194 ++     than on an SI */
 98.5195 ++
 98.5196 ++/* We don't currently support extended floats (long doubles) on machines
 98.5197 ++   without hardware to deal with them.
 98.5198 ++
 98.5199 ++   These stubs are just to keep the linker from complaining about unresolved
 98.5200 ++   references which can be pulled in from libio & libstdc++, even if the
 98.5201 ++   user isn't using long doubles.  However, they may generate an unresolved
 98.5202 ++   external to abort if abort is not used by the function, and the stubs
 98.5203 ++   are referenced from within libc, since libgcc goes before and after the
 98.5204 ++   system library.  */
 98.5205 ++
 98.5206 ++#ifdef DECLARE_LIBRARY_RENAMES
 98.5207 ++  DECLARE_LIBRARY_RENAMES
 98.5208 ++#endif
 98.5209 ++
 98.5210 ++#ifdef EXTENDED_FLOAT_STUBS
 98.5211 ++extern void abort (void);
 98.5212 ++void __extendsfxf2 (void) { abort(); }
 98.5213 ++void __extenddfxf2 (void) { abort(); }
 98.5214 ++void __truncxfdf2 (void) { abort(); }
 98.5215 ++void __truncxfsf2 (void) { abort(); }
 98.5216 ++void __fixxfsi (void) { abort(); }
 98.5217 ++void __floatsixf (void) { abort(); }
 98.5218 ++void __addxf3 (void) { abort(); }
 98.5219 ++void __subxf3 (void) { abort(); }
 98.5220 ++void __mulxf3 (void) { abort(); }
 98.5221 ++void __divxf3 (void) { abort(); }
 98.5222 ++void __negxf2 (void) { abort(); }
 98.5223 ++void __eqxf2 (void) { abort(); }
 98.5224 ++void __nexf2 (void) { abort(); }
 98.5225 ++void __gtxf2 (void) { abort(); }
 98.5226 ++void __gexf2 (void) { abort(); }
 98.5227 ++void __lexf2 (void) { abort(); }
 98.5228 ++void __ltxf2 (void) { abort(); }
 98.5229 ++
 98.5230 ++void __extendsftf2 (void) { abort(); }
 98.5231 ++void __extenddftf2 (void) { abort(); }
 98.5232 ++void __trunctfdf2 (void) { abort(); }
 98.5233 ++void __trunctfsf2 (void) { abort(); }
 98.5234 ++void __fixtfsi (void) { abort(); }
 98.5235 ++void __floatsitf (void) { abort(); }
 98.5236 ++void __addtf3 (void) { abort(); }
 98.5237 ++void __subtf3 (void) { abort(); }
 98.5238 ++void __multf3 (void) { abort(); }
 98.5239 ++void __divtf3 (void) { abort(); }
 98.5240 ++void __negtf2 (void) { abort(); }
 98.5241 ++void __eqtf2 (void) { abort(); }
 98.5242 ++void __netf2 (void) { abort(); }
 98.5243 ++void __gttf2 (void) { abort(); }
 98.5244 ++void __getf2 (void) { abort(); }
 98.5245 ++void __letf2 (void) { abort(); }
 98.5246 ++void __lttf2 (void) { abort(); }
 98.5247 ++#else	/* !EXTENDED_FLOAT_STUBS, rest of file */
 98.5248 ++
 98.5249 ++/* IEEE "special" number predicates */
 98.5250 ++
 98.5251 ++#ifdef NO_NANS
 98.5252 ++
 98.5253 ++#define nan() 0
 98.5254 ++#define isnan(x) 0
 98.5255 ++#define isinf(x) 0
 98.5256 ++#else
 98.5257 ++
 98.5258 ++#if   defined L_thenan_sf
 98.5259 ++const fp_number_type __thenan_sf = { CLASS_SNAN, 0, 0, {(fractype) 0} };
 98.5260 ++#elif defined L_thenan_df
 98.5261 ++const fp_number_type __thenan_df = { CLASS_SNAN, 0, 0, {(fractype) 0} };
 98.5262 ++#elif defined L_thenan_tf
 98.5263 ++const fp_number_type __thenan_tf = { CLASS_SNAN, 0, 0, {(fractype) 0} };
 98.5264 ++#elif defined TFLOAT
 98.5265 ++extern const fp_number_type __thenan_tf;
 98.5266 ++#elif defined FLOAT
 98.5267 ++extern const fp_number_type __thenan_sf;
 98.5268 ++#else
 98.5269 ++extern const fp_number_type __thenan_df;
 98.5270 ++#endif
 98.5271 ++
 98.5272 ++INLINE
 98.5273 ++static fp_number_type *
 98.5274 ++nan (void)
 98.5275 ++{
 98.5276 ++  /* Discard the const qualifier...  */
 98.5277 ++#ifdef TFLOAT
 98.5278 ++  return (fp_number_type *) (& __thenan_tf);
 98.5279 ++#elif defined FLOAT  
 98.5280 ++  return (fp_number_type *) (& __thenan_sf);
 98.5281 ++#else
 98.5282 ++  return (fp_number_type *) (& __thenan_df);
 98.5283 ++#endif
 98.5284 ++}
 98.5285 ++
 98.5286 ++INLINE
 98.5287 ++static int
 98.5288 ++isnan ( fp_number_type *  x)
 98.5289 ++{
 98.5290 ++  return x->class == CLASS_SNAN || x->class == CLASS_QNAN;
 98.5291 ++}
 98.5292 ++
 98.5293 ++INLINE
 98.5294 ++static int
 98.5295 ++isinf ( fp_number_type *  x)
 98.5296 ++{
 98.5297 ++  return x->class == CLASS_INFINITY;
 98.5298 ++}
 98.5299 ++
 98.5300 ++#endif /* NO_NANS */
 98.5301 ++
 98.5302 ++INLINE
 98.5303 ++static int
 98.5304 ++iszero ( fp_number_type *  x)
 98.5305 ++{
 98.5306 ++  return x->class == CLASS_ZERO;
 98.5307 ++}
 98.5308 ++
 98.5309 ++INLINE 
 98.5310 ++static void
 98.5311 ++flip_sign ( fp_number_type *  x)
 98.5312 ++{
 98.5313 ++  x->sign = !x->sign;
 98.5314 ++}
 98.5315 ++
 98.5316 ++extern FLO_type pack_d ( fp_number_type * );
 98.5317 ++
 98.5318 ++#if defined(L_pack_df) || defined(L_pack_sf) || defined(L_pack_tf)
 98.5319 ++FLO_type
 98.5320 ++pack_d ( fp_number_type *  src)
 98.5321 ++{
 98.5322 ++  FLO_union_type dst;
 98.5323 ++  fractype fraction = src->fraction.ll;	/* wasn't unsigned before? */
 98.5324 ++  int sign = src->sign;
 98.5325 ++  int exp = 0;
 98.5326 ++
 98.5327 ++  if (LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && (isnan (src) || isinf (src)))
 98.5328 ++    {
 98.5329 ++      /* We can't represent these values accurately.  By using the
 98.5330 ++	 largest possible magnitude, we guarantee that the conversion
 98.5331 ++	 of infinity is at least as big as any finite number.  */
 98.5332 ++      exp = EXPMAX;
 98.5333 ++      fraction = ((fractype) 1 << FRACBITS) - 1;
 98.5334 ++    }
 98.5335 ++  else if (isnan (src))
 98.5336 ++    {
 98.5337 ++      exp = EXPMAX;
 98.5338 ++      if (src->class == CLASS_QNAN || 1)
 98.5339 ++	{
 98.5340 ++#ifdef QUIET_NAN_NEGATED
 98.5341 ++	  fraction |= QUIET_NAN - 1;
 98.5342 ++#else
 98.5343 ++	  fraction |= QUIET_NAN;
 98.5344 ++#endif
 98.5345 ++	}
 98.5346 ++    }
 98.5347 ++  else if (isinf (src))
 98.5348 ++    {
 98.5349 ++      exp = EXPMAX;
 98.5350 ++      fraction = 0;
 98.5351 ++    }
 98.5352 ++  else if (iszero (src))
 98.5353 ++    {
 98.5354 ++      exp = 0;
 98.5355 ++      fraction = 0;
 98.5356 ++    }
 98.5357 ++  else if (fraction == 0)
 98.5358 ++    {
 98.5359 ++      exp = 0;
 98.5360 ++    }
 98.5361 ++  else
 98.5362 ++    {
 98.5363 ++      if (src->normal_exp < NORMAL_EXPMIN)
 98.5364 ++	{
 98.5365 ++#ifdef NO_DENORMALS
 98.5366 ++	  /* Go straight to a zero representation if denormals are not
 98.5367 ++ 	     supported.  The denormal handling would be harmless but
 98.5368 ++ 	     isn't unnecessary.  */
 98.5369 ++	  exp = 0;
 98.5370 ++	  fraction = 0;
 98.5371 ++#else /* NO_DENORMALS */
 98.5372 ++	  /* This number's exponent is too low to fit into the bits
 98.5373 ++	     available in the number, so we'll store 0 in the exponent and
 98.5374 ++	     shift the fraction to the right to make up for it.  */
 98.5375 ++
 98.5376 ++	  int shift = NORMAL_EXPMIN - src->normal_exp;
 98.5377 ++
 98.5378 ++	  exp = 0;
 98.5379 ++
 98.5380 ++	  if (shift > FRAC_NBITS - NGARDS)
 98.5381 ++	    {
 98.5382 ++	      /* No point shifting, since it's more that 64 out.  */
 98.5383 ++	      fraction = 0;
 98.5384 ++	    }
 98.5385 ++	  else
 98.5386 ++	    {
 98.5387 ++	      int lowbit = (fraction & (((fractype)1 << shift) - 1)) ? 1 : 0;
 98.5388 ++	      fraction = (fraction >> shift) | lowbit;
 98.5389 ++	    }
 98.5390 ++	  if ((fraction & GARDMASK) == GARDMSB)
 98.5391 ++	    {
 98.5392 ++	      if ((fraction & (1 << NGARDS)))
 98.5393 ++		fraction += GARDROUND + 1;
 98.5394 ++	    }
 98.5395 ++	  else
 98.5396 ++	    {
 98.5397 ++	      /* Add to the guards to round up.  */
 98.5398 ++	      fraction += GARDROUND;
 98.5399 ++	    }
 98.5400 ++	  /* Perhaps the rounding means we now need to change the
 98.5401 ++             exponent, because the fraction is no longer denormal.  */
 98.5402 ++	  if (fraction >= IMPLICIT_1)
 98.5403 ++	    {
 98.5404 ++	      exp += 1;
 98.5405 ++	    }
 98.5406 ++	  fraction >>= NGARDS;
 98.5407 ++#endif /* NO_DENORMALS */
 98.5408 ++	}
 98.5409 ++      else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS)
 98.5410 ++	       && src->normal_exp > EXPBIAS)
 98.5411 ++	{
 98.5412 ++	  exp = EXPMAX;
 98.5413 ++	  fraction = 0;
 98.5414 ++	}
 98.5415 ++      else
 98.5416 ++	{
 98.5417 ++	  exp = src->normal_exp + EXPBIAS;
 98.5418 ++	  if (!ROUND_TOWARDS_ZERO)
 98.5419 ++	    {
 98.5420 ++	      /* IF the gard bits are the all zero, but the first, then we're
 98.5421 ++		 half way between two numbers, choose the one which makes the
 98.5422 ++		 lsb of the answer 0.  */
 98.5423 ++	      if ((fraction & GARDMASK) == GARDMSB)
 98.5424 ++		{
 98.5425 ++		  if (fraction & (1 << NGARDS))
 98.5426 ++		    fraction += GARDROUND + 1;
 98.5427 ++		}
 98.5428 ++	      else
 98.5429 ++		{
 98.5430 ++		  /* Add a one to the guards to round up */
 98.5431 ++		  fraction += GARDROUND;
 98.5432 ++		}
 98.5433 ++	      if (fraction >= IMPLICIT_2)
 98.5434 ++		{
 98.5435 ++		  fraction >>= 1;
 98.5436 ++		  exp += 1;
 98.5437 ++		}
 98.5438 ++	    }
 98.5439 ++	  fraction >>= NGARDS;
 98.5440 ++
 98.5441 ++	  if (LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && exp > EXPMAX)
 98.5442 ++	    {
 98.5443 ++	      /* Saturate on overflow.  */
 98.5444 ++	      exp = EXPMAX;
 98.5445 ++	      fraction = ((fractype) 1 << FRACBITS) - 1;
 98.5446 ++	    }
 98.5447 ++	}
 98.5448 ++    }
 98.5449 ++
 98.5450 ++  /* We previously used bitfields to store the number, but this doesn't
 98.5451 ++     handle little/big endian systems conveniently, so use shifts and
 98.5452 ++     masks */
 98.5453 ++#ifdef FLOAT_BIT_ORDER_MISMATCH
 98.5454 ++  dst.bits.fraction = fraction;
 98.5455 ++  dst.bits.exp = exp;
 98.5456 ++  dst.bits.sign = sign;
 98.5457 ++#else
 98.5458 ++# if defined TFLOAT && defined HALFFRACBITS
 98.5459 ++ {
 98.5460 ++   halffractype high, low, unity;
 98.5461 ++   int lowsign, lowexp;
 98.5462 ++
 98.5463 ++   unity = (halffractype) 1 << HALFFRACBITS;
 98.5464 ++
 98.5465 ++   /* Set HIGH to the high double's significand, masking out the implicit 1.
 98.5466 ++      Set LOW to the low double's full significand.  */
 98.5467 ++   high = (fraction >> (FRACBITS - HALFFRACBITS)) & (unity - 1);
 98.5468 ++   low = fraction & (unity * 2 - 1);
 98.5469 ++
 98.5470 ++   /* Get the initial sign and exponent of the low double.  */
 98.5471 ++   lowexp = exp - HALFFRACBITS - 1;
 98.5472 ++   lowsign = sign;
 98.5473 ++
 98.5474 ++   /* HIGH should be rounded like a normal double, making |LOW| <=
 98.5475 ++      0.5 ULP of HIGH.  Assume round-to-nearest.  */
 98.5476 ++   if (exp < EXPMAX)
 98.5477 ++     if (low > unity || (low == unity && (high & 1) == 1))
 98.5478 ++       {
 98.5479 ++	 /* Round HIGH up and adjust LOW to match.  */
 98.5480 ++	 high++;
 98.5481 ++	 if (high == unity)
 98.5482 ++	   {
 98.5483 ++	     /* May make it infinite, but that's OK.  */
 98.5484 ++	     high = 0;
 98.5485 ++	     exp++;
 98.5486 ++	   }
 98.5487 ++	 low = unity * 2 - low;
 98.5488 ++	 lowsign ^= 1;
 98.5489 ++       }
 98.5490 ++
 98.5491 ++   high |= (halffractype) exp << HALFFRACBITS;
 98.5492 ++   high |= (halffractype) sign << (HALFFRACBITS + EXPBITS);
 98.5493 ++
 98.5494 ++   if (exp == EXPMAX || exp == 0 || low == 0)
 98.5495 ++     low = 0;
 98.5496 ++   else
 98.5497 ++     {
 98.5498 ++       while (lowexp > 0 && low < unity)
 98.5499 ++	 {
 98.5500 ++	   low <<= 1;
 98.5501 ++	   lowexp--;
 98.5502 ++	 }
 98.5503 ++
 98.5504 ++       if (lowexp <= 0)
 98.5505 ++	 {
 98.5506 ++	   halffractype roundmsb, round;
 98.5507 ++	   int shift;
 98.5508 ++
 98.5509 ++	   shift = 1 - lowexp;
 98.5510 ++	   roundmsb = (1 << (shift - 1));
 98.5511 ++	   round = low & ((roundmsb << 1) - 1);
 98.5512 ++
 98.5513 ++	   low >>= shift;
 98.5514 ++	   lowexp = 0;
 98.5515 ++
 98.5516 ++	   if (round > roundmsb || (round == roundmsb && (low & 1) == 1))
 98.5517 ++	     {
 98.5518 ++	       low++;
 98.5519 ++	       if (low == unity)
 98.5520 ++		 /* LOW rounds up to the smallest normal number.  */
 98.5521 ++		 lowexp++;
 98.5522 ++	     }
 98.5523 ++	 }
 98.5524 ++
 98.5525 ++       low &= unity - 1;
 98.5526 ++       low |= (halffractype) lowexp << HALFFRACBITS;
 98.5527 ++       low |= (halffractype) lowsign << (HALFFRACBITS + EXPBITS);
 98.5528 ++     }
 98.5529 ++   dst.value_raw = ((fractype) high << HALFSHIFT) | low;
 98.5530 ++ }
 98.5531 ++# else
 98.5532 ++  dst.value_raw = fraction & ((((fractype)1) << FRACBITS) - (fractype)1);
 98.5533 ++  dst.value_raw |= ((fractype) (exp & ((1 << EXPBITS) - 1))) << FRACBITS;
 98.5534 ++  dst.value_raw |= ((fractype) (sign & 1)) << (FRACBITS | EXPBITS);
 98.5535 ++# endif
 98.5536 ++#endif
 98.5537 ++
 98.5538 ++#if defined(FLOAT_WORD_ORDER_MISMATCH) && !defined(FLOAT)
 98.5539 ++#ifdef TFLOAT
 98.5540 ++  {
 98.5541 ++    qrtrfractype tmp1 = dst.words[0];
 98.5542 ++    qrtrfractype tmp2 = dst.words[1];
 98.5543 ++    dst.words[0] = dst.words[3];
 98.5544 ++    dst.words[1] = dst.words[2];
 98.5545 ++    dst.words[2] = tmp2;
 98.5546 ++    dst.words[3] = tmp1;
 98.5547 ++  }
 98.5548 ++#else
 98.5549 ++  {
 98.5550 ++    halffractype tmp = dst.words[0];
 98.5551 ++    dst.words[0] = dst.words[1];
 98.5552 ++    dst.words[1] = tmp;
 98.5553 ++  }
 98.5554 ++#endif
 98.5555 ++#endif
 98.5556 ++
 98.5557 ++  return dst.value;
 98.5558 ++}
 98.5559 ++#endif
 98.5560 ++
 98.5561 ++#if defined(L_unpack_df) || defined(L_unpack_sf) || defined(L_unpack_tf)
 98.5562 ++void
 98.5563 ++unpack_d (FLO_union_type * src, fp_number_type * dst)
 98.5564 ++{
 98.5565 ++  /* We previously used bitfields to store the number, but this doesn't
 98.5566 ++     handle little/big endian systems conveniently, so use shifts and
 98.5567 ++     masks */
 98.5568 ++  fractype fraction;
 98.5569 ++  int exp;
 98.5570 ++  int sign;
 98.5571 ++
 98.5572 ++#if defined(FLOAT_WORD_ORDER_MISMATCH) && !defined(FLOAT)
 98.5573 ++  FLO_union_type swapped;
 98.5574 ++
 98.5575 ++#ifdef TFLOAT
 98.5576 ++  swapped.words[0] = src->words[3];
 98.5577 ++  swapped.words[1] = src->words[2];
 98.5578 ++  swapped.words[2] = src->words[1];
 98.5579 ++  swapped.words[3] = src->words[0];
 98.5580 ++#else
 98.5581 ++  swapped.words[0] = src->words[1];
 98.5582 ++  swapped.words[1] = src->words[0];
 98.5583 ++#endif
 98.5584 ++  src = &swapped;
 98.5585 ++#endif
 98.5586 ++  
 98.5587 ++#ifdef FLOAT_BIT_ORDER_MISMATCH
 98.5588 ++  fraction = src->bits.fraction;
 98.5589 ++  exp = src->bits.exp;
 98.5590 ++  sign = src->bits.sign;
 98.5591 ++#else
 98.5592 ++# if defined TFLOAT && defined HALFFRACBITS
 98.5593 ++ {
 98.5594 ++   halffractype high, low;
 98.5595 ++   
 98.5596 ++   high = src->value_raw >> HALFSHIFT;
 98.5597 ++   low = src->value_raw & (((fractype)1 << HALFSHIFT) - 1);
 98.5598 ++
 98.5599 ++   fraction = high & ((((fractype)1) << HALFFRACBITS) - 1);
 98.5600 ++   fraction <<= FRACBITS - HALFFRACBITS;
 98.5601 ++   exp = ((int)(high >> HALFFRACBITS)) & ((1 << EXPBITS) - 1);
 98.5602 ++   sign = ((int)(high >> (((HALFFRACBITS + EXPBITS))))) & 1;
 98.5603 ++
 98.5604 ++   if (exp != EXPMAX && exp != 0 && low != 0)
 98.5605 ++     {
 98.5606 ++       int lowexp = ((int)(low >> HALFFRACBITS)) & ((1 << EXPBITS) - 1);
 98.5607 ++       int lowsign = ((int)(low >> (((HALFFRACBITS + EXPBITS))))) & 1;
 98.5608 ++       int shift;
 98.5609 ++       fractype xlow;
 98.5610 ++
 98.5611 ++       xlow = low & ((((fractype)1) << HALFFRACBITS) - 1);
 98.5612 ++       if (lowexp)
 98.5613 ++	 xlow |= (((halffractype)1) << HALFFRACBITS);
 98.5614 ++       else
 98.5615 ++	 lowexp = 1;
 98.5616 ++       shift = (FRACBITS - HALFFRACBITS) - (exp - lowexp);
 98.5617 ++       if (shift > 0)
 98.5618 ++	 xlow <<= shift;
 98.5619 ++       else if (shift < 0)
 98.5620 ++	 xlow >>= -shift;
 98.5621 ++       if (sign == lowsign)
 98.5622 ++	 fraction += xlow;
 98.5623 ++       else if (fraction >= xlow)
 98.5624 ++	 fraction -= xlow;
 98.5625 ++       else
 98.5626 ++	 {
 98.5627 ++	   /* The high part is a power of two but the full number is lower.
 98.5628 ++	      This code will leave the implicit 1 in FRACTION, but we'd
 98.5629 ++	      have added that below anyway.  */
 98.5630 ++	   fraction = (((fractype) 1 << FRACBITS) - xlow) << 1;
 98.5631 ++	   exp--;
 98.5632 ++	 }
 98.5633 ++     }
 98.5634 ++ }
 98.5635 ++# else
 98.5636 ++  fraction = src->value_raw & ((((fractype)1) << FRACBITS) - 1);
 98.5637 ++  exp = ((int)(src->value_raw >> FRACBITS)) & ((1 << EXPBITS) - 1);
 98.5638 ++  sign = ((int)(src->value_raw >> (FRACBITS + EXPBITS))) & 1;
 98.5639 ++# endif
 98.5640 ++#endif
 98.5641 ++
 98.5642 ++  dst->sign = sign;
 98.5643 ++  if (exp == 0)
 98.5644 ++    {
 98.5645 ++      /* Hmm.  Looks like 0 */
 98.5646 ++      if (fraction == 0
 98.5647 ++#ifdef NO_DENORMALS
 98.5648 ++	  || 1
 98.5649 ++#endif
 98.5650 ++	  )
 98.5651 ++	{
 98.5652 ++	  /* tastes like zero */
 98.5653 ++	  dst->class = CLASS_ZERO;
 98.5654 ++	}
 98.5655 ++      else
 98.5656 ++	{
 98.5657 ++	  /* Zero exponent with nonzero fraction - it's denormalized,
 98.5658 ++	     so there isn't a leading implicit one - we'll shift it so
 98.5659 ++	     it gets one.  */
 98.5660 ++	  dst->normal_exp = exp - EXPBIAS + 1;
 98.5661 ++	  fraction <<= NGARDS;
 98.5662 ++
 98.5663 ++	  dst->class = CLASS_NUMBER;
 98.5664 ++#if 1
 98.5665 ++	  while (fraction < IMPLICIT_1)
 98.5666 ++	    {
 98.5667 ++	      fraction <<= 1;
 98.5668 ++	      dst->normal_exp--;
 98.5669 ++	    }
 98.5670 ++#endif
 98.5671 ++	  dst->fraction.ll = fraction;
 98.5672 ++	}
 98.5673 ++    }
 98.5674 ++  else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && exp == EXPMAX)
 98.5675 ++    {
 98.5676 ++      /* Huge exponent*/
 98.5677 ++      if (fraction == 0)
 98.5678 ++	{
 98.5679 ++	  /* Attached to a zero fraction - means infinity */
 98.5680 ++	  dst->class = CLASS_INFINITY;
 98.5681 ++	}
 98.5682 ++      else
 98.5683 ++	{
 98.5684 ++	  /* Nonzero fraction, means nan */
 98.5685 ++#ifdef QUIET_NAN_NEGATED
 98.5686 ++	  if ((fraction & QUIET_NAN) == 0)
 98.5687 ++#else
 98.5688 ++	  if (fraction & QUIET_NAN)
 98.5689 ++#endif
 98.5690 ++	    {
 98.5691 ++	      dst->class = CLASS_QNAN;
 98.5692 ++	    }
 98.5693 ++	  else
 98.5694 ++	    {
 98.5695 ++	      dst->class = CLASS_SNAN;
 98.5696 ++	    }
 98.5697 ++	  /* Keep the fraction part as the nan number */
 98.5698 ++	  dst->fraction.ll = fraction;
 98.5699 ++	}
 98.5700 ++    }
 98.5701 ++  else
 98.5702 ++    {
 98.5703 ++      /* Nothing strange about this number */
 98.5704 ++      dst->normal_exp = exp - EXPBIAS;
 98.5705 ++      dst->class = CLASS_NUMBER;
 98.5706 ++      dst->fraction.ll = (fraction << NGARDS) | IMPLICIT_1;
 98.5707 ++    }
 98.5708 ++}
 98.5709 ++#endif /* L_unpack_df || L_unpack_sf */
 98.5710 ++
 98.5711 ++#if defined(L_addsub_sf) || defined(L_addsub_df) || defined(L_addsub_tf)
 98.5712 ++static fp_number_type *
 98.5713 ++_fpadd_parts (fp_number_type * a,
 98.5714 ++	      fp_number_type * b,
 98.5715 ++	      fp_number_type * tmp)
 98.5716 ++{
 98.5717 ++  intfrac tfraction;
 98.5718 ++
 98.5719 ++  /* Put commonly used fields in local variables.  */
 98.5720 ++  int a_normal_exp;
 98.5721 ++  int b_normal_exp;
 98.5722 ++  fractype a_fraction;
 98.5723 ++  fractype b_fraction;
 98.5724 ++
 98.5725 ++  if (isnan (a))
 98.5726 ++    {
 98.5727 ++      return a;
 98.5728 ++    }
 98.5729 ++  if (isnan (b))
 98.5730 ++    {
 98.5731 ++      return b;
 98.5732 ++    }
 98.5733 ++  if (isinf (a))
 98.5734 ++    {
 98.5735 ++      /* Adding infinities with opposite signs yields a NaN.  */
 98.5736 ++      if (isinf (b) && a->sign != b->sign)
 98.5737 ++	return nan ();
 98.5738 ++      return a;
 98.5739 ++    }
 98.5740 ++  if (isinf (b))
 98.5741 ++    {
 98.5742 ++      return b;
 98.5743 ++    }
 98.5744 ++  if (iszero (b))
 98.5745 ++    {
 98.5746 ++      if (iszero (a))
 98.5747 ++	{
 98.5748 ++	  *tmp = *a;
 98.5749 ++	  tmp->sign = a->sign & b->sign;
 98.5750 ++	  return tmp;
 98.5751 ++	}
 98.5752 ++      return a;
 98.5753 ++    }
 98.5754 ++  if (iszero (a))
 98.5755 ++    {
 98.5756 ++      return b;
 98.5757 ++    }
 98.5758 ++
 98.5759 ++  /* Got two numbers. shift the smaller and increment the exponent till
 98.5760 ++     they're the same */
 98.5761 ++  {
 98.5762 ++    int diff;
 98.5763 ++
 98.5764 ++    a_normal_exp = a->normal_exp;
 98.5765 ++    b_normal_exp = b->normal_exp;
 98.5766 ++    a_fraction = a->fraction.ll;
 98.5767 ++    b_fraction = b->fraction.ll;
 98.5768 ++
 98.5769 ++    diff = a_normal_exp - b_normal_exp;
 98.5770 ++
 98.5771 ++    if (diff < 0)
 98.5772 ++      diff = -diff;
 98.5773 ++    if (diff < FRAC_NBITS)
 98.5774 ++      {
 98.5775 ++	/* ??? This does shifts one bit at a time.  Optimize.  */
 98.5776 ++	while (a_normal_exp > b_normal_exp)
 98.5777 ++	  {
 98.5778 ++	    b_normal_exp++;
 98.5779 ++	    LSHIFT (b_fraction);
 98.5780 ++	  }
 98.5781 ++	while (b_normal_exp > a_normal_exp)
 98.5782 ++	  {
 98.5783 ++	    a_normal_exp++;
 98.5784 ++	    LSHIFT (a_fraction);
 98.5785 ++	  }
 98.5786 ++      }
 98.5787 ++    else
 98.5788 ++      {
 98.5789 ++	/* Somethings's up.. choose the biggest */
 98.5790 ++	if (a_normal_exp > b_normal_exp)
 98.5791 ++	  {
 98.5792 ++	    b_normal_exp = a_normal_exp;
 98.5793 ++	    b_fraction = 0;
 98.5794 ++	  }
 98.5795 ++	else
 98.5796 ++	  {
 98.5797 ++	    a_normal_exp = b_normal_exp;
 98.5798 ++	    a_fraction = 0;
 98.5799 ++	  }
 98.5800 ++      }
 98.5801 ++  }
 98.5802 ++
 98.5803 ++  if (a->sign != b->sign)
 98.5804 ++    {
 98.5805 ++      if (a->sign)
 98.5806 ++	{
 98.5807 ++	  tfraction = -a_fraction + b_fraction;
 98.5808 ++	}
 98.5809 ++      else
 98.5810 ++	{
 98.5811 ++	  tfraction = a_fraction - b_fraction;
 98.5812 ++	}
 98.5813 ++      if (tfraction >= 0)
 98.5814 ++	{
 98.5815 ++	  tmp->sign = 0;
 98.5816 ++	  tmp->normal_exp = a_normal_exp;
 98.5817 ++	  tmp->fraction.ll = tfraction;
 98.5818 ++	}
 98.5819 ++      else
 98.5820 ++	{
 98.5821 ++	  tmp->sign = 1;
 98.5822 ++	  tmp->normal_exp = a_normal_exp;
 98.5823 ++	  tmp->fraction.ll = -tfraction;
 98.5824 ++	}
 98.5825 ++      /* and renormalize it */
 98.5826 ++
 98.5827 ++      while (tmp->fraction.ll < IMPLICIT_1 && tmp->fraction.ll)
 98.5828 ++	{
 98.5829 ++	  tmp->fraction.ll <<= 1;
 98.5830 ++	  tmp->normal_exp--;
 98.5831 ++	}
 98.5832 ++    }
 98.5833 ++  else
 98.5834 ++    {
 98.5835 ++      tmp->sign = a->sign;
 98.5836 ++      tmp->normal_exp = a_normal_exp;
 98.5837 ++      tmp->fraction.ll = a_fraction + b_fraction;
 98.5838 ++    }
 98.5839 ++  tmp->class = CLASS_NUMBER;
 98.5840 ++  /* Now the fraction is added, we have to shift down to renormalize the
 98.5841 ++     number */
 98.5842 ++
 98.5843 ++  if (tmp->fraction.ll >= IMPLICIT_2)
 98.5844 ++    {
 98.5845 ++      LSHIFT (tmp->fraction.ll);
 98.5846 ++      tmp->normal_exp++;
 98.5847 ++    }
 98.5848 ++  return tmp;
 98.5849 ++
 98.5850 ++}
 98.5851 ++
 98.5852 ++FLO_type
 98.5853 ++add (FLO_type arg_a, FLO_type arg_b)
 98.5854 ++{
 98.5855 ++  fp_number_type a;
 98.5856 ++  fp_number_type b;
 98.5857 ++  fp_number_type tmp;
 98.5858 ++  fp_number_type *res;
 98.5859 ++  FLO_union_type au, bu;
 98.5860 ++
 98.5861 ++  au.value = arg_a;
 98.5862 ++  bu.value = arg_b;
 98.5863 ++
 98.5864 ++  unpack_d (&au, &a);
 98.5865 ++  unpack_d (&bu, &b);
 98.5866 ++
 98.5867 ++  res = _fpadd_parts (&a, &b, &tmp);
 98.5868 ++
 98.5869 ++  return pack_d (res);
 98.5870 ++}
 98.5871 ++
 98.5872 ++FLO_type
 98.5873 ++sub (FLO_type arg_a, FLO_type arg_b)
 98.5874 ++{
 98.5875 ++  fp_number_type a;
 98.5876 ++  fp_number_type b;
 98.5877 ++  fp_number_type tmp;
 98.5878 ++  fp_number_type *res;
 98.5879 ++  FLO_union_type au, bu;
 98.5880 ++
 98.5881 ++  au.value = arg_a;
 98.5882 ++  bu.value = arg_b;
 98.5883 ++
 98.5884 ++  unpack_d (&au, &a);
 98.5885 ++  unpack_d (&bu, &b);
 98.5886 ++
 98.5887 ++  b.sign ^= 1;
 98.5888 ++
 98.5889 ++  res = _fpadd_parts (&a, &b, &tmp);
 98.5890 ++
 98.5891 ++  return pack_d (res);
 98.5892 ++}
 98.5893 ++#endif /* L_addsub_sf || L_addsub_df */
 98.5894 ++
 98.5895 ++#if defined(L_mul_sf) || defined(L_mul_df) || defined(L_mul_tf)
 98.5896 ++static inline __attribute__ ((__always_inline__)) fp_number_type *
 98.5897 ++_fpmul_parts ( fp_number_type *  a,
 98.5898 ++	       fp_number_type *  b,
 98.5899 ++	       fp_number_type * tmp)
 98.5900 ++{
 98.5901 ++  fractype low = 0;
 98.5902 ++  fractype high = 0;
 98.5903 ++
 98.5904 ++  if (isnan (a))
 98.5905 ++    {
 98.5906 ++      a->sign = a->sign != b->sign;
 98.5907 ++      return a;
 98.5908 ++    }
 98.5909 ++  if (isnan (b))
 98.5910 ++    {
 98.5911 ++      b->sign = a->sign != b->sign;
 98.5912 ++      return b;
 98.5913 ++    }
 98.5914 ++  if (isinf (a))
 98.5915 ++    {
 98.5916 ++      if (iszero (b))
 98.5917 ++	return nan ();
 98.5918 ++      a->sign = a->sign != b->sign;
 98.5919 ++      return a;
 98.5920 ++    }
 98.5921 ++  if (isinf (b))
 98.5922 ++    {
 98.5923 ++      if (iszero (a))
 98.5924 ++	{
 98.5925 ++	  return nan ();
 98.5926 ++	}
 98.5927 ++      b->sign = a->sign != b->sign;
 98.5928 ++      return b;
 98.5929 ++    }
 98.5930 ++  if (iszero (a))
 98.5931 ++    {
 98.5932 ++      a->sign = a->sign != b->sign;
 98.5933 ++      return a;
 98.5934 ++    }
 98.5935 ++  if (iszero (b))
 98.5936 ++    {
 98.5937 ++      b->sign = a->sign != b->sign;
 98.5938 ++      return b;
 98.5939 ++    }
 98.5940 ++
 98.5941 ++  /* Calculate the mantissa by multiplying both numbers to get a
 98.5942 ++     twice-as-wide number.  */
 98.5943 ++  {
 98.5944 ++#if defined(NO_DI_MODE) || defined(TFLOAT)
 98.5945 ++    {
 98.5946 ++      fractype x = a->fraction.ll;
 98.5947 ++      fractype ylow = b->fraction.ll;
 98.5948 ++      fractype yhigh = 0;
 98.5949 ++      int bit;
 98.5950 ++
 98.5951 ++      /* ??? This does multiplies one bit at a time.  Optimize.  */
 98.5952 ++      for (bit = 0; bit < FRAC_NBITS; bit++)
 98.5953 ++	{
 98.5954 ++	  int carry;
 98.5955 ++
 98.5956 ++	  if (x & 1)
 98.5957 ++	    {
 98.5958 ++	      carry = (low += ylow) < ylow;
 98.5959 ++	      high += yhigh + carry;
 98.5960 ++	    }
 98.5961 ++	  yhigh <<= 1;
 98.5962 ++	  if (ylow & FRACHIGH)
 98.5963 ++	    {
 98.5964 ++	      yhigh |= 1;
 98.5965 ++	    }
 98.5966 ++	  ylow <<= 1;
 98.5967 ++	  x >>= 1;
 98.5968 ++	}
 98.5969 ++    }
 98.5970 ++#elif defined(FLOAT) 
 98.5971 ++    /* Multiplying two USIs to get a UDI, we're safe.  */
 98.5972 ++    {
 98.5973 ++      UDItype answer = (UDItype)a->fraction.ll * (UDItype)b->fraction.ll;
 98.5974 ++      
 98.5975 ++      high = answer >> BITS_PER_SI;
 98.5976 ++      low = answer;
 98.5977 ++    }
 98.5978 ++#else
 98.5979 ++    /* fractype is DImode, but we need the result to be twice as wide.
 98.5980 ++       Assuming a widening multiply from DImode to TImode is not
 98.5981 ++       available, build one by hand.  */
 98.5982 ++    {
 98.5983 ++      USItype nl = a->fraction.ll;
 98.5984 ++      USItype nh = a->fraction.ll >> BITS_PER_SI;
 98.5985 ++      USItype ml = b->fraction.ll;
 98.5986 ++      USItype mh = b->fraction.ll >> BITS_PER_SI;
 98.5987 ++      UDItype pp_ll = (UDItype) ml * nl;
 98.5988 ++      UDItype pp_hl = (UDItype) mh * nl;
 98.5989 ++      UDItype pp_lh = (UDItype) ml * nh;
 98.5990 ++      UDItype pp_hh = (UDItype) mh * nh;
 98.5991 ++      UDItype res2 = 0;
 98.5992 ++      UDItype res0 = 0;
 98.5993 ++      UDItype ps_hh__ = pp_hl + pp_lh;
 98.5994 ++      if (ps_hh__ < pp_hl)
 98.5995 ++	res2 += (UDItype)1 << BITS_PER_SI;
 98.5996 ++      pp_hl = (UDItype)(USItype)ps_hh__ << BITS_PER_SI;
 98.5997 ++      res0 = pp_ll + pp_hl;
 98.5998 ++      if (res0 < pp_ll)
 98.5999 ++	res2++;
 98.6000 ++      res2 += (ps_hh__ >> BITS_PER_SI) + pp_hh;
 98.6001 ++      high = res2;
 98.6002 ++      low = res0;
 98.6003 ++    }
 98.6004 ++#endif
 98.6005 ++  }
 98.6006 ++
 98.6007 ++  tmp->normal_exp = a->normal_exp + b->normal_exp
 98.6008 ++    + FRAC_NBITS - (FRACBITS + NGARDS);
 98.6009 ++  tmp->sign = a->sign != b->sign;
 98.6010 ++  while (high >= IMPLICIT_2)
 98.6011 ++    {
 98.6012 ++      tmp->normal_exp++;
 98.6013 ++      if (high & 1)
 98.6014 ++	{
 98.6015 ++	  low >>= 1;
 98.6016 ++	  low |= FRACHIGH;
 98.6017 ++	}
 98.6018 ++      high >>= 1;
 98.6019 ++    }
 98.6020 ++  while (high < IMPLICIT_1)
 98.6021 ++    {
 98.6022 ++      tmp->normal_exp--;
 98.6023 ++
 98.6024 ++      high <<= 1;
 98.6025 ++      if (low & FRACHIGH)
 98.6026 ++	high |= 1;
 98.6027 ++      low <<= 1;
 98.6028 ++    }
 98.6029 ++  /* rounding is tricky. if we only round if it won't make us round later.  */
 98.6030 ++#if 0
 98.6031 ++  if (low & FRACHIGH2)
 98.6032 ++    {
 98.6033 ++      if (((high & GARDMASK) != GARDMSB)
 98.6034 ++	  && (((high + 1) & GARDMASK) == GARDMSB))
 98.6035 ++	{
 98.6036 ++	  /* don't round, it gets done again later.  */
 98.6037 ++	}
 98.6038 ++      else
 98.6039 ++	{
 98.6040 ++	  high++;
 98.6041 ++	}
 98.6042 ++    }
 98.6043 ++#endif
 98.6044 ++  if (!ROUND_TOWARDS_ZERO && (high & GARDMASK) == GARDMSB)
 98.6045 ++    {
 98.6046 ++      if (high & (1 << NGARDS))
 98.6047 ++	{
 98.6048 ++	  /* half way, so round to even */
 98.6049 ++	  high += GARDROUND + 1;
 98.6050 ++	}
 98.6051 ++      else if (low)
 98.6052 ++	{
 98.6053 ++	  /* but we really weren't half way */
 98.6054 ++	  high += GARDROUND + 1;
 98.6055 ++	}
 98.6056 ++    }
 98.6057 ++  tmp->fraction.ll = high;
 98.6058 ++  tmp->class = CLASS_NUMBER;
 98.6059 ++  return tmp;
 98.6060 ++}
 98.6061 ++
 98.6062 ++FLO_type
 98.6063 ++multiply (FLO_type arg_a, FLO_type arg_b)
 98.6064 ++{
 98.6065 ++  fp_number_type a;
 98.6066 ++  fp_number_type b;
 98.6067 ++  fp_number_type tmp;
 98.6068 ++  fp_number_type *res;
 98.6069 ++  FLO_union_type au, bu;
 98.6070 ++
 98.6071 ++  au.value = arg_a;
 98.6072 ++  bu.value = arg_b;
 98.6073 ++
 98.6074 ++  unpack_d (&au, &a);
 98.6075 ++  unpack_d (&bu, &b);
 98.6076 ++
 98.6077 ++  res = _fpmul_parts (&a, &b, &tmp);
 98.6078 ++
 98.6079 ++  return pack_d (res);
 98.6080 ++}
 98.6081 ++#endif /* L_mul_sf || L_mul_df */
 98.6082 ++
 98.6083 ++#if defined(L_div_sf) || defined(L_div_df) || defined(L_div_tf)
 98.6084 ++static inline __attribute__ ((__always_inline__)) fp_number_type *
 98.6085 ++_fpdiv_parts (fp_number_type * a,
 98.6086 ++	      fp_number_type * b)
 98.6087 ++{
 98.6088 ++  fractype bit;
 98.6089 ++  fractype numerator;
 98.6090 ++  fractype denominator;
 98.6091 ++  fractype quotient;
 98.6092 ++
 98.6093 ++  if (isnan (a))
 98.6094 ++    {
 98.6095 ++      return a;
 98.6096 ++    }
 98.6097 ++  if (isnan (b))
 98.6098 ++    {
 98.6099 ++      return b;
 98.6100 ++    }
 98.6101 ++
 98.6102 ++  a->sign = a->sign ^ b->sign;
 98.6103 ++
 98.6104 ++  if (isinf (a) || iszero (a))
 98.6105 ++    {
 98.6106 ++      if (a->class == b->class)
 98.6107 ++	return nan ();
 98.6108 ++      return a;
 98.6109 ++    }
 98.6110 ++
 98.6111 ++  if (isinf (b))
 98.6112 ++    {
 98.6113 ++      a->fraction.ll = 0;
 98.6114 ++      a->normal_exp = 0;
 98.6115 ++      return a;
 98.6116 ++    }
 98.6117 ++  if (iszero (b))
 98.6118 ++    {
 98.6119 ++      a->class = CLASS_INFINITY;
 98.6120 ++      return a;
 98.6121 ++    }
 98.6122 ++
 98.6123 ++  /* Calculate the mantissa by multiplying both 64bit numbers to get a
 98.6124 ++     128 bit number */
 98.6125 ++  {
 98.6126 ++    /* quotient =
 98.6127 ++       ( numerator / denominator) * 2^(numerator exponent -  denominator exponent)
 98.6128 ++     */
 98.6129 ++
 98.6130 ++    a->normal_exp = a->normal_exp - b->normal_exp;
 98.6131 ++    numerator = a->fraction.ll;
 98.6132 ++    denominator = b->fraction.ll;
 98.6133 ++
 98.6134 ++    if (numerator < denominator)
 98.6135 ++      {
 98.6136 ++	/* Fraction will be less than 1.0 */
 98.6137 ++	numerator *= 2;
 98.6138 ++	a->normal_exp--;
 98.6139 ++      }
 98.6140 ++    bit = IMPLICIT_1;
 98.6141 ++    quotient = 0;
 98.6142 ++    /* ??? Does divide one bit at a time.  Optimize.  */
 98.6143 ++    while (bit)
 98.6144 ++      {
 98.6145 ++	if (numerator >= denominator)
 98.6146 ++	  {
 98.6147 ++	    quotient |= bit;
 98.6148 ++	    numerator -= denominator;
 98.6149 ++	  }
 98.6150 ++	bit >>= 1;
 98.6151 ++	numerator *= 2;
 98.6152 ++      }
 98.6153 ++
 98.6154 ++    if (!ROUND_TOWARDS_ZERO && (quotient & GARDMASK) == GARDMSB)
 98.6155 ++      {
 98.6156 ++	if (quotient & (1 << NGARDS))
 98.6157 ++	  {
 98.6158 ++	    /* half way, so round to even */
 98.6159 ++	    quotient += GARDROUND + 1;
 98.6160 ++	  }
 98.6161 ++	else if (numerator)
 98.6162 ++	  {
 98.6163 ++	    /* but we really weren't half way, more bits exist */
 98.6164 ++	    quotient += GARDROUND + 1;
 98.6165 ++	  }
 98.6166 ++      }
 98.6167 ++
 98.6168 ++    a->fraction.ll = quotient;
 98.6169 ++    return (a);
 98.6170 ++  }
 98.6171 ++}
 98.6172 ++
 98.6173 ++FLO_type
 98.6174 ++divide (FLO_type arg_a, FLO_type arg_b)
 98.6175 ++{
 98.6176 ++  fp_number_type a;
 98.6177 ++  fp_number_type b;
 98.6178 ++  fp_number_type *res;
 98.6179 ++  FLO_union_type au, bu;
 98.6180 ++
 98.6181 ++  au.value = arg_a;
 98.6182 ++  bu.value = arg_b;
 98.6183 ++
 98.6184 ++  unpack_d (&au, &a);
 98.6185 ++  unpack_d (&bu, &b);
 98.6186 ++
 98.6187 ++  res = _fpdiv_parts (&a, &b);
 98.6188 ++
 98.6189 ++  return pack_d (res);
 98.6190 ++}
 98.6191 ++#endif /* L_div_sf || L_div_df */
 98.6192 ++
 98.6193 ++#if defined(L_fpcmp_parts_sf) || defined(L_fpcmp_parts_df) \
 98.6194 ++    || defined(L_fpcmp_parts_tf)
 98.6195 ++/* according to the demo, fpcmp returns a comparison with 0... thus
 98.6196 ++   a<b -> -1
 98.6197 ++   a==b -> 0
 98.6198 ++   a>b -> +1
 98.6199 ++ */
 98.6200 ++
 98.6201 ++int
 98.6202 ++__fpcmp_parts (fp_number_type * a, fp_number_type * b)
 98.6203 ++{
 98.6204 ++#if 0
 98.6205 ++  /* either nan -> unordered. Must be checked outside of this routine.  */
 98.6206 ++  if (isnan (a) && isnan (b))
 98.6207 ++    {
 98.6208 ++      return 1;			/* still unordered! */
 98.6209 ++    }
 98.6210 ++#endif
 98.6211 ++
 98.6212 ++  if (isnan (a) || isnan (b))
 98.6213 ++    {
 98.6214 ++      return 1;			/* how to indicate unordered compare? */
 98.6215 ++    }
 98.6216 ++  if (isinf (a) && isinf (b))
 98.6217 ++    {
 98.6218 ++      /* +inf > -inf, but +inf != +inf */
 98.6219 ++      /* b    \a| +inf(0)| -inf(1)
 98.6220 ++       ______\+--------+--------
 98.6221 ++       +inf(0)| a==b(0)| a<b(-1)
 98.6222 ++       -------+--------+--------
 98.6223 ++       -inf(1)| a>b(1) | a==b(0)
 98.6224 ++       -------+--------+--------
 98.6225 ++       So since unordered must be nonzero, just line up the columns...
 98.6226 ++       */
 98.6227 ++      return b->sign - a->sign;
 98.6228 ++    }
 98.6229 ++  /* but not both...  */
 98.6230 ++  if (isinf (a))
 98.6231 ++    {
 98.6232 ++      return a->sign ? -1 : 1;
 98.6233 ++    }
 98.6234 ++  if (isinf (b))
 98.6235 ++    {
 98.6236 ++      return b->sign ? 1 : -1;
 98.6237 ++    }
 98.6238 ++  if (iszero (a) && iszero (b))
 98.6239 ++    {
 98.6240 ++      return 0;
 98.6241 ++    }
 98.6242 ++  if (iszero (a))
 98.6243 ++    {
 98.6244 ++      return b->sign ? 1 : -1;
 98.6245 ++    }
 98.6246 ++  if (iszero (b))
 98.6247 ++    {
 98.6248 ++      return a->sign ? -1 : 1;
 98.6249 ++    }
 98.6250 ++  /* now both are "normal".  */
 98.6251 ++  if (a->sign != b->sign)
 98.6252 ++    {
 98.6253 ++      /* opposite signs */
 98.6254 ++      return a->sign ? -1 : 1;
 98.6255 ++    }
 98.6256 ++  /* same sign; exponents? */
 98.6257 ++  if (a->normal_exp > b->normal_exp)
 98.6258 ++    {
 98.6259 ++      return a->sign ? -1 : 1;
 98.6260 ++    }
 98.6261 ++  if (a->normal_exp < b->normal_exp)
 98.6262 ++    {
 98.6263 ++      return a->sign ? 1 : -1;
 98.6264 ++    }
 98.6265 ++  /* same exponents; check size.  */
 98.6266 ++  if (a->fraction.ll > b->fraction.ll)
 98.6267 ++    {
 98.6268 ++      return a->sign ? -1 : 1;
 98.6269 ++    }
 98.6270 ++  if (a->fraction.ll < b->fraction.ll)
 98.6271 ++    {
 98.6272 ++      return a->sign ? 1 : -1;
 98.6273 ++    }
 98.6274 ++  /* after all that, they're equal.  */
 98.6275 ++  return 0;
 98.6276 ++}
 98.6277 ++#endif
 98.6278 ++
 98.6279 ++#if defined(L_compare_sf) || defined(L_compare_df) || defined(L_compoare_tf)
 98.6280 ++CMPtype
 98.6281 ++compare (FLO_type arg_a, FLO_type arg_b)
 98.6282 ++{
 98.6283 ++  fp_number_type a;
 98.6284 ++  fp_number_type b;
 98.6285 ++  FLO_union_type au, bu;
 98.6286 ++
 98.6287 ++  au.value = arg_a;
 98.6288 ++  bu.value = arg_b;
 98.6289 ++
 98.6290 ++  unpack_d (&au, &a);
 98.6291 ++  unpack_d (&bu, &b);
 98.6292 ++
 98.6293 ++  return __fpcmp_parts (&a, &b);
 98.6294 ++}
 98.6295 ++#endif /* L_compare_sf || L_compare_df */
 98.6296 ++
 98.6297 ++#ifndef US_SOFTWARE_GOFAST
 98.6298 ++
 98.6299 ++/* These should be optimized for their specific tasks someday.  */
 98.6300 ++
 98.6301 ++#if defined(L_eq_sf) || defined(L_eq_df) || defined(L_eq_tf)
 98.6302 ++CMPtype
 98.6303 ++_eq_f2 (FLO_type arg_a, FLO_type arg_b)
 98.6304 ++{
 98.6305 ++  fp_number_type a;
 98.6306 ++  fp_number_type b;
 98.6307 ++  FLO_union_type au, bu;
 98.6308 ++
 98.6309 ++  au.value = arg_a;
 98.6310 ++  bu.value = arg_b;
 98.6311 ++
 98.6312 ++  unpack_d (&au, &a);
 98.6313 ++  unpack_d (&bu, &b);
 98.6314 ++
 98.6315 ++  if (isnan (&a) || isnan (&b))
 98.6316 ++    return 1;			/* false, truth == 0 */
 98.6317 ++
 98.6318 ++  return __fpcmp_parts (&a, &b) ;
 98.6319 ++}
 98.6320 ++#endif /* L_eq_sf || L_eq_df */
 98.6321 ++
 98.6322 ++#if defined(L_ne_sf) || defined(L_ne_df) || defined(L_ne_tf)
 98.6323 ++CMPtype
 98.6324 ++_ne_f2 (FLO_type arg_a, FLO_type arg_b)
 98.6325 ++{
 98.6326 ++  fp_number_type a;
 98.6327 ++  fp_number_type b;
 98.6328 ++  FLO_union_type au, bu;
 98.6329 ++
 98.6330 ++  au.value = arg_a;
 98.6331 ++  bu.value = arg_b;
 98.6332 ++
 98.6333 ++  unpack_d (&au, &a);
 98.6334 ++  unpack_d (&bu, &b);
 98.6335 ++
 98.6336 ++  if (isnan (&a) || isnan (&b))
 98.6337 ++    return 1;			/* true, truth != 0 */
 98.6338 ++
 98.6339 ++  return  __fpcmp_parts (&a, &b) ;
 98.6340 ++}
 98.6341 ++#endif /* L_ne_sf || L_ne_df */
 98.6342 ++
 98.6343 ++#if defined(L_gt_sf) || defined(L_gt_df) || defined(L_gt_tf)
 98.6344 ++CMPtype
 98.6345 ++_gt_f2 (FLO_type arg_a, FLO_type arg_b)
 98.6346 ++{
 98.6347 ++  fp_number_type a;
 98.6348 ++  fp_number_type b;
 98.6349 ++  FLO_union_type au, bu;
 98.6350 ++
 98.6351 ++  au.value = arg_a;
 98.6352 ++  bu.value = arg_b;
 98.6353 ++
 98.6354 ++  unpack_d (&au, &a);
 98.6355 ++  unpack_d (&bu, &b);
 98.6356 ++
 98.6357 ++  if (isnan (&a) || isnan (&b))
 98.6358 ++    return -1;			/* false, truth > 0 */
 98.6359 ++
 98.6360 ++  return __fpcmp_parts (&a, &b);
 98.6361 ++}
 98.6362 ++#endif /* L_gt_sf || L_gt_df */
 98.6363 ++
 98.6364 ++#if defined(L_ge_sf) || defined(L_ge_df) || defined(L_ge_tf)
 98.6365 ++CMPtype
 98.6366 ++_ge_f2 (FLO_type arg_a, FLO_type arg_b)
 98.6367 ++{
 98.6368 ++  fp_number_type a;
 98.6369 ++  fp_number_type b;
 98.6370 ++  FLO_union_type au, bu;
 98.6371 ++
 98.6372 ++  au.value = arg_a;
 98.6373 ++  bu.value = arg_b;
 98.6374 ++
 98.6375 ++  unpack_d (&au, &a);
 98.6376 ++  unpack_d (&bu, &b);
 98.6377 ++
 98.6378 ++  if (isnan (&a) || isnan (&b))
 98.6379 ++    return -1;			/* false, truth >= 0 */
 98.6380 ++  return __fpcmp_parts (&a, &b) ;
 98.6381 ++}
 98.6382 ++#endif /* L_ge_sf || L_ge_df */
 98.6383 ++
 98.6384 ++#if defined(L_lt_sf) || defined(L_lt_df) || defined(L_lt_tf)
 98.6385 ++CMPtype
 98.6386 ++_lt_f2 (FLO_type arg_a, FLO_type arg_b)
 98.6387 ++{
 98.6388 ++  fp_number_type a;
 98.6389 ++  fp_number_type b;
 98.6390 ++  FLO_union_type au, bu;
 98.6391 ++
 98.6392 ++  au.value = arg_a;
 98.6393 ++  bu.value = arg_b;
 98.6394 ++
 98.6395 ++  unpack_d (&au, &a);
 98.6396 ++  unpack_d (&bu, &b);
 98.6397 ++
 98.6398 ++  if (isnan (&a) || isnan (&b))
 98.6399 ++    return 1;			/* false, truth < 0 */
 98.6400 ++
 98.6401 ++  return __fpcmp_parts (&a, &b);
 98.6402 ++}
 98.6403 ++#endif /* L_lt_sf || L_lt_df */
 98.6404 ++
 98.6405 ++#if defined(L_le_sf) || defined(L_le_df) || defined(L_le_tf)
 98.6406 ++CMPtype
 98.6407 ++_le_f2 (FLO_type arg_a, FLO_type arg_b)
 98.6408 ++{
 98.6409 ++  fp_number_type a;
 98.6410 ++  fp_number_type b;
 98.6411 ++  FLO_union_type au, bu;
 98.6412 ++
 98.6413 ++  au.value = arg_a;
 98.6414 ++  bu.value = arg_b;
 98.6415 ++
 98.6416 ++  unpack_d (&au, &a);
 98.6417 ++  unpack_d (&bu, &b);
 98.6418 ++
 98.6419 ++  if (isnan (&a) || isnan (&b))
 98.6420 ++    return 1;			/* false, truth <= 0 */
 98.6421 ++
 98.6422 ++  return __fpcmp_parts (&a, &b) ;
 98.6423 ++}
 98.6424 ++#endif /* L_le_sf || L_le_df */
 98.6425 ++
 98.6426 ++#endif /* ! US_SOFTWARE_GOFAST */
 98.6427 ++
 98.6428 ++#if defined(L_unord_sf) || defined(L_unord_df) || defined(L_unord_tf)
 98.6429 ++CMPtype
 98.6430 ++_unord_f2 (FLO_type arg_a, FLO_type arg_b)
 98.6431 ++{
 98.6432 ++  fp_number_type a;
 98.6433 ++  fp_number_type b;
 98.6434 ++  FLO_union_type au, bu;
 98.6435 ++
 98.6436 ++  au.value = arg_a;
 98.6437 ++  bu.value = arg_b;
 98.6438 ++
 98.6439 ++  unpack_d (&au, &a);
 98.6440 ++  unpack_d (&bu, &b);
 98.6441 ++
 98.6442 ++  return (isnan (&a) || isnan (&b));
 98.6443 ++}
 98.6444 ++#endif /* L_unord_sf || L_unord_df */
 98.6445 ++
 98.6446 ++#if defined(L_si_to_sf) || defined(L_si_to_df) || defined(L_si_to_tf)
 98.6447 ++FLO_type
 98.6448 ++si_to_float (SItype arg_a)
 98.6449 ++{
 98.6450 ++  fp_number_type in;
 98.6451 ++
 98.6452 ++  in.class = CLASS_NUMBER;
 98.6453 ++  in.sign = arg_a < 0;
 98.6454 ++  if (!arg_a)
 98.6455 ++    {
 98.6456 ++      in.class = CLASS_ZERO;
 98.6457 ++    }
 98.6458 ++  else
 98.6459 ++    {
 98.6460 ++      in.normal_exp = FRACBITS + NGARDS;
 98.6461 ++      if (in.sign) 
 98.6462 ++	{
 98.6463 ++	  /* Special case for minint, since there is no +ve integer
 98.6464 ++	     representation for it */
 98.6465 ++	  if (arg_a == (- MAX_SI_INT - 1))
 98.6466 ++	    {
 98.6467 ++	      return (FLO_type)(- MAX_SI_INT - 1);
 98.6468 ++	    }
 98.6469 ++	  in.fraction.ll = (-arg_a);
 98.6470 ++	}
 98.6471 ++      else
 98.6472 ++	in.fraction.ll = arg_a;
 98.6473 ++
 98.6474 ++      while (in.fraction.ll < ((fractype)1 << (FRACBITS + NGARDS)))
 98.6475 ++	{
 98.6476 ++	  in.fraction.ll <<= 1;
 98.6477 ++	  in.normal_exp -= 1;
 98.6478 ++	}
 98.6479 ++    }
 98.6480 ++  return pack_d (&in);
 98.6481 ++}
 98.6482 ++#endif /* L_si_to_sf || L_si_to_df */
 98.6483 ++
 98.6484 ++#if defined(L_usi_to_sf) || defined(L_usi_to_df) || defined(L_usi_to_tf)
 98.6485 ++FLO_type
 98.6486 ++usi_to_float (USItype arg_a)
 98.6487 ++{
 98.6488 ++  fp_number_type in;
 98.6489 ++
 98.6490 ++  in.sign = 0;
 98.6491 ++  if (!arg_a)
 98.6492 ++    {
 98.6493 ++      in.class = CLASS_ZERO;
 98.6494 ++    }
 98.6495 ++  else
 98.6496 ++    {
 98.6497 ++      in.class = CLASS_NUMBER;
 98.6498 ++      in.normal_exp = FRACBITS + NGARDS;
 98.6499 ++      in.fraction.ll = arg_a;
 98.6500 ++
 98.6501 ++      while (in.fraction.ll > ((fractype)1 << (FRACBITS + NGARDS)))
 98.6502 ++        {
 98.6503 ++          in.fraction.ll >>= 1;
 98.6504 ++          in.normal_exp += 1;
 98.6505 ++        }
 98.6506 ++      while (in.fraction.ll < ((fractype)1 << (FRACBITS + NGARDS)))
 98.6507 ++	{
 98.6508 ++	  in.fraction.ll <<= 1;
 98.6509 ++	  in.normal_exp -= 1;
 98.6510 ++	}
 98.6511 ++    }
 98.6512 ++  return pack_d (&in);
 98.6513 ++}
 98.6514 ++#endif
 98.6515 ++
 98.6516 ++#if defined(L_sf_to_si) || defined(L_df_to_si) || defined(L_tf_to_si)
 98.6517 ++SItype
 98.6518 ++float_to_si (FLO_type arg_a)
 98.6519 ++{
 98.6520 ++  fp_number_type a;
 98.6521 ++  SItype tmp;
 98.6522 ++  FLO_union_type au;
 98.6523 ++
 98.6524 ++  au.value = arg_a;
 98.6525 ++  unpack_d (&au, &a);
 98.6526 ++
 98.6527 ++  if (iszero (&a))
 98.6528 ++    return 0;
 98.6529 ++  if (isnan (&a))
 98.6530 ++    return 0;
 98.6531 ++  /* get reasonable MAX_SI_INT...  */
 98.6532 ++  if (isinf (&a))
 98.6533 ++    return a.sign ? (-MAX_SI_INT)-1 : MAX_SI_INT;
 98.6534 ++  /* it is a number, but a small one */
 98.6535 ++  if (a.normal_exp < 0)
 98.6536 ++    return 0;
 98.6537 ++  if (a.normal_exp > BITS_PER_SI - 2)
 98.6538 ++    return a.sign ? (-MAX_SI_INT)-1 : MAX_SI_INT;
 98.6539 ++  tmp = a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp);
 98.6540 ++  return a.sign ? (-tmp) : (tmp);
 98.6541 ++}
 98.6542 ++#endif /* L_sf_to_si || L_df_to_si */
 98.6543 ++
 98.6544 ++#if defined(L_sf_to_usi) || defined(L_df_to_usi) || defined(L_tf_to_usi)
 98.6545 ++#if defined US_SOFTWARE_GOFAST || defined(L_tf_to_usi)
 98.6546 ++/* While libgcc2.c defines its own __fixunssfsi and __fixunsdfsi routines,
 98.6547 ++   we also define them for GOFAST because the ones in libgcc2.c have the
 98.6548 ++   wrong names and I'd rather define these here and keep GOFAST CYG-LOC's
 98.6549 ++   out of libgcc2.c.  We can't define these here if not GOFAST because then
 98.6550 ++   there'd be duplicate copies.  */
 98.6551 ++
 98.6552 ++USItype
 98.6553 ++float_to_usi (FLO_type arg_a)
 98.6554 ++{
 98.6555 ++  fp_number_type a;
 98.6556 ++  FLO_union_type au;
 98.6557 ++
 98.6558 ++  au.value = arg_a;
 98.6559 ++  unpack_d (&au, &a);
 98.6560 ++
 98.6561 ++  if (iszero (&a))
 98.6562 ++    return 0;
 98.6563 ++  if (isnan (&a))
 98.6564 ++    return 0;
 98.6565 ++  /* it is a negative number */
 98.6566 ++  if (a.sign)
 98.6567 ++    return 0;
 98.6568 ++  /* get reasonable MAX_USI_INT...  */
 98.6569 ++  if (isinf (&a))
 98.6570 ++    return MAX_USI_INT;
 98.6571 ++  /* it is a number, but a small one */
 98.6572 ++  if (a.normal_exp < 0)
 98.6573 ++    return 0;
 98.6574 ++  if (a.normal_exp > BITS_PER_SI - 1)
 98.6575 ++    return MAX_USI_INT;
 98.6576 ++  else if (a.normal_exp > (FRACBITS + NGARDS))
 98.6577 ++    return a.fraction.ll << (a.normal_exp - (FRACBITS + NGARDS));
 98.6578 ++  else
 98.6579 ++    return a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp);
 98.6580 ++}
 98.6581 ++#endif /* US_SOFTWARE_GOFAST */
 98.6582 ++#endif /* L_sf_to_usi || L_df_to_usi */
 98.6583 ++
 98.6584 ++#if defined(L_negate_sf) || defined(L_negate_df) || defined(L_negate_tf)
 98.6585 ++FLO_type
 98.6586 ++negate (FLO_type arg_a)
 98.6587 ++{
 98.6588 ++  fp_number_type a;
 98.6589 ++  FLO_union_type au;
 98.6590 ++
 98.6591 ++  au.value = arg_a;
 98.6592 ++  unpack_d (&au, &a);
 98.6593 ++
 98.6594 ++  flip_sign (&a);
 98.6595 ++  return pack_d (&a);
 98.6596 ++}
 98.6597 ++#endif /* L_negate_sf || L_negate_df */
 98.6598 ++
 98.6599 ++#ifdef FLOAT
 98.6600 ++
 98.6601 ++#if defined(L_make_sf)
 98.6602 ++SFtype
 98.6603 ++__make_fp(fp_class_type class,
 98.6604 ++	     unsigned int sign,
 98.6605 ++	     int exp, 
 98.6606 ++	     USItype frac)
 98.6607 ++{
 98.6608 ++  fp_number_type in;
 98.6609 ++
 98.6610 ++  in.class = class;
 98.6611 ++  in.sign = sign;
 98.6612 ++  in.normal_exp = exp;
 98.6613 ++  in.fraction.ll = frac;
 98.6614 ++  return pack_d (&in);
 98.6615 ++}
 98.6616 ++#endif /* L_make_sf */
 98.6617 ++
 98.6618 ++#ifndef FLOAT_ONLY
 98.6619 ++
 98.6620 ++/* This enables one to build an fp library that supports float but not double.
 98.6621 ++   Otherwise, we would get an undefined reference to __make_dp.
 98.6622 ++   This is needed for some 8-bit ports that can't handle well values that
 98.6623 ++   are 8-bytes in size, so we just don't support double for them at all.  */
 98.6624 ++
 98.6625 ++#if defined(L_sf_to_df)
 98.6626 ++DFtype
 98.6627 ++sf_to_df (SFtype arg_a)
 98.6628 ++{
 98.6629 ++  fp_number_type in;
 98.6630 ++  FLO_union_type au;
 98.6631 ++
 98.6632 ++  au.value = arg_a;
 98.6633 ++  unpack_d (&au, &in);
 98.6634 ++
 98.6635 ++  return __make_dp (in.class, in.sign, in.normal_exp,
 98.6636 ++		    ((UDItype) in.fraction.ll) << F_D_BITOFF);
 98.6637 ++}
 98.6638 ++#endif /* L_sf_to_df */
 98.6639 ++
 98.6640 ++#if defined(L_sf_to_tf) && defined(TMODES)
 98.6641 ++TFtype
 98.6642 ++sf_to_tf (SFtype arg_a)
 98.6643 ++{
 98.6644 ++  fp_number_type in;
 98.6645 ++  FLO_union_type au;
 98.6646 ++
 98.6647 ++  au.value = arg_a;
 98.6648 ++  unpack_d (&au, &in);
 98.6649 ++
 98.6650 ++  return __make_tp (in.class, in.sign, in.normal_exp,
 98.6651 ++		    ((UTItype) in.fraction.ll) << F_T_BITOFF);
 98.6652 ++}
 98.6653 ++#endif /* L_sf_to_df */
 98.6654 ++
 98.6655 ++#endif /* ! FLOAT_ONLY */
 98.6656 ++#endif /* FLOAT */
 98.6657 ++
 98.6658 ++#ifndef FLOAT
 98.6659 ++
 98.6660 ++extern SFtype __make_fp (fp_class_type, unsigned int, int, USItype);
 98.6661 ++
 98.6662 ++#if defined(L_make_df)
 98.6663 ++DFtype
 98.6664 ++__make_dp (fp_class_type class, unsigned int sign, int exp, UDItype frac)
 98.6665 ++{
 98.6666 ++  fp_number_type in;
 98.6667 ++
 98.6668 ++  in.class = class;
 98.6669 ++  in.sign = sign;
 98.6670 ++  in.normal_exp = exp;
 98.6671 ++  in.fraction.ll = frac;
 98.6672 ++  return pack_d (&in);
 98.6673 ++}
 98.6674 ++#endif /* L_make_df */
 98.6675 ++
 98.6676 ++#if defined(L_df_to_sf)
 98.6677 ++SFtype
 98.6678 ++df_to_sf (DFtype arg_a)
 98.6679 ++{
 98.6680 ++  fp_number_type in;
 98.6681 ++  USItype sffrac;
 98.6682 ++  FLO_union_type au;
 98.6683 ++
 98.6684 ++  au.value = arg_a;
 98.6685 ++  unpack_d (&au, &in);
 98.6686 ++
 98.6687 ++  sffrac = in.fraction.ll >> F_D_BITOFF;
 98.6688 ++
 98.6689 ++  /* We set the lowest guard bit in SFFRAC if we discarded any non
 98.6690 ++     zero bits.  */
 98.6691 ++  if ((in.fraction.ll & (((USItype) 1 << F_D_BITOFF) - 1)) != 0)
 98.6692 ++    sffrac |= 1;
 98.6693 ++
 98.6694 ++  return __make_fp (in.class, in.sign, in.normal_exp, sffrac);
 98.6695 ++}
 98.6696 ++#endif /* L_df_to_sf */
 98.6697 ++
 98.6698 ++#if defined(L_df_to_tf) && defined(TMODES) \
 98.6699 ++    && !defined(FLOAT) && !defined(TFLOAT)
 98.6700 ++TFtype
 98.6701 ++df_to_tf (DFtype arg_a)
 98.6702 ++{
 98.6703 ++  fp_number_type in;
 98.6704 ++  FLO_union_type au;
 98.6705 ++
 98.6706 ++  au.value = arg_a;
 98.6707 ++  unpack_d (&au, &in);
 98.6708 ++
 98.6709 ++  return __make_tp (in.class, in.sign, in.normal_exp,
 98.6710 ++		    ((UTItype) in.fraction.ll) << D_T_BITOFF);
 98.6711 ++}
 98.6712 ++#endif /* L_sf_to_df */
 98.6713 ++
 98.6714 ++#ifdef TFLOAT
 98.6715 ++#if defined(L_make_tf)
 98.6716 ++TFtype
 98.6717 ++__make_tp(fp_class_type class,
 98.6718 ++	     unsigned int sign,
 98.6719 ++	     int exp, 
 98.6720 ++	     UTItype frac)
 98.6721 ++{
 98.6722 ++  fp_number_type in;
 98.6723 ++
 98.6724 ++  in.class = class;
 98.6725 ++  in.sign = sign;
 98.6726 ++  in.normal_exp = exp;
 98.6727 ++  in.fraction.ll = frac;
 98.6728 ++  return pack_d (&in);
 98.6729 ++}
 98.6730 ++#endif /* L_make_tf */
 98.6731 ++
 98.6732 ++#if defined(L_tf_to_df)
 98.6733 ++DFtype
 98.6734 ++tf_to_df (TFtype arg_a)
 98.6735 ++{
 98.6736 ++  fp_number_type in;
 98.6737 ++  UDItype sffrac;
 98.6738 ++  FLO_union_type au;
 98.6739 ++
 98.6740 ++  au.value = arg_a;
 98.6741 ++  unpack_d (&au, &in);
 98.6742 ++
 98.6743 ++  sffrac = in.fraction.ll >> D_T_BITOFF;
 98.6744 ++
 98.6745 ++  /* We set the lowest guard bit in SFFRAC if we discarded any non
 98.6746 ++     zero bits.  */
 98.6747 ++  if ((in.fraction.ll & (((UTItype) 1 << D_T_BITOFF) - 1)) != 0)
 98.6748 ++    sffrac |= 1;
 98.6749 ++
 98.6750 ++  return __make_dp (in.class, in.sign, in.normal_exp, sffrac);
 98.6751 ++}
 98.6752 ++#endif /* L_tf_to_df */
 98.6753 ++
 98.6754 ++#if defined(L_tf_to_sf)
 98.6755 ++SFtype
 98.6756 ++tf_to_sf (TFtype arg_a)
 98.6757 ++{
 98.6758 ++  fp_number_type in;
 98.6759 ++  USItype sffrac;
 98.6760 ++  FLO_union_type au;
 98.6761 ++
 98.6762 ++  au.value = arg_a;
 98.6763 ++  unpack_d (&au, &in);
 98.6764 ++
 98.6765 ++  sffrac = in.fraction.ll >> F_T_BITOFF;
 98.6766 ++
 98.6767 ++  /* We set the lowest guard bit in SFFRAC if we discarded any non
 98.6768 ++     zero bits.  */
 98.6769 ++  if ((in.fraction.ll & (((UTItype) 1 << F_T_BITOFF) - 1)) != 0)
 98.6770 ++    sffrac |= 1;
 98.6771 ++
 98.6772 ++  return __make_fp (in.class, in.sign, in.normal_exp, sffrac);
 98.6773 ++}
 98.6774 ++#endif /* L_tf_to_sf */
 98.6775 ++#endif /* TFLOAT */
 98.6776 ++
 98.6777 ++#endif /* ! FLOAT */
 98.6778 ++#endif /* !EXTENDED_FLOAT_STUBS */
 98.6779 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2.h gcc-3.4.6/gcc/config/nios2/nios2.h
 98.6780 +--- gcc-3.4.6.orig/gcc/config/nios2/nios2.h	1970-01-01 01:00:00.000000000 +0100
 98.6781 ++++ gcc-3.4.6/gcc/config/nios2/nios2.h	2007-08-15 23:09:36.000000000 +0200
 98.6782 +@@ -0,0 +1,824 @@
 98.6783 ++/* Definitions of target machine for Altera NIOS 2G NIOS2 version.
 98.6784 ++   Copyright (C) 2003 Altera 
 98.6785 ++   Contributed by Jonah Graham (jgraham@altera.com).
 98.6786 ++
 98.6787 ++This file is part of GNU CC.
 98.6788 ++
 98.6789 ++GNU CC is free software; you can redistribute it and/or modify
 98.6790 ++it under the terms of the GNU General Public License as published by
 98.6791 ++the Free Software Foundation; either version 2, or (at your option)
 98.6792 ++any later version.
 98.6793 ++
 98.6794 ++GNU CC is distributed in the hope that it will be useful,
 98.6795 ++but WITHOUT ANY WARRANTY; without even the implied warranty of
 98.6796 ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 98.6797 ++GNU General Public License for more details.
 98.6798 ++
 98.6799 ++You should have received a copy of the GNU General Public License
 98.6800 ++along with GNU CC; see the file COPYING.  If not, write to
 98.6801 ++the Free Software Foundation, 59 Temple Place - Suite 330,
 98.6802 ++Boston, MA 02111-1307, USA.  */
 98.6803 ++
 98.6804 ++
 98.6805 ++
 98.6806 ++#define TARGET_CPU_CPP_BUILTINS()		\
 98.6807 ++  do						\
 98.6808 ++    {						\
 98.6809 ++      builtin_define_std ("NIOS2");		\
 98.6810 ++      builtin_define_std ("nios2");		\
 98.6811 ++      builtin_define ("_GNU_SOURCE");		\
 98.6812 ++    }						\
 98.6813 ++  while (0)
 98.6814 ++#define TARGET_VERSION fprintf (stderr, " (Altera Nios II)")
 98.6815 ++
 98.6816 ++
 98.6817 ++
 98.6818 ++
 98.6819 ++
 98.6820 ++/*********************************
 98.6821 ++ * Run-time Target Specification
 98.6822 ++ *********************************/
 98.6823 ++
 98.6824 ++#define HAS_DIV_FLAG 0x0001
 98.6825 ++#define HAS_MUL_FLAG 0x0002
 98.6826 ++#define HAS_MULX_FLAG 0x0004
 98.6827 ++#define FAST_SW_DIV_FLAG 0x0008
 98.6828 ++#define INLINE_MEMCPY_FLAG 0x00010
 98.6829 ++#define CACHE_VOLATILE_FLAG 0x0020
 98.6830 ++#define BYPASS_CACHE_FLAG 0x0040
 98.6831 ++
 98.6832 ++extern int target_flags;
 98.6833 ++#define TARGET_HAS_DIV (target_flags & HAS_DIV_FLAG)
 98.6834 ++#define TARGET_HAS_MUL (target_flags & HAS_MUL_FLAG)
 98.6835 ++#define TARGET_HAS_MULX (target_flags & HAS_MULX_FLAG)
 98.6836 ++#define TARGET_FAST_SW_DIV (target_flags & FAST_SW_DIV_FLAG)
 98.6837 ++#define TARGET_INLINE_MEMCPY (target_flags & INLINE_MEMCPY_FLAG)
 98.6838 ++#define TARGET_CACHE_VOLATILE (target_flags & CACHE_VOLATILE_FLAG)
 98.6839 ++#define TARGET_BYPASS_CACHE (target_flags & BYPASS_CACHE_FLAG)
 98.6840 ++
 98.6841 ++#define TARGET_SWITCHES					\
 98.6842 ++{							\
 98.6843 ++    { "hw-div", HAS_DIV_FLAG,				\
 98.6844 ++      N_("Enable DIV, DIVU") },				\
 98.6845 ++    { "no-hw-div", -HAS_DIV_FLAG,			\
 98.6846 ++      N_("Disable DIV, DIVU (default)") },		\
 98.6847 ++    { "hw-mul", HAS_MUL_FLAG,				\
 98.6848 ++      N_("Enable MUL instructions (default)") },				\
 98.6849 ++    { "hw-mulx", HAS_MULX_FLAG,				\
 98.6850 ++      N_("Enable MULX instructions, assume fast shifter") },				\
 98.6851 ++    { "no-hw-mul", -HAS_MUL_FLAG,			\
 98.6852 ++      N_("Disable MUL instructions") },		\
 98.6853 ++    { "no-hw-mulx", -HAS_MULX_FLAG,			\
 98.6854 ++      N_("Disable MULX instructions, assume slow shifter (default and implied by -mno-hw-mul)") },		\
 98.6855 ++    { "fast-sw-div", FAST_SW_DIV_FLAG,				\
 98.6856 ++      N_("Use table based fast divide (default at -O3)") },				\
 98.6857 ++    { "no-fast-sw-div", -FAST_SW_DIV_FLAG,			\
 98.6858 ++      N_("Don't use table based fast divide ever") },		\
 98.6859 ++    { "inline-memcpy", INLINE_MEMCPY_FLAG,				\
 98.6860 ++      N_("Inline small memcpy (default when optimizing)") },				\
 98.6861 ++    { "no-inline-memcpy", -INLINE_MEMCPY_FLAG,			\
 98.6862 ++      N_("Don't Inline small memcpy") },		\
 98.6863 ++    { "cache-volatile", CACHE_VOLATILE_FLAG,				\
 98.6864 ++      N_("Volatile accesses use non-io variants of instructions (default)") },				\
 98.6865 ++    { "no-cache-volatile", -CACHE_VOLATILE_FLAG,			\
 98.6866 ++      N_("Volatile accesses use io variants of instructions") },		\
 98.6867 ++    { "bypass-cache", BYPASS_CACHE_FLAG,				\
 98.6868 ++      N_("All ld/st instructins use io variants") },				\
 98.6869 ++    { "no-bypass-cache", -BYPASS_CACHE_FLAG,			\
 98.6870 ++      N_("All ld/st instructins do not use io variants (default)") },		\
 98.6871 ++    { "smallc", 0,			\
 98.6872 ++      N_("Link with a limited version of the C library") },		\
 98.6873 ++    { "ctors-in-init", 0,			\
 98.6874 ++      "" /* undocumented: N_("Link with static constructors and destructors in init") */ },		\
 98.6875 ++    { "", TARGET_DEFAULT, 0 }				\
 98.6876 ++}
 98.6877 ++
 98.6878 ++
 98.6879 ++extern const char *nios2_sys_nosys_string;    /* for -msys=nosys */
 98.6880 ++extern const char *nios2_sys_lib_string;    /* for -msys-lib= */
 98.6881 ++extern const char *nios2_sys_crt0_string;    /* for -msys-crt0= */
 98.6882 ++
 98.6883 ++#define TARGET_OPTIONS					\
 98.6884 ++{							\
 98.6885 ++  { "sys=nosys",    &nios2_sys_nosys_string,		\
 98.6886 ++      N_("Use stub versions of OS library calls (default)"), 0},	\
 98.6887 ++  { "sys-lib=",    &nios2_sys_lib_string,		\
 98.6888 ++      N_("Name of System Library to link against. (Converted to a -l option)"), 0},	\
 98.6889 ++  { "sys-crt0=",    &nios2_sys_crt0_string,		\
 98.6890 ++      N_("Name of the startfile. (default is a crt0 for the ISS only)"), 0},	\
 98.6891 ++}
 98.6892 ++
 98.6893 ++
 98.6894 ++/* Default target_flags if no switches specified.  */
 98.6895 ++#ifndef TARGET_DEFAULT
 98.6896 ++# define TARGET_DEFAULT (HAS_MUL_FLAG | CACHE_VOLATILE_FLAG)
 98.6897 ++#endif
 98.6898 ++
 98.6899 ++/* Switch  Recognition by gcc.c.  Add -G xx support */
 98.6900 ++#undef  SWITCH_TAKES_ARG
 98.6901 ++#define SWITCH_TAKES_ARG(CHAR)						\
 98.6902 ++  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
 98.6903 ++
 98.6904 ++#define OVERRIDE_OPTIONS override_options ()
 98.6905 ++#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) optimization_options (LEVEL, SIZE)
 98.6906 ++#define CAN_DEBUG_WITHOUT_FP
 98.6907 ++ 
 98.6908 ++#define CC1_SPEC "\
 98.6909 ++%{G*}"
 98.6910 ++
 98.6911 ++#undef LIB_SPEC
 98.6912 ++#define LIB_SPEC \
 98.6913 ++"--start-group %{msmallc: -lsmallc} %{!msmallc: -lc} -lgcc \
 98.6914 ++ %{msys-lib=*: -l%*} \
 98.6915 ++ %{!msys-lib=*: -lc } \
 98.6916 ++ --end-group \
 98.6917 ++ %{msys-lib=: %eYou need a library name for -msys-lib=} \
 98.6918 ++"
 98.6919 ++
 98.6920 ++
 98.6921 ++#undef STARTFILE_SPEC 
 98.6922 ++#define STARTFILE_SPEC  \
 98.6923 ++"%{msys-crt0=*: %*} %{!msys-crt0=*: crt1%O%s} \
 98.6924 ++ %{msys-crt0=: %eYou need a C startup file for -msys-crt0=} \
 98.6925 ++ %{mctors-in-init: crti%O%s crtbegin%O%s} \
 98.6926 ++"
 98.6927 ++
 98.6928 ++#undef ENDFILE_SPEC 
 98.6929 ++#define ENDFILE_SPEC \
 98.6930 ++ "%{mctors-in-init: crtend%O%s crtn%O%s}"
 98.6931 ++
 98.6932 ++
 98.6933 ++/***********************
 98.6934 ++ * Storage Layout
 98.6935 ++ ***********************/
 98.6936 ++
 98.6937 ++#define DEFAULT_SIGNED_CHAR 1
 98.6938 ++#define BITS_BIG_ENDIAN 0
 98.6939 ++#define BYTES_BIG_ENDIAN 0
 98.6940 ++#define WORDS_BIG_ENDIAN 0
 98.6941 ++#define BITS_PER_UNIT 8
 98.6942 ++#define BITS_PER_WORD 32
 98.6943 ++#define UNITS_PER_WORD 4
 98.6944 ++#define POINTER_SIZE 32
 98.6945 ++#define BIGGEST_ALIGNMENT 32
 98.6946 ++#define STRICT_ALIGNMENT 1
 98.6947 ++#define FUNCTION_BOUNDARY 32
 98.6948 ++#define PARM_BOUNDARY 32
 98.6949 ++#define STACK_BOUNDARY 32
 98.6950 ++#define PREFERRED_STACK_BOUNDARY 32
 98.6951 ++#define MAX_FIXED_MODE_SIZE 64
 98.6952 ++
 98.6953 ++#define CONSTANT_ALIGNMENT(EXP, ALIGN)				\
 98.6954 ++  ((TREE_CODE (EXP) == STRING_CST) 				\
 98.6955 ++   && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
 98.6956 ++
 98.6957 ++
 98.6958 ++/**********************
 98.6959 ++ * Layout of Source Language Data Types
 98.6960 ++ **********************/
 98.6961 ++
 98.6962 ++#define INT_TYPE_SIZE 32
 98.6963 ++#define SHORT_TYPE_SIZE 16
 98.6964 ++#define LONG_TYPE_SIZE 32
 98.6965 ++#define LONG_LONG_TYPE_SIZE 64
 98.6966 ++#define FLOAT_TYPE_SIZE 32
 98.6967 ++#define DOUBLE_TYPE_SIZE 64
 98.6968 ++#define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE
 98.6969 ++
 98.6970 ++
 98.6971 ++/*************************
 98.6972 ++ * Condition Code Status
 98.6973 ++ ************************/
 98.6974 ++
 98.6975 ++/* comparison type */
 98.6976 ++/* ??? currently only CMP_SI is used */
 98.6977 ++enum cmp_type {
 98.6978 ++  CMP_SI,				/* compare four byte integers */
 98.6979 ++  CMP_DI,				/* compare eight byte integers */
 98.6980 ++  CMP_SF,				/* compare single precision floats */
 98.6981 ++  CMP_DF,				/* compare double precision floats */
 98.6982 ++  CMP_MAX				/* max comparison type */
 98.6983 ++};
 98.6984 ++
 98.6985 ++extern GTY(()) rtx branch_cmp[2];	/* operands for compare */
 98.6986 ++extern enum cmp_type branch_type;	/* what type of branch to use */
 98.6987 ++
 98.6988 ++/**********************
 98.6989 ++ * Register Usage
 98.6990 ++ **********************/
 98.6991 ++
 98.6992 ++/* ---------------------------------- *
 98.6993 ++ * Basic Characteristics of Registers
 98.6994 ++ * ---------------------------------- */
 98.6995 ++
 98.6996 ++/*
 98.6997 ++Register Number
 98.6998 ++      Register Name
 98.6999 ++          Alternate Name
 98.7000 ++                Purpose
 98.7001 ++0     r0  zero  always zero
 98.7002 ++1     r1  at    Assembler Temporary
 98.7003 ++2-3   r2-r3     Return Location
 98.7004 ++4-7   r4-r7     Register Arguments
 98.7005 ++8-15  r8-r15    Caller Saved Registers
 98.7006 ++16-22 r16-r22   Callee Saved Registers
 98.7007 ++23    r23 sc    Static Chain (Callee Saved)
 98.7008 ++                ??? Does $sc want to be caller or callee 
 98.7009 ++                saved. If caller, 15, else 23. 
 98.7010 ++24    r24       Exception Temporary
 98.7011 ++25    r25       Breakpoint Temporary
 98.7012 ++26    r26 gp    Global Pointer
 98.7013 ++27    r27 sp    Stack Pointer
 98.7014 ++28    r28 fp    Frame Pointer
 98.7015 ++29    r29 ea    Exception Return Address
 98.7016 ++30    r30 ba    Breakpoint Return Address
 98.7017 ++31    r31 ra    Return Address
 98.7018 ++
 98.7019 ++32    ctl0 status
 98.7020 ++33    ctl1 estatus STATUS saved by exception ? 	
 98.7021 ++34    ctl2 bstatus STATUS saved by break ? 	
 98.7022 ++35    ctl3 ipri    Interrupt Priority Mask ?	
 98.7023 ++36    ctl4 ecause  Exception Cause ? 	
 98.7024 ++
 98.7025 ++37         pc   Not an actual register	
 98.7026 ++
 98.7027 ++38    rap      Return address pointer, this does not
 98.7028 ++                   actually exist and will be eliminated
 98.7029 ++
 98.7030 ++39    fake_fp  Fake Frame Pointer which will always be eliminated.
 98.7031 ++40    fake_ap  Fake Argument Pointer which will always be eliminated.
 98.7032 ++
 98.7033 ++41             First Pseudo Register
 98.7034 ++
 98.7035 ++
 98.7036 ++The definitions for all the hard register numbers
 98.7037 ++are located in nios2.md.
 98.7038 ++*/
 98.7039 ++
 98.7040 ++#define FIRST_PSEUDO_REGISTER 41
 98.7041 ++#define NUM_ARG_REGS (LAST_ARG_REGNO - FIRST_ARG_REGNO + 1)
 98.7042 ++
 98.7043 ++
 98.7044 ++
 98.7045 ++/* also see CONDITIONAL_REGISTER_USAGE */
 98.7046 ++#define FIXED_REGISTERS			     \
 98.7047 ++    {					     \
 98.7048 ++/*        +0  1  2  3  4  5  6  7  8  9 */   \
 98.7049 ++/*   0 */  1, 1, 0, 0, 0, 0, 0, 0, 0, 0,     \
 98.7050 ++/*  10 */  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     \
 98.7051 ++/*  20 */  0, 0, 0, 0, 1, 1, 1, 1, 0, 1,     \
 98.7052 ++/*  30 */  1, 0, 1, 1, 1, 1, 1, 1, 1, 1,     \
 98.7053 ++/*  40 */  1,                                \
 98.7054 ++    }
 98.7055 ++
 98.7056 ++/* call used is the same as caller saved
 98.7057 ++   + fixed regs + args + ret vals */
 98.7058 ++#define CALL_USED_REGISTERS		     \
 98.7059 ++    { 					     \
 98.7060 ++/*        +0  1  2  3  4  5  6  7  8  9 */   \
 98.7061 ++/*   0 */  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     \
 98.7062 ++/*  10 */  1, 1, 1, 1, 1, 1, 0, 0, 0, 0,     \
 98.7063 ++/*  20 */  0, 0, 0, 0, 1, 1, 1, 1, 0, 1,     \
 98.7064 ++/*  30 */  1, 0, 1, 1, 1, 1, 1, 1, 1, 1,     \
 98.7065 ++/*  40 */  1,                                \
 98.7066 ++    }
 98.7067 ++
 98.7068 ++#define HARD_REGNO_NREGS(REGNO, MODE)            \
 98.7069 ++   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1)  \
 98.7070 ++    / UNITS_PER_WORD)
 98.7071 ++
 98.7072 ++/* --------------------------- *
 98.7073 ++ * How Values Fit in Registers
 98.7074 ++ * --------------------------- */
 98.7075 ++
 98.7076 ++#define HARD_REGNO_MODE_OK(REGNO, MODE) 1
 98.7077 ++
 98.7078 ++#define MODES_TIEABLE_P(MODE1, MODE2) 1
 98.7079 ++
 98.7080 ++
 98.7081 ++/*************************
 98.7082 ++ * Register Classes
 98.7083 ++ *************************/
 98.7084 ++
 98.7085 ++enum reg_class
 98.7086 ++{
 98.7087 ++    NO_REGS,
 98.7088 ++    ALL_REGS,
 98.7089 ++    LIM_REG_CLASSES
 98.7090 ++};
 98.7091 ++
 98.7092 ++#define N_REG_CLASSES (int) LIM_REG_CLASSES
 98.7093 ++
 98.7094 ++#define REG_CLASS_NAMES   \
 98.7095 ++    {"NO_REGS",           \
 98.7096 ++     "ALL_REGS"}
 98.7097 ++
 98.7098 ++#define GENERAL_REGS ALL_REGS
 98.7099 ++
 98.7100 ++#define REG_CLASS_CONTENTS   \
 98.7101 ++/* NO_REGS  */       {{ 0, 0},     \
 98.7102 ++/* ALL_REGS */        {~0,~0}}    \
 98.7103 ++
 98.7104 ++#define REGNO_REG_CLASS(REGNO) ALL_REGS
 98.7105 ++
 98.7106 ++#define BASE_REG_CLASS ALL_REGS
 98.7107 ++#define INDEX_REG_CLASS ALL_REGS
 98.7108 ++
 98.7109 ++/* only one reg class, 'r', is handled automatically */
 98.7110 ++#define REG_CLASS_FROM_LETTER(CHAR) NO_REGS
 98.7111 ++
 98.7112 ++#define REGNO_OK_FOR_BASE_P2(REGNO, STRICT) \
 98.7113 ++    ((STRICT) \
 98.7114 ++     ? (REGNO) < FIRST_PSEUDO_REGISTER \
 98.7115 ++     : (REGNO) < FIRST_PSEUDO_REGISTER || (reg_renumber && reg_renumber[REGNO] < FIRST_PSEUDO_REGISTER))
 98.7116 ++
 98.7117 ++#define REGNO_OK_FOR_INDEX_P2(REGNO, STRICT) \
 98.7118 ++    (REGNO_OK_FOR_BASE_P2 (REGNO, STRICT))
 98.7119 ++
 98.7120 ++#define REGNO_OK_FOR_BASE_P(REGNO) \
 98.7121 ++    (REGNO_OK_FOR_BASE_P2 (REGNO, 1))
 98.7122 ++
 98.7123 ++#define REGNO_OK_FOR_INDEX_P(REGNO) \
 98.7124 ++    (REGNO_OK_FOR_INDEX_P2 (REGNO, 1))
 98.7125 ++
 98.7126 ++#define REG_OK_FOR_BASE_P2(X, STRICT)                                   \
 98.7127 ++    (STRICT                                                             \
 98.7128 ++     ? REGNO_OK_FOR_BASE_P2 (REGNO (X), 1)                              \
 98.7129 ++     : REGNO_OK_FOR_BASE_P2 (REGNO (X), 1) || REGNO(X) >= FIRST_PSEUDO_REGISTER)
 98.7130 ++
 98.7131 ++#define REG_OK_FOR_INDEX_P2(X, STRICT)                                  \
 98.7132 ++    (STRICT                                                             \
 98.7133 ++     ? REGNO_OK_FOR_INDEX_P2 (REGNO (X), 1)                             \
 98.7134 ++     : REGNO_OK_FOR_INDEX_P2 (REGNO (X), 1) || REGNO(X) >= FIRST_PSEUDO_REGISTER)
 98.7135 ++
 98.7136 ++#define CLASS_MAX_NREGS(CLASS, MODE)             \
 98.7137 ++   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1)  \
 98.7138 ++    / UNITS_PER_WORD)
 98.7139 ++
 98.7140 ++
 98.7141 ++#define SMALL_INT(X) ((unsigned HOST_WIDE_INT) ((X) + 0x8000) < 0x10000)
 98.7142 ++#define SMALL_INT_UNSIGNED(X) ((unsigned HOST_WIDE_INT) (X) < 0x10000)
 98.7143 ++#define UPPER16_INT(X) (((X) & 0xffff) == 0)
 98.7144 ++#define SHIFT_INT(X) ((X) >= 0 && (X) <= 31)
 98.7145 ++#define RDWRCTL_INT(X) ((X) >= 0 && (X) <= 31)
 98.7146 ++#define CUSTOM_INSN_OPCODE(X) ((X) >= 0 && (X) <= 255)
 98.7147 ++
 98.7148 ++#define CONST_OK_FOR_LETTER_P(VALUE, C)			\
 98.7149 ++ (							\
 98.7150 ++  (C) == 'I' ? SMALL_INT (VALUE) :			\
 98.7151 ++  (C) == 'J' ? SMALL_INT_UNSIGNED (VALUE) :		\
 98.7152 ++  (C) == 'K' ? UPPER16_INT (VALUE) :         		\
 98.7153 ++  (C) == 'L' ? SHIFT_INT (VALUE) :			\
 98.7154 ++  (C) == 'M' ? (VALUE) == 0 :				\
 98.7155 ++  (C) == 'N' ? CUSTOM_INSN_OPCODE (VALUE) :		\
 98.7156 ++  (C) == 'O' ? RDWRCTL_INT (VALUE) :			\
 98.7157 ++  0)
 98.7158 ++
 98.7159 ++#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
 98.7160 ++
 98.7161 ++#define PREFERRED_RELOAD_CLASS(X, CLASS) \
 98.7162 ++    ((CLASS) == NO_REGS ? GENERAL_REGS : (CLASS))
 98.7163 ++
 98.7164 ++/* 'S' matches immediates which are in small data 
 98.7165 ++   and therefore can be added to gp to create a 
 98.7166 ++   32-bit value. */
 98.7167 ++#define EXTRA_CONSTRAINT(VALUE, C)		\
 98.7168 ++  ((C) == 'S' 					\
 98.7169 ++   && (GET_CODE (VALUE) == SYMBOL_REF)   	\
 98.7170 ++   && SYMBOL_REF_IN_NIOS2_SMALL_DATA_P (VALUE))
 98.7171 ++
 98.7172 ++
 98.7173 ++
 98.7174 ++
 98.7175 ++/* Say that the epilogue uses the return address register.  Note that
 98.7176 ++   in the case of sibcalls, the values "used by the epilogue" are
 98.7177 ++   considered live at the start of the called function.  */
 98.7178 ++#define EPILOGUE_USES(REGNO) ((REGNO) == RA_REGNO)
 98.7179 ++
 98.7180 ++
 98.7181 ++#define DEFAULT_MAIN_RETURN  c_expand_return (integer_zero_node)
 98.7182 ++
 98.7183 ++/**********************************
 98.7184 ++ * Trampolines for Nested Functions
 98.7185 ++ ***********************************/
 98.7186 ++
 98.7187 ++#define TRAMPOLINE_TEMPLATE(FILE) \
 98.7188 ++    error ("trampolines not yet implemented")
 98.7189 ++#define TRAMPOLINE_SIZE 20
 98.7190 ++#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
 98.7191 ++    error ("trampolines not yet implemented")
 98.7192 ++
 98.7193 ++/***************************
 98.7194 ++ * Stack Layout and Calling Conventions
 98.7195 ++ ***************************/
 98.7196 ++
 98.7197 ++/* ------------------ *
 98.7198 ++ * Basic Stack Layout
 98.7199 ++ * ------------------ */
 98.7200 ++
 98.7201 ++/* The downward variants are used by the compiler,
 98.7202 ++   the upward ones serve as documentation */
 98.7203 ++#define STACK_GROWS_DOWNWARD
 98.7204 ++#define FRAME_GROWS_UPWARD
 98.7205 ++#define ARGS_GROW_UPWARD
 98.7206 ++
 98.7207 ++#define STARTING_FRAME_OFFSET current_function_outgoing_args_size
 98.7208 ++#define FIRST_PARM_OFFSET(FUNDECL) 0
 98.7209 ++
 98.7210 ++/* Before the prologue, RA lives in r31.  */
 98.7211 ++#define INCOMING_RETURN_ADDR_RTX  gen_rtx_REG (VOIDmode, RA_REGNO)
 98.7212 ++
 98.7213 ++/* -------------------------------------- *
 98.7214 ++ * Registers That Address the Stack Frame
 98.7215 ++ * -------------------------------------- */
 98.7216 ++
 98.7217 ++#define STACK_POINTER_REGNUM SP_REGNO
 98.7218 ++#define STATIC_CHAIN_REGNUM SC_REGNO
 98.7219 ++#define PC_REGNUM PC_REGNO
 98.7220 ++#define DWARF_FRAME_RETURN_COLUMN RA_REGNO
 98.7221 ++
 98.7222 ++/* Base register for access to local variables of the function.  We
 98.7223 ++   pretend that the frame pointer is a non-existent hard register, and 
 98.7224 ++   then eliminate it to HARD_FRAME_POINTER_REGNUM. */
 98.7225 ++#define FRAME_POINTER_REGNUM FAKE_FP_REGNO
 98.7226 ++
 98.7227 ++#define HARD_FRAME_POINTER_REGNUM FP_REGNO
 98.7228 ++#define RETURN_ADDRESS_POINTER_REGNUM RAP_REGNO
 98.7229 ++/* the argumnet pointer needs to always be eliminated
 98.7230 ++   so it is set to a fake hard register. */
 98.7231 ++#define ARG_POINTER_REGNUM FAKE_AP_REGNO
 98.7232 ++
 98.7233 ++/* ----------------------------------------- *
 98.7234 ++ * Eliminating Frame Pointer and Arg Pointer
 98.7235 ++ * ----------------------------------------- */
 98.7236 ++
 98.7237 ++#define FRAME_POINTER_REQUIRED 0
 98.7238 ++
 98.7239 ++#define ELIMINABLE_REGS							\
 98.7240 ++{{ ARG_POINTER_REGNUM,   STACK_POINTER_REGNUM},				\
 98.7241 ++ { ARG_POINTER_REGNUM,   HARD_FRAME_POINTER_REGNUM},			\
 98.7242 ++ { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM},		\
 98.7243 ++ { RETURN_ADDRESS_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM},		\
 98.7244 ++ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM},				\
 98.7245 ++ { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
 98.7246 ++
 98.7247 ++#define CAN_ELIMINATE(FROM, TO)	1
 98.7248 ++
 98.7249 ++#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
 98.7250 ++	(OFFSET) = nios2_initial_elimination_offset ((FROM), (TO))
 98.7251 ++
 98.7252 ++#define MUST_SAVE_REGISTER(regno) \
 98.7253 ++ ((regs_ever_live[regno] && !call_used_regs[regno])			\
 98.7254 ++  || (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed)	\
 98.7255 ++  || (regno == RA_REGNO && regs_ever_live[RA_REGNO]))
 98.7256 ++
 98.7257 ++/* Treat LOC as a byte offset from the stack pointer and round it up
 98.7258 ++   to the next fully-aligned offset.  */
 98.7259 ++#define STACK_ALIGN(LOC)						\
 98.7260 ++  (((LOC) + ((PREFERRED_STACK_BOUNDARY / 8) - 1)) & ~((PREFERRED_STACK_BOUNDARY / 8) - 1))
 98.7261 ++
 98.7262 ++
 98.7263 ++/* ------------------------------ *
 98.7264 ++ * Passing Arguments in Registers
 98.7265 ++ * ------------------------------ */
 98.7266 ++
 98.7267 ++/* see nios2.c */
 98.7268 ++#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
 98.7269 ++  (function_arg (&CUM, MODE, TYPE, NAMED))
 98.7270 ++
 98.7271 ++#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
 98.7272 ++  (function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED))
 98.7273 ++
 98.7274 ++#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) 0
 98.7275 ++
 98.7276 ++#define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) 0
 98.7277 ++
 98.7278 ++typedef struct nios2_args
 98.7279 ++{
 98.7280 ++    int regs_used;
 98.7281 ++} CUMULATIVE_ARGS;
 98.7282 ++
 98.7283 ++/* This is to initialize the above unused CUM data type */
 98.7284 ++#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
 98.7285 ++    (init_cumulative_args (&CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS))
 98.7286 ++
 98.7287 ++#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
 98.7288 ++    (function_arg_advance (&CUM, MODE, TYPE, NAMED))
 98.7289 ++
 98.7290 ++#define FUNCTION_ARG_REGNO_P(REGNO) \
 98.7291 ++    ((REGNO) >= FIRST_ARG_REGNO && (REGNO) <= LAST_ARG_REGNO)
 98.7292 ++
 98.7293 ++#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL)   \
 98.7294 ++  {								    \
 98.7295 ++    int pret_size = nios2_setup_incoming_varargs (&(CUM), (MODE),	    \
 98.7296 ++						(TYPE), (NO_RTL));  \
 98.7297 ++    if (pret_size)						    \
 98.7298 ++      (PRETEND_SIZE) = pret_size;				    \
 98.7299 ++  }
 98.7300 ++
 98.7301 ++/* ----------------------------- *
 98.7302 ++ * Generating Code for Profiling
 98.7303 ++ * ----------------------------- */
 98.7304 ++
 98.7305 ++#define PROFILE_BEFORE_PROLOGUE
 98.7306 ++
 98.7307 ++#define FUNCTION_PROFILER(FILE, LABELNO) \
 98.7308 ++  function_profiler ((FILE), (LABELNO))
 98.7309 ++
 98.7310 ++/* --------------------------------------- *
 98.7311 ++ * Passing Function Arguments on the Stack
 98.7312 ++ * --------------------------------------- */
 98.7313 ++
 98.7314 ++#define PROMOTE_PROTOTYPES 1
 98.7315 ++
 98.7316 ++#define PUSH_ARGS 0
 98.7317 ++#define ACCUMULATE_OUTGOING_ARGS 1
 98.7318 ++
 98.7319 ++#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACKSIZE) 0
 98.7320 ++
 98.7321 ++/* --------------------------------------- *
 98.7322 ++ * How Scalar Function Values Are Returned
 98.7323 ++ * --------------------------------------- */
 98.7324 ++
 98.7325 ++#define FUNCTION_VALUE(VALTYPE, FUNC) \
 98.7326 ++    gen_rtx(REG, TYPE_MODE(VALTYPE), FIRST_RETVAL_REGNO)
 98.7327 ++
 98.7328 ++#define LIBCALL_VALUE(MODE) \
 98.7329 ++    gen_rtx(REG, MODE, FIRST_RETVAL_REGNO)
 98.7330 ++
 98.7331 ++#define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == FIRST_RETVAL_REGNO)
 98.7332 ++
 98.7333 ++/* ----------------------------- *
 98.7334 ++ * How Large Values Are Returned
 98.7335 ++ * ----------------------------- */
 98.7336 ++
 98.7337 ++
 98.7338 ++#define RETURN_IN_MEMORY(TYPE)	\
 98.7339 ++  nios2_return_in_memory (TYPE)
 98.7340 ++
 98.7341 ++
 98.7342 ++#define STRUCT_VALUE 0
 98.7343 ++
 98.7344 ++#define DEFAULT_PCC_STRUCT_RETURN 0
 98.7345 ++
 98.7346 ++/*******************
 98.7347 ++ * Addressing Modes
 98.7348 ++ *******************/
 98.7349 ++
 98.7350 ++
 98.7351 ++#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
 98.7352 ++
 98.7353 ++#define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X))
 98.7354 ++
 98.7355 ++#define MAX_REGS_PER_ADDRESS 1
 98.7356 ++
 98.7357 ++/* Go to ADDR if X is a valid address.  */
 98.7358 ++#ifndef REG_OK_STRICT
 98.7359 ++#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)        \
 98.7360 ++    {                                                  \
 98.7361 ++        if (nios2_legitimate_address ((X), (MODE), 0))  \
 98.7362 ++            goto ADDR;                                 \
 98.7363 ++    }
 98.7364 ++#else
 98.7365 ++#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)        \
 98.7366 ++    {                                                  \
 98.7367 ++        if (nios2_legitimate_address ((X), (MODE), 1))  \
 98.7368 ++            goto ADDR;                                 \
 98.7369 ++    }
 98.7370 ++#endif
 98.7371 ++
 98.7372 ++#ifndef REG_OK_STRICT
 98.7373 ++#define REG_OK_FOR_BASE_P(X)   REGNO_OK_FOR_BASE_P2 (REGNO (X), 0)
 98.7374 ++#define REG_OK_FOR_INDEX_P(X)  REGNO_OK_FOR_INDEX_P2 (REGNO (X), 0)
 98.7375 ++#else
 98.7376 ++#define REG_OK_FOR_BASE_P(X)   REGNO_OK_FOR_BASE_P2 (REGNO (X), 1)
 98.7377 ++#define REG_OK_FOR_INDEX_P(X)  REGNO_OK_FOR_INDEX_P2 (REGNO (X), 1)
 98.7378 ++#endif
 98.7379 ++
 98.7380 ++#define LEGITIMATE_CONSTANT_P(X) 1
 98.7381 ++
 98.7382 ++/* Nios II has no mode dependent addresses.  */
 98.7383 ++#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
 98.7384 ++
 98.7385 ++/* Set if this has a weak declaration  */
 98.7386 ++#define SYMBOL_FLAG_WEAK_DECL	(1 << SYMBOL_FLAG_MACH_DEP_SHIFT)
 98.7387 ++#define SYMBOL_REF_WEAK_DECL_P(RTX) \
 98.7388 ++  ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_WEAK_DECL) != 0)
 98.7389 ++
 98.7390 ++
 98.7391 ++/* true if a symbol is both small and not weak. In this case, gp
 98.7392 ++   relative access can be used */
 98.7393 ++#define SYMBOL_REF_IN_NIOS2_SMALL_DATA_P(RTX) \
 98.7394 ++   (SYMBOL_REF_SMALL_P(RTX) && !SYMBOL_REF_WEAK_DECL_P(RTX))
 98.7395 ++
 98.7396 ++/*****************
 98.7397 ++ * Describing Relative Costs of Operations
 98.7398 ++ *****************/
 98.7399 ++
 98.7400 ++#define SLOW_BYTE_ACCESS 1
 98.7401 ++
 98.7402 ++/* It is as good to call a constant function address as to call an address
 98.7403 ++   kept in a register.
 98.7404 ++   ??? Not true anymore really. Now that call cannot address full range
 98.7405 ++   of memory callr may need to be used */
 98.7406 ++
 98.7407 ++#define NO_FUNCTION_CSE
 98.7408 ++#define NO_RECURSIVE_FUNCTION_CSE
 98.7409 ++
 98.7410 ++
 98.7411 ++
 98.7412 ++/*****************************************
 98.7413 ++ * Defining the Output Assembler Language
 98.7414 ++ *****************************************/
 98.7415 ++
 98.7416 ++/* ------------------------------------------ *
 98.7417 ++ * The Overall Framework of an Assembler File
 98.7418 ++ * ------------------------------------------ */
 98.7419 ++
 98.7420 ++#define ASM_APP_ON "#APP\n"
 98.7421 ++#define ASM_APP_OFF "#NO_APP\n"
 98.7422 ++
 98.7423 ++#define ASM_COMMENT_START "# "
 98.7424 ++
 98.7425 ++/* ------------------------------- *
 98.7426 ++ * Output and Generation of Labels
 98.7427 ++ * ------------------------------- */
 98.7428 ++
 98.7429 ++#define GLOBAL_ASM_OP "\t.global\t"
 98.7430 ++
 98.7431 ++
 98.7432 ++/* -------------- *
 98.7433 ++ * Output of Data
 98.7434 ++ * -------------- */
 98.7435 ++
 98.7436 ++#define DWARF2_UNWIND_INFO 0
 98.7437 ++
 98.7438 ++
 98.7439 ++/* -------------------------------- *
 98.7440 ++ * Assembler Commands for Alignment
 98.7441 ++ * -------------------------------- */
 98.7442 ++
 98.7443 ++#define ASM_OUTPUT_ALIGN(FILE, LOG) \
 98.7444 ++  do { \
 98.7445 ++    fprintf ((FILE), "%s%d\n", ALIGN_ASM_OP, (LOG)); \
 98.7446 ++  } while (0)
 98.7447 ++
 98.7448 ++
 98.7449 ++/* -------------------------------- *
 98.7450 ++ * Output of Assembler Instructions
 98.7451 ++ * -------------------------------- */
 98.7452 ++
 98.7453 ++#define REGISTER_NAMES \
 98.7454 ++{ \
 98.7455 ++    "zero", \
 98.7456 ++    "at", \
 98.7457 ++    "r2", \
 98.7458 ++    "r3", \
 98.7459 ++    "r4", \
 98.7460 ++    "r5", \
 98.7461 ++    "r6", \
 98.7462 ++    "r7", \
 98.7463 ++    "r8", \
 98.7464 ++    "r9", \
 98.7465 ++    "r10", \
 98.7466 ++    "r11", \
 98.7467 ++    "r12", \
 98.7468 ++    "r13", \
 98.7469 ++    "r14", \
 98.7470 ++    "r15", \
 98.7471 ++    "r16", \
 98.7472 ++    "r17", \
 98.7473 ++    "r18", \
 98.7474 ++    "r19", \
 98.7475 ++    "r20", \
 98.7476 ++    "r21", \
 98.7477 ++    "r22", \
 98.7478 ++    "r23", \
 98.7479 ++    "r24", \
 98.7480 ++    "r25", \
 98.7481 ++    "gp", \
 98.7482 ++    "sp", \
 98.7483 ++    "fp", \
 98.7484 ++    "ta", \
 98.7485 ++    "ba", \
 98.7486 ++    "ra", \
 98.7487 ++    "status", \
 98.7488 ++    "estatus", \
 98.7489 ++    "bstatus", \
 98.7490 ++    "ipri", \
 98.7491 ++    "ecause", \
 98.7492 ++    "pc", \
 98.7493 ++    "rap", \
 98.7494 ++    "fake_fp", \
 98.7495 ++    "fake_ap", \
 98.7496 ++}
 98.7497 ++
 98.7498 ++#define ASM_OUTPUT_OPCODE(STREAM, PTR)\
 98.7499 ++   (PTR) = asm_output_opcode (STREAM, PTR)
 98.7500 ++
 98.7501 ++#define PRINT_OPERAND(STREAM, X, CODE) \
 98.7502 ++    nios2_print_operand (STREAM, X, CODE)
 98.7503 ++
 98.7504 ++#define PRINT_OPERAND_ADDRESS(STREAM, X) \
 98.7505 ++    nios2_print_operand_address (STREAM, X)
 98.7506 ++
 98.7507 ++#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
 98.7508 ++do { fputs (integer_asm_op (POINTER_SIZE / BITS_PER_UNIT, TRUE), FILE); \
 98.7509 ++     fprintf (FILE, ".L%u\n", (unsigned) (VALUE));               \
 98.7510 ++   } while (0)
 98.7511 ++
 98.7512 ++
 98.7513 ++/* ------------ *
 98.7514 ++ * Label Output
 98.7515 ++ * ------------ */
 98.7516 ++
 98.7517 ++
 98.7518 ++/* ---------------------------------------------------- *
 98.7519 ++ * Dividing the Output into Sections (Texts, Data, ...)
 98.7520 ++ * ---------------------------------------------------- */
 98.7521 ++
 98.7522 ++/* Output before read-only data.  */
 98.7523 ++#define TEXT_SECTION_ASM_OP ("\t.section\t.text")
 98.7524 ++
 98.7525 ++/* Output before writable data.  */
 98.7526 ++#define DATA_SECTION_ASM_OP ("\t.section\t.data")
 98.7527 ++
 98.7528 ++
 98.7529 ++/* Default the definition of "small data" to 8 bytes. */
 98.7530 ++/* ??? How come I can't use HOST_WIDE_INT here? */
 98.7531 ++extern unsigned long nios2_section_threshold;
 98.7532 ++#define NIOS2_DEFAULT_GVALUE 8
 98.7533 ++
 98.7534 ++
 98.7535 ++
 98.7536 ++/* This says how to output assembler code to declare an
 98.7537 ++   uninitialized external linkage data object.  Under SVR4,
 98.7538 ++   the linker seems to want the alignment of data objects
 98.7539 ++   to depend on their types.  We do exactly that here.  */
 98.7540 ++
 98.7541 ++#undef COMMON_ASM_OP
 98.7542 ++#define COMMON_ASM_OP	"\t.comm\t"
 98.7543 ++
 98.7544 ++#undef  ASM_OUTPUT_ALIGNED_COMMON
 98.7545 ++#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)		\
 98.7546 ++do 									\
 98.7547 ++{									\
 98.7548 ++  if ((SIZE) <= nios2_section_threshold)				\
 98.7549 ++    {									\
 98.7550 ++      named_section (0, ".sbss", 0);					\
 98.7551 ++      (*targetm.asm_out.globalize_label) (FILE, NAME);			\
 98.7552 ++      ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");			\
 98.7553 ++      if (!flag_inhibit_size_directive)					\
 98.7554 ++	ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE);			\
 98.7555 ++      ASM_OUTPUT_ALIGN ((FILE), exact_log2((ALIGN) / BITS_PER_UNIT));	\
 98.7556 ++      ASM_OUTPUT_LABEL(FILE, NAME);					\
 98.7557 ++      ASM_OUTPUT_SKIP((FILE), (SIZE) ? (SIZE) : 1);			\
 98.7558 ++    }									\
 98.7559 ++  else									\
 98.7560 ++    {									\
 98.7561 ++      fprintf ((FILE), "%s", COMMON_ASM_OP);				\
 98.7562 ++      assemble_name ((FILE), (NAME));					\
 98.7563 ++      fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT);	\
 98.7564 ++    }									\
 98.7565 ++}									\
 98.7566 ++while (0)
 98.7567 ++
 98.7568 ++
 98.7569 ++/* This says how to output assembler code to declare an
 98.7570 ++   uninitialized internal linkage data object.  Under SVR4,
 98.7571 ++   the linker seems to want the alignment of data objects
 98.7572 ++   to depend on their types.  We do exactly that here.  */
 98.7573 ++
 98.7574 ++#undef  ASM_OUTPUT_ALIGNED_LOCAL
 98.7575 ++#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)		\
 98.7576 ++do {									\
 98.7577 ++  if ((SIZE) <= nios2_section_threshold)				\
 98.7578 ++    named_section (0, ".sbss", 0);					\
 98.7579 ++  else									\
 98.7580 ++    named_section (0, ".bss", 0);					\
 98.7581 ++  ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");			\
 98.7582 ++  if (!flag_inhibit_size_directive)					\
 98.7583 ++    ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE);			\
 98.7584 ++  ASM_OUTPUT_ALIGN ((FILE), exact_log2((ALIGN) / BITS_PER_UNIT));	\
 98.7585 ++  ASM_OUTPUT_LABEL(FILE, NAME);						\
 98.7586 ++  ASM_OUTPUT_SKIP((FILE), (SIZE) ? (SIZE) : 1);				\
 98.7587 ++} while (0)
 98.7588 ++
 98.7589 ++
 98.7590 ++
 98.7591 ++/***************************
 98.7592 ++ * Miscellaneous Parameters
 98.7593 ++ ***************************/
 98.7594 ++
 98.7595 ++#define MOVE_MAX 4
 98.7596 ++
 98.7597 ++#define Pmode SImode
 98.7598 ++#define FUNCTION_MODE QImode
 98.7599 ++
 98.7600 ++#define CASE_VECTOR_MODE Pmode
 98.7601 ++
 98.7602 ++#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
 98.7603 ++
 98.7604 ++#define LOAD_EXTEND_OP(MODE) (ZERO_EXTEND)
 98.7605 ++
 98.7606 ++#define WORD_REGISTER_OPERATIONS
 98.7607 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2.md gcc-3.4.6/gcc/config/nios2/nios2.md
 98.7608 +--- gcc-3.4.6.orig/gcc/config/nios2/nios2.md	1970-01-01 01:00:00.000000000 +0100
 98.7609 ++++ gcc-3.4.6/gcc/config/nios2/nios2.md	2007-08-15 23:09:36.000000000 +0200
 98.7610 +@@ -0,0 +1,2078 @@
 98.7611 ++;; Machine Description for Altera NIOS 2G NIOS2 version.
 98.7612 ++;;    Copyright (C) 2003 Altera 
 98.7613 ++;;    Contributed by Jonah Graham (jgraham@altera.com).
 98.7614 ++;; 
 98.7615 ++;; This file is part of GNU CC.
 98.7616 ++;; 
 98.7617 ++;; GNU CC is free software; you can redistribute it and/or modify
 98.7618 ++;; it under the terms of the GNU General Public License as published by
 98.7619 ++;; the Free Software Foundation; either version 2, or (at your option)
 98.7620 ++;; any later version.
 98.7621 ++;; 
 98.7622 ++;; GNU CC is distributed in the hope that it will be useful,
 98.7623 ++;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 98.7624 ++;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 98.7625 ++;; GNU General Public License for more details.
 98.7626 ++;; 
 98.7627 ++;; You should have received a copy of the GNU General Public License
 98.7628 ++;; along with GNU CC; see the file COPYING.  If not, write to
 98.7629 ++;; the Free Software Foundation, 59 Temple Place - Suite 330,
 98.7630 ++;; Boston, MA 02111-1307, USA.  */
 98.7631 ++
 98.7632 ++
 98.7633 ++
 98.7634 ++;*****************************************************************************
 98.7635 ++;*
 98.7636 ++;* constants
 98.7637 ++;*
 98.7638 ++;*****************************************************************************
 98.7639 ++(define_constants [
 98.7640 ++  (GP_REGNO 26)
 98.7641 ++  (SP_REGNO 27)
 98.7642 ++  (FP_REGNO 28)
 98.7643 ++  (RA_REGNO 31)
 98.7644 ++  (RAP_REGNO 38)
 98.7645 ++  (FIRST_RETVAL_REGNO 2)
 98.7646 ++  (LAST_RETVAL_REGNO 3)
 98.7647 ++  (FIRST_ARG_REGNO 4)
 98.7648 ++  (LAST_ARG_REGNO 7)
 98.7649 ++  (SC_REGNO 23)
 98.7650 ++  (PC_REGNO 37)
 98.7651 ++  (FAKE_FP_REGNO 39)
 98.7652 ++  (FAKE_AP_REGNO 40)
 98.7653 ++
 98.7654 ++
 98.7655 ++  (UNSPEC_BLOCKAGE 0)
 98.7656 ++  (UNSPEC_LDBIO 1)
 98.7657 ++  (UNSPEC_LDBUIO 2)
 98.7658 ++  (UNSPEC_LDHIO 3)
 98.7659 ++  (UNSPEC_LDHUIO 4)
 98.7660 ++  (UNSPEC_LDWIO 5)
 98.7661 ++  (UNSPEC_STBIO 6)
 98.7662 ++  (UNSPEC_STHIO 7)
 98.7663 ++  (UNSPEC_STWIO 8)
 98.7664 ++  (UNSPEC_SYNC 9)
 98.7665 ++  (UNSPEC_WRCTL 10)
 98.7666 ++  (UNSPEC_RDCTL 11)
 98.7667 ++  
 98.7668 ++])
 98.7669 ++
 98.7670 ++
 98.7671 ++
 98.7672 ++;*****************************************************************************
 98.7673 ++;*
 98.7674 ++;* instruction scheduler
 98.7675 ++;*
 98.7676 ++;*****************************************************************************
 98.7677 ++
 98.7678 ++; No schedule info is currently available, using an assumption that no
 98.7679 ++; instruction can use the results of the previous instruction without
 98.7680 ++; incuring a stall.
 98.7681 ++
 98.7682 ++; length of an instruction (in bytes)
 98.7683 ++(define_attr "length" "" (const_int 4))
 98.7684 ++(define_attr "type" "unknown,complex,control,alu,cond_alu,st,ld,shift,mul,div,custom" (const_string "complex"))
 98.7685 ++
 98.7686 ++(define_asm_attributes
 98.7687 ++ [(set_attr "length" "4")
 98.7688 ++  (set_attr "type" "complex")])
 98.7689 ++
 98.7690 ++(define_automaton "nios2")
 98.7691 ++(automata_option "v")
 98.7692 ++;(automata_option "no-minimization")
 98.7693 ++(automata_option "ndfa")
 98.7694 ++
 98.7695 ++; The nios2 pipeline is fairly straightforward for the fast model.
 98.7696 ++; Every alu operation is pipelined so that an instruction can
 98.7697 ++; be issued every cycle. However, there are still potential
 98.7698 ++; stalls which this description tries to deal with.
 98.7699 ++
 98.7700 ++(define_cpu_unit "cpu" "nios2")
 98.7701 ++
 98.7702 ++(define_insn_reservation "complex" 1
 98.7703 ++  (eq_attr "type" "complex")
 98.7704 ++  "cpu")
 98.7705 ++
 98.7706 ++(define_insn_reservation "control" 1
 98.7707 ++  (eq_attr "type" "control")
 98.7708 ++  "cpu")
 98.7709 ++
 98.7710 ++(define_insn_reservation "alu" 1
 98.7711 ++  (eq_attr "type" "alu")
 98.7712 ++  "cpu")
 98.7713 ++
 98.7714 ++(define_insn_reservation "cond_alu" 1
 98.7715 ++  (eq_attr "type" "cond_alu")
 98.7716 ++  "cpu")
 98.7717 ++
 98.7718 ++(define_insn_reservation "st" 1
 98.7719 ++  (eq_attr "type" "st")
 98.7720 ++  "cpu")
 98.7721 ++  
 98.7722 ++(define_insn_reservation "custom" 1
 98.7723 ++  (eq_attr "type" "custom")
 98.7724 ++  "cpu")
 98.7725 ++
 98.7726 ++; shifts, muls and lds have three cycle latency
 98.7727 ++(define_insn_reservation "ld" 3
 98.7728 ++  (eq_attr "type" "ld")
 98.7729 ++  "cpu")
 98.7730 ++
 98.7731 ++(define_insn_reservation "shift" 3
 98.7732 ++  (eq_attr "type" "shift")
 98.7733 ++  "cpu")
 98.7734 ++
 98.7735 ++(define_insn_reservation "mul" 3
 98.7736 ++  (eq_attr "type" "mul")
 98.7737 ++  "cpu")
 98.7738 ++
 98.7739 ++(define_insn_reservation "div" 1
 98.7740 ++  (eq_attr "type" "div")
 98.7741 ++  "cpu")
 98.7742 ++
 98.7743 ++
 98.7744 ++;*****************************************************************************
 98.7745 ++;*
 98.7746 ++;* MOV Instructions
 98.7747 ++;*
 98.7748 ++;*****************************************************************************
 98.7749 ++
 98.7750 ++(define_expand "movqi"
 98.7751 ++  [(set (match_operand:QI 0 "nonimmediate_operand" "")
 98.7752 ++        (match_operand:QI 1 "general_operand" ""))]
 98.7753 ++  ""
 98.7754 ++{
 98.7755 ++  if (nios2_emit_move_sequence (operands, QImode))
 98.7756 ++    DONE;
 98.7757 ++})
 98.7758 ++
 98.7759 ++(define_insn "movqi_internal"
 98.7760 ++  [(set (match_operand:QI 0 "nonimmediate_operand" "=m, r,r, r")
 98.7761 ++        (match_operand:QI 1 "general_operand"       "rM,m,rM,I"))]
 98.7762 ++  "(register_operand (operands[0], QImode)
 98.7763 ++    || register_operand (operands[1], QImode)
 98.7764 ++    || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
 98.7765 ++  "@
 98.7766 ++    stb%o0\\t%z1, %0
 98.7767 ++    ldbu%o1\\t%0, %1
 98.7768 ++    mov\\t%0, %z1
 98.7769 ++    movi\\t%0, %1"
 98.7770 ++  [(set_attr "type" "st,ld,alu,alu")])
 98.7771 ++
 98.7772 ++(define_insn "ldbio"
 98.7773 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.7774 ++	(unspec_volatile:SI [(const_int 0)] UNSPEC_LDBIO))
 98.7775 ++   (use (match_operand:SI 1 "memory_operand" "m"))]
 98.7776 ++  ""
 98.7777 ++  "ldbio\\t%0, %1"
 98.7778 ++  [(set_attr "type" "ld")])
 98.7779 ++
 98.7780 ++(define_insn "ldbuio"
 98.7781 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.7782 ++	(unspec_volatile:SI [(const_int 0)] UNSPEC_LDBUIO))
 98.7783 ++   (use (match_operand:SI 1 "memory_operand" "m"))]
 98.7784 ++  ""
 98.7785 ++  "ldbuio\\t%0, %1"
 98.7786 ++  [(set_attr "type" "ld")])
 98.7787 ++
 98.7788 ++(define_insn "stbio"
 98.7789 ++  [(set (match_operand:SI 0 "memory_operand" "=m")
 98.7790 ++	(match_operand:SI 1 "register_operand"   "r"))
 98.7791 ++   (unspec_volatile:SI [(const_int 0)] UNSPEC_STBIO)]
 98.7792 ++  ""
 98.7793 ++  "stbio\\t%z1, %0"
 98.7794 ++  [(set_attr "type" "st")])
 98.7795 ++
 98.7796 ++
 98.7797 ++(define_expand "movhi"
 98.7798 ++  [(set (match_operand:HI 0 "nonimmediate_operand" "")
 98.7799 ++        (match_operand:HI 1 "general_operand" ""))]
 98.7800 ++  ""
 98.7801 ++{
 98.7802 ++  if (nios2_emit_move_sequence (operands, HImode))
 98.7803 ++    DONE;
 98.7804 ++})
 98.7805 ++
 98.7806 ++(define_insn "movhi_internal"
 98.7807 ++  [(set (match_operand:HI 0 "nonimmediate_operand" "=m, r,r, r,r")
 98.7808 ++        (match_operand:HI 1 "general_operand"       "rM,m,rM,I,J"))]
 98.7809 ++  "(register_operand (operands[0], HImode)
 98.7810 ++    || register_operand (operands[1], HImode)
 98.7811 ++    || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
 98.7812 ++  "@
 98.7813 ++    sth%o0\\t%z1, %0
 98.7814 ++    ldhu%o1\\t%0, %1
 98.7815 ++    mov\\t%0, %z1
 98.7816 ++    movi\\t%0, %1
 98.7817 ++    movui\\t%0, %1"
 98.7818 ++  [(set_attr "type" "st,ld,alu,alu,alu")])
 98.7819 ++
 98.7820 ++(define_insn "ldhio"
 98.7821 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.7822 ++	(unspec_volatile:SI [(const_int 0)] UNSPEC_LDHIO))
 98.7823 ++   (use (match_operand:SI 1 "memory_operand" "m"))]
 98.7824 ++  ""
 98.7825 ++  "ldhio\\t%0, %1"
 98.7826 ++  [(set_attr "type" "ld")])
 98.7827 ++
 98.7828 ++(define_insn "ldhuio"
 98.7829 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.7830 ++	(unspec_volatile:SI [(const_int 0)] UNSPEC_LDHUIO))
 98.7831 ++   (use (match_operand:SI 1 "memory_operand" "m"))]
 98.7832 ++  ""
 98.7833 ++  "ldhuio\\t%0, %1"
 98.7834 ++  [(set_attr "type" "ld")])
 98.7835 ++
 98.7836 ++(define_insn "sthio"
 98.7837 ++  [(set (match_operand:SI 0 "memory_operand" "=m")
 98.7838 ++	(match_operand:SI 1 "register_operand"   "r"))
 98.7839 ++   (unspec_volatile:SI [(const_int 0)] UNSPEC_STHIO)]
 98.7840 ++  ""
 98.7841 ++  "sthio\\t%z1, %0"
 98.7842 ++  [(set_attr "type" "st")])
 98.7843 ++
 98.7844 ++(define_expand "movsi"
 98.7845 ++  [(set (match_operand:SI 0 "nonimmediate_operand" "")
 98.7846 ++        (match_operand:SI 1 "general_operand" ""))]
 98.7847 ++  ""
 98.7848 ++{
 98.7849 ++  if (nios2_emit_move_sequence (operands, SImode))
 98.7850 ++    DONE;
 98.7851 ++})
 98.7852 ++
 98.7853 ++(define_insn "movsi_internal"
 98.7854 ++  [(set (match_operand:SI 0 "nonimmediate_operand" "=m, r,r, r,r,r,r")
 98.7855 ++        (match_operand:SI 1 "general_operand"       "rM,m,rM,I,J,S,i"))]
 98.7856 ++  "(register_operand (operands[0], SImode)
 98.7857 ++    || register_operand (operands[1], SImode)
 98.7858 ++    || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
 98.7859 ++  "@
 98.7860 ++    stw%o0\\t%z1, %0
 98.7861 ++    ldw%o1\\t%0, %1
 98.7862 ++    mov\\t%0, %z1
 98.7863 ++    movi\\t%0, %1
 98.7864 ++    movui\\t%0, %1
 98.7865 ++    addi\\t%0, gp, %%gprel(%1)
 98.7866 ++    movhi\\t%0, %H1\;addi\\t%0, %0, %L1"
 98.7867 ++  [(set_attr "type" "st,ld,alu,alu,alu,alu,alu")])
 98.7868 ++
 98.7869 ++(define_insn "ldwio"
 98.7870 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.7871 ++	(unspec_volatile:SI [(const_int 0)] UNSPEC_LDWIO))
 98.7872 ++   (use (match_operand:SI 1 "memory_operand" "m"))]
 98.7873 ++  ""
 98.7874 ++  "ldwio\\t%0, %1"
 98.7875 ++  [(set_attr "type" "ld")])
 98.7876 ++
 98.7877 ++(define_insn "stwio"
 98.7878 ++  [(set (match_operand:SI 0 "memory_operand" "=m")
 98.7879 ++	(match_operand:SI 1 "register_operand"   "r"))
 98.7880 ++   (unspec_volatile:SI [(const_int 0)] UNSPEC_STWIO)]
 98.7881 ++  ""
 98.7882 ++  "stwio\\t%z1, %0"
 98.7883 ++  [(set_attr "type" "st")])
 98.7884 ++
 98.7885 ++
 98.7886 ++
 98.7887 ++;*****************************************************************************
 98.7888 ++;*
 98.7889 ++;* zero extension
 98.7890 ++;*
 98.7891 ++;*****************************************************************************
 98.7892 ++
 98.7893 ++
 98.7894 ++(define_insn "zero_extendhisi2"
 98.7895 ++  [(set (match_operand:SI 0 "register_operand" "=r,r")
 98.7896 ++	(zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
 98.7897 ++  ""
 98.7898 ++  "@
 98.7899 ++    andi\\t%0, %1, 0xffff
 98.7900 ++    ldhu%o1\\t%0, %1"
 98.7901 ++  [(set_attr "type"	"alu,ld")])
 98.7902 ++
 98.7903 ++(define_insn "zero_extendqihi2"
 98.7904 ++  [(set (match_operand:HI 0 "register_operand" "=r,r")
 98.7905 ++	(zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
 98.7906 ++  ""
 98.7907 ++  "@
 98.7908 ++    andi\\t%0, %1, 0xff
 98.7909 ++    ldbu%o1\\t%0, %1"
 98.7910 ++  [(set_attr "type"	"alu,ld")])
 98.7911 ++
 98.7912 ++(define_insn "zero_extendqisi2"
 98.7913 ++  [(set (match_operand:SI 0 "register_operand" "=r,r")
 98.7914 ++	(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
 98.7915 ++  ""
 98.7916 ++  "@
 98.7917 ++    andi\\t%0, %1, 0xff
 98.7918 ++    ldbu%o1\\t%0, %1"
 98.7919 ++  [(set_attr "type"	"alu,ld")])
 98.7920 ++
 98.7921 ++
 98.7922 ++
 98.7923 ++;*****************************************************************************
 98.7924 ++;*
 98.7925 ++;* sign extension
 98.7926 ++;*
 98.7927 ++;*****************************************************************************
 98.7928 ++
 98.7929 ++(define_expand "extendhisi2"
 98.7930 ++  [(set (match_operand:SI 0 "register_operand" "")
 98.7931 ++	(sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))]
 98.7932 ++  ""
 98.7933 ++{
 98.7934 ++  if (optimize && GET_CODE (operands[1]) == MEM)
 98.7935 ++    operands[1] = force_not_mem (operands[1]);
 98.7936 ++
 98.7937 ++  if (GET_CODE (operands[1]) != MEM)
 98.7938 ++    {
 98.7939 ++      rtx op1   = gen_lowpart (SImode, operands[1]);
 98.7940 ++      rtx temp  = gen_reg_rtx (SImode);
 98.7941 ++      rtx shift = GEN_INT (16);
 98.7942 ++
 98.7943 ++      emit_insn (gen_ashlsi3 (temp, op1, shift));
 98.7944 ++      emit_insn (gen_ashrsi3 (operands[0], temp, shift));
 98.7945 ++      DONE;
 98.7946 ++    }
 98.7947 ++})
 98.7948 ++
 98.7949 ++(define_insn "extendhisi2_internal"
 98.7950 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.7951 ++	(sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
 98.7952 ++  ""
 98.7953 ++  "ldh%o1\\t%0, %1"
 98.7954 ++  [(set_attr "type"	"ld")])
 98.7955 ++
 98.7956 ++(define_expand "extendqihi2"
 98.7957 ++  [(set (match_operand:HI 0 "register_operand" "")
 98.7958 ++	(sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))]
 98.7959 ++  ""
 98.7960 ++{
 98.7961 ++  if (optimize && GET_CODE (operands[1]) == MEM)
 98.7962 ++    operands[1] = force_not_mem (operands[1]);
 98.7963 ++
 98.7964 ++  if (GET_CODE (operands[1]) != MEM)
 98.7965 ++    {
 98.7966 ++      rtx op0   = gen_lowpart (SImode, operands[0]);
 98.7967 ++      rtx op1   = gen_lowpart (SImode, operands[1]);
 98.7968 ++      rtx temp  = gen_reg_rtx (SImode);
 98.7969 ++      rtx shift = GEN_INT (24);
 98.7970 ++
 98.7971 ++      emit_insn (gen_ashlsi3 (temp, op1, shift));
 98.7972 ++      emit_insn (gen_ashrsi3 (op0, temp, shift));
 98.7973 ++      DONE;
 98.7974 ++    }
 98.7975 ++})
 98.7976 ++
 98.7977 ++(define_insn "extendqihi2_internal"
 98.7978 ++  [(set (match_operand:HI 0 "register_operand" "=r")
 98.7979 ++	(sign_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
 98.7980 ++  ""
 98.7981 ++  "ldb%o1\\t%0, %1"
 98.7982 ++  [(set_attr "type"	"ld")])
 98.7983 ++
 98.7984 ++
 98.7985 ++(define_expand "extendqisi2"
 98.7986 ++  [(set (match_operand:SI 0 "register_operand" "")
 98.7987 ++	(sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
 98.7988 ++  ""
 98.7989 ++{
 98.7990 ++  if (optimize && GET_CODE (operands[1]) == MEM)
 98.7991 ++    operands[1] = force_not_mem (operands[1]);
 98.7992 ++
 98.7993 ++  if (GET_CODE (operands[1]) != MEM)
 98.7994 ++    {
 98.7995 ++      rtx op1   = gen_lowpart (SImode, operands[1]);
 98.7996 ++      rtx temp  = gen_reg_rtx (SImode);
 98.7997 ++      rtx shift = GEN_INT (24);
 98.7998 ++
 98.7999 ++      emit_insn (gen_ashlsi3 (temp, op1, shift));
 98.8000 ++      emit_insn (gen_ashrsi3 (operands[0], temp, shift));
 98.8001 ++      DONE;
 98.8002 ++    }
 98.8003 ++})
 98.8004 ++
 98.8005 ++(define_insn "extendqisi2_insn"
 98.8006 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.8007 ++	(sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
 98.8008 ++  ""
 98.8009 ++  "ldb%o1\\t%0, %1"
 98.8010 ++  [(set_attr "type"	"ld")])
 98.8011 ++
 98.8012 ++
 98.8013 ++
 98.8014 ++;*****************************************************************************
 98.8015 ++;*
 98.8016 ++;* Arithmetic Operations
 98.8017 ++;*
 98.8018 ++;*****************************************************************************
 98.8019 ++
 98.8020 ++(define_insn "addsi3"
 98.8021 ++  [(set (match_operand:SI 0 "register_operand"          "=r,r")
 98.8022 ++        (plus:SI (match_operand:SI 1 "register_operand" "%r,r")
 98.8023 ++                 (match_operand:SI 2 "arith_operand"     "r,I")))]
 98.8024 ++  ""
 98.8025 ++  "add%i2\\t%0, %1, %z2"
 98.8026 ++  [(set_attr "type" "alu")])
 98.8027 ++
 98.8028 ++(define_insn "subsi3"
 98.8029 ++  [(set (match_operand:SI 0 "register_operand"           "=r")
 98.8030 ++        (minus:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
 98.8031 ++                  (match_operand:SI 2 "register_operand"  "r")))]
 98.8032 ++  ""
 98.8033 ++  "sub\\t%0, %z1, %2"
 98.8034 ++  [(set_attr "type" "alu")])
 98.8035 ++
 98.8036 ++(define_insn "mulsi3"
 98.8037 ++  [(set (match_operand:SI 0 "register_operand"            "=r,r")
 98.8038 ++        (mult:SI (match_operand:SI 1 "register_operand"    "r,r")
 98.8039 ++                 (match_operand:SI 2 "arith_operand"       "r,I")))]
 98.8040 ++  "TARGET_HAS_MUL"
 98.8041 ++  "mul%i2\\t%0, %1, %z2"
 98.8042 ++  [(set_attr "type" "mul")])
 98.8043 ++
 98.8044 ++(define_expand "divsi3"
 98.8045 ++  [(set (match_operand:SI 0 "register_operand"            "=r")
 98.8046 ++        (div:SI (match_operand:SI 1 "register_operand"     "r")
 98.8047 ++                (match_operand:SI 2 "register_operand"     "r")))]
 98.8048 ++  ""
 98.8049 ++{
 98.8050 ++  if (!TARGET_HAS_DIV)
 98.8051 ++    {
 98.8052 ++      if (!TARGET_FAST_SW_DIV)
 98.8053 ++	FAIL;
 98.8054 ++      else
 98.8055 ++        {
 98.8056 ++	  if (nios2_emit_expensive_div (operands, SImode))
 98.8057 ++	    DONE;
 98.8058 ++	}
 98.8059 ++    }
 98.8060 ++})
 98.8061 ++
 98.8062 ++(define_insn "divsi3_insn"
 98.8063 ++  [(set (match_operand:SI 0 "register_operand"            "=r")
 98.8064 ++        (div:SI (match_operand:SI 1 "register_operand"     "r")
 98.8065 ++                (match_operand:SI 2 "register_operand"     "r")))]
 98.8066 ++  "TARGET_HAS_DIV"
 98.8067 ++  "div\\t%0, %1, %2"
 98.8068 ++  [(set_attr "type" "div")])
 98.8069 ++
 98.8070 ++(define_insn "udivsi3"
 98.8071 ++  [(set (match_operand:SI 0 "register_operand"            "=r")
 98.8072 ++        (udiv:SI (match_operand:SI 1 "register_operand"     "r")
 98.8073 ++                (match_operand:SI 2 "register_operand"     "r")))]
 98.8074 ++  "TARGET_HAS_DIV"
 98.8075 ++  "divu\\t%0, %1, %2"
 98.8076 ++  [(set_attr "type" "div")])
 98.8077 ++
 98.8078 ++(define_insn "smulsi3_highpart"
 98.8079 ++  [(set (match_operand:SI 0 "register_operand"                            "=r")
 98.8080 ++	(truncate:SI
 98.8081 ++	 (lshiftrt:DI
 98.8082 ++	  (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand"  "r"))
 98.8083 ++		   (sign_extend:DI (match_operand:SI 2 "register_operand"  "r")))
 98.8084 ++	  (const_int 32))))]
 98.8085 ++  "TARGET_HAS_MULX"
 98.8086 ++  "mulxss\\t%0, %1, %2"
 98.8087 ++  [(set_attr "type" "mul")])
 98.8088 ++
 98.8089 ++(define_insn "umulsi3_highpart"
 98.8090 ++  [(set (match_operand:SI 0 "register_operand"                            "=r")
 98.8091 ++	(truncate:SI
 98.8092 ++	 (lshiftrt:DI
 98.8093 ++	  (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand"  "r"))
 98.8094 ++		   (zero_extend:DI (match_operand:SI 2 "register_operand"  "r")))
 98.8095 ++	  (const_int 32))))]
 98.8096 ++  "TARGET_HAS_MULX"
 98.8097 ++  "mulxuu\\t%0, %1, %2"
 98.8098 ++  [(set_attr "type" "mul")])
 98.8099 ++
 98.8100 ++
 98.8101 ++(define_expand "mulsidi3"
 98.8102 ++    [(set (subreg:SI (match_operand:DI 0 "register_operand" "") 0)
 98.8103 ++	  (mult:SI (match_operand:SI 1 "register_operand" "")
 98.8104 ++		   (match_operand:SI 2 "register_operand" "")))
 98.8105 ++     (set (subreg:SI (match_dup 0) 4)
 98.8106 ++	  (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
 98.8107 ++					     (sign_extend:DI (match_dup 2)))
 98.8108 ++				    (const_int 32))))]
 98.8109 ++  "TARGET_HAS_MULX"
 98.8110 ++  "")
 98.8111 ++
 98.8112 ++(define_expand "umulsidi3"
 98.8113 ++    [(set (subreg:SI (match_operand:DI 0 "register_operand" "") 0)
 98.8114 ++	  (mult:SI (match_operand:SI 1 "register_operand" "")
 98.8115 ++		   (match_operand:SI 2 "register_operand" "")))
 98.8116 ++     (set (subreg:SI (match_dup 0) 4)
 98.8117 ++	  (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
 98.8118 ++					     (zero_extend:DI (match_dup 2)))
 98.8119 ++				    (const_int 32))))]
 98.8120 ++  "TARGET_HAS_MULX"
 98.8121 ++  "")
 98.8122 ++
 98.8123 ++
 98.8124 ++
 98.8125 ++;*****************************************************************************
 98.8126 ++;*
 98.8127 ++;* Negate and ones complement
 98.8128 ++;*
 98.8129 ++;*****************************************************************************
 98.8130 ++
 98.8131 ++(define_insn "negsi2"
 98.8132 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8133 ++	(neg:SI (match_operand:SI 1 "register_operand" "r")))]
 98.8134 ++  ""
 98.8135 ++{
 98.8136 ++  operands[2] = const0_rtx;
 98.8137 ++  return "sub\\t%0, %z2, %1";
 98.8138 ++}
 98.8139 ++  [(set_attr "type" "alu")])
 98.8140 ++
 98.8141 ++(define_insn "one_cmplsi2"
 98.8142 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8143 ++	(not:SI (match_operand:SI 1 "register_operand" "r")))]
 98.8144 ++  ""
 98.8145 ++{
 98.8146 ++  operands[2] = const0_rtx;
 98.8147 ++  return "nor\\t%0, %z2, %1";
 98.8148 ++}
 98.8149 ++  [(set_attr "type" "alu")])
 98.8150 ++
 98.8151 ++
 98.8152 ++
 98.8153 ++; Logical Operantions
 98.8154 ++
 98.8155 ++(define_insn "andsi3"
 98.8156 ++  [(set (match_operand:SI 0 "register_operand"         "=r, r,r")
 98.8157 ++        (and:SI (match_operand:SI 1 "register_operand" "%r, r,r")
 98.8158 ++                (match_operand:SI 2 "logical_operand"   "rM,J,K")))]
 98.8159 ++  ""
 98.8160 ++  "@
 98.8161 ++    and\\t%0, %1, %z2
 98.8162 ++    and%i2\\t%0, %1, %2
 98.8163 ++    andh%i2\\t%0, %1, %U2"
 98.8164 ++  [(set_attr "type" "alu")])
 98.8165 ++
 98.8166 ++(define_insn "iorsi3"
 98.8167 ++  [(set (match_operand:SI 0 "register_operand"          "=r, r,r")
 98.8168 ++        (ior:SI (match_operand:SI 1 "register_operand"  "%r, r,r")
 98.8169 ++                (match_operand:SI 2 "logical_operand"    "rM,J,K")))]
 98.8170 ++  ""
 98.8171 ++  "@
 98.8172 ++    or\\t%0, %1, %z2
 98.8173 ++    or%i2\\t%0, %1, %2
 98.8174 ++    orh%i2\\t%0, %1, %U2"
 98.8175 ++  [(set_attr "type" "alu")])
 98.8176 ++
 98.8177 ++(define_insn "*norsi3"
 98.8178 ++  [(set (match_operand:SI 0 "register_operand"                  "=r")
 98.8179 ++        (and:SI (not:SI (match_operand:SI 1 "register_operand"  "%r"))
 98.8180 ++                (not:SI (match_operand:SI 2 "reg_or_0_operand"   "rM"))))]
 98.8181 ++  ""
 98.8182 ++  "nor\\t%0, %1, %z2"
 98.8183 ++  [(set_attr "type" "alu")])
 98.8184 ++
 98.8185 ++(define_insn "xorsi3"
 98.8186 ++  [(set (match_operand:SI 0 "register_operand"          "=r, r,r")
 98.8187 ++        (xor:SI (match_operand:SI 1 "register_operand"  "%r, r,r")
 98.8188 ++                (match_operand:SI 2 "logical_operand"    "rM,J,K")))]
 98.8189 ++  ""
 98.8190 ++  "@
 98.8191 ++    xor\\t%0, %1, %z2
 98.8192 ++    xor%i2\\t%0, %1, %2
 98.8193 ++    xorh%i2\\t%0, %1, %U2"
 98.8194 ++  [(set_attr "type" "alu")])
 98.8195 ++
 98.8196 ++
 98.8197 ++
 98.8198 ++;*****************************************************************************
 98.8199 ++;*
 98.8200 ++;* Shifts
 98.8201 ++;*
 98.8202 ++;*****************************************************************************
 98.8203 ++
 98.8204 ++(define_insn "ashlsi3"
 98.8205 ++  [(set (match_operand:SI 0 "register_operand"           "=r,r")
 98.8206 ++	(ashift:SI (match_operand:SI 1 "register_operand" "r,r")
 98.8207 ++		   (match_operand:SI 2 "shift_operand"    "r,L")))]
 98.8208 ++  ""
 98.8209 ++  "sll%i2\\t%0, %1, %z2"
 98.8210 ++  [(set_attr "type" "shift")])
 98.8211 ++
 98.8212 ++(define_insn "ashrsi3"
 98.8213 ++  [(set (match_operand:SI 0 "register_operand"             "=r,r")
 98.8214 ++	(ashiftrt:SI (match_operand:SI 1 "register_operand" "r,r")
 98.8215 ++		     (match_operand:SI 2 "shift_operand"    "r,L")))]
 98.8216 ++  ""
 98.8217 ++  "sra%i2\\t%0, %1, %z2"
 98.8218 ++  [(set_attr "type" "shift")])
 98.8219 ++
 98.8220 ++(define_insn "lshrsi3"
 98.8221 ++  [(set (match_operand:SI 0 "register_operand"             "=r,r")
 98.8222 ++	(lshiftrt:SI (match_operand:SI 1 "register_operand" "r,r")
 98.8223 ++		     (match_operand:SI 2 "shift_operand"    "r,L")))]
 98.8224 ++  ""
 98.8225 ++  "srl%i2\\t%0, %1, %z2"
 98.8226 ++  [(set_attr "type" "shift")])
 98.8227 ++
 98.8228 ++(define_insn "rotlsi3"
 98.8229 ++  [(set (match_operand:SI 0 "register_operand"           "=r,r")
 98.8230 ++	(rotate:SI (match_operand:SI 1 "register_operand" "r,r")
 98.8231 ++		   (match_operand:SI 2 "shift_operand"    "r,L")))]
 98.8232 ++  ""
 98.8233 ++  "rol%i2\\t%0, %1, %z2"
 98.8234 ++  [(set_attr "type" "shift")])
 98.8235 ++
 98.8236 ++(define_insn "rotrsi3"
 98.8237 ++  [(set (match_operand:SI 0 "register_operand"             "=r,r")
 98.8238 ++	(rotatert:SI (match_operand:SI 1 "register_operand" "r,r")
 98.8239 ++		     (match_operand:SI 2 "register_operand" "r,r")))]
 98.8240 ++  ""
 98.8241 ++  "ror\\t%0, %1, %2"
 98.8242 ++  [(set_attr "type" "shift")])
 98.8243 ++
 98.8244 ++(define_insn "*shift_mul_constants"
 98.8245 ++  [(set (match_operand:SI 0 "register_operand"                     "=r")
 98.8246 ++	(ashift:SI (mult:SI (match_operand:SI 1 "register_operand"  "r")
 98.8247 ++		            (match_operand:SI 2 "const_int_operand" "I"))
 98.8248 ++		   (match_operand:SI 3          "const_int_operand" "I")))]
 98.8249 ++  "TARGET_HAS_MUL && SMALL_INT (INTVAL (operands[2]) << INTVAL (operands[3]))"
 98.8250 ++{
 98.8251 ++  HOST_WIDE_INT mul = INTVAL (operands[2]) << INTVAL (operands[3]);
 98.8252 ++  rtx ops[3];
 98.8253 ++  
 98.8254 ++  ops[0] = operands[0];
 98.8255 ++  ops[1] = operands[1];
 98.8256 ++  ops[2] = GEN_INT (mul);
 98.8257 ++  
 98.8258 ++  output_asm_insn ("muli\t%0, %1, %2", ops);
 98.8259 ++  return "";
 98.8260 ++}
 98.8261 ++  [(set_attr "type" "mul")])
 98.8262 ++
 98.8263 ++
 98.8264 ++
 98.8265 ++
 98.8266 ++;*****************************************************************************
 98.8267 ++;*
 98.8268 ++;* Prologue, Epilogue and Return
 98.8269 ++;*
 98.8270 ++;*****************************************************************************
 98.8271 ++
 98.8272 ++(define_expand "prologue"
 98.8273 ++  [(const_int 1)]
 98.8274 ++  ""
 98.8275 ++{
 98.8276 ++  expand_prologue ();
 98.8277 ++  DONE;
 98.8278 ++})
 98.8279 ++
 98.8280 ++(define_expand "epilogue"
 98.8281 ++  [(return)]
 98.8282 ++  ""
 98.8283 ++{
 98.8284 ++  expand_epilogue (false);
 98.8285 ++  DONE;
 98.8286 ++})
 98.8287 ++
 98.8288 ++(define_expand "sibcall_epilogue"
 98.8289 ++  [(return)]
 98.8290 ++  ""
 98.8291 ++{
 98.8292 ++  expand_epilogue (true);
 98.8293 ++  DONE;
 98.8294 ++})
 98.8295 ++
 98.8296 ++(define_insn "return"
 98.8297 ++  [(return)]
 98.8298 ++  "reload_completed && nios2_can_use_return_insn ()"
 98.8299 ++  "ret\\t"
 98.8300 ++)
 98.8301 ++
 98.8302 ++(define_insn "return_from_epilogue"
 98.8303 ++  [(use (match_operand 0 "pmode_register_operand" ""))
 98.8304 ++   (return)]
 98.8305 ++  "reload_completed"
 98.8306 ++  "ret\\t"
 98.8307 ++)
 98.8308 ++
 98.8309 ++;; Block any insns from being moved before this point, since the
 98.8310 ++;; profiling call to mcount can use various registers that aren't
 98.8311 ++;; saved or used to pass arguments.
 98.8312 ++
 98.8313 ++(define_insn "blockage"
 98.8314 ++  [(unspec_volatile [(const_int 0)] UNSPEC_BLOCKAGE)]
 98.8315 ++  ""
 98.8316 ++  ""
 98.8317 ++  [(set_attr "type" "unknown")
 98.8318 ++   (set_attr "length" "0")])
 98.8319 ++
 98.8320 ++
 98.8321 ++
 98.8322 ++;*****************************************************************************
 98.8323 ++;*
 98.8324 ++;* Jumps and Calls
 98.8325 ++;*
 98.8326 ++;*****************************************************************************
 98.8327 ++
 98.8328 ++(define_insn "indirect_jump"
 98.8329 ++  [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
 98.8330 ++  ""
 98.8331 ++  "jmp\\t%0"
 98.8332 ++  [(set_attr "type" "control")])
 98.8333 ++
 98.8334 ++(define_insn "jump"
 98.8335 ++  [(set (pc)
 98.8336 ++        (label_ref (match_operand 0 "" "")))]
 98.8337 ++  ""
 98.8338 ++  "br\\t%0"
 98.8339 ++  [(set_attr "type" "control")])
 98.8340 ++
 98.8341 ++
 98.8342 ++(define_insn "indirect_call"
 98.8343 ++  [(call (mem:QI (match_operand:SI 0 "register_operand" "r"))
 98.8344 ++         (match_operand 1 "" ""))
 98.8345 ++   (clobber (reg:SI RA_REGNO))]
 98.8346 ++  ""
 98.8347 ++  "callr\\t%0"
 98.8348 ++  [(set_attr "type" "control")])
 98.8349 ++
 98.8350 ++(define_insn "indirect_call_value"
 98.8351 ++  [(set (match_operand 0 "" "")
 98.8352 ++        (call (mem:QI (match_operand:SI 1 "register_operand" "r"))
 98.8353 ++              (match_operand 2 "" "")))
 98.8354 ++   (clobber (reg:SI RA_REGNO))]
 98.8355 ++  ""
 98.8356 ++  "callr\\t%1"
 98.8357 ++)
 98.8358 ++
 98.8359 ++(define_expand "call"
 98.8360 ++  [(parallel [(call (match_operand 0 "" "")
 98.8361 ++                    (match_operand 1 "" ""))
 98.8362 ++              (clobber (reg:SI RA_REGNO))])]
 98.8363 ++  ""
 98.8364 ++  "")
 98.8365 ++
 98.8366 ++(define_expand "call_value"
 98.8367 ++  [(parallel [(set (match_operand 0 "" "")
 98.8368 ++                   (call (match_operand 1 "" "")
 98.8369 ++                         (match_operand 2 "" "")))
 98.8370 ++              (clobber (reg:SI RA_REGNO))])]
 98.8371 ++  ""
 98.8372 ++  "")
 98.8373 ++
 98.8374 ++(define_insn "*call"
 98.8375 ++  [(call (mem:QI (match_operand:SI 0 "immediate_operand" "i"))
 98.8376 ++         (match_operand 1 "" ""))
 98.8377 ++   (clobber (match_operand:SI 2 "register_operand" "=r"))]
 98.8378 ++  ""
 98.8379 ++  "call\\t%0"
 98.8380 ++  [(set_attr "type" "control")])
 98.8381 ++
 98.8382 ++(define_insn "*call_value"
 98.8383 ++  [(set (match_operand 0 "" "")
 98.8384 ++        (call (mem:QI (match_operand:SI 1 "immediate_operand" "i"))
 98.8385 ++              (match_operand 2 "" "")))
 98.8386 ++   (clobber (match_operand:SI 3 "register_operand" "=r"))]
 98.8387 ++  ""
 98.8388 ++  "call\\t%1"
 98.8389 ++  [(set_attr "type" "control")])
 98.8390 ++
 98.8391 ++(define_expand "sibcall"
 98.8392 ++  [(parallel [(call (match_operand 0 "" "")
 98.8393 ++		    (match_operand 1 "" ""))
 98.8394 ++	      (return)
 98.8395 ++	      (use (match_operand 2 "" ""))])]
 98.8396 ++  ""
 98.8397 ++  {
 98.8398 ++    XEXP (operands[0], 0) = copy_to_mode_reg (SImode, XEXP (operands[0], 0));
 98.8399 ++
 98.8400 ++    if (operands[2] == NULL_RTX)
 98.8401 ++      operands[2] = const0_rtx;
 98.8402 ++  }
 98.8403 ++)
 98.8404 ++
 98.8405 ++(define_expand "sibcall_value"
 98.8406 ++  [(parallel [(set (match_operand 0 "" "")
 98.8407 ++		   (call (match_operand 1 "" "")
 98.8408 ++			 (match_operand 2 "" "")))
 98.8409 ++	      (return)
 98.8410 ++	      (use (match_operand 3 "" ""))])]
 98.8411 ++  ""
 98.8412 ++  {
 98.8413 ++    XEXP (operands[1], 0) = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
 98.8414 ++
 98.8415 ++    if (operands[3] == NULL_RTX)
 98.8416 ++      operands[3] = const0_rtx;
 98.8417 ++  }
 98.8418 ++)
 98.8419 ++
 98.8420 ++(define_insn "sibcall_insn"
 98.8421 ++ [(call (mem:QI (match_operand:SI 0 "register_operand" "r"))
 98.8422 ++	(match_operand 1 "" ""))
 98.8423 ++  (return)
 98.8424 ++  (use (match_operand 2 "" ""))]
 98.8425 ++  ""
 98.8426 ++  "jmp\\t%0"
 98.8427 ++)
 98.8428 ++
 98.8429 ++(define_insn "sibcall_value_insn"
 98.8430 ++ [(set (match_operand 0 "register_operand" "")
 98.8431 ++       (call (mem:QI (match_operand:SI 1 "register_operand" "r"))
 98.8432 ++	     (match_operand 2 "" "")))
 98.8433 ++  (return)
 98.8434 ++  (use (match_operand 3 "" ""))]
 98.8435 ++  ""
 98.8436 ++  "jmp\\t%1"
 98.8437 ++)
 98.8438 ++
 98.8439 ++
 98.8440 ++
 98.8441 ++
 98.8442 ++(define_expand "tablejump"
 98.8443 ++  [(parallel [(set (pc) (match_operand 0 "register_operand" "r"))
 98.8444 ++              (use (label_ref (match_operand 1 "" "")))])]
 98.8445 ++  ""
 98.8446 ++  ""
 98.8447 ++)
 98.8448 ++
 98.8449 ++(define_insn "*tablejump"
 98.8450 ++  [(set (pc)
 98.8451 ++	(match_operand:SI 0 "register_operand" "r"))
 98.8452 ++   (use (label_ref (match_operand 1 "" "")))]
 98.8453 ++  ""
 98.8454 ++  "jmp\\t%0"
 98.8455 ++  [(set_attr "type" "control")])
 98.8456 ++
 98.8457 ++
 98.8458 ++
 98.8459 ++;*****************************************************************************
 98.8460 ++;*
 98.8461 ++;* Comparisons
 98.8462 ++;*
 98.8463 ++;*****************************************************************************
 98.8464 ++;; Flow here is rather complex (based on MIPS):
 98.8465 ++;;
 98.8466 ++;;  1)	The cmp{si,di,sf,df} routine is called.  It deposits the
 98.8467 ++;;	arguments into the branch_cmp array, and the type into
 98.8468 ++;;	branch_type.  No RTL is generated.
 98.8469 ++;;
 98.8470 ++;;  2)	The appropriate branch define_expand is called, which then
 98.8471 ++;;	creates the appropriate RTL for the comparison and branch.
 98.8472 ++;;	Different CC modes are used, based on what type of branch is
 98.8473 ++;;	done, so that we can constrain things appropriately.  There
 98.8474 ++;;	are assumptions in the rest of GCC that break if we fold the
 98.8475 ++;;	operands into the branchs for integer operations, and use cc0
 98.8476 ++;;	for floating point, so we use the fp status register instead.
 98.8477 ++;;	If needed, an appropriate temporary is created to hold the
 98.8478 ++;;	of the integer compare.
 98.8479 ++
 98.8480 ++(define_expand "cmpsi"
 98.8481 ++  [(set (cc0)
 98.8482 ++	(compare:CC (match_operand:SI 0 "register_operand" "")
 98.8483 ++		    (match_operand:SI 1 "arith_operand" "")))]
 98.8484 ++  ""
 98.8485 ++{
 98.8486 ++  branch_cmp[0] = operands[0];
 98.8487 ++  branch_cmp[1] = operands[1];
 98.8488 ++  branch_type = CMP_SI;
 98.8489 ++  DONE;
 98.8490 ++})
 98.8491 ++
 98.8492 ++(define_expand "tstsi"
 98.8493 ++  [(set (cc0)
 98.8494 ++	(match_operand:SI 0 "register_operand" ""))]
 98.8495 ++  ""
 98.8496 ++{
 98.8497 ++  branch_cmp[0] = operands[0];
 98.8498 ++  branch_cmp[1] = const0_rtx;
 98.8499 ++  branch_type = CMP_SI;
 98.8500 ++  DONE;
 98.8501 ++})
 98.8502 ++
 98.8503 ++
 98.8504 ++;*****************************************************************************
 98.8505 ++;*
 98.8506 ++;* setting a register from a comparison
 98.8507 ++;*
 98.8508 ++;*****************************************************************************
 98.8509 ++
 98.8510 ++(define_expand "seq"
 98.8511 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.8512 ++	(eq:SI (match_dup 1)
 98.8513 ++	       (match_dup 2)))]
 98.8514 ++  ""
 98.8515 ++{
 98.8516 ++  if (branch_type != CMP_SI)
 98.8517 ++    FAIL;
 98.8518 ++
 98.8519 ++  /* set up operands from compare.  */
 98.8520 ++  operands[1] = branch_cmp[0];
 98.8521 ++  operands[2] = branch_cmp[1];
 98.8522 ++
 98.8523 ++  gen_int_relational (EQ, operands[0], operands[1], operands[2], NULL_RTX);
 98.8524 ++  DONE;
 98.8525 ++})
 98.8526 ++
 98.8527 ++
 98.8528 ++(define_insn "*seq"
 98.8529 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8530 ++	(eq:SI (match_operand:SI 1 "reg_or_0_operand" "%rM")
 98.8531 ++	       (match_operand:SI 2 "arith_operand"     "rI")))]
 98.8532 ++  ""
 98.8533 ++  "cmpeq%i2\\t%0, %z1, %z2"
 98.8534 ++  [(set_attr "type" "alu")])
 98.8535 ++
 98.8536 ++
 98.8537 ++(define_expand "sne"
 98.8538 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.8539 ++	(ne:SI (match_dup 1)
 98.8540 ++	       (match_dup 2)))]
 98.8541 ++  ""
 98.8542 ++{
 98.8543 ++  if (branch_type != CMP_SI)
 98.8544 ++    FAIL;
 98.8545 ++
 98.8546 ++  /* set up operands from compare.  */
 98.8547 ++  operands[1] = branch_cmp[0];
 98.8548 ++  operands[2] = branch_cmp[1];
 98.8549 ++
 98.8550 ++  gen_int_relational (NE, operands[0], operands[1], operands[2], NULL_RTX);
 98.8551 ++  DONE;
 98.8552 ++})
 98.8553 ++
 98.8554 ++
 98.8555 ++(define_insn "*sne"
 98.8556 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8557 ++	(ne:SI (match_operand:SI 1 "reg_or_0_operand" "%rM")
 98.8558 ++	       (match_operand:SI 2 "arith_operand"     "rI")))]
 98.8559 ++  ""
 98.8560 ++  "cmpne%i2\\t%0, %z1, %z2"
 98.8561 ++  [(set_attr "type" "alu")])
 98.8562 ++
 98.8563 ++
 98.8564 ++(define_expand "sgt"
 98.8565 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.8566 ++	(gt:SI (match_dup 1)
 98.8567 ++	       (match_dup 2)))]
 98.8568 ++  ""
 98.8569 ++{
 98.8570 ++  if (branch_type != CMP_SI)
 98.8571 ++    FAIL;
 98.8572 ++
 98.8573 ++  /* set up operands from compare.  */
 98.8574 ++  operands[1] = branch_cmp[0];
 98.8575 ++  operands[2] = branch_cmp[1];
 98.8576 ++
 98.8577 ++  gen_int_relational (GT, operands[0], operands[1], operands[2], NULL_RTX);
 98.8578 ++  DONE;
 98.8579 ++})
 98.8580 ++
 98.8581 ++
 98.8582 ++(define_insn "*sgt"
 98.8583 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8584 ++	(gt:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
 98.8585 ++	       (match_operand:SI 2 "reg_or_0_operand"  "rM")))]
 98.8586 ++  ""
 98.8587 ++  "cmplt\\t%0, %z2, %z1"
 98.8588 ++  [(set_attr "type" "alu")])
 98.8589 ++
 98.8590 ++
 98.8591 ++(define_expand "sge"
 98.8592 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.8593 ++	(ge:SI (match_dup 1)
 98.8594 ++	       (match_dup 2)))]
 98.8595 ++  ""
 98.8596 ++{
 98.8597 ++  if (branch_type != CMP_SI)
 98.8598 ++    FAIL;
 98.8599 ++
 98.8600 ++  /* set up operands from compare.  */
 98.8601 ++  operands[1] = branch_cmp[0];
 98.8602 ++  operands[2] = branch_cmp[1];
 98.8603 ++
 98.8604 ++  gen_int_relational (GE, operands[0], operands[1], operands[2], NULL_RTX);
 98.8605 ++  DONE;
 98.8606 ++})
 98.8607 ++
 98.8608 ++
 98.8609 ++(define_insn "*sge"
 98.8610 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8611 ++	(ge:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
 98.8612 ++	       (match_operand:SI 2 "arith_operand"     "rI")))]
 98.8613 ++  ""
 98.8614 ++  "cmpge%i2\\t%0, %z1, %z2"
 98.8615 ++  [(set_attr "type" "alu")])
 98.8616 ++
 98.8617 ++(define_expand "sle"
 98.8618 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.8619 ++	(le:SI (match_dup 1)
 98.8620 ++	       (match_dup 2)))]
 98.8621 ++  ""
 98.8622 ++{
 98.8623 ++  if (branch_type != CMP_SI)
 98.8624 ++    FAIL;
 98.8625 ++
 98.8626 ++  /* set up operands from compare.  */
 98.8627 ++  operands[1] = branch_cmp[0];
 98.8628 ++  operands[2] = branch_cmp[1];
 98.8629 ++
 98.8630 ++  gen_int_relational (LE, operands[0], operands[1], operands[2], NULL_RTX);
 98.8631 ++  DONE;
 98.8632 ++})
 98.8633 ++
 98.8634 ++
 98.8635 ++(define_insn "*sle"
 98.8636 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8637 ++	(le:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
 98.8638 ++	       (match_operand:SI 2 "reg_or_0_operand"  "rM")))]
 98.8639 ++  ""
 98.8640 ++  "cmpge\\t%0, %z2, %z1"
 98.8641 ++  [(set_attr "type" "alu")])
 98.8642 ++
 98.8643 ++
 98.8644 ++(define_expand "slt"
 98.8645 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.8646 ++	(lt:SI (match_dup 1)
 98.8647 ++	       (match_dup 2)))]
 98.8648 ++  ""
 98.8649 ++{
 98.8650 ++  if (branch_type != CMP_SI)
 98.8651 ++    FAIL;
 98.8652 ++
 98.8653 ++  /* set up operands from compare.  */
 98.8654 ++  operands[1] = branch_cmp[0];
 98.8655 ++  operands[2] = branch_cmp[1];
 98.8656 ++
 98.8657 ++  gen_int_relational (LT, operands[0], operands[1], operands[2], NULL_RTX);
 98.8658 ++  DONE;
 98.8659 ++})
 98.8660 ++
 98.8661 ++
 98.8662 ++(define_insn "*slt"
 98.8663 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8664 ++	(lt:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
 98.8665 ++	       (match_operand:SI 2 "arith_operand"     "rI")))]
 98.8666 ++  ""
 98.8667 ++  "cmplt%i2\\t%0, %z1, %z2"
 98.8668 ++  [(set_attr "type" "alu")])
 98.8669 ++
 98.8670 ++
 98.8671 ++(define_expand "sgtu"
 98.8672 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.8673 ++	(gtu:SI (match_dup 1)
 98.8674 ++	        (match_dup 2)))]
 98.8675 ++  ""
 98.8676 ++{
 98.8677 ++  if (branch_type != CMP_SI)
 98.8678 ++    FAIL;
 98.8679 ++
 98.8680 ++  /* set up operands from compare.  */
 98.8681 ++  operands[1] = branch_cmp[0];
 98.8682 ++  operands[2] = branch_cmp[1];
 98.8683 ++
 98.8684 ++  gen_int_relational (GTU, operands[0], operands[1], operands[2], NULL_RTX);
 98.8685 ++  DONE;
 98.8686 ++})
 98.8687 ++
 98.8688 ++
 98.8689 ++(define_insn "*sgtu"
 98.8690 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8691 ++	(gtu:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
 98.8692 ++	        (match_operand:SI 2 "reg_or_0_operand"  "rM")))]
 98.8693 ++  ""
 98.8694 ++  "cmpltu\\t%0, %z2, %z1"
 98.8695 ++  [(set_attr "type" "alu")])
 98.8696 ++
 98.8697 ++
 98.8698 ++(define_expand "sgeu"
 98.8699 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.8700 ++	(geu:SI (match_dup 1)
 98.8701 ++	        (match_dup 2)))]
 98.8702 ++  ""
 98.8703 ++{
 98.8704 ++  if (branch_type != CMP_SI)
 98.8705 ++    FAIL;
 98.8706 ++
 98.8707 ++  /* set up operands from compare.  */
 98.8708 ++  operands[1] = branch_cmp[0];
 98.8709 ++  operands[2] = branch_cmp[1];
 98.8710 ++
 98.8711 ++  gen_int_relational (GEU, operands[0], operands[1], operands[2], NULL_RTX);
 98.8712 ++  DONE;
 98.8713 ++})
 98.8714 ++
 98.8715 ++
 98.8716 ++(define_insn "*sgeu"
 98.8717 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8718 ++	(geu:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
 98.8719 ++	        (match_operand:SI 2 "uns_arith_operand"     "rJ")))]
 98.8720 ++  ""
 98.8721 ++  "cmpgeu%i2\\t%0, %z1, %z2"
 98.8722 ++  [(set_attr "type" "alu")])
 98.8723 ++
 98.8724 ++(define_expand "sleu"
 98.8725 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.8726 ++	(leu:SI (match_dup 1)
 98.8727 ++	        (match_dup 2)))]
 98.8728 ++  ""
 98.8729 ++{
 98.8730 ++  if (branch_type != CMP_SI)
 98.8731 ++    FAIL;
 98.8732 ++
 98.8733 ++  /* set up operands from compare.  */
 98.8734 ++  operands[1] = branch_cmp[0];
 98.8735 ++  operands[2] = branch_cmp[1];
 98.8736 ++
 98.8737 ++  gen_int_relational (LEU, operands[0], operands[1], operands[2], NULL_RTX);
 98.8738 ++  DONE;
 98.8739 ++})
 98.8740 ++
 98.8741 ++
 98.8742 ++(define_insn "*sleu"
 98.8743 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8744 ++	(leu:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
 98.8745 ++	        (match_operand:SI 2 "reg_or_0_operand"  "rM")))]
 98.8746 ++  ""
 98.8747 ++  "cmpgeu\\t%0, %z2, %z1"
 98.8748 ++  [(set_attr "type" "alu")])
 98.8749 ++
 98.8750 ++
 98.8751 ++(define_expand "sltu"
 98.8752 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.8753 ++	(ltu:SI (match_dup 1)
 98.8754 ++	        (match_dup 2)))]
 98.8755 ++  ""
 98.8756 ++{
 98.8757 ++  if (branch_type != CMP_SI)
 98.8758 ++    FAIL;
 98.8759 ++
 98.8760 ++  /* set up operands from compare.  */
 98.8761 ++  operands[1] = branch_cmp[0];
 98.8762 ++  operands[2] = branch_cmp[1];
 98.8763 ++
 98.8764 ++  gen_int_relational (LTU, operands[0], operands[1], operands[2], NULL_RTX);
 98.8765 ++  DONE;
 98.8766 ++})
 98.8767 ++
 98.8768 ++
 98.8769 ++(define_insn "*sltu"
 98.8770 ++  [(set (match_operand:SI 0 "register_operand"        "=r")
 98.8771 ++	(ltu:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
 98.8772 ++	        (match_operand:SI 2 "uns_arith_operand"     "rJ")))]
 98.8773 ++  ""
 98.8774 ++  "cmpltu%i2\\t%0, %z1, %z2"
 98.8775 ++  [(set_attr "type" "alu")])
 98.8776 ++
 98.8777 ++
 98.8778 ++
 98.8779 ++
 98.8780 ++;*****************************************************************************
 98.8781 ++;*
 98.8782 ++;* branches
 98.8783 ++;*
 98.8784 ++;*****************************************************************************
 98.8785 ++
 98.8786 ++(define_insn "*cbranch"
 98.8787 ++  [(set (pc)
 98.8788 ++	(if_then_else
 98.8789 ++         (match_operator:SI 0 "comparison_operator"
 98.8790 ++			    [(match_operand:SI 2 "reg_or_0_operand" "rM")
 98.8791 ++			     (match_operand:SI 3 "reg_or_0_operand" "rM")])
 98.8792 ++        (label_ref (match_operand 1 "" ""))
 98.8793 ++        (pc)))]
 98.8794 ++  ""
 98.8795 ++  "b%0\\t%z2, %z3, %l1"
 98.8796 ++  [(set_attr "type" "control")])
 98.8797 ++
 98.8798 ++
 98.8799 ++(define_expand "beq"
 98.8800 ++  [(set (pc)
 98.8801 ++	(if_then_else (eq:CC (cc0)
 98.8802 ++			     (const_int 0))
 98.8803 ++		      (label_ref (match_operand 0 "" ""))
 98.8804 ++		      (pc)))]
 98.8805 ++  ""
 98.8806 ++{
 98.8807 ++  gen_int_relational (EQ, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
 98.8808 ++  DONE;
 98.8809 ++})
 98.8810 ++
 98.8811 ++
 98.8812 ++(define_expand "bne"
 98.8813 ++  [(set (pc)
 98.8814 ++	(if_then_else (ne:CC (cc0)
 98.8815 ++			     (const_int 0))
 98.8816 ++		      (label_ref (match_operand 0 "" ""))
 98.8817 ++		      (pc)))]
 98.8818 ++  ""
 98.8819 ++{
 98.8820 ++  gen_int_relational (NE, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
 98.8821 ++  DONE;
 98.8822 ++})
 98.8823 ++
 98.8824 ++
 98.8825 ++(define_expand "bgt"
 98.8826 ++  [(set (pc)
 98.8827 ++	(if_then_else (gt:CC (cc0)
 98.8828 ++			     (const_int 0))
 98.8829 ++		      (label_ref (match_operand 0 "" ""))
 98.8830 ++		      (pc)))]
 98.8831 ++  ""
 98.8832 ++{
 98.8833 ++  gen_int_relational (GT, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
 98.8834 ++  DONE;
 98.8835 ++})
 98.8836 ++
 98.8837 ++(define_expand "bge"
 98.8838 ++  [(set (pc)
 98.8839 ++	(if_then_else (ge:CC (cc0)
 98.8840 ++			     (const_int 0))
 98.8841 ++		      (label_ref (match_operand 0 "" ""))
 98.8842 ++		      (pc)))]
 98.8843 ++  ""
 98.8844 ++{
 98.8845 ++  gen_int_relational (GE, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
 98.8846 ++  DONE;
 98.8847 ++})
 98.8848 ++
 98.8849 ++(define_expand "ble"
 98.8850 ++  [(set (pc)
 98.8851 ++	(if_then_else (le:CC (cc0)
 98.8852 ++			     (const_int 0))
 98.8853 ++		      (label_ref (match_operand 0 "" ""))
 98.8854 ++		      (pc)))]
 98.8855 ++  ""
 98.8856 ++{
 98.8857 ++  gen_int_relational (LE, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
 98.8858 ++  DONE;
 98.8859 ++})
 98.8860 ++
 98.8861 ++(define_expand "blt"
 98.8862 ++  [(set (pc)
 98.8863 ++	(if_then_else (lt:CC (cc0)
 98.8864 ++			     (const_int 0))
 98.8865 ++		      (label_ref (match_operand 0 "" ""))
 98.8866 ++		      (pc)))]
 98.8867 ++  ""
 98.8868 ++{
 98.8869 ++  gen_int_relational (LT, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
 98.8870 ++  DONE;
 98.8871 ++})
 98.8872 ++
 98.8873 ++
 98.8874 ++(define_expand "bgtu"
 98.8875 ++  [(set (pc)
 98.8876 ++	(if_then_else (gtu:CC (cc0)
 98.8877 ++		 	      (const_int 0))
 98.8878 ++		      (label_ref (match_operand 0 "" ""))
 98.8879 ++		      (pc)))]
 98.8880 ++  ""
 98.8881 ++{
 98.8882 ++  gen_int_relational (GTU, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
 98.8883 ++  DONE;
 98.8884 ++})
 98.8885 ++
 98.8886 ++(define_expand "bgeu"
 98.8887 ++  [(set (pc)
 98.8888 ++	(if_then_else (geu:CC (cc0)
 98.8889 ++			      (const_int 0))
 98.8890 ++		      (label_ref (match_operand 0 "" ""))
 98.8891 ++		      (pc)))]
 98.8892 ++  ""
 98.8893 ++{
 98.8894 ++  gen_int_relational (GEU, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
 98.8895 ++  DONE;
 98.8896 ++})
 98.8897 ++
 98.8898 ++(define_expand "bleu"
 98.8899 ++  [(set (pc)
 98.8900 ++	(if_then_else (leu:CC (cc0)
 98.8901 ++			      (const_int 0))
 98.8902 ++		      (label_ref (match_operand 0 "" ""))
 98.8903 ++		      (pc)))]
 98.8904 ++  ""
 98.8905 ++{
 98.8906 ++  gen_int_relational (LEU, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
 98.8907 ++  DONE;
 98.8908 ++})
 98.8909 ++
 98.8910 ++(define_expand "bltu"
 98.8911 ++  [(set (pc)
 98.8912 ++	(if_then_else (ltu:CC (cc0)
 98.8913 ++			      (const_int 0))
 98.8914 ++		      (label_ref (match_operand 0 "" ""))
 98.8915 ++		      (pc)))]
 98.8916 ++  ""
 98.8917 ++{
 98.8918 ++  gen_int_relational (LTU, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
 98.8919 ++  DONE;
 98.8920 ++})
 98.8921 ++
 98.8922 ++
 98.8923 ++;*****************************************************************************
 98.8924 ++;*
 98.8925 ++;* String and Block Operations
 98.8926 ++;*
 98.8927 ++;*****************************************************************************
 98.8928 ++
 98.8929 ++; ??? This is all really a hack to get Dhrystone to work as fast as possible
 98.8930 ++;     things to be fixed:
 98.8931 ++;        * let the compiler core handle all of this, for that to work the extra
 98.8932 ++;          aliasing needs to be addressed.
 98.8933 ++;        * we use three temporary registers for loading and storing to ensure no
 98.8934 ++;          ld use stalls, this is excessive, because after the first ld/st only
 98.8935 ++;          two are needed. Only two would be needed all the way through if 
 98.8936 ++;          we could schedule with other code. Consider:
 98.8937 ++;           1  ld $1, 0($src)
 98.8938 ++;           2  ld $2, 4($src)
 98.8939 ++;           3  ld $3, 8($src)
 98.8940 ++;           4  st $1, 0($dest)
 98.8941 ++;           5  ld $1, 12($src)
 98.8942 ++;           6  st $2, 4($src)
 98.8943 ++;           7  etc.
 98.8944 ++;          The first store has to wait until 4. If it does not there will be one
 98.8945 ++;          cycle of stalling. However, if any other instruction could be placed
 98.8946 ++;          between 1 and 4, $3 would not be needed.
 98.8947 ++;        * In small we probably don't want to ever do this ourself because there
 98.8948 ++;          is no ld use stall.
 98.8949 ++
 98.8950 ++(define_expand "movstrsi"
 98.8951 ++  [(parallel [(set (match_operand:BLK 0 "general_operand"  "")
 98.8952 ++		   (match_operand:BLK 1 "general_operand"  ""))
 98.8953 ++	      (use (match_operand:SI 2 "const_int_operand" ""))
 98.8954 ++	      (use (match_operand:SI 3 "const_int_operand" ""))
 98.8955 ++	      (clobber (match_scratch:SI 4                "=&r"))
 98.8956 ++	      (clobber (match_scratch:SI 5                "=&r"))
 98.8957 ++	      (clobber (match_scratch:SI 6                "=&r"))])]
 98.8958 ++  "TARGET_INLINE_MEMCPY"
 98.8959 ++{
 98.8960 ++  rtx ld_addr_reg, st_addr_reg;
 98.8961 ++
 98.8962 ++  /* If the predicate for op2 fails in expr.c:emit_block_move_via_movstr 
 98.8963 ++     it trys to copy to a register, but does not re-try the predicate.
 98.8964 ++     ??? Intead of fixing expr.c, I fix it here. */
 98.8965 ++  if (!const_int_operand (operands[2], SImode))
 98.8966 ++    FAIL;
 98.8967 ++
 98.8968 ++  /* ??? there are some magic numbers which need to be sorted out here.
 98.8969 ++         the basis for them is not increasing code size hugely or going
 98.8970 ++         out of range of offset addressing */
 98.8971 ++  if (INTVAL (operands[3]) < 4)
 98.8972 ++    FAIL;
 98.8973 ++  if (!optimize
 98.8974 ++      || (optimize_size && INTVAL (operands[2]) > 12)
 98.8975 ++      || (optimize < 3 && INTVAL (operands[2]) > 100)
 98.8976 ++      || INTVAL (operands[2]) > 200)
 98.8977 ++    FAIL;
 98.8978 ++
 98.8979 ++  st_addr_reg
 98.8980 ++    = replace_equiv_address (operands[0],
 98.8981 ++			     copy_to_mode_reg (Pmode, XEXP (operands[0], 0)));
 98.8982 ++  ld_addr_reg
 98.8983 ++    = replace_equiv_address (operands[1],
 98.8984 ++			     copy_to_mode_reg (Pmode, XEXP (operands[1], 0)));
 98.8985 ++  emit_insn (gen_movstrsi_internal (st_addr_reg, ld_addr_reg,
 98.8986 ++				    operands[2], operands[3]));
 98.8987 ++
 98.8988 ++  DONE;
 98.8989 ++})
 98.8990 ++
 98.8991 ++
 98.8992 ++(define_insn "movstrsi_internal"
 98.8993 ++  [(set (match_operand:BLK 0 "memory_operand"   "=o")
 98.8994 ++	(match_operand:BLK 1 "memory_operand"    "o"))
 98.8995 ++   (use (match_operand:SI 2 "const_int_operand"  "i"))
 98.8996 ++   (use (match_operand:SI 3 "const_int_operand"  "i"))
 98.8997 ++   (clobber (match_scratch:SI 4                "=&r"))
 98.8998 ++   (clobber (match_scratch:SI 5                "=&r"))
 98.8999 ++   (clobber (match_scratch:SI 6                "=&r"))]
 98.9000 ++  "TARGET_INLINE_MEMCPY"
 98.9001 ++{
 98.9002 ++  int ld_offset = INTVAL (operands[2]);
 98.9003 ++  int ld_len = INTVAL (operands[2]);
 98.9004 ++  int ld_reg = 0;
 98.9005 ++  rtx ld_addr_reg = XEXP (operands[1], 0);
 98.9006 ++  int st_offset = INTVAL (operands[2]);
 98.9007 ++  int st_len = INTVAL (operands[2]);
 98.9008 ++  int st_reg = 0;
 98.9009 ++  rtx st_addr_reg = XEXP (operands[0], 0);
 98.9010 ++  int delay_count = 0;
 98.9011 ++  
 98.9012 ++  /* ops[0] is the address used by the insn
 98.9013 ++     ops[1] is the register being loaded or stored */
 98.9014 ++  rtx ops[2];
 98.9015 ++  
 98.9016 ++  if (INTVAL (operands[3]) < 4)
 98.9017 ++    abort ();
 98.9018 ++  
 98.9019 ++  while (ld_offset >= 4)
 98.9020 ++    {
 98.9021 ++      /* if the load use delay has been met, I can start
 98.9022 ++         storing */
 98.9023 ++      if (delay_count >= 3)
 98.9024 ++        {
 98.9025 ++	  ops[0] = gen_rtx (MEM, SImode, 
 98.9026 ++			    plus_constant (st_addr_reg, st_len - st_offset));
 98.9027 ++	  ops[1] = operands[st_reg + 4];			 
 98.9028 ++	  output_asm_insn ("stw\t%1, %0", ops);
 98.9029 ++	  
 98.9030 ++	  st_reg = (st_reg + 1) % 3;
 98.9031 ++	  st_offset -= 4;
 98.9032 ++        }
 98.9033 ++    
 98.9034 ++      ops[0] = gen_rtx (MEM, SImode, 
 98.9035 ++			plus_constant (ld_addr_reg, ld_len - ld_offset));
 98.9036 ++      ops[1] = operands[ld_reg + 4];			 
 98.9037 ++      output_asm_insn ("ldw\t%1, %0", ops);
 98.9038 ++      
 98.9039 ++      ld_reg = (ld_reg + 1) % 3;
 98.9040 ++      ld_offset -= 4;
 98.9041 ++      delay_count++;
 98.9042 ++    }
 98.9043 ++  
 98.9044 ++  if (ld_offset >= 2)
 98.9045 ++    {
 98.9046 ++      /* if the load use delay has been met, I can start
 98.9047 ++         storing */
 98.9048 ++      if (delay_count >= 3)
 98.9049 ++        {
 98.9050 ++	  ops[0] = gen_rtx (MEM, SImode, 
 98.9051 ++			    plus_constant (st_addr_reg, st_len - st_offset));
 98.9052 ++	  ops[1] = operands[st_reg + 4];			 
 98.9053 ++	  output_asm_insn ("stw\t%1, %0", ops);
 98.9054 ++	  
 98.9055 ++	  st_reg = (st_reg + 1) % 3;
 98.9056 ++	  st_offset -= 4;
 98.9057 ++        }
 98.9058 ++    
 98.9059 ++      ops[0] = gen_rtx (MEM, HImode, 
 98.9060 ++			plus_constant (ld_addr_reg, ld_len - ld_offset));
 98.9061 ++      ops[1] = operands[ld_reg + 4];			 
 98.9062 ++      output_asm_insn ("ldh\t%1, %0", ops);
 98.9063 ++      
 98.9064 ++      ld_reg = (ld_reg + 1) % 3;
 98.9065 ++      ld_offset -= 2;
 98.9066 ++      delay_count++;
 98.9067 ++    }
 98.9068 ++  
 98.9069 ++  if (ld_offset >= 1)
 98.9070 ++    {
 98.9071 ++      /* if the load use delay has been met, I can start
 98.9072 ++         storing */
 98.9073 ++      if (delay_count >= 3)
 98.9074 ++        {
 98.9075 ++	  ops[0] = gen_rtx (MEM, SImode, 
 98.9076 ++			    plus_constant (st_addr_reg, st_len - st_offset));
 98.9077 ++	  ops[1] = operands[st_reg + 4];			 
 98.9078 ++	  output_asm_insn ("stw\t%1, %0", ops);
 98.9079 ++	  
 98.9080 ++	  st_reg = (st_reg + 1) % 3;
 98.9081 ++	  st_offset -= 4;
 98.9082 ++        }
 98.9083 ++    
 98.9084 ++      ops[0] = gen_rtx (MEM, QImode, 
 98.9085 ++			plus_constant (ld_addr_reg, ld_len - ld_offset));
 98.9086 ++      ops[1] = operands[ld_reg + 4];			 
 98.9087 ++      output_asm_insn ("ldb\t%1, %0", ops);
 98.9088 ++      
 98.9089 ++      ld_reg = (ld_reg + 1) % 3;
 98.9090 ++      ld_offset -= 1;
 98.9091 ++      delay_count++;
 98.9092 ++    }
 98.9093 ++
 98.9094 ++    while (st_offset >= 4)
 98.9095 ++      {
 98.9096 ++	ops[0] = gen_rtx (MEM, SImode, 
 98.9097 ++			  plus_constant (st_addr_reg, st_len - st_offset));
 98.9098 ++	ops[1] = operands[st_reg + 4];			 
 98.9099 ++	output_asm_insn ("stw\t%1, %0", ops);
 98.9100 ++
 98.9101 ++	st_reg = (st_reg + 1) % 3;
 98.9102 ++	st_offset -= 4;
 98.9103 ++      }
 98.9104 ++  
 98.9105 ++    while (st_offset >= 2)
 98.9106 ++      {
 98.9107 ++	ops[0] = gen_rtx (MEM, HImode, 
 98.9108 ++			  plus_constant (st_addr_reg, st_len - st_offset));
 98.9109 ++	ops[1] = operands[st_reg + 4];			 
 98.9110 ++	output_asm_insn ("sth\t%1, %0", ops);
 98.9111 ++
 98.9112 ++	st_reg = (st_reg + 1) % 3;
 98.9113 ++	st_offset -= 2;
 98.9114 ++      }
 98.9115 ++  
 98.9116 ++    while (st_offset >= 1)
 98.9117 ++      {
 98.9118 ++	ops[0] = gen_rtx (MEM, QImode, 
 98.9119 ++			  plus_constant (st_addr_reg, st_len - st_offset));
 98.9120 ++	ops[1] = operands[st_reg + 4];			 
 98.9121 ++	output_asm_insn ("stb\t%1, %0", ops);
 98.9122 ++
 98.9123 ++	st_reg = (st_reg + 1) % 3;
 98.9124 ++	st_offset -= 1;
 98.9125 ++      }
 98.9126 ++  
 98.9127 ++  return "";
 98.9128 ++}
 98.9129 ++; ??? lengths are not being used yet, but I will probably forget
 98.9130 ++; to update this once I am using lengths, so set it to something
 98.9131 ++; definetely big enough to cover it. 400 allows for 200 bytes
 98.9132 ++; of motion.
 98.9133 ++  [(set_attr "length" "400")])
 98.9134 ++
 98.9135 ++
 98.9136 ++
 98.9137 ++;*****************************************************************************
 98.9138 ++;*
 98.9139 ++;* Custom instructions
 98.9140 ++;*
 98.9141 ++;*****************************************************************************
 98.9142 ++
 98.9143 ++(define_constants [
 98.9144 ++  (CUSTOM_N 100)
 98.9145 ++  (CUSTOM_NI 101)
 98.9146 ++  (CUSTOM_NF 102)
 98.9147 ++  (CUSTOM_NP 103)
 98.9148 ++  (CUSTOM_NII 104)
 98.9149 ++  (CUSTOM_NIF 105)
 98.9150 ++  (CUSTOM_NIP 106)
 98.9151 ++  (CUSTOM_NFI 107)
 98.9152 ++  (CUSTOM_NFF 108)
 98.9153 ++  (CUSTOM_NFP 109)
 98.9154 ++  (CUSTOM_NPI 110)
 98.9155 ++  (CUSTOM_NPF 111)
 98.9156 ++  (CUSTOM_NPP 112)
 98.9157 ++  (CUSTOM_IN 113)
 98.9158 ++  (CUSTOM_INI 114)
 98.9159 ++  (CUSTOM_INF 115)
 98.9160 ++  (CUSTOM_INP 116)
 98.9161 ++  (CUSTOM_INII 117)
 98.9162 ++  (CUSTOM_INIF 118)
 98.9163 ++  (CUSTOM_INIP 119)
 98.9164 ++  (CUSTOM_INFI 120)
 98.9165 ++  (CUSTOM_INFF 121)
 98.9166 ++  (CUSTOM_INFP 122)
 98.9167 ++  (CUSTOM_INPI 123)
 98.9168 ++  (CUSTOM_INPF 124)
 98.9169 ++  (CUSTOM_INPP 125)
 98.9170 ++  (CUSTOM_FN 126)
 98.9171 ++  (CUSTOM_FNI 127)
 98.9172 ++  (CUSTOM_FNF 128)
 98.9173 ++  (CUSTOM_FNP 129)
 98.9174 ++  (CUSTOM_FNII 130)
 98.9175 ++  (CUSTOM_FNIF 131)
 98.9176 ++  (CUSTOM_FNIP 132)
 98.9177 ++  (CUSTOM_FNFI 133)
 98.9178 ++  (CUSTOM_FNFF 134)
 98.9179 ++  (CUSTOM_FNFP 135)
 98.9180 ++  (CUSTOM_FNPI 136)
 98.9181 ++  (CUSTOM_FNPF 137)
 98.9182 ++  (CUSTOM_FNPP 138)
 98.9183 ++  (CUSTOM_PN 139)
 98.9184 ++  (CUSTOM_PNI 140)
 98.9185 ++  (CUSTOM_PNF 141)
 98.9186 ++  (CUSTOM_PNP 142)
 98.9187 ++  (CUSTOM_PNII 143)
 98.9188 ++  (CUSTOM_PNIF 144)
 98.9189 ++  (CUSTOM_PNIP 145)
 98.9190 ++  (CUSTOM_PNFI 146)
 98.9191 ++  (CUSTOM_PNFF 147)
 98.9192 ++  (CUSTOM_PNFP 148)
 98.9193 ++  (CUSTOM_PNPI 149)
 98.9194 ++  (CUSTOM_PNPF 150)
 98.9195 ++  (CUSTOM_PNPP 151)
 98.9196 ++])
 98.9197 ++
 98.9198 ++
 98.9199 ++(define_insn "custom_n"
 98.9200 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")] CUSTOM_N)]
 98.9201 ++  ""
 98.9202 ++  "custom\\t%0, zero, zero, zero"
 98.9203 ++  [(set_attr "type" "custom")])
 98.9204 ++
 98.9205 ++(define_insn "custom_ni"
 98.9206 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9207 ++                     (match_operand:SI 1 "register_operand"   "r")] CUSTOM_NI)]
 98.9208 ++  ""
 98.9209 ++  "custom\\t%0, zero, %1, zero"
 98.9210 ++  [(set_attr "type" "custom")])
 98.9211 ++
 98.9212 ++(define_insn "custom_nf"
 98.9213 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9214 ++                     (match_operand:SF 1 "register_operand"   "r")] CUSTOM_NF)]
 98.9215 ++  ""
 98.9216 ++  "custom\\t%0, zero, %1, zero"
 98.9217 ++  [(set_attr "type" "custom")])
 98.9218 ++
 98.9219 ++(define_insn "custom_np"
 98.9220 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9221 ++                     (match_operand:SI 1 "register_operand"   "r")] CUSTOM_NP)]
 98.9222 ++  ""
 98.9223 ++  "custom\\t%0, zero, %1, zero"
 98.9224 ++  [(set_attr "type" "custom")])
 98.9225 ++
 98.9226 ++(define_insn "custom_nii"
 98.9227 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9228 ++                     (match_operand:SI 1 "register_operand"   "r")
 98.9229 ++                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NII)]
 98.9230 ++  ""
 98.9231 ++  "custom\\t%0, zero, %1, %2"
 98.9232 ++  [(set_attr "type" "custom")])
 98.9233 ++
 98.9234 ++(define_insn "custom_nif"
 98.9235 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9236 ++                     (match_operand:SI 1 "register_operand"   "r")
 98.9237 ++                     (match_operand:SF 2 "register_operand"   "r")] CUSTOM_NIF)]
 98.9238 ++  ""
 98.9239 ++  "custom\\t%0, zero, %1, %2"
 98.9240 ++  [(set_attr "type" "custom")])
 98.9241 ++
 98.9242 ++(define_insn "custom_nip"
 98.9243 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9244 ++                     (match_operand:SI 1 "register_operand"   "r")
 98.9245 ++                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NIP)]
 98.9246 ++  ""
 98.9247 ++  "custom\\t%0, zero, %1, %2"
 98.9248 ++  [(set_attr "type" "custom")])
 98.9249 ++
 98.9250 ++(define_insn "custom_nfi"
 98.9251 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9252 ++                     (match_operand:SF 1 "register_operand"   "r")
 98.9253 ++                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NFI)]
 98.9254 ++  ""
 98.9255 ++  "custom\\t%0, zero, %1, %2"
 98.9256 ++  [(set_attr "type" "custom")])
 98.9257 ++
 98.9258 ++(define_insn "custom_nff"
 98.9259 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9260 ++                     (match_operand:SF 1 "register_operand"   "r")
 98.9261 ++                     (match_operand:SF 2 "register_operand"   "r")] CUSTOM_NFF)]
 98.9262 ++  ""
 98.9263 ++  "custom\\t%0, zero, %1, %2"
 98.9264 ++  [(set_attr "type" "custom")])
 98.9265 ++
 98.9266 ++(define_insn "custom_nfp"
 98.9267 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9268 ++                     (match_operand:SF 1 "register_operand"   "r")
 98.9269 ++                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NFP)]
 98.9270 ++  ""
 98.9271 ++  "custom\\t%0, zero, %1, %2"
 98.9272 ++  [(set_attr "type" "custom")])
 98.9273 ++
 98.9274 ++(define_insn "custom_npi"
 98.9275 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9276 ++                     (match_operand:SI 1 "register_operand"   "r")
 98.9277 ++                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NPI)]
 98.9278 ++  ""
 98.9279 ++  "custom\\t%0, zero, %1, %2"
 98.9280 ++  [(set_attr "type" "custom")])
 98.9281 ++
 98.9282 ++(define_insn "custom_npf"
 98.9283 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9284 ++                     (match_operand:SI 1 "register_operand"   "r")
 98.9285 ++                     (match_operand:SF 2 "register_operand"   "r")] CUSTOM_NPF)]
 98.9286 ++  ""
 98.9287 ++  "custom\\t%0, zero, %1, %2"
 98.9288 ++  [(set_attr "type" "custom")])
 98.9289 ++
 98.9290 ++(define_insn "custom_npp"
 98.9291 ++  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
 98.9292 ++                     (match_operand:SI 1 "register_operand"   "r")
 98.9293 ++                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NPP)]
 98.9294 ++  ""
 98.9295 ++  "custom\\t%0, zero, %1, %2"
 98.9296 ++  [(set_attr "type" "custom")])
 98.9297 ++
 98.9298 ++
 98.9299 ++
 98.9300 ++(define_insn "custom_in"
 98.9301 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9302 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")] CUSTOM_IN))]
 98.9303 ++  ""
 98.9304 ++  "custom\\t%1, %0, zero, zero"
 98.9305 ++  [(set_attr "type" "custom")])
 98.9306 ++
 98.9307 ++(define_insn "custom_ini"
 98.9308 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9309 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9310 ++                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_INI))]
 98.9311 ++  ""
 98.9312 ++  "custom\\t%1, %0, %2, zero"
 98.9313 ++  [(set_attr "type" "custom")])
 98.9314 ++
 98.9315 ++(define_insn "custom_inf"
 98.9316 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9317 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9318 ++                          (match_operand:SF 2 "register_operand"   "r")] CUSTOM_INF))]
 98.9319 ++  ""
 98.9320 ++  "custom\\t%1, %0, %2, zero"
 98.9321 ++  [(set_attr "type" "custom")])
 98.9322 ++
 98.9323 ++(define_insn "custom_inp"
 98.9324 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9325 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9326 ++                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_INP))]
 98.9327 ++  ""
 98.9328 ++  "custom\\t%1, %0, %2, zero"
 98.9329 ++  [(set_attr "type" "custom")])
 98.9330 ++
 98.9331 ++(define_insn "custom_inii"
 98.9332 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9333 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9334 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9335 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INII))]
 98.9336 ++  ""
 98.9337 ++  "custom\\t%1, %0, %2, %3"
 98.9338 ++  [(set_attr "type" "custom")])
 98.9339 ++
 98.9340 ++(define_insn "custom_inif"
 98.9341 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9342 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9343 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9344 ++                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_INIF))]
 98.9345 ++  ""
 98.9346 ++  "custom\\t%1, %0, %2, %3"
 98.9347 ++  [(set_attr "type" "custom")])
 98.9348 ++
 98.9349 ++(define_insn "custom_inip"
 98.9350 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9351 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9352 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9353 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INIP))]
 98.9354 ++  ""
 98.9355 ++  "custom\\t%1, %0, %2, %3"
 98.9356 ++  [(set_attr "type" "custom")])
 98.9357 ++
 98.9358 ++(define_insn "custom_infi"
 98.9359 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9360 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9361 ++                          (match_operand:SF 2 "register_operand"   "r")
 98.9362 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INFI))]
 98.9363 ++  ""
 98.9364 ++  "custom\\t%1, %0, %2, %3"
 98.9365 ++  [(set_attr "type" "custom")])
 98.9366 ++
 98.9367 ++(define_insn "custom_inff"
 98.9368 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9369 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9370 ++                          (match_operand:SF 2 "register_operand"   "r")
 98.9371 ++                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_INFF))]
 98.9372 ++  ""
 98.9373 ++  "custom\\t%1, %0, %2, %3"
 98.9374 ++  [(set_attr "type" "custom")])
 98.9375 ++
 98.9376 ++(define_insn "custom_infp"
 98.9377 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9378 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9379 ++                          (match_operand:SF 2 "register_operand"   "r")
 98.9380 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INFP))]
 98.9381 ++  ""
 98.9382 ++  "custom\\t%1, %0, %2, %3"
 98.9383 ++  [(set_attr "type" "custom")])
 98.9384 ++
 98.9385 ++(define_insn "custom_inpi"
 98.9386 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9387 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9388 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9389 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INPI))]
 98.9390 ++  ""
 98.9391 ++  "custom\\t%1, %0, %2, %3"
 98.9392 ++  [(set_attr "type" "custom")])
 98.9393 ++
 98.9394 ++(define_insn "custom_inpf"
 98.9395 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9396 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9397 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9398 ++                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_INPF))]
 98.9399 ++  ""
 98.9400 ++  "custom\\t%1, %0, %2, %3"
 98.9401 ++  [(set_attr "type" "custom")])
 98.9402 ++
 98.9403 ++(define_insn "custom_inpp"
 98.9404 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9405 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9406 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9407 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INPP))]
 98.9408 ++  ""
 98.9409 ++  "custom\\t%1, %0, %2, %3"
 98.9410 ++  [(set_attr "type" "custom")])
 98.9411 ++
 98.9412 ++
 98.9413 ++
 98.9414 ++
 98.9415 ++
 98.9416 ++(define_insn "custom_fn"
 98.9417 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9418 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")] CUSTOM_FN))]
 98.9419 ++  ""
 98.9420 ++  "custom\\t%1, %0, zero, zero"
 98.9421 ++  [(set_attr "type" "custom")])
 98.9422 ++
 98.9423 ++(define_insn "custom_fni"
 98.9424 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9425 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9426 ++                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_FNI))]
 98.9427 ++  ""
 98.9428 ++  "custom\\t%1, %0, %2, zero"
 98.9429 ++  [(set_attr "type" "custom")])
 98.9430 ++
 98.9431 ++(define_insn "custom_fnf"
 98.9432 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9433 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9434 ++                          (match_operand:SF 2 "register_operand"   "r")] CUSTOM_FNF))]
 98.9435 ++  ""
 98.9436 ++  "custom\\t%1, %0, %2, zero"
 98.9437 ++  [(set_attr "type" "custom")])
 98.9438 ++
 98.9439 ++(define_insn "custom_fnp"
 98.9440 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9441 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9442 ++                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_FNP))]
 98.9443 ++  ""
 98.9444 ++  "custom\\t%1, %0, %2, zero"
 98.9445 ++  [(set_attr "type" "custom")])
 98.9446 ++
 98.9447 ++(define_insn "custom_fnii"
 98.9448 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9449 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9450 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9451 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNII))]
 98.9452 ++  ""
 98.9453 ++  "custom\\t%1, %0, %2, %3"
 98.9454 ++  [(set_attr "type" "custom")])
 98.9455 ++
 98.9456 ++(define_insn "custom_fnif"
 98.9457 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9458 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9459 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9460 ++                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_FNIF))]
 98.9461 ++  ""
 98.9462 ++  "custom\\t%1, %0, %2, %3"
 98.9463 ++  [(set_attr "type" "custom")])
 98.9464 ++
 98.9465 ++(define_insn "custom_fnip"
 98.9466 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9467 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9468 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9469 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNIP))]
 98.9470 ++  ""
 98.9471 ++  "custom\\t%1, %0, %2, %3"
 98.9472 ++  [(set_attr "type" "custom")])
 98.9473 ++
 98.9474 ++(define_insn "custom_fnfi"
 98.9475 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9476 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9477 ++                          (match_operand:SF 2 "register_operand"   "r")
 98.9478 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNFI))]
 98.9479 ++  ""
 98.9480 ++  "custom\\t%1, %0, %2, %3"
 98.9481 ++  [(set_attr "type" "custom")])
 98.9482 ++
 98.9483 ++(define_insn "custom_fnff"
 98.9484 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9485 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9486 ++                          (match_operand:SF 2 "register_operand"   "r")
 98.9487 ++                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_FNFF))]
 98.9488 ++  ""
 98.9489 ++  "custom\\t%1, %0, %2, %3"
 98.9490 ++  [(set_attr "type" "custom")])
 98.9491 ++
 98.9492 ++(define_insn "custom_fnfp"
 98.9493 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9494 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9495 ++                          (match_operand:SF 2 "register_operand"   "r")
 98.9496 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNFP))]
 98.9497 ++  ""
 98.9498 ++  "custom\\t%1, %0, %2, %3"
 98.9499 ++  [(set_attr "type" "custom")])
 98.9500 ++
 98.9501 ++(define_insn "custom_fnpi"
 98.9502 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9503 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9504 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9505 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNPI))]
 98.9506 ++  ""
 98.9507 ++  "custom\\t%1, %0, %2, %3"
 98.9508 ++  [(set_attr "type" "custom")])
 98.9509 ++
 98.9510 ++(define_insn "custom_fnpf"
 98.9511 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9512 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9513 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9514 ++                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_FNPF))]
 98.9515 ++  ""
 98.9516 ++  "custom\\t%1, %0, %2, %3"
 98.9517 ++  [(set_attr "type" "custom")])
 98.9518 ++
 98.9519 ++(define_insn "custom_fnpp"
 98.9520 ++  [(set (match_operand:SF 0 "register_operand"   "=r")
 98.9521 ++        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9522 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9523 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNPP))]
 98.9524 ++  ""
 98.9525 ++  "custom\\t%1, %0, %2, %3"
 98.9526 ++  [(set_attr "type" "custom")])
 98.9527 ++
 98.9528 ++
 98.9529 ++
 98.9530 ++(define_insn "custom_pn"
 98.9531 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9532 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")] CUSTOM_PN))]
 98.9533 ++  ""
 98.9534 ++  "custom\\t%1, %0, zero, zero"
 98.9535 ++  [(set_attr "type" "custom")])
 98.9536 ++
 98.9537 ++(define_insn "custom_pni"
 98.9538 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9539 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9540 ++                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_PNI))]
 98.9541 ++  ""
 98.9542 ++  "custom\\t%1, %0, %2, zero"
 98.9543 ++  [(set_attr "type" "custom")])
 98.9544 ++
 98.9545 ++(define_insn "custom_pnf"
 98.9546 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9547 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9548 ++                          (match_operand:SF 2 "register_operand"   "r")] CUSTOM_PNF))]
 98.9549 ++  ""
 98.9550 ++  "custom\\t%1, %0, %2, zero"
 98.9551 ++  [(set_attr "type" "custom")])
 98.9552 ++
 98.9553 ++(define_insn "custom_pnp"
 98.9554 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9555 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9556 ++                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_PNP))]
 98.9557 ++  ""
 98.9558 ++  "custom\\t%1, %0, %2, zero"
 98.9559 ++  [(set_attr "type" "custom")])
 98.9560 ++
 98.9561 ++(define_insn "custom_pnii"
 98.9562 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9563 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9564 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9565 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNII))]
 98.9566 ++  ""
 98.9567 ++  "custom\\t%1, %0, %2, %3"
 98.9568 ++  [(set_attr "type" "custom")])
 98.9569 ++
 98.9570 ++(define_insn "custom_pnif"
 98.9571 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9572 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9573 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9574 ++                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_PNIF))]
 98.9575 ++  ""
 98.9576 ++  "custom\\t%1, %0, %2, %3"
 98.9577 ++  [(set_attr "type" "custom")])
 98.9578 ++
 98.9579 ++(define_insn "custom_pnip"
 98.9580 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9581 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9582 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9583 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNIP))]
 98.9584 ++  ""
 98.9585 ++  "custom\\t%1, %0, %2, %3"
 98.9586 ++  [(set_attr "type" "custom")])
 98.9587 ++
 98.9588 ++(define_insn "custom_pnfi"
 98.9589 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9590 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9591 ++                          (match_operand:SF 2 "register_operand"   "r")
 98.9592 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNFI))]
 98.9593 ++  ""
 98.9594 ++  "custom\\t%1, %0, %2, %3"
 98.9595 ++  [(set_attr "type" "custom")])
 98.9596 ++
 98.9597 ++(define_insn "custom_pnff"
 98.9598 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9599 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9600 ++                          (match_operand:SF 2 "register_operand"   "r")
 98.9601 ++                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_PNFF))]
 98.9602 ++  ""
 98.9603 ++  "custom\\t%1, %0, %2, %3"
 98.9604 ++  [(set_attr "type" "custom")])
 98.9605 ++
 98.9606 ++(define_insn "custom_pnfp"
 98.9607 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9608 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9609 ++                          (match_operand:SF 2 "register_operand"   "r")
 98.9610 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNFP))]
 98.9611 ++  ""
 98.9612 ++  "custom\\t%1, %0, %2, %3"
 98.9613 ++  [(set_attr "type" "custom")])
 98.9614 ++
 98.9615 ++(define_insn "custom_pnpi"
 98.9616 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9617 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9618 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9619 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNPI))]
 98.9620 ++  ""
 98.9621 ++  "custom\\t%1, %0, %2, %3"
 98.9622 ++  [(set_attr "type" "custom")])
 98.9623 ++
 98.9624 ++(define_insn "custom_pnpf"
 98.9625 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9626 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9627 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9628 ++                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_PNPF))]
 98.9629 ++  ""
 98.9630 ++  "custom\\t%1, %0, %2, %3"
 98.9631 ++  [(set_attr "type" "custom")])
 98.9632 ++
 98.9633 ++(define_insn "custom_pnpp"
 98.9634 ++  [(set (match_operand:SI 0 "register_operand"   "=r")
 98.9635 ++        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
 98.9636 ++                          (match_operand:SI 2 "register_operand"   "r")
 98.9637 ++                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNPP))]
 98.9638 ++  ""
 98.9639 ++  "custom\\t%1, %0, %2, %3"
 98.9640 ++  [(set_attr "type" "custom")])
 98.9641 ++
 98.9642 ++
 98.9643 ++
 98.9644 ++
 98.9645 ++
 98.9646 ++
 98.9647 ++;*****************************************************************************
 98.9648 ++;*
 98.9649 ++;* Misc
 98.9650 ++;*
 98.9651 ++;*****************************************************************************
 98.9652 ++
 98.9653 ++(define_insn "nop"
 98.9654 ++  [(const_int 0)]
 98.9655 ++  ""
 98.9656 ++  "nop\\t"
 98.9657 ++  [(set_attr "type" "alu")])
 98.9658 ++
 98.9659 ++(define_insn "sync"
 98.9660 ++  [(unspec_volatile [(const_int 0)] UNSPEC_SYNC)]
 98.9661 ++  ""
 98.9662 ++  "sync\\t"
 98.9663 ++  [(set_attr "type" "control")])
 98.9664 ++
 98.9665 ++
 98.9666 ++(define_insn "rdctl"
 98.9667 ++  [(set (match_operand:SI 0 "register_operand" "=r")
 98.9668 ++	(unspec_volatile:SI [(match_operand:SI 1 "rdwrctl_operand" "O")] UNSPEC_RDCTL))]
 98.9669 ++  ""
 98.9670 ++  "rdctl\\t%0, ctl%1"
 98.9671 ++  [(set_attr "type" "control")])
 98.9672 ++
 98.9673 ++(define_insn "wrctl"
 98.9674 ++  [(unspec_volatile:SI [(match_operand:SI 0 "rdwrctl_operand"  "O")
 98.9675 ++                        (match_operand:SI 1 "register_operand" "r")] UNSPEC_WRCTL)]
 98.9676 ++  ""
 98.9677 ++  "wrctl\\tctl%0, %1"
 98.9678 ++  [(set_attr "type" "control")])
 98.9679 ++
 98.9680 ++
 98.9681 ++
 98.9682 ++;*****************************************************************************
 98.9683 ++;*
 98.9684 ++;* Peepholes
 98.9685 ++;*
 98.9686 ++;*****************************************************************************
 98.9687 ++
 98.9688 ++
 98.9689 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2-protos.h gcc-3.4.6/gcc/config/nios2/nios2-protos.h
 98.9690 +--- gcc-3.4.6.orig/gcc/config/nios2/nios2-protos.h	1970-01-01 01:00:00.000000000 +0100
 98.9691 ++++ gcc-3.4.6/gcc/config/nios2/nios2-protos.h	2007-08-15 23:09:36.000000000 +0200
 98.9692 +@@ -0,0 +1,70 @@
 98.9693 ++/* Subroutines for assembler code output for Altera NIOS 2G NIOS2 version.
 98.9694 ++   Copyright (C) 2003 Altera 
 98.9695 ++   Contributed by Jonah Graham (jgraham@altera.com).
 98.9696 ++
 98.9697 ++This file is part of GNU CC.
 98.9698 ++
 98.9699 ++GNU CC is free software; you can redistribute it and/or modify
 98.9700 ++it under the terms of the GNU General Public License as published by
 98.9701 ++the Free Software Foundation; either version 2, or (at your option)
 98.9702 ++any later version.
 98.9703 ++
 98.9704 ++GNU CC is distributed in the hope that it will be useful,
 98.9705 ++but WITHOUT ANY WARRANTY; without even the implied warranty of
 98.9706 ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 98.9707 ++GNU General Public License for more details.
 98.9708 ++
 98.9709 ++You should have received a copy of the GNU General Public License
 98.9710 ++along with GNU CC; see the file COPYING.  If not, write to
 98.9711 ++the Free Software Foundation, 59 Temple Place - Suite 330,
 98.9712 ++Boston, MA 02111-1307, USA.  */
 98.9713 ++
 98.9714 ++extern void dump_frame_size (FILE *);
 98.9715 ++extern HOST_WIDE_INT compute_frame_size (void);
 98.9716 ++extern int nios2_initial_elimination_offset (int, int);
 98.9717 ++extern void override_options (void);
 98.9718 ++extern void optimization_options (int, int);
 98.9719 ++extern int nios2_can_use_return_insn (void);
 98.9720 ++extern void expand_prologue (void);
 98.9721 ++extern void expand_epilogue (bool);
 98.9722 ++extern void function_profiler (FILE *, int);
 98.9723 ++
 98.9724 ++
 98.9725 ++#ifdef RTX_CODE
 98.9726 ++extern int nios2_legitimate_address (rtx, enum machine_mode, int);
 98.9727 ++extern void nios2_print_operand (FILE *, rtx, int);
 98.9728 ++extern void nios2_print_operand_address (FILE *, rtx);
 98.9729 ++
 98.9730 ++extern int nios2_emit_move_sequence (rtx *, enum machine_mode);
 98.9731 ++extern int nios2_emit_expensive_div (rtx *, enum machine_mode);
 98.9732 ++
 98.9733 ++extern void gen_int_relational (enum rtx_code, rtx, rtx, rtx, rtx);
 98.9734 ++extern void gen_conditional_move (rtx *, enum machine_mode);
 98.9735 ++extern const char *asm_output_opcode (FILE *, const char *);
 98.9736 ++
 98.9737 ++/* predicates */
 98.9738 ++extern int arith_operand (rtx, enum machine_mode);
 98.9739 ++extern int uns_arith_operand (rtx, enum machine_mode);
 98.9740 ++extern int logical_operand (rtx, enum machine_mode);
 98.9741 ++extern int shift_operand (rtx, enum machine_mode);
 98.9742 ++extern int reg_or_0_operand (rtx, enum machine_mode);
 98.9743 ++extern int equality_op (rtx, enum machine_mode);
 98.9744 ++extern int custom_insn_opcode (rtx, enum machine_mode);
 98.9745 ++extern int rdwrctl_operand (rtx, enum machine_mode);
 98.9746 ++
 98.9747 ++# ifdef HAVE_MACHINE_MODES
 98.9748 ++#  if defined TREE_CODE
 98.9749 ++extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
 98.9750 ++extern rtx function_arg (const CUMULATIVE_ARGS *, enum machine_mode, tree, int);
 98.9751 ++extern int function_arg_partial_nregs (const CUMULATIVE_ARGS *, enum machine_mode, tree, int);
 98.9752 ++extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, int);
 98.9753 ++extern int nios2_setup_incoming_varargs (const CUMULATIVE_ARGS *, enum machine_mode, tree, int);
 98.9754 ++
 98.9755 ++#  endif /* TREE_CODE */
 98.9756 ++# endif	/* HAVE_MACHINE_MODES */
 98.9757 ++#endif
 98.9758 ++
 98.9759 ++#ifdef TREE_CODE
 98.9760 ++extern int nios2_return_in_memory (tree);
 98.9761 ++
 98.9762 ++#endif /* TREE_CODE */
 98.9763 +diff -durN gcc-3.4.6.orig/gcc/config/nios2/t-nios2 gcc-3.4.6/gcc/config/nios2/t-nios2
 98.9764 +--- gcc-3.4.6.orig/gcc/config/nios2/t-nios2	1970-01-01 01:00:00.000000000 +0100
 98.9765 ++++ gcc-3.4.6/gcc/config/nios2/t-nios2	2007-08-15 23:09:36.000000000 +0200
 98.9766 +@@ -0,0 +1,123 @@
 98.9767 ++##
 98.9768 ++## Compiler flags to use when compiling libgcc2.c.
 98.9769 ++##
 98.9770 ++## LIB2FUNCS_EXTRA
 98.9771 ++## A list of source file names to be compiled or assembled and inserted into libgcc.a.
 98.9772 ++
 98.9773 ++LIB2FUNCS_EXTRA=$(srcdir)/config/nios2/lib2-divmod.c \
 98.9774 ++  $(srcdir)/config/nios2/lib2-divmod-hi.c \
 98.9775 ++  $(srcdir)/config/nios2/lib2-divtable.c \
 98.9776 ++  $(srcdir)/config/nios2/lib2-mul.c
 98.9777 ++
 98.9778 ++##
 98.9779 ++## Floating Point Emulation
 98.9780 ++## To have GCC include software floating point libraries in libgcc.a define FPBIT
 98.9781 ++## and DPBIT along with a few rules as follows:
 98.9782 ++##
 98.9783 ++## # We want fine grained libraries, so use the new code
 98.9784 ++## # to build the floating point emulation libraries.
 98.9785 ++FPBIT=$(srcdir)/config/nios2/nios2-fp-bit.c
 98.9786 ++DPBIT=$(srcdir)/config/nios2/nios2-dp-bit.c
 98.9787 ++
 98.9788 ++TARGET_LIBGCC2_CFLAGS = -O2
 98.9789 ++
 98.9790 ++# FLOAT_ONLY - no doubles
 98.9791 ++# SMALL_MACHINE - QI/HI is faster than SI
 98.9792 ++#     Actually SMALL_MACHINE uses chars and shorts instead of ints
 98.9793 ++#     since ints (16-bit ones as they are today) are at least as fast
 98.9794 ++#     as chars and shorts, don't define SMALL_MACHINE
 98.9795 ++# CMPtype - type returned by FP compare, i.e. INT (hard coded in fp-bit - see code )
 98.9796 ++
 98.9797 ++$(FPBIT): $(srcdir)/config/fp-bit.c Makefile
 98.9798 ++	echo '#define FLOAT'          >  ${FPBIT}
 98.9799 ++	cat $(srcdir)/config/fp-bit.c >> ${FPBIT}
 98.9800 ++
 98.9801 ++$(DPBIT): $(srcdir)/config/fp-bit.c Makefile
 98.9802 ++	echo ''          >  ${DPBIT}
 98.9803 ++	cat $(srcdir)/config/fp-bit.c >> ${DPBIT}
 98.9804 ++
 98.9805 ++EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o 
 98.9806 ++
 98.9807 ++# Assemble startup files. 
 98.9808 ++$(T)crti.o: $(srcdir)/config/nios2/crti.asm $(GCC_PASSES) 
 98.9809 ++	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
 98.9810 ++	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/nios2/crti.asm 
 98.9811 ++
 98.9812 ++$(T)crtn.o: $(srcdir)/config/nios2/crtn.asm $(GCC_PASSES) 
 98.9813 ++	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
 98.9814 ++	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/nios2/crtn.asm 
 98.9815 ++
 98.9816 ++
 98.9817 ++## You may need to provide additional #defines at the beginning of
 98.9818 ++## fp-bit.c and dp-bit.c to control target endianness and other options
 98.9819 ++##
 98.9820 ++## CRTSTUFF_T_CFLAGS
 98.9821 ++## Special flags used when compiling crtstuff.c.  See Initialization.
 98.9822 ++##
 98.9823 ++## CRTSTUFF_T_CFLAGS_S
 98.9824 ++## Special flags used when compiling crtstuff.c for shared linking.  Used
 98.9825 ++## if you use crtbeginS.o and crtendS.o in EXTRA-PARTS. See Initialization.
 98.9826 ++##
 98.9827 ++## MULTILIB_OPTIONS
 98.9828 ++## For some targets, invoking GCC in different ways produces objects that
 98.9829 ++## can not be linked together.  For example, for some targets GCC produces
 98.9830 ++## both big and little endian code.  For these targets, you must arrange
 98.9831 ++## for multiple versions of libgcc.a to be compiled, one for each set of
 98.9832 ++## incompatible options.  When GCC invokes the linker, it arranges to link
 98.9833 ++## in the right version of libgcc.a, based on the command line options
 98.9834 ++## used.
 98.9835 ++## The MULTILIB_OPTIONS macro lists the set of options for which special
 98.9836 ++## versions of libgcc.a must be built.  Write options that are mutually
 98.9837 ++## incompatible side by side, separated by a slash.  Write options that may
 98.9838 ++## be used together separated by a space.  The build procedure will build
 98.9839 ++## all combinations of compatible options.
 98.9840 ++##
 98.9841 ++## For example, if you set MULTILIB_OPTIONS to m68000/m68020 msoft-float,
 98.9842 ++## Makefile will build special versions of libgcc.a using the following
 98.9843 ++## sets of options: -m68000, -m68020, -msoft-float, -m68000 -msoft-float,
 98.9844 ++## and -m68020 -msoft-float.
 98.9845 ++
 98.9846 ++MULTILIB_OPTIONS = mno-hw-mul mhw-mulx
 98.9847 ++
 98.9848 ++## MULTILIB_DIRNAMES
 98.9849 ++## If MULTILIB_OPTIONS is used, this variable specifies the directory names
 98.9850 ++## that should be used to hold the various libraries.  Write one element in
 98.9851 ++## MULTILIB_DIRNAMES for each element in MULTILIB_OPTIONS. If
 98.9852 ++## MULTILIB_DIRNAMES is not used, the default value will be
 98.9853 ++## MULTILIB_OPTIONS, with all slashes treated as spaces.
 98.9854 ++## For example, if MULTILIB_OPTIONS is set to m68000/m68020 msoft-float,
 98.9855 ++## then the default value of MULTILIB_DIRNAMES is m68000 m68020
 98.9856 ++## msoft-float.  You may specify a different value if you desire a
 98.9857 ++## different set of directory names.
 98.9858 ++
 98.9859 ++# MULTILIB_DIRNAMES =
 98.9860 ++
 98.9861 ++## MULTILIB_MATCHES
 98.9862 ++## Sometimes the same option may be written in two different ways.  If an
 98.9863 ++## option is listed in MULTILIB_OPTIONS, GCC needs to know about any
 98.9864 ++## synonyms.  In that case, set MULTILIB_MATCHES to a list of items of the
 98.9865 ++## form option=option to describe all relevant synonyms.  For example,
 98.9866 ++## m68000=mc68000 m68020=mc68020.
 98.9867 ++##
 98.9868 ++## MULTILIB_EXCEPTIONS
 98.9869 ++## Sometimes when there are multiple sets of MULTILIB_OPTIONS being
 98.9870 ++## specified, there are combinations that should not be built.  In that
 98.9871 ++## case, set MULTILIB_EXCEPTIONS to be all of the switch exceptions in
 98.9872 ++## shell case syntax that should not be built.
 98.9873 ++## For example, in the PowerPC embedded ABI support, it is not desirable to
 98.9874 ++## build libraries compiled with the -mcall-aix option and either of the
 98.9875 ++## -fleading-underscore or -mlittle options at the same time.  Therefore
 98.9876 ++## MULTILIB_EXCEPTIONS is set to
 98.9877 ++##
 98.9878 ++## *mcall-aix/*fleading-underscore* *mlittle/*mcall-aix*
 98.9879 ++##
 98.9880 ++
 98.9881 ++MULTILIB_EXCEPTIONS = *mno-hw-mul/*mhw-mulx*
 98.9882 ++
 98.9883 ++##
 98.9884 ++## MULTILIB_EXTRA_OPTS Sometimes it is desirable that when building
 98.9885 ++## multiple versions of libgcc.a certain options should always be passed on
 98.9886 ++## to the compiler.  In that case, set MULTILIB_EXTRA_OPTS to be the list
 98.9887 ++## of options to be used for all builds.
 98.9888 ++##
 98.9889 ++
 98.9890 +diff -durN gcc-3.4.6.orig/gcc/config.gcc gcc-3.4.6/gcc/config.gcc
 98.9891 +--- gcc-3.4.6.orig/gcc/config.gcc	2007-08-15 23:07:00.000000000 +0200
 98.9892 ++++ gcc-3.4.6/gcc/config.gcc	2007-08-15 23:09:36.000000000 +0200
 98.9893 +@@ -1342,6 +1342,10 @@
 98.9894 + 		thread_file='posix'
 98.9895 + 	fi
 98.9896 + 	;;
 98.9897 ++# JBG
 98.9898 ++nios2-*-* | nios2-*-*)
 98.9899 ++	tm_file="elfos.h ${tm_file}"
 98.9900 ++	;;
 98.9901 + # m68hc11 and m68hc12 share the same machine description.
 98.9902 + m68hc11-*-*|m6811-*-*)
 98.9903 + 	tm_file="dbxelf.h elfos.h m68hc11/m68hc11.h"
 98.9904 +diff -durN gcc-3.4.6.orig/gcc/cse.c gcc-3.4.6/gcc/cse.c
 98.9905 +--- gcc-3.4.6.orig/gcc/cse.c	2005-12-31 01:39:42.000000000 +0100
 98.9906 ++++ gcc-3.4.6/gcc/cse.c	2007-08-15 23:09:36.000000000 +0200
 98.9907 +@@ -3134,6 +3134,10 @@
 98.9908 + #ifdef FLOAT_STORE_FLAG_VALUE
 98.9909 + 	  REAL_VALUE_TYPE fsfv;
 98.9910 + #endif
 98.9911 ++#ifdef __nios2__
 98.9912 ++	  if (p->is_const)
 98.9913 ++	    break;
 98.9914 ++#endif
 98.9915 + 
 98.9916 + 	  /* If the entry isn't valid, skip it.  */
 98.9917 + 	  if (! exp_equiv_p (p->exp, p->exp, 1, 0))
 98.9918 +diff -durN gcc-3.4.6.orig/gcc/doc/extend.texi gcc-3.4.6/gcc/doc/extend.texi
 98.9919 +--- gcc-3.4.6.orig/gcc/doc/extend.texi	2005-02-26 23:17:26.000000000 +0100
 98.9920 ++++ gcc-3.4.6/gcc/doc/extend.texi	2007-08-15 23:09:36.000000000 +0200
 98.9921 +@@ -5638,12 +5638,118 @@
 98.9922 + instructions, but allow the compiler to schedule those calls.
 98.9923 + 
 98.9924 + @menu
 98.9925 ++* Altera Nios II Built-in Functions::
 98.9926 + * Alpha Built-in Functions::
 98.9927 + * ARM Built-in Functions::
 98.9928 + * X86 Built-in Functions::
 98.9929 + * PowerPC AltiVec Built-in Functions::
 98.9930 + @end menu
 98.9931 + 
 98.9932 ++@node Altera Nios II Built-in Functions
 98.9933 ++@subsection Altera Nios II Built-in Functions
 98.9934 ++
 98.9935 ++These built-in functions are available for the Altera Nios II
 98.9936 ++family of processors.
 98.9937 ++
 98.9938 ++The following built-in functions are always available.  They
 98.9939 ++all generate the machine instruction that is part of the name.
 98.9940 ++
 98.9941 ++@example
 98.9942 ++int __builtin_ldbio (volatile const void *)
 98.9943 ++int __builtin_ldbuio (volatile const void *)
 98.9944 ++int __builtin_ldhio (volatile const void *)
 98.9945 ++int __builtin_ldhuio (volatile const void *)
 98.9946 ++int __builtin_ldwio (volatile const void *)
 98.9947 ++void __builtin_stbio (volatile void *, int)
 98.9948 ++void __builtin_sthio (volatile void *, int)
 98.9949 ++void __builtin_stwio (volatile void *, int)
 98.9950 ++void __builtin_sync (void)
 98.9951 ++int __builtin_rdctl (int) 
 98.9952 ++void __builtin_wrctl (int, int)
 98.9953 ++@end example
 98.9954 ++
 98.9955 ++The following built-in functions are always available.  They
 98.9956 ++all generate a Nios II Custom Instruction. The name of the 
 98.9957 ++function represents the types that the function takes and 
 98.9958 ++returns. The letter before the @code{n} is the return type
 98.9959 ++or void if absent. The @code{n} represnts the first parameter
 98.9960 ++to all the custom instructions, the custom instruction number.
 98.9961 ++The two letters after the @code{n} represent the up to two 
 98.9962 ++parameters to the function.
 98.9963 ++
 98.9964 ++The letters reprsent the following data types:
 98.9965 ++@table @code
 98.9966 ++@item <no letter>
 98.9967 ++@code{void} for return type and no parameter for parameter types.
 98.9968 ++
 98.9969 ++@item i
 98.9970 ++@code{int} for return type and parameter type
 98.9971 ++
 98.9972 ++@item f
 98.9973 ++@code{float} for return type and parameter type
 98.9974 ++
 98.9975 ++@item p
 98.9976 ++@code{void *} for return type and parameter type
 98.9977 ++
 98.9978 ++@end table
 98.9979 ++
 98.9980 ++And the function names are:
 98.9981 ++@example
 98.9982 ++void __builtin_custom_n (void)
 98.9983 ++void __builtin_custom_ni (int)
 98.9984 ++void __builtin_custom_nf (float)
 98.9985 ++void __builtin_custom_np (void *)
 98.9986 ++void __builtin_custom_nii (int, int)
 98.9987 ++void __builtin_custom_nif (int, float)
 98.9988 ++void __builtin_custom_nip (int, void *)
 98.9989 ++void __builtin_custom_nfi (float, int)
 98.9990 ++void __builtin_custom_nff (float, float)
 98.9991 ++void __builtin_custom_nfp (float, void *)
 98.9992 ++void __builtin_custom_npi (void *, int)
 98.9993 ++void __builtin_custom_npf (void *, float)
 98.9994 ++void __builtin_custom_npp (void *, void *)
 98.9995 ++int __builtin_custom_in (void)
 98.9996 ++int __builtin_custom_ini (int)
 98.9997 ++int __builtin_custom_inf (float)
 98.9998 ++int __builtin_custom_inp (void *)
 98.9999 ++int __builtin_custom_inii (int, int)
98.10000 ++int __builtin_custom_inif (int, float)
98.10001 ++int __builtin_custom_inip (int, void *)
98.10002 ++int __builtin_custom_infi (float, int)
98.10003 ++int __builtin_custom_inff (float, float)
98.10004 ++int __builtin_custom_infp (float, void *)
98.10005 ++int __builtin_custom_inpi (void *, int)
98.10006 ++int __builtin_custom_inpf (void *, float)
98.10007 ++int __builtin_custom_inpp (void *, void *)
98.10008 ++float __builtin_custom_fn (void)
98.10009 ++float __builtin_custom_fni (int)
98.10010 ++float __builtin_custom_fnf (float)
98.10011 ++float __builtin_custom_fnp (void *)
98.10012 ++float __builtin_custom_fnii (int, int)
98.10013 ++float __builtin_custom_fnif (int, float)
98.10014 ++float __builtin_custom_fnip (int, void *)
98.10015 ++float __builtin_custom_fnfi (float, int)
98.10016 ++float __builtin_custom_fnff (float, float)
98.10017 ++float __builtin_custom_fnfp (float, void *)
98.10018 ++float __builtin_custom_fnpi (void *, int)
98.10019 ++float __builtin_custom_fnpf (void *, float)
98.10020 ++float __builtin_custom_fnpp (void *, void *)
98.10021 ++void * __builtin_custom_pn (void)
98.10022 ++void * __builtin_custom_pni (int)
98.10023 ++void * __builtin_custom_pnf (float)
98.10024 ++void * __builtin_custom_pnp (void *)
98.10025 ++void * __builtin_custom_pnii (int, int)
98.10026 ++void * __builtin_custom_pnif (int, float)
98.10027 ++void * __builtin_custom_pnip (int, void *)
98.10028 ++void * __builtin_custom_pnfi (float, int)
98.10029 ++void * __builtin_custom_pnff (float, float)
98.10030 ++void * __builtin_custom_pnfp (float, void *)
98.10031 ++void * __builtin_custom_pnpi (void *, int)
98.10032 ++void * __builtin_custom_pnpf (void *, float)
98.10033 ++void * __builtin_custom_pnpp (void *, void *)
98.10034 ++@end example
98.10035 ++
98.10036 ++
98.10037 + @node Alpha Built-in Functions
98.10038 + @subsection Alpha Built-in Functions
98.10039 + 
98.10040 +diff -durN gcc-3.4.6.orig/gcc/doc/invoke.texi gcc-3.4.6/gcc/doc/invoke.texi
98.10041 +--- gcc-3.4.6.orig/gcc/doc/invoke.texi	2005-10-08 02:22:20.000000000 +0200
98.10042 ++++ gcc-3.4.6/gcc/doc/invoke.texi	2007-08-15 23:09:36.000000000 +0200
98.10043 +@@ -337,6 +337,14 @@
98.10044 + @item Machine Dependent Options
98.10045 + @xref{Submodel Options,,Hardware Models and Configurations}.
98.10046 + 
98.10047 ++@emph{Altera Nios II Options}
98.10048 ++@gccoptlist{-msmallc -mno-bypass-cache -mbypass-cache @gol
98.10049 ++-mno-cache-volatile -mcache-volatile -mno-inline-memcpy @gol 
98.10050 ++-minline-memcpy -mno-fast-sw-div -mfast-sw-div @gol
98.10051 ++-mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx @gol
98.10052 ++-mno-hw-div -mhw-div @gol
98.10053 ++-msys-crt0= -msys-lib= -msys=nosys }
98.10054 ++
98.10055 + @emph{M680x0 Options}
98.10056 + @gccoptlist{-m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
98.10057 + -m68060  -mcpu32  -m5200  -m68881  -mbitfield  -mc68000  -mc68020   @gol
98.10058 +@@ -5839,6 +5847,7 @@
98.10059 + that macro, which enables you to change the defaults.
98.10060 + 
98.10061 + @menu
98.10062 ++* Altera Nios II Options::
98.10063 + * M680x0 Options::
98.10064 + * M68hc1x Options::
98.10065 + * VAX Options::
98.10066 +@@ -5874,6 +5883,103 @@
98.10067 + * FRV Options::
98.10068 + @end menu
98.10069 + 
98.10070 ++
98.10071 ++@node Altera Nios II Options
98.10072 ++@subsection Altera Nios II Options
98.10073 ++@cindex Altera Nios II options
98.10074 ++
98.10075 ++These are the @samp{-m} options defined for the Altera Nios II 
98.10076 ++processor.
98.10077 ++
98.10078 ++@table @gcctabopt
98.10079 ++
98.10080 ++@item -msmallc
98.10081 ++@opindex msmallc
98.10082 ++
98.10083 ++Link with a limited version of the C library, -lsmallc. For more 
98.10084 ++information see the C Library Documentation.
98.10085 ++
98.10086 ++
98.10087 ++@item -mbypass-cache
98.10088 ++@itemx -mno-bypass-cache
98.10089 ++@opindex mno-bypass-cache
98.10090 ++@opindex mbypass-cache
98.10091 ++
98.10092 ++Force all load and store instructions to always bypass cache by 
98.10093 ++using io variants of the instructions. The default is to not
98.10094 ++bypass the cache.
98.10095 ++
98.10096 ++@item -mno-cache-volatile 
98.10097 ++@itemx -mcache-volatile       
98.10098 ++@opindex mcache-volatile 
98.10099 ++@opindex mno-cache-volatile
98.10100 ++
98.10101 ++Volatile memory access bypass the cache using the io variants of 
98.10102 ++the ld and st instructions. The default is to cache volatile 
98.10103 ++accesses. 
98.10104 ++
98.10105 ++-mno-cache-volatile is deprecated and will be deleted in a 
98.10106 ++future GCC release.
98.10107 ++
98.10108 ++
98.10109 ++@item -mno-inline-memcpy
98.10110 ++@itemx -minline-memcpy
98.10111 ++@opindex mno-inline-memcpy 
98.10112 ++@opindex minline-memcpy
98.10113 ++
98.10114 ++Do not inline memcpy. The default is to inline when -O is on.
98.10115 ++
98.10116 ++
98.10117 ++@item -mno-fast-sw-div
98.10118 ++@itemx -mfast-sw-div
98.10119 ++@opindex mno-fast-sw-div
98.10120 ++@opindex mfast-sw-div
98.10121 ++
98.10122 ++Do no use table based fast divide for small numbers. The default 
98.10123 ++is to use the fast divide at -O3 and above.
98.10124 ++
98.10125 ++
98.10126 ++@item -mno-hw-mul
98.10127 ++@itemx -mhw-mul
98.10128 ++@itemx -mno-hw-mulx
98.10129 ++@itemx -mhw-mulx
98.10130 ++@itemx -mno-hw-div
98.10131 ++@itemx -mhw-div
98.10132 ++@opindex mno-hw-mul
98.10133 ++@opindex mhw-mul
98.10134 ++@opindex mno-hw-mulx
98.10135 ++@opindex mhw-mulx
98.10136 ++@opindex mno-hw-div
98.10137 ++@opindex mhw-div
98.10138 ++
98.10139 ++Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
98.10140 ++instructions by the compiler. The default is to emit @code{mul}
98.10141 ++and not emit @code{div} and @code{mulx}.
98.10142 ++
98.10143 ++The different combinations of @code{mul} and @code{mulx} instructions 
98.10144 ++generate a different multilib options. 
98.10145 ++
98.10146 ++
98.10147 ++@item -msys-crt0=@var{startfile}
98.10148 ++@opindex msys-crt0
98.10149 ++
98.10150 ++@var{startfile} is the file name  of the startfile (crt0) to use 
98.10151 ++when linking. The default is crt0.o that comes with libgloss
98.10152 ++and is only suitable for use with the instruction set
98.10153 ++simulator.
98.10154 ++
98.10155 ++@item -msys-lib=@var{systemlib}
98.10156 ++@itemx -msys-lib=nosys
98.10157 ++@opindex msys-lib
98.10158 ++
98.10159 ++@var{systemlib} is the library name of the library which provides
98.10160 ++the system calls required by the C library, e.g. @code{read}, @code{write}
98.10161 ++etc. The default is to use nosys, this library provides
98.10162 ++stub implementations of the calls and is part of libgloss.
98.10163 ++
98.10164 ++@end table
98.10165 ++
98.10166 ++
98.10167 + @node M680x0 Options
98.10168 + @subsection M680x0 Options
98.10169 + @cindex M680x0 options
98.10170 +diff -durN gcc-3.4.6.orig/gcc/doc/md.texi gcc-3.4.6/gcc/doc/md.texi
98.10171 +--- gcc-3.4.6.orig/gcc/doc/md.texi	2004-11-13 23:31:42.000000000 +0100
98.10172 ++++ gcc-3.4.6/gcc/doc/md.texi	2007-08-15 23:09:36.000000000 +0200
98.10173 +@@ -1337,6 +1337,49 @@
98.10174 + available on some particular machines.
98.10175 + 
98.10176 + @table @emph
98.10177 ++
98.10178 ++@item Altera Nios II family---@file{nios2.h}
98.10179 ++@table @code
98.10180 ++
98.10181 ++@item I
98.10182 ++Integer that is valid as an immediate operand in an
98.10183 ++instruction taking a signed 16-bit number. Range
98.10184 ++@minus{}32768 to 32767.
98.10185 ++
98.10186 ++@item J
98.10187 ++Integer that is valid as an immediate operand in an
98.10188 ++instruction taking an unsigned 16-bit number. Range
98.10189 ++0 to 65535.
98.10190 ++
98.10191 ++@item K
98.10192 ++Integer that is valid as an immediate operand in an
98.10193 ++instruction taking only the upper 16-bits of a
98.10194 ++32-bit number. Range 32-bit numbers with the lower
98.10195 ++16-bits being 0.
98.10196 ++
98.10197 ++@item L
98.10198 ++Integer that is valid as an immediate operand for a 
98.10199 ++shift instruction. Range 0 to 31.
98.10200 ++
98.10201 ++
98.10202 ++@item M
98.10203 ++Integer that is valid as an immediate operand for
98.10204 ++only the value 0. Can be used in conjunction with
98.10205 ++the format modifier @code{z} to use @code{r0}
98.10206 ++instead of @code{0} in the assembly output.
98.10207 ++
98.10208 ++@item N
98.10209 ++Integer that is valid as an immediate operand for
98.10210 ++a custom instruction opcode. Range 0 to 255.
98.10211 ++
98.10212 ++@item S
98.10213 ++Matches immediates which are addresses in the small
98.10214 ++data section and therefore can be added to @code{gp}
98.10215 ++as a 16-bit immediate to re-create their 32-bit value.
98.10216 ++
98.10217 ++@end table
98.10218 ++
98.10219 ++
98.10220 + @item ARM family---@file{arm.h}
98.10221 + @table @code
98.10222 + @item f
98.10223 +diff -durN gcc-3.4.6.orig/gcc/Makefile.in gcc-3.4.6/gcc/Makefile.in
98.10224 +--- gcc-3.4.6.orig/gcc/Makefile.in	2005-02-24 10:26:59.000000000 +0100
98.10225 ++++ gcc-3.4.6/gcc/Makefile.in	2007-08-15 23:09:36.000000000 +0200
98.10226 +@@ -3094,7 +3094,7 @@
98.10227 + 	  $(INSTALL_DATA) $(srcdir)/README-fixinc \
98.10228 + 	    $(DESTDIR)$(itoolsdatadir)/include/README ; \
98.10229 + 	  $(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh ; \
98.10230 +-	  $(INSTALL_PROGRAM) fixinc/fixincl $(DESTDIR)$(itoolsdir)/fixincl ; \
98.10231 ++	  $(INSTALL_PROGRAM) fixinc/fixincl$(build_exeext) $(DESTDIR)$(itoolsdir)/fixincl$(build_exeext) ; \
98.10232 + 	  $(INSTALL_DATA) $(srcdir)/gsyslimits.h \
98.10233 + 	    $(DESTDIR)$(itoolsdatadir)/gsyslimits.h ; \
98.10234 + 	else :; fi
    99.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.2 +++ b/patches/gcc/3.4.6/260-arm-softfloat.patch	Mon Jul 28 21:32:33 2008 +0000
    99.3 @@ -0,0 +1,161 @@
    99.4 +diff -durN gcc-3.4.6.orig/gcc/config/arm/coff.h gcc-3.4.6/gcc/config/arm/coff.h
    99.5 +--- gcc-3.4.6.orig/gcc/config/arm/coff.h	2004-02-24 15:25:22.000000000 +0100
    99.6 ++++ gcc-3.4.6/gcc/config/arm/coff.h	2007-08-15 23:10:54.000000000 +0200
    99.7 +@@ -31,11 +31,16 @@
    99.8 + #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
    99.9 + 
   99.10 + #undef  TARGET_DEFAULT
   99.11 +-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
   99.12 ++#define TARGET_DEFAULT		\
   99.13 ++	( ARM_FLAG_SOFT_FLOAT	\
   99.14 ++	| ARM_FLAG_VFP		\
   99.15 ++	| ARM_FLAG_APCS_32	\
   99.16 ++	| ARM_FLAG_APCS_FRAME	\
   99.17 ++	| ARM_FLAG_MMU_TRAPS )
   99.18 + 
   99.19 + #ifndef MULTILIB_DEFAULTS
   99.20 + #define MULTILIB_DEFAULTS \
   99.21 +-  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
   99.22 ++  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
   99.23 + #endif
   99.24 + 
   99.25 + /* This is COFF, but prefer stabs.  */
   99.26 +diff -durN gcc-3.4.6.orig/gcc/config/arm/elf.h gcc-3.4.6/gcc/config/arm/elf.h
   99.27 +--- gcc-3.4.6.orig/gcc/config/arm/elf.h	2004-02-24 15:25:22.000000000 +0100
   99.28 ++++ gcc-3.4.6/gcc/config/arm/elf.h	2007-08-15 23:10:54.000000000 +0200
   99.29 +@@ -46,7 +46,9 @@
   99.30 + 
   99.31 + #ifndef SUBTARGET_ASM_FLOAT_SPEC
   99.32 + #define SUBTARGET_ASM_FLOAT_SPEC "\
   99.33 +-%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
   99.34 ++%{mapcs-float:-mfloat} \
   99.35 ++%{mhard-float:-mfpu=fpa} \
   99.36 ++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
   99.37 + #endif
   99.38 + 
   99.39 + #ifndef ASM_SPEC
   99.40 +@@ -106,12 +108,17 @@
   99.41 + #endif
   99.42 + 
   99.43 + #ifndef TARGET_DEFAULT
   99.44 +-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
   99.45 ++#define TARGET_DEFAULT		\
   99.46 ++	( ARM_FLAG_SOFT_FLOAT	\
   99.47 ++	| ARM_FLAG_VFP		\
   99.48 ++	| ARM_FLAG_APCS_32	\
   99.49 ++	| ARM_FLAG_APCS_FRAME	\
   99.50 ++	| ARM_FLAG_MMU_TRAPS )
   99.51 + #endif
   99.52 + 
   99.53 + #ifndef MULTILIB_DEFAULTS
   99.54 + #define MULTILIB_DEFAULTS \
   99.55 +-  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
   99.56 ++  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
   99.57 + #endif
   99.58 + 
   99.59 + #define TARGET_ASM_FILE_START_APP_OFF true
   99.60 +diff -durN gcc-3.4.6.orig/gcc/config/arm/linux-elf.h gcc-3.4.6/gcc/config/arm/linux-elf.h
   99.61 +--- gcc-3.4.6.orig/gcc/config/arm/linux-elf.h	2007-08-15 23:07:00.000000000 +0200
   99.62 ++++ gcc-3.4.6/gcc/config/arm/linux-elf.h	2007-08-15 23:10:54.000000000 +0200
   99.63 +@@ -44,12 +44,26 @@
   99.64 + #define TARGET_LINKER_EMULATION "armelf_linux"
   99.65 + #endif
   99.66 + 
   99.67 +-/* Default is to use APCS-32 mode.  */
   99.68 ++/*
   99.69 ++ * Default is to use APCS-32 mode with soft-vfp.
   99.70 ++ * The old Linux default for floats can be achieved with -mhard-float
   99.71 ++ * or with the configure --with-float=hard option.
   99.72 ++ * If -msoft-float or --with-float=soft is used then software float 
   99.73 ++ * support will be used just like the default but with the legacy
   99.74 ++ * big endian word ordering for double float representation instead.
   99.75 ++ */
   99.76 + #undef  TARGET_DEFAULT
   99.77 +-#define TARGET_DEFAULT \
   99.78 +-		( ARM_FLAG_APCS_32 | \
   99.79 +-		  ARM_FLAG_MMU_TRAPS | \
   99.80 +-		  TARGET_ENDIAN_DEFAULT )
   99.81 ++#define TARGET_DEFAULT		\
   99.82 ++	( ARM_FLAG_APCS_32	\
   99.83 ++	| ARM_FLAG_SOFT_FLOAT	\
   99.84 ++	| TARGET_ENDIAN_DEFAULT	\
   99.85 ++	| ARM_FLAG_VFP		\
   99.86 ++	| ARM_FLAG_MMU_TRAPS )
   99.87 ++
   99.88 ++#undef  SUBTARGET_EXTRA_ASM_SPEC
   99.89 ++#define SUBTARGET_EXTRA_ASM_SPEC "\
   99.90 ++%{mhard-float:-mfpu=fpa} \
   99.91 ++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
   99.92 + 
   99.93 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
   99.94 + 
   99.95 +@@ -57,7 +71,7 @@
   99.96 + 
   99.97 + #undef  MULTILIB_DEFAULTS
   99.98 + #define MULTILIB_DEFAULTS \
   99.99 +-	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
  99.100 ++	{ "marm", TARGET_ENDIAN_OPTION, "mapcs-32", "mno-thumb-interwork" }
  99.101 + 
  99.102 + #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
  99.103 + 
  99.104 +@@ -72,7 +86,7 @@
  99.105 +    %{shared:-lc} \
  99.106 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  99.107 + 
  99.108 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
  99.109 ++#define LIBGCC_SPEC "-lgcc"
  99.110 + 
  99.111 + /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
  99.112 +    the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
  99.113 +diff -durN gcc-3.4.6.orig/gcc/config/arm/t-linux gcc-3.4.6/gcc/config/arm/t-linux
  99.114 +--- gcc-3.4.6.orig/gcc/config/arm/t-linux	2003-09-20 23:09:07.000000000 +0200
  99.115 ++++ gcc-3.4.6/gcc/config/arm/t-linux	2007-08-15 23:10:54.000000000 +0200
  99.116 +@@ -4,7 +4,10 @@
  99.117 + LIBGCC2_DEBUG_CFLAGS = -g0
  99.118 + 
  99.119 + LIB1ASMSRC = arm/lib1funcs.asm
  99.120 +-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
  99.121 ++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
  99.122 ++	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
  99.123 ++	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
  99.124 ++	_fixsfsi _fixunssfsi
  99.125 + 
  99.126 + # MULTILIB_OPTIONS = mhard-float/msoft-float
  99.127 + # MULTILIB_DIRNAMES = hard-float soft-float
  99.128 +diff -durN gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h gcc-3.4.6/gcc/config/arm/unknown-elf.h
  99.129 +--- gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h	2004-02-24 15:25:22.000000000 +0100
  99.130 ++++ gcc-3.4.6/gcc/config/arm/unknown-elf.h	2007-08-15 23:10:54.000000000 +0200
  99.131 +@@ -30,7 +30,12 @@
  99.132 + 
  99.133 + /* Default to using APCS-32 and software floating point.  */
  99.134 + #ifndef TARGET_DEFAULT
  99.135 +-#define TARGET_DEFAULT	(ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
  99.136 ++#define TARGET_DEFAULT		\
  99.137 ++	( ARM_FLAG_SOFT_FLOAT	\
  99.138 ++	| ARM_FLAG_VFP		\
  99.139 ++	| ARM_FLAG_APCS_32	\
  99.140 ++	| ARM_FLAG_APCS_FRAME	\
  99.141 ++	| ARM_FLAG_MMU_TRAPS )
  99.142 + #endif
  99.143 + 
  99.144 + /* Now we define the strings used to build the spec file.  */
  99.145 +diff -durN gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h gcc-3.4.6/gcc/config/arm/xscale-elf.h
  99.146 +--- gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h	2003-07-02 01:26:43.000000000 +0200
  99.147 ++++ gcc-3.4.6/gcc/config/arm/xscale-elf.h	2007-08-15 23:10:54.000000000 +0200
  99.148 +@@ -49,11 +49,12 @@
  99.149 + 		     endian, regardless of the endian-ness of the memory
  99.150 + 		     system.  */
  99.151 + 		     
  99.152 +-#define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
  99.153 +-  %{mhard-float:-mfpu=fpa} \
  99.154 +-  %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
  99.155 ++#define SUBTARGET_EXTRA_ASM_SPEC "\
  99.156 ++%{!mcpu=*:-mcpu=xscale} \
  99.157 ++%{mhard-float:-mfpu=fpa} \
  99.158 ++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
  99.159 + 
  99.160 + #ifndef MULTILIB_DEFAULTS
  99.161 + #define MULTILIB_DEFAULTS \
  99.162 +-  { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" }
  99.163 ++  { "mlittle-endian", "mno-thumb-interwork", "marm" }
  99.164 + #endif
   100.1 --- a/patches/gcc/3.4.6/300-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   100.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   100.3 @@ -1,46 +0,0 @@
   100.4 -diff -durN gcc-3.4.6.orig/libstdc++-v3/src/Makefile.am gcc-3.4.6/libstdc++-v3/src/Makefile.am
   100.5 ---- gcc-3.4.6.orig/libstdc++-v3/src/Makefile.am	2004-04-16 21:08:35.000000000 +0200
   100.6 -+++ gcc-3.4.6/libstdc++-v3/src/Makefile.am	2007-08-15 22:52:23.000000000 +0200
   100.7 -@@ -210,6 +210,10 @@
   100.8 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
   100.9 - 
  100.10 - 
  100.11 -+install-exec-local:
  100.12 -+	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  100.13 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  100.14 -+
  100.15 - # Added bits to build debug library.
  100.16 - if GLIBCXX_BUILD_DEBUG
  100.17 - all-local: build_debug
  100.18 -diff -durN gcc-3.4.6.orig/libstdc++-v3/src/Makefile.in gcc-3.4.6/libstdc++-v3/src/Makefile.in
  100.19 ---- gcc-3.4.6.orig/libstdc++-v3/src/Makefile.in	2004-04-16 21:08:35.000000000 +0200
  100.20 -+++ gcc-3.4.6/libstdc++-v3/src/Makefile.in	2007-08-15 22:52:23.000000000 +0200
  100.21 -@@ -592,7 +592,7 @@
  100.22 - 
  100.23 - install-data-am: install-data-local
  100.24 - 
  100.25 --install-exec-am: install-toolexeclibLTLIBRARIES
  100.26 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  100.27 - 
  100.28 - install-info: install-info-am
  100.29 - 
  100.30 -@@ -625,6 +625,7 @@
  100.31 - 	distclean-tags distdir dvi dvi-am info info-am install \
  100.32 - 	install-am install-data install-data-am install-data-local \
  100.33 - 	install-exec install-exec-am install-info install-info-am \
  100.34 -+	install-exec-local \
  100.35 - 	install-man install-strip install-toolexeclibLTLIBRARIES \
  100.36 - 	installcheck installcheck-am installdirs maintainer-clean \
  100.37 - 	maintainer-clean-generic mostlyclean mostlyclean-compile \
  100.38 -@@ -709,6 +710,11 @@
  100.39 - install_debug:
  100.40 - 	(cd ${debugdir} && $(MAKE) \
  100.41 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  100.42 -+
  100.43 -+install-exec-local:
  100.44 -+	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  100.45 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  100.46 -+
  100.47 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  100.48 - # Otherwise a system limit (for SysV at least) may be exceeded.
  100.49 - .NOEXPORT:
   101.1 --- a/patches/gcc/3.4.6/304-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   101.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.3 @@ -1,26 +0,0 @@
   101.4 -diff -durN gcc-3.4.6.orig/libstdc++-v3/include/ext/rope gcc-3.4.6/libstdc++-v3/include/ext/rope
   101.5 ---- gcc-3.4.6.orig/libstdc++-v3/include/ext/rope	2005-01-16 23:08:43.000000000 +0100
   101.6 -+++ gcc-3.4.6/libstdc++-v3/include/ext/rope	2007-08-15 22:53:37.000000000 +0200
   101.7 -@@ -58,6 +58,9 @@
   101.8 - #include <bits/allocator.h>
   101.9 - #include <ext/hash_fun.h>
  101.10 - 
  101.11 -+/* cope w/ index defined as macro, SuSv3 proposal */
  101.12 -+#undef index
  101.13 -+
  101.14 - # ifdef __GC
  101.15 - #   define __GC_CONST const
  101.16 - # else
  101.17 -diff -durN gcc-3.4.6.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-3.4.6/libstdc++-v3/include/ext/ropeimpl.h
  101.18 ---- gcc-3.4.6.orig/libstdc++-v3/include/ext/ropeimpl.h	2004-09-08 15:36:04.000000000 +0200
  101.19 -+++ gcc-3.4.6/libstdc++-v3/include/ext/ropeimpl.h	2007-08-15 22:53:37.000000000 +0200
  101.20 -@@ -53,6 +53,9 @@
  101.21 - #include <ext/memory> // For uninitialized_copy_n
  101.22 - #include <ext/numeric> // For power
  101.23 - 
  101.24 -+/* cope w/ index defined as macro, SuSv3 proposal */
  101.25 -+#undef index
  101.26 -+
  101.27 - namespace __gnu_cxx
  101.28 - {
  101.29 -   using std::size_t;
   102.1 --- a/patches/gcc/3.4.6/600-arm-ldm-peephole.patch	Mon Jul 28 21:08:01 2008 +0000
   102.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.3 @@ -1,68 +0,0 @@
   102.4 -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
   102.5 ---- gcc-3.4.6.orig/gcc/config/arm/arm.c	2005-10-01 15:31:38.000000000 +0200
   102.6 -+++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:54:59.000000000 +0200
   102.7 -@@ -4857,6 +4857,11 @@
   102.8 -       *load_offset = unsorted_offsets[order[0]];
   102.9 -     }
  102.10 - 
  102.11 -+  /* For XScale a two-word LDM is a performance loss, so only do this if
  102.12 -+     size is more important.  See comments in arm_gen_load_multiple.  */
  102.13 -+  if (nops == 2 && arm_tune_xscale && !optimize_size)
  102.14 -+    return 0;
  102.15 -+
  102.16 -   if (unsorted_offsets[order[0]] == 0)
  102.17 -     return 1; /* ldmia */
  102.18 - 
  102.19 -@@ -5083,6 +5088,11 @@
  102.20 -       *load_offset = unsorted_offsets[order[0]];
  102.21 -     }
  102.22 - 
  102.23 -+  /* For XScale a two-word LDM is a performance loss, so only do this if
  102.24 -+     size is more important.  See comments in arm_gen_load_multiple.  */
  102.25 -+  if (nops == 2 && arm_tune_xscale && !optimize_size)
  102.26 -+    return 0;
  102.27 -+
  102.28 -   if (unsorted_offsets[order[0]] == 0)
  102.29 -     return 1; /* stmia */
  102.30 - 
  102.31 -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.md gcc-3.4.6/gcc/config/arm/arm.md
  102.32 ---- gcc-3.4.6.orig/gcc/config/arm/arm.md	2005-10-01 15:31:38.000000000 +0200
  102.33 -+++ gcc-3.4.6/gcc/config/arm/arm.md	2007-08-15 22:54:59.000000000 +0200
  102.34 -@@ -8811,13 +8811,16 @@
  102.35 -    (set_attr "length" "4,8,8")]
  102.36 - )
  102.37 - 
  102.38 -+; Try to convert LDR+LDR+arith into [add+]LDM+arith
  102.39 -+; On XScale, LDM is always slower than two LDRs, so only do this if
  102.40 -+; optimising for size.
  102.41 - (define_insn "*arith_adjacentmem"
  102.42 -   [(set (match_operand:SI 0 "s_register_operand" "=r")
  102.43 - 	(match_operator:SI 1 "shiftable_operator"
  102.44 - 	 [(match_operand:SI 2 "memory_operand" "m")
  102.45 - 	  (match_operand:SI 3 "memory_operand" "m")]))
  102.46 -    (clobber (match_scratch:SI 4 "=r"))]
  102.47 --  "TARGET_ARM && adjacent_mem_locations (operands[2], operands[3])"
  102.48 -+  "TARGET_ARM && (!arm_tune_xscale || optimize_size) && adjacent_mem_locations (operands[2], operands[3])"
  102.49 -   "*
  102.50 -   {
  102.51 -     rtx ldm[3];
  102.52 -@@ -8852,6 +8855,8 @@
  102.53 -       }
  102.54 -    if (val1 && val2)
  102.55 -       {
  102.56 -+	/* This would be a loss on a Harvard core, but adjacent_mem_locations()
  102.57 -+	   will prevent it from happening.  */
  102.58 - 	rtx ops[3];
  102.59 - 	ldm[0] = ops[0] = operands[4];
  102.60 - 	ops[1] = XEXP (XEXP (operands[2], 0), 0);
  102.61 -diff -durN gcc-3.4.6.orig/gcc/genpeep.c gcc-3.4.6/gcc/genpeep.c
  102.62 ---- gcc-3.4.6.orig/gcc/genpeep.c	2003-07-05 07:27:22.000000000 +0200
  102.63 -+++ gcc-3.4.6/gcc/genpeep.c	2007-08-15 22:54:59.000000000 +0200
  102.64 -@@ -381,6 +381,7 @@
  102.65 -   printf ("#include \"recog.h\"\n");
  102.66 -   printf ("#include \"except.h\"\n\n");
  102.67 -   printf ("#include \"function.h\"\n\n");
  102.68 -+  printf ("#include \"flags.h\"\n\n");
  102.69 - 
  102.70 -   printf ("#ifdef HAVE_peephole\n");
  102.71 -   printf ("extern rtx peep_operand[];\n\n");
   103.1 --- a/patches/gcc/3.4.6/601-arm-ldm.patch	Mon Jul 28 21:08:01 2008 +0000
   103.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.3 @@ -1,120 +0,0 @@
   103.4 -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
   103.5 ---- gcc-3.4.6.orig/gcc/config/arm/arm.c	2007-08-15 22:56:20.000000000 +0200
   103.6 -+++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:56:20.000000000 +0200
   103.7 -@@ -8524,6 +8524,26 @@
   103.8 -   return_used_this_function = 0;  
   103.9 - }
  103.10 - 
  103.11 -+/* Return the number (counting from 0) of
  103.12 -+   the least significant set bit in MASK.  */
  103.13 -+
  103.14 -+#ifdef __GNUC__
  103.15 -+inline
  103.16 -+#endif
  103.17 -+static int
  103.18 -+number_of_first_bit_set (mask)
  103.19 -+     int mask;
  103.20 -+{
  103.21 -+  int bit;
  103.22 -+
  103.23 -+  for (bit = 0;
  103.24 -+       (mask & (1 << bit)) == 0;
  103.25 -+       ++bit)
  103.26 -+    continue;
  103.27 -+
  103.28 -+  return bit;
  103.29 -+}
  103.30 -+
  103.31 - const char *
  103.32 - arm_output_epilogue (rtx sibling)
  103.33 - {
  103.34 -@@ -8757,27 +8777,47 @@
  103.35 - 	  saved_regs_mask |=   (1 << PC_REGNUM);
  103.36 - 	}
  103.37 - 
  103.38 --      /* Load the registers off the stack.  If we only have one register
  103.39 --	 to load use the LDR instruction - it is faster.  */
  103.40 --      if (saved_regs_mask == (1 << LR_REGNUM))
  103.41 --	{
  103.42 --	  /* The exception handler ignores the LR, so we do
  103.43 --	     not really need to load it off the stack.  */
  103.44 --	  if (eh_ofs)
  103.45 --	    asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
  103.46 --	  else
  103.47 --	    asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM);
  103.48 --	}
  103.49 --      else if (saved_regs_mask)
  103.50 -+      if (saved_regs_mask)
  103.51 - 	{
  103.52 --	  if (saved_regs_mask & (1 << SP_REGNUM))
  103.53 --	    /* Note - write back to the stack register is not enabled
  103.54 --	       (ie "ldmfd sp!...").  We know that the stack pointer is
  103.55 --	       in the list of registers and if we add writeback the
  103.56 --	       instruction becomes UNPREDICTABLE.  */
  103.57 --	    print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
  103.58 -+	  /* Load the registers off the stack.  If we only have one register
  103.59 -+	     to load use the LDR instruction - it is faster.  */
  103.60 -+	  if (bit_count (saved_regs_mask) == 1)
  103.61 -+	    {
  103.62 -+	      int reg = number_of_first_bit_set (saved_regs_mask);
  103.63 -+
  103.64 -+	      switch (reg)
  103.65 -+		{
  103.66 -+		case SP_REGNUM:
  103.67 -+		  /* Mustn't use base writeback when loading SP.  */
  103.68 -+		  asm_fprintf (f, "\tldr\t%r, [%r]\n", SP_REGNUM, SP_REGNUM);
  103.69 -+		  break;
  103.70 -+		  
  103.71 -+		case LR_REGNUM:
  103.72 -+		  if (eh_ofs)
  103.73 -+		    {
  103.74 -+		      /* The exception handler ignores the LR, so we do
  103.75 -+			 not really need to load it off the stack.  */
  103.76 -+		      asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
  103.77 -+		      break;
  103.78 -+		    }
  103.79 -+		  /* else fall through */
  103.80 -+		  
  103.81 -+		default:
  103.82 -+		  asm_fprintf (f, "\tldr\t%r, [%r], #4\n", reg, SP_REGNUM);
  103.83 -+		  break;
  103.84 -+		}
  103.85 -+	    }
  103.86 - 	  else
  103.87 --	    print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
  103.88 -+	    {
  103.89 -+	      if (saved_regs_mask & (1 << SP_REGNUM))
  103.90 -+		/* Note - write back to the stack register is not enabled
  103.91 -+		   (ie "ldmfd sp!...").  We know that the stack pointer is
  103.92 -+		   in the list of registers and if we add writeback the
  103.93 -+		   instruction becomes UNPREDICTABLE.  */
  103.94 -+		print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
  103.95 -+	      else
  103.96 -+		print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
  103.97 -+	    }
  103.98 - 	}
  103.99 - 
 103.100 -       if (current_function_pretend_args_size)
 103.101 -@@ -11405,22 +11445,6 @@
 103.102 -     }
 103.103 - }
 103.104 - 
 103.105 --/* Return the number (counting from 0) of
 103.106 --   the least significant set bit in MASK.  */
 103.107 --
 103.108 --inline static int
 103.109 --number_of_first_bit_set (int mask)
 103.110 --{
 103.111 --  int bit;
 103.112 --
 103.113 --  for (bit = 0;
 103.114 --       (mask & (1 << bit)) == 0;
 103.115 --       ++bit)
 103.116 --    continue;
 103.117 --
 103.118 --  return bit;
 103.119 --}
 103.120 --
 103.121 - /* Generate code to return from a thumb function.
 103.122 -    If 'reg_containing_return_addr' is -1, then the return address is
 103.123 -    actually on the stack, at the stack pointer.  */
   104.1 --- a/patches/gcc/3.4.6/602-arm-ldm-peephole2.patch	Mon Jul 28 21:08:01 2008 +0000
   104.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.3 @@ -1,32 +0,0 @@
   104.4 -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
   104.5 ---- gcc-3.4.6.orig/gcc/config/arm/arm.c	2007-08-15 22:57:51.000000000 +0200
   104.6 -+++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:57:51.000000000 +0200
   104.7 -@@ -4572,6 +4572,10 @@
   104.8 - int
   104.9 - adjacent_mem_locations (rtx a, rtx b)
  104.10 - {
  104.11 -+  /* We don't guarantee to preserve the order of these memory refs.  */
  104.12 -+  if (volatile_refs_p (a) || volatile_refs_p (b))
  104.13 -+    return 0;
  104.14 -+
  104.15 -   if ((GET_CODE (XEXP (a, 0)) == REG
  104.16 -        || (GET_CODE (XEXP (a, 0)) == PLUS
  104.17 - 	   && GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT))
  104.18 -@@ -4611,6 +4615,17 @@
  104.19 - 	return 0;
  104.20 - 
  104.21 -       val_diff = val1 - val0;
  104.22 -+
  104.23 -+      if (arm_ld_sched)
  104.24 -+	{
  104.25 -+	  /* If the target has load delay slots, then there's no benefit
  104.26 -+	     to using an ldm instruction unless the offset is zero and
  104.27 -+	     we are optimizing for size.  */
  104.28 -+	  return (optimize_size && (REGNO (reg0) == REGNO (reg1))
  104.29 -+		  && (val0 == 0 || val1 == 0 || val0 == 4 || val1 == 4)
  104.30 -+		  && (val_diff == 4 || val_diff == -4));
  104.31 -+	}
  104.32 -+
  104.33 -       return ((REGNO (reg0) == REGNO (reg1))
  104.34 - 	      && (val_diff == 4 || val_diff == -4));
  104.35 -     }
   105.1 --- a/patches/gcc/3.4.6/602-sdk-libstdc++-includes.patch	Mon Jul 28 21:08:01 2008 +0000
   105.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.3 @@ -1,24 +0,0 @@
   105.4 -diff -durN gcc-3.4.6.orig/libstdc++-v3/fragment.am gcc-3.4.6/libstdc++-v3/fragment.am
   105.5 ---- gcc-3.4.6.orig/libstdc++-v3/fragment.am	2003-08-27 02:38:28.000000000 +0200
   105.6 -+++ gcc-3.4.6/libstdc++-v3/fragment.am	2007-08-15 22:59:09.000000000 +0200
   105.7 -@@ -18,7 +18,7 @@
   105.8 - 	$(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
   105.9 - 
  105.10 - # -I/-D flags to pass when compiling.
  105.11 --AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
  105.12 -+AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
  105.13 - 
  105.14 - 
  105.15 - 
  105.16 -diff -durN gcc-3.4.6.orig/libstdc++-v3/libmath/Makefile.am gcc-3.4.6/libstdc++-v3/libmath/Makefile.am
  105.17 ---- gcc-3.4.6.orig/libstdc++-v3/libmath/Makefile.am	2003-08-27 23:29:43.000000000 +0200
  105.18 -+++ gcc-3.4.6/libstdc++-v3/libmath/Makefile.am	2007-08-15 22:59:09.000000000 +0200
  105.19 -@@ -32,7 +32,7 @@
  105.20 - 
  105.21 - libmath_la_SOURCES = stubs.c
  105.22 - 
  105.23 --AM_CPPFLAGS = $(CANADIAN_INCLUDES)
  105.24 -+AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
  105.25 - 
  105.26 - # Only compiling "C" sources in this directory.
  105.27 - LIBTOOL = @LIBTOOL@ --tag CC
   106.1 --- a/patches/gcc/3.4.6/700-pr15068-fix.patch	Mon Jul 28 21:08:01 2008 +0000
   106.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.3 @@ -1,27 +0,0 @@
   106.4 -diff -durN gcc-3.4.6.orig/gcc/flow.c gcc-3.4.6/gcc/flow.c
   106.5 ---- gcc-3.4.6.orig/gcc/flow.c	2005-09-01 22:51:09.000000000 +0200
   106.6 -+++ gcc-3.4.6/gcc/flow.c	2007-08-15 23:00:30.000000000 +0200
   106.7 -@@ -1884,6 +1884,7 @@
   106.8 - 	  rtx set_src = SET_SRC (pc_set (BB_END (bb)));
   106.9 - 	  rtx cond_true = XEXP (set_src, 0);
  106.10 - 	  rtx reg = XEXP (cond_true, 0);
  106.11 -+ 	  enum rtx_code inv_cond;
  106.12 - 
  106.13 - 	  if (GET_CODE (reg) == SUBREG)
  106.14 - 	    reg = SUBREG_REG (reg);
  106.15 -@@ -1892,11 +1893,13 @@
  106.16 - 	     in the form of a comparison of a register against zero.  
  106.17 - 	     If the condition is more complex than that, then it is safe
  106.18 - 	     not to record any information.  */
  106.19 --	  if (GET_CODE (reg) == REG
  106.20 -+ 	  inv_cond = reversed_comparison_code (cond_true, BB_END (bb));
  106.21 -+ 	  if (inv_cond != UNKNOWN
  106.22 -+	      && GET_CODE (reg) == REG
  106.23 - 	      && XEXP (cond_true, 1) == const0_rtx)
  106.24 - 	    {
  106.25 - 	      rtx cond_false
  106.26 --		= gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond_true)),
  106.27 -+		= gen_rtx_fmt_ee (inv_cond,
  106.28 - 				  GET_MODE (cond_true), XEXP (cond_true, 0),
  106.29 - 				  XEXP (cond_true, 1));
  106.30 - 	      if (GET_CODE (XEXP (set_src, 1)) == PC)
   107.1 --- a/patches/gcc/3.4.6/710-all_sh-pr16665-fix.patch	Mon Jul 28 21:08:01 2008 +0000
   107.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.3 @@ -1,44 +0,0 @@
   107.4 -diff -durN gcc-3.4.6.orig/gcc/config/sh/sh.c gcc-3.4.6/gcc/config/sh/sh.c
   107.5 ---- gcc-3.4.6.orig/gcc/config/sh/sh.c	2004-09-03 08:51:30.000000000 +0200
   107.6 -+++ gcc-3.4.6/gcc/config/sh/sh.c	2007-08-15 23:01:48.000000000 +0200
   107.7 -@@ -9107,6 +9107,15 @@
   107.8 -     }
   107.9 -   this = FUNCTION_ARG (cum, Pmode, ptr_type_node, 1);
  107.10 - 
  107.11 -+  /* In PIC case, we set PIC register to compute the target address.  We
  107.12 -+     can use a scratch register to save and restore the original value  
  107.13 -+     except for SHcompact.  For SHcompact, use stack.  */
  107.14 -+  if (flag_pic && TARGET_SHCOMPACT)
  107.15 -+    {
  107.16 -+      push (PIC_OFFSET_TABLE_REGNUM);
  107.17 -+      emit_insn (gen_GOTaddr2picreg ());
  107.18 -+    }
  107.19 -+
  107.20 -   /* For SHcompact, we only have r0 for a scratch register: r1 is the
  107.21 -      static chain pointer (even if you can't have nested virtual functions
  107.22 -      right now, someone might implement them sometime), and the rest of the
  107.23 -@@ -9189,8 +9198,24 @@
  107.24 -       assemble_external (function);
  107.25 -       TREE_USED (function) = 1;
  107.26 -     }
  107.27 -+  /* We can use scratch1 to save and restore the original value of
  107.28 -+     PIC register except for SHcompact.  */
  107.29 -+  if (flag_pic && ! TARGET_SHCOMPACT)
  107.30 -+    {
  107.31 -+      emit_move_insn (scratch1,
  107.32 -+		      gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM));
  107.33 -+      emit_insn (gen_GOTaddr2picreg ());
  107.34 -+    }
  107.35 -   funexp = XEXP (DECL_RTL (function), 0);
  107.36 -   emit_move_insn (scratch2, funexp);
  107.37 -+  if (flag_pic)
  107.38 -+    {
  107.39 -+      if (! TARGET_SHCOMPACT)
  107.40 -+	emit_move_insn (gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM),
  107.41 -+			scratch1);
  107.42 -+      else
  107.43 -+	pop (PIC_OFFSET_TABLE_REGNUM);
  107.44 -+    }
  107.45 -   funexp = gen_rtx_MEM (FUNCTION_MODE, scratch2);
  107.46 -   sibcall = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX));
  107.47 -   SIBLING_CALL_P (sibcall) = 1;
   108.1 --- a/patches/gcc/3.4.6/720-all_sh-no-reorder-blocks.patch	Mon Jul 28 21:08:01 2008 +0000
   108.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   108.3 @@ -1,14 +0,0 @@
   108.4 -diff -durN gcc-3.4.6.orig/gcc/config/sh/sh.h gcc-3.4.6/gcc/config/sh/sh.h
   108.5 ---- gcc-3.4.6.orig/gcc/config/sh/sh.h	2006-01-12 02:20:32.000000000 +0100
   108.6 -+++ gcc-3.4.6/gcc/config/sh/sh.h	2007-08-15 23:03:09.000000000 +0200
   108.7 -@@ -422,6 +422,10 @@
   108.8 - do {									\
   108.9 -   if (LEVEL)								\
  108.10 -     flag_omit_frame_pointer = -1;					\
  108.11 -+  if (LEVEL <= 2)							\
  108.12 -+    {									\
  108.13 -+      flag_reorder_blocks = 0;						\
  108.14 -+    }									\
  108.15 -   if (SIZE)								\
  108.16 -     target_flags |= SPACE_BIT;						\
  108.17 -   if (TARGET_SHMEDIA && LEVEL > 1)					\
   109.1 --- a/patches/gcc/3.4.6/730-all_sh-pr20617.patch	Mon Jul 28 21:08:01 2008 +0000
   109.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.3 @@ -1,24 +0,0 @@
   109.4 -diff -durN gcc-3.4.6.orig/gcc/config/sh/lib1funcs.asm gcc-3.4.6/gcc/config/sh/lib1funcs.asm
   109.5 ---- gcc-3.4.6.orig/gcc/config/sh/lib1funcs.asm	2003-08-12 03:25:07.000000000 +0200
   109.6 -+++ gcc-3.4.6/gcc/config/sh/lib1funcs.asm	2007-08-15 23:04:26.000000000 +0200
   109.7 -@@ -37,9 +37,19 @@
   109.8 -    ELF local label prefixes by J"orn Rennecke
   109.9 -    amylaar@cygnus.com  */
  109.10 - 
  109.11 -+#define ALIAS(X,Y)	.global GLOBAL(X); .set GLOBAL(X),GLOBAL(Y)
  109.12 -+
  109.13 - #ifdef __ELF__
  109.14 - #define LOCAL(X)	.L_##X
  109.15 --#define FUNC(X)		.type X,@function
  109.16 -+
  109.17 -+#if 1 /* ??? The export list mechanism is broken, everything that is not
  109.18 -+	 hidden is exported.  */
  109.19 -+#undef FUNC
  109.20 -+#define FUNC(X)		.type X,@function; .hidden X
  109.21 -+#undef ALIAS
  109.22 -+#define ALIAS(X,Y)	.global GLOBAL(X); .set GLOBAL(X),GLOBAL(Y); .hidden GLOBAL(X)
  109.23 -+#endif
  109.24 -+
  109.25 - #define ENDFUNC0(X)	.Lfe_##X: .size X,.Lfe_##X-X
  109.26 - #define ENDFUNC(X)	ENDFUNC0(X)
  109.27 - #else
   110.1 --- a/patches/gcc/3.4.6/800-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
   110.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.3 @@ -1,65 +0,0 @@
   110.4 -diff -durN gcc-3.4.6.orig/gcc/config/arm/linux-elf.h gcc-3.4.6/gcc/config/arm/linux-elf.h
   110.5 ---- gcc-3.4.6.orig/gcc/config/arm/linux-elf.h	2007-08-15 22:51:01.000000000 +0200
   110.6 -+++ gcc-3.4.6/gcc/config/arm/linux-elf.h	2007-08-15 23:05:42.000000000 +0200
   110.7 -@@ -30,17 +30,34 @@
   110.8 - /* Do not assume anything about header files.  */
   110.9 - #define NO_IMPLICIT_EXTERN_C
  110.10 - 
  110.11 -+/*
  110.12 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  110.13 -+ * (big endian) configurations.
  110.14 -+ */
  110.15 -+#if TARGET_BIG_ENDIAN_DEFAULT
  110.16 -+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
  110.17 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
  110.18 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
  110.19 -+#else
  110.20 -+#define TARGET_ENDIAN_DEFAULT 0
  110.21 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
  110.22 -+#define TARGET_LINKER_EMULATION "armelf_linux"
  110.23 -+#endif
  110.24 -+
  110.25 - /* Default is to use APCS-32 mode.  */
  110.26 - #undef  TARGET_DEFAULT
  110.27 --#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
  110.28 -+#define TARGET_DEFAULT \
  110.29 -+		( ARM_FLAG_APCS_32 | \
  110.30 -+		  ARM_FLAG_MMU_TRAPS | \
  110.31 -+		  TARGET_ENDIAN_DEFAULT )
  110.32 - 
  110.33 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  110.34 - 
  110.35 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  110.36 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  110.37 - 
  110.38 - #undef  MULTILIB_DEFAULTS
  110.39 - #define MULTILIB_DEFAULTS \
  110.40 --	{ "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
  110.41 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
  110.42 - 
  110.43 - #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
  110.44 - 
  110.45 -@@ -94,7 +111,7 @@
  110.46 -    %{rdynamic:-export-dynamic} \
  110.47 -    %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "} \
  110.48 -    -X \
  110.49 --   %{mbig-endian:-EB}" \
  110.50 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  110.51 -    SUBTARGET_EXTRA_LINK_SPEC
  110.52 - 
  110.53 - #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
  110.54 -diff -durN gcc-3.4.6.orig/gcc/config.gcc gcc-3.4.6/gcc/config.gcc
  110.55 ---- gcc-3.4.6.orig/gcc/config.gcc	2007-08-15 22:51:01.000000000 +0200
  110.56 -+++ gcc-3.4.6/gcc/config.gcc	2007-08-15 23:05:42.000000000 +0200
  110.57 -@@ -678,6 +678,11 @@
  110.58 - 	;;
  110.59 - arm*-*-linux*)			# ARM GNU/Linux with ELF
  110.60 - 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
  110.61 -+	case $target in
  110.62 -+	arm*b-*)
  110.63 -+		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
  110.64 -+		;;
  110.65 -+	esac
  110.66 - 	tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
  110.67 - 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  110.68 - 	gnu_ld=yes
   111.1 --- a/patches/gcc/3.4.6/800-powerpc-libc_stack_end-uclibc.patch	Mon Jul 28 21:08:01 2008 +0000
   111.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.3 @@ -1,16 +0,0 @@
   111.4 -diff -durN gcc-3.4.6.orig/gcc/config/rs6000/linux-unwind.h gcc-3.4.6/gcc/config/rs6000/linux-unwind.h
   111.5 ---- gcc-3.4.6.orig/gcc/config/rs6000/linux-unwind.h	2005-03-17 11:41:18.000000000 +0100
   111.6 -+++ gcc-3.4.6/gcc/config/rs6000/linux-unwind.h	2007-08-15 23:07:00.000000000 +0200
   111.7 -@@ -32,6 +32,7 @@
   111.8 -    these structs elsewhere;  Many fields are missing, particularly
   111.9 -    from the end of the structures.  */
  111.10 - 
  111.11 -+#ifndef inhibit_libc
  111.12 - struct gcc_vregs
  111.13 - {
  111.14 -   __attribute__ ((vector_size (16))) int vr[32];
  111.15 -@@ -320,3 +321,4 @@
  111.16 - 									\
  111.17 -     goto SUCCESS;							\
  111.18 -   } while (0)
  111.19 -+#endif
   112.1 --- a/patches/gcc/3.4.6/810-mips-xgot.patch	Mon Jul 28 21:08:01 2008 +0000
   112.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   112.3 @@ -1,7 +0,0 @@
   112.4 -diff -durN gcc-3.4.6.orig/gcc/config/mips/t-linux gcc-3.4.6/gcc/config/mips/t-linux
   112.5 ---- gcc-3.4.6.orig/gcc/config/mips/t-linux	1970-01-01 01:00:00.000000000 +0100
   112.6 -+++ gcc-3.4.6/gcc/config/mips/t-linux	2007-08-15 23:08:15.000000000 +0200
   112.7 -@@ -0,0 +1,3 @@
   112.8 -+# Compile crtbegin/end with xgot so it works for both
   112.9 -+# normal and large GOTs.
  112.10 -+CRTSTUFF_T_CFLAGS = -mxgot
   113.1 --- a/patches/gcc/3.4.6/900-nios2.patch	Mon Jul 28 21:08:01 2008 +0000
   113.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   113.3 @@ -1,10231 +0,0 @@
   113.4 -diff -durN gcc-3.4.6.orig/gcc/combine.c gcc-3.4.6/gcc/combine.c
   113.5 ---- gcc-3.4.6.orig/gcc/combine.c	2005-08-08 20:41:04.000000000 +0200
   113.6 -+++ gcc-3.4.6/gcc/combine.c	2007-08-15 23:09:36.000000000 +0200
   113.7 -@@ -4381,6 +4381,14 @@
   113.8 - 					 mode);
   113.9 - 	    }
  113.10 - 
  113.11 -+#ifndef __nios2__
  113.12 -+/* This screws up Nios II in this test case:
  113.13 -+
  113.14 -+if (x & 1)
  113.15 -+  return 2;
  113.16 -+else
  113.17 -+  return 3;
  113.18 -+*/
  113.19 - 	  else if (STORE_FLAG_VALUE == 1
  113.20 - 		   && new_code == EQ && GET_MODE_CLASS (mode) == MODE_INT
  113.21 - 		   && op1 == const0_rtx
  113.22 -@@ -4392,6 +4400,7 @@
  113.23 - 				 gen_lowpart_for_combine (mode, op0),
  113.24 - 				 const1_rtx);
  113.25 - 	    }
  113.26 -+#endif
  113.27 - 
  113.28 - 	  else if (STORE_FLAG_VALUE == 1
  113.29 - 		   && new_code == EQ && GET_MODE_CLASS (mode) == MODE_INT
  113.30 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/crti.asm gcc-3.4.6/gcc/config/nios2/crti.asm
  113.31 ---- gcc-3.4.6.orig/gcc/config/nios2/crti.asm	1970-01-01 01:00:00.000000000 +0100
  113.32 -+++ gcc-3.4.6/gcc/config/nios2/crti.asm	2007-08-15 23:09:36.000000000 +0200
  113.33 -@@ -0,0 +1,88 @@
  113.34 -+/*
  113.35 -+  Copyright (C) 2003 
  113.36 -+ by Jonah Graham (jgraham@altera.com)
  113.37 -+
  113.38 -+This file is free software; you can redistribute it and/or modify it
  113.39 -+under the terms of the GNU General Public License as published by the
  113.40 -+Free Software Foundation; either version 2, or (at your option) any
  113.41 -+later version.
  113.42 -+
  113.43 -+In addition to the permissions in the GNU General Public License, the
  113.44 -+Free Software Foundation gives you unlimited permission to link the
  113.45 -+compiled version of this file with other programs, and to distribute
  113.46 -+those programs without any restriction coming from the use of this
  113.47 -+file.  (The General Public License restrictions do apply in other
  113.48 -+respects; for example, they cover modification of the file, and
  113.49 -+distribution when not linked into another program.)
  113.50 -+
  113.51 -+This file is distributed in the hope that it will be useful, but
  113.52 -+WITHOUT ANY WARRANTY; without even the implied warranty of
  113.53 -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  113.54 -+General Public License for more details.
  113.55 -+
  113.56 -+You should have received a copy of the GNU General Public License
  113.57 -+along with this program; see the file COPYING.  If not, write to
  113.58 -+the Free Software Foundation, 59 Temple Place - Suite 330,
  113.59 -+Boston, MA 02111-1307, USA.
  113.60 -+
  113.61 -+   As a special exception, if you link this library with files
  113.62 -+   compiled with GCC to produce an executable, this does not cause
  113.63 -+   the resulting executable to be covered by the GNU General Public License.
  113.64 -+   This exception does not however invalidate any other reasons why
  113.65 -+   the executable file might be covered by the GNU General Public License.
  113.66 -+
  113.67 -+
  113.68 -+This file just make a stack frame for the contents of the .fini and
  113.69 -+.init sections.  Users may put any desired instructions in those
  113.70 -+sections.
  113.71 -+
  113.72 -+
  113.73 -+While technically any code can be put in the init and fini sections
  113.74 -+most stuff will not work other than stuff which obeys the call frame
  113.75 -+and ABI. All the call-preserved registers are saved, the call clobbered
  113.76 -+registers should have been saved by the code calling init and fini.
  113.77 -+
  113.78 -+See crtstuff.c for an example of code that inserts itself in the 
  113.79 -+init and fini sections. 
  113.80 -+
  113.81 -+See crt0.s for the code that calls init and fini.
  113.82 -+*/
  113.83 -+
  113.84 -+	.file	"crti.asm"
  113.85 -+
  113.86 -+	.section	".init"
  113.87 -+	.align 2
  113.88 -+	.global	_init
  113.89 -+_init:
  113.90 -+	addi	sp, sp, -48
  113.91 -+	stw	ra, 44(sp)
  113.92 -+	stw	r23, 40(sp)
  113.93 -+	stw	r22, 36(sp)
  113.94 -+	stw	r21, 32(sp)
  113.95 -+	stw	r20, 28(sp)
  113.96 -+	stw	r19, 24(sp)
  113.97 -+	stw	r18, 20(sp)
  113.98 -+	stw	r17, 16(sp)
  113.99 -+	stw	r16, 12(sp)
 113.100 -+	stw	fp, 8(sp)
 113.101 -+	mov	fp, sp
 113.102 -+	
 113.103 -+	
 113.104 -+	.section	".fini"
 113.105 -+	.align	2
 113.106 -+	.global	_fini
 113.107 -+_fini:
 113.108 -+	addi	sp, sp, -48
 113.109 -+	stw	ra, 44(sp)
 113.110 -+	stw	r23, 40(sp)
 113.111 -+	stw	r22, 36(sp)
 113.112 -+	stw	r21, 32(sp)
 113.113 -+	stw	r20, 28(sp)
 113.114 -+	stw	r19, 24(sp)
 113.115 -+	stw	r18, 20(sp)
 113.116 -+	stw	r17, 16(sp)
 113.117 -+	stw	r16, 12(sp)
 113.118 -+	stw	fp, 8(sp)
 113.119 -+	mov	fp, sp
 113.120 -+	
 113.121 -+
 113.122 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/crtn.asm gcc-3.4.6/gcc/config/nios2/crtn.asm
 113.123 ---- gcc-3.4.6.orig/gcc/config/nios2/crtn.asm	1970-01-01 01:00:00.000000000 +0100
 113.124 -+++ gcc-3.4.6/gcc/config/nios2/crtn.asm	2007-08-15 23:09:36.000000000 +0200
 113.125 -@@ -0,0 +1,70 @@
 113.126 -+/*
 113.127 -+  Copyright (C) 2003 
 113.128 -+ by Jonah Graham (jgraham@altera.com)
 113.129 -+
 113.130 -+This file is free software; you can redistribute it and/or modify it
 113.131 -+under the terms of the GNU General Public License as published by the
 113.132 -+Free Software Foundation; either version 2, or (at your option) any
 113.133 -+later version.
 113.134 -+
 113.135 -+In addition to the permissions in the GNU General Public License, the
 113.136 -+Free Software Foundation gives you unlimited permission to link the
 113.137 -+compiled version of this file with other programs, and to distribute
 113.138 -+those programs without any restriction coming from the use of this
 113.139 -+file.  (The General Public License restrictions do apply in other
 113.140 -+respects; for example, they cover modification of the file, and
 113.141 -+distribution when not linked into another program.)
 113.142 -+
 113.143 -+This file is distributed in the hope that it will be useful, but
 113.144 -+WITHOUT ANY WARRANTY; without even the implied warranty of
 113.145 -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 113.146 -+General Public License for more details.
 113.147 -+
 113.148 -+You should have received a copy of the GNU General Public License
 113.149 -+along with this program; see the file COPYING.  If not, write to
 113.150 -+the Free Software Foundation, 59 Temple Place - Suite 330,
 113.151 -+Boston, MA 02111-1307, USA.
 113.152 -+
 113.153 -+   As a special exception, if you link this library with files
 113.154 -+   compiled with GCC to produce an executable, this does not cause
 113.155 -+   the resulting executable to be covered by the GNU General Public License.
 113.156 -+   This exception does not however invalidate any other reasons why
 113.157 -+   the executable file might be covered by the GNU General Public License.
 113.158 -+
 113.159 -+
 113.160 -+This file just makes sure that the .fini and .init sections do in
 113.161 -+fact return.  Users may put any desired instructions in those sections.
 113.162 -+This file is the last thing linked into any executable.
 113.163 -+*/	
 113.164 -+	.file	"crtn.asm"
 113.165 -+
 113.166 -+
 113.167 -+
 113.168 -+	.section	".init"
 113.169 -+	ldw	ra, 44(sp)
 113.170 -+	ldw	r23, 40(sp)
 113.171 -+	ldw	r22, 36(sp)
 113.172 -+	ldw	r21, 32(sp)
 113.173 -+	ldw	r20, 28(sp)
 113.174 -+	ldw	r19, 24(sp)
 113.175 -+	ldw	r18, 20(sp)
 113.176 -+	ldw	r17, 16(sp)
 113.177 -+	ldw	r16, 12(sp)
 113.178 -+	ldw	fp, 8(sp)
 113.179 -+	addi	sp, sp, -48
 113.180 -+	ret
 113.181 -+	
 113.182 -+	.section	".fini"
 113.183 -+	ldw	ra, 44(sp)
 113.184 -+	ldw	r23, 40(sp)
 113.185 -+	ldw	r22, 36(sp)
 113.186 -+	ldw	r21, 32(sp)
 113.187 -+	ldw	r20, 28(sp)
 113.188 -+	ldw	r19, 24(sp)
 113.189 -+	ldw	r18, 20(sp)
 113.190 -+	ldw	r17, 16(sp)
 113.191 -+	ldw	r16, 12(sp)
 113.192 -+	ldw	fp, 8(sp)
 113.193 -+	addi	sp, sp, -48
 113.194 -+	ret
 113.195 -+	
 113.196 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/lib2-divmod.c gcc-3.4.6/gcc/config/nios2/lib2-divmod.c
 113.197 ---- gcc-3.4.6.orig/gcc/config/nios2/lib2-divmod.c	1970-01-01 01:00:00.000000000 +0100
 113.198 -+++ gcc-3.4.6/gcc/config/nios2/lib2-divmod.c	2007-08-15 23:09:36.000000000 +0200
 113.199 -@@ -0,0 +1,126 @@
 113.200 -+
 113.201 -+/* We include auto-host.h here to get HAVE_GAS_HIDDEN.  This is
 113.202 -+   supposedly valid even though this is a "target" file.  */
 113.203 -+#include "auto-host.h"
 113.204 -+
 113.205 -+
 113.206 -+#include "tconfig.h"
 113.207 -+#include "tsystem.h"
 113.208 -+#include "coretypes.h"
 113.209 -+#include "tm.h"
 113.210 -+
 113.211 -+
 113.212 -+/* Don't use `fancy_abort' here even if config.h says to use it.  */
 113.213 -+#ifdef abort
 113.214 -+#undef abort
 113.215 -+#endif
 113.216 -+
 113.217 -+
 113.218 -+#ifdef HAVE_GAS_HIDDEN
 113.219 -+#define ATTRIBUTE_HIDDEN  __attribute__ ((__visibility__ ("hidden")))
 113.220 -+#else
 113.221 -+#define ATTRIBUTE_HIDDEN
 113.222 -+#endif
 113.223 -+
 113.224 -+#include "libgcc2.h"
 113.225 -+
 113.226 -+extern SItype __modsi3 (SItype, SItype);
 113.227 -+extern SItype __divsi3 (SItype, SItype);
 113.228 -+extern SItype __umodsi3 (SItype, SItype);
 113.229 -+extern SItype __udivsi3 (SItype, SItype);
 113.230 -+
 113.231 -+static USItype udivmodsi4(USItype, USItype, word_type);
 113.232 -+
 113.233 -+/* 16-bit SI divide and modulo as used in NIOS */
 113.234 -+
 113.235 -+
 113.236 -+static USItype
 113.237 -+udivmodsi4(USItype num, USItype den, word_type modwanted)
 113.238 -+{
 113.239 -+  USItype bit = 1;
 113.240 -+  USItype res = 0;
 113.241 -+
 113.242 -+  while (den < num && bit && !(den & (1L<<31)))
 113.243 -+    {
 113.244 -+      den <<=1;
 113.245 -+      bit <<=1;
 113.246 -+    }
 113.247 -+  while (bit)
 113.248 -+    {
 113.249 -+      if (num >= den)
 113.250 -+	{
 113.251 -+	  num -= den;
 113.252 -+	  res |= bit;
 113.253 -+	}
 113.254 -+      bit >>=1;
 113.255 -+      den >>=1;
 113.256 -+    }
 113.257 -+  if (modwanted) return num;
 113.258 -+  return res;
 113.259 -+}
 113.260 -+
 113.261 -+
 113.262 -+SItype
 113.263 -+__divsi3 (SItype a, SItype b)
 113.264 -+{
 113.265 -+  word_type neg = 0;
 113.266 -+  SItype res;
 113.267 -+
 113.268 -+  if (a < 0)
 113.269 -+    {
 113.270 -+      a = -a;
 113.271 -+      neg = !neg;
 113.272 -+    }
 113.273 -+
 113.274 -+  if (b < 0)
 113.275 -+    {
 113.276 -+      b = -b;
 113.277 -+      neg = !neg;
 113.278 -+    }
 113.279 -+
 113.280 -+  res = udivmodsi4 (a, b, 0);
 113.281 -+
 113.282 -+  if (neg)
 113.283 -+    res = -res;
 113.284 -+
 113.285 -+  return res;
 113.286 -+}
 113.287 -+
 113.288 -+
 113.289 -+SItype
 113.290 -+__modsi3 (SItype a, SItype b)
 113.291 -+{
 113.292 -+  word_type neg = 0;
 113.293 -+  SItype res;
 113.294 -+
 113.295 -+  if (a < 0)
 113.296 -+    {
 113.297 -+      a = -a;
 113.298 -+      neg = 1;
 113.299 -+    }
 113.300 -+
 113.301 -+  if (b < 0)
 113.302 -+    b = -b;
 113.303 -+
 113.304 -+  res = udivmodsi4 (a, b, 1);
 113.305 -+
 113.306 -+  if (neg)
 113.307 -+    res = -res;
 113.308 -+
 113.309 -+  return res;
 113.310 -+}
 113.311 -+
 113.312 -+
 113.313 -+SItype
 113.314 -+__udivsi3 (SItype a, SItype b)
 113.315 -+{
 113.316 -+  return udivmodsi4 (a, b, 0);
 113.317 -+}
 113.318 -+
 113.319 -+
 113.320 -+SItype
 113.321 -+__umodsi3 (SItype a, SItype b)
 113.322 -+{
 113.323 -+  return udivmodsi4 (a, b, 1);
 113.324 -+}
 113.325 -+
 113.326 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/lib2-divmod-hi.c gcc-3.4.6/gcc/config/nios2/lib2-divmod-hi.c
 113.327 ---- gcc-3.4.6.orig/gcc/config/nios2/lib2-divmod-hi.c	1970-01-01 01:00:00.000000000 +0100
 113.328 -+++ gcc-3.4.6/gcc/config/nios2/lib2-divmod-hi.c	2007-08-15 23:09:36.000000000 +0200
 113.329 -@@ -0,0 +1,123 @@
 113.330 -+
 113.331 -+/* We include auto-host.h here to get HAVE_GAS_HIDDEN.  This is
 113.332 -+   supposedly valid even though this is a "target" file.  */
 113.333 -+#include "auto-host.h"
 113.334 -+
 113.335 -+
 113.336 -+#include "tconfig.h"
 113.337 -+#include "tsystem.h"
 113.338 -+#include "coretypes.h"
 113.339 -+#include "tm.h"
 113.340 -+
 113.341 -+
 113.342 -+/* Don't use `fancy_abort' here even if config.h says to use it.  */
 113.343 -+#ifdef abort
 113.344 -+#undef abort
 113.345 -+#endif
 113.346 -+
 113.347 -+
 113.348 -+#ifdef HAVE_GAS_HIDDEN
 113.349 -+#define ATTRIBUTE_HIDDEN  __attribute__ ((__visibility__ ("hidden")))
 113.350 -+#else
 113.351 -+#define ATTRIBUTE_HIDDEN
 113.352 -+#endif
 113.353 -+
 113.354 -+#include "libgcc2.h"
 113.355 -+
 113.356 -+extern HItype __modhi3 (HItype, HItype);
 113.357 -+extern HItype __divhi3 (HItype, HItype);
 113.358 -+extern HItype __umodhi3 (HItype, HItype);
 113.359 -+extern HItype __udivhi3 (HItype, HItype);
 113.360 -+
 113.361 -+static UHItype udivmodhi4(UHItype, UHItype, word_type);
 113.362 -+
 113.363 -+static UHItype
 113.364 -+udivmodhi4(UHItype num, UHItype den, word_type modwanted)
 113.365 -+{
 113.366 -+  UHItype bit = 1;
 113.367 -+  UHItype res = 0;
 113.368 -+
 113.369 -+  while (den < num && bit && !(den & (1L<<15)))
 113.370 -+    {
 113.371 -+      den <<=1;
 113.372 -+      bit <<=1;
 113.373 -+    }
 113.374 -+  while (bit)
 113.375 -+    {
 113.376 -+      if (num >= den)
 113.377 -+	{
 113.378 -+	  num -= den;
 113.379 -+	  res |= bit;
 113.380 -+	}
 113.381 -+      bit >>=1;
 113.382 -+      den >>=1;
 113.383 -+    }
 113.384 -+  if (modwanted) return num;
 113.385 -+  return res;
 113.386 -+}
 113.387 -+
 113.388 -+
 113.389 -+HItype
 113.390 -+__divhi3 (HItype a, HItype b)
 113.391 -+{
 113.392 -+  word_type neg = 0;
 113.393 -+  HItype res;
 113.394 -+
 113.395 -+  if (a < 0)
 113.396 -+    {
 113.397 -+      a = -a;
 113.398 -+      neg = !neg;
 113.399 -+    }
 113.400 -+
 113.401 -+  if (b < 0)
 113.402 -+    {
 113.403 -+      b = -b;
 113.404 -+      neg = !neg;
 113.405 -+    }
 113.406 -+
 113.407 -+  res = udivmodhi4 (a, b, 0);
 113.408 -+
 113.409 -+  if (neg)
 113.410 -+    res = -res;
 113.411 -+
 113.412 -+  return res;
 113.413 -+}
 113.414 -+
 113.415 -+
 113.416 -+HItype
 113.417 -+__modhi3 (HItype a, HItype b)
 113.418 -+{
 113.419 -+  word_type neg = 0;
 113.420 -+  HItype res;
 113.421 -+
 113.422 -+  if (a < 0)
 113.423 -+    {
 113.424 -+      a = -a;
 113.425 -+      neg = 1;
 113.426 -+    }
 113.427 -+
 113.428 -+  if (b < 0)
 113.429 -+    b = -b;
 113.430 -+
 113.431 -+  res = udivmodhi4 (a, b, 1);
 113.432 -+
 113.433 -+  if (neg)
 113.434 -+    res = -res;
 113.435 -+
 113.436 -+  return res;
 113.437 -+}
 113.438 -+
 113.439 -+
 113.440 -+HItype
 113.441 -+__udivhi3 (HItype a, HItype b)
 113.442 -+{
 113.443 -+  return udivmodhi4 (a, b, 0);
 113.444 -+}
 113.445 -+
 113.446 -+
 113.447 -+HItype
 113.448 -+__umodhi3 (HItype a, HItype b)
 113.449 -+{
 113.450 -+  return udivmodhi4 (a, b, 1);
 113.451 -+}
 113.452 -+
 113.453 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/lib2-divtable.c gcc-3.4.6/gcc/config/nios2/lib2-divtable.c
 113.454 ---- gcc-3.4.6.orig/gcc/config/nios2/lib2-divtable.c	1970-01-01 01:00:00.000000000 +0100
 113.455 -+++ gcc-3.4.6/gcc/config/nios2/lib2-divtable.c	2007-08-15 23:09:36.000000000 +0200
 113.456 -@@ -0,0 +1,46 @@
 113.457 -+
 113.458 -+/* We include auto-host.h here to get HAVE_GAS_HIDDEN.  This is
 113.459 -+   supposedly valid even though this is a "target" file.  */
 113.460 -+#include "auto-host.h"
 113.461 -+
 113.462 -+
 113.463 -+#include "tconfig.h"
 113.464 -+#include "tsystem.h"
 113.465 -+#include "coretypes.h"
 113.466 -+#include "tm.h"
 113.467 -+
 113.468 -+
 113.469 -+/* Don't use `fancy_abort' here even if config.h says to use it.  */
 113.470 -+#ifdef abort
 113.471 -+#undef abort
 113.472 -+#endif
 113.473 -+
 113.474 -+
 113.475 -+#ifdef HAVE_GAS_HIDDEN
 113.476 -+#define ATTRIBUTE_HIDDEN  __attribute__ ((__visibility__ ("hidden")))
 113.477 -+#else
 113.478 -+#define ATTRIBUTE_HIDDEN
 113.479 -+#endif
 113.480 -+
 113.481 -+#include "libgcc2.h"
 113.482 -+
 113.483 -+UQItype __divsi3_table[] =
 113.484 -+{
 113.485 -+  0, 0/1, 0/2, 0/3, 0/4, 0/5, 0/6, 0/7, 0/8, 0/9, 0/10, 0/11, 0/12, 0/13, 0/14, 0/15,
 113.486 -+  0, 1/1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10, 1/11, 1/12, 1/13, 1/14, 1/15,
 113.487 -+  0, 2/1, 2/2, 2/3, 2/4, 2/5, 2/6, 2/7, 2/8, 2/9, 2/10, 2/11, 2/12, 2/13, 2/14, 2/15,
 113.488 -+  0, 3/1, 3/2, 3/3, 3/4, 3/5, 3/6, 3/7, 3/8, 3/9, 3/10, 3/11, 3/12, 3/13, 3/14, 3/15,
 113.489 -+  0, 4/1, 4/2, 4/3, 4/4, 4/5, 4/6, 4/7, 4/8, 4/9, 4/10, 4/11, 4/12, 4/13, 4/14, 4/15,
 113.490 -+  0, 5/1, 5/2, 5/3, 5/4, 5/5, 5/6, 5/7, 5/8, 5/9, 5/10, 5/11, 5/12, 5/13, 5/14, 5/15,
 113.491 -+  0, 6/1, 6/2, 6/3, 6/4, 6/5, 6/6, 6/7, 6/8, 6/9, 6/10, 6/11, 6/12, 6/13, 6/14, 6/15,
 113.492 -+  0, 7/1, 7/2, 7/3, 7/4, 7/5, 7/6, 7/7, 7/8, 7/9, 7/10, 7/11, 7/12, 7/13, 7/14, 7/15,
 113.493 -+  0, 8/1, 8/2, 8/3, 8/4, 8/5, 8/6, 8/7, 8/8, 8/9, 8/10, 8/11, 8/12, 8/13, 8/14, 8/15,
 113.494 -+  0, 9/1, 9/2, 9/3, 9/4, 9/5, 9/6, 9/7, 9/8, 9/9, 9/10, 9/11, 9/12, 9/13, 9/14, 9/15,
 113.495 -+  0, 10/1, 10/2, 10/3, 10/4, 10/5, 10/6, 10/7, 10/8, 10/9, 10/10, 10/11, 10/12, 10/13, 10/14, 10/15,
 113.496 -+  0, 11/1, 11/2, 11/3, 11/4, 11/5, 11/6, 11/7, 11/8, 11/9, 11/10, 11/11, 11/12, 11/13, 11/14, 11/15,
 113.497 -+  0, 12/1, 12/2, 12/3, 12/4, 12/5, 12/6, 12/7, 12/8, 12/9, 12/10, 12/11, 12/12, 12/13, 12/14, 12/15,
 113.498 -+  0, 13/1, 13/2, 13/3, 13/4, 13/5, 13/6, 13/7, 13/8, 13/9, 13/10, 13/11, 13/12, 13/13, 13/14, 13/15,
 113.499 -+  0, 14/1, 14/2, 14/3, 14/4, 14/5, 14/6, 14/7, 14/8, 14/9, 14/10, 14/11, 14/12, 14/13, 14/14, 14/15,
 113.500 -+  0, 15/1, 15/2, 15/3, 15/4, 15/5, 15/6, 15/7, 15/8, 15/9, 15/10, 15/11, 15/12, 15/13, 15/14, 15/15,
 113.501 -+};
 113.502 -+
 113.503 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/lib2-mul.c gcc-3.4.6/gcc/config/nios2/lib2-mul.c
 113.504 ---- gcc-3.4.6.orig/gcc/config/nios2/lib2-mul.c	1970-01-01 01:00:00.000000000 +0100
 113.505 -+++ gcc-3.4.6/gcc/config/nios2/lib2-mul.c	2007-08-15 23:09:36.000000000 +0200
 113.506 -@@ -0,0 +1,103 @@
 113.507 -+/* while we are debugging (ie compile outside of gcc build) 
 113.508 -+   disable gcc specific headers */
 113.509 -+#ifndef DEBUG_MULSI3
 113.510 -+
 113.511 -+
 113.512 -+/* We include auto-host.h here to get HAVE_GAS_HIDDEN.  This is
 113.513 -+   supposedly valid even though this is a "target" file.  */
 113.514 -+#include "auto-host.h"
 113.515 -+
 113.516 -+
 113.517 -+#include "tconfig.h"
 113.518 -+#include "tsystem.h"
 113.519 -+#include "coretypes.h"
 113.520 -+#include "tm.h"
 113.521 -+
 113.522 -+
 113.523 -+/* Don't use `fancy_abort' here even if config.h says to use it.  */
 113.524 -+#ifdef abort
 113.525 -+#undef abort
 113.526 -+#endif
 113.527 -+
 113.528 -+
 113.529 -+#ifdef HAVE_GAS_HIDDEN
 113.530 -+#define ATTRIBUTE_HIDDEN  __attribute__ ((__visibility__ ("hidden")))
 113.531 -+#else
 113.532 -+#define ATTRIBUTE_HIDDEN
 113.533 -+#endif
 113.534 -+
 113.535 -+#include "libgcc2.h"
 113.536 -+
 113.537 -+#else
 113.538 -+#define SItype int
 113.539 -+#define USItype unsigned int
 113.540 -+#endif
 113.541 -+
 113.542 -+
 113.543 -+extern SItype __mulsi3 (SItype, SItype);
 113.544 -+
 113.545 -+SItype
 113.546 -+__mulsi3 (SItype a, SItype b)
 113.547 -+{
 113.548 -+  SItype res = 0;
 113.549 -+  USItype cnt = a;
 113.550 -+  
 113.551 -+  while (cnt)
 113.552 -+    {
 113.553 -+      if (cnt & 1)
 113.554 -+        {
 113.555 -+	  res += b;	  
 113.556 -+	}
 113.557 -+      b <<= 1;
 113.558 -+      cnt >>= 1;
 113.559 -+    }
 113.560 -+    
 113.561 -+  return res;
 113.562 -+}
 113.563 -+/*
 113.564 -+TODO: Choose best alternative implementation.
 113.565 -+
 113.566 -+SItype
 113.567 -+__divsi3 (SItype a, SItype b)
 113.568 -+{
 113.569 -+  SItype res = 0;
 113.570 -+  USItype cnt = 0;
 113.571 -+  
 113.572 -+  while (cnt < 32)
 113.573 -+    {
 113.574 -+      if (a & (1L << cnt))
 113.575 -+        {
 113.576 -+	  res += b;	  
 113.577 -+	}
 113.578 -+      b <<= 1;
 113.579 -+      cnt++;
 113.580 -+    }
 113.581 -+    
 113.582 -+  return res;
 113.583 -+}
 113.584 -+*/
 113.585 -+
 113.586 -+
 113.587 -+#ifdef DEBUG_MULSI3
 113.588 -+
 113.589 -+int
 113.590 -+main ()
 113.591 -+{
 113.592 -+  int i, j;
 113.593 -+  int error = 0;
 113.594 -+  
 113.595 -+  for (i = -1000; i < 1000; i++)
 113.596 -+    for (j = -1000; j < 1000; j++)
 113.597 -+      {
 113.598 -+	int expect = i * j;
 113.599 -+	int actual = A__divsi3 (i, j);
 113.600 -+	if (expect != actual)
 113.601 -+	  {
 113.602 -+	    printf ("error: %d * %d = %d not %d\n", i, j, expect, actual);
 113.603 -+	    error = 1;
 113.604 -+	  }
 113.605 -+      }
 113.606 -+
 113.607 -+  return error;
 113.608 -+}
 113.609 -+#endif
 113.610 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2.c gcc-3.4.6/gcc/config/nios2/nios2.c
 113.611 ---- gcc-3.4.6.orig/gcc/config/nios2/nios2.c	1970-01-01 01:00:00.000000000 +0100
 113.612 -+++ gcc-3.4.6/gcc/config/nios2/nios2.c	2007-08-15 23:09:36.000000000 +0200
 113.613 -@@ -0,0 +1,2853 @@
 113.614 -+/* Subroutines for assembler code output for Altera NIOS 2G NIOS2 version.
 113.615 -+   Copyright (C) 2003 Altera
 113.616 -+   Contributed by Jonah Graham (jgraham@altera.com).
 113.617 -+
 113.618 -+This file is part of GNU CC.
 113.619 -+
 113.620 -+GNU CC is free software; you can redistribute it and/or modify
 113.621 -+it under the terms of the GNU General Public License as published by
 113.622 -+the Free Software Foundation; either version 2, or (at your option)
 113.623 -+any later version.
 113.624 -+
 113.625 -+GNU CC is distributed in the hope that it will be useful,
 113.626 -+but WITHOUT ANY WARRANTY; without even the implied warranty of
 113.627 -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 113.628 -+GNU General Public License for more details.
 113.629 -+
 113.630 -+You should have received a copy of the GNU General Public License
 113.631 -+along with GNU CC; see the file COPYING.  If not, write to
 113.632 -+the Free Software Foundation, 59 Temple Place - Suite 330,
 113.633 -+Boston, MA 02111-1307, USA.  */
 113.634 -+
 113.635 -+
 113.636 -+#include <stdio.h>
 113.637 -+#include "config.h"
 113.638 -+#include "system.h"
 113.639 -+#include "coretypes.h"
 113.640 -+#include "tm.h"
 113.641 -+#include "rtl.h"
 113.642 -+#include "tree.h"
 113.643 -+#include "tm_p.h"
 113.644 -+#include "regs.h"
 113.645 -+#include "hard-reg-set.h"
 113.646 -+#include "real.h"
 113.647 -+#include "insn-config.h"
 113.648 -+#include "conditions.h"
 113.649 -+#include "output.h"
 113.650 -+#include "insn-attr.h"
 113.651 -+#include "flags.h"
 113.652 -+#include "recog.h"
 113.653 -+#include "expr.h"
 113.654 -+#include "toplev.h"
 113.655 -+#include "basic-block.h"
 113.656 -+#include "function.h"
 113.657 -+#include "ggc.h"
 113.658 -+#include "reload.h"
 113.659 -+#include "debug.h"
 113.660 -+#include "optabs.h"
 113.661 -+#include "target.h"
 113.662 -+#include "target-def.h"
 113.663 -+
 113.664 -+/* local prototypes */
 113.665 -+static bool nios2_rtx_costs (rtx, int, int, int *);
 113.666 -+
 113.667 -+static void nios2_asm_function_prologue (FILE *, HOST_WIDE_INT);
 113.668 -+static int nios2_use_dfa_pipeline_interface (void);
 113.669 -+static int nios2_issue_rate (void);
 113.670 -+static struct machine_function *nios2_init_machine_status (void);
 113.671 -+static bool nios2_in_small_data_p (tree);
 113.672 -+static rtx save_reg (int, HOST_WIDE_INT, rtx);
 113.673 -+static rtx restore_reg (int, HOST_WIDE_INT);
 113.674 -+static unsigned int nios2_section_type_flags (tree, const char *, int);
 113.675 -+static void nios2_init_builtins (void);
 113.676 -+static rtx nios2_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
 113.677 -+static bool nios2_function_ok_for_sibcall (tree, tree);
 113.678 -+static void nios2_encode_section_info (tree, rtx, int);
 113.679 -+
 113.680 -+/* Initialize the GCC target structure.  */
 113.681 -+#undef TARGET_ASM_FUNCTION_PROLOGUE
 113.682 -+#define TARGET_ASM_FUNCTION_PROLOGUE nios2_asm_function_prologue
 113.683 -+
 113.684 -+#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
 113.685 -+#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE \
 113.686 -+ nios2_use_dfa_pipeline_interface
 113.687 -+#undef TARGET_SCHED_ISSUE_RATE
 113.688 -+#define TARGET_SCHED_ISSUE_RATE nios2_issue_rate
 113.689 -+#undef TARGET_IN_SMALL_DATA_P
 113.690 -+#define TARGET_IN_SMALL_DATA_P nios2_in_small_data_p
 113.691 -+#undef  TARGET_ENCODE_SECTION_INFO
 113.692 -+#define TARGET_ENCODE_SECTION_INFO nios2_encode_section_info
 113.693 -+#undef  TARGET_SECTION_TYPE_FLAGS
 113.694 -+#define TARGET_SECTION_TYPE_FLAGS  nios2_section_type_flags
 113.695 -+
 113.696 -+#undef TARGET_INIT_BUILTINS
 113.697 -+#define TARGET_INIT_BUILTINS nios2_init_builtins
 113.698 -+#undef TARGET_EXPAND_BUILTIN
 113.699 -+#define TARGET_EXPAND_BUILTIN nios2_expand_builtin
 113.700 -+
 113.701 -+#undef TARGET_FUNCTION_OK_FOR_SIBCALL
 113.702 -+#define TARGET_FUNCTION_OK_FOR_SIBCALL nios2_function_ok_for_sibcall
 113.703 -+
 113.704 -+#undef TARGET_RTX_COSTS
 113.705 -+#define TARGET_RTX_COSTS nios2_rtx_costs
 113.706 -+
 113.707 -+
 113.708 -+struct gcc_target targetm = TARGET_INITIALIZER;
 113.709 -+
 113.710 -+
 113.711 -+
 113.712 -+/* Threshold for data being put into the small data/bss area, instead
 113.713 -+   of the normal data area (references to the small data/bss area take
 113.714 -+   1 instruction, and use the global pointer, references to the normal
 113.715 -+   data area takes 2 instructions).  */
 113.716 -+unsigned HOST_WIDE_INT nios2_section_threshold = NIOS2_DEFAULT_GVALUE;
 113.717 -+
 113.718 -+
 113.719 -+/* Structure to be filled in by compute_frame_size with register
 113.720 -+   save masks, and offsets for the current function.  */
 113.721 -+
 113.722 -+struct nios2_frame_info
 113.723 -+GTY (())
 113.724 -+{
 113.725 -+  long total_size;		/* # bytes that the entire frame takes up */
 113.726 -+  long var_size;		/* # bytes that variables take up */
 113.727 -+  long args_size;		/* # bytes that outgoing arguments take up */
 113.728 -+  int save_reg_size;		/* # bytes needed to store gp regs */
 113.729 -+  int save_reg_rounded;		/* # bytes needed to store gp regs */
 113.730 -+  long save_regs_offset;	/* offset from new sp to store gp registers */
 113.731 -+  int initialized;		/* != 0 if frame size already calculated */
 113.732 -+  int num_regs;			/* number of gp registers saved */
 113.733 -+};
 113.734 -+
 113.735 -+struct machine_function
 113.736 -+GTY (())
 113.737 -+{
 113.738 -+
 113.739 -+  /* Current frame information, calculated by compute_frame_size.  */
 113.740 -+  struct nios2_frame_info frame;
 113.741 -+};
 113.742 -+
 113.743 -+
 113.744 -+/***************************************
 113.745 -+ * Section encodings
 113.746 -+ ***************************************/
 113.747 -+
 113.748 -+
 113.749 -+
 113.750 -+
 113.751 -+
 113.752 -+/***************************************
 113.753 -+ * Stack Layout and Calling Conventions
 113.754 -+ ***************************************/
 113.755 -+
 113.756 -+
 113.757 -+#define TOO_BIG_OFFSET(X) ((X) > ((1 << 15) - 1))
 113.758 -+#define TEMP_REG_NUM 8
 113.759 -+
 113.760 -+static void
 113.761 -+nios2_asm_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
 113.762 -+{
 113.763 -+  if (flag_verbose_asm || flag_debug_asm)
 113.764 -+    {
 113.765 -+      compute_frame_size ();
 113.766 -+      dump_frame_size (file);
 113.767 -+    }
 113.768 -+}
 113.769 -+
 113.770 -+static rtx
 113.771 -+save_reg (int regno, HOST_WIDE_INT offset, rtx cfa_store_reg)
 113.772 -+{
 113.773 -+  rtx insn, stack_slot;
 113.774 -+
 113.775 -+  stack_slot = gen_rtx_PLUS (SImode,
 113.776 -+			     cfa_store_reg,
 113.777 -+			     GEN_INT (offset));
 113.778 -+
 113.779 -+  insn = emit_insn (gen_rtx_SET (SImode,
 113.780 -+				 gen_rtx_MEM (SImode, stack_slot),
 113.781 -+				 gen_rtx_REG (SImode, regno)));
 113.782 -+
 113.783 -+  RTX_FRAME_RELATED_P (insn) = 1;
 113.784 -+
 113.785 -+  return insn;
 113.786 -+}
 113.787 -+
 113.788 -+static rtx
 113.789 -+restore_reg (int regno, HOST_WIDE_INT offset)
 113.790 -+{
 113.791 -+  rtx insn, stack_slot;
 113.792 -+
 113.793 -+  if (TOO_BIG_OFFSET (offset))
 113.794 -+    {
 113.795 -+      stack_slot = gen_rtx_REG (SImode, TEMP_REG_NUM);
 113.796 -+      insn = emit_insn (gen_rtx_SET (SImode,
 113.797 -+				     stack_slot,
 113.798 -+				     GEN_INT (offset)));
 113.799 -+
 113.800 -+      insn = emit_insn (gen_rtx_SET (SImode,
 113.801 -+				     stack_slot,
 113.802 -+                                     gen_rtx_PLUS (SImode,
 113.803 -+				                   stack_slot,
 113.804 -+				                   stack_pointer_rtx)));
 113.805 -+    }
 113.806 -+  else
 113.807 -+    {
 113.808 -+      stack_slot = gen_rtx_PLUS (SImode,
 113.809 -+			         stack_pointer_rtx,
 113.810 -+				 GEN_INT (offset));
 113.811 -+    }
 113.812 -+
 113.813 -+  stack_slot = gen_rtx_MEM (SImode, stack_slot);
 113.814 -+
 113.815 -+  insn = emit_move_insn (gen_rtx_REG (SImode, regno), stack_slot);
 113.816 -+
 113.817 -+  return insn;
 113.818 -+}
 113.819 -+
 113.820 -+
 113.821 -+/* There are two possible paths for prologue expansion,
 113.822 -+- the first is if the total frame size is < 2^15-1. In that
 113.823 -+case all the immediates will fit into the 16-bit immediate
 113.824 -+fields.
 113.825 -+- the second is when the frame size is too big, in that
 113.826 -+case an additional temporary register is used, first 
 113.827 -+as a cfa_temp to offset the sp, second as the cfa_store
 113.828 -+register.
 113.829 -+
 113.830 -+See the comment above dwarf2out_frame_debug_expr in 
 113.831 -+dwarf2out.c for more explanation of the "rules."
 113.832 -+
 113.833 -+
 113.834 -+Case 1:
 113.835 -+Rule #  Example Insn                       Effect
 113.836 -+2  	addi	sp, sp, -total_frame_size  cfa.reg=sp, cfa.offset=total_frame_size
 113.837 -+                                           cfa_store.reg=sp, cfa_store.offset=total_frame_size
 113.838 -+12  	stw	ra, offset(sp)		   
 113.839 -+12  	stw	r16, offset(sp)
 113.840 -+1  	mov	fp, sp
 113.841 -+  
 113.842 -+Case 2: 
 113.843 -+Rule #  Example Insn                       Effect
 113.844 -+6 	movi	r8, total_frame_size       cfa_temp.reg=r8, cfa_temp.offset=total_frame_size
 113.845 -+2  	sub	sp, sp, r8                 cfa.reg=sp, cfa.offset=total_frame_size
 113.846 -+                                           cfa_store.reg=sp, cfa_store.offset=total_frame_size
 113.847 -+5   	add	r8, r8, sp                 cfa_store.reg=r8, cfa_store.offset=0
 113.848 -+12  	stw	ra, offset(r8)
 113.849 -+12  	stw	r16, offset(r8)
 113.850 -+1  	mov	fp, sp
 113.851 -+
 113.852 -+*/
 113.853 -+
 113.854 -+void
 113.855 -+expand_prologue ()
 113.856 -+{
 113.857 -+  int i;
 113.858 -+  HOST_WIDE_INT total_frame_size;
 113.859 -+  int cfa_store_offset;
 113.860 -+  rtx insn;
 113.861 -+  rtx cfa_store_reg = 0;
 113.862 -+
 113.863 -+  total_frame_size = compute_frame_size ();
 113.864 -+
 113.865 -+  if (total_frame_size)
 113.866 -+    {
 113.867 -+
 113.868 -+      if (TOO_BIG_OFFSET (total_frame_size)) 
 113.869 -+	{
 113.870 -+	    /* cfa_temp and cfa_store_reg are the same register,
 113.871 -+	       cfa_store_reg overwrites cfa_temp */
 113.872 -+	    cfa_store_reg = gen_rtx_REG (SImode, TEMP_REG_NUM);
 113.873 -+	    insn = emit_insn (gen_rtx_SET (SImode,
 113.874 -+					   cfa_store_reg,
 113.875 -+					   GEN_INT (total_frame_size)));
 113.876 -+
 113.877 -+	    RTX_FRAME_RELATED_P (insn) = 1;
 113.878 -+
 113.879 -+
 113.880 -+	    insn = gen_rtx_SET (SImode,
 113.881 -+				stack_pointer_rtx,
 113.882 -+				gen_rtx_MINUS (SImode,
 113.883 -+					       stack_pointer_rtx,
 113.884 -+					       cfa_store_reg));
 113.885 -+
 113.886 -+	    insn = emit_insn (insn);
 113.887 -+	    RTX_FRAME_RELATED_P (insn) = 1;
 113.888 -+
 113.889 -+
 113.890 -+	    /* if there are no registers to save, I don't need to
 113.891 -+	       create a cfa_store */
 113.892 -+	    if (cfun->machine->frame.save_reg_size) 
 113.893 -+	      {
 113.894 -+		insn = gen_rtx_SET (SImode,
 113.895 -+				    cfa_store_reg,
 113.896 -+				    gen_rtx_PLUS (SImode,
 113.897 -+						  cfa_store_reg,
 113.898 -+						  stack_pointer_rtx));
 113.899 -+
 113.900 -+		insn = emit_insn (insn);
 113.901 -+		RTX_FRAME_RELATED_P (insn) = 1;
 113.902 -+	      }
 113.903 -+
 113.904 -+	    cfa_store_offset 
 113.905 -+	      = total_frame_size 
 113.906 -+		- (cfun->machine->frame.save_regs_offset
 113.907 -+		   + cfun->machine->frame.save_reg_rounded);
 113.908 -+	}
 113.909 -+      else
 113.910 -+	{
 113.911 -+	    insn = gen_rtx_SET (SImode,
 113.912 -+				stack_pointer_rtx,
 113.913 -+				gen_rtx_PLUS (SImode,
 113.914 -+					      stack_pointer_rtx,
 113.915 -+					      GEN_INT (-total_frame_size)));
 113.916 -+	    insn = emit_insn (insn);
 113.917 -+	    RTX_FRAME_RELATED_P (insn) = 1;
 113.918 -+
 113.919 -+	    cfa_store_reg = stack_pointer_rtx;
 113.920 -+	    cfa_store_offset 
 113.921 -+	      = cfun->machine->frame.save_regs_offset
 113.922 -+		+ cfun->machine->frame.save_reg_rounded;
 113.923 -+	}
 113.924 -+    }
 113.925 -+
 113.926 -+  if (MUST_SAVE_REGISTER (RA_REGNO))
 113.927 -+    {
 113.928 -+      cfa_store_offset -= 4;
 113.929 -+      save_reg (RA_REGNO, cfa_store_offset, cfa_store_reg);
 113.930 -+    }
 113.931 -+  if (MUST_SAVE_REGISTER (FP_REGNO))
 113.932 -+    {
 113.933 -+      cfa_store_offset -= 4;
 113.934 -+      save_reg (FP_REGNO, cfa_store_offset, cfa_store_reg);
 113.935 -+    }
 113.936 -+
 113.937 -+  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
 113.938 -+    {
 113.939 -+      if (MUST_SAVE_REGISTER (i) && i != FP_REGNO && i != RA_REGNO)
 113.940 -+	{
 113.941 -+	  cfa_store_offset -= 4;
 113.942 -+	  save_reg (i, cfa_store_offset, cfa_store_reg);
 113.943 -+	}
 113.944 -+    }
 113.945 -+
 113.946 -+  if (frame_pointer_needed)
 113.947 -+    {
 113.948 -+      insn = emit_insn (gen_rtx_SET (SImode,
 113.949 -+				     gen_rtx_REG (SImode, FP_REGNO),
 113.950 -+				     gen_rtx_REG (SImode, SP_REGNO)));
 113.951 -+
 113.952 -+      RTX_FRAME_RELATED_P (insn) = 1;
 113.953 -+    }
 113.954 -+
 113.955 -+  /* If we are profiling, make sure no instructions are scheduled before
 113.956 -+     the call to mcount.  */
 113.957 -+  if (current_function_profile)
 113.958 -+    emit_insn (gen_blockage ());
 113.959 -+}
 113.960 -+
 113.961 -+void
 113.962 -+expand_epilogue (bool sibcall_p)
 113.963 -+{
 113.964 -+  rtx insn;
 113.965 -+  int i;
 113.966 -+  HOST_WIDE_INT total_frame_size;
 113.967 -+  int register_store_offset;
 113.968 -+
 113.969 -+  total_frame_size = compute_frame_size ();
 113.970 -+
 113.971 -+  if (!sibcall_p && nios2_can_use_return_insn ())
 113.972 -+    {
 113.973 -+      insn = emit_jump_insn (gen_return ());
 113.974 -+      return;
 113.975 -+    }
 113.976 -+
 113.977 -+  emit_insn (gen_blockage ());
 113.978 -+
 113.979 -+  register_store_offset =
 113.980 -+    cfun->machine->frame.save_regs_offset +
 113.981 -+    cfun->machine->frame.save_reg_rounded;
 113.982 -+
 113.983 -+  if (MUST_SAVE_REGISTER (RA_REGNO))
 113.984 -+    {
 113.985 -+      register_store_offset -= 4;
 113.986 -+      restore_reg (RA_REGNO, register_store_offset);
 113.987 -+    }
 113.988 -+
 113.989 -+  if (MUST_SAVE_REGISTER (FP_REGNO))
 113.990 -+    {
 113.991 -+      register_store_offset -= 4;
 113.992 -+      restore_reg (FP_REGNO, register_store_offset);
 113.993 -+    }
 113.994 -+
 113.995 -+  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
 113.996 -+    {
 113.997 -+      if (MUST_SAVE_REGISTER (i) && i != FP_REGNO && i != RA_REGNO)
 113.998 -+	{
 113.999 -+	  register_store_offset -= 4;
113.1000 -+	  restore_reg (i, register_store_offset);
113.1001 -+	}
113.1002 -+    }
113.1003 -+
113.1004 -+  if (total_frame_size)
113.1005 -+    {
113.1006 -+      rtx sp_adjust;
113.1007 -+
113.1008 -+      if (TOO_BIG_OFFSET (total_frame_size))
113.1009 -+        {
113.1010 -+	  sp_adjust = gen_rtx_REG (SImode, TEMP_REG_NUM);
113.1011 -+	  insn = emit_insn (gen_rtx_SET (SImode,
113.1012 -+					 sp_adjust,
113.1013 -+					 GEN_INT (total_frame_size)));
113.1014 -+
113.1015 -+      	}
113.1016 -+      else
113.1017 -+        {
113.1018 -+	  sp_adjust = GEN_INT (total_frame_size);
113.1019 -+	}
113.1020 -+
113.1021 -+      insn = gen_rtx_SET (SImode,
113.1022 -+			  stack_pointer_rtx,
113.1023 -+			  gen_rtx_PLUS (SImode,
113.1024 -+					stack_pointer_rtx,
113.1025 -+					sp_adjust));
113.1026 -+      insn = emit_insn (insn);
113.1027 -+    }
113.1028 -+
113.1029 -+
113.1030 -+  if (!sibcall_p)
113.1031 -+    {
113.1032 -+      insn = emit_jump_insn (gen_return_from_epilogue (gen_rtx (REG, Pmode,
113.1033 -+								RA_REGNO)));
113.1034 -+    }
113.1035 -+}
113.1036 -+
113.1037 -+
113.1038 -+bool
113.1039 -+nios2_function_ok_for_sibcall (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED)
113.1040 -+{
113.1041 -+  return true;
113.1042 -+}
113.1043 -+
113.1044 -+
113.1045 -+
113.1046 -+
113.1047 -+
113.1048 -+/* ----------------------- *
113.1049 -+ * Profiling
113.1050 -+ * ----------------------- */
113.1051 -+
113.1052 -+void
113.1053 -+function_profiler (FILE *file, int labelno)
113.1054 -+{
113.1055 -+  fprintf (file, "\t%s mcount begin, label: .LP%d\n", 
113.1056 -+           ASM_COMMENT_START, labelno);
113.1057 -+  fprintf (file, "\tnextpc\tr8\n");
113.1058 -+  fprintf (file, "\tmov\tr9, ra\n");
113.1059 -+  fprintf (file, "\tmovhi\tr10, %%hiadj(.LP%d)\n", labelno);
113.1060 -+  fprintf (file, "\taddi\tr10, r10, %%lo(.LP%d)\n", labelno);
113.1061 -+  fprintf (file, "\tcall\tmcount\n");
113.1062 -+  fprintf (file, "\tmov\tra, r9\n");
113.1063 -+  fprintf (file, "\t%s mcount end\n", ASM_COMMENT_START);
113.1064 -+}
113.1065 -+
113.1066 -+
113.1067 -+/***************************************
113.1068 -+ * Stack Layout
113.1069 -+ ***************************************/
113.1070 -+
113.1071 -+
113.1072 -+void
113.1073 -+dump_frame_size (FILE *file)
113.1074 -+{
113.1075 -+  fprintf (file, "\t%s Current Frame Info\n", ASM_COMMENT_START);
113.1076 -+
113.1077 -+  fprintf (file, "\t%s total_size = %ld\n", ASM_COMMENT_START,
113.1078 -+	   cfun->machine->frame.total_size);
113.1079 -+  fprintf (file, "\t%s var_size = %ld\n", ASM_COMMENT_START,
113.1080 -+	   cfun->machine->frame.var_size);
113.1081 -+  fprintf (file, "\t%s args_size = %ld\n", ASM_COMMENT_START,
113.1082 -+	   cfun->machine->frame.args_size);
113.1083 -+  fprintf (file, "\t%s save_reg_size = %d\n", ASM_COMMENT_START,
113.1084 -+	   cfun->machine->frame.save_reg_size);
113.1085 -+  fprintf (file, "\t%s save_reg_rounded = %d\n", ASM_COMMENT_START,
113.1086 -+	   cfun->machine->frame.save_reg_rounded);
113.1087 -+  fprintf (file, "\t%s initialized = %d\n", ASM_COMMENT_START,
113.1088 -+	   cfun->machine->frame.initialized);
113.1089 -+  fprintf (file, "\t%s num_regs = %d\n", ASM_COMMENT_START,
113.1090 -+	   cfun->machine->frame.num_regs);
113.1091 -+  fprintf (file, "\t%s save_regs_offset = %ld\n", ASM_COMMENT_START,
113.1092 -+	   cfun->machine->frame.save_regs_offset);
113.1093 -+  fprintf (file, "\t%s current_function_is_leaf = %d\n", ASM_COMMENT_START,
113.1094 -+	   current_function_is_leaf);
113.1095 -+  fprintf (file, "\t%s frame_pointer_needed = %d\n", ASM_COMMENT_START,
113.1096 -+	   frame_pointer_needed);
113.1097 -+  fprintf (file, "\t%s pretend_args_size = %d\n", ASM_COMMENT_START,
113.1098 -+	   current_function_pretend_args_size);
113.1099 -+
113.1100 -+}
113.1101 -+
113.1102 -+
113.1103 -+/* Return the bytes needed to compute the frame pointer from the current
113.1104 -+   stack pointer.
113.1105 -+*/
113.1106 -+
113.1107 -+HOST_WIDE_INT
113.1108 -+compute_frame_size ()
113.1109 -+{
113.1110 -+  unsigned int regno;
113.1111 -+  HOST_WIDE_INT var_size;	/* # of var. bytes allocated */
113.1112 -+  HOST_WIDE_INT total_size;	/* # bytes that the entire frame takes up */
113.1113 -+  HOST_WIDE_INT save_reg_size;	/* # bytes needed to store callee save regs */
113.1114 -+  HOST_WIDE_INT save_reg_rounded;	
113.1115 -+    /* # bytes needed to store callee save regs (rounded) */
113.1116 -+  HOST_WIDE_INT out_args_size;	/* # bytes needed for outgoing args */
113.1117 -+
113.1118 -+  save_reg_size = 0;
113.1119 -+  var_size = STACK_ALIGN (get_frame_size ());
113.1120 -+  out_args_size = STACK_ALIGN (current_function_outgoing_args_size);
113.1121 -+
113.1122 -+  total_size = var_size + out_args_size;
113.1123 -+
113.1124 -+  /* Calculate space needed for gp registers.  */
113.1125 -+  for (regno = 0; regno <= FIRST_PSEUDO_REGISTER; regno++)
113.1126 -+    {
113.1127 -+      if (MUST_SAVE_REGISTER (regno))
113.1128 -+	{
113.1129 -+	  save_reg_size += 4;
113.1130 -+	}
113.1131 -+    }
113.1132 -+
113.1133 -+  save_reg_rounded = STACK_ALIGN (save_reg_size);
113.1134 -+  total_size += save_reg_rounded;
113.1135 -+
113.1136 -+  total_size += STACK_ALIGN (current_function_pretend_args_size);
113.1137 -+
113.1138 -+  /* Save other computed information.  */
113.1139 -+  cfun->machine->frame.total_size = total_size;
113.1140 -+  cfun->machine->frame.var_size = var_size;
113.1141 -+  cfun->machine->frame.args_size = current_function_outgoing_args_size;
113.1142 -+  cfun->machine->frame.save_reg_size = save_reg_size;
113.1143 -+  cfun->machine->frame.save_reg_rounded = save_reg_rounded;
113.1144 -+  cfun->machine->frame.initialized = reload_completed;
113.1145 -+  cfun->machine->frame.num_regs = save_reg_size / UNITS_PER_WORD;
113.1146 -+
113.1147 -+  cfun->machine->frame.save_regs_offset
113.1148 -+    = save_reg_rounded ? current_function_outgoing_args_size + var_size : 0;
113.1149 -+
113.1150 -+  return total_size;
113.1151 -+}
113.1152 -+
113.1153 -+
113.1154 -+int
113.1155 -+nios2_initial_elimination_offset (int from, int to ATTRIBUTE_UNUSED)
113.1156 -+{
113.1157 -+  int offset;
113.1158 -+
113.1159 -+  /* Set OFFSET to the offset from the stack pointer.  */
113.1160 -+  switch (from)
113.1161 -+    {
113.1162 -+    case FRAME_POINTER_REGNUM:
113.1163 -+      offset = 0;
113.1164 -+      break;
113.1165 -+
113.1166 -+    case ARG_POINTER_REGNUM:
113.1167 -+      compute_frame_size ();
113.1168 -+      offset = cfun->machine->frame.total_size;
113.1169 -+      offset -= current_function_pretend_args_size;
113.1170 -+      break;
113.1171 -+
113.1172 -+    case RETURN_ADDRESS_POINTER_REGNUM:
113.1173 -+      compute_frame_size ();
113.1174 -+      /* since the return address is always the first of the
113.1175 -+         saved registers, return the offset to the beginning
113.1176 -+         of the saved registers block */
113.1177 -+      offset = cfun->machine->frame.save_regs_offset;
113.1178 -+      break;
113.1179 -+
113.1180 -+    default:
113.1181 -+      abort ();
113.1182 -+    }
113.1183 -+
113.1184 -+  return offset;
113.1185 -+}
113.1186 -+
113.1187 -+/* Return nonzero if this function is known to have a null epilogue.
113.1188 -+   This allows the optimizer to omit jumps to jumps if no stack
113.1189 -+   was created.  */
113.1190 -+int
113.1191 -+nios2_can_use_return_insn ()
113.1192 -+{
113.1193 -+  if (!reload_completed)
113.1194 -+    return 0;
113.1195 -+
113.1196 -+  if (regs_ever_live[RA_REGNO] || current_function_profile)
113.1197 -+    return 0;
113.1198 -+
113.1199 -+  if (cfun->machine->frame.initialized)
113.1200 -+    return cfun->machine->frame.total_size == 0;
113.1201 -+
113.1202 -+  return compute_frame_size () == 0;
113.1203 -+}
113.1204 -+
113.1205 -+
113.1206 -+
113.1207 -+
113.1208 -+
113.1209 -+/***************************************
113.1210 -+ *
113.1211 -+ ***************************************/
113.1212 -+
113.1213 -+const char *nios2_sys_nosys_string;    /* for -msys=nosys */
113.1214 -+const char *nios2_sys_lib_string;    /* for -msys-lib= */
113.1215 -+const char *nios2_sys_crt0_string;    /* for -msys-crt0= */
113.1216 -+
113.1217 -+void
113.1218 -+override_options ()
113.1219 -+{
113.1220 -+  /* Function to allocate machine-dependent function status.  */
113.1221 -+  init_machine_status = &nios2_init_machine_status;
113.1222 -+
113.1223 -+  nios2_section_threshold 
113.1224 -+    = g_switch_set ? g_switch_value : NIOS2_DEFAULT_GVALUE;
113.1225 -+
113.1226 -+  if (nios2_sys_nosys_string && *nios2_sys_nosys_string)
113.1227 -+    {
113.1228 -+      error ("invalid option '-msys=nosys%s'", nios2_sys_nosys_string);
113.1229 -+    }
113.1230 -+
113.1231 -+  /* If we don't have mul, we don't have mulx either! */
113.1232 -+  if (!TARGET_HAS_MUL && TARGET_HAS_MULX) 
113.1233 -+    {
113.1234 -+      target_flags &= ~HAS_MULX_FLAG;
113.1235 -+    }
113.1236 -+
113.1237 -+}
113.1238 -+
113.1239 -+void
113.1240 -+optimization_options (int level, int size)
113.1241 -+{
113.1242 -+  if (level || size)
113.1243 -+    {
113.1244 -+      target_flags |= INLINE_MEMCPY_FLAG;
113.1245 -+    }
113.1246 -+
113.1247 -+  if (level >= 3 && !size)
113.1248 -+    {
113.1249 -+      target_flags |= FAST_SW_DIV_FLAG;
113.1250 -+    }
113.1251 -+}
113.1252 -+
113.1253 -+/* Allocate a chunk of memory for per-function machine-dependent data.  */
113.1254 -+static struct machine_function *
113.1255 -+nios2_init_machine_status ()
113.1256 -+{
113.1257 -+  return ((struct machine_function *)
113.1258 -+	  ggc_alloc_cleared (sizeof (struct machine_function)));
113.1259 -+}
113.1260 -+
113.1261 -+
113.1262 -+
113.1263 -+/*****************
113.1264 -+ * Describing Relative Costs of Operations
113.1265 -+ *****************/
113.1266 -+
113.1267 -+/* Compute a (partial) cost for rtx X.  Return true if the complete
113.1268 -+   cost has been computed, and false if subexpressions should be
113.1269 -+   scanned.  In either case, *TOTAL contains the cost result.  */
113.1270 -+
113.1271 -+
113.1272 -+
113.1273 -+static bool
113.1274 -+nios2_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total)
113.1275 -+{
113.1276 -+  switch (code)
113.1277 -+    {
113.1278 -+      case CONST_INT:
113.1279 -+	if (INTVAL (x) == 0)
113.1280 -+	  {
113.1281 -+	    *total = COSTS_N_INSNS (0);
113.1282 -+	    return true;
113.1283 -+	  }
113.1284 -+	else if (SMALL_INT (INTVAL (x))
113.1285 -+		|| SMALL_INT_UNSIGNED (INTVAL (x))
113.1286 -+		|| UPPER16_INT (INTVAL (x)))
113.1287 -+	  {
113.1288 -+	    *total = COSTS_N_INSNS (2);
113.1289 -+	    return true;
113.1290 -+	  }
113.1291 -+	else
113.1292 -+	  {
113.1293 -+	    *total = COSTS_N_INSNS (4);
113.1294 -+	    return true;
113.1295 -+	  }
113.1296 -+
113.1297 -+      case LABEL_REF:
113.1298 -+      case SYMBOL_REF:
113.1299 -+	/* ??? gp relative stuff will fit in here */
113.1300 -+	/* fall through */
113.1301 -+      case CONST:
113.1302 -+      case CONST_DOUBLE:
113.1303 -+	{
113.1304 -+	  *total = COSTS_N_INSNS (4);
113.1305 -+	  return true;
113.1306 -+	}
113.1307 -+
113.1308 -+      case MULT:
113.1309 -+	{
113.1310 -+	  *total = COSTS_N_INSNS (1);
113.1311 -+	  return false;
113.1312 -+	}
113.1313 -+      case SIGN_EXTEND:
113.1314 -+	{
113.1315 -+	  *total = COSTS_N_INSNS (3);
113.1316 -+	  return false;
113.1317 -+	}
113.1318 -+      case ZERO_EXTEND:
113.1319 -+	{
113.1320 -+	  *total = COSTS_N_INSNS (1);
113.1321 -+	  return false;
113.1322 -+	}
113.1323 -+
113.1324 -+    default:
113.1325 -+      return false;
113.1326 -+    }
113.1327 -+}
113.1328 -+
113.1329 -+
113.1330 -+/***************************************
113.1331 -+ * INSTRUCTION SUPPORT
113.1332 -+ *
113.1333 -+ * These functions are used within the Machine Description to
113.1334 -+ * handle common or complicated output and expansions from
113.1335 -+ * instructions.
113.1336 -+ ***************************************/
113.1337 -+
113.1338 -+int
113.1339 -+nios2_emit_move_sequence (rtx *operands, enum machine_mode mode)
113.1340 -+{
113.1341 -+  rtx to = operands[0];
113.1342 -+  rtx from = operands[1];
113.1343 -+
113.1344 -+  if (!register_operand (to, mode) && !reg_or_0_operand (from, mode))
113.1345 -+    {
113.1346 -+      if (no_new_pseudos)
113.1347 -+	internal_error ("Trying to force_reg no_new_pseudos == 1");
113.1348 -+      from = copy_to_mode_reg (mode, from);
113.1349 -+    }
113.1350 -+
113.1351 -+  operands[0] = to;
113.1352 -+  operands[1] = from;
113.1353 -+  return 0;
113.1354 -+}
113.1355 -+
113.1356 -+/* Divide Support */
113.1357 -+
113.1358 -+/*
113.1359 -+  If -O3 is used, we want to output a table lookup for
113.1360 -+  divides between small numbers (both num and den >= 0
113.1361 -+  and < 0x10). The overhead of this method in the worse
113.1362 -+  case is 40 bytes in the text section (10 insns) and
113.1363 -+  256 bytes in the data section. Additional divides do
113.1364 -+  not incur additional penalties in the data section.
113.1365 -+
113.1366 -+  Code speed is improved for small divides by about 5x
113.1367 -+  when using this method in the worse case (~9 cycles
113.1368 -+  vs ~45). And in the worse case divides not within the
113.1369 -+  table are penalized by about 10% (~5 cycles vs ~45).
113.1370 -+  However in the typical case the penalty is not as bad
113.1371 -+  because doing the long divide in only 45 cycles is
113.1372 -+  quite optimistic.
113.1373 -+
113.1374 -+  ??? It would be nice to have some benchmarks other
113.1375 -+  than Dhrystone to back this up.
113.1376 -+
113.1377 -+  This bit of expansion is to create this instruction
113.1378 -+  sequence as rtl.
113.1379 -+	or	$8, $4, $5
113.1380 -+	slli	$9, $4, 4
113.1381 -+	cmpgeui	$3, $8, 16
113.1382 -+	beq	$3, $0, .L3
113.1383 -+	or	$10, $9, $5
113.1384 -+	add	$12, $11, divide_table
113.1385 -+	ldbu	$2, 0($12)
113.1386 -+	br	.L1
113.1387 -+.L3:
113.1388 -+	call	slow_div
113.1389 -+.L1:
113.1390 -+#	continue here with result in $2
113.1391 -+
113.1392 -+  ??? Ideally I would like the emit libcall block to contain
113.1393 -+  all of this code, but I don't know how to do that. What it
113.1394 -+  means is that if the divide can be eliminated, it may not
113.1395 -+  completely disappear.
113.1396 -+
113.1397 -+  ??? The __divsi3_table label should ideally be moved out
113.1398 -+  of this block and into a global. If it is placed into the
113.1399 -+  sdata section we can save even more cycles by doing things
113.1400 -+  gp relative.
113.1401 -+*/
113.1402 -+int
113.1403 -+nios2_emit_expensive_div (rtx *operands, enum machine_mode mode)
113.1404 -+{
113.1405 -+  rtx or_result, shift_left_result;
113.1406 -+  rtx lookup_value;
113.1407 -+  rtx lab1, lab3;
113.1408 -+  rtx insns;
113.1409 -+  rtx libfunc;
113.1410 -+  rtx final_result;
113.1411 -+  rtx tmp;
113.1412 -+
113.1413 -+  /* it may look a little generic, but only SImode
113.1414 -+     is supported for now */
113.1415 -+  if (mode != SImode)
113.1416 -+    abort ();
113.1417 -+
113.1418 -+  libfunc = sdiv_optab->handlers[(int) SImode].libfunc;
113.1419 -+
113.1420 -+
113.1421 -+
113.1422 -+  lab1 = gen_label_rtx ();
113.1423 -+  lab3 = gen_label_rtx ();
113.1424 -+
113.1425 -+  or_result = expand_simple_binop (SImode, IOR,
113.1426 -+				   operands[1], operands[2],
113.1427 -+				   0, 0, OPTAB_LIB_WIDEN);
113.1428 -+
113.1429 -+  emit_cmp_and_jump_insns (or_result, GEN_INT (15), GTU, 0,
113.1430 -+			   GET_MODE (or_result), 0, lab3);
113.1431 -+  JUMP_LABEL (get_last_insn ()) = lab3;
113.1432 -+
113.1433 -+  shift_left_result = expand_simple_binop (SImode, ASHIFT,
113.1434 -+					   operands[1], GEN_INT (4),
113.1435 -+					   0, 0, OPTAB_LIB_WIDEN);
113.1436 -+
113.1437 -+  lookup_value = expand_simple_binop (SImode, IOR,
113.1438 -+				      shift_left_result, operands[2],
113.1439 -+				      0, 0, OPTAB_LIB_WIDEN);
113.1440 -+
113.1441 -+  convert_move (operands[0],
113.1442 -+		gen_rtx (MEM, QImode,
113.1443 -+			 gen_rtx (PLUS, SImode,
113.1444 -+				  lookup_value,
113.1445 -+				  gen_rtx_SYMBOL_REF (SImode, "__divsi3_table"))),
113.1446 -+		1);
113.1447 -+
113.1448 -+
113.1449 -+  tmp = emit_jump_insn (gen_jump (lab1));
113.1450 -+  JUMP_LABEL (tmp) = lab1;
113.1451 -+  emit_barrier ();
113.1452 -+
113.1453 -+  emit_label (lab3);
113.1454 -+  LABEL_NUSES (lab3) = 1;
113.1455 -+
113.1456 -+  start_sequence ();
113.1457 -+  final_result = emit_library_call_value (libfunc, NULL_RTX,
113.1458 -+					  LCT_CONST, SImode, 2,
113.1459 -+					  operands[1], SImode,
113.1460 -+					  operands[2], SImode);
113.1461 -+
113.1462 -+
113.1463 -+  insns = get_insns ();
113.1464 -+  end_sequence ();
113.1465 -+  emit_libcall_block (insns, operands[0], final_result,
113.1466 -+		      gen_rtx (DIV, SImode, operands[1], operands[2]));
113.1467 -+
113.1468 -+  emit_label (lab1);
113.1469 -+  LABEL_NUSES (lab1) = 1;
113.1470 -+  return 1;
113.1471 -+}
113.1472 -+
113.1473 -+/* Branches/Compares */
113.1474 -+
113.1475 -+/* the way of handling branches/compares
113.1476 -+   in gcc is heavily borrowed from MIPS */
113.1477 -+
113.1478 -+enum internal_test
113.1479 -+{
113.1480 -+  ITEST_EQ,
113.1481 -+  ITEST_NE,
113.1482 -+  ITEST_GT,
113.1483 -+  ITEST_GE,
113.1484 -+  ITEST_LT,
113.1485 -+  ITEST_LE,
113.1486 -+  ITEST_GTU,
113.1487 -+  ITEST_GEU,
113.1488 -+  ITEST_LTU,
113.1489 -+  ITEST_LEU,
113.1490 -+  ITEST_MAX
113.1491 -+};
113.1492 -+
113.1493 -+static enum internal_test map_test_to_internal_test (enum rtx_code);
113.1494 -+
113.1495 -+/* Cached operands, and operator to compare for use in set/branch/trap
113.1496 -+   on condition codes.  */
113.1497 -+rtx branch_cmp[2];
113.1498 -+enum cmp_type branch_type;
113.1499 -+
113.1500 -+/* Make normal rtx_code into something we can index from an array */
113.1501 -+
113.1502 -+static enum internal_test
113.1503 -+map_test_to_internal_test (enum rtx_code test_code)
113.1504 -+{
113.1505 -+  enum internal_test test = ITEST_MAX;
113.1506 -+
113.1507 -+  switch (test_code)
113.1508 -+    {
113.1509 -+    case EQ:
113.1510 -+      test = ITEST_EQ;
113.1511 -+      break;
113.1512 -+    case NE:
113.1513 -+      test = ITEST_NE;
113.1514 -+      break;
113.1515 -+    case GT:
113.1516 -+      test = ITEST_GT;
113.1517 -+      break;
113.1518 -+    case GE:
113.1519 -+      test = ITEST_GE;
113.1520 -+      break;
113.1521 -+    case LT:
113.1522 -+      test = ITEST_LT;
113.1523 -+      break;
113.1524 -+    case LE:
113.1525 -+      test = ITEST_LE;
113.1526 -+      break;
113.1527 -+    case GTU:
113.1528 -+      test = ITEST_GTU;
113.1529 -+      break;
113.1530 -+    case GEU:
113.1531 -+      test = ITEST_GEU;
113.1532 -+      break;
113.1533 -+    case LTU:
113.1534 -+      test = ITEST_LTU;
113.1535 -+      break;
113.1536 -+    case LEU:
113.1537 -+      test = ITEST_LEU;
113.1538 -+      break;
113.1539 -+    default:
113.1540 -+      break;
113.1541 -+    }
113.1542 -+
113.1543 -+  return test;
113.1544 -+}
113.1545 -+
113.1546 -+/* Generate the code to compare (and possibly branch) two integer values
113.1547 -+   TEST_CODE is the comparison code we are trying to emulate 
113.1548 -+     (or implement directly)
113.1549 -+   RESULT is where to store the result of the comparison, 
113.1550 -+     or null to emit a branch
113.1551 -+   CMP0 CMP1 are the two comparison operands
113.1552 -+   DESTINATION is the destination of the branch, or null to only compare
113.1553 -+   */
113.1554 -+
113.1555 -+void
113.1556 -+gen_int_relational (enum rtx_code test_code, /* relational test (EQ, etc) */
113.1557 -+		    rtx result,		/* result to store comp. or 0 if branch */
113.1558 -+		    rtx cmp0,		/* first operand to compare */
113.1559 -+		    rtx cmp1,		/* second operand to compare */
113.1560 -+		    rtx destination)	/* destination of the branch, or 0 if compare */
113.1561 -+{
113.1562 -+  struct cmp_info
113.1563 -+  {
113.1564 -+    /* for register (or 0) compares */
113.1565 -+    enum rtx_code test_code_reg;	/* code to use in instruction (LT vs. LTU) */
113.1566 -+    int reverse_regs;		/* reverse registers in test */
113.1567 -+
113.1568 -+    /* for immediate compares */
113.1569 -+    enum rtx_code test_code_const;	
113.1570 -+         /* code to use in instruction (LT vs. LTU) */
113.1571 -+    int const_low;		/* low bound of constant we can accept */
113.1572 -+    int const_high;		/* high bound of constant we can accept */
113.1573 -+    int const_add;		/* constant to add */
113.1574 -+
113.1575 -+    /* generic info */
113.1576 -+    int unsignedp;		/* != 0 for unsigned comparisons.  */
113.1577 -+  };
113.1578 -+
113.1579 -+  static const struct cmp_info info[(int) ITEST_MAX] = {
113.1580 -+
113.1581 -+    {EQ, 0, EQ, -32768, 32767, 0, 0}, /* EQ  */
113.1582 -+    {NE, 0, NE, -32768, 32767, 0, 0}, /* NE  */
113.1583 -+
113.1584 -+    {LT, 1, GE, -32769, 32766, 1, 0}, /* GT  */
113.1585 -+    {GE, 0, GE, -32768, 32767, 0, 0}, /* GE  */
113.1586 -+    {LT, 0, LT, -32768, 32767, 0, 0}, /* LT  */
113.1587 -+    {GE, 1, LT, -32769, 32766, 1, 0}, /* LE  */
113.1588 -+
113.1589 -+    {LTU, 1, GEU, 0, 65534, 1, 0}, /* GTU */
113.1590 -+    {GEU, 0, GEU, 0, 65535, 0, 0}, /* GEU */
113.1591 -+    {LTU, 0, LTU, 0, 65535, 0, 0}, /* LTU */
113.1592 -+    {GEU, 1, LTU, 0, 65534, 1, 0}, /* LEU */
113.1593 -+  };
113.1594 -+
113.1595 -+  enum internal_test test;
113.1596 -+  enum machine_mode mode;
113.1597 -+  const struct cmp_info *p_info;
113.1598 -+  int branch_p;
113.1599 -+
113.1600 -+
113.1601 -+
113.1602 -+
113.1603 -+  test = map_test_to_internal_test (test_code);
113.1604 -+  if (test == ITEST_MAX)
113.1605 -+    abort ();
113.1606 -+
113.1607 -+  p_info = &info[(int) test];
113.1608 -+
113.1609 -+  mode = GET_MODE (cmp0);
113.1610 -+  if (mode == VOIDmode)
113.1611 -+    mode = GET_MODE (cmp1);
113.1612 -+
113.1613 -+  branch_p = (destination != 0);
113.1614 -+
113.1615 -+  /* We can't, under any circumstances, have const_ints in cmp0
113.1616 -+     ??? Actually we could have const0 */
113.1617 -+  if (GET_CODE (cmp0) == CONST_INT)
113.1618 -+    cmp0 = force_reg (mode, cmp0);
113.1619 -+
113.1620 -+  /* if the comparison is against an int not in legal range
113.1621 -+     move it into a register */
113.1622 -+  if (GET_CODE (cmp1) == CONST_INT)
113.1623 -+    {
113.1624 -+      HOST_WIDE_INT value = INTVAL (cmp1);
113.1625 -+
113.1626 -+      if (value < p_info->const_low || value > p_info->const_high)
113.1627 -+	cmp1 = force_reg (mode, cmp1);
113.1628 -+    }
113.1629 -+
113.1630 -+  /* Comparison to constants, may involve adding 1 to change a GT into GE.
113.1631 -+     Comparison between two registers, may involve switching operands.  */
113.1632 -+  if (GET_CODE (cmp1) == CONST_INT)
113.1633 -+    {
113.1634 -+      if (p_info->const_add != 0)
113.1635 -+	{
113.1636 -+	  HOST_WIDE_INT new = INTVAL (cmp1) + p_info->const_add;
113.1637 -+
113.1638 -+	  /* If modification of cmp1 caused overflow,
113.1639 -+	     we would get the wrong answer if we follow the usual path;
113.1640 -+	     thus, x > 0xffffffffU would turn into x > 0U.  */
113.1641 -+	  if ((p_info->unsignedp
113.1642 -+	       ? (unsigned HOST_WIDE_INT) new >
113.1643 -+	       (unsigned HOST_WIDE_INT) INTVAL (cmp1)
113.1644 -+	       : new > INTVAL (cmp1)) != (p_info->const_add > 0))
113.1645 -+	    {
113.1646 -+	      /* ??? This case can never happen with the current numbers,
113.1647 -+	         but I am paranoid and would rather an abort than
113.1648 -+	         a bug I will never find */
113.1649 -+	      abort ();
113.1650 -+	    }
113.1651 -+	  else
113.1652 -+	    cmp1 = GEN_INT (new);
113.1653 -+	}
113.1654 -+    }
113.1655 -+
113.1656 -+  else if (p_info->reverse_regs)
113.1657 -+    {
113.1658 -+      rtx temp = cmp0;
113.1659 -+      cmp0 = cmp1;
113.1660 -+      cmp1 = temp;
113.1661 -+    }
113.1662 -+
113.1663 -+
113.1664 -+
113.1665 -+  if (branch_p)
113.1666 -+    {
113.1667 -+      if (register_operand (cmp0, mode) && register_operand (cmp1, mode))
113.1668 -+	{
113.1669 -+	  rtx insn;
113.1670 -+	  rtx cond = gen_rtx (p_info->test_code_reg, mode, cmp0, cmp1);
113.1671 -+	  rtx label = gen_rtx_LABEL_REF (VOIDmode, destination);
113.1672 -+
113.1673 -+	  insn = gen_rtx_SET (VOIDmode, pc_rtx,
113.1674 -+			      gen_rtx_IF_THEN_ELSE (VOIDmode,
113.1675 -+						    cond, label, pc_rtx));
113.1676 -+	  emit_jump_insn (insn);
113.1677 -+	}
113.1678 -+      else
113.1679 -+	{
113.1680 -+	  rtx cond, label;
113.1681 -+
113.1682 -+	  result = gen_reg_rtx (mode);
113.1683 -+
113.1684 -+	  emit_move_insn (result,
113.1685 -+			  gen_rtx (p_info->test_code_const, mode, cmp0,
113.1686 -+				   cmp1));
113.1687 -+
113.1688 -+	  cond = gen_rtx (NE, mode, result, const0_rtx);
113.1689 -+	  label = gen_rtx_LABEL_REF (VOIDmode, destination);
113.1690 -+
113.1691 -+	  emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
113.1692 -+				       gen_rtx_IF_THEN_ELSE (VOIDmode,
113.1693 -+							     cond,
113.1694 -+							     label, pc_rtx)));
113.1695 -+	}
113.1696 -+    }
113.1697 -+  else
113.1698 -+    {
113.1699 -+      if (register_operand (cmp0, mode) && register_operand (cmp1, mode))
113.1700 -+	{
113.1701 -+	  emit_move_insn (result,
113.1702 -+			  gen_rtx (p_info->test_code_reg, mode, cmp0, cmp1));
113.1703 -+	}
113.1704 -+      else
113.1705 -+	{
113.1706 -+	  emit_move_insn (result,
113.1707 -+			  gen_rtx (p_info->test_code_const, mode, cmp0,
113.1708 -+				   cmp1));
113.1709 -+	}
113.1710 -+    }
113.1711 -+
113.1712 -+}
113.1713 -+
113.1714 -+
113.1715 -+/* ??? For now conditional moves are only supported
113.1716 -+   when the mode of the operands being compared are
113.1717 -+   the same as the ones being moved */
113.1718 -+
113.1719 -+void
113.1720 -+gen_conditional_move (rtx *operands, enum machine_mode mode)
113.1721 -+{
113.1722 -+  rtx insn, cond;
113.1723 -+  rtx cmp_reg = gen_reg_rtx (mode);
113.1724 -+  enum rtx_code cmp_code = GET_CODE (operands[1]);
113.1725 -+  enum rtx_code move_code = EQ;
113.1726 -+
113.1727 -+  /* emit a comparison if it is not "simple".
113.1728 -+     Simple comparisons are X eq 0 and X ne 0 */
113.1729 -+  if ((cmp_code == EQ || cmp_code == NE) && branch_cmp[1] == const0_rtx)
113.1730 -+    {
113.1731 -+      cmp_reg = branch_cmp[0];
113.1732 -+      move_code = cmp_code;
113.1733 -+    }
113.1734 -+  else if ((cmp_code == EQ || cmp_code == NE) && branch_cmp[0] == const0_rtx)
113.1735 -+    {
113.1736 -+      cmp_reg = branch_cmp[1];
113.1737 -+      move_code = cmp_code == EQ ? NE : EQ;
113.1738 -+    }
113.1739 -+  else
113.1740 -+    gen_int_relational (cmp_code, cmp_reg, branch_cmp[0], branch_cmp[1],
113.1741 -+			NULL_RTX);
113.1742 -+
113.1743 -+  cond = gen_rtx (move_code, VOIDmode, cmp_reg, CONST0_RTX (mode));
113.1744 -+  insn = gen_rtx_SET (mode, operands[0],
113.1745 -+		      gen_rtx_IF_THEN_ELSE (mode,
113.1746 -+					    cond, operands[2], operands[3]));
113.1747 -+  emit_insn (insn);
113.1748 -+}
113.1749 -+
113.1750 -+/*******************
113.1751 -+ * Addressing Modes
113.1752 -+ *******************/
113.1753 -+
113.1754 -+int
113.1755 -+nios2_legitimate_address (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED, 
113.1756 -+                          int strict)
113.1757 -+{
113.1758 -+  int ret_val = 0;
113.1759 -+
113.1760 -+  switch (GET_CODE (operand))
113.1761 -+    {
113.1762 -+      /* direct.  */
113.1763 -+    case SYMBOL_REF:
113.1764 -+      if (SYMBOL_REF_IN_NIOS2_SMALL_DATA_P (operand))
113.1765 -+        {
113.1766 -+          ret_val = 1;
113.1767 -+          break;
113.1768 -+	}
113.1769 -+      /* else, fall through */
113.1770 -+    case LABEL_REF:
113.1771 -+    case CONST_INT:
113.1772 -+    case CONST:
113.1773 -+    case CONST_DOUBLE:
113.1774 -+      /* ??? In here I need to add gp addressing */
113.1775 -+      ret_val = 0;
113.1776 -+
113.1777 -+      break;
113.1778 -+
113.1779 -+      /* Register indirect.  */
113.1780 -+    case REG:
113.1781 -+      ret_val = REG_OK_FOR_BASE_P2 (operand, strict);
113.1782 -+      break;
113.1783 -+
113.1784 -+      /* Register indirect with displacement */
113.1785 -+    case PLUS:
113.1786 -+      {
113.1787 -+	rtx op0 = XEXP (operand, 0);
113.1788 -+	rtx op1 = XEXP (operand, 1);
113.1789 -+
113.1790 -+	if (REG_P (op0) && REG_P (op1))
113.1791 -+	  ret_val = 0;
113.1792 -+	else if (REG_P (op0) && CONSTANT_P (op1))
113.1793 -+	  ret_val = REG_OK_FOR_BASE_P2 (op0, strict)
113.1794 -+	    && SMALL_INT (INTVAL (op1));
113.1795 -+	else if (REG_P (op1) && CONSTANT_P (op0))
113.1796 -+	  ret_val = REG_OK_FOR_BASE_P2 (op1, strict)
113.1797 -+	    && SMALL_INT (INTVAL (op0));
113.1798 -+	else
113.1799 -+	  ret_val = 0;
113.1800 -+      }
113.1801 -+      break;
113.1802 -+
113.1803 -+    default:
113.1804 -+      ret_val = 0;
113.1805 -+      break;
113.1806 -+    }
113.1807 -+
113.1808 -+  return ret_val;
113.1809 -+}
113.1810 -+
113.1811 -+/* Return true if EXP should be placed in the small data section.  */
113.1812 -+
113.1813 -+static bool
113.1814 -+nios2_in_small_data_p (tree exp)
113.1815 -+{
113.1816 -+  /* We want to merge strings, so we never consider them small data.  */
113.1817 -+  if (TREE_CODE (exp) == STRING_CST)
113.1818 -+    return false;
113.1819 -+
113.1820 -+  if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
113.1821 -+    {
113.1822 -+      const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
113.1823 -+      /* ??? these string names need moving into 
113.1824 -+         an array in some header file */
113.1825 -+      if (nios2_section_threshold > 0
113.1826 -+          && (strcmp (section, ".sbss") == 0
113.1827 -+	      || strncmp (section, ".sbss.", 6) == 0
113.1828 -+	      || strcmp (section, ".sdata") == 0
113.1829 -+	      || strncmp (section, ".sdata.", 7) == 0))
113.1830 -+	return true;
113.1831 -+    }
113.1832 -+  else if (TREE_CODE (exp) == VAR_DECL)
113.1833 -+    {
113.1834 -+      HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp));
113.1835 -+
113.1836 -+      /* If this is an incomplete type with size 0, then we can't put it
113.1837 -+         in sdata because it might be too big when completed.  */
113.1838 -+      if (size > 0 && size <= nios2_section_threshold)
113.1839 -+	return true;
113.1840 -+    }
113.1841 -+
113.1842 -+  return false;
113.1843 -+}
113.1844 -+
113.1845 -+static void
113.1846 -+nios2_encode_section_info (tree decl, rtx rtl, int first)
113.1847 -+{
113.1848 -+
113.1849 -+  rtx symbol;
113.1850 -+  int flags;
113.1851 -+
113.1852 -+  default_encode_section_info (decl, rtl, first);
113.1853 -+  
113.1854 -+  /* Careful not to prod global register variables.  */
113.1855 -+  if (GET_CODE (rtl) != MEM)
113.1856 -+    return;
113.1857 -+  symbol = XEXP (rtl, 0);
113.1858 -+  if (GET_CODE (symbol) != SYMBOL_REF)
113.1859 -+    return;
113.1860 -+
113.1861 -+  flags = SYMBOL_REF_FLAGS (symbol);
113.1862 -+    
113.1863 -+  /* We don't want weak variables to be addressed with gp in case they end up with
113.1864 -+     value 0 which is not within 2^15 of $gp */
113.1865 -+  if (DECL_P (decl) && DECL_WEAK (decl))
113.1866 -+    flags |= SYMBOL_FLAG_WEAK_DECL;
113.1867 -+
113.1868 -+  SYMBOL_REF_FLAGS (symbol) = flags;
113.1869 -+}
113.1870 -+
113.1871 -+
113.1872 -+static unsigned int
113.1873 -+nios2_section_type_flags (tree decl, const char *name, int reloc)
113.1874 -+{
113.1875 -+  unsigned int flags;
113.1876 -+
113.1877 -+  flags = default_section_type_flags (decl, name, reloc);
113.1878 -+
113.1879 -+  /* ??? these string names need moving into an array in some header file */
113.1880 -+  if (strcmp (name, ".sbss") == 0
113.1881 -+      || strncmp (name, ".sbss.", 6) == 0
113.1882 -+      || strcmp (name, ".sdata") == 0
113.1883 -+      || strncmp (name, ".sdata.", 7) == 0)
113.1884 -+    flags |= SECTION_SMALL;
113.1885 -+
113.1886 -+  return flags;
113.1887 -+}
113.1888 -+
113.1889 -+
113.1890 -+
113.1891 -+
113.1892 -+/*****************************************
113.1893 -+ * Defining the Output Assembler Language
113.1894 -+ *****************************************/
113.1895 -+
113.1896 -+/* -------------- *
113.1897 -+ * Output of Data
113.1898 -+ * -------------- */
113.1899 -+
113.1900 -+
113.1901 -+/* -------------------------------- *
113.1902 -+ * Output of Assembler Instructions
113.1903 -+ * -------------------------------- */
113.1904 -+
113.1905 -+
113.1906 -+/* print the operand OP to file stream
113.1907 -+   FILE modified by LETTER. LETTER
113.1908 -+   can be one of:
113.1909 -+     i: print "i" if OP is an immediate, except 0
113.1910 -+     o: print "io" if OP is volatile
113.1911 -+
113.1912 -+     z: for const0_rtx print $0 instead of 0
113.1913 -+     H: for %hiadj
113.1914 -+     L: for %lo
113.1915 -+     U: for upper half of 32 bit value
113.1916 -+ */
113.1917 -+
113.1918 -+void
113.1919 -+nios2_print_operand (FILE *file, rtx op, int letter)
113.1920 -+{
113.1921 -+
113.1922 -+  switch (letter)
113.1923 -+    {
113.1924 -+    case 'i':
113.1925 -+      if (CONSTANT_P (op) && (op != const0_rtx))
113.1926 -+	fprintf (file, "i");
113.1927 -+      return;
113.1928 -+
113.1929 -+    case 'o':
113.1930 -+      if (GET_CODE (op) == MEM
113.1931 -+          && ((MEM_VOLATILE_P (op) && !TARGET_CACHE_VOLATILE)
113.1932 -+              || TARGET_BYPASS_CACHE))
113.1933 -+	fprintf (file, "io");
113.1934 -+      return;
113.1935 -+
113.1936 -+    default:
113.1937 -+      break;
113.1938 -+    }
113.1939 -+
113.1940 -+  if (comparison_operator (op, VOIDmode))
113.1941 -+    {
113.1942 -+      if (letter == 0)
113.1943 -+	{
113.1944 -+	  fprintf (file, "%s", GET_RTX_NAME (GET_CODE (op)));
113.1945 -+	  return;
113.1946 -+	}
113.1947 -+    }
113.1948 -+
113.1949 -+
113.1950 -+  switch (GET_CODE (op))
113.1951 -+    {
113.1952 -+    case REG:
113.1953 -+      if (letter == 0 || letter == 'z')
113.1954 -+	{
113.1955 -+	  fprintf (file, "%s", reg_names[REGNO (op)]);
113.1956 -+	  return;
113.1957 -+	}
113.1958 -+
113.1959 -+    case CONST_INT:
113.1960 -+      if (INTVAL (op) == 0 && letter == 'z')
113.1961 -+	{
113.1962 -+	  fprintf (file, "zero");
113.1963 -+	  return;
113.1964 -+	}
113.1965 -+      else if (letter == 'U')
113.1966 -+	{
113.1967 -+	  HOST_WIDE_INT val = INTVAL (op);
113.1968 -+	  rtx new_op;
113.1969 -+	  val = (val / 65536) & 0xFFFF;
113.1970 -+	  new_op = GEN_INT (val);
113.1971 -+	  output_addr_const (file, new_op);
113.1972 -+	  return;
113.1973 -+	}
113.1974 -+
113.1975 -+      /* else, fall through */
113.1976 -+    case CONST:
113.1977 -+    case LABEL_REF:
113.1978 -+    case SYMBOL_REF:
113.1979 -+    case CONST_DOUBLE:
113.1980 -+      if (letter == 0 || letter == 'z')
113.1981 -+	{
113.1982 -+	  output_addr_const (file, op);
113.1983 -+	  return;
113.1984 -+	}
113.1985 -+      else if (letter == 'H')
113.1986 -+	{
113.1987 -+	  fprintf (file, "%%hiadj(");
113.1988 -+	  output_addr_const (file, op);
113.1989 -+	  fprintf (file, ")");
113.1990 -+	  return;
113.1991 -+	}
113.1992 -+      else if (letter == 'L')
113.1993 -+	{
113.1994 -+	  fprintf (file, "%%lo(");
113.1995 -+	  output_addr_const (file, op);
113.1996 -+	  fprintf (file, ")");
113.1997 -+	  return;
113.1998 -+	}
113.1999 -+
113.2000 -+
113.2001 -+    case SUBREG:
113.2002 -+    case MEM:
113.2003 -+      if (letter == 0)
113.2004 -+	{
113.2005 -+	  output_address (op);
113.2006 -+	  return;
113.2007 -+	}
113.2008 -+
113.2009 -+    case CODE_LABEL:
113.2010 -+      if (letter == 0)
113.2011 -+	{
113.2012 -+	  output_addr_const (file, op);
113.2013 -+	  return;
113.2014 -+	}
113.2015 -+
113.2016 -+    default:
113.2017 -+      break;
113.2018 -+    }
113.2019 -+
113.2020 -+  fprintf (stderr, "Missing way to print (%c) ", letter);
113.2021 -+  debug_rtx (op);
113.2022 -+  abort ();
113.2023 -+}
113.2024 -+
113.2025 -+static int gprel_constant (rtx);
113.2026 -+
113.2027 -+static int
113.2028 -+gprel_constant (rtx op)
113.2029 -+{
113.2030 -+  if (GET_CODE (op) == SYMBOL_REF
113.2031 -+      && SYMBOL_REF_IN_NIOS2_SMALL_DATA_P (op))
113.2032 -+    {
113.2033 -+      return 1;
113.2034 -+    }
113.2035 -+  else if (GET_CODE (op) == CONST
113.2036 -+           && GET_CODE (XEXP (op, 0)) == PLUS)
113.2037 -+    {
113.2038 -+      return gprel_constant (XEXP (XEXP (op, 0), 0));
113.2039 -+    }
113.2040 -+  else
113.2041 -+    {
113.2042 -+      return 0;
113.2043 -+    }
113.2044 -+}
113.2045 -+
113.2046 -+void
113.2047 -+nios2_print_operand_address (FILE *file, rtx op)
113.2048 -+{
113.2049 -+  switch (GET_CODE (op))
113.2050 -+    {
113.2051 -+    case CONST:
113.2052 -+    case CONST_INT:
113.2053 -+    case LABEL_REF:
113.2054 -+    case CONST_DOUBLE:
113.2055 -+    case SYMBOL_REF:
113.2056 -+      if (gprel_constant (op))
113.2057 -+        {
113.2058 -+          fprintf (file, "%%gprel(");
113.2059 -+          output_addr_const (file, op);
113.2060 -+          fprintf (file, ")(%s)", reg_names[GP_REGNO]);
113.2061 -+          return;
113.2062 -+        }
113.2063 -+
113.2064 -+      break;
113.2065 -+
113.2066 -+    case PLUS:
113.2067 -+      {
113.2068 -+	rtx op0 = XEXP (op, 0);
113.2069 -+	rtx op1 = XEXP (op, 1);
113.2070 -+
113.2071 -+	if (REG_P (op0) && CONSTANT_P (op1))
113.2072 -+	  {
113.2073 -+	    output_addr_const (file, op1);
113.2074 -+	    fprintf (file, "(%s)", reg_names[REGNO (op0)]);
113.2075 -+	    return;
113.2076 -+	  }
113.2077 -+	else if (REG_P (op1) && CONSTANT_P (op0))
113.2078 -+	  {
113.2079 -+	    output_addr_const (file, op0);
113.2080 -+	    fprintf (file, "(%s)", reg_names[REGNO (op1)]);
113.2081 -+	    return;
113.2082 -+	  }
113.2083 -+      }
113.2084 -+      break;
113.2085 -+
113.2086 -+    case REG:
113.2087 -+      fprintf (file, "0(%s)", reg_names[REGNO (op)]);
113.2088 -+      return;
113.2089 -+
113.2090 -+    case MEM:
113.2091 -+      {
113.2092 -+	rtx base = XEXP (op, 0);
113.2093 -+	PRINT_OPERAND_ADDRESS (file, base);
113.2094 -+	return;
113.2095 -+      }
113.2096 -+    default:
113.2097 -+      break;
113.2098 -+    }
113.2099 -+
113.2100 -+  fprintf (stderr, "Missing way to print address\n");
113.2101 -+  debug_rtx (op);
113.2102 -+  abort ();
113.2103 -+}
113.2104 -+
113.2105 -+
113.2106 -+
113.2107 -+
113.2108 -+
113.2109 -+/****************************
113.2110 -+ * Predicates
113.2111 -+ ****************************/
113.2112 -+
113.2113 -+int
113.2114 -+arith_operand (rtx op, enum machine_mode mode)
113.2115 -+{
113.2116 -+  if (GET_CODE (op) == CONST_INT && SMALL_INT (INTVAL (op)))
113.2117 -+    return 1;
113.2118 -+
113.2119 -+  return register_operand (op, mode);
113.2120 -+}
113.2121 -+
113.2122 -+int
113.2123 -+uns_arith_operand (rtx op, enum machine_mode mode)
113.2124 -+{
113.2125 -+  if (GET_CODE (op) == CONST_INT && SMALL_INT_UNSIGNED (INTVAL (op)))
113.2126 -+    return 1;
113.2127 -+
113.2128 -+  return register_operand (op, mode);
113.2129 -+}
113.2130 -+
113.2131 -+int
113.2132 -+logical_operand (rtx op, enum machine_mode mode)
113.2133 -+{
113.2134 -+  if (GET_CODE (op) == CONST_INT
113.2135 -+      && (SMALL_INT_UNSIGNED (INTVAL (op)) || UPPER16_INT (INTVAL (op))))
113.2136 -+    return 1;
113.2137 -+
113.2138 -+  return register_operand (op, mode);
113.2139 -+}
113.2140 -+
113.2141 -+int
113.2142 -+shift_operand (rtx op, enum machine_mode mode)
113.2143 -+{
113.2144 -+  if (GET_CODE (op) == CONST_INT && SHIFT_INT (INTVAL (op)))
113.2145 -+    return 1;
113.2146 -+
113.2147 -+  return register_operand (op, mode);
113.2148 -+}
113.2149 -+
113.2150 -+int
113.2151 -+rdwrctl_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
113.2152 -+{
113.2153 -+  return GET_CODE (op) == CONST_INT && RDWRCTL_INT (INTVAL (op));
113.2154 -+}
113.2155 -+
113.2156 -+/* Return truth value of whether OP is a register or the constant 0. */
113.2157 -+
113.2158 -+int
113.2159 -+reg_or_0_operand (rtx op, enum machine_mode mode)
113.2160 -+{
113.2161 -+  switch (GET_CODE (op))
113.2162 -+    {
113.2163 -+    case CONST_INT:
113.2164 -+      return INTVAL (op) == 0;
113.2165 -+
113.2166 -+    case CONST_DOUBLE:
113.2167 -+      return op == CONST0_RTX (mode);
113.2168 -+
113.2169 -+    default:
113.2170 -+      break;
113.2171 -+    }
113.2172 -+
113.2173 -+  return register_operand (op, mode);
113.2174 -+}
113.2175 -+
113.2176 -+
113.2177 -+int
113.2178 -+equality_op (rtx op, enum machine_mode mode)
113.2179 -+{
113.2180 -+  if (mode != GET_MODE (op))
113.2181 -+    return 0;
113.2182 -+
113.2183 -+  return GET_CODE (op) == EQ || GET_CODE (op) == NE;
113.2184 -+}
113.2185 -+
113.2186 -+int
113.2187 -+custom_insn_opcode (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
113.2188 -+{
113.2189 -+  return GET_CODE (op) == CONST_INT && CUSTOM_INSN_OPCODE (INTVAL (op));
113.2190 -+}
113.2191 -+
113.2192 -+
113.2193 -+
113.2194 -+
113.2195 -+
113.2196 -+
113.2197 -+
113.2198 -+/*****************************************************************************
113.2199 -+**
113.2200 -+** instruction scheduler
113.2201 -+**
113.2202 -+*****************************************************************************/
113.2203 -+static int
113.2204 -+nios2_use_dfa_pipeline_interface ()
113.2205 -+{
113.2206 -+  return 1;
113.2207 -+}
113.2208 -+
113.2209 -+
113.2210 -+static int
113.2211 -+nios2_issue_rate ()
113.2212 -+{
113.2213 -+#ifdef MAX_DFA_ISSUE_RATE
113.2214 -+  return MAX_DFA_ISSUE_RATE;
113.2215 -+#else
113.2216 -+  return 1;
113.2217 -+#endif
113.2218 -+}
113.2219 -+
113.2220 -+
113.2221 -+const char *
113.2222 -+asm_output_opcode (FILE *file ATTRIBUTE_UNUSED, 
113.2223 -+                   const char *ptr ATTRIBUTE_UNUSED)
113.2224 -+{
113.2225 -+  const char *p;
113.2226 -+
113.2227 -+  p = ptr;
113.2228 -+  return ptr;
113.2229 -+}
113.2230 -+
113.2231 -+
113.2232 -+
113.2233 -+/*****************************************************************************
113.2234 -+**
113.2235 -+** function arguments
113.2236 -+**
113.2237 -+*****************************************************************************/
113.2238 -+
113.2239 -+void
113.2240 -+init_cumulative_args (CUMULATIVE_ARGS *cum, 
113.2241 -+                      tree fntype ATTRIBUTE_UNUSED, 
113.2242 -+                      rtx libname ATTRIBUTE_UNUSED, 
113.2243 -+                      tree fndecl ATTRIBUTE_UNUSED, 
113.2244 -+                      int n_named_args ATTRIBUTE_UNUSED)
113.2245 -+{
113.2246 -+  cum->regs_used = 0;
113.2247 -+}
113.2248 -+
113.2249 -+
113.2250 -+/* Update the data in CUM to advance over an argument
113.2251 -+   of mode MODE and data type TYPE.
113.2252 -+   (TYPE is null for libcalls where that information may not be available.)  */
113.2253 -+
113.2254 -+void
113.2255 -+function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, 
113.2256 -+                      tree type ATTRIBUTE_UNUSED, int named ATTRIBUTE_UNUSED)
113.2257 -+{
113.2258 -+  HOST_WIDE_INT param_size;
113.2259 -+
113.2260 -+  if (mode == BLKmode)
113.2261 -+    {
113.2262 -+      param_size = int_size_in_bytes (type);
113.2263 -+      if (param_size < 0)
113.2264 -+	internal_error
113.2265 -+	  ("Do not know how to handle large structs or variable length types");
113.2266 -+    }
113.2267 -+  else
113.2268 -+    {
113.2269 -+      param_size = GET_MODE_SIZE (mode);
113.2270 -+    }
113.2271 -+
113.2272 -+  /* convert to words (round up) */
113.2273 -+  param_size = (3 + param_size) / 4;
113.2274 -+
113.2275 -+  if (cum->regs_used + param_size > NUM_ARG_REGS)
113.2276 -+    {
113.2277 -+      cum->regs_used = NUM_ARG_REGS;
113.2278 -+    }
113.2279 -+  else
113.2280 -+    {
113.2281 -+      cum->regs_used += param_size;
113.2282 -+    }
113.2283 -+
113.2284 -+  return;
113.2285 -+}
113.2286 -+
113.2287 -+/* Define where to put the arguments to a function.  Value is zero to
113.2288 -+   push the argument on the stack, or a hard register in which to
113.2289 -+   store the argument.
113.2290 -+
113.2291 -+   MODE is the argument's machine mode.
113.2292 -+   TYPE is the data type of the argument (as a tree).
113.2293 -+   This is null for libcalls where that information may
113.2294 -+   not be available.
113.2295 -+   CUM is a variable of type CUMULATIVE_ARGS which gives info about
113.2296 -+   the preceding args and about the function being called.
113.2297 -+   NAMED is nonzero if this argument is a named parameter
113.2298 -+   (otherwise it is an extra parameter matching an ellipsis).  */
113.2299 -+rtx
113.2300 -+function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode, 
113.2301 -+              tree type ATTRIBUTE_UNUSED, int named ATTRIBUTE_UNUSED)
113.2302 -+{
113.2303 -+  rtx return_rtx = NULL_RTX;
113.2304 -+
113.2305 -+  if (cum->regs_used < NUM_ARG_REGS)
113.2306 -+    {
113.2307 -+      return_rtx = gen_rtx_REG (mode, FIRST_ARG_REGNO + cum->regs_used);
113.2308 -+    }
113.2309 -+
113.2310 -+  return return_rtx;
113.2311 -+}
113.2312 -+
113.2313 -+int
113.2314 -+function_arg_partial_nregs (const CUMULATIVE_ARGS *cum,
113.2315 -+                            enum machine_mode mode, tree type, 
113.2316 -+                            int named ATTRIBUTE_UNUSED)
113.2317 -+{
113.2318 -+  HOST_WIDE_INT param_size;
113.2319 -+
113.2320 -+  if (mode == BLKmode)
113.2321 -+    {
113.2322 -+      param_size = int_size_in_bytes (type);
113.2323 -+      if (param_size < 0)
113.2324 -+	internal_error
113.2325 -+	  ("Do not know how to handle large structs or variable length types");
113.2326 -+    }
113.2327 -+  else
113.2328 -+    {
113.2329 -+      param_size = GET_MODE_SIZE (mode);
113.2330 -+    }
113.2331 -+
113.2332 -+  /* convert to words (round up) */
113.2333 -+  param_size = (3 + param_size) / 4;
113.2334 -+
113.2335 -+  if (cum->regs_used < NUM_ARG_REGS
113.2336 -+      && cum->regs_used + param_size > NUM_ARG_REGS)
113.2337 -+    {
113.2338 -+      return NUM_ARG_REGS - cum->regs_used;
113.2339 -+    }
113.2340 -+  else
113.2341 -+    {
113.2342 -+      return 0;
113.2343 -+    }
113.2344 -+}
113.2345 -+
113.2346 -+
113.2347 -+int
113.2348 -+nios2_return_in_memory (tree type)
113.2349 -+{
113.2350 -+  int res = ((int_size_in_bytes (type) > (2 * UNITS_PER_WORD))
113.2351 -+  	     || (int_size_in_bytes (type) == -1));
113.2352 -+
113.2353 -+  return res;
113.2354 -+}
113.2355 -+
113.2356 -+/* ??? It may be possible to eliminate the copyback and implement
113.2357 -+       my own va_arg type, but that is more work for now. */
113.2358 -+int
113.2359 -+nios2_setup_incoming_varargs (const CUMULATIVE_ARGS *cum, 
113.2360 -+                              enum machine_mode mode, tree type, 
113.2361 -+                              int no_rtl)
113.2362 -+{
113.2363 -+  CUMULATIVE_ARGS local_cum;
113.2364 -+  int regs_to_push;
113.2365 -+
113.2366 -+  local_cum = *cum;
113.2367 -+  FUNCTION_ARG_ADVANCE (local_cum, mode, type, 1);
113.2368 -+
113.2369 -+  regs_to_push = NUM_ARG_REGS - local_cum.regs_used;
113.2370 -+
113.2371 -+  if (!no_rtl)
113.2372 -+    {
113.2373 -+      if (regs_to_push > 0)
113.2374 -+	{
113.2375 -+	  rtx ptr, mem;
113.2376 -+
113.2377 -+	  ptr = virtual_incoming_args_rtx;
113.2378 -+	  mem = gen_rtx_MEM (BLKmode, ptr);
113.2379 -+
113.2380 -+	  /* va_arg is an array access in this case, which causes
113.2381 -+	     it to get MEM_IN_STRUCT_P set.  We must set it here
113.2382 -+	     so that the insn scheduler won't assume that these
113.2383 -+	     stores can't possibly overlap with the va_arg loads.  */
113.2384 -+	  MEM_SET_IN_STRUCT_P (mem, 1);
113.2385 -+
113.2386 -+	  emit_insn (gen_blockage ());
113.2387 -+	  move_block_from_reg (local_cum.regs_used + FIRST_ARG_REGNO, mem,
113.2388 -+			       regs_to_push);
113.2389 -+	  emit_insn (gen_blockage ());
113.2390 -+	}
113.2391 -+    }
113.2392 -+
113.2393 -+  return regs_to_push * UNITS_PER_WORD;
113.2394 -+
113.2395 -+}
113.2396 -+
113.2397 -+
113.2398 -+
113.2399 -+/*****************************************************************************
113.2400 -+**
113.2401 -+** builtins
113.2402 -+**
113.2403 -+** This method for handling builtins is from CSP where _many_ more types of
113.2404 -+** expanders have already been written. Check there first before writing
113.2405 -+** new ones.
113.2406 -+**
113.2407 -+*****************************************************************************/
113.2408 -+
113.2409 -+enum nios2_builtins
113.2410 -+{
113.2411 -+  NIOS2_BUILTIN_LDBIO,
113.2412 -+  NIOS2_BUILTIN_LDBUIO,
113.2413 -+  NIOS2_BUILTIN_LDHIO,
113.2414 -+  NIOS2_BUILTIN_LDHUIO,
113.2415 -+  NIOS2_BUILTIN_LDWIO,
113.2416 -+  NIOS2_BUILTIN_STBIO,
113.2417 -+  NIOS2_BUILTIN_STHIO,
113.2418 -+  NIOS2_BUILTIN_STWIO,
113.2419 -+  NIOS2_BUILTIN_SYNC,
113.2420 -+  NIOS2_BUILTIN_RDCTL,
113.2421 -+  NIOS2_BUILTIN_WRCTL,
113.2422 -+
113.2423 -+  NIOS2_BUILTIN_CUSTOM_N,
113.2424 -+  NIOS2_BUILTIN_CUSTOM_NI,
113.2425 -+  NIOS2_BUILTIN_CUSTOM_NF,
113.2426 -+  NIOS2_BUILTIN_CUSTOM_NP,
113.2427 -+  NIOS2_BUILTIN_CUSTOM_NII,
113.2428 -+  NIOS2_BUILTIN_CUSTOM_NIF,
113.2429 -+  NIOS2_BUILTIN_CUSTOM_NIP,
113.2430 -+  NIOS2_BUILTIN_CUSTOM_NFI,
113.2431 -+  NIOS2_BUILTIN_CUSTOM_NFF,
113.2432 -+  NIOS2_BUILTIN_CUSTOM_NFP,
113.2433 -+  NIOS2_BUILTIN_CUSTOM_NPI,
113.2434 -+  NIOS2_BUILTIN_CUSTOM_NPF,
113.2435 -+  NIOS2_BUILTIN_CUSTOM_NPP,
113.2436 -+  NIOS2_BUILTIN_CUSTOM_IN,
113.2437 -+  NIOS2_BUILTIN_CUSTOM_INI,
113.2438 -+  NIOS2_BUILTIN_CUSTOM_INF,
113.2439 -+  NIOS2_BUILTIN_CUSTOM_INP,
113.2440 -+  NIOS2_BUILTIN_CUSTOM_INII,
113.2441 -+  NIOS2_BUILTIN_CUSTOM_INIF,
113.2442 -+  NIOS2_BUILTIN_CUSTOM_INIP,
113.2443 -+  NIOS2_BUILTIN_CUSTOM_INFI,
113.2444 -+  NIOS2_BUILTIN_CUSTOM_INFF,
113.2445 -+  NIOS2_BUILTIN_CUSTOM_INFP,
113.2446 -+  NIOS2_BUILTIN_CUSTOM_INPI,
113.2447 -+  NIOS2_BUILTIN_CUSTOM_INPF,
113.2448 -+  NIOS2_BUILTIN_CUSTOM_INPP,
113.2449 -+  NIOS2_BUILTIN_CUSTOM_FN,
113.2450 -+  NIOS2_BUILTIN_CUSTOM_FNI,
113.2451 -+  NIOS2_BUILTIN_CUSTOM_FNF,
113.2452 -+  NIOS2_BUILTIN_CUSTOM_FNP,
113.2453 -+  NIOS2_BUILTIN_CUSTOM_FNII,
113.2454 -+  NIOS2_BUILTIN_CUSTOM_FNIF,
113.2455 -+  NIOS2_BUILTIN_CUSTOM_FNIP,
113.2456 -+  NIOS2_BUILTIN_CUSTOM_FNFI,
113.2457 -+  NIOS2_BUILTIN_CUSTOM_FNFF,
113.2458 -+  NIOS2_BUILTIN_CUSTOM_FNFP,
113.2459 -+  NIOS2_BUILTIN_CUSTOM_FNPI,
113.2460 -+  NIOS2_BUILTIN_CUSTOM_FNPF,
113.2461 -+  NIOS2_BUILTIN_CUSTOM_FNPP,
113.2462 -+  NIOS2_BUILTIN_CUSTOM_PN,
113.2463 -+  NIOS2_BUILTIN_CUSTOM_PNI,
113.2464 -+  NIOS2_BUILTIN_CUSTOM_PNF,
113.2465 -+  NIOS2_BUILTIN_CUSTOM_PNP,
113.2466 -+  NIOS2_BUILTIN_CUSTOM_PNII,
113.2467 -+  NIOS2_BUILTIN_CUSTOM_PNIF,
113.2468 -+  NIOS2_BUILTIN_CUSTOM_PNIP,
113.2469 -+  NIOS2_BUILTIN_CUSTOM_PNFI,
113.2470 -+  NIOS2_BUILTIN_CUSTOM_PNFF,
113.2471 -+  NIOS2_BUILTIN_CUSTOM_PNFP,
113.2472 -+  NIOS2_BUILTIN_CUSTOM_PNPI,
113.2473 -+  NIOS2_BUILTIN_CUSTOM_PNPF,
113.2474 -+  NIOS2_BUILTIN_CUSTOM_PNPP,
113.2475 -+
113.2476 -+
113.2477 -+  LIM_NIOS2_BUILTINS
113.2478 -+};
113.2479 -+
113.2480 -+struct builtin_description
113.2481 -+{
113.2482 -+    const enum insn_code icode;
113.2483 -+    const char *const name;
113.2484 -+    const enum nios2_builtins code;
113.2485 -+    const tree *type;
113.2486 -+    rtx (* expander) PARAMS ((const struct builtin_description *,
113.2487 -+                              tree, rtx, rtx, enum machine_mode, int));
113.2488 -+};
113.2489 -+
113.2490 -+static rtx nios2_expand_STXIO (const struct builtin_description *, 
113.2491 -+                               tree, rtx, rtx, enum machine_mode, int);
113.2492 -+static rtx nios2_expand_LDXIO (const struct builtin_description *, 
113.2493 -+                               tree, rtx, rtx, enum machine_mode, int);
113.2494 -+static rtx nios2_expand_sync (const struct builtin_description *, 
113.2495 -+                              tree, rtx, rtx, enum machine_mode, int);
113.2496 -+static rtx nios2_expand_rdctl (const struct builtin_description *, 
113.2497 -+                               tree, rtx, rtx, enum machine_mode, int);
113.2498 -+static rtx nios2_expand_wrctl (const struct builtin_description *, 
113.2499 -+                               tree, rtx, rtx, enum machine_mode, int);
113.2500 -+
113.2501 -+static rtx nios2_expand_custom_n (const struct builtin_description *, 
113.2502 -+                                  tree, rtx, rtx, enum machine_mode, int);
113.2503 -+static rtx nios2_expand_custom_Xn (const struct builtin_description *, 
113.2504 -+                                   tree, rtx, rtx, enum machine_mode, int);
113.2505 -+static rtx nios2_expand_custom_nX (const struct builtin_description *, 
113.2506 -+                                   tree, rtx, rtx, enum machine_mode, int);
113.2507 -+static rtx nios2_expand_custom_XnX (const struct builtin_description *, 
113.2508 -+                                    tree, rtx, rtx, enum machine_mode, int);
113.2509 -+static rtx nios2_expand_custom_nXX (const struct builtin_description *, 
113.2510 -+                                    tree, rtx, rtx, enum machine_mode, int);
113.2511 -+static rtx nios2_expand_custom_XnXX (const struct builtin_description *, 
113.2512 -+                                     tree, rtx, rtx, enum machine_mode, int);
113.2513 -+
113.2514 -+static tree endlink;
113.2515 -+
113.2516 -+/* int fn (volatile const void *)
113.2517 -+ */
113.2518 -+static tree int_ftype_volatile_const_void_p;
113.2519 -+
113.2520 -+/* int fn (int)
113.2521 -+ */
113.2522 -+static tree int_ftype_int;
113.2523 -+
113.2524 -+/* void fn (int, int)
113.2525 -+ */
113.2526 -+static tree void_ftype_int_int;
113.2527 -+
113.2528 -+/* void fn (volatile void *, int)
113.2529 -+ */
113.2530 -+static tree void_ftype_volatile_void_p_int;
113.2531 -+
113.2532 -+/* void fn (void)
113.2533 -+ */
113.2534 -+static tree void_ftype_void;
113.2535 -+
113.2536 -+static tree custom_n;
113.2537 -+static tree custom_ni;
113.2538 -+static tree custom_nf;
113.2539 -+static tree custom_np;
113.2540 -+static tree custom_nii;
113.2541 -+static tree custom_nif;
113.2542 -+static tree custom_nip;
113.2543 -+static tree custom_nfi;
113.2544 -+static tree custom_nff;
113.2545 -+static tree custom_nfp;
113.2546 -+static tree custom_npi;
113.2547 -+static tree custom_npf;
113.2548 -+static tree custom_npp;
113.2549 -+static tree custom_in;
113.2550 -+static tree custom_ini;
113.2551 -+static tree custom_inf;
113.2552 -+static tree custom_inp;
113.2553 -+static tree custom_inii;
113.2554 -+static tree custom_inif;
113.2555 -+static tree custom_inip;
113.2556 -+static tree custom_infi;
113.2557 -+static tree custom_inff;
113.2558 -+static tree custom_infp;
113.2559 -+static tree custom_inpi;
113.2560 -+static tree custom_inpf;
113.2561 -+static tree custom_inpp;
113.2562 -+static tree custom_fn;
113.2563 -+static tree custom_fni;
113.2564 -+static tree custom_fnf;
113.2565 -+static tree custom_fnp;
113.2566 -+static tree custom_fnii;
113.2567 -+static tree custom_fnif;
113.2568 -+static tree custom_fnip;
113.2569 -+static tree custom_fnfi;
113.2570 -+static tree custom_fnff;
113.2571 -+static tree custom_fnfp;
113.2572 -+static tree custom_fnpi;
113.2573 -+static tree custom_fnpf;
113.2574 -+static tree custom_fnpp;
113.2575 -+static tree custom_pn;
113.2576 -+static tree custom_pni;
113.2577 -+static tree custom_pnf;
113.2578 -+static tree custom_pnp;
113.2579 -+static tree custom_pnii;
113.2580 -+static tree custom_pnif;
113.2581 -+static tree custom_pnip;
113.2582 -+static tree custom_pnfi;
113.2583 -+static tree custom_pnff;
113.2584 -+static tree custom_pnfp;
113.2585 -+static tree custom_pnpi;
113.2586 -+static tree custom_pnpf;
113.2587 -+static tree custom_pnpp;
113.2588 -+
113.2589 -+
113.2590 -+static const struct builtin_description bdesc[] = {
113.2591 -+    {CODE_FOR_ldbio, "__builtin_ldbio", NIOS2_BUILTIN_LDBIO, &int_ftype_volatile_const_void_p, nios2_expand_LDXIO},
113.2592 -+    {CODE_FOR_ldbuio, "__builtin_ldbuio", NIOS2_BUILTIN_LDBUIO, &int_ftype_volatile_const_void_p, nios2_expand_LDXIO},
113.2593 -+    {CODE_FOR_ldhio, "__builtin_ldhio", NIOS2_BUILTIN_LDHIO, &int_ftype_volatile_const_void_p, nios2_expand_LDXIO},
113.2594 -+    {CODE_FOR_ldhuio, "__builtin_ldhuio", NIOS2_BUILTIN_LDHUIO, &int_ftype_volatile_const_void_p, nios2_expand_LDXIO},
113.2595 -+    {CODE_FOR_ldwio, "__builtin_ldwio", NIOS2_BUILTIN_LDWIO, &int_ftype_volatile_const_void_p, nios2_expand_LDXIO},
113.2596 -+
113.2597 -+    {CODE_FOR_stbio, "__builtin_stbio", NIOS2_BUILTIN_STBIO, &void_ftype_volatile_void_p_int, nios2_expand_STXIO},
113.2598 -+    {CODE_FOR_sthio, "__builtin_sthio", NIOS2_BUILTIN_STHIO, &void_ftype_volatile_void_p_int, nios2_expand_STXIO},
113.2599 -+    {CODE_FOR_stwio, "__builtin_stwio", NIOS2_BUILTIN_STWIO, &void_ftype_volatile_void_p_int, nios2_expand_STXIO},
113.2600 -+
113.2601 -+    {CODE_FOR_sync, "__builtin_sync", NIOS2_BUILTIN_SYNC, &void_ftype_void, nios2_expand_sync},
113.2602 -+    {CODE_FOR_rdctl, "__builtin_rdctl", NIOS2_BUILTIN_RDCTL, &int_ftype_int, nios2_expand_rdctl},
113.2603 -+    {CODE_FOR_wrctl, "__builtin_wrctl", NIOS2_BUILTIN_WRCTL, &void_ftype_int_int, nios2_expand_wrctl},
113.2604 -+
113.2605 -+    {CODE_FOR_custom_n, "__builtin_custom_n", NIOS2_BUILTIN_CUSTOM_N, &custom_n, nios2_expand_custom_n},
113.2606 -+    {CODE_FOR_custom_ni, "__builtin_custom_ni", NIOS2_BUILTIN_CUSTOM_NI, &custom_ni, nios2_expand_custom_nX},
113.2607 -+    {CODE_FOR_custom_nf, "__builtin_custom_nf", NIOS2_BUILTIN_CUSTOM_NF, &custom_nf, nios2_expand_custom_nX},
113.2608 -+    {CODE_FOR_custom_np, "__builtin_custom_np", NIOS2_BUILTIN_CUSTOM_NP, &custom_np, nios2_expand_custom_nX},
113.2609 -+    {CODE_FOR_custom_nii, "__builtin_custom_nii", NIOS2_BUILTIN_CUSTOM_NII, &custom_nii, nios2_expand_custom_nXX},
113.2610 -+    {CODE_FOR_custom_nif, "__builtin_custom_nif", NIOS2_BUILTIN_CUSTOM_NIF, &custom_nif, nios2_expand_custom_nXX},
113.2611 -+    {CODE_FOR_custom_nip, "__builtin_custom_nip", NIOS2_BUILTIN_CUSTOM_NIP, &custom_nip, nios2_expand_custom_nXX},
113.2612 -+    {CODE_FOR_custom_nfi, "__builtin_custom_nfi", NIOS2_BUILTIN_CUSTOM_NFI, &custom_nfi, nios2_expand_custom_nXX},
113.2613 -+    {CODE_FOR_custom_nff, "__builtin_custom_nff", NIOS2_BUILTIN_CUSTOM_NFF, &custom_nff, nios2_expand_custom_nXX},
113.2614 -+    {CODE_FOR_custom_nfp, "__builtin_custom_nfp", NIOS2_BUILTIN_CUSTOM_NFP, &custom_nfp, nios2_expand_custom_nXX},
113.2615 -+    {CODE_FOR_custom_npi, "__builtin_custom_npi", NIOS2_BUILTIN_CUSTOM_NPI, &custom_npi, nios2_expand_custom_nXX},
113.2616 -+    {CODE_FOR_custom_npf, "__builtin_custom_npf", NIOS2_BUILTIN_CUSTOM_NPF, &custom_npf, nios2_expand_custom_nXX},
113.2617 -+    {CODE_FOR_custom_npp, "__builtin_custom_npp", NIOS2_BUILTIN_CUSTOM_NPP, &custom_npp, nios2_expand_custom_nXX},
113.2618 -+    {CODE_FOR_custom_in, "__builtin_custom_in", NIOS2_BUILTIN_CUSTOM_IN, &custom_in, nios2_expand_custom_Xn},
113.2619 -+    {CODE_FOR_custom_ini, "__builtin_custom_ini", NIOS2_BUILTIN_CUSTOM_INI, &custom_ini, nios2_expand_custom_XnX},
113.2620 -+    {CODE_FOR_custom_inf, "__builtin_custom_inf", NIOS2_BUILTIN_CUSTOM_INF, &custom_inf, nios2_expand_custom_XnX},
113.2621 -+    {CODE_FOR_custom_inp, "__builtin_custom_inp", NIOS2_BUILTIN_CUSTOM_INP, &custom_inp, nios2_expand_custom_XnX},
113.2622 -+    {CODE_FOR_custom_inii, "__builtin_custom_inii", NIOS2_BUILTIN_CUSTOM_INII, &custom_inii, nios2_expand_custom_XnXX},
113.2623 -+    {CODE_FOR_custom_inif, "__builtin_custom_inif", NIOS2_BUILTIN_CUSTOM_INIF, &custom_inif, nios2_expand_custom_XnXX},
113.2624 -+    {CODE_FOR_custom_inip, "__builtin_custom_inip", NIOS2_BUILTIN_CUSTOM_INIP, &custom_inip, nios2_expand_custom_XnXX},
113.2625 -+    {CODE_FOR_custom_infi, "__builtin_custom_infi", NIOS2_BUILTIN_CUSTOM_INFI, &custom_infi, nios2_expand_custom_XnXX},
113.2626 -+    {CODE_FOR_custom_inff, "__builtin_custom_inff", NIOS2_BUILTIN_CUSTOM_INFF, &custom_inff, nios2_expand_custom_XnXX},
113.2627 -+    {CODE_FOR_custom_infp, "__builtin_custom_infp", NIOS2_BUILTIN_CUSTOM_INFP, &custom_infp, nios2_expand_custom_XnXX},
113.2628 -+    {CODE_FOR_custom_inpi, "__builtin_custom_inpi", NIOS2_BUILTIN_CUSTOM_INPI, &custom_inpi, nios2_expand_custom_XnXX},
113.2629 -+    {CODE_FOR_custom_inpf, "__builtin_custom_inpf", NIOS2_BUILTIN_CUSTOM_INPF, &custom_inpf, nios2_expand_custom_XnXX},
113.2630 -+    {CODE_FOR_custom_inpp, "__builtin_custom_inpp", NIOS2_BUILTIN_CUSTOM_INPP, &custom_inpp, nios2_expand_custom_XnXX},
113.2631 -+    {CODE_FOR_custom_fn, "__builtin_custom_fn", NIOS2_BUILTIN_CUSTOM_FN, &custom_fn, nios2_expand_custom_Xn},
113.2632 -+    {CODE_FOR_custom_fni, "__builtin_custom_fni", NIOS2_BUILTIN_CUSTOM_FNI, &custom_fni, nios2_expand_custom_XnX},
113.2633 -+    {CODE_FOR_custom_fnf, "__builtin_custom_fnf", NIOS2_BUILTIN_CUSTOM_FNF, &custom_fnf, nios2_expand_custom_XnX},
113.2634 -+    {CODE_FOR_custom_fnp, "__builtin_custom_fnp", NIOS2_BUILTIN_CUSTOM_FNP, &custom_fnp, nios2_expand_custom_XnX},
113.2635 -+    {CODE_FOR_custom_fnii, "__builtin_custom_fnii", NIOS2_BUILTIN_CUSTOM_FNII, &custom_fnii, nios2_expand_custom_XnXX},
113.2636 -+    {CODE_FOR_custom_fnif, "__builtin_custom_fnif", NIOS2_BUILTIN_CUSTOM_FNIF, &custom_fnif, nios2_expand_custom_XnXX},
113.2637 -+    {CODE_FOR_custom_fnip, "__builtin_custom_fnip", NIOS2_BUILTIN_CUSTOM_FNIP, &custom_fnip, nios2_expand_custom_XnXX},
113.2638 -+    {CODE_FOR_custom_fnfi, "__builtin_custom_fnfi", NIOS2_BUILTIN_CUSTOM_FNFI, &custom_fnfi, nios2_expand_custom_XnXX},
113.2639 -+    {CODE_FOR_custom_fnff, "__builtin_custom_fnff", NIOS2_BUILTIN_CUSTOM_FNFF, &custom_fnff, nios2_expand_custom_XnXX},
113.2640 -+    {CODE_FOR_custom_fnfp, "__builtin_custom_fnfp", NIOS2_BUILTIN_CUSTOM_FNFP, &custom_fnfp, nios2_expand_custom_XnXX},
113.2641 -+    {CODE_FOR_custom_fnpi, "__builtin_custom_fnpi", NIOS2_BUILTIN_CUSTOM_FNPI, &custom_fnpi, nios2_expand_custom_XnXX},
113.2642 -+    {CODE_FOR_custom_fnpf, "__builtin_custom_fnpf", NIOS2_BUILTIN_CUSTOM_FNPF, &custom_fnpf, nios2_expand_custom_XnXX},
113.2643 -+    {CODE_FOR_custom_fnpp, "__builtin_custom_fnpp", NIOS2_BUILTIN_CUSTOM_FNPP, &custom_fnpp, nios2_expand_custom_XnXX},
113.2644 -+    {CODE_FOR_custom_pn, "__builtin_custom_pn", NIOS2_BUILTIN_CUSTOM_PN, &custom_pn, nios2_expand_custom_Xn},
113.2645 -+    {CODE_FOR_custom_pni, "__builtin_custom_pni", NIOS2_BUILTIN_CUSTOM_PNI, &custom_pni, nios2_expand_custom_XnX},
113.2646 -+    {CODE_FOR_custom_pnf, "__builtin_custom_pnf", NIOS2_BUILTIN_CUSTOM_PNF, &custom_pnf, nios2_expand_custom_XnX},
113.2647 -+    {CODE_FOR_custom_pnp, "__builtin_custom_pnp", NIOS2_BUILTIN_CUSTOM_PNP, &custom_pnp, nios2_expand_custom_XnX},
113.2648 -+    {CODE_FOR_custom_pnii, "__builtin_custom_pnii", NIOS2_BUILTIN_CUSTOM_PNII, &custom_pnii, nios2_expand_custom_XnXX},
113.2649 -+    {CODE_FOR_custom_pnif, "__builtin_custom_pnif", NIOS2_BUILTIN_CUSTOM_PNIF, &custom_pnif, nios2_expand_custom_XnXX},
113.2650 -+    {CODE_FOR_custom_pnip, "__builtin_custom_pnip", NIOS2_BUILTIN_CUSTOM_PNIP, &custom_pnip, nios2_expand_custom_XnXX},
113.2651 -+    {CODE_FOR_custom_pnfi, "__builtin_custom_pnfi", NIOS2_BUILTIN_CUSTOM_PNFI, &custom_pnfi, nios2_expand_custom_XnXX},
113.2652 -+    {CODE_FOR_custom_pnff, "__builtin_custom_pnff", NIOS2_BUILTIN_CUSTOM_PNFF, &custom_pnff, nios2_expand_custom_XnXX},
113.2653 -+    {CODE_FOR_custom_pnfp, "__builtin_custom_pnfp", NIOS2_BUILTIN_CUSTOM_PNFP, &custom_pnfp, nios2_expand_custom_XnXX},
113.2654 -+    {CODE_FOR_custom_pnpi, "__builtin_custom_pnpi", NIOS2_BUILTIN_CUSTOM_PNPI, &custom_pnpi, nios2_expand_custom_XnXX},
113.2655 -+    {CODE_FOR_custom_pnpf, "__builtin_custom_pnpf", NIOS2_BUILTIN_CUSTOM_PNPF, &custom_pnpf, nios2_expand_custom_XnXX},
113.2656 -+    {CODE_FOR_custom_pnpp, "__builtin_custom_pnpp", NIOS2_BUILTIN_CUSTOM_PNPP, &custom_pnpp, nios2_expand_custom_XnXX},
113.2657 -+
113.2658 -+
113.2659 -+    {0, 0, 0, 0, 0},
113.2660 -+};
113.2661 -+
113.2662 -+/* This does not have a closing bracket on purpose (see use) */
113.2663 -+#define def_param(TYPE) \
113.2664 -+  tree_cons (NULL_TREE, TYPE,
113.2665 -+
113.2666 -+static void
113.2667 -+nios2_init_builtins ()
113.2668 -+{
113.2669 -+  const struct builtin_description *d;
113.2670 -+
113.2671 -+
113.2672 -+  endlink = void_list_node;
113.2673 -+
113.2674 -+  /* Special indenting here because one of the brackets is in def_param */
113.2675 -+  /* *INDENT-OFF* */
113.2676 -+
113.2677 -+  /* int fn (volatile const void *)
113.2678 -+   */
113.2679 -+  int_ftype_volatile_const_void_p
113.2680 -+    = build_function_type (integer_type_node,
113.2681 -+			   def_param (build_qualified_type (ptr_type_node,
113.2682 -+			                                    TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE))
113.2683 -+			   endlink));
113.2684 -+
113.2685 -+
113.2686 -+  /* void fn (volatile void *, int)
113.2687 -+   */
113.2688 -+  void_ftype_volatile_void_p_int
113.2689 -+    = build_function_type (void_type_node,
113.2690 -+			   def_param (build_qualified_type (ptr_type_node,
113.2691 -+			                                    TYPE_QUAL_VOLATILE))
113.2692 -+			   def_param (integer_type_node)
113.2693 -+			   endlink)));
113.2694 -+
113.2695 -+  /* void fn (void)
113.2696 -+   */
113.2697 -+  void_ftype_void
113.2698 -+      = build_function_type (void_type_node,
113.2699 -+                             endlink);
113.2700 -+
113.2701 -+  /* int fn (int)
113.2702 -+   */
113.2703 -+  int_ftype_int
113.2704 -+      = build_function_type (integer_type_node,
113.2705 -+                             def_param (integer_type_node)
113.2706 -+                             endlink));
113.2707 -+
113.2708 -+  /* void fn (int, int)
113.2709 -+   */
113.2710 -+  void_ftype_int_int
113.2711 -+      = build_function_type (void_type_node,
113.2712 -+                             def_param (integer_type_node)
113.2713 -+                             def_param (integer_type_node)
113.2714 -+                             endlink)));
113.2715 -+
113.2716 -+
113.2717 -+#define CUSTOM_NUM def_param (integer_type_node)
113.2718 -+
113.2719 -+  custom_n
113.2720 -+      = build_function_type (void_type_node,
113.2721 -+  			     CUSTOM_NUM
113.2722 -+  			     endlink));
113.2723 -+  custom_ni
113.2724 -+      = build_function_type (void_type_node,
113.2725 -+  			     CUSTOM_NUM
113.2726 -+  			     def_param (integer_type_node)
113.2727 -+  			     endlink)));
113.2728 -+  custom_nf
113.2729 -+      = build_function_type (void_type_node,
113.2730 -+  			     CUSTOM_NUM
113.2731 -+  			     def_param (float_type_node)
113.2732 -+  			     endlink)));
113.2733 -+  custom_np
113.2734 -+      = build_function_type (void_type_node,
113.2735 -+  			     CUSTOM_NUM
113.2736 -+  			     def_param (ptr_type_node)
113.2737 -+  			     endlink)));
113.2738 -+  custom_nii
113.2739 -+      = build_function_type (void_type_node,
113.2740 -+  			     CUSTOM_NUM
113.2741 -+  			     def_param (integer_type_node)
113.2742 -+  			     def_param (integer_type_node)
113.2743 -+  			     endlink))));
113.2744 -+  custom_nif
113.2745 -+      = build_function_type (void_type_node,
113.2746 -+  			     CUSTOM_NUM
113.2747 -+  			     def_param (integer_type_node)
113.2748 -+  			     def_param (float_type_node)
113.2749 -+  			     endlink))));
113.2750 -+  custom_nip
113.2751 -+      = build_function_type (void_type_node,
113.2752 -+  			     CUSTOM_NUM
113.2753 -+  			     def_param (integer_type_node)
113.2754 -+  			     def_param (ptr_type_node)
113.2755 -+  			     endlink))));
113.2756 -+  custom_nfi
113.2757 -+      = build_function_type (void_type_node,
113.2758 -+  			     CUSTOM_NUM
113.2759 -+  			     def_param (float_type_node)
113.2760 -+  			     def_param (integer_type_node)
113.2761 -+  			     endlink))));
113.2762 -+  custom_nff
113.2763 -+      = build_function_type (void_type_node,
113.2764 -+  			     CUSTOM_NUM
113.2765 -+  			     def_param (float_type_node)
113.2766 -+  			     def_param (float_type_node)
113.2767 -+  			     endlink))));
113.2768 -+  custom_nfp
113.2769 -+      = build_function_type (void_type_node,
113.2770 -+  			     CUSTOM_NUM
113.2771 -+  			     def_param (float_type_node)
113.2772 -+  			     def_param (ptr_type_node)
113.2773 -+  			     endlink))));
113.2774 -+  custom_npi
113.2775 -+      = build_function_type (void_type_node,
113.2776 -+  			     CUSTOM_NUM
113.2777 -+  			     def_param (ptr_type_node)
113.2778 -+  			     def_param (integer_type_node)
113.2779 -+  			     endlink))));
113.2780 -+  custom_npf
113.2781 -+      = build_function_type (void_type_node,
113.2782 -+  			     CUSTOM_NUM
113.2783 -+  			     def_param (ptr_type_node)
113.2784 -+  			     def_param (float_type_node)
113.2785 -+  			     endlink))));
113.2786 -+  custom_npp
113.2787 -+      = build_function_type (void_type_node,
113.2788 -+  			     CUSTOM_NUM
113.2789 -+  			     def_param (ptr_type_node)
113.2790 -+  			     def_param (ptr_type_node)
113.2791 -+  			     endlink))));
113.2792 -+
113.2793 -+  custom_in
113.2794 -+      = build_function_type (integer_type_node,
113.2795 -+  			     CUSTOM_NUM
113.2796 -+  			     endlink));
113.2797 -+  custom_ini
113.2798 -+      = build_function_type (integer_type_node,
113.2799 -+  			     CUSTOM_NUM
113.2800 -+  			     def_param (integer_type_node)
113.2801 -+  			     endlink)));
113.2802 -+  custom_inf
113.2803 -+      = build_function_type (integer_type_node,
113.2804 -+  			     CUSTOM_NUM
113.2805 -+  			     def_param (float_type_node)
113.2806 -+  			     endlink)));
113.2807 -+  custom_inp
113.2808 -+      = build_function_type (integer_type_node,
113.2809 -+  			     CUSTOM_NUM
113.2810 -+  			     def_param (ptr_type_node)
113.2811 -+  			     endlink)));
113.2812 -+  custom_inii
113.2813 -+      = build_function_type (integer_type_node,
113.2814 -+  			     CUSTOM_NUM
113.2815 -+  			     def_param (integer_type_node)
113.2816 -+  			     def_param (integer_type_node)
113.2817 -+  			     endlink))));
113.2818 -+  custom_inif
113.2819 -+      = build_function_type (integer_type_node,
113.2820 -+  			     CUSTOM_NUM
113.2821 -+  			     def_param (integer_type_node)
113.2822 -+  			     def_param (float_type_node)
113.2823 -+  			     endlink))));
113.2824 -+  custom_inip
113.2825 -+      = build_function_type (integer_type_node,
113.2826 -+  			     CUSTOM_NUM
113.2827 -+  			     def_param (integer_type_node)
113.2828 -+  			     def_param (ptr_type_node)
113.2829 -+  			     endlink))));
113.2830 -+  custom_infi
113.2831 -+      = build_function_type (integer_type_node,
113.2832 -+  			     CUSTOM_NUM
113.2833 -+  			     def_param (float_type_node)
113.2834 -+  			     def_param (integer_type_node)
113.2835 -+  			     endlink))));
113.2836 -+  custom_inff
113.2837 -+      = build_function_type (integer_type_node,
113.2838 -+  			     CUSTOM_NUM
113.2839 -+  			     def_param (float_type_node)
113.2840 -+  			     def_param (float_type_node)
113.2841 -+  			     endlink))));
113.2842 -+  custom_infp
113.2843 -+      = build_function_type (integer_type_node,
113.2844 -+  			     CUSTOM_NUM
113.2845 -+  			     def_param (float_type_node)
113.2846 -+  			     def_param (ptr_type_node)
113.2847 -+  			     endlink))));
113.2848 -+  custom_inpi
113.2849 -+      = build_function_type (integer_type_node,
113.2850 -+  			     CUSTOM_NUM
113.2851 -+  			     def_param (ptr_type_node)
113.2852 -+  			     def_param (integer_type_node)
113.2853 -+  			     endlink))));
113.2854 -+  custom_inpf
113.2855 -+      = build_function_type (integer_type_node,
113.2856 -+  			     CUSTOM_NUM
113.2857 -+  			     def_param (ptr_type_node)
113.2858 -+  			     def_param (float_type_node)
113.2859 -+  			     endlink))));
113.2860 -+  custom_inpp
113.2861 -+      = build_function_type (integer_type_node,
113.2862 -+  			     CUSTOM_NUM
113.2863 -+  			     def_param (ptr_type_node)
113.2864 -+  			     def_param (ptr_type_node)
113.2865 -+  			     endlink))));
113.2866 -+
113.2867 -+  custom_fn
113.2868 -+      = build_function_type (float_type_node,
113.2869 -+  			     CUSTOM_NUM
113.2870 -+  			     endlink));
113.2871 -+  custom_fni
113.2872 -+      = build_function_type (float_type_node,
113.2873 -+  			     CUSTOM_NUM
113.2874 -+  			     def_param (integer_type_node)
113.2875 -+  			     endlink)));
113.2876 -+  custom_fnf
113.2877 -+      = build_function_type (float_type_node,
113.2878 -+  			     CUSTOM_NUM
113.2879 -+  			     def_param (float_type_node)
113.2880 -+  			     endlink)));
113.2881 -+  custom_fnp
113.2882 -+      = build_function_type (float_type_node,
113.2883 -+  			     CUSTOM_NUM
113.2884 -+  			     def_param (ptr_type_node)
113.2885 -+  			     endlink)));
113.2886 -+  custom_fnii
113.2887 -+      = build_function_type (float_type_node,
113.2888 -+  			     CUSTOM_NUM
113.2889 -+  			     def_param (integer_type_node)
113.2890 -+  			     def_param (integer_type_node)
113.2891 -+  			     endlink))));
113.2892 -+  custom_fnif
113.2893 -+      = build_function_type (float_type_node,
113.2894 -+  			     CUSTOM_NUM
113.2895 -+  			     def_param (integer_type_node)
113.2896 -+  			     def_param (float_type_node)
113.2897 -+  			     endlink))));
113.2898 -+  custom_fnip
113.2899 -+      = build_function_type (float_type_node,
113.2900 -+  			     CUSTOM_NUM
113.2901 -+  			     def_param (integer_type_node)
113.2902 -+  			     def_param (ptr_type_node)
113.2903 -+  			     endlink))));
113.2904 -+  custom_fnfi
113.2905 -+      = build_function_type (float_type_node,
113.2906 -+  			     CUSTOM_NUM
113.2907 -+  			     def_param (float_type_node)
113.2908 -+  			     def_param (integer_type_node)
113.2909 -+  			     endlink))));
113.2910 -+  custom_fnff
113.2911 -+      = build_function_type (float_type_node,
113.2912 -+  			     CUSTOM_NUM
113.2913 -+  			     def_param (float_type_node)
113.2914 -+  			     def_param (float_type_node)
113.2915 -+  			     endlink))));
113.2916 -+  custom_fnfp
113.2917 -+      = build_function_type (float_type_node,
113.2918 -+  			     CUSTOM_NUM
113.2919 -+  			     def_param (float_type_node)
113.2920 -+  			     def_param (ptr_type_node)
113.2921 -+  			     endlink))));
113.2922 -+  custom_fnpi
113.2923 -+      = build_function_type (float_type_node,
113.2924 -+  			     CUSTOM_NUM
113.2925 -+  			     def_param (ptr_type_node)
113.2926 -+  			     def_param (integer_type_node)
113.2927 -+  			     endlink))));
113.2928 -+  custom_fnpf
113.2929 -+      = build_function_type (float_type_node,
113.2930 -+  			     CUSTOM_NUM
113.2931 -+  			     def_param (ptr_type_node)
113.2932 -+  			     def_param (float_type_node)
113.2933 -+  			     endlink))));
113.2934 -+  custom_fnpp
113.2935 -+      = build_function_type (float_type_node,
113.2936 -+  			     CUSTOM_NUM
113.2937 -+  			     def_param (ptr_type_node)
113.2938 -+  			     def_param (ptr_type_node)
113.2939 -+  			     endlink))));
113.2940 -+
113.2941 -+
113.2942 -+  custom_pn
113.2943 -+      = build_function_type (ptr_type_node,
113.2944 -+  			     CUSTOM_NUM
113.2945 -+  			     endlink));
113.2946 -+  custom_pni
113.2947 -+      = build_function_type (ptr_type_node,
113.2948 -+  			     CUSTOM_NUM
113.2949 -+  			     def_param (integer_type_node)
113.2950 -+  			     endlink)));
113.2951 -+  custom_pnf
113.2952 -+      = build_function_type (ptr_type_node,
113.2953 -+  			     CUSTOM_NUM
113.2954 -+  			     def_param (float_type_node)
113.2955 -+  			     endlink)));
113.2956 -+  custom_pnp
113.2957 -+      = build_function_type (ptr_type_node,
113.2958 -+  			     CUSTOM_NUM
113.2959 -+  			     def_param (ptr_type_node)
113.2960 -+  			     endlink)));
113.2961 -+  custom_pnii
113.2962 -+      = build_function_type (ptr_type_node,
113.2963 -+  			     CUSTOM_NUM
113.2964 -+  			     def_param (integer_type_node)
113.2965 -+  			     def_param (integer_type_node)
113.2966 -+  			     endlink))));
113.2967 -+  custom_pnif
113.2968 -+      = build_function_type (ptr_type_node,
113.2969 -+  			     CUSTOM_NUM
113.2970 -+  			     def_param (integer_type_node)
113.2971 -+  			     def_param (float_type_node)
113.2972 -+  			     endlink))));
113.2973 -+  custom_pnip
113.2974 -+      = build_function_type (ptr_type_node,
113.2975 -+  			     CUSTOM_NUM
113.2976 -+  			     def_param (integer_type_node)
113.2977 -+  			     def_param (ptr_type_node)
113.2978 -+  			     endlink))));
113.2979 -+  custom_pnfi
113.2980 -+      = build_function_type (ptr_type_node,
113.2981 -+  			     CUSTOM_NUM
113.2982 -+  			     def_param (float_type_node)
113.2983 -+  			     def_param (integer_type_node)
113.2984 -+  			     endlink))));
113.2985 -+  custom_pnff
113.2986 -+      = build_function_type (ptr_type_node,
113.2987 -+  			     CUSTOM_NUM
113.2988 -+  			     def_param (float_type_node)
113.2989 -+  			     def_param (float_type_node)
113.2990 -+  			     endlink))));
113.2991 -+  custom_pnfp
113.2992 -+      = build_function_type (ptr_type_node,
113.2993 -+  			     CUSTOM_NUM
113.2994 -+  			     def_param (float_type_node)
113.2995 -+  			     def_param (ptr_type_node)
113.2996 -+  			     endlink))));
113.2997 -+  custom_pnpi
113.2998 -+      = build_function_type (ptr_type_node,
113.2999 -+  			     CUSTOM_NUM
113.3000 -+  			     def_param (ptr_type_node)
113.3001 -+  			     def_param (integer_type_node)
113.3002 -+  			     endlink))));
113.3003 -+  custom_pnpf
113.3004 -+      = build_function_type (ptr_type_node,
113.3005 -+  			     CUSTOM_NUM
113.3006 -+  			     def_param (ptr_type_node)
113.3007 -+  			     def_param (float_type_node)
113.3008 -+  			     endlink))));
113.3009 -+  custom_pnpp
113.3010 -+      = build_function_type (ptr_type_node,
113.3011 -+  			     CUSTOM_NUM
113.3012 -+  			     def_param (ptr_type_node)
113.3013 -+  			     def_param (ptr_type_node)
113.3014 -+  			     endlink))));
113.3015 -+
113.3016 -+
113.3017 -+
113.3018 -+  /* *INDENT-ON* */
113.3019 -+
113.3020 -+
113.3021 -+  for (d = bdesc; d->name; d++)
113.3022 -+    {
113.3023 -+      builtin_function (d->name, *d->type, d->code,
113.3024 -+			BUILT_IN_MD, NULL, NULL);
113.3025 -+    }
113.3026 -+}
113.3027 -+
113.3028 -+/* Expand an expression EXP that calls a built-in function,
113.3029 -+   with result going to TARGET if that's convenient
113.3030 -+   (and in mode MODE if that's convenient).
113.3031 -+   SUBTARGET may be used as the target for computing one of EXP's operands.
113.3032 -+   IGNORE is nonzero if the value is to be ignored.  */
113.3033 -+
113.3034 -+static rtx
113.3035 -+nios2_expand_builtin (tree exp, rtx target, rtx subtarget, 
113.3036 -+                      enum machine_mode mode, int ignore)
113.3037 -+{
113.3038 -+  const struct builtin_description *d;
113.3039 -+  tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
113.3040 -+  unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
113.3041 -+
113.3042 -+  for (d = bdesc; d->name; d++)
113.3043 -+    if (d->code == fcode)
113.3044 -+      return (d->expander) (d, exp, target, subtarget, mode, ignore);
113.3045 -+
113.3046 -+  /* we should have seen one of the functins we registered */
113.3047 -+  abort ();
113.3048 -+}
113.3049 -+
113.3050 -+static rtx nios2_create_target (const struct builtin_description *, rtx);
113.3051 -+
113.3052 -+
113.3053 -+static rtx
113.3054 -+nios2_create_target (const struct builtin_description *d, rtx target)
113.3055 -+{
113.3056 -+  if (!target
113.3057 -+      || !(*insn_data[d->icode].operand[0].predicate) (target,
113.3058 -+                                                       insn_data[d->icode].operand[0].mode))
113.3059 -+    {
113.3060 -+      target = gen_reg_rtx (insn_data[d->icode].operand[0].mode);
113.3061 -+    }
113.3062 -+
113.3063 -+  return target;
113.3064 -+}
113.3065 -+
113.3066 -+
113.3067 -+static rtx nios2_extract_opcode (const struct builtin_description *, int, tree);
113.3068 -+static rtx nios2_extract_operand (const struct builtin_description *, int, int, tree);
113.3069 -+
113.3070 -+static rtx
113.3071 -+nios2_extract_opcode (const struct builtin_description *d, int op, tree arglist)
113.3072 -+{
113.3073 -+  enum machine_mode mode = insn_data[d->icode].operand[op].mode;
113.3074 -+  tree arg = TREE_VALUE (arglist);
113.3075 -+  rtx opcode = expand_expr (arg, NULL_RTX, mode, 0);
113.3076 -+  opcode = protect_from_queue (opcode, 0);
113.3077 -+
113.3078 -+  if (!(*insn_data[d->icode].operand[op].predicate) (opcode, mode))
113.3079 -+    error ("Custom instruction opcode must be compile time constant in the range 0-255 for %s", d->name);
113.3080 -+
113.3081 -+  return opcode;
113.3082 -+}
113.3083 -+
113.3084 -+static rtx
113.3085 -+nios2_extract_operand (const struct builtin_description *d, int op, int argnum, tree arglist)
113.3086 -+{
113.3087 -+  enum machine_mode mode = insn_data[d->icode].operand[op].mode;
113.3088 -+  tree arg = TREE_VALUE (arglist);
113.3089 -+  rtx operand = expand_expr (arg, NULL_RTX, mode, 0);
113.3090 -+  operand = protect_from_queue (operand, 0);
113.3091 -+
113.3092 -+  if (!(*insn_data[d->icode].operand[op].predicate) (operand, mode))
113.3093 -+    operand = copy_to_mode_reg (mode, operand);
113.3094 -+
113.3095 -+  /* ??? Better errors would be nice */
113.3096 -+  if (!(*insn_data[d->icode].operand[op].predicate) (operand, mode))
113.3097 -+    error ("Invalid argument %d to %s", argnum, d->name);
113.3098 -+
113.3099 -+  return operand;
113.3100 -+}
113.3101 -+
113.3102 -+
113.3103 -+static rtx
113.3104 -+nios2_expand_custom_n (const struct builtin_description *d, tree exp, 
113.3105 -+                       rtx target ATTRIBUTE_UNUSED, rtx subtarget ATTRIBUTE_UNUSED, 
113.3106 -+                       enum machine_mode mode ATTRIBUTE_UNUSED, int ignore ATTRIBUTE_UNUSED)
113.3107 -+{
113.3108 -+  tree arglist = TREE_OPERAND (exp, 1);
113.3109 -+  rtx pat;
113.3110 -+  rtx opcode;
113.3111 -+
113.3112 -+  /* custom_n should have exactly one operand */
113.3113 -+  if (insn_data[d->icode].n_operands != 1)
113.3114 -+    abort ();
113.3115 -+
113.3116 -+  opcode = nios2_extract_opcode (d, 0, arglist);
113.3117 -+
113.3118 -+  pat = GEN_FCN (d->icode) (opcode);
113.3119 -+  if (!pat)
113.3120 -+    return 0;
113.3121 -+  emit_insn (pat);
113.3122 -+  return 0;
113.3123 -+}
113.3124 -+
113.3125 -+static rtx
113.3126 -+nios2_expand_custom_Xn (const struct builtin_description *d, tree exp, 
113.3127 -+                        rtx target, rtx subtarget ATTRIBUTE_UNUSED, 
113.3128 -+                        enum machine_mode mode ATTRIBUTE_UNUSED, 
113.3129 -+                        int ignore ATTRIBUTE_UNUSED)
113.3130 -+{
113.3131 -+  tree arglist = TREE_OPERAND (exp, 1);
113.3132 -+  rtx pat;
113.3133 -+  rtx opcode;
113.3134 -+
113.3135 -+  /* custom_Xn should have exactly two operands */
113.3136 -+  if (insn_data[d->icode].n_operands != 2)
113.3137 -+    abort ();
113.3138 -+
113.3139 -+  target = nios2_create_target (d, target);
113.3140 -+  opcode = nios2_extract_opcode (d, 1, arglist);
113.3141 -+
113.3142 -+  pat = GEN_FCN (d->icode) (target, opcode);
113.3143 -+  if (!pat)
113.3144 -+    return 0;
113.3145 -+  emit_insn (pat);
113.3146 -+  return target;
113.3147 -+}
113.3148 -+
113.3149 -+static rtx
113.3150 -+nios2_expand_custom_nX (const struct builtin_description *d, tree exp, 
113.3151 -+                        rtx target ATTRIBUTE_UNUSED, rtx subtarget ATTRIBUTE_UNUSED, 
113.3152 -+                        enum machine_mode mode ATTRIBUTE_UNUSED, int ignore ATTRIBUTE_UNUSED)
113.3153 -+{
113.3154 -+  tree arglist = TREE_OPERAND (exp, 1);
113.3155 -+  rtx pat;
113.3156 -+  rtx opcode;
113.3157 -+  rtx operands[1];
113.3158 -+  int i;
113.3159 -+
113.3160 -+
113.3161 -+  /* custom_nX should have exactly two operands */
113.3162 -+  if (insn_data[d->icode].n_operands != 2)
113.3163 -+    abort ();
113.3164 -+
113.3165 -+  opcode = nios2_extract_opcode (d, 0, arglist);
113.3166 -+  for (i = 0; i < 1; i++)
113.3167 -+    {
113.3168 -+      arglist = TREE_CHAIN (arglist);
113.3169 -+      operands[i] = nios2_extract_operand (d, i + 1, i + 1, arglist);
113.3170 -+    }
113.3171 -+
113.3172 -+  pat = GEN_FCN (d->icode) (opcode, operands[0]);
113.3173 -+  if (!pat)
113.3174 -+    return 0;
113.3175 -+  emit_insn (pat);
113.3176 -+  return 0;
113.3177 -+}
113.3178 -+
113.3179 -+static rtx
113.3180 -+nios2_expand_custom_XnX (const struct builtin_description *d, tree exp, rtx target, 
113.3181 -+                         rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, 
113.3182 -+                         int ignore ATTRIBUTE_UNUSED)
113.3183 -+{
113.3184 -+  tree arglist = TREE_OPERAND (exp, 1);
113.3185 -+  rtx pat;
113.3186 -+  rtx opcode;
113.3187 -+  rtx operands[1];
113.3188 -+  int i;
113.3189 -+
113.3190 -+  /* custom_Xn should have exactly three operands */
113.3191 -+  if (insn_data[d->icode].n_operands != 3)
113.3192 -+    abort ();
113.3193 -+
113.3194 -+  target = nios2_create_target (d, target);
113.3195 -+  opcode = nios2_extract_opcode (d, 1, arglist);
113.3196 -+
113.3197 -+  for (i = 0; i < 1; i++)
113.3198 -+    {
113.3199 -+      arglist = TREE_CHAIN (arglist);
113.3200 -+      operands[i] = nios2_extract_operand (d, i + 2, i + 1, arglist);
113.3201 -+    }
113.3202 -+
113.3203 -+  pat = GEN_FCN (d->icode) (target, opcode, operands[0]);
113.3204 -+
113.3205 -+  if (!pat)
113.3206 -+    return 0;
113.3207 -+  emit_insn (pat);
113.3208 -+  return target;
113.3209 -+}
113.3210 -+
113.3211 -+static rtx
113.3212 -+nios2_expand_custom_nXX (const struct builtin_description *d, tree exp, rtx target ATTRIBUTE_UNUSED, 
113.3213 -+                         rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, 
113.3214 -+                         int ignore ATTRIBUTE_UNUSED)
113.3215 -+{
113.3216 -+  tree arglist = TREE_OPERAND (exp, 1);
113.3217 -+  rtx pat;
113.3218 -+  rtx opcode;
113.3219 -+  rtx operands[2];
113.3220 -+  int i;
113.3221 -+
113.3222 -+
113.3223 -+  /* custom_nX should have exactly three operands */
113.3224 -+  if (insn_data[d->icode].n_operands != 3)
113.3225 -+    abort ();
113.3226 -+
113.3227 -+  opcode = nios2_extract_opcode (d, 0, arglist);
113.3228 -+  for (i = 0; i < 2; i++)
113.3229 -+    {
113.3230 -+      arglist = TREE_CHAIN (arglist);
113.3231 -+      operands[i] = nios2_extract_operand (d, i + 1, i + 1, arglist);
113.3232 -+    }
113.3233 -+
113.3234 -+  pat = GEN_FCN (d->icode) (opcode, operands[0], operands[1]);
113.3235 -+  if (!pat)
113.3236 -+    return 0;
113.3237 -+  emit_insn (pat);
113.3238 -+  return 0;
113.3239 -+}
113.3240 -+
113.3241 -+static rtx
113.3242 -+nios2_expand_custom_XnXX (const struct builtin_description *d, tree exp, rtx target, 
113.3243 -+                          rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, 
113.3244 -+                          int ignore ATTRIBUTE_UNUSED)
113.3245 -+{
113.3246 -+  tree arglist = TREE_OPERAND (exp, 1);
113.3247 -+  rtx pat;
113.3248 -+  rtx opcode;
113.3249 -+  rtx operands[2];
113.3250 -+  int i;
113.3251 -+
113.3252 -+
113.3253 -+  /* custom_XnX should have exactly four operands */
113.3254 -+  if (insn_data[d->icode].n_operands != 4)
113.3255 -+    abort ();
113.3256 -+
113.3257 -+  target = nios2_create_target (d, target);
113.3258 -+  opcode = nios2_extract_opcode (d, 1, arglist);
113.3259 -+  for (i = 0; i < 2; i++)
113.3260 -+    {
113.3261 -+      arglist = TREE_CHAIN (arglist);
113.3262 -+      operands[i] = nios2_extract_operand (d, i + 2, i + 1, arglist);
113.3263 -+    }
113.3264 -+
113.3265 -+  pat = GEN_FCN (d->icode) (target, opcode, operands[0], operands[1]);
113.3266 -+
113.3267 -+  if (!pat)
113.3268 -+    return 0;
113.3269 -+  emit_insn (pat);
113.3270 -+  return target;
113.3271 -+}
113.3272 -+
113.3273 -+
113.3274 -+
113.3275 -+static rtx
113.3276 -+nios2_expand_STXIO (const struct builtin_description *d, tree exp, rtx target ATTRIBUTE_UNUSED, 
113.3277 -+                    rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, 
113.3278 -+                    int ignore ATTRIBUTE_UNUSED)
113.3279 -+{
113.3280 -+  tree arglist = TREE_OPERAND (exp, 1);
113.3281 -+  rtx pat;
113.3282 -+  rtx store_dest, store_val;
113.3283 -+  enum insn_code icode = d->icode;
113.3284 -+
113.3285 -+  /* stores should have exactly two operands */
113.3286 -+  if (insn_data[icode].n_operands != 2)
113.3287 -+    abort ();
113.3288 -+
113.3289 -+  /* process the destination of the store */
113.3290 -+  {
113.3291 -+    enum machine_mode mode = insn_data[icode].operand[0].mode;
113.3292 -+    tree arg = TREE_VALUE (arglist);
113.3293 -+    store_dest = expand_expr (arg, NULL_RTX, VOIDmode, 0);
113.3294 -+    store_dest = protect_from_queue (store_dest, 0);
113.3295 -+
113.3296 -+    store_dest = gen_rtx_MEM (mode, copy_to_mode_reg (Pmode, store_dest));
113.3297 -+
113.3298 -+    /* ??? Better errors would be nice */
113.3299 -+    if (!(*insn_data[icode].operand[0].predicate) (store_dest, mode))
113.3300 -+      error ("Invalid argument 1 to %s", d->name);
113.3301 -+  }
113.3302 -+
113.3303 -+
113.3304 -+  /* process the value to store */
113.3305 -+  {
113.3306 -+    enum machine_mode mode = insn_data[icode].operand[1].mode;
113.3307 -+    tree arg = TREE_VALUE (TREE_CHAIN (arglist));
113.3308 -+    store_val = expand_expr (arg, NULL_RTX, mode, 0);
113.3309 -+    store_val = protect_from_queue (store_val, 0);
113.3310 -+
113.3311 -+    if (!(*insn_data[icode].operand[1].predicate) (store_val, mode))
113.3312 -+      store_val = copy_to_mode_reg (mode, store_val);
113.3313 -+
113.3314 -+    /* ??? Better errors would be nice */
113.3315 -+    if (!(*insn_data[icode].operand[1].predicate) (store_val, mode))
113.3316 -+      error ("Invalid argument 2 to %s", d->name);
113.3317 -+  }
113.3318 -+
113.3319 -+  pat = GEN_FCN (d->icode) (store_dest, store_val);
113.3320 -+  if (!pat)
113.3321 -+    return 0;
113.3322 -+  emit_insn (pat);
113.3323 -+  return 0;
113.3324 -+}
113.3325 -+
113.3326 -+
113.3327 -+static rtx
113.3328 -+nios2_expand_LDXIO (const struct builtin_description * d, tree exp, rtx target, 
113.3329 -+                    rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, 
113.3330 -+                    int ignore ATTRIBUTE_UNUSED)
113.3331 -+{
113.3332 -+  tree arglist = TREE_OPERAND (exp, 1);
113.3333 -+  rtx pat;
113.3334 -+  rtx ld_src;
113.3335 -+  enum insn_code icode = d->icode;
113.3336 -+
113.3337 -+  /* loads should have exactly two operands */
113.3338 -+  if (insn_data[icode].n_operands != 2)
113.3339 -+    abort ();
113.3340 -+
113.3341 -+  target = nios2_create_target (d, target);
113.3342 -+
113.3343 -+  {
113.3344 -+    enum machine_mode mode = insn_data[icode].operand[1].mode;
113.3345 -+    tree arg = TREE_VALUE (arglist);
113.3346 -+    ld_src = expand_expr (arg, NULL_RTX, VOIDmode, 0);
113.3347 -+    ld_src = protect_from_queue (ld_src, 0);
113.3348 -+
113.3349 -+    ld_src = gen_rtx_MEM (mode, copy_to_mode_reg (Pmode, ld_src));
113.3350 -+
113.3351 -+    /* ??? Better errors would be nice */
113.3352 -+    if (!(*insn_data[icode].operand[1].predicate) (ld_src, mode))
113.3353 -+      {
113.3354 -+        error ("Invalid argument 1 to %s", d->name);
113.3355 -+      }
113.3356 -+  }
113.3357 -+
113.3358 -+  pat = GEN_FCN (d->icode) (target, ld_src);
113.3359 -+  if (!pat)
113.3360 -+    return 0;
113.3361 -+  emit_insn (pat);
113.3362 -+  return target;
113.3363 -+}
113.3364 -+
113.3365 -+
113.3366 -+static rtx
113.3367 -+nios2_expand_sync (const struct builtin_description * d ATTRIBUTE_UNUSED, 
113.3368 -+                   tree exp ATTRIBUTE_UNUSED, rtx target ATTRIBUTE_UNUSED, 
113.3369 -+                   rtx subtarget ATTRIBUTE_UNUSED, 
113.3370 -+                   enum machine_mode mode ATTRIBUTE_UNUSED, 
113.3371 -+                   int ignore ATTRIBUTE_UNUSED)
113.3372 -+{
113.3373 -+  emit_insn (gen_sync ());
113.3374 -+  return 0;
113.3375 -+}
113.3376 -+
113.3377 -+static rtx
113.3378 -+nios2_expand_rdctl (const struct builtin_description * d ATTRIBUTE_UNUSED, 
113.3379 -+                   tree exp ATTRIBUTE_UNUSED, rtx target ATTRIBUTE_UNUSED, 
113.3380 -+                   rtx subtarget ATTRIBUTE_UNUSED, 
113.3381 -+                   enum machine_mode mode ATTRIBUTE_UNUSED, 
113.3382 -+                   int ignore ATTRIBUTE_UNUSED)
113.3383 -+{
113.3384 -+  tree arglist = TREE_OPERAND (exp, 1);
113.3385 -+  rtx pat;
113.3386 -+  rtx rdctl_reg;
113.3387 -+  enum insn_code icode = d->icode;
113.3388 -+
113.3389 -+  /* rdctl should have exactly two operands */
113.3390 -+  if (insn_data[icode].n_operands != 2)
113.3391 -+    abort ();
113.3392 -+
113.3393 -+  target = nios2_create_target (d, target);
113.3394 -+
113.3395 -+  {
113.3396 -+    enum machine_mode mode = insn_data[icode].operand[1].mode;
113.3397 -+    tree arg = TREE_VALUE (arglist);
113.3398 -+    rdctl_reg = expand_expr (arg, NULL_RTX, VOIDmode, 0);
113.3399 -+    rdctl_reg = protect_from_queue (rdctl_reg, 0);
113.3400 -+
113.3401 -+    if (!(*insn_data[icode].operand[1].predicate) (rdctl_reg, mode))
113.3402 -+      {
113.3403 -+        error ("Control register number must be in range 0-31 for %s", d->name);
113.3404 -+      }
113.3405 -+  }
113.3406 -+
113.3407 -+  pat = GEN_FCN (d->icode) (target, rdctl_reg);
113.3408 -+  if (!pat)
113.3409 -+    return 0;
113.3410 -+  emit_insn (pat);
113.3411 -+  return target;
113.3412 -+}
113.3413 -+
113.3414 -+static rtx
113.3415 -+nios2_expand_wrctl (const struct builtin_description * d ATTRIBUTE_UNUSED, 
113.3416 -+                   tree exp ATTRIBUTE_UNUSED, rtx target ATTRIBUTE_UNUSED, 
113.3417 -+                   rtx subtarget ATTRIBUTE_UNUSED, 
113.3418 -+                   enum machine_mode mode ATTRIBUTE_UNUSED, 
113.3419 -+                   int ignore ATTRIBUTE_UNUSED)
113.3420 -+{
113.3421 -+  tree arglist = TREE_OPERAND (exp, 1);
113.3422 -+  rtx pat;
113.3423 -+  rtx wrctl_reg, store_val;
113.3424 -+  enum insn_code icode = d->icode;
113.3425 -+
113.3426 -+  /* stores should have exactly two operands */
113.3427 -+  if (insn_data[icode].n_operands != 2)
113.3428 -+    abort ();
113.3429 -+
113.3430 -+  /* process the destination of the store */
113.3431 -+  {
113.3432 -+    enum machine_mode mode = insn_data[icode].operand[0].mode;
113.3433 -+    tree arg = TREE_VALUE (arglist);
113.3434 -+    wrctl_reg = expand_expr (arg, NULL_RTX, VOIDmode, 0);
113.3435 -+    wrctl_reg = protect_from_queue (wrctl_reg, 0);
113.3436 -+
113.3437 -+    if (!(*insn_data[icode].operand[0].predicate) (wrctl_reg, mode))
113.3438 -+      error ("Control register number must be in range 0-31 for %s", d->name);
113.3439 -+  }
113.3440 -+
113.3441 -+
113.3442 -+  /* process the value to store */
113.3443 -+  {
113.3444 -+    enum machine_mode mode = insn_data[icode].operand[1].mode;
113.3445 -+    tree arg = TREE_VALUE (TREE_CHAIN (arglist));
113.3446 -+    store_val = expand_expr (arg, NULL_RTX, mode, 0);
113.3447 -+    store_val = protect_from_queue (store_val, 0);
113.3448 -+
113.3449 -+    if (!(*insn_data[icode].operand[1].predicate) (store_val, mode))
113.3450 -+      store_val = copy_to_mode_reg (mode, store_val);
113.3451 -+
113.3452 -+    /* ??? Better errors would be nice */
113.3453 -+    if (!(*insn_data[icode].operand[1].predicate) (store_val, mode))
113.3454 -+      error ("Invalid argument 2 to %s", d->name);
113.3455 -+  }
113.3456 -+
113.3457 -+  pat = GEN_FCN (d->icode) (wrctl_reg, store_val);
113.3458 -+  if (!pat)
113.3459 -+    return 0;
113.3460 -+  emit_insn (pat);
113.3461 -+  return 0;
113.3462 -+}
113.3463 -+
113.3464 -+
113.3465 -+#include "gt-nios2.h"
113.3466 -+
113.3467 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2-dp-bit.c gcc-3.4.6/gcc/config/nios2/nios2-dp-bit.c
113.3468 ---- gcc-3.4.6.orig/gcc/config/nios2/nios2-dp-bit.c	1970-01-01 01:00:00.000000000 +0100
113.3469 -+++ gcc-3.4.6/gcc/config/nios2/nios2-dp-bit.c	2007-08-15 23:09:36.000000000 +0200
113.3470 -@@ -0,0 +1,1652 @@
113.3471 -+
113.3472 -+/* This is a software floating point library which can be used
113.3473 -+   for targets without hardware floating point. 
113.3474 -+   Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004
113.3475 -+   Free Software Foundation, Inc.
113.3476 -+
113.3477 -+This file is free software; you can redistribute it and/or modify it
113.3478 -+under the terms of the GNU General Public License as published by the
113.3479 -+Free Software Foundation; either version 2, or (at your option) any
113.3480 -+later version.
113.3481 -+
113.3482 -+In addition to the permissions in the GNU General Public License, the
113.3483 -+Free Software Foundation gives you unlimited permission to link the
113.3484 -+compiled version of this file with other programs, and to distribute
113.3485 -+those programs without any restriction coming from the use of this
113.3486 -+file.  (The General Public License restrictions do apply in other
113.3487 -+respects; for example, they cover modification of the file, and
113.3488 -+distribution when not linked into another program.)
113.3489 -+
113.3490 -+This file is distributed in the hope that it will be useful, but
113.3491 -+WITHOUT ANY WARRANTY; without even the implied warranty of
113.3492 -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
113.3493 -+General Public License for more details.
113.3494 -+
113.3495 -+You should have received a copy of the GNU General Public License
113.3496 -+along with this program; see the file COPYING.  If not, write to
113.3497 -+the Free Software Foundation, 59 Temple Place - Suite 330,
113.3498 -+Boston, MA 02111-1307, USA.  */
113.3499 -+
113.3500 -+/* As a special exception, if you link this library with other files,
113.3501 -+   some of which are compiled with GCC, to produce an executable,
113.3502 -+   this library does not by itself cause the resulting executable
113.3503 -+   to be covered by the GNU General Public License.
113.3504 -+   This exception does not however invalidate any other reasons why
113.3505 -+   the executable file might be covered by the GNU General Public License.  */
113.3506 -+
113.3507 -+/* This implements IEEE 754 format arithmetic, but does not provide a
113.3508 -+   mechanism for setting the rounding mode, or for generating or handling
113.3509 -+   exceptions.
113.3510 -+
113.3511 -+   The original code by Steve Chamberlain, hacked by Mark Eichin and Jim
113.3512 -+   Wilson, all of Cygnus Support.  */
113.3513 -+
113.3514 -+/* The intended way to use this file is to make two copies, add `#define FLOAT'
113.3515 -+   to one copy, then compile both copies and add them to libgcc.a.  */
113.3516 -+
113.3517 -+#include "tconfig.h"
113.3518 -+#include "coretypes.h"
113.3519 -+#include "tm.h"
113.3520 -+#include "config/fp-bit.h"
113.3521 -+
113.3522 -+/* The following macros can be defined to change the behavior of this file:
113.3523 -+   FLOAT: Implement a `float', aka SFmode, fp library.  If this is not
113.3524 -+     defined, then this file implements a `double', aka DFmode, fp library.
113.3525 -+   FLOAT_ONLY: Used with FLOAT, to implement a `float' only library, i.e.
113.3526 -+     don't include float->double conversion which requires the double library.
113.3527 -+     This is useful only for machines which can't support doubles, e.g. some
113.3528 -+     8-bit processors.
113.3529 -+   CMPtype: Specify the type that floating point compares should return.
113.3530 -+     This defaults to SItype, aka int.
113.3531 -+   US_SOFTWARE_GOFAST: This makes all entry points use the same names as the
113.3532 -+     US Software goFast library.
113.3533 -+   _DEBUG_BITFLOAT: This makes debugging the code a little easier, by adding
113.3534 -+     two integers to the FLO_union_type.
113.3535 -+   NO_DENORMALS: Disable handling of denormals.
113.3536 -+   NO_NANS: Disable nan and infinity handling
113.3537 -+   SMALL_MACHINE: Useful when operations on QIs and HIs are faster
113.3538 -+     than on an SI */
113.3539 -+
113.3540 -+/* We don't currently support extended floats (long doubles) on machines
113.3541 -+   without hardware to deal with them.
113.3542 -+
113.3543 -+   These stubs are just to keep the linker from complaining about unresolved
113.3544 -+   references which can be pulled in from libio & libstdc++, even if the
113.3545 -+   user isn't using long doubles.  However, they may generate an unresolved
113.3546 -+   external to abort if abort is not used by the function, and the stubs
113.3547 -+   are referenced from within libc, since libgcc goes before and after the
113.3548 -+   system library.  */
113.3549 -+
113.3550 -+#ifdef DECLARE_LIBRARY_RENAMES
113.3551 -+  DECLARE_LIBRARY_RENAMES
113.3552 -+#endif
113.3553 -+
113.3554 -+#ifdef EXTENDED_FLOAT_STUBS
113.3555 -+extern void abort (void);
113.3556 -+void __extendsfxf2 (void) { abort(); }
113.3557 -+void __extenddfxf2 (void) { abort(); }
113.3558 -+void __truncxfdf2 (void) { abort(); }
113.3559 -+void __truncxfsf2 (void) { abort(); }
113.3560 -+void __fixxfsi (void) { abort(); }
113.3561 -+void __floatsixf (void) { abort(); }
113.3562 -+void __addxf3 (void) { abort(); }
113.3563 -+void __subxf3 (void) { abort(); }
113.3564 -+void __mulxf3 (void) { abort(); }
113.3565 -+void __divxf3 (void) { abort(); }
113.3566 -+void __negxf2 (void) { abort(); }
113.3567 -+void __eqxf2 (void) { abort(); }
113.3568 -+void __nexf2 (void) { abort(); }
113.3569 -+void __gtxf2 (void) { abort(); }
113.3570 -+void __gexf2 (void) { abort(); }
113.3571 -+void __lexf2 (void) { abort(); }
113.3572 -+void __ltxf2 (void) { abort(); }
113.3573 -+
113.3574 -+void __extendsftf2 (void) { abort(); }
113.3575 -+void __extenddftf2 (void) { abort(); }
113.3576 -+void __trunctfdf2 (void) { abort(); }
113.3577 -+void __trunctfsf2 (void) { abort(); }
113.3578 -+void __fixtfsi (void) { abort(); }
113.3579 -+void __floatsitf (void) { abort(); }
113.3580 -+void __addtf3 (void) { abort(); }
113.3581 -+void __subtf3 (void) { abort(); }
113.3582 -+void __multf3 (void) { abort(); }
113.3583 -+void __divtf3 (void) { abort(); }
113.3584 -+void __negtf2 (void) { abort(); }
113.3585 -+void __eqtf2 (void) { abort(); }
113.3586 -+void __netf2 (void) { abort(); }
113.3587 -+void __gttf2 (void) { abort(); }
113.3588 -+void __getf2 (void) { abort(); }
113.3589 -+void __letf2 (void) { abort(); }
113.3590 -+void __lttf2 (void) { abort(); }
113.3591 -+#else	/* !EXTENDED_FLOAT_STUBS, rest of file */
113.3592 -+
113.3593 -+/* IEEE "special" number predicates */
113.3594 -+
113.3595 -+#ifdef NO_NANS
113.3596 -+
113.3597 -+#define nan() 0
113.3598 -+#define isnan(x) 0
113.3599 -+#define isinf(x) 0
113.3600 -+#else
113.3601 -+
113.3602 -+#if   defined L_thenan_sf
113.3603 -+const fp_number_type __thenan_sf = { CLASS_SNAN, 0, 0, {(fractype) 0} };
113.3604 -+#elif defined L_thenan_df
113.3605 -+const fp_number_type __thenan_df = { CLASS_SNAN, 0, 0, {(fractype) 0} };
113.3606 -+#elif defined L_thenan_tf
113.3607 -+const fp_number_type __thenan_tf = { CLASS_SNAN, 0, 0, {(fractype) 0} };
113.3608 -+#elif defined TFLOAT
113.3609 -+extern const fp_number_type __thenan_tf;
113.3610 -+#elif defined FLOAT
113.3611 -+extern const fp_number_type __thenan_sf;
113.3612 -+#else
113.3613 -+extern const fp_number_type __thenan_df;
113.3614 -+#endif
113.3615 -+
113.3616 -+INLINE
113.3617 -+static fp_number_type *
113.3618 -+nan (void)
113.3619 -+{
113.3620 -+  /* Discard the const qualifier...  */
113.3621 -+#ifdef TFLOAT
113.3622 -+  return (fp_number_type *) (& __thenan_tf);
113.3623 -+#elif defined FLOAT  
113.3624 -+  return (fp_number_type *) (& __thenan_sf);
113.3625 -+#else
113.3626 -+  return (fp_number_type *) (& __thenan_df);
113.3627 -+#endif
113.3628 -+}
113.3629 -+
113.3630 -+INLINE
113.3631 -+static int
113.3632 -+isnan ( fp_number_type *  x)
113.3633 -+{
113.3634 -+  return x->class == CLASS_SNAN || x->class == CLASS_QNAN;
113.3635 -+}
113.3636 -+
113.3637 -+INLINE
113.3638 -+static int
113.3639 -+isinf ( fp_number_type *  x)
113.3640 -+{
113.3641 -+  return x->class == CLASS_INFINITY;
113.3642 -+}
113.3643 -+
113.3644 -+#endif /* NO_NANS */
113.3645 -+
113.3646 -+INLINE
113.3647 -+static int
113.3648 -+iszero ( fp_number_type *  x)
113.3649 -+{
113.3650 -+  return x->class == CLASS_ZERO;
113.3651 -+}
113.3652 -+
113.3653 -+INLINE 
113.3654 -+static void
113.3655 -+flip_sign ( fp_number_type *  x)
113.3656 -+{
113.3657 -+  x->sign = !x->sign;
113.3658 -+}
113.3659 -+
113.3660 -+extern FLO_type pack_d ( fp_number_type * );
113.3661 -+
113.3662 -+#if defined(L_pack_df) || defined(L_pack_sf) || defined(L_pack_tf)
113.3663 -+FLO_type
113.3664 -+pack_d ( fp_number_type *  src)
113.3665 -+{
113.3666 -+  FLO_union_type dst;
113.3667 -+  fractype fraction = src->fraction.ll;	/* wasn't unsigned before? */
113.3668 -+  int sign = src->sign;
113.3669 -+  int exp = 0;
113.3670 -+
113.3671 -+  if (LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && (isnan (src) || isinf (src)))
113.3672 -+    {
113.3673 -+      /* We can't represent these values accurately.  By using the
113.3674 -+	 largest possible magnitude, we guarantee that the conversion
113.3675 -+	 of infinity is at least as big as any finite number.  */
113.3676 -+      exp = EXPMAX;
113.3677 -+      fraction = ((fractype) 1 << FRACBITS) - 1;
113.3678 -+    }
113.3679 -+  else if (isnan (src))
113.3680 -+    {
113.3681 -+      exp = EXPMAX;
113.3682 -+      if (src->class == CLASS_QNAN || 1)
113.3683 -+	{
113.3684 -+#ifdef QUIET_NAN_NEGATED
113.3685 -+	  fraction |= QUIET_NAN - 1;
113.3686 -+#else
113.3687 -+	  fraction |= QUIET_NAN;
113.3688 -+#endif
113.3689 -+	}
113.3690 -+    }
113.3691 -+  else if (isinf (src))
113.3692 -+    {
113.3693 -+      exp = EXPMAX;
113.3694 -+      fraction = 0;
113.3695 -+    }
113.3696 -+  else if (iszero (src))
113.3697 -+    {
113.3698 -+      exp = 0;
113.3699 -+      fraction = 0;
113.3700 -+    }
113.3701 -+  else if (fraction == 0)
113.3702 -+    {
113.3703 -+      exp = 0;
113.3704 -+    }
113.3705 -+  else
113.3706 -+    {
113.3707 -+      if (src->normal_exp < NORMAL_EXPMIN)
113.3708 -+	{
113.3709 -+#ifdef NO_DENORMALS
113.3710 -+	  /* Go straight to a zero representation if denormals are not
113.3711 -+ 	     supported.  The denormal handling would be harmless but
113.3712 -+ 	     isn't unnecessary.  */
113.3713 -+	  exp = 0;
113.3714 -+	  fraction = 0;
113.3715 -+#else /* NO_DENORMALS */
113.3716 -+	  /* This number's exponent is too low to fit into the bits
113.3717 -+	     available in the number, so we'll store 0 in the exponent and
113.3718 -+	     shift the fraction to the right to make up for it.  */
113.3719 -+
113.3720 -+	  int shift = NORMAL_EXPMIN - src->normal_exp;
113.3721 -+
113.3722 -+	  exp = 0;
113.3723 -+
113.3724 -+	  if (shift > FRAC_NBITS - NGARDS)
113.3725 -+	    {
113.3726 -+	      /* No point shifting, since it's more that 64 out.  */
113.3727 -+	      fraction = 0;
113.3728 -+	    }
113.3729 -+	  else
113.3730 -+	    {
113.3731 -+	      int lowbit = (fraction & (((fractype)1 << shift) - 1)) ? 1 : 0;
113.3732 -+	      fraction = (fraction >> shift) | lowbit;
113.3733 -+	    }
113.3734 -+	  if ((fraction & GARDMASK) == GARDMSB)
113.3735 -+	    {
113.3736 -+	      if ((fraction & (1 << NGARDS)))
113.3737 -+		fraction += GARDROUND + 1;
113.3738 -+	    }
113.3739 -+	  else
113.3740 -+	    {
113.3741 -+	      /* Add to the guards to round up.  */
113.3742 -+	      fraction += GARDROUND;
113.3743 -+	    }
113.3744 -+	  /* Perhaps the rounding means we now need to change the
113.3745 -+             exponent, because the fraction is no longer denormal.  */
113.3746 -+	  if (fraction >= IMPLICIT_1)
113.3747 -+	    {
113.3748 -+	      exp += 1;
113.3749 -+	    }
113.3750 -+	  fraction >>= NGARDS;
113.3751 -+#endif /* NO_DENORMALS */
113.3752 -+	}
113.3753 -+      else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS)
113.3754 -+	       && src->normal_exp > EXPBIAS)
113.3755 -+	{
113.3756 -+	  exp = EXPMAX;
113.3757 -+	  fraction = 0;
113.3758 -+	}
113.3759 -+      else
113.3760 -+	{
113.3761 -+	  exp = src->normal_exp + EXPBIAS;
113.3762 -+	  if (!ROUND_TOWARDS_ZERO)
113.3763 -+	    {
113.3764 -+	      /* IF the gard bits are the all zero, but the first, then we're
113.3765 -+		 half way between two numbers, choose the one which makes the
113.3766 -+		 lsb of the answer 0.  */
113.3767 -+	      if ((fraction & GARDMASK) == GARDMSB)
113.3768 -+		{
113.3769 -+		  if (fraction & (1 << NGARDS))
113.3770 -+		    fraction += GARDROUND + 1;
113.3771 -+		}
113.3772 -+	      else
113.3773 -+		{
113.3774 -+		  /* Add a one to the guards to round up */
113.3775 -+		  fraction += GARDROUND;
113.3776 -+		}
113.3777 -+	      if (fraction >= IMPLICIT_2)
113.3778 -+		{
113.3779 -+		  fraction >>= 1;
113.3780 -+		  exp += 1;
113.3781 -+		}
113.3782 -+	    }
113.3783 -+	  fraction >>= NGARDS;
113.3784 -+
113.3785 -+	  if (LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && exp > EXPMAX)
113.3786 -+	    {
113.3787 -+	      /* Saturate on overflow.  */
113.3788 -+	      exp = EXPMAX;
113.3789 -+	      fraction = ((fractype) 1 << FRACBITS) - 1;
113.3790 -+	    }
113.3791 -+	}
113.3792 -+    }
113.3793 -+
113.3794 -+  /* We previously used bitfields to store the number, but this doesn't
113.3795 -+     handle little/big endian systems conveniently, so use shifts and
113.3796 -+     masks */
113.3797 -+#ifdef FLOAT_BIT_ORDER_MISMATCH
113.3798 -+  dst.bits.fraction = fraction;
113.3799 -+  dst.bits.exp = exp;
113.3800 -+  dst.bits.sign = sign;
113.3801 -+#else
113.3802 -+# if defined TFLOAT && defined HALFFRACBITS
113.3803 -+ {
113.3804 -+   halffractype high, low, unity;
113.3805 -+   int lowsign, lowexp;
113.3806 -+
113.3807 -+   unity = (halffractype) 1 << HALFFRACBITS;
113.3808 -+
113.3809 -+   /* Set HIGH to the high double's significand, masking out the implicit 1.
113.3810 -+      Set LOW to the low double's full significand.  */
113.3811 -+   high = (fraction >> (FRACBITS - HALFFRACBITS)) & (unity - 1);
113.3812 -+   low = fraction & (unity * 2 - 1);
113.3813 -+
113.3814 -+   /* Get the initial sign and exponent of the low double.  */
113.3815 -+   lowexp = exp - HALFFRACBITS - 1;
113.3816 -+   lowsign = sign;
113.3817 -+
113.3818 -+   /* HIGH should be rounded like a normal double, making |LOW| <=
113.3819 -+      0.5 ULP of HIGH.  Assume round-to-nearest.  */
113.3820 -+   if (exp < EXPMAX)
113.3821 -+     if (low > unity || (low == unity && (high & 1) == 1))
113.3822 -+       {
113.3823 -+	 /* Round HIGH up and adjust LOW to match.  */
113.3824 -+	 high++;
113.3825 -+	 if (high == unity)
113.3826 -+	   {
113.3827 -+	     /* May make it infinite, but that's OK.  */
113.3828 -+	     high = 0;
113.3829 -+	     exp++;
113.3830 -+	   }
113.3831 -+	 low = unity * 2 - low;
113.3832 -+	 lowsign ^= 1;
113.3833 -+       }
113.3834 -+
113.3835 -+   high |= (halffractype) exp << HALFFRACBITS;
113.3836 -+   high |= (halffractype) sign << (HALFFRACBITS + EXPBITS);
113.3837 -+
113.3838 -+   if (exp == EXPMAX || exp == 0 || low == 0)
113.3839 -+     low = 0;
113.3840 -+   else
113.3841 -+     {
113.3842 -+       while (lowexp > 0 && low < unity)
113.3843 -+	 {
113.3844 -+	   low <<= 1;
113.3845 -+	   lowexp--;
113.3846 -+	 }
113.3847 -+
113.3848 -+       if (lowexp <= 0)
113.3849 -+	 {
113.3850 -+	   halffractype roundmsb, round;
113.3851 -+	   int shift;
113.3852 -+
113.3853 -+	   shift = 1 - lowexp;
113.3854 -+	   roundmsb = (1 << (shift - 1));
113.3855 -+	   round = low & ((roundmsb << 1) - 1);
113.3856 -+
113.3857 -+	   low >>= shift;
113.3858 -+	   lowexp = 0;
113.3859 -+
113.3860 -+	   if (round > roundmsb || (round == roundmsb && (low & 1) == 1))
113.3861 -+	     {
113.3862 -+	       low++;
113.3863 -+	       if (low == unity)
113.3864 -+		 /* LOW rounds up to the smallest normal number.  */
113.3865 -+		 lowexp++;
113.3866 -+	     }
113.3867 -+	 }
113.3868 -+
113.3869 -+       low &= unity - 1;
113.3870 -+       low |= (halffractype) lowexp << HALFFRACBITS;
113.3871 -+       low |= (halffractype) lowsign << (HALFFRACBITS + EXPBITS);
113.3872 -+     }
113.3873 -+   dst.value_raw = ((fractype) high << HALFSHIFT) | low;
113.3874 -+ }
113.3875 -+# else
113.3876 -+  dst.value_raw = fraction & ((((fractype)1) << FRACBITS) - (fractype)1);
113.3877 -+  dst.value_raw |= ((fractype) (exp & ((1 << EXPBITS) - 1))) << FRACBITS;
113.3878 -+  dst.value_raw |= ((fractype) (sign & 1)) << (FRACBITS | EXPBITS);
113.3879 -+# endif
113.3880 -+#endif
113.3881 -+
113.3882 -+#if defined(FLOAT_WORD_ORDER_MISMATCH) && !defined(FLOAT)
113.3883 -+#ifdef TFLOAT
113.3884 -+  {
113.3885 -+    qrtrfractype tmp1 = dst.words[0];
113.3886 -+    qrtrfractype tmp2 = dst.words[1];
113.3887 -+    dst.words[0] = dst.words[3];
113.3888 -+    dst.words[1] = dst.words[2];
113.3889 -+    dst.words[2] = tmp2;
113.3890 -+    dst.words[3] = tmp1;
113.3891 -+  }
113.3892 -+#else
113.3893 -+  {
113.3894 -+    halffractype tmp = dst.words[0];
113.3895 -+    dst.words[0] = dst.words[1];
113.3896 -+    dst.words[1] = tmp;
113.3897 -+  }
113.3898 -+#endif
113.3899 -+#endif
113.3900 -+
113.3901 -+  return dst.value;
113.3902 -+}
113.3903 -+#endif
113.3904 -+
113.3905 -+#if defined(L_unpack_df) || defined(L_unpack_sf) || defined(L_unpack_tf)
113.3906 -+void
113.3907 -+unpack_d (FLO_union_type * src, fp_number_type * dst)
113.3908 -+{
113.3909 -+  /* We previously used bitfields to store the number, but this doesn't
113.3910 -+     handle little/big endian systems conveniently, so use shifts and
113.3911 -+     masks */
113.3912 -+  fractype fraction;
113.3913 -+  int exp;
113.3914 -+  int sign;
113.3915 -+
113.3916 -+#if defined(FLOAT_WORD_ORDER_MISMATCH) && !defined(FLOAT)
113.3917 -+  FLO_union_type swapped;
113.3918 -+
113.3919 -+#ifdef TFLOAT
113.3920 -+  swapped.words[0] = src->words[3];
113.3921 -+  swapped.words[1] = src->words[2];
113.3922 -+  swapped.words[2] = src->words[1];
113.3923 -+  swapped.words[3] = src->words[0];
113.3924 -+#else
113.3925 -+  swapped.words[0] = src->words[1];
113.3926 -+  swapped.words[1] = src->words[0];
113.3927 -+#endif
113.3928 -+  src = &swapped;
113.3929 -+#endif
113.3930 -+  
113.3931 -+#ifdef FLOAT_BIT_ORDER_MISMATCH
113.3932 -+  fraction = src->bits.fraction;
113.3933 -+  exp = src->bits.exp;
113.3934 -+  sign = src->bits.sign;
113.3935 -+#else
113.3936 -+# if defined TFLOAT && defined HALFFRACBITS
113.3937 -+ {
113.3938 -+   halffractype high, low;
113.3939 -+   
113.3940 -+   high = src->value_raw >> HALFSHIFT;
113.3941 -+   low = src->value_raw & (((fractype)1 << HALFSHIFT) - 1);
113.3942 -+
113.3943 -+   fraction = high & ((((fractype)1) << HALFFRACBITS) - 1);
113.3944 -+   fraction <<= FRACBITS - HALFFRACBITS;
113.3945 -+   exp = ((int)(high >> HALFFRACBITS)) & ((1 << EXPBITS) - 1);
113.3946 -+   sign = ((int)(high >> (((HALFFRACBITS + EXPBITS))))) & 1;
113.3947 -+
113.3948 -+   if (exp != EXPMAX && exp != 0 && low != 0)
113.3949 -+     {
113.3950 -+       int lowexp = ((int)(low >> HALFFRACBITS)) & ((1 << EXPBITS) - 1);
113.3951 -+       int lowsign = ((int)(low >> (((HALFFRACBITS + EXPBITS))))) & 1;
113.3952 -+       int shift;
113.3953 -+       fractype xlow;
113.3954 -+
113.3955 -+       xlow = low & ((((fractype)1) << HALFFRACBITS) - 1);
113.3956 -+       if (lowexp)
113.3957 -+	 xlow |= (((halffractype)1) << HALFFRACBITS);
113.3958 -+       else
113.3959 -+	 lowexp = 1;
113.3960 -+       shift = (FRACBITS - HALFFRACBITS) - (exp - lowexp);
113.3961 -+       if (shift > 0)
113.3962 -+	 xlow <<= shift;
113.3963 -+       else if (shift < 0)
113.3964 -+	 xlow >>= -shift;
113.3965 -+       if (sign == lowsign)
113.3966 -+	 fraction += xlow;
113.3967 -+       else if (fraction >= xlow)
113.3968 -+	 fraction -= xlow;
113.3969 -+       else
113.3970 -+	 {
113.3971 -+	   /* The high part is a power of two but the full number is lower.
113.3972 -+	      This code will leave the implicit 1 in FRACTION, but we'd
113.3973 -+	      have added that below anyway.  */
113.3974 -+	   fraction = (((fractype) 1 << FRACBITS) - xlow) << 1;
113.3975 -+	   exp--;
113.3976 -+	 }
113.3977 -+     }
113.3978 -+ }
113.3979 -+# else
113.3980 -+  fraction = src->value_raw & ((((fractype)1) << FRACBITS) - 1);
113.3981 -+  exp = ((int)(src->value_raw >> FRACBITS)) & ((1 << EXPBITS) - 1);
113.3982 -+  sign = ((int)(src->value_raw >> (FRACBITS + EXPBITS))) & 1;
113.3983 -+# endif
113.3984 -+#endif
113.3985 -+
113.3986 -+  dst->sign = sign;
113.3987 -+  if (exp == 0)
113.3988 -+    {
113.3989 -+      /* Hmm.  Looks like 0 */
113.3990 -+      if (fraction == 0
113.3991 -+#ifdef NO_DENORMALS
113.3992 -+	  || 1
113.3993 -+#endif
113.3994 -+	  )
113.3995 -+	{
113.3996 -+	  /* tastes like zero */
113.3997 -+	  dst->class = CLASS_ZERO;
113.3998 -+	}
113.3999 -+      else
113.4000 -+	{
113.4001 -+	  /* Zero exponent with nonzero fraction - it's denormalized,
113.4002 -+	     so there isn't a leading implicit one - we'll shift it so
113.4003 -+	     it gets one.  */
113.4004 -+	  dst->normal_exp = exp - EXPBIAS + 1;
113.4005 -+	  fraction <<= NGARDS;
113.4006 -+
113.4007 -+	  dst->class = CLASS_NUMBER;
113.4008 -+#if 1
113.4009 -+	  while (fraction < IMPLICIT_1)
113.4010 -+	    {
113.4011 -+	      fraction <<= 1;
113.4012 -+	      dst->normal_exp--;
113.4013 -+	    }
113.4014 -+#endif
113.4015 -+	  dst->fraction.ll = fraction;
113.4016 -+	}
113.4017 -+    }
113.4018 -+  else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && exp == EXPMAX)
113.4019 -+    {
113.4020 -+      /* Huge exponent*/
113.4021 -+      if (fraction == 0)
113.4022 -+	{
113.4023 -+	  /* Attached to a zero fraction - means infinity */
113.4024 -+	  dst->class = CLASS_INFINITY;
113.4025 -+	}
113.4026 -+      else
113.4027 -+	{
113.4028 -+	  /* Nonzero fraction, means nan */
113.4029 -+#ifdef QUIET_NAN_NEGATED
113.4030 -+	  if ((fraction & QUIET_NAN) == 0)
113.4031 -+#else
113.4032 -+	  if (fraction & QUIET_NAN)
113.4033 -+#endif
113.4034 -+	    {
113.4035 -+	      dst->class = CLASS_QNAN;
113.4036 -+	    }
113.4037 -+	  else
113.4038 -+	    {
113.4039 -+	      dst->class = CLASS_SNAN;
113.4040 -+	    }
113.4041 -+	  /* Keep the fraction part as the nan number */
113.4042 -+	  dst->fraction.ll = fraction;
113.4043 -+	}
113.4044 -+    }
113.4045 -+  else
113.4046 -+    {
113.4047 -+      /* Nothing strange about this number */
113.4048 -+      dst->normal_exp = exp - EXPBIAS;
113.4049 -+      dst->class = CLASS_NUMBER;
113.4050 -+      dst->fraction.ll = (fraction << NGARDS) | IMPLICIT_1;
113.4051 -+    }
113.4052 -+}
113.4053 -+#endif /* L_unpack_df || L_unpack_sf */
113.4054 -+
113.4055 -+#if defined(L_addsub_sf) || defined(L_addsub_df) || defined(L_addsub_tf)
113.4056 -+static fp_number_type *
113.4057 -+_fpadd_parts (fp_number_type * a,
113.4058 -+	      fp_number_type * b,
113.4059 -+	      fp_number_type * tmp)
113.4060 -+{
113.4061 -+  intfrac tfraction;
113.4062 -+
113.4063 -+  /* Put commonly used fields in local variables.  */
113.4064 -+  int a_normal_exp;
113.4065 -+  int b_normal_exp;
113.4066 -+  fractype a_fraction;
113.4067 -+  fractype b_fraction;
113.4068 -+
113.4069 -+  if (isnan (a))
113.4070 -+    {
113.4071 -+      return a;
113.4072 -+    }
113.4073 -+  if (isnan (b))
113.4074 -+    {
113.4075 -+      return b;
113.4076 -+    }
113.4077 -+  if (isinf (a))
113.4078 -+    {
113.4079 -+      /* Adding infinities with opposite signs yields a NaN.  */
113.4080 -+      if (isinf (b) && a->sign != b->sign)
113.4081 -+	return nan ();
113.4082 -+      return a;
113.4083 -+    }
113.4084 -+  if (isinf (b))
113.4085 -+    {
113.4086 -+      return b;
113.4087 -+    }
113.4088 -+  if (iszero (b))
113.4089 -+    {
113.4090 -+      if (iszero (a))
113.4091 -+	{
113.4092 -+	  *tmp = *a;
113.4093 -+	  tmp->sign = a->sign & b->sign;
113.4094 -+	  return tmp;
113.4095 -+	}
113.4096 -+      return a;
113.4097 -+    }
113.4098 -+  if (iszero (a))
113.4099 -+    {
113.4100 -+      return b;
113.4101 -+    }
113.4102 -+
113.4103 -+  /* Got two numbers. shift the smaller and increment the exponent till
113.4104 -+     they're the same */
113.4105 -+  {
113.4106 -+    int diff;
113.4107 -+
113.4108 -+    a_normal_exp = a->normal_exp;
113.4109 -+    b_normal_exp = b->normal_exp;
113.4110 -+    a_fraction = a->fraction.ll;
113.4111 -+    b_fraction = b->fraction.ll;
113.4112 -+
113.4113 -+    diff = a_normal_exp - b_normal_exp;
113.4114 -+
113.4115 -+    if (diff < 0)
113.4116 -+      diff = -diff;
113.4117 -+    if (diff < FRAC_NBITS)
113.4118 -+      {
113.4119 -+	/* ??? This does shifts one bit at a time.  Optimize.  */
113.4120 -+	while (a_normal_exp > b_normal_exp)
113.4121 -+	  {
113.4122 -+	    b_normal_exp++;
113.4123 -+	    LSHIFT (b_fraction);
113.4124 -+	  }
113.4125 -+	while (b_normal_exp > a_normal_exp)
113.4126 -+	  {
113.4127 -+	    a_normal_exp++;
113.4128 -+	    LSHIFT (a_fraction);
113.4129 -+	  }
113.4130 -+      }
113.4131 -+    else
113.4132 -+      {
113.4133 -+	/* Somethings's up.. choose the biggest */
113.4134 -+	if (a_normal_exp > b_normal_exp)
113.4135 -+	  {
113.4136 -+	    b_normal_exp = a_normal_exp;
113.4137 -+	    b_fraction = 0;
113.4138 -+	  }
113.4139 -+	else
113.4140 -+	  {
113.4141 -+	    a_normal_exp = b_normal_exp;
113.4142 -+	    a_fraction = 0;
113.4143 -+	  }
113.4144 -+      }
113.4145 -+  }
113.4146 -+
113.4147 -+  if (a->sign != b->sign)
113.4148 -+    {
113.4149 -+      if (a->sign)
113.4150 -+	{
113.4151 -+	  tfraction = -a_fraction + b_fraction;
113.4152 -+	}
113.4153 -+      else
113.4154 -+	{
113.4155 -+	  tfraction = a_fraction - b_fraction;
113.4156 -+	}
113.4157 -+      if (tfraction >= 0)
113.4158 -+	{
113.4159 -+	  tmp->sign = 0;
113.4160 -+	  tmp->normal_exp = a_normal_exp;
113.4161 -+	  tmp->fraction.ll = tfraction;
113.4162 -+	}
113.4163 -+      else
113.4164 -+	{
113.4165 -+	  tmp->sign = 1;
113.4166 -+	  tmp->normal_exp = a_normal_exp;
113.4167 -+	  tmp->fraction.ll = -tfraction;
113.4168 -+	}
113.4169 -+      /* and renormalize it */
113.4170 -+
113.4171 -+      while (tmp->fraction.ll < IMPLICIT_1 && tmp->fraction.ll)
113.4172 -+	{
113.4173 -+	  tmp->fraction.ll <<= 1;
113.4174 -+	  tmp->normal_exp--;
113.4175 -+	}
113.4176 -+    }
113.4177 -+  else
113.4178 -+    {
113.4179 -+      tmp->sign = a->sign;
113.4180 -+      tmp->normal_exp = a_normal_exp;
113.4181 -+      tmp->fraction.ll = a_fraction + b_fraction;
113.4182 -+    }
113.4183 -+  tmp->class = CLASS_NUMBER;
113.4184 -+  /* Now the fraction is added, we have to shift down to renormalize the
113.4185 -+     number */
113.4186 -+
113.4187 -+  if (tmp->fraction.ll >= IMPLICIT_2)
113.4188 -+    {
113.4189 -+      LSHIFT (tmp->fraction.ll);
113.4190 -+      tmp->normal_exp++;
113.4191 -+    }
113.4192 -+  return tmp;
113.4193 -+
113.4194 -+}
113.4195 -+
113.4196 -+FLO_type
113.4197 -+add (FLO_type arg_a, FLO_type arg_b)
113.4198 -+{
113.4199 -+  fp_number_type a;
113.4200 -+  fp_number_type b;
113.4201 -+  fp_number_type tmp;
113.4202 -+  fp_number_type *res;
113.4203 -+  FLO_union_type au, bu;
113.4204 -+
113.4205 -+  au.value = arg_a;
113.4206 -+  bu.value = arg_b;
113.4207 -+
113.4208 -+  unpack_d (&au, &a);
113.4209 -+  unpack_d (&bu, &b);
113.4210 -+
113.4211 -+  res = _fpadd_parts (&a, &b, &tmp);
113.4212 -+
113.4213 -+  return pack_d (res);
113.4214 -+}
113.4215 -+
113.4216 -+FLO_type
113.4217 -+sub (FLO_type arg_a, FLO_type arg_b)
113.4218 -+{
113.4219 -+  fp_number_type a;
113.4220 -+  fp_number_type b;
113.4221 -+  fp_number_type tmp;
113.4222 -+  fp_number_type *res;
113.4223 -+  FLO_union_type au, bu;
113.4224 -+
113.4225 -+  au.value = arg_a;
113.4226 -+  bu.value = arg_b;
113.4227 -+
113.4228 -+  unpack_d (&au, &a);
113.4229 -+  unpack_d (&bu, &b);
113.4230 -+
113.4231 -+  b.sign ^= 1;
113.4232 -+
113.4233 -+  res = _fpadd_parts (&a, &b, &tmp);
113.4234 -+
113.4235 -+  return pack_d (res);
113.4236 -+}
113.4237 -+#endif /* L_addsub_sf || L_addsub_df */
113.4238 -+
113.4239 -+#if defined(L_mul_sf) || defined(L_mul_df) || defined(L_mul_tf)
113.4240 -+static inline __attribute__ ((__always_inline__)) fp_number_type *
113.4241 -+_fpmul_parts ( fp_number_type *  a,
113.4242 -+	       fp_number_type *  b,
113.4243 -+	       fp_number_type * tmp)
113.4244 -+{
113.4245 -+  fractype low = 0;
113.4246 -+  fractype high = 0;
113.4247 -+
113.4248 -+  if (isnan (a))
113.4249 -+    {
113.4250 -+      a->sign = a->sign != b->sign;
113.4251 -+      return a;
113.4252 -+    }
113.4253 -+  if (isnan (b))
113.4254 -+    {
113.4255 -+      b->sign = a->sign != b->sign;
113.4256 -+      return b;
113.4257 -+    }
113.4258 -+  if (isinf (a))
113.4259 -+    {
113.4260 -+      if (iszero (b))
113.4261 -+	return nan ();
113.4262 -+      a->sign = a->sign != b->sign;
113.4263 -+      return a;
113.4264 -+    }
113.4265 -+  if (isinf (b))
113.4266 -+    {
113.4267 -+      if (iszero (a))
113.4268 -+	{
113.4269 -+	  return nan ();
113.4270 -+	}
113.4271 -+      b->sign = a->sign != b->sign;
113.4272 -+      return b;
113.4273 -+    }
113.4274 -+  if (iszero (a))
113.4275 -+    {
113.4276 -+      a->sign = a->sign != b->sign;
113.4277 -+      return a;
113.4278 -+    }
113.4279 -+  if (iszero (b))
113.4280 -+    {
113.4281 -+      b->sign = a->sign != b->sign;
113.4282 -+      return b;
113.4283 -+    }
113.4284 -+
113.4285 -+  /* Calculate the mantissa by multiplying both numbers to get a
113.4286 -+     twice-as-wide number.  */
113.4287 -+  {
113.4288 -+#if defined(NO_DI_MODE) || defined(TFLOAT)
113.4289 -+    {
113.4290 -+      fractype x = a->fraction.ll;
113.4291 -+      fractype ylow = b->fraction.ll;
113.4292 -+      fractype yhigh = 0;
113.4293 -+      int bit;
113.4294 -+
113.4295 -+      /* ??? This does multiplies one bit at a time.  Optimize.  */
113.4296 -+      for (bit = 0; bit < FRAC_NBITS; bit++)
113.4297 -+	{
113.4298 -+	  int carry;
113.4299 -+
113.4300 -+	  if (x & 1)
113.4301 -+	    {
113.4302 -+	      carry = (low += ylow) < ylow;
113.4303 -+	      high += yhigh + carry;
113.4304 -+	    }
113.4305 -+	  yhigh <<= 1;
113.4306 -+	  if (ylow & FRACHIGH)
113.4307 -+	    {
113.4308 -+	      yhigh |= 1;
113.4309 -+	    }
113.4310 -+	  ylow <<= 1;
113.4311 -+	  x >>= 1;
113.4312 -+	}
113.4313 -+    }
113.4314 -+#elif defined(FLOAT) 
113.4315 -+    /* Multiplying two USIs to get a UDI, we're safe.  */
113.4316 -+    {
113.4317 -+      UDItype answer = (UDItype)a->fraction.ll * (UDItype)b->fraction.ll;
113.4318 -+      
113.4319 -+      high = answer >> BITS_PER_SI;
113.4320 -+      low = answer;
113.4321 -+    }
113.4322 -+#else
113.4323 -+    /* fractype is DImode, but we need the result to be twice as wide.
113.4324 -+       Assuming a widening multiply from DImode to TImode is not
113.4325 -+       available, build one by hand.  */
113.4326 -+    {
113.4327 -+      USItype nl = a->fraction.ll;
113.4328 -+      USItype nh = a->fraction.ll >> BITS_PER_SI;
113.4329 -+      USItype ml = b->fraction.ll;
113.4330 -+      USItype mh = b->fraction.ll >> BITS_PER_SI;
113.4331 -+      UDItype pp_ll = (UDItype) ml * nl;
113.4332 -+      UDItype pp_hl = (UDItype) mh * nl;
113.4333 -+      UDItype pp_lh = (UDItype) ml * nh;
113.4334 -+      UDItype pp_hh = (UDItype) mh * nh;
113.4335 -+      UDItype res2 = 0;
113.4336 -+      UDItype res0 = 0;
113.4337 -+      UDItype ps_hh__ = pp_hl + pp_lh;
113.4338 -+      if (ps_hh__ < pp_hl)
113.4339 -+	res2 += (UDItype)1 << BITS_PER_SI;
113.4340 -+      pp_hl = (UDItype)(USItype)ps_hh__ << BITS_PER_SI;
113.4341 -+      res0 = pp_ll + pp_hl;
113.4342 -+      if (res0 < pp_ll)
113.4343 -+	res2++;
113.4344 -+      res2 += (ps_hh__ >> BITS_PER_SI) + pp_hh;
113.4345 -+      high = res2;
113.4346 -+      low = res0;
113.4347 -+    }
113.4348 -+#endif
113.4349 -+  }
113.4350 -+
113.4351 -+  tmp->normal_exp = a->normal_exp + b->normal_exp
113.4352 -+    + FRAC_NBITS - (FRACBITS + NGARDS);
113.4353 -+  tmp->sign = a->sign != b->sign;
113.4354 -+  while (high >= IMPLICIT_2)
113.4355 -+    {
113.4356 -+      tmp->normal_exp++;
113.4357 -+      if (high & 1)
113.4358 -+	{
113.4359 -+	  low >>= 1;
113.4360 -+	  low |= FRACHIGH;
113.4361 -+	}
113.4362 -+      high >>= 1;
113.4363 -+    }
113.4364 -+  while (high < IMPLICIT_1)
113.4365 -+    {
113.4366 -+      tmp->normal_exp--;
113.4367 -+
113.4368 -+      high <<= 1;
113.4369 -+      if (low & FRACHIGH)
113.4370 -+	high |= 1;
113.4371 -+      low <<= 1;
113.4372 -+    }
113.4373 -+  /* rounding is tricky. if we only round if it won't make us round later.  */
113.4374 -+#if 0
113.4375 -+  if (low & FRACHIGH2)
113.4376 -+    {
113.4377 -+      if (((high & GARDMASK) != GARDMSB)
113.4378 -+	  && (((high + 1) & GARDMASK) == GARDMSB))
113.4379 -+	{
113.4380 -+	  /* don't round, it gets done again later.  */
113.4381 -+	}
113.4382 -+      else
113.4383 -+	{
113.4384 -+	  high++;
113.4385 -+	}
113.4386 -+    }
113.4387 -+#endif
113.4388 -+  if (!ROUND_TOWARDS_ZERO && (high & GARDMASK) == GARDMSB)
113.4389 -+    {
113.4390 -+      if (high & (1 << NGARDS))
113.4391 -+	{
113.4392 -+	  /* half way, so round to even */
113.4393 -+	  high += GARDROUND + 1;
113.4394 -+	}
113.4395 -+      else if (low)
113.4396 -+	{
113.4397 -+	  /* but we really weren't half way */
113.4398 -+	  high += GARDROUND + 1;
113.4399 -+	}
113.4400 -+    }
113.4401 -+  tmp->fraction.ll = high;
113.4402 -+  tmp->class = CLASS_NUMBER;
113.4403 -+  return tmp;
113.4404 -+}
113.4405 -+
113.4406 -+FLO_type
113.4407 -+multiply (FLO_type arg_a, FLO_type arg_b)
113.4408 -+{
113.4409 -+  fp_number_type a;
113.4410 -+  fp_number_type b;
113.4411 -+  fp_number_type tmp;
113.4412 -+  fp_number_type *res;
113.4413 -+  FLO_union_type au, bu;
113.4414 -+
113.4415 -+  au.value = arg_a;
113.4416 -+  bu.value = arg_b;
113.4417 -+
113.4418 -+  unpack_d (&au, &a);
113.4419 -+  unpack_d (&bu, &b);
113.4420 -+
113.4421 -+  res = _fpmul_parts (&a, &b, &tmp);
113.4422 -+
113.4423 -+  return pack_d (res);
113.4424 -+}
113.4425 -+#endif /* L_mul_sf || L_mul_df */
113.4426 -+
113.4427 -+#if defined(L_div_sf) || defined(L_div_df) || defined(L_div_tf)
113.4428 -+static inline __attribute__ ((__always_inline__)) fp_number_type *
113.4429 -+_fpdiv_parts (fp_number_type * a,
113.4430 -+	      fp_number_type * b)
113.4431 -+{
113.4432 -+  fractype bit;
113.4433 -+  fractype numerator;
113.4434 -+  fractype denominator;
113.4435 -+  fractype quotient;
113.4436 -+
113.4437 -+  if (isnan (a))
113.4438 -+    {
113.4439 -+      return a;
113.4440 -+    }
113.4441 -+  if (isnan (b))
113.4442 -+    {
113.4443 -+      return b;
113.4444 -+    }
113.4445 -+
113.4446 -+  a->sign = a->sign ^ b->sign;
113.4447 -+
113.4448 -+  if (isinf (a) || iszero (a))
113.4449 -+    {
113.4450 -+      if (a->class == b->class)
113.4451 -+	return nan ();
113.4452 -+      return a;
113.4453 -+    }
113.4454 -+
113.4455 -+  if (isinf (b))
113.4456 -+    {
113.4457 -+      a->fraction.ll = 0;
113.4458 -+      a->normal_exp = 0;
113.4459 -+      return a;
113.4460 -+    }
113.4461 -+  if (iszero (b))
113.4462 -+    {
113.4463 -+      a->class = CLASS_INFINITY;
113.4464 -+      return a;
113.4465 -+    }
113.4466 -+
113.4467 -+  /* Calculate the mantissa by multiplying both 64bit numbers to get a
113.4468 -+     128 bit number */
113.4469 -+  {
113.4470 -+    /* quotient =
113.4471 -+       ( numerator / denominator) * 2^(numerator exponent -  denominator exponent)
113.4472 -+     */
113.4473 -+
113.4474 -+    a->normal_exp = a->normal_exp - b->normal_exp;
113.4475 -+    numerator = a->fraction.ll;
113.4476 -+    denominator = b->fraction.ll;
113.4477 -+
113.4478 -+    if (numerator < denominator)
113.4479 -+      {
113.4480 -+	/* Fraction will be less than 1.0 */
113.4481 -+	numerator *= 2;
113.4482 -+	a->normal_exp--;
113.4483 -+      }
113.4484 -+    bit = IMPLICIT_1;
113.4485 -+    quotient = 0;
113.4486 -+    /* ??? Does divide one bit at a time.  Optimize.  */
113.4487 -+    while (bit)
113.4488 -+      {
113.4489 -+	if (numerator >= denominator)
113.4490 -+	  {
113.4491 -+	    quotient |= bit;
113.4492 -+	    numerator -= denominator;
113.4493 -+	  }
113.4494 -+	bit >>= 1;
113.4495 -+	numerator *= 2;
113.4496 -+      }
113.4497 -+
113.4498 -+    if (!ROUND_TOWARDS_ZERO && (quotient & GARDMASK) == GARDMSB)
113.4499 -+      {
113.4500 -+	if (quotient & (1 << NGARDS))
113.4501 -+	  {
113.4502 -+	    /* half way, so round to even */
113.4503 -+	    quotient += GARDROUND + 1;
113.4504 -+	  }
113.4505 -+	else if (numerator)
113.4506 -+	  {
113.4507 -+	    /* but we really weren't half way, more bits exist */
113.4508 -+	    quotient += GARDROUND + 1;
113.4509 -+	  }
113.4510 -+      }
113.4511 -+
113.4512 -+    a->fraction.ll = quotient;
113.4513 -+    return (a);
113.4514 -+  }
113.4515 -+}
113.4516 -+
113.4517 -+FLO_type
113.4518 -+divide (FLO_type arg_a, FLO_type arg_b)
113.4519 -+{
113.4520 -+  fp_number_type a;
113.4521 -+  fp_number_type b;
113.4522 -+  fp_number_type *res;
113.4523 -+  FLO_union_type au, bu;
113.4524 -+
113.4525 -+  au.value = arg_a;
113.4526 -+  bu.value = arg_b;
113.4527 -+
113.4528 -+  unpack_d (&au, &a);
113.4529 -+  unpack_d (&bu, &b);
113.4530 -+
113.4531 -+  res = _fpdiv_parts (&a, &b);
113.4532 -+
113.4533 -+  return pack_d (res);
113.4534 -+}
113.4535 -+#endif /* L_div_sf || L_div_df */
113.4536 -+
113.4537 -+#if defined(L_fpcmp_parts_sf) || defined(L_fpcmp_parts_df) \
113.4538 -+    || defined(L_fpcmp_parts_tf)
113.4539 -+/* according to the demo, fpcmp returns a comparison with 0... thus
113.4540 -+   a<b -> -1
113.4541 -+   a==b -> 0
113.4542 -+   a>b -> +1
113.4543 -+ */
113.4544 -+
113.4545 -+int
113.4546 -+__fpcmp_parts (fp_number_type * a, fp_number_type * b)
113.4547 -+{
113.4548 -+#if 0
113.4549 -+  /* either nan -> unordered. Must be checked outside of this routine.  */
113.4550 -+  if (isnan (a) && isnan (b))
113.4551 -+    {
113.4552 -+      return 1;			/* still unordered! */
113.4553 -+    }
113.4554 -+#endif
113.4555 -+
113.4556 -+  if (isnan (a) || isnan (b))
113.4557 -+    {
113.4558 -+      return 1;			/* how to indicate unordered compare? */
113.4559 -+    }
113.4560 -+  if (isinf (a) && isinf (b))
113.4561 -+    {
113.4562 -+      /* +inf > -inf, but +inf != +inf */
113.4563 -+      /* b    \a| +inf(0)| -inf(1)
113.4564 -+       ______\+--------+--------
113.4565 -+       +inf(0)| a==b(0)| a<b(-1)
113.4566 -+       -------+--------+--------
113.4567 -+       -inf(1)| a>b(1) | a==b(0)
113.4568 -+       -------+--------+--------
113.4569 -+       So since unordered must be nonzero, just line up the columns...
113.4570 -+       */
113.4571 -+      return b->sign - a->sign;
113.4572 -+    }
113.4573 -+  /* but not both...  */
113.4574 -+  if (isinf (a))
113.4575 -+    {
113.4576 -+      return a->sign ? -1 : 1;
113.4577 -+    }
113.4578 -+  if (isinf (b))
113.4579 -+    {
113.4580 -+      return b->sign ? 1 : -1;
113.4581 -+    }
113.4582 -+  if (iszero (a) && iszero (b))
113.4583 -+    {
113.4584 -+      return 0;
113.4585 -+    }
113.4586 -+  if (iszero (a))
113.4587 -+    {
113.4588 -+      return b->sign ? 1 : -1;
113.4589 -+    }
113.4590 -+  if (iszero (b))
113.4591 -+    {
113.4592 -+      return a->sign ? -1 : 1;
113.4593 -+    }
113.4594 -+  /* now both are "normal".  */
113.4595 -+  if (a->sign != b->sign)
113.4596 -+    {
113.4597 -+      /* opposite signs */
113.4598 -+      return a->sign ? -1 : 1;
113.4599 -+    }
113.4600 -+  /* same sign; exponents? */
113.4601 -+  if (a->normal_exp > b->normal_exp)
113.4602 -+    {
113.4603 -+      return a->sign ? -1 : 1;
113.4604 -+    }
113.4605 -+  if (a->normal_exp < b->normal_exp)
113.4606 -+    {
113.4607 -+      return a->sign ? 1 : -1;
113.4608 -+    }
113.4609 -+  /* same exponents; check size.  */
113.4610 -+  if (a->fraction.ll > b->fraction.ll)
113.4611 -+    {
113.4612 -+      return a->sign ? -1 : 1;
113.4613 -+    }
113.4614 -+  if (a->fraction.ll < b->fraction.ll)
113.4615 -+    {
113.4616 -+      return a->sign ? 1 : -1;
113.4617 -+    }
113.4618 -+  /* after all that, they're equal.  */
113.4619 -+  return 0;
113.4620 -+}
113.4621 -+#endif
113.4622 -+
113.4623 -+#if defined(L_compare_sf) || defined(L_compare_df) || defined(L_compoare_tf)
113.4624 -+CMPtype
113.4625 -+compare (FLO_type arg_a, FLO_type arg_b)
113.4626 -+{
113.4627 -+  fp_number_type a;
113.4628 -+  fp_number_type b;
113.4629 -+  FLO_union_type au, bu;
113.4630 -+
113.4631 -+  au.value = arg_a;
113.4632 -+  bu.value = arg_b;
113.4633 -+
113.4634 -+  unpack_d (&au, &a);
113.4635 -+  unpack_d (&bu, &b);
113.4636 -+
113.4637 -+  return __fpcmp_parts (&a, &b);
113.4638 -+}
113.4639 -+#endif /* L_compare_sf || L_compare_df */
113.4640 -+
113.4641 -+#ifndef US_SOFTWARE_GOFAST
113.4642 -+
113.4643 -+/* These should be optimized for their specific tasks someday.  */
113.4644 -+
113.4645 -+#if defined(L_eq_sf) || defined(L_eq_df) || defined(L_eq_tf)
113.4646 -+CMPtype
113.4647 -+_eq_f2 (FLO_type arg_a, FLO_type arg_b)
113.4648 -+{
113.4649 -+  fp_number_type a;
113.4650 -+  fp_number_type b;
113.4651 -+  FLO_union_type au, bu;
113.4652 -+
113.4653 -+  au.value = arg_a;
113.4654 -+  bu.value = arg_b;
113.4655 -+
113.4656 -+  unpack_d (&au, &a);
113.4657 -+  unpack_d (&bu, &b);
113.4658 -+
113.4659 -+  if (isnan (&a) || isnan (&b))
113.4660 -+    return 1;			/* false, truth == 0 */
113.4661 -+
113.4662 -+  return __fpcmp_parts (&a, &b) ;
113.4663 -+}
113.4664 -+#endif /* L_eq_sf || L_eq_df */
113.4665 -+
113.4666 -+#if defined(L_ne_sf) || defined(L_ne_df) || defined(L_ne_tf)
113.4667 -+CMPtype
113.4668 -+_ne_f2 (FLO_type arg_a, FLO_type arg_b)
113.4669 -+{
113.4670 -+  fp_number_type a;
113.4671 -+  fp_number_type b;
113.4672 -+  FLO_union_type au, bu;
113.4673 -+
113.4674 -+  au.value = arg_a;
113.4675 -+  bu.value = arg_b;
113.4676 -+
113.4677 -+  unpack_d (&au, &a);
113.4678 -+  unpack_d (&bu, &b);
113.4679 -+
113.4680 -+  if (isnan (&a) || isnan (&b))
113.4681 -+    return 1;			/* true, truth != 0 */
113.4682 -+
113.4683 -+  return  __fpcmp_parts (&a, &b) ;
113.4684 -+}
113.4685 -+#endif /* L_ne_sf || L_ne_df */
113.4686 -+
113.4687 -+#if defined(L_gt_sf) || defined(L_gt_df) || defined(L_gt_tf)
113.4688 -+CMPtype
113.4689 -+_gt_f2 (FLO_type arg_a, FLO_type arg_b)
113.4690 -+{
113.4691 -+  fp_number_type a;
113.4692 -+  fp_number_type b;
113.4693 -+  FLO_union_type au, bu;
113.4694 -+
113.4695 -+  au.value = arg_a;
113.4696 -+  bu.value = arg_b;
113.4697 -+
113.4698 -+  unpack_d (&au, &a);
113.4699 -+  unpack_d (&bu, &b);
113.4700 -+
113.4701 -+  if (isnan (&a) || isnan (&b))
113.4702 -+    return -1;			/* false, truth > 0 */
113.4703 -+
113.4704 -+  return __fpcmp_parts (&a, &b);
113.4705 -+}
113.4706 -+#endif /* L_gt_sf || L_gt_df */
113.4707 -+
113.4708 -+#if defined(L_ge_sf) || defined(L_ge_df) || defined(L_ge_tf)
113.4709 -+CMPtype
113.4710 -+_ge_f2 (FLO_type arg_a, FLO_type arg_b)
113.4711 -+{
113.4712 -+  fp_number_type a;
113.4713 -+  fp_number_type b;
113.4714 -+  FLO_union_type au, bu;
113.4715 -+
113.4716 -+  au.value = arg_a;
113.4717 -+  bu.value = arg_b;
113.4718 -+
113.4719 -+  unpack_d (&au, &a);
113.4720 -+  unpack_d (&bu, &b);
113.4721 -+
113.4722 -+  if (isnan (&a) || isnan (&b))
113.4723 -+    return -1;			/* false, truth >= 0 */
113.4724 -+  return __fpcmp_parts (&a, &b) ;
113.4725 -+}
113.4726 -+#endif /* L_ge_sf || L_ge_df */
113.4727 -+
113.4728 -+#if defined(L_lt_sf) || defined(L_lt_df) || defined(L_lt_tf)
113.4729 -+CMPtype
113.4730 -+_lt_f2 (FLO_type arg_a, FLO_type arg_b)
113.4731 -+{
113.4732 -+  fp_number_type a;
113.4733 -+  fp_number_type b;
113.4734 -+  FLO_union_type au, bu;
113.4735 -+
113.4736 -+  au.value = arg_a;
113.4737 -+  bu.value = arg_b;
113.4738 -+
113.4739 -+  unpack_d (&au, &a);
113.4740 -+  unpack_d (&bu, &b);
113.4741 -+
113.4742 -+  if (isnan (&a) || isnan (&b))
113.4743 -+    return 1;			/* false, truth < 0 */
113.4744 -+
113.4745 -+  return __fpcmp_parts (&a, &b);
113.4746 -+}
113.4747 -+#endif /* L_lt_sf || L_lt_df */
113.4748 -+
113.4749 -+#if defined(L_le_sf) || defined(L_le_df) || defined(L_le_tf)
113.4750 -+CMPtype
113.4751 -+_le_f2 (FLO_type arg_a, FLO_type arg_b)
113.4752 -+{
113.4753 -+  fp_number_type a;
113.4754 -+  fp_number_type b;
113.4755 -+  FLO_union_type au, bu;
113.4756 -+
113.4757 -+  au.value = arg_a;
113.4758 -+  bu.value = arg_b;
113.4759 -+
113.4760 -+  unpack_d (&au, &a);
113.4761 -+  unpack_d (&bu, &b);
113.4762 -+
113.4763 -+  if (isnan (&a) || isnan (&b))
113.4764 -+    return 1;			/* false, truth <= 0 */
113.4765 -+
113.4766 -+  return __fpcmp_parts (&a, &b) ;
113.4767 -+}
113.4768 -+#endif /* L_le_sf || L_le_df */
113.4769 -+
113.4770 -+#endif /* ! US_SOFTWARE_GOFAST */
113.4771 -+
113.4772 -+#if defined(L_unord_sf) || defined(L_unord_df) || defined(L_unord_tf)
113.4773 -+CMPtype
113.4774 -+_unord_f2 (FLO_type arg_a, FLO_type arg_b)
113.4775 -+{
113.4776 -+  fp_number_type a;
113.4777 -+  fp_number_type b;
113.4778 -+  FLO_union_type au, bu;
113.4779 -+
113.4780 -+  au.value = arg_a;
113.4781 -+  bu.value = arg_b;
113.4782 -+
113.4783 -+  unpack_d (&au, &a);
113.4784 -+  unpack_d (&bu, &b);
113.4785 -+
113.4786 -+  return (isnan (&a) || isnan (&b));
113.4787 -+}
113.4788 -+#endif /* L_unord_sf || L_unord_df */
113.4789 -+
113.4790 -+#if defined(L_si_to_sf) || defined(L_si_to_df) || defined(L_si_to_tf)
113.4791 -+FLO_type
113.4792 -+si_to_float (SItype arg_a)
113.4793 -+{
113.4794 -+  fp_number_type in;
113.4795 -+
113.4796 -+  in.class = CLASS_NUMBER;
113.4797 -+  in.sign = arg_a < 0;
113.4798 -+  if (!arg_a)
113.4799 -+    {
113.4800 -+      in.class = CLASS_ZERO;
113.4801 -+    }
113.4802 -+  else
113.4803 -+    {
113.4804 -+      in.normal_exp = FRACBITS + NGARDS;
113.4805 -+      if (in.sign) 
113.4806 -+	{
113.4807 -+	  /* Special case for minint, since there is no +ve integer
113.4808 -+	     representation for it */
113.4809 -+	  if (arg_a == (- MAX_SI_INT - 1))
113.4810 -+	    {
113.4811 -+	      return (FLO_type)(- MAX_SI_INT - 1);
113.4812 -+	    }
113.4813 -+	  in.fraction.ll = (-arg_a);
113.4814 -+	}
113.4815 -+      else
113.4816 -+	in.fraction.ll = arg_a;
113.4817 -+
113.4818 -+      while (in.fraction.ll < ((fractype)1 << (FRACBITS + NGARDS)))
113.4819 -+	{
113.4820 -+	  in.fraction.ll <<= 1;
113.4821 -+	  in.normal_exp -= 1;
113.4822 -+	}
113.4823 -+    }
113.4824 -+  return pack_d (&in);
113.4825 -+}
113.4826 -+#endif /* L_si_to_sf || L_si_to_df */
113.4827 -+
113.4828 -+#if defined(L_usi_to_sf) || defined(L_usi_to_df) || defined(L_usi_to_tf)
113.4829 -+FLO_type
113.4830 -+usi_to_float (USItype arg_a)
113.4831 -+{
113.4832 -+  fp_number_type in;
113.4833 -+
113.4834 -+  in.sign = 0;
113.4835 -+  if (!arg_a)
113.4836 -+    {
113.4837 -+      in.class = CLASS_ZERO;
113.4838 -+    }
113.4839 -+  else
113.4840 -+    {
113.4841 -+      in.class = CLASS_NUMBER;
113.4842 -+      in.normal_exp = FRACBITS + NGARDS;
113.4843 -+      in.fraction.ll = arg_a;
113.4844 -+
113.4845 -+      while (in.fraction.ll > ((fractype)1 << (FRACBITS + NGARDS)))
113.4846 -+        {
113.4847 -+          in.fraction.ll >>= 1;
113.4848 -+          in.normal_exp += 1;
113.4849 -+        }
113.4850 -+      while (in.fraction.ll < ((fractype)1 << (FRACBITS + NGARDS)))
113.4851 -+	{
113.4852 -+	  in.fraction.ll <<= 1;
113.4853 -+	  in.normal_exp -= 1;
113.4854 -+	}
113.4855 -+    }
113.4856 -+  return pack_d (&in);
113.4857 -+}
113.4858 -+#endif
113.4859 -+
113.4860 -+#if defined(L_sf_to_si) || defined(L_df_to_si) || defined(L_tf_to_si)
113.4861 -+SItype
113.4862 -+float_to_si (FLO_type arg_a)
113.4863 -+{
113.4864 -+  fp_number_type a;
113.4865 -+  SItype tmp;
113.4866 -+  FLO_union_type au;
113.4867 -+
113.4868 -+  au.value = arg_a;
113.4869 -+  unpack_d (&au, &a);
113.4870 -+
113.4871 -+  if (iszero (&a))
113.4872 -+    return 0;
113.4873 -+  if (isnan (&a))
113.4874 -+    return 0;
113.4875 -+  /* get reasonable MAX_SI_INT...  */
113.4876 -+  if (isinf (&a))
113.4877 -+    return a.sign ? (-MAX_SI_INT)-1 : MAX_SI_INT;
113.4878 -+  /* it is a number, but a small one */
113.4879 -+  if (a.normal_exp < 0)
113.4880 -+    return 0;
113.4881 -+  if (a.normal_exp > BITS_PER_SI - 2)
113.4882 -+    return a.sign ? (-MAX_SI_INT)-1 : MAX_SI_INT;
113.4883 -+  tmp = a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp);
113.4884 -+  return a.sign ? (-tmp) : (tmp);
113.4885 -+}
113.4886 -+#endif /* L_sf_to_si || L_df_to_si */
113.4887 -+
113.4888 -+#if defined(L_sf_to_usi) || defined(L_df_to_usi) || defined(L_tf_to_usi)
113.4889 -+#if defined US_SOFTWARE_GOFAST || defined(L_tf_to_usi)
113.4890 -+/* While libgcc2.c defines its own __fixunssfsi and __fixunsdfsi routines,
113.4891 -+   we also define them for GOFAST because the ones in libgcc2.c have the
113.4892 -+   wrong names and I'd rather define these here and keep GOFAST CYG-LOC's
113.4893 -+   out of libgcc2.c.  We can't define these here if not GOFAST because then
113.4894 -+   there'd be duplicate copies.  */
113.4895 -+
113.4896 -+USItype
113.4897 -+float_to_usi (FLO_type arg_a)
113.4898 -+{
113.4899 -+  fp_number_type a;
113.4900 -+  FLO_union_type au;
113.4901 -+
113.4902 -+  au.value = arg_a;
113.4903 -+  unpack_d (&au, &a);
113.4904 -+
113.4905 -+  if (iszero (&a))
113.4906 -+    return 0;
113.4907 -+  if (isnan (&a))
113.4908 -+    return 0;
113.4909 -+  /* it is a negative number */
113.4910 -+  if (a.sign)
113.4911 -+    return 0;
113.4912 -+  /* get reasonable MAX_USI_INT...  */
113.4913 -+  if (isinf (&a))
113.4914 -+    return MAX_USI_INT;
113.4915 -+  /* it is a number, but a small one */
113.4916 -+  if (a.normal_exp < 0)
113.4917 -+    return 0;
113.4918 -+  if (a.normal_exp > BITS_PER_SI - 1)
113.4919 -+    return MAX_USI_INT;
113.4920 -+  else if (a.normal_exp > (FRACBITS + NGARDS))
113.4921 -+    return a.fraction.ll << (a.normal_exp - (FRACBITS + NGARDS));
113.4922 -+  else
113.4923 -+    return a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp);
113.4924 -+}
113.4925 -+#endif /* US_SOFTWARE_GOFAST */
113.4926 -+#endif /* L_sf_to_usi || L_df_to_usi */
113.4927 -+
113.4928 -+#if defined(L_negate_sf) || defined(L_negate_df) || defined(L_negate_tf)
113.4929 -+FLO_type
113.4930 -+negate (FLO_type arg_a)
113.4931 -+{
113.4932 -+  fp_number_type a;
113.4933 -+  FLO_union_type au;
113.4934 -+
113.4935 -+  au.value = arg_a;
113.4936 -+  unpack_d (&au, &a);
113.4937 -+
113.4938 -+  flip_sign (&a);
113.4939 -+  return pack_d (&a);
113.4940 -+}
113.4941 -+#endif /* L_negate_sf || L_negate_df */
113.4942 -+
113.4943 -+#ifdef FLOAT
113.4944 -+
113.4945 -+#if defined(L_make_sf)
113.4946 -+SFtype
113.4947 -+__make_fp(fp_class_type class,
113.4948 -+	     unsigned int sign,
113.4949 -+	     int exp, 
113.4950 -+	     USItype frac)
113.4951 -+{
113.4952 -+  fp_number_type in;
113.4953 -+
113.4954 -+  in.class = class;
113.4955 -+  in.sign = sign;
113.4956 -+  in.normal_exp = exp;
113.4957 -+  in.fraction.ll = frac;
113.4958 -+  return pack_d (&in);
113.4959 -+}
113.4960 -+#endif /* L_make_sf */
113.4961 -+
113.4962 -+#ifndef FLOAT_ONLY
113.4963 -+
113.4964 -+/* This enables one to build an fp library that supports float but not double.
113.4965 -+   Otherwise, we would get an undefined reference to __make_dp.
113.4966 -+   This is needed for some 8-bit ports that can't handle well values that
113.4967 -+   are 8-bytes in size, so we just don't support double for them at all.  */
113.4968 -+
113.4969 -+#if defined(L_sf_to_df)
113.4970 -+DFtype
113.4971 -+sf_to_df (SFtype arg_a)
113.4972 -+{
113.4973 -+  fp_number_type in;
113.4974 -+  FLO_union_type au;
113.4975 -+
113.4976 -+  au.value = arg_a;
113.4977 -+  unpack_d (&au, &in);
113.4978 -+
113.4979 -+  return __make_dp (in.class, in.sign, in.normal_exp,
113.4980 -+		    ((UDItype) in.fraction.ll) << F_D_BITOFF);
113.4981 -+}
113.4982 -+#endif /* L_sf_to_df */
113.4983 -+
113.4984 -+#if defined(L_sf_to_tf) && defined(TMODES)
113.4985 -+TFtype
113.4986 -+sf_to_tf (SFtype arg_a)
113.4987 -+{
113.4988 -+  fp_number_type in;
113.4989 -+  FLO_union_type au;
113.4990 -+
113.4991 -+  au.value = arg_a;
113.4992 -+  unpack_d (&au, &in);
113.4993 -+
113.4994 -+  return __make_tp (in.class, in.sign, in.normal_exp,
113.4995 -+		    ((UTItype) in.fraction.ll) << F_T_BITOFF);
113.4996 -+}
113.4997 -+#endif /* L_sf_to_df */
113.4998 -+
113.4999 -+#endif /* ! FLOAT_ONLY */
113.5000 -+#endif /* FLOAT */
113.5001 -+
113.5002 -+#ifndef FLOAT
113.5003 -+
113.5004 -+extern SFtype __make_fp (fp_class_type, unsigned int, int, USItype);
113.5005 -+
113.5006 -+#if defined(L_make_df)
113.5007 -+DFtype
113.5008 -+__make_dp (fp_class_type class, unsigned int sign, int exp, UDItype frac)
113.5009 -+{
113.5010 -+  fp_number_type in;
113.5011 -+
113.5012 -+  in.class = class;
113.5013 -+  in.sign = sign;
113.5014 -+  in.normal_exp = exp;
113.5015 -+  in.fraction.ll = frac;
113.5016 -+  return pack_d (&in);
113.5017 -+}
113.5018 -+#endif /* L_make_df */
113.5019 -+
113.5020 -+#if defined(L_df_to_sf)
113.5021 -+SFtype
113.5022 -+df_to_sf (DFtype arg_a)
113.5023 -+{
113.5024 -+  fp_number_type in;
113.5025 -+  USItype sffrac;
113.5026 -+  FLO_union_type au;
113.5027 -+
113.5028 -+  au.value = arg_a;
113.5029 -+  unpack_d (&au, &in);
113.5030 -+
113.5031 -+  sffrac = in.fraction.ll >> F_D_BITOFF;
113.5032 -+
113.5033 -+  /* We set the lowest guard bit in SFFRAC if we discarded any non
113.5034 -+     zero bits.  */
113.5035 -+  if ((in.fraction.ll & (((USItype) 1 << F_D_BITOFF) - 1)) != 0)
113.5036 -+    sffrac |= 1;
113.5037 -+
113.5038 -+  return __make_fp (in.class, in.sign, in.normal_exp, sffrac);
113.5039 -+}
113.5040 -+#endif /* L_df_to_sf */
113.5041 -+
113.5042 -+#if defined(L_df_to_tf) && defined(TMODES) \
113.5043 -+    && !defined(FLOAT) && !defined(TFLOAT)
113.5044 -+TFtype
113.5045 -+df_to_tf (DFtype arg_a)
113.5046 -+{
113.5047 -+  fp_number_type in;
113.5048 -+  FLO_union_type au;
113.5049 -+
113.5050 -+  au.value = arg_a;
113.5051 -+  unpack_d (&au, &in);
113.5052 -+
113.5053 -+  return __make_tp (in.class, in.sign, in.normal_exp,
113.5054 -+		    ((UTItype) in.fraction.ll) << D_T_BITOFF);
113.5055 -+}
113.5056 -+#endif /* L_sf_to_df */
113.5057 -+
113.5058 -+#ifdef TFLOAT
113.5059 -+#if defined(L_make_tf)
113.5060 -+TFtype
113.5061 -+__make_tp(fp_class_type class,
113.5062 -+	     unsigned int sign,
113.5063 -+	     int exp, 
113.5064 -+	     UTItype frac)
113.5065 -+{
113.5066 -+  fp_number_type in;
113.5067 -+
113.5068 -+  in.class = class;
113.5069 -+  in.sign = sign;
113.5070 -+  in.normal_exp = exp;
113.5071 -+  in.fraction.ll = frac;
113.5072 -+  return pack_d (&in);
113.5073 -+}
113.5074 -+#endif /* L_make_tf */
113.5075 -+
113.5076 -+#if defined(L_tf_to_df)
113.5077 -+DFtype
113.5078 -+tf_to_df (TFtype arg_a)
113.5079 -+{
113.5080 -+  fp_number_type in;
113.5081 -+  UDItype sffrac;
113.5082 -+  FLO_union_type au;
113.5083 -+
113.5084 -+  au.value = arg_a;
113.5085 -+  unpack_d (&au, &in);
113.5086 -+
113.5087 -+  sffrac = in.fraction.ll >> D_T_BITOFF;
113.5088 -+
113.5089 -+  /* We set the lowest guard bit in SFFRAC if we discarded any non
113.5090 -+     zero bits.  */
113.5091 -+  if ((in.fraction.ll & (((UTItype) 1 << D_T_BITOFF) - 1)) != 0)
113.5092 -+    sffrac |= 1;
113.5093 -+
113.5094 -+  return __make_dp (in.class, in.sign, in.normal_exp, sffrac);
113.5095 -+}
113.5096 -+#endif /* L_tf_to_df */
113.5097 -+
113.5098 -+#if defined(L_tf_to_sf)
113.5099 -+SFtype
113.5100 -+tf_to_sf (TFtype arg_a)
113.5101 -+{
113.5102 -+  fp_number_type in;
113.5103 -+  USItype sffrac;
113.5104 -+  FLO_union_type au;
113.5105 -+
113.5106 -+  au.value = arg_a;
113.5107 -+  unpack_d (&au, &in);
113.5108 -+
113.5109 -+  sffrac = in.fraction.ll >> F_T_BITOFF;
113.5110 -+
113.5111 -+  /* We set the lowest guard bit in SFFRAC if we discarded any non
113.5112 -+     zero bits.  */
113.5113 -+  if ((in.fraction.ll & (((UTItype) 1 << F_T_BITOFF) - 1)) != 0)
113.5114 -+    sffrac |= 1;
113.5115 -+
113.5116 -+  return __make_fp (in.class, in.sign, in.normal_exp, sffrac);
113.5117 -+}
113.5118 -+#endif /* L_tf_to_sf */
113.5119 -+#endif /* TFLOAT */
113.5120 -+
113.5121 -+#endif /* ! FLOAT */
113.5122 -+#endif /* !EXTENDED_FLOAT_STUBS */
113.5123 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2-fp-bit.c gcc-3.4.6/gcc/config/nios2/nios2-fp-bit.c
113.5124 ---- gcc-3.4.6.orig/gcc/config/nios2/nios2-fp-bit.c	1970-01-01 01:00:00.000000000 +0100
113.5125 -+++ gcc-3.4.6/gcc/config/nios2/nios2-fp-bit.c	2007-08-15 23:09:36.000000000 +0200
113.5126 -@@ -0,0 +1,1652 @@
113.5127 -+#define FLOAT
113.5128 -+/* This is a software floating point library which can be used
113.5129 -+   for targets without hardware floating point. 
113.5130 -+   Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004
113.5131 -+   Free Software Foundation, Inc.
113.5132 -+
113.5133 -+This file is free software; you can redistribute it and/or modify it
113.5134 -+under the terms of the GNU General Public License as published by the
113.5135 -+Free Software Foundation; either version 2, or (at your option) any
113.5136 -+later version.
113.5137 -+
113.5138 -+In addition to the permissions in the GNU General Public License, the
113.5139 -+Free Software Foundation gives you unlimited permission to link the
113.5140 -+compiled version of this file with other programs, and to distribute
113.5141 -+those programs without any restriction coming from the use of this
113.5142 -+file.  (The General Public License restrictions do apply in other
113.5143 -+respects; for example, they cover modification of the file, and
113.5144 -+distribution when not linked into another program.)
113.5145 -+
113.5146 -+This file is distributed in the hope that it will be useful, but
113.5147 -+WITHOUT ANY WARRANTY; without even the implied warranty of
113.5148 -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
113.5149 -+General Public License for more details.
113.5150 -+
113.5151 -+You should have received a copy of the GNU General Public License
113.5152 -+along with this program; see the file COPYING.  If not, write to
113.5153 -+the Free Software Foundation, 59 Temple Place - Suite 330,
113.5154 -+Boston, MA 02111-1307, USA.  */
113.5155 -+
113.5156 -+/* As a special exception, if you link this library with other files,
113.5157 -+   some of which are compiled with GCC, to produce an executable,
113.5158 -+   this library does not by itself cause the resulting executable
113.5159 -+   to be covered by the GNU General Public License.
113.5160 -+   This exception does not however invalidate any other reasons why
113.5161 -+   the executable file might be covered by the GNU General Public License.  */
113.5162 -+
113.5163 -+/* This implements IEEE 754 format arithmetic, but does not provide a
113.5164 -+   mechanism for setting the rounding mode, or for generating or handling
113.5165 -+   exceptions.
113.5166 -+
113.5167 -+   The original code by Steve Chamberlain, hacked by Mark Eichin and Jim
113.5168 -+   Wilson, all of Cygnus Support.  */
113.5169 -+
113.5170 -+/* The intended way to use this file is to make two copies, add `#define FLOAT'
113.5171 -+   to one copy, then compile both copies and add them to libgcc.a.  */
113.5172 -+
113.5173 -+#include "tconfig.h"
113.5174 -+#include "coretypes.h"
113.5175 -+#include "tm.h"
113.5176 -+#include "config/fp-bit.h"
113.5177 -+
113.5178 -+/* The following macros can be defined to change the behavior of this file:
113.5179 -+   FLOAT: Implement a `float', aka SFmode, fp library.  If this is not
113.5180 -+     defined, then this file implements a `double', aka DFmode, fp library.
113.5181 -+   FLOAT_ONLY: Used with FLOAT, to implement a `float' only library, i.e.
113.5182 -+     don't include float->double conversion which requires the double library.
113.5183 -+     This is useful only for machines which can't support doubles, e.g. some
113.5184 -+     8-bit processors.
113.5185 -+   CMPtype: Specify the type that floating point compares should return.
113.5186 -+     This defaults to SItype, aka int.
113.5187 -+   US_SOFTWARE_GOFAST: This makes all entry points use the same names as the
113.5188 -+     US Software goFast library.
113.5189 -+   _DEBUG_BITFLOAT: This makes debugging the code a little easier, by adding
113.5190 -+     two integers to the FLO_union_type.
113.5191 -+   NO_DENORMALS: Disable handling of denormals.
113.5192 -+   NO_NANS: Disable nan and infinity handling
113.5193 -+   SMALL_MACHINE: Useful when operations on QIs and HIs are faster
113.5194 -+     than on an SI */
113.5195 -+
113.5196 -+/* We don't currently support extended floats (long doubles) on machines
113.5197 -+   without hardware to deal with them.
113.5198 -+
113.5199 -+   These stubs are just to keep the linker from complaining about unresolved
113.5200 -+   references which can be pulled in from libio & libstdc++, even if the
113.5201 -+   user isn't using long doubles.  However, they may generate an unresolved
113.5202 -+   external to abort if abort is not used by the function, and the stubs
113.5203 -+   are referenced from within libc, since libgcc goes before and after the
113.5204 -+   system library.  */
113.5205 -+
113.5206 -+#ifdef DECLARE_LIBRARY_RENAMES
113.5207 -+  DECLARE_LIBRARY_RENAMES
113.5208 -+#endif
113.5209 -+
113.5210 -+#ifdef EXTENDED_FLOAT_STUBS
113.5211 -+extern void abort (void);
113.5212 -+void __extendsfxf2 (void) { abort(); }
113.5213 -+void __extenddfxf2 (void) { abort(); }
113.5214 -+void __truncxfdf2 (void) { abort(); }
113.5215 -+void __truncxfsf2 (void) { abort(); }
113.5216 -+void __fixxfsi (void) { abort(); }
113.5217 -+void __floatsixf (void) { abort(); }
113.5218 -+void __addxf3 (void) { abort(); }
113.5219 -+void __subxf3 (void) { abort(); }
113.5220 -+void __mulxf3 (void) { abort(); }
113.5221 -+void __divxf3 (void) { abort(); }
113.5222 -+void __negxf2 (void) { abort(); }
113.5223 -+void __eqxf2 (void) { abort(); }
113.5224 -+void __nexf2 (void) { abort(); }
113.5225 -+void __gtxf2 (void) { abort(); }
113.5226 -+void __gexf2 (void) { abort(); }
113.5227 -+void __lexf2 (void) { abort(); }
113.5228 -+void __ltxf2 (void) { abort(); }
113.5229 -+
113.5230 -+void __extendsftf2 (void) { abort(); }
113.5231 -+void __extenddftf2 (void) { abort(); }
113.5232 -+void __trunctfdf2 (void) { abort(); }
113.5233 -+void __trunctfsf2 (void) { abort(); }
113.5234 -+void __fixtfsi (void) { abort(); }
113.5235 -+void __floatsitf (void) { abort(); }
113.5236 -+void __addtf3 (void) { abort(); }
113.5237 -+void __subtf3 (void) { abort(); }
113.5238 -+void __multf3 (void) { abort(); }
113.5239 -+void __divtf3 (void) { abort(); }
113.5240 -+void __negtf2 (void) { abort(); }
113.5241 -+void __eqtf2 (void) { abort(); }
113.5242 -+void __netf2 (void) { abort(); }
113.5243 -+void __gttf2 (void) { abort(); }
113.5244 -+void __getf2 (void) { abort(); }
113.5245 -+void __letf2 (void) { abort(); }
113.5246 -+void __lttf2 (void) { abort(); }
113.5247 -+#else	/* !EXTENDED_FLOAT_STUBS, rest of file */
113.5248 -+
113.5249 -+/* IEEE "special" number predicates */
113.5250 -+
113.5251 -+#ifdef NO_NANS
113.5252 -+
113.5253 -+#define nan() 0
113.5254 -+#define isnan(x) 0
113.5255 -+#define isinf(x) 0
113.5256 -+#else
113.5257 -+
113.5258 -+#if   defined L_thenan_sf
113.5259 -+const fp_number_type __thenan_sf = { CLASS_SNAN, 0, 0, {(fractype) 0} };
113.5260 -+#elif defined L_thenan_df
113.5261 -+const fp_number_type __thenan_df = { CLASS_SNAN, 0, 0, {(fractype) 0} };
113.5262 -+#elif defined L_thenan_tf
113.5263 -+const fp_number_type __thenan_tf = { CLASS_SNAN, 0, 0, {(fractype) 0} };
113.5264 -+#elif defined TFLOAT
113.5265 -+extern const fp_number_type __thenan_tf;
113.5266 -+#elif defined FLOAT
113.5267 -+extern const fp_number_type __thenan_sf;
113.5268 -+#else
113.5269 -+extern const fp_number_type __thenan_df;
113.5270 -+#endif
113.5271 -+
113.5272 -+INLINE
113.5273 -+static fp_number_type *
113.5274 -+nan (void)
113.5275 -+{
113.5276 -+  /* Discard the const qualifier...  */
113.5277 -+#ifdef TFLOAT
113.5278 -+  return (fp_number_type *) (& __thenan_tf);
113.5279 -+#elif defined FLOAT  
113.5280 -+  return (fp_number_type *) (& __thenan_sf);
113.5281 -+#else
113.5282 -+  return (fp_number_type *) (& __thenan_df);
113.5283 -+#endif
113.5284 -+}
113.5285 -+
113.5286 -+INLINE
113.5287 -+static int
113.5288 -+isnan ( fp_number_type *  x)
113.5289 -+{
113.5290 -+  return x->class == CLASS_SNAN || x->class == CLASS_QNAN;
113.5291 -+}
113.5292 -+
113.5293 -+INLINE
113.5294 -+static int
113.5295 -+isinf ( fp_number_type *  x)
113.5296 -+{
113.5297 -+  return x->class == CLASS_INFINITY;
113.5298 -+}
113.5299 -+
113.5300 -+#endif /* NO_NANS */
113.5301 -+
113.5302 -+INLINE
113.5303 -+static int
113.5304 -+iszero ( fp_number_type *  x)
113.5305 -+{
113.5306 -+  return x->class == CLASS_ZERO;
113.5307 -+}
113.5308 -+
113.5309 -+INLINE 
113.5310 -+static void
113.5311 -+flip_sign ( fp_number_type *  x)
113.5312 -+{
113.5313 -+  x->sign = !x->sign;
113.5314 -+}
113.5315 -+
113.5316 -+extern FLO_type pack_d ( fp_number_type * );
113.5317 -+
113.5318 -+#if defined(L_pack_df) || defined(L_pack_sf) || defined(L_pack_tf)
113.5319 -+FLO_type
113.5320 -+pack_d ( fp_number_type *  src)
113.5321 -+{
113.5322 -+  FLO_union_type dst;
113.5323 -+  fractype fraction = src->fraction.ll;	/* wasn't unsigned before? */
113.5324 -+  int sign = src->sign;
113.5325 -+  int exp = 0;
113.5326 -+
113.5327 -+  if (LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && (isnan (src) || isinf (src)))
113.5328 -+    {
113.5329 -+      /* We can't represent these values accurately.  By using the
113.5330 -+	 largest possible magnitude, we guarantee that the conversion
113.5331 -+	 of infinity is at least as big as any finite number.  */
113.5332 -+      exp = EXPMAX;
113.5333 -+      fraction = ((fractype) 1 << FRACBITS) - 1;
113.5334 -+    }
113.5335 -+  else if (isnan (src))
113.5336 -+    {
113.5337 -+      exp = EXPMAX;
113.5338 -+      if (src->class == CLASS_QNAN || 1)
113.5339 -+	{
113.5340 -+#ifdef QUIET_NAN_NEGATED
113.5341 -+	  fraction |= QUIET_NAN - 1;
113.5342 -+#else
113.5343 -+	  fraction |= QUIET_NAN;
113.5344 -+#endif
113.5345 -+	}
113.5346 -+    }
113.5347 -+  else if (isinf (src))
113.5348 -+    {
113.5349 -+      exp = EXPMAX;
113.5350 -+      fraction = 0;
113.5351 -+    }
113.5352 -+  else if (iszero (src))
113.5353 -+    {
113.5354 -+      exp = 0;
113.5355 -+      fraction = 0;
113.5356 -+    }
113.5357 -+  else if (fraction == 0)
113.5358 -+    {
113.5359 -+      exp = 0;
113.5360 -+    }
113.5361 -+  else
113.5362 -+    {
113.5363 -+      if (src->normal_exp < NORMAL_EXPMIN)
113.5364 -+	{
113.5365 -+#ifdef NO_DENORMALS
113.5366 -+	  /* Go straight to a zero representation if denormals are not
113.5367 -+ 	     supported.  The denormal handling would be harmless but
113.5368 -+ 	     isn't unnecessary.  */
113.5369 -+	  exp = 0;
113.5370 -+	  fraction = 0;
113.5371 -+#else /* NO_DENORMALS */
113.5372 -+	  /* This number's exponent is too low to fit into the bits
113.5373 -+	     available in the number, so we'll store 0 in the exponent and
113.5374 -+	     shift the fraction to the right to make up for it.  */
113.5375 -+
113.5376 -+	  int shift = NORMAL_EXPMIN - src->normal_exp;
113.5377 -+
113.5378 -+	  exp = 0;
113.5379 -+
113.5380 -+	  if (shift > FRAC_NBITS - NGARDS)
113.5381 -+	    {
113.5382 -+	      /* No point shifting, since it's more that 64 out.  */
113.5383 -+	      fraction = 0;
113.5384 -+	    }
113.5385 -+	  else
113.5386 -+	    {
113.5387 -+	      int lowbit = (fraction & (((fractype)1 << shift) - 1)) ? 1 : 0;
113.5388 -+	      fraction = (fraction >> shift) | lowbit;
113.5389 -+	    }
113.5390 -+	  if ((fraction & GARDMASK) == GARDMSB)
113.5391 -+	    {
113.5392 -+	      if ((fraction & (1 << NGARDS)))
113.5393 -+		fraction += GARDROUND + 1;
113.5394 -+	    }
113.5395 -+	  else
113.5396 -+	    {
113.5397 -+	      /* Add to the guards to round up.  */
113.5398 -+	      fraction += GARDROUND;
113.5399 -+	    }
113.5400 -+	  /* Perhaps the rounding means we now need to change the
113.5401 -+             exponent, because the fraction is no longer denormal.  */
113.5402 -+	  if (fraction >= IMPLICIT_1)
113.5403 -+	    {
113.5404 -+	      exp += 1;
113.5405 -+	    }
113.5406 -+	  fraction >>= NGARDS;
113.5407 -+#endif /* NO_DENORMALS */
113.5408 -+	}
113.5409 -+      else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS)
113.5410 -+	       && src->normal_exp > EXPBIAS)
113.5411 -+	{
113.5412 -+	  exp = EXPMAX;
113.5413 -+	  fraction = 0;
113.5414 -+	}
113.5415 -+      else
113.5416 -+	{
113.5417 -+	  exp = src->normal_exp + EXPBIAS;
113.5418 -+	  if (!ROUND_TOWARDS_ZERO)
113.5419 -+	    {
113.5420 -+	      /* IF the gard bits are the all zero, but the first, then we're
113.5421 -+		 half way between two numbers, choose the one which makes the
113.5422 -+		 lsb of the answer 0.  */
113.5423 -+	      if ((fraction & GARDMASK) == GARDMSB)
113.5424 -+		{
113.5425 -+		  if (fraction & (1 << NGARDS))
113.5426 -+		    fraction += GARDROUND + 1;
113.5427 -+		}
113.5428 -+	      else
113.5429 -+		{
113.5430 -+		  /* Add a one to the guards to round up */
113.5431 -+		  fraction += GARDROUND;
113.5432 -+		}
113.5433 -+	      if (fraction >= IMPLICIT_2)
113.5434 -+		{
113.5435 -+		  fraction >>= 1;
113.5436 -+		  exp += 1;
113.5437 -+		}
113.5438 -+	    }
113.5439 -+	  fraction >>= NGARDS;
113.5440 -+
113.5441 -+	  if (LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && exp > EXPMAX)
113.5442 -+	    {
113.5443 -+	      /* Saturate on overflow.  */
113.5444 -+	      exp = EXPMAX;
113.5445 -+	      fraction = ((fractype) 1 << FRACBITS) - 1;
113.5446 -+	    }
113.5447 -+	}
113.5448 -+    }
113.5449 -+
113.5450 -+  /* We previously used bitfields to store the number, but this doesn't
113.5451 -+     handle little/big endian systems conveniently, so use shifts and
113.5452 -+     masks */
113.5453 -+#ifdef FLOAT_BIT_ORDER_MISMATCH
113.5454 -+  dst.bits.fraction = fraction;
113.5455 -+  dst.bits.exp = exp;
113.5456 -+  dst.bits.sign = sign;
113.5457 -+#else
113.5458 -+# if defined TFLOAT && defined HALFFRACBITS
113.5459 -+ {
113.5460 -+   halffractype high, low, unity;
113.5461 -+   int lowsign, lowexp;
113.5462 -+
113.5463 -+   unity = (halffractype) 1 << HALFFRACBITS;
113.5464 -+
113.5465 -+   /* Set HIGH to the high double's significand, masking out the implicit 1.
113.5466 -+      Set LOW to the low double's full significand.  */
113.5467 -+   high = (fraction >> (FRACBITS - HALFFRACBITS)) & (unity - 1);
113.5468 -+   low = fraction & (unity * 2 - 1);
113.5469 -+
113.5470 -+   /* Get the initial sign and exponent of the low double.  */
113.5471 -+   lowexp = exp - HALFFRACBITS - 1;
113.5472 -+   lowsign = sign;
113.5473 -+
113.5474 -+   /* HIGH should be rounded like a normal double, making |LOW| <=
113.5475 -+      0.5 ULP of HIGH.  Assume round-to-nearest.  */
113.5476 -+   if (exp < EXPMAX)
113.5477 -+     if (low > unity || (low == unity && (high & 1) == 1))
113.5478 -+       {
113.5479 -+	 /* Round HIGH up and adjust LOW to match.  */
113.5480 -+	 high++;
113.5481 -+	 if (high == unity)
113.5482 -+	   {
113.5483 -+	     /* May make it infinite, but that's OK.  */
113.5484 -+	     high = 0;
113.5485 -+	     exp++;
113.5486 -+	   }
113.5487 -+	 low = unity * 2 - low;
113.5488 -+	 lowsign ^= 1;
113.5489 -+       }
113.5490 -+
113.5491 -+   high |= (halffractype) exp << HALFFRACBITS;
113.5492 -+   high |= (halffractype) sign << (HALFFRACBITS + EXPBITS);
113.5493 -+
113.5494 -+   if (exp == EXPMAX || exp == 0 || low == 0)
113.5495 -+     low = 0;
113.5496 -+   else
113.5497 -+     {
113.5498 -+       while (lowexp > 0 && low < unity)
113.5499 -+	 {
113.5500 -+	   low <<= 1;
113.5501 -+	   lowexp--;
113.5502 -+	 }
113.5503 -+
113.5504 -+       if (lowexp <= 0)
113.5505 -+	 {
113.5506 -+	   halffractype roundmsb, round;
113.5507 -+	   int shift;
113.5508 -+
113.5509 -+	   shift = 1 - lowexp;
113.5510 -+	   roundmsb = (1 << (shift - 1));
113.5511 -+	   round = low & ((roundmsb << 1) - 1);
113.5512 -+
113.5513 -+	   low >>= shift;
113.5514 -+	   lowexp = 0;
113.5515 -+
113.5516 -+	   if (round > roundmsb || (round == roundmsb && (low & 1) == 1))
113.5517 -+	     {
113.5518 -+	       low++;
113.5519 -+	       if (low == unity)
113.5520 -+		 /* LOW rounds up to the smallest normal number.  */
113.5521 -+		 lowexp++;
113.5522 -+	     }
113.5523 -+	 }
113.5524 -+
113.5525 -+       low &= unity - 1;
113.5526 -+       low |= (halffractype) lowexp << HALFFRACBITS;
113.5527 -+       low |= (halffractype) lowsign << (HALFFRACBITS + EXPBITS);
113.5528 -+     }
113.5529 -+   dst.value_raw = ((fractype) high << HALFSHIFT) | low;
113.5530 -+ }
113.5531 -+# else
113.5532 -+  dst.value_raw = fraction & ((((fractype)1) << FRACBITS) - (fractype)1);
113.5533 -+  dst.value_raw |= ((fractype) (exp & ((1 << EXPBITS) - 1))) << FRACBITS;
113.5534 -+  dst.value_raw |= ((fractype) (sign & 1)) << (FRACBITS | EXPBITS);
113.5535 -+# endif
113.5536 -+#endif
113.5537 -+
113.5538 -+#if defined(FLOAT_WORD_ORDER_MISMATCH) && !defined(FLOAT)
113.5539 -+#ifdef TFLOAT
113.5540 -+  {
113.5541 -+    qrtrfractype tmp1 = dst.words[0];
113.5542 -+    qrtrfractype tmp2 = dst.words[1];
113.5543 -+    dst.words[0] = dst.words[3];
113.5544 -+    dst.words[1] = dst.words[2];
113.5545 -+    dst.words[2] = tmp2;
113.5546 -+    dst.words[3] = tmp1;
113.5547 -+  }
113.5548 -+#else
113.5549 -+  {
113.5550 -+    halffractype tmp = dst.words[0];
113.5551 -+    dst.words[0] = dst.words[1];
113.5552 -+    dst.words[1] = tmp;
113.5553 -+  }
113.5554 -+#endif
113.5555 -+#endif
113.5556 -+
113.5557 -+  return dst.value;
113.5558 -+}
113.5559 -+#endif
113.5560 -+
113.5561 -+#if defined(L_unpack_df) || defined(L_unpack_sf) || defined(L_unpack_tf)
113.5562 -+void
113.5563 -+unpack_d (FLO_union_type * src, fp_number_type * dst)
113.5564 -+{
113.5565 -+  /* We previously used bitfields to store the number, but this doesn't
113.5566 -+     handle little/big endian systems conveniently, so use shifts and
113.5567 -+     masks */
113.5568 -+  fractype fraction;
113.5569 -+  int exp;
113.5570 -+  int sign;
113.5571 -+
113.5572 -+#if defined(FLOAT_WORD_ORDER_MISMATCH) && !defined(FLOAT)
113.5573 -+  FLO_union_type swapped;
113.5574 -+
113.5575 -+#ifdef TFLOAT
113.5576 -+  swapped.words[0] = src->words[3];
113.5577 -+  swapped.words[1] = src->words[2];
113.5578 -+  swapped.words[2] = src->words[1];
113.5579 -+  swapped.words[3] = src->words[0];
113.5580 -+#else
113.5581 -+  swapped.words[0] = src->words[1];
113.5582 -+  swapped.words[1] = src->words[0];
113.5583 -+#endif
113.5584 -+  src = &swapped;
113.5585 -+#endif
113.5586 -+  
113.5587 -+#ifdef FLOAT_BIT_ORDER_MISMATCH
113.5588 -+  fraction = src->bits.fraction;
113.5589 -+  exp = src->bits.exp;
113.5590 -+  sign = src->bits.sign;
113.5591 -+#else
113.5592 -+# if defined TFLOAT && defined HALFFRACBITS
113.5593 -+ {
113.5594 -+   halffractype high, low;
113.5595 -+   
113.5596 -+   high = src->value_raw >> HALFSHIFT;
113.5597 -+   low = src->value_raw & (((fractype)1 << HALFSHIFT) - 1);
113.5598 -+
113.5599 -+   fraction = high & ((((fractype)1) << HALFFRACBITS) - 1);
113.5600 -+   fraction <<= FRACBITS - HALFFRACBITS;
113.5601 -+   exp = ((int)(high >> HALFFRACBITS)) & ((1 << EXPBITS) - 1);
113.5602 -+   sign = ((int)(high >> (((HALFFRACBITS + EXPBITS))))) & 1;
113.5603 -+
113.5604 -+   if (exp != EXPMAX && exp != 0 && low != 0)
113.5605 -+     {
113.5606 -+       int lowexp = ((int)(low >> HALFFRACBITS)) & ((1 << EXPBITS) - 1);
113.5607 -+       int lowsign = ((int)(low >> (((HALFFRACBITS + EXPBITS))))) & 1;
113.5608 -+       int shift;
113.5609 -+       fractype xlow;
113.5610 -+
113.5611 -+       xlow = low & ((((fractype)1) << HALFFRACBITS) - 1);
113.5612 -+       if (lowexp)
113.5613 -+	 xlow |= (((halffractype)1) << HALFFRACBITS);
113.5614 -+       else
113.5615 -+	 lowexp = 1;
113.5616 -+       shift = (FRACBITS - HALFFRACBITS) - (exp - lowexp);
113.5617 -+       if (shift > 0)
113.5618 -+	 xlow <<= shift;
113.5619 -+       else if (shift < 0)
113.5620 -+	 xlow >>= -shift;
113.5621 -+       if (sign == lowsign)
113.5622 -+	 fraction += xlow;
113.5623 -+       else if (fraction >= xlow)
113.5624 -+	 fraction -= xlow;
113.5625 -+       else
113.5626 -+	 {
113.5627 -+	   /* The high part is a power of two but the full number is lower.
113.5628 -+	      This code will leave the implicit 1 in FRACTION, but we'd
113.5629 -+	      have added that below anyway.  */
113.5630 -+	   fraction = (((fractype) 1 << FRACBITS) - xlow) << 1;
113.5631 -+	   exp--;
113.5632 -+	 }
113.5633 -+     }
113.5634 -+ }
113.5635 -+# else
113.5636 -+  fraction = src->value_raw & ((((fractype)1) << FRACBITS) - 1);
113.5637 -+  exp = ((int)(src->value_raw >> FRACBITS)) & ((1 << EXPBITS) - 1);
113.5638 -+  sign = ((int)(src->value_raw >> (FRACBITS + EXPBITS))) & 1;
113.5639 -+# endif
113.5640 -+#endif
113.5641 -+
113.5642 -+  dst->sign = sign;
113.5643 -+  if (exp == 0)
113.5644 -+    {
113.5645 -+      /* Hmm.  Looks like 0 */
113.5646 -+      if (fraction == 0
113.5647 -+#ifdef NO_DENORMALS
113.5648 -+	  || 1
113.5649 -+#endif
113.5650 -+	  )
113.5651 -+	{
113.5652 -+	  /* tastes like zero */
113.5653 -+	  dst->class = CLASS_ZERO;
113.5654 -+	}
113.5655 -+      else
113.5656 -+	{
113.5657 -+	  /* Zero exponent with nonzero fraction - it's denormalized,
113.5658 -+	     so there isn't a leading implicit one - we'll shift it so
113.5659 -+	     it gets one.  */
113.5660 -+	  dst->normal_exp = exp - EXPBIAS + 1;
113.5661 -+	  fraction <<= NGARDS;
113.5662 -+
113.5663 -+	  dst->class = CLASS_NUMBER;
113.5664 -+#if 1
113.5665 -+	  while (fraction < IMPLICIT_1)
113.5666 -+	    {
113.5667 -+	      fraction <<= 1;
113.5668 -+	      dst->normal_exp--;
113.5669 -+	    }
113.5670 -+#endif
113.5671 -+	  dst->fraction.ll = fraction;
113.5672 -+	}
113.5673 -+    }
113.5674 -+  else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && exp == EXPMAX)
113.5675 -+    {
113.5676 -+      /* Huge exponent*/
113.5677 -+      if (fraction == 0)
113.5678 -+	{
113.5679 -+	  /* Attached to a zero fraction - means infinity */
113.5680 -+	  dst->class = CLASS_INFINITY;
113.5681 -+	}
113.5682 -+      else
113.5683 -+	{
113.5684 -+	  /* Nonzero fraction, means nan */
113.5685 -+#ifdef QUIET_NAN_NEGATED
113.5686 -+	  if ((fraction & QUIET_NAN) == 0)
113.5687 -+#else
113.5688 -+	  if (fraction & QUIET_NAN)
113.5689 -+#endif
113.5690 -+	    {
113.5691 -+	      dst->class = CLASS_QNAN;
113.5692 -+	    }
113.5693 -+	  else
113.5694 -+	    {
113.5695 -+	      dst->class = CLASS_SNAN;
113.5696 -+	    }
113.5697 -+	  /* Keep the fraction part as the nan number */
113.5698 -+	  dst->fraction.ll = fraction;
113.5699 -+	}
113.5700 -+    }
113.5701 -+  else
113.5702 -+    {
113.5703 -+      /* Nothing strange about this number */
113.5704 -+      dst->normal_exp = exp - EXPBIAS;
113.5705 -+      dst->class = CLASS_NUMBER;
113.5706 -+      dst->fraction.ll = (fraction << NGARDS) | IMPLICIT_1;
113.5707 -+    }
113.5708 -+}
113.5709 -+#endif /* L_unpack_df || L_unpack_sf */
113.5710 -+
113.5711 -+#if defined(L_addsub_sf) || defined(L_addsub_df) || defined(L_addsub_tf)
113.5712 -+static fp_number_type *
113.5713 -+_fpadd_parts (fp_number_type * a,
113.5714 -+	      fp_number_type * b,
113.5715 -+	      fp_number_type * tmp)
113.5716 -+{
113.5717 -+  intfrac tfraction;
113.5718 -+
113.5719 -+  /* Put commonly used fields in local variables.  */
113.5720 -+  int a_normal_exp;
113.5721 -+  int b_normal_exp;
113.5722 -+  fractype a_fraction;
113.5723 -+  fractype b_fraction;
113.5724 -+
113.5725 -+  if (isnan (a))
113.5726 -+    {
113.5727 -+      return a;
113.5728 -+    }
113.5729 -+  if (isnan (b))
113.5730 -+    {
113.5731 -+      return b;
113.5732 -+    }
113.5733 -+  if (isinf (a))
113.5734 -+    {
113.5735 -+      /* Adding infinities with opposite signs yields a NaN.  */
113.5736 -+      if (isinf (b) && a->sign != b->sign)
113.5737 -+	return nan ();
113.5738 -+      return a;
113.5739 -+    }
113.5740 -+  if (isinf (b))
113.5741 -+    {
113.5742 -+      return b;
113.5743 -+    }
113.5744 -+  if (iszero (b))
113.5745 -+    {
113.5746 -+      if (iszero (a))
113.5747 -+	{
113.5748 -+	  *tmp = *a;
113.5749 -+	  tmp->sign = a->sign & b->sign;
113.5750 -+	  return tmp;
113.5751 -+	}
113.5752 -+      return a;
113.5753 -+    }
113.5754 -+  if (iszero (a))
113.5755 -+    {
113.5756 -+      return b;
113.5757 -+    }
113.5758 -+
113.5759 -+  /* Got two numbers. shift the smaller and increment the exponent till
113.5760 -+     they're the same */
113.5761 -+  {
113.5762 -+    int diff;
113.5763 -+
113.5764 -+    a_normal_exp = a->normal_exp;
113.5765 -+    b_normal_exp = b->normal_exp;
113.5766 -+    a_fraction = a->fraction.ll;
113.5767 -+    b_fraction = b->fraction.ll;
113.5768 -+
113.5769 -+    diff = a_normal_exp - b_normal_exp;
113.5770 -+
113.5771 -+    if (diff < 0)
113.5772 -+      diff = -diff;
113.5773 -+    if (diff < FRAC_NBITS)
113.5774 -+      {
113.5775 -+	/* ??? This does shifts one bit at a time.  Optimize.  */
113.5776 -+	while (a_normal_exp > b_normal_exp)
113.5777 -+	  {
113.5778 -+	    b_normal_exp++;
113.5779 -+	    LSHIFT (b_fraction);
113.5780 -+	  }
113.5781 -+	while (b_normal_exp > a_normal_exp)
113.5782 -+	  {
113.5783 -+	    a_normal_exp++;
113.5784 -+	    LSHIFT (a_fraction);
113.5785 -+	  }
113.5786 -+      }
113.5787 -+    else
113.5788 -+      {
113.5789 -+	/* Somethings's up.. choose the biggest */
113.5790 -+	if (a_normal_exp > b_normal_exp)
113.5791 -+	  {
113.5792 -+	    b_normal_exp = a_normal_exp;
113.5793 -+	    b_fraction = 0;
113.5794 -+	  }
113.5795 -+	else
113.5796 -+	  {
113.5797 -+	    a_normal_exp = b_normal_exp;
113.5798 -+	    a_fraction = 0;
113.5799 -+	  }
113.5800 -+      }
113.5801 -+  }
113.5802 -+
113.5803 -+  if (a->sign != b->sign)
113.5804 -+    {
113.5805 -+      if (a->sign)
113.5806 -+	{
113.5807 -+	  tfraction = -a_fraction + b_fraction;
113.5808 -+	}
113.5809 -+      else
113.5810 -+	{
113.5811 -+	  tfraction = a_fraction - b_fraction;
113.5812 -+	}
113.5813 -+      if (tfraction >= 0)
113.5814 -+	{
113.5815 -+	  tmp->sign = 0;
113.5816 -+	  tmp->normal_exp = a_normal_exp;
113.5817 -+	  tmp->fraction.ll = tfraction;
113.5818 -+	}
113.5819 -+      else
113.5820 -+	{
113.5821 -+	  tmp->sign = 1;
113.5822 -+	  tmp->normal_exp = a_normal_exp;
113.5823 -+	  tmp->fraction.ll = -tfraction;
113.5824 -+	}
113.5825 -+      /* and renormalize it */
113.5826 -+
113.5827 -+      while (tmp->fraction.ll < IMPLICIT_1 && tmp->fraction.ll)
113.5828 -+	{
113.5829 -+	  tmp->fraction.ll <<= 1;
113.5830 -+	  tmp->normal_exp--;
113.5831 -+	}
113.5832 -+    }
113.5833 -+  else
113.5834 -+    {
113.5835 -+      tmp->sign = a->sign;
113.5836 -+      tmp->normal_exp = a_normal_exp;
113.5837 -+      tmp->fraction.ll = a_fraction + b_fraction;
113.5838 -+    }
113.5839 -+  tmp->class = CLASS_NUMBER;
113.5840 -+  /* Now the fraction is added, we have to shift down to renormalize the
113.5841 -+     number */
113.5842 -+
113.5843 -+  if (tmp->fraction.ll >= IMPLICIT_2)
113.5844 -+    {
113.5845 -+      LSHIFT (tmp->fraction.ll);
113.5846 -+      tmp->normal_exp++;
113.5847 -+    }
113.5848 -+  return tmp;
113.5849 -+
113.5850 -+}
113.5851 -+
113.5852 -+FLO_type
113.5853 -+add (FLO_type arg_a, FLO_type arg_b)
113.5854 -+{
113.5855 -+  fp_number_type a;
113.5856 -+  fp_number_type b;
113.5857 -+  fp_number_type tmp;
113.5858 -+  fp_number_type *res;
113.5859 -+  FLO_union_type au, bu;
113.5860 -+
113.5861 -+  au.value = arg_a;
113.5862 -+  bu.value = arg_b;
113.5863 -+
113.5864 -+  unpack_d (&au, &a);
113.5865 -+  unpack_d (&bu, &b);
113.5866 -+
113.5867 -+  res = _fpadd_parts (&a, &b, &tmp);
113.5868 -+
113.5869 -+  return pack_d (res);
113.5870 -+}
113.5871 -+
113.5872 -+FLO_type
113.5873 -+sub (FLO_type arg_a, FLO_type arg_b)
113.5874 -+{
113.5875 -+  fp_number_type a;
113.5876 -+  fp_number_type b;
113.5877 -+  fp_number_type tmp;
113.5878 -+  fp_number_type *res;
113.5879 -+  FLO_union_type au, bu;
113.5880 -+
113.5881 -+  au.value = arg_a;
113.5882 -+  bu.value = arg_b;
113.5883 -+
113.5884 -+  unpack_d (&au, &a);
113.5885 -+  unpack_d (&bu, &b);
113.5886 -+
113.5887 -+  b.sign ^= 1;
113.5888 -+
113.5889 -+  res = _fpadd_parts (&a, &b, &tmp);
113.5890 -+
113.5891 -+  return pack_d (res);
113.5892 -+}
113.5893 -+#endif /* L_addsub_sf || L_addsub_df */
113.5894 -+
113.5895 -+#if defined(L_mul_sf) || defined(L_mul_df) || defined(L_mul_tf)
113.5896 -+static inline __attribute__ ((__always_inline__)) fp_number_type *
113.5897 -+_fpmul_parts ( fp_number_type *  a,
113.5898 -+	       fp_number_type *  b,
113.5899 -+	       fp_number_type * tmp)
113.5900 -+{
113.5901 -+  fractype low = 0;
113.5902 -+  fractype high = 0;
113.5903 -+
113.5904 -+  if (isnan (a))
113.5905 -+    {
113.5906 -+      a->sign = a->sign != b->sign;
113.5907 -+      return a;
113.5908 -+    }
113.5909 -+  if (isnan (b))
113.5910 -+    {
113.5911 -+      b->sign = a->sign != b->sign;
113.5912 -+      return b;
113.5913 -+    }
113.5914 -+  if (isinf (a))
113.5915 -+    {
113.5916 -+      if (iszero (b))
113.5917 -+	return nan ();
113.5918 -+      a->sign = a->sign != b->sign;
113.5919 -+      return a;
113.5920 -+    }
113.5921 -+  if (isinf (b))
113.5922 -+    {
113.5923 -+      if (iszero (a))
113.5924 -+	{
113.5925 -+	  return nan ();
113.5926 -+	}
113.5927 -+      b->sign = a->sign != b->sign;
113.5928 -+      return b;
113.5929 -+    }
113.5930 -+  if (iszero (a))
113.5931 -+    {
113.5932 -+      a->sign = a->sign != b->sign;
113.5933 -+      return a;
113.5934 -+    }
113.5935 -+  if (iszero (b))
113.5936 -+    {
113.5937 -+      b->sign = a->sign != b->sign;
113.5938 -+      return b;
113.5939 -+    }
113.5940 -+
113.5941 -+  /* Calculate the mantissa by multiplying both numbers to get a
113.5942 -+     twice-as-wide number.  */
113.5943 -+  {
113.5944 -+#if defined(NO_DI_MODE) || defined(TFLOAT)
113.5945 -+    {
113.5946 -+      fractype x = a->fraction.ll;
113.5947 -+      fractype ylow = b->fraction.ll;
113.5948 -+      fractype yhigh = 0;
113.5949 -+      int bit;
113.5950 -+
113.5951 -+      /* ??? This does multiplies one bit at a time.  Optimize.  */
113.5952 -+      for (bit = 0; bit < FRAC_NBITS; bit++)
113.5953 -+	{
113.5954 -+	  int carry;
113.5955 -+
113.5956 -+	  if (x & 1)
113.5957 -+	    {
113.5958 -+	      carry = (low += ylow) < ylow;
113.5959 -+	      high += yhigh + carry;
113.5960 -+	    }
113.5961 -+	  yhigh <<= 1;
113.5962 -+	  if (ylow & FRACHIGH)
113.5963 -+	    {
113.5964 -+	      yhigh |= 1;
113.5965 -+	    }
113.5966 -+	  ylow <<= 1;
113.5967 -+	  x >>= 1;
113.5968 -+	}
113.5969 -+    }
113.5970 -+#elif defined(FLOAT) 
113.5971 -+    /* Multiplying two USIs to get a UDI, we're safe.  */
113.5972 -+    {
113.5973 -+      UDItype answer = (UDItype)a->fraction.ll * (UDItype)b->fraction.ll;
113.5974 -+      
113.5975 -+      high = answer >> BITS_PER_SI;
113.5976 -+      low = answer;
113.5977 -+    }
113.5978 -+#else
113.5979 -+    /* fractype is DImode, but we need the result to be twice as wide.
113.5980 -+       Assuming a widening multiply from DImode to TImode is not
113.5981 -+       available, build one by hand.  */
113.5982 -+    {
113.5983 -+      USItype nl = a->fraction.ll;
113.5984 -+      USItype nh = a->fraction.ll >> BITS_PER_SI;
113.5985 -+      USItype ml = b->fraction.ll;
113.5986 -+      USItype mh = b->fraction.ll >> BITS_PER_SI;
113.5987 -+      UDItype pp_ll = (UDItype) ml * nl;
113.5988 -+      UDItype pp_hl = (UDItype) mh * nl;
113.5989 -+      UDItype pp_lh = (UDItype) ml * nh;
113.5990 -+      UDItype pp_hh = (UDItype) mh * nh;
113.5991 -+      UDItype res2 = 0;
113.5992 -+      UDItype res0 = 0;
113.5993 -+      UDItype ps_hh__ = pp_hl + pp_lh;
113.5994 -+      if (ps_hh__ < pp_hl)
113.5995 -+	res2 += (UDItype)1 << BITS_PER_SI;
113.5996 -+      pp_hl = (UDItype)(USItype)ps_hh__ << BITS_PER_SI;
113.5997 -+      res0 = pp_ll + pp_hl;
113.5998 -+      if (res0 < pp_ll)
113.5999 -+	res2++;
113.6000 -+      res2 += (ps_hh__ >> BITS_PER_SI) + pp_hh;
113.6001 -+      high = res2;
113.6002 -+      low = res0;
113.6003 -+    }
113.6004 -+#endif
113.6005 -+  }
113.6006 -+
113.6007 -+  tmp->normal_exp = a->normal_exp + b->normal_exp
113.6008 -+    + FRAC_NBITS - (FRACBITS + NGARDS);
113.6009 -+  tmp->sign = a->sign != b->sign;
113.6010 -+  while (high >= IMPLICIT_2)
113.6011 -+    {
113.6012 -+      tmp->normal_exp++;
113.6013 -+      if (high & 1)
113.6014 -+	{
113.6015 -+	  low >>= 1;
113.6016 -+	  low |= FRACHIGH;
113.6017 -+	}
113.6018 -+      high >>= 1;
113.6019 -+    }
113.6020 -+  while (high < IMPLICIT_1)
113.6021 -+    {
113.6022 -+      tmp->normal_exp--;
113.6023 -+
113.6024 -+      high <<= 1;
113.6025 -+      if (low & FRACHIGH)
113.6026 -+	high |= 1;
113.6027 -+      low <<= 1;
113.6028 -+    }
113.6029 -+  /* rounding is tricky. if we only round if it won't make us round later.  */
113.6030 -+#if 0
113.6031 -+  if (low & FRACHIGH2)
113.6032 -+    {
113.6033 -+      if (((high & GARDMASK) != GARDMSB)
113.6034 -+	  && (((high + 1) & GARDMASK) == GARDMSB))
113.6035 -+	{
113.6036 -+	  /* don't round, it gets done again later.  */
113.6037 -+	}
113.6038 -+      else
113.6039 -+	{
113.6040 -+	  high++;
113.6041 -+	}
113.6042 -+    }
113.6043 -+#endif
113.6044 -+  if (!ROUND_TOWARDS_ZERO && (high & GARDMASK) == GARDMSB)
113.6045 -+    {
113.6046 -+      if (high & (1 << NGARDS))
113.6047 -+	{
113.6048 -+	  /* half way, so round to even */
113.6049 -+	  high += GARDROUND + 1;
113.6050 -+	}
113.6051 -+      else if (low)
113.6052 -+	{
113.6053 -+	  /* but we really weren't half way */
113.6054 -+	  high += GARDROUND + 1;
113.6055 -+	}
113.6056 -+    }
113.6057 -+  tmp->fraction.ll = high;
113.6058 -+  tmp->class = CLASS_NUMBER;
113.6059 -+  return tmp;
113.6060 -+}
113.6061 -+
113.6062 -+FLO_type
113.6063 -+multiply (FLO_type arg_a, FLO_type arg_b)
113.6064 -+{
113.6065 -+  fp_number_type a;
113.6066 -+  fp_number_type b;
113.6067 -+  fp_number_type tmp;
113.6068 -+  fp_number_type *res;
113.6069 -+  FLO_union_type au, bu;
113.6070 -+
113.6071 -+  au.value = arg_a;
113.6072 -+  bu.value = arg_b;
113.6073 -+
113.6074 -+  unpack_d (&au, &a);
113.6075 -+  unpack_d (&bu, &b);
113.6076 -+
113.6077 -+  res = _fpmul_parts (&a, &b, &tmp);
113.6078 -+
113.6079 -+  return pack_d (res);
113.6080 -+}
113.6081 -+#endif /* L_mul_sf || L_mul_df */
113.6082 -+
113.6083 -+#if defined(L_div_sf) || defined(L_div_df) || defined(L_div_tf)
113.6084 -+static inline __attribute__ ((__always_inline__)) fp_number_type *
113.6085 -+_fpdiv_parts (fp_number_type * a,
113.6086 -+	      fp_number_type * b)
113.6087 -+{
113.6088 -+  fractype bit;
113.6089 -+  fractype numerator;
113.6090 -+  fractype denominator;
113.6091 -+  fractype quotient;
113.6092 -+
113.6093 -+  if (isnan (a))
113.6094 -+    {
113.6095 -+      return a;
113.6096 -+    }
113.6097 -+  if (isnan (b))
113.6098 -+    {
113.6099 -+      return b;
113.6100 -+    }
113.6101 -+
113.6102 -+  a->sign = a->sign ^ b->sign;
113.6103 -+
113.6104 -+  if (isinf (a) || iszero (a))
113.6105 -+    {
113.6106 -+      if (a->class == b->class)
113.6107 -+	return nan ();
113.6108 -+      return a;
113.6109 -+    }
113.6110 -+
113.6111 -+  if (isinf (b))
113.6112 -+    {
113.6113 -+      a->fraction.ll = 0;
113.6114 -+      a->normal_exp = 0;
113.6115 -+      return a;
113.6116 -+    }
113.6117 -+  if (iszero (b))
113.6118 -+    {
113.6119 -+      a->class = CLASS_INFINITY;
113.6120 -+      return a;
113.6121 -+    }
113.6122 -+
113.6123 -+  /* Calculate the mantissa by multiplying both 64bit numbers to get a
113.6124 -+     128 bit number */
113.6125 -+  {
113.6126 -+    /* quotient =
113.6127 -+       ( numerator / denominator) * 2^(numerator exponent -  denominator exponent)
113.6128 -+     */
113.6129 -+
113.6130 -+    a->normal_exp = a->normal_exp - b->normal_exp;
113.6131 -+    numerator = a->fraction.ll;
113.6132 -+    denominator = b->fraction.ll;
113.6133 -+
113.6134 -+    if (numerator < denominator)
113.6135 -+      {
113.6136 -+	/* Fraction will be less than 1.0 */
113.6137 -+	numerator *= 2;
113.6138 -+	a->normal_exp--;
113.6139 -+      }
113.6140 -+    bit = IMPLICIT_1;
113.6141 -+    quotient = 0;
113.6142 -+    /* ??? Does divide one bit at a time.  Optimize.  */
113.6143 -+    while (bit)
113.6144 -+      {
113.6145 -+	if (numerator >= denominator)
113.6146 -+	  {
113.6147 -+	    quotient |= bit;
113.6148 -+	    numerator -= denominator;
113.6149 -+	  }
113.6150 -+	bit >>= 1;
113.6151 -+	numerator *= 2;
113.6152 -+      }
113.6153 -+
113.6154 -+    if (!ROUND_TOWARDS_ZERO && (quotient & GARDMASK) == GARDMSB)
113.6155 -+      {
113.6156 -+	if (quotient & (1 << NGARDS))
113.6157 -+	  {
113.6158 -+	    /* half way, so round to even */
113.6159 -+	    quotient += GARDROUND + 1;
113.6160 -+	  }
113.6161 -+	else if (numerator)
113.6162 -+	  {
113.6163 -+	    /* but we really weren't half way, more bits exist */
113.6164 -+	    quotient += GARDROUND + 1;
113.6165 -+	  }
113.6166 -+      }
113.6167 -+
113.6168 -+    a->fraction.ll = quotient;
113.6169 -+    return (a);
113.6170 -+  }
113.6171 -+}
113.6172 -+
113.6173 -+FLO_type
113.6174 -+divide (FLO_type arg_a, FLO_type arg_b)
113.6175 -+{
113.6176 -+  fp_number_type a;
113.6177 -+  fp_number_type b;
113.6178 -+  fp_number_type *res;
113.6179 -+  FLO_union_type au, bu;
113.6180 -+
113.6181 -+  au.value = arg_a;
113.6182 -+  bu.value = arg_b;
113.6183 -+
113.6184 -+  unpack_d (&au, &a);
113.6185 -+  unpack_d (&bu, &b);
113.6186 -+
113.6187 -+  res = _fpdiv_parts (&a, &b);
113.6188 -+
113.6189 -+  return pack_d (res);
113.6190 -+}
113.6191 -+#endif /* L_div_sf || L_div_df */
113.6192 -+
113.6193 -+#if defined(L_fpcmp_parts_sf) || defined(L_fpcmp_parts_df) \
113.6194 -+    || defined(L_fpcmp_parts_tf)
113.6195 -+/* according to the demo, fpcmp returns a comparison with 0... thus
113.6196 -+   a<b -> -1
113.6197 -+   a==b -> 0
113.6198 -+   a>b -> +1
113.6199 -+ */
113.6200 -+
113.6201 -+int
113.6202 -+__fpcmp_parts (fp_number_type * a, fp_number_type * b)
113.6203 -+{
113.6204 -+#if 0
113.6205 -+  /* either nan -> unordered. Must be checked outside of this routine.  */
113.6206 -+  if (isnan (a) && isnan (b))
113.6207 -+    {
113.6208 -+      return 1;			/* still unordered! */
113.6209 -+    }
113.6210 -+#endif
113.6211 -+
113.6212 -+  if (isnan (a) || isnan (b))
113.6213 -+    {
113.6214 -+      return 1;			/* how to indicate unordered compare? */
113.6215 -+    }
113.6216 -+  if (isinf (a) && isinf (b))
113.6217 -+    {
113.6218 -+      /* +inf > -inf, but +inf != +inf */
113.6219 -+      /* b    \a| +inf(0)| -inf(1)
113.6220 -+       ______\+--------+--------
113.6221 -+       +inf(0)| a==b(0)| a<b(-1)
113.6222 -+       -------+--------+--------
113.6223 -+       -inf(1)| a>b(1) | a==b(0)
113.6224 -+       -------+--------+--------
113.6225 -+       So since unordered must be nonzero, just line up the columns...
113.6226 -+       */
113.6227 -+      return b->sign - a->sign;
113.6228 -+    }
113.6229 -+  /* but not both...  */
113.6230 -+  if (isinf (a))
113.6231 -+    {
113.6232 -+      return a->sign ? -1 : 1;
113.6233 -+    }
113.6234 -+  if (isinf (b))
113.6235 -+    {
113.6236 -+      return b->sign ? 1 : -1;
113.6237 -+    }
113.6238 -+  if (iszero (a) && iszero (b))
113.6239 -+    {
113.6240 -+      return 0;
113.6241 -+    }
113.6242 -+  if (iszero (a))
113.6243 -+    {
113.6244 -+      return b->sign ? 1 : -1;
113.6245 -+    }
113.6246 -+  if (iszero (b))
113.6247 -+    {
113.6248 -+      return a->sign ? -1 : 1;
113.6249 -+    }
113.6250 -+  /* now both are "normal".  */
113.6251 -+  if (a->sign != b->sign)
113.6252 -+    {
113.6253 -+      /* opposite signs */
113.6254 -+      return a->sign ? -1 : 1;
113.6255 -+    }
113.6256 -+  /* same sign; exponents? */
113.6257 -+  if (a->normal_exp > b->normal_exp)
113.6258 -+    {
113.6259 -+      return a->sign ? -1 : 1;
113.6260 -+    }
113.6261 -+  if (a->normal_exp < b->normal_exp)
113.6262 -+    {
113.6263 -+      return a->sign ? 1 : -1;
113.6264 -+    }
113.6265 -+  /* same exponents; check size.  */
113.6266 -+  if (a->fraction.ll > b->fraction.ll)
113.6267 -+    {
113.6268 -+      return a->sign ? -1 : 1;
113.6269 -+    }
113.6270 -+  if (a->fraction.ll < b->fraction.ll)
113.6271 -+    {
113.6272 -+      return a->sign ? 1 : -1;
113.6273 -+    }
113.6274 -+  /* after all that, they're equal.  */
113.6275 -+  return 0;
113.6276 -+}
113.6277 -+#endif
113.6278 -+
113.6279 -+#if defined(L_compare_sf) || defined(L_compare_df) || defined(L_compoare_tf)
113.6280 -+CMPtype
113.6281 -+compare (FLO_type arg_a, FLO_type arg_b)
113.6282 -+{
113.6283 -+  fp_number_type a;
113.6284 -+  fp_number_type b;
113.6285 -+  FLO_union_type au, bu;
113.6286 -+
113.6287 -+  au.value = arg_a;
113.6288 -+  bu.value = arg_b;
113.6289 -+
113.6290 -+  unpack_d (&au, &a);
113.6291 -+  unpack_d (&bu, &b);
113.6292 -+
113.6293 -+  return __fpcmp_parts (&a, &b);
113.6294 -+}
113.6295 -+#endif /* L_compare_sf || L_compare_df */
113.6296 -+
113.6297 -+#ifndef US_SOFTWARE_GOFAST
113.6298 -+
113.6299 -+/* These should be optimized for their specific tasks someday.  */
113.6300 -+
113.6301 -+#if defined(L_eq_sf) || defined(L_eq_df) || defined(L_eq_tf)
113.6302 -+CMPtype
113.6303 -+_eq_f2 (FLO_type arg_a, FLO_type arg_b)
113.6304 -+{
113.6305 -+  fp_number_type a;
113.6306 -+  fp_number_type b;
113.6307 -+  FLO_union_type au, bu;
113.6308 -+
113.6309 -+  au.value = arg_a;
113.6310 -+  bu.value = arg_b;
113.6311 -+
113.6312 -+  unpack_d (&au, &a);
113.6313 -+  unpack_d (&bu, &b);
113.6314 -+
113.6315 -+  if (isnan (&a) || isnan (&b))
113.6316 -+    return 1;			/* false, truth == 0 */
113.6317 -+
113.6318 -+  return __fpcmp_parts (&a, &b) ;
113.6319 -+}
113.6320 -+#endif /* L_eq_sf || L_eq_df */
113.6321 -+
113.6322 -+#if defined(L_ne_sf) || defined(L_ne_df) || defined(L_ne_tf)
113.6323 -+CMPtype
113.6324 -+_ne_f2 (FLO_type arg_a, FLO_type arg_b)
113.6325 -+{
113.6326 -+  fp_number_type a;
113.6327 -+  fp_number_type b;
113.6328 -+  FLO_union_type au, bu;
113.6329 -+
113.6330 -+  au.value = arg_a;
113.6331 -+  bu.value = arg_b;
113.6332 -+
113.6333 -+  unpack_d (&au, &a);
113.6334 -+  unpack_d (&bu, &b);
113.6335 -+
113.6336 -+  if (isnan (&a) || isnan (&b))
113.6337 -+    return 1;			/* true, truth != 0 */
113.6338 -+
113.6339 -+  return  __fpcmp_parts (&a, &b) ;
113.6340 -+}
113.6341 -+#endif /* L_ne_sf || L_ne_df */
113.6342 -+
113.6343 -+#if defined(L_gt_sf) || defined(L_gt_df) || defined(L_gt_tf)
113.6344 -+CMPtype
113.6345 -+_gt_f2 (FLO_type arg_a, FLO_type arg_b)
113.6346 -+{
113.6347 -+  fp_number_type a;
113.6348 -+  fp_number_type b;
113.6349 -+  FLO_union_type au, bu;
113.6350 -+
113.6351 -+  au.value = arg_a;
113.6352 -+  bu.value = arg_b;
113.6353 -+
113.6354 -+  unpack_d (&au, &a);
113.6355 -+  unpack_d (&bu, &b);
113.6356 -+
113.6357 -+  if (isnan (&a) || isnan (&b))
113.6358 -+    return -1;			/* false, truth > 0 */
113.6359 -+
113.6360 -+  return __fpcmp_parts (&a, &b);
113.6361 -+}
113.6362 -+#endif /* L_gt_sf || L_gt_df */
113.6363 -+
113.6364 -+#if defined(L_ge_sf) || defined(L_ge_df) || defined(L_ge_tf)
113.6365 -+CMPtype
113.6366 -+_ge_f2 (FLO_type arg_a, FLO_type arg_b)
113.6367 -+{
113.6368 -+  fp_number_type a;
113.6369 -+  fp_number_type b;
113.6370 -+  FLO_union_type au, bu;
113.6371 -+
113.6372 -+  au.value = arg_a;
113.6373 -+  bu.value = arg_b;
113.6374 -+
113.6375 -+  unpack_d (&au, &a);
113.6376 -+  unpack_d (&bu, &b);
113.6377 -+
113.6378 -+  if (isnan (&a) || isnan (&b))
113.6379 -+    return -1;			/* false, truth >= 0 */
113.6380 -+  return __fpcmp_parts (&a, &b) ;
113.6381 -+}
113.6382 -+#endif /* L_ge_sf || L_ge_df */
113.6383 -+
113.6384 -+#if defined(L_lt_sf) || defined(L_lt_df) || defined(L_lt_tf)
113.6385 -+CMPtype
113.6386 -+_lt_f2 (FLO_type arg_a, FLO_type arg_b)
113.6387 -+{
113.6388 -+  fp_number_type a;
113.6389 -+  fp_number_type b;
113.6390 -+  FLO_union_type au, bu;
113.6391 -+
113.6392 -+  au.value = arg_a;
113.6393 -+  bu.value = arg_b;
113.6394 -+
113.6395 -+  unpack_d (&au, &a);
113.6396 -+  unpack_d (&bu, &b);
113.6397 -+
113.6398 -+  if (isnan (&a) || isnan (&b))
113.6399 -+    return 1;			/* false, truth < 0 */
113.6400 -+
113.6401 -+  return __fpcmp_parts (&a, &b);
113.6402 -+}
113.6403 -+#endif /* L_lt_sf || L_lt_df */
113.6404 -+
113.6405 -+#if defined(L_le_sf) || defined(L_le_df) || defined(L_le_tf)
113.6406 -+CMPtype
113.6407 -+_le_f2 (FLO_type arg_a, FLO_type arg_b)
113.6408 -+{
113.6409 -+  fp_number_type a;
113.6410 -+  fp_number_type b;
113.6411 -+  FLO_union_type au, bu;
113.6412 -+
113.6413 -+  au.value = arg_a;
113.6414 -+  bu.value = arg_b;
113.6415 -+
113.6416 -+  unpack_d (&au, &a);
113.6417 -+  unpack_d (&bu, &b);
113.6418 -+
113.6419 -+  if (isnan (&a) || isnan (&b))
113.6420 -+    return 1;			/* false, truth <= 0 */
113.6421 -+
113.6422 -+  return __fpcmp_parts (&a, &b) ;
113.6423 -+}
113.6424 -+#endif /* L_le_sf || L_le_df */
113.6425 -+
113.6426 -+#endif /* ! US_SOFTWARE_GOFAST */
113.6427 -+
113.6428 -+#if defined(L_unord_sf) || defined(L_unord_df) || defined(L_unord_tf)
113.6429 -+CMPtype
113.6430 -+_unord_f2 (FLO_type arg_a, FLO_type arg_b)
113.6431 -+{
113.6432 -+  fp_number_type a;
113.6433 -+  fp_number_type b;
113.6434 -+  FLO_union_type au, bu;
113.6435 -+
113.6436 -+  au.value = arg_a;
113.6437 -+  bu.value = arg_b;
113.6438 -+
113.6439 -+  unpack_d (&au, &a);
113.6440 -+  unpack_d (&bu, &b);
113.6441 -+
113.6442 -+  return (isnan (&a) || isnan (&b));
113.6443 -+}
113.6444 -+#endif /* L_unord_sf || L_unord_df */
113.6445 -+
113.6446 -+#if defined(L_si_to_sf) || defined(L_si_to_df) || defined(L_si_to_tf)
113.6447 -+FLO_type
113.6448 -+si_to_float (SItype arg_a)
113.6449 -+{
113.6450 -+  fp_number_type in;
113.6451 -+
113.6452 -+  in.class = CLASS_NUMBER;
113.6453 -+  in.sign = arg_a < 0;
113.6454 -+  if (!arg_a)
113.6455 -+    {
113.6456 -+      in.class = CLASS_ZERO;
113.6457 -+    }
113.6458 -+  else
113.6459 -+    {
113.6460 -+      in.normal_exp = FRACBITS + NGARDS;
113.6461 -+      if (in.sign) 
113.6462 -+	{
113.6463 -+	  /* Special case for minint, since there is no +ve integer
113.6464 -+	     representation for it */
113.6465 -+	  if (arg_a == (- MAX_SI_INT - 1))
113.6466 -+	    {
113.6467 -+	      return (FLO_type)(- MAX_SI_INT - 1);
113.6468 -+	    }
113.6469 -+	  in.fraction.ll = (-arg_a);
113.6470 -+	}
113.6471 -+      else
113.6472 -+	in.fraction.ll = arg_a;
113.6473 -+
113.6474 -+      while (in.fraction.ll < ((fractype)1 << (FRACBITS + NGARDS)))
113.6475 -+	{
113.6476 -+	  in.fraction.ll <<= 1;
113.6477 -+	  in.normal_exp -= 1;
113.6478 -+	}
113.6479 -+    }
113.6480 -+  return pack_d (&in);
113.6481 -+}
113.6482 -+#endif /* L_si_to_sf || L_si_to_df */
113.6483 -+
113.6484 -+#if defined(L_usi_to_sf) || defined(L_usi_to_df) || defined(L_usi_to_tf)
113.6485 -+FLO_type
113.6486 -+usi_to_float (USItype arg_a)
113.6487 -+{
113.6488 -+  fp_number_type in;
113.6489 -+
113.6490 -+  in.sign = 0;
113.6491 -+  if (!arg_a)
113.6492 -+    {
113.6493 -+      in.class = CLASS_ZERO;
113.6494 -+    }
113.6495 -+  else
113.6496 -+    {
113.6497 -+      in.class = CLASS_NUMBER;
113.6498 -+      in.normal_exp = FRACBITS + NGARDS;
113.6499 -+      in.fraction.ll = arg_a;
113.6500 -+
113.6501 -+      while (in.fraction.ll > ((fractype)1 << (FRACBITS + NGARDS)))
113.6502 -+        {
113.6503 -+          in.fraction.ll >>= 1;
113.6504 -+          in.normal_exp += 1;
113.6505 -+        }
113.6506 -+      while (in.fraction.ll < ((fractype)1 << (FRACBITS + NGARDS)))
113.6507 -+	{
113.6508 -+	  in.fraction.ll <<= 1;
113.6509 -+	  in.normal_exp -= 1;
113.6510 -+	}
113.6511 -+    }
113.6512 -+  return pack_d (&in);
113.6513 -+}
113.6514 -+#endif
113.6515 -+
113.6516 -+#if defined(L_sf_to_si) || defined(L_df_to_si) || defined(L_tf_to_si)
113.6517 -+SItype
113.6518 -+float_to_si (FLO_type arg_a)
113.6519 -+{
113.6520 -+  fp_number_type a;
113.6521 -+  SItype tmp;
113.6522 -+  FLO_union_type au;
113.6523 -+
113.6524 -+  au.value = arg_a;
113.6525 -+  unpack_d (&au, &a);
113.6526 -+
113.6527 -+  if (iszero (&a))
113.6528 -+    return 0;
113.6529 -+  if (isnan (&a))
113.6530 -+    return 0;
113.6531 -+  /* get reasonable MAX_SI_INT...  */
113.6532 -+  if (isinf (&a))
113.6533 -+    return a.sign ? (-MAX_SI_INT)-1 : MAX_SI_INT;
113.6534 -+  /* it is a number, but a small one */
113.6535 -+  if (a.normal_exp < 0)
113.6536 -+    return 0;
113.6537 -+  if (a.normal_exp > BITS_PER_SI - 2)
113.6538 -+    return a.sign ? (-MAX_SI_INT)-1 : MAX_SI_INT;
113.6539 -+  tmp = a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp);
113.6540 -+  return a.sign ? (-tmp) : (tmp);
113.6541 -+}
113.6542 -+#endif /* L_sf_to_si || L_df_to_si */
113.6543 -+
113.6544 -+#if defined(L_sf_to_usi) || defined(L_df_to_usi) || defined(L_tf_to_usi)
113.6545 -+#if defined US_SOFTWARE_GOFAST || defined(L_tf_to_usi)
113.6546 -+/* While libgcc2.c defines its own __fixunssfsi and __fixunsdfsi routines,
113.6547 -+   we also define them for GOFAST because the ones in libgcc2.c have the
113.6548 -+   wrong names and I'd rather define these here and keep GOFAST CYG-LOC's
113.6549 -+   out of libgcc2.c.  We can't define these here if not GOFAST because then
113.6550 -+   there'd be duplicate copies.  */
113.6551 -+
113.6552 -+USItype
113.6553 -+float_to_usi (FLO_type arg_a)
113.6554 -+{
113.6555 -+  fp_number_type a;
113.6556 -+  FLO_union_type au;
113.6557 -+
113.6558 -+  au.value = arg_a;
113.6559 -+  unpack_d (&au, &a);
113.6560 -+
113.6561 -+  if (iszero (&a))
113.6562 -+    return 0;
113.6563 -+  if (isnan (&a))
113.6564 -+    return 0;
113.6565 -+  /* it is a negative number */
113.6566 -+  if (a.sign)
113.6567 -+    return 0;
113.6568 -+  /* get reasonable MAX_USI_INT...  */
113.6569 -+  if (isinf (&a))
113.6570 -+    return MAX_USI_INT;
113.6571 -+  /* it is a number, but a small one */
113.6572 -+  if (a.normal_exp < 0)
113.6573 -+    return 0;
113.6574 -+  if (a.normal_exp > BITS_PER_SI - 1)
113.6575 -+    return MAX_USI_INT;
113.6576 -+  else if (a.normal_exp > (FRACBITS + NGARDS))
113.6577 -+    return a.fraction.ll << (a.normal_exp - (FRACBITS + NGARDS));
113.6578 -+  else
113.6579 -+    return a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp);
113.6580 -+}
113.6581 -+#endif /* US_SOFTWARE_GOFAST */
113.6582 -+#endif /* L_sf_to_usi || L_df_to_usi */
113.6583 -+
113.6584 -+#if defined(L_negate_sf) || defined(L_negate_df) || defined(L_negate_tf)
113.6585 -+FLO_type
113.6586 -+negate (FLO_type arg_a)
113.6587 -+{
113.6588 -+  fp_number_type a;
113.6589 -+  FLO_union_type au;
113.6590 -+
113.6591 -+  au.value = arg_a;
113.6592 -+  unpack_d (&au, &a);
113.6593 -+
113.6594 -+  flip_sign (&a);
113.6595 -+  return pack_d (&a);
113.6596 -+}
113.6597 -+#endif /* L_negate_sf || L_negate_df */
113.6598 -+
113.6599 -+#ifdef FLOAT
113.6600 -+
113.6601 -+#if defined(L_make_sf)
113.6602 -+SFtype
113.6603 -+__make_fp(fp_class_type class,
113.6604 -+	     unsigned int sign,
113.6605 -+	     int exp, 
113.6606 -+	     USItype frac)
113.6607 -+{
113.6608 -+  fp_number_type in;
113.6609 -+
113.6610 -+  in.class = class;
113.6611 -+  in.sign = sign;
113.6612 -+  in.normal_exp = exp;
113.6613 -+  in.fraction.ll = frac;
113.6614 -+  return pack_d (&in);
113.6615 -+}
113.6616 -+#endif /* L_make_sf */
113.6617 -+
113.6618 -+#ifndef FLOAT_ONLY
113.6619 -+
113.6620 -+/* This enables one to build an fp library that supports float but not double.
113.6621 -+   Otherwise, we would get an undefined reference to __make_dp.
113.6622 -+   This is needed for some 8-bit ports that can't handle well values that
113.6623 -+   are 8-bytes in size, so we just don't support double for them at all.  */
113.6624 -+
113.6625 -+#if defined(L_sf_to_df)
113.6626 -+DFtype
113.6627 -+sf_to_df (SFtype arg_a)
113.6628 -+{
113.6629 -+  fp_number_type in;
113.6630 -+  FLO_union_type au;
113.6631 -+
113.6632 -+  au.value = arg_a;
113.6633 -+  unpack_d (&au, &in);
113.6634 -+
113.6635 -+  return __make_dp (in.class, in.sign, in.normal_exp,
113.6636 -+		    ((UDItype) in.fraction.ll) << F_D_BITOFF);
113.6637 -+}
113.6638 -+#endif /* L_sf_to_df */
113.6639 -+
113.6640 -+#if defined(L_sf_to_tf) && defined(TMODES)
113.6641 -+TFtype
113.6642 -+sf_to_tf (SFtype arg_a)
113.6643 -+{
113.6644 -+  fp_number_type in;
113.6645 -+  FLO_union_type au;
113.6646 -+
113.6647 -+  au.value = arg_a;
113.6648 -+  unpack_d (&au, &in);
113.6649 -+
113.6650 -+  return __make_tp (in.class, in.sign, in.normal_exp,
113.6651 -+		    ((UTItype) in.fraction.ll) << F_T_BITOFF);
113.6652 -+}
113.6653 -+#endif /* L_sf_to_df */
113.6654 -+
113.6655 -+#endif /* ! FLOAT_ONLY */
113.6656 -+#endif /* FLOAT */
113.6657 -+
113.6658 -+#ifndef FLOAT
113.6659 -+
113.6660 -+extern SFtype __make_fp (fp_class_type, unsigned int, int, USItype);
113.6661 -+
113.6662 -+#if defined(L_make_df)
113.6663 -+DFtype
113.6664 -+__make_dp (fp_class_type class, unsigned int sign, int exp, UDItype frac)
113.6665 -+{
113.6666 -+  fp_number_type in;
113.6667 -+
113.6668 -+  in.class = class;
113.6669 -+  in.sign = sign;
113.6670 -+  in.normal_exp = exp;
113.6671 -+  in.fraction.ll = frac;
113.6672 -+  return pack_d (&in);
113.6673 -+}
113.6674 -+#endif /* L_make_df */
113.6675 -+
113.6676 -+#if defined(L_df_to_sf)
113.6677 -+SFtype
113.6678 -+df_to_sf (DFtype arg_a)
113.6679 -+{
113.6680 -+  fp_number_type in;
113.6681 -+  USItype sffrac;
113.6682 -+  FLO_union_type au;
113.6683 -+
113.6684 -+  au.value = arg_a;
113.6685 -+  unpack_d (&au, &in);
113.6686 -+
113.6687 -+  sffrac = in.fraction.ll >> F_D_BITOFF;
113.6688 -+
113.6689 -+  /* We set the lowest guard bit in SFFRAC if we discarded any non
113.6690 -+     zero bits.  */
113.6691 -+  if ((in.fraction.ll & (((USItype) 1 << F_D_BITOFF) - 1)) != 0)
113.6692 -+    sffrac |= 1;
113.6693 -+
113.6694 -+  return __make_fp (in.class, in.sign, in.normal_exp, sffrac);
113.6695 -+}
113.6696 -+#endif /* L_df_to_sf */
113.6697 -+
113.6698 -+#if defined(L_df_to_tf) && defined(TMODES) \
113.6699 -+    && !defined(FLOAT) && !defined(TFLOAT)
113.6700 -+TFtype
113.6701 -+df_to_tf (DFtype arg_a)
113.6702 -+{
113.6703 -+  fp_number_type in;
113.6704 -+  FLO_union_type au;
113.6705 -+
113.6706 -+  au.value = arg_a;
113.6707 -+  unpack_d (&au, &in);
113.6708 -+
113.6709 -+  return __make_tp (in.class, in.sign, in.normal_exp,
113.6710 -+		    ((UTItype) in.fraction.ll) << D_T_BITOFF);
113.6711 -+}
113.6712 -+#endif /* L_sf_to_df */
113.6713 -+
113.6714 -+#ifdef TFLOAT
113.6715 -+#if defined(L_make_tf)
113.6716 -+TFtype
113.6717 -+__make_tp(fp_class_type class,
113.6718 -+	     unsigned int sign,
113.6719 -+	     int exp, 
113.6720 -+	     UTItype frac)
113.6721 -+{
113.6722 -+  fp_number_type in;
113.6723 -+
113.6724 -+  in.class = class;
113.6725 -+  in.sign = sign;
113.6726 -+  in.normal_exp = exp;
113.6727 -+  in.fraction.ll = frac;
113.6728 -+  return pack_d (&in);
113.6729 -+}
113.6730 -+#endif /* L_make_tf */
113.6731 -+
113.6732 -+#if defined(L_tf_to_df)
113.6733 -+DFtype
113.6734 -+tf_to_df (TFtype arg_a)
113.6735 -+{
113.6736 -+  fp_number_type in;
113.6737 -+  UDItype sffrac;
113.6738 -+  FLO_union_type au;
113.6739 -+
113.6740 -+  au.value = arg_a;
113.6741 -+  unpack_d (&au, &in);
113.6742 -+
113.6743 -+  sffrac = in.fraction.ll >> D_T_BITOFF;
113.6744 -+
113.6745 -+  /* We set the lowest guard bit in SFFRAC if we discarded any non
113.6746 -+     zero bits.  */
113.6747 -+  if ((in.fraction.ll & (((UTItype) 1 << D_T_BITOFF) - 1)) != 0)
113.6748 -+    sffrac |= 1;
113.6749 -+
113.6750 -+  return __make_dp (in.class, in.sign, in.normal_exp, sffrac);
113.6751 -+}
113.6752 -+#endif /* L_tf_to_df */
113.6753 -+
113.6754 -+#if defined(L_tf_to_sf)
113.6755 -+SFtype
113.6756 -+tf_to_sf (TFtype arg_a)
113.6757 -+{
113.6758 -+  fp_number_type in;
113.6759 -+  USItype sffrac;
113.6760 -+  FLO_union_type au;
113.6761 -+
113.6762 -+  au.value = arg_a;
113.6763 -+  unpack_d (&au, &in);
113.6764 -+
113.6765 -+  sffrac = in.fraction.ll >> F_T_BITOFF;
113.6766 -+
113.6767 -+  /* We set the lowest guard bit in SFFRAC if we discarded any non
113.6768 -+     zero bits.  */
113.6769 -+  if ((in.fraction.ll & (((UTItype) 1 << F_T_BITOFF) - 1)) != 0)
113.6770 -+    sffrac |= 1;
113.6771 -+
113.6772 -+  return __make_fp (in.class, in.sign, in.normal_exp, sffrac);
113.6773 -+}
113.6774 -+#endif /* L_tf_to_sf */
113.6775 -+#endif /* TFLOAT */
113.6776 -+
113.6777 -+#endif /* ! FLOAT */
113.6778 -+#endif /* !EXTENDED_FLOAT_STUBS */
113.6779 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2.h gcc-3.4.6/gcc/config/nios2/nios2.h
113.6780 ---- gcc-3.4.6.orig/gcc/config/nios2/nios2.h	1970-01-01 01:00:00.000000000 +0100
113.6781 -+++ gcc-3.4.6/gcc/config/nios2/nios2.h	2007-08-15 23:09:36.000000000 +0200
113.6782 -@@ -0,0 +1,824 @@
113.6783 -+/* Definitions of target machine for Altera NIOS 2G NIOS2 version.
113.6784 -+   Copyright (C) 2003 Altera 
113.6785 -+   Contributed by Jonah Graham (jgraham@altera.com).
113.6786 -+
113.6787 -+This file is part of GNU CC.
113.6788 -+
113.6789 -+GNU CC is free software; you can redistribute it and/or modify
113.6790 -+it under the terms of the GNU General Public License as published by
113.6791 -+the Free Software Foundation; either version 2, or (at your option)
113.6792 -+any later version.
113.6793 -+
113.6794 -+GNU CC is distributed in the hope that it will be useful,
113.6795 -+but WITHOUT ANY WARRANTY; without even the implied warranty of
113.6796 -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
113.6797 -+GNU General Public License for more details.
113.6798 -+
113.6799 -+You should have received a copy of the GNU General Public License
113.6800 -+along with GNU CC; see the file COPYING.  If not, write to
113.6801 -+the Free Software Foundation, 59 Temple Place - Suite 330,
113.6802 -+Boston, MA 02111-1307, USA.  */
113.6803 -+
113.6804 -+
113.6805 -+
113.6806 -+#define TARGET_CPU_CPP_BUILTINS()		\
113.6807 -+  do						\
113.6808 -+    {						\
113.6809 -+      builtin_define_std ("NIOS2");		\
113.6810 -+      builtin_define_std ("nios2");		\
113.6811 -+      builtin_define ("_GNU_SOURCE");		\
113.6812 -+    }						\
113.6813 -+  while (0)
113.6814 -+#define TARGET_VERSION fprintf (stderr, " (Altera Nios II)")
113.6815 -+
113.6816 -+
113.6817 -+
113.6818 -+
113.6819 -+
113.6820 -+/*********************************
113.6821 -+ * Run-time Target Specification
113.6822 -+ *********************************/
113.6823 -+
113.6824 -+#define HAS_DIV_FLAG 0x0001
113.6825 -+#define HAS_MUL_FLAG 0x0002
113.6826 -+#define HAS_MULX_FLAG 0x0004
113.6827 -+#define FAST_SW_DIV_FLAG 0x0008
113.6828 -+#define INLINE_MEMCPY_FLAG 0x00010
113.6829 -+#define CACHE_VOLATILE_FLAG 0x0020
113.6830 -+#define BYPASS_CACHE_FLAG 0x0040
113.6831 -+
113.6832 -+extern int target_flags;
113.6833 -+#define TARGET_HAS_DIV (target_flags & HAS_DIV_FLAG)
113.6834 -+#define TARGET_HAS_MUL (target_flags & HAS_MUL_FLAG)
113.6835 -+#define TARGET_HAS_MULX (target_flags & HAS_MULX_FLAG)
113.6836 -+#define TARGET_FAST_SW_DIV (target_flags & FAST_SW_DIV_FLAG)
113.6837 -+#define TARGET_INLINE_MEMCPY (target_flags & INLINE_MEMCPY_FLAG)
113.6838 -+#define TARGET_CACHE_VOLATILE (target_flags & CACHE_VOLATILE_FLAG)
113.6839 -+#define TARGET_BYPASS_CACHE (target_flags & BYPASS_CACHE_FLAG)
113.6840 -+
113.6841 -+#define TARGET_SWITCHES					\
113.6842 -+{							\
113.6843 -+    { "hw-div", HAS_DIV_FLAG,				\
113.6844 -+      N_("Enable DIV, DIVU") },				\
113.6845 -+    { "no-hw-div", -HAS_DIV_FLAG,			\
113.6846 -+      N_("Disable DIV, DIVU (default)") },		\
113.6847 -+    { "hw-mul", HAS_MUL_FLAG,				\
113.6848 -+      N_("Enable MUL instructions (default)") },				\
113.6849 -+    { "hw-mulx", HAS_MULX_FLAG,				\
113.6850 -+      N_("Enable MULX instructions, assume fast shifter") },				\
113.6851 -+    { "no-hw-mul", -HAS_MUL_FLAG,			\
113.6852 -+      N_("Disable MUL instructions") },		\
113.6853 -+    { "no-hw-mulx", -HAS_MULX_FLAG,			\
113.6854 -+      N_("Disable MULX instructions, assume slow shifter (default and implied by -mno-hw-mul)") },		\
113.6855 -+    { "fast-sw-div", FAST_SW_DIV_FLAG,				\
113.6856 -+      N_("Use table based fast divide (default at -O3)") },				\
113.6857 -+    { "no-fast-sw-div", -FAST_SW_DIV_FLAG,			\
113.6858 -+      N_("Don't use table based fast divide ever") },		\
113.6859 -+    { "inline-memcpy", INLINE_MEMCPY_FLAG,				\
113.6860 -+      N_("Inline small memcpy (default when optimizing)") },				\
113.6861 -+    { "no-inline-memcpy", -INLINE_MEMCPY_FLAG,			\
113.6862 -+      N_("Don't Inline small memcpy") },		\
113.6863 -+    { "cache-volatile", CACHE_VOLATILE_FLAG,				\
113.6864 -+      N_("Volatile accesses use non-io variants of instructions (default)") },				\
113.6865 -+    { "no-cache-volatile", -CACHE_VOLATILE_FLAG,			\
113.6866 -+      N_("Volatile accesses use io variants of instructions") },		\
113.6867 -+    { "bypass-cache", BYPASS_CACHE_FLAG,				\
113.6868 -+      N_("All ld/st instructins use io variants") },				\
113.6869 -+    { "no-bypass-cache", -BYPASS_CACHE_FLAG,			\
113.6870 -+      N_("All ld/st instructins do not use io variants (default)") },		\
113.6871 -+    { "smallc", 0,			\
113.6872 -+      N_("Link with a limited version of the C library") },		\
113.6873 -+    { "ctors-in-init", 0,			\
113.6874 -+      "" /* undocumented: N_("Link with static constructors and destructors in init") */ },		\
113.6875 -+    { "", TARGET_DEFAULT, 0 }				\
113.6876 -+}
113.6877 -+
113.6878 -+
113.6879 -+extern const char *nios2_sys_nosys_string;    /* for -msys=nosys */
113.6880 -+extern const char *nios2_sys_lib_string;    /* for -msys-lib= */
113.6881 -+extern const char *nios2_sys_crt0_string;    /* for -msys-crt0= */
113.6882 -+
113.6883 -+#define TARGET_OPTIONS					\
113.6884 -+{							\
113.6885 -+  { "sys=nosys",    &nios2_sys_nosys_string,		\
113.6886 -+      N_("Use stub versions of OS library calls (default)"), 0},	\
113.6887 -+  { "sys-lib=",    &nios2_sys_lib_string,		\
113.6888 -+      N_("Name of System Library to link against. (Converted to a -l option)"), 0},	\
113.6889 -+  { "sys-crt0=",    &nios2_sys_crt0_string,		\
113.6890 -+      N_("Name of the startfile. (default is a crt0 for the ISS only)"), 0},	\
113.6891 -+}
113.6892 -+
113.6893 -+
113.6894 -+/* Default target_flags if no switches specified.  */
113.6895 -+#ifndef TARGET_DEFAULT
113.6896 -+# define TARGET_DEFAULT (HAS_MUL_FLAG | CACHE_VOLATILE_FLAG)
113.6897 -+#endif
113.6898 -+
113.6899 -+/* Switch  Recognition by gcc.c.  Add -G xx support */
113.6900 -+#undef  SWITCH_TAKES_ARG
113.6901 -+#define SWITCH_TAKES_ARG(CHAR)						\
113.6902 -+  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
113.6903 -+
113.6904 -+#define OVERRIDE_OPTIONS override_options ()
113.6905 -+#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) optimization_options (LEVEL, SIZE)
113.6906 -+#define CAN_DEBUG_WITHOUT_FP
113.6907 -+ 
113.6908 -+#define CC1_SPEC "\
113.6909 -+%{G*}"
113.6910 -+
113.6911 -+#undef LIB_SPEC
113.6912 -+#define LIB_SPEC \
113.6913 -+"--start-group %{msmallc: -lsmallc} %{!msmallc: -lc} -lgcc \
113.6914 -+ %{msys-lib=*: -l%*} \
113.6915 -+ %{!msys-lib=*: -lc } \
113.6916 -+ --end-group \
113.6917 -+ %{msys-lib=: %eYou need a library name for -msys-lib=} \
113.6918 -+"
113.6919 -+
113.6920 -+
113.6921 -+#undef STARTFILE_SPEC 
113.6922 -+#define STARTFILE_SPEC  \
113.6923 -+"%{msys-crt0=*: %*} %{!msys-crt0=*: crt1%O%s} \
113.6924 -+ %{msys-crt0=: %eYou need a C startup file for -msys-crt0=} \
113.6925 -+ %{mctors-in-init: crti%O%s crtbegin%O%s} \
113.6926 -+"
113.6927 -+
113.6928 -+#undef ENDFILE_SPEC 
113.6929 -+#define ENDFILE_SPEC \
113.6930 -+ "%{mctors-in-init: crtend%O%s crtn%O%s}"
113.6931 -+
113.6932 -+
113.6933 -+/***********************
113.6934 -+ * Storage Layout
113.6935 -+ ***********************/
113.6936 -+
113.6937 -+#define DEFAULT_SIGNED_CHAR 1
113.6938 -+#define BITS_BIG_ENDIAN 0
113.6939 -+#define BYTES_BIG_ENDIAN 0
113.6940 -+#define WORDS_BIG_ENDIAN 0
113.6941 -+#define BITS_PER_UNIT 8
113.6942 -+#define BITS_PER_WORD 32
113.6943 -+#define UNITS_PER_WORD 4
113.6944 -+#define POINTER_SIZE 32
113.6945 -+#define BIGGEST_ALIGNMENT 32
113.6946 -+#define STRICT_ALIGNMENT 1
113.6947 -+#define FUNCTION_BOUNDARY 32
113.6948 -+#define PARM_BOUNDARY 32
113.6949 -+#define STACK_BOUNDARY 32
113.6950 -+#define PREFERRED_STACK_BOUNDARY 32
113.6951 -+#define MAX_FIXED_MODE_SIZE 64
113.6952 -+
113.6953 -+#define CONSTANT_ALIGNMENT(EXP, ALIGN)				\
113.6954 -+  ((TREE_CODE (EXP) == STRING_CST) 				\
113.6955 -+   && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
113.6956 -+
113.6957 -+
113.6958 -+/**********************
113.6959 -+ * Layout of Source Language Data Types
113.6960 -+ **********************/
113.6961 -+
113.6962 -+#define INT_TYPE_SIZE 32
113.6963 -+#define SHORT_TYPE_SIZE 16
113.6964 -+#define LONG_TYPE_SIZE 32
113.6965 -+#define LONG_LONG_TYPE_SIZE 64
113.6966 -+#define FLOAT_TYPE_SIZE 32
113.6967 -+#define DOUBLE_TYPE_SIZE 64
113.6968 -+#define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE
113.6969 -+
113.6970 -+
113.6971 -+/*************************
113.6972 -+ * Condition Code Status
113.6973 -+ ************************/
113.6974 -+
113.6975 -+/* comparison type */
113.6976 -+/* ??? currently only CMP_SI is used */
113.6977 -+enum cmp_type {
113.6978 -+  CMP_SI,				/* compare four byte integers */
113.6979 -+  CMP_DI,				/* compare eight byte integers */
113.6980 -+  CMP_SF,				/* compare single precision floats */
113.6981 -+  CMP_DF,				/* compare double precision floats */
113.6982 -+  CMP_MAX				/* max comparison type */
113.6983 -+};
113.6984 -+
113.6985 -+extern GTY(()) rtx branch_cmp[2];	/* operands for compare */
113.6986 -+extern enum cmp_type branch_type;	/* what type of branch to use */
113.6987 -+
113.6988 -+/**********************
113.6989 -+ * Register Usage
113.6990 -+ **********************/
113.6991 -+
113.6992 -+/* ---------------------------------- *
113.6993 -+ * Basic Characteristics of Registers
113.6994 -+ * ---------------------------------- */
113.6995 -+
113.6996 -+/*
113.6997 -+Register Number
113.6998 -+      Register Name
113.6999 -+          Alternate Name
113.7000 -+                Purpose
113.7001 -+0     r0  zero  always zero
113.7002 -+1     r1  at    Assembler Temporary
113.7003 -+2-3   r2-r3     Return Location
113.7004 -+4-7   r4-r7     Register Arguments
113.7005 -+8-15  r8-r15    Caller Saved Registers
113.7006 -+16-22 r16-r22   Callee Saved Registers
113.7007 -+23    r23 sc    Static Chain (Callee Saved)
113.7008 -+                ??? Does $sc want to be caller or callee 
113.7009 -+                saved. If caller, 15, else 23. 
113.7010 -+24    r24       Exception Temporary
113.7011 -+25    r25       Breakpoint Temporary
113.7012 -+26    r26 gp    Global Pointer
113.7013 -+27    r27 sp    Stack Pointer
113.7014 -+28    r28 fp    Frame Pointer
113.7015 -+29    r29 ea    Exception Return Address
113.7016 -+30    r30 ba    Breakpoint Return Address
113.7017 -+31    r31 ra    Return Address
113.7018 -+
113.7019 -+32    ctl0 status
113.7020 -+33    ctl1 estatus STATUS saved by exception ? 	
113.7021 -+34    ctl2 bstatus STATUS saved by break ? 	
113.7022 -+35    ctl3 ipri    Interrupt Priority Mask ?	
113.7023 -+36    ctl4 ecause  Exception Cause ? 	
113.7024 -+
113.7025 -+37         pc   Not an actual register	
113.7026 -+
113.7027 -+38    rap      Return address pointer, this does not
113.7028 -+                   actually exist and will be eliminated
113.7029 -+
113.7030 -+39    fake_fp  Fake Frame Pointer which will always be eliminated.
113.7031 -+40    fake_ap  Fake Argument Pointer which will always be eliminated.
113.7032 -+
113.7033 -+41             First Pseudo Register
113.7034 -+
113.7035 -+
113.7036 -+The definitions for all the hard register numbers
113.7037 -+are located in nios2.md.
113.7038 -+*/
113.7039 -+
113.7040 -+#define FIRST_PSEUDO_REGISTER 41
113.7041 -+#define NUM_ARG_REGS (LAST_ARG_REGNO - FIRST_ARG_REGNO + 1)
113.7042 -+
113.7043 -+
113.7044 -+
113.7045 -+/* also see CONDITIONAL_REGISTER_USAGE */
113.7046 -+#define FIXED_REGISTERS			     \
113.7047 -+    {					     \
113.7048 -+/*        +0  1  2  3  4  5  6  7  8  9 */   \
113.7049 -+/*   0 */  1, 1, 0, 0, 0, 0, 0, 0, 0, 0,     \
113.7050 -+/*  10 */  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     \
113.7051 -+/*  20 */  0, 0, 0, 0, 1, 1, 1, 1, 0, 1,     \
113.7052 -+/*  30 */  1, 0, 1, 1, 1, 1, 1, 1, 1, 1,     \
113.7053 -+/*  40 */  1,                                \
113.7054 -+    }
113.7055 -+
113.7056 -+/* call used is the same as caller saved
113.7057 -+   + fixed regs + args + ret vals */
113.7058 -+#define CALL_USED_REGISTERS		     \
113.7059 -+    { 					     \
113.7060 -+/*        +0  1  2  3  4  5  6  7  8  9 */   \
113.7061 -+/*   0 */  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     \
113.7062 -+/*  10 */  1, 1, 1, 1, 1, 1, 0, 0, 0, 0,     \
113.7063 -+/*  20 */  0, 0, 0, 0, 1, 1, 1, 1, 0, 1,     \
113.7064 -+/*  30 */  1, 0, 1, 1, 1, 1, 1, 1, 1, 1,     \
113.7065 -+/*  40 */  1,                                \
113.7066 -+    }
113.7067 -+
113.7068 -+#define HARD_REGNO_NREGS(REGNO, MODE)            \
113.7069 -+   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1)  \
113.7070 -+    / UNITS_PER_WORD)
113.7071 -+
113.7072 -+/* --------------------------- *
113.7073 -+ * How Values Fit in Registers
113.7074 -+ * --------------------------- */
113.7075 -+
113.7076 -+#define HARD_REGNO_MODE_OK(REGNO, MODE) 1
113.7077 -+
113.7078 -+#define MODES_TIEABLE_P(MODE1, MODE2) 1
113.7079 -+
113.7080 -+
113.7081 -+/*************************
113.7082 -+ * Register Classes
113.7083 -+ *************************/
113.7084 -+
113.7085 -+enum reg_class
113.7086 -+{
113.7087 -+    NO_REGS,
113.7088 -+    ALL_REGS,
113.7089 -+    LIM_REG_CLASSES
113.7090 -+};
113.7091 -+
113.7092 -+#define N_REG_CLASSES (int) LIM_REG_CLASSES
113.7093 -+
113.7094 -+#define REG_CLASS_NAMES   \
113.7095 -+    {"NO_REGS",           \
113.7096 -+     "ALL_REGS"}
113.7097 -+
113.7098 -+#define GENERAL_REGS ALL_REGS
113.7099 -+
113.7100 -+#define REG_CLASS_CONTENTS   \
113.7101 -+/* NO_REGS  */       {{ 0, 0},     \
113.7102 -+/* ALL_REGS */        {~0,~0}}    \
113.7103 -+
113.7104 -+#define REGNO_REG_CLASS(REGNO) ALL_REGS
113.7105 -+
113.7106 -+#define BASE_REG_CLASS ALL_REGS
113.7107 -+#define INDEX_REG_CLASS ALL_REGS
113.7108 -+
113.7109 -+/* only one reg class, 'r', is handled automatically */
113.7110 -+#define REG_CLASS_FROM_LETTER(CHAR) NO_REGS
113.7111 -+
113.7112 -+#define REGNO_OK_FOR_BASE_P2(REGNO, STRICT) \
113.7113 -+    ((STRICT) \
113.7114 -+     ? (REGNO) < FIRST_PSEUDO_REGISTER \
113.7115 -+     : (REGNO) < FIRST_PSEUDO_REGISTER || (reg_renumber && reg_renumber[REGNO] < FIRST_PSEUDO_REGISTER))
113.7116 -+
113.7117 -+#define REGNO_OK_FOR_INDEX_P2(REGNO, STRICT) \
113.7118 -+    (REGNO_OK_FOR_BASE_P2 (REGNO, STRICT))
113.7119 -+
113.7120 -+#define REGNO_OK_FOR_BASE_P(REGNO) \
113.7121 -+    (REGNO_OK_FOR_BASE_P2 (REGNO, 1))
113.7122 -+
113.7123 -+#define REGNO_OK_FOR_INDEX_P(REGNO) \
113.7124 -+    (REGNO_OK_FOR_INDEX_P2 (REGNO, 1))
113.7125 -+
113.7126 -+#define REG_OK_FOR_BASE_P2(X, STRICT)                                   \
113.7127 -+    (STRICT                                                             \
113.7128 -+     ? REGNO_OK_FOR_BASE_P2 (REGNO (X), 1)                              \
113.7129 -+     : REGNO_OK_FOR_BASE_P2 (REGNO (X), 1) || REGNO(X) >= FIRST_PSEUDO_REGISTER)
113.7130 -+
113.7131 -+#define REG_OK_FOR_INDEX_P2(X, STRICT)                                  \
113.7132 -+    (STRICT                                                             \
113.7133 -+     ? REGNO_OK_FOR_INDEX_P2 (REGNO (X), 1)                             \
113.7134 -+     : REGNO_OK_FOR_INDEX_P2 (REGNO (X), 1) || REGNO(X) >= FIRST_PSEUDO_REGISTER)
113.7135 -+
113.7136 -+#define CLASS_MAX_NREGS(CLASS, MODE)             \
113.7137 -+   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1)  \
113.7138 -+    / UNITS_PER_WORD)
113.7139 -+
113.7140 -+
113.7141 -+#define SMALL_INT(X) ((unsigned HOST_WIDE_INT) ((X) + 0x8000) < 0x10000)
113.7142 -+#define SMALL_INT_UNSIGNED(X) ((unsigned HOST_WIDE_INT) (X) < 0x10000)
113.7143 -+#define UPPER16_INT(X) (((X) & 0xffff) == 0)
113.7144 -+#define SHIFT_INT(X) ((X) >= 0 && (X) <= 31)
113.7145 -+#define RDWRCTL_INT(X) ((X) >= 0 && (X) <= 31)
113.7146 -+#define CUSTOM_INSN_OPCODE(X) ((X) >= 0 && (X) <= 255)
113.7147 -+
113.7148 -+#define CONST_OK_FOR_LETTER_P(VALUE, C)			\
113.7149 -+ (							\
113.7150 -+  (C) == 'I' ? SMALL_INT (VALUE) :			\
113.7151 -+  (C) == 'J' ? SMALL_INT_UNSIGNED (VALUE) :		\
113.7152 -+  (C) == 'K' ? UPPER16_INT (VALUE) :         		\
113.7153 -+  (C) == 'L' ? SHIFT_INT (VALUE) :			\
113.7154 -+  (C) == 'M' ? (VALUE) == 0 :				\
113.7155 -+  (C) == 'N' ? CUSTOM_INSN_OPCODE (VALUE) :		\
113.7156 -+  (C) == 'O' ? RDWRCTL_INT (VALUE) :			\
113.7157 -+  0)
113.7158 -+
113.7159 -+#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
113.7160 -+
113.7161 -+#define PREFERRED_RELOAD_CLASS(X, CLASS) \
113.7162 -+    ((CLASS) == NO_REGS ? GENERAL_REGS : (CLASS))
113.7163 -+
113.7164 -+/* 'S' matches immediates which are in small data 
113.7165 -+   and therefore can be added to gp to create a 
113.7166 -+   32-bit value. */
113.7167 -+#define EXTRA_CONSTRAINT(VALUE, C)		\
113.7168 -+  ((C) == 'S' 					\
113.7169 -+   && (GET_CODE (VALUE) == SYMBOL_REF)   	\
113.7170 -+   && SYMBOL_REF_IN_NIOS2_SMALL_DATA_P (VALUE))
113.7171 -+
113.7172 -+
113.7173 -+
113.7174 -+
113.7175 -+/* Say that the epilogue uses the return address register.  Note that
113.7176 -+   in the case of sibcalls, the values "used by the epilogue" are
113.7177 -+   considered live at the start of the called function.  */
113.7178 -+#define EPILOGUE_USES(REGNO) ((REGNO) == RA_REGNO)
113.7179 -+
113.7180 -+
113.7181 -+#define DEFAULT_MAIN_RETURN  c_expand_return (integer_zero_node)
113.7182 -+
113.7183 -+/**********************************
113.7184 -+ * Trampolines for Nested Functions
113.7185 -+ ***********************************/
113.7186 -+
113.7187 -+#define TRAMPOLINE_TEMPLATE(FILE) \
113.7188 -+    error ("trampolines not yet implemented")
113.7189 -+#define TRAMPOLINE_SIZE 20
113.7190 -+#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
113.7191 -+    error ("trampolines not yet implemented")
113.7192 -+
113.7193 -+/***************************
113.7194 -+ * Stack Layout and Calling Conventions
113.7195 -+ ***************************/
113.7196 -+
113.7197 -+/* ------------------ *
113.7198 -+ * Basic Stack Layout
113.7199 -+ * ------------------ */
113.7200 -+
113.7201 -+/* The downward variants are used by the compiler,
113.7202 -+   the upward ones serve as documentation */
113.7203 -+#define STACK_GROWS_DOWNWARD
113.7204 -+#define FRAME_GROWS_UPWARD
113.7205 -+#define ARGS_GROW_UPWARD
113.7206 -+
113.7207 -+#define STARTING_FRAME_OFFSET current_function_outgoing_args_size
113.7208 -+#define FIRST_PARM_OFFSET(FUNDECL) 0
113.7209 -+
113.7210 -+/* Before the prologue, RA lives in r31.  */
113.7211 -+#define INCOMING_RETURN_ADDR_RTX  gen_rtx_REG (VOIDmode, RA_REGNO)
113.7212 -+
113.7213 -+/* -------------------------------------- *
113.7214 -+ * Registers That Address the Stack Frame
113.7215 -+ * -------------------------------------- */
113.7216 -+
113.7217 -+#define STACK_POINTER_REGNUM SP_REGNO
113.7218 -+#define STATIC_CHAIN_REGNUM SC_REGNO
113.7219 -+#define PC_REGNUM PC_REGNO
113.7220 -+#define DWARF_FRAME_RETURN_COLUMN RA_REGNO
113.7221 -+
113.7222 -+/* Base register for access to local variables of the function.  We
113.7223 -+   pretend that the frame pointer is a non-existent hard register, and 
113.7224 -+   then eliminate it to HARD_FRAME_POINTER_REGNUM. */
113.7225 -+#define FRAME_POINTER_REGNUM FAKE_FP_REGNO
113.7226 -+
113.7227 -+#define HARD_FRAME_POINTER_REGNUM FP_REGNO
113.7228 -+#define RETURN_ADDRESS_POINTER_REGNUM RAP_REGNO
113.7229 -+/* the argumnet pointer needs to always be eliminated
113.7230 -+   so it is set to a fake hard register. */
113.7231 -+#define ARG_POINTER_REGNUM FAKE_AP_REGNO
113.7232 -+
113.7233 -+/* ----------------------------------------- *
113.7234 -+ * Eliminating Frame Pointer and Arg Pointer
113.7235 -+ * ----------------------------------------- */
113.7236 -+
113.7237 -+#define FRAME_POINTER_REQUIRED 0
113.7238 -+
113.7239 -+#define ELIMINABLE_REGS							\
113.7240 -+{{ ARG_POINTER_REGNUM,   STACK_POINTER_REGNUM},				\
113.7241 -+ { ARG_POINTER_REGNUM,   HARD_FRAME_POINTER_REGNUM},			\
113.7242 -+ { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM},		\
113.7243 -+ { RETURN_ADDRESS_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM},		\
113.7244 -+ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM},				\
113.7245 -+ { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
113.7246 -+
113.7247 -+#define CAN_ELIMINATE(FROM, TO)	1
113.7248 -+
113.7249 -+#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
113.7250 -+	(OFFSET) = nios2_initial_elimination_offset ((FROM), (TO))
113.7251 -+
113.7252 -+#define MUST_SAVE_REGISTER(regno) \
113.7253 -+ ((regs_ever_live[regno] && !call_used_regs[regno])			\
113.7254 -+  || (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed)	\
113.7255 -+  || (regno == RA_REGNO && regs_ever_live[RA_REGNO]))
113.7256 -+
113.7257 -+/* Treat LOC as a byte offset from the stack pointer and round it up
113.7258 -+   to the next fully-aligned offset.  */
113.7259 -+#define STACK_ALIGN(LOC)						\
113.7260 -+  (((LOC) + ((PREFERRED_STACK_BOUNDARY / 8) - 1)) & ~((PREFERRED_STACK_BOUNDARY / 8) - 1))
113.7261 -+
113.7262 -+
113.7263 -+/* ------------------------------ *
113.7264 -+ * Passing Arguments in Registers
113.7265 -+ * ------------------------------ */
113.7266 -+
113.7267 -+/* see nios2.c */
113.7268 -+#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
113.7269 -+  (function_arg (&CUM, MODE, TYPE, NAMED))
113.7270 -+
113.7271 -+#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
113.7272 -+  (function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED))
113.7273 -+
113.7274 -+#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) 0
113.7275 -+
113.7276 -+#define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) 0
113.7277 -+
113.7278 -+typedef struct nios2_args
113.7279 -+{
113.7280 -+    int regs_used;
113.7281 -+} CUMULATIVE_ARGS;
113.7282 -+
113.7283 -+/* This is to initialize the above unused CUM data type */
113.7284 -+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
113.7285 -+    (init_cumulative_args (&CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS))
113.7286 -+
113.7287 -+#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
113.7288 -+    (function_arg_advance (&CUM, MODE, TYPE, NAMED))
113.7289 -+
113.7290 -+#define FUNCTION_ARG_REGNO_P(REGNO) \
113.7291 -+    ((REGNO) >= FIRST_ARG_REGNO && (REGNO) <= LAST_ARG_REGNO)
113.7292 -+
113.7293 -+#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL)   \
113.7294 -+  {								    \
113.7295 -+    int pret_size = nios2_setup_incoming_varargs (&(CUM), (MODE),	    \
113.7296 -+						(TYPE), (NO_RTL));  \
113.7297 -+    if (pret_size)						    \
113.7298 -+      (PRETEND_SIZE) = pret_size;				    \
113.7299 -+  }
113.7300 -+
113.7301 -+/* ----------------------------- *
113.7302 -+ * Generating Code for Profiling
113.7303 -+ * ----------------------------- */
113.7304 -+
113.7305 -+#define PROFILE_BEFORE_PROLOGUE
113.7306 -+
113.7307 -+#define FUNCTION_PROFILER(FILE, LABELNO) \
113.7308 -+  function_profiler ((FILE), (LABELNO))
113.7309 -+
113.7310 -+/* --------------------------------------- *
113.7311 -+ * Passing Function Arguments on the Stack
113.7312 -+ * --------------------------------------- */
113.7313 -+
113.7314 -+#define PROMOTE_PROTOTYPES 1
113.7315 -+
113.7316 -+#define PUSH_ARGS 0
113.7317 -+#define ACCUMULATE_OUTGOING_ARGS 1
113.7318 -+
113.7319 -+#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACKSIZE) 0
113.7320 -+
113.7321 -+/* --------------------------------------- *
113.7322 -+ * How Scalar Function Values Are Returned
113.7323 -+ * --------------------------------------- */
113.7324 -+
113.7325 -+#define FUNCTION_VALUE(VALTYPE, FUNC) \
113.7326 -+    gen_rtx(REG, TYPE_MODE(VALTYPE), FIRST_RETVAL_REGNO)
113.7327 -+
113.7328 -+#define LIBCALL_VALUE(MODE) \
113.7329 -+    gen_rtx(REG, MODE, FIRST_RETVAL_REGNO)
113.7330 -+
113.7331 -+#define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == FIRST_RETVAL_REGNO)
113.7332 -+
113.7333 -+/* ----------------------------- *
113.7334 -+ * How Large Values Are Returned
113.7335 -+ * ----------------------------- */
113.7336 -+
113.7337 -+
113.7338 -+#define RETURN_IN_MEMORY(TYPE)	\
113.7339 -+  nios2_return_in_memory (TYPE)
113.7340 -+
113.7341 -+
113.7342 -+#define STRUCT_VALUE 0
113.7343 -+
113.7344 -+#define DEFAULT_PCC_STRUCT_RETURN 0
113.7345 -+
113.7346 -+/*******************
113.7347 -+ * Addressing Modes
113.7348 -+ *******************/
113.7349 -+
113.7350 -+
113.7351 -+#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
113.7352 -+
113.7353 -+#define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X))
113.7354 -+
113.7355 -+#define MAX_REGS_PER_ADDRESS 1
113.7356 -+
113.7357 -+/* Go to ADDR if X is a valid address.  */
113.7358 -+#ifndef REG_OK_STRICT
113.7359 -+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)        \
113.7360 -+    {                                                  \
113.7361 -+        if (nios2_legitimate_address ((X), (MODE), 0))  \
113.7362 -+            goto ADDR;                                 \
113.7363 -+    }
113.7364 -+#else
113.7365 -+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)        \
113.7366 -+    {                                                  \
113.7367 -+        if (nios2_legitimate_address ((X), (MODE), 1))  \
113.7368 -+            goto ADDR;                                 \
113.7369 -+    }
113.7370 -+#endif
113.7371 -+
113.7372 -+#ifndef REG_OK_STRICT
113.7373 -+#define REG_OK_FOR_BASE_P(X)   REGNO_OK_FOR_BASE_P2 (REGNO (X), 0)
113.7374 -+#define REG_OK_FOR_INDEX_P(X)  REGNO_OK_FOR_INDEX_P2 (REGNO (X), 0)
113.7375 -+#else
113.7376 -+#define REG_OK_FOR_BASE_P(X)   REGNO_OK_FOR_BASE_P2 (REGNO (X), 1)
113.7377 -+#define REG_OK_FOR_INDEX_P(X)  REGNO_OK_FOR_INDEX_P2 (REGNO (X), 1)
113.7378 -+#endif
113.7379 -+
113.7380 -+#define LEGITIMATE_CONSTANT_P(X) 1
113.7381 -+
113.7382 -+/* Nios II has no mode dependent addresses.  */
113.7383 -+#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
113.7384 -+
113.7385 -+/* Set if this has a weak declaration  */
113.7386 -+#define SYMBOL_FLAG_WEAK_DECL	(1 << SYMBOL_FLAG_MACH_DEP_SHIFT)
113.7387 -+#define SYMBOL_REF_WEAK_DECL_P(RTX) \
113.7388 -+  ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_WEAK_DECL) != 0)
113.7389 -+
113.7390 -+
113.7391 -+/* true if a symbol is both small and not weak. In this case, gp
113.7392 -+   relative access can be used */
113.7393 -+#define SYMBOL_REF_IN_NIOS2_SMALL_DATA_P(RTX) \
113.7394 -+   (SYMBOL_REF_SMALL_P(RTX) && !SYMBOL_REF_WEAK_DECL_P(RTX))
113.7395 -+
113.7396 -+/*****************
113.7397 -+ * Describing Relative Costs of Operations
113.7398 -+ *****************/
113.7399 -+
113.7400 -+#define SLOW_BYTE_ACCESS 1
113.7401 -+
113.7402 -+/* It is as good to call a constant function address as to call an address
113.7403 -+   kept in a register.
113.7404 -+   ??? Not true anymore really. Now that call cannot address full range
113.7405 -+   of memory callr may need to be used */
113.7406 -+
113.7407 -+#define NO_FUNCTION_CSE
113.7408 -+#define NO_RECURSIVE_FUNCTION_CSE
113.7409 -+
113.7410 -+
113.7411 -+
113.7412 -+/*****************************************
113.7413 -+ * Defining the Output Assembler Language
113.7414 -+ *****************************************/
113.7415 -+
113.7416 -+/* ------------------------------------------ *
113.7417 -+ * The Overall Framework of an Assembler File
113.7418 -+ * ------------------------------------------ */
113.7419 -+
113.7420 -+#define ASM_APP_ON "#APP\n"
113.7421 -+#define ASM_APP_OFF "#NO_APP\n"
113.7422 -+
113.7423 -+#define ASM_COMMENT_START "# "
113.7424 -+
113.7425 -+/* ------------------------------- *
113.7426 -+ * Output and Generation of Labels
113.7427 -+ * ------------------------------- */
113.7428 -+
113.7429 -+#define GLOBAL_ASM_OP "\t.global\t"
113.7430 -+
113.7431 -+
113.7432 -+/* -------------- *
113.7433 -+ * Output of Data
113.7434 -+ * -------------- */
113.7435 -+
113.7436 -+#define DWARF2_UNWIND_INFO 0
113.7437 -+
113.7438 -+
113.7439 -+/* -------------------------------- *
113.7440 -+ * Assembler Commands for Alignment
113.7441 -+ * -------------------------------- */
113.7442 -+
113.7443 -+#define ASM_OUTPUT_ALIGN(FILE, LOG) \
113.7444 -+  do { \
113.7445 -+    fprintf ((FILE), "%s%d\n", ALIGN_ASM_OP, (LOG)); \
113.7446 -+  } while (0)
113.7447 -+
113.7448 -+
113.7449 -+/* -------------------------------- *
113.7450 -+ * Output of Assembler Instructions
113.7451 -+ * -------------------------------- */
113.7452 -+
113.7453 -+#define REGISTER_NAMES \
113.7454 -+{ \
113.7455 -+    "zero", \
113.7456 -+    "at", \
113.7457 -+    "r2", \
113.7458 -+    "r3", \
113.7459 -+    "r4", \
113.7460 -+    "r5", \
113.7461 -+    "r6", \
113.7462 -+    "r7", \
113.7463 -+    "r8", \
113.7464 -+    "r9", \
113.7465 -+    "r10", \
113.7466 -+    "r11", \
113.7467 -+    "r12", \
113.7468 -+    "r13", \
113.7469 -+    "r14", \
113.7470 -+    "r15", \
113.7471 -+    "r16", \
113.7472 -+    "r17", \
113.7473 -+    "r18", \
113.7474 -+    "r19", \
113.7475 -+    "r20", \
113.7476 -+    "r21", \
113.7477 -+    "r22", \
113.7478 -+    "r23", \
113.7479 -+    "r24", \
113.7480 -+    "r25", \
113.7481 -+    "gp", \
113.7482 -+    "sp", \
113.7483 -+    "fp", \
113.7484 -+    "ta", \
113.7485 -+    "ba", \
113.7486 -+    "ra", \
113.7487 -+    "status", \
113.7488 -+    "estatus", \
113.7489 -+    "bstatus", \
113.7490 -+    "ipri", \
113.7491 -+    "ecause", \
113.7492 -+    "pc", \
113.7493 -+    "rap", \
113.7494 -+    "fake_fp", \
113.7495 -+    "fake_ap", \
113.7496 -+}
113.7497 -+
113.7498 -+#define ASM_OUTPUT_OPCODE(STREAM, PTR)\
113.7499 -+   (PTR) = asm_output_opcode (STREAM, PTR)
113.7500 -+
113.7501 -+#define PRINT_OPERAND(STREAM, X, CODE) \
113.7502 -+    nios2_print_operand (STREAM, X, CODE)
113.7503 -+
113.7504 -+#define PRINT_OPERAND_ADDRESS(STREAM, X) \
113.7505 -+    nios2_print_operand_address (STREAM, X)
113.7506 -+
113.7507 -+#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
113.7508 -+do { fputs (integer_asm_op (POINTER_SIZE / BITS_PER_UNIT, TRUE), FILE); \
113.7509 -+     fprintf (FILE, ".L%u\n", (unsigned) (VALUE));               \
113.7510 -+   } while (0)
113.7511 -+
113.7512 -+
113.7513 -+/* ------------ *
113.7514 -+ * Label Output
113.7515 -+ * ------------ */
113.7516 -+
113.7517 -+
113.7518 -+/* ---------------------------------------------------- *
113.7519 -+ * Dividing the Output into Sections (Texts, Data, ...)
113.7520 -+ * ---------------------------------------------------- */
113.7521 -+
113.7522 -+/* Output before read-only data.  */
113.7523 -+#define TEXT_SECTION_ASM_OP ("\t.section\t.text")
113.7524 -+
113.7525 -+/* Output before writable data.  */
113.7526 -+#define DATA_SECTION_ASM_OP ("\t.section\t.data")
113.7527 -+
113.7528 -+
113.7529 -+/* Default the definition of "small data" to 8 bytes. */
113.7530 -+/* ??? How come I can't use HOST_WIDE_INT here? */
113.7531 -+extern unsigned long nios2_section_threshold;
113.7532 -+#define NIOS2_DEFAULT_GVALUE 8
113.7533 -+
113.7534 -+
113.7535 -+
113.7536 -+/* This says how to output assembler code to declare an
113.7537 -+   uninitialized external linkage data object.  Under SVR4,
113.7538 -+   the linker seems to want the alignment of data objects
113.7539 -+   to depend on their types.  We do exactly that here.  */
113.7540 -+
113.7541 -+#undef COMMON_ASM_OP
113.7542 -+#define COMMON_ASM_OP	"\t.comm\t"
113.7543 -+
113.7544 -+#undef  ASM_OUTPUT_ALIGNED_COMMON
113.7545 -+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)		\
113.7546 -+do 									\
113.7547 -+{									\
113.7548 -+  if ((SIZE) <= nios2_section_threshold)				\
113.7549 -+    {									\
113.7550 -+      named_section (0, ".sbss", 0);					\
113.7551 -+      (*targetm.asm_out.globalize_label) (FILE, NAME);			\
113.7552 -+      ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");			\
113.7553 -+      if (!flag_inhibit_size_directive)					\
113.7554 -+	ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE);			\
113.7555 -+      ASM_OUTPUT_ALIGN ((FILE), exact_log2((ALIGN) / BITS_PER_UNIT));	\
113.7556 -+      ASM_OUTPUT_LABEL(FILE, NAME);					\
113.7557 -+      ASM_OUTPUT_SKIP((FILE), (SIZE) ? (SIZE) : 1);			\
113.7558 -+    }									\
113.7559 -+  else									\
113.7560 -+    {									\
113.7561 -+      fprintf ((FILE), "%s", COMMON_ASM_OP);				\
113.7562 -+      assemble_name ((FILE), (NAME));					\
113.7563 -+      fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT);	\
113.7564 -+    }									\
113.7565 -+}									\
113.7566 -+while (0)
113.7567 -+
113.7568 -+
113.7569 -+/* This says how to output assembler code to declare an
113.7570 -+   uninitialized internal linkage data object.  Under SVR4,
113.7571 -+   the linker seems to want the alignment of data objects
113.7572 -+   to depend on their types.  We do exactly that here.  */
113.7573 -+
113.7574 -+#undef  ASM_OUTPUT_ALIGNED_LOCAL
113.7575 -+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)		\
113.7576 -+do {									\
113.7577 -+  if ((SIZE) <= nios2_section_threshold)				\
113.7578 -+    named_section (0, ".sbss", 0);					\
113.7579 -+  else									\
113.7580 -+    named_section (0, ".bss", 0);					\
113.7581 -+  ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");			\
113.7582 -+  if (!flag_inhibit_size_directive)					\
113.7583 -+    ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE);			\
113.7584 -+  ASM_OUTPUT_ALIGN ((FILE), exact_log2((ALIGN) / BITS_PER_UNIT));	\
113.7585 -+  ASM_OUTPUT_LABEL(FILE, NAME);						\
113.7586 -+  ASM_OUTPUT_SKIP((FILE), (SIZE) ? (SIZE) : 1);				\
113.7587 -+} while (0)
113.7588 -+
113.7589 -+
113.7590 -+
113.7591 -+/***************************
113.7592 -+ * Miscellaneous Parameters
113.7593 -+ ***************************/
113.7594 -+
113.7595 -+#define MOVE_MAX 4
113.7596 -+
113.7597 -+#define Pmode SImode
113.7598 -+#define FUNCTION_MODE QImode
113.7599 -+
113.7600 -+#define CASE_VECTOR_MODE Pmode
113.7601 -+
113.7602 -+#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
113.7603 -+
113.7604 -+#define LOAD_EXTEND_OP(MODE) (ZERO_EXTEND)
113.7605 -+
113.7606 -+#define WORD_REGISTER_OPERATIONS
113.7607 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2.md gcc-3.4.6/gcc/config/nios2/nios2.md
113.7608 ---- gcc-3.4.6.orig/gcc/config/nios2/nios2.md	1970-01-01 01:00:00.000000000 +0100
113.7609 -+++ gcc-3.4.6/gcc/config/nios2/nios2.md	2007-08-15 23:09:36.000000000 +0200
113.7610 -@@ -0,0 +1,2078 @@
113.7611 -+;; Machine Description for Altera NIOS 2G NIOS2 version.
113.7612 -+;;    Copyright (C) 2003 Altera 
113.7613 -+;;    Contributed by Jonah Graham (jgraham@altera.com).
113.7614 -+;; 
113.7615 -+;; This file is part of GNU CC.
113.7616 -+;; 
113.7617 -+;; GNU CC is free software; you can redistribute it and/or modify
113.7618 -+;; it under the terms of the GNU General Public License as published by
113.7619 -+;; the Free Software Foundation; either version 2, or (at your option)
113.7620 -+;; any later version.
113.7621 -+;; 
113.7622 -+;; GNU CC is distributed in the hope that it will be useful,
113.7623 -+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
113.7624 -+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
113.7625 -+;; GNU General Public License for more details.
113.7626 -+;; 
113.7627 -+;; You should have received a copy of the GNU General Public License
113.7628 -+;; along with GNU CC; see the file COPYING.  If not, write to
113.7629 -+;; the Free Software Foundation, 59 Temple Place - Suite 330,
113.7630 -+;; Boston, MA 02111-1307, USA.  */
113.7631 -+
113.7632 -+
113.7633 -+
113.7634 -+;*****************************************************************************
113.7635 -+;*
113.7636 -+;* constants
113.7637 -+;*
113.7638 -+;*****************************************************************************
113.7639 -+(define_constants [
113.7640 -+  (GP_REGNO 26)
113.7641 -+  (SP_REGNO 27)
113.7642 -+  (FP_REGNO 28)
113.7643 -+  (RA_REGNO 31)
113.7644 -+  (RAP_REGNO 38)
113.7645 -+  (FIRST_RETVAL_REGNO 2)
113.7646 -+  (LAST_RETVAL_REGNO 3)
113.7647 -+  (FIRST_ARG_REGNO 4)
113.7648 -+  (LAST_ARG_REGNO 7)
113.7649 -+  (SC_REGNO 23)
113.7650 -+  (PC_REGNO 37)
113.7651 -+  (FAKE_FP_REGNO 39)
113.7652 -+  (FAKE_AP_REGNO 40)
113.7653 -+
113.7654 -+
113.7655 -+  (UNSPEC_BLOCKAGE 0)
113.7656 -+  (UNSPEC_LDBIO 1)
113.7657 -+  (UNSPEC_LDBUIO 2)
113.7658 -+  (UNSPEC_LDHIO 3)
113.7659 -+  (UNSPEC_LDHUIO 4)
113.7660 -+  (UNSPEC_LDWIO 5)
113.7661 -+  (UNSPEC_STBIO 6)
113.7662 -+  (UNSPEC_STHIO 7)
113.7663 -+  (UNSPEC_STWIO 8)
113.7664 -+  (UNSPEC_SYNC 9)
113.7665 -+  (UNSPEC_WRCTL 10)
113.7666 -+  (UNSPEC_RDCTL 11)
113.7667 -+  
113.7668 -+])
113.7669 -+
113.7670 -+
113.7671 -+
113.7672 -+;*****************************************************************************
113.7673 -+;*
113.7674 -+;* instruction scheduler
113.7675 -+;*
113.7676 -+;*****************************************************************************
113.7677 -+
113.7678 -+; No schedule info is currently available, using an assumption that no
113.7679 -+; instruction can use the results of the previous instruction without
113.7680 -+; incuring a stall.
113.7681 -+
113.7682 -+; length of an instruction (in bytes)
113.7683 -+(define_attr "length" "" (const_int 4))
113.7684 -+(define_attr "type" "unknown,complex,control,alu,cond_alu,st,ld,shift,mul,div,custom" (const_string "complex"))
113.7685 -+
113.7686 -+(define_asm_attributes
113.7687 -+ [(set_attr "length" "4")
113.7688 -+  (set_attr "type" "complex")])
113.7689 -+
113.7690 -+(define_automaton "nios2")
113.7691 -+(automata_option "v")
113.7692 -+;(automata_option "no-minimization")
113.7693 -+(automata_option "ndfa")
113.7694 -+
113.7695 -+; The nios2 pipeline is fairly straightforward for the fast model.
113.7696 -+; Every alu operation is pipelined so that an instruction can
113.7697 -+; be issued every cycle. However, there are still potential
113.7698 -+; stalls which this description tries to deal with.
113.7699 -+
113.7700 -+(define_cpu_unit "cpu" "nios2")
113.7701 -+
113.7702 -+(define_insn_reservation "complex" 1
113.7703 -+  (eq_attr "type" "complex")
113.7704 -+  "cpu")
113.7705 -+
113.7706 -+(define_insn_reservation "control" 1
113.7707 -+  (eq_attr "type" "control")
113.7708 -+  "cpu")
113.7709 -+
113.7710 -+(define_insn_reservation "alu" 1
113.7711 -+  (eq_attr "type" "alu")
113.7712 -+  "cpu")
113.7713 -+
113.7714 -+(define_insn_reservation "cond_alu" 1
113.7715 -+  (eq_attr "type" "cond_alu")
113.7716 -+  "cpu")
113.7717 -+
113.7718 -+(define_insn_reservation "st" 1
113.7719 -+  (eq_attr "type" "st")
113.7720 -+  "cpu")
113.7721 -+  
113.7722 -+(define_insn_reservation "custom" 1
113.7723 -+  (eq_attr "type" "custom")
113.7724 -+  "cpu")
113.7725 -+
113.7726 -+; shifts, muls and lds have three cycle latency
113.7727 -+(define_insn_reservation "ld" 3
113.7728 -+  (eq_attr "type" "ld")
113.7729 -+  "cpu")
113.7730 -+
113.7731 -+(define_insn_reservation "shift" 3
113.7732 -+  (eq_attr "type" "shift")
113.7733 -+  "cpu")
113.7734 -+
113.7735 -+(define_insn_reservation "mul" 3
113.7736 -+  (eq_attr "type" "mul")
113.7737 -+  "cpu")
113.7738 -+
113.7739 -+(define_insn_reservation "div" 1
113.7740 -+  (eq_attr "type" "div")
113.7741 -+  "cpu")
113.7742 -+
113.7743 -+
113.7744 -+;*****************************************************************************
113.7745 -+;*
113.7746 -+;* MOV Instructions
113.7747 -+;*
113.7748 -+;*****************************************************************************
113.7749 -+
113.7750 -+(define_expand "movqi"
113.7751 -+  [(set (match_operand:QI 0 "nonimmediate_operand" "")
113.7752 -+        (match_operand:QI 1 "general_operand" ""))]
113.7753 -+  ""
113.7754 -+{
113.7755 -+  if (nios2_emit_move_sequence (operands, QImode))
113.7756 -+    DONE;
113.7757 -+})
113.7758 -+
113.7759 -+(define_insn "movqi_internal"
113.7760 -+  [(set (match_operand:QI 0 "nonimmediate_operand" "=m, r,r, r")
113.7761 -+        (match_operand:QI 1 "general_operand"       "rM,m,rM,I"))]
113.7762 -+  "(register_operand (operands[0], QImode)
113.7763 -+    || register_operand (operands[1], QImode)
113.7764 -+    || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
113.7765 -+  "@
113.7766 -+    stb%o0\\t%z1, %0
113.7767 -+    ldbu%o1\\t%0, %1
113.7768 -+    mov\\t%0, %z1
113.7769 -+    movi\\t%0, %1"
113.7770 -+  [(set_attr "type" "st,ld,alu,alu")])
113.7771 -+
113.7772 -+(define_insn "ldbio"
113.7773 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.7774 -+	(unspec_volatile:SI [(const_int 0)] UNSPEC_LDBIO))
113.7775 -+   (use (match_operand:SI 1 "memory_operand" "m"))]
113.7776 -+  ""
113.7777 -+  "ldbio\\t%0, %1"
113.7778 -+  [(set_attr "type" "ld")])
113.7779 -+
113.7780 -+(define_insn "ldbuio"
113.7781 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.7782 -+	(unspec_volatile:SI [(const_int 0)] UNSPEC_LDBUIO))
113.7783 -+   (use (match_operand:SI 1 "memory_operand" "m"))]
113.7784 -+  ""
113.7785 -+  "ldbuio\\t%0, %1"
113.7786 -+  [(set_attr "type" "ld")])
113.7787 -+
113.7788 -+(define_insn "stbio"
113.7789 -+  [(set (match_operand:SI 0 "memory_operand" "=m")
113.7790 -+	(match_operand:SI 1 "register_operand"   "r"))
113.7791 -+   (unspec_volatile:SI [(const_int 0)] UNSPEC_STBIO)]
113.7792 -+  ""
113.7793 -+  "stbio\\t%z1, %0"
113.7794 -+  [(set_attr "type" "st")])
113.7795 -+
113.7796 -+
113.7797 -+(define_expand "movhi"
113.7798 -+  [(set (match_operand:HI 0 "nonimmediate_operand" "")
113.7799 -+        (match_operand:HI 1 "general_operand" ""))]
113.7800 -+  ""
113.7801 -+{
113.7802 -+  if (nios2_emit_move_sequence (operands, HImode))
113.7803 -+    DONE;
113.7804 -+})
113.7805 -+
113.7806 -+(define_insn "movhi_internal"
113.7807 -+  [(set (match_operand:HI 0 "nonimmediate_operand" "=m, r,r, r,r")
113.7808 -+        (match_operand:HI 1 "general_operand"       "rM,m,rM,I,J"))]
113.7809 -+  "(register_operand (operands[0], HImode)
113.7810 -+    || register_operand (operands[1], HImode)
113.7811 -+    || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
113.7812 -+  "@
113.7813 -+    sth%o0\\t%z1, %0
113.7814 -+    ldhu%o1\\t%0, %1
113.7815 -+    mov\\t%0, %z1
113.7816 -+    movi\\t%0, %1
113.7817 -+    movui\\t%0, %1"
113.7818 -+  [(set_attr "type" "st,ld,alu,alu,alu")])
113.7819 -+
113.7820 -+(define_insn "ldhio"
113.7821 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.7822 -+	(unspec_volatile:SI [(const_int 0)] UNSPEC_LDHIO))
113.7823 -+   (use (match_operand:SI 1 "memory_operand" "m"))]
113.7824 -+  ""
113.7825 -+  "ldhio\\t%0, %1"
113.7826 -+  [(set_attr "type" "ld")])
113.7827 -+
113.7828 -+(define_insn "ldhuio"
113.7829 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.7830 -+	(unspec_volatile:SI [(const_int 0)] UNSPEC_LDHUIO))
113.7831 -+   (use (match_operand:SI 1 "memory_operand" "m"))]
113.7832 -+  ""
113.7833 -+  "ldhuio\\t%0, %1"
113.7834 -+  [(set_attr "type" "ld")])
113.7835 -+
113.7836 -+(define_insn "sthio"
113.7837 -+  [(set (match_operand:SI 0 "memory_operand" "=m")
113.7838 -+	(match_operand:SI 1 "register_operand"   "r"))
113.7839 -+   (unspec_volatile:SI [(const_int 0)] UNSPEC_STHIO)]
113.7840 -+  ""
113.7841 -+  "sthio\\t%z1, %0"
113.7842 -+  [(set_attr "type" "st")])
113.7843 -+
113.7844 -+(define_expand "movsi"
113.7845 -+  [(set (match_operand:SI 0 "nonimmediate_operand" "")
113.7846 -+        (match_operand:SI 1 "general_operand" ""))]
113.7847 -+  ""
113.7848 -+{
113.7849 -+  if (nios2_emit_move_sequence (operands, SImode))
113.7850 -+    DONE;
113.7851 -+})
113.7852 -+
113.7853 -+(define_insn "movsi_internal"
113.7854 -+  [(set (match_operand:SI 0 "nonimmediate_operand" "=m, r,r, r,r,r,r")
113.7855 -+        (match_operand:SI 1 "general_operand"       "rM,m,rM,I,J,S,i"))]
113.7856 -+  "(register_operand (operands[0], SImode)
113.7857 -+    || register_operand (operands[1], SImode)
113.7858 -+    || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
113.7859 -+  "@
113.7860 -+    stw%o0\\t%z1, %0
113.7861 -+    ldw%o1\\t%0, %1
113.7862 -+    mov\\t%0, %z1
113.7863 -+    movi\\t%0, %1
113.7864 -+    movui\\t%0, %1
113.7865 -+    addi\\t%0, gp, %%gprel(%1)
113.7866 -+    movhi\\t%0, %H1\;addi\\t%0, %0, %L1"
113.7867 -+  [(set_attr "type" "st,ld,alu,alu,alu,alu,alu")])
113.7868 -+
113.7869 -+(define_insn "ldwio"
113.7870 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.7871 -+	(unspec_volatile:SI [(const_int 0)] UNSPEC_LDWIO))
113.7872 -+   (use (match_operand:SI 1 "memory_operand" "m"))]
113.7873 -+  ""
113.7874 -+  "ldwio\\t%0, %1"
113.7875 -+  [(set_attr "type" "ld")])
113.7876 -+
113.7877 -+(define_insn "stwio"
113.7878 -+  [(set (match_operand:SI 0 "memory_operand" "=m")
113.7879 -+	(match_operand:SI 1 "register_operand"   "r"))
113.7880 -+   (unspec_volatile:SI [(const_int 0)] UNSPEC_STWIO)]
113.7881 -+  ""
113.7882 -+  "stwio\\t%z1, %0"
113.7883 -+  [(set_attr "type" "st")])
113.7884 -+
113.7885 -+
113.7886 -+
113.7887 -+;*****************************************************************************
113.7888 -+;*
113.7889 -+;* zero extension
113.7890 -+;*
113.7891 -+;*****************************************************************************
113.7892 -+
113.7893 -+
113.7894 -+(define_insn "zero_extendhisi2"
113.7895 -+  [(set (match_operand:SI 0 "register_operand" "=r,r")
113.7896 -+	(zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
113.7897 -+  ""
113.7898 -+  "@
113.7899 -+    andi\\t%0, %1, 0xffff
113.7900 -+    ldhu%o1\\t%0, %1"
113.7901 -+  [(set_attr "type"	"alu,ld")])
113.7902 -+
113.7903 -+(define_insn "zero_extendqihi2"
113.7904 -+  [(set (match_operand:HI 0 "register_operand" "=r,r")
113.7905 -+	(zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
113.7906 -+  ""
113.7907 -+  "@
113.7908 -+    andi\\t%0, %1, 0xff
113.7909 -+    ldbu%o1\\t%0, %1"
113.7910 -+  [(set_attr "type"	"alu,ld")])
113.7911 -+
113.7912 -+(define_insn "zero_extendqisi2"
113.7913 -+  [(set (match_operand:SI 0 "register_operand" "=r,r")
113.7914 -+	(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
113.7915 -+  ""
113.7916 -+  "@
113.7917 -+    andi\\t%0, %1, 0xff
113.7918 -+    ldbu%o1\\t%0, %1"
113.7919 -+  [(set_attr "type"	"alu,ld")])
113.7920 -+
113.7921 -+
113.7922 -+
113.7923 -+;*****************************************************************************
113.7924 -+;*
113.7925 -+;* sign extension
113.7926 -+;*
113.7927 -+;*****************************************************************************
113.7928 -+
113.7929 -+(define_expand "extendhisi2"
113.7930 -+  [(set (match_operand:SI 0 "register_operand" "")
113.7931 -+	(sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))]
113.7932 -+  ""
113.7933 -+{
113.7934 -+  if (optimize && GET_CODE (operands[1]) == MEM)
113.7935 -+    operands[1] = force_not_mem (operands[1]);
113.7936 -+
113.7937 -+  if (GET_CODE (operands[1]) != MEM)
113.7938 -+    {
113.7939 -+      rtx op1   = gen_lowpart (SImode, operands[1]);
113.7940 -+      rtx temp  = gen_reg_rtx (SImode);
113.7941 -+      rtx shift = GEN_INT (16);
113.7942 -+
113.7943 -+      emit_insn (gen_ashlsi3 (temp, op1, shift));
113.7944 -+      emit_insn (gen_ashrsi3 (operands[0], temp, shift));
113.7945 -+      DONE;
113.7946 -+    }
113.7947 -+})
113.7948 -+
113.7949 -+(define_insn "extendhisi2_internal"
113.7950 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.7951 -+	(sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
113.7952 -+  ""
113.7953 -+  "ldh%o1\\t%0, %1"
113.7954 -+  [(set_attr "type"	"ld")])
113.7955 -+
113.7956 -+(define_expand "extendqihi2"
113.7957 -+  [(set (match_operand:HI 0 "register_operand" "")
113.7958 -+	(sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))]
113.7959 -+  ""
113.7960 -+{
113.7961 -+  if (optimize && GET_CODE (operands[1]) == MEM)
113.7962 -+    operands[1] = force_not_mem (operands[1]);
113.7963 -+
113.7964 -+  if (GET_CODE (operands[1]) != MEM)
113.7965 -+    {
113.7966 -+      rtx op0   = gen_lowpart (SImode, operands[0]);
113.7967 -+      rtx op1   = gen_lowpart (SImode, operands[1]);
113.7968 -+      rtx temp  = gen_reg_rtx (SImode);
113.7969 -+      rtx shift = GEN_INT (24);
113.7970 -+
113.7971 -+      emit_insn (gen_ashlsi3 (temp, op1, shift));
113.7972 -+      emit_insn (gen_ashrsi3 (op0, temp, shift));
113.7973 -+      DONE;
113.7974 -+    }
113.7975 -+})
113.7976 -+
113.7977 -+(define_insn "extendqihi2_internal"
113.7978 -+  [(set (match_operand:HI 0 "register_operand" "=r")
113.7979 -+	(sign_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
113.7980 -+  ""
113.7981 -+  "ldb%o1\\t%0, %1"
113.7982 -+  [(set_attr "type"	"ld")])
113.7983 -+
113.7984 -+
113.7985 -+(define_expand "extendqisi2"
113.7986 -+  [(set (match_operand:SI 0 "register_operand" "")
113.7987 -+	(sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
113.7988 -+  ""
113.7989 -+{
113.7990 -+  if (optimize && GET_CODE (operands[1]) == MEM)
113.7991 -+    operands[1] = force_not_mem (operands[1]);
113.7992 -+
113.7993 -+  if (GET_CODE (operands[1]) != MEM)
113.7994 -+    {
113.7995 -+      rtx op1   = gen_lowpart (SImode, operands[1]);
113.7996 -+      rtx temp  = gen_reg_rtx (SImode);
113.7997 -+      rtx shift = GEN_INT (24);
113.7998 -+
113.7999 -+      emit_insn (gen_ashlsi3 (temp, op1, shift));
113.8000 -+      emit_insn (gen_ashrsi3 (operands[0], temp, shift));
113.8001 -+      DONE;
113.8002 -+    }
113.8003 -+})
113.8004 -+
113.8005 -+(define_insn "extendqisi2_insn"
113.8006 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.8007 -+	(sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
113.8008 -+  ""
113.8009 -+  "ldb%o1\\t%0, %1"
113.8010 -+  [(set_attr "type"	"ld")])
113.8011 -+
113.8012 -+
113.8013 -+
113.8014 -+;*****************************************************************************
113.8015 -+;*
113.8016 -+;* Arithmetic Operations
113.8017 -+;*
113.8018 -+;*****************************************************************************
113.8019 -+
113.8020 -+(define_insn "addsi3"
113.8021 -+  [(set (match_operand:SI 0 "register_operand"          "=r,r")
113.8022 -+        (plus:SI (match_operand:SI 1 "register_operand" "%r,r")
113.8023 -+                 (match_operand:SI 2 "arith_operand"     "r,I")))]
113.8024 -+  ""
113.8025 -+  "add%i2\\t%0, %1, %z2"
113.8026 -+  [(set_attr "type" "alu")])
113.8027 -+
113.8028 -+(define_insn "subsi3"
113.8029 -+  [(set (match_operand:SI 0 "register_operand"           "=r")
113.8030 -+        (minus:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
113.8031 -+                  (match_operand:SI 2 "register_operand"  "r")))]
113.8032 -+  ""
113.8033 -+  "sub\\t%0, %z1, %2"
113.8034 -+  [(set_attr "type" "alu")])
113.8035 -+
113.8036 -+(define_insn "mulsi3"
113.8037 -+  [(set (match_operand:SI 0 "register_operand"            "=r,r")
113.8038 -+        (mult:SI (match_operand:SI 1 "register_operand"    "r,r")
113.8039 -+                 (match_operand:SI 2 "arith_operand"       "r,I")))]
113.8040 -+  "TARGET_HAS_MUL"
113.8041 -+  "mul%i2\\t%0, %1, %z2"
113.8042 -+  [(set_attr "type" "mul")])
113.8043 -+
113.8044 -+(define_expand "divsi3"
113.8045 -+  [(set (match_operand:SI 0 "register_operand"            "=r")
113.8046 -+        (div:SI (match_operand:SI 1 "register_operand"     "r")
113.8047 -+                (match_operand:SI 2 "register_operand"     "r")))]
113.8048 -+  ""
113.8049 -+{
113.8050 -+  if (!TARGET_HAS_DIV)
113.8051 -+    {
113.8052 -+      if (!TARGET_FAST_SW_DIV)
113.8053 -+	FAIL;
113.8054 -+      else
113.8055 -+        {
113.8056 -+	  if (nios2_emit_expensive_div (operands, SImode))
113.8057 -+	    DONE;
113.8058 -+	}
113.8059 -+    }
113.8060 -+})
113.8061 -+
113.8062 -+(define_insn "divsi3_insn"
113.8063 -+  [(set (match_operand:SI 0 "register_operand"            "=r")
113.8064 -+        (div:SI (match_operand:SI 1 "register_operand"     "r")
113.8065 -+                (match_operand:SI 2 "register_operand"     "r")))]
113.8066 -+  "TARGET_HAS_DIV"
113.8067 -+  "div\\t%0, %1, %2"
113.8068 -+  [(set_attr "type" "div")])
113.8069 -+
113.8070 -+(define_insn "udivsi3"
113.8071 -+  [(set (match_operand:SI 0 "register_operand"            "=r")
113.8072 -+        (udiv:SI (match_operand:SI 1 "register_operand"     "r")
113.8073 -+                (match_operand:SI 2 "register_operand"     "r")))]
113.8074 -+  "TARGET_HAS_DIV"
113.8075 -+  "divu\\t%0, %1, %2"
113.8076 -+  [(set_attr "type" "div")])
113.8077 -+
113.8078 -+(define_insn "smulsi3_highpart"
113.8079 -+  [(set (match_operand:SI 0 "register_operand"                            "=r")
113.8080 -+	(truncate:SI
113.8081 -+	 (lshiftrt:DI
113.8082 -+	  (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand"  "r"))
113.8083 -+		   (sign_extend:DI (match_operand:SI 2 "register_operand"  "r")))
113.8084 -+	  (const_int 32))))]
113.8085 -+  "TARGET_HAS_MULX"
113.8086 -+  "mulxss\\t%0, %1, %2"
113.8087 -+  [(set_attr "type" "mul")])
113.8088 -+
113.8089 -+(define_insn "umulsi3_highpart"
113.8090 -+  [(set (match_operand:SI 0 "register_operand"                            "=r")
113.8091 -+	(truncate:SI
113.8092 -+	 (lshiftrt:DI
113.8093 -+	  (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand"  "r"))
113.8094 -+		   (zero_extend:DI (match_operand:SI 2 "register_operand"  "r")))
113.8095 -+	  (const_int 32))))]
113.8096 -+  "TARGET_HAS_MULX"
113.8097 -+  "mulxuu\\t%0, %1, %2"
113.8098 -+  [(set_attr "type" "mul")])
113.8099 -+
113.8100 -+
113.8101 -+(define_expand "mulsidi3"
113.8102 -+    [(set (subreg:SI (match_operand:DI 0 "register_operand" "") 0)
113.8103 -+	  (mult:SI (match_operand:SI 1 "register_operand" "")
113.8104 -+		   (match_operand:SI 2 "register_operand" "")))
113.8105 -+     (set (subreg:SI (match_dup 0) 4)
113.8106 -+	  (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
113.8107 -+					     (sign_extend:DI (match_dup 2)))
113.8108 -+				    (const_int 32))))]
113.8109 -+  "TARGET_HAS_MULX"
113.8110 -+  "")
113.8111 -+
113.8112 -+(define_expand "umulsidi3"
113.8113 -+    [(set (subreg:SI (match_operand:DI 0 "register_operand" "") 0)
113.8114 -+	  (mult:SI (match_operand:SI 1 "register_operand" "")
113.8115 -+		   (match_operand:SI 2 "register_operand" "")))
113.8116 -+     (set (subreg:SI (match_dup 0) 4)
113.8117 -+	  (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
113.8118 -+					     (zero_extend:DI (match_dup 2)))
113.8119 -+				    (const_int 32))))]
113.8120 -+  "TARGET_HAS_MULX"
113.8121 -+  "")
113.8122 -+
113.8123 -+
113.8124 -+
113.8125 -+;*****************************************************************************
113.8126 -+;*
113.8127 -+;* Negate and ones complement
113.8128 -+;*
113.8129 -+;*****************************************************************************
113.8130 -+
113.8131 -+(define_insn "negsi2"
113.8132 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8133 -+	(neg:SI (match_operand:SI 1 "register_operand" "r")))]
113.8134 -+  ""
113.8135 -+{
113.8136 -+  operands[2] = const0_rtx;
113.8137 -+  return "sub\\t%0, %z2, %1";
113.8138 -+}
113.8139 -+  [(set_attr "type" "alu")])
113.8140 -+
113.8141 -+(define_insn "one_cmplsi2"
113.8142 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8143 -+	(not:SI (match_operand:SI 1 "register_operand" "r")))]
113.8144 -+  ""
113.8145 -+{
113.8146 -+  operands[2] = const0_rtx;
113.8147 -+  return "nor\\t%0, %z2, %1";
113.8148 -+}
113.8149 -+  [(set_attr "type" "alu")])
113.8150 -+
113.8151 -+
113.8152 -+
113.8153 -+; Logical Operantions
113.8154 -+
113.8155 -+(define_insn "andsi3"
113.8156 -+  [(set (match_operand:SI 0 "register_operand"         "=r, r,r")
113.8157 -+        (and:SI (match_operand:SI 1 "register_operand" "%r, r,r")
113.8158 -+                (match_operand:SI 2 "logical_operand"   "rM,J,K")))]
113.8159 -+  ""
113.8160 -+  "@
113.8161 -+    and\\t%0, %1, %z2
113.8162 -+    and%i2\\t%0, %1, %2
113.8163 -+    andh%i2\\t%0, %1, %U2"
113.8164 -+  [(set_attr "type" "alu")])
113.8165 -+
113.8166 -+(define_insn "iorsi3"
113.8167 -+  [(set (match_operand:SI 0 "register_operand"          "=r, r,r")
113.8168 -+        (ior:SI (match_operand:SI 1 "register_operand"  "%r, r,r")
113.8169 -+                (match_operand:SI 2 "logical_operand"    "rM,J,K")))]
113.8170 -+  ""
113.8171 -+  "@
113.8172 -+    or\\t%0, %1, %z2
113.8173 -+    or%i2\\t%0, %1, %2
113.8174 -+    orh%i2\\t%0, %1, %U2"
113.8175 -+  [(set_attr "type" "alu")])
113.8176 -+
113.8177 -+(define_insn "*norsi3"
113.8178 -+  [(set (match_operand:SI 0 "register_operand"                  "=r")
113.8179 -+        (and:SI (not:SI (match_operand:SI 1 "register_operand"  "%r"))
113.8180 -+                (not:SI (match_operand:SI 2 "reg_or_0_operand"   "rM"))))]
113.8181 -+  ""
113.8182 -+  "nor\\t%0, %1, %z2"
113.8183 -+  [(set_attr "type" "alu")])
113.8184 -+
113.8185 -+(define_insn "xorsi3"
113.8186 -+  [(set (match_operand:SI 0 "register_operand"          "=r, r,r")
113.8187 -+        (xor:SI (match_operand:SI 1 "register_operand"  "%r, r,r")
113.8188 -+                (match_operand:SI 2 "logical_operand"    "rM,J,K")))]
113.8189 -+  ""
113.8190 -+  "@
113.8191 -+    xor\\t%0, %1, %z2
113.8192 -+    xor%i2\\t%0, %1, %2
113.8193 -+    xorh%i2\\t%0, %1, %U2"
113.8194 -+  [(set_attr "type" "alu")])
113.8195 -+
113.8196 -+
113.8197 -+
113.8198 -+;*****************************************************************************
113.8199 -+;*
113.8200 -+;* Shifts
113.8201 -+;*
113.8202 -+;*****************************************************************************
113.8203 -+
113.8204 -+(define_insn "ashlsi3"
113.8205 -+  [(set (match_operand:SI 0 "register_operand"           "=r,r")
113.8206 -+	(ashift:SI (match_operand:SI 1 "register_operand" "r,r")
113.8207 -+		   (match_operand:SI 2 "shift_operand"    "r,L")))]
113.8208 -+  ""
113.8209 -+  "sll%i2\\t%0, %1, %z2"
113.8210 -+  [(set_attr "type" "shift")])
113.8211 -+
113.8212 -+(define_insn "ashrsi3"
113.8213 -+  [(set (match_operand:SI 0 "register_operand"             "=r,r")
113.8214 -+	(ashiftrt:SI (match_operand:SI 1 "register_operand" "r,r")
113.8215 -+		     (match_operand:SI 2 "shift_operand"    "r,L")))]
113.8216 -+  ""
113.8217 -+  "sra%i2\\t%0, %1, %z2"
113.8218 -+  [(set_attr "type" "shift")])
113.8219 -+
113.8220 -+(define_insn "lshrsi3"
113.8221 -+  [(set (match_operand:SI 0 "register_operand"             "=r,r")
113.8222 -+	(lshiftrt:SI (match_operand:SI 1 "register_operand" "r,r")
113.8223 -+		     (match_operand:SI 2 "shift_operand"    "r,L")))]
113.8224 -+  ""
113.8225 -+  "srl%i2\\t%0, %1, %z2"
113.8226 -+  [(set_attr "type" "shift")])
113.8227 -+
113.8228 -+(define_insn "rotlsi3"
113.8229 -+  [(set (match_operand:SI 0 "register_operand"           "=r,r")
113.8230 -+	(rotate:SI (match_operand:SI 1 "register_operand" "r,r")
113.8231 -+		   (match_operand:SI 2 "shift_operand"    "r,L")))]
113.8232 -+  ""
113.8233 -+  "rol%i2\\t%0, %1, %z2"
113.8234 -+  [(set_attr "type" "shift")])
113.8235 -+
113.8236 -+(define_insn "rotrsi3"
113.8237 -+  [(set (match_operand:SI 0 "register_operand"             "=r,r")
113.8238 -+	(rotatert:SI (match_operand:SI 1 "register_operand" "r,r")
113.8239 -+		     (match_operand:SI 2 "register_operand" "r,r")))]
113.8240 -+  ""
113.8241 -+  "ror\\t%0, %1, %2"
113.8242 -+  [(set_attr "type" "shift")])
113.8243 -+
113.8244 -+(define_insn "*shift_mul_constants"
113.8245 -+  [(set (match_operand:SI 0 "register_operand"                     "=r")
113.8246 -+	(ashift:SI (mult:SI (match_operand:SI 1 "register_operand"  "r")
113.8247 -+		            (match_operand:SI 2 "const_int_operand" "I"))
113.8248 -+		   (match_operand:SI 3          "const_int_operand" "I")))]
113.8249 -+  "TARGET_HAS_MUL && SMALL_INT (INTVAL (operands[2]) << INTVAL (operands[3]))"
113.8250 -+{
113.8251 -+  HOST_WIDE_INT mul = INTVAL (operands[2]) << INTVAL (operands[3]);
113.8252 -+  rtx ops[3];
113.8253 -+  
113.8254 -+  ops[0] = operands[0];
113.8255 -+  ops[1] = operands[1];
113.8256 -+  ops[2] = GEN_INT (mul);
113.8257 -+  
113.8258 -+  output_asm_insn ("muli\t%0, %1, %2", ops);
113.8259 -+  return "";
113.8260 -+}
113.8261 -+  [(set_attr "type" "mul")])
113.8262 -+
113.8263 -+
113.8264 -+
113.8265 -+
113.8266 -+;*****************************************************************************
113.8267 -+;*
113.8268 -+;* Prologue, Epilogue and Return
113.8269 -+;*
113.8270 -+;*****************************************************************************
113.8271 -+
113.8272 -+(define_expand "prologue"
113.8273 -+  [(const_int 1)]
113.8274 -+  ""
113.8275 -+{
113.8276 -+  expand_prologue ();
113.8277 -+  DONE;
113.8278 -+})
113.8279 -+
113.8280 -+(define_expand "epilogue"
113.8281 -+  [(return)]
113.8282 -+  ""
113.8283 -+{
113.8284 -+  expand_epilogue (false);
113.8285 -+  DONE;
113.8286 -+})
113.8287 -+
113.8288 -+(define_expand "sibcall_epilogue"
113.8289 -+  [(return)]
113.8290 -+  ""
113.8291 -+{
113.8292 -+  expand_epilogue (true);
113.8293 -+  DONE;
113.8294 -+})
113.8295 -+
113.8296 -+(define_insn "return"
113.8297 -+  [(return)]
113.8298 -+  "reload_completed && nios2_can_use_return_insn ()"
113.8299 -+  "ret\\t"
113.8300 -+)
113.8301 -+
113.8302 -+(define_insn "return_from_epilogue"
113.8303 -+  [(use (match_operand 0 "pmode_register_operand" ""))
113.8304 -+   (return)]
113.8305 -+  "reload_completed"
113.8306 -+  "ret\\t"
113.8307 -+)
113.8308 -+
113.8309 -+;; Block any insns from being moved before this point, since the
113.8310 -+;; profiling call to mcount can use various registers that aren't
113.8311 -+;; saved or used to pass arguments.
113.8312 -+
113.8313 -+(define_insn "blockage"
113.8314 -+  [(unspec_volatile [(const_int 0)] UNSPEC_BLOCKAGE)]
113.8315 -+  ""
113.8316 -+  ""
113.8317 -+  [(set_attr "type" "unknown")
113.8318 -+   (set_attr "length" "0")])
113.8319 -+
113.8320 -+
113.8321 -+
113.8322 -+;*****************************************************************************
113.8323 -+;*
113.8324 -+;* Jumps and Calls
113.8325 -+;*
113.8326 -+;*****************************************************************************
113.8327 -+
113.8328 -+(define_insn "indirect_jump"
113.8329 -+  [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
113.8330 -+  ""
113.8331 -+  "jmp\\t%0"
113.8332 -+  [(set_attr "type" "control")])
113.8333 -+
113.8334 -+(define_insn "jump"
113.8335 -+  [(set (pc)
113.8336 -+        (label_ref (match_operand 0 "" "")))]
113.8337 -+  ""
113.8338 -+  "br\\t%0"
113.8339 -+  [(set_attr "type" "control")])
113.8340 -+
113.8341 -+
113.8342 -+(define_insn "indirect_call"
113.8343 -+  [(call (mem:QI (match_operand:SI 0 "register_operand" "r"))
113.8344 -+         (match_operand 1 "" ""))
113.8345 -+   (clobber (reg:SI RA_REGNO))]
113.8346 -+  ""
113.8347 -+  "callr\\t%0"
113.8348 -+  [(set_attr "type" "control")])
113.8349 -+
113.8350 -+(define_insn "indirect_call_value"
113.8351 -+  [(set (match_operand 0 "" "")
113.8352 -+        (call (mem:QI (match_operand:SI 1 "register_operand" "r"))
113.8353 -+              (match_operand 2 "" "")))
113.8354 -+   (clobber (reg:SI RA_REGNO))]
113.8355 -+  ""
113.8356 -+  "callr\\t%1"
113.8357 -+)
113.8358 -+
113.8359 -+(define_expand "call"
113.8360 -+  [(parallel [(call (match_operand 0 "" "")
113.8361 -+                    (match_operand 1 "" ""))
113.8362 -+              (clobber (reg:SI RA_REGNO))])]
113.8363 -+  ""
113.8364 -+  "")
113.8365 -+
113.8366 -+(define_expand "call_value"
113.8367 -+  [(parallel [(set (match_operand 0 "" "")
113.8368 -+                   (call (match_operand 1 "" "")
113.8369 -+                         (match_operand 2 "" "")))
113.8370 -+              (clobber (reg:SI RA_REGNO))])]
113.8371 -+  ""
113.8372 -+  "")
113.8373 -+
113.8374 -+(define_insn "*call"
113.8375 -+  [(call (mem:QI (match_operand:SI 0 "immediate_operand" "i"))
113.8376 -+         (match_operand 1 "" ""))
113.8377 -+   (clobber (match_operand:SI 2 "register_operand" "=r"))]
113.8378 -+  ""
113.8379 -+  "call\\t%0"
113.8380 -+  [(set_attr "type" "control")])
113.8381 -+
113.8382 -+(define_insn "*call_value"
113.8383 -+  [(set (match_operand 0 "" "")
113.8384 -+        (call (mem:QI (match_operand:SI 1 "immediate_operand" "i"))
113.8385 -+              (match_operand 2 "" "")))
113.8386 -+   (clobber (match_operand:SI 3 "register_operand" "=r"))]
113.8387 -+  ""
113.8388 -+  "call\\t%1"
113.8389 -+  [(set_attr "type" "control")])
113.8390 -+
113.8391 -+(define_expand "sibcall"
113.8392 -+  [(parallel [(call (match_operand 0 "" "")
113.8393 -+		    (match_operand 1 "" ""))
113.8394 -+	      (return)
113.8395 -+	      (use (match_operand 2 "" ""))])]
113.8396 -+  ""
113.8397 -+  {
113.8398 -+    XEXP (operands[0], 0) = copy_to_mode_reg (SImode, XEXP (operands[0], 0));
113.8399 -+
113.8400 -+    if (operands[2] == NULL_RTX)
113.8401 -+      operands[2] = const0_rtx;
113.8402 -+  }
113.8403 -+)
113.8404 -+
113.8405 -+(define_expand "sibcall_value"
113.8406 -+  [(parallel [(set (match_operand 0 "" "")
113.8407 -+		   (call (match_operand 1 "" "")
113.8408 -+			 (match_operand 2 "" "")))
113.8409 -+	      (return)
113.8410 -+	      (use (match_operand 3 "" ""))])]
113.8411 -+  ""
113.8412 -+  {
113.8413 -+    XEXP (operands[1], 0) = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
113.8414 -+
113.8415 -+    if (operands[3] == NULL_RTX)
113.8416 -+      operands[3] = const0_rtx;
113.8417 -+  }
113.8418 -+)
113.8419 -+
113.8420 -+(define_insn "sibcall_insn"
113.8421 -+ [(call (mem:QI (match_operand:SI 0 "register_operand" "r"))
113.8422 -+	(match_operand 1 "" ""))
113.8423 -+  (return)
113.8424 -+  (use (match_operand 2 "" ""))]
113.8425 -+  ""
113.8426 -+  "jmp\\t%0"
113.8427 -+)
113.8428 -+
113.8429 -+(define_insn "sibcall_value_insn"
113.8430 -+ [(set (match_operand 0 "register_operand" "")
113.8431 -+       (call (mem:QI (match_operand:SI 1 "register_operand" "r"))
113.8432 -+	     (match_operand 2 "" "")))
113.8433 -+  (return)
113.8434 -+  (use (match_operand 3 "" ""))]
113.8435 -+  ""
113.8436 -+  "jmp\\t%1"
113.8437 -+)
113.8438 -+
113.8439 -+
113.8440 -+
113.8441 -+
113.8442 -+(define_expand "tablejump"
113.8443 -+  [(parallel [(set (pc) (match_operand 0 "register_operand" "r"))
113.8444 -+              (use (label_ref (match_operand 1 "" "")))])]
113.8445 -+  ""
113.8446 -+  ""
113.8447 -+)
113.8448 -+
113.8449 -+(define_insn "*tablejump"
113.8450 -+  [(set (pc)
113.8451 -+	(match_operand:SI 0 "register_operand" "r"))
113.8452 -+   (use (label_ref (match_operand 1 "" "")))]
113.8453 -+  ""
113.8454 -+  "jmp\\t%0"
113.8455 -+  [(set_attr "type" "control")])
113.8456 -+
113.8457 -+
113.8458 -+
113.8459 -+;*****************************************************************************
113.8460 -+;*
113.8461 -+;* Comparisons
113.8462 -+;*
113.8463 -+;*****************************************************************************
113.8464 -+;; Flow here is rather complex (based on MIPS):
113.8465 -+;;
113.8466 -+;;  1)	The cmp{si,di,sf,df} routine is called.  It deposits the
113.8467 -+;;	arguments into the branch_cmp array, and the type into
113.8468 -+;;	branch_type.  No RTL is generated.
113.8469 -+;;
113.8470 -+;;  2)	The appropriate branch define_expand is called, which then
113.8471 -+;;	creates the appropriate RTL for the comparison and branch.
113.8472 -+;;	Different CC modes are used, based on what type of branch is
113.8473 -+;;	done, so that we can constrain things appropriately.  There
113.8474 -+;;	are assumptions in the rest of GCC that break if we fold the
113.8475 -+;;	operands into the branchs for integer operations, and use cc0
113.8476 -+;;	for floating point, so we use the fp status register instead.
113.8477 -+;;	If needed, an appropriate temporary is created to hold the
113.8478 -+;;	of the integer compare.
113.8479 -+
113.8480 -+(define_expand "cmpsi"
113.8481 -+  [(set (cc0)
113.8482 -+	(compare:CC (match_operand:SI 0 "register_operand" "")
113.8483 -+		    (match_operand:SI 1 "arith_operand" "")))]
113.8484 -+  ""
113.8485 -+{
113.8486 -+  branch_cmp[0] = operands[0];
113.8487 -+  branch_cmp[1] = operands[1];
113.8488 -+  branch_type = CMP_SI;
113.8489 -+  DONE;
113.8490 -+})
113.8491 -+
113.8492 -+(define_expand "tstsi"
113.8493 -+  [(set (cc0)
113.8494 -+	(match_operand:SI 0 "register_operand" ""))]
113.8495 -+  ""
113.8496 -+{
113.8497 -+  branch_cmp[0] = operands[0];
113.8498 -+  branch_cmp[1] = const0_rtx;
113.8499 -+  branch_type = CMP_SI;
113.8500 -+  DONE;
113.8501 -+})
113.8502 -+
113.8503 -+
113.8504 -+;*****************************************************************************
113.8505 -+;*
113.8506 -+;* setting a register from a comparison
113.8507 -+;*
113.8508 -+;*****************************************************************************
113.8509 -+
113.8510 -+(define_expand "seq"
113.8511 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.8512 -+	(eq:SI (match_dup 1)
113.8513 -+	       (match_dup 2)))]
113.8514 -+  ""
113.8515 -+{
113.8516 -+  if (branch_type != CMP_SI)
113.8517 -+    FAIL;
113.8518 -+
113.8519 -+  /* set up operands from compare.  */
113.8520 -+  operands[1] = branch_cmp[0];
113.8521 -+  operands[2] = branch_cmp[1];
113.8522 -+
113.8523 -+  gen_int_relational (EQ, operands[0], operands[1], operands[2], NULL_RTX);
113.8524 -+  DONE;
113.8525 -+})
113.8526 -+
113.8527 -+
113.8528 -+(define_insn "*seq"
113.8529 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8530 -+	(eq:SI (match_operand:SI 1 "reg_or_0_operand" "%rM")
113.8531 -+	       (match_operand:SI 2 "arith_operand"     "rI")))]
113.8532 -+  ""
113.8533 -+  "cmpeq%i2\\t%0, %z1, %z2"
113.8534 -+  [(set_attr "type" "alu")])
113.8535 -+
113.8536 -+
113.8537 -+(define_expand "sne"
113.8538 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.8539 -+	(ne:SI (match_dup 1)
113.8540 -+	       (match_dup 2)))]
113.8541 -+  ""
113.8542 -+{
113.8543 -+  if (branch_type != CMP_SI)
113.8544 -+    FAIL;
113.8545 -+
113.8546 -+  /* set up operands from compare.  */
113.8547 -+  operands[1] = branch_cmp[0];
113.8548 -+  operands[2] = branch_cmp[1];
113.8549 -+
113.8550 -+  gen_int_relational (NE, operands[0], operands[1], operands[2], NULL_RTX);
113.8551 -+  DONE;
113.8552 -+})
113.8553 -+
113.8554 -+
113.8555 -+(define_insn "*sne"
113.8556 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8557 -+	(ne:SI (match_operand:SI 1 "reg_or_0_operand" "%rM")
113.8558 -+	       (match_operand:SI 2 "arith_operand"     "rI")))]
113.8559 -+  ""
113.8560 -+  "cmpne%i2\\t%0, %z1, %z2"
113.8561 -+  [(set_attr "type" "alu")])
113.8562 -+
113.8563 -+
113.8564 -+(define_expand "sgt"
113.8565 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.8566 -+	(gt:SI (match_dup 1)
113.8567 -+	       (match_dup 2)))]
113.8568 -+  ""
113.8569 -+{
113.8570 -+  if (branch_type != CMP_SI)
113.8571 -+    FAIL;
113.8572 -+
113.8573 -+  /* set up operands from compare.  */
113.8574 -+  operands[1] = branch_cmp[0];
113.8575 -+  operands[2] = branch_cmp[1];
113.8576 -+
113.8577 -+  gen_int_relational (GT, operands[0], operands[1], operands[2], NULL_RTX);
113.8578 -+  DONE;
113.8579 -+})
113.8580 -+
113.8581 -+
113.8582 -+(define_insn "*sgt"
113.8583 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8584 -+	(gt:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
113.8585 -+	       (match_operand:SI 2 "reg_or_0_operand"  "rM")))]
113.8586 -+  ""
113.8587 -+  "cmplt\\t%0, %z2, %z1"
113.8588 -+  [(set_attr "type" "alu")])
113.8589 -+
113.8590 -+
113.8591 -+(define_expand "sge"
113.8592 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.8593 -+	(ge:SI (match_dup 1)
113.8594 -+	       (match_dup 2)))]
113.8595 -+  ""
113.8596 -+{
113.8597 -+  if (branch_type != CMP_SI)
113.8598 -+    FAIL;
113.8599 -+
113.8600 -+  /* set up operands from compare.  */
113.8601 -+  operands[1] = branch_cmp[0];
113.8602 -+  operands[2] = branch_cmp[1];
113.8603 -+
113.8604 -+  gen_int_relational (GE, operands[0], operands[1], operands[2], NULL_RTX);
113.8605 -+  DONE;
113.8606 -+})
113.8607 -+
113.8608 -+
113.8609 -+(define_insn "*sge"
113.8610 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8611 -+	(ge:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
113.8612 -+	       (match_operand:SI 2 "arith_operand"     "rI")))]
113.8613 -+  ""
113.8614 -+  "cmpge%i2\\t%0, %z1, %z2"
113.8615 -+  [(set_attr "type" "alu")])
113.8616 -+
113.8617 -+(define_expand "sle"
113.8618 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.8619 -+	(le:SI (match_dup 1)
113.8620 -+	       (match_dup 2)))]
113.8621 -+  ""
113.8622 -+{
113.8623 -+  if (branch_type != CMP_SI)
113.8624 -+    FAIL;
113.8625 -+
113.8626 -+  /* set up operands from compare.  */
113.8627 -+  operands[1] = branch_cmp[0];
113.8628 -+  operands[2] = branch_cmp[1];
113.8629 -+
113.8630 -+  gen_int_relational (LE, operands[0], operands[1], operands[2], NULL_RTX);
113.8631 -+  DONE;
113.8632 -+})
113.8633 -+
113.8634 -+
113.8635 -+(define_insn "*sle"
113.8636 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8637 -+	(le:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
113.8638 -+	       (match_operand:SI 2 "reg_or_0_operand"  "rM")))]
113.8639 -+  ""
113.8640 -+  "cmpge\\t%0, %z2, %z1"
113.8641 -+  [(set_attr "type" "alu")])
113.8642 -+
113.8643 -+
113.8644 -+(define_expand "slt"
113.8645 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.8646 -+	(lt:SI (match_dup 1)
113.8647 -+	       (match_dup 2)))]
113.8648 -+  ""
113.8649 -+{
113.8650 -+  if (branch_type != CMP_SI)
113.8651 -+    FAIL;
113.8652 -+
113.8653 -+  /* set up operands from compare.  */
113.8654 -+  operands[1] = branch_cmp[0];
113.8655 -+  operands[2] = branch_cmp[1];
113.8656 -+
113.8657 -+  gen_int_relational (LT, operands[0], operands[1], operands[2], NULL_RTX);
113.8658 -+  DONE;
113.8659 -+})
113.8660 -+
113.8661 -+
113.8662 -+(define_insn "*slt"
113.8663 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8664 -+	(lt:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
113.8665 -+	       (match_operand:SI 2 "arith_operand"     "rI")))]
113.8666 -+  ""
113.8667 -+  "cmplt%i2\\t%0, %z1, %z2"
113.8668 -+  [(set_attr "type" "alu")])
113.8669 -+
113.8670 -+
113.8671 -+(define_expand "sgtu"
113.8672 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.8673 -+	(gtu:SI (match_dup 1)
113.8674 -+	        (match_dup 2)))]
113.8675 -+  ""
113.8676 -+{
113.8677 -+  if (branch_type != CMP_SI)
113.8678 -+    FAIL;
113.8679 -+
113.8680 -+  /* set up operands from compare.  */
113.8681 -+  operands[1] = branch_cmp[0];
113.8682 -+  operands[2] = branch_cmp[1];
113.8683 -+
113.8684 -+  gen_int_relational (GTU, operands[0], operands[1], operands[2], NULL_RTX);
113.8685 -+  DONE;
113.8686 -+})
113.8687 -+
113.8688 -+
113.8689 -+(define_insn "*sgtu"
113.8690 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8691 -+	(gtu:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
113.8692 -+	        (match_operand:SI 2 "reg_or_0_operand"  "rM")))]
113.8693 -+  ""
113.8694 -+  "cmpltu\\t%0, %z2, %z1"
113.8695 -+  [(set_attr "type" "alu")])
113.8696 -+
113.8697 -+
113.8698 -+(define_expand "sgeu"
113.8699 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.8700 -+	(geu:SI (match_dup 1)
113.8701 -+	        (match_dup 2)))]
113.8702 -+  ""
113.8703 -+{
113.8704 -+  if (branch_type != CMP_SI)
113.8705 -+    FAIL;
113.8706 -+
113.8707 -+  /* set up operands from compare.  */
113.8708 -+  operands[1] = branch_cmp[0];
113.8709 -+  operands[2] = branch_cmp[1];
113.8710 -+
113.8711 -+  gen_int_relational (GEU, operands[0], operands[1], operands[2], NULL_RTX);
113.8712 -+  DONE;
113.8713 -+})
113.8714 -+
113.8715 -+
113.8716 -+(define_insn "*sgeu"
113.8717 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8718 -+	(geu:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
113.8719 -+	        (match_operand:SI 2 "uns_arith_operand"     "rJ")))]
113.8720 -+  ""
113.8721 -+  "cmpgeu%i2\\t%0, %z1, %z2"
113.8722 -+  [(set_attr "type" "alu")])
113.8723 -+
113.8724 -+(define_expand "sleu"
113.8725 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.8726 -+	(leu:SI (match_dup 1)
113.8727 -+	        (match_dup 2)))]
113.8728 -+  ""
113.8729 -+{
113.8730 -+  if (branch_type != CMP_SI)
113.8731 -+    FAIL;
113.8732 -+
113.8733 -+  /* set up operands from compare.  */
113.8734 -+  operands[1] = branch_cmp[0];
113.8735 -+  operands[2] = branch_cmp[1];
113.8736 -+
113.8737 -+  gen_int_relational (LEU, operands[0], operands[1], operands[2], NULL_RTX);
113.8738 -+  DONE;
113.8739 -+})
113.8740 -+
113.8741 -+
113.8742 -+(define_insn "*sleu"
113.8743 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8744 -+	(leu:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
113.8745 -+	        (match_operand:SI 2 "reg_or_0_operand"  "rM")))]
113.8746 -+  ""
113.8747 -+  "cmpgeu\\t%0, %z2, %z1"
113.8748 -+  [(set_attr "type" "alu")])
113.8749 -+
113.8750 -+
113.8751 -+(define_expand "sltu"
113.8752 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.8753 -+	(ltu:SI (match_dup 1)
113.8754 -+	        (match_dup 2)))]
113.8755 -+  ""
113.8756 -+{
113.8757 -+  if (branch_type != CMP_SI)
113.8758 -+    FAIL;
113.8759 -+
113.8760 -+  /* set up operands from compare.  */
113.8761 -+  operands[1] = branch_cmp[0];
113.8762 -+  operands[2] = branch_cmp[1];
113.8763 -+
113.8764 -+  gen_int_relational (LTU, operands[0], operands[1], operands[2], NULL_RTX);
113.8765 -+  DONE;
113.8766 -+})
113.8767 -+
113.8768 -+
113.8769 -+(define_insn "*sltu"
113.8770 -+  [(set (match_operand:SI 0 "register_operand"        "=r")
113.8771 -+	(ltu:SI (match_operand:SI 1 "reg_or_0_operand"  "rM")
113.8772 -+	        (match_operand:SI 2 "uns_arith_operand"     "rJ")))]
113.8773 -+  ""
113.8774 -+  "cmpltu%i2\\t%0, %z1, %z2"
113.8775 -+  [(set_attr "type" "alu")])
113.8776 -+
113.8777 -+
113.8778 -+
113.8779 -+
113.8780 -+;*****************************************************************************
113.8781 -+;*
113.8782 -+;* branches
113.8783 -+;*
113.8784 -+;*****************************************************************************
113.8785 -+
113.8786 -+(define_insn "*cbranch"
113.8787 -+  [(set (pc)
113.8788 -+	(if_then_else
113.8789 -+         (match_operator:SI 0 "comparison_operator"
113.8790 -+			    [(match_operand:SI 2 "reg_or_0_operand" "rM")
113.8791 -+			     (match_operand:SI 3 "reg_or_0_operand" "rM")])
113.8792 -+        (label_ref (match_operand 1 "" ""))
113.8793 -+        (pc)))]
113.8794 -+  ""
113.8795 -+  "b%0\\t%z2, %z3, %l1"
113.8796 -+  [(set_attr "type" "control")])
113.8797 -+
113.8798 -+
113.8799 -+(define_expand "beq"
113.8800 -+  [(set (pc)
113.8801 -+	(if_then_else (eq:CC (cc0)
113.8802 -+			     (const_int 0))
113.8803 -+		      (label_ref (match_operand 0 "" ""))
113.8804 -+		      (pc)))]
113.8805 -+  ""
113.8806 -+{
113.8807 -+  gen_int_relational (EQ, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
113.8808 -+  DONE;
113.8809 -+})
113.8810 -+
113.8811 -+
113.8812 -+(define_expand "bne"
113.8813 -+  [(set (pc)
113.8814 -+	(if_then_else (ne:CC (cc0)
113.8815 -+			     (const_int 0))
113.8816 -+		      (label_ref (match_operand 0 "" ""))
113.8817 -+		      (pc)))]
113.8818 -+  ""
113.8819 -+{
113.8820 -+  gen_int_relational (NE, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
113.8821 -+  DONE;
113.8822 -+})
113.8823 -+
113.8824 -+
113.8825 -+(define_expand "bgt"
113.8826 -+  [(set (pc)
113.8827 -+	(if_then_else (gt:CC (cc0)
113.8828 -+			     (const_int 0))
113.8829 -+		      (label_ref (match_operand 0 "" ""))
113.8830 -+		      (pc)))]
113.8831 -+  ""
113.8832 -+{
113.8833 -+  gen_int_relational (GT, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
113.8834 -+  DONE;
113.8835 -+})
113.8836 -+
113.8837 -+(define_expand "bge"
113.8838 -+  [(set (pc)
113.8839 -+	(if_then_else (ge:CC (cc0)
113.8840 -+			     (const_int 0))
113.8841 -+		      (label_ref (match_operand 0 "" ""))
113.8842 -+		      (pc)))]
113.8843 -+  ""
113.8844 -+{
113.8845 -+  gen_int_relational (GE, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
113.8846 -+  DONE;
113.8847 -+})
113.8848 -+
113.8849 -+(define_expand "ble"
113.8850 -+  [(set (pc)
113.8851 -+	(if_then_else (le:CC (cc0)
113.8852 -+			     (const_int 0))
113.8853 -+		      (label_ref (match_operand 0 "" ""))
113.8854 -+		      (pc)))]
113.8855 -+  ""
113.8856 -+{
113.8857 -+  gen_int_relational (LE, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
113.8858 -+  DONE;
113.8859 -+})
113.8860 -+
113.8861 -+(define_expand "blt"
113.8862 -+  [(set (pc)
113.8863 -+	(if_then_else (lt:CC (cc0)
113.8864 -+			     (const_int 0))
113.8865 -+		      (label_ref (match_operand 0 "" ""))
113.8866 -+		      (pc)))]
113.8867 -+  ""
113.8868 -+{
113.8869 -+  gen_int_relational (LT, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
113.8870 -+  DONE;
113.8871 -+})
113.8872 -+
113.8873 -+
113.8874 -+(define_expand "bgtu"
113.8875 -+  [(set (pc)
113.8876 -+	(if_then_else (gtu:CC (cc0)
113.8877 -+		 	      (const_int 0))
113.8878 -+		      (label_ref (match_operand 0 "" ""))
113.8879 -+		      (pc)))]
113.8880 -+  ""
113.8881 -+{
113.8882 -+  gen_int_relational (GTU, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
113.8883 -+  DONE;
113.8884 -+})
113.8885 -+
113.8886 -+(define_expand "bgeu"
113.8887 -+  [(set (pc)
113.8888 -+	(if_then_else (geu:CC (cc0)
113.8889 -+			      (const_int 0))
113.8890 -+		      (label_ref (match_operand 0 "" ""))
113.8891 -+		      (pc)))]
113.8892 -+  ""
113.8893 -+{
113.8894 -+  gen_int_relational (GEU, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
113.8895 -+  DONE;
113.8896 -+})
113.8897 -+
113.8898 -+(define_expand "bleu"
113.8899 -+  [(set (pc)
113.8900 -+	(if_then_else (leu:CC (cc0)
113.8901 -+			      (const_int 0))
113.8902 -+		      (label_ref (match_operand 0 "" ""))
113.8903 -+		      (pc)))]
113.8904 -+  ""
113.8905 -+{
113.8906 -+  gen_int_relational (LEU, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
113.8907 -+  DONE;
113.8908 -+})
113.8909 -+
113.8910 -+(define_expand "bltu"
113.8911 -+  [(set (pc)
113.8912 -+	(if_then_else (ltu:CC (cc0)
113.8913 -+			      (const_int 0))
113.8914 -+		      (label_ref (match_operand 0 "" ""))
113.8915 -+		      (pc)))]
113.8916 -+  ""
113.8917 -+{
113.8918 -+  gen_int_relational (LTU, NULL_RTX, branch_cmp[0], branch_cmp[1], operands[0]);
113.8919 -+  DONE;
113.8920 -+})
113.8921 -+
113.8922 -+
113.8923 -+;*****************************************************************************
113.8924 -+;*
113.8925 -+;* String and Block Operations
113.8926 -+;*
113.8927 -+;*****************************************************************************
113.8928 -+
113.8929 -+; ??? This is all really a hack to get Dhrystone to work as fast as possible
113.8930 -+;     things to be fixed:
113.8931 -+;        * let the compiler core handle all of this, for that to work the extra
113.8932 -+;          aliasing needs to be addressed.
113.8933 -+;        * we use three temporary registers for loading and storing to ensure no
113.8934 -+;          ld use stalls, this is excessive, because after the first ld/st only
113.8935 -+;          two are needed. Only two would be needed all the way through if 
113.8936 -+;          we could schedule with other code. Consider:
113.8937 -+;           1  ld $1, 0($src)
113.8938 -+;           2  ld $2, 4($src)
113.8939 -+;           3  ld $3, 8($src)
113.8940 -+;           4  st $1, 0($dest)
113.8941 -+;           5  ld $1, 12($src)
113.8942 -+;           6  st $2, 4($src)
113.8943 -+;           7  etc.
113.8944 -+;          The first store has to wait until 4. If it does not there will be one
113.8945 -+;          cycle of stalling. However, if any other instruction could be placed
113.8946 -+;          between 1 and 4, $3 would not be needed.
113.8947 -+;        * In small we probably don't want to ever do this ourself because there
113.8948 -+;          is no ld use stall.
113.8949 -+
113.8950 -+(define_expand "movstrsi"
113.8951 -+  [(parallel [(set (match_operand:BLK 0 "general_operand"  "")
113.8952 -+		   (match_operand:BLK 1 "general_operand"  ""))
113.8953 -+	      (use (match_operand:SI 2 "const_int_operand" ""))
113.8954 -+	      (use (match_operand:SI 3 "const_int_operand" ""))
113.8955 -+	      (clobber (match_scratch:SI 4                "=&r"))
113.8956 -+	      (clobber (match_scratch:SI 5                "=&r"))
113.8957 -+	      (clobber (match_scratch:SI 6                "=&r"))])]
113.8958 -+  "TARGET_INLINE_MEMCPY"
113.8959 -+{
113.8960 -+  rtx ld_addr_reg, st_addr_reg;
113.8961 -+
113.8962 -+  /* If the predicate for op2 fails in expr.c:emit_block_move_via_movstr 
113.8963 -+     it trys to copy to a register, but does not re-try the predicate.
113.8964 -+     ??? Intead of fixing expr.c, I fix it here. */
113.8965 -+  if (!const_int_operand (operands[2], SImode))
113.8966 -+    FAIL;
113.8967 -+
113.8968 -+  /* ??? there are some magic numbers which need to be sorted out here.
113.8969 -+         the basis for them is not increasing code size hugely or going
113.8970 -+         out of range of offset addressing */
113.8971 -+  if (INTVAL (operands[3]) < 4)
113.8972 -+    FAIL;
113.8973 -+  if (!optimize
113.8974 -+      || (optimize_size && INTVAL (operands[2]) > 12)
113.8975 -+      || (optimize < 3 && INTVAL (operands[2]) > 100)
113.8976 -+      || INTVAL (operands[2]) > 200)
113.8977 -+    FAIL;
113.8978 -+
113.8979 -+  st_addr_reg
113.8980 -+    = replace_equiv_address (operands[0],
113.8981 -+			     copy_to_mode_reg (Pmode, XEXP (operands[0], 0)));
113.8982 -+  ld_addr_reg
113.8983 -+    = replace_equiv_address (operands[1],
113.8984 -+			     copy_to_mode_reg (Pmode, XEXP (operands[1], 0)));
113.8985 -+  emit_insn (gen_movstrsi_internal (st_addr_reg, ld_addr_reg,
113.8986 -+				    operands[2], operands[3]));
113.8987 -+
113.8988 -+  DONE;
113.8989 -+})
113.8990 -+
113.8991 -+
113.8992 -+(define_insn "movstrsi_internal"
113.8993 -+  [(set (match_operand:BLK 0 "memory_operand"   "=o")
113.8994 -+	(match_operand:BLK 1 "memory_operand"    "o"))
113.8995 -+   (use (match_operand:SI 2 "const_int_operand"  "i"))
113.8996 -+   (use (match_operand:SI 3 "const_int_operand"  "i"))
113.8997 -+   (clobber (match_scratch:SI 4                "=&r"))
113.8998 -+   (clobber (match_scratch:SI 5                "=&r"))
113.8999 -+   (clobber (match_scratch:SI 6                "=&r"))]
113.9000 -+  "TARGET_INLINE_MEMCPY"
113.9001 -+{
113.9002 -+  int ld_offset = INTVAL (operands[2]);
113.9003 -+  int ld_len = INTVAL (operands[2]);
113.9004 -+  int ld_reg = 0;
113.9005 -+  rtx ld_addr_reg = XEXP (operands[1], 0);
113.9006 -+  int st_offset = INTVAL (operands[2]);
113.9007 -+  int st_len = INTVAL (operands[2]);
113.9008 -+  int st_reg = 0;
113.9009 -+  rtx st_addr_reg = XEXP (operands[0], 0);
113.9010 -+  int delay_count = 0;
113.9011 -+  
113.9012 -+  /* ops[0] is the address used by the insn
113.9013 -+     ops[1] is the register being loaded or stored */
113.9014 -+  rtx ops[2];
113.9015 -+  
113.9016 -+  if (INTVAL (operands[3]) < 4)
113.9017 -+    abort ();
113.9018 -+  
113.9019 -+  while (ld_offset >= 4)
113.9020 -+    {
113.9021 -+      /* if the load use delay has been met, I can start
113.9022 -+         storing */
113.9023 -+      if (delay_count >= 3)
113.9024 -+        {
113.9025 -+	  ops[0] = gen_rtx (MEM, SImode, 
113.9026 -+			    plus_constant (st_addr_reg, st_len - st_offset));
113.9027 -+	  ops[1] = operands[st_reg + 4];			 
113.9028 -+	  output_asm_insn ("stw\t%1, %0", ops);
113.9029 -+	  
113.9030 -+	  st_reg = (st_reg + 1) % 3;
113.9031 -+	  st_offset -= 4;
113.9032 -+        }
113.9033 -+    
113.9034 -+      ops[0] = gen_rtx (MEM, SImode, 
113.9035 -+			plus_constant (ld_addr_reg, ld_len - ld_offset));
113.9036 -+      ops[1] = operands[ld_reg + 4];			 
113.9037 -+      output_asm_insn ("ldw\t%1, %0", ops);
113.9038 -+      
113.9039 -+      ld_reg = (ld_reg + 1) % 3;
113.9040 -+      ld_offset -= 4;
113.9041 -+      delay_count++;
113.9042 -+    }
113.9043 -+  
113.9044 -+  if (ld_offset >= 2)
113.9045 -+    {
113.9046 -+      /* if the load use delay has been met, I can start
113.9047 -+         storing */
113.9048 -+      if (delay_count >= 3)
113.9049 -+        {
113.9050 -+	  ops[0] = gen_rtx (MEM, SImode, 
113.9051 -+			    plus_constant (st_addr_reg, st_len - st_offset));
113.9052 -+	  ops[1] = operands[st_reg + 4];			 
113.9053 -+	  output_asm_insn ("stw\t%1, %0", ops);
113.9054 -+	  
113.9055 -+	  st_reg = (st_reg + 1) % 3;
113.9056 -+	  st_offset -= 4;
113.9057 -+        }
113.9058 -+    
113.9059 -+      ops[0] = gen_rtx (MEM, HImode, 
113.9060 -+			plus_constant (ld_addr_reg, ld_len - ld_offset));
113.9061 -+      ops[1] = operands[ld_reg + 4];			 
113.9062 -+      output_asm_insn ("ldh\t%1, %0", ops);
113.9063 -+      
113.9064 -+      ld_reg = (ld_reg + 1) % 3;
113.9065 -+      ld_offset -= 2;
113.9066 -+      delay_count++;
113.9067 -+    }
113.9068 -+  
113.9069 -+  if (ld_offset >= 1)
113.9070 -+    {
113.9071 -+      /* if the load use delay has been met, I can start
113.9072 -+         storing */
113.9073 -+      if (delay_count >= 3)
113.9074 -+        {
113.9075 -+	  ops[0] = gen_rtx (MEM, SImode, 
113.9076 -+			    plus_constant (st_addr_reg, st_len - st_offset));
113.9077 -+	  ops[1] = operands[st_reg + 4];			 
113.9078 -+	  output_asm_insn ("stw\t%1, %0", ops);
113.9079 -+	  
113.9080 -+	  st_reg = (st_reg + 1) % 3;
113.9081 -+	  st_offset -= 4;
113.9082 -+        }
113.9083 -+    
113.9084 -+      ops[0] = gen_rtx (MEM, QImode, 
113.9085 -+			plus_constant (ld_addr_reg, ld_len - ld_offset));
113.9086 -+      ops[1] = operands[ld_reg + 4];			 
113.9087 -+      output_asm_insn ("ldb\t%1, %0", ops);
113.9088 -+      
113.9089 -+      ld_reg = (ld_reg + 1) % 3;
113.9090 -+      ld_offset -= 1;
113.9091 -+      delay_count++;
113.9092 -+    }
113.9093 -+
113.9094 -+    while (st_offset >= 4)
113.9095 -+      {
113.9096 -+	ops[0] = gen_rtx (MEM, SImode, 
113.9097 -+			  plus_constant (st_addr_reg, st_len - st_offset));
113.9098 -+	ops[1] = operands[st_reg + 4];			 
113.9099 -+	output_asm_insn ("stw\t%1, %0", ops);
113.9100 -+
113.9101 -+	st_reg = (st_reg + 1) % 3;
113.9102 -+	st_offset -= 4;
113.9103 -+      }
113.9104 -+  
113.9105 -+    while (st_offset >= 2)
113.9106 -+      {
113.9107 -+	ops[0] = gen_rtx (MEM, HImode, 
113.9108 -+			  plus_constant (st_addr_reg, st_len - st_offset));
113.9109 -+	ops[1] = operands[st_reg + 4];			 
113.9110 -+	output_asm_insn ("sth\t%1, %0", ops);
113.9111 -+
113.9112 -+	st_reg = (st_reg + 1) % 3;
113.9113 -+	st_offset -= 2;
113.9114 -+      }
113.9115 -+  
113.9116 -+    while (st_offset >= 1)
113.9117 -+      {
113.9118 -+	ops[0] = gen_rtx (MEM, QImode, 
113.9119 -+			  plus_constant (st_addr_reg, st_len - st_offset));
113.9120 -+	ops[1] = operands[st_reg + 4];			 
113.9121 -+	output_asm_insn ("stb\t%1, %0", ops);
113.9122 -+
113.9123 -+	st_reg = (st_reg + 1) % 3;
113.9124 -+	st_offset -= 1;
113.9125 -+      }
113.9126 -+  
113.9127 -+  return "";
113.9128 -+}
113.9129 -+; ??? lengths are not being used yet, but I will probably forget
113.9130 -+; to update this once I am using lengths, so set it to something
113.9131 -+; definetely big enough to cover it. 400 allows for 200 bytes
113.9132 -+; of motion.
113.9133 -+  [(set_attr "length" "400")])
113.9134 -+
113.9135 -+
113.9136 -+
113.9137 -+;*****************************************************************************
113.9138 -+;*
113.9139 -+;* Custom instructions
113.9140 -+;*
113.9141 -+;*****************************************************************************
113.9142 -+
113.9143 -+(define_constants [
113.9144 -+  (CUSTOM_N 100)
113.9145 -+  (CUSTOM_NI 101)
113.9146 -+  (CUSTOM_NF 102)
113.9147 -+  (CUSTOM_NP 103)
113.9148 -+  (CUSTOM_NII 104)
113.9149 -+  (CUSTOM_NIF 105)
113.9150 -+  (CUSTOM_NIP 106)
113.9151 -+  (CUSTOM_NFI 107)
113.9152 -+  (CUSTOM_NFF 108)
113.9153 -+  (CUSTOM_NFP 109)
113.9154 -+  (CUSTOM_NPI 110)
113.9155 -+  (CUSTOM_NPF 111)
113.9156 -+  (CUSTOM_NPP 112)
113.9157 -+  (CUSTOM_IN 113)
113.9158 -+  (CUSTOM_INI 114)
113.9159 -+  (CUSTOM_INF 115)
113.9160 -+  (CUSTOM_INP 116)
113.9161 -+  (CUSTOM_INII 117)
113.9162 -+  (CUSTOM_INIF 118)
113.9163 -+  (CUSTOM_INIP 119)
113.9164 -+  (CUSTOM_INFI 120)
113.9165 -+  (CUSTOM_INFF 121)
113.9166 -+  (CUSTOM_INFP 122)
113.9167 -+  (CUSTOM_INPI 123)
113.9168 -+  (CUSTOM_INPF 124)
113.9169 -+  (CUSTOM_INPP 125)
113.9170 -+  (CUSTOM_FN 126)
113.9171 -+  (CUSTOM_FNI 127)
113.9172 -+  (CUSTOM_FNF 128)
113.9173 -+  (CUSTOM_FNP 129)
113.9174 -+  (CUSTOM_FNII 130)
113.9175 -+  (CUSTOM_FNIF 131)
113.9176 -+  (CUSTOM_FNIP 132)
113.9177 -+  (CUSTOM_FNFI 133)
113.9178 -+  (CUSTOM_FNFF 134)
113.9179 -+  (CUSTOM_FNFP 135)
113.9180 -+  (CUSTOM_FNPI 136)
113.9181 -+  (CUSTOM_FNPF 137)
113.9182 -+  (CUSTOM_FNPP 138)
113.9183 -+  (CUSTOM_PN 139)
113.9184 -+  (CUSTOM_PNI 140)
113.9185 -+  (CUSTOM_PNF 141)
113.9186 -+  (CUSTOM_PNP 142)
113.9187 -+  (CUSTOM_PNII 143)
113.9188 -+  (CUSTOM_PNIF 144)
113.9189 -+  (CUSTOM_PNIP 145)
113.9190 -+  (CUSTOM_PNFI 146)
113.9191 -+  (CUSTOM_PNFF 147)
113.9192 -+  (CUSTOM_PNFP 148)
113.9193 -+  (CUSTOM_PNPI 149)
113.9194 -+  (CUSTOM_PNPF 150)
113.9195 -+  (CUSTOM_PNPP 151)
113.9196 -+])
113.9197 -+
113.9198 -+
113.9199 -+(define_insn "custom_n"
113.9200 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")] CUSTOM_N)]
113.9201 -+  ""
113.9202 -+  "custom\\t%0, zero, zero, zero"
113.9203 -+  [(set_attr "type" "custom")])
113.9204 -+
113.9205 -+(define_insn "custom_ni"
113.9206 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9207 -+                     (match_operand:SI 1 "register_operand"   "r")] CUSTOM_NI)]
113.9208 -+  ""
113.9209 -+  "custom\\t%0, zero, %1, zero"
113.9210 -+  [(set_attr "type" "custom")])
113.9211 -+
113.9212 -+(define_insn "custom_nf"
113.9213 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9214 -+                     (match_operand:SF 1 "register_operand"   "r")] CUSTOM_NF)]
113.9215 -+  ""
113.9216 -+  "custom\\t%0, zero, %1, zero"
113.9217 -+  [(set_attr "type" "custom")])
113.9218 -+
113.9219 -+(define_insn "custom_np"
113.9220 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9221 -+                     (match_operand:SI 1 "register_operand"   "r")] CUSTOM_NP)]
113.9222 -+  ""
113.9223 -+  "custom\\t%0, zero, %1, zero"
113.9224 -+  [(set_attr "type" "custom")])
113.9225 -+
113.9226 -+(define_insn "custom_nii"
113.9227 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9228 -+                     (match_operand:SI 1 "register_operand"   "r")
113.9229 -+                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NII)]
113.9230 -+  ""
113.9231 -+  "custom\\t%0, zero, %1, %2"
113.9232 -+  [(set_attr "type" "custom")])
113.9233 -+
113.9234 -+(define_insn "custom_nif"
113.9235 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9236 -+                     (match_operand:SI 1 "register_operand"   "r")
113.9237 -+                     (match_operand:SF 2 "register_operand"   "r")] CUSTOM_NIF)]
113.9238 -+  ""
113.9239 -+  "custom\\t%0, zero, %1, %2"
113.9240 -+  [(set_attr "type" "custom")])
113.9241 -+
113.9242 -+(define_insn "custom_nip"
113.9243 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9244 -+                     (match_operand:SI 1 "register_operand"   "r")
113.9245 -+                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NIP)]
113.9246 -+  ""
113.9247 -+  "custom\\t%0, zero, %1, %2"
113.9248 -+  [(set_attr "type" "custom")])
113.9249 -+
113.9250 -+(define_insn "custom_nfi"
113.9251 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9252 -+                     (match_operand:SF 1 "register_operand"   "r")
113.9253 -+                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NFI)]
113.9254 -+  ""
113.9255 -+  "custom\\t%0, zero, %1, %2"
113.9256 -+  [(set_attr "type" "custom")])
113.9257 -+
113.9258 -+(define_insn "custom_nff"
113.9259 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9260 -+                     (match_operand:SF 1 "register_operand"   "r")
113.9261 -+                     (match_operand:SF 2 "register_operand"   "r")] CUSTOM_NFF)]
113.9262 -+  ""
113.9263 -+  "custom\\t%0, zero, %1, %2"
113.9264 -+  [(set_attr "type" "custom")])
113.9265 -+
113.9266 -+(define_insn "custom_nfp"
113.9267 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9268 -+                     (match_operand:SF 1 "register_operand"   "r")
113.9269 -+                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NFP)]
113.9270 -+  ""
113.9271 -+  "custom\\t%0, zero, %1, %2"
113.9272 -+  [(set_attr "type" "custom")])
113.9273 -+
113.9274 -+(define_insn "custom_npi"
113.9275 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9276 -+                     (match_operand:SI 1 "register_operand"   "r")
113.9277 -+                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NPI)]
113.9278 -+  ""
113.9279 -+  "custom\\t%0, zero, %1, %2"
113.9280 -+  [(set_attr "type" "custom")])
113.9281 -+
113.9282 -+(define_insn "custom_npf"
113.9283 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9284 -+                     (match_operand:SI 1 "register_operand"   "r")
113.9285 -+                     (match_operand:SF 2 "register_operand"   "r")] CUSTOM_NPF)]
113.9286 -+  ""
113.9287 -+  "custom\\t%0, zero, %1, %2"
113.9288 -+  [(set_attr "type" "custom")])
113.9289 -+
113.9290 -+(define_insn "custom_npp"
113.9291 -+  [(unspec_volatile [(match_operand:SI 0 "custom_insn_opcode" "N")
113.9292 -+                     (match_operand:SI 1 "register_operand"   "r")
113.9293 -+                     (match_operand:SI 2 "register_operand"   "r")] CUSTOM_NPP)]
113.9294 -+  ""
113.9295 -+  "custom\\t%0, zero, %1, %2"
113.9296 -+  [(set_attr "type" "custom")])
113.9297 -+
113.9298 -+
113.9299 -+
113.9300 -+(define_insn "custom_in"
113.9301 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9302 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")] CUSTOM_IN))]
113.9303 -+  ""
113.9304 -+  "custom\\t%1, %0, zero, zero"
113.9305 -+  [(set_attr "type" "custom")])
113.9306 -+
113.9307 -+(define_insn "custom_ini"
113.9308 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9309 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9310 -+                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_INI))]
113.9311 -+  ""
113.9312 -+  "custom\\t%1, %0, %2, zero"
113.9313 -+  [(set_attr "type" "custom")])
113.9314 -+
113.9315 -+(define_insn "custom_inf"
113.9316 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9317 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9318 -+                          (match_operand:SF 2 "register_operand"   "r")] CUSTOM_INF))]
113.9319 -+  ""
113.9320 -+  "custom\\t%1, %0, %2, zero"
113.9321 -+  [(set_attr "type" "custom")])
113.9322 -+
113.9323 -+(define_insn "custom_inp"
113.9324 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9325 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9326 -+                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_INP))]
113.9327 -+  ""
113.9328 -+  "custom\\t%1, %0, %2, zero"
113.9329 -+  [(set_attr "type" "custom")])
113.9330 -+
113.9331 -+(define_insn "custom_inii"
113.9332 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9333 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9334 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9335 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INII))]
113.9336 -+  ""
113.9337 -+  "custom\\t%1, %0, %2, %3"
113.9338 -+  [(set_attr "type" "custom")])
113.9339 -+
113.9340 -+(define_insn "custom_inif"
113.9341 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9342 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9343 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9344 -+                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_INIF))]
113.9345 -+  ""
113.9346 -+  "custom\\t%1, %0, %2, %3"
113.9347 -+  [(set_attr "type" "custom")])
113.9348 -+
113.9349 -+(define_insn "custom_inip"
113.9350 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9351 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9352 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9353 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INIP))]
113.9354 -+  ""
113.9355 -+  "custom\\t%1, %0, %2, %3"
113.9356 -+  [(set_attr "type" "custom")])
113.9357 -+
113.9358 -+(define_insn "custom_infi"
113.9359 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9360 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9361 -+                          (match_operand:SF 2 "register_operand"   "r")
113.9362 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INFI))]
113.9363 -+  ""
113.9364 -+  "custom\\t%1, %0, %2, %3"
113.9365 -+  [(set_attr "type" "custom")])
113.9366 -+
113.9367 -+(define_insn "custom_inff"
113.9368 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9369 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9370 -+                          (match_operand:SF 2 "register_operand"   "r")
113.9371 -+                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_INFF))]
113.9372 -+  ""
113.9373 -+  "custom\\t%1, %0, %2, %3"
113.9374 -+  [(set_attr "type" "custom")])
113.9375 -+
113.9376 -+(define_insn "custom_infp"
113.9377 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9378 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9379 -+                          (match_operand:SF 2 "register_operand"   "r")
113.9380 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INFP))]
113.9381 -+  ""
113.9382 -+  "custom\\t%1, %0, %2, %3"
113.9383 -+  [(set_attr "type" "custom")])
113.9384 -+
113.9385 -+(define_insn "custom_inpi"
113.9386 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9387 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9388 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9389 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INPI))]
113.9390 -+  ""
113.9391 -+  "custom\\t%1, %0, %2, %3"
113.9392 -+  [(set_attr "type" "custom")])
113.9393 -+
113.9394 -+(define_insn "custom_inpf"
113.9395 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9396 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9397 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9398 -+                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_INPF))]
113.9399 -+  ""
113.9400 -+  "custom\\t%1, %0, %2, %3"
113.9401 -+  [(set_attr "type" "custom")])
113.9402 -+
113.9403 -+(define_insn "custom_inpp"
113.9404 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9405 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9406 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9407 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_INPP))]
113.9408 -+  ""
113.9409 -+  "custom\\t%1, %0, %2, %3"
113.9410 -+  [(set_attr "type" "custom")])
113.9411 -+
113.9412 -+
113.9413 -+
113.9414 -+
113.9415 -+
113.9416 -+(define_insn "custom_fn"
113.9417 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9418 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")] CUSTOM_FN))]
113.9419 -+  ""
113.9420 -+  "custom\\t%1, %0, zero, zero"
113.9421 -+  [(set_attr "type" "custom")])
113.9422 -+
113.9423 -+(define_insn "custom_fni"
113.9424 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9425 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9426 -+                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_FNI))]
113.9427 -+  ""
113.9428 -+  "custom\\t%1, %0, %2, zero"
113.9429 -+  [(set_attr "type" "custom")])
113.9430 -+
113.9431 -+(define_insn "custom_fnf"
113.9432 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9433 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9434 -+                          (match_operand:SF 2 "register_operand"   "r")] CUSTOM_FNF))]
113.9435 -+  ""
113.9436 -+  "custom\\t%1, %0, %2, zero"
113.9437 -+  [(set_attr "type" "custom")])
113.9438 -+
113.9439 -+(define_insn "custom_fnp"
113.9440 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9441 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9442 -+                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_FNP))]
113.9443 -+  ""
113.9444 -+  "custom\\t%1, %0, %2, zero"
113.9445 -+  [(set_attr "type" "custom")])
113.9446 -+
113.9447 -+(define_insn "custom_fnii"
113.9448 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9449 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9450 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9451 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNII))]
113.9452 -+  ""
113.9453 -+  "custom\\t%1, %0, %2, %3"
113.9454 -+  [(set_attr "type" "custom")])
113.9455 -+
113.9456 -+(define_insn "custom_fnif"
113.9457 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9458 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9459 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9460 -+                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_FNIF))]
113.9461 -+  ""
113.9462 -+  "custom\\t%1, %0, %2, %3"
113.9463 -+  [(set_attr "type" "custom")])
113.9464 -+
113.9465 -+(define_insn "custom_fnip"
113.9466 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9467 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9468 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9469 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNIP))]
113.9470 -+  ""
113.9471 -+  "custom\\t%1, %0, %2, %3"
113.9472 -+  [(set_attr "type" "custom")])
113.9473 -+
113.9474 -+(define_insn "custom_fnfi"
113.9475 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9476 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9477 -+                          (match_operand:SF 2 "register_operand"   "r")
113.9478 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNFI))]
113.9479 -+  ""
113.9480 -+  "custom\\t%1, %0, %2, %3"
113.9481 -+  [(set_attr "type" "custom")])
113.9482 -+
113.9483 -+(define_insn "custom_fnff"
113.9484 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9485 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9486 -+                          (match_operand:SF 2 "register_operand"   "r")
113.9487 -+                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_FNFF))]
113.9488 -+  ""
113.9489 -+  "custom\\t%1, %0, %2, %3"
113.9490 -+  [(set_attr "type" "custom")])
113.9491 -+
113.9492 -+(define_insn "custom_fnfp"
113.9493 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9494 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9495 -+                          (match_operand:SF 2 "register_operand"   "r")
113.9496 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNFP))]
113.9497 -+  ""
113.9498 -+  "custom\\t%1, %0, %2, %3"
113.9499 -+  [(set_attr "type" "custom")])
113.9500 -+
113.9501 -+(define_insn "custom_fnpi"
113.9502 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9503 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9504 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9505 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNPI))]
113.9506 -+  ""
113.9507 -+  "custom\\t%1, %0, %2, %3"
113.9508 -+  [(set_attr "type" "custom")])
113.9509 -+
113.9510 -+(define_insn "custom_fnpf"
113.9511 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9512 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9513 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9514 -+                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_FNPF))]
113.9515 -+  ""
113.9516 -+  "custom\\t%1, %0, %2, %3"
113.9517 -+  [(set_attr "type" "custom")])
113.9518 -+
113.9519 -+(define_insn "custom_fnpp"
113.9520 -+  [(set (match_operand:SF 0 "register_operand"   "=r")
113.9521 -+        (unspec_volatile:SF [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9522 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9523 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_FNPP))]
113.9524 -+  ""
113.9525 -+  "custom\\t%1, %0, %2, %3"
113.9526 -+  [(set_attr "type" "custom")])
113.9527 -+
113.9528 -+
113.9529 -+
113.9530 -+(define_insn "custom_pn"
113.9531 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9532 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")] CUSTOM_PN))]
113.9533 -+  ""
113.9534 -+  "custom\\t%1, %0, zero, zero"
113.9535 -+  [(set_attr "type" "custom")])
113.9536 -+
113.9537 -+(define_insn "custom_pni"
113.9538 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9539 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9540 -+                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_PNI))]
113.9541 -+  ""
113.9542 -+  "custom\\t%1, %0, %2, zero"
113.9543 -+  [(set_attr "type" "custom")])
113.9544 -+
113.9545 -+(define_insn "custom_pnf"
113.9546 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9547 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9548 -+                          (match_operand:SF 2 "register_operand"   "r")] CUSTOM_PNF))]
113.9549 -+  ""
113.9550 -+  "custom\\t%1, %0, %2, zero"
113.9551 -+  [(set_attr "type" "custom")])
113.9552 -+
113.9553 -+(define_insn "custom_pnp"
113.9554 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9555 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9556 -+                          (match_operand:SI 2 "register_operand"   "r")] CUSTOM_PNP))]
113.9557 -+  ""
113.9558 -+  "custom\\t%1, %0, %2, zero"
113.9559 -+  [(set_attr "type" "custom")])
113.9560 -+
113.9561 -+(define_insn "custom_pnii"
113.9562 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9563 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9564 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9565 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNII))]
113.9566 -+  ""
113.9567 -+  "custom\\t%1, %0, %2, %3"
113.9568 -+  [(set_attr "type" "custom")])
113.9569 -+
113.9570 -+(define_insn "custom_pnif"
113.9571 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9572 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9573 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9574 -+                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_PNIF))]
113.9575 -+  ""
113.9576 -+  "custom\\t%1, %0, %2, %3"
113.9577 -+  [(set_attr "type" "custom")])
113.9578 -+
113.9579 -+(define_insn "custom_pnip"
113.9580 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9581 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9582 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9583 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNIP))]
113.9584 -+  ""
113.9585 -+  "custom\\t%1, %0, %2, %3"
113.9586 -+  [(set_attr "type" "custom")])
113.9587 -+
113.9588 -+(define_insn "custom_pnfi"
113.9589 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9590 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9591 -+                          (match_operand:SF 2 "register_operand"   "r")
113.9592 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNFI))]
113.9593 -+  ""
113.9594 -+  "custom\\t%1, %0, %2, %3"
113.9595 -+  [(set_attr "type" "custom")])
113.9596 -+
113.9597 -+(define_insn "custom_pnff"
113.9598 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9599 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9600 -+                          (match_operand:SF 2 "register_operand"   "r")
113.9601 -+                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_PNFF))]
113.9602 -+  ""
113.9603 -+  "custom\\t%1, %0, %2, %3"
113.9604 -+  [(set_attr "type" "custom")])
113.9605 -+
113.9606 -+(define_insn "custom_pnfp"
113.9607 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9608 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9609 -+                          (match_operand:SF 2 "register_operand"   "r")
113.9610 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNFP))]
113.9611 -+  ""
113.9612 -+  "custom\\t%1, %0, %2, %3"
113.9613 -+  [(set_attr "type" "custom")])
113.9614 -+
113.9615 -+(define_insn "custom_pnpi"
113.9616 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9617 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9618 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9619 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNPI))]
113.9620 -+  ""
113.9621 -+  "custom\\t%1, %0, %2, %3"
113.9622 -+  [(set_attr "type" "custom")])
113.9623 -+
113.9624 -+(define_insn "custom_pnpf"
113.9625 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9626 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9627 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9628 -+                          (match_operand:SF 3 "register_operand"   "r")] CUSTOM_PNPF))]
113.9629 -+  ""
113.9630 -+  "custom\\t%1, %0, %2, %3"
113.9631 -+  [(set_attr "type" "custom")])
113.9632 -+
113.9633 -+(define_insn "custom_pnpp"
113.9634 -+  [(set (match_operand:SI 0 "register_operand"   "=r")
113.9635 -+        (unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
113.9636 -+                          (match_operand:SI 2 "register_operand"   "r")
113.9637 -+                          (match_operand:SI 3 "register_operand"   "r")] CUSTOM_PNPP))]
113.9638 -+  ""
113.9639 -+  "custom\\t%1, %0, %2, %3"
113.9640 -+  [(set_attr "type" "custom")])
113.9641 -+
113.9642 -+
113.9643 -+
113.9644 -+
113.9645 -+
113.9646 -+
113.9647 -+;*****************************************************************************
113.9648 -+;*
113.9649 -+;* Misc
113.9650 -+;*
113.9651 -+;*****************************************************************************
113.9652 -+
113.9653 -+(define_insn "nop"
113.9654 -+  [(const_int 0)]
113.9655 -+  ""
113.9656 -+  "nop\\t"
113.9657 -+  [(set_attr "type" "alu")])
113.9658 -+
113.9659 -+(define_insn "sync"
113.9660 -+  [(unspec_volatile [(const_int 0)] UNSPEC_SYNC)]
113.9661 -+  ""
113.9662 -+  "sync\\t"
113.9663 -+  [(set_attr "type" "control")])
113.9664 -+
113.9665 -+
113.9666 -+(define_insn "rdctl"
113.9667 -+  [(set (match_operand:SI 0 "register_operand" "=r")
113.9668 -+	(unspec_volatile:SI [(match_operand:SI 1 "rdwrctl_operand" "O")] UNSPEC_RDCTL))]
113.9669 -+  ""
113.9670 -+  "rdctl\\t%0, ctl%1"
113.9671 -+  [(set_attr "type" "control")])
113.9672 -+
113.9673 -+(define_insn "wrctl"
113.9674 -+  [(unspec_volatile:SI [(match_operand:SI 0 "rdwrctl_operand"  "O")
113.9675 -+                        (match_operand:SI 1 "register_operand" "r")] UNSPEC_WRCTL)]
113.9676 -+  ""
113.9677 -+  "wrctl\\tctl%0, %1"
113.9678 -+  [(set_attr "type" "control")])
113.9679 -+
113.9680 -+
113.9681 -+
113.9682 -+;*****************************************************************************
113.9683 -+;*
113.9684 -+;* Peepholes
113.9685 -+;*
113.9686 -+;*****************************************************************************
113.9687 -+
113.9688 -+
113.9689 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/nios2-protos.h gcc-3.4.6/gcc/config/nios2/nios2-protos.h
113.9690 ---- gcc-3.4.6.orig/gcc/config/nios2/nios2-protos.h	1970-01-01 01:00:00.000000000 +0100
113.9691 -+++ gcc-3.4.6/gcc/config/nios2/nios2-protos.h	2007-08-15 23:09:36.000000000 +0200
113.9692 -@@ -0,0 +1,70 @@
113.9693 -+/* Subroutines for assembler code output for Altera NIOS 2G NIOS2 version.
113.9694 -+   Copyright (C) 2003 Altera 
113.9695 -+   Contributed by Jonah Graham (jgraham@altera.com).
113.9696 -+
113.9697 -+This file is part of GNU CC.
113.9698 -+
113.9699 -+GNU CC is free software; you can redistribute it and/or modify
113.9700 -+it under the terms of the GNU General Public License as published by
113.9701 -+the Free Software Foundation; either version 2, or (at your option)
113.9702 -+any later version.
113.9703 -+
113.9704 -+GNU CC is distributed in the hope that it will be useful,
113.9705 -+but WITHOUT ANY WARRANTY; without even the implied warranty of
113.9706 -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
113.9707 -+GNU General Public License for more details.
113.9708 -+
113.9709 -+You should have received a copy of the GNU General Public License
113.9710 -+along with GNU CC; see the file COPYING.  If not, write to
113.9711 -+the Free Software Foundation, 59 Temple Place - Suite 330,
113.9712 -+Boston, MA 02111-1307, USA.  */
113.9713 -+
113.9714 -+extern void dump_frame_size (FILE *);
113.9715 -+extern HOST_WIDE_INT compute_frame_size (void);
113.9716 -+extern int nios2_initial_elimination_offset (int, int);
113.9717 -+extern void override_options (void);
113.9718 -+extern void optimization_options (int, int);
113.9719 -+extern int nios2_can_use_return_insn (void);
113.9720 -+extern void expand_prologue (void);
113.9721 -+extern void expand_epilogue (bool);
113.9722 -+extern void function_profiler (FILE *, int);
113.9723 -+
113.9724 -+
113.9725 -+#ifdef RTX_CODE
113.9726 -+extern int nios2_legitimate_address (rtx, enum machine_mode, int);
113.9727 -+extern void nios2_print_operand (FILE *, rtx, int);
113.9728 -+extern void nios2_print_operand_address (FILE *, rtx);
113.9729 -+
113.9730 -+extern int nios2_emit_move_sequence (rtx *, enum machine_mode);
113.9731 -+extern int nios2_emit_expensive_div (rtx *, enum machine_mode);
113.9732 -+
113.9733 -+extern void gen_int_relational (enum rtx_code, rtx, rtx, rtx, rtx);
113.9734 -+extern void gen_conditional_move (rtx *, enum machine_mode);
113.9735 -+extern const char *asm_output_opcode (FILE *, const char *);
113.9736 -+
113.9737 -+/* predicates */
113.9738 -+extern int arith_operand (rtx, enum machine_mode);
113.9739 -+extern int uns_arith_operand (rtx, enum machine_mode);
113.9740 -+extern int logical_operand (rtx, enum machine_mode);
113.9741 -+extern int shift_operand (rtx, enum machine_mode);
113.9742 -+extern int reg_or_0_operand (rtx, enum machine_mode);
113.9743 -+extern int equality_op (rtx, enum machine_mode);
113.9744 -+extern int custom_insn_opcode (rtx, enum machine_mode);
113.9745 -+extern int rdwrctl_operand (rtx, enum machine_mode);
113.9746 -+
113.9747 -+# ifdef HAVE_MACHINE_MODES
113.9748 -+#  if defined TREE_CODE
113.9749 -+extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
113.9750 -+extern rtx function_arg (const CUMULATIVE_ARGS *, enum machine_mode, tree, int);
113.9751 -+extern int function_arg_partial_nregs (const CUMULATIVE_ARGS *, enum machine_mode, tree, int);
113.9752 -+extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, int);
113.9753 -+extern int nios2_setup_incoming_varargs (const CUMULATIVE_ARGS *, enum machine_mode, tree, int);
113.9754 -+
113.9755 -+#  endif /* TREE_CODE */
113.9756 -+# endif	/* HAVE_MACHINE_MODES */
113.9757 -+#endif
113.9758 -+
113.9759 -+#ifdef TREE_CODE
113.9760 -+extern int nios2_return_in_memory (tree);
113.9761 -+
113.9762 -+#endif /* TREE_CODE */
113.9763 -diff -durN gcc-3.4.6.orig/gcc/config/nios2/t-nios2 gcc-3.4.6/gcc/config/nios2/t-nios2
113.9764 ---- gcc-3.4.6.orig/gcc/config/nios2/t-nios2	1970-01-01 01:00:00.000000000 +0100
113.9765 -+++ gcc-3.4.6/gcc/config/nios2/t-nios2	2007-08-15 23:09:36.000000000 +0200
113.9766 -@@ -0,0 +1,123 @@
113.9767 -+##
113.9768 -+## Compiler flags to use when compiling libgcc2.c.
113.9769 -+##
113.9770 -+## LIB2FUNCS_EXTRA
113.9771 -+## A list of source file names to be compiled or assembled and inserted into libgcc.a.
113.9772 -+
113.9773 -+LIB2FUNCS_EXTRA=$(srcdir)/config/nios2/lib2-divmod.c \
113.9774 -+  $(srcdir)/config/nios2/lib2-divmod-hi.c \
113.9775 -+  $(srcdir)/config/nios2/lib2-divtable.c \
113.9776 -+  $(srcdir)/config/nios2/lib2-mul.c
113.9777 -+
113.9778 -+##
113.9779 -+## Floating Point Emulation
113.9780 -+## To have GCC include software floating point libraries in libgcc.a define FPBIT
113.9781 -+## and DPBIT along with a few rules as follows:
113.9782 -+##
113.9783 -+## # We want fine grained libraries, so use the new code
113.9784 -+## # to build the floating point emulation libraries.
113.9785 -+FPBIT=$(srcdir)/config/nios2/nios2-fp-bit.c
113.9786 -+DPBIT=$(srcdir)/config/nios2/nios2-dp-bit.c
113.9787 -+
113.9788 -+TARGET_LIBGCC2_CFLAGS = -O2
113.9789 -+
113.9790 -+# FLOAT_ONLY - no doubles
113.9791 -+# SMALL_MACHINE - QI/HI is faster than SI
113.9792 -+#     Actually SMALL_MACHINE uses chars and shorts instead of ints
113.9793 -+#     since ints (16-bit ones as they are today) are at least as fast
113.9794 -+#     as chars and shorts, don't define SMALL_MACHINE
113.9795 -+# CMPtype - type returned by FP compare, i.e. INT (hard coded in fp-bit - see code )
113.9796 -+
113.9797 -+$(FPBIT): $(srcdir)/config/fp-bit.c Makefile
113.9798 -+	echo '#define FLOAT'          >  ${FPBIT}
113.9799 -+	cat $(srcdir)/config/fp-bit.c >> ${FPBIT}
113.9800 -+
113.9801 -+$(DPBIT): $(srcdir)/config/fp-bit.c Makefile
113.9802 -+	echo ''          >  ${DPBIT}
113.9803 -+	cat $(srcdir)/config/fp-bit.c >> ${DPBIT}
113.9804 -+
113.9805 -+EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o 
113.9806 -+
113.9807 -+# Assemble startup files. 
113.9808 -+$(T)crti.o: $(srcdir)/config/nios2/crti.asm $(GCC_PASSES) 
113.9809 -+	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
113.9810 -+	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/nios2/crti.asm 
113.9811 -+
113.9812 -+$(T)crtn.o: $(srcdir)/config/nios2/crtn.asm $(GCC_PASSES) 
113.9813 -+	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
113.9814 -+	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/nios2/crtn.asm 
113.9815 -+
113.9816 -+
113.9817 -+## You may need to provide additional #defines at the beginning of
113.9818 -+## fp-bit.c and dp-bit.c to control target endianness and other options
113.9819 -+##
113.9820 -+## CRTSTUFF_T_CFLAGS
113.9821 -+## Special flags used when compiling crtstuff.c.  See Initialization.
113.9822 -+##
113.9823 -+## CRTSTUFF_T_CFLAGS_S
113.9824 -+## Special flags used when compiling crtstuff.c for shared linking.  Used
113.9825 -+## if you use crtbeginS.o and crtendS.o in EXTRA-PARTS. See Initialization.
113.9826 -+##
113.9827 -+## MULTILIB_OPTIONS
113.9828 -+## For some targets, invoking GCC in different ways produces objects that
113.9829 -+## can not be linked together.  For example, for some targets GCC produces
113.9830 -+## both big and little endian code.  For these targets, you must arrange
113.9831 -+## for multiple versions of libgcc.a to be compiled, one for each set of
113.9832 -+## incompatible options.  When GCC invokes the linker, it arranges to link
113.9833 -+## in the right version of libgcc.a, based on the command line options
113.9834 -+## used.
113.9835 -+## The MULTILIB_OPTIONS macro lists the set of options for which special
113.9836 -+## versions of libgcc.a must be built.  Write options that are mutually
113.9837 -+## incompatible side by side, separated by a slash.  Write options that may
113.9838 -+## be used together separated by a space.  The build procedure will build
113.9839 -+## all combinations of compatible options.
113.9840 -+##
113.9841 -+## For example, if you set MULTILIB_OPTIONS to m68000/m68020 msoft-float,
113.9842 -+## Makefile will build special versions of libgcc.a using the following
113.9843 -+## sets of options: -m68000, -m68020, -msoft-float, -m68000 -msoft-float,
113.9844 -+## and -m68020 -msoft-float.
113.9845 -+
113.9846 -+MULTILIB_OPTIONS = mno-hw-mul mhw-mulx
113.9847 -+
113.9848 -+## MULTILIB_DIRNAMES
113.9849 -+## If MULTILIB_OPTIONS is used, this variable specifies the directory names
113.9850 -+## that should be used to hold the various libraries.  Write one element in
113.9851 -+## MULTILIB_DIRNAMES for each element in MULTILIB_OPTIONS. If
113.9852 -+## MULTILIB_DIRNAMES is not used, the default value will be
113.9853 -+## MULTILIB_OPTIONS, with all slashes treated as spaces.
113.9854 -+## For example, if MULTILIB_OPTIONS is set to m68000/m68020 msoft-float,
113.9855 -+## then the default value of MULTILIB_DIRNAMES is m68000 m68020
113.9856 -+## msoft-float.  You may specify a different value if you desire a
113.9857 -+## different set of directory names.
113.9858 -+
113.9859 -+# MULTILIB_DIRNAMES =
113.9860 -+
113.9861 -+## MULTILIB_MATCHES
113.9862 -+## Sometimes the same option may be written in two different ways.  If an
113.9863 -+## option is listed in MULTILIB_OPTIONS, GCC needs to know about any
113.9864 -+## synonyms.  In that case, set MULTILIB_MATCHES to a list of items of the
113.9865 -+## form option=option to describe all relevant synonyms.  For example,
113.9866 -+## m68000=mc68000 m68020=mc68020.
113.9867 -+##
113.9868 -+## MULTILIB_EXCEPTIONS
113.9869 -+## Sometimes when there are multiple sets of MULTILIB_OPTIONS being
113.9870 -+## specified, there are combinations that should not be built.  In that
113.9871 -+## case, set MULTILIB_EXCEPTIONS to be all of the switch exceptions in
113.9872 -+## shell case syntax that should not be built.
113.9873 -+## For example, in the PowerPC embedded ABI support, it is not desirable to
113.9874 -+## build libraries compiled with the -mcall-aix option and either of the
113.9875 -+## -fleading-underscore or -mlittle options at the same time.  Therefore
113.9876 -+## MULTILIB_EXCEPTIONS is set to
113.9877 -+##
113.9878 -+## *mcall-aix/*fleading-underscore* *mlittle/*mcall-aix*
113.9879 -+##
113.9880 -+
113.9881 -+MULTILIB_EXCEPTIONS = *mno-hw-mul/*mhw-mulx*
113.9882 -+
113.9883 -+##
113.9884 -+## MULTILIB_EXTRA_OPTS Sometimes it is desirable that when building
113.9885 -+## multiple versions of libgcc.a certain options should always be passed on
113.9886 -+## to the compiler.  In that case, set MULTILIB_EXTRA_OPTS to be the list
113.9887 -+## of options to be used for all builds.
113.9888 -+##
113.9889 -+
113.9890 -diff -durN gcc-3.4.6.orig/gcc/config.gcc gcc-3.4.6/gcc/config.gcc
113.9891 ---- gcc-3.4.6.orig/gcc/config.gcc	2007-08-15 23:07:00.000000000 +0200
113.9892 -+++ gcc-3.4.6/gcc/config.gcc	2007-08-15 23:09:36.000000000 +0200
113.9893 -@@ -1342,6 +1342,10 @@
113.9894 - 		thread_file='posix'
113.9895 - 	fi
113.9896 - 	;;
113.9897 -+# JBG
113.9898 -+nios2-*-* | nios2-*-*)
113.9899 -+	tm_file="elfos.h ${tm_file}"
113.9900 -+	;;
113.9901 - # m68hc11 and m68hc12 share the same machine description.
113.9902 - m68hc11-*-*|m6811-*-*)
113.9903 - 	tm_file="dbxelf.h elfos.h m68hc11/m68hc11.h"
113.9904 -diff -durN gcc-3.4.6.orig/gcc/cse.c gcc-3.4.6/gcc/cse.c
113.9905 ---- gcc-3.4.6.orig/gcc/cse.c	2005-12-31 01:39:42.000000000 +0100
113.9906 -+++ gcc-3.4.6/gcc/cse.c	2007-08-15 23:09:36.000000000 +0200
113.9907 -@@ -3134,6 +3134,10 @@
113.9908 - #ifdef FLOAT_STORE_FLAG_VALUE
113.9909 - 	  REAL_VALUE_TYPE fsfv;
113.9910 - #endif
113.9911 -+#ifdef __nios2__
113.9912 -+	  if (p->is_const)
113.9913 -+	    break;
113.9914 -+#endif
113.9915 - 
113.9916 - 	  /* If the entry isn't valid, skip it.  */
113.9917 - 	  if (! exp_equiv_p (p->exp, p->exp, 1, 0))
113.9918 -diff -durN gcc-3.4.6.orig/gcc/doc/extend.texi gcc-3.4.6/gcc/doc/extend.texi
113.9919 ---- gcc-3.4.6.orig/gcc/doc/extend.texi	2005-02-26 23:17:26.000000000 +0100
113.9920 -+++ gcc-3.4.6/gcc/doc/extend.texi	2007-08-15 23:09:36.000000000 +0200
113.9921 -@@ -5638,12 +5638,118 @@
113.9922 - instructions, but allow the compiler to schedule those calls.
113.9923 - 
113.9924 - @menu
113.9925 -+* Altera Nios II Built-in Functions::
113.9926 - * Alpha Built-in Functions::
113.9927 - * ARM Built-in Functions::
113.9928 - * X86 Built-in Functions::
113.9929 - * PowerPC AltiVec Built-in Functions::
113.9930 - @end menu
113.9931 - 
113.9932 -+@node Altera Nios II Built-in Functions
113.9933 -+@subsection Altera Nios II Built-in Functions
113.9934 -+
113.9935 -+These built-in functions are available for the Altera Nios II
113.9936 -+family of processors.
113.9937 -+
113.9938 -+The following built-in functions are always available.  They
113.9939 -+all generate the machine instruction that is part of the name.
113.9940 -+
113.9941 -+@example
113.9942 -+int __builtin_ldbio (volatile const void *)
113.9943 -+int __builtin_ldbuio (volatile const void *)
113.9944 -+int __builtin_ldhio (volatile const void *)
113.9945 -+int __builtin_ldhuio (volatile const void *)
113.9946 -+int __builtin_ldwio (volatile const void *)
113.9947 -+void __builtin_stbio (volatile void *, int)
113.9948 -+void __builtin_sthio (volatile void *, int)
113.9949 -+void __builtin_stwio (volatile void *, int)
113.9950 -+void __builtin_sync (void)
113.9951 -+int __builtin_rdctl (int) 
113.9952 -+void __builtin_wrctl (int, int)
113.9953 -+@end example
113.9954 -+
113.9955 -+The following built-in functions are always available.  They
113.9956 -+all generate a Nios II Custom Instruction. The name of the 
113.9957 -+function represents the types that the function takes and 
113.9958 -+returns. The letter before the @code{n} is the return type
113.9959 -+or void if absent. The @code{n} represnts the first parameter
113.9960 -+to all the custom instructions, the custom instruction number.
113.9961 -+The two letters after the @code{n} represent the up to two 
113.9962 -+parameters to the function.
113.9963 -+
113.9964 -+The letters reprsent the following data types:
113.9965 -+@table @code
113.9966 -+@item <no letter>
113.9967 -+@code{void} for return type and no parameter for parameter types.
113.9968 -+
113.9969 -+@item i
113.9970 -+@code{int} for return type and parameter type
113.9971 -+
113.9972 -+@item f
113.9973 -+@code{float} for return type and parameter type
113.9974 -+
113.9975 -+@item p
113.9976 -+@code{void *} for return type and parameter type
113.9977 -+
113.9978 -+@end table
113.9979 -+
113.9980 -+And the function names are:
113.9981 -+@example
113.9982 -+void __builtin_custom_n (void)
113.9983 -+void __builtin_custom_ni (int)
113.9984 -+void __builtin_custom_nf (float)
113.9985 -+void __builtin_custom_np (void *)
113.9986 -+void __builtin_custom_nii (int, int)
113.9987 -+void __builtin_custom_nif (int, float)
113.9988 -+void __builtin_custom_nip (int, void *)
113.9989 -+void __builtin_custom_nfi (float, int)
113.9990 -+void __builtin_custom_nff (float, float)
113.9991 -+void __builtin_custom_nfp (float, void *)
113.9992 -+void __builtin_custom_npi (void *, int)
113.9993 -+void __builtin_custom_npf (void *, float)
113.9994 -+void __builtin_custom_npp (void *, void *)
113.9995 -+int __builtin_custom_in (void)
113.9996 -+int __builtin_custom_ini (int)
113.9997 -+int __builtin_custom_inf (float)
113.9998 -+int __builtin_custom_inp (void *)
113.9999 -+int __builtin_custom_inii (int, int)
113.10000 -+int __builtin_custom_inif (int, float)
113.10001 -+int __builtin_custom_inip (int, void *)
113.10002 -+int __builtin_custom_infi (float, int)
113.10003 -+int __builtin_custom_inff (float, float)
113.10004 -+int __builtin_custom_infp (float, void *)
113.10005 -+int __builtin_custom_inpi (void *, int)
113.10006 -+int __builtin_custom_inpf (void *, float)
113.10007 -+int __builtin_custom_inpp (void *, void *)
113.10008 -+float __builtin_custom_fn (void)
113.10009 -+float __builtin_custom_fni (int)
113.10010 -+float __builtin_custom_fnf (float)
113.10011 -+float __builtin_custom_fnp (void *)
113.10012 -+float __builtin_custom_fnii (int, int)
113.10013 -+float __builtin_custom_fnif (int, float)
113.10014 -+float __builtin_custom_fnip (int, void *)
113.10015 -+float __builtin_custom_fnfi (float, int)
113.10016 -+float __builtin_custom_fnff (float, float)
113.10017 -+float __builtin_custom_fnfp (float, void *)
113.10018 -+float __builtin_custom_fnpi (void *, int)
113.10019 -+float __builtin_custom_fnpf (void *, float)
113.10020 -+float __builtin_custom_fnpp (void *, void *)
113.10021 -+void * __builtin_custom_pn (void)
113.10022 -+void * __builtin_custom_pni (int)
113.10023 -+void * __builtin_custom_pnf (float)
113.10024 -+void * __builtin_custom_pnp (void *)
113.10025 -+void * __builtin_custom_pnii (int, int)
113.10026 -+void * __builtin_custom_pnif (int, float)
113.10027 -+void * __builtin_custom_pnip (int, void *)
113.10028 -+void * __builtin_custom_pnfi (float, int)
113.10029 -+void * __builtin_custom_pnff (float, float)
113.10030 -+void * __builtin_custom_pnfp (float, void *)
113.10031 -+void * __builtin_custom_pnpi (void *, int)
113.10032 -+void * __builtin_custom_pnpf (void *, float)
113.10033 -+void * __builtin_custom_pnpp (void *, void *)
113.10034 -+@end example
113.10035 -+
113.10036 -+
113.10037 - @node Alpha Built-in Functions
113.10038 - @subsection Alpha Built-in Functions
113.10039 - 
113.10040 -diff -durN gcc-3.4.6.orig/gcc/doc/invoke.texi gcc-3.4.6/gcc/doc/invoke.texi
113.10041 ---- gcc-3.4.6.orig/gcc/doc/invoke.texi	2005-10-08 02:22:20.000000000 +0200
113.10042 -+++ gcc-3.4.6/gcc/doc/invoke.texi	2007-08-15 23:09:36.000000000 +0200
113.10043 -@@ -337,6 +337,14 @@
113.10044 - @item Machine Dependent Options
113.10045 - @xref{Submodel Options,,Hardware Models and Configurations}.
113.10046 - 
113.10047 -+@emph{Altera Nios II Options}
113.10048 -+@gccoptlist{-msmallc -mno-bypass-cache -mbypass-cache @gol
113.10049 -+-mno-cache-volatile -mcache-volatile -mno-inline-memcpy @gol 
113.10050 -+-minline-memcpy -mno-fast-sw-div -mfast-sw-div @gol
113.10051 -+-mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx @gol
113.10052 -+-mno-hw-div -mhw-div @gol
113.10053 -+-msys-crt0= -msys-lib= -msys=nosys }
113.10054 -+
113.10055 - @emph{M680x0 Options}
113.10056 - @gccoptlist{-m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
113.10057 - -m68060  -mcpu32  -m5200  -m68881  -mbitfield  -mc68000  -mc68020   @gol
113.10058 -@@ -5839,6 +5847,7 @@
113.10059 - that macro, which enables you to change the defaults.
113.10060 - 
113.10061 - @menu
113.10062 -+* Altera Nios II Options::
113.10063 - * M680x0 Options::
113.10064 - * M68hc1x Options::
113.10065 - * VAX Options::
113.10066 -@@ -5874,6 +5883,103 @@
113.10067 - * FRV Options::
113.10068 - @end menu
113.10069 - 
113.10070 -+
113.10071 -+@node Altera Nios II Options
113.10072 -+@subsection Altera Nios II Options
113.10073 -+@cindex Altera Nios II options
113.10074 -+
113.10075 -+These are the @samp{-m} options defined for the Altera Nios II 
113.10076 -+processor.
113.10077 -+
113.10078 -+@table @gcctabopt
113.10079 -+
113.10080 -+@item -msmallc
113.10081 -+@opindex msmallc
113.10082 -+
113.10083 -+Link with a limited version of the C library, -lsmallc. For more 
113.10084 -+information see the C Library Documentation.
113.10085 -+
113.10086 -+
113.10087 -+@item -mbypass-cache
113.10088 -+@itemx -mno-bypass-cache
113.10089 -+@opindex mno-bypass-cache
113.10090 -+@opindex mbypass-cache
113.10091 -+
113.10092 -+Force all load and store instructions to always bypass cache by 
113.10093 -+using io variants of the instructions. The default is to not
113.10094 -+bypass the cache.
113.10095 -+
113.10096 -+@item -mno-cache-volatile 
113.10097 -+@itemx -mcache-volatile       
113.10098 -+@opindex mcache-volatile 
113.10099 -+@opindex mno-cache-volatile
113.10100 -+
113.10101 -+Volatile memory access bypass the cache using the io variants of 
113.10102 -+the ld and st instructions. The default is to cache volatile 
113.10103 -+accesses. 
113.10104 -+
113.10105 -+-mno-cache-volatile is deprecated and will be deleted in a 
113.10106 -+future GCC release.
113.10107 -+
113.10108 -+
113.10109 -+@item -mno-inline-memcpy
113.10110 -+@itemx -minline-memcpy
113.10111 -+@opindex mno-inline-memcpy 
113.10112 -+@opindex minline-memcpy
113.10113 -+
113.10114 -+Do not inline memcpy. The default is to inline when -O is on.
113.10115 -+
113.10116 -+
113.10117 -+@item -mno-fast-sw-div
113.10118 -+@itemx -mfast-sw-div
113.10119 -+@opindex mno-fast-sw-div
113.10120 -+@opindex mfast-sw-div
113.10121 -+
113.10122 -+Do no use table based fast divide for small numbers. The default 
113.10123 -+is to use the fast divide at -O3 and above.
113.10124 -+
113.10125 -+
113.10126 -+@item -mno-hw-mul
113.10127 -+@itemx -mhw-mul
113.10128 -+@itemx -mno-hw-mulx
113.10129 -+@itemx -mhw-mulx
113.10130 -+@itemx -mno-hw-div
113.10131 -+@itemx -mhw-div
113.10132 -+@opindex mno-hw-mul
113.10133 -+@opindex mhw-mul
113.10134 -+@opindex mno-hw-mulx
113.10135 -+@opindex mhw-mulx
113.10136 -+@opindex mno-hw-div
113.10137 -+@opindex mhw-div
113.10138 -+
113.10139 -+Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
113.10140 -+instructions by the compiler. The default is to emit @code{mul}
113.10141 -+and not emit @code{div} and @code{mulx}.
113.10142 -+
113.10143 -+The different combinations of @code{mul} and @code{mulx} instructions 
113.10144 -+generate a different multilib options. 
113.10145 -+
113.10146 -+
113.10147 -+@item -msys-crt0=@var{startfile}
113.10148 -+@opindex msys-crt0
113.10149 -+
113.10150 -+@var{startfile} is the file name  of the startfile (crt0) to use 
113.10151 -+when linking. The default is crt0.o that comes with libgloss
113.10152 -+and is only suitable for use with the instruction set
113.10153 -+simulator.
113.10154 -+
113.10155 -+@item -msys-lib=@var{systemlib}
113.10156 -+@itemx -msys-lib=nosys
113.10157 -+@opindex msys-lib
113.10158 -+
113.10159 -+@var{systemlib} is the library name of the library which provides
113.10160 -+the system calls required by the C library, e.g. @code{read}, @code{write}
113.10161 -+etc. The default is to use nosys, this library provides
113.10162 -+stub implementations of the calls and is part of libgloss.
113.10163 -+
113.10164 -+@end table
113.10165 -+
113.10166 -+
113.10167 - @node M680x0 Options
113.10168 - @subsection M680x0 Options
113.10169 - @cindex M680x0 options
113.10170 -diff -durN gcc-3.4.6.orig/gcc/doc/md.texi gcc-3.4.6/gcc/doc/md.texi
113.10171 ---- gcc-3.4.6.orig/gcc/doc/md.texi	2004-11-13 23:31:42.000000000 +0100
113.10172 -+++ gcc-3.4.6/gcc/doc/md.texi	2007-08-15 23:09:36.000000000 +0200
113.10173 -@@ -1337,6 +1337,49 @@
113.10174 - available on some particular machines.
113.10175 - 
113.10176 - @table @emph
113.10177 -+
113.10178 -+@item Altera Nios II family---@file{nios2.h}
113.10179 -+@table @code
113.10180 -+
113.10181 -+@item I
113.10182 -+Integer that is valid as an immediate operand in an
113.10183 -+instruction taking a signed 16-bit number. Range
113.10184 -+@minus{}32768 to 32767.
113.10185 -+
113.10186 -+@item J
113.10187 -+Integer that is valid as an immediate operand in an
113.10188 -+instruction taking an unsigned 16-bit number. Range
113.10189 -+0 to 65535.
113.10190 -+
113.10191 -+@item K
113.10192 -+Integer that is valid as an immediate operand in an
113.10193 -+instruction taking only the upper 16-bits of a
113.10194 -+32-bit number. Range 32-bit numbers with the lower
113.10195 -+16-bits being 0.
113.10196 -+
113.10197 -+@item L
113.10198 -+Integer that is valid as an immediate operand for a 
113.10199 -+shift instruction. Range 0 to 31.
113.10200 -+
113.10201 -+
113.10202 -+@item M
113.10203 -+Integer that is valid as an immediate operand for
113.10204 -+only the value 0. Can be used in conjunction with
113.10205 -+the format modifier @code{z} to use @code{r0}
113.10206 -+instead of @code{0} in the assembly output.
113.10207 -+
113.10208 -+@item N
113.10209 -+Integer that is valid as an immediate operand for
113.10210 -+a custom instruction opcode. Range 0 to 255.
113.10211 -+
113.10212 -+@item S
113.10213 -+Matches immediates which are addresses in the small
113.10214 -+data section and therefore can be added to @code{gp}
113.10215 -+as a 16-bit immediate to re-create their 32-bit value.
113.10216 -+
113.10217 -+@end table
113.10218 -+
113.10219 -+
113.10220 - @item ARM family---@file{arm.h}
113.10221 - @table @code
113.10222 - @item f
113.10223 -diff -durN gcc-3.4.6.orig/gcc/Makefile.in gcc-3.4.6/gcc/Makefile.in
113.10224 ---- gcc-3.4.6.orig/gcc/Makefile.in	2005-02-24 10:26:59.000000000 +0100
113.10225 -+++ gcc-3.4.6/gcc/Makefile.in	2007-08-15 23:09:36.000000000 +0200
113.10226 -@@ -3094,7 +3094,7 @@
113.10227 - 	  $(INSTALL_DATA) $(srcdir)/README-fixinc \
113.10228 - 	    $(DESTDIR)$(itoolsdatadir)/include/README ; \
113.10229 - 	  $(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh ; \
113.10230 --	  $(INSTALL_PROGRAM) fixinc/fixincl $(DESTDIR)$(itoolsdir)/fixincl ; \
113.10231 -+	  $(INSTALL_PROGRAM) fixinc/fixincl$(build_exeext) $(DESTDIR)$(itoolsdir)/fixincl$(build_exeext) ; \
113.10232 - 	  $(INSTALL_DATA) $(srcdir)/gsyslimits.h \
113.10233 - 	    $(DESTDIR)$(itoolsdatadir)/gsyslimits.h ; \
113.10234 - 	else :; fi
   114.1 --- a/patches/gcc/3.4.6/910-arm-softfloat.patch	Mon Jul 28 21:08:01 2008 +0000
   114.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.3 @@ -1,161 +0,0 @@
   114.4 -diff -durN gcc-3.4.6.orig/gcc/config/arm/coff.h gcc-3.4.6/gcc/config/arm/coff.h
   114.5 ---- gcc-3.4.6.orig/gcc/config/arm/coff.h	2004-02-24 15:25:22.000000000 +0100
   114.6 -+++ gcc-3.4.6/gcc/config/arm/coff.h	2007-08-15 23:10:54.000000000 +0200
   114.7 -@@ -31,11 +31,16 @@
   114.8 - #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
   114.9 - 
  114.10 - #undef  TARGET_DEFAULT
  114.11 --#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
  114.12 -+#define TARGET_DEFAULT		\
  114.13 -+	( ARM_FLAG_SOFT_FLOAT	\
  114.14 -+	| ARM_FLAG_VFP		\
  114.15 -+	| ARM_FLAG_APCS_32	\
  114.16 -+	| ARM_FLAG_APCS_FRAME	\
  114.17 -+	| ARM_FLAG_MMU_TRAPS )
  114.18 - 
  114.19 - #ifndef MULTILIB_DEFAULTS
  114.20 - #define MULTILIB_DEFAULTS \
  114.21 --  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
  114.22 -+  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
  114.23 - #endif
  114.24 - 
  114.25 - /* This is COFF, but prefer stabs.  */
  114.26 -diff -durN gcc-3.4.6.orig/gcc/config/arm/elf.h gcc-3.4.6/gcc/config/arm/elf.h
  114.27 ---- gcc-3.4.6.orig/gcc/config/arm/elf.h	2004-02-24 15:25:22.000000000 +0100
  114.28 -+++ gcc-3.4.6/gcc/config/arm/elf.h	2007-08-15 23:10:54.000000000 +0200
  114.29 -@@ -46,7 +46,9 @@
  114.30 - 
  114.31 - #ifndef SUBTARGET_ASM_FLOAT_SPEC
  114.32 - #define SUBTARGET_ASM_FLOAT_SPEC "\
  114.33 --%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
  114.34 -+%{mapcs-float:-mfloat} \
  114.35 -+%{mhard-float:-mfpu=fpa} \
  114.36 -+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
  114.37 - #endif
  114.38 - 
  114.39 - #ifndef ASM_SPEC
  114.40 -@@ -106,12 +108,17 @@
  114.41 - #endif
  114.42 - 
  114.43 - #ifndef TARGET_DEFAULT
  114.44 --#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
  114.45 -+#define TARGET_DEFAULT		\
  114.46 -+	( ARM_FLAG_SOFT_FLOAT	\
  114.47 -+	| ARM_FLAG_VFP		\
  114.48 -+	| ARM_FLAG_APCS_32	\
  114.49 -+	| ARM_FLAG_APCS_FRAME	\
  114.50 -+	| ARM_FLAG_MMU_TRAPS )
  114.51 - #endif
  114.52 - 
  114.53 - #ifndef MULTILIB_DEFAULTS
  114.54 - #define MULTILIB_DEFAULTS \
  114.55 --  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
  114.56 -+  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
  114.57 - #endif
  114.58 - 
  114.59 - #define TARGET_ASM_FILE_START_APP_OFF true
  114.60 -diff -durN gcc-3.4.6.orig/gcc/config/arm/linux-elf.h gcc-3.4.6/gcc/config/arm/linux-elf.h
  114.61 ---- gcc-3.4.6.orig/gcc/config/arm/linux-elf.h	2007-08-15 23:07:00.000000000 +0200
  114.62 -+++ gcc-3.4.6/gcc/config/arm/linux-elf.h	2007-08-15 23:10:54.000000000 +0200
  114.63 -@@ -44,12 +44,26 @@
  114.64 - #define TARGET_LINKER_EMULATION "armelf_linux"
  114.65 - #endif
  114.66 - 
  114.67 --/* Default is to use APCS-32 mode.  */
  114.68 -+/*
  114.69 -+ * Default is to use APCS-32 mode with soft-vfp.
  114.70 -+ * The old Linux default for floats can be achieved with -mhard-float
  114.71 -+ * or with the configure --with-float=hard option.
  114.72 -+ * If -msoft-float or --with-float=soft is used then software float 
  114.73 -+ * support will be used just like the default but with the legacy
  114.74 -+ * big endian word ordering for double float representation instead.
  114.75 -+ */
  114.76 - #undef  TARGET_DEFAULT
  114.77 --#define TARGET_DEFAULT \
  114.78 --		( ARM_FLAG_APCS_32 | \
  114.79 --		  ARM_FLAG_MMU_TRAPS | \
  114.80 --		  TARGET_ENDIAN_DEFAULT )
  114.81 -+#define TARGET_DEFAULT		\
  114.82 -+	( ARM_FLAG_APCS_32	\
  114.83 -+	| ARM_FLAG_SOFT_FLOAT	\
  114.84 -+	| TARGET_ENDIAN_DEFAULT	\
  114.85 -+	| ARM_FLAG_VFP		\
  114.86 -+	| ARM_FLAG_MMU_TRAPS )
  114.87 -+
  114.88 -+#undef  SUBTARGET_EXTRA_ASM_SPEC
  114.89 -+#define SUBTARGET_EXTRA_ASM_SPEC "\
  114.90 -+%{mhard-float:-mfpu=fpa} \
  114.91 -+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
  114.92 - 
  114.93 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  114.94 - 
  114.95 -@@ -57,7 +71,7 @@
  114.96 - 
  114.97 - #undef  MULTILIB_DEFAULTS
  114.98 - #define MULTILIB_DEFAULTS \
  114.99 --	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
 114.100 -+	{ "marm", TARGET_ENDIAN_OPTION, "mapcs-32", "mno-thumb-interwork" }
 114.101 - 
 114.102 - #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
 114.103 - 
 114.104 -@@ -72,7 +86,7 @@
 114.105 -    %{shared:-lc} \
 114.106 -    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
 114.107 - 
 114.108 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
 114.109 -+#define LIBGCC_SPEC "-lgcc"
 114.110 - 
 114.111 - /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
 114.112 -    the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
 114.113 -diff -durN gcc-3.4.6.orig/gcc/config/arm/t-linux gcc-3.4.6/gcc/config/arm/t-linux
 114.114 ---- gcc-3.4.6.orig/gcc/config/arm/t-linux	2003-09-20 23:09:07.000000000 +0200
 114.115 -+++ gcc-3.4.6/gcc/config/arm/t-linux	2007-08-15 23:10:54.000000000 +0200
 114.116 -@@ -4,7 +4,10 @@
 114.117 - LIBGCC2_DEBUG_CFLAGS = -g0
 114.118 - 
 114.119 - LIB1ASMSRC = arm/lib1funcs.asm
 114.120 --LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
 114.121 -+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
 114.122 -+	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
 114.123 -+	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
 114.124 -+	_fixsfsi _fixunssfsi
 114.125 - 
 114.126 - # MULTILIB_OPTIONS = mhard-float/msoft-float
 114.127 - # MULTILIB_DIRNAMES = hard-float soft-float
 114.128 -diff -durN gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h gcc-3.4.6/gcc/config/arm/unknown-elf.h
 114.129 ---- gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h	2004-02-24 15:25:22.000000000 +0100
 114.130 -+++ gcc-3.4.6/gcc/config/arm/unknown-elf.h	2007-08-15 23:10:54.000000000 +0200
 114.131 -@@ -30,7 +30,12 @@
 114.132 - 
 114.133 - /* Default to using APCS-32 and software floating point.  */
 114.134 - #ifndef TARGET_DEFAULT
 114.135 --#define TARGET_DEFAULT	(ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
 114.136 -+#define TARGET_DEFAULT		\
 114.137 -+	( ARM_FLAG_SOFT_FLOAT	\
 114.138 -+	| ARM_FLAG_VFP		\
 114.139 -+	| ARM_FLAG_APCS_32	\
 114.140 -+	| ARM_FLAG_APCS_FRAME	\
 114.141 -+	| ARM_FLAG_MMU_TRAPS )
 114.142 - #endif
 114.143 - 
 114.144 - /* Now we define the strings used to build the spec file.  */
 114.145 -diff -durN gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h gcc-3.4.6/gcc/config/arm/xscale-elf.h
 114.146 ---- gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h	2003-07-02 01:26:43.000000000 +0200
 114.147 -+++ gcc-3.4.6/gcc/config/arm/xscale-elf.h	2007-08-15 23:10:54.000000000 +0200
 114.148 -@@ -49,11 +49,12 @@
 114.149 - 		     endian, regardless of the endian-ness of the memory
 114.150 - 		     system.  */
 114.151 - 		     
 114.152 --#define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
 114.153 --  %{mhard-float:-mfpu=fpa} \
 114.154 --  %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
 114.155 -+#define SUBTARGET_EXTRA_ASM_SPEC "\
 114.156 -+%{!mcpu=*:-mcpu=xscale} \
 114.157 -+%{mhard-float:-mfpu=fpa} \
 114.158 -+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
 114.159 - 
 114.160 - #ifndef MULTILIB_DEFAULTS
 114.161 - #define MULTILIB_DEFAULTS \
 114.162 --  { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" }
 114.163 -+  { "mlittle-endian", "mno-thumb-interwork", "marm" }
 114.164 - #endif
   115.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   115.2 +++ b/patches/gcc/4.0.3/110-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   115.3 @@ -0,0 +1,3237 @@
   115.4 +diff -urN gcc-4.0.0-100/libstdc++-v3/acinclude.m4 gcc-4.0.0/libstdc++-v3/acinclude.m4
   115.5 +--- gcc-4.0.0-100/libstdc++-v3/acinclude.m4	2005-04-30 13:06:53.000000000 -0500
   115.6 ++++ gcc-4.0.0/libstdc++-v3/acinclude.m4	2005-04-28 20:19:01.000000000 -0500
   115.7 +@@ -1104,7 +1104,7 @@
   115.8 +   AC_MSG_CHECKING([for C locale to use])
   115.9 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  115.10 +     [use MODEL for target locale package],
  115.11 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  115.12 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  115.13 +   
  115.14 +   # If they didn't use this option switch, or if they specified --enable
  115.15 +   # with no specific model, we'll have to look for one.  If they
  115.16 +@@ -1120,6 +1120,9 @@
  115.17 +   # Default to "generic".
  115.18 +   if test $enable_clocale_flag = auto; then
  115.19 +     case ${target_os} in
  115.20 ++      *-uclibc*)
  115.21 ++        enable_clocale_flag=uclibc
  115.22 ++        ;;
  115.23 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  115.24 +         AC_EGREP_CPP([_GLIBCXX_ok], [
  115.25 +         #include <features.h>
  115.26 +@@ -1263,6 +1266,40 @@
  115.27 +       CTIME_CC=config/locale/generic/time_members.cc
  115.28 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  115.29 +       ;;
  115.30 ++    uclibc)
  115.31 ++      AC_MSG_RESULT(uclibc)
  115.32 ++
  115.33 ++      # Declare intention to use gettext, and add support for specific
  115.34 ++      # languages.
  115.35 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  115.36 ++      ALL_LINGUAS="de fr"
  115.37 ++
  115.38 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  115.39 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  115.40 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  115.41 ++        USE_NLS=yes
  115.42 ++      fi
  115.43 ++      # Export the build objects.
  115.44 ++      for ling in $ALL_LINGUAS; do \
  115.45 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  115.46 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  115.47 ++      done
  115.48 ++      AC_SUBST(glibcxx_MOFILES)
  115.49 ++      AC_SUBST(glibcxx_POFILES)
  115.50 ++
  115.51 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  115.52 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  115.53 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  115.54 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  115.55 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  115.56 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  115.57 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  115.58 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  115.59 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  115.60 ++      CTIME_H=config/locale/uclibc/time_members.h
  115.61 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  115.62 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  115.63 ++      ;;
  115.64 +   esac
  115.65 + 
  115.66 +   # This is where the testsuite looks for locale catalogs, using the
  115.67 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  115.68 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1969-12-31 18:00:00.000000000 -0600
  115.69 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2005-04-28 01:13:15.000000000 -0500
  115.70 +@@ -0,0 +1,59 @@
  115.71 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  115.72 ++
  115.73 ++// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
  115.74 ++//
  115.75 ++// This file is part of the GNU ISO C++ Library.  This library is free
  115.76 ++// software; you can redistribute it and/or modify it under the
  115.77 ++// terms of the GNU General Public License as published by the
  115.78 ++// Free Software Foundation; either version 2, or (at your option)
  115.79 ++// any later version.
  115.80 ++
  115.81 ++// This library is distributed in the hope that it will be useful,
  115.82 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  115.83 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  115.84 ++// GNU General Public License for more details.
  115.85 ++
  115.86 ++// You should have received a copy of the GNU General Public License along
  115.87 ++// with this library; see the file COPYING.  If not, write to the Free
  115.88 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  115.89 ++// USA.
  115.90 ++
  115.91 ++// As a special exception, you may use this file as part of a free software
  115.92 ++// library without restriction.  Specifically, if other files instantiate
  115.93 ++// templates or use macros or inline functions from this file, or you compile
  115.94 ++// this file and link it with other files to produce an executable, this
  115.95 ++// file does not by itself cause the resulting executable to be covered by
  115.96 ++// the GNU General Public License.  This exception does not however
  115.97 ++// invalidate any other reasons why the executable file might be covered by
  115.98 ++// the GNU General Public License.
  115.99 ++
 115.100 ++// Written by Jakub Jelinek <jakub@redhat.com>
 115.101 ++
 115.102 ++#include <clocale>
 115.103 ++
 115.104 ++#ifdef __UCLIBC_MJN3_ONLY__
 115.105 ++#warning clean this up
 115.106 ++#endif
 115.107 ++
 115.108 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.109 ++                                                  
 115.110 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 115.111 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 115.112 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 115.113 ++extern "C" __typeof(strftime_l) __strftime_l;
 115.114 ++extern "C" __typeof(strtod_l) __strtod_l;
 115.115 ++extern "C" __typeof(strtof_l) __strtof_l;
 115.116 ++extern "C" __typeof(strtold_l) __strtold_l;
 115.117 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 115.118 ++extern "C" __typeof(towlower_l) __towlower_l;
 115.119 ++extern "C" __typeof(towupper_l) __towupper_l;
 115.120 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 115.121 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 115.122 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 115.123 ++extern "C" __typeof(wctype_l) __wctype_l;
 115.124 ++extern "C" __typeof(newlocale) __newlocale;
 115.125 ++extern "C" __typeof(freelocale) __freelocale;
 115.126 ++extern "C" __typeof(duplocale) __duplocale;
 115.127 ++extern "C" __typeof(uselocale) __uselocale;
 115.128 ++
 115.129 ++#endif // GLIBC 2.3 and later
 115.130 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
 115.131 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.cc	1969-12-31 18:00:00.000000000 -0600
 115.132 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2005-04-28 01:13:15.000000000 -0500
 115.133 +@@ -0,0 +1,160 @@
 115.134 ++// Wrapper for underlying C-language localization -*- C++ -*-
 115.135 ++
 115.136 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 115.137 ++//
 115.138 ++// This file is part of the GNU ISO C++ Library.  This library is free
 115.139 ++// software; you can redistribute it and/or modify it under the
 115.140 ++// terms of the GNU General Public License as published by the
 115.141 ++// Free Software Foundation; either version 2, or (at your option)
 115.142 ++// any later version.
 115.143 ++
 115.144 ++// This library is distributed in the hope that it will be useful,
 115.145 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 115.146 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 115.147 ++// GNU General Public License for more details.
 115.148 ++
 115.149 ++// You should have received a copy of the GNU General Public License along
 115.150 ++// with this library; see the file COPYING.  If not, write to the Free
 115.151 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 115.152 ++// USA.
 115.153 ++
 115.154 ++// As a special exception, you may use this file as part of a free software
 115.155 ++// library without restriction.  Specifically, if other files instantiate
 115.156 ++// templates or use macros or inline functions from this file, or you compile
 115.157 ++// this file and link it with other files to produce an executable, this
 115.158 ++// file does not by itself cause the resulting executable to be covered by
 115.159 ++// the GNU General Public License.  This exception does not however
 115.160 ++// invalidate any other reasons why the executable file might be covered by
 115.161 ++// the GNU General Public License.
 115.162 ++
 115.163 ++//
 115.164 ++// ISO C++ 14882: 22.8  Standard locale categories.
 115.165 ++//
 115.166 ++
 115.167 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 115.168 ++
 115.169 ++#include <cerrno>  // For errno
 115.170 ++#include <locale>
 115.171 ++#include <stdexcept>
 115.172 ++#include <langinfo.h>
 115.173 ++#include <bits/c++locale_internal.h>
 115.174 ++
 115.175 ++#ifndef __UCLIBC_HAS_XLOCALE__
 115.176 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 115.177 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 115.178 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 115.179 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 115.180 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 115.181 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 115.182 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 115.183 ++#warning should dummy __newlocale check for C|POSIX ?
 115.184 ++#define __newlocale(a, b, c)        NULL
 115.185 ++#define __freelocale(a)             ((void)0)
 115.186 ++#define __duplocale(a)              __c_locale()
 115.187 ++#endif
 115.188 ++
 115.189 ++namespace std 
 115.190 ++{
 115.191 ++  template<>
 115.192 ++    void
 115.193 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 115.194 ++		   const __c_locale& __cloc)
 115.195 ++    {
 115.196 ++      if (!(__err & ios_base::failbit))
 115.197 ++	{
 115.198 ++	  char* __sanity;
 115.199 ++	  errno = 0;
 115.200 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
 115.201 ++          if (__sanity != __s && errno != ERANGE)
 115.202 ++	    __v = __f;
 115.203 ++	  else
 115.204 ++	    __err |= ios_base::failbit;
 115.205 ++	}
 115.206 ++    }
 115.207 ++
 115.208 ++  template<>
 115.209 ++    void
 115.210 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 115.211 ++		   const __c_locale& __cloc)
 115.212 ++    {
 115.213 ++      if (!(__err & ios_base::failbit))
 115.214 ++	{
 115.215 ++	  char* __sanity;
 115.216 ++	  errno = 0;
 115.217 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
 115.218 ++          if (__sanity != __s && errno != ERANGE)
 115.219 ++	    __v = __d;
 115.220 ++	  else
 115.221 ++	    __err |= ios_base::failbit;
 115.222 ++	}
 115.223 ++    }
 115.224 ++
 115.225 ++  template<>
 115.226 ++    void
 115.227 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 115.228 ++		   const __c_locale& __cloc)
 115.229 ++    {
 115.230 ++      if (!(__err & ios_base::failbit))
 115.231 ++	{
 115.232 ++	  char* __sanity;
 115.233 ++	  errno = 0;
 115.234 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 115.235 ++          if (__sanity != __s && errno != ERANGE)
 115.236 ++	    __v = __ld;
 115.237 ++	  else
 115.238 ++	    __err |= ios_base::failbit;
 115.239 ++	}
 115.240 ++    }
 115.241 ++
 115.242 ++  void
 115.243 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 115.244 ++				    __c_locale __old)
 115.245 ++  {
 115.246 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 115.247 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.248 ++    if (!__cloc)
 115.249 ++      {
 115.250 ++	// This named locale is not supported by the underlying OS.
 115.251 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 115.252 ++			      "name not valid"));
 115.253 ++      }
 115.254 ++#endif
 115.255 ++  }
 115.256 ++  
 115.257 ++  void
 115.258 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 115.259 ++  {
 115.260 ++    if (_S_get_c_locale() != __cloc)
 115.261 ++      __freelocale(__cloc); 
 115.262 ++  }
 115.263 ++
 115.264 ++  __c_locale
 115.265 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 115.266 ++  { return __duplocale(__cloc); }
 115.267 ++} // namespace std
 115.268 ++
 115.269 ++namespace __gnu_cxx
 115.270 ++{
 115.271 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 115.272 ++    {
 115.273 ++      "LC_CTYPE", 
 115.274 ++      "LC_NUMERIC",
 115.275 ++      "LC_TIME", 
 115.276 ++      "LC_COLLATE", 
 115.277 ++      "LC_MONETARY",
 115.278 ++      "LC_MESSAGES", 
 115.279 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 115.280 ++      "LC_PAPER", 
 115.281 ++      "LC_NAME", 
 115.282 ++      "LC_ADDRESS",
 115.283 ++      "LC_TELEPHONE", 
 115.284 ++      "LC_MEASUREMENT", 
 115.285 ++      "LC_IDENTIFICATION" 
 115.286 ++#endif
 115.287 ++    };
 115.288 ++}
 115.289 ++
 115.290 ++namespace std
 115.291 ++{
 115.292 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 115.293 ++}  // namespace std
 115.294 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.h
 115.295 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.h	1969-12-31 18:00:00.000000000 -0600
 115.296 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2005-04-28 01:13:15.000000000 -0500
 115.297 +@@ -0,0 +1,115 @@
 115.298 ++// Wrapper for underlying C-language localization -*- C++ -*-
 115.299 ++
 115.300 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 115.301 ++//
 115.302 ++// This file is part of the GNU ISO C++ Library.  This library is free
 115.303 ++// software; you can redistribute it and/or modify it under the
 115.304 ++// terms of the GNU General Public License as published by the
 115.305 ++// Free Software Foundation; either version 2, or (at your option)
 115.306 ++// any later version.
 115.307 ++
 115.308 ++// This library is distributed in the hope that it will be useful,
 115.309 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 115.310 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 115.311 ++// GNU General Public License for more details.
 115.312 ++
 115.313 ++// You should have received a copy of the GNU General Public License along
 115.314 ++// with this library; see the file COPYING.  If not, write to the Free
 115.315 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 115.316 ++// USA.
 115.317 ++
 115.318 ++// As a special exception, you may use this file as part of a free software
 115.319 ++// library without restriction.  Specifically, if other files instantiate
 115.320 ++// templates or use macros or inline functions from this file, or you compile
 115.321 ++// this file and link it with other files to produce an executable, this
 115.322 ++// file does not by itself cause the resulting executable to be covered by
 115.323 ++// the GNU General Public License.  This exception does not however
 115.324 ++// invalidate any other reasons why the executable file might be covered by
 115.325 ++// the GNU General Public License.
 115.326 ++
 115.327 ++//
 115.328 ++// ISO C++ 14882: 22.8  Standard locale categories.
 115.329 ++//
 115.330 ++
 115.331 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 115.332 ++
 115.333 ++#ifndef _C_LOCALE_H
 115.334 ++#define _C_LOCALE_H 1
 115.335 ++
 115.336 ++#pragma GCC system_header
 115.337 ++
 115.338 ++#include <cstring>              // get std::strlen
 115.339 ++#include <cstdio>               // get std::snprintf or std::sprintf
 115.340 ++#include <clocale>
 115.341 ++#include <langinfo.h>		// For codecvt
 115.342 ++#ifdef __UCLIBC_MJN3_ONLY__
 115.343 ++#warning fix this
 115.344 ++#endif
 115.345 ++#ifdef __UCLIBC_HAS_LOCALE__
 115.346 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 115.347 ++#endif
 115.348 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 115.349 ++#include <libintl.h> 		// For messages
 115.350 ++#endif
 115.351 ++
 115.352 ++#ifdef __UCLIBC_MJN3_ONLY__
 115.353 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 115.354 ++#endif
 115.355 ++#define _GLIBCXX_C_LOCALE_GNU 1
 115.356 ++
 115.357 ++#ifdef __UCLIBC_MJN3_ONLY__
 115.358 ++#warning fix categories
 115.359 ++#endif
 115.360 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 115.361 ++#define _GLIBCXX_NUM_CATEGORIES 0
 115.362 ++ 
 115.363 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.364 ++namespace __gnu_cxx
 115.365 ++{
 115.366 ++  extern "C" __typeof(uselocale) __uselocale;
 115.367 ++}
 115.368 ++#endif
 115.369 ++
 115.370 ++namespace std
 115.371 ++{
 115.372 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.373 ++  typedef __locale_t		__c_locale;
 115.374 ++#else
 115.375 ++  typedef int*			__c_locale;
 115.376 ++#endif
 115.377 ++
 115.378 ++  // Convert numeric value of type _Tv to string and return length of
 115.379 ++  // string.  If snprintf is available use it, otherwise fall back to
 115.380 ++  // the unsafe sprintf which, in general, can be dangerous and should
 115.381 ++  // be avoided.
 115.382 ++  template<typename _Tv>
 115.383 ++    int
 115.384 ++    __convert_from_v(char* __out, const int __size, const char* __fmt,
 115.385 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.386 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 115.387 ++    {
 115.388 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 115.389 ++#else
 115.390 ++		     _Tv __v, const __c_locale&, int __prec)
 115.391 ++    {
 115.392 ++# ifdef __UCLIBC_HAS_LOCALE__
 115.393 ++      char* __old = std::setlocale(LC_ALL, NULL);
 115.394 ++      char* __sav = new char[std::strlen(__old) + 1];
 115.395 ++      std::strcpy(__sav, __old);
 115.396 ++      std::setlocale(LC_ALL, "C");
 115.397 ++# endif
 115.398 ++#endif
 115.399 ++
 115.400 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 115.401 ++
 115.402 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.403 ++      __gnu_cxx::__uselocale(__old);
 115.404 ++#elif defined __UCLIBC_HAS_LOCALE__
 115.405 ++      std::setlocale(LC_ALL, __sav);
 115.406 ++      delete [] __sav;
 115.407 ++#endif
 115.408 ++      return __ret;
 115.409 ++    }
 115.410 ++}
 115.411 ++
 115.412 ++#endif
 115.413 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 115.414 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1969-12-31 18:00:00.000000000 -0600
 115.415 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2005-04-28 01:13:15.000000000 -0500
 115.416 +@@ -0,0 +1,306 @@
 115.417 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 115.418 ++
 115.419 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 115.420 ++//
 115.421 ++// This file is part of the GNU ISO C++ Library.  This library is free
 115.422 ++// software; you can redistribute it and/or modify it under the
 115.423 ++// terms of the GNU General Public License as published by the
 115.424 ++// Free Software Foundation; either version 2, or (at your option)
 115.425 ++// any later version.
 115.426 ++
 115.427 ++// This library is distributed in the hope that it will be useful,
 115.428 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 115.429 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 115.430 ++// GNU General Public License for more details.
 115.431 ++
 115.432 ++// You should have received a copy of the GNU General Public License along
 115.433 ++// with this library; see the file COPYING.  If not, write to the Free
 115.434 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 115.435 ++// USA.
 115.436 ++
 115.437 ++// As a special exception, you may use this file as part of a free software
 115.438 ++// library without restriction.  Specifically, if other files instantiate
 115.439 ++// templates or use macros or inline functions from this file, or you compile
 115.440 ++// this file and link it with other files to produce an executable, this
 115.441 ++// file does not by itself cause the resulting executable to be covered by
 115.442 ++// the GNU General Public License.  This exception does not however
 115.443 ++// invalidate any other reasons why the executable file might be covered by
 115.444 ++// the GNU General Public License.
 115.445 ++
 115.446 ++//
 115.447 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 115.448 ++//
 115.449 ++
 115.450 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 115.451 ++
 115.452 ++#include <locale>
 115.453 ++#include <bits/c++locale_internal.h>
 115.454 ++
 115.455 ++namespace std
 115.456 ++{
 115.457 ++  // Specializations.
 115.458 ++#ifdef _GLIBCXX_USE_WCHAR_T
 115.459 ++  codecvt_base::result
 115.460 ++  codecvt<wchar_t, char, mbstate_t>::
 115.461 ++  do_out(state_type& __state, const intern_type* __from, 
 115.462 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 115.463 ++	 extern_type* __to, extern_type* __to_end,
 115.464 ++	 extern_type*& __to_next) const
 115.465 ++  {
 115.466 ++    result __ret = ok;
 115.467 ++    state_type __tmp_state(__state);
 115.468 ++
 115.469 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.470 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 115.471 ++#endif
 115.472 ++
 115.473 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 115.474 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 115.475 ++    // NB: wcsnrtombs is a GNU extension
 115.476 ++    for (__from_next = __from, __to_next = __to;
 115.477 ++	 __from_next < __from_end && __to_next < __to_end
 115.478 ++	 && __ret == ok;)
 115.479 ++      {
 115.480 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 115.481 ++						      __from_end - __from_next);
 115.482 ++	if (!__from_chunk_end)
 115.483 ++	  __from_chunk_end = __from_end;
 115.484 ++
 115.485 ++	__from = __from_next;
 115.486 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 115.487 ++					 __from_chunk_end - __from_next,
 115.488 ++					 __to_end - __to_next, &__state);
 115.489 ++	if (__conv == static_cast<size_t>(-1))
 115.490 ++	  {
 115.491 ++	    // In case of error, in order to stop at the exact place we
 115.492 ++	    // have to start again from the beginning with a series of
 115.493 ++	    // wcrtomb.
 115.494 ++	    for (; __from < __from_next; ++__from)
 115.495 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 115.496 ++	    __state = __tmp_state;
 115.497 ++	    __ret = error;
 115.498 ++	  }
 115.499 ++	else if (__from_next && __from_next < __from_chunk_end)
 115.500 ++	  {
 115.501 ++	    __to_next += __conv;
 115.502 ++	    __ret = partial;
 115.503 ++	  }
 115.504 ++	else
 115.505 ++	  {
 115.506 ++	    __from_next = __from_chunk_end;
 115.507 ++	    __to_next += __conv;
 115.508 ++	  }
 115.509 ++
 115.510 ++	if (__from_next < __from_end && __ret == ok)
 115.511 ++	  {
 115.512 ++	    extern_type __buf[MB_LEN_MAX];
 115.513 ++	    __tmp_state = __state;
 115.514 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 115.515 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 115.516 ++	      __ret = partial;
 115.517 ++	    else
 115.518 ++	      {
 115.519 ++		memcpy(__to_next, __buf, __conv);
 115.520 ++		__state = __tmp_state;
 115.521 ++		__to_next += __conv;
 115.522 ++		++__from_next;
 115.523 ++	      }
 115.524 ++	  }
 115.525 ++      }
 115.526 ++
 115.527 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.528 ++    __uselocale(__old);
 115.529 ++#endif
 115.530 ++
 115.531 ++    return __ret; 
 115.532 ++  }
 115.533 ++  
 115.534 ++  codecvt_base::result
 115.535 ++  codecvt<wchar_t, char, mbstate_t>::
 115.536 ++  do_in(state_type& __state, const extern_type* __from, 
 115.537 ++	const extern_type* __from_end, const extern_type*& __from_next,
 115.538 ++	intern_type* __to, intern_type* __to_end,
 115.539 ++	intern_type*& __to_next) const
 115.540 ++  {
 115.541 ++    result __ret = ok;
 115.542 ++    state_type __tmp_state(__state);
 115.543 ++
 115.544 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.545 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 115.546 ++#endif
 115.547 ++
 115.548 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 115.549 ++    // in case we store a L'\0' and then continue, in a loop.
 115.550 ++    // NB: mbsnrtowcs is a GNU extension
 115.551 ++    for (__from_next = __from, __to_next = __to;
 115.552 ++	 __from_next < __from_end && __to_next < __to_end
 115.553 ++	 && __ret == ok;)
 115.554 ++      {
 115.555 ++	const extern_type* __from_chunk_end;
 115.556 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 115.557 ++								  __from_end
 115.558 ++								  - __from_next));
 115.559 ++	if (!__from_chunk_end)
 115.560 ++	  __from_chunk_end = __from_end;
 115.561 ++
 115.562 ++	__from = __from_next;
 115.563 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 115.564 ++				   __from_chunk_end - __from_next,
 115.565 ++				   __to_end - __to_next, &__state);
 115.566 ++	if (__conv == static_cast<size_t>(-1))
 115.567 ++	  {
 115.568 ++	    // In case of error, in order to stop at the exact place we
 115.569 ++	    // have to start again from the beginning with a series of
 115.570 ++	    // mbrtowc.
 115.571 ++	    for (;; ++__to_next, __from += __conv)
 115.572 ++	      {
 115.573 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 115.574 ++				 &__tmp_state);
 115.575 ++		if (__conv == static_cast<size_t>(-1)
 115.576 ++		    || __conv == static_cast<size_t>(-2))
 115.577 ++		  break;
 115.578 ++	      }
 115.579 ++	    __from_next = __from;
 115.580 ++	    __state = __tmp_state;	    
 115.581 ++	    __ret = error;
 115.582 ++	  }
 115.583 ++	else if (__from_next && __from_next < __from_chunk_end)
 115.584 ++	  {
 115.585 ++	    // It is unclear what to return in this case (see DR 382). 
 115.586 ++	    __to_next += __conv;
 115.587 ++	    __ret = partial;
 115.588 ++	  }
 115.589 ++	else
 115.590 ++	  {
 115.591 ++	    __from_next = __from_chunk_end;
 115.592 ++	    __to_next += __conv;
 115.593 ++	  }
 115.594 ++
 115.595 ++	if (__from_next < __from_end && __ret == ok)
 115.596 ++	  {
 115.597 ++	    if (__to_next < __to_end)
 115.598 ++	      {
 115.599 ++		// XXX Probably wrong for stateful encodings
 115.600 ++		__tmp_state = __state;		
 115.601 ++		++__from_next;
 115.602 ++		*__to_next++ = L'\0';
 115.603 ++	      }
 115.604 ++	    else
 115.605 ++	      __ret = partial;
 115.606 ++	  }
 115.607 ++      }
 115.608 ++
 115.609 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.610 ++    __uselocale(__old);
 115.611 ++#endif
 115.612 ++
 115.613 ++    return __ret; 
 115.614 ++  }
 115.615 ++
 115.616 ++  int 
 115.617 ++  codecvt<wchar_t, char, mbstate_t>::
 115.618 ++  do_encoding() const throw()
 115.619 ++  {
 115.620 ++    // XXX This implementation assumes that the encoding is
 115.621 ++    // stateless and is either single-byte or variable-width.
 115.622 ++    int __ret = 0;
 115.623 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.624 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 115.625 ++#endif
 115.626 ++    if (MB_CUR_MAX == 1)
 115.627 ++      __ret = 1;
 115.628 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.629 ++    __uselocale(__old);
 115.630 ++#endif
 115.631 ++    return __ret;
 115.632 ++  }  
 115.633 ++
 115.634 ++  int 
 115.635 ++  codecvt<wchar_t, char, mbstate_t>::
 115.636 ++  do_max_length() const throw()
 115.637 ++  {
 115.638 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.639 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 115.640 ++#endif
 115.641 ++    // XXX Probably wrong for stateful encodings.
 115.642 ++    int __ret = MB_CUR_MAX;
 115.643 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.644 ++    __uselocale(__old);
 115.645 ++#endif
 115.646 ++    return __ret;
 115.647 ++  }
 115.648 ++  
 115.649 ++  int 
 115.650 ++  codecvt<wchar_t, char, mbstate_t>::
 115.651 ++  do_length(state_type& __state, const extern_type* __from,
 115.652 ++	    const extern_type* __end, size_t __max) const
 115.653 ++  {
 115.654 ++    int __ret = 0;
 115.655 ++    state_type __tmp_state(__state);
 115.656 ++
 115.657 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.658 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 115.659 ++#endif
 115.660 ++
 115.661 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 115.662 ++    // in case we advance past it and then continue, in a loop.
 115.663 ++    // NB: mbsnrtowcs is a GNU extension
 115.664 ++  
 115.665 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 115.666 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 115.667 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 115.668 ++							   * __max));
 115.669 ++    while (__from < __end && __max)
 115.670 ++      {
 115.671 ++	const extern_type* __from_chunk_end;
 115.672 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 115.673 ++								  __end
 115.674 ++								  - __from));
 115.675 ++	if (!__from_chunk_end)
 115.676 ++	  __from_chunk_end = __end;
 115.677 ++
 115.678 ++	const extern_type* __tmp_from = __from;
 115.679 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 115.680 ++				   __from_chunk_end - __from,
 115.681 ++				   __max, &__state);
 115.682 ++	if (__conv == static_cast<size_t>(-1))
 115.683 ++	  {
 115.684 ++	    // In case of error, in order to stop at the exact place we
 115.685 ++	    // have to start again from the beginning with a series of
 115.686 ++	    // mbrtowc.
 115.687 ++	    for (__from = __tmp_from;; __from += __conv)
 115.688 ++	      {
 115.689 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 115.690 ++				 &__tmp_state);
 115.691 ++		if (__conv == static_cast<size_t>(-1)
 115.692 ++		    || __conv == static_cast<size_t>(-2))
 115.693 ++		  break;
 115.694 ++	      }
 115.695 ++	    __state = __tmp_state;
 115.696 ++	    __ret += __from - __tmp_from;
 115.697 ++	    break;
 115.698 ++	  }
 115.699 ++	if (!__from)
 115.700 ++	  __from = __from_chunk_end;
 115.701 ++	
 115.702 ++	__ret += __from - __tmp_from;
 115.703 ++	__max -= __conv;
 115.704 ++
 115.705 ++	if (__from < __end && __max)
 115.706 ++	  {
 115.707 ++	    // XXX Probably wrong for stateful encodings
 115.708 ++	    __tmp_state = __state;
 115.709 ++	    ++__from;
 115.710 ++	    ++__ret;
 115.711 ++	    --__max;
 115.712 ++	  }
 115.713 ++      }
 115.714 ++
 115.715 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.716 ++    __uselocale(__old);
 115.717 ++#endif
 115.718 ++
 115.719 ++    return __ret; 
 115.720 ++  }
 115.721 ++#endif
 115.722 ++}
 115.723 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
 115.724 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/collate_members.cc	1969-12-31 18:00:00.000000000 -0600
 115.725 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2005-04-28 01:13:15.000000000 -0500
 115.726 +@@ -0,0 +1,80 @@
 115.727 ++// std::collate implementation details, GNU version -*- C++ -*-
 115.728 ++
 115.729 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 115.730 ++//
 115.731 ++// This file is part of the GNU ISO C++ Library.  This library is free
 115.732 ++// software; you can redistribute it and/or modify it under the
 115.733 ++// terms of the GNU General Public License as published by the
 115.734 ++// Free Software Foundation; either version 2, or (at your option)
 115.735 ++// any later version.
 115.736 ++
 115.737 ++// This library is distributed in the hope that it will be useful,
 115.738 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 115.739 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 115.740 ++// GNU General Public License for more details.
 115.741 ++
 115.742 ++// You should have received a copy of the GNU General Public License along
 115.743 ++// with this library; see the file COPYING.  If not, write to the Free
 115.744 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 115.745 ++// USA.
 115.746 ++
 115.747 ++// As a special exception, you may use this file as part of a free software
 115.748 ++// library without restriction.  Specifically, if other files instantiate
 115.749 ++// templates or use macros or inline functions from this file, or you compile
 115.750 ++// this file and link it with other files to produce an executable, this
 115.751 ++// file does not by itself cause the resulting executable to be covered by
 115.752 ++// the GNU General Public License.  This exception does not however
 115.753 ++// invalidate any other reasons why the executable file might be covered by
 115.754 ++// the GNU General Public License.
 115.755 ++
 115.756 ++//
 115.757 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 115.758 ++//
 115.759 ++
 115.760 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 115.761 ++
 115.762 ++#include <locale>
 115.763 ++#include <bits/c++locale_internal.h>
 115.764 ++
 115.765 ++#ifndef __UCLIBC_HAS_XLOCALE__
 115.766 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 115.767 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 115.768 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 115.769 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 115.770 ++#endif
 115.771 ++
 115.772 ++namespace std
 115.773 ++{
 115.774 ++  // These are basically extensions to char_traits, and perhaps should
 115.775 ++  // be put there instead of here.
 115.776 ++  template<>
 115.777 ++    int 
 115.778 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 115.779 ++    { 
 115.780 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 115.781 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 115.782 ++    }
 115.783 ++  
 115.784 ++  template<>
 115.785 ++    size_t
 115.786 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 115.787 ++				size_t __n) const 
 115.788 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 115.789 ++
 115.790 ++#ifdef _GLIBCXX_USE_WCHAR_T
 115.791 ++  template<>
 115.792 ++    int 
 115.793 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 115.794 ++				 const wchar_t* __two) const
 115.795 ++    {
 115.796 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 115.797 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 115.798 ++    }
 115.799 ++  
 115.800 ++  template<>
 115.801 ++    size_t
 115.802 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 115.803 ++				   size_t __n) const
 115.804 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 115.805 ++#endif
 115.806 ++}
 115.807 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 115.808 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1969-12-31 18:00:00.000000000 -0600
 115.809 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2005-04-28 01:13:15.000000000 -0500
 115.810 +@@ -0,0 +1,300 @@
 115.811 ++// std::ctype implementation details, GNU version -*- C++ -*-
 115.812 ++
 115.813 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 115.814 ++//
 115.815 ++// This file is part of the GNU ISO C++ Library.  This library is free
 115.816 ++// software; you can redistribute it and/or modify it under the
 115.817 ++// terms of the GNU General Public License as published by the
 115.818 ++// Free Software Foundation; either version 2, or (at your option)
 115.819 ++// any later version.
 115.820 ++
 115.821 ++// This library is distributed in the hope that it will be useful,
 115.822 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 115.823 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 115.824 ++// GNU General Public License for more details.
 115.825 ++
 115.826 ++// You should have received a copy of the GNU General Public License along
 115.827 ++// with this library; see the file COPYING.  If not, write to the Free
 115.828 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 115.829 ++// USA.
 115.830 ++
 115.831 ++// As a special exception, you may use this file as part of a free software
 115.832 ++// library without restriction.  Specifically, if other files instantiate
 115.833 ++// templates or use macros or inline functions from this file, or you compile
 115.834 ++// this file and link it with other files to produce an executable, this
 115.835 ++// file does not by itself cause the resulting executable to be covered by
 115.836 ++// the GNU General Public License.  This exception does not however
 115.837 ++// invalidate any other reasons why the executable file might be covered by
 115.838 ++// the GNU General Public License.
 115.839 ++
 115.840 ++//
 115.841 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 115.842 ++//
 115.843 ++
 115.844 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 115.845 ++
 115.846 ++#define _LIBC
 115.847 ++#include <locale>
 115.848 ++#undef _LIBC
 115.849 ++#include <bits/c++locale_internal.h>
 115.850 ++
 115.851 ++#ifndef __UCLIBC_HAS_XLOCALE__
 115.852 ++#define __wctype_l(S, L)           wctype((S))
 115.853 ++#define __towupper_l(C, L)         towupper((C))
 115.854 ++#define __towlower_l(C, L)         towlower((C))
 115.855 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 115.856 ++#endif
 115.857 ++
 115.858 ++namespace std
 115.859 ++{
 115.860 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 115.861 ++  // various /config/os/* files.
 115.862 ++  template<>
 115.863 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 115.864 ++    : ctype<char>(0, false, __refs) 
 115.865 ++    { 		
 115.866 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 115.867 ++	{
 115.868 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 115.869 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 115.870 ++#ifdef __UCLIBC_HAS_XLOCALE__
 115.871 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 115.872 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 115.873 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 115.874 ++#endif
 115.875 ++	}
 115.876 ++    }
 115.877 ++
 115.878 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 115.879 ++  ctype<wchar_t>::__wmask_type
 115.880 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 115.881 ++  {
 115.882 ++    __wmask_type __ret;
 115.883 ++    switch (__m)
 115.884 ++      {
 115.885 ++      case space:
 115.886 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 115.887 ++	break;
 115.888 ++      case print:
 115.889 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 115.890 ++	break;
 115.891 ++      case cntrl:
 115.892 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 115.893 ++	break;
 115.894 ++      case upper:
 115.895 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 115.896 ++	break;
 115.897 ++      case lower:
 115.898 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 115.899 ++	break;
 115.900 ++      case alpha:
 115.901 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 115.902 ++	break;
 115.903 ++      case digit:
 115.904 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 115.905 ++	break;
 115.906 ++      case punct:
 115.907 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 115.908 ++	break;
 115.909 ++      case xdigit:
 115.910 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 115.911 ++	break;
 115.912 ++      case alnum:
 115.913 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 115.914 ++	break;
 115.915 ++      case graph:
 115.916 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 115.917 ++	break;
 115.918 ++      default:
 115.919 ++	__ret = __wmask_type();
 115.920 ++      }
 115.921 ++    return __ret;
 115.922 ++  }
 115.923 ++  
 115.924 ++  wchar_t
 115.925 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 115.926 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 115.927 ++
 115.928 ++  const wchar_t*
 115.929 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 115.930 ++  {
 115.931 ++    while (__lo < __hi)
 115.932 ++      {
 115.933 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 115.934 ++        ++__lo;
 115.935 ++      }
 115.936 ++    return __hi;
 115.937 ++  }
 115.938 ++  
 115.939 ++  wchar_t
 115.940 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 115.941 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 115.942 ++  
 115.943 ++  const wchar_t*
 115.944 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 115.945 ++  {
 115.946 ++    while (__lo < __hi)
 115.947 ++      {
 115.948 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 115.949 ++        ++__lo;
 115.950 ++      }
 115.951 ++    return __hi;
 115.952 ++  }
 115.953 ++
 115.954 ++  bool
 115.955 ++  ctype<wchar_t>::
 115.956 ++  do_is(mask __m, wchar_t __c) const
 115.957 ++  { 
 115.958 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
 115.959 ++    // library for blank.
 115.960 ++    bool __ret = false;
 115.961 ++    const size_t __bitmasksize = 11; 
 115.962 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 115.963 ++      if (__m & _M_bit[__bitcur]
 115.964 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 115.965 ++	{
 115.966 ++	  __ret = true;
 115.967 ++	  break;
 115.968 ++	}
 115.969 ++    return __ret;    
 115.970 ++  }
 115.971 ++  
 115.972 ++  const wchar_t* 
 115.973 ++  ctype<wchar_t>::
 115.974 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 115.975 ++  {
 115.976 ++    for (; __lo < __hi; ++__vec, ++__lo)
 115.977 ++      {
 115.978 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 115.979 ++	// library for blank.
 115.980 ++	const size_t __bitmasksize = 11; 
 115.981 ++	mask __m = 0;
 115.982 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 115.983 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 115.984 ++	    __m |= _M_bit[__bitcur];
 115.985 ++	*__vec = __m;
 115.986 ++      }
 115.987 ++    return __hi;
 115.988 ++  }
 115.989 ++  
 115.990 ++  const wchar_t* 
 115.991 ++  ctype<wchar_t>::
 115.992 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 115.993 ++  {
 115.994 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
 115.995 ++      ++__lo;
 115.996 ++    return __lo;
 115.997 ++  }
 115.998 ++
 115.999 ++  const wchar_t*
115.1000 ++  ctype<wchar_t>::
115.1001 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
115.1002 ++  {
115.1003 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
115.1004 ++      ++__lo;
115.1005 ++    return __lo;
115.1006 ++  }
115.1007 ++
115.1008 ++  wchar_t
115.1009 ++  ctype<wchar_t>::
115.1010 ++  do_widen(char __c) const
115.1011 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
115.1012 ++
115.1013 ++  const char* 
115.1014 ++  ctype<wchar_t>::
115.1015 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
115.1016 ++  {
115.1017 ++    while (__lo < __hi)
115.1018 ++      {
115.1019 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
115.1020 ++	++__lo;
115.1021 ++	++__dest;
115.1022 ++      }
115.1023 ++    return __hi;
115.1024 ++  }
115.1025 ++
115.1026 ++  char
115.1027 ++  ctype<wchar_t>::
115.1028 ++  do_narrow(wchar_t __wc, char __dfault) const
115.1029 ++  {
115.1030 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
115.1031 ++      return _M_narrow[__wc];
115.1032 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1033 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
115.1034 ++#endif
115.1035 ++    const int __c = wctob(__wc);
115.1036 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1037 ++    __uselocale(__old);
115.1038 ++#endif
115.1039 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
115.1040 ++  }
115.1041 ++
115.1042 ++  const wchar_t*
115.1043 ++  ctype<wchar_t>::
115.1044 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
115.1045 ++	    char* __dest) const
115.1046 ++  {
115.1047 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1048 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
115.1049 ++#endif
115.1050 ++    if (_M_narrow_ok)
115.1051 ++      while (__lo < __hi)
115.1052 ++	{
115.1053 ++	  if (*__lo >= 0 && *__lo < 128)
115.1054 ++	    *__dest = _M_narrow[*__lo];
115.1055 ++	  else
115.1056 ++	    {
115.1057 ++	      const int __c = wctob(*__lo);
115.1058 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
115.1059 ++	    }
115.1060 ++	  ++__lo;
115.1061 ++	  ++__dest;
115.1062 ++	}
115.1063 ++    else
115.1064 ++      while (__lo < __hi)
115.1065 ++	{
115.1066 ++	  const int __c = wctob(*__lo);
115.1067 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
115.1068 ++	  ++__lo;
115.1069 ++	  ++__dest;
115.1070 ++	}
115.1071 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1072 ++    __uselocale(__old);
115.1073 ++#endif
115.1074 ++    return __hi;
115.1075 ++  }
115.1076 ++
115.1077 ++  void
115.1078 ++  ctype<wchar_t>::_M_initialize_ctype()
115.1079 ++  {
115.1080 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1081 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
115.1082 ++#endif
115.1083 ++    wint_t __i;
115.1084 ++    for (__i = 0; __i < 128; ++__i)
115.1085 ++      {
115.1086 ++	const int __c = wctob(__i);
115.1087 ++	if (__c == EOF)
115.1088 ++	  break;
115.1089 ++	else
115.1090 ++	  _M_narrow[__i] = static_cast<char>(__c);
115.1091 ++      }
115.1092 ++    if (__i == 128)
115.1093 ++      _M_narrow_ok = true;
115.1094 ++    else
115.1095 ++      _M_narrow_ok = false;
115.1096 ++    for (size_t __j = 0;
115.1097 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
115.1098 ++      _M_widen[__j] = btowc(__j);
115.1099 ++
115.1100 ++    for (size_t __k = 0; __k <= 11; ++__k)
115.1101 ++      { 
115.1102 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
115.1103 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
115.1104 ++      }
115.1105 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1106 ++    __uselocale(__old);
115.1107 ++#endif
115.1108 ++  }
115.1109 ++#endif //  _GLIBCXX_USE_WCHAR_T
115.1110 ++}
115.1111 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
115.1112 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.cc	1969-12-31 18:00:00.000000000 -0600
115.1113 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2005-04-28 01:13:15.000000000 -0500
115.1114 +@@ -0,0 +1,100 @@
115.1115 ++// std::messages implementation details, GNU version -*- C++ -*-
115.1116 ++
115.1117 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
115.1118 ++//
115.1119 ++// This file is part of the GNU ISO C++ Library.  This library is free
115.1120 ++// software; you can redistribute it and/or modify it under the
115.1121 ++// terms of the GNU General Public License as published by the
115.1122 ++// Free Software Foundation; either version 2, or (at your option)
115.1123 ++// any later version.
115.1124 ++
115.1125 ++// This library is distributed in the hope that it will be useful,
115.1126 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
115.1127 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
115.1128 ++// GNU General Public License for more details.
115.1129 ++
115.1130 ++// You should have received a copy of the GNU General Public License along
115.1131 ++// with this library; see the file COPYING.  If not, write to the Free
115.1132 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
115.1133 ++// USA.
115.1134 ++
115.1135 ++// As a special exception, you may use this file as part of a free software
115.1136 ++// library without restriction.  Specifically, if other files instantiate
115.1137 ++// templates or use macros or inline functions from this file, or you compile
115.1138 ++// this file and link it with other files to produce an executable, this
115.1139 ++// file does not by itself cause the resulting executable to be covered by
115.1140 ++// the GNU General Public License.  This exception does not however
115.1141 ++// invalidate any other reasons why the executable file might be covered by
115.1142 ++// the GNU General Public License.
115.1143 ++
115.1144 ++//
115.1145 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
115.1146 ++//
115.1147 ++
115.1148 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
115.1149 ++
115.1150 ++#include <locale>
115.1151 ++#include <bits/c++locale_internal.h>
115.1152 ++
115.1153 ++#ifdef __UCLIBC_MJN3_ONLY__
115.1154 ++#warning fix gettext stuff
115.1155 ++#endif
115.1156 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
115.1157 ++extern "C" char *__dcgettext(const char *domainname,
115.1158 ++			     const char *msgid, int category);
115.1159 ++#undef gettext
115.1160 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
115.1161 ++#else
115.1162 ++#undef gettext
115.1163 ++#define gettext(msgid) (msgid)
115.1164 ++#endif
115.1165 ++
115.1166 ++namespace std
115.1167 ++{
115.1168 ++  // Specializations.
115.1169 ++  template<>
115.1170 ++    string
115.1171 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
115.1172 ++    {
115.1173 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1174 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
115.1175 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
115.1176 ++      __uselocale(__old);
115.1177 ++      return string(__msg);
115.1178 ++#elif defined __UCLIBC_HAS_LOCALE__
115.1179 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
115.1180 ++      setlocale(LC_ALL, _M_name_messages);
115.1181 ++      const char* __msg = gettext(__dfault.c_str());
115.1182 ++      setlocale(LC_ALL, __old);
115.1183 ++      free(__old);
115.1184 ++      return string(__msg);
115.1185 ++#else
115.1186 ++      const char* __msg = gettext(__dfault.c_str());
115.1187 ++      return string(__msg);
115.1188 ++#endif
115.1189 ++    }
115.1190 ++
115.1191 ++#ifdef _GLIBCXX_USE_WCHAR_T
115.1192 ++  template<>
115.1193 ++    wstring
115.1194 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
115.1195 ++    {
115.1196 ++# ifdef __UCLIBC_HAS_XLOCALE__
115.1197 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
115.1198 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
115.1199 ++      __uselocale(__old);
115.1200 ++      return _M_convert_from_char(__msg);
115.1201 ++# elif defined __UCLIBC_HAS_LOCALE__
115.1202 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
115.1203 ++      setlocale(LC_ALL, _M_name_messages);
115.1204 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
115.1205 ++      setlocale(LC_ALL, __old);
115.1206 ++      free(__old);
115.1207 ++      return _M_convert_from_char(__msg);
115.1208 ++# else
115.1209 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
115.1210 ++      return _M_convert_from_char(__msg);
115.1211 ++# endif
115.1212 ++    }
115.1213 ++#endif
115.1214 ++}
115.1215 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.h
115.1216 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.h	1969-12-31 18:00:00.000000000 -0600
115.1217 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2005-04-28 01:13:15.000000000 -0500
115.1218 +@@ -0,0 +1,118 @@
115.1219 ++// std::messages implementation details, GNU version -*- C++ -*-
115.1220 ++
115.1221 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
115.1222 ++//
115.1223 ++// This file is part of the GNU ISO C++ Library.  This library is free
115.1224 ++// software; you can redistribute it and/or modify it under the
115.1225 ++// terms of the GNU General Public License as published by the
115.1226 ++// Free Software Foundation; either version 2, or (at your option)
115.1227 ++// any later version.
115.1228 ++
115.1229 ++// This library is distributed in the hope that it will be useful,
115.1230 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
115.1231 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
115.1232 ++// GNU General Public License for more details.
115.1233 ++
115.1234 ++// You should have received a copy of the GNU General Public License along
115.1235 ++// with this library; see the file COPYING.  If not, write to the Free
115.1236 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
115.1237 ++// USA.
115.1238 ++
115.1239 ++// As a special exception, you may use this file as part of a free software
115.1240 ++// library without restriction.  Specifically, if other files instantiate
115.1241 ++// templates or use macros or inline functions from this file, or you compile
115.1242 ++// this file and link it with other files to produce an executable, this
115.1243 ++// file does not by itself cause the resulting executable to be covered by
115.1244 ++// the GNU General Public License.  This exception does not however
115.1245 ++// invalidate any other reasons why the executable file might be covered by
115.1246 ++// the GNU General Public License.
115.1247 ++
115.1248 ++//
115.1249 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
115.1250 ++//
115.1251 ++
115.1252 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
115.1253 ++
115.1254 ++#ifdef __UCLIBC_MJN3_ONLY__
115.1255 ++#warning fix prototypes for *textdomain funcs
115.1256 ++#endif
115.1257 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
115.1258 ++extern "C" char *__textdomain(const char *domainname);
115.1259 ++extern "C" char *__bindtextdomain(const char *domainname,
115.1260 ++				  const char *dirname);
115.1261 ++#else
115.1262 ++#undef __textdomain
115.1263 ++#undef __bindtextdomain
115.1264 ++#define __textdomain(D)           ((void)0)
115.1265 ++#define __bindtextdomain(D,P)     ((void)0)
115.1266 ++#endif
115.1267 ++
115.1268 ++  // Non-virtual member functions.
115.1269 ++  template<typename _CharT>
115.1270 ++     messages<_CharT>::messages(size_t __refs)
115.1271 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
115.1272 ++     _M_name_messages(_S_get_c_name())
115.1273 ++     { }
115.1274 ++
115.1275 ++  template<typename _CharT>
115.1276 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
115.1277 ++				size_t __refs) 
115.1278 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
115.1279 ++     _M_name_messages(__s)
115.1280 ++     {
115.1281 ++       char* __tmp = new char[std::strlen(__s) + 1];
115.1282 ++       std::strcpy(__tmp, __s);
115.1283 ++       _M_name_messages = __tmp;
115.1284 ++     }
115.1285 ++
115.1286 ++  template<typename _CharT>
115.1287 ++    typename messages<_CharT>::catalog 
115.1288 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
115.1289 ++			   const char* __dir) const
115.1290 ++    { 
115.1291 ++      __bindtextdomain(__s.c_str(), __dir);
115.1292 ++      return this->do_open(__s, __loc); 
115.1293 ++    }
115.1294 ++
115.1295 ++  // Virtual member functions.
115.1296 ++  template<typename _CharT>
115.1297 ++    messages<_CharT>::~messages()
115.1298 ++    { 
115.1299 ++      if (_M_name_messages != _S_get_c_name())
115.1300 ++	delete [] _M_name_messages;
115.1301 ++      _S_destroy_c_locale(_M_c_locale_messages); 
115.1302 ++    }
115.1303 ++
115.1304 ++  template<typename _CharT>
115.1305 ++    typename messages<_CharT>::catalog 
115.1306 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
115.1307 ++			      const locale&) const
115.1308 ++    { 
115.1309 ++      // No error checking is done, assume the catalog exists and can
115.1310 ++      // be used.
115.1311 ++      __textdomain(__s.c_str());
115.1312 ++      return 0;
115.1313 ++    }
115.1314 ++
115.1315 ++  template<typename _CharT>
115.1316 ++    void    
115.1317 ++    messages<_CharT>::do_close(catalog) const 
115.1318 ++    { }
115.1319 ++
115.1320 ++   // messages_byname
115.1321 ++   template<typename _CharT>
115.1322 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
115.1323 ++     : messages<_CharT>(__refs) 
115.1324 ++     { 
115.1325 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
115.1326 ++	 delete [] this->_M_name_messages;
115.1327 ++       char* __tmp = new char[std::strlen(__s) + 1];
115.1328 ++       std::strcpy(__tmp, __s);
115.1329 ++       this->_M_name_messages = __tmp;
115.1330 ++
115.1331 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
115.1332 ++	 {
115.1333 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
115.1334 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
115.1335 ++	 }
115.1336 ++     }
115.1337 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
115.1338 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1969-12-31 18:00:00.000000000 -0600
115.1339 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2005-04-28 01:23:02.000000000 -0500
115.1340 +@@ -0,0 +1,692 @@
115.1341 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
115.1342 ++
115.1343 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
115.1344 ++//
115.1345 ++// This file is part of the GNU ISO C++ Library.  This library is free
115.1346 ++// software; you can redistribute it and/or modify it under the
115.1347 ++// terms of the GNU General Public License as published by the
115.1348 ++// Free Software Foundation; either version 2, or (at your option)
115.1349 ++// any later version.
115.1350 ++
115.1351 ++// This library is distributed in the hope that it will be useful,
115.1352 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
115.1353 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
115.1354 ++// GNU General Public License for more details.
115.1355 ++
115.1356 ++// You should have received a copy of the GNU General Public License along
115.1357 ++// with this library; see the file COPYING.  If not, write to the Free
115.1358 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
115.1359 ++// USA.
115.1360 ++
115.1361 ++// As a special exception, you may use this file as part of a free software
115.1362 ++// library without restriction.  Specifically, if other files instantiate
115.1363 ++// templates or use macros or inline functions from this file, or you compile
115.1364 ++// this file and link it with other files to produce an executable, this
115.1365 ++// file does not by itself cause the resulting executable to be covered by
115.1366 ++// the GNU General Public License.  This exception does not however
115.1367 ++// invalidate any other reasons why the executable file might be covered by
115.1368 ++// the GNU General Public License.
115.1369 ++
115.1370 ++//
115.1371 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
115.1372 ++//
115.1373 ++
115.1374 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
115.1375 ++
115.1376 ++#define _LIBC
115.1377 ++#include <locale>
115.1378 ++#undef _LIBC
115.1379 ++#include <bits/c++locale_internal.h>
115.1380 ++
115.1381 ++#ifdef __UCLIBC_MJN3_ONLY__
115.1382 ++#warning optimize this for uclibc
115.1383 ++#warning tailor for stub locale support
115.1384 ++#endif
115.1385 ++
115.1386 ++#ifndef __UCLIBC_HAS_XLOCALE__
115.1387 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
115.1388 ++#endif
115.1389 ++
115.1390 ++namespace std
115.1391 ++{
115.1392 ++  // Construct and return valid pattern consisting of some combination of:
115.1393 ++  // space none symbol sign value
115.1394 ++  money_base::pattern
115.1395 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
115.1396 ++  { 
115.1397 ++    pattern __ret;
115.1398 ++
115.1399 ++    // This insanely complicated routine attempts to construct a valid
115.1400 ++    // pattern for use with monyepunct. A couple of invariants:
115.1401 ++
115.1402 ++    // if (__precedes) symbol -> value
115.1403 ++    // else value -> symbol
115.1404 ++    
115.1405 ++    // if (__space) space
115.1406 ++    // else none
115.1407 ++
115.1408 ++    // none == never first
115.1409 ++    // space never first or last
115.1410 ++
115.1411 ++    // Any elegant implementations of this are welcome.
115.1412 ++    switch (__posn)
115.1413 ++      {
115.1414 ++      case 0:
115.1415 ++      case 1:
115.1416 ++	// 1 The sign precedes the value and symbol.
115.1417 ++	__ret.field[0] = sign;
115.1418 ++	if (__space)
115.1419 ++	  {
115.1420 ++	    // Pattern starts with sign.
115.1421 ++	    if (__precedes)
115.1422 ++	      {
115.1423 ++		__ret.field[1] = symbol;
115.1424 ++		__ret.field[3] = value;
115.1425 ++	      }
115.1426 ++	    else
115.1427 ++	      {
115.1428 ++		__ret.field[1] = value;
115.1429 ++		__ret.field[3] = symbol;
115.1430 ++	      }
115.1431 ++	    __ret.field[2] = space;
115.1432 ++	  }
115.1433 ++	else
115.1434 ++	  {
115.1435 ++	    // Pattern starts with sign and ends with none.
115.1436 ++	    if (__precedes)
115.1437 ++	      {
115.1438 ++		__ret.field[1] = symbol;
115.1439 ++		__ret.field[2] = value;
115.1440 ++	      }
115.1441 ++	    else
115.1442 ++	      {
115.1443 ++		__ret.field[1] = value;
115.1444 ++		__ret.field[2] = symbol;
115.1445 ++	      }
115.1446 ++	    __ret.field[3] = none;
115.1447 ++	  }
115.1448 ++	break;
115.1449 ++      case 2:
115.1450 ++	// 2 The sign follows the value and symbol.
115.1451 ++	if (__space)
115.1452 ++	  {
115.1453 ++	    // Pattern either ends with sign.
115.1454 ++	    if (__precedes)
115.1455 ++	      {
115.1456 ++		__ret.field[0] = symbol;
115.1457 ++		__ret.field[2] = value;
115.1458 ++	      }
115.1459 ++	    else
115.1460 ++	      {
115.1461 ++		__ret.field[0] = value;
115.1462 ++		__ret.field[2] = symbol;
115.1463 ++	      }
115.1464 ++	    __ret.field[1] = space;
115.1465 ++	    __ret.field[3] = sign;
115.1466 ++	  }
115.1467 ++	else
115.1468 ++	  {
115.1469 ++	    // Pattern ends with sign then none.
115.1470 ++	    if (__precedes)
115.1471 ++	      {
115.1472 ++		__ret.field[0] = symbol;
115.1473 ++		__ret.field[1] = value;
115.1474 ++	      }
115.1475 ++	    else
115.1476 ++	      {
115.1477 ++		__ret.field[0] = value;
115.1478 ++		__ret.field[1] = symbol;
115.1479 ++	      }
115.1480 ++	    __ret.field[2] = sign;
115.1481 ++	    __ret.field[3] = none;
115.1482 ++	  }
115.1483 ++	break;
115.1484 ++      case 3:
115.1485 ++	// 3 The sign immediately precedes the symbol.
115.1486 ++	if (__precedes)
115.1487 ++	  {
115.1488 ++	    __ret.field[0] = sign;
115.1489 ++	    __ret.field[1] = symbol;	    
115.1490 ++	    if (__space)
115.1491 ++	      {
115.1492 ++		__ret.field[2] = space;
115.1493 ++		__ret.field[3] = value;
115.1494 ++	      }
115.1495 ++	    else
115.1496 ++	      {
115.1497 ++		__ret.field[2] = value;		
115.1498 ++		__ret.field[3] = none;
115.1499 ++	      }
115.1500 ++	  }
115.1501 ++	else
115.1502 ++	  {
115.1503 ++	    __ret.field[0] = value;
115.1504 ++	    if (__space)
115.1505 ++	      {
115.1506 ++		__ret.field[1] = space;
115.1507 ++		__ret.field[2] = sign;
115.1508 ++		__ret.field[3] = symbol;
115.1509 ++	      }
115.1510 ++	    else
115.1511 ++	      {
115.1512 ++		__ret.field[1] = sign;
115.1513 ++		__ret.field[2] = symbol;
115.1514 ++		__ret.field[3] = none;
115.1515 ++	      }
115.1516 ++	  }
115.1517 ++	break;
115.1518 ++      case 4:
115.1519 ++	// 4 The sign immediately follows the symbol.
115.1520 ++	if (__precedes)
115.1521 ++	  {
115.1522 ++	    __ret.field[0] = symbol;
115.1523 ++	    __ret.field[1] = sign;
115.1524 ++	    if (__space)
115.1525 ++	      {
115.1526 ++		__ret.field[2] = space;
115.1527 ++		__ret.field[3] = value;
115.1528 ++	      }
115.1529 ++	    else
115.1530 ++	      {
115.1531 ++		__ret.field[2] = value;
115.1532 ++		__ret.field[3] = none;
115.1533 ++	      }
115.1534 ++	  }
115.1535 ++	else
115.1536 ++	  {
115.1537 ++	    __ret.field[0] = value;
115.1538 ++	    if (__space)
115.1539 ++	      {
115.1540 ++		__ret.field[1] = space;
115.1541 ++		__ret.field[2] = symbol;
115.1542 ++		__ret.field[3] = sign;
115.1543 ++	      }
115.1544 ++	    else
115.1545 ++	      {
115.1546 ++		__ret.field[1] = symbol;
115.1547 ++		__ret.field[2] = sign;
115.1548 ++		__ret.field[3] = none;
115.1549 ++	      }
115.1550 ++	  }
115.1551 ++	break;
115.1552 ++      default:
115.1553 ++	__ret = pattern();
115.1554 ++      }
115.1555 ++    return __ret;
115.1556 ++  }
115.1557 ++
115.1558 ++  template<> 
115.1559 ++    void
115.1560 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
115.1561 ++						     const char*)
115.1562 ++    {
115.1563 ++      if (!_M_data)
115.1564 ++	_M_data = new __moneypunct_cache<char, true>;
115.1565 ++
115.1566 ++      if (!__cloc)
115.1567 ++	{
115.1568 ++	  // "C" locale
115.1569 ++	  _M_data->_M_decimal_point = '.';
115.1570 ++	  _M_data->_M_thousands_sep = ',';
115.1571 ++	  _M_data->_M_grouping = "";
115.1572 ++	  _M_data->_M_grouping_size = 0;
115.1573 ++	  _M_data->_M_curr_symbol = "";
115.1574 ++	  _M_data->_M_curr_symbol_size = 0;
115.1575 ++	  _M_data->_M_positive_sign = "";
115.1576 ++	  _M_data->_M_positive_sign_size = 0;
115.1577 ++	  _M_data->_M_negative_sign = "";
115.1578 ++	  _M_data->_M_negative_sign_size = 0;
115.1579 ++	  _M_data->_M_frac_digits = 0;
115.1580 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
115.1581 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
115.1582 ++
115.1583 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
115.1584 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
115.1585 ++	}
115.1586 ++      else
115.1587 ++	{
115.1588 ++	  // Named locale.
115.1589 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
115.1590 ++							__cloc));
115.1591 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
115.1592 ++							__cloc));
115.1593 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
115.1594 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
115.1595 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
115.1596 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
115.1597 ++
115.1598 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
115.1599 ++	  if (!__nposn)
115.1600 ++	    _M_data->_M_negative_sign = "()";
115.1601 ++	  else
115.1602 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
115.1603 ++							__cloc);
115.1604 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
115.1605 ++
115.1606 ++	  // _Intl == true
115.1607 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
115.1608 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
115.1609 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
115.1610 ++						      __cloc));
115.1611 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
115.1612 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
115.1613 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
115.1614 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
115.1615 ++							__pposn);
115.1616 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
115.1617 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
115.1618 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
115.1619 ++							__nposn);
115.1620 ++	}
115.1621 ++    }
115.1622 ++
115.1623 ++  template<> 
115.1624 ++    void
115.1625 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
115.1626 ++						      const char*)
115.1627 ++    {
115.1628 ++      if (!_M_data)
115.1629 ++	_M_data = new __moneypunct_cache<char, false>;
115.1630 ++
115.1631 ++      if (!__cloc)
115.1632 ++	{
115.1633 ++	  // "C" locale
115.1634 ++	  _M_data->_M_decimal_point = '.';
115.1635 ++	  _M_data->_M_thousands_sep = ',';
115.1636 ++	  _M_data->_M_grouping = "";
115.1637 ++	  _M_data->_M_grouping_size = 0;
115.1638 ++	  _M_data->_M_curr_symbol = "";
115.1639 ++	  _M_data->_M_curr_symbol_size = 0;
115.1640 ++	  _M_data->_M_positive_sign = "";
115.1641 ++	  _M_data->_M_positive_sign_size = 0;
115.1642 ++	  _M_data->_M_negative_sign = "";
115.1643 ++	  _M_data->_M_negative_sign_size = 0;
115.1644 ++	  _M_data->_M_frac_digits = 0;
115.1645 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
115.1646 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
115.1647 ++
115.1648 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
115.1649 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
115.1650 ++	}
115.1651 ++      else
115.1652 ++	{
115.1653 ++	  // Named locale.
115.1654 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
115.1655 ++							__cloc));
115.1656 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
115.1657 ++							__cloc));
115.1658 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
115.1659 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
115.1660 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
115.1661 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
115.1662 ++
115.1663 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
115.1664 ++	  if (!__nposn)
115.1665 ++	    _M_data->_M_negative_sign = "()";
115.1666 ++	  else
115.1667 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
115.1668 ++							__cloc);
115.1669 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
115.1670 ++
115.1671 ++	  // _Intl == false
115.1672 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
115.1673 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
115.1674 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
115.1675 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
115.1676 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
115.1677 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
115.1678 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
115.1679 ++							__pposn);
115.1680 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
115.1681 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
115.1682 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
115.1683 ++							__nposn);
115.1684 ++	}
115.1685 ++    }
115.1686 ++
115.1687 ++  template<> 
115.1688 ++    moneypunct<char, true>::~moneypunct()
115.1689 ++    { delete _M_data; }
115.1690 ++
115.1691 ++  template<> 
115.1692 ++    moneypunct<char, false>::~moneypunct()
115.1693 ++    { delete _M_data; }
115.1694 ++
115.1695 ++#ifdef _GLIBCXX_USE_WCHAR_T
115.1696 ++  template<> 
115.1697 ++    void
115.1698 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
115.1699 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1700 ++							const char*)
115.1701 ++#else
115.1702 ++							const char* __name)
115.1703 ++#endif
115.1704 ++    {
115.1705 ++      if (!_M_data)
115.1706 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
115.1707 ++
115.1708 ++      if (!__cloc)
115.1709 ++	{
115.1710 ++	  // "C" locale
115.1711 ++	  _M_data->_M_decimal_point = L'.';
115.1712 ++	  _M_data->_M_thousands_sep = L',';
115.1713 ++	  _M_data->_M_grouping = "";
115.1714 ++	  _M_data->_M_grouping_size = 0;
115.1715 ++	  _M_data->_M_curr_symbol = L"";
115.1716 ++	  _M_data->_M_curr_symbol_size = 0;
115.1717 ++	  _M_data->_M_positive_sign = L"";
115.1718 ++	  _M_data->_M_positive_sign_size = 0;
115.1719 ++	  _M_data->_M_negative_sign = L"";
115.1720 ++	  _M_data->_M_negative_sign_size = 0;
115.1721 ++	  _M_data->_M_frac_digits = 0;
115.1722 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
115.1723 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
115.1724 ++
115.1725 ++	  // Use ctype::widen code without the facet...
115.1726 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
115.1727 ++	    _M_data->_M_atoms[__i] =
115.1728 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
115.1729 ++	}
115.1730 ++      else
115.1731 ++	{
115.1732 ++	  // Named locale.
115.1733 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1734 ++	  __c_locale __old = __uselocale(__cloc);
115.1735 ++#else
115.1736 ++	  // Switch to named locale so that mbsrtowcs will work.
115.1737 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
115.1738 ++	  setlocale(LC_ALL, __name);
115.1739 ++#endif
115.1740 ++
115.1741 ++#ifdef __UCLIBC_MJN3_ONLY__
115.1742 ++#warning fix this... should be monetary
115.1743 ++#endif
115.1744 ++#ifdef __UCLIBC__
115.1745 ++# ifdef __UCLIBC_HAS_XLOCALE__
115.1746 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
115.1747 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
115.1748 ++# else
115.1749 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
115.1750 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
115.1751 ++# endif
115.1752 ++#else
115.1753 ++	  union { char *__s; wchar_t __w; } __u;
115.1754 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
115.1755 ++	  _M_data->_M_decimal_point = __u.__w;
115.1756 ++
115.1757 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
115.1758 ++	  _M_data->_M_thousands_sep = __u.__w;
115.1759 ++#endif
115.1760 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
115.1761 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
115.1762 ++
115.1763 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
115.1764 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
115.1765 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
115.1766 ++
115.1767 ++	  wchar_t* __wcs_ps = 0;
115.1768 ++	  wchar_t* __wcs_ns = 0;
115.1769 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
115.1770 ++	  try
115.1771 ++	    {
115.1772 ++	      mbstate_t __state;
115.1773 ++	      size_t __len = strlen(__cpossign);
115.1774 ++	      if (__len)
115.1775 ++		{
115.1776 ++		  ++__len;
115.1777 ++		  memset(&__state, 0, sizeof(mbstate_t));
115.1778 ++		  __wcs_ps = new wchar_t[__len];
115.1779 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
115.1780 ++		  _M_data->_M_positive_sign = __wcs_ps;
115.1781 ++		}
115.1782 ++	      else
115.1783 ++		_M_data->_M_positive_sign = L"";
115.1784 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
115.1785 ++	      
115.1786 ++	      __len = strlen(__cnegsign);
115.1787 ++	      if (!__nposn)
115.1788 ++		_M_data->_M_negative_sign = L"()";
115.1789 ++	      else if (__len)
115.1790 ++		{ 
115.1791 ++		  ++__len;
115.1792 ++		  memset(&__state, 0, sizeof(mbstate_t));
115.1793 ++		  __wcs_ns = new wchar_t[__len];
115.1794 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
115.1795 ++		  _M_data->_M_negative_sign = __wcs_ns;
115.1796 ++		}
115.1797 ++	      else
115.1798 ++		_M_data->_M_negative_sign = L"";
115.1799 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
115.1800 ++	      
115.1801 ++	      // _Intl == true.
115.1802 ++	      __len = strlen(__ccurr);
115.1803 ++	      if (__len)
115.1804 ++		{
115.1805 ++		  ++__len;
115.1806 ++		  memset(&__state, 0, sizeof(mbstate_t));
115.1807 ++		  wchar_t* __wcs = new wchar_t[__len];
115.1808 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
115.1809 ++		  _M_data->_M_curr_symbol = __wcs;
115.1810 ++		}
115.1811 ++	      else
115.1812 ++		_M_data->_M_curr_symbol = L"";
115.1813 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
115.1814 ++	    }
115.1815 ++	  catch (...)
115.1816 ++	    {
115.1817 ++	      delete _M_data;
115.1818 ++	      _M_data = 0;
115.1819 ++	      delete __wcs_ps;
115.1820 ++	      delete __wcs_ns;	      
115.1821 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1822 ++	      __uselocale(__old);
115.1823 ++#else
115.1824 ++	      setlocale(LC_ALL, __old);
115.1825 ++	      free(__old);
115.1826 ++#endif
115.1827 ++	      __throw_exception_again;
115.1828 ++	    } 
115.1829 ++	  
115.1830 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
115.1831 ++						      __cloc));
115.1832 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
115.1833 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
115.1834 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
115.1835 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
115.1836 ++							__pposn);
115.1837 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
115.1838 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
115.1839 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
115.1840 ++							__nposn);
115.1841 ++
115.1842 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1843 ++	  __uselocale(__old);
115.1844 ++#else
115.1845 ++	  setlocale(LC_ALL, __old);
115.1846 ++	  free(__old);
115.1847 ++#endif
115.1848 ++	}
115.1849 ++    }
115.1850 ++
115.1851 ++  template<> 
115.1852 ++  void
115.1853 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
115.1854 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1855 ++						       const char*)
115.1856 ++#else
115.1857 ++                                                       const char* __name)
115.1858 ++#endif
115.1859 ++  {
115.1860 ++    if (!_M_data)
115.1861 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
115.1862 ++
115.1863 ++    if (!__cloc)
115.1864 ++	{
115.1865 ++	  // "C" locale
115.1866 ++	  _M_data->_M_decimal_point = L'.';
115.1867 ++	  _M_data->_M_thousands_sep = L',';
115.1868 ++	  _M_data->_M_grouping = "";
115.1869 ++          _M_data->_M_grouping_size = 0;
115.1870 ++	  _M_data->_M_curr_symbol = L"";
115.1871 ++	  _M_data->_M_curr_symbol_size = 0;
115.1872 ++	  _M_data->_M_positive_sign = L"";
115.1873 ++	  _M_data->_M_positive_sign_size = 0;
115.1874 ++	  _M_data->_M_negative_sign = L"";
115.1875 ++	  _M_data->_M_negative_sign_size = 0;
115.1876 ++	  _M_data->_M_frac_digits = 0;
115.1877 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
115.1878 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
115.1879 ++
115.1880 ++	  // Use ctype::widen code without the facet...
115.1881 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
115.1882 ++	    _M_data->_M_atoms[__i] =
115.1883 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
115.1884 ++	}
115.1885 ++      else
115.1886 ++	{
115.1887 ++	  // Named locale.
115.1888 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1889 ++	  __c_locale __old = __uselocale(__cloc);
115.1890 ++#else
115.1891 ++	  // Switch to named locale so that mbsrtowcs will work.
115.1892 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
115.1893 ++	  setlocale(LC_ALL, __name);
115.1894 ++#endif
115.1895 ++
115.1896 ++#ifdef __UCLIBC_MJN3_ONLY__
115.1897 ++#warning fix this... should be monetary
115.1898 ++#endif
115.1899 ++#ifdef __UCLIBC__
115.1900 ++# ifdef __UCLIBC_HAS_XLOCALE__
115.1901 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
115.1902 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
115.1903 ++# else
115.1904 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
115.1905 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
115.1906 ++# endif
115.1907 ++#else
115.1908 ++          union { char *__s; wchar_t __w; } __u;
115.1909 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
115.1910 ++	  _M_data->_M_decimal_point = __u.__w;
115.1911 ++
115.1912 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
115.1913 ++	  _M_data->_M_thousands_sep = __u.__w;
115.1914 ++#endif
115.1915 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
115.1916 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
115.1917 ++
115.1918 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
115.1919 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
115.1920 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
115.1921 ++
115.1922 ++	  wchar_t* __wcs_ps = 0;
115.1923 ++	  wchar_t* __wcs_ns = 0;
115.1924 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
115.1925 ++	  try
115.1926 ++            {
115.1927 ++              mbstate_t __state;
115.1928 ++              size_t __len;
115.1929 ++              __len = strlen(__cpossign);
115.1930 ++              if (__len)
115.1931 ++                {
115.1932 ++		  ++__len;
115.1933 ++		  memset(&__state, 0, sizeof(mbstate_t));
115.1934 ++		  __wcs_ps = new wchar_t[__len];
115.1935 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
115.1936 ++		  _M_data->_M_positive_sign = __wcs_ps;
115.1937 ++		}
115.1938 ++	      else
115.1939 ++		_M_data->_M_positive_sign = L"";
115.1940 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
115.1941 ++	      
115.1942 ++	      __len = strlen(__cnegsign);
115.1943 ++	      if (!__nposn)
115.1944 ++		_M_data->_M_negative_sign = L"()";
115.1945 ++	      else if (__len)
115.1946 ++		{ 
115.1947 ++		  ++__len;
115.1948 ++		  memset(&__state, 0, sizeof(mbstate_t));
115.1949 ++		  __wcs_ns = new wchar_t[__len];
115.1950 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
115.1951 ++		  _M_data->_M_negative_sign = __wcs_ns;
115.1952 ++		}
115.1953 ++	      else
115.1954 ++		_M_data->_M_negative_sign = L"";
115.1955 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
115.1956 ++
115.1957 ++	      // _Intl == true.
115.1958 ++	      __len = strlen(__ccurr);
115.1959 ++	      if (__len)
115.1960 ++		{
115.1961 ++		  ++__len;
115.1962 ++		  memset(&__state, 0, sizeof(mbstate_t));
115.1963 ++		  wchar_t* __wcs = new wchar_t[__len];
115.1964 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
115.1965 ++		  _M_data->_M_curr_symbol = __wcs;
115.1966 ++		}
115.1967 ++	      else
115.1968 ++		_M_data->_M_curr_symbol = L"";
115.1969 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
115.1970 ++	    }
115.1971 ++          catch (...)
115.1972 ++	    {
115.1973 ++	      delete _M_data;
115.1974 ++              _M_data = 0;
115.1975 ++	      delete __wcs_ps;
115.1976 ++	      delete __wcs_ns;	      
115.1977 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1978 ++	      __uselocale(__old);
115.1979 ++#else
115.1980 ++	      setlocale(LC_ALL, __old);
115.1981 ++	      free(__old);
115.1982 ++#endif
115.1983 ++              __throw_exception_again;
115.1984 ++	    }
115.1985 ++
115.1986 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
115.1987 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
115.1988 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
115.1989 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
115.1990 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
115.1991 ++	                                                __pposn);
115.1992 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
115.1993 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
115.1994 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
115.1995 ++	                                                __nposn);
115.1996 ++
115.1997 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.1998 ++	  __uselocale(__old);
115.1999 ++#else
115.2000 ++	  setlocale(LC_ALL, __old);
115.2001 ++	  free(__old);
115.2002 ++#endif
115.2003 ++	}
115.2004 ++    }
115.2005 ++
115.2006 ++  template<> 
115.2007 ++    moneypunct<wchar_t, true>::~moneypunct()
115.2008 ++    {
115.2009 ++      if (_M_data->_M_positive_sign_size)
115.2010 ++	delete [] _M_data->_M_positive_sign;
115.2011 ++      if (_M_data->_M_negative_sign_size
115.2012 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
115.2013 ++	delete [] _M_data->_M_negative_sign;
115.2014 ++      if (_M_data->_M_curr_symbol_size)
115.2015 ++	delete [] _M_data->_M_curr_symbol;
115.2016 ++      delete _M_data;
115.2017 ++    }
115.2018 ++
115.2019 ++  template<> 
115.2020 ++    moneypunct<wchar_t, false>::~moneypunct()
115.2021 ++    {
115.2022 ++      if (_M_data->_M_positive_sign_size)
115.2023 ++	delete [] _M_data->_M_positive_sign;
115.2024 ++      if (_M_data->_M_negative_sign_size
115.2025 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
115.2026 ++	delete [] _M_data->_M_negative_sign;
115.2027 ++      if (_M_data->_M_curr_symbol_size)
115.2028 ++	delete [] _M_data->_M_curr_symbol;
115.2029 ++      delete _M_data;
115.2030 ++    }
115.2031 ++#endif
115.2032 ++}
115.2033 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
115.2034 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1969-12-31 18:00:00.000000000 -0600
115.2035 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2005-04-28 01:20:20.000000000 -0500
115.2036 +@@ -0,0 +1,173 @@
115.2037 ++// std::numpunct implementation details, GNU version -*- C++ -*-
115.2038 ++
115.2039 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
115.2040 ++//
115.2041 ++// This file is part of the GNU ISO C++ Library.  This library is free
115.2042 ++// software; you can redistribute it and/or modify it under the
115.2043 ++// terms of the GNU General Public License as published by the
115.2044 ++// Free Software Foundation; either version 2, or (at your option)
115.2045 ++// any later version.
115.2046 ++
115.2047 ++// This library is distributed in the hope that it will be useful,
115.2048 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
115.2049 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
115.2050 ++// GNU General Public License for more details.
115.2051 ++
115.2052 ++// You should have received a copy of the GNU General Public License along
115.2053 ++// with this library; see the file COPYING.  If not, write to the Free
115.2054 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
115.2055 ++// USA.
115.2056 ++
115.2057 ++// As a special exception, you may use this file as part of a free software
115.2058 ++// library without restriction.  Specifically, if other files instantiate
115.2059 ++// templates or use macros or inline functions from this file, or you compile
115.2060 ++// this file and link it with other files to produce an executable, this
115.2061 ++// file does not by itself cause the resulting executable to be covered by
115.2062 ++// the GNU General Public License.  This exception does not however
115.2063 ++// invalidate any other reasons why the executable file might be covered by
115.2064 ++// the GNU General Public License.
115.2065 ++
115.2066 ++//
115.2067 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
115.2068 ++//
115.2069 ++
115.2070 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
115.2071 ++
115.2072 ++#define _LIBC
115.2073 ++#include <locale>
115.2074 ++#undef _LIBC
115.2075 ++#include <bits/c++locale_internal.h>
115.2076 ++
115.2077 ++#ifdef __UCLIBC_MJN3_ONLY__
115.2078 ++#warning tailor for stub locale support
115.2079 ++#endif
115.2080 ++#ifndef __UCLIBC_HAS_XLOCALE__
115.2081 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
115.2082 ++#endif
115.2083 ++
115.2084 ++namespace std
115.2085 ++{
115.2086 ++  template<> 
115.2087 ++    void
115.2088 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
115.2089 ++    {
115.2090 ++      if (!_M_data)
115.2091 ++	_M_data = new __numpunct_cache<char>;
115.2092 ++
115.2093 ++      if (!__cloc)
115.2094 ++	{
115.2095 ++	  // "C" locale
115.2096 ++	  _M_data->_M_grouping = "";
115.2097 ++	  _M_data->_M_grouping_size = 0;
115.2098 ++	  _M_data->_M_use_grouping = false;
115.2099 ++
115.2100 ++	  _M_data->_M_decimal_point = '.';
115.2101 ++	  _M_data->_M_thousands_sep = ',';
115.2102 ++
115.2103 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
115.2104 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
115.2105 ++
115.2106 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
115.2107 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
115.2108 ++	}
115.2109 ++      else
115.2110 ++	{
115.2111 ++	  // Named locale.
115.2112 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
115.2113 ++							__cloc));
115.2114 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
115.2115 ++							__cloc));
115.2116 ++
115.2117 ++	  // Check for NULL, which implies no grouping.
115.2118 ++	  if (_M_data->_M_thousands_sep == '\0')
115.2119 ++	    _M_data->_M_grouping = "";
115.2120 ++	  else
115.2121 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
115.2122 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
115.2123 ++	}
115.2124 ++
115.2125 ++      // NB: There is no way to extact this info from posix locales.
115.2126 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
115.2127 ++      _M_data->_M_truename = "true";
115.2128 ++      _M_data->_M_truename_size = 4;
115.2129 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
115.2130 ++      _M_data->_M_falsename = "false";
115.2131 ++      _M_data->_M_falsename_size = 5;
115.2132 ++    }
115.2133 ++ 
115.2134 ++  template<> 
115.2135 ++    numpunct<char>::~numpunct()
115.2136 ++    { delete _M_data; }
115.2137 ++   
115.2138 ++#ifdef _GLIBCXX_USE_WCHAR_T
115.2139 ++  template<> 
115.2140 ++    void
115.2141 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
115.2142 ++    {
115.2143 ++      if (!_M_data)
115.2144 ++	_M_data = new __numpunct_cache<wchar_t>;
115.2145 ++
115.2146 ++      if (!__cloc)
115.2147 ++	{
115.2148 ++	  // "C" locale
115.2149 ++	  _M_data->_M_grouping = "";
115.2150 ++	  _M_data->_M_grouping_size = 0;
115.2151 ++	  _M_data->_M_use_grouping = false;
115.2152 ++
115.2153 ++	  _M_data->_M_decimal_point = L'.';
115.2154 ++	  _M_data->_M_thousands_sep = L',';
115.2155 ++
115.2156 ++	  // Use ctype::widen code without the facet...
115.2157 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
115.2158 ++	    _M_data->_M_atoms_out[__i] =
115.2159 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
115.2160 ++
115.2161 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
115.2162 ++	    _M_data->_M_atoms_in[__j] =
115.2163 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
115.2164 ++	}
115.2165 ++      else
115.2166 ++	{
115.2167 ++	  // Named locale.
115.2168 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
115.2169 ++#ifdef __UCLIBC_MJN3_ONLY__
115.2170 ++#warning fix this
115.2171 ++#endif
115.2172 ++#ifdef __UCLIBC__
115.2173 ++# ifdef __UCLIBC_HAS_XLOCALE__
115.2174 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
115.2175 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
115.2176 ++# else
115.2177 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
115.2178 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
115.2179 ++# endif
115.2180 ++#else
115.2181 ++	  union { char *__s; wchar_t __w; } __u;
115.2182 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
115.2183 ++	  _M_data->_M_decimal_point = __u.__w;
115.2184 ++
115.2185 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
115.2186 ++	  _M_data->_M_thousands_sep = __u.__w;
115.2187 ++#endif
115.2188 ++
115.2189 ++	  if (_M_data->_M_thousands_sep == L'\0')
115.2190 ++	    _M_data->_M_grouping = "";
115.2191 ++	  else
115.2192 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
115.2193 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
115.2194 ++	}
115.2195 ++
115.2196 ++      // NB: There is no way to extact this info from posix locales.
115.2197 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
115.2198 ++      _M_data->_M_truename = L"true";
115.2199 ++      _M_data->_M_truename_size = 4;
115.2200 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
115.2201 ++      _M_data->_M_falsename = L"false";
115.2202 ++      _M_data->_M_falsename_size = 5;
115.2203 ++    }
115.2204 ++
115.2205 ++  template<> 
115.2206 ++    numpunct<wchar_t>::~numpunct()
115.2207 ++    { delete _M_data; }
115.2208 ++ #endif
115.2209 ++}
115.2210 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.cc
115.2211 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.cc	1969-12-31 18:00:00.000000000 -0600
115.2212 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2005-04-28 01:13:15.000000000 -0500
115.2213 +@@ -0,0 +1,406 @@
115.2214 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
115.2215 ++
115.2216 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
115.2217 ++//
115.2218 ++// This file is part of the GNU ISO C++ Library.  This library is free
115.2219 ++// software; you can redistribute it and/or modify it under the
115.2220 ++// terms of the GNU General Public License as published by the
115.2221 ++// Free Software Foundation; either version 2, or (at your option)
115.2222 ++// any later version.
115.2223 ++
115.2224 ++// This library is distributed in the hope that it will be useful,
115.2225 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
115.2226 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
115.2227 ++// GNU General Public License for more details.
115.2228 ++
115.2229 ++// You should have received a copy of the GNU General Public License along
115.2230 ++// with this library; see the file COPYING.  If not, write to the Free
115.2231 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
115.2232 ++// USA.
115.2233 ++
115.2234 ++// As a special exception, you may use this file as part of a free software
115.2235 ++// library without restriction.  Specifically, if other files instantiate
115.2236 ++// templates or use macros or inline functions from this file, or you compile
115.2237 ++// this file and link it with other files to produce an executable, this
115.2238 ++// file does not by itself cause the resulting executable to be covered by
115.2239 ++// the GNU General Public License.  This exception does not however
115.2240 ++// invalidate any other reasons why the executable file might be covered by
115.2241 ++// the GNU General Public License.
115.2242 ++
115.2243 ++//
115.2244 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
115.2245 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
115.2246 ++//
115.2247 ++
115.2248 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
115.2249 ++
115.2250 ++#include <locale>
115.2251 ++#include <bits/c++locale_internal.h>
115.2252 ++
115.2253 ++#ifdef __UCLIBC_MJN3_ONLY__
115.2254 ++#warning tailor for stub locale support
115.2255 ++#endif
115.2256 ++#ifndef __UCLIBC_HAS_XLOCALE__
115.2257 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
115.2258 ++#endif
115.2259 ++
115.2260 ++namespace std
115.2261 ++{
115.2262 ++  template<>
115.2263 ++    void
115.2264 ++    __timepunct<char>::
115.2265 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
115.2266 ++	   const tm* __tm) const
115.2267 ++    {
115.2268 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.2269 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
115.2270 ++					_M_c_locale_timepunct);
115.2271 ++#else
115.2272 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
115.2273 ++      setlocale(LC_ALL, _M_name_timepunct);
115.2274 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
115.2275 ++      setlocale(LC_ALL, __old);
115.2276 ++      free(__old);
115.2277 ++#endif
115.2278 ++      // Make sure __s is null terminated.
115.2279 ++      if (__len == 0)
115.2280 ++	__s[0] = '\0';
115.2281 ++    }
115.2282 ++
115.2283 ++  template<> 
115.2284 ++    void
115.2285 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
115.2286 ++    {
115.2287 ++      if (!_M_data)
115.2288 ++	_M_data = new __timepunct_cache<char>;
115.2289 ++
115.2290 ++      if (!__cloc)
115.2291 ++	{
115.2292 ++	  // "C" locale
115.2293 ++	  _M_c_locale_timepunct = _S_get_c_locale();
115.2294 ++
115.2295 ++	  _M_data->_M_date_format = "%m/%d/%y";
115.2296 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
115.2297 ++	  _M_data->_M_time_format = "%H:%M:%S";
115.2298 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
115.2299 ++	  _M_data->_M_date_time_format = "";
115.2300 ++	  _M_data->_M_date_time_era_format = "";
115.2301 ++	  _M_data->_M_am = "AM";
115.2302 ++	  _M_data->_M_pm = "PM";
115.2303 ++	  _M_data->_M_am_pm_format = "";
115.2304 ++
115.2305 ++	  // Day names, starting with "C"'s Sunday.
115.2306 ++	  _M_data->_M_day1 = "Sunday";
115.2307 ++	  _M_data->_M_day2 = "Monday";
115.2308 ++	  _M_data->_M_day3 = "Tuesday";
115.2309 ++	  _M_data->_M_day4 = "Wednesday";
115.2310 ++	  _M_data->_M_day5 = "Thursday";
115.2311 ++	  _M_data->_M_day6 = "Friday";
115.2312 ++	  _M_data->_M_day7 = "Saturday";
115.2313 ++
115.2314 ++	  // Abbreviated day names, starting with "C"'s Sun.
115.2315 ++	  _M_data->_M_aday1 = "Sun";
115.2316 ++	  _M_data->_M_aday2 = "Mon";
115.2317 ++	  _M_data->_M_aday3 = "Tue";
115.2318 ++	  _M_data->_M_aday4 = "Wed";
115.2319 ++	  _M_data->_M_aday5 = "Thu";
115.2320 ++	  _M_data->_M_aday6 = "Fri";
115.2321 ++	  _M_data->_M_aday7 = "Sat";
115.2322 ++
115.2323 ++	  // Month names, starting with "C"'s January.
115.2324 ++	  _M_data->_M_month01 = "January";
115.2325 ++	  _M_data->_M_month02 = "February";
115.2326 ++	  _M_data->_M_month03 = "March";
115.2327 ++	  _M_data->_M_month04 = "April";
115.2328 ++	  _M_data->_M_month05 = "May";
115.2329 ++	  _M_data->_M_month06 = "June";
115.2330 ++	  _M_data->_M_month07 = "July";
115.2331 ++	  _M_data->_M_month08 = "August";
115.2332 ++	  _M_data->_M_month09 = "September";
115.2333 ++	  _M_data->_M_month10 = "October";
115.2334 ++	  _M_data->_M_month11 = "November";
115.2335 ++	  _M_data->_M_month12 = "December";
115.2336 ++
115.2337 ++	  // Abbreviated month names, starting with "C"'s Jan.
115.2338 ++	  _M_data->_M_amonth01 = "Jan";
115.2339 ++	  _M_data->_M_amonth02 = "Feb";
115.2340 ++	  _M_data->_M_amonth03 = "Mar";
115.2341 ++	  _M_data->_M_amonth04 = "Apr";
115.2342 ++	  _M_data->_M_amonth05 = "May";
115.2343 ++	  _M_data->_M_amonth06 = "Jun";
115.2344 ++	  _M_data->_M_amonth07 = "Jul";
115.2345 ++	  _M_data->_M_amonth08 = "Aug";
115.2346 ++	  _M_data->_M_amonth09 = "Sep";
115.2347 ++	  _M_data->_M_amonth10 = "Oct";
115.2348 ++	  _M_data->_M_amonth11 = "Nov";
115.2349 ++	  _M_data->_M_amonth12 = "Dec";
115.2350 ++	}
115.2351 ++      else
115.2352 ++	{
115.2353 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
115.2354 ++
115.2355 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
115.2356 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
115.2357 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
115.2358 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
115.2359 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
115.2360 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
115.2361 ++							     __cloc);
115.2362 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
115.2363 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
115.2364 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
115.2365 ++
115.2366 ++	  // Day names, starting with "C"'s Sunday.
115.2367 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
115.2368 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
115.2369 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
115.2370 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
115.2371 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
115.2372 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
115.2373 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
115.2374 ++
115.2375 ++	  // Abbreviated day names, starting with "C"'s Sun.
115.2376 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
115.2377 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
115.2378 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
115.2379 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
115.2380 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
115.2381 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
115.2382 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
115.2383 ++
115.2384 ++	  // Month names, starting with "C"'s January.
115.2385 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
115.2386 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
115.2387 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
115.2388 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
115.2389 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
115.2390 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
115.2391 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
115.2392 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
115.2393 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
115.2394 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
115.2395 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
115.2396 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
115.2397 ++
115.2398 ++	  // Abbreviated month names, starting with "C"'s Jan.
115.2399 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
115.2400 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
115.2401 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
115.2402 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
115.2403 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
115.2404 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
115.2405 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
115.2406 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
115.2407 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
115.2408 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
115.2409 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
115.2410 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
115.2411 ++	}
115.2412 ++    }
115.2413 ++
115.2414 ++#ifdef _GLIBCXX_USE_WCHAR_T
115.2415 ++  template<>
115.2416 ++    void
115.2417 ++    __timepunct<wchar_t>::
115.2418 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
115.2419 ++	   const tm* __tm) const
115.2420 ++    {
115.2421 ++#ifdef __UCLIBC_HAS_XLOCALE__
115.2422 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
115.2423 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
115.2424 ++					_M_c_locale_timepunct);
115.2425 ++#else
115.2426 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
115.2427 ++      setlocale(LC_ALL, _M_name_timepunct);
115.2428 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
115.2429 ++      setlocale(LC_ALL, __old);
115.2430 ++      free(__old);
115.2431 ++#endif
115.2432 ++      // Make sure __s is null terminated.
115.2433 ++      if (__len == 0)
115.2434 ++	__s[0] = L'\0';
115.2435 ++    }
115.2436 ++
115.2437 ++  template<> 
115.2438 ++    void
115.2439 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
115.2440 ++    {
115.2441 ++      if (!_M_data)
115.2442 ++	_M_data = new __timepunct_cache<wchar_t>;
115.2443 ++
115.2444 ++#warning wide time stuff
115.2445 ++//       if (!__cloc)
115.2446 ++	{
115.2447 ++	  // "C" locale
115.2448 ++	  _M_c_locale_timepunct = _S_get_c_locale();
115.2449 ++
115.2450 ++	  _M_data->_M_date_format = L"%m/%d/%y";
115.2451 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
115.2452 ++	  _M_data->_M_time_format = L"%H:%M:%S";
115.2453 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
115.2454 ++	  _M_data->_M_date_time_format = L"";
115.2455 ++	  _M_data->_M_date_time_era_format = L"";
115.2456 ++	  _M_data->_M_am = L"AM";
115.2457 ++	  _M_data->_M_pm = L"PM";
115.2458 ++	  _M_data->_M_am_pm_format = L"";
115.2459 ++
115.2460 ++	  // Day names, starting with "C"'s Sunday.
115.2461 ++	  _M_data->_M_day1 = L"Sunday";
115.2462 ++	  _M_data->_M_day2 = L"Monday";
115.2463 ++	  _M_data->_M_day3 = L"Tuesday";
115.2464 ++	  _M_data->_M_day4 = L"Wednesday";
115.2465 ++	  _M_data->_M_day5 = L"Thursday";
115.2466 ++	  _M_data->_M_day6 = L"Friday";
115.2467 ++	  _M_data->_M_day7 = L"Saturday";
115.2468 ++
115.2469 ++	  // Abbreviated day names, starting with "C"'s Sun.
115.2470 ++	  _M_data->_M_aday1 = L"Sun";
115.2471 ++	  _M_data->_M_aday2 = L"Mon";
115.2472 ++	  _M_data->_M_aday3 = L"Tue";
115.2473 ++	  _M_data->_M_aday4 = L"Wed";
115.2474 ++	  _M_data->_M_aday5 = L"Thu";
115.2475 ++	  _M_data->_M_aday6 = L"Fri";
115.2476 ++	  _M_data->_M_aday7 = L"Sat";
115.2477 ++
115.2478 ++	  // Month names, starting with "C"'s January.
115.2479 ++	  _M_data->_M_month01 = L"January";
115.2480 ++	  _M_data->_M_month02 = L"February";
115.2481 ++	  _M_data->_M_month03 = L"March";
115.2482 ++	  _M_data->_M_month04 = L"April";
115.2483 ++	  _M_data->_M_month05 = L"May";
115.2484 ++	  _M_data->_M_month06 = L"June";
115.2485 ++	  _M_data->_M_month07 = L"July";
115.2486 ++	  _M_data->_M_month08 = L"August";
115.2487 ++	  _M_data->_M_month09 = L"September";
115.2488 ++	  _M_data->_M_month10 = L"October";
115.2489 ++	  _M_data->_M_month11 = L"November";
115.2490 ++	  _M_data->_M_month12 = L"December";
115.2491 ++
115.2492 ++	  // Abbreviated month names, starting with "C"'s Jan.
115.2493 ++	  _M_data->_M_amonth01 = L"Jan";
115.2494 ++	  _M_data->_M_amonth02 = L"Feb";
115.2495 ++	  _M_data->_M_amonth03 = L"Mar";
115.2496 ++	  _M_data->_M_amonth04 = L"Apr";
115.2497 ++	  _M_data->_M_amonth05 = L"May";
115.2498 ++	  _M_data->_M_amonth06 = L"Jun";
115.2499 ++	  _M_data->_M_amonth07 = L"Jul";
115.2500 ++	  _M_data->_M_amonth08 = L"Aug";
115.2501 ++	  _M_data->_M_amonth09 = L"Sep";
115.2502 ++	  _M_data->_M_amonth10 = L"Oct";
115.2503 ++	  _M_data->_M_amonth11 = L"Nov";
115.2504 ++	  _M_data->_M_amonth12 = L"Dec";
115.2505 ++	}
115.2506 ++#if 0
115.2507 ++      else
115.2508 ++	{
115.2509 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
115.2510 ++
115.2511 ++	  union { char *__s; wchar_t *__w; } __u;
115.2512 ++
115.2513 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
115.2514 ++	  _M_data->_M_date_format = __u.__w;
115.2515 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
115.2516 ++	  _M_data->_M_date_era_format = __u.__w;
115.2517 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
115.2518 ++	  _M_data->_M_time_format = __u.__w;
115.2519 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
115.2520 ++	  _M_data->_M_time_era_format = __u.__w;
115.2521 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
115.2522 ++	  _M_data->_M_date_time_format = __u.__w;
115.2523 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
115.2524 ++	  _M_data->_M_date_time_era_format = __u.__w;
115.2525 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
115.2526 ++	  _M_data->_M_am = __u.__w;
115.2527 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
115.2528 ++	  _M_data->_M_pm = __u.__w;
115.2529 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
115.2530 ++	  _M_data->_M_am_pm_format = __u.__w;
115.2531 ++
115.2532 ++	  // Day names, starting with "C"'s Sunday.
115.2533 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
115.2534 ++	  _M_data->_M_day1 = __u.__w;
115.2535 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
115.2536 ++	  _M_data->_M_day2 = __u.__w;
115.2537 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
115.2538 ++	  _M_data->_M_day3 = __u.__w;
115.2539 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
115.2540 ++	  _M_data->_M_day4 = __u.__w;
115.2541 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
115.2542 ++	  _M_data->_M_day5 = __u.__w;
115.2543 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
115.2544 ++	  _M_data->_M_day6 = __u.__w;
115.2545 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
115.2546 ++	  _M_data->_M_day7 = __u.__w;
115.2547 ++
115.2548 ++	  // Abbreviated day names, starting with "C"'s Sun.
115.2549 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
115.2550 ++	  _M_data->_M_aday1 = __u.__w;
115.2551 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
115.2552 ++	  _M_data->_M_aday2 = __u.__w;
115.2553 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
115.2554 ++	  _M_data->_M_aday3 = __u.__w;
115.2555 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
115.2556 ++	  _M_data->_M_aday4 = __u.__w;
115.2557 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
115.2558 ++	  _M_data->_M_aday5 = __u.__w;
115.2559 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
115.2560 ++	  _M_data->_M_aday6 = __u.__w;
115.2561 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
115.2562 ++	  _M_data->_M_aday7 = __u.__w;
115.2563 ++
115.2564 ++	  // Month names, starting with "C"'s January.
115.2565 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
115.2566 ++	  _M_data->_M_month01 = __u.__w;
115.2567 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
115.2568 ++	  _M_data->_M_month02 = __u.__w;
115.2569 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
115.2570 ++	  _M_data->_M_month03 = __u.__w;
115.2571 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
115.2572 ++	  _M_data->_M_month04 = __u.__w;
115.2573 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
115.2574 ++	  _M_data->_M_month05 = __u.__w;
115.2575 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
115.2576 ++	  _M_data->_M_month06 = __u.__w;
115.2577 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
115.2578 ++	  _M_data->_M_month07 = __u.__w;
115.2579 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
115.2580 ++	  _M_data->_M_month08 = __u.__w;
115.2581 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
115.2582 ++	  _M_data->_M_month09 = __u.__w;
115.2583 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
115.2584 ++	  _M_data->_M_month10 = __u.__w;
115.2585 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
115.2586 ++	  _M_data->_M_month11 = __u.__w;
115.2587 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
115.2588 ++	  _M_data->_M_month12 = __u.__w;
115.2589 ++
115.2590 ++	  // Abbreviated month names, starting with "C"'s Jan.
115.2591 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
115.2592 ++	  _M_data->_M_amonth01 = __u.__w;
115.2593 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
115.2594 ++	  _M_data->_M_amonth02 = __u.__w;
115.2595 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
115.2596 ++	  _M_data->_M_amonth03 = __u.__w;
115.2597 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
115.2598 ++	  _M_data->_M_amonth04 = __u.__w;
115.2599 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
115.2600 ++	  _M_data->_M_amonth05 = __u.__w;
115.2601 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
115.2602 ++	  _M_data->_M_amonth06 = __u.__w;
115.2603 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
115.2604 ++	  _M_data->_M_amonth07 = __u.__w;
115.2605 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
115.2606 ++	  _M_data->_M_amonth08 = __u.__w;
115.2607 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
115.2608 ++	  _M_data->_M_amonth09 = __u.__w;
115.2609 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
115.2610 ++	  _M_data->_M_amonth10 = __u.__w;
115.2611 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
115.2612 ++	  _M_data->_M_amonth11 = __u.__w;
115.2613 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
115.2614 ++	  _M_data->_M_amonth12 = __u.__w;
115.2615 ++	}
115.2616 ++#endif // 0
115.2617 ++    }
115.2618 ++#endif
115.2619 ++}
115.2620 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.h
115.2621 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.h	1969-12-31 18:00:00.000000000 -0600
115.2622 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.h	2004-05-22 18:46:31.000000000 -0500
115.2623 +@@ -0,0 +1,68 @@
115.2624 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
115.2625 ++
115.2626 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
115.2627 ++//
115.2628 ++// This file is part of the GNU ISO C++ Library.  This library is free
115.2629 ++// software; you can redistribute it and/or modify it under the
115.2630 ++// terms of the GNU General Public License as published by the
115.2631 ++// Free Software Foundation; either version 2, or (at your option)
115.2632 ++// any later version.
115.2633 ++
115.2634 ++// This library is distributed in the hope that it will be useful,
115.2635 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
115.2636 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
115.2637 ++// GNU General Public License for more details.
115.2638 ++
115.2639 ++// You should have received a copy of the GNU General Public License along
115.2640 ++// with this library; see the file COPYING.  If not, write to the Free
115.2641 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
115.2642 ++// USA.
115.2643 ++
115.2644 ++// As a special exception, you may use this file as part of a free software
115.2645 ++// library without restriction.  Specifically, if other files instantiate
115.2646 ++// templates or use macros or inline functions from this file, or you compile
115.2647 ++// this file and link it with other files to produce an executable, this
115.2648 ++// file does not by itself cause the resulting executable to be covered by
115.2649 ++// the GNU General Public License.  This exception does not however
115.2650 ++// invalidate any other reasons why the executable file might be covered by
115.2651 ++// the GNU General Public License.
115.2652 ++
115.2653 ++//
115.2654 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
115.2655 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
115.2656 ++//
115.2657 ++
115.2658 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
115.2659 ++
115.2660 ++  template<typename _CharT>
115.2661 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
115.2662 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
115.2663 ++    _M_name_timepunct(_S_get_c_name())
115.2664 ++    { _M_initialize_timepunct(); }
115.2665 ++
115.2666 ++  template<typename _CharT>
115.2667 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
115.2668 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
115.2669 ++    _M_name_timepunct(_S_get_c_name())
115.2670 ++    { _M_initialize_timepunct(); }
115.2671 ++
115.2672 ++  template<typename _CharT>
115.2673 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
115.2674 ++				     size_t __refs) 
115.2675 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
115.2676 ++    _M_name_timepunct(__s)
115.2677 ++    { 
115.2678 ++      char* __tmp = new char[std::strlen(__s) + 1];
115.2679 ++      std::strcpy(__tmp, __s);
115.2680 ++      _M_name_timepunct = __tmp;
115.2681 ++      _M_initialize_timepunct(__cloc); 
115.2682 ++    }
115.2683 ++
115.2684 ++  template<typename _CharT>
115.2685 ++    __timepunct<_CharT>::~__timepunct()
115.2686 ++    { 
115.2687 ++      if (_M_name_timepunct != _S_get_c_name())
115.2688 ++	delete [] _M_name_timepunct;
115.2689 ++      delete _M_data; 
115.2690 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
115.2691 ++    }
115.2692 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_base.h
115.2693 +--- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_base.h	1969-12-31 18:00:00.000000000 -0600
115.2694 ++++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_base.h	2005-04-28 01:10:27.000000000 -0500
115.2695 +@@ -0,0 +1,64 @@
115.2696 ++// Locale support -*- C++ -*-
115.2697 ++
115.2698 ++// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
115.2699 ++// Free Software Foundation, Inc.
115.2700 ++//
115.2701 ++// This file is part of the GNU ISO C++ Library.  This library is free
115.2702 ++// software; you can redistribute it and/or modify it under the
115.2703 ++// terms of the GNU General Public License as published by the
115.2704 ++// Free Software Foundation; either version 2, or (at your option)
115.2705 ++// any later version.
115.2706 ++
115.2707 ++// This library is distributed in the hope that it will be useful,
115.2708 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
115.2709 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
115.2710 ++// GNU General Public License for more details.
115.2711 ++
115.2712 ++// You should have received a copy of the GNU General Public License along
115.2713 ++// with this library; see the file COPYING.  If not, write to the Free
115.2714 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
115.2715 ++// USA.
115.2716 ++
115.2717 ++// As a special exception, you may use this file as part of a free software
115.2718 ++// library without restriction.  Specifically, if other files instantiate
115.2719 ++// templates or use macros or inline functions from this file, or you compile
115.2720 ++// this file and link it with other files to produce an executable, this
115.2721 ++// file does not by itself cause the resulting executable to be covered by
115.2722 ++// the GNU General Public License.  This exception does not however
115.2723 ++// invalidate any other reasons why the executable file might be covered by
115.2724 ++// the GNU General Public License.
115.2725 ++
115.2726 ++//
115.2727 ++// ISO C++ 14882: 22.1  Locales
115.2728 ++//
115.2729 ++  
115.2730 ++/** @file ctype_base.h
115.2731 ++ *  This is an internal header file, included by other library headers.
115.2732 ++ *  You should not attempt to use it directly.
115.2733 ++ */
115.2734 ++
115.2735 ++// Information as gleaned from /usr/include/ctype.h
115.2736 ++  
115.2737 ++  /// @brief  Base class for ctype.
115.2738 ++  struct ctype_base
115.2739 ++  {
115.2740 ++    // Note: In uClibc, the following two types depend on configuration.
115.2741 ++ 
115.2742 ++    // Non-standard typedefs.
115.2743 ++    typedef const __ctype_touplow_t* __to_type;
115.2744 ++
115.2745 ++    // NB: Offsets into ctype<char>::_M_table force a particular size
115.2746 ++    // on the mask type. Because of this, we don't use an enum.
115.2747 ++    typedef __ctype_mask_t	mask;   
115.2748 ++    static const mask upper    	= _ISupper;
115.2749 ++    static const mask lower 	= _ISlower;
115.2750 ++    static const mask alpha 	= _ISalpha;
115.2751 ++    static const mask digit 	= _ISdigit;
115.2752 ++    static const mask xdigit 	= _ISxdigit;
115.2753 ++    static const mask space 	= _ISspace;
115.2754 ++    static const mask print 	= _ISprint;
115.2755 ++    static const mask graph 	= _ISalpha | _ISdigit | _ISpunct;
115.2756 ++    static const mask cntrl 	= _IScntrl;
115.2757 ++    static const mask punct 	= _ISpunct;
115.2758 ++    static const mask alnum 	= _ISalpha | _ISdigit;
115.2759 ++  };
115.2760 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
115.2761 +--- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_inline.h	1969-12-31 18:00:00.000000000 -0600
115.2762 ++++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_inline.h	2002-06-24 00:49:19.000000000 -0500
115.2763 +@@ -0,0 +1,69 @@
115.2764 ++// Locale support -*- C++ -*-
115.2765 ++
115.2766 ++// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
115.2767 ++//
115.2768 ++// This file is part of the GNU ISO C++ Library.  This library is free
115.2769 ++// software; you can redistribute it and/or modify it under the
115.2770 ++// terms of the GNU General Public License as published by the
115.2771 ++// Free Software Foundation; either version 2, or (at your option)
115.2772 ++// any later version.
115.2773 ++
115.2774 ++// This library is distributed in the hope that it will be useful,
115.2775 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
115.2776 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
115.2777 ++// GNU General Public License for more details.
115.2778 ++
115.2779 ++// You should have received a copy of the GNU General Public License along
115.2780 ++// with this library; see the file COPYING.  If not, write to the Free
115.2781 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
115.2782 ++// USA.
115.2783 ++
115.2784 ++// As a special exception, you may use this file as part of a free software
115.2785 ++// library without restriction.  Specifically, if other files instantiate
115.2786 ++// templates or use macros or inline functions from this file, or you compile
115.2787 ++// this file and link it with other files to produce an executable, this
115.2788 ++// file does not by itself cause the resulting executable to be covered by
115.2789 ++// the GNU General Public License.  This exception does not however
115.2790 ++// invalidate any other reasons why the executable file might be covered by
115.2791 ++// the GNU General Public License.
115.2792 ++
115.2793 ++//
115.2794 ++// ISO C++ 14882: 22.1  Locales
115.2795 ++//
115.2796 ++  
115.2797 ++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
115.2798 ++// functions go in ctype.cc
115.2799 ++  
115.2800 ++  bool
115.2801 ++  ctype<char>::
115.2802 ++  is(mask __m, char __c) const
115.2803 ++  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
115.2804 ++
115.2805 ++  const char*
115.2806 ++  ctype<char>::
115.2807 ++  is(const char* __low, const char* __high, mask* __vec) const
115.2808 ++  {
115.2809 ++    while (__low < __high)
115.2810 ++      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
115.2811 ++    return __high;
115.2812 ++  }
115.2813 ++
115.2814 ++  const char*
115.2815 ++  ctype<char>::
115.2816 ++  scan_is(mask __m, const char* __low, const char* __high) const
115.2817 ++  {
115.2818 ++    while (__low < __high 
115.2819 ++	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
115.2820 ++      ++__low;
115.2821 ++    return __low;
115.2822 ++  }
115.2823 ++
115.2824 ++  const char*
115.2825 ++  ctype<char>::
115.2826 ++  scan_not(mask __m, const char* __low, const char* __high) const
115.2827 ++  {
115.2828 ++    while (__low < __high 
115.2829 ++	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
115.2830 ++      ++__low;
115.2831 ++    return __low;
115.2832 ++  }
115.2833 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
115.2834 +--- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_noninline.h	1969-12-31 18:00:00.000000000 -0600
115.2835 ++++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h	2005-04-28 01:10:27.000000000 -0500
115.2836 +@@ -0,0 +1,92 @@
115.2837 ++// Locale support -*- C++ -*-
115.2838 ++
115.2839 ++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
115.2840 ++// Free Software Foundation, Inc.
115.2841 ++//
115.2842 ++// This file is part of the GNU ISO C++ Library.  This library is free
115.2843 ++// software; you can redistribute it and/or modify it under the
115.2844 ++// terms of the GNU General Public License as published by the
115.2845 ++// Free Software Foundation; either version 2, or (at your option)
115.2846 ++// any later version.
115.2847 ++
115.2848 ++// This library is distributed in the hope that it will be useful,
115.2849 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
115.2850 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
115.2851 ++// GNU General Public License for more details.
115.2852 ++
115.2853 ++// You should have received a copy of the GNU General Public License along
115.2854 ++// with this library; see the file COPYING.  If not, write to the Free
115.2855 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
115.2856 ++// USA.
115.2857 ++
115.2858 ++// As a special exception, you may use this file as part of a free software
115.2859 ++// library without restriction.  Specifically, if other files instantiate
115.2860 ++// templates or use macros or inline functions from this file, or you compile
115.2861 ++// this file and link it with other files to produce an executable, this
115.2862 ++// file does not by itself cause the resulting executable to be covered by
115.2863 ++// the GNU General Public License.  This exception does not however
115.2864 ++// invalidate any other reasons why the executable file might be covered by
115.2865 ++// the GNU General Public License.
115.2866 ++
115.2867 ++//
115.2868 ++// ISO C++ 14882: 22.1  Locales
115.2869 ++//
115.2870 ++  
115.2871 ++// Information as gleaned from /usr/include/ctype.h
115.2872 ++
115.2873 ++  const ctype_base::mask*
115.2874 ++  ctype<char>::classic_table() throw()
115.2875 ++  { return __C_ctype_b; }
115.2876 ++
115.2877 ++  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
115.2878 ++		     size_t __refs) 
115.2879 ++  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
115.2880 ++  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
115.2881 ++  {
115.2882 ++    _M_toupper = __C_ctype_toupper;
115.2883 ++    _M_tolower = __C_ctype_tolower;
115.2884 ++    _M_table = __table ? __table : __C_ctype_b;
115.2885 ++    memset(_M_widen, 0, sizeof(_M_widen));
115.2886 ++    memset(_M_narrow, 0, sizeof(_M_narrow));
115.2887 ++  }
115.2888 ++
115.2889 ++  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
115.2890 ++  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
115.2891 ++  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
115.2892 ++  {
115.2893 ++    _M_toupper = __C_ctype_toupper;
115.2894 ++    _M_tolower = __C_ctype_tolower;
115.2895 ++    _M_table = __table ? __table : __C_ctype_b;
115.2896 ++    memset(_M_widen, 0, sizeof(_M_widen));
115.2897 ++    memset(_M_narrow, 0, sizeof(_M_narrow));
115.2898 ++  }
115.2899 ++
115.2900 ++  char
115.2901 ++  ctype<char>::do_toupper(char __c) const
115.2902 ++  { return _M_toupper[static_cast<unsigned char>(__c)]; }
115.2903 ++
115.2904 ++  const char*
115.2905 ++  ctype<char>::do_toupper(char* __low, const char* __high) const
115.2906 ++  {
115.2907 ++    while (__low < __high)
115.2908 ++      {
115.2909 ++	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
115.2910 ++	++__low;
115.2911 ++      }
115.2912 ++    return __high;
115.2913 ++  }
115.2914 ++
115.2915 ++  char
115.2916 ++  ctype<char>::do_tolower(char __c) const
115.2917 ++  { return _M_tolower[static_cast<unsigned char>(__c)]; }
115.2918 ++
115.2919 ++  const char* 
115.2920 ++  ctype<char>::do_tolower(char* __low, const char* __high) const
115.2921 ++  {
115.2922 ++    while (__low < __high)
115.2923 ++      {
115.2924 ++	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
115.2925 ++	++__low;
115.2926 ++      }
115.2927 ++    return __high;
115.2928 ++  }
115.2929 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/os_defines.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/os_defines.h
115.2930 +--- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/os_defines.h	1969-12-31 18:00:00.000000000 -0600
115.2931 ++++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/os_defines.h	2005-04-28 01:10:27.000000000 -0500
115.2932 +@@ -0,0 +1,44 @@
115.2933 ++// Specific definitions for GNU/Linux  -*- C++ -*-
115.2934 ++
115.2935 ++// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
115.2936 ++//
115.2937 ++// This file is part of the GNU ISO C++ Library.  This library is free
115.2938 ++// software; you can redistribute it and/or modify it under the
115.2939 ++// terms of the GNU General Public License as published by the
115.2940 ++// Free Software Foundation; either version 2, or (at your option)
115.2941 ++// any later version.
115.2942 ++
115.2943 ++// This library is distributed in the hope that it will be useful,
115.2944 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
115.2945 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
115.2946 ++// GNU General Public License for more details.
115.2947 ++
115.2948 ++// You should have received a copy of the GNU General Public License along
115.2949 ++// with this library; see the file COPYING.  If not, write to the Free
115.2950 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
115.2951 ++// USA.
115.2952 ++
115.2953 ++// As a special exception, you may use this file as part of a free software
115.2954 ++// library without restriction.  Specifically, if other files instantiate
115.2955 ++// templates or use macros or inline functions from this file, or you compile
115.2956 ++// this file and link it with other files to produce an executable, this
115.2957 ++// file does not by itself cause the resulting executable to be covered by
115.2958 ++// the GNU General Public License.  This exception does not however
115.2959 ++// invalidate any other reasons why the executable file might be covered by
115.2960 ++// the GNU General Public License.
115.2961 ++
115.2962 ++#ifndef _GLIBCXX_OS_DEFINES
115.2963 ++#define _GLIBCXX_OS_DEFINES 1
115.2964 ++
115.2965 ++// System-specific #define, typedefs, corrections, etc, go here.  This
115.2966 ++// file will come before all others.
115.2967 ++
115.2968 ++// This keeps isanum, et al from being propagated as macros.
115.2969 ++#define __NO_CTYPE 1
115.2970 ++
115.2971 ++#include <features.h>
115.2972 ++
115.2973 ++// We must not see the optimized string functions GNU libc defines.
115.2974 ++#define __NO_STRING_INLINES
115.2975 ++
115.2976 ++#endif
115.2977 +diff -urN gcc-4.0.0-100/libstdc++-v3/configure gcc-4.0.0/libstdc++-v3/configure
115.2978 +--- gcc-4.0.0-100/libstdc++-v3/configure	2005-04-30 13:06:53.683055232 -0500
115.2979 ++++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 12:24:24.000000000 -0500
115.2980 +@@ -3998,6 +3998,11 @@
115.2981 +   lt_cv_deplibs_check_method=pass_all
115.2982 +   ;;
115.2983 + 
115.2984 ++linux-uclibc*)
115.2985 ++  lt_cv_deplibs_check_method=pass_all
115.2986 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
115.2987 ++  ;;
115.2988 ++
115.2989 + netbsd* | knetbsd*-gnu)
115.2990 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
115.2991 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
115.2992 +@@ -5672,7 +5677,7 @@
115.2993 +   enableval="$enable_clocale"
115.2994 + 
115.2995 +       case "$enableval" in
115.2996 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
115.2997 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
115.2998 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
115.2999 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
115.3000 +    { (exit 1); exit 1; }; } ;;
115.3001 +@@ -5697,6 +5702,9 @@
115.3002 +   # Default to "generic".
115.3003 +   if test $enable_clocale_flag = auto; then
115.3004 +     case ${target_os} in
115.3005 ++      linux-uclibc*)
115.3006 ++	enable_clocale_flag=uclibc
115.3007 ++	;;
115.3008 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
115.3009 +         cat >conftest.$ac_ext <<_ACEOF
115.3010 + /* confdefs.h.  */
115.3011 +@@ -5927,6 +5935,76 @@
115.3012 +       CTIME_CC=config/locale/generic/time_members.cc
115.3013 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
115.3014 +       ;;
115.3015 ++    uclibc)
115.3016 ++      echo "$as_me:$LINENO: result: uclibc" >&5
115.3017 ++echo "${ECHO_T}uclibc" >&6
115.3018 ++
115.3019 ++      # Declare intention to use gettext, and add support for specific
115.3020 ++      # languages.
115.3021 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
115.3022 ++      ALL_LINGUAS="de fr"
115.3023 ++
115.3024 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
115.3025 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
115.3026 ++set dummy msgfmt; ac_word=$2
115.3027 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
115.3028 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
115.3029 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
115.3030 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
115.3031 ++else
115.3032 ++  if test -n "$check_msgfmt"; then
115.3033 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
115.3034 ++else
115.3035 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
115.3036 ++for as_dir in $PATH
115.3037 ++do
115.3038 ++  IFS=$as_save_IFS
115.3039 ++  test -z "$as_dir" && as_dir=.
115.3040 ++  for ac_exec_ext in '' $ac_executable_extensions; do
115.3041 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
115.3042 ++    ac_cv_prog_check_msgfmt="yes"
115.3043 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
115.3044 ++    break 2
115.3045 ++  fi
115.3046 ++done
115.3047 ++done
115.3048 ++
115.3049 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
115.3050 ++fi
115.3051 ++fi
115.3052 ++check_msgfmt=$ac_cv_prog_check_msgfmt
115.3053 ++if test -n "$check_msgfmt"; then
115.3054 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
115.3055 ++echo "${ECHO_T}$check_msgfmt" >&6
115.3056 ++else
115.3057 ++  echo "$as_me:$LINENO: result: no" >&5
115.3058 ++echo "${ECHO_T}no" >&6
115.3059 ++fi
115.3060 ++
115.3061 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
115.3062 ++        USE_NLS=yes
115.3063 ++      fi
115.3064 ++      # Export the build objects.
115.3065 ++      for ling in $ALL_LINGUAS; do \
115.3066 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
115.3067 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
115.3068 ++      done
115.3069 ++
115.3070 ++
115.3071 ++
115.3072 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
115.3073 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
115.3074 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
115.3075 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
115.3076 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
115.3077 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
115.3078 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
115.3079 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
115.3080 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
115.3081 ++      CTIME_H=config/locale/uclibc/time_members.h
115.3082 ++      CTIME_CC=config/locale/uclibc/time_members.cc
115.3083 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
115.3084 ++      ;;
115.3085 +   esac
115.3086 + 
115.3087 +   # This is where the testsuite looks for locale catalogs, using the
115.3088 +diff -urN gcc-4.0.0-100/libstdc++-v3/configure.host gcc-4.0.0/libstdc++-v3/configure.host
115.3089 +--- gcc-4.0.0-100/libstdc++-v3/configure.host	2005-04-30 13:06:53.688054472 -0500
115.3090 ++++ gcc-4.0.0/libstdc++-v3/configure.host	2005-04-28 20:20:32.000000000 -0500
115.3091 +@@ -249,6 +249,12 @@
115.3092 +     ;;
115.3093 + esac
115.3094 + 
115.3095 ++# Override for uClibc since linux-uclibc gets mishandled above.
115.3096 ++case "${host_os}" in
115.3097 ++  *-uclibc*)
115.3098 ++    os_include_dir="os/uclibc"
115.3099 ++    ;;
115.3100 ++esac
115.3101 + 
115.3102 + # Set any OS-dependent and CPU-dependent bits.
115.3103 + # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
115.3104 +diff -urN gcc-4.0.0-100/libstdc++-v3/crossconfig.m4 gcc-4.0.0/libstdc++-v3/crossconfig.m4
115.3105 +--- gcc-4.0.0-100/libstdc++-v3/crossconfig.m4	2005-04-30 13:06:53.689054320 -0500
115.3106 ++++ gcc-4.0.0/libstdc++-v3/crossconfig.m4	2005-04-28 20:27:15.000000000 -0500
115.3107 +@@ -142,6 +142,98 @@
115.3108 + 	;;
115.3109 +     esac
115.3110 +     ;;
115.3111 ++  *-uclibc*)
115.3112 ++# Temporary hack until we implement the float versions of the libm funcs
115.3113 ++    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
115.3114 ++      machine/endian.h machine/param.h sys/machine.h sys/types.h \
115.3115 ++      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
115.3116 ++    SECTION_FLAGS='-ffunction-sections -fdata-sections'
115.3117 ++    AC_SUBST(SECTION_FLAGS)
115.3118 ++    GLIBCXX_CHECK_LINKER_FEATURES
115.3119 ++    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
115.3120 ++    GLIBCXX_CHECK_WCHAR_T_SUPPORT
115.3121 ++
115.3122 ++    # For LFS.
115.3123 ++    AC_DEFINE(HAVE_INT64_T)
115.3124 ++    case "$target" in
115.3125 ++      *-uclinux*)
115.3126 ++        # Don't enable LFS with uClinux
115.3127 ++        ;;
115.3128 ++      *)
115.3129 ++        AC_DEFINE(_GLIBCXX_USE_LFS)
115.3130 ++    esac
115.3131 ++
115.3132 ++    # For showmanyc_helper().
115.3133 ++    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
115.3134 ++    GLIBCXX_CHECK_POLL
115.3135 ++    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
115.3136 ++
115.3137 ++    # For xsputn_2().
115.3138 ++    AC_CHECK_HEADERS(sys/uio.h)
115.3139 ++    GLIBCXX_CHECK_WRITEV
115.3140 ++
115.3141 ++#     AC_DEFINE(HAVE_ACOSF)
115.3142 ++#     AC_DEFINE(HAVE_ASINF)
115.3143 ++#     AC_DEFINE(HAVE_ATANF)
115.3144 ++#     AC_DEFINE(HAVE_ATAN2F)
115.3145 ++    AC_DEFINE(HAVE_CEILF)
115.3146 ++    AC_DEFINE(HAVE_COPYSIGN)
115.3147 ++#     AC_DEFINE(HAVE_COPYSIGNF)
115.3148 ++#     AC_DEFINE(HAVE_COSF)
115.3149 ++#     AC_DEFINE(HAVE_COSHF)
115.3150 ++#     AC_DEFINE(HAVE_EXPF)
115.3151 ++#     AC_DEFINE(HAVE_FABSF)
115.3152 ++    AC_DEFINE(HAVE_FINITE)
115.3153 ++    AC_DEFINE(HAVE_FINITEF)
115.3154 ++    AC_DEFINE(HAVE_FLOORF)
115.3155 ++#     AC_DEFINE(HAVE_FMODF)
115.3156 ++#     AC_DEFINE(HAVE_FREXPF)
115.3157 ++    AC_DEFINE(HAVE_HYPOT)
115.3158 ++#     AC_DEFINE(HAVE_HYPOTF)
115.3159 ++    AC_DEFINE(HAVE_ISINF)
115.3160 ++    AC_DEFINE(HAVE_ISINFF)
115.3161 ++    AC_DEFINE(HAVE_ISNAN)
115.3162 ++    AC_DEFINE(HAVE_ISNANF)
115.3163 ++#     AC_DEFINE(HAVE_LOGF)
115.3164 ++#     AC_DEFINE(HAVE_LOG10F)
115.3165 ++#     AC_DEFINE(HAVE_MODFF)
115.3166 ++#     AC_DEFINE(HAVE_SINF)
115.3167 ++#     AC_DEFINE(HAVE_SINHF)
115.3168 ++#     AC_DEFINE(HAVE_SINCOS)
115.3169 ++#     AC_DEFINE(HAVE_SINCOSF)
115.3170 ++    AC_DEFINE(HAVE_SQRTF)
115.3171 ++#     AC_DEFINE(HAVE_TANF)
115.3172 ++#     AC_DEFINE(HAVE_TANHF)
115.3173 ++    if test x"long_double_math_on_this_cpu" = x"yes"; then
115.3174 ++#       AC_DEFINE(HAVE_ACOSL)
115.3175 ++#       AC_DEFINE(HAVE_ASINL)
115.3176 ++#       AC_DEFINE(HAVE_ATANL)
115.3177 ++#       AC_DEFINE(HAVE_ATAN2L)
115.3178 ++#       AC_DEFINE(HAVE_CEILL)
115.3179 ++#       AC_DEFINE(HAVE_COPYSIGNL)
115.3180 ++#       AC_DEFINE(HAVE_COSL)
115.3181 ++#       AC_DEFINE(HAVE_COSHL)
115.3182 ++#       AC_DEFINE(HAVE_EXPL)
115.3183 ++#       AC_DEFINE(HAVE_FABSL)
115.3184 ++#       AC_DEFINE(HAVE_FINITEL)
115.3185 ++#       AC_DEFINE(HAVE_FLOORL)
115.3186 ++#       AC_DEFINE(HAVE_FMODL)
115.3187 ++#       AC_DEFINE(HAVE_FREXPL)
115.3188 ++#       AC_DEFINE(HAVE_HYPOTL)
115.3189 ++#       AC_DEFINE(HAVE_ISINFL)
115.3190 ++#       AC_DEFINE(HAVE_ISNANL)
115.3191 ++#       AC_DEFINE(HAVE_LOGL)
115.3192 ++#       AC_DEFINE(HAVE_LOG10L)
115.3193 ++#       AC_DEFINE(HAVE_MODFL)
115.3194 ++#       AC_DEFINE(HAVE_POWL)
115.3195 ++#       AC_DEFINE(HAVE_SINL)
115.3196 ++#       AC_DEFINE(HAVE_SINHL)
115.3197 ++#       AC_DEFINE(HAVE_SINCOSL)
115.3198 ++#       AC_DEFINE(HAVE_SQRTL)
115.3199 ++#       AC_DEFINE(HAVE_TANL)
115.3200 ++#       AC_DEFINE(HAVE_TANHL)
115.3201 ++    fi
115.3202 ++    ;;
115.3203 +   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
115.3204 +     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
115.3205 +       machine/endian.h machine/param.h sys/machine.h sys/types.h \
115.3206 +@@ -156,7 +248,7 @@
115.3207 +     AC_DEFINE(HAVE_INT64_T)
115.3208 +     case "$target" in
115.3209 +       *-uclinux*)
115.3210 +-        # Don't enable LFS with uClibc
115.3211 ++        # Don't enable LFS with uClinux
115.3212 +         ;;
115.3213 +       *)
115.3214 +         AC_DEFINE(_GLIBCXX_USE_LFS)
115.3215 +diff -urN gcc-4.0.0-100/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.0.0/libstdc++-v3/include/c_compatibility/wchar.h
115.3216 +--- gcc-4.0.0-100/libstdc++-v3/include/c_compatibility/wchar.h	2005-04-30 13:06:53.690054168 -0500
115.3217 ++++ gcc-4.0.0/libstdc++-v3/include/c_compatibility/wchar.h	2005-04-28 20:15:56.000000000 -0500
115.3218 +@@ -101,7 +101,9 @@
115.3219 + using std::wmemcpy;
115.3220 + using std::wmemmove;
115.3221 + using std::wmemset;
115.3222 ++#if _GLIBCXX_HAVE_WCSFTIME
115.3223 + using std::wcsftime;
115.3224 ++#endif
115.3225 + 
115.3226 + #if _GLIBCXX_USE_C99
115.3227 + using std::wcstold;
115.3228 +diff -urN gcc-4.0.0-100/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.0.0/libstdc++-v3/include/c_std/std_cwchar.h
115.3229 +--- gcc-4.0.0-100/libstdc++-v3/include/c_std/std_cwchar.h	2005-04-30 13:06:53.691054016 -0500
115.3230 ++++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cwchar.h	2005-04-28 20:15:56.000000000 -0500
115.3231 +@@ -179,7 +179,9 @@
115.3232 +   using ::wcscoll;
115.3233 +   using ::wcscpy;
115.3234 +   using ::wcscspn;
115.3235 ++#if _GLIBCXX_HAVE_WCSFTIME
115.3236 +   using ::wcsftime;
115.3237 ++#endif
115.3238 +   using ::wcslen;
115.3239 +   using ::wcsncat;
115.3240 +   using ::wcsncmp;
   116.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   116.2 +++ b/patches/gcc/4.0.3/120-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   116.3 @@ -0,0 +1,45 @@
   116.4 +--- gcc-4.0.0/libstdc++-v3/src/Makefile.am
   116.5 ++++ gcc-4.0.0/libstdc++-v3/src/Makefile.am
   116.6 +@@ -214,6 +214,10 @@
   116.7 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
   116.8 + 
   116.9 + 
  116.10 ++install-exec-local:
  116.11 ++	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  116.12 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  116.13 ++
  116.14 + # Added bits to build debug library.
  116.15 + if GLIBCXX_BUILD_DEBUG
  116.16 + all-local: build_debug
  116.17 +--- gcc-4.0.0/libstdc++-v3/src/Makefile.in
  116.18 ++++ gcc-4.0.0/libstdc++-v3/src/Makefile.in
  116.19 +@@ -625,7 +625,7 @@
  116.20 + 
  116.21 + install-data-am: install-data-local
  116.22 + 
  116.23 +-install-exec-am: install-toolexeclibLTLIBRARIES
  116.24 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  116.25 + 
  116.26 + install-info: install-info-am
  116.27 + 
  116.28 +@@ -664,7 +664,7 @@
  116.29 + 	maintainer-clean-generic mostlyclean mostlyclean-compile \
  116.30 + 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  116.31 + 	tags uninstall uninstall-am uninstall-info-am \
  116.32 +-	uninstall-toolexeclibLTLIBRARIES
  116.33 ++	uninstall-toolexeclibLTLIBRARIES install-exec-local
  116.34 + 
  116.35 + @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@libstdc++-symbol.ver:  ${glibcxx_srcdir}/$(SYMVER_MAP)
  116.36 + @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@	cp ${glibcxx_srcdir}/$(SYMVER_MAP) ./libstdc++-symbol.ver
  116.37 +@@ -743,6 +743,11 @@
  116.38 + install_debug:
  116.39 + 	(cd ${debugdir} && $(MAKE) \
  116.40 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  116.41 ++
  116.42 ++install-exec-local:
  116.43 ++	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  116.44 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  116.45 ++
  116.46 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  116.47 + # Otherwise a system limit (for SysV at least) may be exceeded.
  116.48 + .NOEXPORT:
   117.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   117.2 +++ b/patches/gcc/4.0.3/130-missing-execinfo_h.patch	Mon Jul 28 21:32:33 2008 +0000
   117.3 @@ -0,0 +1,11 @@
   117.4 +--- gcc-4.0.0/boehm-gc/include/gc.h-orig	2005-04-28 22:28:57.000000000 -0500
   117.5 ++++ gcc-4.0.0/boehm-gc/include/gc.h	2005-04-28 22:30:38.000000000 -0500
   117.6 +@@ -500,7 +500,7 @@
   117.7 + #ifdef __linux__
   117.8 + # include <features.h>
   117.9 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  117.10 +-     && !defined(__ia64__)
  117.11 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  117.12 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  117.13 + #     define GC_HAVE_BUILTIN_BACKTRACE
  117.14 + #   endif
   118.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   118.2 +++ b/patches/gcc/4.0.3/140-c99-snprintf.patch	Mon Jul 28 21:32:33 2008 +0000
   118.3 @@ -0,0 +1,11 @@
   118.4 +--- gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h-orig	2005-04-29 00:08:41.000000000 -0500
   118.5 ++++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h	2005-04-29 00:08:45.000000000 -0500
   118.6 +@@ -142,7 +142,7 @@
   118.7 +   using ::vsprintf;
   118.8 + }
   118.9 + 
  118.10 +-#if _GLIBCXX_USE_C99
  118.11 ++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  118.12 + 
  118.13 + #undef snprintf
  118.14 + #undef vfscanf
   119.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.2 +++ b/patches/gcc/4.0.3/150-c99-complex-ugly-hack.patch	Mon Jul 28 21:32:33 2008 +0000
   119.3 @@ -0,0 +1,12 @@
   119.4 +--- gcc-4.0.0/libstdc++-v3/configure-old	2005-04-30 22:04:48.061603912 -0500
   119.5 ++++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 22:06:13.678588152 -0500
   119.6 +@@ -7194,6 +7194,9 @@
   119.7 + cat >>conftest.$ac_ext <<_ACEOF
   119.8 + /* end confdefs.h.  */
   119.9 + #include <complex.h>
  119.10 ++#ifdef __UCLIBC__
  119.11 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  119.12 ++#endif
  119.13 + int
  119.14 + main ()
  119.15 + {
   120.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   120.2 +++ b/patches/gcc/4.0.3/160-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
   120.3 @@ -0,0 +1,24 @@
   120.4 +--- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps	2006-03-24 01:49:51 +0100
   120.5 ++++ gcc-4.1.0/libstdc++-v3/include/ext/rope	2006-03-24 01:49:37 +0100
   120.6 +@@ -59,6 +59,9 @@
   120.7 + #include <bits/allocator.h>
   120.8 + #include <ext/hash_fun.h>
   120.9 + 
  120.10 ++/* cope w/ index defined as macro, SuSv3 proposal */
  120.11 ++#undef index
  120.12 ++
  120.13 + # ifdef __GC
  120.14 + #   define __GC_CONST const
  120.15 + # else
  120.16 +--- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps	2006-03-24 01:50:04 +0100
  120.17 ++++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h	2006-03-24 01:50:28 +0100
  120.18 +@@ -53,6 +53,9 @@
  120.19 + #include <ext/memory> // For uninitialized_copy_n
  120.20 + #include <ext/numeric> // For power
  120.21 + 
  120.22 ++/* cope w/ index defined as macro, SuSv3 proposal */
  120.23 ++#undef index
  120.24 ++
  120.25 + namespace __gnu_cxx
  120.26 + {
  120.27 +   using std::size_t;
   121.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   121.2 +++ b/patches/gcc/4.0.3/170-sdk-libstdc++-includes.patch	Mon Jul 28 21:32:33 2008 +0000
   121.3 @@ -0,0 +1,22 @@
   121.4 +diff -urN gcc-4.0.0-100/libstdc++-v3/fragment.am gcc-4.0.0/libstdc++-v3/fragment.am
   121.5 +--- gcc-4.0.0-100/libstdc++-v3/fragment.am	2004-10-25 15:32:40.000000000 -0500
   121.6 ++++ gcc-4.0.0/libstdc++-v3/fragment.am	2005-04-28 21:48:43.000000000 -0500
   121.7 +@@ -18,5 +18,5 @@
   121.8 + 	$(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
   121.9 + 
  121.10 + # -I/-D flags to pass when compiling.
  121.11 +-AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
  121.12 ++AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
  121.13 + 
  121.14 +diff -urN gcc-4.0.0-100/libstdc++-v3/libmath/Makefile.am gcc-4.0.0/libstdc++-v3/libmath/Makefile.am
  121.15 +--- gcc-4.0.0-100/libstdc++-v3/libmath/Makefile.am	2003-08-27 16:29:42.000000000 -0500
  121.16 ++++ gcc-4.0.0/libstdc++-v3/libmath/Makefile.am	2005-04-28 21:48:43.000000000 -0500
  121.17 +@@ -32,7 +32,7 @@
  121.18 + 
  121.19 + libmath_la_SOURCES = stubs.c
  121.20 + 
  121.21 +-AM_CPPFLAGS = $(CANADIAN_INCLUDES)
  121.22 ++AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
  121.23 + 
  121.24 + # Only compiling "C" sources in this directory.
  121.25 + LIBTOOL = @LIBTOOL@ --tag CC
   122.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   122.2 +++ b/patches/gcc/4.0.3/180-arm-bigendian.patch	Mon Jul 28 21:32:33 2008 +0000
   122.3 @@ -0,0 +1,67 @@
   122.4 +By Lennert Buytenhek <buytenh@wantstofly.org>
   122.5 +Adds support for arm*b-linux* big-endian ARM targets
   122.6 +
   122.7 +See http://gcc.gnu.org/PR16350
   122.8 +
   122.9 +--- gcc-4.0.3/gcc/config/arm/linux-elf.h
  122.10 ++++ gcc-4.0.3/gcc/config/arm/linux-elf.h
  122.11 +@@ -31,19 +31,33 @@
  122.12 + /* Do not assume anything about header files.  */
  122.13 + #define NO_IMPLICIT_EXTERN_C
  122.14 + 
  122.15 ++/*
  122.16 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  122.17 ++ * (big endian) configurations.
  122.18 ++ */
  122.19 ++#if TARGET_BIG_ENDIAN_DEFAULT
  122.20 ++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
  122.21 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
  122.22 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
  122.23 ++#else
  122.24 ++#define TARGET_ENDIAN_DEFAULT 0
  122.25 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
  122.26 ++#define TARGET_LINKER_EMULATION "armelf_linux"
  122.27 ++#endif
  122.28 ++
  122.29 + #undef  TARGET_DEFAULT_FLOAT_ABI
  122.30 + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  122.31 + 
  122.32 + #undef  TARGET_DEFAULT
  122.33 +-#define TARGET_DEFAULT (0)
  122.34 ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  122.35 + 
  122.36 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  122.37 + 
  122.38 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  122.39 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  122.40 + 
  122.41 + #undef  MULTILIB_DEFAULTS
  122.42 + #define MULTILIB_DEFAULTS \
  122.43 +-	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  122.44 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  122.45 + 
  122.46 + /* The GNU C++ standard library requires that these macros be defined.  */
  122.47 + #undef CPLUSPLUS_CPP_SPEC
  122.48 +@@ -90,7 +104,7 @@
  122.49 +    %{rdynamic:-export-dynamic} \
  122.50 +    %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
  122.51 +    -X \
  122.52 +-   %{mbig-endian:-EB}" \
  122.53 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  122.54 +    SUBTARGET_EXTRA_LINK_SPEC
  122.55 + 
  122.56 + #define TARGET_OS_CPP_BUILTINS()		\
  122.57 +--- gcc-4.0.3/gcc/config.gcc
  122.58 ++++ gcc-4.0.3/gcc/config.gcc
  122.59 +@@ -672,6 +672,11 @@
  122.60 + 	;;
  122.61 + arm*-*-linux*)			# ARM GNU/Linux with ELF
  122.62 + 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
  122.63 ++	case $target in
  122.64 ++	arm*b-*)
  122.65 ++		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
  122.66 ++		;;
  122.67 ++	esac
  122.68 + 	tmake_file="${tmake_file} arm/t-arm arm/t-linux"
  122.69 + 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  122.70 + 	gnu_ld=yes
   123.1 --- a/patches/gcc/4.0.3/200-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   123.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   123.3 @@ -1,3237 +0,0 @@
   123.4 -diff -urN gcc-4.0.0-100/libstdc++-v3/acinclude.m4 gcc-4.0.0/libstdc++-v3/acinclude.m4
   123.5 ---- gcc-4.0.0-100/libstdc++-v3/acinclude.m4	2005-04-30 13:06:53.000000000 -0500
   123.6 -+++ gcc-4.0.0/libstdc++-v3/acinclude.m4	2005-04-28 20:19:01.000000000 -0500
   123.7 -@@ -1104,7 +1104,7 @@
   123.8 -   AC_MSG_CHECKING([for C locale to use])
   123.9 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  123.10 -     [use MODEL for target locale package],
  123.11 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  123.12 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  123.13 -   
  123.14 -   # If they didn't use this option switch, or if they specified --enable
  123.15 -   # with no specific model, we'll have to look for one.  If they
  123.16 -@@ -1120,6 +1120,9 @@
  123.17 -   # Default to "generic".
  123.18 -   if test $enable_clocale_flag = auto; then
  123.19 -     case ${target_os} in
  123.20 -+      *-uclibc*)
  123.21 -+        enable_clocale_flag=uclibc
  123.22 -+        ;;
  123.23 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  123.24 -         AC_EGREP_CPP([_GLIBCXX_ok], [
  123.25 -         #include <features.h>
  123.26 -@@ -1263,6 +1266,40 @@
  123.27 -       CTIME_CC=config/locale/generic/time_members.cc
  123.28 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  123.29 -       ;;
  123.30 -+    uclibc)
  123.31 -+      AC_MSG_RESULT(uclibc)
  123.32 -+
  123.33 -+      # Declare intention to use gettext, and add support for specific
  123.34 -+      # languages.
  123.35 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  123.36 -+      ALL_LINGUAS="de fr"
  123.37 -+
  123.38 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  123.39 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  123.40 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  123.41 -+        USE_NLS=yes
  123.42 -+      fi
  123.43 -+      # Export the build objects.
  123.44 -+      for ling in $ALL_LINGUAS; do \
  123.45 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  123.46 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  123.47 -+      done
  123.48 -+      AC_SUBST(glibcxx_MOFILES)
  123.49 -+      AC_SUBST(glibcxx_POFILES)
  123.50 -+
  123.51 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  123.52 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  123.53 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  123.54 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  123.55 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  123.56 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  123.57 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  123.58 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  123.59 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  123.60 -+      CTIME_H=config/locale/uclibc/time_members.h
  123.61 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  123.62 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  123.63 -+      ;;
  123.64 -   esac
  123.65 - 
  123.66 -   # This is where the testsuite looks for locale catalogs, using the
  123.67 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  123.68 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1969-12-31 18:00:00.000000000 -0600
  123.69 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2005-04-28 01:13:15.000000000 -0500
  123.70 -@@ -0,0 +1,59 @@
  123.71 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  123.72 -+
  123.73 -+// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
  123.74 -+//
  123.75 -+// This file is part of the GNU ISO C++ Library.  This library is free
  123.76 -+// software; you can redistribute it and/or modify it under the
  123.77 -+// terms of the GNU General Public License as published by the
  123.78 -+// Free Software Foundation; either version 2, or (at your option)
  123.79 -+// any later version.
  123.80 -+
  123.81 -+// This library is distributed in the hope that it will be useful,
  123.82 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  123.83 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  123.84 -+// GNU General Public License for more details.
  123.85 -+
  123.86 -+// You should have received a copy of the GNU General Public License along
  123.87 -+// with this library; see the file COPYING.  If not, write to the Free
  123.88 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  123.89 -+// USA.
  123.90 -+
  123.91 -+// As a special exception, you may use this file as part of a free software
  123.92 -+// library without restriction.  Specifically, if other files instantiate
  123.93 -+// templates or use macros or inline functions from this file, or you compile
  123.94 -+// this file and link it with other files to produce an executable, this
  123.95 -+// file does not by itself cause the resulting executable to be covered by
  123.96 -+// the GNU General Public License.  This exception does not however
  123.97 -+// invalidate any other reasons why the executable file might be covered by
  123.98 -+// the GNU General Public License.
  123.99 -+
 123.100 -+// Written by Jakub Jelinek <jakub@redhat.com>
 123.101 -+
 123.102 -+#include <clocale>
 123.103 -+
 123.104 -+#ifdef __UCLIBC_MJN3_ONLY__
 123.105 -+#warning clean this up
 123.106 -+#endif
 123.107 -+
 123.108 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.109 -+                                                  
 123.110 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 123.111 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 123.112 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 123.113 -+extern "C" __typeof(strftime_l) __strftime_l;
 123.114 -+extern "C" __typeof(strtod_l) __strtod_l;
 123.115 -+extern "C" __typeof(strtof_l) __strtof_l;
 123.116 -+extern "C" __typeof(strtold_l) __strtold_l;
 123.117 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 123.118 -+extern "C" __typeof(towlower_l) __towlower_l;
 123.119 -+extern "C" __typeof(towupper_l) __towupper_l;
 123.120 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 123.121 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 123.122 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 123.123 -+extern "C" __typeof(wctype_l) __wctype_l;
 123.124 -+extern "C" __typeof(newlocale) __newlocale;
 123.125 -+extern "C" __typeof(freelocale) __freelocale;
 123.126 -+extern "C" __typeof(duplocale) __duplocale;
 123.127 -+extern "C" __typeof(uselocale) __uselocale;
 123.128 -+
 123.129 -+#endif // GLIBC 2.3 and later
 123.130 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
 123.131 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.cc	1969-12-31 18:00:00.000000000 -0600
 123.132 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2005-04-28 01:13:15.000000000 -0500
 123.133 -@@ -0,0 +1,160 @@
 123.134 -+// Wrapper for underlying C-language localization -*- C++ -*-
 123.135 -+
 123.136 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 123.137 -+//
 123.138 -+// This file is part of the GNU ISO C++ Library.  This library is free
 123.139 -+// software; you can redistribute it and/or modify it under the
 123.140 -+// terms of the GNU General Public License as published by the
 123.141 -+// Free Software Foundation; either version 2, or (at your option)
 123.142 -+// any later version.
 123.143 -+
 123.144 -+// This library is distributed in the hope that it will be useful,
 123.145 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 123.146 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 123.147 -+// GNU General Public License for more details.
 123.148 -+
 123.149 -+// You should have received a copy of the GNU General Public License along
 123.150 -+// with this library; see the file COPYING.  If not, write to the Free
 123.151 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 123.152 -+// USA.
 123.153 -+
 123.154 -+// As a special exception, you may use this file as part of a free software
 123.155 -+// library without restriction.  Specifically, if other files instantiate
 123.156 -+// templates or use macros or inline functions from this file, or you compile
 123.157 -+// this file and link it with other files to produce an executable, this
 123.158 -+// file does not by itself cause the resulting executable to be covered by
 123.159 -+// the GNU General Public License.  This exception does not however
 123.160 -+// invalidate any other reasons why the executable file might be covered by
 123.161 -+// the GNU General Public License.
 123.162 -+
 123.163 -+//
 123.164 -+// ISO C++ 14882: 22.8  Standard locale categories.
 123.165 -+//
 123.166 -+
 123.167 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 123.168 -+
 123.169 -+#include <cerrno>  // For errno
 123.170 -+#include <locale>
 123.171 -+#include <stdexcept>
 123.172 -+#include <langinfo.h>
 123.173 -+#include <bits/c++locale_internal.h>
 123.174 -+
 123.175 -+#ifndef __UCLIBC_HAS_XLOCALE__
 123.176 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 123.177 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 123.178 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 123.179 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 123.180 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 123.181 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 123.182 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 123.183 -+#warning should dummy __newlocale check for C|POSIX ?
 123.184 -+#define __newlocale(a, b, c)        NULL
 123.185 -+#define __freelocale(a)             ((void)0)
 123.186 -+#define __duplocale(a)              __c_locale()
 123.187 -+#endif
 123.188 -+
 123.189 -+namespace std 
 123.190 -+{
 123.191 -+  template<>
 123.192 -+    void
 123.193 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 123.194 -+		   const __c_locale& __cloc)
 123.195 -+    {
 123.196 -+      if (!(__err & ios_base::failbit))
 123.197 -+	{
 123.198 -+	  char* __sanity;
 123.199 -+	  errno = 0;
 123.200 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
 123.201 -+          if (__sanity != __s && errno != ERANGE)
 123.202 -+	    __v = __f;
 123.203 -+	  else
 123.204 -+	    __err |= ios_base::failbit;
 123.205 -+	}
 123.206 -+    }
 123.207 -+
 123.208 -+  template<>
 123.209 -+    void
 123.210 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 123.211 -+		   const __c_locale& __cloc)
 123.212 -+    {
 123.213 -+      if (!(__err & ios_base::failbit))
 123.214 -+	{
 123.215 -+	  char* __sanity;
 123.216 -+	  errno = 0;
 123.217 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
 123.218 -+          if (__sanity != __s && errno != ERANGE)
 123.219 -+	    __v = __d;
 123.220 -+	  else
 123.221 -+	    __err |= ios_base::failbit;
 123.222 -+	}
 123.223 -+    }
 123.224 -+
 123.225 -+  template<>
 123.226 -+    void
 123.227 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 123.228 -+		   const __c_locale& __cloc)
 123.229 -+    {
 123.230 -+      if (!(__err & ios_base::failbit))
 123.231 -+	{
 123.232 -+	  char* __sanity;
 123.233 -+	  errno = 0;
 123.234 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 123.235 -+          if (__sanity != __s && errno != ERANGE)
 123.236 -+	    __v = __ld;
 123.237 -+	  else
 123.238 -+	    __err |= ios_base::failbit;
 123.239 -+	}
 123.240 -+    }
 123.241 -+
 123.242 -+  void
 123.243 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 123.244 -+				    __c_locale __old)
 123.245 -+  {
 123.246 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 123.247 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.248 -+    if (!__cloc)
 123.249 -+      {
 123.250 -+	// This named locale is not supported by the underlying OS.
 123.251 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 123.252 -+			      "name not valid"));
 123.253 -+      }
 123.254 -+#endif
 123.255 -+  }
 123.256 -+  
 123.257 -+  void
 123.258 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 123.259 -+  {
 123.260 -+    if (_S_get_c_locale() != __cloc)
 123.261 -+      __freelocale(__cloc); 
 123.262 -+  }
 123.263 -+
 123.264 -+  __c_locale
 123.265 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 123.266 -+  { return __duplocale(__cloc); }
 123.267 -+} // namespace std
 123.268 -+
 123.269 -+namespace __gnu_cxx
 123.270 -+{
 123.271 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 123.272 -+    {
 123.273 -+      "LC_CTYPE", 
 123.274 -+      "LC_NUMERIC",
 123.275 -+      "LC_TIME", 
 123.276 -+      "LC_COLLATE", 
 123.277 -+      "LC_MONETARY",
 123.278 -+      "LC_MESSAGES", 
 123.279 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 123.280 -+      "LC_PAPER", 
 123.281 -+      "LC_NAME", 
 123.282 -+      "LC_ADDRESS",
 123.283 -+      "LC_TELEPHONE", 
 123.284 -+      "LC_MEASUREMENT", 
 123.285 -+      "LC_IDENTIFICATION" 
 123.286 -+#endif
 123.287 -+    };
 123.288 -+}
 123.289 -+
 123.290 -+namespace std
 123.291 -+{
 123.292 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 123.293 -+}  // namespace std
 123.294 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.h
 123.295 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.h	1969-12-31 18:00:00.000000000 -0600
 123.296 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2005-04-28 01:13:15.000000000 -0500
 123.297 -@@ -0,0 +1,115 @@
 123.298 -+// Wrapper for underlying C-language localization -*- C++ -*-
 123.299 -+
 123.300 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 123.301 -+//
 123.302 -+// This file is part of the GNU ISO C++ Library.  This library is free
 123.303 -+// software; you can redistribute it and/or modify it under the
 123.304 -+// terms of the GNU General Public License as published by the
 123.305 -+// Free Software Foundation; either version 2, or (at your option)
 123.306 -+// any later version.
 123.307 -+
 123.308 -+// This library is distributed in the hope that it will be useful,
 123.309 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 123.310 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 123.311 -+// GNU General Public License for more details.
 123.312 -+
 123.313 -+// You should have received a copy of the GNU General Public License along
 123.314 -+// with this library; see the file COPYING.  If not, write to the Free
 123.315 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 123.316 -+// USA.
 123.317 -+
 123.318 -+// As a special exception, you may use this file as part of a free software
 123.319 -+// library without restriction.  Specifically, if other files instantiate
 123.320 -+// templates or use macros or inline functions from this file, or you compile
 123.321 -+// this file and link it with other files to produce an executable, this
 123.322 -+// file does not by itself cause the resulting executable to be covered by
 123.323 -+// the GNU General Public License.  This exception does not however
 123.324 -+// invalidate any other reasons why the executable file might be covered by
 123.325 -+// the GNU General Public License.
 123.326 -+
 123.327 -+//
 123.328 -+// ISO C++ 14882: 22.8  Standard locale categories.
 123.329 -+//
 123.330 -+
 123.331 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 123.332 -+
 123.333 -+#ifndef _C_LOCALE_H
 123.334 -+#define _C_LOCALE_H 1
 123.335 -+
 123.336 -+#pragma GCC system_header
 123.337 -+
 123.338 -+#include <cstring>              // get std::strlen
 123.339 -+#include <cstdio>               // get std::snprintf or std::sprintf
 123.340 -+#include <clocale>
 123.341 -+#include <langinfo.h>		// For codecvt
 123.342 -+#ifdef __UCLIBC_MJN3_ONLY__
 123.343 -+#warning fix this
 123.344 -+#endif
 123.345 -+#ifdef __UCLIBC_HAS_LOCALE__
 123.346 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 123.347 -+#endif
 123.348 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 123.349 -+#include <libintl.h> 		// For messages
 123.350 -+#endif
 123.351 -+
 123.352 -+#ifdef __UCLIBC_MJN3_ONLY__
 123.353 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 123.354 -+#endif
 123.355 -+#define _GLIBCXX_C_LOCALE_GNU 1
 123.356 -+
 123.357 -+#ifdef __UCLIBC_MJN3_ONLY__
 123.358 -+#warning fix categories
 123.359 -+#endif
 123.360 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 123.361 -+#define _GLIBCXX_NUM_CATEGORIES 0
 123.362 -+ 
 123.363 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.364 -+namespace __gnu_cxx
 123.365 -+{
 123.366 -+  extern "C" __typeof(uselocale) __uselocale;
 123.367 -+}
 123.368 -+#endif
 123.369 -+
 123.370 -+namespace std
 123.371 -+{
 123.372 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.373 -+  typedef __locale_t		__c_locale;
 123.374 -+#else
 123.375 -+  typedef int*			__c_locale;
 123.376 -+#endif
 123.377 -+
 123.378 -+  // Convert numeric value of type _Tv to string and return length of
 123.379 -+  // string.  If snprintf is available use it, otherwise fall back to
 123.380 -+  // the unsafe sprintf which, in general, can be dangerous and should
 123.381 -+  // be avoided.
 123.382 -+  template<typename _Tv>
 123.383 -+    int
 123.384 -+    __convert_from_v(char* __out, const int __size, const char* __fmt,
 123.385 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.386 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 123.387 -+    {
 123.388 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 123.389 -+#else
 123.390 -+		     _Tv __v, const __c_locale&, int __prec)
 123.391 -+    {
 123.392 -+# ifdef __UCLIBC_HAS_LOCALE__
 123.393 -+      char* __old = std::setlocale(LC_ALL, NULL);
 123.394 -+      char* __sav = new char[std::strlen(__old) + 1];
 123.395 -+      std::strcpy(__sav, __old);
 123.396 -+      std::setlocale(LC_ALL, "C");
 123.397 -+# endif
 123.398 -+#endif
 123.399 -+
 123.400 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 123.401 -+
 123.402 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.403 -+      __gnu_cxx::__uselocale(__old);
 123.404 -+#elif defined __UCLIBC_HAS_LOCALE__
 123.405 -+      std::setlocale(LC_ALL, __sav);
 123.406 -+      delete [] __sav;
 123.407 -+#endif
 123.408 -+      return __ret;
 123.409 -+    }
 123.410 -+}
 123.411 -+
 123.412 -+#endif
 123.413 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 123.414 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1969-12-31 18:00:00.000000000 -0600
 123.415 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2005-04-28 01:13:15.000000000 -0500
 123.416 -@@ -0,0 +1,306 @@
 123.417 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 123.418 -+
 123.419 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 123.420 -+//
 123.421 -+// This file is part of the GNU ISO C++ Library.  This library is free
 123.422 -+// software; you can redistribute it and/or modify it under the
 123.423 -+// terms of the GNU General Public License as published by the
 123.424 -+// Free Software Foundation; either version 2, or (at your option)
 123.425 -+// any later version.
 123.426 -+
 123.427 -+// This library is distributed in the hope that it will be useful,
 123.428 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 123.429 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 123.430 -+// GNU General Public License for more details.
 123.431 -+
 123.432 -+// You should have received a copy of the GNU General Public License along
 123.433 -+// with this library; see the file COPYING.  If not, write to the Free
 123.434 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 123.435 -+// USA.
 123.436 -+
 123.437 -+// As a special exception, you may use this file as part of a free software
 123.438 -+// library without restriction.  Specifically, if other files instantiate
 123.439 -+// templates or use macros or inline functions from this file, or you compile
 123.440 -+// this file and link it with other files to produce an executable, this
 123.441 -+// file does not by itself cause the resulting executable to be covered by
 123.442 -+// the GNU General Public License.  This exception does not however
 123.443 -+// invalidate any other reasons why the executable file might be covered by
 123.444 -+// the GNU General Public License.
 123.445 -+
 123.446 -+//
 123.447 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 123.448 -+//
 123.449 -+
 123.450 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 123.451 -+
 123.452 -+#include <locale>
 123.453 -+#include <bits/c++locale_internal.h>
 123.454 -+
 123.455 -+namespace std
 123.456 -+{
 123.457 -+  // Specializations.
 123.458 -+#ifdef _GLIBCXX_USE_WCHAR_T
 123.459 -+  codecvt_base::result
 123.460 -+  codecvt<wchar_t, char, mbstate_t>::
 123.461 -+  do_out(state_type& __state, const intern_type* __from, 
 123.462 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 123.463 -+	 extern_type* __to, extern_type* __to_end,
 123.464 -+	 extern_type*& __to_next) const
 123.465 -+  {
 123.466 -+    result __ret = ok;
 123.467 -+    state_type __tmp_state(__state);
 123.468 -+
 123.469 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.470 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 123.471 -+#endif
 123.472 -+
 123.473 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 123.474 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 123.475 -+    // NB: wcsnrtombs is a GNU extension
 123.476 -+    for (__from_next = __from, __to_next = __to;
 123.477 -+	 __from_next < __from_end && __to_next < __to_end
 123.478 -+	 && __ret == ok;)
 123.479 -+      {
 123.480 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 123.481 -+						      __from_end - __from_next);
 123.482 -+	if (!__from_chunk_end)
 123.483 -+	  __from_chunk_end = __from_end;
 123.484 -+
 123.485 -+	__from = __from_next;
 123.486 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 123.487 -+					 __from_chunk_end - __from_next,
 123.488 -+					 __to_end - __to_next, &__state);
 123.489 -+	if (__conv == static_cast<size_t>(-1))
 123.490 -+	  {
 123.491 -+	    // In case of error, in order to stop at the exact place we
 123.492 -+	    // have to start again from the beginning with a series of
 123.493 -+	    // wcrtomb.
 123.494 -+	    for (; __from < __from_next; ++__from)
 123.495 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 123.496 -+	    __state = __tmp_state;
 123.497 -+	    __ret = error;
 123.498 -+	  }
 123.499 -+	else if (__from_next && __from_next < __from_chunk_end)
 123.500 -+	  {
 123.501 -+	    __to_next += __conv;
 123.502 -+	    __ret = partial;
 123.503 -+	  }
 123.504 -+	else
 123.505 -+	  {
 123.506 -+	    __from_next = __from_chunk_end;
 123.507 -+	    __to_next += __conv;
 123.508 -+	  }
 123.509 -+
 123.510 -+	if (__from_next < __from_end && __ret == ok)
 123.511 -+	  {
 123.512 -+	    extern_type __buf[MB_LEN_MAX];
 123.513 -+	    __tmp_state = __state;
 123.514 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 123.515 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 123.516 -+	      __ret = partial;
 123.517 -+	    else
 123.518 -+	      {
 123.519 -+		memcpy(__to_next, __buf, __conv);
 123.520 -+		__state = __tmp_state;
 123.521 -+		__to_next += __conv;
 123.522 -+		++__from_next;
 123.523 -+	      }
 123.524 -+	  }
 123.525 -+      }
 123.526 -+
 123.527 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.528 -+    __uselocale(__old);
 123.529 -+#endif
 123.530 -+
 123.531 -+    return __ret; 
 123.532 -+  }
 123.533 -+  
 123.534 -+  codecvt_base::result
 123.535 -+  codecvt<wchar_t, char, mbstate_t>::
 123.536 -+  do_in(state_type& __state, const extern_type* __from, 
 123.537 -+	const extern_type* __from_end, const extern_type*& __from_next,
 123.538 -+	intern_type* __to, intern_type* __to_end,
 123.539 -+	intern_type*& __to_next) const
 123.540 -+  {
 123.541 -+    result __ret = ok;
 123.542 -+    state_type __tmp_state(__state);
 123.543 -+
 123.544 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.545 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 123.546 -+#endif
 123.547 -+
 123.548 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 123.549 -+    // in case we store a L'\0' and then continue, in a loop.
 123.550 -+    // NB: mbsnrtowcs is a GNU extension
 123.551 -+    for (__from_next = __from, __to_next = __to;
 123.552 -+	 __from_next < __from_end && __to_next < __to_end
 123.553 -+	 && __ret == ok;)
 123.554 -+      {
 123.555 -+	const extern_type* __from_chunk_end;
 123.556 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 123.557 -+								  __from_end
 123.558 -+								  - __from_next));
 123.559 -+	if (!__from_chunk_end)
 123.560 -+	  __from_chunk_end = __from_end;
 123.561 -+
 123.562 -+	__from = __from_next;
 123.563 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 123.564 -+				   __from_chunk_end - __from_next,
 123.565 -+				   __to_end - __to_next, &__state);
 123.566 -+	if (__conv == static_cast<size_t>(-1))
 123.567 -+	  {
 123.568 -+	    // In case of error, in order to stop at the exact place we
 123.569 -+	    // have to start again from the beginning with a series of
 123.570 -+	    // mbrtowc.
 123.571 -+	    for (;; ++__to_next, __from += __conv)
 123.572 -+	      {
 123.573 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 123.574 -+				 &__tmp_state);
 123.575 -+		if (__conv == static_cast<size_t>(-1)
 123.576 -+		    || __conv == static_cast<size_t>(-2))
 123.577 -+		  break;
 123.578 -+	      }
 123.579 -+	    __from_next = __from;
 123.580 -+	    __state = __tmp_state;	    
 123.581 -+	    __ret = error;
 123.582 -+	  }
 123.583 -+	else if (__from_next && __from_next < __from_chunk_end)
 123.584 -+	  {
 123.585 -+	    // It is unclear what to return in this case (see DR 382). 
 123.586 -+	    __to_next += __conv;
 123.587 -+	    __ret = partial;
 123.588 -+	  }
 123.589 -+	else
 123.590 -+	  {
 123.591 -+	    __from_next = __from_chunk_end;
 123.592 -+	    __to_next += __conv;
 123.593 -+	  }
 123.594 -+
 123.595 -+	if (__from_next < __from_end && __ret == ok)
 123.596 -+	  {
 123.597 -+	    if (__to_next < __to_end)
 123.598 -+	      {
 123.599 -+		// XXX Probably wrong for stateful encodings
 123.600 -+		__tmp_state = __state;		
 123.601 -+		++__from_next;
 123.602 -+		*__to_next++ = L'\0';
 123.603 -+	      }
 123.604 -+	    else
 123.605 -+	      __ret = partial;
 123.606 -+	  }
 123.607 -+      }
 123.608 -+
 123.609 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.610 -+    __uselocale(__old);
 123.611 -+#endif
 123.612 -+
 123.613 -+    return __ret; 
 123.614 -+  }
 123.615 -+
 123.616 -+  int 
 123.617 -+  codecvt<wchar_t, char, mbstate_t>::
 123.618 -+  do_encoding() const throw()
 123.619 -+  {
 123.620 -+    // XXX This implementation assumes that the encoding is
 123.621 -+    // stateless and is either single-byte or variable-width.
 123.622 -+    int __ret = 0;
 123.623 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.624 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 123.625 -+#endif
 123.626 -+    if (MB_CUR_MAX == 1)
 123.627 -+      __ret = 1;
 123.628 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.629 -+    __uselocale(__old);
 123.630 -+#endif
 123.631 -+    return __ret;
 123.632 -+  }  
 123.633 -+
 123.634 -+  int 
 123.635 -+  codecvt<wchar_t, char, mbstate_t>::
 123.636 -+  do_max_length() const throw()
 123.637 -+  {
 123.638 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.639 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 123.640 -+#endif
 123.641 -+    // XXX Probably wrong for stateful encodings.
 123.642 -+    int __ret = MB_CUR_MAX;
 123.643 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.644 -+    __uselocale(__old);
 123.645 -+#endif
 123.646 -+    return __ret;
 123.647 -+  }
 123.648 -+  
 123.649 -+  int 
 123.650 -+  codecvt<wchar_t, char, mbstate_t>::
 123.651 -+  do_length(state_type& __state, const extern_type* __from,
 123.652 -+	    const extern_type* __end, size_t __max) const
 123.653 -+  {
 123.654 -+    int __ret = 0;
 123.655 -+    state_type __tmp_state(__state);
 123.656 -+
 123.657 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.658 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 123.659 -+#endif
 123.660 -+
 123.661 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 123.662 -+    // in case we advance past it and then continue, in a loop.
 123.663 -+    // NB: mbsnrtowcs is a GNU extension
 123.664 -+  
 123.665 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 123.666 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 123.667 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 123.668 -+							   * __max));
 123.669 -+    while (__from < __end && __max)
 123.670 -+      {
 123.671 -+	const extern_type* __from_chunk_end;
 123.672 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 123.673 -+								  __end
 123.674 -+								  - __from));
 123.675 -+	if (!__from_chunk_end)
 123.676 -+	  __from_chunk_end = __end;
 123.677 -+
 123.678 -+	const extern_type* __tmp_from = __from;
 123.679 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 123.680 -+				   __from_chunk_end - __from,
 123.681 -+				   __max, &__state);
 123.682 -+	if (__conv == static_cast<size_t>(-1))
 123.683 -+	  {
 123.684 -+	    // In case of error, in order to stop at the exact place we
 123.685 -+	    // have to start again from the beginning with a series of
 123.686 -+	    // mbrtowc.
 123.687 -+	    for (__from = __tmp_from;; __from += __conv)
 123.688 -+	      {
 123.689 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 123.690 -+				 &__tmp_state);
 123.691 -+		if (__conv == static_cast<size_t>(-1)
 123.692 -+		    || __conv == static_cast<size_t>(-2))
 123.693 -+		  break;
 123.694 -+	      }
 123.695 -+	    __state = __tmp_state;
 123.696 -+	    __ret += __from - __tmp_from;
 123.697 -+	    break;
 123.698 -+	  }
 123.699 -+	if (!__from)
 123.700 -+	  __from = __from_chunk_end;
 123.701 -+	
 123.702 -+	__ret += __from - __tmp_from;
 123.703 -+	__max -= __conv;
 123.704 -+
 123.705 -+	if (__from < __end && __max)
 123.706 -+	  {
 123.707 -+	    // XXX Probably wrong for stateful encodings
 123.708 -+	    __tmp_state = __state;
 123.709 -+	    ++__from;
 123.710 -+	    ++__ret;
 123.711 -+	    --__max;
 123.712 -+	  }
 123.713 -+      }
 123.714 -+
 123.715 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.716 -+    __uselocale(__old);
 123.717 -+#endif
 123.718 -+
 123.719 -+    return __ret; 
 123.720 -+  }
 123.721 -+#endif
 123.722 -+}
 123.723 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
 123.724 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/collate_members.cc	1969-12-31 18:00:00.000000000 -0600
 123.725 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2005-04-28 01:13:15.000000000 -0500
 123.726 -@@ -0,0 +1,80 @@
 123.727 -+// std::collate implementation details, GNU version -*- C++ -*-
 123.728 -+
 123.729 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 123.730 -+//
 123.731 -+// This file is part of the GNU ISO C++ Library.  This library is free
 123.732 -+// software; you can redistribute it and/or modify it under the
 123.733 -+// terms of the GNU General Public License as published by the
 123.734 -+// Free Software Foundation; either version 2, or (at your option)
 123.735 -+// any later version.
 123.736 -+
 123.737 -+// This library is distributed in the hope that it will be useful,
 123.738 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 123.739 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 123.740 -+// GNU General Public License for more details.
 123.741 -+
 123.742 -+// You should have received a copy of the GNU General Public License along
 123.743 -+// with this library; see the file COPYING.  If not, write to the Free
 123.744 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 123.745 -+// USA.
 123.746 -+
 123.747 -+// As a special exception, you may use this file as part of a free software
 123.748 -+// library without restriction.  Specifically, if other files instantiate
 123.749 -+// templates or use macros or inline functions from this file, or you compile
 123.750 -+// this file and link it with other files to produce an executable, this
 123.751 -+// file does not by itself cause the resulting executable to be covered by
 123.752 -+// the GNU General Public License.  This exception does not however
 123.753 -+// invalidate any other reasons why the executable file might be covered by
 123.754 -+// the GNU General Public License.
 123.755 -+
 123.756 -+//
 123.757 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 123.758 -+//
 123.759 -+
 123.760 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 123.761 -+
 123.762 -+#include <locale>
 123.763 -+#include <bits/c++locale_internal.h>
 123.764 -+
 123.765 -+#ifndef __UCLIBC_HAS_XLOCALE__
 123.766 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 123.767 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 123.768 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 123.769 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 123.770 -+#endif
 123.771 -+
 123.772 -+namespace std
 123.773 -+{
 123.774 -+  // These are basically extensions to char_traits, and perhaps should
 123.775 -+  // be put there instead of here.
 123.776 -+  template<>
 123.777 -+    int 
 123.778 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 123.779 -+    { 
 123.780 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 123.781 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 123.782 -+    }
 123.783 -+  
 123.784 -+  template<>
 123.785 -+    size_t
 123.786 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 123.787 -+				size_t __n) const 
 123.788 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 123.789 -+
 123.790 -+#ifdef _GLIBCXX_USE_WCHAR_T
 123.791 -+  template<>
 123.792 -+    int 
 123.793 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 123.794 -+				 const wchar_t* __two) const
 123.795 -+    {
 123.796 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 123.797 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 123.798 -+    }
 123.799 -+  
 123.800 -+  template<>
 123.801 -+    size_t
 123.802 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 123.803 -+				   size_t __n) const
 123.804 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 123.805 -+#endif
 123.806 -+}
 123.807 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 123.808 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1969-12-31 18:00:00.000000000 -0600
 123.809 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2005-04-28 01:13:15.000000000 -0500
 123.810 -@@ -0,0 +1,300 @@
 123.811 -+// std::ctype implementation details, GNU version -*- C++ -*-
 123.812 -+
 123.813 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 123.814 -+//
 123.815 -+// This file is part of the GNU ISO C++ Library.  This library is free
 123.816 -+// software; you can redistribute it and/or modify it under the
 123.817 -+// terms of the GNU General Public License as published by the
 123.818 -+// Free Software Foundation; either version 2, or (at your option)
 123.819 -+// any later version.
 123.820 -+
 123.821 -+// This library is distributed in the hope that it will be useful,
 123.822 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 123.823 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 123.824 -+// GNU General Public License for more details.
 123.825 -+
 123.826 -+// You should have received a copy of the GNU General Public License along
 123.827 -+// with this library; see the file COPYING.  If not, write to the Free
 123.828 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 123.829 -+// USA.
 123.830 -+
 123.831 -+// As a special exception, you may use this file as part of a free software
 123.832 -+// library without restriction.  Specifically, if other files instantiate
 123.833 -+// templates or use macros or inline functions from this file, or you compile
 123.834 -+// this file and link it with other files to produce an executable, this
 123.835 -+// file does not by itself cause the resulting executable to be covered by
 123.836 -+// the GNU General Public License.  This exception does not however
 123.837 -+// invalidate any other reasons why the executable file might be covered by
 123.838 -+// the GNU General Public License.
 123.839 -+
 123.840 -+//
 123.841 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 123.842 -+//
 123.843 -+
 123.844 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 123.845 -+
 123.846 -+#define _LIBC
 123.847 -+#include <locale>
 123.848 -+#undef _LIBC
 123.849 -+#include <bits/c++locale_internal.h>
 123.850 -+
 123.851 -+#ifndef __UCLIBC_HAS_XLOCALE__
 123.852 -+#define __wctype_l(S, L)           wctype((S))
 123.853 -+#define __towupper_l(C, L)         towupper((C))
 123.854 -+#define __towlower_l(C, L)         towlower((C))
 123.855 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 123.856 -+#endif
 123.857 -+
 123.858 -+namespace std
 123.859 -+{
 123.860 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 123.861 -+  // various /config/os/* files.
 123.862 -+  template<>
 123.863 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 123.864 -+    : ctype<char>(0, false, __refs) 
 123.865 -+    { 		
 123.866 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 123.867 -+	{
 123.868 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 123.869 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 123.870 -+#ifdef __UCLIBC_HAS_XLOCALE__
 123.871 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 123.872 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 123.873 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 123.874 -+#endif
 123.875 -+	}
 123.876 -+    }
 123.877 -+
 123.878 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 123.879 -+  ctype<wchar_t>::__wmask_type
 123.880 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 123.881 -+  {
 123.882 -+    __wmask_type __ret;
 123.883 -+    switch (__m)
 123.884 -+      {
 123.885 -+      case space:
 123.886 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 123.887 -+	break;
 123.888 -+      case print:
 123.889 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 123.890 -+	break;
 123.891 -+      case cntrl:
 123.892 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 123.893 -+	break;
 123.894 -+      case upper:
 123.895 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 123.896 -+	break;
 123.897 -+      case lower:
 123.898 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 123.899 -+	break;
 123.900 -+      case alpha:
 123.901 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 123.902 -+	break;
 123.903 -+      case digit:
 123.904 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 123.905 -+	break;
 123.906 -+      case punct:
 123.907 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 123.908 -+	break;
 123.909 -+      case xdigit:
 123.910 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 123.911 -+	break;
 123.912 -+      case alnum:
 123.913 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 123.914 -+	break;
 123.915 -+      case graph:
 123.916 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 123.917 -+	break;
 123.918 -+      default:
 123.919 -+	__ret = __wmask_type();
 123.920 -+      }
 123.921 -+    return __ret;
 123.922 -+  }
 123.923 -+  
 123.924 -+  wchar_t
 123.925 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 123.926 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 123.927 -+
 123.928 -+  const wchar_t*
 123.929 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 123.930 -+  {
 123.931 -+    while (__lo < __hi)
 123.932 -+      {
 123.933 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 123.934 -+        ++__lo;
 123.935 -+      }
 123.936 -+    return __hi;
 123.937 -+  }
 123.938 -+  
 123.939 -+  wchar_t
 123.940 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 123.941 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 123.942 -+  
 123.943 -+  const wchar_t*
 123.944 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 123.945 -+  {
 123.946 -+    while (__lo < __hi)
 123.947 -+      {
 123.948 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 123.949 -+        ++__lo;
 123.950 -+      }
 123.951 -+    return __hi;
 123.952 -+  }
 123.953 -+
 123.954 -+  bool
 123.955 -+  ctype<wchar_t>::
 123.956 -+  do_is(mask __m, wchar_t __c) const
 123.957 -+  { 
 123.958 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
 123.959 -+    // library for blank.
 123.960 -+    bool __ret = false;
 123.961 -+    const size_t __bitmasksize = 11; 
 123.962 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 123.963 -+      if (__m & _M_bit[__bitcur]
 123.964 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 123.965 -+	{
 123.966 -+	  __ret = true;
 123.967 -+	  break;
 123.968 -+	}
 123.969 -+    return __ret;    
 123.970 -+  }
 123.971 -+  
 123.972 -+  const wchar_t* 
 123.973 -+  ctype<wchar_t>::
 123.974 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 123.975 -+  {
 123.976 -+    for (; __lo < __hi; ++__vec, ++__lo)
 123.977 -+      {
 123.978 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 123.979 -+	// library for blank.
 123.980 -+	const size_t __bitmasksize = 11; 
 123.981 -+	mask __m = 0;
 123.982 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 123.983 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 123.984 -+	    __m |= _M_bit[__bitcur];
 123.985 -+	*__vec = __m;
 123.986 -+      }
 123.987 -+    return __hi;
 123.988 -+  }
 123.989 -+  
 123.990 -+  const wchar_t* 
 123.991 -+  ctype<wchar_t>::
 123.992 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 123.993 -+  {
 123.994 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
 123.995 -+      ++__lo;
 123.996 -+    return __lo;
 123.997 -+  }
 123.998 -+
 123.999 -+  const wchar_t*
123.1000 -+  ctype<wchar_t>::
123.1001 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
123.1002 -+  {
123.1003 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
123.1004 -+      ++__lo;
123.1005 -+    return __lo;
123.1006 -+  }
123.1007 -+
123.1008 -+  wchar_t
123.1009 -+  ctype<wchar_t>::
123.1010 -+  do_widen(char __c) const
123.1011 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
123.1012 -+
123.1013 -+  const char* 
123.1014 -+  ctype<wchar_t>::
123.1015 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
123.1016 -+  {
123.1017 -+    while (__lo < __hi)
123.1018 -+      {
123.1019 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
123.1020 -+	++__lo;
123.1021 -+	++__dest;
123.1022 -+      }
123.1023 -+    return __hi;
123.1024 -+  }
123.1025 -+
123.1026 -+  char
123.1027 -+  ctype<wchar_t>::
123.1028 -+  do_narrow(wchar_t __wc, char __dfault) const
123.1029 -+  {
123.1030 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
123.1031 -+      return _M_narrow[__wc];
123.1032 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1033 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
123.1034 -+#endif
123.1035 -+    const int __c = wctob(__wc);
123.1036 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1037 -+    __uselocale(__old);
123.1038 -+#endif
123.1039 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
123.1040 -+  }
123.1041 -+
123.1042 -+  const wchar_t*
123.1043 -+  ctype<wchar_t>::
123.1044 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
123.1045 -+	    char* __dest) const
123.1046 -+  {
123.1047 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1048 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
123.1049 -+#endif
123.1050 -+    if (_M_narrow_ok)
123.1051 -+      while (__lo < __hi)
123.1052 -+	{
123.1053 -+	  if (*__lo >= 0 && *__lo < 128)
123.1054 -+	    *__dest = _M_narrow[*__lo];
123.1055 -+	  else
123.1056 -+	    {
123.1057 -+	      const int __c = wctob(*__lo);
123.1058 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
123.1059 -+	    }
123.1060 -+	  ++__lo;
123.1061 -+	  ++__dest;
123.1062 -+	}
123.1063 -+    else
123.1064 -+      while (__lo < __hi)
123.1065 -+	{
123.1066 -+	  const int __c = wctob(*__lo);
123.1067 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
123.1068 -+	  ++__lo;
123.1069 -+	  ++__dest;
123.1070 -+	}
123.1071 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1072 -+    __uselocale(__old);
123.1073 -+#endif
123.1074 -+    return __hi;
123.1075 -+  }
123.1076 -+
123.1077 -+  void
123.1078 -+  ctype<wchar_t>::_M_initialize_ctype()
123.1079 -+  {
123.1080 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1081 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
123.1082 -+#endif
123.1083 -+    wint_t __i;
123.1084 -+    for (__i = 0; __i < 128; ++__i)
123.1085 -+      {
123.1086 -+	const int __c = wctob(__i);
123.1087 -+	if (__c == EOF)
123.1088 -+	  break;
123.1089 -+	else
123.1090 -+	  _M_narrow[__i] = static_cast<char>(__c);
123.1091 -+      }
123.1092 -+    if (__i == 128)
123.1093 -+      _M_narrow_ok = true;
123.1094 -+    else
123.1095 -+      _M_narrow_ok = false;
123.1096 -+    for (size_t __j = 0;
123.1097 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
123.1098 -+      _M_widen[__j] = btowc(__j);
123.1099 -+
123.1100 -+    for (size_t __k = 0; __k <= 11; ++__k)
123.1101 -+      { 
123.1102 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
123.1103 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
123.1104 -+      }
123.1105 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1106 -+    __uselocale(__old);
123.1107 -+#endif
123.1108 -+  }
123.1109 -+#endif //  _GLIBCXX_USE_WCHAR_T
123.1110 -+}
123.1111 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
123.1112 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.cc	1969-12-31 18:00:00.000000000 -0600
123.1113 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2005-04-28 01:13:15.000000000 -0500
123.1114 -@@ -0,0 +1,100 @@
123.1115 -+// std::messages implementation details, GNU version -*- C++ -*-
123.1116 -+
123.1117 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
123.1118 -+//
123.1119 -+// This file is part of the GNU ISO C++ Library.  This library is free
123.1120 -+// software; you can redistribute it and/or modify it under the
123.1121 -+// terms of the GNU General Public License as published by the
123.1122 -+// Free Software Foundation; either version 2, or (at your option)
123.1123 -+// any later version.
123.1124 -+
123.1125 -+// This library is distributed in the hope that it will be useful,
123.1126 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
123.1127 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123.1128 -+// GNU General Public License for more details.
123.1129 -+
123.1130 -+// You should have received a copy of the GNU General Public License along
123.1131 -+// with this library; see the file COPYING.  If not, write to the Free
123.1132 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
123.1133 -+// USA.
123.1134 -+
123.1135 -+// As a special exception, you may use this file as part of a free software
123.1136 -+// library without restriction.  Specifically, if other files instantiate
123.1137 -+// templates or use macros or inline functions from this file, or you compile
123.1138 -+// this file and link it with other files to produce an executable, this
123.1139 -+// file does not by itself cause the resulting executable to be covered by
123.1140 -+// the GNU General Public License.  This exception does not however
123.1141 -+// invalidate any other reasons why the executable file might be covered by
123.1142 -+// the GNU General Public License.
123.1143 -+
123.1144 -+//
123.1145 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
123.1146 -+//
123.1147 -+
123.1148 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
123.1149 -+
123.1150 -+#include <locale>
123.1151 -+#include <bits/c++locale_internal.h>
123.1152 -+
123.1153 -+#ifdef __UCLIBC_MJN3_ONLY__
123.1154 -+#warning fix gettext stuff
123.1155 -+#endif
123.1156 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
123.1157 -+extern "C" char *__dcgettext(const char *domainname,
123.1158 -+			     const char *msgid, int category);
123.1159 -+#undef gettext
123.1160 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
123.1161 -+#else
123.1162 -+#undef gettext
123.1163 -+#define gettext(msgid) (msgid)
123.1164 -+#endif
123.1165 -+
123.1166 -+namespace std
123.1167 -+{
123.1168 -+  // Specializations.
123.1169 -+  template<>
123.1170 -+    string
123.1171 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
123.1172 -+    {
123.1173 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1174 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
123.1175 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
123.1176 -+      __uselocale(__old);
123.1177 -+      return string(__msg);
123.1178 -+#elif defined __UCLIBC_HAS_LOCALE__
123.1179 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
123.1180 -+      setlocale(LC_ALL, _M_name_messages);
123.1181 -+      const char* __msg = gettext(__dfault.c_str());
123.1182 -+      setlocale(LC_ALL, __old);
123.1183 -+      free(__old);
123.1184 -+      return string(__msg);
123.1185 -+#else
123.1186 -+      const char* __msg = gettext(__dfault.c_str());
123.1187 -+      return string(__msg);
123.1188 -+#endif
123.1189 -+    }
123.1190 -+
123.1191 -+#ifdef _GLIBCXX_USE_WCHAR_T
123.1192 -+  template<>
123.1193 -+    wstring
123.1194 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
123.1195 -+    {
123.1196 -+# ifdef __UCLIBC_HAS_XLOCALE__
123.1197 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
123.1198 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
123.1199 -+      __uselocale(__old);
123.1200 -+      return _M_convert_from_char(__msg);
123.1201 -+# elif defined __UCLIBC_HAS_LOCALE__
123.1202 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
123.1203 -+      setlocale(LC_ALL, _M_name_messages);
123.1204 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
123.1205 -+      setlocale(LC_ALL, __old);
123.1206 -+      free(__old);
123.1207 -+      return _M_convert_from_char(__msg);
123.1208 -+# else
123.1209 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
123.1210 -+      return _M_convert_from_char(__msg);
123.1211 -+# endif
123.1212 -+    }
123.1213 -+#endif
123.1214 -+}
123.1215 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.h
123.1216 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.h	1969-12-31 18:00:00.000000000 -0600
123.1217 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2005-04-28 01:13:15.000000000 -0500
123.1218 -@@ -0,0 +1,118 @@
123.1219 -+// std::messages implementation details, GNU version -*- C++ -*-
123.1220 -+
123.1221 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
123.1222 -+//
123.1223 -+// This file is part of the GNU ISO C++ Library.  This library is free
123.1224 -+// software; you can redistribute it and/or modify it under the
123.1225 -+// terms of the GNU General Public License as published by the
123.1226 -+// Free Software Foundation; either version 2, or (at your option)
123.1227 -+// any later version.
123.1228 -+
123.1229 -+// This library is distributed in the hope that it will be useful,
123.1230 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
123.1231 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123.1232 -+// GNU General Public License for more details.
123.1233 -+
123.1234 -+// You should have received a copy of the GNU General Public License along
123.1235 -+// with this library; see the file COPYING.  If not, write to the Free
123.1236 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
123.1237 -+// USA.
123.1238 -+
123.1239 -+// As a special exception, you may use this file as part of a free software
123.1240 -+// library without restriction.  Specifically, if other files instantiate
123.1241 -+// templates or use macros or inline functions from this file, or you compile
123.1242 -+// this file and link it with other files to produce an executable, this
123.1243 -+// file does not by itself cause the resulting executable to be covered by
123.1244 -+// the GNU General Public License.  This exception does not however
123.1245 -+// invalidate any other reasons why the executable file might be covered by
123.1246 -+// the GNU General Public License.
123.1247 -+
123.1248 -+//
123.1249 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
123.1250 -+//
123.1251 -+
123.1252 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
123.1253 -+
123.1254 -+#ifdef __UCLIBC_MJN3_ONLY__
123.1255 -+#warning fix prototypes for *textdomain funcs
123.1256 -+#endif
123.1257 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
123.1258 -+extern "C" char *__textdomain(const char *domainname);
123.1259 -+extern "C" char *__bindtextdomain(const char *domainname,
123.1260 -+				  const char *dirname);
123.1261 -+#else
123.1262 -+#undef __textdomain
123.1263 -+#undef __bindtextdomain
123.1264 -+#define __textdomain(D)           ((void)0)
123.1265 -+#define __bindtextdomain(D,P)     ((void)0)
123.1266 -+#endif
123.1267 -+
123.1268 -+  // Non-virtual member functions.
123.1269 -+  template<typename _CharT>
123.1270 -+     messages<_CharT>::messages(size_t __refs)
123.1271 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
123.1272 -+     _M_name_messages(_S_get_c_name())
123.1273 -+     { }
123.1274 -+
123.1275 -+  template<typename _CharT>
123.1276 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
123.1277 -+				size_t __refs) 
123.1278 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
123.1279 -+     _M_name_messages(__s)
123.1280 -+     {
123.1281 -+       char* __tmp = new char[std::strlen(__s) + 1];
123.1282 -+       std::strcpy(__tmp, __s);
123.1283 -+       _M_name_messages = __tmp;
123.1284 -+     }
123.1285 -+
123.1286 -+  template<typename _CharT>
123.1287 -+    typename messages<_CharT>::catalog 
123.1288 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
123.1289 -+			   const char* __dir) const
123.1290 -+    { 
123.1291 -+      __bindtextdomain(__s.c_str(), __dir);
123.1292 -+      return this->do_open(__s, __loc); 
123.1293 -+    }
123.1294 -+
123.1295 -+  // Virtual member functions.
123.1296 -+  template<typename _CharT>
123.1297 -+    messages<_CharT>::~messages()
123.1298 -+    { 
123.1299 -+      if (_M_name_messages != _S_get_c_name())
123.1300 -+	delete [] _M_name_messages;
123.1301 -+      _S_destroy_c_locale(_M_c_locale_messages); 
123.1302 -+    }
123.1303 -+
123.1304 -+  template<typename _CharT>
123.1305 -+    typename messages<_CharT>::catalog 
123.1306 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
123.1307 -+			      const locale&) const
123.1308 -+    { 
123.1309 -+      // No error checking is done, assume the catalog exists and can
123.1310 -+      // be used.
123.1311 -+      __textdomain(__s.c_str());
123.1312 -+      return 0;
123.1313 -+    }
123.1314 -+
123.1315 -+  template<typename _CharT>
123.1316 -+    void    
123.1317 -+    messages<_CharT>::do_close(catalog) const 
123.1318 -+    { }
123.1319 -+
123.1320 -+   // messages_byname
123.1321 -+   template<typename _CharT>
123.1322 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
123.1323 -+     : messages<_CharT>(__refs) 
123.1324 -+     { 
123.1325 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
123.1326 -+	 delete [] this->_M_name_messages;
123.1327 -+       char* __tmp = new char[std::strlen(__s) + 1];
123.1328 -+       std::strcpy(__tmp, __s);
123.1329 -+       this->_M_name_messages = __tmp;
123.1330 -+
123.1331 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
123.1332 -+	 {
123.1333 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
123.1334 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
123.1335 -+	 }
123.1336 -+     }
123.1337 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
123.1338 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1969-12-31 18:00:00.000000000 -0600
123.1339 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2005-04-28 01:23:02.000000000 -0500
123.1340 -@@ -0,0 +1,692 @@
123.1341 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
123.1342 -+
123.1343 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
123.1344 -+//
123.1345 -+// This file is part of the GNU ISO C++ Library.  This library is free
123.1346 -+// software; you can redistribute it and/or modify it under the
123.1347 -+// terms of the GNU General Public License as published by the
123.1348 -+// Free Software Foundation; either version 2, or (at your option)
123.1349 -+// any later version.
123.1350 -+
123.1351 -+// This library is distributed in the hope that it will be useful,
123.1352 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
123.1353 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123.1354 -+// GNU General Public License for more details.
123.1355 -+
123.1356 -+// You should have received a copy of the GNU General Public License along
123.1357 -+// with this library; see the file COPYING.  If not, write to the Free
123.1358 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
123.1359 -+// USA.
123.1360 -+
123.1361 -+// As a special exception, you may use this file as part of a free software
123.1362 -+// library without restriction.  Specifically, if other files instantiate
123.1363 -+// templates or use macros or inline functions from this file, or you compile
123.1364 -+// this file and link it with other files to produce an executable, this
123.1365 -+// file does not by itself cause the resulting executable to be covered by
123.1366 -+// the GNU General Public License.  This exception does not however
123.1367 -+// invalidate any other reasons why the executable file might be covered by
123.1368 -+// the GNU General Public License.
123.1369 -+
123.1370 -+//
123.1371 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
123.1372 -+//
123.1373 -+
123.1374 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
123.1375 -+
123.1376 -+#define _LIBC
123.1377 -+#include <locale>
123.1378 -+#undef _LIBC
123.1379 -+#include <bits/c++locale_internal.h>
123.1380 -+
123.1381 -+#ifdef __UCLIBC_MJN3_ONLY__
123.1382 -+#warning optimize this for uclibc
123.1383 -+#warning tailor for stub locale support
123.1384 -+#endif
123.1385 -+
123.1386 -+#ifndef __UCLIBC_HAS_XLOCALE__
123.1387 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
123.1388 -+#endif
123.1389 -+
123.1390 -+namespace std
123.1391 -+{
123.1392 -+  // Construct and return valid pattern consisting of some combination of:
123.1393 -+  // space none symbol sign value
123.1394 -+  money_base::pattern
123.1395 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
123.1396 -+  { 
123.1397 -+    pattern __ret;
123.1398 -+
123.1399 -+    // This insanely complicated routine attempts to construct a valid
123.1400 -+    // pattern for use with monyepunct. A couple of invariants:
123.1401 -+
123.1402 -+    // if (__precedes) symbol -> value
123.1403 -+    // else value -> symbol
123.1404 -+    
123.1405 -+    // if (__space) space
123.1406 -+    // else none
123.1407 -+
123.1408 -+    // none == never first
123.1409 -+    // space never first or last
123.1410 -+
123.1411 -+    // Any elegant implementations of this are welcome.
123.1412 -+    switch (__posn)
123.1413 -+      {
123.1414 -+      case 0:
123.1415 -+      case 1:
123.1416 -+	// 1 The sign precedes the value and symbol.
123.1417 -+	__ret.field[0] = sign;
123.1418 -+	if (__space)
123.1419 -+	  {
123.1420 -+	    // Pattern starts with sign.
123.1421 -+	    if (__precedes)
123.1422 -+	      {
123.1423 -+		__ret.field[1] = symbol;
123.1424 -+		__ret.field[3] = value;
123.1425 -+	      }
123.1426 -+	    else
123.1427 -+	      {
123.1428 -+		__ret.field[1] = value;
123.1429 -+		__ret.field[3] = symbol;
123.1430 -+	      }
123.1431 -+	    __ret.field[2] = space;
123.1432 -+	  }
123.1433 -+	else
123.1434 -+	  {
123.1435 -+	    // Pattern starts with sign and ends with none.
123.1436 -+	    if (__precedes)
123.1437 -+	      {
123.1438 -+		__ret.field[1] = symbol;
123.1439 -+		__ret.field[2] = value;
123.1440 -+	      }
123.1441 -+	    else
123.1442 -+	      {
123.1443 -+		__ret.field[1] = value;
123.1444 -+		__ret.field[2] = symbol;
123.1445 -+	      }
123.1446 -+	    __ret.field[3] = none;
123.1447 -+	  }
123.1448 -+	break;
123.1449 -+      case 2:
123.1450 -+	// 2 The sign follows the value and symbol.
123.1451 -+	if (__space)
123.1452 -+	  {
123.1453 -+	    // Pattern either ends with sign.
123.1454 -+	    if (__precedes)
123.1455 -+	      {
123.1456 -+		__ret.field[0] = symbol;
123.1457 -+		__ret.field[2] = value;
123.1458 -+	      }
123.1459 -+	    else
123.1460 -+	      {
123.1461 -+		__ret.field[0] = value;
123.1462 -+		__ret.field[2] = symbol;
123.1463 -+	      }
123.1464 -+	    __ret.field[1] = space;
123.1465 -+	    __ret.field[3] = sign;
123.1466 -+	  }
123.1467 -+	else
123.1468 -+	  {
123.1469 -+	    // Pattern ends with sign then none.
123.1470 -+	    if (__precedes)
123.1471 -+	      {
123.1472 -+		__ret.field[0] = symbol;
123.1473 -+		__ret.field[1] = value;
123.1474 -+	      }
123.1475 -+	    else
123.1476 -+	      {
123.1477 -+		__ret.field[0] = value;
123.1478 -+		__ret.field[1] = symbol;
123.1479 -+	      }
123.1480 -+	    __ret.field[2] = sign;
123.1481 -+	    __ret.field[3] = none;
123.1482 -+	  }
123.1483 -+	break;
123.1484 -+      case 3:
123.1485 -+	// 3 The sign immediately precedes the symbol.
123.1486 -+	if (__precedes)
123.1487 -+	  {
123.1488 -+	    __ret.field[0] = sign;
123.1489 -+	    __ret.field[1] = symbol;	    
123.1490 -+	    if (__space)
123.1491 -+	      {
123.1492 -+		__ret.field[2] = space;
123.1493 -+		__ret.field[3] = value;
123.1494 -+	      }
123.1495 -+	    else
123.1496 -+	      {
123.1497 -+		__ret.field[2] = value;		
123.1498 -+		__ret.field[3] = none;
123.1499 -+	      }
123.1500 -+	  }
123.1501 -+	else
123.1502 -+	  {
123.1503 -+	    __ret.field[0] = value;
123.1504 -+	    if (__space)
123.1505 -+	      {
123.1506 -+		__ret.field[1] = space;
123.1507 -+		__ret.field[2] = sign;
123.1508 -+		__ret.field[3] = symbol;
123.1509 -+	      }
123.1510 -+	    else
123.1511 -+	      {
123.1512 -+		__ret.field[1] = sign;
123.1513 -+		__ret.field[2] = symbol;
123.1514 -+		__ret.field[3] = none;
123.1515 -+	      }
123.1516 -+	  }
123.1517 -+	break;
123.1518 -+      case 4:
123.1519 -+	// 4 The sign immediately follows the symbol.
123.1520 -+	if (__precedes)
123.1521 -+	  {
123.1522 -+	    __ret.field[0] = symbol;
123.1523 -+	    __ret.field[1] = sign;
123.1524 -+	    if (__space)
123.1525 -+	      {
123.1526 -+		__ret.field[2] = space;
123.1527 -+		__ret.field[3] = value;
123.1528 -+	      }
123.1529 -+	    else
123.1530 -+	      {
123.1531 -+		__ret.field[2] = value;
123.1532 -+		__ret.field[3] = none;
123.1533 -+	      }
123.1534 -+	  }
123.1535 -+	else
123.1536 -+	  {
123.1537 -+	    __ret.field[0] = value;
123.1538 -+	    if (__space)
123.1539 -+	      {
123.1540 -+		__ret.field[1] = space;
123.1541 -+		__ret.field[2] = symbol;
123.1542 -+		__ret.field[3] = sign;
123.1543 -+	      }
123.1544 -+	    else
123.1545 -+	      {
123.1546 -+		__ret.field[1] = symbol;
123.1547 -+		__ret.field[2] = sign;
123.1548 -+		__ret.field[3] = none;
123.1549 -+	      }
123.1550 -+	  }
123.1551 -+	break;
123.1552 -+      default:
123.1553 -+	__ret = pattern();
123.1554 -+      }
123.1555 -+    return __ret;
123.1556 -+  }
123.1557 -+
123.1558 -+  template<> 
123.1559 -+    void
123.1560 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
123.1561 -+						     const char*)
123.1562 -+    {
123.1563 -+      if (!_M_data)
123.1564 -+	_M_data = new __moneypunct_cache<char, true>;
123.1565 -+
123.1566 -+      if (!__cloc)
123.1567 -+	{
123.1568 -+	  // "C" locale
123.1569 -+	  _M_data->_M_decimal_point = '.';
123.1570 -+	  _M_data->_M_thousands_sep = ',';
123.1571 -+	  _M_data->_M_grouping = "";
123.1572 -+	  _M_data->_M_grouping_size = 0;
123.1573 -+	  _M_data->_M_curr_symbol = "";
123.1574 -+	  _M_data->_M_curr_symbol_size = 0;
123.1575 -+	  _M_data->_M_positive_sign = "";
123.1576 -+	  _M_data->_M_positive_sign_size = 0;
123.1577 -+	  _M_data->_M_negative_sign = "";
123.1578 -+	  _M_data->_M_negative_sign_size = 0;
123.1579 -+	  _M_data->_M_frac_digits = 0;
123.1580 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
123.1581 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
123.1582 -+
123.1583 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
123.1584 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
123.1585 -+	}
123.1586 -+      else
123.1587 -+	{
123.1588 -+	  // Named locale.
123.1589 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
123.1590 -+							__cloc));
123.1591 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
123.1592 -+							__cloc));
123.1593 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
123.1594 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
123.1595 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
123.1596 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
123.1597 -+
123.1598 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
123.1599 -+	  if (!__nposn)
123.1600 -+	    _M_data->_M_negative_sign = "()";
123.1601 -+	  else
123.1602 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
123.1603 -+							__cloc);
123.1604 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
123.1605 -+
123.1606 -+	  // _Intl == true
123.1607 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
123.1608 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
123.1609 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
123.1610 -+						      __cloc));
123.1611 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
123.1612 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
123.1613 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
123.1614 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
123.1615 -+							__pposn);
123.1616 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
123.1617 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
123.1618 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
123.1619 -+							__nposn);
123.1620 -+	}
123.1621 -+    }
123.1622 -+
123.1623 -+  template<> 
123.1624 -+    void
123.1625 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
123.1626 -+						      const char*)
123.1627 -+    {
123.1628 -+      if (!_M_data)
123.1629 -+	_M_data = new __moneypunct_cache<char, false>;
123.1630 -+
123.1631 -+      if (!__cloc)
123.1632 -+	{
123.1633 -+	  // "C" locale
123.1634 -+	  _M_data->_M_decimal_point = '.';
123.1635 -+	  _M_data->_M_thousands_sep = ',';
123.1636 -+	  _M_data->_M_grouping = "";
123.1637 -+	  _M_data->_M_grouping_size = 0;
123.1638 -+	  _M_data->_M_curr_symbol = "";
123.1639 -+	  _M_data->_M_curr_symbol_size = 0;
123.1640 -+	  _M_data->_M_positive_sign = "";
123.1641 -+	  _M_data->_M_positive_sign_size = 0;
123.1642 -+	  _M_data->_M_negative_sign = "";
123.1643 -+	  _M_data->_M_negative_sign_size = 0;
123.1644 -+	  _M_data->_M_frac_digits = 0;
123.1645 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
123.1646 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
123.1647 -+
123.1648 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
123.1649 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
123.1650 -+	}
123.1651 -+      else
123.1652 -+	{
123.1653 -+	  // Named locale.
123.1654 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
123.1655 -+							__cloc));
123.1656 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
123.1657 -+							__cloc));
123.1658 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
123.1659 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
123.1660 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
123.1661 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
123.1662 -+
123.1663 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
123.1664 -+	  if (!__nposn)
123.1665 -+	    _M_data->_M_negative_sign = "()";
123.1666 -+	  else
123.1667 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
123.1668 -+							__cloc);
123.1669 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
123.1670 -+
123.1671 -+	  // _Intl == false
123.1672 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
123.1673 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
123.1674 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
123.1675 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
123.1676 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
123.1677 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
123.1678 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
123.1679 -+							__pposn);
123.1680 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
123.1681 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
123.1682 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
123.1683 -+							__nposn);
123.1684 -+	}
123.1685 -+    }
123.1686 -+
123.1687 -+  template<> 
123.1688 -+    moneypunct<char, true>::~moneypunct()
123.1689 -+    { delete _M_data; }
123.1690 -+
123.1691 -+  template<> 
123.1692 -+    moneypunct<char, false>::~moneypunct()
123.1693 -+    { delete _M_data; }
123.1694 -+
123.1695 -+#ifdef _GLIBCXX_USE_WCHAR_T
123.1696 -+  template<> 
123.1697 -+    void
123.1698 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
123.1699 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1700 -+							const char*)
123.1701 -+#else
123.1702 -+							const char* __name)
123.1703 -+#endif
123.1704 -+    {
123.1705 -+      if (!_M_data)
123.1706 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
123.1707 -+
123.1708 -+      if (!__cloc)
123.1709 -+	{
123.1710 -+	  // "C" locale
123.1711 -+	  _M_data->_M_decimal_point = L'.';
123.1712 -+	  _M_data->_M_thousands_sep = L',';
123.1713 -+	  _M_data->_M_grouping = "";
123.1714 -+	  _M_data->_M_grouping_size = 0;
123.1715 -+	  _M_data->_M_curr_symbol = L"";
123.1716 -+	  _M_data->_M_curr_symbol_size = 0;
123.1717 -+	  _M_data->_M_positive_sign = L"";
123.1718 -+	  _M_data->_M_positive_sign_size = 0;
123.1719 -+	  _M_data->_M_negative_sign = L"";
123.1720 -+	  _M_data->_M_negative_sign_size = 0;
123.1721 -+	  _M_data->_M_frac_digits = 0;
123.1722 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
123.1723 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
123.1724 -+
123.1725 -+	  // Use ctype::widen code without the facet...
123.1726 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
123.1727 -+	    _M_data->_M_atoms[__i] =
123.1728 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
123.1729 -+	}
123.1730 -+      else
123.1731 -+	{
123.1732 -+	  // Named locale.
123.1733 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1734 -+	  __c_locale __old = __uselocale(__cloc);
123.1735 -+#else
123.1736 -+	  // Switch to named locale so that mbsrtowcs will work.
123.1737 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
123.1738 -+	  setlocale(LC_ALL, __name);
123.1739 -+#endif
123.1740 -+
123.1741 -+#ifdef __UCLIBC_MJN3_ONLY__
123.1742 -+#warning fix this... should be monetary
123.1743 -+#endif
123.1744 -+#ifdef __UCLIBC__
123.1745 -+# ifdef __UCLIBC_HAS_XLOCALE__
123.1746 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
123.1747 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
123.1748 -+# else
123.1749 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
123.1750 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
123.1751 -+# endif
123.1752 -+#else
123.1753 -+	  union { char *__s; wchar_t __w; } __u;
123.1754 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
123.1755 -+	  _M_data->_M_decimal_point = __u.__w;
123.1756 -+
123.1757 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
123.1758 -+	  _M_data->_M_thousands_sep = __u.__w;
123.1759 -+#endif
123.1760 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
123.1761 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
123.1762 -+
123.1763 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
123.1764 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
123.1765 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
123.1766 -+
123.1767 -+	  wchar_t* __wcs_ps = 0;
123.1768 -+	  wchar_t* __wcs_ns = 0;
123.1769 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
123.1770 -+	  try
123.1771 -+	    {
123.1772 -+	      mbstate_t __state;
123.1773 -+	      size_t __len = strlen(__cpossign);
123.1774 -+	      if (__len)
123.1775 -+		{
123.1776 -+		  ++__len;
123.1777 -+		  memset(&__state, 0, sizeof(mbstate_t));
123.1778 -+		  __wcs_ps = new wchar_t[__len];
123.1779 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
123.1780 -+		  _M_data->_M_positive_sign = __wcs_ps;
123.1781 -+		}
123.1782 -+	      else
123.1783 -+		_M_data->_M_positive_sign = L"";
123.1784 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
123.1785 -+	      
123.1786 -+	      __len = strlen(__cnegsign);
123.1787 -+	      if (!__nposn)
123.1788 -+		_M_data->_M_negative_sign = L"()";
123.1789 -+	      else if (__len)
123.1790 -+		{ 
123.1791 -+		  ++__len;
123.1792 -+		  memset(&__state, 0, sizeof(mbstate_t));
123.1793 -+		  __wcs_ns = new wchar_t[__len];
123.1794 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
123.1795 -+		  _M_data->_M_negative_sign = __wcs_ns;
123.1796 -+		}
123.1797 -+	      else
123.1798 -+		_M_data->_M_negative_sign = L"";
123.1799 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
123.1800 -+	      
123.1801 -+	      // _Intl == true.
123.1802 -+	      __len = strlen(__ccurr);
123.1803 -+	      if (__len)
123.1804 -+		{
123.1805 -+		  ++__len;
123.1806 -+		  memset(&__state, 0, sizeof(mbstate_t));
123.1807 -+		  wchar_t* __wcs = new wchar_t[__len];
123.1808 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
123.1809 -+		  _M_data->_M_curr_symbol = __wcs;
123.1810 -+		}
123.1811 -+	      else
123.1812 -+		_M_data->_M_curr_symbol = L"";
123.1813 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
123.1814 -+	    }
123.1815 -+	  catch (...)
123.1816 -+	    {
123.1817 -+	      delete _M_data;
123.1818 -+	      _M_data = 0;
123.1819 -+	      delete __wcs_ps;
123.1820 -+	      delete __wcs_ns;	      
123.1821 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1822 -+	      __uselocale(__old);
123.1823 -+#else
123.1824 -+	      setlocale(LC_ALL, __old);
123.1825 -+	      free(__old);
123.1826 -+#endif
123.1827 -+	      __throw_exception_again;
123.1828 -+	    } 
123.1829 -+	  
123.1830 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
123.1831 -+						      __cloc));
123.1832 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
123.1833 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
123.1834 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
123.1835 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
123.1836 -+							__pposn);
123.1837 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
123.1838 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
123.1839 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
123.1840 -+							__nposn);
123.1841 -+
123.1842 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1843 -+	  __uselocale(__old);
123.1844 -+#else
123.1845 -+	  setlocale(LC_ALL, __old);
123.1846 -+	  free(__old);
123.1847 -+#endif
123.1848 -+	}
123.1849 -+    }
123.1850 -+
123.1851 -+  template<> 
123.1852 -+  void
123.1853 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
123.1854 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1855 -+						       const char*)
123.1856 -+#else
123.1857 -+                                                       const char* __name)
123.1858 -+#endif
123.1859 -+  {
123.1860 -+    if (!_M_data)
123.1861 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
123.1862 -+
123.1863 -+    if (!__cloc)
123.1864 -+	{
123.1865 -+	  // "C" locale
123.1866 -+	  _M_data->_M_decimal_point = L'.';
123.1867 -+	  _M_data->_M_thousands_sep = L',';
123.1868 -+	  _M_data->_M_grouping = "";
123.1869 -+          _M_data->_M_grouping_size = 0;
123.1870 -+	  _M_data->_M_curr_symbol = L"";
123.1871 -+	  _M_data->_M_curr_symbol_size = 0;
123.1872 -+	  _M_data->_M_positive_sign = L"";
123.1873 -+	  _M_data->_M_positive_sign_size = 0;
123.1874 -+	  _M_data->_M_negative_sign = L"";
123.1875 -+	  _M_data->_M_negative_sign_size = 0;
123.1876 -+	  _M_data->_M_frac_digits = 0;
123.1877 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
123.1878 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
123.1879 -+
123.1880 -+	  // Use ctype::widen code without the facet...
123.1881 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
123.1882 -+	    _M_data->_M_atoms[__i] =
123.1883 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
123.1884 -+	}
123.1885 -+      else
123.1886 -+	{
123.1887 -+	  // Named locale.
123.1888 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1889 -+	  __c_locale __old = __uselocale(__cloc);
123.1890 -+#else
123.1891 -+	  // Switch to named locale so that mbsrtowcs will work.
123.1892 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
123.1893 -+	  setlocale(LC_ALL, __name);
123.1894 -+#endif
123.1895 -+
123.1896 -+#ifdef __UCLIBC_MJN3_ONLY__
123.1897 -+#warning fix this... should be monetary
123.1898 -+#endif
123.1899 -+#ifdef __UCLIBC__
123.1900 -+# ifdef __UCLIBC_HAS_XLOCALE__
123.1901 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
123.1902 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
123.1903 -+# else
123.1904 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
123.1905 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
123.1906 -+# endif
123.1907 -+#else
123.1908 -+          union { char *__s; wchar_t __w; } __u;
123.1909 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
123.1910 -+	  _M_data->_M_decimal_point = __u.__w;
123.1911 -+
123.1912 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
123.1913 -+	  _M_data->_M_thousands_sep = __u.__w;
123.1914 -+#endif
123.1915 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
123.1916 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
123.1917 -+
123.1918 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
123.1919 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
123.1920 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
123.1921 -+
123.1922 -+	  wchar_t* __wcs_ps = 0;
123.1923 -+	  wchar_t* __wcs_ns = 0;
123.1924 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
123.1925 -+	  try
123.1926 -+            {
123.1927 -+              mbstate_t __state;
123.1928 -+              size_t __len;
123.1929 -+              __len = strlen(__cpossign);
123.1930 -+              if (__len)
123.1931 -+                {
123.1932 -+		  ++__len;
123.1933 -+		  memset(&__state, 0, sizeof(mbstate_t));
123.1934 -+		  __wcs_ps = new wchar_t[__len];
123.1935 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
123.1936 -+		  _M_data->_M_positive_sign = __wcs_ps;
123.1937 -+		}
123.1938 -+	      else
123.1939 -+		_M_data->_M_positive_sign = L"";
123.1940 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
123.1941 -+	      
123.1942 -+	      __len = strlen(__cnegsign);
123.1943 -+	      if (!__nposn)
123.1944 -+		_M_data->_M_negative_sign = L"()";
123.1945 -+	      else if (__len)
123.1946 -+		{ 
123.1947 -+		  ++__len;
123.1948 -+		  memset(&__state, 0, sizeof(mbstate_t));
123.1949 -+		  __wcs_ns = new wchar_t[__len];
123.1950 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
123.1951 -+		  _M_data->_M_negative_sign = __wcs_ns;
123.1952 -+		}
123.1953 -+	      else
123.1954 -+		_M_data->_M_negative_sign = L"";
123.1955 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
123.1956 -+
123.1957 -+	      // _Intl == true.
123.1958 -+	      __len = strlen(__ccurr);
123.1959 -+	      if (__len)
123.1960 -+		{
123.1961 -+		  ++__len;
123.1962 -+		  memset(&__state, 0, sizeof(mbstate_t));
123.1963 -+		  wchar_t* __wcs = new wchar_t[__len];
123.1964 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
123.1965 -+		  _M_data->_M_curr_symbol = __wcs;
123.1966 -+		}
123.1967 -+	      else
123.1968 -+		_M_data->_M_curr_symbol = L"";
123.1969 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
123.1970 -+	    }
123.1971 -+          catch (...)
123.1972 -+	    {
123.1973 -+	      delete _M_data;
123.1974 -+              _M_data = 0;
123.1975 -+	      delete __wcs_ps;
123.1976 -+	      delete __wcs_ns;	      
123.1977 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1978 -+	      __uselocale(__old);
123.1979 -+#else
123.1980 -+	      setlocale(LC_ALL, __old);
123.1981 -+	      free(__old);
123.1982 -+#endif
123.1983 -+              __throw_exception_again;
123.1984 -+	    }
123.1985 -+
123.1986 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
123.1987 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
123.1988 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
123.1989 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
123.1990 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
123.1991 -+	                                                __pposn);
123.1992 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
123.1993 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
123.1994 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
123.1995 -+	                                                __nposn);
123.1996 -+
123.1997 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.1998 -+	  __uselocale(__old);
123.1999 -+#else
123.2000 -+	  setlocale(LC_ALL, __old);
123.2001 -+	  free(__old);
123.2002 -+#endif
123.2003 -+	}
123.2004 -+    }
123.2005 -+
123.2006 -+  template<> 
123.2007 -+    moneypunct<wchar_t, true>::~moneypunct()
123.2008 -+    {
123.2009 -+      if (_M_data->_M_positive_sign_size)
123.2010 -+	delete [] _M_data->_M_positive_sign;
123.2011 -+      if (_M_data->_M_negative_sign_size
123.2012 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
123.2013 -+	delete [] _M_data->_M_negative_sign;
123.2014 -+      if (_M_data->_M_curr_symbol_size)
123.2015 -+	delete [] _M_data->_M_curr_symbol;
123.2016 -+      delete _M_data;
123.2017 -+    }
123.2018 -+
123.2019 -+  template<> 
123.2020 -+    moneypunct<wchar_t, false>::~moneypunct()
123.2021 -+    {
123.2022 -+      if (_M_data->_M_positive_sign_size)
123.2023 -+	delete [] _M_data->_M_positive_sign;
123.2024 -+      if (_M_data->_M_negative_sign_size
123.2025 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
123.2026 -+	delete [] _M_data->_M_negative_sign;
123.2027 -+      if (_M_data->_M_curr_symbol_size)
123.2028 -+	delete [] _M_data->_M_curr_symbol;
123.2029 -+      delete _M_data;
123.2030 -+    }
123.2031 -+#endif
123.2032 -+}
123.2033 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
123.2034 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1969-12-31 18:00:00.000000000 -0600
123.2035 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2005-04-28 01:20:20.000000000 -0500
123.2036 -@@ -0,0 +1,173 @@
123.2037 -+// std::numpunct implementation details, GNU version -*- C++ -*-
123.2038 -+
123.2039 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
123.2040 -+//
123.2041 -+// This file is part of the GNU ISO C++ Library.  This library is free
123.2042 -+// software; you can redistribute it and/or modify it under the
123.2043 -+// terms of the GNU General Public License as published by the
123.2044 -+// Free Software Foundation; either version 2, or (at your option)
123.2045 -+// any later version.
123.2046 -+
123.2047 -+// This library is distributed in the hope that it will be useful,
123.2048 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
123.2049 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123.2050 -+// GNU General Public License for more details.
123.2051 -+
123.2052 -+// You should have received a copy of the GNU General Public License along
123.2053 -+// with this library; see the file COPYING.  If not, write to the Free
123.2054 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
123.2055 -+// USA.
123.2056 -+
123.2057 -+// As a special exception, you may use this file as part of a free software
123.2058 -+// library without restriction.  Specifically, if other files instantiate
123.2059 -+// templates or use macros or inline functions from this file, or you compile
123.2060 -+// this file and link it with other files to produce an executable, this
123.2061 -+// file does not by itself cause the resulting executable to be covered by
123.2062 -+// the GNU General Public License.  This exception does not however
123.2063 -+// invalidate any other reasons why the executable file might be covered by
123.2064 -+// the GNU General Public License.
123.2065 -+
123.2066 -+//
123.2067 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
123.2068 -+//
123.2069 -+
123.2070 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
123.2071 -+
123.2072 -+#define _LIBC
123.2073 -+#include <locale>
123.2074 -+#undef _LIBC
123.2075 -+#include <bits/c++locale_internal.h>
123.2076 -+
123.2077 -+#ifdef __UCLIBC_MJN3_ONLY__
123.2078 -+#warning tailor for stub locale support
123.2079 -+#endif
123.2080 -+#ifndef __UCLIBC_HAS_XLOCALE__
123.2081 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
123.2082 -+#endif
123.2083 -+
123.2084 -+namespace std
123.2085 -+{
123.2086 -+  template<> 
123.2087 -+    void
123.2088 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
123.2089 -+    {
123.2090 -+      if (!_M_data)
123.2091 -+	_M_data = new __numpunct_cache<char>;
123.2092 -+
123.2093 -+      if (!__cloc)
123.2094 -+	{
123.2095 -+	  // "C" locale
123.2096 -+	  _M_data->_M_grouping = "";
123.2097 -+	  _M_data->_M_grouping_size = 0;
123.2098 -+	  _M_data->_M_use_grouping = false;
123.2099 -+
123.2100 -+	  _M_data->_M_decimal_point = '.';
123.2101 -+	  _M_data->_M_thousands_sep = ',';
123.2102 -+
123.2103 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
123.2104 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
123.2105 -+
123.2106 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
123.2107 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
123.2108 -+	}
123.2109 -+      else
123.2110 -+	{
123.2111 -+	  // Named locale.
123.2112 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
123.2113 -+							__cloc));
123.2114 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
123.2115 -+							__cloc));
123.2116 -+
123.2117 -+	  // Check for NULL, which implies no grouping.
123.2118 -+	  if (_M_data->_M_thousands_sep == '\0')
123.2119 -+	    _M_data->_M_grouping = "";
123.2120 -+	  else
123.2121 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
123.2122 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
123.2123 -+	}
123.2124 -+
123.2125 -+      // NB: There is no way to extact this info from posix locales.
123.2126 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
123.2127 -+      _M_data->_M_truename = "true";
123.2128 -+      _M_data->_M_truename_size = 4;
123.2129 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
123.2130 -+      _M_data->_M_falsename = "false";
123.2131 -+      _M_data->_M_falsename_size = 5;
123.2132 -+    }
123.2133 -+ 
123.2134 -+  template<> 
123.2135 -+    numpunct<char>::~numpunct()
123.2136 -+    { delete _M_data; }
123.2137 -+   
123.2138 -+#ifdef _GLIBCXX_USE_WCHAR_T
123.2139 -+  template<> 
123.2140 -+    void
123.2141 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
123.2142 -+    {
123.2143 -+      if (!_M_data)
123.2144 -+	_M_data = new __numpunct_cache<wchar_t>;
123.2145 -+
123.2146 -+      if (!__cloc)
123.2147 -+	{
123.2148 -+	  // "C" locale
123.2149 -+	  _M_data->_M_grouping = "";
123.2150 -+	  _M_data->_M_grouping_size = 0;
123.2151 -+	  _M_data->_M_use_grouping = false;
123.2152 -+
123.2153 -+	  _M_data->_M_decimal_point = L'.';
123.2154 -+	  _M_data->_M_thousands_sep = L',';
123.2155 -+
123.2156 -+	  // Use ctype::widen code without the facet...
123.2157 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
123.2158 -+	    _M_data->_M_atoms_out[__i] =
123.2159 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
123.2160 -+
123.2161 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
123.2162 -+	    _M_data->_M_atoms_in[__j] =
123.2163 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
123.2164 -+	}
123.2165 -+      else
123.2166 -+	{
123.2167 -+	  // Named locale.
123.2168 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
123.2169 -+#ifdef __UCLIBC_MJN3_ONLY__
123.2170 -+#warning fix this
123.2171 -+#endif
123.2172 -+#ifdef __UCLIBC__
123.2173 -+# ifdef __UCLIBC_HAS_XLOCALE__
123.2174 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
123.2175 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
123.2176 -+# else
123.2177 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
123.2178 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
123.2179 -+# endif
123.2180 -+#else
123.2181 -+	  union { char *__s; wchar_t __w; } __u;
123.2182 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
123.2183 -+	  _M_data->_M_decimal_point = __u.__w;
123.2184 -+
123.2185 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
123.2186 -+	  _M_data->_M_thousands_sep = __u.__w;
123.2187 -+#endif
123.2188 -+
123.2189 -+	  if (_M_data->_M_thousands_sep == L'\0')
123.2190 -+	    _M_data->_M_grouping = "";
123.2191 -+	  else
123.2192 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
123.2193 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
123.2194 -+	}
123.2195 -+
123.2196 -+      // NB: There is no way to extact this info from posix locales.
123.2197 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
123.2198 -+      _M_data->_M_truename = L"true";
123.2199 -+      _M_data->_M_truename_size = 4;
123.2200 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
123.2201 -+      _M_data->_M_falsename = L"false";
123.2202 -+      _M_data->_M_falsename_size = 5;
123.2203 -+    }
123.2204 -+
123.2205 -+  template<> 
123.2206 -+    numpunct<wchar_t>::~numpunct()
123.2207 -+    { delete _M_data; }
123.2208 -+ #endif
123.2209 -+}
123.2210 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.cc
123.2211 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.cc	1969-12-31 18:00:00.000000000 -0600
123.2212 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2005-04-28 01:13:15.000000000 -0500
123.2213 -@@ -0,0 +1,406 @@
123.2214 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
123.2215 -+
123.2216 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
123.2217 -+//
123.2218 -+// This file is part of the GNU ISO C++ Library.  This library is free
123.2219 -+// software; you can redistribute it and/or modify it under the
123.2220 -+// terms of the GNU General Public License as published by the
123.2221 -+// Free Software Foundation; either version 2, or (at your option)
123.2222 -+// any later version.
123.2223 -+
123.2224 -+// This library is distributed in the hope that it will be useful,
123.2225 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
123.2226 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123.2227 -+// GNU General Public License for more details.
123.2228 -+
123.2229 -+// You should have received a copy of the GNU General Public License along
123.2230 -+// with this library; see the file COPYING.  If not, write to the Free
123.2231 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
123.2232 -+// USA.
123.2233 -+
123.2234 -+// As a special exception, you may use this file as part of a free software
123.2235 -+// library without restriction.  Specifically, if other files instantiate
123.2236 -+// templates or use macros or inline functions from this file, or you compile
123.2237 -+// this file and link it with other files to produce an executable, this
123.2238 -+// file does not by itself cause the resulting executable to be covered by
123.2239 -+// the GNU General Public License.  This exception does not however
123.2240 -+// invalidate any other reasons why the executable file might be covered by
123.2241 -+// the GNU General Public License.
123.2242 -+
123.2243 -+//
123.2244 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
123.2245 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
123.2246 -+//
123.2247 -+
123.2248 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
123.2249 -+
123.2250 -+#include <locale>
123.2251 -+#include <bits/c++locale_internal.h>
123.2252 -+
123.2253 -+#ifdef __UCLIBC_MJN3_ONLY__
123.2254 -+#warning tailor for stub locale support
123.2255 -+#endif
123.2256 -+#ifndef __UCLIBC_HAS_XLOCALE__
123.2257 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
123.2258 -+#endif
123.2259 -+
123.2260 -+namespace std
123.2261 -+{
123.2262 -+  template<>
123.2263 -+    void
123.2264 -+    __timepunct<char>::
123.2265 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
123.2266 -+	   const tm* __tm) const
123.2267 -+    {
123.2268 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.2269 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
123.2270 -+					_M_c_locale_timepunct);
123.2271 -+#else
123.2272 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
123.2273 -+      setlocale(LC_ALL, _M_name_timepunct);
123.2274 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
123.2275 -+      setlocale(LC_ALL, __old);
123.2276 -+      free(__old);
123.2277 -+#endif
123.2278 -+      // Make sure __s is null terminated.
123.2279 -+      if (__len == 0)
123.2280 -+	__s[0] = '\0';
123.2281 -+    }
123.2282 -+
123.2283 -+  template<> 
123.2284 -+    void
123.2285 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
123.2286 -+    {
123.2287 -+      if (!_M_data)
123.2288 -+	_M_data = new __timepunct_cache<char>;
123.2289 -+
123.2290 -+      if (!__cloc)
123.2291 -+	{
123.2292 -+	  // "C" locale
123.2293 -+	  _M_c_locale_timepunct = _S_get_c_locale();
123.2294 -+
123.2295 -+	  _M_data->_M_date_format = "%m/%d/%y";
123.2296 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
123.2297 -+	  _M_data->_M_time_format = "%H:%M:%S";
123.2298 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
123.2299 -+	  _M_data->_M_date_time_format = "";
123.2300 -+	  _M_data->_M_date_time_era_format = "";
123.2301 -+	  _M_data->_M_am = "AM";
123.2302 -+	  _M_data->_M_pm = "PM";
123.2303 -+	  _M_data->_M_am_pm_format = "";
123.2304 -+
123.2305 -+	  // Day names, starting with "C"'s Sunday.
123.2306 -+	  _M_data->_M_day1 = "Sunday";
123.2307 -+	  _M_data->_M_day2 = "Monday";
123.2308 -+	  _M_data->_M_day3 = "Tuesday";
123.2309 -+	  _M_data->_M_day4 = "Wednesday";
123.2310 -+	  _M_data->_M_day5 = "Thursday";
123.2311 -+	  _M_data->_M_day6 = "Friday";
123.2312 -+	  _M_data->_M_day7 = "Saturday";
123.2313 -+
123.2314 -+	  // Abbreviated day names, starting with "C"'s Sun.
123.2315 -+	  _M_data->_M_aday1 = "Sun";
123.2316 -+	  _M_data->_M_aday2 = "Mon";
123.2317 -+	  _M_data->_M_aday3 = "Tue";
123.2318 -+	  _M_data->_M_aday4 = "Wed";
123.2319 -+	  _M_data->_M_aday5 = "Thu";
123.2320 -+	  _M_data->_M_aday6 = "Fri";
123.2321 -+	  _M_data->_M_aday7 = "Sat";
123.2322 -+
123.2323 -+	  // Month names, starting with "C"'s January.
123.2324 -+	  _M_data->_M_month01 = "January";
123.2325 -+	  _M_data->_M_month02 = "February";
123.2326 -+	  _M_data->_M_month03 = "March";
123.2327 -+	  _M_data->_M_month04 = "April";
123.2328 -+	  _M_data->_M_month05 = "May";
123.2329 -+	  _M_data->_M_month06 = "June";
123.2330 -+	  _M_data->_M_month07 = "July";
123.2331 -+	  _M_data->_M_month08 = "August";
123.2332 -+	  _M_data->_M_month09 = "September";
123.2333 -+	  _M_data->_M_month10 = "October";
123.2334 -+	  _M_data->_M_month11 = "November";
123.2335 -+	  _M_data->_M_month12 = "December";
123.2336 -+
123.2337 -+	  // Abbreviated month names, starting with "C"'s Jan.
123.2338 -+	  _M_data->_M_amonth01 = "Jan";
123.2339 -+	  _M_data->_M_amonth02 = "Feb";
123.2340 -+	  _M_data->_M_amonth03 = "Mar";
123.2341 -+	  _M_data->_M_amonth04 = "Apr";
123.2342 -+	  _M_data->_M_amonth05 = "May";
123.2343 -+	  _M_data->_M_amonth06 = "Jun";
123.2344 -+	  _M_data->_M_amonth07 = "Jul";
123.2345 -+	  _M_data->_M_amonth08 = "Aug";
123.2346 -+	  _M_data->_M_amonth09 = "Sep";
123.2347 -+	  _M_data->_M_amonth10 = "Oct";
123.2348 -+	  _M_data->_M_amonth11 = "Nov";
123.2349 -+	  _M_data->_M_amonth12 = "Dec";
123.2350 -+	}
123.2351 -+      else
123.2352 -+	{
123.2353 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
123.2354 -+
123.2355 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
123.2356 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
123.2357 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
123.2358 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
123.2359 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
123.2360 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
123.2361 -+							     __cloc);
123.2362 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
123.2363 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
123.2364 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
123.2365 -+
123.2366 -+	  // Day names, starting with "C"'s Sunday.
123.2367 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
123.2368 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
123.2369 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
123.2370 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
123.2371 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
123.2372 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
123.2373 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
123.2374 -+
123.2375 -+	  // Abbreviated day names, starting with "C"'s Sun.
123.2376 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
123.2377 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
123.2378 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
123.2379 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
123.2380 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
123.2381 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
123.2382 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
123.2383 -+
123.2384 -+	  // Month names, starting with "C"'s January.
123.2385 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
123.2386 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
123.2387 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
123.2388 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
123.2389 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
123.2390 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
123.2391 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
123.2392 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
123.2393 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
123.2394 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
123.2395 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
123.2396 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
123.2397 -+
123.2398 -+	  // Abbreviated month names, starting with "C"'s Jan.
123.2399 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
123.2400 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
123.2401 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
123.2402 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
123.2403 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
123.2404 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
123.2405 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
123.2406 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
123.2407 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
123.2408 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
123.2409 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
123.2410 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
123.2411 -+	}
123.2412 -+    }
123.2413 -+
123.2414 -+#ifdef _GLIBCXX_USE_WCHAR_T
123.2415 -+  template<>
123.2416 -+    void
123.2417 -+    __timepunct<wchar_t>::
123.2418 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
123.2419 -+	   const tm* __tm) const
123.2420 -+    {
123.2421 -+#ifdef __UCLIBC_HAS_XLOCALE__
123.2422 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
123.2423 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
123.2424 -+					_M_c_locale_timepunct);
123.2425 -+#else
123.2426 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
123.2427 -+      setlocale(LC_ALL, _M_name_timepunct);
123.2428 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
123.2429 -+      setlocale(LC_ALL, __old);
123.2430 -+      free(__old);
123.2431 -+#endif
123.2432 -+      // Make sure __s is null terminated.
123.2433 -+      if (__len == 0)
123.2434 -+	__s[0] = L'\0';
123.2435 -+    }
123.2436 -+
123.2437 -+  template<> 
123.2438 -+    void
123.2439 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
123.2440 -+    {
123.2441 -+      if (!_M_data)
123.2442 -+	_M_data = new __timepunct_cache<wchar_t>;
123.2443 -+
123.2444 -+#warning wide time stuff
123.2445 -+//       if (!__cloc)
123.2446 -+	{
123.2447 -+	  // "C" locale
123.2448 -+	  _M_c_locale_timepunct = _S_get_c_locale();
123.2449 -+
123.2450 -+	  _M_data->_M_date_format = L"%m/%d/%y";
123.2451 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
123.2452 -+	  _M_data->_M_time_format = L"%H:%M:%S";
123.2453 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
123.2454 -+	  _M_data->_M_date_time_format = L"";
123.2455 -+	  _M_data->_M_date_time_era_format = L"";
123.2456 -+	  _M_data->_M_am = L"AM";
123.2457 -+	  _M_data->_M_pm = L"PM";
123.2458 -+	  _M_data->_M_am_pm_format = L"";
123.2459 -+
123.2460 -+	  // Day names, starting with "C"'s Sunday.
123.2461 -+	  _M_data->_M_day1 = L"Sunday";
123.2462 -+	  _M_data->_M_day2 = L"Monday";
123.2463 -+	  _M_data->_M_day3 = L"Tuesday";
123.2464 -+	  _M_data->_M_day4 = L"Wednesday";
123.2465 -+	  _M_data->_M_day5 = L"Thursday";
123.2466 -+	  _M_data->_M_day6 = L"Friday";
123.2467 -+	  _M_data->_M_day7 = L"Saturday";
123.2468 -+
123.2469 -+	  // Abbreviated day names, starting with "C"'s Sun.
123.2470 -+	  _M_data->_M_aday1 = L"Sun";
123.2471 -+	  _M_data->_M_aday2 = L"Mon";
123.2472 -+	  _M_data->_M_aday3 = L"Tue";
123.2473 -+	  _M_data->_M_aday4 = L"Wed";
123.2474 -+	  _M_data->_M_aday5 = L"Thu";
123.2475 -+	  _M_data->_M_aday6 = L"Fri";
123.2476 -+	  _M_data->_M_aday7 = L"Sat";
123.2477 -+
123.2478 -+	  // Month names, starting with "C"'s January.
123.2479 -+	  _M_data->_M_month01 = L"January";
123.2480 -+	  _M_data->_M_month02 = L"February";
123.2481 -+	  _M_data->_M_month03 = L"March";
123.2482 -+	  _M_data->_M_month04 = L"April";
123.2483 -+	  _M_data->_M_month05 = L"May";
123.2484 -+	  _M_data->_M_month06 = L"June";
123.2485 -+	  _M_data->_M_month07 = L"July";
123.2486 -+	  _M_data->_M_month08 = L"August";
123.2487 -+	  _M_data->_M_month09 = L"September";
123.2488 -+	  _M_data->_M_month10 = L"October";
123.2489 -+	  _M_data->_M_month11 = L"November";
123.2490 -+	  _M_data->_M_month12 = L"December";
123.2491 -+
123.2492 -+	  // Abbreviated month names, starting with "C"'s Jan.
123.2493 -+	  _M_data->_M_amonth01 = L"Jan";
123.2494 -+	  _M_data->_M_amonth02 = L"Feb";
123.2495 -+	  _M_data->_M_amonth03 = L"Mar";
123.2496 -+	  _M_data->_M_amonth04 = L"Apr";
123.2497 -+	  _M_data->_M_amonth05 = L"May";
123.2498 -+	  _M_data->_M_amonth06 = L"Jun";
123.2499 -+	  _M_data->_M_amonth07 = L"Jul";
123.2500 -+	  _M_data->_M_amonth08 = L"Aug";
123.2501 -+	  _M_data->_M_amonth09 = L"Sep";
123.2502 -+	  _M_data->_M_amonth10 = L"Oct";
123.2503 -+	  _M_data->_M_amonth11 = L"Nov";
123.2504 -+	  _M_data->_M_amonth12 = L"Dec";
123.2505 -+	}
123.2506 -+#if 0
123.2507 -+      else
123.2508 -+	{
123.2509 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
123.2510 -+
123.2511 -+	  union { char *__s; wchar_t *__w; } __u;
123.2512 -+
123.2513 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
123.2514 -+	  _M_data->_M_date_format = __u.__w;
123.2515 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
123.2516 -+	  _M_data->_M_date_era_format = __u.__w;
123.2517 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
123.2518 -+	  _M_data->_M_time_format = __u.__w;
123.2519 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
123.2520 -+	  _M_data->_M_time_era_format = __u.__w;
123.2521 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
123.2522 -+	  _M_data->_M_date_time_format = __u.__w;
123.2523 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
123.2524 -+	  _M_data->_M_date_time_era_format = __u.__w;
123.2525 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
123.2526 -+	  _M_data->_M_am = __u.__w;
123.2527 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
123.2528 -+	  _M_data->_M_pm = __u.__w;
123.2529 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
123.2530 -+	  _M_data->_M_am_pm_format = __u.__w;
123.2531 -+
123.2532 -+	  // Day names, starting with "C"'s Sunday.
123.2533 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
123.2534 -+	  _M_data->_M_day1 = __u.__w;
123.2535 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
123.2536 -+	  _M_data->_M_day2 = __u.__w;
123.2537 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
123.2538 -+	  _M_data->_M_day3 = __u.__w;
123.2539 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
123.2540 -+	  _M_data->_M_day4 = __u.__w;
123.2541 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
123.2542 -+	  _M_data->_M_day5 = __u.__w;
123.2543 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
123.2544 -+	  _M_data->_M_day6 = __u.__w;
123.2545 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
123.2546 -+	  _M_data->_M_day7 = __u.__w;
123.2547 -+
123.2548 -+	  // Abbreviated day names, starting with "C"'s Sun.
123.2549 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
123.2550 -+	  _M_data->_M_aday1 = __u.__w;
123.2551 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
123.2552 -+	  _M_data->_M_aday2 = __u.__w;
123.2553 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
123.2554 -+	  _M_data->_M_aday3 = __u.__w;
123.2555 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
123.2556 -+	  _M_data->_M_aday4 = __u.__w;
123.2557 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
123.2558 -+	  _M_data->_M_aday5 = __u.__w;
123.2559 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
123.2560 -+	  _M_data->_M_aday6 = __u.__w;
123.2561 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
123.2562 -+	  _M_data->_M_aday7 = __u.__w;
123.2563 -+
123.2564 -+	  // Month names, starting with "C"'s January.
123.2565 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
123.2566 -+	  _M_data->_M_month01 = __u.__w;
123.2567 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
123.2568 -+	  _M_data->_M_month02 = __u.__w;
123.2569 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
123.2570 -+	  _M_data->_M_month03 = __u.__w;
123.2571 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
123.2572 -+	  _M_data->_M_month04 = __u.__w;
123.2573 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
123.2574 -+	  _M_data->_M_month05 = __u.__w;
123.2575 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
123.2576 -+	  _M_data->_M_month06 = __u.__w;
123.2577 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
123.2578 -+	  _M_data->_M_month07 = __u.__w;
123.2579 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
123.2580 -+	  _M_data->_M_month08 = __u.__w;
123.2581 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
123.2582 -+	  _M_data->_M_month09 = __u.__w;
123.2583 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
123.2584 -+	  _M_data->_M_month10 = __u.__w;
123.2585 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
123.2586 -+	  _M_data->_M_month11 = __u.__w;
123.2587 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
123.2588 -+	  _M_data->_M_month12 = __u.__w;
123.2589 -+
123.2590 -+	  // Abbreviated month names, starting with "C"'s Jan.
123.2591 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
123.2592 -+	  _M_data->_M_amonth01 = __u.__w;
123.2593 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
123.2594 -+	  _M_data->_M_amonth02 = __u.__w;
123.2595 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
123.2596 -+	  _M_data->_M_amonth03 = __u.__w;
123.2597 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
123.2598 -+	  _M_data->_M_amonth04 = __u.__w;
123.2599 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
123.2600 -+	  _M_data->_M_amonth05 = __u.__w;
123.2601 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
123.2602 -+	  _M_data->_M_amonth06 = __u.__w;
123.2603 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
123.2604 -+	  _M_data->_M_amonth07 = __u.__w;
123.2605 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
123.2606 -+	  _M_data->_M_amonth08 = __u.__w;
123.2607 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
123.2608 -+	  _M_data->_M_amonth09 = __u.__w;
123.2609 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
123.2610 -+	  _M_data->_M_amonth10 = __u.__w;
123.2611 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
123.2612 -+	  _M_data->_M_amonth11 = __u.__w;
123.2613 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
123.2614 -+	  _M_data->_M_amonth12 = __u.__w;
123.2615 -+	}
123.2616 -+#endif // 0
123.2617 -+    }
123.2618 -+#endif
123.2619 -+}
123.2620 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.h
123.2621 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.h	1969-12-31 18:00:00.000000000 -0600
123.2622 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.h	2004-05-22 18:46:31.000000000 -0500
123.2623 -@@ -0,0 +1,68 @@
123.2624 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
123.2625 -+
123.2626 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
123.2627 -+//
123.2628 -+// This file is part of the GNU ISO C++ Library.  This library is free
123.2629 -+// software; you can redistribute it and/or modify it under the
123.2630 -+// terms of the GNU General Public License as published by the
123.2631 -+// Free Software Foundation; either version 2, or (at your option)
123.2632 -+// any later version.
123.2633 -+
123.2634 -+// This library is distributed in the hope that it will be useful,
123.2635 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
123.2636 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123.2637 -+// GNU General Public License for more details.
123.2638 -+
123.2639 -+// You should have received a copy of the GNU General Public License along
123.2640 -+// with this library; see the file COPYING.  If not, write to the Free
123.2641 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
123.2642 -+// USA.
123.2643 -+
123.2644 -+// As a special exception, you may use this file as part of a free software
123.2645 -+// library without restriction.  Specifically, if other files instantiate
123.2646 -+// templates or use macros or inline functions from this file, or you compile
123.2647 -+// this file and link it with other files to produce an executable, this
123.2648 -+// file does not by itself cause the resulting executable to be covered by
123.2649 -+// the GNU General Public License.  This exception does not however
123.2650 -+// invalidate any other reasons why the executable file might be covered by
123.2651 -+// the GNU General Public License.
123.2652 -+
123.2653 -+//
123.2654 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
123.2655 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
123.2656 -+//
123.2657 -+
123.2658 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
123.2659 -+
123.2660 -+  template<typename _CharT>
123.2661 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
123.2662 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
123.2663 -+    _M_name_timepunct(_S_get_c_name())
123.2664 -+    { _M_initialize_timepunct(); }
123.2665 -+
123.2666 -+  template<typename _CharT>
123.2667 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
123.2668 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
123.2669 -+    _M_name_timepunct(_S_get_c_name())
123.2670 -+    { _M_initialize_timepunct(); }
123.2671 -+
123.2672 -+  template<typename _CharT>
123.2673 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
123.2674 -+				     size_t __refs) 
123.2675 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
123.2676 -+    _M_name_timepunct(__s)
123.2677 -+    { 
123.2678 -+      char* __tmp = new char[std::strlen(__s) + 1];
123.2679 -+      std::strcpy(__tmp, __s);
123.2680 -+      _M_name_timepunct = __tmp;
123.2681 -+      _M_initialize_timepunct(__cloc); 
123.2682 -+    }
123.2683 -+
123.2684 -+  template<typename _CharT>
123.2685 -+    __timepunct<_CharT>::~__timepunct()
123.2686 -+    { 
123.2687 -+      if (_M_name_timepunct != _S_get_c_name())
123.2688 -+	delete [] _M_name_timepunct;
123.2689 -+      delete _M_data; 
123.2690 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
123.2691 -+    }
123.2692 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_base.h
123.2693 ---- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_base.h	1969-12-31 18:00:00.000000000 -0600
123.2694 -+++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_base.h	2005-04-28 01:10:27.000000000 -0500
123.2695 -@@ -0,0 +1,64 @@
123.2696 -+// Locale support -*- C++ -*-
123.2697 -+
123.2698 -+// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
123.2699 -+// Free Software Foundation, Inc.
123.2700 -+//
123.2701 -+// This file is part of the GNU ISO C++ Library.  This library is free
123.2702 -+// software; you can redistribute it and/or modify it under the
123.2703 -+// terms of the GNU General Public License as published by the
123.2704 -+// Free Software Foundation; either version 2, or (at your option)
123.2705 -+// any later version.
123.2706 -+
123.2707 -+// This library is distributed in the hope that it will be useful,
123.2708 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
123.2709 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123.2710 -+// GNU General Public License for more details.
123.2711 -+
123.2712 -+// You should have received a copy of the GNU General Public License along
123.2713 -+// with this library; see the file COPYING.  If not, write to the Free
123.2714 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
123.2715 -+// USA.
123.2716 -+
123.2717 -+// As a special exception, you may use this file as part of a free software
123.2718 -+// library without restriction.  Specifically, if other files instantiate
123.2719 -+// templates or use macros or inline functions from this file, or you compile
123.2720 -+// this file and link it with other files to produce an executable, this
123.2721 -+// file does not by itself cause the resulting executable to be covered by
123.2722 -+// the GNU General Public License.  This exception does not however
123.2723 -+// invalidate any other reasons why the executable file might be covered by
123.2724 -+// the GNU General Public License.
123.2725 -+
123.2726 -+//
123.2727 -+// ISO C++ 14882: 22.1  Locales
123.2728 -+//
123.2729 -+  
123.2730 -+/** @file ctype_base.h
123.2731 -+ *  This is an internal header file, included by other library headers.
123.2732 -+ *  You should not attempt to use it directly.
123.2733 -+ */
123.2734 -+
123.2735 -+// Information as gleaned from /usr/include/ctype.h
123.2736 -+  
123.2737 -+  /// @brief  Base class for ctype.
123.2738 -+  struct ctype_base
123.2739 -+  {
123.2740 -+    // Note: In uClibc, the following two types depend on configuration.
123.2741 -+ 
123.2742 -+    // Non-standard typedefs.
123.2743 -+    typedef const __ctype_touplow_t* __to_type;
123.2744 -+
123.2745 -+    // NB: Offsets into ctype<char>::_M_table force a particular size
123.2746 -+    // on the mask type. Because of this, we don't use an enum.
123.2747 -+    typedef __ctype_mask_t	mask;   
123.2748 -+    static const mask upper    	= _ISupper;
123.2749 -+    static const mask lower 	= _ISlower;
123.2750 -+    static const mask alpha 	= _ISalpha;
123.2751 -+    static const mask digit 	= _ISdigit;
123.2752 -+    static const mask xdigit 	= _ISxdigit;
123.2753 -+    static const mask space 	= _ISspace;
123.2754 -+    static const mask print 	= _ISprint;
123.2755 -+    static const mask graph 	= _ISalpha | _ISdigit | _ISpunct;
123.2756 -+    static const mask cntrl 	= _IScntrl;
123.2757 -+    static const mask punct 	= _ISpunct;
123.2758 -+    static const mask alnum 	= _ISalpha | _ISdigit;
123.2759 -+  };
123.2760 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
123.2761 ---- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_inline.h	1969-12-31 18:00:00.000000000 -0600
123.2762 -+++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_inline.h	2002-06-24 00:49:19.000000000 -0500
123.2763 -@@ -0,0 +1,69 @@
123.2764 -+// Locale support -*- C++ -*-
123.2765 -+
123.2766 -+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
123.2767 -+//
123.2768 -+// This file is part of the GNU ISO C++ Library.  This library is free
123.2769 -+// software; you can redistribute it and/or modify it under the
123.2770 -+// terms of the GNU General Public License as published by the
123.2771 -+// Free Software Foundation; either version 2, or (at your option)
123.2772 -+// any later version.
123.2773 -+
123.2774 -+// This library is distributed in the hope that it will be useful,
123.2775 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
123.2776 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123.2777 -+// GNU General Public License for more details.
123.2778 -+
123.2779 -+// You should have received a copy of the GNU General Public License along
123.2780 -+// with this library; see the file COPYING.  If not, write to the Free
123.2781 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
123.2782 -+// USA.
123.2783 -+
123.2784 -+// As a special exception, you may use this file as part of a free software
123.2785 -+// library without restriction.  Specifically, if other files instantiate
123.2786 -+// templates or use macros or inline functions from this file, or you compile
123.2787 -+// this file and link it with other files to produce an executable, this
123.2788 -+// file does not by itself cause the resulting executable to be covered by
123.2789 -+// the GNU General Public License.  This exception does not however
123.2790 -+// invalidate any other reasons why the executable file might be covered by
123.2791 -+// the GNU General Public License.
123.2792 -+
123.2793 -+//
123.2794 -+// ISO C++ 14882: 22.1  Locales
123.2795 -+//
123.2796 -+  
123.2797 -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
123.2798 -+// functions go in ctype.cc
123.2799 -+  
123.2800 -+  bool
123.2801 -+  ctype<char>::
123.2802 -+  is(mask __m, char __c) const
123.2803 -+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
123.2804 -+
123.2805 -+  const char*
123.2806 -+  ctype<char>::
123.2807 -+  is(const char* __low, const char* __high, mask* __vec) const
123.2808 -+  {
123.2809 -+    while (__low < __high)
123.2810 -+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
123.2811 -+    return __high;
123.2812 -+  }
123.2813 -+
123.2814 -+  const char*
123.2815 -+  ctype<char>::
123.2816 -+  scan_is(mask __m, const char* __low, const char* __high) const
123.2817 -+  {
123.2818 -+    while (__low < __high 
123.2819 -+	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
123.2820 -+      ++__low;
123.2821 -+    return __low;
123.2822 -+  }
123.2823 -+
123.2824 -+  const char*
123.2825 -+  ctype<char>::
123.2826 -+  scan_not(mask __m, const char* __low, const char* __high) const
123.2827 -+  {
123.2828 -+    while (__low < __high 
123.2829 -+	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
123.2830 -+      ++__low;
123.2831 -+    return __low;
123.2832 -+  }
123.2833 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
123.2834 ---- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_noninline.h	1969-12-31 18:00:00.000000000 -0600
123.2835 -+++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h	2005-04-28 01:10:27.000000000 -0500
123.2836 -@@ -0,0 +1,92 @@
123.2837 -+// Locale support -*- C++ -*-
123.2838 -+
123.2839 -+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
123.2840 -+// Free Software Foundation, Inc.
123.2841 -+//
123.2842 -+// This file is part of the GNU ISO C++ Library.  This library is free
123.2843 -+// software; you can redistribute it and/or modify it under the
123.2844 -+// terms of the GNU General Public License as published by the
123.2845 -+// Free Software Foundation; either version 2, or (at your option)
123.2846 -+// any later version.
123.2847 -+
123.2848 -+// This library is distributed in the hope that it will be useful,
123.2849 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
123.2850 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123.2851 -+// GNU General Public License for more details.
123.2852 -+
123.2853 -+// You should have received a copy of the GNU General Public License along
123.2854 -+// with this library; see the file COPYING.  If not, write to the Free
123.2855 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
123.2856 -+// USA.
123.2857 -+
123.2858 -+// As a special exception, you may use this file as part of a free software
123.2859 -+// library without restriction.  Specifically, if other files instantiate
123.2860 -+// templates or use macros or inline functions from this file, or you compile
123.2861 -+// this file and link it with other files to produce an executable, this
123.2862 -+// file does not by itself cause the resulting executable to be covered by
123.2863 -+// the GNU General Public License.  This exception does not however
123.2864 -+// invalidate any other reasons why the executable file might be covered by
123.2865 -+// the GNU General Public License.
123.2866 -+
123.2867 -+//
123.2868 -+// ISO C++ 14882: 22.1  Locales
123.2869 -+//
123.2870 -+  
123.2871 -+// Information as gleaned from /usr/include/ctype.h
123.2872 -+
123.2873 -+  const ctype_base::mask*
123.2874 -+  ctype<char>::classic_table() throw()
123.2875 -+  { return __C_ctype_b; }
123.2876 -+
123.2877 -+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
123.2878 -+		     size_t __refs) 
123.2879 -+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
123.2880 -+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
123.2881 -+  {
123.2882 -+    _M_toupper = __C_ctype_toupper;
123.2883 -+    _M_tolower = __C_ctype_tolower;
123.2884 -+    _M_table = __table ? __table : __C_ctype_b;
123.2885 -+    memset(_M_widen, 0, sizeof(_M_widen));
123.2886 -+    memset(_M_narrow, 0, sizeof(_M_narrow));
123.2887 -+  }
123.2888 -+
123.2889 -+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
123.2890 -+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
123.2891 -+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
123.2892 -+  {
123.2893 -+    _M_toupper = __C_ctype_toupper;
123.2894 -+    _M_tolower = __C_ctype_tolower;
123.2895 -+    _M_table = __table ? __table : __C_ctype_b;
123.2896 -+    memset(_M_widen, 0, sizeof(_M_widen));
123.2897 -+    memset(_M_narrow, 0, sizeof(_M_narrow));
123.2898 -+  }
123.2899 -+
123.2900 -+  char
123.2901 -+  ctype<char>::do_toupper(char __c) const
123.2902 -+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
123.2903 -+
123.2904 -+  const char*
123.2905 -+  ctype<char>::do_toupper(char* __low, const char* __high) const
123.2906 -+  {
123.2907 -+    while (__low < __high)
123.2908 -+      {
123.2909 -+	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
123.2910 -+	++__low;
123.2911 -+      }
123.2912 -+    return __high;
123.2913 -+  }
123.2914 -+
123.2915 -+  char
123.2916 -+  ctype<char>::do_tolower(char __c) const
123.2917 -+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
123.2918 -+
123.2919 -+  const char* 
123.2920 -+  ctype<char>::do_tolower(char* __low, const char* __high) const
123.2921 -+  {
123.2922 -+    while (__low < __high)
123.2923 -+      {
123.2924 -+	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
123.2925 -+	++__low;
123.2926 -+      }
123.2927 -+    return __high;
123.2928 -+  }
123.2929 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/os_defines.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/os_defines.h
123.2930 ---- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/os_defines.h	1969-12-31 18:00:00.000000000 -0600
123.2931 -+++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/os_defines.h	2005-04-28 01:10:27.000000000 -0500
123.2932 -@@ -0,0 +1,44 @@
123.2933 -+// Specific definitions for GNU/Linux  -*- C++ -*-
123.2934 -+
123.2935 -+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
123.2936 -+//
123.2937 -+// This file is part of the GNU ISO C++ Library.  This library is free
123.2938 -+// software; you can redistribute it and/or modify it under the
123.2939 -+// terms of the GNU General Public License as published by the
123.2940 -+// Free Software Foundation; either version 2, or (at your option)
123.2941 -+// any later version.
123.2942 -+
123.2943 -+// This library is distributed in the hope that it will be useful,
123.2944 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
123.2945 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
123.2946 -+// GNU General Public License for more details.
123.2947 -+
123.2948 -+// You should have received a copy of the GNU General Public License along
123.2949 -+// with this library; see the file COPYING.  If not, write to the Free
123.2950 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
123.2951 -+// USA.
123.2952 -+
123.2953 -+// As a special exception, you may use this file as part of a free software
123.2954 -+// library without restriction.  Specifically, if other files instantiate
123.2955 -+// templates or use macros or inline functions from this file, or you compile
123.2956 -+// this file and link it with other files to produce an executable, this
123.2957 -+// file does not by itself cause the resulting executable to be covered by
123.2958 -+// the GNU General Public License.  This exception does not however
123.2959 -+// invalidate any other reasons why the executable file might be covered by
123.2960 -+// the GNU General Public License.
123.2961 -+
123.2962 -+#ifndef _GLIBCXX_OS_DEFINES
123.2963 -+#define _GLIBCXX_OS_DEFINES 1
123.2964 -+
123.2965 -+// System-specific #define, typedefs, corrections, etc, go here.  This
123.2966 -+// file will come before all others.
123.2967 -+
123.2968 -+// This keeps isanum, et al from being propagated as macros.
123.2969 -+#define __NO_CTYPE 1
123.2970 -+
123.2971 -+#include <features.h>
123.2972 -+
123.2973 -+// We must not see the optimized string functions GNU libc defines.
123.2974 -+#define __NO_STRING_INLINES
123.2975 -+
123.2976 -+#endif
123.2977 -diff -urN gcc-4.0.0-100/libstdc++-v3/configure gcc-4.0.0/libstdc++-v3/configure
123.2978 ---- gcc-4.0.0-100/libstdc++-v3/configure	2005-04-30 13:06:53.683055232 -0500
123.2979 -+++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 12:24:24.000000000 -0500
123.2980 -@@ -3998,6 +3998,11 @@
123.2981 -   lt_cv_deplibs_check_method=pass_all
123.2982 -   ;;
123.2983 - 
123.2984 -+linux-uclibc*)
123.2985 -+  lt_cv_deplibs_check_method=pass_all
123.2986 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
123.2987 -+  ;;
123.2988 -+
123.2989 - netbsd* | knetbsd*-gnu)
123.2990 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
123.2991 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
123.2992 -@@ -5672,7 +5677,7 @@
123.2993 -   enableval="$enable_clocale"
123.2994 - 
123.2995 -       case "$enableval" in
123.2996 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
123.2997 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
123.2998 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
123.2999 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
123.3000 -    { (exit 1); exit 1; }; } ;;
123.3001 -@@ -5697,6 +5702,9 @@
123.3002 -   # Default to "generic".
123.3003 -   if test $enable_clocale_flag = auto; then
123.3004 -     case ${target_os} in
123.3005 -+      linux-uclibc*)
123.3006 -+	enable_clocale_flag=uclibc
123.3007 -+	;;
123.3008 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
123.3009 -         cat >conftest.$ac_ext <<_ACEOF
123.3010 - /* confdefs.h.  */
123.3011 -@@ -5927,6 +5935,76 @@
123.3012 -       CTIME_CC=config/locale/generic/time_members.cc
123.3013 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
123.3014 -       ;;
123.3015 -+    uclibc)
123.3016 -+      echo "$as_me:$LINENO: result: uclibc" >&5
123.3017 -+echo "${ECHO_T}uclibc" >&6
123.3018 -+
123.3019 -+      # Declare intention to use gettext, and add support for specific
123.3020 -+      # languages.
123.3021 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
123.3022 -+      ALL_LINGUAS="de fr"
123.3023 -+
123.3024 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
123.3025 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
123.3026 -+set dummy msgfmt; ac_word=$2
123.3027 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
123.3028 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
123.3029 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
123.3030 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
123.3031 -+else
123.3032 -+  if test -n "$check_msgfmt"; then
123.3033 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
123.3034 -+else
123.3035 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
123.3036 -+for as_dir in $PATH
123.3037 -+do
123.3038 -+  IFS=$as_save_IFS
123.3039 -+  test -z "$as_dir" && as_dir=.
123.3040 -+  for ac_exec_ext in '' $ac_executable_extensions; do
123.3041 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
123.3042 -+    ac_cv_prog_check_msgfmt="yes"
123.3043 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
123.3044 -+    break 2
123.3045 -+  fi
123.3046 -+done
123.3047 -+done
123.3048 -+
123.3049 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
123.3050 -+fi
123.3051 -+fi
123.3052 -+check_msgfmt=$ac_cv_prog_check_msgfmt
123.3053 -+if test -n "$check_msgfmt"; then
123.3054 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
123.3055 -+echo "${ECHO_T}$check_msgfmt" >&6
123.3056 -+else
123.3057 -+  echo "$as_me:$LINENO: result: no" >&5
123.3058 -+echo "${ECHO_T}no" >&6
123.3059 -+fi
123.3060 -+
123.3061 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
123.3062 -+        USE_NLS=yes
123.3063 -+      fi
123.3064 -+      # Export the build objects.
123.3065 -+      for ling in $ALL_LINGUAS; do \
123.3066 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
123.3067 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
123.3068 -+      done
123.3069 -+
123.3070 -+
123.3071 -+
123.3072 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
123.3073 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
123.3074 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
123.3075 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
123.3076 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
123.3077 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
123.3078 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
123.3079 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
123.3080 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
123.3081 -+      CTIME_H=config/locale/uclibc/time_members.h
123.3082 -+      CTIME_CC=config/locale/uclibc/time_members.cc
123.3083 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
123.3084 -+      ;;
123.3085 -   esac
123.3086 - 
123.3087 -   # This is where the testsuite looks for locale catalogs, using the
123.3088 -diff -urN gcc-4.0.0-100/libstdc++-v3/configure.host gcc-4.0.0/libstdc++-v3/configure.host
123.3089 ---- gcc-4.0.0-100/libstdc++-v3/configure.host	2005-04-30 13:06:53.688054472 -0500
123.3090 -+++ gcc-4.0.0/libstdc++-v3/configure.host	2005-04-28 20:20:32.000000000 -0500
123.3091 -@@ -249,6 +249,12 @@
123.3092 -     ;;
123.3093 - esac
123.3094 - 
123.3095 -+# Override for uClibc since linux-uclibc gets mishandled above.
123.3096 -+case "${host_os}" in
123.3097 -+  *-uclibc*)
123.3098 -+    os_include_dir="os/uclibc"
123.3099 -+    ;;
123.3100 -+esac
123.3101 - 
123.3102 - # Set any OS-dependent and CPU-dependent bits.
123.3103 - # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
123.3104 -diff -urN gcc-4.0.0-100/libstdc++-v3/crossconfig.m4 gcc-4.0.0/libstdc++-v3/crossconfig.m4
123.3105 ---- gcc-4.0.0-100/libstdc++-v3/crossconfig.m4	2005-04-30 13:06:53.689054320 -0500
123.3106 -+++ gcc-4.0.0/libstdc++-v3/crossconfig.m4	2005-04-28 20:27:15.000000000 -0500
123.3107 -@@ -142,6 +142,98 @@
123.3108 - 	;;
123.3109 -     esac
123.3110 -     ;;
123.3111 -+  *-uclibc*)
123.3112 -+# Temporary hack until we implement the float versions of the libm funcs
123.3113 -+    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
123.3114 -+      machine/endian.h machine/param.h sys/machine.h sys/types.h \
123.3115 -+      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
123.3116 -+    SECTION_FLAGS='-ffunction-sections -fdata-sections'
123.3117 -+    AC_SUBST(SECTION_FLAGS)
123.3118 -+    GLIBCXX_CHECK_LINKER_FEATURES
123.3119 -+    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
123.3120 -+    GLIBCXX_CHECK_WCHAR_T_SUPPORT
123.3121 -+
123.3122 -+    # For LFS.
123.3123 -+    AC_DEFINE(HAVE_INT64_T)
123.3124 -+    case "$target" in
123.3125 -+      *-uclinux*)
123.3126 -+        # Don't enable LFS with uClinux
123.3127 -+        ;;
123.3128 -+      *)
123.3129 -+        AC_DEFINE(_GLIBCXX_USE_LFS)
123.3130 -+    esac
123.3131 -+
123.3132 -+    # For showmanyc_helper().
123.3133 -+    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
123.3134 -+    GLIBCXX_CHECK_POLL
123.3135 -+    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
123.3136 -+
123.3137 -+    # For xsputn_2().
123.3138 -+    AC_CHECK_HEADERS(sys/uio.h)
123.3139 -+    GLIBCXX_CHECK_WRITEV
123.3140 -+
123.3141 -+#     AC_DEFINE(HAVE_ACOSF)
123.3142 -+#     AC_DEFINE(HAVE_ASINF)
123.3143 -+#     AC_DEFINE(HAVE_ATANF)
123.3144 -+#     AC_DEFINE(HAVE_ATAN2F)
123.3145 -+    AC_DEFINE(HAVE_CEILF)
123.3146 -+    AC_DEFINE(HAVE_COPYSIGN)
123.3147 -+#     AC_DEFINE(HAVE_COPYSIGNF)
123.3148 -+#     AC_DEFINE(HAVE_COSF)
123.3149 -+#     AC_DEFINE(HAVE_COSHF)
123.3150 -+#     AC_DEFINE(HAVE_EXPF)
123.3151 -+#     AC_DEFINE(HAVE_FABSF)
123.3152 -+    AC_DEFINE(HAVE_FINITE)
123.3153 -+    AC_DEFINE(HAVE_FINITEF)
123.3154 -+    AC_DEFINE(HAVE_FLOORF)
123.3155 -+#     AC_DEFINE(HAVE_FMODF)
123.3156 -+#     AC_DEFINE(HAVE_FREXPF)
123.3157 -+    AC_DEFINE(HAVE_HYPOT)
123.3158 -+#     AC_DEFINE(HAVE_HYPOTF)
123.3159 -+    AC_DEFINE(HAVE_ISINF)
123.3160 -+    AC_DEFINE(HAVE_ISINFF)
123.3161 -+    AC_DEFINE(HAVE_ISNAN)
123.3162 -+    AC_DEFINE(HAVE_ISNANF)
123.3163 -+#     AC_DEFINE(HAVE_LOGF)
123.3164 -+#     AC_DEFINE(HAVE_LOG10F)
123.3165 -+#     AC_DEFINE(HAVE_MODFF)
123.3166 -+#     AC_DEFINE(HAVE_SINF)
123.3167 -+#     AC_DEFINE(HAVE_SINHF)
123.3168 -+#     AC_DEFINE(HAVE_SINCOS)
123.3169 -+#     AC_DEFINE(HAVE_SINCOSF)
123.3170 -+    AC_DEFINE(HAVE_SQRTF)
123.3171 -+#     AC_DEFINE(HAVE_TANF)
123.3172 -+#     AC_DEFINE(HAVE_TANHF)
123.3173 -+    if test x"long_double_math_on_this_cpu" = x"yes"; then
123.3174 -+#       AC_DEFINE(HAVE_ACOSL)
123.3175 -+#       AC_DEFINE(HAVE_ASINL)
123.3176 -+#       AC_DEFINE(HAVE_ATANL)
123.3177 -+#       AC_DEFINE(HAVE_ATAN2L)
123.3178 -+#       AC_DEFINE(HAVE_CEILL)
123.3179 -+#       AC_DEFINE(HAVE_COPYSIGNL)
123.3180 -+#       AC_DEFINE(HAVE_COSL)
123.3181 -+#       AC_DEFINE(HAVE_COSHL)
123.3182 -+#       AC_DEFINE(HAVE_EXPL)
123.3183 -+#       AC_DEFINE(HAVE_FABSL)
123.3184 -+#       AC_DEFINE(HAVE_FINITEL)
123.3185 -+#       AC_DEFINE(HAVE_FLOORL)
123.3186 -+#       AC_DEFINE(HAVE_FMODL)
123.3187 -+#       AC_DEFINE(HAVE_FREXPL)
123.3188 -+#       AC_DEFINE(HAVE_HYPOTL)
123.3189 -+#       AC_DEFINE(HAVE_ISINFL)
123.3190 -+#       AC_DEFINE(HAVE_ISNANL)
123.3191 -+#       AC_DEFINE(HAVE_LOGL)
123.3192 -+#       AC_DEFINE(HAVE_LOG10L)
123.3193 -+#       AC_DEFINE(HAVE_MODFL)
123.3194 -+#       AC_DEFINE(HAVE_POWL)
123.3195 -+#       AC_DEFINE(HAVE_SINL)
123.3196 -+#       AC_DEFINE(HAVE_SINHL)
123.3197 -+#       AC_DEFINE(HAVE_SINCOSL)
123.3198 -+#       AC_DEFINE(HAVE_SQRTL)
123.3199 -+#       AC_DEFINE(HAVE_TANL)
123.3200 -+#       AC_DEFINE(HAVE_TANHL)
123.3201 -+    fi
123.3202 -+    ;;
123.3203 -   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
123.3204 -     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
123.3205 -       machine/endian.h machine/param.h sys/machine.h sys/types.h \
123.3206 -@@ -156,7 +248,7 @@
123.3207 -     AC_DEFINE(HAVE_INT64_T)
123.3208 -     case "$target" in
123.3209 -       *-uclinux*)
123.3210 --        # Don't enable LFS with uClibc
123.3211 -+        # Don't enable LFS with uClinux
123.3212 -         ;;
123.3213 -       *)
123.3214 -         AC_DEFINE(_GLIBCXX_USE_LFS)
123.3215 -diff -urN gcc-4.0.0-100/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.0.0/libstdc++-v3/include/c_compatibility/wchar.h
123.3216 ---- gcc-4.0.0-100/libstdc++-v3/include/c_compatibility/wchar.h	2005-04-30 13:06:53.690054168 -0500
123.3217 -+++ gcc-4.0.0/libstdc++-v3/include/c_compatibility/wchar.h	2005-04-28 20:15:56.000000000 -0500
123.3218 -@@ -101,7 +101,9 @@
123.3219 - using std::wmemcpy;
123.3220 - using std::wmemmove;
123.3221 - using std::wmemset;
123.3222 -+#if _GLIBCXX_HAVE_WCSFTIME
123.3223 - using std::wcsftime;
123.3224 -+#endif
123.3225 - 
123.3226 - #if _GLIBCXX_USE_C99
123.3227 - using std::wcstold;
123.3228 -diff -urN gcc-4.0.0-100/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.0.0/libstdc++-v3/include/c_std/std_cwchar.h
123.3229 ---- gcc-4.0.0-100/libstdc++-v3/include/c_std/std_cwchar.h	2005-04-30 13:06:53.691054016 -0500
123.3230 -+++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cwchar.h	2005-04-28 20:15:56.000000000 -0500
123.3231 -@@ -179,7 +179,9 @@
123.3232 -   using ::wcscoll;
123.3233 -   using ::wcscpy;
123.3234 -   using ::wcscspn;
123.3235 -+#if _GLIBCXX_HAVE_WCSFTIME
123.3236 -   using ::wcsftime;
123.3237 -+#endif
123.3238 -   using ::wcslen;
123.3239 -   using ::wcsncat;
123.3240 -   using ::wcsncmp;
   124.1 --- a/patches/gcc/4.0.3/300-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   124.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   124.3 @@ -1,45 +0,0 @@
   124.4 ---- gcc-4.0.0/libstdc++-v3/src/Makefile.am
   124.5 -+++ gcc-4.0.0/libstdc++-v3/src/Makefile.am
   124.6 -@@ -214,6 +214,10 @@
   124.7 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
   124.8 - 
   124.9 - 
  124.10 -+install-exec-local:
  124.11 -+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  124.12 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  124.13 -+
  124.14 - # Added bits to build debug library.
  124.15 - if GLIBCXX_BUILD_DEBUG
  124.16 - all-local: build_debug
  124.17 ---- gcc-4.0.0/libstdc++-v3/src/Makefile.in
  124.18 -+++ gcc-4.0.0/libstdc++-v3/src/Makefile.in
  124.19 -@@ -625,7 +625,7 @@
  124.20 - 
  124.21 - install-data-am: install-data-local
  124.22 - 
  124.23 --install-exec-am: install-toolexeclibLTLIBRARIES
  124.24 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  124.25 - 
  124.26 - install-info: install-info-am
  124.27 - 
  124.28 -@@ -664,7 +664,7 @@
  124.29 - 	maintainer-clean-generic mostlyclean mostlyclean-compile \
  124.30 - 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  124.31 - 	tags uninstall uninstall-am uninstall-info-am \
  124.32 --	uninstall-toolexeclibLTLIBRARIES
  124.33 -+	uninstall-toolexeclibLTLIBRARIES install-exec-local
  124.34 - 
  124.35 - @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@libstdc++-symbol.ver:  ${glibcxx_srcdir}/$(SYMVER_MAP)
  124.36 - @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@	cp ${glibcxx_srcdir}/$(SYMVER_MAP) ./libstdc++-symbol.ver
  124.37 -@@ -743,6 +743,11 @@
  124.38 - install_debug:
  124.39 - 	(cd ${debugdir} && $(MAKE) \
  124.40 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  124.41 -+
  124.42 -+install-exec-local:
  124.43 -+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  124.44 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  124.45 -+
  124.46 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  124.47 - # Otherwise a system limit (for SysV at least) may be exceeded.
  124.48 - .NOEXPORT:
   125.1 --- a/patches/gcc/4.0.3/301-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   125.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   125.3 @@ -1,11 +0,0 @@
   125.4 ---- gcc-4.0.0/boehm-gc/include/gc.h-orig	2005-04-28 22:28:57.000000000 -0500
   125.5 -+++ gcc-4.0.0/boehm-gc/include/gc.h	2005-04-28 22:30:38.000000000 -0500
   125.6 -@@ -500,7 +500,7 @@
   125.7 - #ifdef __linux__
   125.8 - # include <features.h>
   125.9 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  125.10 --     && !defined(__ia64__)
  125.11 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  125.12 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  125.13 - #     define GC_HAVE_BUILTIN_BACKTRACE
  125.14 - #   endif
   126.1 --- a/patches/gcc/4.0.3/302-c99-snprintf.patch	Mon Jul 28 21:08:01 2008 +0000
   126.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   126.3 @@ -1,11 +0,0 @@
   126.4 ---- gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h-orig	2005-04-29 00:08:41.000000000 -0500
   126.5 -+++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h	2005-04-29 00:08:45.000000000 -0500
   126.6 -@@ -142,7 +142,7 @@
   126.7 -   using ::vsprintf;
   126.8 - }
   126.9 - 
  126.10 --#if _GLIBCXX_USE_C99
  126.11 -+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  126.12 - 
  126.13 - #undef snprintf
  126.14 - #undef vfscanf
   127.1 --- a/patches/gcc/4.0.3/303-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   127.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   127.3 @@ -1,12 +0,0 @@
   127.4 ---- gcc-4.0.0/libstdc++-v3/configure-old	2005-04-30 22:04:48.061603912 -0500
   127.5 -+++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 22:06:13.678588152 -0500
   127.6 -@@ -7194,6 +7194,9 @@
   127.7 - cat >>conftest.$ac_ext <<_ACEOF
   127.8 - /* end confdefs.h.  */
   127.9 - #include <complex.h>
  127.10 -+#ifdef __UCLIBC__
  127.11 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  127.12 -+#endif
  127.13 - int
  127.14 - main ()
  127.15 - {
   128.1 --- a/patches/gcc/4.0.3/304-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   128.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   128.3 @@ -1,24 +0,0 @@
   128.4 ---- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps	2006-03-24 01:49:51 +0100
   128.5 -+++ gcc-4.1.0/libstdc++-v3/include/ext/rope	2006-03-24 01:49:37 +0100
   128.6 -@@ -59,6 +59,9 @@
   128.7 - #include <bits/allocator.h>
   128.8 - #include <ext/hash_fun.h>
   128.9 - 
  128.10 -+/* cope w/ index defined as macro, SuSv3 proposal */
  128.11 -+#undef index
  128.12 -+
  128.13 - # ifdef __GC
  128.14 - #   define __GC_CONST const
  128.15 - # else
  128.16 ---- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps	2006-03-24 01:50:04 +0100
  128.17 -+++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h	2006-03-24 01:50:28 +0100
  128.18 -@@ -53,6 +53,9 @@
  128.19 - #include <ext/memory> // For uninitialized_copy_n
  128.20 - #include <ext/numeric> // For power
  128.21 - 
  128.22 -+/* cope w/ index defined as macro, SuSv3 proposal */
  128.23 -+#undef index
  128.24 -+
  128.25 - namespace __gnu_cxx
  128.26 - {
  128.27 -   using std::size_t;
   129.1 --- a/patches/gcc/4.0.3/602-sdk-libstdc++-includes.patch	Mon Jul 28 21:08:01 2008 +0000
   129.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   129.3 @@ -1,22 +0,0 @@
   129.4 -diff -urN gcc-4.0.0-100/libstdc++-v3/fragment.am gcc-4.0.0/libstdc++-v3/fragment.am
   129.5 ---- gcc-4.0.0-100/libstdc++-v3/fragment.am	2004-10-25 15:32:40.000000000 -0500
   129.6 -+++ gcc-4.0.0/libstdc++-v3/fragment.am	2005-04-28 21:48:43.000000000 -0500
   129.7 -@@ -18,5 +18,5 @@
   129.8 - 	$(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
   129.9 - 
  129.10 - # -I/-D flags to pass when compiling.
  129.11 --AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
  129.12 -+AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
  129.13 - 
  129.14 -diff -urN gcc-4.0.0-100/libstdc++-v3/libmath/Makefile.am gcc-4.0.0/libstdc++-v3/libmath/Makefile.am
  129.15 ---- gcc-4.0.0-100/libstdc++-v3/libmath/Makefile.am	2003-08-27 16:29:42.000000000 -0500
  129.16 -+++ gcc-4.0.0/libstdc++-v3/libmath/Makefile.am	2005-04-28 21:48:43.000000000 -0500
  129.17 -@@ -32,7 +32,7 @@
  129.18 - 
  129.19 - libmath_la_SOURCES = stubs.c
  129.20 - 
  129.21 --AM_CPPFLAGS = $(CANADIAN_INCLUDES)
  129.22 -+AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
  129.23 - 
  129.24 - # Only compiling "C" sources in this directory.
  129.25 - LIBTOOL = @LIBTOOL@ --tag CC
   130.1 --- a/patches/gcc/4.0.3/800-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
   130.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   130.3 @@ -1,67 +0,0 @@
   130.4 -By Lennert Buytenhek <buytenh@wantstofly.org>
   130.5 -Adds support for arm*b-linux* big-endian ARM targets
   130.6 -
   130.7 -See http://gcc.gnu.org/PR16350
   130.8 -
   130.9 ---- gcc-4.0.3/gcc/config/arm/linux-elf.h
  130.10 -+++ gcc-4.0.3/gcc/config/arm/linux-elf.h
  130.11 -@@ -31,19 +31,33 @@
  130.12 - /* Do not assume anything about header files.  */
  130.13 - #define NO_IMPLICIT_EXTERN_C
  130.14 - 
  130.15 -+/*
  130.16 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  130.17 -+ * (big endian) configurations.
  130.18 -+ */
  130.19 -+#if TARGET_BIG_ENDIAN_DEFAULT
  130.20 -+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
  130.21 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
  130.22 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
  130.23 -+#else
  130.24 -+#define TARGET_ENDIAN_DEFAULT 0
  130.25 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
  130.26 -+#define TARGET_LINKER_EMULATION "armelf_linux"
  130.27 -+#endif
  130.28 -+
  130.29 - #undef  TARGET_DEFAULT_FLOAT_ABI
  130.30 - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  130.31 - 
  130.32 - #undef  TARGET_DEFAULT
  130.33 --#define TARGET_DEFAULT (0)
  130.34 -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  130.35 - 
  130.36 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  130.37 - 
  130.38 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  130.39 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  130.40 - 
  130.41 - #undef  MULTILIB_DEFAULTS
  130.42 - #define MULTILIB_DEFAULTS \
  130.43 --	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  130.44 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  130.45 - 
  130.46 - /* The GNU C++ standard library requires that these macros be defined.  */
  130.47 - #undef CPLUSPLUS_CPP_SPEC
  130.48 -@@ -90,7 +104,7 @@
  130.49 -    %{rdynamic:-export-dynamic} \
  130.50 -    %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
  130.51 -    -X \
  130.52 --   %{mbig-endian:-EB}" \
  130.53 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  130.54 -    SUBTARGET_EXTRA_LINK_SPEC
  130.55 - 
  130.56 - #define TARGET_OS_CPP_BUILTINS()		\
  130.57 ---- gcc-4.0.3/gcc/config.gcc
  130.58 -+++ gcc-4.0.3/gcc/config.gcc
  130.59 -@@ -672,6 +672,11 @@
  130.60 - 	;;
  130.61 - arm*-*-linux*)			# ARM GNU/Linux with ELF
  130.62 - 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
  130.63 -+	case $target in
  130.64 -+	arm*b-*)
  130.65 -+		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
  130.66 -+		;;
  130.67 -+	esac
  130.68 - 	tmake_file="${tmake_file} arm/t-arm arm/t-linux"
  130.69 - 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  130.70 - 	gnu_ld=yes
   131.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   131.2 +++ b/patches/gcc/4.0.4/110-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   131.3 @@ -0,0 +1,3237 @@
   131.4 +diff -urN gcc-4.0.0-100/libstdc++-v3/acinclude.m4 gcc-4.0.0/libstdc++-v3/acinclude.m4
   131.5 +--- gcc-4.0.0-100/libstdc++-v3/acinclude.m4	2005-04-30 13:06:53.000000000 -0500
   131.6 ++++ gcc-4.0.0/libstdc++-v3/acinclude.m4	2005-04-28 20:19:01.000000000 -0500
   131.7 +@@ -1104,7 +1104,7 @@
   131.8 +   AC_MSG_CHECKING([for C locale to use])
   131.9 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  131.10 +     [use MODEL for target locale package],
  131.11 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  131.12 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  131.13 +   
  131.14 +   # If they didn't use this option switch, or if they specified --enable
  131.15 +   # with no specific model, we'll have to look for one.  If they
  131.16 +@@ -1120,6 +1120,9 @@
  131.17 +   # Default to "generic".
  131.18 +   if test $enable_clocale_flag = auto; then
  131.19 +     case ${target_os} in
  131.20 ++      *-uclibc*)
  131.21 ++        enable_clocale_flag=uclibc
  131.22 ++        ;;
  131.23 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  131.24 +         AC_EGREP_CPP([_GLIBCXX_ok], [
  131.25 +         #include <features.h>
  131.26 +@@ -1263,6 +1266,40 @@
  131.27 +       CTIME_CC=config/locale/generic/time_members.cc
  131.28 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  131.29 +       ;;
  131.30 ++    uclibc)
  131.31 ++      AC_MSG_RESULT(uclibc)
  131.32 ++
  131.33 ++      # Declare intention to use gettext, and add support for specific
  131.34 ++      # languages.
  131.35 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  131.36 ++      ALL_LINGUAS="de fr"
  131.37 ++
  131.38 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  131.39 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  131.40 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  131.41 ++        USE_NLS=yes
  131.42 ++      fi
  131.43 ++      # Export the build objects.
  131.44 ++      for ling in $ALL_LINGUAS; do \
  131.45 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  131.46 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  131.47 ++      done
  131.48 ++      AC_SUBST(glibcxx_MOFILES)
  131.49 ++      AC_SUBST(glibcxx_POFILES)
  131.50 ++
  131.51 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  131.52 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  131.53 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  131.54 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  131.55 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  131.56 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  131.57 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  131.58 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  131.59 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  131.60 ++      CTIME_H=config/locale/uclibc/time_members.h
  131.61 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  131.62 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  131.63 ++      ;;
  131.64 +   esac
  131.65 + 
  131.66 +   # This is where the testsuite looks for locale catalogs, using the
  131.67 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  131.68 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1969-12-31 18:00:00.000000000 -0600
  131.69 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2005-04-28 01:13:15.000000000 -0500
  131.70 +@@ -0,0 +1,59 @@
  131.71 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  131.72 ++
  131.73 ++// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
  131.74 ++//
  131.75 ++// This file is part of the GNU ISO C++ Library.  This library is free
  131.76 ++// software; you can redistribute it and/or modify it under the
  131.77 ++// terms of the GNU General Public License as published by the
  131.78 ++// Free Software Foundation; either version 2, or (at your option)
  131.79 ++// any later version.
  131.80 ++
  131.81 ++// This library is distributed in the hope that it will be useful,
  131.82 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  131.83 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  131.84 ++// GNU General Public License for more details.
  131.85 ++
  131.86 ++// You should have received a copy of the GNU General Public License along
  131.87 ++// with this library; see the file COPYING.  If not, write to the Free
  131.88 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  131.89 ++// USA.
  131.90 ++
  131.91 ++// As a special exception, you may use this file as part of a free software
  131.92 ++// library without restriction.  Specifically, if other files instantiate
  131.93 ++// templates or use macros or inline functions from this file, or you compile
  131.94 ++// this file and link it with other files to produce an executable, this
  131.95 ++// file does not by itself cause the resulting executable to be covered by
  131.96 ++// the GNU General Public License.  This exception does not however
  131.97 ++// invalidate any other reasons why the executable file might be covered by
  131.98 ++// the GNU General Public License.
  131.99 ++
 131.100 ++// Written by Jakub Jelinek <jakub@redhat.com>
 131.101 ++
 131.102 ++#include <clocale>
 131.103 ++
 131.104 ++#ifdef __UCLIBC_MJN3_ONLY__
 131.105 ++#warning clean this up
 131.106 ++#endif
 131.107 ++
 131.108 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.109 ++                                                  
 131.110 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 131.111 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 131.112 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 131.113 ++extern "C" __typeof(strftime_l) __strftime_l;
 131.114 ++extern "C" __typeof(strtod_l) __strtod_l;
 131.115 ++extern "C" __typeof(strtof_l) __strtof_l;
 131.116 ++extern "C" __typeof(strtold_l) __strtold_l;
 131.117 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 131.118 ++extern "C" __typeof(towlower_l) __towlower_l;
 131.119 ++extern "C" __typeof(towupper_l) __towupper_l;
 131.120 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 131.121 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 131.122 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 131.123 ++extern "C" __typeof(wctype_l) __wctype_l;
 131.124 ++extern "C" __typeof(newlocale) __newlocale;
 131.125 ++extern "C" __typeof(freelocale) __freelocale;
 131.126 ++extern "C" __typeof(duplocale) __duplocale;
 131.127 ++extern "C" __typeof(uselocale) __uselocale;
 131.128 ++
 131.129 ++#endif // GLIBC 2.3 and later
 131.130 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
 131.131 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.cc	1969-12-31 18:00:00.000000000 -0600
 131.132 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2005-04-28 01:13:15.000000000 -0500
 131.133 +@@ -0,0 +1,160 @@
 131.134 ++// Wrapper for underlying C-language localization -*- C++ -*-
 131.135 ++
 131.136 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 131.137 ++//
 131.138 ++// This file is part of the GNU ISO C++ Library.  This library is free
 131.139 ++// software; you can redistribute it and/or modify it under the
 131.140 ++// terms of the GNU General Public License as published by the
 131.141 ++// Free Software Foundation; either version 2, or (at your option)
 131.142 ++// any later version.
 131.143 ++
 131.144 ++// This library is distributed in the hope that it will be useful,
 131.145 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 131.146 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 131.147 ++// GNU General Public License for more details.
 131.148 ++
 131.149 ++// You should have received a copy of the GNU General Public License along
 131.150 ++// with this library; see the file COPYING.  If not, write to the Free
 131.151 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 131.152 ++// USA.
 131.153 ++
 131.154 ++// As a special exception, you may use this file as part of a free software
 131.155 ++// library without restriction.  Specifically, if other files instantiate
 131.156 ++// templates or use macros or inline functions from this file, or you compile
 131.157 ++// this file and link it with other files to produce an executable, this
 131.158 ++// file does not by itself cause the resulting executable to be covered by
 131.159 ++// the GNU General Public License.  This exception does not however
 131.160 ++// invalidate any other reasons why the executable file might be covered by
 131.161 ++// the GNU General Public License.
 131.162 ++
 131.163 ++//
 131.164 ++// ISO C++ 14882: 22.8  Standard locale categories.
 131.165 ++//
 131.166 ++
 131.167 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 131.168 ++
 131.169 ++#include <cerrno>  // For errno
 131.170 ++#include <locale>
 131.171 ++#include <stdexcept>
 131.172 ++#include <langinfo.h>
 131.173 ++#include <bits/c++locale_internal.h>
 131.174 ++
 131.175 ++#ifndef __UCLIBC_HAS_XLOCALE__
 131.176 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 131.177 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 131.178 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 131.179 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 131.180 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 131.181 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 131.182 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 131.183 ++#warning should dummy __newlocale check for C|POSIX ?
 131.184 ++#define __newlocale(a, b, c)        NULL
 131.185 ++#define __freelocale(a)             ((void)0)
 131.186 ++#define __duplocale(a)              __c_locale()
 131.187 ++#endif
 131.188 ++
 131.189 ++namespace std 
 131.190 ++{
 131.191 ++  template<>
 131.192 ++    void
 131.193 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 131.194 ++		   const __c_locale& __cloc)
 131.195 ++    {
 131.196 ++      if (!(__err & ios_base::failbit))
 131.197 ++	{
 131.198 ++	  char* __sanity;
 131.199 ++	  errno = 0;
 131.200 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
 131.201 ++          if (__sanity != __s && errno != ERANGE)
 131.202 ++	    __v = __f;
 131.203 ++	  else
 131.204 ++	    __err |= ios_base::failbit;
 131.205 ++	}
 131.206 ++    }
 131.207 ++
 131.208 ++  template<>
 131.209 ++    void
 131.210 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 131.211 ++		   const __c_locale& __cloc)
 131.212 ++    {
 131.213 ++      if (!(__err & ios_base::failbit))
 131.214 ++	{
 131.215 ++	  char* __sanity;
 131.216 ++	  errno = 0;
 131.217 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
 131.218 ++          if (__sanity != __s && errno != ERANGE)
 131.219 ++	    __v = __d;
 131.220 ++	  else
 131.221 ++	    __err |= ios_base::failbit;
 131.222 ++	}
 131.223 ++    }
 131.224 ++
 131.225 ++  template<>
 131.226 ++    void
 131.227 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 131.228 ++		   const __c_locale& __cloc)
 131.229 ++    {
 131.230 ++      if (!(__err & ios_base::failbit))
 131.231 ++	{
 131.232 ++	  char* __sanity;
 131.233 ++	  errno = 0;
 131.234 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 131.235 ++          if (__sanity != __s && errno != ERANGE)
 131.236 ++	    __v = __ld;
 131.237 ++	  else
 131.238 ++	    __err |= ios_base::failbit;
 131.239 ++	}
 131.240 ++    }
 131.241 ++
 131.242 ++  void
 131.243 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 131.244 ++				    __c_locale __old)
 131.245 ++  {
 131.246 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 131.247 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.248 ++    if (!__cloc)
 131.249 ++      {
 131.250 ++	// This named locale is not supported by the underlying OS.
 131.251 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 131.252 ++			      "name not valid"));
 131.253 ++      }
 131.254 ++#endif
 131.255 ++  }
 131.256 ++  
 131.257 ++  void
 131.258 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 131.259 ++  {
 131.260 ++    if (_S_get_c_locale() != __cloc)
 131.261 ++      __freelocale(__cloc); 
 131.262 ++  }
 131.263 ++
 131.264 ++  __c_locale
 131.265 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 131.266 ++  { return __duplocale(__cloc); }
 131.267 ++} // namespace std
 131.268 ++
 131.269 ++namespace __gnu_cxx
 131.270 ++{
 131.271 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 131.272 ++    {
 131.273 ++      "LC_CTYPE", 
 131.274 ++      "LC_NUMERIC",
 131.275 ++      "LC_TIME", 
 131.276 ++      "LC_COLLATE", 
 131.277 ++      "LC_MONETARY",
 131.278 ++      "LC_MESSAGES", 
 131.279 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 131.280 ++      "LC_PAPER", 
 131.281 ++      "LC_NAME", 
 131.282 ++      "LC_ADDRESS",
 131.283 ++      "LC_TELEPHONE", 
 131.284 ++      "LC_MEASUREMENT", 
 131.285 ++      "LC_IDENTIFICATION" 
 131.286 ++#endif
 131.287 ++    };
 131.288 ++}
 131.289 ++
 131.290 ++namespace std
 131.291 ++{
 131.292 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 131.293 ++}  // namespace std
 131.294 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.h
 131.295 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.h	1969-12-31 18:00:00.000000000 -0600
 131.296 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2005-04-28 01:13:15.000000000 -0500
 131.297 +@@ -0,0 +1,115 @@
 131.298 ++// Wrapper for underlying C-language localization -*- C++ -*-
 131.299 ++
 131.300 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 131.301 ++//
 131.302 ++// This file is part of the GNU ISO C++ Library.  This library is free
 131.303 ++// software; you can redistribute it and/or modify it under the
 131.304 ++// terms of the GNU General Public License as published by the
 131.305 ++// Free Software Foundation; either version 2, or (at your option)
 131.306 ++// any later version.
 131.307 ++
 131.308 ++// This library is distributed in the hope that it will be useful,
 131.309 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 131.310 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 131.311 ++// GNU General Public License for more details.
 131.312 ++
 131.313 ++// You should have received a copy of the GNU General Public License along
 131.314 ++// with this library; see the file COPYING.  If not, write to the Free
 131.315 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 131.316 ++// USA.
 131.317 ++
 131.318 ++// As a special exception, you may use this file as part of a free software
 131.319 ++// library without restriction.  Specifically, if other files instantiate
 131.320 ++// templates or use macros or inline functions from this file, or you compile
 131.321 ++// this file and link it with other files to produce an executable, this
 131.322 ++// file does not by itself cause the resulting executable to be covered by
 131.323 ++// the GNU General Public License.  This exception does not however
 131.324 ++// invalidate any other reasons why the executable file might be covered by
 131.325 ++// the GNU General Public License.
 131.326 ++
 131.327 ++//
 131.328 ++// ISO C++ 14882: 22.8  Standard locale categories.
 131.329 ++//
 131.330 ++
 131.331 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 131.332 ++
 131.333 ++#ifndef _C_LOCALE_H
 131.334 ++#define _C_LOCALE_H 1
 131.335 ++
 131.336 ++#pragma GCC system_header
 131.337 ++
 131.338 ++#include <cstring>              // get std::strlen
 131.339 ++#include <cstdio>               // get std::snprintf or std::sprintf
 131.340 ++#include <clocale>
 131.341 ++#include <langinfo.h>		// For codecvt
 131.342 ++#ifdef __UCLIBC_MJN3_ONLY__
 131.343 ++#warning fix this
 131.344 ++#endif
 131.345 ++#ifdef __UCLIBC_HAS_LOCALE__
 131.346 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 131.347 ++#endif
 131.348 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 131.349 ++#include <libintl.h> 		// For messages
 131.350 ++#endif
 131.351 ++
 131.352 ++#ifdef __UCLIBC_MJN3_ONLY__
 131.353 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 131.354 ++#endif
 131.355 ++#define _GLIBCXX_C_LOCALE_GNU 1
 131.356 ++
 131.357 ++#ifdef __UCLIBC_MJN3_ONLY__
 131.358 ++#warning fix categories
 131.359 ++#endif
 131.360 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 131.361 ++#define _GLIBCXX_NUM_CATEGORIES 0
 131.362 ++ 
 131.363 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.364 ++namespace __gnu_cxx
 131.365 ++{
 131.366 ++  extern "C" __typeof(uselocale) __uselocale;
 131.367 ++}
 131.368 ++#endif
 131.369 ++
 131.370 ++namespace std
 131.371 ++{
 131.372 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.373 ++  typedef __locale_t		__c_locale;
 131.374 ++#else
 131.375 ++  typedef int*			__c_locale;
 131.376 ++#endif
 131.377 ++
 131.378 ++  // Convert numeric value of type _Tv to string and return length of
 131.379 ++  // string.  If snprintf is available use it, otherwise fall back to
 131.380 ++  // the unsafe sprintf which, in general, can be dangerous and should
 131.381 ++  // be avoided.
 131.382 ++  template<typename _Tv>
 131.383 ++    int
 131.384 ++    __convert_from_v(char* __out, const int __size, const char* __fmt,
 131.385 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.386 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 131.387 ++    {
 131.388 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 131.389 ++#else
 131.390 ++		     _Tv __v, const __c_locale&, int __prec)
 131.391 ++    {
 131.392 ++# ifdef __UCLIBC_HAS_LOCALE__
 131.393 ++      char* __old = std::setlocale(LC_ALL, NULL);
 131.394 ++      char* __sav = new char[std::strlen(__old) + 1];
 131.395 ++      std::strcpy(__sav, __old);
 131.396 ++      std::setlocale(LC_ALL, "C");
 131.397 ++# endif
 131.398 ++#endif
 131.399 ++
 131.400 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 131.401 ++
 131.402 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.403 ++      __gnu_cxx::__uselocale(__old);
 131.404 ++#elif defined __UCLIBC_HAS_LOCALE__
 131.405 ++      std::setlocale(LC_ALL, __sav);
 131.406 ++      delete [] __sav;
 131.407 ++#endif
 131.408 ++      return __ret;
 131.409 ++    }
 131.410 ++}
 131.411 ++
 131.412 ++#endif
 131.413 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 131.414 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1969-12-31 18:00:00.000000000 -0600
 131.415 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2005-04-28 01:13:15.000000000 -0500
 131.416 +@@ -0,0 +1,306 @@
 131.417 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 131.418 ++
 131.419 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 131.420 ++//
 131.421 ++// This file is part of the GNU ISO C++ Library.  This library is free
 131.422 ++// software; you can redistribute it and/or modify it under the
 131.423 ++// terms of the GNU General Public License as published by the
 131.424 ++// Free Software Foundation; either version 2, or (at your option)
 131.425 ++// any later version.
 131.426 ++
 131.427 ++// This library is distributed in the hope that it will be useful,
 131.428 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 131.429 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 131.430 ++// GNU General Public License for more details.
 131.431 ++
 131.432 ++// You should have received a copy of the GNU General Public License along
 131.433 ++// with this library; see the file COPYING.  If not, write to the Free
 131.434 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 131.435 ++// USA.
 131.436 ++
 131.437 ++// As a special exception, you may use this file as part of a free software
 131.438 ++// library without restriction.  Specifically, if other files instantiate
 131.439 ++// templates or use macros or inline functions from this file, or you compile
 131.440 ++// this file and link it with other files to produce an executable, this
 131.441 ++// file does not by itself cause the resulting executable to be covered by
 131.442 ++// the GNU General Public License.  This exception does not however
 131.443 ++// invalidate any other reasons why the executable file might be covered by
 131.444 ++// the GNU General Public License.
 131.445 ++
 131.446 ++//
 131.447 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 131.448 ++//
 131.449 ++
 131.450 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 131.451 ++
 131.452 ++#include <locale>
 131.453 ++#include <bits/c++locale_internal.h>
 131.454 ++
 131.455 ++namespace std
 131.456 ++{
 131.457 ++  // Specializations.
 131.458 ++#ifdef _GLIBCXX_USE_WCHAR_T
 131.459 ++  codecvt_base::result
 131.460 ++  codecvt<wchar_t, char, mbstate_t>::
 131.461 ++  do_out(state_type& __state, const intern_type* __from, 
 131.462 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 131.463 ++	 extern_type* __to, extern_type* __to_end,
 131.464 ++	 extern_type*& __to_next) const
 131.465 ++  {
 131.466 ++    result __ret = ok;
 131.467 ++    state_type __tmp_state(__state);
 131.468 ++
 131.469 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.470 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 131.471 ++#endif
 131.472 ++
 131.473 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 131.474 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 131.475 ++    // NB: wcsnrtombs is a GNU extension
 131.476 ++    for (__from_next = __from, __to_next = __to;
 131.477 ++	 __from_next < __from_end && __to_next < __to_end
 131.478 ++	 && __ret == ok;)
 131.479 ++      {
 131.480 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 131.481 ++						      __from_end - __from_next);
 131.482 ++	if (!__from_chunk_end)
 131.483 ++	  __from_chunk_end = __from_end;
 131.484 ++
 131.485 ++	__from = __from_next;
 131.486 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 131.487 ++					 __from_chunk_end - __from_next,
 131.488 ++					 __to_end - __to_next, &__state);
 131.489 ++	if (__conv == static_cast<size_t>(-1))
 131.490 ++	  {
 131.491 ++	    // In case of error, in order to stop at the exact place we
 131.492 ++	    // have to start again from the beginning with a series of
 131.493 ++	    // wcrtomb.
 131.494 ++	    for (; __from < __from_next; ++__from)
 131.495 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 131.496 ++	    __state = __tmp_state;
 131.497 ++	    __ret = error;
 131.498 ++	  }
 131.499 ++	else if (__from_next && __from_next < __from_chunk_end)
 131.500 ++	  {
 131.501 ++	    __to_next += __conv;
 131.502 ++	    __ret = partial;
 131.503 ++	  }
 131.504 ++	else
 131.505 ++	  {
 131.506 ++	    __from_next = __from_chunk_end;
 131.507 ++	    __to_next += __conv;
 131.508 ++	  }
 131.509 ++
 131.510 ++	if (__from_next < __from_end && __ret == ok)
 131.511 ++	  {
 131.512 ++	    extern_type __buf[MB_LEN_MAX];
 131.513 ++	    __tmp_state = __state;
 131.514 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 131.515 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 131.516 ++	      __ret = partial;
 131.517 ++	    else
 131.518 ++	      {
 131.519 ++		memcpy(__to_next, __buf, __conv);
 131.520 ++		__state = __tmp_state;
 131.521 ++		__to_next += __conv;
 131.522 ++		++__from_next;
 131.523 ++	      }
 131.524 ++	  }
 131.525 ++      }
 131.526 ++
 131.527 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.528 ++    __uselocale(__old);
 131.529 ++#endif
 131.530 ++
 131.531 ++    return __ret; 
 131.532 ++  }
 131.533 ++  
 131.534 ++  codecvt_base::result
 131.535 ++  codecvt<wchar_t, char, mbstate_t>::
 131.536 ++  do_in(state_type& __state, const extern_type* __from, 
 131.537 ++	const extern_type* __from_end, const extern_type*& __from_next,
 131.538 ++	intern_type* __to, intern_type* __to_end,
 131.539 ++	intern_type*& __to_next) const
 131.540 ++  {
 131.541 ++    result __ret = ok;
 131.542 ++    state_type __tmp_state(__state);
 131.543 ++
 131.544 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.545 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 131.546 ++#endif
 131.547 ++
 131.548 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 131.549 ++    // in case we store a L'\0' and then continue, in a loop.
 131.550 ++    // NB: mbsnrtowcs is a GNU extension
 131.551 ++    for (__from_next = __from, __to_next = __to;
 131.552 ++	 __from_next < __from_end && __to_next < __to_end
 131.553 ++	 && __ret == ok;)
 131.554 ++      {
 131.555 ++	const extern_type* __from_chunk_end;
 131.556 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 131.557 ++								  __from_end
 131.558 ++								  - __from_next));
 131.559 ++	if (!__from_chunk_end)
 131.560 ++	  __from_chunk_end = __from_end;
 131.561 ++
 131.562 ++	__from = __from_next;
 131.563 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 131.564 ++				   __from_chunk_end - __from_next,
 131.565 ++				   __to_end - __to_next, &__state);
 131.566 ++	if (__conv == static_cast<size_t>(-1))
 131.567 ++	  {
 131.568 ++	    // In case of error, in order to stop at the exact place we
 131.569 ++	    // have to start again from the beginning with a series of
 131.570 ++	    // mbrtowc.
 131.571 ++	    for (;; ++__to_next, __from += __conv)
 131.572 ++	      {
 131.573 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 131.574 ++				 &__tmp_state);
 131.575 ++		if (__conv == static_cast<size_t>(-1)
 131.576 ++		    || __conv == static_cast<size_t>(-2))
 131.577 ++		  break;
 131.578 ++	      }
 131.579 ++	    __from_next = __from;
 131.580 ++	    __state = __tmp_state;	    
 131.581 ++	    __ret = error;
 131.582 ++	  }
 131.583 ++	else if (__from_next && __from_next < __from_chunk_end)
 131.584 ++	  {
 131.585 ++	    // It is unclear what to return in this case (see DR 382). 
 131.586 ++	    __to_next += __conv;
 131.587 ++	    __ret = partial;
 131.588 ++	  }
 131.589 ++	else
 131.590 ++	  {
 131.591 ++	    __from_next = __from_chunk_end;
 131.592 ++	    __to_next += __conv;
 131.593 ++	  }
 131.594 ++
 131.595 ++	if (__from_next < __from_end && __ret == ok)
 131.596 ++	  {
 131.597 ++	    if (__to_next < __to_end)
 131.598 ++	      {
 131.599 ++		// XXX Probably wrong for stateful encodings
 131.600 ++		__tmp_state = __state;		
 131.601 ++		++__from_next;
 131.602 ++		*__to_next++ = L'\0';
 131.603 ++	      }
 131.604 ++	    else
 131.605 ++	      __ret = partial;
 131.606 ++	  }
 131.607 ++      }
 131.608 ++
 131.609 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.610 ++    __uselocale(__old);
 131.611 ++#endif
 131.612 ++
 131.613 ++    return __ret; 
 131.614 ++  }
 131.615 ++
 131.616 ++  int 
 131.617 ++  codecvt<wchar_t, char, mbstate_t>::
 131.618 ++  do_encoding() const throw()
 131.619 ++  {
 131.620 ++    // XXX This implementation assumes that the encoding is
 131.621 ++    // stateless and is either single-byte or variable-width.
 131.622 ++    int __ret = 0;
 131.623 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.624 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 131.625 ++#endif
 131.626 ++    if (MB_CUR_MAX == 1)
 131.627 ++      __ret = 1;
 131.628 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.629 ++    __uselocale(__old);
 131.630 ++#endif
 131.631 ++    return __ret;
 131.632 ++  }  
 131.633 ++
 131.634 ++  int 
 131.635 ++  codecvt<wchar_t, char, mbstate_t>::
 131.636 ++  do_max_length() const throw()
 131.637 ++  {
 131.638 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.639 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 131.640 ++#endif
 131.641 ++    // XXX Probably wrong for stateful encodings.
 131.642 ++    int __ret = MB_CUR_MAX;
 131.643 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.644 ++    __uselocale(__old);
 131.645 ++#endif
 131.646 ++    return __ret;
 131.647 ++  }
 131.648 ++  
 131.649 ++  int 
 131.650 ++  codecvt<wchar_t, char, mbstate_t>::
 131.651 ++  do_length(state_type& __state, const extern_type* __from,
 131.652 ++	    const extern_type* __end, size_t __max) const
 131.653 ++  {
 131.654 ++    int __ret = 0;
 131.655 ++    state_type __tmp_state(__state);
 131.656 ++
 131.657 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.658 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 131.659 ++#endif
 131.660 ++
 131.661 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 131.662 ++    // in case we advance past it and then continue, in a loop.
 131.663 ++    // NB: mbsnrtowcs is a GNU extension
 131.664 ++  
 131.665 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 131.666 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 131.667 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 131.668 ++							   * __max));
 131.669 ++    while (__from < __end && __max)
 131.670 ++      {
 131.671 ++	const extern_type* __from_chunk_end;
 131.672 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 131.673 ++								  __end
 131.674 ++								  - __from));
 131.675 ++	if (!__from_chunk_end)
 131.676 ++	  __from_chunk_end = __end;
 131.677 ++
 131.678 ++	const extern_type* __tmp_from = __from;
 131.679 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 131.680 ++				   __from_chunk_end - __from,
 131.681 ++				   __max, &__state);
 131.682 ++	if (__conv == static_cast<size_t>(-1))
 131.683 ++	  {
 131.684 ++	    // In case of error, in order to stop at the exact place we
 131.685 ++	    // have to start again from the beginning with a series of
 131.686 ++	    // mbrtowc.
 131.687 ++	    for (__from = __tmp_from;; __from += __conv)
 131.688 ++	      {
 131.689 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 131.690 ++				 &__tmp_state);
 131.691 ++		if (__conv == static_cast<size_t>(-1)
 131.692 ++		    || __conv == static_cast<size_t>(-2))
 131.693 ++		  break;
 131.694 ++	      }
 131.695 ++	    __state = __tmp_state;
 131.696 ++	    __ret += __from - __tmp_from;
 131.697 ++	    break;
 131.698 ++	  }
 131.699 ++	if (!__from)
 131.700 ++	  __from = __from_chunk_end;
 131.701 ++	
 131.702 ++	__ret += __from - __tmp_from;
 131.703 ++	__max -= __conv;
 131.704 ++
 131.705 ++	if (__from < __end && __max)
 131.706 ++	  {
 131.707 ++	    // XXX Probably wrong for stateful encodings
 131.708 ++	    __tmp_state = __state;
 131.709 ++	    ++__from;
 131.710 ++	    ++__ret;
 131.711 ++	    --__max;
 131.712 ++	  }
 131.713 ++      }
 131.714 ++
 131.715 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.716 ++    __uselocale(__old);
 131.717 ++#endif
 131.718 ++
 131.719 ++    return __ret; 
 131.720 ++  }
 131.721 ++#endif
 131.722 ++}
 131.723 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
 131.724 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/collate_members.cc	1969-12-31 18:00:00.000000000 -0600
 131.725 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2005-04-28 01:13:15.000000000 -0500
 131.726 +@@ -0,0 +1,80 @@
 131.727 ++// std::collate implementation details, GNU version -*- C++ -*-
 131.728 ++
 131.729 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 131.730 ++//
 131.731 ++// This file is part of the GNU ISO C++ Library.  This library is free
 131.732 ++// software; you can redistribute it and/or modify it under the
 131.733 ++// terms of the GNU General Public License as published by the
 131.734 ++// Free Software Foundation; either version 2, or (at your option)
 131.735 ++// any later version.
 131.736 ++
 131.737 ++// This library is distributed in the hope that it will be useful,
 131.738 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 131.739 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 131.740 ++// GNU General Public License for more details.
 131.741 ++
 131.742 ++// You should have received a copy of the GNU General Public License along
 131.743 ++// with this library; see the file COPYING.  If not, write to the Free
 131.744 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 131.745 ++// USA.
 131.746 ++
 131.747 ++// As a special exception, you may use this file as part of a free software
 131.748 ++// library without restriction.  Specifically, if other files instantiate
 131.749 ++// templates or use macros or inline functions from this file, or you compile
 131.750 ++// this file and link it with other files to produce an executable, this
 131.751 ++// file does not by itself cause the resulting executable to be covered by
 131.752 ++// the GNU General Public License.  This exception does not however
 131.753 ++// invalidate any other reasons why the executable file might be covered by
 131.754 ++// the GNU General Public License.
 131.755 ++
 131.756 ++//
 131.757 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 131.758 ++//
 131.759 ++
 131.760 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 131.761 ++
 131.762 ++#include <locale>
 131.763 ++#include <bits/c++locale_internal.h>
 131.764 ++
 131.765 ++#ifndef __UCLIBC_HAS_XLOCALE__
 131.766 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 131.767 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 131.768 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 131.769 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 131.770 ++#endif
 131.771 ++
 131.772 ++namespace std
 131.773 ++{
 131.774 ++  // These are basically extensions to char_traits, and perhaps should
 131.775 ++  // be put there instead of here.
 131.776 ++  template<>
 131.777 ++    int 
 131.778 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 131.779 ++    { 
 131.780 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 131.781 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 131.782 ++    }
 131.783 ++  
 131.784 ++  template<>
 131.785 ++    size_t
 131.786 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 131.787 ++				size_t __n) const 
 131.788 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 131.789 ++
 131.790 ++#ifdef _GLIBCXX_USE_WCHAR_T
 131.791 ++  template<>
 131.792 ++    int 
 131.793 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 131.794 ++				 const wchar_t* __two) const
 131.795 ++    {
 131.796 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 131.797 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 131.798 ++    }
 131.799 ++  
 131.800 ++  template<>
 131.801 ++    size_t
 131.802 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 131.803 ++				   size_t __n) const
 131.804 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 131.805 ++#endif
 131.806 ++}
 131.807 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 131.808 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1969-12-31 18:00:00.000000000 -0600
 131.809 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2005-04-28 01:13:15.000000000 -0500
 131.810 +@@ -0,0 +1,300 @@
 131.811 ++// std::ctype implementation details, GNU version -*- C++ -*-
 131.812 ++
 131.813 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 131.814 ++//
 131.815 ++// This file is part of the GNU ISO C++ Library.  This library is free
 131.816 ++// software; you can redistribute it and/or modify it under the
 131.817 ++// terms of the GNU General Public License as published by the
 131.818 ++// Free Software Foundation; either version 2, or (at your option)
 131.819 ++// any later version.
 131.820 ++
 131.821 ++// This library is distributed in the hope that it will be useful,
 131.822 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 131.823 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 131.824 ++// GNU General Public License for more details.
 131.825 ++
 131.826 ++// You should have received a copy of the GNU General Public License along
 131.827 ++// with this library; see the file COPYING.  If not, write to the Free
 131.828 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 131.829 ++// USA.
 131.830 ++
 131.831 ++// As a special exception, you may use this file as part of a free software
 131.832 ++// library without restriction.  Specifically, if other files instantiate
 131.833 ++// templates or use macros or inline functions from this file, or you compile
 131.834 ++// this file and link it with other files to produce an executable, this
 131.835 ++// file does not by itself cause the resulting executable to be covered by
 131.836 ++// the GNU General Public License.  This exception does not however
 131.837 ++// invalidate any other reasons why the executable file might be covered by
 131.838 ++// the GNU General Public License.
 131.839 ++
 131.840 ++//
 131.841 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 131.842 ++//
 131.843 ++
 131.844 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 131.845 ++
 131.846 ++#define _LIBC
 131.847 ++#include <locale>
 131.848 ++#undef _LIBC
 131.849 ++#include <bits/c++locale_internal.h>
 131.850 ++
 131.851 ++#ifndef __UCLIBC_HAS_XLOCALE__
 131.852 ++#define __wctype_l(S, L)           wctype((S))
 131.853 ++#define __towupper_l(C, L)         towupper((C))
 131.854 ++#define __towlower_l(C, L)         towlower((C))
 131.855 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 131.856 ++#endif
 131.857 ++
 131.858 ++namespace std
 131.859 ++{
 131.860 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 131.861 ++  // various /config/os/* files.
 131.862 ++  template<>
 131.863 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 131.864 ++    : ctype<char>(0, false, __refs) 
 131.865 ++    { 		
 131.866 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 131.867 ++	{
 131.868 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 131.869 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 131.870 ++#ifdef __UCLIBC_HAS_XLOCALE__
 131.871 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 131.872 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 131.873 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 131.874 ++#endif
 131.875 ++	}
 131.876 ++    }
 131.877 ++
 131.878 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 131.879 ++  ctype<wchar_t>::__wmask_type
 131.880 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 131.881 ++  {
 131.882 ++    __wmask_type __ret;
 131.883 ++    switch (__m)
 131.884 ++      {
 131.885 ++      case space:
 131.886 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 131.887 ++	break;
 131.888 ++      case print:
 131.889 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 131.890 ++	break;
 131.891 ++      case cntrl:
 131.892 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 131.893 ++	break;
 131.894 ++      case upper:
 131.895 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 131.896 ++	break;
 131.897 ++      case lower:
 131.898 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 131.899 ++	break;
 131.900 ++      case alpha:
 131.901 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 131.902 ++	break;
 131.903 ++      case digit:
 131.904 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 131.905 ++	break;
 131.906 ++      case punct:
 131.907 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 131.908 ++	break;
 131.909 ++      case xdigit:
 131.910 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 131.911 ++	break;
 131.912 ++      case alnum:
 131.913 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 131.914 ++	break;
 131.915 ++      case graph:
 131.916 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 131.917 ++	break;
 131.918 ++      default:
 131.919 ++	__ret = __wmask_type();
 131.920 ++      }
 131.921 ++    return __ret;
 131.922 ++  }
 131.923 ++  
 131.924 ++  wchar_t
 131.925 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 131.926 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 131.927 ++
 131.928 ++  const wchar_t*
 131.929 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 131.930 ++  {
 131.931 ++    while (__lo < __hi)
 131.932 ++      {
 131.933 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 131.934 ++        ++__lo;
 131.935 ++      }
 131.936 ++    return __hi;
 131.937 ++  }
 131.938 ++  
 131.939 ++  wchar_t
 131.940 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 131.941 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 131.942 ++  
 131.943 ++  const wchar_t*
 131.944 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 131.945 ++  {
 131.946 ++    while (__lo < __hi)
 131.947 ++      {
 131.948 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 131.949 ++        ++__lo;
 131.950 ++      }
 131.951 ++    return __hi;
 131.952 ++  }
 131.953 ++
 131.954 ++  bool
 131.955 ++  ctype<wchar_t>::
 131.956 ++  do_is(mask __m, wchar_t __c) const
 131.957 ++  { 
 131.958 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
 131.959 ++    // library for blank.
 131.960 ++    bool __ret = false;
 131.961 ++    const size_t __bitmasksize = 11; 
 131.962 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 131.963 ++      if (__m & _M_bit[__bitcur]
 131.964 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 131.965 ++	{
 131.966 ++	  __ret = true;
 131.967 ++	  break;
 131.968 ++	}
 131.969 ++    return __ret;    
 131.970 ++  }
 131.971 ++  
 131.972 ++  const wchar_t* 
 131.973 ++  ctype<wchar_t>::
 131.974 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 131.975 ++  {
 131.976 ++    for (; __lo < __hi; ++__vec, ++__lo)
 131.977 ++      {
 131.978 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 131.979 ++	// library for blank.
 131.980 ++	const size_t __bitmasksize = 11; 
 131.981 ++	mask __m = 0;
 131.982 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 131.983 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 131.984 ++	    __m |= _M_bit[__bitcur];
 131.985 ++	*__vec = __m;
 131.986 ++      }
 131.987 ++    return __hi;
 131.988 ++  }
 131.989 ++  
 131.990 ++  const wchar_t* 
 131.991 ++  ctype<wchar_t>::
 131.992 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 131.993 ++  {
 131.994 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
 131.995 ++      ++__lo;
 131.996 ++    return __lo;
 131.997 ++  }
 131.998 ++
 131.999 ++  const wchar_t*
131.1000 ++  ctype<wchar_t>::
131.1001 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
131.1002 ++  {
131.1003 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
131.1004 ++      ++__lo;
131.1005 ++    return __lo;
131.1006 ++  }
131.1007 ++
131.1008 ++  wchar_t
131.1009 ++  ctype<wchar_t>::
131.1010 ++  do_widen(char __c) const
131.1011 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
131.1012 ++
131.1013 ++  const char* 
131.1014 ++  ctype<wchar_t>::
131.1015 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
131.1016 ++  {
131.1017 ++    while (__lo < __hi)
131.1018 ++      {
131.1019 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
131.1020 ++	++__lo;
131.1021 ++	++__dest;
131.1022 ++      }
131.1023 ++    return __hi;
131.1024 ++  }
131.1025 ++
131.1026 ++  char
131.1027 ++  ctype<wchar_t>::
131.1028 ++  do_narrow(wchar_t __wc, char __dfault) const
131.1029 ++  {
131.1030 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
131.1031 ++      return _M_narrow[__wc];
131.1032 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1033 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
131.1034 ++#endif
131.1035 ++    const int __c = wctob(__wc);
131.1036 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1037 ++    __uselocale(__old);
131.1038 ++#endif
131.1039 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
131.1040 ++  }
131.1041 ++
131.1042 ++  const wchar_t*
131.1043 ++  ctype<wchar_t>::
131.1044 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
131.1045 ++	    char* __dest) const
131.1046 ++  {
131.1047 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1048 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
131.1049 ++#endif
131.1050 ++    if (_M_narrow_ok)
131.1051 ++      while (__lo < __hi)
131.1052 ++	{
131.1053 ++	  if (*__lo >= 0 && *__lo < 128)
131.1054 ++	    *__dest = _M_narrow[*__lo];
131.1055 ++	  else
131.1056 ++	    {
131.1057 ++	      const int __c = wctob(*__lo);
131.1058 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
131.1059 ++	    }
131.1060 ++	  ++__lo;
131.1061 ++	  ++__dest;
131.1062 ++	}
131.1063 ++    else
131.1064 ++      while (__lo < __hi)
131.1065 ++	{
131.1066 ++	  const int __c = wctob(*__lo);
131.1067 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
131.1068 ++	  ++__lo;
131.1069 ++	  ++__dest;
131.1070 ++	}
131.1071 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1072 ++    __uselocale(__old);
131.1073 ++#endif
131.1074 ++    return __hi;
131.1075 ++  }
131.1076 ++
131.1077 ++  void
131.1078 ++  ctype<wchar_t>::_M_initialize_ctype()
131.1079 ++  {
131.1080 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1081 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
131.1082 ++#endif
131.1083 ++    wint_t __i;
131.1084 ++    for (__i = 0; __i < 128; ++__i)
131.1085 ++      {
131.1086 ++	const int __c = wctob(__i);
131.1087 ++	if (__c == EOF)
131.1088 ++	  break;
131.1089 ++	else
131.1090 ++	  _M_narrow[__i] = static_cast<char>(__c);
131.1091 ++      }
131.1092 ++    if (__i == 128)
131.1093 ++      _M_narrow_ok = true;
131.1094 ++    else
131.1095 ++      _M_narrow_ok = false;
131.1096 ++    for (size_t __j = 0;
131.1097 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
131.1098 ++      _M_widen[__j] = btowc(__j);
131.1099 ++
131.1100 ++    for (size_t __k = 0; __k <= 11; ++__k)
131.1101 ++      { 
131.1102 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
131.1103 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
131.1104 ++      }
131.1105 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1106 ++    __uselocale(__old);
131.1107 ++#endif
131.1108 ++  }
131.1109 ++#endif //  _GLIBCXX_USE_WCHAR_T
131.1110 ++}
131.1111 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
131.1112 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.cc	1969-12-31 18:00:00.000000000 -0600
131.1113 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2005-04-28 01:13:15.000000000 -0500
131.1114 +@@ -0,0 +1,100 @@
131.1115 ++// std::messages implementation details, GNU version -*- C++ -*-
131.1116 ++
131.1117 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
131.1118 ++//
131.1119 ++// This file is part of the GNU ISO C++ Library.  This library is free
131.1120 ++// software; you can redistribute it and/or modify it under the
131.1121 ++// terms of the GNU General Public License as published by the
131.1122 ++// Free Software Foundation; either version 2, or (at your option)
131.1123 ++// any later version.
131.1124 ++
131.1125 ++// This library is distributed in the hope that it will be useful,
131.1126 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
131.1127 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131.1128 ++// GNU General Public License for more details.
131.1129 ++
131.1130 ++// You should have received a copy of the GNU General Public License along
131.1131 ++// with this library; see the file COPYING.  If not, write to the Free
131.1132 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
131.1133 ++// USA.
131.1134 ++
131.1135 ++// As a special exception, you may use this file as part of a free software
131.1136 ++// library without restriction.  Specifically, if other files instantiate
131.1137 ++// templates or use macros or inline functions from this file, or you compile
131.1138 ++// this file and link it with other files to produce an executable, this
131.1139 ++// file does not by itself cause the resulting executable to be covered by
131.1140 ++// the GNU General Public License.  This exception does not however
131.1141 ++// invalidate any other reasons why the executable file might be covered by
131.1142 ++// the GNU General Public License.
131.1143 ++
131.1144 ++//
131.1145 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
131.1146 ++//
131.1147 ++
131.1148 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
131.1149 ++
131.1150 ++#include <locale>
131.1151 ++#include <bits/c++locale_internal.h>
131.1152 ++
131.1153 ++#ifdef __UCLIBC_MJN3_ONLY__
131.1154 ++#warning fix gettext stuff
131.1155 ++#endif
131.1156 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
131.1157 ++extern "C" char *__dcgettext(const char *domainname,
131.1158 ++			     const char *msgid, int category);
131.1159 ++#undef gettext
131.1160 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
131.1161 ++#else
131.1162 ++#undef gettext
131.1163 ++#define gettext(msgid) (msgid)
131.1164 ++#endif
131.1165 ++
131.1166 ++namespace std
131.1167 ++{
131.1168 ++  // Specializations.
131.1169 ++  template<>
131.1170 ++    string
131.1171 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
131.1172 ++    {
131.1173 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1174 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
131.1175 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
131.1176 ++      __uselocale(__old);
131.1177 ++      return string(__msg);
131.1178 ++#elif defined __UCLIBC_HAS_LOCALE__
131.1179 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
131.1180 ++      setlocale(LC_ALL, _M_name_messages);
131.1181 ++      const char* __msg = gettext(__dfault.c_str());
131.1182 ++      setlocale(LC_ALL, __old);
131.1183 ++      free(__old);
131.1184 ++      return string(__msg);
131.1185 ++#else
131.1186 ++      const char* __msg = gettext(__dfault.c_str());
131.1187 ++      return string(__msg);
131.1188 ++#endif
131.1189 ++    }
131.1190 ++
131.1191 ++#ifdef _GLIBCXX_USE_WCHAR_T
131.1192 ++  template<>
131.1193 ++    wstring
131.1194 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
131.1195 ++    {
131.1196 ++# ifdef __UCLIBC_HAS_XLOCALE__
131.1197 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
131.1198 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
131.1199 ++      __uselocale(__old);
131.1200 ++      return _M_convert_from_char(__msg);
131.1201 ++# elif defined __UCLIBC_HAS_LOCALE__
131.1202 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
131.1203 ++      setlocale(LC_ALL, _M_name_messages);
131.1204 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
131.1205 ++      setlocale(LC_ALL, __old);
131.1206 ++      free(__old);
131.1207 ++      return _M_convert_from_char(__msg);
131.1208 ++# else
131.1209 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
131.1210 ++      return _M_convert_from_char(__msg);
131.1211 ++# endif
131.1212 ++    }
131.1213 ++#endif
131.1214 ++}
131.1215 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.h
131.1216 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.h	1969-12-31 18:00:00.000000000 -0600
131.1217 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2005-04-28 01:13:15.000000000 -0500
131.1218 +@@ -0,0 +1,118 @@
131.1219 ++// std::messages implementation details, GNU version -*- C++ -*-
131.1220 ++
131.1221 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
131.1222 ++//
131.1223 ++// This file is part of the GNU ISO C++ Library.  This library is free
131.1224 ++// software; you can redistribute it and/or modify it under the
131.1225 ++// terms of the GNU General Public License as published by the
131.1226 ++// Free Software Foundation; either version 2, or (at your option)
131.1227 ++// any later version.
131.1228 ++
131.1229 ++// This library is distributed in the hope that it will be useful,
131.1230 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
131.1231 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131.1232 ++// GNU General Public License for more details.
131.1233 ++
131.1234 ++// You should have received a copy of the GNU General Public License along
131.1235 ++// with this library; see the file COPYING.  If not, write to the Free
131.1236 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
131.1237 ++// USA.
131.1238 ++
131.1239 ++// As a special exception, you may use this file as part of a free software
131.1240 ++// library without restriction.  Specifically, if other files instantiate
131.1241 ++// templates or use macros or inline functions from this file, or you compile
131.1242 ++// this file and link it with other files to produce an executable, this
131.1243 ++// file does not by itself cause the resulting executable to be covered by
131.1244 ++// the GNU General Public License.  This exception does not however
131.1245 ++// invalidate any other reasons why the executable file might be covered by
131.1246 ++// the GNU General Public License.
131.1247 ++
131.1248 ++//
131.1249 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
131.1250 ++//
131.1251 ++
131.1252 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
131.1253 ++
131.1254 ++#ifdef __UCLIBC_MJN3_ONLY__
131.1255 ++#warning fix prototypes for *textdomain funcs
131.1256 ++#endif
131.1257 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
131.1258 ++extern "C" char *__textdomain(const char *domainname);
131.1259 ++extern "C" char *__bindtextdomain(const char *domainname,
131.1260 ++				  const char *dirname);
131.1261 ++#else
131.1262 ++#undef __textdomain
131.1263 ++#undef __bindtextdomain
131.1264 ++#define __textdomain(D)           ((void)0)
131.1265 ++#define __bindtextdomain(D,P)     ((void)0)
131.1266 ++#endif
131.1267 ++
131.1268 ++  // Non-virtual member functions.
131.1269 ++  template<typename _CharT>
131.1270 ++     messages<_CharT>::messages(size_t __refs)
131.1271 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
131.1272 ++     _M_name_messages(_S_get_c_name())
131.1273 ++     { }
131.1274 ++
131.1275 ++  template<typename _CharT>
131.1276 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
131.1277 ++				size_t __refs) 
131.1278 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
131.1279 ++     _M_name_messages(__s)
131.1280 ++     {
131.1281 ++       char* __tmp = new char[std::strlen(__s) + 1];
131.1282 ++       std::strcpy(__tmp, __s);
131.1283 ++       _M_name_messages = __tmp;
131.1284 ++     }
131.1285 ++
131.1286 ++  template<typename _CharT>
131.1287 ++    typename messages<_CharT>::catalog 
131.1288 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
131.1289 ++			   const char* __dir) const
131.1290 ++    { 
131.1291 ++      __bindtextdomain(__s.c_str(), __dir);
131.1292 ++      return this->do_open(__s, __loc); 
131.1293 ++    }
131.1294 ++
131.1295 ++  // Virtual member functions.
131.1296 ++  template<typename _CharT>
131.1297 ++    messages<_CharT>::~messages()
131.1298 ++    { 
131.1299 ++      if (_M_name_messages != _S_get_c_name())
131.1300 ++	delete [] _M_name_messages;
131.1301 ++      _S_destroy_c_locale(_M_c_locale_messages); 
131.1302 ++    }
131.1303 ++
131.1304 ++  template<typename _CharT>
131.1305 ++    typename messages<_CharT>::catalog 
131.1306 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
131.1307 ++			      const locale&) const
131.1308 ++    { 
131.1309 ++      // No error checking is done, assume the catalog exists and can
131.1310 ++      // be used.
131.1311 ++      __textdomain(__s.c_str());
131.1312 ++      return 0;
131.1313 ++    }
131.1314 ++
131.1315 ++  template<typename _CharT>
131.1316 ++    void    
131.1317 ++    messages<_CharT>::do_close(catalog) const 
131.1318 ++    { }
131.1319 ++
131.1320 ++   // messages_byname
131.1321 ++   template<typename _CharT>
131.1322 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
131.1323 ++     : messages<_CharT>(__refs) 
131.1324 ++     { 
131.1325 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
131.1326 ++	 delete [] this->_M_name_messages;
131.1327 ++       char* __tmp = new char[std::strlen(__s) + 1];
131.1328 ++       std::strcpy(__tmp, __s);
131.1329 ++       this->_M_name_messages = __tmp;
131.1330 ++
131.1331 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
131.1332 ++	 {
131.1333 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
131.1334 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
131.1335 ++	 }
131.1336 ++     }
131.1337 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
131.1338 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1969-12-31 18:00:00.000000000 -0600
131.1339 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2005-04-28 01:23:02.000000000 -0500
131.1340 +@@ -0,0 +1,692 @@
131.1341 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
131.1342 ++
131.1343 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
131.1344 ++//
131.1345 ++// This file is part of the GNU ISO C++ Library.  This library is free
131.1346 ++// software; you can redistribute it and/or modify it under the
131.1347 ++// terms of the GNU General Public License as published by the
131.1348 ++// Free Software Foundation; either version 2, or (at your option)
131.1349 ++// any later version.
131.1350 ++
131.1351 ++// This library is distributed in the hope that it will be useful,
131.1352 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
131.1353 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131.1354 ++// GNU General Public License for more details.
131.1355 ++
131.1356 ++// You should have received a copy of the GNU General Public License along
131.1357 ++// with this library; see the file COPYING.  If not, write to the Free
131.1358 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
131.1359 ++// USA.
131.1360 ++
131.1361 ++// As a special exception, you may use this file as part of a free software
131.1362 ++// library without restriction.  Specifically, if other files instantiate
131.1363 ++// templates or use macros or inline functions from this file, or you compile
131.1364 ++// this file and link it with other files to produce an executable, this
131.1365 ++// file does not by itself cause the resulting executable to be covered by
131.1366 ++// the GNU General Public License.  This exception does not however
131.1367 ++// invalidate any other reasons why the executable file might be covered by
131.1368 ++// the GNU General Public License.
131.1369 ++
131.1370 ++//
131.1371 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
131.1372 ++//
131.1373 ++
131.1374 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
131.1375 ++
131.1376 ++#define _LIBC
131.1377 ++#include <locale>
131.1378 ++#undef _LIBC
131.1379 ++#include <bits/c++locale_internal.h>
131.1380 ++
131.1381 ++#ifdef __UCLIBC_MJN3_ONLY__
131.1382 ++#warning optimize this for uclibc
131.1383 ++#warning tailor for stub locale support
131.1384 ++#endif
131.1385 ++
131.1386 ++#ifndef __UCLIBC_HAS_XLOCALE__
131.1387 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
131.1388 ++#endif
131.1389 ++
131.1390 ++namespace std
131.1391 ++{
131.1392 ++  // Construct and return valid pattern consisting of some combination of:
131.1393 ++  // space none symbol sign value
131.1394 ++  money_base::pattern
131.1395 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
131.1396 ++  { 
131.1397 ++    pattern __ret;
131.1398 ++
131.1399 ++    // This insanely complicated routine attempts to construct a valid
131.1400 ++    // pattern for use with monyepunct. A couple of invariants:
131.1401 ++
131.1402 ++    // if (__precedes) symbol -> value
131.1403 ++    // else value -> symbol
131.1404 ++    
131.1405 ++    // if (__space) space
131.1406 ++    // else none
131.1407 ++
131.1408 ++    // none == never first
131.1409 ++    // space never first or last
131.1410 ++
131.1411 ++    // Any elegant implementations of this are welcome.
131.1412 ++    switch (__posn)
131.1413 ++      {
131.1414 ++      case 0:
131.1415 ++      case 1:
131.1416 ++	// 1 The sign precedes the value and symbol.
131.1417 ++	__ret.field[0] = sign;
131.1418 ++	if (__space)
131.1419 ++	  {
131.1420 ++	    // Pattern starts with sign.
131.1421 ++	    if (__precedes)
131.1422 ++	      {
131.1423 ++		__ret.field[1] = symbol;
131.1424 ++		__ret.field[3] = value;
131.1425 ++	      }
131.1426 ++	    else
131.1427 ++	      {
131.1428 ++		__ret.field[1] = value;
131.1429 ++		__ret.field[3] = symbol;
131.1430 ++	      }
131.1431 ++	    __ret.field[2] = space;
131.1432 ++	  }
131.1433 ++	else
131.1434 ++	  {
131.1435 ++	    // Pattern starts with sign and ends with none.
131.1436 ++	    if (__precedes)
131.1437 ++	      {
131.1438 ++		__ret.field[1] = symbol;
131.1439 ++		__ret.field[2] = value;
131.1440 ++	      }
131.1441 ++	    else
131.1442 ++	      {
131.1443 ++		__ret.field[1] = value;
131.1444 ++		__ret.field[2] = symbol;
131.1445 ++	      }
131.1446 ++	    __ret.field[3] = none;
131.1447 ++	  }
131.1448 ++	break;
131.1449 ++      case 2:
131.1450 ++	// 2 The sign follows the value and symbol.
131.1451 ++	if (__space)
131.1452 ++	  {
131.1453 ++	    // Pattern either ends with sign.
131.1454 ++	    if (__precedes)
131.1455 ++	      {
131.1456 ++		__ret.field[0] = symbol;
131.1457 ++		__ret.field[2] = value;
131.1458 ++	      }
131.1459 ++	    else
131.1460 ++	      {
131.1461 ++		__ret.field[0] = value;
131.1462 ++		__ret.field[2] = symbol;
131.1463 ++	      }
131.1464 ++	    __ret.field[1] = space;
131.1465 ++	    __ret.field[3] = sign;
131.1466 ++	  }
131.1467 ++	else
131.1468 ++	  {
131.1469 ++	    // Pattern ends with sign then none.
131.1470 ++	    if (__precedes)
131.1471 ++	      {
131.1472 ++		__ret.field[0] = symbol;
131.1473 ++		__ret.field[1] = value;
131.1474 ++	      }
131.1475 ++	    else
131.1476 ++	      {
131.1477 ++		__ret.field[0] = value;
131.1478 ++		__ret.field[1] = symbol;
131.1479 ++	      }
131.1480 ++	    __ret.field[2] = sign;
131.1481 ++	    __ret.field[3] = none;
131.1482 ++	  }
131.1483 ++	break;
131.1484 ++      case 3:
131.1485 ++	// 3 The sign immediately precedes the symbol.
131.1486 ++	if (__precedes)
131.1487 ++	  {
131.1488 ++	    __ret.field[0] = sign;
131.1489 ++	    __ret.field[1] = symbol;	    
131.1490 ++	    if (__space)
131.1491 ++	      {
131.1492 ++		__ret.field[2] = space;
131.1493 ++		__ret.field[3] = value;
131.1494 ++	      }
131.1495 ++	    else
131.1496 ++	      {
131.1497 ++		__ret.field[2] = value;		
131.1498 ++		__ret.field[3] = none;
131.1499 ++	      }
131.1500 ++	  }
131.1501 ++	else
131.1502 ++	  {
131.1503 ++	    __ret.field[0] = value;
131.1504 ++	    if (__space)
131.1505 ++	      {
131.1506 ++		__ret.field[1] = space;
131.1507 ++		__ret.field[2] = sign;
131.1508 ++		__ret.field[3] = symbol;
131.1509 ++	      }
131.1510 ++	    else
131.1511 ++	      {
131.1512 ++		__ret.field[1] = sign;
131.1513 ++		__ret.field[2] = symbol;
131.1514 ++		__ret.field[3] = none;
131.1515 ++	      }
131.1516 ++	  }
131.1517 ++	break;
131.1518 ++      case 4:
131.1519 ++	// 4 The sign immediately follows the symbol.
131.1520 ++	if (__precedes)
131.1521 ++	  {
131.1522 ++	    __ret.field[0] = symbol;
131.1523 ++	    __ret.field[1] = sign;
131.1524 ++	    if (__space)
131.1525 ++	      {
131.1526 ++		__ret.field[2] = space;
131.1527 ++		__ret.field[3] = value;
131.1528 ++	      }
131.1529 ++	    else
131.1530 ++	      {
131.1531 ++		__ret.field[2] = value;
131.1532 ++		__ret.field[3] = none;
131.1533 ++	      }
131.1534 ++	  }
131.1535 ++	else
131.1536 ++	  {
131.1537 ++	    __ret.field[0] = value;
131.1538 ++	    if (__space)
131.1539 ++	      {
131.1540 ++		__ret.field[1] = space;
131.1541 ++		__ret.field[2] = symbol;
131.1542 ++		__ret.field[3] = sign;
131.1543 ++	      }
131.1544 ++	    else
131.1545 ++	      {
131.1546 ++		__ret.field[1] = symbol;
131.1547 ++		__ret.field[2] = sign;
131.1548 ++		__ret.field[3] = none;
131.1549 ++	      }
131.1550 ++	  }
131.1551 ++	break;
131.1552 ++      default:
131.1553 ++	__ret = pattern();
131.1554 ++      }
131.1555 ++    return __ret;
131.1556 ++  }
131.1557 ++
131.1558 ++  template<> 
131.1559 ++    void
131.1560 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
131.1561 ++						     const char*)
131.1562 ++    {
131.1563 ++      if (!_M_data)
131.1564 ++	_M_data = new __moneypunct_cache<char, true>;
131.1565 ++
131.1566 ++      if (!__cloc)
131.1567 ++	{
131.1568 ++	  // "C" locale
131.1569 ++	  _M_data->_M_decimal_point = '.';
131.1570 ++	  _M_data->_M_thousands_sep = ',';
131.1571 ++	  _M_data->_M_grouping = "";
131.1572 ++	  _M_data->_M_grouping_size = 0;
131.1573 ++	  _M_data->_M_curr_symbol = "";
131.1574 ++	  _M_data->_M_curr_symbol_size = 0;
131.1575 ++	  _M_data->_M_positive_sign = "";
131.1576 ++	  _M_data->_M_positive_sign_size = 0;
131.1577 ++	  _M_data->_M_negative_sign = "";
131.1578 ++	  _M_data->_M_negative_sign_size = 0;
131.1579 ++	  _M_data->_M_frac_digits = 0;
131.1580 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
131.1581 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
131.1582 ++
131.1583 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
131.1584 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
131.1585 ++	}
131.1586 ++      else
131.1587 ++	{
131.1588 ++	  // Named locale.
131.1589 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
131.1590 ++							__cloc));
131.1591 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
131.1592 ++							__cloc));
131.1593 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
131.1594 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
131.1595 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
131.1596 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
131.1597 ++
131.1598 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
131.1599 ++	  if (!__nposn)
131.1600 ++	    _M_data->_M_negative_sign = "()";
131.1601 ++	  else
131.1602 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
131.1603 ++							__cloc);
131.1604 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
131.1605 ++
131.1606 ++	  // _Intl == true
131.1607 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
131.1608 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
131.1609 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
131.1610 ++						      __cloc));
131.1611 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
131.1612 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
131.1613 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
131.1614 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
131.1615 ++							__pposn);
131.1616 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
131.1617 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
131.1618 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
131.1619 ++							__nposn);
131.1620 ++	}
131.1621 ++    }
131.1622 ++
131.1623 ++  template<> 
131.1624 ++    void
131.1625 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
131.1626 ++						      const char*)
131.1627 ++    {
131.1628 ++      if (!_M_data)
131.1629 ++	_M_data = new __moneypunct_cache<char, false>;
131.1630 ++
131.1631 ++      if (!__cloc)
131.1632 ++	{
131.1633 ++	  // "C" locale
131.1634 ++	  _M_data->_M_decimal_point = '.';
131.1635 ++	  _M_data->_M_thousands_sep = ',';
131.1636 ++	  _M_data->_M_grouping = "";
131.1637 ++	  _M_data->_M_grouping_size = 0;
131.1638 ++	  _M_data->_M_curr_symbol = "";
131.1639 ++	  _M_data->_M_curr_symbol_size = 0;
131.1640 ++	  _M_data->_M_positive_sign = "";
131.1641 ++	  _M_data->_M_positive_sign_size = 0;
131.1642 ++	  _M_data->_M_negative_sign = "";
131.1643 ++	  _M_data->_M_negative_sign_size = 0;
131.1644 ++	  _M_data->_M_frac_digits = 0;
131.1645 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
131.1646 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
131.1647 ++
131.1648 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
131.1649 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
131.1650 ++	}
131.1651 ++      else
131.1652 ++	{
131.1653 ++	  // Named locale.
131.1654 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
131.1655 ++							__cloc));
131.1656 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
131.1657 ++							__cloc));
131.1658 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
131.1659 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
131.1660 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
131.1661 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
131.1662 ++
131.1663 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
131.1664 ++	  if (!__nposn)
131.1665 ++	    _M_data->_M_negative_sign = "()";
131.1666 ++	  else
131.1667 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
131.1668 ++							__cloc);
131.1669 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
131.1670 ++
131.1671 ++	  // _Intl == false
131.1672 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
131.1673 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
131.1674 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
131.1675 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
131.1676 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
131.1677 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
131.1678 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
131.1679 ++							__pposn);
131.1680 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
131.1681 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
131.1682 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
131.1683 ++							__nposn);
131.1684 ++	}
131.1685 ++    }
131.1686 ++
131.1687 ++  template<> 
131.1688 ++    moneypunct<char, true>::~moneypunct()
131.1689 ++    { delete _M_data; }
131.1690 ++
131.1691 ++  template<> 
131.1692 ++    moneypunct<char, false>::~moneypunct()
131.1693 ++    { delete _M_data; }
131.1694 ++
131.1695 ++#ifdef _GLIBCXX_USE_WCHAR_T
131.1696 ++  template<> 
131.1697 ++    void
131.1698 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
131.1699 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1700 ++							const char*)
131.1701 ++#else
131.1702 ++							const char* __name)
131.1703 ++#endif
131.1704 ++    {
131.1705 ++      if (!_M_data)
131.1706 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
131.1707 ++
131.1708 ++      if (!__cloc)
131.1709 ++	{
131.1710 ++	  // "C" locale
131.1711 ++	  _M_data->_M_decimal_point = L'.';
131.1712 ++	  _M_data->_M_thousands_sep = L',';
131.1713 ++	  _M_data->_M_grouping = "";
131.1714 ++	  _M_data->_M_grouping_size = 0;
131.1715 ++	  _M_data->_M_curr_symbol = L"";
131.1716 ++	  _M_data->_M_curr_symbol_size = 0;
131.1717 ++	  _M_data->_M_positive_sign = L"";
131.1718 ++	  _M_data->_M_positive_sign_size = 0;
131.1719 ++	  _M_data->_M_negative_sign = L"";
131.1720 ++	  _M_data->_M_negative_sign_size = 0;
131.1721 ++	  _M_data->_M_frac_digits = 0;
131.1722 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
131.1723 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
131.1724 ++
131.1725 ++	  // Use ctype::widen code without the facet...
131.1726 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
131.1727 ++	    _M_data->_M_atoms[__i] =
131.1728 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
131.1729 ++	}
131.1730 ++      else
131.1731 ++	{
131.1732 ++	  // Named locale.
131.1733 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1734 ++	  __c_locale __old = __uselocale(__cloc);
131.1735 ++#else
131.1736 ++	  // Switch to named locale so that mbsrtowcs will work.
131.1737 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
131.1738 ++	  setlocale(LC_ALL, __name);
131.1739 ++#endif
131.1740 ++
131.1741 ++#ifdef __UCLIBC_MJN3_ONLY__
131.1742 ++#warning fix this... should be monetary
131.1743 ++#endif
131.1744 ++#ifdef __UCLIBC__
131.1745 ++# ifdef __UCLIBC_HAS_XLOCALE__
131.1746 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
131.1747 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
131.1748 ++# else
131.1749 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
131.1750 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
131.1751 ++# endif
131.1752 ++#else
131.1753 ++	  union { char *__s; wchar_t __w; } __u;
131.1754 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
131.1755 ++	  _M_data->_M_decimal_point = __u.__w;
131.1756 ++
131.1757 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
131.1758 ++	  _M_data->_M_thousands_sep = __u.__w;
131.1759 ++#endif
131.1760 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
131.1761 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
131.1762 ++
131.1763 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
131.1764 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
131.1765 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
131.1766 ++
131.1767 ++	  wchar_t* __wcs_ps = 0;
131.1768 ++	  wchar_t* __wcs_ns = 0;
131.1769 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
131.1770 ++	  try
131.1771 ++	    {
131.1772 ++	      mbstate_t __state;
131.1773 ++	      size_t __len = strlen(__cpossign);
131.1774 ++	      if (__len)
131.1775 ++		{
131.1776 ++		  ++__len;
131.1777 ++		  memset(&__state, 0, sizeof(mbstate_t));
131.1778 ++		  __wcs_ps = new wchar_t[__len];
131.1779 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
131.1780 ++		  _M_data->_M_positive_sign = __wcs_ps;
131.1781 ++		}
131.1782 ++	      else
131.1783 ++		_M_data->_M_positive_sign = L"";
131.1784 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
131.1785 ++	      
131.1786 ++	      __len = strlen(__cnegsign);
131.1787 ++	      if (!__nposn)
131.1788 ++		_M_data->_M_negative_sign = L"()";
131.1789 ++	      else if (__len)
131.1790 ++		{ 
131.1791 ++		  ++__len;
131.1792 ++		  memset(&__state, 0, sizeof(mbstate_t));
131.1793 ++		  __wcs_ns = new wchar_t[__len];
131.1794 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
131.1795 ++		  _M_data->_M_negative_sign = __wcs_ns;
131.1796 ++		}
131.1797 ++	      else
131.1798 ++		_M_data->_M_negative_sign = L"";
131.1799 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
131.1800 ++	      
131.1801 ++	      // _Intl == true.
131.1802 ++	      __len = strlen(__ccurr);
131.1803 ++	      if (__len)
131.1804 ++		{
131.1805 ++		  ++__len;
131.1806 ++		  memset(&__state, 0, sizeof(mbstate_t));
131.1807 ++		  wchar_t* __wcs = new wchar_t[__len];
131.1808 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
131.1809 ++		  _M_data->_M_curr_symbol = __wcs;
131.1810 ++		}
131.1811 ++	      else
131.1812 ++		_M_data->_M_curr_symbol = L"";
131.1813 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
131.1814 ++	    }
131.1815 ++	  catch (...)
131.1816 ++	    {
131.1817 ++	      delete _M_data;
131.1818 ++	      _M_data = 0;
131.1819 ++	      delete __wcs_ps;
131.1820 ++	      delete __wcs_ns;	      
131.1821 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1822 ++	      __uselocale(__old);
131.1823 ++#else
131.1824 ++	      setlocale(LC_ALL, __old);
131.1825 ++	      free(__old);
131.1826 ++#endif
131.1827 ++	      __throw_exception_again;
131.1828 ++	    } 
131.1829 ++	  
131.1830 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
131.1831 ++						      __cloc));
131.1832 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
131.1833 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
131.1834 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
131.1835 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
131.1836 ++							__pposn);
131.1837 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
131.1838 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
131.1839 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
131.1840 ++							__nposn);
131.1841 ++
131.1842 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1843 ++	  __uselocale(__old);
131.1844 ++#else
131.1845 ++	  setlocale(LC_ALL, __old);
131.1846 ++	  free(__old);
131.1847 ++#endif
131.1848 ++	}
131.1849 ++    }
131.1850 ++
131.1851 ++  template<> 
131.1852 ++  void
131.1853 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
131.1854 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1855 ++						       const char*)
131.1856 ++#else
131.1857 ++                                                       const char* __name)
131.1858 ++#endif
131.1859 ++  {
131.1860 ++    if (!_M_data)
131.1861 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
131.1862 ++
131.1863 ++    if (!__cloc)
131.1864 ++	{
131.1865 ++	  // "C" locale
131.1866 ++	  _M_data->_M_decimal_point = L'.';
131.1867 ++	  _M_data->_M_thousands_sep = L',';
131.1868 ++	  _M_data->_M_grouping = "";
131.1869 ++          _M_data->_M_grouping_size = 0;
131.1870 ++	  _M_data->_M_curr_symbol = L"";
131.1871 ++	  _M_data->_M_curr_symbol_size = 0;
131.1872 ++	  _M_data->_M_positive_sign = L"";
131.1873 ++	  _M_data->_M_positive_sign_size = 0;
131.1874 ++	  _M_data->_M_negative_sign = L"";
131.1875 ++	  _M_data->_M_negative_sign_size = 0;
131.1876 ++	  _M_data->_M_frac_digits = 0;
131.1877 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
131.1878 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
131.1879 ++
131.1880 ++	  // Use ctype::widen code without the facet...
131.1881 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
131.1882 ++	    _M_data->_M_atoms[__i] =
131.1883 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
131.1884 ++	}
131.1885 ++      else
131.1886 ++	{
131.1887 ++	  // Named locale.
131.1888 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1889 ++	  __c_locale __old = __uselocale(__cloc);
131.1890 ++#else
131.1891 ++	  // Switch to named locale so that mbsrtowcs will work.
131.1892 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
131.1893 ++	  setlocale(LC_ALL, __name);
131.1894 ++#endif
131.1895 ++
131.1896 ++#ifdef __UCLIBC_MJN3_ONLY__
131.1897 ++#warning fix this... should be monetary
131.1898 ++#endif
131.1899 ++#ifdef __UCLIBC__
131.1900 ++# ifdef __UCLIBC_HAS_XLOCALE__
131.1901 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
131.1902 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
131.1903 ++# else
131.1904 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
131.1905 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
131.1906 ++# endif
131.1907 ++#else
131.1908 ++          union { char *__s; wchar_t __w; } __u;
131.1909 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
131.1910 ++	  _M_data->_M_decimal_point = __u.__w;
131.1911 ++
131.1912 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
131.1913 ++	  _M_data->_M_thousands_sep = __u.__w;
131.1914 ++#endif
131.1915 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
131.1916 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
131.1917 ++
131.1918 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
131.1919 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
131.1920 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
131.1921 ++
131.1922 ++	  wchar_t* __wcs_ps = 0;
131.1923 ++	  wchar_t* __wcs_ns = 0;
131.1924 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
131.1925 ++	  try
131.1926 ++            {
131.1927 ++              mbstate_t __state;
131.1928 ++              size_t __len;
131.1929 ++              __len = strlen(__cpossign);
131.1930 ++              if (__len)
131.1931 ++                {
131.1932 ++		  ++__len;
131.1933 ++		  memset(&__state, 0, sizeof(mbstate_t));
131.1934 ++		  __wcs_ps = new wchar_t[__len];
131.1935 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
131.1936 ++		  _M_data->_M_positive_sign = __wcs_ps;
131.1937 ++		}
131.1938 ++	      else
131.1939 ++		_M_data->_M_positive_sign = L"";
131.1940 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
131.1941 ++	      
131.1942 ++	      __len = strlen(__cnegsign);
131.1943 ++	      if (!__nposn)
131.1944 ++		_M_data->_M_negative_sign = L"()";
131.1945 ++	      else if (__len)
131.1946 ++		{ 
131.1947 ++		  ++__len;
131.1948 ++		  memset(&__state, 0, sizeof(mbstate_t));
131.1949 ++		  __wcs_ns = new wchar_t[__len];
131.1950 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
131.1951 ++		  _M_data->_M_negative_sign = __wcs_ns;
131.1952 ++		}
131.1953 ++	      else
131.1954 ++		_M_data->_M_negative_sign = L"";
131.1955 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
131.1956 ++
131.1957 ++	      // _Intl == true.
131.1958 ++	      __len = strlen(__ccurr);
131.1959 ++	      if (__len)
131.1960 ++		{
131.1961 ++		  ++__len;
131.1962 ++		  memset(&__state, 0, sizeof(mbstate_t));
131.1963 ++		  wchar_t* __wcs = new wchar_t[__len];
131.1964 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
131.1965 ++		  _M_data->_M_curr_symbol = __wcs;
131.1966 ++		}
131.1967 ++	      else
131.1968 ++		_M_data->_M_curr_symbol = L"";
131.1969 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
131.1970 ++	    }
131.1971 ++          catch (...)
131.1972 ++	    {
131.1973 ++	      delete _M_data;
131.1974 ++              _M_data = 0;
131.1975 ++	      delete __wcs_ps;
131.1976 ++	      delete __wcs_ns;	      
131.1977 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1978 ++	      __uselocale(__old);
131.1979 ++#else
131.1980 ++	      setlocale(LC_ALL, __old);
131.1981 ++	      free(__old);
131.1982 ++#endif
131.1983 ++              __throw_exception_again;
131.1984 ++	    }
131.1985 ++
131.1986 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
131.1987 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
131.1988 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
131.1989 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
131.1990 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
131.1991 ++	                                                __pposn);
131.1992 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
131.1993 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
131.1994 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
131.1995 ++	                                                __nposn);
131.1996 ++
131.1997 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.1998 ++	  __uselocale(__old);
131.1999 ++#else
131.2000 ++	  setlocale(LC_ALL, __old);
131.2001 ++	  free(__old);
131.2002 ++#endif
131.2003 ++	}
131.2004 ++    }
131.2005 ++
131.2006 ++  template<> 
131.2007 ++    moneypunct<wchar_t, true>::~moneypunct()
131.2008 ++    {
131.2009 ++      if (_M_data->_M_positive_sign_size)
131.2010 ++	delete [] _M_data->_M_positive_sign;
131.2011 ++      if (_M_data->_M_negative_sign_size
131.2012 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
131.2013 ++	delete [] _M_data->_M_negative_sign;
131.2014 ++      if (_M_data->_M_curr_symbol_size)
131.2015 ++	delete [] _M_data->_M_curr_symbol;
131.2016 ++      delete _M_data;
131.2017 ++    }
131.2018 ++
131.2019 ++  template<> 
131.2020 ++    moneypunct<wchar_t, false>::~moneypunct()
131.2021 ++    {
131.2022 ++      if (_M_data->_M_positive_sign_size)
131.2023 ++	delete [] _M_data->_M_positive_sign;
131.2024 ++      if (_M_data->_M_negative_sign_size
131.2025 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
131.2026 ++	delete [] _M_data->_M_negative_sign;
131.2027 ++      if (_M_data->_M_curr_symbol_size)
131.2028 ++	delete [] _M_data->_M_curr_symbol;
131.2029 ++      delete _M_data;
131.2030 ++    }
131.2031 ++#endif
131.2032 ++}
131.2033 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
131.2034 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1969-12-31 18:00:00.000000000 -0600
131.2035 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2005-04-28 01:20:20.000000000 -0500
131.2036 +@@ -0,0 +1,173 @@
131.2037 ++// std::numpunct implementation details, GNU version -*- C++ -*-
131.2038 ++
131.2039 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
131.2040 ++//
131.2041 ++// This file is part of the GNU ISO C++ Library.  This library is free
131.2042 ++// software; you can redistribute it and/or modify it under the
131.2043 ++// terms of the GNU General Public License as published by the
131.2044 ++// Free Software Foundation; either version 2, or (at your option)
131.2045 ++// any later version.
131.2046 ++
131.2047 ++// This library is distributed in the hope that it will be useful,
131.2048 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
131.2049 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131.2050 ++// GNU General Public License for more details.
131.2051 ++
131.2052 ++// You should have received a copy of the GNU General Public License along
131.2053 ++// with this library; see the file COPYING.  If not, write to the Free
131.2054 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
131.2055 ++// USA.
131.2056 ++
131.2057 ++// As a special exception, you may use this file as part of a free software
131.2058 ++// library without restriction.  Specifically, if other files instantiate
131.2059 ++// templates or use macros or inline functions from this file, or you compile
131.2060 ++// this file and link it with other files to produce an executable, this
131.2061 ++// file does not by itself cause the resulting executable to be covered by
131.2062 ++// the GNU General Public License.  This exception does not however
131.2063 ++// invalidate any other reasons why the executable file might be covered by
131.2064 ++// the GNU General Public License.
131.2065 ++
131.2066 ++//
131.2067 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
131.2068 ++//
131.2069 ++
131.2070 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
131.2071 ++
131.2072 ++#define _LIBC
131.2073 ++#include <locale>
131.2074 ++#undef _LIBC
131.2075 ++#include <bits/c++locale_internal.h>
131.2076 ++
131.2077 ++#ifdef __UCLIBC_MJN3_ONLY__
131.2078 ++#warning tailor for stub locale support
131.2079 ++#endif
131.2080 ++#ifndef __UCLIBC_HAS_XLOCALE__
131.2081 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
131.2082 ++#endif
131.2083 ++
131.2084 ++namespace std
131.2085 ++{
131.2086 ++  template<> 
131.2087 ++    void
131.2088 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
131.2089 ++    {
131.2090 ++      if (!_M_data)
131.2091 ++	_M_data = new __numpunct_cache<char>;
131.2092 ++
131.2093 ++      if (!__cloc)
131.2094 ++	{
131.2095 ++	  // "C" locale
131.2096 ++	  _M_data->_M_grouping = "";
131.2097 ++	  _M_data->_M_grouping_size = 0;
131.2098 ++	  _M_data->_M_use_grouping = false;
131.2099 ++
131.2100 ++	  _M_data->_M_decimal_point = '.';
131.2101 ++	  _M_data->_M_thousands_sep = ',';
131.2102 ++
131.2103 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
131.2104 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
131.2105 ++
131.2106 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
131.2107 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
131.2108 ++	}
131.2109 ++      else
131.2110 ++	{
131.2111 ++	  // Named locale.
131.2112 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
131.2113 ++							__cloc));
131.2114 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
131.2115 ++							__cloc));
131.2116 ++
131.2117 ++	  // Check for NULL, which implies no grouping.
131.2118 ++	  if (_M_data->_M_thousands_sep == '\0')
131.2119 ++	    _M_data->_M_grouping = "";
131.2120 ++	  else
131.2121 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
131.2122 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
131.2123 ++	}
131.2124 ++
131.2125 ++      // NB: There is no way to extact this info from posix locales.
131.2126 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
131.2127 ++      _M_data->_M_truename = "true";
131.2128 ++      _M_data->_M_truename_size = 4;
131.2129 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
131.2130 ++      _M_data->_M_falsename = "false";
131.2131 ++      _M_data->_M_falsename_size = 5;
131.2132 ++    }
131.2133 ++ 
131.2134 ++  template<> 
131.2135 ++    numpunct<char>::~numpunct()
131.2136 ++    { delete _M_data; }
131.2137 ++   
131.2138 ++#ifdef _GLIBCXX_USE_WCHAR_T
131.2139 ++  template<> 
131.2140 ++    void
131.2141 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
131.2142 ++    {
131.2143 ++      if (!_M_data)
131.2144 ++	_M_data = new __numpunct_cache<wchar_t>;
131.2145 ++
131.2146 ++      if (!__cloc)
131.2147 ++	{
131.2148 ++	  // "C" locale
131.2149 ++	  _M_data->_M_grouping = "";
131.2150 ++	  _M_data->_M_grouping_size = 0;
131.2151 ++	  _M_data->_M_use_grouping = false;
131.2152 ++
131.2153 ++	  _M_data->_M_decimal_point = L'.';
131.2154 ++	  _M_data->_M_thousands_sep = L',';
131.2155 ++
131.2156 ++	  // Use ctype::widen code without the facet...
131.2157 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
131.2158 ++	    _M_data->_M_atoms_out[__i] =
131.2159 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
131.2160 ++
131.2161 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
131.2162 ++	    _M_data->_M_atoms_in[__j] =
131.2163 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
131.2164 ++	}
131.2165 ++      else
131.2166 ++	{
131.2167 ++	  // Named locale.
131.2168 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
131.2169 ++#ifdef __UCLIBC_MJN3_ONLY__
131.2170 ++#warning fix this
131.2171 ++#endif
131.2172 ++#ifdef __UCLIBC__
131.2173 ++# ifdef __UCLIBC_HAS_XLOCALE__
131.2174 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
131.2175 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
131.2176 ++# else
131.2177 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
131.2178 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
131.2179 ++# endif
131.2180 ++#else
131.2181 ++	  union { char *__s; wchar_t __w; } __u;
131.2182 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
131.2183 ++	  _M_data->_M_decimal_point = __u.__w;
131.2184 ++
131.2185 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
131.2186 ++	  _M_data->_M_thousands_sep = __u.__w;
131.2187 ++#endif
131.2188 ++
131.2189 ++	  if (_M_data->_M_thousands_sep == L'\0')
131.2190 ++	    _M_data->_M_grouping = "";
131.2191 ++	  else
131.2192 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
131.2193 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
131.2194 ++	}
131.2195 ++
131.2196 ++      // NB: There is no way to extact this info from posix locales.
131.2197 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
131.2198 ++      _M_data->_M_truename = L"true";
131.2199 ++      _M_data->_M_truename_size = 4;
131.2200 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
131.2201 ++      _M_data->_M_falsename = L"false";
131.2202 ++      _M_data->_M_falsename_size = 5;
131.2203 ++    }
131.2204 ++
131.2205 ++  template<> 
131.2206 ++    numpunct<wchar_t>::~numpunct()
131.2207 ++    { delete _M_data; }
131.2208 ++ #endif
131.2209 ++}
131.2210 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.cc
131.2211 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.cc	1969-12-31 18:00:00.000000000 -0600
131.2212 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2005-04-28 01:13:15.000000000 -0500
131.2213 +@@ -0,0 +1,406 @@
131.2214 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
131.2215 ++
131.2216 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
131.2217 ++//
131.2218 ++// This file is part of the GNU ISO C++ Library.  This library is free
131.2219 ++// software; you can redistribute it and/or modify it under the
131.2220 ++// terms of the GNU General Public License as published by the
131.2221 ++// Free Software Foundation; either version 2, or (at your option)
131.2222 ++// any later version.
131.2223 ++
131.2224 ++// This library is distributed in the hope that it will be useful,
131.2225 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
131.2226 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131.2227 ++// GNU General Public License for more details.
131.2228 ++
131.2229 ++// You should have received a copy of the GNU General Public License along
131.2230 ++// with this library; see the file COPYING.  If not, write to the Free
131.2231 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
131.2232 ++// USA.
131.2233 ++
131.2234 ++// As a special exception, you may use this file as part of a free software
131.2235 ++// library without restriction.  Specifically, if other files instantiate
131.2236 ++// templates or use macros or inline functions from this file, or you compile
131.2237 ++// this file and link it with other files to produce an executable, this
131.2238 ++// file does not by itself cause the resulting executable to be covered by
131.2239 ++// the GNU General Public License.  This exception does not however
131.2240 ++// invalidate any other reasons why the executable file might be covered by
131.2241 ++// the GNU General Public License.
131.2242 ++
131.2243 ++//
131.2244 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
131.2245 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
131.2246 ++//
131.2247 ++
131.2248 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
131.2249 ++
131.2250 ++#include <locale>
131.2251 ++#include <bits/c++locale_internal.h>
131.2252 ++
131.2253 ++#ifdef __UCLIBC_MJN3_ONLY__
131.2254 ++#warning tailor for stub locale support
131.2255 ++#endif
131.2256 ++#ifndef __UCLIBC_HAS_XLOCALE__
131.2257 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
131.2258 ++#endif
131.2259 ++
131.2260 ++namespace std
131.2261 ++{
131.2262 ++  template<>
131.2263 ++    void
131.2264 ++    __timepunct<char>::
131.2265 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
131.2266 ++	   const tm* __tm) const
131.2267 ++    {
131.2268 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.2269 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
131.2270 ++					_M_c_locale_timepunct);
131.2271 ++#else
131.2272 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
131.2273 ++      setlocale(LC_ALL, _M_name_timepunct);
131.2274 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
131.2275 ++      setlocale(LC_ALL, __old);
131.2276 ++      free(__old);
131.2277 ++#endif
131.2278 ++      // Make sure __s is null terminated.
131.2279 ++      if (__len == 0)
131.2280 ++	__s[0] = '\0';
131.2281 ++    }
131.2282 ++
131.2283 ++  template<> 
131.2284 ++    void
131.2285 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
131.2286 ++    {
131.2287 ++      if (!_M_data)
131.2288 ++	_M_data = new __timepunct_cache<char>;
131.2289 ++
131.2290 ++      if (!__cloc)
131.2291 ++	{
131.2292 ++	  // "C" locale
131.2293 ++	  _M_c_locale_timepunct = _S_get_c_locale();
131.2294 ++
131.2295 ++	  _M_data->_M_date_format = "%m/%d/%y";
131.2296 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
131.2297 ++	  _M_data->_M_time_format = "%H:%M:%S";
131.2298 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
131.2299 ++	  _M_data->_M_date_time_format = "";
131.2300 ++	  _M_data->_M_date_time_era_format = "";
131.2301 ++	  _M_data->_M_am = "AM";
131.2302 ++	  _M_data->_M_pm = "PM";
131.2303 ++	  _M_data->_M_am_pm_format = "";
131.2304 ++
131.2305 ++	  // Day names, starting with "C"'s Sunday.
131.2306 ++	  _M_data->_M_day1 = "Sunday";
131.2307 ++	  _M_data->_M_day2 = "Monday";
131.2308 ++	  _M_data->_M_day3 = "Tuesday";
131.2309 ++	  _M_data->_M_day4 = "Wednesday";
131.2310 ++	  _M_data->_M_day5 = "Thursday";
131.2311 ++	  _M_data->_M_day6 = "Friday";
131.2312 ++	  _M_data->_M_day7 = "Saturday";
131.2313 ++
131.2314 ++	  // Abbreviated day names, starting with "C"'s Sun.
131.2315 ++	  _M_data->_M_aday1 = "Sun";
131.2316 ++	  _M_data->_M_aday2 = "Mon";
131.2317 ++	  _M_data->_M_aday3 = "Tue";
131.2318 ++	  _M_data->_M_aday4 = "Wed";
131.2319 ++	  _M_data->_M_aday5 = "Thu";
131.2320 ++	  _M_data->_M_aday6 = "Fri";
131.2321 ++	  _M_data->_M_aday7 = "Sat";
131.2322 ++
131.2323 ++	  // Month names, starting with "C"'s January.
131.2324 ++	  _M_data->_M_month01 = "January";
131.2325 ++	  _M_data->_M_month02 = "February";
131.2326 ++	  _M_data->_M_month03 = "March";
131.2327 ++	  _M_data->_M_month04 = "April";
131.2328 ++	  _M_data->_M_month05 = "May";
131.2329 ++	  _M_data->_M_month06 = "June";
131.2330 ++	  _M_data->_M_month07 = "July";
131.2331 ++	  _M_data->_M_month08 = "August";
131.2332 ++	  _M_data->_M_month09 = "September";
131.2333 ++	  _M_data->_M_month10 = "October";
131.2334 ++	  _M_data->_M_month11 = "November";
131.2335 ++	  _M_data->_M_month12 = "December";
131.2336 ++
131.2337 ++	  // Abbreviated month names, starting with "C"'s Jan.
131.2338 ++	  _M_data->_M_amonth01 = "Jan";
131.2339 ++	  _M_data->_M_amonth02 = "Feb";
131.2340 ++	  _M_data->_M_amonth03 = "Mar";
131.2341 ++	  _M_data->_M_amonth04 = "Apr";
131.2342 ++	  _M_data->_M_amonth05 = "May";
131.2343 ++	  _M_data->_M_amonth06 = "Jun";
131.2344 ++	  _M_data->_M_amonth07 = "Jul";
131.2345 ++	  _M_data->_M_amonth08 = "Aug";
131.2346 ++	  _M_data->_M_amonth09 = "Sep";
131.2347 ++	  _M_data->_M_amonth10 = "Oct";
131.2348 ++	  _M_data->_M_amonth11 = "Nov";
131.2349 ++	  _M_data->_M_amonth12 = "Dec";
131.2350 ++	}
131.2351 ++      else
131.2352 ++	{
131.2353 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
131.2354 ++
131.2355 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
131.2356 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
131.2357 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
131.2358 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
131.2359 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
131.2360 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
131.2361 ++							     __cloc);
131.2362 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
131.2363 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
131.2364 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
131.2365 ++
131.2366 ++	  // Day names, starting with "C"'s Sunday.
131.2367 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
131.2368 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
131.2369 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
131.2370 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
131.2371 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
131.2372 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
131.2373 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
131.2374 ++
131.2375 ++	  // Abbreviated day names, starting with "C"'s Sun.
131.2376 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
131.2377 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
131.2378 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
131.2379 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
131.2380 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
131.2381 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
131.2382 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
131.2383 ++
131.2384 ++	  // Month names, starting with "C"'s January.
131.2385 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
131.2386 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
131.2387 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
131.2388 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
131.2389 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
131.2390 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
131.2391 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
131.2392 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
131.2393 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
131.2394 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
131.2395 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
131.2396 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
131.2397 ++
131.2398 ++	  // Abbreviated month names, starting with "C"'s Jan.
131.2399 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
131.2400 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
131.2401 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
131.2402 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
131.2403 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
131.2404 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
131.2405 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
131.2406 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
131.2407 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
131.2408 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
131.2409 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
131.2410 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
131.2411 ++	}
131.2412 ++    }
131.2413 ++
131.2414 ++#ifdef _GLIBCXX_USE_WCHAR_T
131.2415 ++  template<>
131.2416 ++    void
131.2417 ++    __timepunct<wchar_t>::
131.2418 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
131.2419 ++	   const tm* __tm) const
131.2420 ++    {
131.2421 ++#ifdef __UCLIBC_HAS_XLOCALE__
131.2422 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
131.2423 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
131.2424 ++					_M_c_locale_timepunct);
131.2425 ++#else
131.2426 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
131.2427 ++      setlocale(LC_ALL, _M_name_timepunct);
131.2428 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
131.2429 ++      setlocale(LC_ALL, __old);
131.2430 ++      free(__old);
131.2431 ++#endif
131.2432 ++      // Make sure __s is null terminated.
131.2433 ++      if (__len == 0)
131.2434 ++	__s[0] = L'\0';
131.2435 ++    }
131.2436 ++
131.2437 ++  template<> 
131.2438 ++    void
131.2439 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
131.2440 ++    {
131.2441 ++      if (!_M_data)
131.2442 ++	_M_data = new __timepunct_cache<wchar_t>;
131.2443 ++
131.2444 ++#warning wide time stuff
131.2445 ++//       if (!__cloc)
131.2446 ++	{
131.2447 ++	  // "C" locale
131.2448 ++	  _M_c_locale_timepunct = _S_get_c_locale();
131.2449 ++
131.2450 ++	  _M_data->_M_date_format = L"%m/%d/%y";
131.2451 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
131.2452 ++	  _M_data->_M_time_format = L"%H:%M:%S";
131.2453 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
131.2454 ++	  _M_data->_M_date_time_format = L"";
131.2455 ++	  _M_data->_M_date_time_era_format = L"";
131.2456 ++	  _M_data->_M_am = L"AM";
131.2457 ++	  _M_data->_M_pm = L"PM";
131.2458 ++	  _M_data->_M_am_pm_format = L"";
131.2459 ++
131.2460 ++	  // Day names, starting with "C"'s Sunday.
131.2461 ++	  _M_data->_M_day1 = L"Sunday";
131.2462 ++	  _M_data->_M_day2 = L"Monday";
131.2463 ++	  _M_data->_M_day3 = L"Tuesday";
131.2464 ++	  _M_data->_M_day4 = L"Wednesday";
131.2465 ++	  _M_data->_M_day5 = L"Thursday";
131.2466 ++	  _M_data->_M_day6 = L"Friday";
131.2467 ++	  _M_data->_M_day7 = L"Saturday";
131.2468 ++
131.2469 ++	  // Abbreviated day names, starting with "C"'s Sun.
131.2470 ++	  _M_data->_M_aday1 = L"Sun";
131.2471 ++	  _M_data->_M_aday2 = L"Mon";
131.2472 ++	  _M_data->_M_aday3 = L"Tue";
131.2473 ++	  _M_data->_M_aday4 = L"Wed";
131.2474 ++	  _M_data->_M_aday5 = L"Thu";
131.2475 ++	  _M_data->_M_aday6 = L"Fri";
131.2476 ++	  _M_data->_M_aday7 = L"Sat";
131.2477 ++
131.2478 ++	  // Month names, starting with "C"'s January.
131.2479 ++	  _M_data->_M_month01 = L"January";
131.2480 ++	  _M_data->_M_month02 = L"February";
131.2481 ++	  _M_data->_M_month03 = L"March";
131.2482 ++	  _M_data->_M_month04 = L"April";
131.2483 ++	  _M_data->_M_month05 = L"May";
131.2484 ++	  _M_data->_M_month06 = L"June";
131.2485 ++	  _M_data->_M_month07 = L"July";
131.2486 ++	  _M_data->_M_month08 = L"August";
131.2487 ++	  _M_data->_M_month09 = L"September";
131.2488 ++	  _M_data->_M_month10 = L"October";
131.2489 ++	  _M_data->_M_month11 = L"November";
131.2490 ++	  _M_data->_M_month12 = L"December";
131.2491 ++
131.2492 ++	  // Abbreviated month names, starting with "C"'s Jan.
131.2493 ++	  _M_data->_M_amonth01 = L"Jan";
131.2494 ++	  _M_data->_M_amonth02 = L"Feb";
131.2495 ++	  _M_data->_M_amonth03 = L"Mar";
131.2496 ++	  _M_data->_M_amonth04 = L"Apr";
131.2497 ++	  _M_data->_M_amonth05 = L"May";
131.2498 ++	  _M_data->_M_amonth06 = L"Jun";
131.2499 ++	  _M_data->_M_amonth07 = L"Jul";
131.2500 ++	  _M_data->_M_amonth08 = L"Aug";
131.2501 ++	  _M_data->_M_amonth09 = L"Sep";
131.2502 ++	  _M_data->_M_amonth10 = L"Oct";
131.2503 ++	  _M_data->_M_amonth11 = L"Nov";
131.2504 ++	  _M_data->_M_amonth12 = L"Dec";
131.2505 ++	}
131.2506 ++#if 0
131.2507 ++      else
131.2508 ++	{
131.2509 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
131.2510 ++
131.2511 ++	  union { char *__s; wchar_t *__w; } __u;
131.2512 ++
131.2513 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
131.2514 ++	  _M_data->_M_date_format = __u.__w;
131.2515 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
131.2516 ++	  _M_data->_M_date_era_format = __u.__w;
131.2517 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
131.2518 ++	  _M_data->_M_time_format = __u.__w;
131.2519 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
131.2520 ++	  _M_data->_M_time_era_format = __u.__w;
131.2521 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
131.2522 ++	  _M_data->_M_date_time_format = __u.__w;
131.2523 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
131.2524 ++	  _M_data->_M_date_time_era_format = __u.__w;
131.2525 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
131.2526 ++	  _M_data->_M_am = __u.__w;
131.2527 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
131.2528 ++	  _M_data->_M_pm = __u.__w;
131.2529 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
131.2530 ++	  _M_data->_M_am_pm_format = __u.__w;
131.2531 ++
131.2532 ++	  // Day names, starting with "C"'s Sunday.
131.2533 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
131.2534 ++	  _M_data->_M_day1 = __u.__w;
131.2535 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
131.2536 ++	  _M_data->_M_day2 = __u.__w;
131.2537 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
131.2538 ++	  _M_data->_M_day3 = __u.__w;
131.2539 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
131.2540 ++	  _M_data->_M_day4 = __u.__w;
131.2541 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
131.2542 ++	  _M_data->_M_day5 = __u.__w;
131.2543 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
131.2544 ++	  _M_data->_M_day6 = __u.__w;
131.2545 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
131.2546 ++	  _M_data->_M_day7 = __u.__w;
131.2547 ++
131.2548 ++	  // Abbreviated day names, starting with "C"'s Sun.
131.2549 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
131.2550 ++	  _M_data->_M_aday1 = __u.__w;
131.2551 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
131.2552 ++	  _M_data->_M_aday2 = __u.__w;
131.2553 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
131.2554 ++	  _M_data->_M_aday3 = __u.__w;
131.2555 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
131.2556 ++	  _M_data->_M_aday4 = __u.__w;
131.2557 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
131.2558 ++	  _M_data->_M_aday5 = __u.__w;
131.2559 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
131.2560 ++	  _M_data->_M_aday6 = __u.__w;
131.2561 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
131.2562 ++	  _M_data->_M_aday7 = __u.__w;
131.2563 ++
131.2564 ++	  // Month names, starting with "C"'s January.
131.2565 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
131.2566 ++	  _M_data->_M_month01 = __u.__w;
131.2567 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
131.2568 ++	  _M_data->_M_month02 = __u.__w;
131.2569 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
131.2570 ++	  _M_data->_M_month03 = __u.__w;
131.2571 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
131.2572 ++	  _M_data->_M_month04 = __u.__w;
131.2573 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
131.2574 ++	  _M_data->_M_month05 = __u.__w;
131.2575 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
131.2576 ++	  _M_data->_M_month06 = __u.__w;
131.2577 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
131.2578 ++	  _M_data->_M_month07 = __u.__w;
131.2579 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
131.2580 ++	  _M_data->_M_month08 = __u.__w;
131.2581 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
131.2582 ++	  _M_data->_M_month09 = __u.__w;
131.2583 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
131.2584 ++	  _M_data->_M_month10 = __u.__w;
131.2585 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
131.2586 ++	  _M_data->_M_month11 = __u.__w;
131.2587 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
131.2588 ++	  _M_data->_M_month12 = __u.__w;
131.2589 ++
131.2590 ++	  // Abbreviated month names, starting with "C"'s Jan.
131.2591 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
131.2592 ++	  _M_data->_M_amonth01 = __u.__w;
131.2593 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
131.2594 ++	  _M_data->_M_amonth02 = __u.__w;
131.2595 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
131.2596 ++	  _M_data->_M_amonth03 = __u.__w;
131.2597 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
131.2598 ++	  _M_data->_M_amonth04 = __u.__w;
131.2599 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
131.2600 ++	  _M_data->_M_amonth05 = __u.__w;
131.2601 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
131.2602 ++	  _M_data->_M_amonth06 = __u.__w;
131.2603 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
131.2604 ++	  _M_data->_M_amonth07 = __u.__w;
131.2605 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
131.2606 ++	  _M_data->_M_amonth08 = __u.__w;
131.2607 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
131.2608 ++	  _M_data->_M_amonth09 = __u.__w;
131.2609 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
131.2610 ++	  _M_data->_M_amonth10 = __u.__w;
131.2611 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
131.2612 ++	  _M_data->_M_amonth11 = __u.__w;
131.2613 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
131.2614 ++	  _M_data->_M_amonth12 = __u.__w;
131.2615 ++	}
131.2616 ++#endif // 0
131.2617 ++    }
131.2618 ++#endif
131.2619 ++}
131.2620 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.h
131.2621 +--- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.h	1969-12-31 18:00:00.000000000 -0600
131.2622 ++++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.h	2004-05-22 18:46:31.000000000 -0500
131.2623 +@@ -0,0 +1,68 @@
131.2624 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
131.2625 ++
131.2626 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
131.2627 ++//
131.2628 ++// This file is part of the GNU ISO C++ Library.  This library is free
131.2629 ++// software; you can redistribute it and/or modify it under the
131.2630 ++// terms of the GNU General Public License as published by the
131.2631 ++// Free Software Foundation; either version 2, or (at your option)
131.2632 ++// any later version.
131.2633 ++
131.2634 ++// This library is distributed in the hope that it will be useful,
131.2635 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
131.2636 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131.2637 ++// GNU General Public License for more details.
131.2638 ++
131.2639 ++// You should have received a copy of the GNU General Public License along
131.2640 ++// with this library; see the file COPYING.  If not, write to the Free
131.2641 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
131.2642 ++// USA.
131.2643 ++
131.2644 ++// As a special exception, you may use this file as part of a free software
131.2645 ++// library without restriction.  Specifically, if other files instantiate
131.2646 ++// templates or use macros or inline functions from this file, or you compile
131.2647 ++// this file and link it with other files to produce an executable, this
131.2648 ++// file does not by itself cause the resulting executable to be covered by
131.2649 ++// the GNU General Public License.  This exception does not however
131.2650 ++// invalidate any other reasons why the executable file might be covered by
131.2651 ++// the GNU General Public License.
131.2652 ++
131.2653 ++//
131.2654 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
131.2655 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
131.2656 ++//
131.2657 ++
131.2658 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
131.2659 ++
131.2660 ++  template<typename _CharT>
131.2661 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
131.2662 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
131.2663 ++    _M_name_timepunct(_S_get_c_name())
131.2664 ++    { _M_initialize_timepunct(); }
131.2665 ++
131.2666 ++  template<typename _CharT>
131.2667 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
131.2668 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
131.2669 ++    _M_name_timepunct(_S_get_c_name())
131.2670 ++    { _M_initialize_timepunct(); }
131.2671 ++
131.2672 ++  template<typename _CharT>
131.2673 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
131.2674 ++				     size_t __refs) 
131.2675 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
131.2676 ++    _M_name_timepunct(__s)
131.2677 ++    { 
131.2678 ++      char* __tmp = new char[std::strlen(__s) + 1];
131.2679 ++      std::strcpy(__tmp, __s);
131.2680 ++      _M_name_timepunct = __tmp;
131.2681 ++      _M_initialize_timepunct(__cloc); 
131.2682 ++    }
131.2683 ++
131.2684 ++  template<typename _CharT>
131.2685 ++    __timepunct<_CharT>::~__timepunct()
131.2686 ++    { 
131.2687 ++      if (_M_name_timepunct != _S_get_c_name())
131.2688 ++	delete [] _M_name_timepunct;
131.2689 ++      delete _M_data; 
131.2690 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
131.2691 ++    }
131.2692 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_base.h
131.2693 +--- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_base.h	1969-12-31 18:00:00.000000000 -0600
131.2694 ++++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_base.h	2005-04-28 01:10:27.000000000 -0500
131.2695 +@@ -0,0 +1,64 @@
131.2696 ++// Locale support -*- C++ -*-
131.2697 ++
131.2698 ++// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
131.2699 ++// Free Software Foundation, Inc.
131.2700 ++//
131.2701 ++// This file is part of the GNU ISO C++ Library.  This library is free
131.2702 ++// software; you can redistribute it and/or modify it under the
131.2703 ++// terms of the GNU General Public License as published by the
131.2704 ++// Free Software Foundation; either version 2, or (at your option)
131.2705 ++// any later version.
131.2706 ++
131.2707 ++// This library is distributed in the hope that it will be useful,
131.2708 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
131.2709 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131.2710 ++// GNU General Public License for more details.
131.2711 ++
131.2712 ++// You should have received a copy of the GNU General Public License along
131.2713 ++// with this library; see the file COPYING.  If not, write to the Free
131.2714 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
131.2715 ++// USA.
131.2716 ++
131.2717 ++// As a special exception, you may use this file as part of a free software
131.2718 ++// library without restriction.  Specifically, if other files instantiate
131.2719 ++// templates or use macros or inline functions from this file, or you compile
131.2720 ++// this file and link it with other files to produce an executable, this
131.2721 ++// file does not by itself cause the resulting executable to be covered by
131.2722 ++// the GNU General Public License.  This exception does not however
131.2723 ++// invalidate any other reasons why the executable file might be covered by
131.2724 ++// the GNU General Public License.
131.2725 ++
131.2726 ++//
131.2727 ++// ISO C++ 14882: 22.1  Locales
131.2728 ++//
131.2729 ++  
131.2730 ++/** @file ctype_base.h
131.2731 ++ *  This is an internal header file, included by other library headers.
131.2732 ++ *  You should not attempt to use it directly.
131.2733 ++ */
131.2734 ++
131.2735 ++// Information as gleaned from /usr/include/ctype.h
131.2736 ++  
131.2737 ++  /// @brief  Base class for ctype.
131.2738 ++  struct ctype_base
131.2739 ++  {
131.2740 ++    // Note: In uClibc, the following two types depend on configuration.
131.2741 ++ 
131.2742 ++    // Non-standard typedefs.
131.2743 ++    typedef const __ctype_touplow_t* __to_type;
131.2744 ++
131.2745 ++    // NB: Offsets into ctype<char>::_M_table force a particular size
131.2746 ++    // on the mask type. Because of this, we don't use an enum.
131.2747 ++    typedef __ctype_mask_t	mask;   
131.2748 ++    static const mask upper    	= _ISupper;
131.2749 ++    static const mask lower 	= _ISlower;
131.2750 ++    static const mask alpha 	= _ISalpha;
131.2751 ++    static const mask digit 	= _ISdigit;
131.2752 ++    static const mask xdigit 	= _ISxdigit;
131.2753 ++    static const mask space 	= _ISspace;
131.2754 ++    static const mask print 	= _ISprint;
131.2755 ++    static const mask graph 	= _ISalpha | _ISdigit | _ISpunct;
131.2756 ++    static const mask cntrl 	= _IScntrl;
131.2757 ++    static const mask punct 	= _ISpunct;
131.2758 ++    static const mask alnum 	= _ISalpha | _ISdigit;
131.2759 ++  };
131.2760 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
131.2761 +--- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_inline.h	1969-12-31 18:00:00.000000000 -0600
131.2762 ++++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_inline.h	2002-06-24 00:49:19.000000000 -0500
131.2763 +@@ -0,0 +1,69 @@
131.2764 ++// Locale support -*- C++ -*-
131.2765 ++
131.2766 ++// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
131.2767 ++//
131.2768 ++// This file is part of the GNU ISO C++ Library.  This library is free
131.2769 ++// software; you can redistribute it and/or modify it under the
131.2770 ++// terms of the GNU General Public License as published by the
131.2771 ++// Free Software Foundation; either version 2, or (at your option)
131.2772 ++// any later version.
131.2773 ++
131.2774 ++// This library is distributed in the hope that it will be useful,
131.2775 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
131.2776 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131.2777 ++// GNU General Public License for more details.
131.2778 ++
131.2779 ++// You should have received a copy of the GNU General Public License along
131.2780 ++// with this library; see the file COPYING.  If not, write to the Free
131.2781 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
131.2782 ++// USA.
131.2783 ++
131.2784 ++// As a special exception, you may use this file as part of a free software
131.2785 ++// library without restriction.  Specifically, if other files instantiate
131.2786 ++// templates or use macros or inline functions from this file, or you compile
131.2787 ++// this file and link it with other files to produce an executable, this
131.2788 ++// file does not by itself cause the resulting executable to be covered by
131.2789 ++// the GNU General Public License.  This exception does not however
131.2790 ++// invalidate any other reasons why the executable file might be covered by
131.2791 ++// the GNU General Public License.
131.2792 ++
131.2793 ++//
131.2794 ++// ISO C++ 14882: 22.1  Locales
131.2795 ++//
131.2796 ++  
131.2797 ++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
131.2798 ++// functions go in ctype.cc
131.2799 ++  
131.2800 ++  bool
131.2801 ++  ctype<char>::
131.2802 ++  is(mask __m, char __c) const
131.2803 ++  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
131.2804 ++
131.2805 ++  const char*
131.2806 ++  ctype<char>::
131.2807 ++  is(const char* __low, const char* __high, mask* __vec) const
131.2808 ++  {
131.2809 ++    while (__low < __high)
131.2810 ++      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
131.2811 ++    return __high;
131.2812 ++  }
131.2813 ++
131.2814 ++  const char*
131.2815 ++  ctype<char>::
131.2816 ++  scan_is(mask __m, const char* __low, const char* __high) const
131.2817 ++  {
131.2818 ++    while (__low < __high 
131.2819 ++	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
131.2820 ++      ++__low;
131.2821 ++    return __low;
131.2822 ++  }
131.2823 ++
131.2824 ++  const char*
131.2825 ++  ctype<char>::
131.2826 ++  scan_not(mask __m, const char* __low, const char* __high) const
131.2827 ++  {
131.2828 ++    while (__low < __high 
131.2829 ++	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
131.2830 ++      ++__low;
131.2831 ++    return __low;
131.2832 ++  }
131.2833 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
131.2834 +--- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_noninline.h	1969-12-31 18:00:00.000000000 -0600
131.2835 ++++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h	2005-04-28 01:10:27.000000000 -0500
131.2836 +@@ -0,0 +1,92 @@
131.2837 ++// Locale support -*- C++ -*-
131.2838 ++
131.2839 ++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
131.2840 ++// Free Software Foundation, Inc.
131.2841 ++//
131.2842 ++// This file is part of the GNU ISO C++ Library.  This library is free
131.2843 ++// software; you can redistribute it and/or modify it under the
131.2844 ++// terms of the GNU General Public License as published by the
131.2845 ++// Free Software Foundation; either version 2, or (at your option)
131.2846 ++// any later version.
131.2847 ++
131.2848 ++// This library is distributed in the hope that it will be useful,
131.2849 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
131.2850 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131.2851 ++// GNU General Public License for more details.
131.2852 ++
131.2853 ++// You should have received a copy of the GNU General Public License along
131.2854 ++// with this library; see the file COPYING.  If not, write to the Free
131.2855 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
131.2856 ++// USA.
131.2857 ++
131.2858 ++// As a special exception, you may use this file as part of a free software
131.2859 ++// library without restriction.  Specifically, if other files instantiate
131.2860 ++// templates or use macros or inline functions from this file, or you compile
131.2861 ++// this file and link it with other files to produce an executable, this
131.2862 ++// file does not by itself cause the resulting executable to be covered by
131.2863 ++// the GNU General Public License.  This exception does not however
131.2864 ++// invalidate any other reasons why the executable file might be covered by
131.2865 ++// the GNU General Public License.
131.2866 ++
131.2867 ++//
131.2868 ++// ISO C++ 14882: 22.1  Locales
131.2869 ++//
131.2870 ++  
131.2871 ++// Information as gleaned from /usr/include/ctype.h
131.2872 ++
131.2873 ++  const ctype_base::mask*
131.2874 ++  ctype<char>::classic_table() throw()
131.2875 ++  { return __C_ctype_b; }
131.2876 ++
131.2877 ++  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
131.2878 ++		     size_t __refs) 
131.2879 ++  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
131.2880 ++  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
131.2881 ++  {
131.2882 ++    _M_toupper = __C_ctype_toupper;
131.2883 ++    _M_tolower = __C_ctype_tolower;
131.2884 ++    _M_table = __table ? __table : __C_ctype_b;
131.2885 ++    memset(_M_widen, 0, sizeof(_M_widen));
131.2886 ++    memset(_M_narrow, 0, sizeof(_M_narrow));
131.2887 ++  }
131.2888 ++
131.2889 ++  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
131.2890 ++  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
131.2891 ++  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
131.2892 ++  {
131.2893 ++    _M_toupper = __C_ctype_toupper;
131.2894 ++    _M_tolower = __C_ctype_tolower;
131.2895 ++    _M_table = __table ? __table : __C_ctype_b;
131.2896 ++    memset(_M_widen, 0, sizeof(_M_widen));
131.2897 ++    memset(_M_narrow, 0, sizeof(_M_narrow));
131.2898 ++  }
131.2899 ++
131.2900 ++  char
131.2901 ++  ctype<char>::do_toupper(char __c) const
131.2902 ++  { return _M_toupper[static_cast<unsigned char>(__c)]; }
131.2903 ++
131.2904 ++  const char*
131.2905 ++  ctype<char>::do_toupper(char* __low, const char* __high) const
131.2906 ++  {
131.2907 ++    while (__low < __high)
131.2908 ++      {
131.2909 ++	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
131.2910 ++	++__low;
131.2911 ++      }
131.2912 ++    return __high;
131.2913 ++  }
131.2914 ++
131.2915 ++  char
131.2916 ++  ctype<char>::do_tolower(char __c) const
131.2917 ++  { return _M_tolower[static_cast<unsigned char>(__c)]; }
131.2918 ++
131.2919 ++  const char* 
131.2920 ++  ctype<char>::do_tolower(char* __low, const char* __high) const
131.2921 ++  {
131.2922 ++    while (__low < __high)
131.2923 ++      {
131.2924 ++	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
131.2925 ++	++__low;
131.2926 ++      }
131.2927 ++    return __high;
131.2928 ++  }
131.2929 +diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/os_defines.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/os_defines.h
131.2930 +--- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/os_defines.h	1969-12-31 18:00:00.000000000 -0600
131.2931 ++++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/os_defines.h	2005-04-28 01:10:27.000000000 -0500
131.2932 +@@ -0,0 +1,44 @@
131.2933 ++// Specific definitions for GNU/Linux  -*- C++ -*-
131.2934 ++
131.2935 ++// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
131.2936 ++//
131.2937 ++// This file is part of the GNU ISO C++ Library.  This library is free
131.2938 ++// software; you can redistribute it and/or modify it under the
131.2939 ++// terms of the GNU General Public License as published by the
131.2940 ++// Free Software Foundation; either version 2, or (at your option)
131.2941 ++// any later version.
131.2942 ++
131.2943 ++// This library is distributed in the hope that it will be useful,
131.2944 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
131.2945 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131.2946 ++// GNU General Public License for more details.
131.2947 ++
131.2948 ++// You should have received a copy of the GNU General Public License along
131.2949 ++// with this library; see the file COPYING.  If not, write to the Free
131.2950 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
131.2951 ++// USA.
131.2952 ++
131.2953 ++// As a special exception, you may use this file as part of a free software
131.2954 ++// library without restriction.  Specifically, if other files instantiate
131.2955 ++// templates or use macros or inline functions from this file, or you compile
131.2956 ++// this file and link it with other files to produce an executable, this
131.2957 ++// file does not by itself cause the resulting executable to be covered by
131.2958 ++// the GNU General Public License.  This exception does not however
131.2959 ++// invalidate any other reasons why the executable file might be covered by
131.2960 ++// the GNU General Public License.
131.2961 ++
131.2962 ++#ifndef _GLIBCXX_OS_DEFINES
131.2963 ++#define _GLIBCXX_OS_DEFINES 1
131.2964 ++
131.2965 ++// System-specific #define, typedefs, corrections, etc, go here.  This
131.2966 ++// file will come before all others.
131.2967 ++
131.2968 ++// This keeps isanum, et al from being propagated as macros.
131.2969 ++#define __NO_CTYPE 1
131.2970 ++
131.2971 ++#include <features.h>
131.2972 ++
131.2973 ++// We must not see the optimized string functions GNU libc defines.
131.2974 ++#define __NO_STRING_INLINES
131.2975 ++
131.2976 ++#endif
131.2977 +diff -urN gcc-4.0.0-100/libstdc++-v3/configure gcc-4.0.0/libstdc++-v3/configure
131.2978 +--- gcc-4.0.0-100/libstdc++-v3/configure	2005-04-30 13:06:53.683055232 -0500
131.2979 ++++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 12:24:24.000000000 -0500
131.2980 +@@ -3998,6 +3998,11 @@
131.2981 +   lt_cv_deplibs_check_method=pass_all
131.2982 +   ;;
131.2983 + 
131.2984 ++linux-uclibc*)
131.2985 ++  lt_cv_deplibs_check_method=pass_all
131.2986 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
131.2987 ++  ;;
131.2988 ++
131.2989 + netbsd* | knetbsd*-gnu)
131.2990 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
131.2991 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
131.2992 +@@ -5672,7 +5677,7 @@
131.2993 +   enableval="$enable_clocale"
131.2994 + 
131.2995 +       case "$enableval" in
131.2996 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
131.2997 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
131.2998 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
131.2999 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
131.3000 +    { (exit 1); exit 1; }; } ;;
131.3001 +@@ -5697,6 +5702,9 @@
131.3002 +   # Default to "generic".
131.3003 +   if test $enable_clocale_flag = auto; then
131.3004 +     case ${target_os} in
131.3005 ++      linux-uclibc*)
131.3006 ++	enable_clocale_flag=uclibc
131.3007 ++	;;
131.3008 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
131.3009 +         cat >conftest.$ac_ext <<_ACEOF
131.3010 + /* confdefs.h.  */
131.3011 +@@ -5927,6 +5935,76 @@
131.3012 +       CTIME_CC=config/locale/generic/time_members.cc
131.3013 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
131.3014 +       ;;
131.3015 ++    uclibc)
131.3016 ++      echo "$as_me:$LINENO: result: uclibc" >&5
131.3017 ++echo "${ECHO_T}uclibc" >&6
131.3018 ++
131.3019 ++      # Declare intention to use gettext, and add support for specific
131.3020 ++      # languages.
131.3021 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
131.3022 ++      ALL_LINGUAS="de fr"
131.3023 ++
131.3024 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
131.3025 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
131.3026 ++set dummy msgfmt; ac_word=$2
131.3027 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
131.3028 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
131.3029 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
131.3030 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
131.3031 ++else
131.3032 ++  if test -n "$check_msgfmt"; then
131.3033 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
131.3034 ++else
131.3035 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
131.3036 ++for as_dir in $PATH
131.3037 ++do
131.3038 ++  IFS=$as_save_IFS
131.3039 ++  test -z "$as_dir" && as_dir=.
131.3040 ++  for ac_exec_ext in '' $ac_executable_extensions; do
131.3041 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
131.3042 ++    ac_cv_prog_check_msgfmt="yes"
131.3043 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
131.3044 ++    break 2
131.3045 ++  fi
131.3046 ++done
131.3047 ++done
131.3048 ++
131.3049 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
131.3050 ++fi
131.3051 ++fi
131.3052 ++check_msgfmt=$ac_cv_prog_check_msgfmt
131.3053 ++if test -n "$check_msgfmt"; then
131.3054 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
131.3055 ++echo "${ECHO_T}$check_msgfmt" >&6
131.3056 ++else
131.3057 ++  echo "$as_me:$LINENO: result: no" >&5
131.3058 ++echo "${ECHO_T}no" >&6
131.3059 ++fi
131.3060 ++
131.3061 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
131.3062 ++        USE_NLS=yes
131.3063 ++      fi
131.3064 ++      # Export the build objects.
131.3065 ++      for ling in $ALL_LINGUAS; do \
131.3066 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
131.3067 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
131.3068 ++      done
131.3069 ++
131.3070 ++
131.3071 ++
131.3072 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
131.3073 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
131.3074 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
131.3075 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
131.3076 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
131.3077 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
131.3078 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
131.3079 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
131.3080 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
131.3081 ++      CTIME_H=config/locale/uclibc/time_members.h
131.3082 ++      CTIME_CC=config/locale/uclibc/time_members.cc
131.3083 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
131.3084 ++      ;;
131.3085 +   esac
131.3086 + 
131.3087 +   # This is where the testsuite looks for locale catalogs, using the
131.3088 +diff -urN gcc-4.0.0-100/libstdc++-v3/configure.host gcc-4.0.0/libstdc++-v3/configure.host
131.3089 +--- gcc-4.0.0-100/libstdc++-v3/configure.host	2005-04-30 13:06:53.688054472 -0500
131.3090 ++++ gcc-4.0.0/libstdc++-v3/configure.host	2005-04-28 20:20:32.000000000 -0500
131.3091 +@@ -249,6 +249,12 @@
131.3092 +     ;;
131.3093 + esac
131.3094 + 
131.3095 ++# Override for uClibc since linux-uclibc gets mishandled above.
131.3096 ++case "${host_os}" in
131.3097 ++  *-uclibc*)
131.3098 ++    os_include_dir="os/uclibc"
131.3099 ++    ;;
131.3100 ++esac
131.3101 + 
131.3102 + # Set any OS-dependent and CPU-dependent bits.
131.3103 + # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
131.3104 +diff -urN gcc-4.0.0-100/libstdc++-v3/crossconfig.m4 gcc-4.0.0/libstdc++-v3/crossconfig.m4
131.3105 +--- gcc-4.0.0-100/libstdc++-v3/crossconfig.m4	2005-04-30 13:06:53.689054320 -0500
131.3106 ++++ gcc-4.0.0/libstdc++-v3/crossconfig.m4	2005-04-28 20:27:15.000000000 -0500
131.3107 +@@ -142,6 +142,98 @@
131.3108 + 	;;
131.3109 +     esac
131.3110 +     ;;
131.3111 ++  *-uclibc*)
131.3112 ++# Temporary hack until we implement the float versions of the libm funcs
131.3113 ++    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
131.3114 ++      machine/endian.h machine/param.h sys/machine.h sys/types.h \
131.3115 ++      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
131.3116 ++    SECTION_FLAGS='-ffunction-sections -fdata-sections'
131.3117 ++    AC_SUBST(SECTION_FLAGS)
131.3118 ++    GLIBCXX_CHECK_LINKER_FEATURES
131.3119 ++    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
131.3120 ++    GLIBCXX_CHECK_WCHAR_T_SUPPORT
131.3121 ++
131.3122 ++    # For LFS.
131.3123 ++    AC_DEFINE(HAVE_INT64_T)
131.3124 ++    case "$target" in
131.3125 ++      *-uclinux*)
131.3126 ++        # Don't enable LFS with uClinux
131.3127 ++        ;;
131.3128 ++      *)
131.3129 ++        AC_DEFINE(_GLIBCXX_USE_LFS)
131.3130 ++    esac
131.3131 ++
131.3132 ++    # For showmanyc_helper().
131.3133 ++    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
131.3134 ++    GLIBCXX_CHECK_POLL
131.3135 ++    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
131.3136 ++
131.3137 ++    # For xsputn_2().
131.3138 ++    AC_CHECK_HEADERS(sys/uio.h)
131.3139 ++    GLIBCXX_CHECK_WRITEV
131.3140 ++
131.3141 ++#     AC_DEFINE(HAVE_ACOSF)
131.3142 ++#     AC_DEFINE(HAVE_ASINF)
131.3143 ++#     AC_DEFINE(HAVE_ATANF)
131.3144 ++#     AC_DEFINE(HAVE_ATAN2F)
131.3145 ++    AC_DEFINE(HAVE_CEILF)
131.3146 ++    AC_DEFINE(HAVE_COPYSIGN)
131.3147 ++#     AC_DEFINE(HAVE_COPYSIGNF)
131.3148 ++#     AC_DEFINE(HAVE_COSF)
131.3149 ++#     AC_DEFINE(HAVE_COSHF)
131.3150 ++#     AC_DEFINE(HAVE_EXPF)
131.3151 ++#     AC_DEFINE(HAVE_FABSF)
131.3152 ++    AC_DEFINE(HAVE_FINITE)
131.3153 ++    AC_DEFINE(HAVE_FINITEF)
131.3154 ++    AC_DEFINE(HAVE_FLOORF)
131.3155 ++#     AC_DEFINE(HAVE_FMODF)
131.3156 ++#     AC_DEFINE(HAVE_FREXPF)
131.3157 ++    AC_DEFINE(HAVE_HYPOT)
131.3158 ++#     AC_DEFINE(HAVE_HYPOTF)
131.3159 ++    AC_DEFINE(HAVE_ISINF)
131.3160 ++    AC_DEFINE(HAVE_ISINFF)
131.3161 ++    AC_DEFINE(HAVE_ISNAN)
131.3162 ++    AC_DEFINE(HAVE_ISNANF)
131.3163 ++#     AC_DEFINE(HAVE_LOGF)
131.3164 ++#     AC_DEFINE(HAVE_LOG10F)
131.3165 ++#     AC_DEFINE(HAVE_MODFF)
131.3166 ++#     AC_DEFINE(HAVE_SINF)
131.3167 ++#     AC_DEFINE(HAVE_SINHF)
131.3168 ++#     AC_DEFINE(HAVE_SINCOS)
131.3169 ++#     AC_DEFINE(HAVE_SINCOSF)
131.3170 ++    AC_DEFINE(HAVE_SQRTF)
131.3171 ++#     AC_DEFINE(HAVE_TANF)
131.3172 ++#     AC_DEFINE(HAVE_TANHF)
131.3173 ++    if test x"long_double_math_on_this_cpu" = x"yes"; then
131.3174 ++#       AC_DEFINE(HAVE_ACOSL)
131.3175 ++#       AC_DEFINE(HAVE_ASINL)
131.3176 ++#       AC_DEFINE(HAVE_ATANL)
131.3177 ++#       AC_DEFINE(HAVE_ATAN2L)
131.3178 ++#       AC_DEFINE(HAVE_CEILL)
131.3179 ++#       AC_DEFINE(HAVE_COPYSIGNL)
131.3180 ++#       AC_DEFINE(HAVE_COSL)
131.3181 ++#       AC_DEFINE(HAVE_COSHL)
131.3182 ++#       AC_DEFINE(HAVE_EXPL)
131.3183 ++#       AC_DEFINE(HAVE_FABSL)
131.3184 ++#       AC_DEFINE(HAVE_FINITEL)
131.3185 ++#       AC_DEFINE(HAVE_FLOORL)
131.3186 ++#       AC_DEFINE(HAVE_FMODL)
131.3187 ++#       AC_DEFINE(HAVE_FREXPL)
131.3188 ++#       AC_DEFINE(HAVE_HYPOTL)
131.3189 ++#       AC_DEFINE(HAVE_ISINFL)
131.3190 ++#       AC_DEFINE(HAVE_ISNANL)
131.3191 ++#       AC_DEFINE(HAVE_LOGL)
131.3192 ++#       AC_DEFINE(HAVE_LOG10L)
131.3193 ++#       AC_DEFINE(HAVE_MODFL)
131.3194 ++#       AC_DEFINE(HAVE_POWL)
131.3195 ++#       AC_DEFINE(HAVE_SINL)
131.3196 ++#       AC_DEFINE(HAVE_SINHL)
131.3197 ++#       AC_DEFINE(HAVE_SINCOSL)
131.3198 ++#       AC_DEFINE(HAVE_SQRTL)
131.3199 ++#       AC_DEFINE(HAVE_TANL)
131.3200 ++#       AC_DEFINE(HAVE_TANHL)
131.3201 ++    fi
131.3202 ++    ;;
131.3203 +   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
131.3204 +     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
131.3205 +       machine/endian.h machine/param.h sys/machine.h sys/types.h \
131.3206 +@@ -156,7 +248,7 @@
131.3207 +     AC_DEFINE(HAVE_INT64_T)
131.3208 +     case "$target" in
131.3209 +       *-uclinux*)
131.3210 +-        # Don't enable LFS with uClibc
131.3211 ++        # Don't enable LFS with uClinux
131.3212 +         ;;
131.3213 +       *)
131.3214 +         AC_DEFINE(_GLIBCXX_USE_LFS)
131.3215 +diff -urN gcc-4.0.0-100/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.0.0/libstdc++-v3/include/c_compatibility/wchar.h
131.3216 +--- gcc-4.0.0-100/libstdc++-v3/include/c_compatibility/wchar.h	2005-04-30 13:06:53.690054168 -0500
131.3217 ++++ gcc-4.0.0/libstdc++-v3/include/c_compatibility/wchar.h	2005-04-28 20:15:56.000000000 -0500
131.3218 +@@ -101,7 +101,9 @@
131.3219 + using std::wmemcpy;
131.3220 + using std::wmemmove;
131.3221 + using std::wmemset;
131.3222 ++#if _GLIBCXX_HAVE_WCSFTIME
131.3223 + using std::wcsftime;
131.3224 ++#endif
131.3225 + 
131.3226 + #if _GLIBCXX_USE_C99
131.3227 + using std::wcstold;
131.3228 +diff -urN gcc-4.0.0-100/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.0.0/libstdc++-v3/include/c_std/std_cwchar.h
131.3229 +--- gcc-4.0.0-100/libstdc++-v3/include/c_std/std_cwchar.h	2005-04-30 13:06:53.691054016 -0500
131.3230 ++++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cwchar.h	2005-04-28 20:15:56.000000000 -0500
131.3231 +@@ -179,7 +179,9 @@
131.3232 +   using ::wcscoll;
131.3233 +   using ::wcscpy;
131.3234 +   using ::wcscspn;
131.3235 ++#if _GLIBCXX_HAVE_WCSFTIME
131.3236 +   using ::wcsftime;
131.3237 ++#endif
131.3238 +   using ::wcslen;
131.3239 +   using ::wcsncat;
131.3240 +   using ::wcsncmp;
   132.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   132.2 +++ b/patches/gcc/4.0.4/120-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   132.3 @@ -0,0 +1,45 @@
   132.4 +--- gcc-4.0.0/libstdc++-v3/src/Makefile.am
   132.5 ++++ gcc-4.0.0/libstdc++-v3/src/Makefile.am
   132.6 +@@ -214,6 +214,10 @@
   132.7 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
   132.8 + 
   132.9 + 
  132.10 ++install-exec-local:
  132.11 ++	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  132.12 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  132.13 ++
  132.14 + # Added bits to build debug library.
  132.15 + if GLIBCXX_BUILD_DEBUG
  132.16 + all-local: build_debug
  132.17 +--- gcc-4.0.0/libstdc++-v3/src/Makefile.in
  132.18 ++++ gcc-4.0.0/libstdc++-v3/src/Makefile.in
  132.19 +@@ -625,7 +625,7 @@
  132.20 + 
  132.21 + install-data-am: install-data-local
  132.22 + 
  132.23 +-install-exec-am: install-toolexeclibLTLIBRARIES
  132.24 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  132.25 + 
  132.26 + install-info: install-info-am
  132.27 + 
  132.28 +@@ -664,7 +664,7 @@
  132.29 + 	maintainer-clean-generic mostlyclean mostlyclean-compile \
  132.30 + 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  132.31 + 	tags uninstall uninstall-am uninstall-info-am \
  132.32 +-	uninstall-toolexeclibLTLIBRARIES
  132.33 ++	uninstall-toolexeclibLTLIBRARIES install-exec-local
  132.34 + 
  132.35 + @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@libstdc++-symbol.ver:  ${glibcxx_srcdir}/$(SYMVER_MAP)
  132.36 + @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@	cp ${glibcxx_srcdir}/$(SYMVER_MAP) ./libstdc++-symbol.ver
  132.37 +@@ -743,6 +743,11 @@
  132.38 + install_debug:
  132.39 + 	(cd ${debugdir} && $(MAKE) \
  132.40 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  132.41 ++
  132.42 ++install-exec-local:
  132.43 ++	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  132.44 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  132.45 ++
  132.46 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  132.47 + # Otherwise a system limit (for SysV at least) may be exceeded.
  132.48 + .NOEXPORT:
   133.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   133.2 +++ b/patches/gcc/4.0.4/130-missing-execinfo_h.patch	Mon Jul 28 21:32:33 2008 +0000
   133.3 @@ -0,0 +1,11 @@
   133.4 +--- gcc-4.0.0/boehm-gc/include/gc.h-orig	2005-04-28 22:28:57.000000000 -0500
   133.5 ++++ gcc-4.0.0/boehm-gc/include/gc.h	2005-04-28 22:30:38.000000000 -0500
   133.6 +@@ -500,7 +500,7 @@
   133.7 + #ifdef __linux__
   133.8 + # include <features.h>
   133.9 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  133.10 +-     && !defined(__ia64__)
  133.11 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  133.12 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  133.13 + #     define GC_HAVE_BUILTIN_BACKTRACE
  133.14 + #   endif
   134.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   134.2 +++ b/patches/gcc/4.0.4/140-c99-snprintf.patch	Mon Jul 28 21:32:33 2008 +0000
   134.3 @@ -0,0 +1,11 @@
   134.4 +--- gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h-orig	2005-04-29 00:08:41.000000000 -0500
   134.5 ++++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h	2005-04-29 00:08:45.000000000 -0500
   134.6 +@@ -142,7 +142,7 @@
   134.7 +   using ::vsprintf;
   134.8 + }
   134.9 + 
  134.10 +-#if _GLIBCXX_USE_C99
  134.11 ++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  134.12 + 
  134.13 + #undef snprintf
  134.14 + #undef vfscanf
   135.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   135.2 +++ b/patches/gcc/4.0.4/150-c99-complex-ugly-hack.patch	Mon Jul 28 21:32:33 2008 +0000
   135.3 @@ -0,0 +1,12 @@
   135.4 +--- gcc-4.0.0/libstdc++-v3/configure-old	2005-04-30 22:04:48.061603912 -0500
   135.5 ++++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 22:06:13.678588152 -0500
   135.6 +@@ -7194,6 +7194,9 @@
   135.7 + cat >>conftest.$ac_ext <<_ACEOF
   135.8 + /* end confdefs.h.  */
   135.9 + #include <complex.h>
  135.10 ++#ifdef __UCLIBC__
  135.11 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  135.12 ++#endif
  135.13 + int
  135.14 + main ()
  135.15 + {
   136.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   136.2 +++ b/patches/gcc/4.0.4/160-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
   136.3 @@ -0,0 +1,24 @@
   136.4 +--- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps	2006-03-24 01:49:51 +0100
   136.5 ++++ gcc-4.1.0/libstdc++-v3/include/ext/rope	2006-03-24 01:49:37 +0100
   136.6 +@@ -59,6 +59,9 @@
   136.7 + #include <bits/allocator.h>
   136.8 + #include <ext/hash_fun.h>
   136.9 + 
  136.10 ++/* cope w/ index defined as macro, SuSv3 proposal */
  136.11 ++#undef index
  136.12 ++
  136.13 + # ifdef __GC
  136.14 + #   define __GC_CONST const
  136.15 + # else
  136.16 +--- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps	2006-03-24 01:50:04 +0100
  136.17 ++++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h	2006-03-24 01:50:28 +0100
  136.18 +@@ -53,6 +53,9 @@
  136.19 + #include <ext/memory> // For uninitialized_copy_n
  136.20 + #include <ext/numeric> // For power
  136.21 + 
  136.22 ++/* cope w/ index defined as macro, SuSv3 proposal */
  136.23 ++#undef index
  136.24 ++
  136.25 + namespace __gnu_cxx
  136.26 + {
  136.27 +   using std::size_t;
   137.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   137.2 +++ b/patches/gcc/4.0.4/170-libmudflap-susv3-legacy.patch	Mon Jul 28 21:32:33 2008 +0000
   137.3 @@ -0,0 +1,49 @@
   137.4 +Index: gcc-4.2/libmudflap/mf-hooks2.c
   137.5 +===================================================================
   137.6 +--- gcc-4.2/libmudflap/mf-hooks2.c	(revision 119834)
   137.7 ++++ gcc-4.2/libmudflap/mf-hooks2.c	(working copy)
   137.8 +@@ -427,7 +427,7 @@
   137.9 + {
  137.10 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  137.11 +   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  137.12 +-  bzero (s, n);
  137.13 ++  memset (s, 0, n);
  137.14 + }
  137.15 + 
  137.16 + 
  137.17 +@@ -437,7 +437,7 @@
  137.18 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  137.19 +   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  137.20 +   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  137.21 +-  bcopy (src, dest, n);
  137.22 ++  memmove (dest, src, n);
  137.23 + }
  137.24 + 
  137.25 + 
  137.26 +@@ -447,7 +447,7 @@
  137.27 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  137.28 +   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  137.29 +   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  137.30 +-  return bcmp (s1, s2, n);
  137.31 ++  return n == 0 ? 0 : memcmp (s1, s2, n);
  137.32 + }
  137.33 + 
  137.34 + 
  137.35 +@@ -456,7 +456,7 @@
  137.36 +   size_t n = strlen (s);
  137.37 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  137.38 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  137.39 +-  return index (s, c);
  137.40 ++  return strchr (s, c);
  137.41 + }
  137.42 + 
  137.43 + 
  137.44 +@@ -465,7 +465,7 @@
  137.45 +   size_t n = strlen (s);
  137.46 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  137.47 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  137.48 +-  return rindex (s, c);
  137.49 ++  return strrchr (s, c);
  137.50 + }
  137.51 + 
  137.52 + /* XXX:  stpcpy, memccpy */
   138.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   138.2 +++ b/patches/gcc/4.0.4/180-sdk-libstdc++-includes.patch	Mon Jul 28 21:32:33 2008 +0000
   138.3 @@ -0,0 +1,22 @@
   138.4 +diff -urN gcc-4.0.0-100/libstdc++-v3/fragment.am gcc-4.0.0/libstdc++-v3/fragment.am
   138.5 +--- gcc-4.0.0-100/libstdc++-v3/fragment.am	2004-10-25 15:32:40.000000000 -0500
   138.6 ++++ gcc-4.0.0/libstdc++-v3/fragment.am	2005-04-28 21:48:43.000000000 -0500
   138.7 +@@ -18,5 +18,5 @@
   138.8 + 	$(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
   138.9 + 
  138.10 + # -I/-D flags to pass when compiling.
  138.11 +-AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
  138.12 ++AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
  138.13 + 
  138.14 +diff -urN gcc-4.0.0-100/libstdc++-v3/libmath/Makefile.am gcc-4.0.0/libstdc++-v3/libmath/Makefile.am
  138.15 +--- gcc-4.0.0-100/libstdc++-v3/libmath/Makefile.am	2003-08-27 16:29:42.000000000 -0500
  138.16 ++++ gcc-4.0.0/libstdc++-v3/libmath/Makefile.am	2005-04-28 21:48:43.000000000 -0500
  138.17 +@@ -32,7 +32,7 @@
  138.18 + 
  138.19 + libmath_la_SOURCES = stubs.c
  138.20 + 
  138.21 +-AM_CPPFLAGS = $(CANADIAN_INCLUDES)
  138.22 ++AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
  138.23 + 
  138.24 + # Only compiling "C" sources in this directory.
  138.25 + LIBTOOL = @LIBTOOL@ --tag CC
   139.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   139.2 +++ b/patches/gcc/4.0.4/190-arm-bigendian.patch	Mon Jul 28 21:32:33 2008 +0000
   139.3 @@ -0,0 +1,65 @@
   139.4 +diff -dur gcc-4.0.4.orig/gcc/config/arm/linux-elf.h gcc-4.0.4/gcc/config/arm/linux-elf.h
   139.5 +--- gcc-4.0.4.orig/gcc/config/arm/linux-elf.h	2007-02-02 19:24:50.000000000 +0100
   139.6 ++++ gcc-4.0.4/gcc/config/arm/linux-elf.h	2007-02-02 19:26:12.000000000 +0100
   139.7 +@@ -31,19 +31,33 @@
   139.8 + /* Do not assume anything about header files.  */
   139.9 + #define NO_IMPLICIT_EXTERN_C
  139.10 + 
  139.11 ++/*
  139.12 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  139.13 ++ * (big endian) configurations.
  139.14 ++ */
  139.15 ++#if TARGET_BIG_ENDIAN_DEFAULT
  139.16 ++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
  139.17 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
  139.18 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
  139.19 ++#else
  139.20 ++#define TARGET_ENDIAN_DEFAULT 0
  139.21 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
  139.22 ++#define TARGET_LINKER_EMULATION "armelf_linux"
  139.23 ++#endif
  139.24 ++
  139.25 + #undef  TARGET_DEFAULT_FLOAT_ABI
  139.26 + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  139.27 + 
  139.28 + #undef  TARGET_DEFAULT
  139.29 +-#define TARGET_DEFAULT (0)
  139.30 ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  139.31 + 
  139.32 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  139.33 + 
  139.34 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  139.35 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  139.36 + 
  139.37 + #undef  MULTILIB_DEFAULTS
  139.38 + #define MULTILIB_DEFAULTS \
  139.39 +-	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  139.40 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  139.41 + 
  139.42 + /* The GNU C++ standard library requires that these macros be defined.  */
  139.43 + #undef CPLUSPLUS_CPP_SPEC
  139.44 +@@ -95,7 +109,7 @@
  139.45 +    %{rdynamic:-export-dynamic} \
  139.46 +    %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "} \
  139.47 +    -X \
  139.48 +-   %{mbig-endian:-EB}" \
  139.49 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  139.50 +    SUBTARGET_EXTRA_LINK_SPEC
  139.51 + 
  139.52 + #define TARGET_OS_CPP_BUILTINS()		\
  139.53 +Only in gcc-4.0.4/gcc/config/arm: linux-elf.h.orig
  139.54 +diff -dur gcc-4.0.4.orig/gcc/config.gcc gcc-4.0.4/gcc/config.gcc
  139.55 +--- gcc-4.0.4.orig/gcc/config.gcc	2007-02-02 19:24:50.000000000 +0100
  139.56 ++++ gcc-4.0.4/gcc/config.gcc	2007-02-02 19:26:12.000000000 +0100
  139.57 +@@ -672,6 +672,11 @@
  139.58 + 	;;
  139.59 + arm*-*-linux*)			# ARM GNU/Linux with ELF
  139.60 + 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
  139.61 ++	case $target in
  139.62 ++	arm*b-*)
  139.63 ++		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
  139.64 ++		;;
  139.65 ++	esac
  139.66 + 	tmake_file="${tmake_file} arm/t-arm arm/t-linux"
  139.67 + 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  139.68 + 	gnu_ld=yes
   140.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   140.2 +++ b/patches/gcc/4.0.4/200-arm-softfloat.patch	Mon Jul 28 21:32:33 2008 +0000
   140.3 @@ -0,0 +1,15 @@
   140.4 +Enable building a pure soft-float compiler without the need for a software
   140.5 +floating point library.
   140.6 +
   140.7 +diff -dur gcc-4.0.4.orig/gcc/config.gcc gcc-4.0.4/gcc/config.gcc
   140.8 +--- gcc-4.0.4.orig/gcc/config.gcc	2007-02-02 19:12:28.000000000 +0100
   140.9 ++++ gcc-4.0.4/gcc/config.gcc	2007-02-02 19:12:07.000000000 +0100
  140.10 +@@ -677,7 +677,7 @@
  140.11 + 		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
  140.12 + 		;;
  140.13 + 	esac
  140.14 +-	tmake_file="${tmake_file} arm/t-arm arm/t-linux"
  140.15 ++	tmake_file="${tmake_file} arm/t-arm arm/t-linux arm/t-arm-elf"
  140.16 + 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  140.17 + 	gnu_ld=yes
  140.18 + 	;;
   141.1 --- a/patches/gcc/4.0.4/200-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   141.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   141.3 @@ -1,3237 +0,0 @@
   141.4 -diff -urN gcc-4.0.0-100/libstdc++-v3/acinclude.m4 gcc-4.0.0/libstdc++-v3/acinclude.m4
   141.5 ---- gcc-4.0.0-100/libstdc++-v3/acinclude.m4	2005-04-30 13:06:53.000000000 -0500
   141.6 -+++ gcc-4.0.0/libstdc++-v3/acinclude.m4	2005-04-28 20:19:01.000000000 -0500
   141.7 -@@ -1104,7 +1104,7 @@
   141.8 -   AC_MSG_CHECKING([for C locale to use])
   141.9 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  141.10 -     [use MODEL for target locale package],
  141.11 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  141.12 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  141.13 -   
  141.14 -   # If they didn't use this option switch, or if they specified --enable
  141.15 -   # with no specific model, we'll have to look for one.  If they
  141.16 -@@ -1120,6 +1120,9 @@
  141.17 -   # Default to "generic".
  141.18 -   if test $enable_clocale_flag = auto; then
  141.19 -     case ${target_os} in
  141.20 -+      *-uclibc*)
  141.21 -+        enable_clocale_flag=uclibc
  141.22 -+        ;;
  141.23 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  141.24 -         AC_EGREP_CPP([_GLIBCXX_ok], [
  141.25 -         #include <features.h>
  141.26 -@@ -1263,6 +1266,40 @@
  141.27 -       CTIME_CC=config/locale/generic/time_members.cc
  141.28 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  141.29 -       ;;
  141.30 -+    uclibc)
  141.31 -+      AC_MSG_RESULT(uclibc)
  141.32 -+
  141.33 -+      # Declare intention to use gettext, and add support for specific
  141.34 -+      # languages.
  141.35 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  141.36 -+      ALL_LINGUAS="de fr"
  141.37 -+
  141.38 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  141.39 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  141.40 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  141.41 -+        USE_NLS=yes
  141.42 -+      fi
  141.43 -+      # Export the build objects.
  141.44 -+      for ling in $ALL_LINGUAS; do \
  141.45 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  141.46 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  141.47 -+      done
  141.48 -+      AC_SUBST(glibcxx_MOFILES)
  141.49 -+      AC_SUBST(glibcxx_POFILES)
  141.50 -+
  141.51 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  141.52 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  141.53 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  141.54 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  141.55 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  141.56 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  141.57 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  141.58 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  141.59 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  141.60 -+      CTIME_H=config/locale/uclibc/time_members.h
  141.61 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  141.62 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  141.63 -+      ;;
  141.64 -   esac
  141.65 - 
  141.66 -   # This is where the testsuite looks for locale catalogs, using the
  141.67 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  141.68 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1969-12-31 18:00:00.000000000 -0600
  141.69 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2005-04-28 01:13:15.000000000 -0500
  141.70 -@@ -0,0 +1,59 @@
  141.71 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  141.72 -+
  141.73 -+// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
  141.74 -+//
  141.75 -+// This file is part of the GNU ISO C++ Library.  This library is free
  141.76 -+// software; you can redistribute it and/or modify it under the
  141.77 -+// terms of the GNU General Public License as published by the
  141.78 -+// Free Software Foundation; either version 2, or (at your option)
  141.79 -+// any later version.
  141.80 -+
  141.81 -+// This library is distributed in the hope that it will be useful,
  141.82 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  141.83 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  141.84 -+// GNU General Public License for more details.
  141.85 -+
  141.86 -+// You should have received a copy of the GNU General Public License along
  141.87 -+// with this library; see the file COPYING.  If not, write to the Free
  141.88 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  141.89 -+// USA.
  141.90 -+
  141.91 -+// As a special exception, you may use this file as part of a free software
  141.92 -+// library without restriction.  Specifically, if other files instantiate
  141.93 -+// templates or use macros or inline functions from this file, or you compile
  141.94 -+// this file and link it with other files to produce an executable, this
  141.95 -+// file does not by itself cause the resulting executable to be covered by
  141.96 -+// the GNU General Public License.  This exception does not however
  141.97 -+// invalidate any other reasons why the executable file might be covered by
  141.98 -+// the GNU General Public License.
  141.99 -+
 141.100 -+// Written by Jakub Jelinek <jakub@redhat.com>
 141.101 -+
 141.102 -+#include <clocale>
 141.103 -+
 141.104 -+#ifdef __UCLIBC_MJN3_ONLY__
 141.105 -+#warning clean this up
 141.106 -+#endif
 141.107 -+
 141.108 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.109 -+                                                  
 141.110 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 141.111 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 141.112 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 141.113 -+extern "C" __typeof(strftime_l) __strftime_l;
 141.114 -+extern "C" __typeof(strtod_l) __strtod_l;
 141.115 -+extern "C" __typeof(strtof_l) __strtof_l;
 141.116 -+extern "C" __typeof(strtold_l) __strtold_l;
 141.117 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 141.118 -+extern "C" __typeof(towlower_l) __towlower_l;
 141.119 -+extern "C" __typeof(towupper_l) __towupper_l;
 141.120 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 141.121 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 141.122 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 141.123 -+extern "C" __typeof(wctype_l) __wctype_l;
 141.124 -+extern "C" __typeof(newlocale) __newlocale;
 141.125 -+extern "C" __typeof(freelocale) __freelocale;
 141.126 -+extern "C" __typeof(duplocale) __duplocale;
 141.127 -+extern "C" __typeof(uselocale) __uselocale;
 141.128 -+
 141.129 -+#endif // GLIBC 2.3 and later
 141.130 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
 141.131 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.cc	1969-12-31 18:00:00.000000000 -0600
 141.132 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2005-04-28 01:13:15.000000000 -0500
 141.133 -@@ -0,0 +1,160 @@
 141.134 -+// Wrapper for underlying C-language localization -*- C++ -*-
 141.135 -+
 141.136 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 141.137 -+//
 141.138 -+// This file is part of the GNU ISO C++ Library.  This library is free
 141.139 -+// software; you can redistribute it and/or modify it under the
 141.140 -+// terms of the GNU General Public License as published by the
 141.141 -+// Free Software Foundation; either version 2, or (at your option)
 141.142 -+// any later version.
 141.143 -+
 141.144 -+// This library is distributed in the hope that it will be useful,
 141.145 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 141.146 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 141.147 -+// GNU General Public License for more details.
 141.148 -+
 141.149 -+// You should have received a copy of the GNU General Public License along
 141.150 -+// with this library; see the file COPYING.  If not, write to the Free
 141.151 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 141.152 -+// USA.
 141.153 -+
 141.154 -+// As a special exception, you may use this file as part of a free software
 141.155 -+// library without restriction.  Specifically, if other files instantiate
 141.156 -+// templates or use macros or inline functions from this file, or you compile
 141.157 -+// this file and link it with other files to produce an executable, this
 141.158 -+// file does not by itself cause the resulting executable to be covered by
 141.159 -+// the GNU General Public License.  This exception does not however
 141.160 -+// invalidate any other reasons why the executable file might be covered by
 141.161 -+// the GNU General Public License.
 141.162 -+
 141.163 -+//
 141.164 -+// ISO C++ 14882: 22.8  Standard locale categories.
 141.165 -+//
 141.166 -+
 141.167 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 141.168 -+
 141.169 -+#include <cerrno>  // For errno
 141.170 -+#include <locale>
 141.171 -+#include <stdexcept>
 141.172 -+#include <langinfo.h>
 141.173 -+#include <bits/c++locale_internal.h>
 141.174 -+
 141.175 -+#ifndef __UCLIBC_HAS_XLOCALE__
 141.176 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 141.177 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 141.178 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 141.179 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 141.180 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 141.181 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 141.182 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 141.183 -+#warning should dummy __newlocale check for C|POSIX ?
 141.184 -+#define __newlocale(a, b, c)        NULL
 141.185 -+#define __freelocale(a)             ((void)0)
 141.186 -+#define __duplocale(a)              __c_locale()
 141.187 -+#endif
 141.188 -+
 141.189 -+namespace std 
 141.190 -+{
 141.191 -+  template<>
 141.192 -+    void
 141.193 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 141.194 -+		   const __c_locale& __cloc)
 141.195 -+    {
 141.196 -+      if (!(__err & ios_base::failbit))
 141.197 -+	{
 141.198 -+	  char* __sanity;
 141.199 -+	  errno = 0;
 141.200 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
 141.201 -+          if (__sanity != __s && errno != ERANGE)
 141.202 -+	    __v = __f;
 141.203 -+	  else
 141.204 -+	    __err |= ios_base::failbit;
 141.205 -+	}
 141.206 -+    }
 141.207 -+
 141.208 -+  template<>
 141.209 -+    void
 141.210 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 141.211 -+		   const __c_locale& __cloc)
 141.212 -+    {
 141.213 -+      if (!(__err & ios_base::failbit))
 141.214 -+	{
 141.215 -+	  char* __sanity;
 141.216 -+	  errno = 0;
 141.217 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
 141.218 -+          if (__sanity != __s && errno != ERANGE)
 141.219 -+	    __v = __d;
 141.220 -+	  else
 141.221 -+	    __err |= ios_base::failbit;
 141.222 -+	}
 141.223 -+    }
 141.224 -+
 141.225 -+  template<>
 141.226 -+    void
 141.227 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 141.228 -+		   const __c_locale& __cloc)
 141.229 -+    {
 141.230 -+      if (!(__err & ios_base::failbit))
 141.231 -+	{
 141.232 -+	  char* __sanity;
 141.233 -+	  errno = 0;
 141.234 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 141.235 -+          if (__sanity != __s && errno != ERANGE)
 141.236 -+	    __v = __ld;
 141.237 -+	  else
 141.238 -+	    __err |= ios_base::failbit;
 141.239 -+	}
 141.240 -+    }
 141.241 -+
 141.242 -+  void
 141.243 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 141.244 -+				    __c_locale __old)
 141.245 -+  {
 141.246 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 141.247 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.248 -+    if (!__cloc)
 141.249 -+      {
 141.250 -+	// This named locale is not supported by the underlying OS.
 141.251 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 141.252 -+			      "name not valid"));
 141.253 -+      }
 141.254 -+#endif
 141.255 -+  }
 141.256 -+  
 141.257 -+  void
 141.258 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 141.259 -+  {
 141.260 -+    if (_S_get_c_locale() != __cloc)
 141.261 -+      __freelocale(__cloc); 
 141.262 -+  }
 141.263 -+
 141.264 -+  __c_locale
 141.265 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 141.266 -+  { return __duplocale(__cloc); }
 141.267 -+} // namespace std
 141.268 -+
 141.269 -+namespace __gnu_cxx
 141.270 -+{
 141.271 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 141.272 -+    {
 141.273 -+      "LC_CTYPE", 
 141.274 -+      "LC_NUMERIC",
 141.275 -+      "LC_TIME", 
 141.276 -+      "LC_COLLATE", 
 141.277 -+      "LC_MONETARY",
 141.278 -+      "LC_MESSAGES", 
 141.279 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 141.280 -+      "LC_PAPER", 
 141.281 -+      "LC_NAME", 
 141.282 -+      "LC_ADDRESS",
 141.283 -+      "LC_TELEPHONE", 
 141.284 -+      "LC_MEASUREMENT", 
 141.285 -+      "LC_IDENTIFICATION" 
 141.286 -+#endif
 141.287 -+    };
 141.288 -+}
 141.289 -+
 141.290 -+namespace std
 141.291 -+{
 141.292 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 141.293 -+}  // namespace std
 141.294 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.h
 141.295 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.h	1969-12-31 18:00:00.000000000 -0600
 141.296 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2005-04-28 01:13:15.000000000 -0500
 141.297 -@@ -0,0 +1,115 @@
 141.298 -+// Wrapper for underlying C-language localization -*- C++ -*-
 141.299 -+
 141.300 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 141.301 -+//
 141.302 -+// This file is part of the GNU ISO C++ Library.  This library is free
 141.303 -+// software; you can redistribute it and/or modify it under the
 141.304 -+// terms of the GNU General Public License as published by the
 141.305 -+// Free Software Foundation; either version 2, or (at your option)
 141.306 -+// any later version.
 141.307 -+
 141.308 -+// This library is distributed in the hope that it will be useful,
 141.309 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 141.310 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 141.311 -+// GNU General Public License for more details.
 141.312 -+
 141.313 -+// You should have received a copy of the GNU General Public License along
 141.314 -+// with this library; see the file COPYING.  If not, write to the Free
 141.315 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 141.316 -+// USA.
 141.317 -+
 141.318 -+// As a special exception, you may use this file as part of a free software
 141.319 -+// library without restriction.  Specifically, if other files instantiate
 141.320 -+// templates or use macros or inline functions from this file, or you compile
 141.321 -+// this file and link it with other files to produce an executable, this
 141.322 -+// file does not by itself cause the resulting executable to be covered by
 141.323 -+// the GNU General Public License.  This exception does not however
 141.324 -+// invalidate any other reasons why the executable file might be covered by
 141.325 -+// the GNU General Public License.
 141.326 -+
 141.327 -+//
 141.328 -+// ISO C++ 14882: 22.8  Standard locale categories.
 141.329 -+//
 141.330 -+
 141.331 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 141.332 -+
 141.333 -+#ifndef _C_LOCALE_H
 141.334 -+#define _C_LOCALE_H 1
 141.335 -+
 141.336 -+#pragma GCC system_header
 141.337 -+
 141.338 -+#include <cstring>              // get std::strlen
 141.339 -+#include <cstdio>               // get std::snprintf or std::sprintf
 141.340 -+#include <clocale>
 141.341 -+#include <langinfo.h>		// For codecvt
 141.342 -+#ifdef __UCLIBC_MJN3_ONLY__
 141.343 -+#warning fix this
 141.344 -+#endif
 141.345 -+#ifdef __UCLIBC_HAS_LOCALE__
 141.346 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 141.347 -+#endif
 141.348 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 141.349 -+#include <libintl.h> 		// For messages
 141.350 -+#endif
 141.351 -+
 141.352 -+#ifdef __UCLIBC_MJN3_ONLY__
 141.353 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 141.354 -+#endif
 141.355 -+#define _GLIBCXX_C_LOCALE_GNU 1
 141.356 -+
 141.357 -+#ifdef __UCLIBC_MJN3_ONLY__
 141.358 -+#warning fix categories
 141.359 -+#endif
 141.360 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 141.361 -+#define _GLIBCXX_NUM_CATEGORIES 0
 141.362 -+ 
 141.363 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.364 -+namespace __gnu_cxx
 141.365 -+{
 141.366 -+  extern "C" __typeof(uselocale) __uselocale;
 141.367 -+}
 141.368 -+#endif
 141.369 -+
 141.370 -+namespace std
 141.371 -+{
 141.372 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.373 -+  typedef __locale_t		__c_locale;
 141.374 -+#else
 141.375 -+  typedef int*			__c_locale;
 141.376 -+#endif
 141.377 -+
 141.378 -+  // Convert numeric value of type _Tv to string and return length of
 141.379 -+  // string.  If snprintf is available use it, otherwise fall back to
 141.380 -+  // the unsafe sprintf which, in general, can be dangerous and should
 141.381 -+  // be avoided.
 141.382 -+  template<typename _Tv>
 141.383 -+    int
 141.384 -+    __convert_from_v(char* __out, const int __size, const char* __fmt,
 141.385 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.386 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 141.387 -+    {
 141.388 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 141.389 -+#else
 141.390 -+		     _Tv __v, const __c_locale&, int __prec)
 141.391 -+    {
 141.392 -+# ifdef __UCLIBC_HAS_LOCALE__
 141.393 -+      char* __old = std::setlocale(LC_ALL, NULL);
 141.394 -+      char* __sav = new char[std::strlen(__old) + 1];
 141.395 -+      std::strcpy(__sav, __old);
 141.396 -+      std::setlocale(LC_ALL, "C");
 141.397 -+# endif
 141.398 -+#endif
 141.399 -+
 141.400 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 141.401 -+
 141.402 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.403 -+      __gnu_cxx::__uselocale(__old);
 141.404 -+#elif defined __UCLIBC_HAS_LOCALE__
 141.405 -+      std::setlocale(LC_ALL, __sav);
 141.406 -+      delete [] __sav;
 141.407 -+#endif
 141.408 -+      return __ret;
 141.409 -+    }
 141.410 -+}
 141.411 -+
 141.412 -+#endif
 141.413 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 141.414 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1969-12-31 18:00:00.000000000 -0600
 141.415 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2005-04-28 01:13:15.000000000 -0500
 141.416 -@@ -0,0 +1,306 @@
 141.417 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 141.418 -+
 141.419 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 141.420 -+//
 141.421 -+// This file is part of the GNU ISO C++ Library.  This library is free
 141.422 -+// software; you can redistribute it and/or modify it under the
 141.423 -+// terms of the GNU General Public License as published by the
 141.424 -+// Free Software Foundation; either version 2, or (at your option)
 141.425 -+// any later version.
 141.426 -+
 141.427 -+// This library is distributed in the hope that it will be useful,
 141.428 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 141.429 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 141.430 -+// GNU General Public License for more details.
 141.431 -+
 141.432 -+// You should have received a copy of the GNU General Public License along
 141.433 -+// with this library; see the file COPYING.  If not, write to the Free
 141.434 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 141.435 -+// USA.
 141.436 -+
 141.437 -+// As a special exception, you may use this file as part of a free software
 141.438 -+// library without restriction.  Specifically, if other files instantiate
 141.439 -+// templates or use macros or inline functions from this file, or you compile
 141.440 -+// this file and link it with other files to produce an executable, this
 141.441 -+// file does not by itself cause the resulting executable to be covered by
 141.442 -+// the GNU General Public License.  This exception does not however
 141.443 -+// invalidate any other reasons why the executable file might be covered by
 141.444 -+// the GNU General Public License.
 141.445 -+
 141.446 -+//
 141.447 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 141.448 -+//
 141.449 -+
 141.450 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 141.451 -+
 141.452 -+#include <locale>
 141.453 -+#include <bits/c++locale_internal.h>
 141.454 -+
 141.455 -+namespace std
 141.456 -+{
 141.457 -+  // Specializations.
 141.458 -+#ifdef _GLIBCXX_USE_WCHAR_T
 141.459 -+  codecvt_base::result
 141.460 -+  codecvt<wchar_t, char, mbstate_t>::
 141.461 -+  do_out(state_type& __state, const intern_type* __from, 
 141.462 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 141.463 -+	 extern_type* __to, extern_type* __to_end,
 141.464 -+	 extern_type*& __to_next) const
 141.465 -+  {
 141.466 -+    result __ret = ok;
 141.467 -+    state_type __tmp_state(__state);
 141.468 -+
 141.469 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.470 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 141.471 -+#endif
 141.472 -+
 141.473 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 141.474 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 141.475 -+    // NB: wcsnrtombs is a GNU extension
 141.476 -+    for (__from_next = __from, __to_next = __to;
 141.477 -+	 __from_next < __from_end && __to_next < __to_end
 141.478 -+	 && __ret == ok;)
 141.479 -+      {
 141.480 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 141.481 -+						      __from_end - __from_next);
 141.482 -+	if (!__from_chunk_end)
 141.483 -+	  __from_chunk_end = __from_end;
 141.484 -+
 141.485 -+	__from = __from_next;
 141.486 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 141.487 -+					 __from_chunk_end - __from_next,
 141.488 -+					 __to_end - __to_next, &__state);
 141.489 -+	if (__conv == static_cast<size_t>(-1))
 141.490 -+	  {
 141.491 -+	    // In case of error, in order to stop at the exact place we
 141.492 -+	    // have to start again from the beginning with a series of
 141.493 -+	    // wcrtomb.
 141.494 -+	    for (; __from < __from_next; ++__from)
 141.495 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 141.496 -+	    __state = __tmp_state;
 141.497 -+	    __ret = error;
 141.498 -+	  }
 141.499 -+	else if (__from_next && __from_next < __from_chunk_end)
 141.500 -+	  {
 141.501 -+	    __to_next += __conv;
 141.502 -+	    __ret = partial;
 141.503 -+	  }
 141.504 -+	else
 141.505 -+	  {
 141.506 -+	    __from_next = __from_chunk_end;
 141.507 -+	    __to_next += __conv;
 141.508 -+	  }
 141.509 -+
 141.510 -+	if (__from_next < __from_end && __ret == ok)
 141.511 -+	  {
 141.512 -+	    extern_type __buf[MB_LEN_MAX];
 141.513 -+	    __tmp_state = __state;
 141.514 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 141.515 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 141.516 -+	      __ret = partial;
 141.517 -+	    else
 141.518 -+	      {
 141.519 -+		memcpy(__to_next, __buf, __conv);
 141.520 -+		__state = __tmp_state;
 141.521 -+		__to_next += __conv;
 141.522 -+		++__from_next;
 141.523 -+	      }
 141.524 -+	  }
 141.525 -+      }
 141.526 -+
 141.527 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.528 -+    __uselocale(__old);
 141.529 -+#endif
 141.530 -+
 141.531 -+    return __ret; 
 141.532 -+  }
 141.533 -+  
 141.534 -+  codecvt_base::result
 141.535 -+  codecvt<wchar_t, char, mbstate_t>::
 141.536 -+  do_in(state_type& __state, const extern_type* __from, 
 141.537 -+	const extern_type* __from_end, const extern_type*& __from_next,
 141.538 -+	intern_type* __to, intern_type* __to_end,
 141.539 -+	intern_type*& __to_next) const
 141.540 -+  {
 141.541 -+    result __ret = ok;
 141.542 -+    state_type __tmp_state(__state);
 141.543 -+
 141.544 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.545 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 141.546 -+#endif
 141.547 -+
 141.548 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 141.549 -+    // in case we store a L'\0' and then continue, in a loop.
 141.550 -+    // NB: mbsnrtowcs is a GNU extension
 141.551 -+    for (__from_next = __from, __to_next = __to;
 141.552 -+	 __from_next < __from_end && __to_next < __to_end
 141.553 -+	 && __ret == ok;)
 141.554 -+      {
 141.555 -+	const extern_type* __from_chunk_end;
 141.556 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 141.557 -+								  __from_end
 141.558 -+								  - __from_next));
 141.559 -+	if (!__from_chunk_end)
 141.560 -+	  __from_chunk_end = __from_end;
 141.561 -+
 141.562 -+	__from = __from_next;
 141.563 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 141.564 -+				   __from_chunk_end - __from_next,
 141.565 -+				   __to_end - __to_next, &__state);
 141.566 -+	if (__conv == static_cast<size_t>(-1))
 141.567 -+	  {
 141.568 -+	    // In case of error, in order to stop at the exact place we
 141.569 -+	    // have to start again from the beginning with a series of
 141.570 -+	    // mbrtowc.
 141.571 -+	    for (;; ++__to_next, __from += __conv)
 141.572 -+	      {
 141.573 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 141.574 -+				 &__tmp_state);
 141.575 -+		if (__conv == static_cast<size_t>(-1)
 141.576 -+		    || __conv == static_cast<size_t>(-2))
 141.577 -+		  break;
 141.578 -+	      }
 141.579 -+	    __from_next = __from;
 141.580 -+	    __state = __tmp_state;	    
 141.581 -+	    __ret = error;
 141.582 -+	  }
 141.583 -+	else if (__from_next && __from_next < __from_chunk_end)
 141.584 -+	  {
 141.585 -+	    // It is unclear what to return in this case (see DR 382). 
 141.586 -+	    __to_next += __conv;
 141.587 -+	    __ret = partial;
 141.588 -+	  }
 141.589 -+	else
 141.590 -+	  {
 141.591 -+	    __from_next = __from_chunk_end;
 141.592 -+	    __to_next += __conv;
 141.593 -+	  }
 141.594 -+
 141.595 -+	if (__from_next < __from_end && __ret == ok)
 141.596 -+	  {
 141.597 -+	    if (__to_next < __to_end)
 141.598 -+	      {
 141.599 -+		// XXX Probably wrong for stateful encodings
 141.600 -+		__tmp_state = __state;		
 141.601 -+		++__from_next;
 141.602 -+		*__to_next++ = L'\0';
 141.603 -+	      }
 141.604 -+	    else
 141.605 -+	      __ret = partial;
 141.606 -+	  }
 141.607 -+      }
 141.608 -+
 141.609 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.610 -+    __uselocale(__old);
 141.611 -+#endif
 141.612 -+
 141.613 -+    return __ret; 
 141.614 -+  }
 141.615 -+
 141.616 -+  int 
 141.617 -+  codecvt<wchar_t, char, mbstate_t>::
 141.618 -+  do_encoding() const throw()
 141.619 -+  {
 141.620 -+    // XXX This implementation assumes that the encoding is
 141.621 -+    // stateless and is either single-byte or variable-width.
 141.622 -+    int __ret = 0;
 141.623 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.624 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 141.625 -+#endif
 141.626 -+    if (MB_CUR_MAX == 1)
 141.627 -+      __ret = 1;
 141.628 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.629 -+    __uselocale(__old);
 141.630 -+#endif
 141.631 -+    return __ret;
 141.632 -+  }  
 141.633 -+
 141.634 -+  int 
 141.635 -+  codecvt<wchar_t, char, mbstate_t>::
 141.636 -+  do_max_length() const throw()
 141.637 -+  {
 141.638 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.639 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 141.640 -+#endif
 141.641 -+    // XXX Probably wrong for stateful encodings.
 141.642 -+    int __ret = MB_CUR_MAX;
 141.643 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.644 -+    __uselocale(__old);
 141.645 -+#endif
 141.646 -+    return __ret;
 141.647 -+  }
 141.648 -+  
 141.649 -+  int 
 141.650 -+  codecvt<wchar_t, char, mbstate_t>::
 141.651 -+  do_length(state_type& __state, const extern_type* __from,
 141.652 -+	    const extern_type* __end, size_t __max) const
 141.653 -+  {
 141.654 -+    int __ret = 0;
 141.655 -+    state_type __tmp_state(__state);
 141.656 -+
 141.657 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.658 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 141.659 -+#endif
 141.660 -+
 141.661 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 141.662 -+    // in case we advance past it and then continue, in a loop.
 141.663 -+    // NB: mbsnrtowcs is a GNU extension
 141.664 -+  
 141.665 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 141.666 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 141.667 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 141.668 -+							   * __max));
 141.669 -+    while (__from < __end && __max)
 141.670 -+      {
 141.671 -+	const extern_type* __from_chunk_end;
 141.672 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 141.673 -+								  __end
 141.674 -+								  - __from));
 141.675 -+	if (!__from_chunk_end)
 141.676 -+	  __from_chunk_end = __end;
 141.677 -+
 141.678 -+	const extern_type* __tmp_from = __from;
 141.679 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 141.680 -+				   __from_chunk_end - __from,
 141.681 -+				   __max, &__state);
 141.682 -+	if (__conv == static_cast<size_t>(-1))
 141.683 -+	  {
 141.684 -+	    // In case of error, in order to stop at the exact place we
 141.685 -+	    // have to start again from the beginning with a series of
 141.686 -+	    // mbrtowc.
 141.687 -+	    for (__from = __tmp_from;; __from += __conv)
 141.688 -+	      {
 141.689 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 141.690 -+				 &__tmp_state);
 141.691 -+		if (__conv == static_cast<size_t>(-1)
 141.692 -+		    || __conv == static_cast<size_t>(-2))
 141.693 -+		  break;
 141.694 -+	      }
 141.695 -+	    __state = __tmp_state;
 141.696 -+	    __ret += __from - __tmp_from;
 141.697 -+	    break;
 141.698 -+	  }
 141.699 -+	if (!__from)
 141.700 -+	  __from = __from_chunk_end;
 141.701 -+	
 141.702 -+	__ret += __from - __tmp_from;
 141.703 -+	__max -= __conv;
 141.704 -+
 141.705 -+	if (__from < __end && __max)
 141.706 -+	  {
 141.707 -+	    // XXX Probably wrong for stateful encodings
 141.708 -+	    __tmp_state = __state;
 141.709 -+	    ++__from;
 141.710 -+	    ++__ret;
 141.711 -+	    --__max;
 141.712 -+	  }
 141.713 -+      }
 141.714 -+
 141.715 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.716 -+    __uselocale(__old);
 141.717 -+#endif
 141.718 -+
 141.719 -+    return __ret; 
 141.720 -+  }
 141.721 -+#endif
 141.722 -+}
 141.723 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
 141.724 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/collate_members.cc	1969-12-31 18:00:00.000000000 -0600
 141.725 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2005-04-28 01:13:15.000000000 -0500
 141.726 -@@ -0,0 +1,80 @@
 141.727 -+// std::collate implementation details, GNU version -*- C++ -*-
 141.728 -+
 141.729 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 141.730 -+//
 141.731 -+// This file is part of the GNU ISO C++ Library.  This library is free
 141.732 -+// software; you can redistribute it and/or modify it under the
 141.733 -+// terms of the GNU General Public License as published by the
 141.734 -+// Free Software Foundation; either version 2, or (at your option)
 141.735 -+// any later version.
 141.736 -+
 141.737 -+// This library is distributed in the hope that it will be useful,
 141.738 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 141.739 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 141.740 -+// GNU General Public License for more details.
 141.741 -+
 141.742 -+// You should have received a copy of the GNU General Public License along
 141.743 -+// with this library; see the file COPYING.  If not, write to the Free
 141.744 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 141.745 -+// USA.
 141.746 -+
 141.747 -+// As a special exception, you may use this file as part of a free software
 141.748 -+// library without restriction.  Specifically, if other files instantiate
 141.749 -+// templates or use macros or inline functions from this file, or you compile
 141.750 -+// this file and link it with other files to produce an executable, this
 141.751 -+// file does not by itself cause the resulting executable to be covered by
 141.752 -+// the GNU General Public License.  This exception does not however
 141.753 -+// invalidate any other reasons why the executable file might be covered by
 141.754 -+// the GNU General Public License.
 141.755 -+
 141.756 -+//
 141.757 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 141.758 -+//
 141.759 -+
 141.760 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 141.761 -+
 141.762 -+#include <locale>
 141.763 -+#include <bits/c++locale_internal.h>
 141.764 -+
 141.765 -+#ifndef __UCLIBC_HAS_XLOCALE__
 141.766 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 141.767 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 141.768 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 141.769 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 141.770 -+#endif
 141.771 -+
 141.772 -+namespace std
 141.773 -+{
 141.774 -+  // These are basically extensions to char_traits, and perhaps should
 141.775 -+  // be put there instead of here.
 141.776 -+  template<>
 141.777 -+    int 
 141.778 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 141.779 -+    { 
 141.780 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 141.781 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 141.782 -+    }
 141.783 -+  
 141.784 -+  template<>
 141.785 -+    size_t
 141.786 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 141.787 -+				size_t __n) const 
 141.788 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 141.789 -+
 141.790 -+#ifdef _GLIBCXX_USE_WCHAR_T
 141.791 -+  template<>
 141.792 -+    int 
 141.793 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 141.794 -+				 const wchar_t* __two) const
 141.795 -+    {
 141.796 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 141.797 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 141.798 -+    }
 141.799 -+  
 141.800 -+  template<>
 141.801 -+    size_t
 141.802 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 141.803 -+				   size_t __n) const
 141.804 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 141.805 -+#endif
 141.806 -+}
 141.807 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 141.808 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1969-12-31 18:00:00.000000000 -0600
 141.809 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2005-04-28 01:13:15.000000000 -0500
 141.810 -@@ -0,0 +1,300 @@
 141.811 -+// std::ctype implementation details, GNU version -*- C++ -*-
 141.812 -+
 141.813 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 141.814 -+//
 141.815 -+// This file is part of the GNU ISO C++ Library.  This library is free
 141.816 -+// software; you can redistribute it and/or modify it under the
 141.817 -+// terms of the GNU General Public License as published by the
 141.818 -+// Free Software Foundation; either version 2, or (at your option)
 141.819 -+// any later version.
 141.820 -+
 141.821 -+// This library is distributed in the hope that it will be useful,
 141.822 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 141.823 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 141.824 -+// GNU General Public License for more details.
 141.825 -+
 141.826 -+// You should have received a copy of the GNU General Public License along
 141.827 -+// with this library; see the file COPYING.  If not, write to the Free
 141.828 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 141.829 -+// USA.
 141.830 -+
 141.831 -+// As a special exception, you may use this file as part of a free software
 141.832 -+// library without restriction.  Specifically, if other files instantiate
 141.833 -+// templates or use macros or inline functions from this file, or you compile
 141.834 -+// this file and link it with other files to produce an executable, this
 141.835 -+// file does not by itself cause the resulting executable to be covered by
 141.836 -+// the GNU General Public License.  This exception does not however
 141.837 -+// invalidate any other reasons why the executable file might be covered by
 141.838 -+// the GNU General Public License.
 141.839 -+
 141.840 -+//
 141.841 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 141.842 -+//
 141.843 -+
 141.844 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 141.845 -+
 141.846 -+#define _LIBC
 141.847 -+#include <locale>
 141.848 -+#undef _LIBC
 141.849 -+#include <bits/c++locale_internal.h>
 141.850 -+
 141.851 -+#ifndef __UCLIBC_HAS_XLOCALE__
 141.852 -+#define __wctype_l(S, L)           wctype((S))
 141.853 -+#define __towupper_l(C, L)         towupper((C))
 141.854 -+#define __towlower_l(C, L)         towlower((C))
 141.855 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 141.856 -+#endif
 141.857 -+
 141.858 -+namespace std
 141.859 -+{
 141.860 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 141.861 -+  // various /config/os/* files.
 141.862 -+  template<>
 141.863 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 141.864 -+    : ctype<char>(0, false, __refs) 
 141.865 -+    { 		
 141.866 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 141.867 -+	{
 141.868 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 141.869 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 141.870 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.871 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 141.872 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 141.873 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 141.874 -+#endif
 141.875 -+	}
 141.876 -+    }
 141.877 -+
 141.878 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 141.879 -+  ctype<wchar_t>::__wmask_type
 141.880 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 141.881 -+  {
 141.882 -+    __wmask_type __ret;
 141.883 -+    switch (__m)
 141.884 -+      {
 141.885 -+      case space:
 141.886 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 141.887 -+	break;
 141.888 -+      case print:
 141.889 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 141.890 -+	break;
 141.891 -+      case cntrl:
 141.892 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 141.893 -+	break;
 141.894 -+      case upper:
 141.895 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 141.896 -+	break;
 141.897 -+      case lower:
 141.898 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 141.899 -+	break;
 141.900 -+      case alpha:
 141.901 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 141.902 -+	break;
 141.903 -+      case digit:
 141.904 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 141.905 -+	break;
 141.906 -+      case punct:
 141.907 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 141.908 -+	break;
 141.909 -+      case xdigit:
 141.910 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 141.911 -+	break;
 141.912 -+      case alnum:
 141.913 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 141.914 -+	break;
 141.915 -+      case graph:
 141.916 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 141.917 -+	break;
 141.918 -+      default:
 141.919 -+	__ret = __wmask_type();
 141.920 -+      }
 141.921 -+    return __ret;
 141.922 -+  }
 141.923 -+  
 141.924 -+  wchar_t
 141.925 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 141.926 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 141.927 -+
 141.928 -+  const wchar_t*
 141.929 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 141.930 -+  {
 141.931 -+    while (__lo < __hi)
 141.932 -+      {
 141.933 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 141.934 -+        ++__lo;
 141.935 -+      }
 141.936 -+    return __hi;
 141.937 -+  }
 141.938 -+  
 141.939 -+  wchar_t
 141.940 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 141.941 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 141.942 -+  
 141.943 -+  const wchar_t*
 141.944 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 141.945 -+  {
 141.946 -+    while (__lo < __hi)
 141.947 -+      {
 141.948 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 141.949 -+        ++__lo;
 141.950 -+      }
 141.951 -+    return __hi;
 141.952 -+  }
 141.953 -+
 141.954 -+  bool
 141.955 -+  ctype<wchar_t>::
 141.956 -+  do_is(mask __m, wchar_t __c) const
 141.957 -+  { 
 141.958 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
 141.959 -+    // library for blank.
 141.960 -+    bool __ret = false;
 141.961 -+    const size_t __bitmasksize = 11; 
 141.962 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 141.963 -+      if (__m & _M_bit[__bitcur]
 141.964 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 141.965 -+	{
 141.966 -+	  __ret = true;
 141.967 -+	  break;
 141.968 -+	}
 141.969 -+    return __ret;    
 141.970 -+  }
 141.971 -+  
 141.972 -+  const wchar_t* 
 141.973 -+  ctype<wchar_t>::
 141.974 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 141.975 -+  {
 141.976 -+    for (; __lo < __hi; ++__vec, ++__lo)
 141.977 -+      {
 141.978 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 141.979 -+	// library for blank.
 141.980 -+	const size_t __bitmasksize = 11; 
 141.981 -+	mask __m = 0;
 141.982 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 141.983 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 141.984 -+	    __m |= _M_bit[__bitcur];
 141.985 -+	*__vec = __m;
 141.986 -+      }
 141.987 -+    return __hi;
 141.988 -+  }
 141.989 -+  
 141.990 -+  const wchar_t* 
 141.991 -+  ctype<wchar_t>::
 141.992 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 141.993 -+  {
 141.994 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
 141.995 -+      ++__lo;
 141.996 -+    return __lo;
 141.997 -+  }
 141.998 -+
 141.999 -+  const wchar_t*
141.1000 -+  ctype<wchar_t>::
141.1001 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
141.1002 -+  {
141.1003 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
141.1004 -+      ++__lo;
141.1005 -+    return __lo;
141.1006 -+  }
141.1007 -+
141.1008 -+  wchar_t
141.1009 -+  ctype<wchar_t>::
141.1010 -+  do_widen(char __c) const
141.1011 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
141.1012 -+
141.1013 -+  const char* 
141.1014 -+  ctype<wchar_t>::
141.1015 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
141.1016 -+  {
141.1017 -+    while (__lo < __hi)
141.1018 -+      {
141.1019 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
141.1020 -+	++__lo;
141.1021 -+	++__dest;
141.1022 -+      }
141.1023 -+    return __hi;
141.1024 -+  }
141.1025 -+
141.1026 -+  char
141.1027 -+  ctype<wchar_t>::
141.1028 -+  do_narrow(wchar_t __wc, char __dfault) const
141.1029 -+  {
141.1030 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
141.1031 -+      return _M_narrow[__wc];
141.1032 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1033 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
141.1034 -+#endif
141.1035 -+    const int __c = wctob(__wc);
141.1036 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1037 -+    __uselocale(__old);
141.1038 -+#endif
141.1039 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
141.1040 -+  }
141.1041 -+
141.1042 -+  const wchar_t*
141.1043 -+  ctype<wchar_t>::
141.1044 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
141.1045 -+	    char* __dest) const
141.1046 -+  {
141.1047 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1048 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
141.1049 -+#endif
141.1050 -+    if (_M_narrow_ok)
141.1051 -+      while (__lo < __hi)
141.1052 -+	{
141.1053 -+	  if (*__lo >= 0 && *__lo < 128)
141.1054 -+	    *__dest = _M_narrow[*__lo];
141.1055 -+	  else
141.1056 -+	    {
141.1057 -+	      const int __c = wctob(*__lo);
141.1058 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
141.1059 -+	    }
141.1060 -+	  ++__lo;
141.1061 -+	  ++__dest;
141.1062 -+	}
141.1063 -+    else
141.1064 -+      while (__lo < __hi)
141.1065 -+	{
141.1066 -+	  const int __c = wctob(*__lo);
141.1067 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
141.1068 -+	  ++__lo;
141.1069 -+	  ++__dest;
141.1070 -+	}
141.1071 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1072 -+    __uselocale(__old);
141.1073 -+#endif
141.1074 -+    return __hi;
141.1075 -+  }
141.1076 -+
141.1077 -+  void
141.1078 -+  ctype<wchar_t>::_M_initialize_ctype()
141.1079 -+  {
141.1080 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1081 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
141.1082 -+#endif
141.1083 -+    wint_t __i;
141.1084 -+    for (__i = 0; __i < 128; ++__i)
141.1085 -+      {
141.1086 -+	const int __c = wctob(__i);
141.1087 -+	if (__c == EOF)
141.1088 -+	  break;
141.1089 -+	else
141.1090 -+	  _M_narrow[__i] = static_cast<char>(__c);
141.1091 -+      }
141.1092 -+    if (__i == 128)
141.1093 -+      _M_narrow_ok = true;
141.1094 -+    else
141.1095 -+      _M_narrow_ok = false;
141.1096 -+    for (size_t __j = 0;
141.1097 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
141.1098 -+      _M_widen[__j] = btowc(__j);
141.1099 -+
141.1100 -+    for (size_t __k = 0; __k <= 11; ++__k)
141.1101 -+      { 
141.1102 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
141.1103 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
141.1104 -+      }
141.1105 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1106 -+    __uselocale(__old);
141.1107 -+#endif
141.1108 -+  }
141.1109 -+#endif //  _GLIBCXX_USE_WCHAR_T
141.1110 -+}
141.1111 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
141.1112 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.cc	1969-12-31 18:00:00.000000000 -0600
141.1113 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2005-04-28 01:13:15.000000000 -0500
141.1114 -@@ -0,0 +1,100 @@
141.1115 -+// std::messages implementation details, GNU version -*- C++ -*-
141.1116 -+
141.1117 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
141.1118 -+//
141.1119 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.1120 -+// software; you can redistribute it and/or modify it under the
141.1121 -+// terms of the GNU General Public License as published by the
141.1122 -+// Free Software Foundation; either version 2, or (at your option)
141.1123 -+// any later version.
141.1124 -+
141.1125 -+// This library is distributed in the hope that it will be useful,
141.1126 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.1127 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.1128 -+// GNU General Public License for more details.
141.1129 -+
141.1130 -+// You should have received a copy of the GNU General Public License along
141.1131 -+// with this library; see the file COPYING.  If not, write to the Free
141.1132 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.1133 -+// USA.
141.1134 -+
141.1135 -+// As a special exception, you may use this file as part of a free software
141.1136 -+// library without restriction.  Specifically, if other files instantiate
141.1137 -+// templates or use macros or inline functions from this file, or you compile
141.1138 -+// this file and link it with other files to produce an executable, this
141.1139 -+// file does not by itself cause the resulting executable to be covered by
141.1140 -+// the GNU General Public License.  This exception does not however
141.1141 -+// invalidate any other reasons why the executable file might be covered by
141.1142 -+// the GNU General Public License.
141.1143 -+
141.1144 -+//
141.1145 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
141.1146 -+//
141.1147 -+
141.1148 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.1149 -+
141.1150 -+#include <locale>
141.1151 -+#include <bits/c++locale_internal.h>
141.1152 -+
141.1153 -+#ifdef __UCLIBC_MJN3_ONLY__
141.1154 -+#warning fix gettext stuff
141.1155 -+#endif
141.1156 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
141.1157 -+extern "C" char *__dcgettext(const char *domainname,
141.1158 -+			     const char *msgid, int category);
141.1159 -+#undef gettext
141.1160 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
141.1161 -+#else
141.1162 -+#undef gettext
141.1163 -+#define gettext(msgid) (msgid)
141.1164 -+#endif
141.1165 -+
141.1166 -+namespace std
141.1167 -+{
141.1168 -+  // Specializations.
141.1169 -+  template<>
141.1170 -+    string
141.1171 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
141.1172 -+    {
141.1173 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1174 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
141.1175 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
141.1176 -+      __uselocale(__old);
141.1177 -+      return string(__msg);
141.1178 -+#elif defined __UCLIBC_HAS_LOCALE__
141.1179 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
141.1180 -+      setlocale(LC_ALL, _M_name_messages);
141.1181 -+      const char* __msg = gettext(__dfault.c_str());
141.1182 -+      setlocale(LC_ALL, __old);
141.1183 -+      free(__old);
141.1184 -+      return string(__msg);
141.1185 -+#else
141.1186 -+      const char* __msg = gettext(__dfault.c_str());
141.1187 -+      return string(__msg);
141.1188 -+#endif
141.1189 -+    }
141.1190 -+
141.1191 -+#ifdef _GLIBCXX_USE_WCHAR_T
141.1192 -+  template<>
141.1193 -+    wstring
141.1194 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
141.1195 -+    {
141.1196 -+# ifdef __UCLIBC_HAS_XLOCALE__
141.1197 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
141.1198 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
141.1199 -+      __uselocale(__old);
141.1200 -+      return _M_convert_from_char(__msg);
141.1201 -+# elif defined __UCLIBC_HAS_LOCALE__
141.1202 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
141.1203 -+      setlocale(LC_ALL, _M_name_messages);
141.1204 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
141.1205 -+      setlocale(LC_ALL, __old);
141.1206 -+      free(__old);
141.1207 -+      return _M_convert_from_char(__msg);
141.1208 -+# else
141.1209 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
141.1210 -+      return _M_convert_from_char(__msg);
141.1211 -+# endif
141.1212 -+    }
141.1213 -+#endif
141.1214 -+}
141.1215 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.h
141.1216 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.h	1969-12-31 18:00:00.000000000 -0600
141.1217 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2005-04-28 01:13:15.000000000 -0500
141.1218 -@@ -0,0 +1,118 @@
141.1219 -+// std::messages implementation details, GNU version -*- C++ -*-
141.1220 -+
141.1221 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
141.1222 -+//
141.1223 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.1224 -+// software; you can redistribute it and/or modify it under the
141.1225 -+// terms of the GNU General Public License as published by the
141.1226 -+// Free Software Foundation; either version 2, or (at your option)
141.1227 -+// any later version.
141.1228 -+
141.1229 -+// This library is distributed in the hope that it will be useful,
141.1230 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.1231 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.1232 -+// GNU General Public License for more details.
141.1233 -+
141.1234 -+// You should have received a copy of the GNU General Public License along
141.1235 -+// with this library; see the file COPYING.  If not, write to the Free
141.1236 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.1237 -+// USA.
141.1238 -+
141.1239 -+// As a special exception, you may use this file as part of a free software
141.1240 -+// library without restriction.  Specifically, if other files instantiate
141.1241 -+// templates or use macros or inline functions from this file, or you compile
141.1242 -+// this file and link it with other files to produce an executable, this
141.1243 -+// file does not by itself cause the resulting executable to be covered by
141.1244 -+// the GNU General Public License.  This exception does not however
141.1245 -+// invalidate any other reasons why the executable file might be covered by
141.1246 -+// the GNU General Public License.
141.1247 -+
141.1248 -+//
141.1249 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
141.1250 -+//
141.1251 -+
141.1252 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.1253 -+
141.1254 -+#ifdef __UCLIBC_MJN3_ONLY__
141.1255 -+#warning fix prototypes for *textdomain funcs
141.1256 -+#endif
141.1257 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
141.1258 -+extern "C" char *__textdomain(const char *domainname);
141.1259 -+extern "C" char *__bindtextdomain(const char *domainname,
141.1260 -+				  const char *dirname);
141.1261 -+#else
141.1262 -+#undef __textdomain
141.1263 -+#undef __bindtextdomain
141.1264 -+#define __textdomain(D)           ((void)0)
141.1265 -+#define __bindtextdomain(D,P)     ((void)0)
141.1266 -+#endif
141.1267 -+
141.1268 -+  // Non-virtual member functions.
141.1269 -+  template<typename _CharT>
141.1270 -+     messages<_CharT>::messages(size_t __refs)
141.1271 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
141.1272 -+     _M_name_messages(_S_get_c_name())
141.1273 -+     { }
141.1274 -+
141.1275 -+  template<typename _CharT>
141.1276 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
141.1277 -+				size_t __refs) 
141.1278 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
141.1279 -+     _M_name_messages(__s)
141.1280 -+     {
141.1281 -+       char* __tmp = new char[std::strlen(__s) + 1];
141.1282 -+       std::strcpy(__tmp, __s);
141.1283 -+       _M_name_messages = __tmp;
141.1284 -+     }
141.1285 -+
141.1286 -+  template<typename _CharT>
141.1287 -+    typename messages<_CharT>::catalog 
141.1288 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
141.1289 -+			   const char* __dir) const
141.1290 -+    { 
141.1291 -+      __bindtextdomain(__s.c_str(), __dir);
141.1292 -+      return this->do_open(__s, __loc); 
141.1293 -+    }
141.1294 -+
141.1295 -+  // Virtual member functions.
141.1296 -+  template<typename _CharT>
141.1297 -+    messages<_CharT>::~messages()
141.1298 -+    { 
141.1299 -+      if (_M_name_messages != _S_get_c_name())
141.1300 -+	delete [] _M_name_messages;
141.1301 -+      _S_destroy_c_locale(_M_c_locale_messages); 
141.1302 -+    }
141.1303 -+
141.1304 -+  template<typename _CharT>
141.1305 -+    typename messages<_CharT>::catalog 
141.1306 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
141.1307 -+			      const locale&) const
141.1308 -+    { 
141.1309 -+      // No error checking is done, assume the catalog exists and can
141.1310 -+      // be used.
141.1311 -+      __textdomain(__s.c_str());
141.1312 -+      return 0;
141.1313 -+    }
141.1314 -+
141.1315 -+  template<typename _CharT>
141.1316 -+    void    
141.1317 -+    messages<_CharT>::do_close(catalog) const 
141.1318 -+    { }
141.1319 -+
141.1320 -+   // messages_byname
141.1321 -+   template<typename _CharT>
141.1322 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
141.1323 -+     : messages<_CharT>(__refs) 
141.1324 -+     { 
141.1325 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
141.1326 -+	 delete [] this->_M_name_messages;
141.1327 -+       char* __tmp = new char[std::strlen(__s) + 1];
141.1328 -+       std::strcpy(__tmp, __s);
141.1329 -+       this->_M_name_messages = __tmp;
141.1330 -+
141.1331 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
141.1332 -+	 {
141.1333 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
141.1334 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
141.1335 -+	 }
141.1336 -+     }
141.1337 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
141.1338 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1969-12-31 18:00:00.000000000 -0600
141.1339 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2005-04-28 01:23:02.000000000 -0500
141.1340 -@@ -0,0 +1,692 @@
141.1341 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
141.1342 -+
141.1343 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
141.1344 -+//
141.1345 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.1346 -+// software; you can redistribute it and/or modify it under the
141.1347 -+// terms of the GNU General Public License as published by the
141.1348 -+// Free Software Foundation; either version 2, or (at your option)
141.1349 -+// any later version.
141.1350 -+
141.1351 -+// This library is distributed in the hope that it will be useful,
141.1352 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.1353 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.1354 -+// GNU General Public License for more details.
141.1355 -+
141.1356 -+// You should have received a copy of the GNU General Public License along
141.1357 -+// with this library; see the file COPYING.  If not, write to the Free
141.1358 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.1359 -+// USA.
141.1360 -+
141.1361 -+// As a special exception, you may use this file as part of a free software
141.1362 -+// library without restriction.  Specifically, if other files instantiate
141.1363 -+// templates or use macros or inline functions from this file, or you compile
141.1364 -+// this file and link it with other files to produce an executable, this
141.1365 -+// file does not by itself cause the resulting executable to be covered by
141.1366 -+// the GNU General Public License.  This exception does not however
141.1367 -+// invalidate any other reasons why the executable file might be covered by
141.1368 -+// the GNU General Public License.
141.1369 -+
141.1370 -+//
141.1371 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
141.1372 -+//
141.1373 -+
141.1374 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.1375 -+
141.1376 -+#define _LIBC
141.1377 -+#include <locale>
141.1378 -+#undef _LIBC
141.1379 -+#include <bits/c++locale_internal.h>
141.1380 -+
141.1381 -+#ifdef __UCLIBC_MJN3_ONLY__
141.1382 -+#warning optimize this for uclibc
141.1383 -+#warning tailor for stub locale support
141.1384 -+#endif
141.1385 -+
141.1386 -+#ifndef __UCLIBC_HAS_XLOCALE__
141.1387 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
141.1388 -+#endif
141.1389 -+
141.1390 -+namespace std
141.1391 -+{
141.1392 -+  // Construct and return valid pattern consisting of some combination of:
141.1393 -+  // space none symbol sign value
141.1394 -+  money_base::pattern
141.1395 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
141.1396 -+  { 
141.1397 -+    pattern __ret;
141.1398 -+
141.1399 -+    // This insanely complicated routine attempts to construct a valid
141.1400 -+    // pattern for use with monyepunct. A couple of invariants:
141.1401 -+
141.1402 -+    // if (__precedes) symbol -> value
141.1403 -+    // else value -> symbol
141.1404 -+    
141.1405 -+    // if (__space) space
141.1406 -+    // else none
141.1407 -+
141.1408 -+    // none == never first
141.1409 -+    // space never first or last
141.1410 -+
141.1411 -+    // Any elegant implementations of this are welcome.
141.1412 -+    switch (__posn)
141.1413 -+      {
141.1414 -+      case 0:
141.1415 -+      case 1:
141.1416 -+	// 1 The sign precedes the value and symbol.
141.1417 -+	__ret.field[0] = sign;
141.1418 -+	if (__space)
141.1419 -+	  {
141.1420 -+	    // Pattern starts with sign.
141.1421 -+	    if (__precedes)
141.1422 -+	      {
141.1423 -+		__ret.field[1] = symbol;
141.1424 -+		__ret.field[3] = value;
141.1425 -+	      }
141.1426 -+	    else
141.1427 -+	      {
141.1428 -+		__ret.field[1] = value;
141.1429 -+		__ret.field[3] = symbol;
141.1430 -+	      }
141.1431 -+	    __ret.field[2] = space;
141.1432 -+	  }
141.1433 -+	else
141.1434 -+	  {
141.1435 -+	    // Pattern starts with sign and ends with none.
141.1436 -+	    if (__precedes)
141.1437 -+	      {
141.1438 -+		__ret.field[1] = symbol;
141.1439 -+		__ret.field[2] = value;
141.1440 -+	      }
141.1441 -+	    else
141.1442 -+	      {
141.1443 -+		__ret.field[1] = value;
141.1444 -+		__ret.field[2] = symbol;
141.1445 -+	      }
141.1446 -+	    __ret.field[3] = none;
141.1447 -+	  }
141.1448 -+	break;
141.1449 -+      case 2:
141.1450 -+	// 2 The sign follows the value and symbol.
141.1451 -+	if (__space)
141.1452 -+	  {
141.1453 -+	    // Pattern either ends with sign.
141.1454 -+	    if (__precedes)
141.1455 -+	      {
141.1456 -+		__ret.field[0] = symbol;
141.1457 -+		__ret.field[2] = value;
141.1458 -+	      }
141.1459 -+	    else
141.1460 -+	      {
141.1461 -+		__ret.field[0] = value;
141.1462 -+		__ret.field[2] = symbol;
141.1463 -+	      }
141.1464 -+	    __ret.field[1] = space;
141.1465 -+	    __ret.field[3] = sign;
141.1466 -+	  }
141.1467 -+	else
141.1468 -+	  {
141.1469 -+	    // Pattern ends with sign then none.
141.1470 -+	    if (__precedes)
141.1471 -+	      {
141.1472 -+		__ret.field[0] = symbol;
141.1473 -+		__ret.field[1] = value;
141.1474 -+	      }
141.1475 -+	    else
141.1476 -+	      {
141.1477 -+		__ret.field[0] = value;
141.1478 -+		__ret.field[1] = symbol;
141.1479 -+	      }
141.1480 -+	    __ret.field[2] = sign;
141.1481 -+	    __ret.field[3] = none;
141.1482 -+	  }
141.1483 -+	break;
141.1484 -+      case 3:
141.1485 -+	// 3 The sign immediately precedes the symbol.
141.1486 -+	if (__precedes)
141.1487 -+	  {
141.1488 -+	    __ret.field[0] = sign;
141.1489 -+	    __ret.field[1] = symbol;	    
141.1490 -+	    if (__space)
141.1491 -+	      {
141.1492 -+		__ret.field[2] = space;
141.1493 -+		__ret.field[3] = value;
141.1494 -+	      }
141.1495 -+	    else
141.1496 -+	      {
141.1497 -+		__ret.field[2] = value;		
141.1498 -+		__ret.field[3] = none;
141.1499 -+	      }
141.1500 -+	  }
141.1501 -+	else
141.1502 -+	  {
141.1503 -+	    __ret.field[0] = value;
141.1504 -+	    if (__space)
141.1505 -+	      {
141.1506 -+		__ret.field[1] = space;
141.1507 -+		__ret.field[2] = sign;
141.1508 -+		__ret.field[3] = symbol;
141.1509 -+	      }
141.1510 -+	    else
141.1511 -+	      {
141.1512 -+		__ret.field[1] = sign;
141.1513 -+		__ret.field[2] = symbol;
141.1514 -+		__ret.field[3] = none;
141.1515 -+	      }
141.1516 -+	  }
141.1517 -+	break;
141.1518 -+      case 4:
141.1519 -+	// 4 The sign immediately follows the symbol.
141.1520 -+	if (__precedes)
141.1521 -+	  {
141.1522 -+	    __ret.field[0] = symbol;
141.1523 -+	    __ret.field[1] = sign;
141.1524 -+	    if (__space)
141.1525 -+	      {
141.1526 -+		__ret.field[2] = space;
141.1527 -+		__ret.field[3] = value;
141.1528 -+	      }
141.1529 -+	    else
141.1530 -+	      {
141.1531 -+		__ret.field[2] = value;
141.1532 -+		__ret.field[3] = none;
141.1533 -+	      }
141.1534 -+	  }
141.1535 -+	else
141.1536 -+	  {
141.1537 -+	    __ret.field[0] = value;
141.1538 -+	    if (__space)
141.1539 -+	      {
141.1540 -+		__ret.field[1] = space;
141.1541 -+		__ret.field[2] = symbol;
141.1542 -+		__ret.field[3] = sign;
141.1543 -+	      }
141.1544 -+	    else
141.1545 -+	      {
141.1546 -+		__ret.field[1] = symbol;
141.1547 -+		__ret.field[2] = sign;
141.1548 -+		__ret.field[3] = none;
141.1549 -+	      }
141.1550 -+	  }
141.1551 -+	break;
141.1552 -+      default:
141.1553 -+	__ret = pattern();
141.1554 -+      }
141.1555 -+    return __ret;
141.1556 -+  }
141.1557 -+
141.1558 -+  template<> 
141.1559 -+    void
141.1560 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
141.1561 -+						     const char*)
141.1562 -+    {
141.1563 -+      if (!_M_data)
141.1564 -+	_M_data = new __moneypunct_cache<char, true>;
141.1565 -+
141.1566 -+      if (!__cloc)
141.1567 -+	{
141.1568 -+	  // "C" locale
141.1569 -+	  _M_data->_M_decimal_point = '.';
141.1570 -+	  _M_data->_M_thousands_sep = ',';
141.1571 -+	  _M_data->_M_grouping = "";
141.1572 -+	  _M_data->_M_grouping_size = 0;
141.1573 -+	  _M_data->_M_curr_symbol = "";
141.1574 -+	  _M_data->_M_curr_symbol_size = 0;
141.1575 -+	  _M_data->_M_positive_sign = "";
141.1576 -+	  _M_data->_M_positive_sign_size = 0;
141.1577 -+	  _M_data->_M_negative_sign = "";
141.1578 -+	  _M_data->_M_negative_sign_size = 0;
141.1579 -+	  _M_data->_M_frac_digits = 0;
141.1580 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
141.1581 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
141.1582 -+
141.1583 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
141.1584 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
141.1585 -+	}
141.1586 -+      else
141.1587 -+	{
141.1588 -+	  // Named locale.
141.1589 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
141.1590 -+							__cloc));
141.1591 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
141.1592 -+							__cloc));
141.1593 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
141.1594 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.1595 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
141.1596 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
141.1597 -+
141.1598 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
141.1599 -+	  if (!__nposn)
141.1600 -+	    _M_data->_M_negative_sign = "()";
141.1601 -+	  else
141.1602 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
141.1603 -+							__cloc);
141.1604 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
141.1605 -+
141.1606 -+	  // _Intl == true
141.1607 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
141.1608 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
141.1609 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
141.1610 -+						      __cloc));
141.1611 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
141.1612 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
141.1613 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
141.1614 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
141.1615 -+							__pposn);
141.1616 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
141.1617 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
141.1618 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
141.1619 -+							__nposn);
141.1620 -+	}
141.1621 -+    }
141.1622 -+
141.1623 -+  template<> 
141.1624 -+    void
141.1625 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
141.1626 -+						      const char*)
141.1627 -+    {
141.1628 -+      if (!_M_data)
141.1629 -+	_M_data = new __moneypunct_cache<char, false>;
141.1630 -+
141.1631 -+      if (!__cloc)
141.1632 -+	{
141.1633 -+	  // "C" locale
141.1634 -+	  _M_data->_M_decimal_point = '.';
141.1635 -+	  _M_data->_M_thousands_sep = ',';
141.1636 -+	  _M_data->_M_grouping = "";
141.1637 -+	  _M_data->_M_grouping_size = 0;
141.1638 -+	  _M_data->_M_curr_symbol = "";
141.1639 -+	  _M_data->_M_curr_symbol_size = 0;
141.1640 -+	  _M_data->_M_positive_sign = "";
141.1641 -+	  _M_data->_M_positive_sign_size = 0;
141.1642 -+	  _M_data->_M_negative_sign = "";
141.1643 -+	  _M_data->_M_negative_sign_size = 0;
141.1644 -+	  _M_data->_M_frac_digits = 0;
141.1645 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
141.1646 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
141.1647 -+
141.1648 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
141.1649 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
141.1650 -+	}
141.1651 -+      else
141.1652 -+	{
141.1653 -+	  // Named locale.
141.1654 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
141.1655 -+							__cloc));
141.1656 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
141.1657 -+							__cloc));
141.1658 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
141.1659 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.1660 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
141.1661 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
141.1662 -+
141.1663 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
141.1664 -+	  if (!__nposn)
141.1665 -+	    _M_data->_M_negative_sign = "()";
141.1666 -+	  else
141.1667 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
141.1668 -+							__cloc);
141.1669 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
141.1670 -+
141.1671 -+	  // _Intl == false
141.1672 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
141.1673 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
141.1674 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
141.1675 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
141.1676 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
141.1677 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
141.1678 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
141.1679 -+							__pposn);
141.1680 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
141.1681 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
141.1682 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
141.1683 -+							__nposn);
141.1684 -+	}
141.1685 -+    }
141.1686 -+
141.1687 -+  template<> 
141.1688 -+    moneypunct<char, true>::~moneypunct()
141.1689 -+    { delete _M_data; }
141.1690 -+
141.1691 -+  template<> 
141.1692 -+    moneypunct<char, false>::~moneypunct()
141.1693 -+    { delete _M_data; }
141.1694 -+
141.1695 -+#ifdef _GLIBCXX_USE_WCHAR_T
141.1696 -+  template<> 
141.1697 -+    void
141.1698 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
141.1699 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1700 -+							const char*)
141.1701 -+#else
141.1702 -+							const char* __name)
141.1703 -+#endif
141.1704 -+    {
141.1705 -+      if (!_M_data)
141.1706 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
141.1707 -+
141.1708 -+      if (!__cloc)
141.1709 -+	{
141.1710 -+	  // "C" locale
141.1711 -+	  _M_data->_M_decimal_point = L'.';
141.1712 -+	  _M_data->_M_thousands_sep = L',';
141.1713 -+	  _M_data->_M_grouping = "";
141.1714 -+	  _M_data->_M_grouping_size = 0;
141.1715 -+	  _M_data->_M_curr_symbol = L"";
141.1716 -+	  _M_data->_M_curr_symbol_size = 0;
141.1717 -+	  _M_data->_M_positive_sign = L"";
141.1718 -+	  _M_data->_M_positive_sign_size = 0;
141.1719 -+	  _M_data->_M_negative_sign = L"";
141.1720 -+	  _M_data->_M_negative_sign_size = 0;
141.1721 -+	  _M_data->_M_frac_digits = 0;
141.1722 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
141.1723 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
141.1724 -+
141.1725 -+	  // Use ctype::widen code without the facet...
141.1726 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
141.1727 -+	    _M_data->_M_atoms[__i] =
141.1728 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
141.1729 -+	}
141.1730 -+      else
141.1731 -+	{
141.1732 -+	  // Named locale.
141.1733 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1734 -+	  __c_locale __old = __uselocale(__cloc);
141.1735 -+#else
141.1736 -+	  // Switch to named locale so that mbsrtowcs will work.
141.1737 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
141.1738 -+	  setlocale(LC_ALL, __name);
141.1739 -+#endif
141.1740 -+
141.1741 -+#ifdef __UCLIBC_MJN3_ONLY__
141.1742 -+#warning fix this... should be monetary
141.1743 -+#endif
141.1744 -+#ifdef __UCLIBC__
141.1745 -+# ifdef __UCLIBC_HAS_XLOCALE__
141.1746 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
141.1747 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
141.1748 -+# else
141.1749 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
141.1750 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
141.1751 -+# endif
141.1752 -+#else
141.1753 -+	  union { char *__s; wchar_t __w; } __u;
141.1754 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
141.1755 -+	  _M_data->_M_decimal_point = __u.__w;
141.1756 -+
141.1757 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
141.1758 -+	  _M_data->_M_thousands_sep = __u.__w;
141.1759 -+#endif
141.1760 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
141.1761 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.1762 -+
141.1763 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
141.1764 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
141.1765 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
141.1766 -+
141.1767 -+	  wchar_t* __wcs_ps = 0;
141.1768 -+	  wchar_t* __wcs_ns = 0;
141.1769 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
141.1770 -+	  try
141.1771 -+	    {
141.1772 -+	      mbstate_t __state;
141.1773 -+	      size_t __len = strlen(__cpossign);
141.1774 -+	      if (__len)
141.1775 -+		{
141.1776 -+		  ++__len;
141.1777 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1778 -+		  __wcs_ps = new wchar_t[__len];
141.1779 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
141.1780 -+		  _M_data->_M_positive_sign = __wcs_ps;
141.1781 -+		}
141.1782 -+	      else
141.1783 -+		_M_data->_M_positive_sign = L"";
141.1784 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
141.1785 -+	      
141.1786 -+	      __len = strlen(__cnegsign);
141.1787 -+	      if (!__nposn)
141.1788 -+		_M_data->_M_negative_sign = L"()";
141.1789 -+	      else if (__len)
141.1790 -+		{ 
141.1791 -+		  ++__len;
141.1792 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1793 -+		  __wcs_ns = new wchar_t[__len];
141.1794 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
141.1795 -+		  _M_data->_M_negative_sign = __wcs_ns;
141.1796 -+		}
141.1797 -+	      else
141.1798 -+		_M_data->_M_negative_sign = L"";
141.1799 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
141.1800 -+	      
141.1801 -+	      // _Intl == true.
141.1802 -+	      __len = strlen(__ccurr);
141.1803 -+	      if (__len)
141.1804 -+		{
141.1805 -+		  ++__len;
141.1806 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1807 -+		  wchar_t* __wcs = new wchar_t[__len];
141.1808 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
141.1809 -+		  _M_data->_M_curr_symbol = __wcs;
141.1810 -+		}
141.1811 -+	      else
141.1812 -+		_M_data->_M_curr_symbol = L"";
141.1813 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
141.1814 -+	    }
141.1815 -+	  catch (...)
141.1816 -+	    {
141.1817 -+	      delete _M_data;
141.1818 -+	      _M_data = 0;
141.1819 -+	      delete __wcs_ps;
141.1820 -+	      delete __wcs_ns;	      
141.1821 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1822 -+	      __uselocale(__old);
141.1823 -+#else
141.1824 -+	      setlocale(LC_ALL, __old);
141.1825 -+	      free(__old);
141.1826 -+#endif
141.1827 -+	      __throw_exception_again;
141.1828 -+	    } 
141.1829 -+	  
141.1830 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
141.1831 -+						      __cloc));
141.1832 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
141.1833 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
141.1834 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
141.1835 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
141.1836 -+							__pposn);
141.1837 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
141.1838 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
141.1839 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
141.1840 -+							__nposn);
141.1841 -+
141.1842 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1843 -+	  __uselocale(__old);
141.1844 -+#else
141.1845 -+	  setlocale(LC_ALL, __old);
141.1846 -+	  free(__old);
141.1847 -+#endif
141.1848 -+	}
141.1849 -+    }
141.1850 -+
141.1851 -+  template<> 
141.1852 -+  void
141.1853 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
141.1854 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1855 -+						       const char*)
141.1856 -+#else
141.1857 -+                                                       const char* __name)
141.1858 -+#endif
141.1859 -+  {
141.1860 -+    if (!_M_data)
141.1861 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
141.1862 -+
141.1863 -+    if (!__cloc)
141.1864 -+	{
141.1865 -+	  // "C" locale
141.1866 -+	  _M_data->_M_decimal_point = L'.';
141.1867 -+	  _M_data->_M_thousands_sep = L',';
141.1868 -+	  _M_data->_M_grouping = "";
141.1869 -+          _M_data->_M_grouping_size = 0;
141.1870 -+	  _M_data->_M_curr_symbol = L"";
141.1871 -+	  _M_data->_M_curr_symbol_size = 0;
141.1872 -+	  _M_data->_M_positive_sign = L"";
141.1873 -+	  _M_data->_M_positive_sign_size = 0;
141.1874 -+	  _M_data->_M_negative_sign = L"";
141.1875 -+	  _M_data->_M_negative_sign_size = 0;
141.1876 -+	  _M_data->_M_frac_digits = 0;
141.1877 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
141.1878 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
141.1879 -+
141.1880 -+	  // Use ctype::widen code without the facet...
141.1881 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
141.1882 -+	    _M_data->_M_atoms[__i] =
141.1883 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
141.1884 -+	}
141.1885 -+      else
141.1886 -+	{
141.1887 -+	  // Named locale.
141.1888 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1889 -+	  __c_locale __old = __uselocale(__cloc);
141.1890 -+#else
141.1891 -+	  // Switch to named locale so that mbsrtowcs will work.
141.1892 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
141.1893 -+	  setlocale(LC_ALL, __name);
141.1894 -+#endif
141.1895 -+
141.1896 -+#ifdef __UCLIBC_MJN3_ONLY__
141.1897 -+#warning fix this... should be monetary
141.1898 -+#endif
141.1899 -+#ifdef __UCLIBC__
141.1900 -+# ifdef __UCLIBC_HAS_XLOCALE__
141.1901 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
141.1902 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
141.1903 -+# else
141.1904 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
141.1905 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
141.1906 -+# endif
141.1907 -+#else
141.1908 -+          union { char *__s; wchar_t __w; } __u;
141.1909 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
141.1910 -+	  _M_data->_M_decimal_point = __u.__w;
141.1911 -+
141.1912 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
141.1913 -+	  _M_data->_M_thousands_sep = __u.__w;
141.1914 -+#endif
141.1915 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
141.1916 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.1917 -+
141.1918 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
141.1919 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
141.1920 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
141.1921 -+
141.1922 -+	  wchar_t* __wcs_ps = 0;
141.1923 -+	  wchar_t* __wcs_ns = 0;
141.1924 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
141.1925 -+	  try
141.1926 -+            {
141.1927 -+              mbstate_t __state;
141.1928 -+              size_t __len;
141.1929 -+              __len = strlen(__cpossign);
141.1930 -+              if (__len)
141.1931 -+                {
141.1932 -+		  ++__len;
141.1933 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1934 -+		  __wcs_ps = new wchar_t[__len];
141.1935 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
141.1936 -+		  _M_data->_M_positive_sign = __wcs_ps;
141.1937 -+		}
141.1938 -+	      else
141.1939 -+		_M_data->_M_positive_sign = L"";
141.1940 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
141.1941 -+	      
141.1942 -+	      __len = strlen(__cnegsign);
141.1943 -+	      if (!__nposn)
141.1944 -+		_M_data->_M_negative_sign = L"()";
141.1945 -+	      else if (__len)
141.1946 -+		{ 
141.1947 -+		  ++__len;
141.1948 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1949 -+		  __wcs_ns = new wchar_t[__len];
141.1950 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
141.1951 -+		  _M_data->_M_negative_sign = __wcs_ns;
141.1952 -+		}
141.1953 -+	      else
141.1954 -+		_M_data->_M_negative_sign = L"";
141.1955 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
141.1956 -+
141.1957 -+	      // _Intl == true.
141.1958 -+	      __len = strlen(__ccurr);
141.1959 -+	      if (__len)
141.1960 -+		{
141.1961 -+		  ++__len;
141.1962 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1963 -+		  wchar_t* __wcs = new wchar_t[__len];
141.1964 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
141.1965 -+		  _M_data->_M_curr_symbol = __wcs;
141.1966 -+		}
141.1967 -+	      else
141.1968 -+		_M_data->_M_curr_symbol = L"";
141.1969 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
141.1970 -+	    }
141.1971 -+          catch (...)
141.1972 -+	    {
141.1973 -+	      delete _M_data;
141.1974 -+              _M_data = 0;
141.1975 -+	      delete __wcs_ps;
141.1976 -+	      delete __wcs_ns;	      
141.1977 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1978 -+	      __uselocale(__old);
141.1979 -+#else
141.1980 -+	      setlocale(LC_ALL, __old);
141.1981 -+	      free(__old);
141.1982 -+#endif
141.1983 -+              __throw_exception_again;
141.1984 -+	    }
141.1985 -+
141.1986 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
141.1987 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
141.1988 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
141.1989 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
141.1990 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
141.1991 -+	                                                __pposn);
141.1992 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
141.1993 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
141.1994 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
141.1995 -+	                                                __nposn);
141.1996 -+
141.1997 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1998 -+	  __uselocale(__old);
141.1999 -+#else
141.2000 -+	  setlocale(LC_ALL, __old);
141.2001 -+	  free(__old);
141.2002 -+#endif
141.2003 -+	}
141.2004 -+    }
141.2005 -+
141.2006 -+  template<> 
141.2007 -+    moneypunct<wchar_t, true>::~moneypunct()
141.2008 -+    {
141.2009 -+      if (_M_data->_M_positive_sign_size)
141.2010 -+	delete [] _M_data->_M_positive_sign;
141.2011 -+      if (_M_data->_M_negative_sign_size
141.2012 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
141.2013 -+	delete [] _M_data->_M_negative_sign;
141.2014 -+      if (_M_data->_M_curr_symbol_size)
141.2015 -+	delete [] _M_data->_M_curr_symbol;
141.2016 -+      delete _M_data;
141.2017 -+    }
141.2018 -+
141.2019 -+  template<> 
141.2020 -+    moneypunct<wchar_t, false>::~moneypunct()
141.2021 -+    {
141.2022 -+      if (_M_data->_M_positive_sign_size)
141.2023 -+	delete [] _M_data->_M_positive_sign;
141.2024 -+      if (_M_data->_M_negative_sign_size
141.2025 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
141.2026 -+	delete [] _M_data->_M_negative_sign;
141.2027 -+      if (_M_data->_M_curr_symbol_size)
141.2028 -+	delete [] _M_data->_M_curr_symbol;
141.2029 -+      delete _M_data;
141.2030 -+    }
141.2031 -+#endif
141.2032 -+}
141.2033 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
141.2034 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1969-12-31 18:00:00.000000000 -0600
141.2035 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2005-04-28 01:20:20.000000000 -0500
141.2036 -@@ -0,0 +1,173 @@
141.2037 -+// std::numpunct implementation details, GNU version -*- C++ -*-
141.2038 -+
141.2039 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
141.2040 -+//
141.2041 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.2042 -+// software; you can redistribute it and/or modify it under the
141.2043 -+// terms of the GNU General Public License as published by the
141.2044 -+// Free Software Foundation; either version 2, or (at your option)
141.2045 -+// any later version.
141.2046 -+
141.2047 -+// This library is distributed in the hope that it will be useful,
141.2048 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.2049 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.2050 -+// GNU General Public License for more details.
141.2051 -+
141.2052 -+// You should have received a copy of the GNU General Public License along
141.2053 -+// with this library; see the file COPYING.  If not, write to the Free
141.2054 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.2055 -+// USA.
141.2056 -+
141.2057 -+// As a special exception, you may use this file as part of a free software
141.2058 -+// library without restriction.  Specifically, if other files instantiate
141.2059 -+// templates or use macros or inline functions from this file, or you compile
141.2060 -+// this file and link it with other files to produce an executable, this
141.2061 -+// file does not by itself cause the resulting executable to be covered by
141.2062 -+// the GNU General Public License.  This exception does not however
141.2063 -+// invalidate any other reasons why the executable file might be covered by
141.2064 -+// the GNU General Public License.
141.2065 -+
141.2066 -+//
141.2067 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
141.2068 -+//
141.2069 -+
141.2070 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.2071 -+
141.2072 -+#define _LIBC
141.2073 -+#include <locale>
141.2074 -+#undef _LIBC
141.2075 -+#include <bits/c++locale_internal.h>
141.2076 -+
141.2077 -+#ifdef __UCLIBC_MJN3_ONLY__
141.2078 -+#warning tailor for stub locale support
141.2079 -+#endif
141.2080 -+#ifndef __UCLIBC_HAS_XLOCALE__
141.2081 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
141.2082 -+#endif
141.2083 -+
141.2084 -+namespace std
141.2085 -+{
141.2086 -+  template<> 
141.2087 -+    void
141.2088 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
141.2089 -+    {
141.2090 -+      if (!_M_data)
141.2091 -+	_M_data = new __numpunct_cache<char>;
141.2092 -+
141.2093 -+      if (!__cloc)
141.2094 -+	{
141.2095 -+	  // "C" locale
141.2096 -+	  _M_data->_M_grouping = "";
141.2097 -+	  _M_data->_M_grouping_size = 0;
141.2098 -+	  _M_data->_M_use_grouping = false;
141.2099 -+
141.2100 -+	  _M_data->_M_decimal_point = '.';
141.2101 -+	  _M_data->_M_thousands_sep = ',';
141.2102 -+
141.2103 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
141.2104 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
141.2105 -+
141.2106 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
141.2107 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
141.2108 -+	}
141.2109 -+      else
141.2110 -+	{
141.2111 -+	  // Named locale.
141.2112 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
141.2113 -+							__cloc));
141.2114 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
141.2115 -+							__cloc));
141.2116 -+
141.2117 -+	  // Check for NULL, which implies no grouping.
141.2118 -+	  if (_M_data->_M_thousands_sep == '\0')
141.2119 -+	    _M_data->_M_grouping = "";
141.2120 -+	  else
141.2121 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
141.2122 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.2123 -+	}
141.2124 -+
141.2125 -+      // NB: There is no way to extact this info from posix locales.
141.2126 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
141.2127 -+      _M_data->_M_truename = "true";
141.2128 -+      _M_data->_M_truename_size = 4;
141.2129 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
141.2130 -+      _M_data->_M_falsename = "false";
141.2131 -+      _M_data->_M_falsename_size = 5;
141.2132 -+    }
141.2133 -+ 
141.2134 -+  template<> 
141.2135 -+    numpunct<char>::~numpunct()
141.2136 -+    { delete _M_data; }
141.2137 -+   
141.2138 -+#ifdef _GLIBCXX_USE_WCHAR_T
141.2139 -+  template<> 
141.2140 -+    void
141.2141 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
141.2142 -+    {
141.2143 -+      if (!_M_data)
141.2144 -+	_M_data = new __numpunct_cache<wchar_t>;
141.2145 -+
141.2146 -+      if (!__cloc)
141.2147 -+	{
141.2148 -+	  // "C" locale
141.2149 -+	  _M_data->_M_grouping = "";
141.2150 -+	  _M_data->_M_grouping_size = 0;
141.2151 -+	  _M_data->_M_use_grouping = false;
141.2152 -+
141.2153 -+	  _M_data->_M_decimal_point = L'.';
141.2154 -+	  _M_data->_M_thousands_sep = L',';
141.2155 -+
141.2156 -+	  // Use ctype::widen code without the facet...
141.2157 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
141.2158 -+	    _M_data->_M_atoms_out[__i] =
141.2159 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
141.2160 -+
141.2161 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
141.2162 -+	    _M_data->_M_atoms_in[__j] =
141.2163 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
141.2164 -+	}
141.2165 -+      else
141.2166 -+	{
141.2167 -+	  // Named locale.
141.2168 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
141.2169 -+#ifdef __UCLIBC_MJN3_ONLY__
141.2170 -+#warning fix this
141.2171 -+#endif
141.2172 -+#ifdef __UCLIBC__
141.2173 -+# ifdef __UCLIBC_HAS_XLOCALE__
141.2174 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
141.2175 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
141.2176 -+# else
141.2177 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
141.2178 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
141.2179 -+# endif
141.2180 -+#else
141.2181 -+	  union { char *__s; wchar_t __w; } __u;
141.2182 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
141.2183 -+	  _M_data->_M_decimal_point = __u.__w;
141.2184 -+
141.2185 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
141.2186 -+	  _M_data->_M_thousands_sep = __u.__w;
141.2187 -+#endif
141.2188 -+
141.2189 -+	  if (_M_data->_M_thousands_sep == L'\0')
141.2190 -+	    _M_data->_M_grouping = "";
141.2191 -+	  else
141.2192 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
141.2193 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.2194 -+	}
141.2195 -+
141.2196 -+      // NB: There is no way to extact this info from posix locales.
141.2197 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
141.2198 -+      _M_data->_M_truename = L"true";
141.2199 -+      _M_data->_M_truename_size = 4;
141.2200 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
141.2201 -+      _M_data->_M_falsename = L"false";
141.2202 -+      _M_data->_M_falsename_size = 5;
141.2203 -+    }
141.2204 -+
141.2205 -+  template<> 
141.2206 -+    numpunct<wchar_t>::~numpunct()
141.2207 -+    { delete _M_data; }
141.2208 -+ #endif
141.2209 -+}
141.2210 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.cc
141.2211 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.cc	1969-12-31 18:00:00.000000000 -0600
141.2212 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2005-04-28 01:13:15.000000000 -0500
141.2213 -@@ -0,0 +1,406 @@
141.2214 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
141.2215 -+
141.2216 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
141.2217 -+//
141.2218 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.2219 -+// software; you can redistribute it and/or modify it under the
141.2220 -+// terms of the GNU General Public License as published by the
141.2221 -+// Free Software Foundation; either version 2, or (at your option)
141.2222 -+// any later version.
141.2223 -+
141.2224 -+// This library is distributed in the hope that it will be useful,
141.2225 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.2226 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.2227 -+// GNU General Public License for more details.
141.2228 -+
141.2229 -+// You should have received a copy of the GNU General Public License along
141.2230 -+// with this library; see the file COPYING.  If not, write to the Free
141.2231 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.2232 -+// USA.
141.2233 -+
141.2234 -+// As a special exception, you may use this file as part of a free software
141.2235 -+// library without restriction.  Specifically, if other files instantiate
141.2236 -+// templates or use macros or inline functions from this file, or you compile
141.2237 -+// this file and link it with other files to produce an executable, this
141.2238 -+// file does not by itself cause the resulting executable to be covered by
141.2239 -+// the GNU General Public License.  This exception does not however
141.2240 -+// invalidate any other reasons why the executable file might be covered by
141.2241 -+// the GNU General Public License.
141.2242 -+
141.2243 -+//
141.2244 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
141.2245 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
141.2246 -+//
141.2247 -+
141.2248 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.2249 -+
141.2250 -+#include <locale>
141.2251 -+#include <bits/c++locale_internal.h>
141.2252 -+
141.2253 -+#ifdef __UCLIBC_MJN3_ONLY__
141.2254 -+#warning tailor for stub locale support
141.2255 -+#endif
141.2256 -+#ifndef __UCLIBC_HAS_XLOCALE__
141.2257 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
141.2258 -+#endif
141.2259 -+
141.2260 -+namespace std
141.2261 -+{
141.2262 -+  template<>
141.2263 -+    void
141.2264 -+    __timepunct<char>::
141.2265 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
141.2266 -+	   const tm* __tm) const
141.2267 -+    {
141.2268 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.2269 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
141.2270 -+					_M_c_locale_timepunct);
141.2271 -+#else
141.2272 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
141.2273 -+      setlocale(LC_ALL, _M_name_timepunct);
141.2274 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
141.2275 -+      setlocale(LC_ALL, __old);
141.2276 -+      free(__old);
141.2277 -+#endif
141.2278 -+      // Make sure __s is null terminated.
141.2279 -+      if (__len == 0)
141.2280 -+	__s[0] = '\0';
141.2281 -+    }
141.2282 -+
141.2283 -+  template<> 
141.2284 -+    void
141.2285 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
141.2286 -+    {
141.2287 -+      if (!_M_data)
141.2288 -+	_M_data = new __timepunct_cache<char>;
141.2289 -+
141.2290 -+      if (!__cloc)
141.2291 -+	{
141.2292 -+	  // "C" locale
141.2293 -+	  _M_c_locale_timepunct = _S_get_c_locale();
141.2294 -+
141.2295 -+	  _M_data->_M_date_format = "%m/%d/%y";
141.2296 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
141.2297 -+	  _M_data->_M_time_format = "%H:%M:%S";
141.2298 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
141.2299 -+	  _M_data->_M_date_time_format = "";
141.2300 -+	  _M_data->_M_date_time_era_format = "";
141.2301 -+	  _M_data->_M_am = "AM";
141.2302 -+	  _M_data->_M_pm = "PM";
141.2303 -+	  _M_data->_M_am_pm_format = "";
141.2304 -+
141.2305 -+	  // Day names, starting with "C"'s Sunday.
141.2306 -+	  _M_data->_M_day1 = "Sunday";
141.2307 -+	  _M_data->_M_day2 = "Monday";
141.2308 -+	  _M_data->_M_day3 = "Tuesday";
141.2309 -+	  _M_data->_M_day4 = "Wednesday";
141.2310 -+	  _M_data->_M_day5 = "Thursday";
141.2311 -+	  _M_data->_M_day6 = "Friday";
141.2312 -+	  _M_data->_M_day7 = "Saturday";
141.2313 -+
141.2314 -+	  // Abbreviated day names, starting with "C"'s Sun.
141.2315 -+	  _M_data->_M_aday1 = "Sun";
141.2316 -+	  _M_data->_M_aday2 = "Mon";
141.2317 -+	  _M_data->_M_aday3 = "Tue";
141.2318 -+	  _M_data->_M_aday4 = "Wed";
141.2319 -+	  _M_data->_M_aday5 = "Thu";
141.2320 -+	  _M_data->_M_aday6 = "Fri";
141.2321 -+	  _M_data->_M_aday7 = "Sat";
141.2322 -+
141.2323 -+	  // Month names, starting with "C"'s January.
141.2324 -+	  _M_data->_M_month01 = "January";
141.2325 -+	  _M_data->_M_month02 = "February";
141.2326 -+	  _M_data->_M_month03 = "March";
141.2327 -+	  _M_data->_M_month04 = "April";
141.2328 -+	  _M_data->_M_month05 = "May";
141.2329 -+	  _M_data->_M_month06 = "June";
141.2330 -+	  _M_data->_M_month07 = "July";
141.2331 -+	  _M_data->_M_month08 = "August";
141.2332 -+	  _M_data->_M_month09 = "September";
141.2333 -+	  _M_data->_M_month10 = "October";
141.2334 -+	  _M_data->_M_month11 = "November";
141.2335 -+	  _M_data->_M_month12 = "December";
141.2336 -+
141.2337 -+	  // Abbreviated month names, starting with "C"'s Jan.
141.2338 -+	  _M_data->_M_amonth01 = "Jan";
141.2339 -+	  _M_data->_M_amonth02 = "Feb";
141.2340 -+	  _M_data->_M_amonth03 = "Mar";
141.2341 -+	  _M_data->_M_amonth04 = "Apr";
141.2342 -+	  _M_data->_M_amonth05 = "May";
141.2343 -+	  _M_data->_M_amonth06 = "Jun";
141.2344 -+	  _M_data->_M_amonth07 = "Jul";
141.2345 -+	  _M_data->_M_amonth08 = "Aug";
141.2346 -+	  _M_data->_M_amonth09 = "Sep";
141.2347 -+	  _M_data->_M_amonth10 = "Oct";
141.2348 -+	  _M_data->_M_amonth11 = "Nov";
141.2349 -+	  _M_data->_M_amonth12 = "Dec";
141.2350 -+	}
141.2351 -+      else
141.2352 -+	{
141.2353 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
141.2354 -+
141.2355 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
141.2356 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
141.2357 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
141.2358 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
141.2359 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
141.2360 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
141.2361 -+							     __cloc);
141.2362 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
141.2363 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
141.2364 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
141.2365 -+
141.2366 -+	  // Day names, starting with "C"'s Sunday.
141.2367 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
141.2368 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
141.2369 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
141.2370 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
141.2371 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
141.2372 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
141.2373 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
141.2374 -+
141.2375 -+	  // Abbreviated day names, starting with "C"'s Sun.
141.2376 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
141.2377 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
141.2378 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
141.2379 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
141.2380 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
141.2381 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
141.2382 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
141.2383 -+
141.2384 -+	  // Month names, starting with "C"'s January.
141.2385 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
141.2386 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
141.2387 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
141.2388 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
141.2389 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
141.2390 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
141.2391 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
141.2392 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
141.2393 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
141.2394 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
141.2395 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
141.2396 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
141.2397 -+
141.2398 -+	  // Abbreviated month names, starting with "C"'s Jan.
141.2399 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
141.2400 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
141.2401 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
141.2402 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
141.2403 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
141.2404 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
141.2405 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
141.2406 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
141.2407 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
141.2408 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
141.2409 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
141.2410 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
141.2411 -+	}
141.2412 -+    }
141.2413 -+
141.2414 -+#ifdef _GLIBCXX_USE_WCHAR_T
141.2415 -+  template<>
141.2416 -+    void
141.2417 -+    __timepunct<wchar_t>::
141.2418 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
141.2419 -+	   const tm* __tm) const
141.2420 -+    {
141.2421 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.2422 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
141.2423 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
141.2424 -+					_M_c_locale_timepunct);
141.2425 -+#else
141.2426 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
141.2427 -+      setlocale(LC_ALL, _M_name_timepunct);
141.2428 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
141.2429 -+      setlocale(LC_ALL, __old);
141.2430 -+      free(__old);
141.2431 -+#endif
141.2432 -+      // Make sure __s is null terminated.
141.2433 -+      if (__len == 0)
141.2434 -+	__s[0] = L'\0';
141.2435 -+    }
141.2436 -+
141.2437 -+  template<> 
141.2438 -+    void
141.2439 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
141.2440 -+    {
141.2441 -+      if (!_M_data)
141.2442 -+	_M_data = new __timepunct_cache<wchar_t>;
141.2443 -+
141.2444 -+#warning wide time stuff
141.2445 -+//       if (!__cloc)
141.2446 -+	{
141.2447 -+	  // "C" locale
141.2448 -+	  _M_c_locale_timepunct = _S_get_c_locale();
141.2449 -+
141.2450 -+	  _M_data->_M_date_format = L"%m/%d/%y";
141.2451 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
141.2452 -+	  _M_data->_M_time_format = L"%H:%M:%S";
141.2453 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
141.2454 -+	  _M_data->_M_date_time_format = L"";
141.2455 -+	  _M_data->_M_date_time_era_format = L"";
141.2456 -+	  _M_data->_M_am = L"AM";
141.2457 -+	  _M_data->_M_pm = L"PM";
141.2458 -+	  _M_data->_M_am_pm_format = L"";
141.2459 -+
141.2460 -+	  // Day names, starting with "C"'s Sunday.
141.2461 -+	  _M_data->_M_day1 = L"Sunday";
141.2462 -+	  _M_data->_M_day2 = L"Monday";
141.2463 -+	  _M_data->_M_day3 = L"Tuesday";
141.2464 -+	  _M_data->_M_day4 = L"Wednesday";
141.2465 -+	  _M_data->_M_day5 = L"Thursday";
141.2466 -+	  _M_data->_M_day6 = L"Friday";
141.2467 -+	  _M_data->_M_day7 = L"Saturday";
141.2468 -+
141.2469 -+	  // Abbreviated day names, starting with "C"'s Sun.
141.2470 -+	  _M_data->_M_aday1 = L"Sun";
141.2471 -+	  _M_data->_M_aday2 = L"Mon";
141.2472 -+	  _M_data->_M_aday3 = L"Tue";
141.2473 -+	  _M_data->_M_aday4 = L"Wed";
141.2474 -+	  _M_data->_M_aday5 = L"Thu";
141.2475 -+	  _M_data->_M_aday6 = L"Fri";
141.2476 -+	  _M_data->_M_aday7 = L"Sat";
141.2477 -+
141.2478 -+	  // Month names, starting with "C"'s January.
141.2479 -+	  _M_data->_M_month01 = L"January";
141.2480 -+	  _M_data->_M_month02 = L"February";
141.2481 -+	  _M_data->_M_month03 = L"March";
141.2482 -+	  _M_data->_M_month04 = L"April";
141.2483 -+	  _M_data->_M_month05 = L"May";
141.2484 -+	  _M_data->_M_month06 = L"June";
141.2485 -+	  _M_data->_M_month07 = L"July";
141.2486 -+	  _M_data->_M_month08 = L"August";
141.2487 -+	  _M_data->_M_month09 = L"September";
141.2488 -+	  _M_data->_M_month10 = L"October";
141.2489 -+	  _M_data->_M_month11 = L"November";
141.2490 -+	  _M_data->_M_month12 = L"December";
141.2491 -+
141.2492 -+	  // Abbreviated month names, starting with "C"'s Jan.
141.2493 -+	  _M_data->_M_amonth01 = L"Jan";
141.2494 -+	  _M_data->_M_amonth02 = L"Feb";
141.2495 -+	  _M_data->_M_amonth03 = L"Mar";
141.2496 -+	  _M_data->_M_amonth04 = L"Apr";
141.2497 -+	  _M_data->_M_amonth05 = L"May";
141.2498 -+	  _M_data->_M_amonth06 = L"Jun";
141.2499 -+	  _M_data->_M_amonth07 = L"Jul";
141.2500 -+	  _M_data->_M_amonth08 = L"Aug";
141.2501 -+	  _M_data->_M_amonth09 = L"Sep";
141.2502 -+	  _M_data->_M_amonth10 = L"Oct";
141.2503 -+	  _M_data->_M_amonth11 = L"Nov";
141.2504 -+	  _M_data->_M_amonth12 = L"Dec";
141.2505 -+	}
141.2506 -+#if 0
141.2507 -+      else
141.2508 -+	{
141.2509 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
141.2510 -+
141.2511 -+	  union { char *__s; wchar_t *__w; } __u;
141.2512 -+
141.2513 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
141.2514 -+	  _M_data->_M_date_format = __u.__w;
141.2515 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
141.2516 -+	  _M_data->_M_date_era_format = __u.__w;
141.2517 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
141.2518 -+	  _M_data->_M_time_format = __u.__w;
141.2519 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
141.2520 -+	  _M_data->_M_time_era_format = __u.__w;
141.2521 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
141.2522 -+	  _M_data->_M_date_time_format = __u.__w;
141.2523 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
141.2524 -+	  _M_data->_M_date_time_era_format = __u.__w;
141.2525 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
141.2526 -+	  _M_data->_M_am = __u.__w;
141.2527 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
141.2528 -+	  _M_data->_M_pm = __u.__w;
141.2529 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
141.2530 -+	  _M_data->_M_am_pm_format = __u.__w;
141.2531 -+
141.2532 -+	  // Day names, starting with "C"'s Sunday.
141.2533 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
141.2534 -+	  _M_data->_M_day1 = __u.__w;
141.2535 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
141.2536 -+	  _M_data->_M_day2 = __u.__w;
141.2537 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
141.2538 -+	  _M_data->_M_day3 = __u.__w;
141.2539 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
141.2540 -+	  _M_data->_M_day4 = __u.__w;
141.2541 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
141.2542 -+	  _M_data->_M_day5 = __u.__w;
141.2543 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
141.2544 -+	  _M_data->_M_day6 = __u.__w;
141.2545 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
141.2546 -+	  _M_data->_M_day7 = __u.__w;
141.2547 -+
141.2548 -+	  // Abbreviated day names, starting with "C"'s Sun.
141.2549 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
141.2550 -+	  _M_data->_M_aday1 = __u.__w;
141.2551 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
141.2552 -+	  _M_data->_M_aday2 = __u.__w;
141.2553 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
141.2554 -+	  _M_data->_M_aday3 = __u.__w;
141.2555 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
141.2556 -+	  _M_data->_M_aday4 = __u.__w;
141.2557 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
141.2558 -+	  _M_data->_M_aday5 = __u.__w;
141.2559 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
141.2560 -+	  _M_data->_M_aday6 = __u.__w;
141.2561 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
141.2562 -+	  _M_data->_M_aday7 = __u.__w;
141.2563 -+
141.2564 -+	  // Month names, starting with "C"'s January.
141.2565 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
141.2566 -+	  _M_data->_M_month01 = __u.__w;
141.2567 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
141.2568 -+	  _M_data->_M_month02 = __u.__w;
141.2569 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
141.2570 -+	  _M_data->_M_month03 = __u.__w;
141.2571 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
141.2572 -+	  _M_data->_M_month04 = __u.__w;
141.2573 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
141.2574 -+	  _M_data->_M_month05 = __u.__w;
141.2575 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
141.2576 -+	  _M_data->_M_month06 = __u.__w;
141.2577 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
141.2578 -+	  _M_data->_M_month07 = __u.__w;
141.2579 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
141.2580 -+	  _M_data->_M_month08 = __u.__w;
141.2581 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
141.2582 -+	  _M_data->_M_month09 = __u.__w;
141.2583 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
141.2584 -+	  _M_data->_M_month10 = __u.__w;
141.2585 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
141.2586 -+	  _M_data->_M_month11 = __u.__w;
141.2587 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
141.2588 -+	  _M_data->_M_month12 = __u.__w;
141.2589 -+
141.2590 -+	  // Abbreviated month names, starting with "C"'s Jan.
141.2591 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
141.2592 -+	  _M_data->_M_amonth01 = __u.__w;
141.2593 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
141.2594 -+	  _M_data->_M_amonth02 = __u.__w;
141.2595 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
141.2596 -+	  _M_data->_M_amonth03 = __u.__w;
141.2597 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
141.2598 -+	  _M_data->_M_amonth04 = __u.__w;
141.2599 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
141.2600 -+	  _M_data->_M_amonth05 = __u.__w;
141.2601 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
141.2602 -+	  _M_data->_M_amonth06 = __u.__w;
141.2603 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
141.2604 -+	  _M_data->_M_amonth07 = __u.__w;
141.2605 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
141.2606 -+	  _M_data->_M_amonth08 = __u.__w;
141.2607 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
141.2608 -+	  _M_data->_M_amonth09 = __u.__w;
141.2609 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
141.2610 -+	  _M_data->_M_amonth10 = __u.__w;
141.2611 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
141.2612 -+	  _M_data->_M_amonth11 = __u.__w;
141.2613 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
141.2614 -+	  _M_data->_M_amonth12 = __u.__w;
141.2615 -+	}
141.2616 -+#endif // 0
141.2617 -+    }
141.2618 -+#endif
141.2619 -+}
141.2620 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.h
141.2621 ---- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.h	1969-12-31 18:00:00.000000000 -0600
141.2622 -+++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.h	2004-05-22 18:46:31.000000000 -0500
141.2623 -@@ -0,0 +1,68 @@
141.2624 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
141.2625 -+
141.2626 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
141.2627 -+//
141.2628 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.2629 -+// software; you can redistribute it and/or modify it under the
141.2630 -+// terms of the GNU General Public License as published by the
141.2631 -+// Free Software Foundation; either version 2, or (at your option)
141.2632 -+// any later version.
141.2633 -+
141.2634 -+// This library is distributed in the hope that it will be useful,
141.2635 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.2636 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.2637 -+// GNU General Public License for more details.
141.2638 -+
141.2639 -+// You should have received a copy of the GNU General Public License along
141.2640 -+// with this library; see the file COPYING.  If not, write to the Free
141.2641 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.2642 -+// USA.
141.2643 -+
141.2644 -+// As a special exception, you may use this file as part of a free software
141.2645 -+// library without restriction.  Specifically, if other files instantiate
141.2646 -+// templates or use macros or inline functions from this file, or you compile
141.2647 -+// this file and link it with other files to produce an executable, this
141.2648 -+// file does not by itself cause the resulting executable to be covered by
141.2649 -+// the GNU General Public License.  This exception does not however
141.2650 -+// invalidate any other reasons why the executable file might be covered by
141.2651 -+// the GNU General Public License.
141.2652 -+
141.2653 -+//
141.2654 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
141.2655 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
141.2656 -+//
141.2657 -+
141.2658 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.2659 -+
141.2660 -+  template<typename _CharT>
141.2661 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
141.2662 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
141.2663 -+    _M_name_timepunct(_S_get_c_name())
141.2664 -+    { _M_initialize_timepunct(); }
141.2665 -+
141.2666 -+  template<typename _CharT>
141.2667 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
141.2668 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
141.2669 -+    _M_name_timepunct(_S_get_c_name())
141.2670 -+    { _M_initialize_timepunct(); }
141.2671 -+
141.2672 -+  template<typename _CharT>
141.2673 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
141.2674 -+				     size_t __refs) 
141.2675 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
141.2676 -+    _M_name_timepunct(__s)
141.2677 -+    { 
141.2678 -+      char* __tmp = new char[std::strlen(__s) + 1];
141.2679 -+      std::strcpy(__tmp, __s);
141.2680 -+      _M_name_timepunct = __tmp;
141.2681 -+      _M_initialize_timepunct(__cloc); 
141.2682 -+    }
141.2683 -+
141.2684 -+  template<typename _CharT>
141.2685 -+    __timepunct<_CharT>::~__timepunct()
141.2686 -+    { 
141.2687 -+      if (_M_name_timepunct != _S_get_c_name())
141.2688 -+	delete [] _M_name_timepunct;
141.2689 -+      delete _M_data; 
141.2690 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
141.2691 -+    }
141.2692 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_base.h
141.2693 ---- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_base.h	1969-12-31 18:00:00.000000000 -0600
141.2694 -+++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_base.h	2005-04-28 01:10:27.000000000 -0500
141.2695 -@@ -0,0 +1,64 @@
141.2696 -+// Locale support -*- C++ -*-
141.2697 -+
141.2698 -+// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
141.2699 -+// Free Software Foundation, Inc.
141.2700 -+//
141.2701 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.2702 -+// software; you can redistribute it and/or modify it under the
141.2703 -+// terms of the GNU General Public License as published by the
141.2704 -+// Free Software Foundation; either version 2, or (at your option)
141.2705 -+// any later version.
141.2706 -+
141.2707 -+// This library is distributed in the hope that it will be useful,
141.2708 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.2709 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.2710 -+// GNU General Public License for more details.
141.2711 -+
141.2712 -+// You should have received a copy of the GNU General Public License along
141.2713 -+// with this library; see the file COPYING.  If not, write to the Free
141.2714 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.2715 -+// USA.
141.2716 -+
141.2717 -+// As a special exception, you may use this file as part of a free software
141.2718 -+// library without restriction.  Specifically, if other files instantiate
141.2719 -+// templates or use macros or inline functions from this file, or you compile
141.2720 -+// this file and link it with other files to produce an executable, this
141.2721 -+// file does not by itself cause the resulting executable to be covered by
141.2722 -+// the GNU General Public License.  This exception does not however
141.2723 -+// invalidate any other reasons why the executable file might be covered by
141.2724 -+// the GNU General Public License.
141.2725 -+
141.2726 -+//
141.2727 -+// ISO C++ 14882: 22.1  Locales
141.2728 -+//
141.2729 -+  
141.2730 -+/** @file ctype_base.h
141.2731 -+ *  This is an internal header file, included by other library headers.
141.2732 -+ *  You should not attempt to use it directly.
141.2733 -+ */
141.2734 -+
141.2735 -+// Information as gleaned from /usr/include/ctype.h
141.2736 -+  
141.2737 -+  /// @brief  Base class for ctype.
141.2738 -+  struct ctype_base
141.2739 -+  {
141.2740 -+    // Note: In uClibc, the following two types depend on configuration.
141.2741 -+ 
141.2742 -+    // Non-standard typedefs.
141.2743 -+    typedef const __ctype_touplow_t* __to_type;
141.2744 -+
141.2745 -+    // NB: Offsets into ctype<char>::_M_table force a particular size
141.2746 -+    // on the mask type. Because of this, we don't use an enum.
141.2747 -+    typedef __ctype_mask_t	mask;   
141.2748 -+    static const mask upper    	= _ISupper;
141.2749 -+    static const mask lower 	= _ISlower;
141.2750 -+    static const mask alpha 	= _ISalpha;
141.2751 -+    static const mask digit 	= _ISdigit;
141.2752 -+    static const mask xdigit 	= _ISxdigit;
141.2753 -+    static const mask space 	= _ISspace;
141.2754 -+    static const mask print 	= _ISprint;
141.2755 -+    static const mask graph 	= _ISalpha | _ISdigit | _ISpunct;
141.2756 -+    static const mask cntrl 	= _IScntrl;
141.2757 -+    static const mask punct 	= _ISpunct;
141.2758 -+    static const mask alnum 	= _ISalpha | _ISdigit;
141.2759 -+  };
141.2760 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
141.2761 ---- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_inline.h	1969-12-31 18:00:00.000000000 -0600
141.2762 -+++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_inline.h	2002-06-24 00:49:19.000000000 -0500
141.2763 -@@ -0,0 +1,69 @@
141.2764 -+// Locale support -*- C++ -*-
141.2765 -+
141.2766 -+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
141.2767 -+//
141.2768 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.2769 -+// software; you can redistribute it and/or modify it under the
141.2770 -+// terms of the GNU General Public License as published by the
141.2771 -+// Free Software Foundation; either version 2, or (at your option)
141.2772 -+// any later version.
141.2773 -+
141.2774 -+// This library is distributed in the hope that it will be useful,
141.2775 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.2776 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.2777 -+// GNU General Public License for more details.
141.2778 -+
141.2779 -+// You should have received a copy of the GNU General Public License along
141.2780 -+// with this library; see the file COPYING.  If not, write to the Free
141.2781 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.2782 -+// USA.
141.2783 -+
141.2784 -+// As a special exception, you may use this file as part of a free software
141.2785 -+// library without restriction.  Specifically, if other files instantiate
141.2786 -+// templates or use macros or inline functions from this file, or you compile
141.2787 -+// this file and link it with other files to produce an executable, this
141.2788 -+// file does not by itself cause the resulting executable to be covered by
141.2789 -+// the GNU General Public License.  This exception does not however
141.2790 -+// invalidate any other reasons why the executable file might be covered by
141.2791 -+// the GNU General Public License.
141.2792 -+
141.2793 -+//
141.2794 -+// ISO C++ 14882: 22.1  Locales
141.2795 -+//
141.2796 -+  
141.2797 -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
141.2798 -+// functions go in ctype.cc
141.2799 -+  
141.2800 -+  bool
141.2801 -+  ctype<char>::
141.2802 -+  is(mask __m, char __c) const
141.2803 -+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
141.2804 -+
141.2805 -+  const char*
141.2806 -+  ctype<char>::
141.2807 -+  is(const char* __low, const char* __high, mask* __vec) const
141.2808 -+  {
141.2809 -+    while (__low < __high)
141.2810 -+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
141.2811 -+    return __high;
141.2812 -+  }
141.2813 -+
141.2814 -+  const char*
141.2815 -+  ctype<char>::
141.2816 -+  scan_is(mask __m, const char* __low, const char* __high) const
141.2817 -+  {
141.2818 -+    while (__low < __high 
141.2819 -+	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
141.2820 -+      ++__low;
141.2821 -+    return __low;
141.2822 -+  }
141.2823 -+
141.2824 -+  const char*
141.2825 -+  ctype<char>::
141.2826 -+  scan_not(mask __m, const char* __low, const char* __high) const
141.2827 -+  {
141.2828 -+    while (__low < __high 
141.2829 -+	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
141.2830 -+      ++__low;
141.2831 -+    return __low;
141.2832 -+  }
141.2833 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
141.2834 ---- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_noninline.h	1969-12-31 18:00:00.000000000 -0600
141.2835 -+++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h	2005-04-28 01:10:27.000000000 -0500
141.2836 -@@ -0,0 +1,92 @@
141.2837 -+// Locale support -*- C++ -*-
141.2838 -+
141.2839 -+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
141.2840 -+// Free Software Foundation, Inc.
141.2841 -+//
141.2842 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.2843 -+// software; you can redistribute it and/or modify it under the
141.2844 -+// terms of the GNU General Public License as published by the
141.2845 -+// Free Software Foundation; either version 2, or (at your option)
141.2846 -+// any later version.
141.2847 -+
141.2848 -+// This library is distributed in the hope that it will be useful,
141.2849 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.2850 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.2851 -+// GNU General Public License for more details.
141.2852 -+
141.2853 -+// You should have received a copy of the GNU General Public License along
141.2854 -+// with this library; see the file COPYING.  If not, write to the Free
141.2855 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.2856 -+// USA.
141.2857 -+
141.2858 -+// As a special exception, you may use this file as part of a free software
141.2859 -+// library without restriction.  Specifically, if other files instantiate
141.2860 -+// templates or use macros or inline functions from this file, or you compile
141.2861 -+// this file and link it with other files to produce an executable, this
141.2862 -+// file does not by itself cause the resulting executable to be covered by
141.2863 -+// the GNU General Public License.  This exception does not however
141.2864 -+// invalidate any other reasons why the executable file might be covered by
141.2865 -+// the GNU General Public License.
141.2866 -+
141.2867 -+//
141.2868 -+// ISO C++ 14882: 22.1  Locales
141.2869 -+//
141.2870 -+  
141.2871 -+// Information as gleaned from /usr/include/ctype.h
141.2872 -+
141.2873 -+  const ctype_base::mask*
141.2874 -+  ctype<char>::classic_table() throw()
141.2875 -+  { return __C_ctype_b; }
141.2876 -+
141.2877 -+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
141.2878 -+		     size_t __refs) 
141.2879 -+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
141.2880 -+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
141.2881 -+  {
141.2882 -+    _M_toupper = __C_ctype_toupper;
141.2883 -+    _M_tolower = __C_ctype_tolower;
141.2884 -+    _M_table = __table ? __table : __C_ctype_b;
141.2885 -+    memset(_M_widen, 0, sizeof(_M_widen));
141.2886 -+    memset(_M_narrow, 0, sizeof(_M_narrow));
141.2887 -+  }
141.2888 -+
141.2889 -+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
141.2890 -+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
141.2891 -+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
141.2892 -+  {
141.2893 -+    _M_toupper = __C_ctype_toupper;
141.2894 -+    _M_tolower = __C_ctype_tolower;
141.2895 -+    _M_table = __table ? __table : __C_ctype_b;
141.2896 -+    memset(_M_widen, 0, sizeof(_M_widen));
141.2897 -+    memset(_M_narrow, 0, sizeof(_M_narrow));
141.2898 -+  }
141.2899 -+
141.2900 -+  char
141.2901 -+  ctype<char>::do_toupper(char __c) const
141.2902 -+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
141.2903 -+
141.2904 -+  const char*
141.2905 -+  ctype<char>::do_toupper(char* __low, const char* __high) const
141.2906 -+  {
141.2907 -+    while (__low < __high)
141.2908 -+      {
141.2909 -+	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
141.2910 -+	++__low;
141.2911 -+      }
141.2912 -+    return __high;
141.2913 -+  }
141.2914 -+
141.2915 -+  char
141.2916 -+  ctype<char>::do_tolower(char __c) const
141.2917 -+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
141.2918 -+
141.2919 -+  const char* 
141.2920 -+  ctype<char>::do_tolower(char* __low, const char* __high) const
141.2921 -+  {
141.2922 -+    while (__low < __high)
141.2923 -+      {
141.2924 -+	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
141.2925 -+	++__low;
141.2926 -+      }
141.2927 -+    return __high;
141.2928 -+  }
141.2929 -diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/os_defines.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/os_defines.h
141.2930 ---- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/os_defines.h	1969-12-31 18:00:00.000000000 -0600
141.2931 -+++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/os_defines.h	2005-04-28 01:10:27.000000000 -0500
141.2932 -@@ -0,0 +1,44 @@
141.2933 -+// Specific definitions for GNU/Linux  -*- C++ -*-
141.2934 -+
141.2935 -+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
141.2936 -+//
141.2937 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.2938 -+// software; you can redistribute it and/or modify it under the
141.2939 -+// terms of the GNU General Public License as published by the
141.2940 -+// Free Software Foundation; either version 2, or (at your option)
141.2941 -+// any later version.
141.2942 -+
141.2943 -+// This library is distributed in the hope that it will be useful,
141.2944 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.2945 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.2946 -+// GNU General Public License for more details.
141.2947 -+
141.2948 -+// You should have received a copy of the GNU General Public License along
141.2949 -+// with this library; see the file COPYING.  If not, write to the Free
141.2950 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.2951 -+// USA.
141.2952 -+
141.2953 -+// As a special exception, you may use this file as part of a free software
141.2954 -+// library without restriction.  Specifically, if other files instantiate
141.2955 -+// templates or use macros or inline functions from this file, or you compile
141.2956 -+// this file and link it with other files to produce an executable, this
141.2957 -+// file does not by itself cause the resulting executable to be covered by
141.2958 -+// the GNU General Public License.  This exception does not however
141.2959 -+// invalidate any other reasons why the executable file might be covered by
141.2960 -+// the GNU General Public License.
141.2961 -+
141.2962 -+#ifndef _GLIBCXX_OS_DEFINES
141.2963 -+#define _GLIBCXX_OS_DEFINES 1
141.2964 -+
141.2965 -+// System-specific #define, typedefs, corrections, etc, go here.  This
141.2966 -+// file will come before all others.
141.2967 -+
141.2968 -+// This keeps isanum, et al from being propagated as macros.
141.2969 -+#define __NO_CTYPE 1
141.2970 -+
141.2971 -+#include <features.h>
141.2972 -+
141.2973 -+// We must not see the optimized string functions GNU libc defines.
141.2974 -+#define __NO_STRING_INLINES
141.2975 -+
141.2976 -+#endif
141.2977 -diff -urN gcc-4.0.0-100/libstdc++-v3/configure gcc-4.0.0/libstdc++-v3/configure
141.2978 ---- gcc-4.0.0-100/libstdc++-v3/configure	2005-04-30 13:06:53.683055232 -0500
141.2979 -+++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 12:24:24.000000000 -0500
141.2980 -@@ -3998,6 +3998,11 @@
141.2981 -   lt_cv_deplibs_check_method=pass_all
141.2982 -   ;;
141.2983 - 
141.2984 -+linux-uclibc*)
141.2985 -+  lt_cv_deplibs_check_method=pass_all
141.2986 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
141.2987 -+  ;;
141.2988 -+
141.2989 - netbsd* | knetbsd*-gnu)
141.2990 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
141.2991 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
141.2992 -@@ -5672,7 +5677,7 @@
141.2993 -   enableval="$enable_clocale"
141.2994 - 
141.2995 -       case "$enableval" in
141.2996 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
141.2997 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
141.2998 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
141.2999 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
141.3000 -    { (exit 1); exit 1; }; } ;;
141.3001 -@@ -5697,6 +5702,9 @@
141.3002 -   # Default to "generic".
141.3003 -   if test $enable_clocale_flag = auto; then
141.3004 -     case ${target_os} in
141.3005 -+      linux-uclibc*)
141.3006 -+	enable_clocale_flag=uclibc
141.3007 -+	;;
141.3008 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
141.3009 -         cat >conftest.$ac_ext <<_ACEOF
141.3010 - /* confdefs.h.  */
141.3011 -@@ -5927,6 +5935,76 @@
141.3012 -       CTIME_CC=config/locale/generic/time_members.cc
141.3013 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
141.3014 -       ;;
141.3015 -+    uclibc)
141.3016 -+      echo "$as_me:$LINENO: result: uclibc" >&5
141.3017 -+echo "${ECHO_T}uclibc" >&6
141.3018 -+
141.3019 -+      # Declare intention to use gettext, and add support for specific
141.3020 -+      # languages.
141.3021 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
141.3022 -+      ALL_LINGUAS="de fr"
141.3023 -+
141.3024 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
141.3025 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
141.3026 -+set dummy msgfmt; ac_word=$2
141.3027 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
141.3028 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
141.3029 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
141.3030 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
141.3031 -+else
141.3032 -+  if test -n "$check_msgfmt"; then
141.3033 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
141.3034 -+else
141.3035 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
141.3036 -+for as_dir in $PATH
141.3037 -+do
141.3038 -+  IFS=$as_save_IFS
141.3039 -+  test -z "$as_dir" && as_dir=.
141.3040 -+  for ac_exec_ext in '' $ac_executable_extensions; do
141.3041 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
141.3042 -+    ac_cv_prog_check_msgfmt="yes"
141.3043 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
141.3044 -+    break 2
141.3045 -+  fi
141.3046 -+done
141.3047 -+done
141.3048 -+
141.3049 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
141.3050 -+fi
141.3051 -+fi
141.3052 -+check_msgfmt=$ac_cv_prog_check_msgfmt
141.3053 -+if test -n "$check_msgfmt"; then
141.3054 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
141.3055 -+echo "${ECHO_T}$check_msgfmt" >&6
141.3056 -+else
141.3057 -+  echo "$as_me:$LINENO: result: no" >&5
141.3058 -+echo "${ECHO_T}no" >&6
141.3059 -+fi
141.3060 -+
141.3061 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
141.3062 -+        USE_NLS=yes
141.3063 -+      fi
141.3064 -+      # Export the build objects.
141.3065 -+      for ling in $ALL_LINGUAS; do \
141.3066 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
141.3067 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
141.3068 -+      done
141.3069 -+
141.3070 -+
141.3071 -+
141.3072 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
141.3073 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
141.3074 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
141.3075 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
141.3076 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
141.3077 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
141.3078 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
141.3079 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
141.3080 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
141.3081 -+      CTIME_H=config/locale/uclibc/time_members.h
141.3082 -+      CTIME_CC=config/locale/uclibc/time_members.cc
141.3083 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
141.3084 -+      ;;
141.3085 -   esac
141.3086 - 
141.3087 -   # This is where the testsuite looks for locale catalogs, using the
141.3088 -diff -urN gcc-4.0.0-100/libstdc++-v3/configure.host gcc-4.0.0/libstdc++-v3/configure.host
141.3089 ---- gcc-4.0.0-100/libstdc++-v3/configure.host	2005-04-30 13:06:53.688054472 -0500
141.3090 -+++ gcc-4.0.0/libstdc++-v3/configure.host	2005-04-28 20:20:32.000000000 -0500
141.3091 -@@ -249,6 +249,12 @@
141.3092 -     ;;
141.3093 - esac
141.3094 - 
141.3095 -+# Override for uClibc since linux-uclibc gets mishandled above.
141.3096 -+case "${host_os}" in
141.3097 -+  *-uclibc*)
141.3098 -+    os_include_dir="os/uclibc"
141.3099 -+    ;;
141.3100 -+esac
141.3101 - 
141.3102 - # Set any OS-dependent and CPU-dependent bits.
141.3103 - # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
141.3104 -diff -urN gcc-4.0.0-100/libstdc++-v3/crossconfig.m4 gcc-4.0.0/libstdc++-v3/crossconfig.m4
141.3105 ---- gcc-4.0.0-100/libstdc++-v3/crossconfig.m4	2005-04-30 13:06:53.689054320 -0500
141.3106 -+++ gcc-4.0.0/libstdc++-v3/crossconfig.m4	2005-04-28 20:27:15.000000000 -0500
141.3107 -@@ -142,6 +142,98 @@
141.3108 - 	;;
141.3109 -     esac
141.3110 -     ;;
141.3111 -+  *-uclibc*)
141.3112 -+# Temporary hack until we implement the float versions of the libm funcs
141.3113 -+    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
141.3114 -+      machine/endian.h machine/param.h sys/machine.h sys/types.h \
141.3115 -+      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
141.3116 -+    SECTION_FLAGS='-ffunction-sections -fdata-sections'
141.3117 -+    AC_SUBST(SECTION_FLAGS)
141.3118 -+    GLIBCXX_CHECK_LINKER_FEATURES
141.3119 -+    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
141.3120 -+    GLIBCXX_CHECK_WCHAR_T_SUPPORT
141.3121 -+
141.3122 -+    # For LFS.
141.3123 -+    AC_DEFINE(HAVE_INT64_T)
141.3124 -+    case "$target" in
141.3125 -+      *-uclinux*)
141.3126 -+        # Don't enable LFS with uClinux
141.3127 -+        ;;
141.3128 -+      *)
141.3129 -+        AC_DEFINE(_GLIBCXX_USE_LFS)
141.3130 -+    esac
141.3131 -+
141.3132 -+    # For showmanyc_helper().
141.3133 -+    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
141.3134 -+    GLIBCXX_CHECK_POLL
141.3135 -+    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
141.3136 -+
141.3137 -+    # For xsputn_2().
141.3138 -+    AC_CHECK_HEADERS(sys/uio.h)
141.3139 -+    GLIBCXX_CHECK_WRITEV
141.3140 -+
141.3141 -+#     AC_DEFINE(HAVE_ACOSF)
141.3142 -+#     AC_DEFINE(HAVE_ASINF)
141.3143 -+#     AC_DEFINE(HAVE_ATANF)
141.3144 -+#     AC_DEFINE(HAVE_ATAN2F)
141.3145 -+    AC_DEFINE(HAVE_CEILF)
141.3146 -+    AC_DEFINE(HAVE_COPYSIGN)
141.3147 -+#     AC_DEFINE(HAVE_COPYSIGNF)
141.3148 -+#     AC_DEFINE(HAVE_COSF)
141.3149 -+#     AC_DEFINE(HAVE_COSHF)
141.3150 -+#     AC_DEFINE(HAVE_EXPF)
141.3151 -+#     AC_DEFINE(HAVE_FABSF)
141.3152 -+    AC_DEFINE(HAVE_FINITE)
141.3153 -+    AC_DEFINE(HAVE_FINITEF)
141.3154 -+    AC_DEFINE(HAVE_FLOORF)
141.3155 -+#     AC_DEFINE(HAVE_FMODF)
141.3156 -+#     AC_DEFINE(HAVE_FREXPF)
141.3157 -+    AC_DEFINE(HAVE_HYPOT)
141.3158 -+#     AC_DEFINE(HAVE_HYPOTF)
141.3159 -+    AC_DEFINE(HAVE_ISINF)
141.3160 -+    AC_DEFINE(HAVE_ISINFF)
141.3161 -+    AC_DEFINE(HAVE_ISNAN)
141.3162 -+    AC_DEFINE(HAVE_ISNANF)
141.3163 -+#     AC_DEFINE(HAVE_LOGF)
141.3164 -+#     AC_DEFINE(HAVE_LOG10F)
141.3165 -+#     AC_DEFINE(HAVE_MODFF)
141.3166 -+#     AC_DEFINE(HAVE_SINF)
141.3167 -+#     AC_DEFINE(HAVE_SINHF)
141.3168 -+#     AC_DEFINE(HAVE_SINCOS)
141.3169 -+#     AC_DEFINE(HAVE_SINCOSF)
141.3170 -+    AC_DEFINE(HAVE_SQRTF)
141.3171 -+#     AC_DEFINE(HAVE_TANF)
141.3172 -+#     AC_DEFINE(HAVE_TANHF)
141.3173 -+    if test x"long_double_math_on_this_cpu" = x"yes"; then
141.3174 -+#       AC_DEFINE(HAVE_ACOSL)
141.3175 -+#       AC_DEFINE(HAVE_ASINL)
141.3176 -+#       AC_DEFINE(HAVE_ATANL)
141.3177 -+#       AC_DEFINE(HAVE_ATAN2L)
141.3178 -+#       AC_DEFINE(HAVE_CEILL)
141.3179 -+#       AC_DEFINE(HAVE_COPYSIGNL)
141.3180 -+#       AC_DEFINE(HAVE_COSL)
141.3181 -+#       AC_DEFINE(HAVE_COSHL)
141.3182 -+#       AC_DEFINE(HAVE_EXPL)
141.3183 -+#       AC_DEFINE(HAVE_FABSL)
141.3184 -+#       AC_DEFINE(HAVE_FINITEL)
141.3185 -+#       AC_DEFINE(HAVE_FLOORL)
141.3186 -+#       AC_DEFINE(HAVE_FMODL)
141.3187 -+#       AC_DEFINE(HAVE_FREXPL)
141.3188 -+#       AC_DEFINE(HAVE_HYPOTL)
141.3189 -+#       AC_DEFINE(HAVE_ISINFL)
141.3190 -+#       AC_DEFINE(HAVE_ISNANL)
141.3191 -+#       AC_DEFINE(HAVE_LOGL)
141.3192 -+#       AC_DEFINE(HAVE_LOG10L)
141.3193 -+#       AC_DEFINE(HAVE_MODFL)
141.3194 -+#       AC_DEFINE(HAVE_POWL)
141.3195 -+#       AC_DEFINE(HAVE_SINL)
141.3196 -+#       AC_DEFINE(HAVE_SINHL)
141.3197 -+#       AC_DEFINE(HAVE_SINCOSL)
141.3198 -+#       AC_DEFINE(HAVE_SQRTL)
141.3199 -+#       AC_DEFINE(HAVE_TANL)
141.3200 -+#       AC_DEFINE(HAVE_TANHL)
141.3201 -+    fi
141.3202 -+    ;;
141.3203 -   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
141.3204 -     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
141.3205 -       machine/endian.h machine/param.h sys/machine.h sys/types.h \
141.3206 -@@ -156,7 +248,7 @@
141.3207 -     AC_DEFINE(HAVE_INT64_T)
141.3208 -     case "$target" in
141.3209 -       *-uclinux*)
141.3210 --        # Don't enable LFS with uClibc
141.3211 -+        # Don't enable LFS with uClinux
141.3212 -         ;;
141.3213 -       *)
141.3214 -         AC_DEFINE(_GLIBCXX_USE_LFS)
141.3215 -diff -urN gcc-4.0.0-100/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.0.0/libstdc++-v3/include/c_compatibility/wchar.h
141.3216 ---- gcc-4.0.0-100/libstdc++-v3/include/c_compatibility/wchar.h	2005-04-30 13:06:53.690054168 -0500
141.3217 -+++ gcc-4.0.0/libstdc++-v3/include/c_compatibility/wchar.h	2005-04-28 20:15:56.000000000 -0500
141.3218 -@@ -101,7 +101,9 @@
141.3219 - using std::wmemcpy;
141.3220 - using std::wmemmove;
141.3221 - using std::wmemset;
141.3222 -+#if _GLIBCXX_HAVE_WCSFTIME
141.3223 - using std::wcsftime;
141.3224 -+#endif
141.3225 - 
141.3226 - #if _GLIBCXX_USE_C99
141.3227 - using std::wcstold;
141.3228 -diff -urN gcc-4.0.0-100/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.0.0/libstdc++-v3/include/c_std/std_cwchar.h
141.3229 ---- gcc-4.0.0-100/libstdc++-v3/include/c_std/std_cwchar.h	2005-04-30 13:06:53.691054016 -0500
141.3230 -+++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cwchar.h	2005-04-28 20:15:56.000000000 -0500
141.3231 -@@ -179,7 +179,9 @@
141.3232 -   using ::wcscoll;
141.3233 -   using ::wcscpy;
141.3234 -   using ::wcscspn;
141.3235 -+#if _GLIBCXX_HAVE_WCSFTIME
141.3236 -   using ::wcsftime;
141.3237 -+#endif
141.3238 -   using ::wcslen;
141.3239 -   using ::wcsncat;
141.3240 -   using ::wcsncmp;
   142.1 --- a/patches/gcc/4.0.4/300-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   142.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   142.3 @@ -1,45 +0,0 @@
   142.4 ---- gcc-4.0.0/libstdc++-v3/src/Makefile.am
   142.5 -+++ gcc-4.0.0/libstdc++-v3/src/Makefile.am
   142.6 -@@ -214,6 +214,10 @@
   142.7 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
   142.8 - 
   142.9 - 
  142.10 -+install-exec-local:
  142.11 -+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  142.12 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  142.13 -+
  142.14 - # Added bits to build debug library.
  142.15 - if GLIBCXX_BUILD_DEBUG
  142.16 - all-local: build_debug
  142.17 ---- gcc-4.0.0/libstdc++-v3/src/Makefile.in
  142.18 -+++ gcc-4.0.0/libstdc++-v3/src/Makefile.in
  142.19 -@@ -625,7 +625,7 @@
  142.20 - 
  142.21 - install-data-am: install-data-local
  142.22 - 
  142.23 --install-exec-am: install-toolexeclibLTLIBRARIES
  142.24 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  142.25 - 
  142.26 - install-info: install-info-am
  142.27 - 
  142.28 -@@ -664,7 +664,7 @@
  142.29 - 	maintainer-clean-generic mostlyclean mostlyclean-compile \
  142.30 - 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  142.31 - 	tags uninstall uninstall-am uninstall-info-am \
  142.32 --	uninstall-toolexeclibLTLIBRARIES
  142.33 -+	uninstall-toolexeclibLTLIBRARIES install-exec-local
  142.34 - 
  142.35 - @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@libstdc++-symbol.ver:  ${glibcxx_srcdir}/$(SYMVER_MAP)
  142.36 - @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@	cp ${glibcxx_srcdir}/$(SYMVER_MAP) ./libstdc++-symbol.ver
  142.37 -@@ -743,6 +743,11 @@
  142.38 - install_debug:
  142.39 - 	(cd ${debugdir} && $(MAKE) \
  142.40 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  142.41 -+
  142.42 -+install-exec-local:
  142.43 -+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  142.44 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  142.45 -+
  142.46 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  142.47 - # Otherwise a system limit (for SysV at least) may be exceeded.
  142.48 - .NOEXPORT:
   143.1 --- a/patches/gcc/4.0.4/301-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   143.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   143.3 @@ -1,11 +0,0 @@
   143.4 ---- gcc-4.0.0/boehm-gc/include/gc.h-orig	2005-04-28 22:28:57.000000000 -0500
   143.5 -+++ gcc-4.0.0/boehm-gc/include/gc.h	2005-04-28 22:30:38.000000000 -0500
   143.6 -@@ -500,7 +500,7 @@
   143.7 - #ifdef __linux__
   143.8 - # include <features.h>
   143.9 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  143.10 --     && !defined(__ia64__)
  143.11 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  143.12 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  143.13 - #     define GC_HAVE_BUILTIN_BACKTRACE
  143.14 - #   endif
   144.1 --- a/patches/gcc/4.0.4/302-c99-snprintf.patch	Mon Jul 28 21:08:01 2008 +0000
   144.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   144.3 @@ -1,11 +0,0 @@
   144.4 ---- gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h-orig	2005-04-29 00:08:41.000000000 -0500
   144.5 -+++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h	2005-04-29 00:08:45.000000000 -0500
   144.6 -@@ -142,7 +142,7 @@
   144.7 -   using ::vsprintf;
   144.8 - }
   144.9 - 
  144.10 --#if _GLIBCXX_USE_C99
  144.11 -+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  144.12 - 
  144.13 - #undef snprintf
  144.14 - #undef vfscanf
   145.1 --- a/patches/gcc/4.0.4/303-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   145.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   145.3 @@ -1,12 +0,0 @@
   145.4 ---- gcc-4.0.0/libstdc++-v3/configure-old	2005-04-30 22:04:48.061603912 -0500
   145.5 -+++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 22:06:13.678588152 -0500
   145.6 -@@ -7194,6 +7194,9 @@
   145.7 - cat >>conftest.$ac_ext <<_ACEOF
   145.8 - /* end confdefs.h.  */
   145.9 - #include <complex.h>
  145.10 -+#ifdef __UCLIBC__
  145.11 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  145.12 -+#endif
  145.13 - int
  145.14 - main ()
  145.15 - {
   146.1 --- a/patches/gcc/4.0.4/304-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   146.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   146.3 @@ -1,24 +0,0 @@
   146.4 ---- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps	2006-03-24 01:49:51 +0100
   146.5 -+++ gcc-4.1.0/libstdc++-v3/include/ext/rope	2006-03-24 01:49:37 +0100
   146.6 -@@ -59,6 +59,9 @@
   146.7 - #include <bits/allocator.h>
   146.8 - #include <ext/hash_fun.h>
   146.9 - 
  146.10 -+/* cope w/ index defined as macro, SuSv3 proposal */
  146.11 -+#undef index
  146.12 -+
  146.13 - # ifdef __GC
  146.14 - #   define __GC_CONST const
  146.15 - # else
  146.16 ---- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps	2006-03-24 01:50:04 +0100
  146.17 -+++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h	2006-03-24 01:50:28 +0100
  146.18 -@@ -53,6 +53,9 @@
  146.19 - #include <ext/memory> // For uninitialized_copy_n
  146.20 - #include <ext/numeric> // For power
  146.21 - 
  146.22 -+/* cope w/ index defined as macro, SuSv3 proposal */
  146.23 -+#undef index
  146.24 -+
  146.25 - namespace __gnu_cxx
  146.26 - {
  146.27 -   using std::size_t;
   147.1 --- a/patches/gcc/4.0.4/305-libmudflap-susv3-legacy.patch	Mon Jul 28 21:08:01 2008 +0000
   147.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   147.3 @@ -1,49 +0,0 @@
   147.4 -Index: gcc-4.2/libmudflap/mf-hooks2.c
   147.5 -===================================================================
   147.6 ---- gcc-4.2/libmudflap/mf-hooks2.c	(revision 119834)
   147.7 -+++ gcc-4.2/libmudflap/mf-hooks2.c	(working copy)
   147.8 -@@ -427,7 +427,7 @@
   147.9 - {
  147.10 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  147.11 -   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  147.12 --  bzero (s, n);
  147.13 -+  memset (s, 0, n);
  147.14 - }
  147.15 - 
  147.16 - 
  147.17 -@@ -437,7 +437,7 @@
  147.18 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  147.19 -   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  147.20 -   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  147.21 --  bcopy (src, dest, n);
  147.22 -+  memmove (dest, src, n);
  147.23 - }
  147.24 - 
  147.25 - 
  147.26 -@@ -447,7 +447,7 @@
  147.27 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  147.28 -   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  147.29 -   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  147.30 --  return bcmp (s1, s2, n);
  147.31 -+  return n == 0 ? 0 : memcmp (s1, s2, n);
  147.32 - }
  147.33 - 
  147.34 - 
  147.35 -@@ -456,7 +456,7 @@
  147.36 -   size_t n = strlen (s);
  147.37 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  147.38 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  147.39 --  return index (s, c);
  147.40 -+  return strchr (s, c);
  147.41 - }
  147.42 - 
  147.43 - 
  147.44 -@@ -465,7 +465,7 @@
  147.45 -   size_t n = strlen (s);
  147.46 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  147.47 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  147.48 --  return rindex (s, c);
  147.49 -+  return strrchr (s, c);
  147.50 - }
  147.51 - 
  147.52 - /* XXX:  stpcpy, memccpy */
   148.1 --- a/patches/gcc/4.0.4/602-sdk-libstdc++-includes.patch	Mon Jul 28 21:08:01 2008 +0000
   148.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   148.3 @@ -1,22 +0,0 @@
   148.4 -diff -urN gcc-4.0.0-100/libstdc++-v3/fragment.am gcc-4.0.0/libstdc++-v3/fragment.am
   148.5 ---- gcc-4.0.0-100/libstdc++-v3/fragment.am	2004-10-25 15:32:40.000000000 -0500
   148.6 -+++ gcc-4.0.0/libstdc++-v3/fragment.am	2005-04-28 21:48:43.000000000 -0500
   148.7 -@@ -18,5 +18,5 @@
   148.8 - 	$(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
   148.9 - 
  148.10 - # -I/-D flags to pass when compiling.
  148.11 --AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
  148.12 -+AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
  148.13 - 
  148.14 -diff -urN gcc-4.0.0-100/libstdc++-v3/libmath/Makefile.am gcc-4.0.0/libstdc++-v3/libmath/Makefile.am
  148.15 ---- gcc-4.0.0-100/libstdc++-v3/libmath/Makefile.am	2003-08-27 16:29:42.000000000 -0500
  148.16 -+++ gcc-4.0.0/libstdc++-v3/libmath/Makefile.am	2005-04-28 21:48:43.000000000 -0500
  148.17 -@@ -32,7 +32,7 @@
  148.18 - 
  148.19 - libmath_la_SOURCES = stubs.c
  148.20 - 
  148.21 --AM_CPPFLAGS = $(CANADIAN_INCLUDES)
  148.22 -+AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
  148.23 - 
  148.24 - # Only compiling "C" sources in this directory.
  148.25 - LIBTOOL = @LIBTOOL@ --tag CC
   149.1 --- a/patches/gcc/4.0.4/800-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
   149.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   149.3 @@ -1,65 +0,0 @@
   149.4 -diff -dur gcc-4.0.4.orig/gcc/config/arm/linux-elf.h gcc-4.0.4/gcc/config/arm/linux-elf.h
   149.5 ---- gcc-4.0.4.orig/gcc/config/arm/linux-elf.h	2007-02-02 19:24:50.000000000 +0100
   149.6 -+++ gcc-4.0.4/gcc/config/arm/linux-elf.h	2007-02-02 19:26:12.000000000 +0100
   149.7 -@@ -31,19 +31,33 @@
   149.8 - /* Do not assume anything about header files.  */
   149.9 - #define NO_IMPLICIT_EXTERN_C
  149.10 - 
  149.11 -+/*
  149.12 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  149.13 -+ * (big endian) configurations.
  149.14 -+ */
  149.15 -+#if TARGET_BIG_ENDIAN_DEFAULT
  149.16 -+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
  149.17 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
  149.18 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
  149.19 -+#else
  149.20 -+#define TARGET_ENDIAN_DEFAULT 0
  149.21 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
  149.22 -+#define TARGET_LINKER_EMULATION "armelf_linux"
  149.23 -+#endif
  149.24 -+
  149.25 - #undef  TARGET_DEFAULT_FLOAT_ABI
  149.26 - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  149.27 - 
  149.28 - #undef  TARGET_DEFAULT
  149.29 --#define TARGET_DEFAULT (0)
  149.30 -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  149.31 - 
  149.32 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  149.33 - 
  149.34 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  149.35 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  149.36 - 
  149.37 - #undef  MULTILIB_DEFAULTS
  149.38 - #define MULTILIB_DEFAULTS \
  149.39 --	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  149.40 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  149.41 - 
  149.42 - /* The GNU C++ standard library requires that these macros be defined.  */
  149.43 - #undef CPLUSPLUS_CPP_SPEC
  149.44 -@@ -95,7 +109,7 @@
  149.45 -    %{rdynamic:-export-dynamic} \
  149.46 -    %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "} \
  149.47 -    -X \
  149.48 --   %{mbig-endian:-EB}" \
  149.49 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  149.50 -    SUBTARGET_EXTRA_LINK_SPEC
  149.51 - 
  149.52 - #define TARGET_OS_CPP_BUILTINS()		\
  149.53 -Only in gcc-4.0.4/gcc/config/arm: linux-elf.h.orig
  149.54 -diff -dur gcc-4.0.4.orig/gcc/config.gcc gcc-4.0.4/gcc/config.gcc
  149.55 ---- gcc-4.0.4.orig/gcc/config.gcc	2007-02-02 19:24:50.000000000 +0100
  149.56 -+++ gcc-4.0.4/gcc/config.gcc	2007-02-02 19:26:12.000000000 +0100
  149.57 -@@ -672,6 +672,11 @@
  149.58 - 	;;
  149.59 - arm*-*-linux*)			# ARM GNU/Linux with ELF
  149.60 - 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
  149.61 -+	case $target in
  149.62 -+	arm*b-*)
  149.63 -+		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
  149.64 -+		;;
  149.65 -+	esac
  149.66 - 	tmake_file="${tmake_file} arm/t-arm arm/t-linux"
  149.67 - 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  149.68 - 	gnu_ld=yes
   150.1 --- a/patches/gcc/4.0.4/801-arm-softfloat.patch	Mon Jul 28 21:08:01 2008 +0000
   150.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   150.3 @@ -1,15 +0,0 @@
   150.4 -Enable building a pure soft-float compiler without the need for a software
   150.5 -floating point library.
   150.6 -
   150.7 -diff -dur gcc-4.0.4.orig/gcc/config.gcc gcc-4.0.4/gcc/config.gcc
   150.8 ---- gcc-4.0.4.orig/gcc/config.gcc	2007-02-02 19:12:28.000000000 +0100
   150.9 -+++ gcc-4.0.4/gcc/config.gcc	2007-02-02 19:12:07.000000000 +0100
  150.10 -@@ -677,7 +677,7 @@
  150.11 - 		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
  150.12 - 		;;
  150.13 - 	esac
  150.14 --	tmake_file="${tmake_file} arm/t-arm arm/t-linux"
  150.15 -+	tmake_file="${tmake_file} arm/t-arm arm/t-linux arm/t-arm-elf"
  150.16 - 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  150.17 - 	gnu_ld=yes
  150.18 - 	;;
   151.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   151.2 +++ b/patches/gcc/4.1.1/120-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   151.3 @@ -0,0 +1,3239 @@
   151.4 +--- gcc-4.1.0-dist/libstdc++-v3/acinclude.m4
   151.5 ++++ gcc-4.1.0/libstdc++-v3/acinclude.m4
   151.6 +@@ -1071,7 +1071,7 @@
   151.7 +   AC_MSG_CHECKING([for C locale to use])
   151.8 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
   151.9 +     [use MODEL for target locale package],
  151.10 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  151.11 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  151.12 +   
  151.13 +   # If they didn't use this option switch, or if they specified --enable
  151.14 +   # with no specific model, we'll have to look for one.  If they
  151.15 +@@ -1087,6 +1087,9 @@
  151.16 +   # Default to "generic".
  151.17 +   if test $enable_clocale_flag = auto; then
  151.18 +     case ${target_os} in
  151.19 ++      *-uclibc*)
  151.20 ++        enable_clocale_flag=uclibc
  151.21 ++        ;;
  151.22 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  151.23 +         AC_EGREP_CPP([_GLIBCXX_ok], [
  151.24 +         #include <features.h>
  151.25 +@@ -1230,6 +1233,40 @@
  151.26 +       CTIME_CC=config/locale/generic/time_members.cc
  151.27 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  151.28 +       ;;
  151.29 ++    uclibc)
  151.30 ++      AC_MSG_RESULT(uclibc)
  151.31 ++
  151.32 ++      # Declare intention to use gettext, and add support for specific
  151.33 ++      # languages.
  151.34 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  151.35 ++      ALL_LINGUAS="de fr"
  151.36 ++
  151.37 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  151.38 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  151.39 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  151.40 ++        USE_NLS=yes
  151.41 ++      fi
  151.42 ++      # Export the build objects.
  151.43 ++      for ling in $ALL_LINGUAS; do \
  151.44 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  151.45 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  151.46 ++      done
  151.47 ++      AC_SUBST(glibcxx_MOFILES)
  151.48 ++      AC_SUBST(glibcxx_POFILES)
  151.49 ++
  151.50 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  151.51 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  151.52 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  151.53 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  151.54 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  151.55 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  151.56 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  151.57 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  151.58 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  151.59 ++      CTIME_H=config/locale/uclibc/time_members.h
  151.60 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  151.61 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  151.62 ++      ;;
  151.63 +   esac
  151.64 + 
  151.65 +   # This is where the testsuite looks for locale catalogs, using the
  151.66 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  151.67 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  151.68 +@@ -0,0 +1,63 @@
  151.69 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  151.70 ++
  151.71 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  151.72 ++//
  151.73 ++// This file is part of the GNU ISO C++ Library.  This library is free
  151.74 ++// software; you can redistribute it and/or modify it under the
  151.75 ++// terms of the GNU General Public License as published by the
  151.76 ++// Free Software Foundation; either version 2, or (at your option)
  151.77 ++// any later version.
  151.78 ++
  151.79 ++// This library is distributed in the hope that it will be useful,
  151.80 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  151.81 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  151.82 ++// GNU General Public License for more details.
  151.83 ++
  151.84 ++// You should have received a copy of the GNU General Public License along
  151.85 ++// with this library; see the file COPYING.  If not, write to the Free
  151.86 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
  151.87 ++// USA.
  151.88 ++
  151.89 ++// As a special exception, you may use this file as part of a free software
  151.90 ++// library without restriction.  Specifically, if other files instantiate
  151.91 ++// templates or use macros or inline functions from this file, or you compile
  151.92 ++// this file and link it with other files to produce an executable, this
  151.93 ++// file does not by itself cause the resulting executable to be covered by
  151.94 ++// the GNU General Public License.  This exception does not however
  151.95 ++// invalidate any other reasons why the executable file might be covered by
  151.96 ++// the GNU General Public License.
  151.97 ++
  151.98 ++// Written by Jakub Jelinek <jakub@redhat.com>
  151.99 ++
 151.100 ++#include <bits/c++config.h>
 151.101 ++#include <clocale>
 151.102 ++
 151.103 ++#ifdef __UCLIBC_MJN3_ONLY__
 151.104 ++#warning clean this up
 151.105 ++#endif
 151.106 ++
 151.107 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.108 ++                                                  
 151.109 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 151.110 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 151.111 ++extern "C" __typeof(strftime_l) __strftime_l;
 151.112 ++extern "C" __typeof(strtod_l) __strtod_l;
 151.113 ++extern "C" __typeof(strtof_l) __strtof_l;
 151.114 ++extern "C" __typeof(strtold_l) __strtold_l;
 151.115 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 151.116 ++extern "C" __typeof(newlocale) __newlocale;
 151.117 ++extern "C" __typeof(freelocale) __freelocale;
 151.118 ++extern "C" __typeof(duplocale) __duplocale;
 151.119 ++extern "C" __typeof(uselocale) __uselocale;
 151.120 ++
 151.121 ++#ifdef _GLIBCXX_USE_WCHAR_T
 151.122 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 151.123 ++extern "C" __typeof(towlower_l) __towlower_l;
 151.124 ++extern "C" __typeof(towupper_l) __towupper_l;
 151.125 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 151.126 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 151.127 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 151.128 ++extern "C" __typeof(wctype_l) __wctype_l;
 151.129 ++#endif 
 151.130 ++
 151.131 ++#endif // GLIBC 2.3 and later
 151.132 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc
 151.133 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
 151.134 +@@ -0,0 +1,152 @@
 151.135 ++// Wrapper for underlying C-language localization -*- C++ -*-
 151.136 ++
 151.137 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 
 151.138 ++// Free Software Foundation, Inc.
 151.139 ++//
 151.140 ++// This file is part of the GNU ISO C++ Library.  This library is free
 151.141 ++// software; you can redistribute it and/or modify it under the
 151.142 ++// terms of the GNU General Public License as published by the
 151.143 ++// Free Software Foundation; either version 2, or (at your option)
 151.144 ++// any later version.
 151.145 ++
 151.146 ++// This library is distributed in the hope that it will be useful,
 151.147 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 151.148 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 151.149 ++// GNU General Public License for more details.
 151.150 ++
 151.151 ++// You should have received a copy of the GNU General Public License along
 151.152 ++// with this library; see the file COPYING.  If not, write to the Free
 151.153 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 151.154 ++// USA.
 151.155 ++
 151.156 ++// As a special exception, you may use this file as part of a free software
 151.157 ++// library without restriction.  Specifically, if other files instantiate
 151.158 ++// templates or use macros or inline functions from this file, or you compile
 151.159 ++// this file and link it with other files to produce an executable, this
 151.160 ++// file does not by itself cause the resulting executable to be covered by
 151.161 ++// the GNU General Public License.  This exception does not however
 151.162 ++// invalidate any other reasons why the executable file might be covered by
 151.163 ++// the GNU General Public License.
 151.164 ++
 151.165 ++//
 151.166 ++// ISO C++ 14882: 22.8  Standard locale categories.
 151.167 ++//
 151.168 ++
 151.169 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 151.170 ++
 151.171 ++#include <cerrno>  // For errno
 151.172 ++#include <locale>
 151.173 ++#include <stdexcept>
 151.174 ++#include <langinfo.h>
 151.175 ++#include <bits/c++locale_internal.h>
 151.176 ++
 151.177 ++#ifndef __UCLIBC_HAS_XLOCALE__
 151.178 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 151.179 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 151.180 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 151.181 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 151.182 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 151.183 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 151.184 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 151.185 ++#warning should dummy __newlocale check for C|POSIX ?
 151.186 ++#define __newlocale(a, b, c)        NULL
 151.187 ++#define __freelocale(a)             ((void)0)
 151.188 ++#define __duplocale(a)              __c_locale()
 151.189 ++#endif
 151.190 ++
 151.191 ++namespace std 
 151.192 ++{
 151.193 ++  template<>
 151.194 ++    void
 151.195 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 151.196 ++		   const __c_locale& __cloc)
 151.197 ++    {
 151.198 ++      char* __sanity;
 151.199 ++      errno = 0;
 151.200 ++      float __f = __strtof_l(__s, &__sanity, __cloc);
 151.201 ++      if (__sanity != __s && errno != ERANGE)
 151.202 ++	__v = __f;
 151.203 ++      else
 151.204 ++	__err |= ios_base::failbit;
 151.205 ++    }
 151.206 ++
 151.207 ++  template<>
 151.208 ++    void
 151.209 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 151.210 ++		   const __c_locale& __cloc)
 151.211 ++    {
 151.212 ++      char* __sanity;
 151.213 ++      errno = 0;
 151.214 ++      double __d = __strtod_l(__s, &__sanity, __cloc);
 151.215 ++      if (__sanity != __s && errno != ERANGE)
 151.216 ++	__v = __d;
 151.217 ++      else
 151.218 ++	__err |= ios_base::failbit;
 151.219 ++    }
 151.220 ++
 151.221 ++  template<>
 151.222 ++    void
 151.223 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 151.224 ++		   const __c_locale& __cloc)
 151.225 ++    {
 151.226 ++      char* __sanity;
 151.227 ++      errno = 0;
 151.228 ++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
 151.229 ++      if (__sanity != __s && errno != ERANGE)
 151.230 ++	__v = __ld;
 151.231 ++      else
 151.232 ++	__err |= ios_base::failbit;
 151.233 ++    }
 151.234 ++
 151.235 ++  void
 151.236 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 151.237 ++				    __c_locale __old)
 151.238 ++  {
 151.239 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 151.240 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.241 ++    if (!__cloc)
 151.242 ++      {
 151.243 ++	// This named locale is not supported by the underlying OS.
 151.244 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 151.245 ++			      "name not valid"));
 151.246 ++      }
 151.247 ++#endif
 151.248 ++  }
 151.249 ++  
 151.250 ++  void
 151.251 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 151.252 ++  {
 151.253 ++    if (__cloc && _S_get_c_locale() != __cloc)
 151.254 ++      __freelocale(__cloc); 
 151.255 ++  }
 151.256 ++
 151.257 ++  __c_locale
 151.258 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 151.259 ++  { return __duplocale(__cloc); }
 151.260 ++} // namespace std
 151.261 ++
 151.262 ++namespace __gnu_cxx
 151.263 ++{
 151.264 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 151.265 ++    {
 151.266 ++      "LC_CTYPE", 
 151.267 ++      "LC_NUMERIC",
 151.268 ++      "LC_TIME", 
 151.269 ++      "LC_COLLATE", 
 151.270 ++      "LC_MONETARY",
 151.271 ++      "LC_MESSAGES", 
 151.272 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 151.273 ++      "LC_PAPER", 
 151.274 ++      "LC_NAME", 
 151.275 ++      "LC_ADDRESS",
 151.276 ++      "LC_TELEPHONE", 
 151.277 ++      "LC_MEASUREMENT", 
 151.278 ++      "LC_IDENTIFICATION" 
 151.279 ++#endif
 151.280 ++    };
 151.281 ++}
 151.282 ++
 151.283 ++namespace std
 151.284 ++{
 151.285 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 151.286 ++}  // namespace std
 151.287 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h
 151.288 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h
 151.289 +@@ -0,0 +1,117 @@
 151.290 ++// Wrapper for underlying C-language localization -*- C++ -*-
 151.291 ++
 151.292 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 151.293 ++//
 151.294 ++// This file is part of the GNU ISO C++ Library.  This library is free
 151.295 ++// software; you can redistribute it and/or modify it under the
 151.296 ++// terms of the GNU General Public License as published by the
 151.297 ++// Free Software Foundation; either version 2, or (at your option)
 151.298 ++// any later version.
 151.299 ++
 151.300 ++// This library is distributed in the hope that it will be useful,
 151.301 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 151.302 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 151.303 ++// GNU General Public License for more details.
 151.304 ++
 151.305 ++// You should have received a copy of the GNU General Public License along
 151.306 ++// with this library; see the file COPYING.  If not, write to the Free
 151.307 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 151.308 ++// USA.
 151.309 ++
 151.310 ++// As a special exception, you may use this file as part of a free software
 151.311 ++// library without restriction.  Specifically, if other files instantiate
 151.312 ++// templates or use macros or inline functions from this file, or you compile
 151.313 ++// this file and link it with other files to produce an executable, this
 151.314 ++// file does not by itself cause the resulting executable to be covered by
 151.315 ++// the GNU General Public License.  This exception does not however
 151.316 ++// invalidate any other reasons why the executable file might be covered by
 151.317 ++// the GNU General Public License.
 151.318 ++
 151.319 ++//
 151.320 ++// ISO C++ 14882: 22.8  Standard locale categories.
 151.321 ++//
 151.322 ++
 151.323 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 151.324 ++
 151.325 ++#ifndef _C_LOCALE_H
 151.326 ++#define _C_LOCALE_H 1
 151.327 ++
 151.328 ++#pragma GCC system_header
 151.329 ++
 151.330 ++#include <cstring>              // get std::strlen
 151.331 ++#include <cstdio>               // get std::snprintf or std::sprintf
 151.332 ++#include <clocale>
 151.333 ++#include <langinfo.h>		// For codecvt
 151.334 ++#ifdef __UCLIBC_MJN3_ONLY__
 151.335 ++#warning fix this
 151.336 ++#endif
 151.337 ++#ifdef __UCLIBC_HAS_LOCALE__
 151.338 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 151.339 ++#endif
 151.340 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 151.341 ++#include <libintl.h> 		// For messages
 151.342 ++#endif
 151.343 ++
 151.344 ++#ifdef __UCLIBC_MJN3_ONLY__
 151.345 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 151.346 ++#endif
 151.347 ++#define _GLIBCXX_C_LOCALE_GNU 1
 151.348 ++
 151.349 ++#ifdef __UCLIBC_MJN3_ONLY__
 151.350 ++#warning fix categories
 151.351 ++#endif
 151.352 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 151.353 ++#define _GLIBCXX_NUM_CATEGORIES 0
 151.354 ++ 
 151.355 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.356 ++namespace __gnu_cxx
 151.357 ++{
 151.358 ++  extern "C" __typeof(uselocale) __uselocale;
 151.359 ++}
 151.360 ++#endif
 151.361 ++
 151.362 ++namespace std
 151.363 ++{
 151.364 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.365 ++  typedef __locale_t		__c_locale;
 151.366 ++#else
 151.367 ++  typedef int*			__c_locale;
 151.368 ++#endif
 151.369 ++
 151.370 ++  // Convert numeric value of type _Tv to string and return length of
 151.371 ++  // string.  If snprintf is available use it, otherwise fall back to
 151.372 ++  // the unsafe sprintf which, in general, can be dangerous and should
 151.373 ++  // be avoided.
 151.374 ++  template<typename _Tv>
 151.375 ++    int
 151.376 ++    __convert_from_v(char* __out, 
 151.377 ++		     const int __size __attribute__ ((__unused__)),
 151.378 ++		     const char* __fmt,
 151.379 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.380 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 151.381 ++    {
 151.382 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 151.383 ++#else
 151.384 ++		     _Tv __v, const __c_locale&, int __prec)
 151.385 ++    {
 151.386 ++# ifdef __UCLIBC_HAS_LOCALE__
 151.387 ++      char* __old = std::setlocale(LC_ALL, NULL);
 151.388 ++      char* __sav = new char[std::strlen(__old) + 1];
 151.389 ++      std::strcpy(__sav, __old);
 151.390 ++      std::setlocale(LC_ALL, "C");
 151.391 ++# endif
 151.392 ++#endif
 151.393 ++
 151.394 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 151.395 ++
 151.396 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.397 ++      __gnu_cxx::__uselocale(__old);
 151.398 ++#elif defined __UCLIBC_HAS_LOCALE__
 151.399 ++      std::setlocale(LC_ALL, __sav);
 151.400 ++      delete [] __sav;
 151.401 ++#endif
 151.402 ++      return __ret;
 151.403 ++    }
 151.404 ++}
 151.405 ++
 151.406 ++#endif
 151.407 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 151.408 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 151.409 +@@ -0,0 +1,306 @@
 151.410 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 151.411 ++
 151.412 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 151.413 ++//
 151.414 ++// This file is part of the GNU ISO C++ Library.  This library is free
 151.415 ++// software; you can redistribute it and/or modify it under the
 151.416 ++// terms of the GNU General Public License as published by the
 151.417 ++// Free Software Foundation; either version 2, or (at your option)
 151.418 ++// any later version.
 151.419 ++
 151.420 ++// This library is distributed in the hope that it will be useful,
 151.421 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 151.422 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 151.423 ++// GNU General Public License for more details.
 151.424 ++
 151.425 ++// You should have received a copy of the GNU General Public License along
 151.426 ++// with this library; see the file COPYING.  If not, write to the Free
 151.427 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 151.428 ++// USA.
 151.429 ++
 151.430 ++// As a special exception, you may use this file as part of a free software
 151.431 ++// library without restriction.  Specifically, if other files instantiate
 151.432 ++// templates or use macros or inline functions from this file, or you compile
 151.433 ++// this file and link it with other files to produce an executable, this
 151.434 ++// file does not by itself cause the resulting executable to be covered by
 151.435 ++// the GNU General Public License.  This exception does not however
 151.436 ++// invalidate any other reasons why the executable file might be covered by
 151.437 ++// the GNU General Public License.
 151.438 ++
 151.439 ++//
 151.440 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 151.441 ++//
 151.442 ++
 151.443 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 151.444 ++
 151.445 ++#include <locale>
 151.446 ++#include <bits/c++locale_internal.h>
 151.447 ++
 151.448 ++namespace std
 151.449 ++{
 151.450 ++  // Specializations.
 151.451 ++#ifdef _GLIBCXX_USE_WCHAR_T
 151.452 ++  codecvt_base::result
 151.453 ++  codecvt<wchar_t, char, mbstate_t>::
 151.454 ++  do_out(state_type& __state, const intern_type* __from, 
 151.455 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 151.456 ++	 extern_type* __to, extern_type* __to_end,
 151.457 ++	 extern_type*& __to_next) const
 151.458 ++  {
 151.459 ++    result __ret = ok;
 151.460 ++    state_type __tmp_state(__state);
 151.461 ++
 151.462 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.463 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 151.464 ++#endif
 151.465 ++
 151.466 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 151.467 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 151.468 ++    // NB: wcsnrtombs is a GNU extension
 151.469 ++    for (__from_next = __from, __to_next = __to;
 151.470 ++	 __from_next < __from_end && __to_next < __to_end
 151.471 ++	 && __ret == ok;)
 151.472 ++      {
 151.473 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 151.474 ++						      __from_end - __from_next);
 151.475 ++	if (!__from_chunk_end)
 151.476 ++	  __from_chunk_end = __from_end;
 151.477 ++
 151.478 ++	__from = __from_next;
 151.479 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 151.480 ++					 __from_chunk_end - __from_next,
 151.481 ++					 __to_end - __to_next, &__state);
 151.482 ++	if (__conv == static_cast<size_t>(-1))
 151.483 ++	  {
 151.484 ++	    // In case of error, in order to stop at the exact place we
 151.485 ++	    // have to start again from the beginning with a series of
 151.486 ++	    // wcrtomb.
 151.487 ++	    for (; __from < __from_next; ++__from)
 151.488 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 151.489 ++	    __state = __tmp_state;
 151.490 ++	    __ret = error;
 151.491 ++	  }
 151.492 ++	else if (__from_next && __from_next < __from_chunk_end)
 151.493 ++	  {
 151.494 ++	    __to_next += __conv;
 151.495 ++	    __ret = partial;
 151.496 ++	  }
 151.497 ++	else
 151.498 ++	  {
 151.499 ++	    __from_next = __from_chunk_end;
 151.500 ++	    __to_next += __conv;
 151.501 ++	  }
 151.502 ++
 151.503 ++	if (__from_next < __from_end && __ret == ok)
 151.504 ++	  {
 151.505 ++	    extern_type __buf[MB_LEN_MAX];
 151.506 ++	    __tmp_state = __state;
 151.507 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 151.508 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 151.509 ++	      __ret = partial;
 151.510 ++	    else
 151.511 ++	      {
 151.512 ++		memcpy(__to_next, __buf, __conv);
 151.513 ++		__state = __tmp_state;
 151.514 ++		__to_next += __conv;
 151.515 ++		++__from_next;
 151.516 ++	      }
 151.517 ++	  }
 151.518 ++      }
 151.519 ++
 151.520 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.521 ++    __uselocale(__old);
 151.522 ++#endif
 151.523 ++
 151.524 ++    return __ret; 
 151.525 ++  }
 151.526 ++  
 151.527 ++  codecvt_base::result
 151.528 ++  codecvt<wchar_t, char, mbstate_t>::
 151.529 ++  do_in(state_type& __state, const extern_type* __from, 
 151.530 ++	const extern_type* __from_end, const extern_type*& __from_next,
 151.531 ++	intern_type* __to, intern_type* __to_end,
 151.532 ++	intern_type*& __to_next) const
 151.533 ++  {
 151.534 ++    result __ret = ok;
 151.535 ++    state_type __tmp_state(__state);
 151.536 ++
 151.537 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.538 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 151.539 ++#endif
 151.540 ++
 151.541 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 151.542 ++    // in case we store a L'\0' and then continue, in a loop.
 151.543 ++    // NB: mbsnrtowcs is a GNU extension
 151.544 ++    for (__from_next = __from, __to_next = __to;
 151.545 ++	 __from_next < __from_end && __to_next < __to_end
 151.546 ++	 && __ret == ok;)
 151.547 ++      {
 151.548 ++	const extern_type* __from_chunk_end;
 151.549 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 151.550 ++								  __from_end
 151.551 ++								  - __from_next));
 151.552 ++	if (!__from_chunk_end)
 151.553 ++	  __from_chunk_end = __from_end;
 151.554 ++
 151.555 ++	__from = __from_next;
 151.556 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 151.557 ++				   __from_chunk_end - __from_next,
 151.558 ++				   __to_end - __to_next, &__state);
 151.559 ++	if (__conv == static_cast<size_t>(-1))
 151.560 ++	  {
 151.561 ++	    // In case of error, in order to stop at the exact place we
 151.562 ++	    // have to start again from the beginning with a series of
 151.563 ++	    // mbrtowc.
 151.564 ++	    for (;; ++__to_next, __from += __conv)
 151.565 ++	      {
 151.566 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 151.567 ++				 &__tmp_state);
 151.568 ++		if (__conv == static_cast<size_t>(-1)
 151.569 ++		    || __conv == static_cast<size_t>(-2))
 151.570 ++		  break;
 151.571 ++	      }
 151.572 ++	    __from_next = __from;
 151.573 ++	    __state = __tmp_state;	    
 151.574 ++	    __ret = error;
 151.575 ++	  }
 151.576 ++	else if (__from_next && __from_next < __from_chunk_end)
 151.577 ++	  {
 151.578 ++	    // It is unclear what to return in this case (see DR 382). 
 151.579 ++	    __to_next += __conv;
 151.580 ++	    __ret = partial;
 151.581 ++	  }
 151.582 ++	else
 151.583 ++	  {
 151.584 ++	    __from_next = __from_chunk_end;
 151.585 ++	    __to_next += __conv;
 151.586 ++	  }
 151.587 ++
 151.588 ++	if (__from_next < __from_end && __ret == ok)
 151.589 ++	  {
 151.590 ++	    if (__to_next < __to_end)
 151.591 ++	      {
 151.592 ++		// XXX Probably wrong for stateful encodings
 151.593 ++		__tmp_state = __state;		
 151.594 ++		++__from_next;
 151.595 ++		*__to_next++ = L'\0';
 151.596 ++	      }
 151.597 ++	    else
 151.598 ++	      __ret = partial;
 151.599 ++	  }
 151.600 ++      }
 151.601 ++
 151.602 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.603 ++    __uselocale(__old);
 151.604 ++#endif
 151.605 ++
 151.606 ++    return __ret; 
 151.607 ++  }
 151.608 ++
 151.609 ++  int 
 151.610 ++  codecvt<wchar_t, char, mbstate_t>::
 151.611 ++  do_encoding() const throw()
 151.612 ++  {
 151.613 ++    // XXX This implementation assumes that the encoding is
 151.614 ++    // stateless and is either single-byte or variable-width.
 151.615 ++    int __ret = 0;
 151.616 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.617 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 151.618 ++#endif
 151.619 ++    if (MB_CUR_MAX == 1)
 151.620 ++      __ret = 1;
 151.621 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.622 ++    __uselocale(__old);
 151.623 ++#endif
 151.624 ++    return __ret;
 151.625 ++  }  
 151.626 ++
 151.627 ++  int 
 151.628 ++  codecvt<wchar_t, char, mbstate_t>::
 151.629 ++  do_max_length() const throw()
 151.630 ++  {
 151.631 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.632 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 151.633 ++#endif
 151.634 ++    // XXX Probably wrong for stateful encodings.
 151.635 ++    int __ret = MB_CUR_MAX;
 151.636 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.637 ++    __uselocale(__old);
 151.638 ++#endif
 151.639 ++    return __ret;
 151.640 ++  }
 151.641 ++  
 151.642 ++  int 
 151.643 ++  codecvt<wchar_t, char, mbstate_t>::
 151.644 ++  do_length(state_type& __state, const extern_type* __from,
 151.645 ++	    const extern_type* __end, size_t __max) const
 151.646 ++  {
 151.647 ++    int __ret = 0;
 151.648 ++    state_type __tmp_state(__state);
 151.649 ++
 151.650 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.651 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 151.652 ++#endif
 151.653 ++
 151.654 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 151.655 ++    // in case we advance past it and then continue, in a loop.
 151.656 ++    // NB: mbsnrtowcs is a GNU extension
 151.657 ++  
 151.658 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 151.659 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 151.660 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 151.661 ++							   * __max));
 151.662 ++    while (__from < __end && __max)
 151.663 ++      {
 151.664 ++	const extern_type* __from_chunk_end;
 151.665 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 151.666 ++								  __end
 151.667 ++								  - __from));
 151.668 ++	if (!__from_chunk_end)
 151.669 ++	  __from_chunk_end = __end;
 151.670 ++
 151.671 ++	const extern_type* __tmp_from = __from;
 151.672 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 151.673 ++				   __from_chunk_end - __from,
 151.674 ++				   __max, &__state);
 151.675 ++	if (__conv == static_cast<size_t>(-1))
 151.676 ++	  {
 151.677 ++	    // In case of error, in order to stop at the exact place we
 151.678 ++	    // have to start again from the beginning with a series of
 151.679 ++	    // mbrtowc.
 151.680 ++	    for (__from = __tmp_from;; __from += __conv)
 151.681 ++	      {
 151.682 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 151.683 ++				 &__tmp_state);
 151.684 ++		if (__conv == static_cast<size_t>(-1)
 151.685 ++		    || __conv == static_cast<size_t>(-2))
 151.686 ++		  break;
 151.687 ++	      }
 151.688 ++	    __state = __tmp_state;
 151.689 ++	    __ret += __from - __tmp_from;
 151.690 ++	    break;
 151.691 ++	  }
 151.692 ++	if (!__from)
 151.693 ++	  __from = __from_chunk_end;
 151.694 ++	
 151.695 ++	__ret += __from - __tmp_from;
 151.696 ++	__max -= __conv;
 151.697 ++
 151.698 ++	if (__from < __end && __max)
 151.699 ++	  {
 151.700 ++	    // XXX Probably wrong for stateful encodings
 151.701 ++	    __tmp_state = __state;
 151.702 ++	    ++__from;
 151.703 ++	    ++__ret;
 151.704 ++	    --__max;
 151.705 ++	  }
 151.706 ++      }
 151.707 ++
 151.708 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.709 ++    __uselocale(__old);
 151.710 ++#endif
 151.711 ++
 151.712 ++    return __ret; 
 151.713 ++  }
 151.714 ++#endif
 151.715 ++}
 151.716 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc
 151.717 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
 151.718 +@@ -0,0 +1,80 @@
 151.719 ++// std::collate implementation details, GNU version -*- C++ -*-
 151.720 ++
 151.721 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 151.722 ++//
 151.723 ++// This file is part of the GNU ISO C++ Library.  This library is free
 151.724 ++// software; you can redistribute it and/or modify it under the
 151.725 ++// terms of the GNU General Public License as published by the
 151.726 ++// Free Software Foundation; either version 2, or (at your option)
 151.727 ++// any later version.
 151.728 ++
 151.729 ++// This library is distributed in the hope that it will be useful,
 151.730 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 151.731 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 151.732 ++// GNU General Public License for more details.
 151.733 ++
 151.734 ++// You should have received a copy of the GNU General Public License along
 151.735 ++// with this library; see the file COPYING.  If not, write to the Free
 151.736 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 151.737 ++// USA.
 151.738 ++
 151.739 ++// As a special exception, you may use this file as part of a free software
 151.740 ++// library without restriction.  Specifically, if other files instantiate
 151.741 ++// templates or use macros or inline functions from this file, or you compile
 151.742 ++// this file and link it with other files to produce an executable, this
 151.743 ++// file does not by itself cause the resulting executable to be covered by
 151.744 ++// the GNU General Public License.  This exception does not however
 151.745 ++// invalidate any other reasons why the executable file might be covered by
 151.746 ++// the GNU General Public License.
 151.747 ++
 151.748 ++//
 151.749 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 151.750 ++//
 151.751 ++
 151.752 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 151.753 ++
 151.754 ++#include <locale>
 151.755 ++#include <bits/c++locale_internal.h>
 151.756 ++
 151.757 ++#ifndef __UCLIBC_HAS_XLOCALE__
 151.758 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 151.759 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 151.760 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 151.761 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 151.762 ++#endif
 151.763 ++
 151.764 ++namespace std
 151.765 ++{
 151.766 ++  // These are basically extensions to char_traits, and perhaps should
 151.767 ++  // be put there instead of here.
 151.768 ++  template<>
 151.769 ++    int 
 151.770 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 151.771 ++    { 
 151.772 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 151.773 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 151.774 ++    }
 151.775 ++  
 151.776 ++  template<>
 151.777 ++    size_t
 151.778 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 151.779 ++				size_t __n) const 
 151.780 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 151.781 ++
 151.782 ++#ifdef _GLIBCXX_USE_WCHAR_T
 151.783 ++  template<>
 151.784 ++    int 
 151.785 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 151.786 ++				 const wchar_t* __two) const
 151.787 ++    {
 151.788 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 151.789 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 151.790 ++    }
 151.791 ++  
 151.792 ++  template<>
 151.793 ++    size_t
 151.794 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 151.795 ++				   size_t __n) const
 151.796 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 151.797 ++#endif
 151.798 ++}
 151.799 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 151.800 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 151.801 +@@ -0,0 +1,314 @@
 151.802 ++// std::ctype implementation details, GNU version -*- C++ -*-
 151.803 ++
 151.804 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 151.805 ++//
 151.806 ++// This file is part of the GNU ISO C++ Library.  This library is free
 151.807 ++// software; you can redistribute it and/or modify it under the
 151.808 ++// terms of the GNU General Public License as published by the
 151.809 ++// Free Software Foundation; either version 2, or (at your option)
 151.810 ++// any later version.
 151.811 ++
 151.812 ++// This library is distributed in the hope that it will be useful,
 151.813 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 151.814 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 151.815 ++// GNU General Public License for more details.
 151.816 ++
 151.817 ++// You should have received a copy of the GNU General Public License along
 151.818 ++// with this library; see the file COPYING.  If not, write to the Free
 151.819 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 151.820 ++// USA.
 151.821 ++
 151.822 ++// As a special exception, you may use this file as part of a free software
 151.823 ++// library without restriction.  Specifically, if other files instantiate
 151.824 ++// templates or use macros or inline functions from this file, or you compile
 151.825 ++// this file and link it with other files to produce an executable, this
 151.826 ++// file does not by itself cause the resulting executable to be covered by
 151.827 ++// the GNU General Public License.  This exception does not however
 151.828 ++// invalidate any other reasons why the executable file might be covered by
 151.829 ++// the GNU General Public License.
 151.830 ++
 151.831 ++//
 151.832 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 151.833 ++//
 151.834 ++
 151.835 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 151.836 ++
 151.837 ++#define _LIBC
 151.838 ++#include <locale>
 151.839 ++#undef _LIBC
 151.840 ++#include <bits/c++locale_internal.h>
 151.841 ++
 151.842 ++#ifndef __UCLIBC_HAS_XLOCALE__
 151.843 ++#define __wctype_l(S, L)           wctype((S))
 151.844 ++#define __towupper_l(C, L)         towupper((C))
 151.845 ++#define __towlower_l(C, L)         towlower((C))
 151.846 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 151.847 ++#endif
 151.848 ++
 151.849 ++namespace std
 151.850 ++{
 151.851 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 151.852 ++  // various /config/os/* files.
 151.853 ++  template<>
 151.854 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 151.855 ++    : ctype<char>(0, false, __refs) 
 151.856 ++    { 		
 151.857 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 151.858 ++	{
 151.859 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 151.860 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 151.861 ++#ifdef __UCLIBC_HAS_XLOCALE__
 151.862 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 151.863 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 151.864 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 151.865 ++#endif
 151.866 ++	}
 151.867 ++    }
 151.868 ++
 151.869 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 151.870 ++  ctype<wchar_t>::__wmask_type
 151.871 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 151.872 ++  {
 151.873 ++    __wmask_type __ret;
 151.874 ++    switch (__m)
 151.875 ++      {
 151.876 ++      case space:
 151.877 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 151.878 ++	break;
 151.879 ++      case print:
 151.880 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 151.881 ++	break;
 151.882 ++      case cntrl:
 151.883 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 151.884 ++	break;
 151.885 ++      case upper:
 151.886 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 151.887 ++	break;
 151.888 ++      case lower:
 151.889 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 151.890 ++	break;
 151.891 ++      case alpha:
 151.892 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 151.893 ++	break;
 151.894 ++      case digit:
 151.895 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 151.896 ++	break;
 151.897 ++      case punct:
 151.898 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 151.899 ++	break;
 151.900 ++      case xdigit:
 151.901 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 151.902 ++	break;
 151.903 ++      case alnum:
 151.904 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 151.905 ++	break;
 151.906 ++      case graph:
 151.907 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 151.908 ++	break;
 151.909 ++      default:
 151.910 ++	__ret = __wmask_type();
 151.911 ++      }
 151.912 ++    return __ret;
 151.913 ++  }
 151.914 ++  
 151.915 ++  wchar_t
 151.916 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 151.917 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 151.918 ++
 151.919 ++  const wchar_t*
 151.920 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 151.921 ++  {
 151.922 ++    while (__lo < __hi)
 151.923 ++      {
 151.924 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 151.925 ++        ++__lo;
 151.926 ++      }
 151.927 ++    return __hi;
 151.928 ++  }
 151.929 ++  
 151.930 ++  wchar_t
 151.931 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 151.932 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 151.933 ++  
 151.934 ++  const wchar_t*
 151.935 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 151.936 ++  {
 151.937 ++    while (__lo < __hi)
 151.938 ++      {
 151.939 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 151.940 ++        ++__lo;
 151.941 ++      }
 151.942 ++    return __hi;
 151.943 ++  }
 151.944 ++
 151.945 ++  bool
 151.946 ++  ctype<wchar_t>::
 151.947 ++  do_is(mask __m, wchar_t __c) const
 151.948 ++  { 
 151.949 ++    // The case of __m == ctype_base::space is particularly important,
 151.950 ++    // due to its use in many istream functions.  Therefore we deal with
 151.951 ++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 151.952 ++    // is the mask corresponding to ctype_base::space.  NB: an encoding
 151.953 ++    // change would not affect correctness!
 151.954 ++    bool __ret = false;
 151.955 ++    if (__m == _M_bit[5])
 151.956 ++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 151.957 ++    else
 151.958 ++      {
 151.959 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 151.960 ++	// library for blank.
 151.961 ++	const size_t __bitmasksize = 11;
 151.962 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 151.963 ++	  if (__m & _M_bit[__bitcur])
 151.964 ++	    {
 151.965 ++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 151.966 ++		{
 151.967 ++		  __ret = true;
 151.968 ++		  break;
 151.969 ++		}
 151.970 ++	      else if (__m == _M_bit[__bitcur])
 151.971 ++		break;
 151.972 ++	    }
 151.973 ++      }
 151.974 ++    return __ret;    
 151.975 ++  }
 151.976 ++
 151.977 ++  const wchar_t* 
 151.978 ++  ctype<wchar_t>::
 151.979 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 151.980 ++  {
 151.981 ++    for (; __lo < __hi; ++__vec, ++__lo)
 151.982 ++      {
 151.983 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 151.984 ++	// library for blank.
 151.985 ++	const size_t __bitmasksize = 11; 
 151.986 ++	mask __m = 0;
 151.987 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 151.988 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 151.989 ++	    __m |= _M_bit[__bitcur];
 151.990 ++	*__vec = __m;
 151.991 ++      }
 151.992 ++    return __hi;
 151.993 ++  }
 151.994 ++  
 151.995 ++  const wchar_t* 
 151.996 ++  ctype<wchar_t>::
 151.997 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 151.998 ++  {
 151.999 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
151.1000 ++      ++__lo;
151.1001 ++    return __lo;
151.1002 ++  }
151.1003 ++
151.1004 ++  const wchar_t*
151.1005 ++  ctype<wchar_t>::
151.1006 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
151.1007 ++  {
151.1008 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
151.1009 ++      ++__lo;
151.1010 ++    return __lo;
151.1011 ++  }
151.1012 ++
151.1013 ++  wchar_t
151.1014 ++  ctype<wchar_t>::
151.1015 ++  do_widen(char __c) const
151.1016 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
151.1017 ++
151.1018 ++  const char* 
151.1019 ++  ctype<wchar_t>::
151.1020 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
151.1021 ++  {
151.1022 ++    while (__lo < __hi)
151.1023 ++      {
151.1024 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
151.1025 ++	++__lo;
151.1026 ++	++__dest;
151.1027 ++      }
151.1028 ++    return __hi;
151.1029 ++  }
151.1030 ++
151.1031 ++  char
151.1032 ++  ctype<wchar_t>::
151.1033 ++  do_narrow(wchar_t __wc, char __dfault) const
151.1034 ++  {
151.1035 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
151.1036 ++      return _M_narrow[__wc];
151.1037 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1038 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
151.1039 ++#endif
151.1040 ++    const int __c = wctob(__wc);
151.1041 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1042 ++    __uselocale(__old);
151.1043 ++#endif
151.1044 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
151.1045 ++  }
151.1046 ++
151.1047 ++  const wchar_t*
151.1048 ++  ctype<wchar_t>::
151.1049 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
151.1050 ++	    char* __dest) const
151.1051 ++  {
151.1052 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1053 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
151.1054 ++#endif
151.1055 ++    if (_M_narrow_ok)
151.1056 ++      while (__lo < __hi)
151.1057 ++	{
151.1058 ++	  if (*__lo >= 0 && *__lo < 128)
151.1059 ++	    *__dest = _M_narrow[*__lo];
151.1060 ++	  else
151.1061 ++	    {
151.1062 ++	      const int __c = wctob(*__lo);
151.1063 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
151.1064 ++	    }
151.1065 ++	  ++__lo;
151.1066 ++	  ++__dest;
151.1067 ++	}
151.1068 ++    else
151.1069 ++      while (__lo < __hi)
151.1070 ++	{
151.1071 ++	  const int __c = wctob(*__lo);
151.1072 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
151.1073 ++	  ++__lo;
151.1074 ++	  ++__dest;
151.1075 ++	}
151.1076 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1077 ++    __uselocale(__old);
151.1078 ++#endif
151.1079 ++    return __hi;
151.1080 ++  }
151.1081 ++
151.1082 ++  void
151.1083 ++  ctype<wchar_t>::_M_initialize_ctype()
151.1084 ++  {
151.1085 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1086 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
151.1087 ++#endif
151.1088 ++    wint_t __i;
151.1089 ++    for (__i = 0; __i < 128; ++__i)
151.1090 ++      {
151.1091 ++	const int __c = wctob(__i);
151.1092 ++	if (__c == EOF)
151.1093 ++	  break;
151.1094 ++	else
151.1095 ++	  _M_narrow[__i] = static_cast<char>(__c);
151.1096 ++      }
151.1097 ++    if (__i == 128)
151.1098 ++      _M_narrow_ok = true;
151.1099 ++    else
151.1100 ++      _M_narrow_ok = false;
151.1101 ++    for (size_t __j = 0;
151.1102 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
151.1103 ++      _M_widen[__j] = btowc(__j);
151.1104 ++
151.1105 ++    for (size_t __k = 0; __k <= 11; ++__k)
151.1106 ++      { 
151.1107 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
151.1108 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
151.1109 ++      }
151.1110 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1111 ++    __uselocale(__old);
151.1112 ++#endif
151.1113 ++  }
151.1114 ++#endif //  _GLIBCXX_USE_WCHAR_T
151.1115 ++}
151.1116 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc
151.1117 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
151.1118 +@@ -0,0 +1,100 @@
151.1119 ++// std::messages implementation details, GNU version -*- C++ -*-
151.1120 ++
151.1121 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
151.1122 ++//
151.1123 ++// This file is part of the GNU ISO C++ Library.  This library is free
151.1124 ++// software; you can redistribute it and/or modify it under the
151.1125 ++// terms of the GNU General Public License as published by the
151.1126 ++// Free Software Foundation; either version 2, or (at your option)
151.1127 ++// any later version.
151.1128 ++
151.1129 ++// This library is distributed in the hope that it will be useful,
151.1130 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
151.1131 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151.1132 ++// GNU General Public License for more details.
151.1133 ++
151.1134 ++// You should have received a copy of the GNU General Public License along
151.1135 ++// with this library; see the file COPYING.  If not, write to the Free
151.1136 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
151.1137 ++// USA.
151.1138 ++
151.1139 ++// As a special exception, you may use this file as part of a free software
151.1140 ++// library without restriction.  Specifically, if other files instantiate
151.1141 ++// templates or use macros or inline functions from this file, or you compile
151.1142 ++// this file and link it with other files to produce an executable, this
151.1143 ++// file does not by itself cause the resulting executable to be covered by
151.1144 ++// the GNU General Public License.  This exception does not however
151.1145 ++// invalidate any other reasons why the executable file might be covered by
151.1146 ++// the GNU General Public License.
151.1147 ++
151.1148 ++//
151.1149 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
151.1150 ++//
151.1151 ++
151.1152 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
151.1153 ++
151.1154 ++#include <locale>
151.1155 ++#include <bits/c++locale_internal.h>
151.1156 ++
151.1157 ++#ifdef __UCLIBC_MJN3_ONLY__
151.1158 ++#warning fix gettext stuff
151.1159 ++#endif
151.1160 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
151.1161 ++extern "C" char *__dcgettext(const char *domainname,
151.1162 ++			     const char *msgid, int category);
151.1163 ++#undef gettext
151.1164 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
151.1165 ++#else
151.1166 ++#undef gettext
151.1167 ++#define gettext(msgid) (msgid)
151.1168 ++#endif
151.1169 ++
151.1170 ++namespace std
151.1171 ++{
151.1172 ++  // Specializations.
151.1173 ++  template<>
151.1174 ++    string
151.1175 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
151.1176 ++    {
151.1177 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1178 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
151.1179 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
151.1180 ++      __uselocale(__old);
151.1181 ++      return string(__msg);
151.1182 ++#elif defined __UCLIBC_HAS_LOCALE__
151.1183 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
151.1184 ++      setlocale(LC_ALL, _M_name_messages);
151.1185 ++      const char* __msg = gettext(__dfault.c_str());
151.1186 ++      setlocale(LC_ALL, __old);
151.1187 ++      free(__old);
151.1188 ++      return string(__msg);
151.1189 ++#else
151.1190 ++      const char* __msg = gettext(__dfault.c_str());
151.1191 ++      return string(__msg);
151.1192 ++#endif
151.1193 ++    }
151.1194 ++
151.1195 ++#ifdef _GLIBCXX_USE_WCHAR_T
151.1196 ++  template<>
151.1197 ++    wstring
151.1198 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
151.1199 ++    {
151.1200 ++# ifdef __UCLIBC_HAS_XLOCALE__
151.1201 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
151.1202 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
151.1203 ++      __uselocale(__old);
151.1204 ++      return _M_convert_from_char(__msg);
151.1205 ++# elif defined __UCLIBC_HAS_LOCALE__
151.1206 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
151.1207 ++      setlocale(LC_ALL, _M_name_messages);
151.1208 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
151.1209 ++      setlocale(LC_ALL, __old);
151.1210 ++      free(__old);
151.1211 ++      return _M_convert_from_char(__msg);
151.1212 ++# else
151.1213 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
151.1214 ++      return _M_convert_from_char(__msg);
151.1215 ++# endif
151.1216 ++    }
151.1217 ++#endif
151.1218 ++}
151.1219 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h
151.1220 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h
151.1221 +@@ -0,0 +1,121 @@
151.1222 ++// std::messages implementation details, GNU version -*- C++ -*-
151.1223 ++
151.1224 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
151.1225 ++//
151.1226 ++// This file is part of the GNU ISO C++ Library.  This library is free
151.1227 ++// software; you can redistribute it and/or modify it under the
151.1228 ++// terms of the GNU General Public License as published by the
151.1229 ++// Free Software Foundation; either version 2, or (at your option)
151.1230 ++// any later version.
151.1231 ++
151.1232 ++// This library is distributed in the hope that it will be useful,
151.1233 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
151.1234 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151.1235 ++// GNU General Public License for more details.
151.1236 ++
151.1237 ++// You should have received a copy of the GNU General Public License along
151.1238 ++// with this library; see the file COPYING.  If not, write to the Free
151.1239 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
151.1240 ++// USA.
151.1241 ++
151.1242 ++// As a special exception, you may use this file as part of a free software
151.1243 ++// library without restriction.  Specifically, if other files instantiate
151.1244 ++// templates or use macros or inline functions from this file, or you compile
151.1245 ++// this file and link it with other files to produce an executable, this
151.1246 ++// file does not by itself cause the resulting executable to be covered by
151.1247 ++// the GNU General Public License.  This exception does not however
151.1248 ++// invalidate any other reasons why the executable file might be covered by
151.1249 ++// the GNU General Public License.
151.1250 ++
151.1251 ++//
151.1252 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
151.1253 ++//
151.1254 ++
151.1255 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
151.1256 ++
151.1257 ++#ifdef __UCLIBC_MJN3_ONLY__
151.1258 ++#warning fix prototypes for *textdomain funcs
151.1259 ++#endif
151.1260 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
151.1261 ++extern "C" char *__textdomain(const char *domainname);
151.1262 ++extern "C" char *__bindtextdomain(const char *domainname,
151.1263 ++				  const char *dirname);
151.1264 ++#else
151.1265 ++#undef __textdomain
151.1266 ++#undef __bindtextdomain
151.1267 ++#define __textdomain(D)           ((void)0)
151.1268 ++#define __bindtextdomain(D,P)     ((void)0)
151.1269 ++#endif
151.1270 ++
151.1271 ++  // Non-virtual member functions.
151.1272 ++  template<typename _CharT>
151.1273 ++     messages<_CharT>::messages(size_t __refs)
151.1274 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
151.1275 ++       _M_name_messages(_S_get_c_name())
151.1276 ++     { }
151.1277 ++
151.1278 ++  template<typename _CharT>
151.1279 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
151.1280 ++				size_t __refs) 
151.1281 ++     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
151.1282 ++     {
151.1283 ++       const size_t __len = std::strlen(__s) + 1;
151.1284 ++       char* __tmp = new char[__len];
151.1285 ++       std::memcpy(__tmp, __s, __len);
151.1286 ++       _M_name_messages = __tmp;
151.1287 ++
151.1288 ++       // Last to avoid leaking memory if new throws.
151.1289 ++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
151.1290 ++     }
151.1291 ++
151.1292 ++  template<typename _CharT>
151.1293 ++    typename messages<_CharT>::catalog 
151.1294 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
151.1295 ++			   const char* __dir) const
151.1296 ++    { 
151.1297 ++      __bindtextdomain(__s.c_str(), __dir);
151.1298 ++      return this->do_open(__s, __loc); 
151.1299 ++    }
151.1300 ++
151.1301 ++  // Virtual member functions.
151.1302 ++  template<typename _CharT>
151.1303 ++    messages<_CharT>::~messages()
151.1304 ++    { 
151.1305 ++      if (_M_name_messages != _S_get_c_name())
151.1306 ++	delete [] _M_name_messages;
151.1307 ++      _S_destroy_c_locale(_M_c_locale_messages); 
151.1308 ++    }
151.1309 ++
151.1310 ++  template<typename _CharT>
151.1311 ++    typename messages<_CharT>::catalog 
151.1312 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
151.1313 ++			      const locale&) const
151.1314 ++    { 
151.1315 ++      // No error checking is done, assume the catalog exists and can
151.1316 ++      // be used.
151.1317 ++      __textdomain(__s.c_str());
151.1318 ++      return 0;
151.1319 ++    }
151.1320 ++
151.1321 ++  template<typename _CharT>
151.1322 ++    void    
151.1323 ++    messages<_CharT>::do_close(catalog) const 
151.1324 ++    { }
151.1325 ++
151.1326 ++   // messages_byname
151.1327 ++   template<typename _CharT>
151.1328 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
151.1329 ++     : messages<_CharT>(__refs) 
151.1330 ++     { 
151.1331 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
151.1332 ++	 delete [] this->_M_name_messages;
151.1333 ++       char* __tmp = new char[std::strlen(__s) + 1];
151.1334 ++       std::strcpy(__tmp, __s);
151.1335 ++       this->_M_name_messages = __tmp;
151.1336 ++
151.1337 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
151.1338 ++	 {
151.1339 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
151.1340 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
151.1341 ++	 }
151.1342 ++     }
151.1343 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc
151.1344 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
151.1345 +@@ -0,0 +1,692 @@
151.1346 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
151.1347 ++
151.1348 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
151.1349 ++//
151.1350 ++// This file is part of the GNU ISO C++ Library.  This library is free
151.1351 ++// software; you can redistribute it and/or modify it under the
151.1352 ++// terms of the GNU General Public License as published by the
151.1353 ++// Free Software Foundation; either version 2, or (at your option)
151.1354 ++// any later version.
151.1355 ++
151.1356 ++// This library is distributed in the hope that it will be useful,
151.1357 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
151.1358 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151.1359 ++// GNU General Public License for more details.
151.1360 ++
151.1361 ++// You should have received a copy of the GNU General Public License along
151.1362 ++// with this library; see the file COPYING.  If not, write to the Free
151.1363 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
151.1364 ++// USA.
151.1365 ++
151.1366 ++// As a special exception, you may use this file as part of a free software
151.1367 ++// library without restriction.  Specifically, if other files instantiate
151.1368 ++// templates or use macros or inline functions from this file, or you compile
151.1369 ++// this file and link it with other files to produce an executable, this
151.1370 ++// file does not by itself cause the resulting executable to be covered by
151.1371 ++// the GNU General Public License.  This exception does not however
151.1372 ++// invalidate any other reasons why the executable file might be covered by
151.1373 ++// the GNU General Public License.
151.1374 ++
151.1375 ++//
151.1376 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
151.1377 ++//
151.1378 ++
151.1379 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
151.1380 ++
151.1381 ++#define _LIBC
151.1382 ++#include <locale>
151.1383 ++#undef _LIBC
151.1384 ++#include <bits/c++locale_internal.h>
151.1385 ++
151.1386 ++#ifdef __UCLIBC_MJN3_ONLY__
151.1387 ++#warning optimize this for uclibc
151.1388 ++#warning tailor for stub locale support
151.1389 ++#endif
151.1390 ++
151.1391 ++#ifndef __UCLIBC_HAS_XLOCALE__
151.1392 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
151.1393 ++#endif
151.1394 ++
151.1395 ++namespace std
151.1396 ++{
151.1397 ++  // Construct and return valid pattern consisting of some combination of:
151.1398 ++  // space none symbol sign value
151.1399 ++  money_base::pattern
151.1400 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
151.1401 ++  { 
151.1402 ++    pattern __ret;
151.1403 ++
151.1404 ++    // This insanely complicated routine attempts to construct a valid
151.1405 ++    // pattern for use with monyepunct. A couple of invariants:
151.1406 ++
151.1407 ++    // if (__precedes) symbol -> value
151.1408 ++    // else value -> symbol
151.1409 ++    
151.1410 ++    // if (__space) space
151.1411 ++    // else none
151.1412 ++
151.1413 ++    // none == never first
151.1414 ++    // space never first or last
151.1415 ++
151.1416 ++    // Any elegant implementations of this are welcome.
151.1417 ++    switch (__posn)
151.1418 ++      {
151.1419 ++      case 0:
151.1420 ++      case 1:
151.1421 ++	// 1 The sign precedes the value and symbol.
151.1422 ++	__ret.field[0] = sign;
151.1423 ++	if (__space)
151.1424 ++	  {
151.1425 ++	    // Pattern starts with sign.
151.1426 ++	    if (__precedes)
151.1427 ++	      {
151.1428 ++		__ret.field[1] = symbol;
151.1429 ++		__ret.field[3] = value;
151.1430 ++	      }
151.1431 ++	    else
151.1432 ++	      {
151.1433 ++		__ret.field[1] = value;
151.1434 ++		__ret.field[3] = symbol;
151.1435 ++	      }
151.1436 ++	    __ret.field[2] = space;
151.1437 ++	  }
151.1438 ++	else
151.1439 ++	  {
151.1440 ++	    // Pattern starts with sign and ends with none.
151.1441 ++	    if (__precedes)
151.1442 ++	      {
151.1443 ++		__ret.field[1] = symbol;
151.1444 ++		__ret.field[2] = value;
151.1445 ++	      }
151.1446 ++	    else
151.1447 ++	      {
151.1448 ++		__ret.field[1] = value;
151.1449 ++		__ret.field[2] = symbol;
151.1450 ++	      }
151.1451 ++	    __ret.field[3] = none;
151.1452 ++	  }
151.1453 ++	break;
151.1454 ++      case 2:
151.1455 ++	// 2 The sign follows the value and symbol.
151.1456 ++	if (__space)
151.1457 ++	  {
151.1458 ++	    // Pattern either ends with sign.
151.1459 ++	    if (__precedes)
151.1460 ++	      {
151.1461 ++		__ret.field[0] = symbol;
151.1462 ++		__ret.field[2] = value;
151.1463 ++	      }
151.1464 ++	    else
151.1465 ++	      {
151.1466 ++		__ret.field[0] = value;
151.1467 ++		__ret.field[2] = symbol;
151.1468 ++	      }
151.1469 ++	    __ret.field[1] = space;
151.1470 ++	    __ret.field[3] = sign;
151.1471 ++	  }
151.1472 ++	else
151.1473 ++	  {
151.1474 ++	    // Pattern ends with sign then none.
151.1475 ++	    if (__precedes)
151.1476 ++	      {
151.1477 ++		__ret.field[0] = symbol;
151.1478 ++		__ret.field[1] = value;
151.1479 ++	      }
151.1480 ++	    else
151.1481 ++	      {
151.1482 ++		__ret.field[0] = value;
151.1483 ++		__ret.field[1] = symbol;
151.1484 ++	      }
151.1485 ++	    __ret.field[2] = sign;
151.1486 ++	    __ret.field[3] = none;
151.1487 ++	  }
151.1488 ++	break;
151.1489 ++      case 3:
151.1490 ++	// 3 The sign immediately precedes the symbol.
151.1491 ++	if (__precedes)
151.1492 ++	  {
151.1493 ++	    __ret.field[0] = sign;
151.1494 ++	    __ret.field[1] = symbol;	    
151.1495 ++	    if (__space)
151.1496 ++	      {
151.1497 ++		__ret.field[2] = space;
151.1498 ++		__ret.field[3] = value;
151.1499 ++	      }
151.1500 ++	    else
151.1501 ++	      {
151.1502 ++		__ret.field[2] = value;		
151.1503 ++		__ret.field[3] = none;
151.1504 ++	      }
151.1505 ++	  }
151.1506 ++	else
151.1507 ++	  {
151.1508 ++	    __ret.field[0] = value;
151.1509 ++	    if (__space)
151.1510 ++	      {
151.1511 ++		__ret.field[1] = space;
151.1512 ++		__ret.field[2] = sign;
151.1513 ++		__ret.field[3] = symbol;
151.1514 ++	      }
151.1515 ++	    else
151.1516 ++	      {
151.1517 ++		__ret.field[1] = sign;
151.1518 ++		__ret.field[2] = symbol;
151.1519 ++		__ret.field[3] = none;
151.1520 ++	      }
151.1521 ++	  }
151.1522 ++	break;
151.1523 ++      case 4:
151.1524 ++	// 4 The sign immediately follows the symbol.
151.1525 ++	if (__precedes)
151.1526 ++	  {
151.1527 ++	    __ret.field[0] = symbol;
151.1528 ++	    __ret.field[1] = sign;
151.1529 ++	    if (__space)
151.1530 ++	      {
151.1531 ++		__ret.field[2] = space;
151.1532 ++		__ret.field[3] = value;
151.1533 ++	      }
151.1534 ++	    else
151.1535 ++	      {
151.1536 ++		__ret.field[2] = value;
151.1537 ++		__ret.field[3] = none;
151.1538 ++	      }
151.1539 ++	  }
151.1540 ++	else
151.1541 ++	  {
151.1542 ++	    __ret.field[0] = value;
151.1543 ++	    if (__space)
151.1544 ++	      {
151.1545 ++		__ret.field[1] = space;
151.1546 ++		__ret.field[2] = symbol;
151.1547 ++		__ret.field[3] = sign;
151.1548 ++	      }
151.1549 ++	    else
151.1550 ++	      {
151.1551 ++		__ret.field[1] = symbol;
151.1552 ++		__ret.field[2] = sign;
151.1553 ++		__ret.field[3] = none;
151.1554 ++	      }
151.1555 ++	  }
151.1556 ++	break;
151.1557 ++      default:
151.1558 ++	__ret = pattern();
151.1559 ++      }
151.1560 ++    return __ret;
151.1561 ++  }
151.1562 ++
151.1563 ++  template<> 
151.1564 ++    void
151.1565 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
151.1566 ++						     const char*)
151.1567 ++    {
151.1568 ++      if (!_M_data)
151.1569 ++	_M_data = new __moneypunct_cache<char, true>;
151.1570 ++
151.1571 ++      if (!__cloc)
151.1572 ++	{
151.1573 ++	  // "C" locale
151.1574 ++	  _M_data->_M_decimal_point = '.';
151.1575 ++	  _M_data->_M_thousands_sep = ',';
151.1576 ++	  _M_data->_M_grouping = "";
151.1577 ++	  _M_data->_M_grouping_size = 0;
151.1578 ++	  _M_data->_M_curr_symbol = "";
151.1579 ++	  _M_data->_M_curr_symbol_size = 0;
151.1580 ++	  _M_data->_M_positive_sign = "";
151.1581 ++	  _M_data->_M_positive_sign_size = 0;
151.1582 ++	  _M_data->_M_negative_sign = "";
151.1583 ++	  _M_data->_M_negative_sign_size = 0;
151.1584 ++	  _M_data->_M_frac_digits = 0;
151.1585 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
151.1586 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
151.1587 ++
151.1588 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
151.1589 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
151.1590 ++	}
151.1591 ++      else
151.1592 ++	{
151.1593 ++	  // Named locale.
151.1594 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
151.1595 ++							__cloc));
151.1596 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
151.1597 ++							__cloc));
151.1598 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
151.1599 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
151.1600 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
151.1601 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
151.1602 ++
151.1603 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
151.1604 ++	  if (!__nposn)
151.1605 ++	    _M_data->_M_negative_sign = "()";
151.1606 ++	  else
151.1607 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
151.1608 ++							__cloc);
151.1609 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
151.1610 ++
151.1611 ++	  // _Intl == true
151.1612 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
151.1613 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
151.1614 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
151.1615 ++						      __cloc));
151.1616 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
151.1617 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
151.1618 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
151.1619 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
151.1620 ++							__pposn);
151.1621 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
151.1622 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
151.1623 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
151.1624 ++							__nposn);
151.1625 ++	}
151.1626 ++    }
151.1627 ++
151.1628 ++  template<> 
151.1629 ++    void
151.1630 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
151.1631 ++						      const char*)
151.1632 ++    {
151.1633 ++      if (!_M_data)
151.1634 ++	_M_data = new __moneypunct_cache<char, false>;
151.1635 ++
151.1636 ++      if (!__cloc)
151.1637 ++	{
151.1638 ++	  // "C" locale
151.1639 ++	  _M_data->_M_decimal_point = '.';
151.1640 ++	  _M_data->_M_thousands_sep = ',';
151.1641 ++	  _M_data->_M_grouping = "";
151.1642 ++	  _M_data->_M_grouping_size = 0;
151.1643 ++	  _M_data->_M_curr_symbol = "";
151.1644 ++	  _M_data->_M_curr_symbol_size = 0;
151.1645 ++	  _M_data->_M_positive_sign = "";
151.1646 ++	  _M_data->_M_positive_sign_size = 0;
151.1647 ++	  _M_data->_M_negative_sign = "";
151.1648 ++	  _M_data->_M_negative_sign_size = 0;
151.1649 ++	  _M_data->_M_frac_digits = 0;
151.1650 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
151.1651 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
151.1652 ++
151.1653 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
151.1654 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
151.1655 ++	}
151.1656 ++      else
151.1657 ++	{
151.1658 ++	  // Named locale.
151.1659 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
151.1660 ++							__cloc));
151.1661 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
151.1662 ++							__cloc));
151.1663 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
151.1664 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
151.1665 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
151.1666 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
151.1667 ++
151.1668 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
151.1669 ++	  if (!__nposn)
151.1670 ++	    _M_data->_M_negative_sign = "()";
151.1671 ++	  else
151.1672 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
151.1673 ++							__cloc);
151.1674 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
151.1675 ++
151.1676 ++	  // _Intl == false
151.1677 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
151.1678 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
151.1679 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
151.1680 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
151.1681 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
151.1682 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
151.1683 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
151.1684 ++							__pposn);
151.1685 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
151.1686 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
151.1687 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
151.1688 ++							__nposn);
151.1689 ++	}
151.1690 ++    }
151.1691 ++
151.1692 ++  template<> 
151.1693 ++    moneypunct<char, true>::~moneypunct()
151.1694 ++    { delete _M_data; }
151.1695 ++
151.1696 ++  template<> 
151.1697 ++    moneypunct<char, false>::~moneypunct()
151.1698 ++    { delete _M_data; }
151.1699 ++
151.1700 ++#ifdef _GLIBCXX_USE_WCHAR_T
151.1701 ++  template<> 
151.1702 ++    void
151.1703 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
151.1704 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1705 ++							const char*)
151.1706 ++#else
151.1707 ++							const char* __name)
151.1708 ++#endif
151.1709 ++    {
151.1710 ++      if (!_M_data)
151.1711 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
151.1712 ++
151.1713 ++      if (!__cloc)
151.1714 ++	{
151.1715 ++	  // "C" locale
151.1716 ++	  _M_data->_M_decimal_point = L'.';
151.1717 ++	  _M_data->_M_thousands_sep = L',';
151.1718 ++	  _M_data->_M_grouping = "";
151.1719 ++	  _M_data->_M_grouping_size = 0;
151.1720 ++	  _M_data->_M_curr_symbol = L"";
151.1721 ++	  _M_data->_M_curr_symbol_size = 0;
151.1722 ++	  _M_data->_M_positive_sign = L"";
151.1723 ++	  _M_data->_M_positive_sign_size = 0;
151.1724 ++	  _M_data->_M_negative_sign = L"";
151.1725 ++	  _M_data->_M_negative_sign_size = 0;
151.1726 ++	  _M_data->_M_frac_digits = 0;
151.1727 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
151.1728 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
151.1729 ++
151.1730 ++	  // Use ctype::widen code without the facet...
151.1731 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
151.1732 ++	    _M_data->_M_atoms[__i] =
151.1733 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
151.1734 ++	}
151.1735 ++      else
151.1736 ++	{
151.1737 ++	  // Named locale.
151.1738 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1739 ++	  __c_locale __old = __uselocale(__cloc);
151.1740 ++#else
151.1741 ++	  // Switch to named locale so that mbsrtowcs will work.
151.1742 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
151.1743 ++	  setlocale(LC_ALL, __name);
151.1744 ++#endif
151.1745 ++
151.1746 ++#ifdef __UCLIBC_MJN3_ONLY__
151.1747 ++#warning fix this... should be monetary
151.1748 ++#endif
151.1749 ++#ifdef __UCLIBC__
151.1750 ++# ifdef __UCLIBC_HAS_XLOCALE__
151.1751 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
151.1752 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
151.1753 ++# elif defined __UCLIBC_HAS_LOCALE__
151.1754 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
151.1755 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
151.1756 ++# endif
151.1757 ++#else
151.1758 ++	  union { char *__s; wchar_t __w; } __u;
151.1759 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
151.1760 ++	  _M_data->_M_decimal_point = __u.__w;
151.1761 ++
151.1762 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
151.1763 ++	  _M_data->_M_thousands_sep = __u.__w;
151.1764 ++#endif
151.1765 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
151.1766 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
151.1767 ++
151.1768 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
151.1769 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
151.1770 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
151.1771 ++
151.1772 ++	  wchar_t* __wcs_ps = 0;
151.1773 ++	  wchar_t* __wcs_ns = 0;
151.1774 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
151.1775 ++	  try
151.1776 ++	    {
151.1777 ++	      mbstate_t __state;
151.1778 ++	      size_t __len = strlen(__cpossign);
151.1779 ++	      if (__len)
151.1780 ++		{
151.1781 ++		  ++__len;
151.1782 ++		  memset(&__state, 0, sizeof(mbstate_t));
151.1783 ++		  __wcs_ps = new wchar_t[__len];
151.1784 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
151.1785 ++		  _M_data->_M_positive_sign = __wcs_ps;
151.1786 ++		}
151.1787 ++	      else
151.1788 ++		_M_data->_M_positive_sign = L"";
151.1789 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
151.1790 ++	      
151.1791 ++	      __len = strlen(__cnegsign);
151.1792 ++	      if (!__nposn)
151.1793 ++		_M_data->_M_negative_sign = L"()";
151.1794 ++	      else if (__len)
151.1795 ++		{ 
151.1796 ++		  ++__len;
151.1797 ++		  memset(&__state, 0, sizeof(mbstate_t));
151.1798 ++		  __wcs_ns = new wchar_t[__len];
151.1799 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
151.1800 ++		  _M_data->_M_negative_sign = __wcs_ns;
151.1801 ++		}
151.1802 ++	      else
151.1803 ++		_M_data->_M_negative_sign = L"";
151.1804 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
151.1805 ++	      
151.1806 ++	      // _Intl == true.
151.1807 ++	      __len = strlen(__ccurr);
151.1808 ++	      if (__len)
151.1809 ++		{
151.1810 ++		  ++__len;
151.1811 ++		  memset(&__state, 0, sizeof(mbstate_t));
151.1812 ++		  wchar_t* __wcs = new wchar_t[__len];
151.1813 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
151.1814 ++		  _M_data->_M_curr_symbol = __wcs;
151.1815 ++		}
151.1816 ++	      else
151.1817 ++		_M_data->_M_curr_symbol = L"";
151.1818 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
151.1819 ++	    }
151.1820 ++	  catch (...)
151.1821 ++	    {
151.1822 ++	      delete _M_data;
151.1823 ++	      _M_data = 0;
151.1824 ++	      delete __wcs_ps;
151.1825 ++	      delete __wcs_ns;	      
151.1826 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1827 ++	      __uselocale(__old);
151.1828 ++#else
151.1829 ++	      setlocale(LC_ALL, __old);
151.1830 ++	      free(__old);
151.1831 ++#endif
151.1832 ++	      __throw_exception_again;
151.1833 ++	    } 
151.1834 ++	  
151.1835 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
151.1836 ++						      __cloc));
151.1837 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
151.1838 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
151.1839 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
151.1840 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
151.1841 ++							__pposn);
151.1842 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
151.1843 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
151.1844 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
151.1845 ++							__nposn);
151.1846 ++
151.1847 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1848 ++	  __uselocale(__old);
151.1849 ++#else
151.1850 ++	  setlocale(LC_ALL, __old);
151.1851 ++	  free(__old);
151.1852 ++#endif
151.1853 ++	}
151.1854 ++    }
151.1855 ++
151.1856 ++  template<> 
151.1857 ++  void
151.1858 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
151.1859 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1860 ++						       const char*)
151.1861 ++#else
151.1862 ++                                                       const char* __name)
151.1863 ++#endif
151.1864 ++  {
151.1865 ++    if (!_M_data)
151.1866 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
151.1867 ++
151.1868 ++    if (!__cloc)
151.1869 ++	{
151.1870 ++	  // "C" locale
151.1871 ++	  _M_data->_M_decimal_point = L'.';
151.1872 ++	  _M_data->_M_thousands_sep = L',';
151.1873 ++	  _M_data->_M_grouping = "";
151.1874 ++          _M_data->_M_grouping_size = 0;
151.1875 ++	  _M_data->_M_curr_symbol = L"";
151.1876 ++	  _M_data->_M_curr_symbol_size = 0;
151.1877 ++	  _M_data->_M_positive_sign = L"";
151.1878 ++	  _M_data->_M_positive_sign_size = 0;
151.1879 ++	  _M_data->_M_negative_sign = L"";
151.1880 ++	  _M_data->_M_negative_sign_size = 0;
151.1881 ++	  _M_data->_M_frac_digits = 0;
151.1882 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
151.1883 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
151.1884 ++
151.1885 ++	  // Use ctype::widen code without the facet...
151.1886 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
151.1887 ++	    _M_data->_M_atoms[__i] =
151.1888 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
151.1889 ++	}
151.1890 ++      else
151.1891 ++	{
151.1892 ++	  // Named locale.
151.1893 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1894 ++	  __c_locale __old = __uselocale(__cloc);
151.1895 ++#else
151.1896 ++	  // Switch to named locale so that mbsrtowcs will work.
151.1897 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
151.1898 ++	  setlocale(LC_ALL, __name);
151.1899 ++#endif
151.1900 ++
151.1901 ++#ifdef __UCLIBC_MJN3_ONLY__
151.1902 ++#warning fix this... should be monetary
151.1903 ++#endif
151.1904 ++#ifdef __UCLIBC__
151.1905 ++# ifdef __UCLIBC_HAS_XLOCALE__
151.1906 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
151.1907 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
151.1908 ++# elif defined __UCLIBC_HAS_LOCALE__
151.1909 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
151.1910 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
151.1911 ++# endif
151.1912 ++#else
151.1913 ++          union { char *__s; wchar_t __w; } __u;
151.1914 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
151.1915 ++	  _M_data->_M_decimal_point = __u.__w;
151.1916 ++
151.1917 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
151.1918 ++	  _M_data->_M_thousands_sep = __u.__w;
151.1919 ++#endif
151.1920 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
151.1921 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
151.1922 ++
151.1923 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
151.1924 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
151.1925 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
151.1926 ++
151.1927 ++	  wchar_t* __wcs_ps = 0;
151.1928 ++	  wchar_t* __wcs_ns = 0;
151.1929 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
151.1930 ++	  try
151.1931 ++            {
151.1932 ++              mbstate_t __state;
151.1933 ++              size_t __len;
151.1934 ++              __len = strlen(__cpossign);
151.1935 ++              if (__len)
151.1936 ++                {
151.1937 ++		  ++__len;
151.1938 ++		  memset(&__state, 0, sizeof(mbstate_t));
151.1939 ++		  __wcs_ps = new wchar_t[__len];
151.1940 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
151.1941 ++		  _M_data->_M_positive_sign = __wcs_ps;
151.1942 ++		}
151.1943 ++	      else
151.1944 ++		_M_data->_M_positive_sign = L"";
151.1945 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
151.1946 ++	      
151.1947 ++	      __len = strlen(__cnegsign);
151.1948 ++	      if (!__nposn)
151.1949 ++		_M_data->_M_negative_sign = L"()";
151.1950 ++	      else if (__len)
151.1951 ++		{ 
151.1952 ++		  ++__len;
151.1953 ++		  memset(&__state, 0, sizeof(mbstate_t));
151.1954 ++		  __wcs_ns = new wchar_t[__len];
151.1955 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
151.1956 ++		  _M_data->_M_negative_sign = __wcs_ns;
151.1957 ++		}
151.1958 ++	      else
151.1959 ++		_M_data->_M_negative_sign = L"";
151.1960 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
151.1961 ++
151.1962 ++	      // _Intl == true.
151.1963 ++	      __len = strlen(__ccurr);
151.1964 ++	      if (__len)
151.1965 ++		{
151.1966 ++		  ++__len;
151.1967 ++		  memset(&__state, 0, sizeof(mbstate_t));
151.1968 ++		  wchar_t* __wcs = new wchar_t[__len];
151.1969 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
151.1970 ++		  _M_data->_M_curr_symbol = __wcs;
151.1971 ++		}
151.1972 ++	      else
151.1973 ++		_M_data->_M_curr_symbol = L"";
151.1974 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
151.1975 ++	    }
151.1976 ++          catch (...)
151.1977 ++	    {
151.1978 ++	      delete _M_data;
151.1979 ++              _M_data = 0;
151.1980 ++	      delete __wcs_ps;
151.1981 ++	      delete __wcs_ns;	      
151.1982 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.1983 ++	      __uselocale(__old);
151.1984 ++#else
151.1985 ++	      setlocale(LC_ALL, __old);
151.1986 ++	      free(__old);
151.1987 ++#endif
151.1988 ++              __throw_exception_again;
151.1989 ++	    }
151.1990 ++
151.1991 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
151.1992 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
151.1993 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
151.1994 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
151.1995 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
151.1996 ++	                                                __pposn);
151.1997 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
151.1998 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
151.1999 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
151.2000 ++	                                                __nposn);
151.2001 ++
151.2002 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.2003 ++	  __uselocale(__old);
151.2004 ++#else
151.2005 ++	  setlocale(LC_ALL, __old);
151.2006 ++	  free(__old);
151.2007 ++#endif
151.2008 ++	}
151.2009 ++    }
151.2010 ++
151.2011 ++  template<> 
151.2012 ++    moneypunct<wchar_t, true>::~moneypunct()
151.2013 ++    {
151.2014 ++      if (_M_data->_M_positive_sign_size)
151.2015 ++	delete [] _M_data->_M_positive_sign;
151.2016 ++      if (_M_data->_M_negative_sign_size
151.2017 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
151.2018 ++	delete [] _M_data->_M_negative_sign;
151.2019 ++      if (_M_data->_M_curr_symbol_size)
151.2020 ++	delete [] _M_data->_M_curr_symbol;
151.2021 ++      delete _M_data;
151.2022 ++    }
151.2023 ++
151.2024 ++  template<> 
151.2025 ++    moneypunct<wchar_t, false>::~moneypunct()
151.2026 ++    {
151.2027 ++      if (_M_data->_M_positive_sign_size)
151.2028 ++	delete [] _M_data->_M_positive_sign;
151.2029 ++      if (_M_data->_M_negative_sign_size
151.2030 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
151.2031 ++	delete [] _M_data->_M_negative_sign;
151.2032 ++      if (_M_data->_M_curr_symbol_size)
151.2033 ++	delete [] _M_data->_M_curr_symbol;
151.2034 ++      delete _M_data;
151.2035 ++    }
151.2036 ++#endif
151.2037 ++}
151.2038 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc
151.2039 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
151.2040 +@@ -0,0 +1,173 @@
151.2041 ++// std::numpunct implementation details, GNU version -*- C++ -*-
151.2042 ++
151.2043 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
151.2044 ++//
151.2045 ++// This file is part of the GNU ISO C++ Library.  This library is free
151.2046 ++// software; you can redistribute it and/or modify it under the
151.2047 ++// terms of the GNU General Public License as published by the
151.2048 ++// Free Software Foundation; either version 2, or (at your option)
151.2049 ++// any later version.
151.2050 ++
151.2051 ++// This library is distributed in the hope that it will be useful,
151.2052 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
151.2053 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151.2054 ++// GNU General Public License for more details.
151.2055 ++
151.2056 ++// You should have received a copy of the GNU General Public License along
151.2057 ++// with this library; see the file COPYING.  If not, write to the Free
151.2058 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
151.2059 ++// USA.
151.2060 ++
151.2061 ++// As a special exception, you may use this file as part of a free software
151.2062 ++// library without restriction.  Specifically, if other files instantiate
151.2063 ++// templates or use macros or inline functions from this file, or you compile
151.2064 ++// this file and link it with other files to produce an executable, this
151.2065 ++// file does not by itself cause the resulting executable to be covered by
151.2066 ++// the GNU General Public License.  This exception does not however
151.2067 ++// invalidate any other reasons why the executable file might be covered by
151.2068 ++// the GNU General Public License.
151.2069 ++
151.2070 ++//
151.2071 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
151.2072 ++//
151.2073 ++
151.2074 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
151.2075 ++
151.2076 ++#define _LIBC
151.2077 ++#include <locale>
151.2078 ++#undef _LIBC
151.2079 ++#include <bits/c++locale_internal.h>
151.2080 ++
151.2081 ++#ifdef __UCLIBC_MJN3_ONLY__
151.2082 ++#warning tailor for stub locale support
151.2083 ++#endif
151.2084 ++#ifndef __UCLIBC_HAS_XLOCALE__
151.2085 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
151.2086 ++#endif
151.2087 ++
151.2088 ++namespace std
151.2089 ++{
151.2090 ++  template<> 
151.2091 ++    void
151.2092 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
151.2093 ++    {
151.2094 ++      if (!_M_data)
151.2095 ++	_M_data = new __numpunct_cache<char>;
151.2096 ++
151.2097 ++      if (!__cloc)
151.2098 ++	{
151.2099 ++	  // "C" locale
151.2100 ++	  _M_data->_M_grouping = "";
151.2101 ++	  _M_data->_M_grouping_size = 0;
151.2102 ++	  _M_data->_M_use_grouping = false;
151.2103 ++
151.2104 ++	  _M_data->_M_decimal_point = '.';
151.2105 ++	  _M_data->_M_thousands_sep = ',';
151.2106 ++
151.2107 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
151.2108 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
151.2109 ++
151.2110 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
151.2111 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
151.2112 ++	}
151.2113 ++      else
151.2114 ++	{
151.2115 ++	  // Named locale.
151.2116 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
151.2117 ++							__cloc));
151.2118 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
151.2119 ++							__cloc));
151.2120 ++
151.2121 ++	  // Check for NULL, which implies no grouping.
151.2122 ++	  if (_M_data->_M_thousands_sep == '\0')
151.2123 ++	    _M_data->_M_grouping = "";
151.2124 ++	  else
151.2125 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
151.2126 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
151.2127 ++	}
151.2128 ++
151.2129 ++      // NB: There is no way to extact this info from posix locales.
151.2130 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
151.2131 ++      _M_data->_M_truename = "true";
151.2132 ++      _M_data->_M_truename_size = 4;
151.2133 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
151.2134 ++      _M_data->_M_falsename = "false";
151.2135 ++      _M_data->_M_falsename_size = 5;
151.2136 ++    }
151.2137 ++ 
151.2138 ++  template<> 
151.2139 ++    numpunct<char>::~numpunct()
151.2140 ++    { delete _M_data; }
151.2141 ++   
151.2142 ++#ifdef _GLIBCXX_USE_WCHAR_T
151.2143 ++  template<> 
151.2144 ++    void
151.2145 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
151.2146 ++    {
151.2147 ++      if (!_M_data)
151.2148 ++	_M_data = new __numpunct_cache<wchar_t>;
151.2149 ++
151.2150 ++      if (!__cloc)
151.2151 ++	{
151.2152 ++	  // "C" locale
151.2153 ++	  _M_data->_M_grouping = "";
151.2154 ++	  _M_data->_M_grouping_size = 0;
151.2155 ++	  _M_data->_M_use_grouping = false;
151.2156 ++
151.2157 ++	  _M_data->_M_decimal_point = L'.';
151.2158 ++	  _M_data->_M_thousands_sep = L',';
151.2159 ++
151.2160 ++	  // Use ctype::widen code without the facet...
151.2161 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
151.2162 ++	    _M_data->_M_atoms_out[__i] =
151.2163 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
151.2164 ++
151.2165 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
151.2166 ++	    _M_data->_M_atoms_in[__j] =
151.2167 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
151.2168 ++	}
151.2169 ++      else
151.2170 ++	{
151.2171 ++	  // Named locale.
151.2172 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
151.2173 ++#ifdef __UCLIBC_MJN3_ONLY__
151.2174 ++#warning fix this
151.2175 ++#endif
151.2176 ++#ifdef __UCLIBC__
151.2177 ++# ifdef __UCLIBC_HAS_XLOCALE__
151.2178 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
151.2179 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
151.2180 ++# elif defined __UCLIBC_HAS_LOCALE__
151.2181 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
151.2182 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
151.2183 ++# endif
151.2184 ++#else
151.2185 ++	  union { char *__s; wchar_t __w; } __u;
151.2186 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
151.2187 ++	  _M_data->_M_decimal_point = __u.__w;
151.2188 ++
151.2189 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
151.2190 ++	  _M_data->_M_thousands_sep = __u.__w;
151.2191 ++#endif
151.2192 ++
151.2193 ++	  if (_M_data->_M_thousands_sep == L'\0')
151.2194 ++	    _M_data->_M_grouping = "";
151.2195 ++	  else
151.2196 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
151.2197 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
151.2198 ++	}
151.2199 ++
151.2200 ++      // NB: There is no way to extact this info from posix locales.
151.2201 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
151.2202 ++      _M_data->_M_truename = L"true";
151.2203 ++      _M_data->_M_truename_size = 4;
151.2204 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
151.2205 ++      _M_data->_M_falsename = L"false";
151.2206 ++      _M_data->_M_falsename_size = 5;
151.2207 ++    }
151.2208 ++
151.2209 ++  template<> 
151.2210 ++    numpunct<wchar_t>::~numpunct()
151.2211 ++    { delete _M_data; }
151.2212 ++ #endif
151.2213 ++}
151.2214 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc
151.2215 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc
151.2216 +@@ -0,0 +1,406 @@
151.2217 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
151.2218 ++
151.2219 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
151.2220 ++//
151.2221 ++// This file is part of the GNU ISO C++ Library.  This library is free
151.2222 ++// software; you can redistribute it and/or modify it under the
151.2223 ++// terms of the GNU General Public License as published by the
151.2224 ++// Free Software Foundation; either version 2, or (at your option)
151.2225 ++// any later version.
151.2226 ++
151.2227 ++// This library is distributed in the hope that it will be useful,
151.2228 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
151.2229 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151.2230 ++// GNU General Public License for more details.
151.2231 ++
151.2232 ++// You should have received a copy of the GNU General Public License along
151.2233 ++// with this library; see the file COPYING.  If not, write to the Free
151.2234 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
151.2235 ++// USA.
151.2236 ++
151.2237 ++// As a special exception, you may use this file as part of a free software
151.2238 ++// library without restriction.  Specifically, if other files instantiate
151.2239 ++// templates or use macros or inline functions from this file, or you compile
151.2240 ++// this file and link it with other files to produce an executable, this
151.2241 ++// file does not by itself cause the resulting executable to be covered by
151.2242 ++// the GNU General Public License.  This exception does not however
151.2243 ++// invalidate any other reasons why the executable file might be covered by
151.2244 ++// the GNU General Public License.
151.2245 ++
151.2246 ++//
151.2247 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
151.2248 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
151.2249 ++//
151.2250 ++
151.2251 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
151.2252 ++
151.2253 ++#include <locale>
151.2254 ++#include <bits/c++locale_internal.h>
151.2255 ++
151.2256 ++#ifdef __UCLIBC_MJN3_ONLY__
151.2257 ++#warning tailor for stub locale support
151.2258 ++#endif
151.2259 ++#ifndef __UCLIBC_HAS_XLOCALE__
151.2260 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
151.2261 ++#endif
151.2262 ++
151.2263 ++namespace std
151.2264 ++{
151.2265 ++  template<>
151.2266 ++    void
151.2267 ++    __timepunct<char>::
151.2268 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
151.2269 ++	   const tm* __tm) const
151.2270 ++    {
151.2271 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.2272 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
151.2273 ++					_M_c_locale_timepunct);
151.2274 ++#else
151.2275 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
151.2276 ++      setlocale(LC_ALL, _M_name_timepunct);
151.2277 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
151.2278 ++      setlocale(LC_ALL, __old);
151.2279 ++      free(__old);
151.2280 ++#endif
151.2281 ++      // Make sure __s is null terminated.
151.2282 ++      if (__len == 0)
151.2283 ++	__s[0] = '\0';
151.2284 ++    }
151.2285 ++
151.2286 ++  template<> 
151.2287 ++    void
151.2288 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
151.2289 ++    {
151.2290 ++      if (!_M_data)
151.2291 ++	_M_data = new __timepunct_cache<char>;
151.2292 ++
151.2293 ++      if (!__cloc)
151.2294 ++	{
151.2295 ++	  // "C" locale
151.2296 ++	  _M_c_locale_timepunct = _S_get_c_locale();
151.2297 ++
151.2298 ++	  _M_data->_M_date_format = "%m/%d/%y";
151.2299 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
151.2300 ++	  _M_data->_M_time_format = "%H:%M:%S";
151.2301 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
151.2302 ++	  _M_data->_M_date_time_format = "";
151.2303 ++	  _M_data->_M_date_time_era_format = "";
151.2304 ++	  _M_data->_M_am = "AM";
151.2305 ++	  _M_data->_M_pm = "PM";
151.2306 ++	  _M_data->_M_am_pm_format = "";
151.2307 ++
151.2308 ++	  // Day names, starting with "C"'s Sunday.
151.2309 ++	  _M_data->_M_day1 = "Sunday";
151.2310 ++	  _M_data->_M_day2 = "Monday";
151.2311 ++	  _M_data->_M_day3 = "Tuesday";
151.2312 ++	  _M_data->_M_day4 = "Wednesday";
151.2313 ++	  _M_data->_M_day5 = "Thursday";
151.2314 ++	  _M_data->_M_day6 = "Friday";
151.2315 ++	  _M_data->_M_day7 = "Saturday";
151.2316 ++
151.2317 ++	  // Abbreviated day names, starting with "C"'s Sun.
151.2318 ++	  _M_data->_M_aday1 = "Sun";
151.2319 ++	  _M_data->_M_aday2 = "Mon";
151.2320 ++	  _M_data->_M_aday3 = "Tue";
151.2321 ++	  _M_data->_M_aday4 = "Wed";
151.2322 ++	  _M_data->_M_aday5 = "Thu";
151.2323 ++	  _M_data->_M_aday6 = "Fri";
151.2324 ++	  _M_data->_M_aday7 = "Sat";
151.2325 ++
151.2326 ++	  // Month names, starting with "C"'s January.
151.2327 ++	  _M_data->_M_month01 = "January";
151.2328 ++	  _M_data->_M_month02 = "February";
151.2329 ++	  _M_data->_M_month03 = "March";
151.2330 ++	  _M_data->_M_month04 = "April";
151.2331 ++	  _M_data->_M_month05 = "May";
151.2332 ++	  _M_data->_M_month06 = "June";
151.2333 ++	  _M_data->_M_month07 = "July";
151.2334 ++	  _M_data->_M_month08 = "August";
151.2335 ++	  _M_data->_M_month09 = "September";
151.2336 ++	  _M_data->_M_month10 = "October";
151.2337 ++	  _M_data->_M_month11 = "November";
151.2338 ++	  _M_data->_M_month12 = "December";
151.2339 ++
151.2340 ++	  // Abbreviated month names, starting with "C"'s Jan.
151.2341 ++	  _M_data->_M_amonth01 = "Jan";
151.2342 ++	  _M_data->_M_amonth02 = "Feb";
151.2343 ++	  _M_data->_M_amonth03 = "Mar";
151.2344 ++	  _M_data->_M_amonth04 = "Apr";
151.2345 ++	  _M_data->_M_amonth05 = "May";
151.2346 ++	  _M_data->_M_amonth06 = "Jun";
151.2347 ++	  _M_data->_M_amonth07 = "Jul";
151.2348 ++	  _M_data->_M_amonth08 = "Aug";
151.2349 ++	  _M_data->_M_amonth09 = "Sep";
151.2350 ++	  _M_data->_M_amonth10 = "Oct";
151.2351 ++	  _M_data->_M_amonth11 = "Nov";
151.2352 ++	  _M_data->_M_amonth12 = "Dec";
151.2353 ++	}
151.2354 ++      else
151.2355 ++	{
151.2356 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
151.2357 ++
151.2358 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
151.2359 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
151.2360 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
151.2361 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
151.2362 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
151.2363 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
151.2364 ++							     __cloc);
151.2365 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
151.2366 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
151.2367 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
151.2368 ++
151.2369 ++	  // Day names, starting with "C"'s Sunday.
151.2370 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
151.2371 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
151.2372 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
151.2373 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
151.2374 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
151.2375 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
151.2376 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
151.2377 ++
151.2378 ++	  // Abbreviated day names, starting with "C"'s Sun.
151.2379 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
151.2380 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
151.2381 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
151.2382 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
151.2383 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
151.2384 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
151.2385 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
151.2386 ++
151.2387 ++	  // Month names, starting with "C"'s January.
151.2388 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
151.2389 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
151.2390 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
151.2391 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
151.2392 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
151.2393 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
151.2394 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
151.2395 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
151.2396 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
151.2397 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
151.2398 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
151.2399 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
151.2400 ++
151.2401 ++	  // Abbreviated month names, starting with "C"'s Jan.
151.2402 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
151.2403 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
151.2404 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
151.2405 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
151.2406 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
151.2407 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
151.2408 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
151.2409 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
151.2410 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
151.2411 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
151.2412 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
151.2413 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
151.2414 ++	}
151.2415 ++    }
151.2416 ++
151.2417 ++#ifdef _GLIBCXX_USE_WCHAR_T
151.2418 ++  template<>
151.2419 ++    void
151.2420 ++    __timepunct<wchar_t>::
151.2421 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
151.2422 ++	   const tm* __tm) const
151.2423 ++    {
151.2424 ++#ifdef __UCLIBC_HAS_XLOCALE__
151.2425 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
151.2426 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
151.2427 ++					_M_c_locale_timepunct);
151.2428 ++#else
151.2429 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
151.2430 ++      setlocale(LC_ALL, _M_name_timepunct);
151.2431 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
151.2432 ++      setlocale(LC_ALL, __old);
151.2433 ++      free(__old);
151.2434 ++#endif
151.2435 ++      // Make sure __s is null terminated.
151.2436 ++      if (__len == 0)
151.2437 ++	__s[0] = L'\0';
151.2438 ++    }
151.2439 ++
151.2440 ++  template<> 
151.2441 ++    void
151.2442 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
151.2443 ++    {
151.2444 ++      if (!_M_data)
151.2445 ++	_M_data = new __timepunct_cache<wchar_t>;
151.2446 ++
151.2447 ++#warning wide time stuff
151.2448 ++//       if (!__cloc)
151.2449 ++	{
151.2450 ++	  // "C" locale
151.2451 ++	  _M_c_locale_timepunct = _S_get_c_locale();
151.2452 ++
151.2453 ++	  _M_data->_M_date_format = L"%m/%d/%y";
151.2454 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
151.2455 ++	  _M_data->_M_time_format = L"%H:%M:%S";
151.2456 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
151.2457 ++	  _M_data->_M_date_time_format = L"";
151.2458 ++	  _M_data->_M_date_time_era_format = L"";
151.2459 ++	  _M_data->_M_am = L"AM";
151.2460 ++	  _M_data->_M_pm = L"PM";
151.2461 ++	  _M_data->_M_am_pm_format = L"";
151.2462 ++
151.2463 ++	  // Day names, starting with "C"'s Sunday.
151.2464 ++	  _M_data->_M_day1 = L"Sunday";
151.2465 ++	  _M_data->_M_day2 = L"Monday";
151.2466 ++	  _M_data->_M_day3 = L"Tuesday";
151.2467 ++	  _M_data->_M_day4 = L"Wednesday";
151.2468 ++	  _M_data->_M_day5 = L"Thursday";
151.2469 ++	  _M_data->_M_day6 = L"Friday";
151.2470 ++	  _M_data->_M_day7 = L"Saturday";
151.2471 ++
151.2472 ++	  // Abbreviated day names, starting with "C"'s Sun.
151.2473 ++	  _M_data->_M_aday1 = L"Sun";
151.2474 ++	  _M_data->_M_aday2 = L"Mon";
151.2475 ++	  _M_data->_M_aday3 = L"Tue";
151.2476 ++	  _M_data->_M_aday4 = L"Wed";
151.2477 ++	  _M_data->_M_aday5 = L"Thu";
151.2478 ++	  _M_data->_M_aday6 = L"Fri";
151.2479 ++	  _M_data->_M_aday7 = L"Sat";
151.2480 ++
151.2481 ++	  // Month names, starting with "C"'s January.
151.2482 ++	  _M_data->_M_month01 = L"January";
151.2483 ++	  _M_data->_M_month02 = L"February";
151.2484 ++	  _M_data->_M_month03 = L"March";
151.2485 ++	  _M_data->_M_month04 = L"April";
151.2486 ++	  _M_data->_M_month05 = L"May";
151.2487 ++	  _M_data->_M_month06 = L"June";
151.2488 ++	  _M_data->_M_month07 = L"July";
151.2489 ++	  _M_data->_M_month08 = L"August";
151.2490 ++	  _M_data->_M_month09 = L"September";
151.2491 ++	  _M_data->_M_month10 = L"October";
151.2492 ++	  _M_data->_M_month11 = L"November";
151.2493 ++	  _M_data->_M_month12 = L"December";
151.2494 ++
151.2495 ++	  // Abbreviated month names, starting with "C"'s Jan.
151.2496 ++	  _M_data->_M_amonth01 = L"Jan";
151.2497 ++	  _M_data->_M_amonth02 = L"Feb";
151.2498 ++	  _M_data->_M_amonth03 = L"Mar";
151.2499 ++	  _M_data->_M_amonth04 = L"Apr";
151.2500 ++	  _M_data->_M_amonth05 = L"May";
151.2501 ++	  _M_data->_M_amonth06 = L"Jun";
151.2502 ++	  _M_data->_M_amonth07 = L"Jul";
151.2503 ++	  _M_data->_M_amonth08 = L"Aug";
151.2504 ++	  _M_data->_M_amonth09 = L"Sep";
151.2505 ++	  _M_data->_M_amonth10 = L"Oct";
151.2506 ++	  _M_data->_M_amonth11 = L"Nov";
151.2507 ++	  _M_data->_M_amonth12 = L"Dec";
151.2508 ++	}
151.2509 ++#if 0
151.2510 ++      else
151.2511 ++	{
151.2512 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
151.2513 ++
151.2514 ++	  union { char *__s; wchar_t *__w; } __u;
151.2515 ++
151.2516 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
151.2517 ++	  _M_data->_M_date_format = __u.__w;
151.2518 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
151.2519 ++	  _M_data->_M_date_era_format = __u.__w;
151.2520 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
151.2521 ++	  _M_data->_M_time_format = __u.__w;
151.2522 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
151.2523 ++	  _M_data->_M_time_era_format = __u.__w;
151.2524 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
151.2525 ++	  _M_data->_M_date_time_format = __u.__w;
151.2526 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
151.2527 ++	  _M_data->_M_date_time_era_format = __u.__w;
151.2528 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
151.2529 ++	  _M_data->_M_am = __u.__w;
151.2530 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
151.2531 ++	  _M_data->_M_pm = __u.__w;
151.2532 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
151.2533 ++	  _M_data->_M_am_pm_format = __u.__w;
151.2534 ++
151.2535 ++	  // Day names, starting with "C"'s Sunday.
151.2536 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
151.2537 ++	  _M_data->_M_day1 = __u.__w;
151.2538 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
151.2539 ++	  _M_data->_M_day2 = __u.__w;
151.2540 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
151.2541 ++	  _M_data->_M_day3 = __u.__w;
151.2542 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
151.2543 ++	  _M_data->_M_day4 = __u.__w;
151.2544 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
151.2545 ++	  _M_data->_M_day5 = __u.__w;
151.2546 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
151.2547 ++	  _M_data->_M_day6 = __u.__w;
151.2548 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
151.2549 ++	  _M_data->_M_day7 = __u.__w;
151.2550 ++
151.2551 ++	  // Abbreviated day names, starting with "C"'s Sun.
151.2552 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
151.2553 ++	  _M_data->_M_aday1 = __u.__w;
151.2554 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
151.2555 ++	  _M_data->_M_aday2 = __u.__w;
151.2556 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
151.2557 ++	  _M_data->_M_aday3 = __u.__w;
151.2558 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
151.2559 ++	  _M_data->_M_aday4 = __u.__w;
151.2560 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
151.2561 ++	  _M_data->_M_aday5 = __u.__w;
151.2562 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
151.2563 ++	  _M_data->_M_aday6 = __u.__w;
151.2564 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
151.2565 ++	  _M_data->_M_aday7 = __u.__w;
151.2566 ++
151.2567 ++	  // Month names, starting with "C"'s January.
151.2568 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
151.2569 ++	  _M_data->_M_month01 = __u.__w;
151.2570 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
151.2571 ++	  _M_data->_M_month02 = __u.__w;
151.2572 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
151.2573 ++	  _M_data->_M_month03 = __u.__w;
151.2574 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
151.2575 ++	  _M_data->_M_month04 = __u.__w;
151.2576 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
151.2577 ++	  _M_data->_M_month05 = __u.__w;
151.2578 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
151.2579 ++	  _M_data->_M_month06 = __u.__w;
151.2580 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
151.2581 ++	  _M_data->_M_month07 = __u.__w;
151.2582 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
151.2583 ++	  _M_data->_M_month08 = __u.__w;
151.2584 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
151.2585 ++	  _M_data->_M_month09 = __u.__w;
151.2586 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
151.2587 ++	  _M_data->_M_month10 = __u.__w;
151.2588 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
151.2589 ++	  _M_data->_M_month11 = __u.__w;
151.2590 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
151.2591 ++	  _M_data->_M_month12 = __u.__w;
151.2592 ++
151.2593 ++	  // Abbreviated month names, starting with "C"'s Jan.
151.2594 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
151.2595 ++	  _M_data->_M_amonth01 = __u.__w;
151.2596 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
151.2597 ++	  _M_data->_M_amonth02 = __u.__w;
151.2598 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
151.2599 ++	  _M_data->_M_amonth03 = __u.__w;
151.2600 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
151.2601 ++	  _M_data->_M_amonth04 = __u.__w;
151.2602 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
151.2603 ++	  _M_data->_M_amonth05 = __u.__w;
151.2604 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
151.2605 ++	  _M_data->_M_amonth06 = __u.__w;
151.2606 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
151.2607 ++	  _M_data->_M_amonth07 = __u.__w;
151.2608 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
151.2609 ++	  _M_data->_M_amonth08 = __u.__w;
151.2610 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
151.2611 ++	  _M_data->_M_amonth09 = __u.__w;
151.2612 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
151.2613 ++	  _M_data->_M_amonth10 = __u.__w;
151.2614 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
151.2615 ++	  _M_data->_M_amonth11 = __u.__w;
151.2616 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
151.2617 ++	  _M_data->_M_amonth12 = __u.__w;
151.2618 ++	}
151.2619 ++#endif // 0
151.2620 ++    }
151.2621 ++#endif
151.2622 ++}
151.2623 +--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h
151.2624 ++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h
151.2625 +@@ -0,0 +1,76 @@
151.2626 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
151.2627 ++
151.2628 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
151.2629 ++//
151.2630 ++// This file is part of the GNU ISO C++ Library.  This library is free
151.2631 ++// software; you can redistribute it and/or modify it under the
151.2632 ++// terms of the GNU General Public License as published by the
151.2633 ++// Free Software Foundation; either version 2, or (at your option)
151.2634 ++// any later version.
151.2635 ++
151.2636 ++// This library is distributed in the hope that it will be useful,
151.2637 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
151.2638 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151.2639 ++// GNU General Public License for more details.
151.2640 ++
151.2641 ++// You should have received a copy of the GNU General Public License along
151.2642 ++// with this library; see the file COPYING.  If not, write to the Free
151.2643 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
151.2644 ++// USA.
151.2645 ++
151.2646 ++// As a special exception, you may use this file as part of a free software
151.2647 ++// library without restriction.  Specifically, if other files instantiate
151.2648 ++// templates or use macros or inline functions from this file, or you compile
151.2649 ++// this file and link it with other files to produce an executable, this
151.2650 ++// file does not by itself cause the resulting executable to be covered by
151.2651 ++// the GNU General Public License.  This exception does not however
151.2652 ++// invalidate any other reasons why the executable file might be covered by
151.2653 ++// the GNU General Public License.
151.2654 ++
151.2655 ++//
151.2656 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
151.2657 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
151.2658 ++//
151.2659 ++
151.2660 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
151.2661 ++
151.2662 ++  template<typename _CharT>
151.2663 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
151.2664 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
151.2665 ++      _M_name_timepunct(_S_get_c_name())
151.2666 ++    { _M_initialize_timepunct(); }
151.2667 ++
151.2668 ++  template<typename _CharT>
151.2669 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
151.2670 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
151.2671 ++      _M_name_timepunct(_S_get_c_name())
151.2672 ++    { _M_initialize_timepunct(); }
151.2673 ++
151.2674 ++  template<typename _CharT>
151.2675 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
151.2676 ++				     size_t __refs) 
151.2677 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
151.2678 ++      _M_name_timepunct(NULL)
151.2679 ++    { 
151.2680 ++      const size_t __len = std::strlen(__s) + 1;
151.2681 ++      char* __tmp = new char[__len];
151.2682 ++      std::memcpy(__tmp, __s, __len);
151.2683 ++      _M_name_timepunct = __tmp;
151.2684 ++
151.2685 ++      try
151.2686 ++	{ _M_initialize_timepunct(__cloc); }
151.2687 ++      catch(...)
151.2688 ++	{
151.2689 ++	  delete [] _M_name_timepunct;
151.2690 ++	  __throw_exception_again;
151.2691 ++	}
151.2692 ++    }
151.2693 ++
151.2694 ++  template<typename _CharT>
151.2695 ++    __timepunct<_CharT>::~__timepunct()
151.2696 ++    { 
151.2697 ++      if (_M_name_timepunct != _S_get_c_name())
151.2698 ++	delete [] _M_name_timepunct;
151.2699 ++      delete _M_data; 
151.2700 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
151.2701 ++    }
151.2702 +--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h
151.2703 ++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h
151.2704 +@@ -0,0 +1,64 @@
151.2705 ++// Locale support -*- C++ -*-
151.2706 ++
151.2707 ++// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
151.2708 ++// Free Software Foundation, Inc.
151.2709 ++//
151.2710 ++// This file is part of the GNU ISO C++ Library.  This library is free
151.2711 ++// software; you can redistribute it and/or modify it under the
151.2712 ++// terms of the GNU General Public License as published by the
151.2713 ++// Free Software Foundation; either version 2, or (at your option)
151.2714 ++// any later version.
151.2715 ++
151.2716 ++// This library is distributed in the hope that it will be useful,
151.2717 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
151.2718 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151.2719 ++// GNU General Public License for more details.
151.2720 ++
151.2721 ++// You should have received a copy of the GNU General Public License along
151.2722 ++// with this library; see the file COPYING.  If not, write to the Free
151.2723 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
151.2724 ++// USA.
151.2725 ++
151.2726 ++// As a special exception, you may use this file as part of a free software
151.2727 ++// library without restriction.  Specifically, if other files instantiate
151.2728 ++// templates or use macros or inline functions from this file, or you compile
151.2729 ++// this file and link it with other files to produce an executable, this
151.2730 ++// file does not by itself cause the resulting executable to be covered by
151.2731 ++// the GNU General Public License.  This exception does not however
151.2732 ++// invalidate any other reasons why the executable file might be covered by
151.2733 ++// the GNU General Public License.
151.2734 ++
151.2735 ++//
151.2736 ++// ISO C++ 14882: 22.1  Locales
151.2737 ++//
151.2738 ++  
151.2739 ++/** @file ctype_base.h
151.2740 ++ *  This is an internal header file, included by other library headers.
151.2741 ++ *  You should not attempt to use it directly.
151.2742 ++ */
151.2743 ++
151.2744 ++// Information as gleaned from /usr/include/ctype.h
151.2745 ++  
151.2746 ++  /// @brief  Base class for ctype.
151.2747 ++  struct ctype_base
151.2748 ++  {
151.2749 ++    // Note: In uClibc, the following two types depend on configuration.
151.2750 ++ 
151.2751 ++    // Non-standard typedefs.
151.2752 ++    typedef const __ctype_touplow_t* __to_type;
151.2753 ++
151.2754 ++    // NB: Offsets into ctype<char>::_M_table force a particular size
151.2755 ++    // on the mask type. Because of this, we don't use an enum.
151.2756 ++    typedef __ctype_mask_t	mask;   
151.2757 ++    static const mask upper    	= _ISupper;
151.2758 ++    static const mask lower 	= _ISlower;
151.2759 ++    static const mask alpha 	= _ISalpha;
151.2760 ++    static const mask digit 	= _ISdigit;
151.2761 ++    static const mask xdigit 	= _ISxdigit;
151.2762 ++    static const mask space 	= _ISspace;
151.2763 ++    static const mask print 	= _ISprint;
151.2764 ++    static const mask graph 	= _ISalpha | _ISdigit | _ISpunct;
151.2765 ++    static const mask cntrl 	= _IScntrl;
151.2766 ++    static const mask punct 	= _ISpunct;
151.2767 ++    static const mask alnum 	= _ISalpha | _ISdigit;
151.2768 ++  };
151.2769 +--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h
151.2770 ++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
151.2771 +@@ -0,0 +1,69 @@
151.2772 ++// Locale support -*- C++ -*-
151.2773 ++
151.2774 ++// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
151.2775 ++//
151.2776 ++// This file is part of the GNU ISO C++ Library.  This library is free
151.2777 ++// software; you can redistribute it and/or modify it under the
151.2778 ++// terms of the GNU General Public License as published by the
151.2779 ++// Free Software Foundation; either version 2, or (at your option)
151.2780 ++// any later version.
151.2781 ++
151.2782 ++// This library is distributed in the hope that it will be useful,
151.2783 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
151.2784 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151.2785 ++// GNU General Public License for more details.
151.2786 ++
151.2787 ++// You should have received a copy of the GNU General Public License along
151.2788 ++// with this library; see the file COPYING.  If not, write to the Free
151.2789 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
151.2790 ++// USA.
151.2791 ++
151.2792 ++// As a special exception, you may use this file as part of a free software
151.2793 ++// library without restriction.  Specifically, if other files instantiate
151.2794 ++// templates or use macros or inline functions from this file, or you compile
151.2795 ++// this file and link it with other files to produce an executable, this
151.2796 ++// file does not by itself cause the resulting executable to be covered by
151.2797 ++// the GNU General Public License.  This exception does not however
151.2798 ++// invalidate any other reasons why the executable file might be covered by
151.2799 ++// the GNU General Public License.
151.2800 ++
151.2801 ++//
151.2802 ++// ISO C++ 14882: 22.1  Locales
151.2803 ++//
151.2804 ++  
151.2805 ++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
151.2806 ++// functions go in ctype.cc
151.2807 ++  
151.2808 ++  bool
151.2809 ++  ctype<char>::
151.2810 ++  is(mask __m, char __c) const
151.2811 ++  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
151.2812 ++
151.2813 ++  const char*
151.2814 ++  ctype<char>::
151.2815 ++  is(const char* __low, const char* __high, mask* __vec) const
151.2816 ++  {
151.2817 ++    while (__low < __high)
151.2818 ++      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
151.2819 ++    return __high;
151.2820 ++  }
151.2821 ++
151.2822 ++  const char*
151.2823 ++  ctype<char>::
151.2824 ++  scan_is(mask __m, const char* __low, const char* __high) const
151.2825 ++  {
151.2826 ++    while (__low < __high 
151.2827 ++	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
151.2828 ++      ++__low;
151.2829 ++    return __low;
151.2830 ++  }
151.2831 ++
151.2832 ++  const char*
151.2833 ++  ctype<char>::
151.2834 ++  scan_not(mask __m, const char* __low, const char* __high) const
151.2835 ++  {
151.2836 ++    while (__low < __high 
151.2837 ++	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
151.2838 ++      ++__low;
151.2839 ++    return __low;
151.2840 ++  }
151.2841 +--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h
151.2842 ++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
151.2843 +@@ -0,0 +1,92 @@
151.2844 ++// Locale support -*- C++ -*-
151.2845 ++
151.2846 ++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
151.2847 ++// Free Software Foundation, Inc.
151.2848 ++//
151.2849 ++// This file is part of the GNU ISO C++ Library.  This library is free
151.2850 ++// software; you can redistribute it and/or modify it under the
151.2851 ++// terms of the GNU General Public License as published by the
151.2852 ++// Free Software Foundation; either version 2, or (at your option)
151.2853 ++// any later version.
151.2854 ++
151.2855 ++// This library is distributed in the hope that it will be useful,
151.2856 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
151.2857 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151.2858 ++// GNU General Public License for more details.
151.2859 ++
151.2860 ++// You should have received a copy of the GNU General Public License along
151.2861 ++// with this library; see the file COPYING.  If not, write to the Free
151.2862 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
151.2863 ++// USA.
151.2864 ++
151.2865 ++// As a special exception, you may use this file as part of a free software
151.2866 ++// library without restriction.  Specifically, if other files instantiate
151.2867 ++// templates or use macros or inline functions from this file, or you compile
151.2868 ++// this file and link it with other files to produce an executable, this
151.2869 ++// file does not by itself cause the resulting executable to be covered by
151.2870 ++// the GNU General Public License.  This exception does not however
151.2871 ++// invalidate any other reasons why the executable file might be covered by
151.2872 ++// the GNU General Public License.
151.2873 ++
151.2874 ++//
151.2875 ++// ISO C++ 14882: 22.1  Locales
151.2876 ++//
151.2877 ++  
151.2878 ++// Information as gleaned from /usr/include/ctype.h
151.2879 ++
151.2880 ++  const ctype_base::mask*
151.2881 ++  ctype<char>::classic_table() throw()
151.2882 ++  { return __C_ctype_b; }
151.2883 ++
151.2884 ++  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
151.2885 ++		     size_t __refs) 
151.2886 ++  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
151.2887 ++  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
151.2888 ++  {
151.2889 ++    _M_toupper = __C_ctype_toupper;
151.2890 ++    _M_tolower = __C_ctype_tolower;
151.2891 ++    _M_table = __table ? __table : __C_ctype_b;
151.2892 ++    memset(_M_widen, 0, sizeof(_M_widen));
151.2893 ++    memset(_M_narrow, 0, sizeof(_M_narrow));
151.2894 ++  }
151.2895 ++
151.2896 ++  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
151.2897 ++  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
151.2898 ++  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
151.2899 ++  {
151.2900 ++    _M_toupper = __C_ctype_toupper;
151.2901 ++    _M_tolower = __C_ctype_tolower;
151.2902 ++    _M_table = __table ? __table : __C_ctype_b;
151.2903 ++    memset(_M_widen, 0, sizeof(_M_widen));
151.2904 ++    memset(_M_narrow, 0, sizeof(_M_narrow));
151.2905 ++  }
151.2906 ++
151.2907 ++  char
151.2908 ++  ctype<char>::do_toupper(char __c) const
151.2909 ++  { return _M_toupper[static_cast<unsigned char>(__c)]; }
151.2910 ++
151.2911 ++  const char*
151.2912 ++  ctype<char>::do_toupper(char* __low, const char* __high) const
151.2913 ++  {
151.2914 ++    while (__low < __high)
151.2915 ++      {
151.2916 ++	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
151.2917 ++	++__low;
151.2918 ++      }
151.2919 ++    return __high;
151.2920 ++  }
151.2921 ++
151.2922 ++  char
151.2923 ++  ctype<char>::do_tolower(char __c) const
151.2924 ++  { return _M_tolower[static_cast<unsigned char>(__c)]; }
151.2925 ++
151.2926 ++  const char* 
151.2927 ++  ctype<char>::do_tolower(char* __low, const char* __high) const
151.2928 ++  {
151.2929 ++    while (__low < __high)
151.2930 ++      {
151.2931 ++	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
151.2932 ++	++__low;
151.2933 ++      }
151.2934 ++    return __high;
151.2935 ++  }
151.2936 +--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h
151.2937 ++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h
151.2938 +@@ -0,0 +1,44 @@
151.2939 ++// Specific definitions for GNU/Linux  -*- C++ -*-
151.2940 ++
151.2941 ++// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
151.2942 ++//
151.2943 ++// This file is part of the GNU ISO C++ Library.  This library is free
151.2944 ++// software; you can redistribute it and/or modify it under the
151.2945 ++// terms of the GNU General Public License as published by the
151.2946 ++// Free Software Foundation; either version 2, or (at your option)
151.2947 ++// any later version.
151.2948 ++
151.2949 ++// This library is distributed in the hope that it will be useful,
151.2950 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
151.2951 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151.2952 ++// GNU General Public License for more details.
151.2953 ++
151.2954 ++// You should have received a copy of the GNU General Public License along
151.2955 ++// with this library; see the file COPYING.  If not, write to the Free
151.2956 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
151.2957 ++// USA.
151.2958 ++
151.2959 ++// As a special exception, you may use this file as part of a free software
151.2960 ++// library without restriction.  Specifically, if other files instantiate
151.2961 ++// templates or use macros or inline functions from this file, or you compile
151.2962 ++// this file and link it with other files to produce an executable, this
151.2963 ++// file does not by itself cause the resulting executable to be covered by
151.2964 ++// the GNU General Public License.  This exception does not however
151.2965 ++// invalidate any other reasons why the executable file might be covered by
151.2966 ++// the GNU General Public License.
151.2967 ++
151.2968 ++#ifndef _GLIBCXX_OS_DEFINES
151.2969 ++#define _GLIBCXX_OS_DEFINES 1
151.2970 ++
151.2971 ++// System-specific #define, typedefs, corrections, etc, go here.  This
151.2972 ++// file will come before all others.
151.2973 ++
151.2974 ++// This keeps isanum, et al from being propagated as macros.
151.2975 ++#define __NO_CTYPE 1
151.2976 ++
151.2977 ++#include <features.h>
151.2978 ++
151.2979 ++// We must not see the optimized string functions GNU libc defines.
151.2980 ++#define __NO_STRING_INLINES
151.2981 ++
151.2982 ++#endif
151.2983 +--- gcc-4.1.0-dist/libstdc++-v3/configure
151.2984 ++++ gcc-4.1.0/libstdc++-v3/configure
151.2985 +@@ -4005,6 +4005,11 @@
151.2986 +   lt_cv_deplibs_check_method=pass_all
151.2987 +   ;;
151.2988 + 
151.2989 ++linux-uclibc*)
151.2990 ++  lt_cv_deplibs_check_method=pass_all
151.2991 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
151.2992 ++  ;;
151.2993 ++
151.2994 + netbsd* | knetbsd*-gnu)
151.2995 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
151.2996 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
151.2997 +@@ -5740,7 +5745,7 @@
151.2998 +   enableval="$enable_clocale"
151.2999 + 
151.3000 +       case "$enableval" in
151.3001 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
151.3002 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
151.3003 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
151.3004 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
151.3005 +    { (exit 1); exit 1; }; } ;;
151.3006 +@@ -5765,6 +5770,9 @@
151.3007 +   # Default to "generic".
151.3008 +   if test $enable_clocale_flag = auto; then
151.3009 +     case ${target_os} in
151.3010 ++      linux-uclibc*)
151.3011 ++        enable_clocale_flag=uclibc
151.3012 ++	;;
151.3013 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
151.3014 +         cat >conftest.$ac_ext <<_ACEOF
151.3015 + /* confdefs.h.  */
151.3016 +@@ -5995,6 +6003,76 @@
151.3017 +       CTIME_CC=config/locale/generic/time_members.cc
151.3018 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
151.3019 +       ;;
151.3020 ++    uclibc)
151.3021 ++      echo "$as_me:$LINENO: result: uclibc" >&5
151.3022 ++echo "${ECHO_T}uclibc" >&6
151.3023 ++
151.3024 ++      # Declare intention to use gettext, and add support for specific
151.3025 ++      # languages.
151.3026 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
151.3027 ++      ALL_LINGUAS="de fr"
151.3028 ++
151.3029 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
151.3030 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
151.3031 ++set dummy msgfmt; ac_word=$2
151.3032 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
151.3033 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
151.3034 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
151.3035 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
151.3036 ++else
151.3037 ++  if test -n "$check_msgfmt"; then
151.3038 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
151.3039 ++else
151.3040 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
151.3041 ++for as_dir in $PATH
151.3042 ++do
151.3043 ++  IFS=$as_save_IFS
151.3044 ++  test -z "$as_dir" && as_dir=.
151.3045 ++  for ac_exec_ext in '' $ac_executable_extensions; do
151.3046 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
151.3047 ++    ac_cv_prog_check_msgfmt="yes"
151.3048 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
151.3049 ++    break 2
151.3050 ++  fi
151.3051 ++done
151.3052 ++done
151.3053 ++
151.3054 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
151.3055 ++fi
151.3056 ++fi
151.3057 ++check_msgfmt=$ac_cv_prog_check_msgfmt
151.3058 ++if test -n "$check_msgfmt"; then
151.3059 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
151.3060 ++echo "${ECHO_T}$check_msgfmt" >&6
151.3061 ++else
151.3062 ++  echo "$as_me:$LINENO: result: no" >&5
151.3063 ++echo "${ECHO_T}no" >&6
151.3064 ++fi
151.3065 ++
151.3066 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
151.3067 ++        USE_NLS=yes
151.3068 ++      fi
151.3069 ++      # Export the build objects.
151.3070 ++      for ling in $ALL_LINGUAS; do \
151.3071 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
151.3072 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
151.3073 ++      done
151.3074 ++
151.3075 ++
151.3076 ++
151.3077 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
151.3078 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
151.3079 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
151.3080 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
151.3081 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
151.3082 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
151.3083 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
151.3084 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
151.3085 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
151.3086 ++      CTIME_H=config/locale/uclibc/time_members.h
151.3087 ++      CTIME_CC=config/locale/uclibc/time_members.cc
151.3088 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
151.3089 ++      ;;
151.3090 +   esac
151.3091 + 
151.3092 +   # This is where the testsuite looks for locale catalogs, using the
151.3093 +--- gcc-4.1.0-dist/libstdc++-v3/configure.host
151.3094 ++++ gcc-4.1.0/libstdc++-v3/configure.host
151.3095 +@@ -261,6 +261,12 @@
151.3096 +     ;;
151.3097 + esac
151.3098 + 
151.3099 ++# Override for uClibc since linux-uclibc gets mishandled above.
151.3100 ++case "${host_os}" in
151.3101 ++  *-uclibc*)
151.3102 ++    os_include_dir="os/uclibc"
151.3103 ++    ;;
151.3104 ++esac
151.3105 + 
151.3106 + # Set any OS-dependent and CPU-dependent bits.
151.3107 + # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
151.3108 +--- gcc-4.1.0-dist/libstdc++-v3/crossconfig.m4
151.3109 ++++ gcc-4.1.0/libstdc++-v3/crossconfig.m4
151.3110 +@@ -143,6 +143,99 @@
151.3111 + 	;;
151.3112 +     esac
151.3113 +     ;;
151.3114 ++  *-uclibc*)
151.3115 ++# Temporary hack until we implement the float versions of the libm funcs
151.3116 ++    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
151.3117 ++      machine/endian.h machine/param.h sys/machine.h sys/types.h \
151.3118 ++      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
151.3119 ++    SECTION_FLAGS='-ffunction-sections -fdata-sections'
151.3120 ++    AC_SUBST(SECTION_FLAGS)
151.3121 ++    GLIBCXX_CHECK_LINKER_FEATURES
151.3122 ++    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
151.3123 ++    GLIBCXX_CHECK_WCHAR_T_SUPPORT
151.3124 ++
151.3125 ++    # For LFS.
151.3126 ++    AC_DEFINE(HAVE_INT64_T)
151.3127 ++    case "$target" in
151.3128 ++      *-uclinux*)
151.3129 ++        # Don't enable LFS with uClinux
151.3130 ++        ;;
151.3131 ++      *)
151.3132 ++        AC_DEFINE(_GLIBCXX_USE_LFS)
151.3133 ++    esac
151.3134 ++
151.3135 ++    # For showmanyc_helper().
151.3136 ++    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
151.3137 ++    GLIBCXX_CHECK_POLL
151.3138 ++    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
151.3139 ++
151.3140 ++    # For xsputn_2().
151.3141 ++    AC_CHECK_HEADERS(sys/uio.h)
151.3142 ++    GLIBCXX_CHECK_WRITEV
151.3143 ++
151.3144 ++#     AC_DEFINE(HAVE_ACOSF)
151.3145 ++#     AC_DEFINE(HAVE_ASINF)
151.3146 ++#     AC_DEFINE(HAVE_ATANF)
151.3147 ++#     AC_DEFINE(HAVE_ATAN2F)
151.3148 ++    AC_DEFINE(HAVE_CEILF)
151.3149 ++    AC_DEFINE(HAVE_COPYSIGN)
151.3150 ++#     AC_DEFINE(HAVE_COPYSIGNF)
151.3151 ++#     AC_DEFINE(HAVE_COSF)
151.3152 ++#     AC_DEFINE(HAVE_COSHF)
151.3153 ++#     AC_DEFINE(HAVE_EXPF)
151.3154 ++#     AC_DEFINE(HAVE_FABSF)
151.3155 ++    AC_DEFINE(HAVE_FINITE)
151.3156 ++    AC_DEFINE(HAVE_FINITEF)
151.3157 ++    AC_DEFINE(HAVE_FLOORF)
151.3158 ++#     AC_DEFINE(HAVE_FMODF)
151.3159 ++#     AC_DEFINE(HAVE_FREXPF)
151.3160 ++    AC_DEFINE(HAVE_HYPOT)
151.3161 ++#     AC_DEFINE(HAVE_HYPOTF)
151.3162 ++    AC_DEFINE(HAVE_ISINF)
151.3163 ++    AC_DEFINE(HAVE_ISINFF)
151.3164 ++    AC_DEFINE(HAVE_ISNAN)
151.3165 ++    AC_DEFINE(HAVE_ISNANF)
151.3166 ++#     AC_DEFINE(HAVE_LOGF)
151.3167 ++#     AC_DEFINE(HAVE_LOG10F)
151.3168 ++#     AC_DEFINE(HAVE_MODFF)
151.3169 ++#     AC_DEFINE(HAVE_SINF)
151.3170 ++#     AC_DEFINE(HAVE_SINHF)
151.3171 ++#     AC_DEFINE(HAVE_SINCOS)
151.3172 ++#     AC_DEFINE(HAVE_SINCOSF)
151.3173 ++    AC_DEFINE(HAVE_SQRTF)
151.3174 ++#     AC_DEFINE(HAVE_TANF)
151.3175 ++#     AC_DEFINE(HAVE_TANHF)
151.3176 ++    if test x"long_double_math_on_this_cpu" = x"yes"; then
151.3177 ++      AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
151.3178 ++#       AC_DEFINE(HAVE_ACOSL)
151.3179 ++#       AC_DEFINE(HAVE_ASINL)
151.3180 ++#       AC_DEFINE(HAVE_ATANL)
151.3181 ++#       AC_DEFINE(HAVE_ATAN2L)
151.3182 ++#       AC_DEFINE(HAVE_CEILL)
151.3183 ++#       AC_DEFINE(HAVE_COPYSIGNL)
151.3184 ++#       AC_DEFINE(HAVE_COSL)
151.3185 ++#       AC_DEFINE(HAVE_COSHL)
151.3186 ++#       AC_DEFINE(HAVE_EXPL)
151.3187 ++#       AC_DEFINE(HAVE_FABSL)
151.3188 ++#       AC_DEFINE(HAVE_FINITEL)
151.3189 ++#       AC_DEFINE(HAVE_FLOORL)
151.3190 ++#       AC_DEFINE(HAVE_FMODL)
151.3191 ++#       AC_DEFINE(HAVE_FREXPL)
151.3192 ++#       AC_DEFINE(HAVE_HYPOTL)
151.3193 ++#       AC_DEFINE(HAVE_ISINFL)
151.3194 ++#       AC_DEFINE(HAVE_ISNANL)
151.3195 ++#       AC_DEFINE(HAVE_LOGL)
151.3196 ++#       AC_DEFINE(HAVE_LOG10L)
151.3197 ++#       AC_DEFINE(HAVE_MODFL)
151.3198 ++#       AC_DEFINE(HAVE_POWL)
151.3199 ++#       AC_DEFINE(HAVE_SINL)
151.3200 ++#       AC_DEFINE(HAVE_SINHL)
151.3201 ++#       AC_DEFINE(HAVE_SINCOSL)
151.3202 ++#       AC_DEFINE(HAVE_SQRTL)
151.3203 ++#       AC_DEFINE(HAVE_TANL)
151.3204 ++#       AC_DEFINE(HAVE_TANHL)
151.3205 ++    fi
151.3206 ++    ;;
151.3207 +   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
151.3208 +     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
151.3209 +       machine/endian.h machine/param.h sys/machine.h sys/types.h \
151.3210 +@@ -157,7 +250,7 @@
151.3211 +     AC_DEFINE(HAVE_INT64_T)
151.3212 +     case "$target" in
151.3213 +       *-uclinux*)
151.3214 +-        # Don't enable LFS with uClibc
151.3215 ++        # Don't enable LFS with uClinux
151.3216 +         ;;
151.3217 +       *)
151.3218 +         AC_DEFINE(_GLIBCXX_USE_LFS)
151.3219 +--- gcc-4.1.0-dist/libstdc++-v3/include/c_compatibility/wchar.h
151.3220 ++++ gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h
151.3221 +@@ -101,7 +101,9 @@
151.3222 + using std::wmemcpy;
151.3223 + using std::wmemmove;
151.3224 + using std::wmemset;
151.3225 ++#if _GLIBCXX_HAVE_WCSFTIME
151.3226 + using std::wcsftime;
151.3227 ++#endif
151.3228 + 
151.3229 + #if _GLIBCXX_USE_C99
151.3230 + using std::wcstold;
151.3231 +--- gcc-4.1.0-dist/libstdc++-v3/include/c_std/std_cwchar.h
151.3232 ++++ gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h
151.3233 +@@ -180,7 +180,9 @@
151.3234 +   using ::wcscoll;
151.3235 +   using ::wcscpy;
151.3236 +   using ::wcscspn;
151.3237 ++#if _GLIBCXX_HAVE_WCSFTIME
151.3238 +   using ::wcsftime;
151.3239 ++#endif
151.3240 +   using ::wcslen;
151.3241 +   using ::wcsncat;
151.3242 +   using ::wcsncmp;
   152.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   152.2 +++ b/patches/gcc/4.1.1/130-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   152.3 @@ -0,0 +1,50 @@
   152.4 +# DP: Build and install libstdc++_pic.a library.
   152.5 +
   152.6 +--- gcc/libstdc++-v3/src/Makefile.am
   152.7 ++++ gcc/libstdc++-v3/src/Makefile.am
   152.8 +@@ -214,6 +214,12 @@
   152.9 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
  152.10 + 
  152.11 + 
  152.12 ++install-exec-local:
  152.13 ++ifeq ($(enable_shared),yes)
  152.14 ++	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  152.15 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  152.16 ++endif
  152.17 ++
  152.18 + # Added bits to build debug library.
  152.19 + if GLIBCXX_BUILD_DEBUG
  152.20 + all-local: build_debug
  152.21 +--- gcc/libstdc++-v3/src/Makefile.in
  152.22 ++++ gcc/libstdc++-v3/src/Makefile.in
  152.23 +@@ -627,7 +627,7 @@
  152.24 + 
  152.25 + install-data-am: install-data-local
  152.26 + 
  152.27 +-install-exec-am: install-toolexeclibLTLIBRARIES
  152.28 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  152.29 + 
  152.30 + install-info: install-info-am
  152.31 + 
  152.32 +@@ -660,6 +660,7 @@
  152.33 + 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  152.34 + 	html-am info info-am install install-am install-data \
  152.35 + 	install-data-am install-data-local install-exec \
  152.36 ++	install-exec-local \
  152.37 + 	install-exec-am install-info install-info-am install-man \
  152.38 + 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  152.39 + 	installcheck-am installdirs maintainer-clean \
  152.40 +@@ -743,6 +743,13 @@
  152.41 + install_debug:
  152.42 + 	(cd ${debugdir} && $(MAKE) \
  152.43 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  152.44 ++
  152.45 ++install-exec-local:
  152.46 ++ifeq ($(enable_shared),yes)
  152.47 ++	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  152.48 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  152.49 ++endif
  152.50 ++
  152.51 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  152.52 + # Otherwise a system limit (for SysV at least) may be exceeded.
  152.53 + .NOEXPORT:
   153.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   153.2 +++ b/patches/gcc/4.1.1/140-missing-execinfo_h.patch	Mon Jul 28 21:32:33 2008 +0000
   153.3 @@ -0,0 +1,11 @@
   153.4 +--- gcc-4.0.0/boehm-gc/include/gc.h-orig	2005-04-28 22:28:57.000000000 -0500
   153.5 ++++ gcc-4.0.0/boehm-gc/include/gc.h	2005-04-28 22:30:38.000000000 -0500
   153.6 +@@ -500,7 +500,7 @@
   153.7 + #ifdef __linux__
   153.8 + # include <features.h>
   153.9 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  153.10 +-     && !defined(__ia64__)
  153.11 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  153.12 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  153.13 + #     define GC_HAVE_BUILTIN_BACKTRACE
  153.14 + #   endif
   154.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   154.2 +++ b/patches/gcc/4.1.1/150-c99-snprintf.patch	Mon Jul 28 21:32:33 2008 +0000
   154.3 @@ -0,0 +1,11 @@
   154.4 +--- gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h-orig	2005-04-29 00:08:41.000000000 -0500
   154.5 ++++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h	2005-04-29 00:08:45.000000000 -0500
   154.6 +@@ -142,7 +142,7 @@
   154.7 +   using ::vsprintf;
   154.8 + }
   154.9 + 
  154.10 +-#if _GLIBCXX_USE_C99
  154.11 ++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  154.12 + 
  154.13 + #undef snprintf
  154.14 + #undef vfscanf
   155.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   155.2 +++ b/patches/gcc/4.1.1/160-c99-complex-ugly-hack.patch	Mon Jul 28 21:32:33 2008 +0000
   155.3 @@ -0,0 +1,12 @@
   155.4 +--- gcc-4.0.0/libstdc++-v3/configure-old	2005-04-30 22:04:48.061603912 -0500
   155.5 ++++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 22:06:13.678588152 -0500
   155.6 +@@ -7194,6 +7194,9 @@
   155.7 + cat >>conftest.$ac_ext <<_ACEOF
   155.8 + /* end confdefs.h.  */
   155.9 + #include <complex.h>
  155.10 ++#ifdef __UCLIBC__
  155.11 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  155.12 ++#endif
  155.13 + int
  155.14 + main ()
  155.15 + {
   156.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   156.2 +++ b/patches/gcc/4.1.1/170-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
   156.3 @@ -0,0 +1,24 @@
   156.4 +--- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps	2006-03-24 01:49:51 +0100
   156.5 ++++ gcc-4.1.0/libstdc++-v3/include/ext/rope	2006-03-24 01:49:37 +0100
   156.6 +@@ -59,6 +59,9 @@
   156.7 + #include <bits/allocator.h>
   156.8 + #include <ext/hash_fun.h>
   156.9 + 
  156.10 ++/* cope w/ index defined as macro, SuSv3 proposal */
  156.11 ++#undef index
  156.12 ++
  156.13 + # ifdef __GC
  156.14 + #   define __GC_CONST const
  156.15 + # else
  156.16 +--- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps	2006-03-24 01:50:04 +0100
  156.17 ++++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h	2006-03-24 01:50:28 +0100
  156.18 +@@ -53,6 +53,9 @@
  156.19 + #include <ext/memory> // For uninitialized_copy_n
  156.20 + #include <ext/numeric> // For power
  156.21 + 
  156.22 ++/* cope w/ index defined as macro, SuSv3 proposal */
  156.23 ++#undef index
  156.24 ++
  156.25 + namespace __gnu_cxx
  156.26 + {
  156.27 +   using std::size_t;
   157.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   157.2 +++ b/patches/gcc/4.1.1/180-sh-pr24836.patch	Mon Jul 28 21:32:33 2008 +0000
   157.3 @@ -0,0 +1,25 @@
   157.4 +http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
   157.5 +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
   157.6 +
   157.7 +--- gcc/gcc/configure.ac	(revision 106699)
   157.8 ++++ gcc/gcc/configure.ac	(working copy)
   157.9 +@@ -2446,7 +2446,7 @@
  157.10 + 	tls_first_minor=14
  157.11 + 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  157.12 + 	;;
  157.13 +-  sh-*-* | sh[34]-*-*)
  157.14 ++  sh-*-* | sh[34]*-*-*)
  157.15 +     conftest_s='
  157.16 + 	.section ".tdata","awT",@progbits
  157.17 + foo:	.long	25
  157.18 +--- gcc/gcc/configure
  157.19 ++++ gcc/gcc/configure
  157.20 +@@ -14846,7 +14846,7 @@
  157.21 + 	tls_first_minor=14
  157.22 + 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  157.23 + 	;;
  157.24 +-  sh-*-* | sh[34]-*-*)
  157.25 ++  sh-*-* | sh[34]*-*-*)
  157.26 +     conftest_s='
  157.27 + 	.section ".tdata","awT",@progbits
  157.28 + foo:	.long	25
   158.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   158.2 +++ b/patches/gcc/4.1.1/190-arm-bigendian.patch	Mon Jul 28 21:32:33 2008 +0000
   158.3 @@ -0,0 +1,67 @@
   158.4 +By Lennert Buytenhek <buytenh@wantstofly.org>
   158.5 +Adds support for arm*b-linux* big-endian ARM targets
   158.6 +
   158.7 +See http://gcc.gnu.org/PR16350
   158.8 +
   158.9 +--- gcc-4.1.0/gcc/config/arm/linux-elf.h
  158.10 ++++ gcc-4.1.0/gcc/config/arm/linux-elf.h
  158.11 +@@ -28,19 +28,33 @@
  158.12 + #undef  TARGET_VERSION
  158.13 + #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  158.14 + 
  158.15 ++/*
  158.16 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  158.17 ++ * (big endian) configurations.
  158.18 ++ */
  158.19 ++#if TARGET_BIG_ENDIAN_DEFAULT
  158.20 ++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  158.21 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
  158.22 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
  158.23 ++#else
  158.24 ++#define TARGET_ENDIAN_DEFAULT 0
  158.25 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
  158.26 ++#define TARGET_LINKER_EMULATION "armelf_linux"
  158.27 ++#endif
  158.28 ++
  158.29 + #undef  TARGET_DEFAULT_FLOAT_ABI
  158.30 + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  158.31 + 
  158.32 + #undef  TARGET_DEFAULT
  158.33 +-#define TARGET_DEFAULT (0)
  158.34 ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  158.35 + 
  158.36 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  158.37 + 
  158.38 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  158.39 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  158.40 + 
  158.41 + #undef  MULTILIB_DEFAULTS
  158.42 + #define MULTILIB_DEFAULTS \
  158.43 +-	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  158.44 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  158.45 + 
  158.46 + /* Now we define the strings used to build the spec file.  */
  158.47 + #undef  LIB_SPEC
  158.48 +@@ -61,7 +75,7 @@
  158.49 +    %{rdynamic:-export-dynamic} \
  158.50 +    %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
  158.51 +    -X \
  158.52 +-   %{mbig-endian:-EB}" \
  158.53 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  158.54 +    SUBTARGET_EXTRA_LINK_SPEC
  158.55 + 
  158.56 + #undef  LINK_SPEC
  158.57 +--- gcc-4.1.0/gcc/config.gcc
  158.58 ++++ gcc-4.1.0/gcc/config.gcc
  158.59 +@@ -672,6 +672,11 @@
  158.60 + 	;;
  158.61 + arm*-*-linux*)			# ARM GNU/Linux with ELF
  158.62 + 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" 
  158.63 ++	case $target in
  158.64 ++	arm*b-*)
  158.65 ++		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  158.66 ++		;;
  158.67 ++	esac
  158.68 + 	tmake_file="${tmake_file} t-linux arm/t-arm"
  158.69 + 	case ${target} in
  158.70 + 	arm*-*-linux-gnueabi)
   159.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   159.2 +++ b/patches/gcc/4.1.1/200-softfloat-fix.patch	Mon Jul 28 21:32:33 2008 +0000
   159.3 @@ -0,0 +1,58 @@
   159.4 +This patch (C) 2007 Yann E. MORIN
   159.5 +Licensed under GPL v2.
   159.6 +
   159.7 +First hunk of this patch solves compiling uClibc-0.9.28{,.1} :
   159.8 +
   159.9 +make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  159.10 +  LD libuClibc-0.9.29.so
  159.11 +libc/libc_so.a(difftime.os): In function `difftime':
  159.12 +difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  159.13 +difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  159.14 +libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  159.15 +_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  159.16 +_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  159.17 +_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  159.18 +_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  159.19 +_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  159.20 +_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  159.21 +_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  159.22 +libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  159.23 +__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  159.24 +libc/libc_so.a(strtof.os): In function `strtof':
  159.25 +strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  159.26 +/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  159.27 +In function `__fixunsdfsi':
  159.28 +libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  159.29 +make[2]: *** [lib/libc.so] Error 1
  159.30 +make[1]: *** [lib/libc.so.0] Error 2
  159.31 +make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  159.32 +make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  159.33 +Error 2
  159.34 +
  159.35 +The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  159.36 +
  159.37 +
  159.38 +diff -dur gcc-4.1.1.no-softfloat-fix/gcc/config.gcc gcc-4.1.1/gcc/config.gcc
  159.39 +--- gcc-4.1.1.no-softfloat-fix/gcc/config.gcc	2007-02-01 21:57:17.000000000 +0100
  159.40 ++++ gcc-4.1.1/gcc/config.gcc	2007-02-01 22:11:06.000000000 +0100
  159.41 +@@ -690,7 +690,7 @@
  159.42 + 	    default_use_cxa_atexit=yes
  159.43 + 	    ;;
  159.44 + 	*)
  159.45 +-	    tmake_file="$tmake_file arm/t-linux"
  159.46 ++	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  159.47 + 	    ;;
  159.48 + 	esac
  159.49 + 	tm_file="$tm_file arm/aout.h arm/arm.h"
  159.50 +diff -dur gcc-4.1.1.-lfloat/gcc/config/arm/linux-elf.h gcc-4.1.1/gcc/config/arm/linux-elf.h
  159.51 +--- gcc-4.1.1.-lfloat/gcc/config/arm/linux-elf.h	2007-02-01 21:57:17.000000000 +0100
  159.52 ++++ gcc-4.1.1/gcc/config/arm/linux-elf.h	2007-02-01 23:00:42.000000000 +0100
  159.53 +@@ -63,7 +63,7 @@
  159.54 +    %{shared:-lc} \
  159.55 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  159.56 + 
  159.57 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  159.58 ++#define LIBGCC_SPEC "-lgcc"
  159.59 + 
  159.60 + #ifdef USE_UCLIBC
  159.61 + #define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
   160.1 --- a/patches/gcc/4.1.1/200-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   160.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   160.3 @@ -1,3239 +0,0 @@
   160.4 ---- gcc-4.1.0-dist/libstdc++-v3/acinclude.m4
   160.5 -+++ gcc-4.1.0/libstdc++-v3/acinclude.m4
   160.6 -@@ -1071,7 +1071,7 @@
   160.7 -   AC_MSG_CHECKING([for C locale to use])
   160.8 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
   160.9 -     [use MODEL for target locale package],
  160.10 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  160.11 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  160.12 -   
  160.13 -   # If they didn't use this option switch, or if they specified --enable
  160.14 -   # with no specific model, we'll have to look for one.  If they
  160.15 -@@ -1087,6 +1087,9 @@
  160.16 -   # Default to "generic".
  160.17 -   if test $enable_clocale_flag = auto; then
  160.18 -     case ${target_os} in
  160.19 -+      *-uclibc*)
  160.20 -+        enable_clocale_flag=uclibc
  160.21 -+        ;;
  160.22 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  160.23 -         AC_EGREP_CPP([_GLIBCXX_ok], [
  160.24 -         #include <features.h>
  160.25 -@@ -1230,6 +1233,40 @@
  160.26 -       CTIME_CC=config/locale/generic/time_members.cc
  160.27 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  160.28 -       ;;
  160.29 -+    uclibc)
  160.30 -+      AC_MSG_RESULT(uclibc)
  160.31 -+
  160.32 -+      # Declare intention to use gettext, and add support for specific
  160.33 -+      # languages.
  160.34 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  160.35 -+      ALL_LINGUAS="de fr"
  160.36 -+
  160.37 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  160.38 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  160.39 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  160.40 -+        USE_NLS=yes
  160.41 -+      fi
  160.42 -+      # Export the build objects.
  160.43 -+      for ling in $ALL_LINGUAS; do \
  160.44 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  160.45 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  160.46 -+      done
  160.47 -+      AC_SUBST(glibcxx_MOFILES)
  160.48 -+      AC_SUBST(glibcxx_POFILES)
  160.49 -+
  160.50 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  160.51 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  160.52 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  160.53 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  160.54 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  160.55 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  160.56 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  160.57 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  160.58 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  160.59 -+      CTIME_H=config/locale/uclibc/time_members.h
  160.60 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  160.61 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  160.62 -+      ;;
  160.63 -   esac
  160.64 - 
  160.65 -   # This is where the testsuite looks for locale catalogs, using the
  160.66 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  160.67 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  160.68 -@@ -0,0 +1,63 @@
  160.69 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  160.70 -+
  160.71 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  160.72 -+//
  160.73 -+// This file is part of the GNU ISO C++ Library.  This library is free
  160.74 -+// software; you can redistribute it and/or modify it under the
  160.75 -+// terms of the GNU General Public License as published by the
  160.76 -+// Free Software Foundation; either version 2, or (at your option)
  160.77 -+// any later version.
  160.78 -+
  160.79 -+// This library is distributed in the hope that it will be useful,
  160.80 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  160.81 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  160.82 -+// GNU General Public License for more details.
  160.83 -+
  160.84 -+// You should have received a copy of the GNU General Public License along
  160.85 -+// with this library; see the file COPYING.  If not, write to the Free
  160.86 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
  160.87 -+// USA.
  160.88 -+
  160.89 -+// As a special exception, you may use this file as part of a free software
  160.90 -+// library without restriction.  Specifically, if other files instantiate
  160.91 -+// templates or use macros or inline functions from this file, or you compile
  160.92 -+// this file and link it with other files to produce an executable, this
  160.93 -+// file does not by itself cause the resulting executable to be covered by
  160.94 -+// the GNU General Public License.  This exception does not however
  160.95 -+// invalidate any other reasons why the executable file might be covered by
  160.96 -+// the GNU General Public License.
  160.97 -+
  160.98 -+// Written by Jakub Jelinek <jakub@redhat.com>
  160.99 -+
 160.100 -+#include <bits/c++config.h>
 160.101 -+#include <clocale>
 160.102 -+
 160.103 -+#ifdef __UCLIBC_MJN3_ONLY__
 160.104 -+#warning clean this up
 160.105 -+#endif
 160.106 -+
 160.107 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.108 -+                                                  
 160.109 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 160.110 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 160.111 -+extern "C" __typeof(strftime_l) __strftime_l;
 160.112 -+extern "C" __typeof(strtod_l) __strtod_l;
 160.113 -+extern "C" __typeof(strtof_l) __strtof_l;
 160.114 -+extern "C" __typeof(strtold_l) __strtold_l;
 160.115 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 160.116 -+extern "C" __typeof(newlocale) __newlocale;
 160.117 -+extern "C" __typeof(freelocale) __freelocale;
 160.118 -+extern "C" __typeof(duplocale) __duplocale;
 160.119 -+extern "C" __typeof(uselocale) __uselocale;
 160.120 -+
 160.121 -+#ifdef _GLIBCXX_USE_WCHAR_T
 160.122 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 160.123 -+extern "C" __typeof(towlower_l) __towlower_l;
 160.124 -+extern "C" __typeof(towupper_l) __towupper_l;
 160.125 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 160.126 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 160.127 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 160.128 -+extern "C" __typeof(wctype_l) __wctype_l;
 160.129 -+#endif 
 160.130 -+
 160.131 -+#endif // GLIBC 2.3 and later
 160.132 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc
 160.133 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
 160.134 -@@ -0,0 +1,152 @@
 160.135 -+// Wrapper for underlying C-language localization -*- C++ -*-
 160.136 -+
 160.137 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 
 160.138 -+// Free Software Foundation, Inc.
 160.139 -+//
 160.140 -+// This file is part of the GNU ISO C++ Library.  This library is free
 160.141 -+// software; you can redistribute it and/or modify it under the
 160.142 -+// terms of the GNU General Public License as published by the
 160.143 -+// Free Software Foundation; either version 2, or (at your option)
 160.144 -+// any later version.
 160.145 -+
 160.146 -+// This library is distributed in the hope that it will be useful,
 160.147 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 160.148 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 160.149 -+// GNU General Public License for more details.
 160.150 -+
 160.151 -+// You should have received a copy of the GNU General Public License along
 160.152 -+// with this library; see the file COPYING.  If not, write to the Free
 160.153 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 160.154 -+// USA.
 160.155 -+
 160.156 -+// As a special exception, you may use this file as part of a free software
 160.157 -+// library without restriction.  Specifically, if other files instantiate
 160.158 -+// templates or use macros or inline functions from this file, or you compile
 160.159 -+// this file and link it with other files to produce an executable, this
 160.160 -+// file does not by itself cause the resulting executable to be covered by
 160.161 -+// the GNU General Public License.  This exception does not however
 160.162 -+// invalidate any other reasons why the executable file might be covered by
 160.163 -+// the GNU General Public License.
 160.164 -+
 160.165 -+//
 160.166 -+// ISO C++ 14882: 22.8  Standard locale categories.
 160.167 -+//
 160.168 -+
 160.169 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 160.170 -+
 160.171 -+#include <cerrno>  // For errno
 160.172 -+#include <locale>
 160.173 -+#include <stdexcept>
 160.174 -+#include <langinfo.h>
 160.175 -+#include <bits/c++locale_internal.h>
 160.176 -+
 160.177 -+#ifndef __UCLIBC_HAS_XLOCALE__
 160.178 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 160.179 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 160.180 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 160.181 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 160.182 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 160.183 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 160.184 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 160.185 -+#warning should dummy __newlocale check for C|POSIX ?
 160.186 -+#define __newlocale(a, b, c)        NULL
 160.187 -+#define __freelocale(a)             ((void)0)
 160.188 -+#define __duplocale(a)              __c_locale()
 160.189 -+#endif
 160.190 -+
 160.191 -+namespace std 
 160.192 -+{
 160.193 -+  template<>
 160.194 -+    void
 160.195 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 160.196 -+		   const __c_locale& __cloc)
 160.197 -+    {
 160.198 -+      char* __sanity;
 160.199 -+      errno = 0;
 160.200 -+      float __f = __strtof_l(__s, &__sanity, __cloc);
 160.201 -+      if (__sanity != __s && errno != ERANGE)
 160.202 -+	__v = __f;
 160.203 -+      else
 160.204 -+	__err |= ios_base::failbit;
 160.205 -+    }
 160.206 -+
 160.207 -+  template<>
 160.208 -+    void
 160.209 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 160.210 -+		   const __c_locale& __cloc)
 160.211 -+    {
 160.212 -+      char* __sanity;
 160.213 -+      errno = 0;
 160.214 -+      double __d = __strtod_l(__s, &__sanity, __cloc);
 160.215 -+      if (__sanity != __s && errno != ERANGE)
 160.216 -+	__v = __d;
 160.217 -+      else
 160.218 -+	__err |= ios_base::failbit;
 160.219 -+    }
 160.220 -+
 160.221 -+  template<>
 160.222 -+    void
 160.223 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 160.224 -+		   const __c_locale& __cloc)
 160.225 -+    {
 160.226 -+      char* __sanity;
 160.227 -+      errno = 0;
 160.228 -+      long double __ld = __strtold_l(__s, &__sanity, __cloc);
 160.229 -+      if (__sanity != __s && errno != ERANGE)
 160.230 -+	__v = __ld;
 160.231 -+      else
 160.232 -+	__err |= ios_base::failbit;
 160.233 -+    }
 160.234 -+
 160.235 -+  void
 160.236 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 160.237 -+				    __c_locale __old)
 160.238 -+  {
 160.239 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 160.240 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.241 -+    if (!__cloc)
 160.242 -+      {
 160.243 -+	// This named locale is not supported by the underlying OS.
 160.244 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 160.245 -+			      "name not valid"));
 160.246 -+      }
 160.247 -+#endif
 160.248 -+  }
 160.249 -+  
 160.250 -+  void
 160.251 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 160.252 -+  {
 160.253 -+    if (__cloc && _S_get_c_locale() != __cloc)
 160.254 -+      __freelocale(__cloc); 
 160.255 -+  }
 160.256 -+
 160.257 -+  __c_locale
 160.258 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 160.259 -+  { return __duplocale(__cloc); }
 160.260 -+} // namespace std
 160.261 -+
 160.262 -+namespace __gnu_cxx
 160.263 -+{
 160.264 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 160.265 -+    {
 160.266 -+      "LC_CTYPE", 
 160.267 -+      "LC_NUMERIC",
 160.268 -+      "LC_TIME", 
 160.269 -+      "LC_COLLATE", 
 160.270 -+      "LC_MONETARY",
 160.271 -+      "LC_MESSAGES", 
 160.272 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 160.273 -+      "LC_PAPER", 
 160.274 -+      "LC_NAME", 
 160.275 -+      "LC_ADDRESS",
 160.276 -+      "LC_TELEPHONE", 
 160.277 -+      "LC_MEASUREMENT", 
 160.278 -+      "LC_IDENTIFICATION" 
 160.279 -+#endif
 160.280 -+    };
 160.281 -+}
 160.282 -+
 160.283 -+namespace std
 160.284 -+{
 160.285 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 160.286 -+}  // namespace std
 160.287 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h
 160.288 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h
 160.289 -@@ -0,0 +1,117 @@
 160.290 -+// Wrapper for underlying C-language localization -*- C++ -*-
 160.291 -+
 160.292 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 160.293 -+//
 160.294 -+// This file is part of the GNU ISO C++ Library.  This library is free
 160.295 -+// software; you can redistribute it and/or modify it under the
 160.296 -+// terms of the GNU General Public License as published by the
 160.297 -+// Free Software Foundation; either version 2, or (at your option)
 160.298 -+// any later version.
 160.299 -+
 160.300 -+// This library is distributed in the hope that it will be useful,
 160.301 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 160.302 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 160.303 -+// GNU General Public License for more details.
 160.304 -+
 160.305 -+// You should have received a copy of the GNU General Public License along
 160.306 -+// with this library; see the file COPYING.  If not, write to the Free
 160.307 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 160.308 -+// USA.
 160.309 -+
 160.310 -+// As a special exception, you may use this file as part of a free software
 160.311 -+// library without restriction.  Specifically, if other files instantiate
 160.312 -+// templates or use macros or inline functions from this file, or you compile
 160.313 -+// this file and link it with other files to produce an executable, this
 160.314 -+// file does not by itself cause the resulting executable to be covered by
 160.315 -+// the GNU General Public License.  This exception does not however
 160.316 -+// invalidate any other reasons why the executable file might be covered by
 160.317 -+// the GNU General Public License.
 160.318 -+
 160.319 -+//
 160.320 -+// ISO C++ 14882: 22.8  Standard locale categories.
 160.321 -+//
 160.322 -+
 160.323 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 160.324 -+
 160.325 -+#ifndef _C_LOCALE_H
 160.326 -+#define _C_LOCALE_H 1
 160.327 -+
 160.328 -+#pragma GCC system_header
 160.329 -+
 160.330 -+#include <cstring>              // get std::strlen
 160.331 -+#include <cstdio>               // get std::snprintf or std::sprintf
 160.332 -+#include <clocale>
 160.333 -+#include <langinfo.h>		// For codecvt
 160.334 -+#ifdef __UCLIBC_MJN3_ONLY__
 160.335 -+#warning fix this
 160.336 -+#endif
 160.337 -+#ifdef __UCLIBC_HAS_LOCALE__
 160.338 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 160.339 -+#endif
 160.340 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 160.341 -+#include <libintl.h> 		// For messages
 160.342 -+#endif
 160.343 -+
 160.344 -+#ifdef __UCLIBC_MJN3_ONLY__
 160.345 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 160.346 -+#endif
 160.347 -+#define _GLIBCXX_C_LOCALE_GNU 1
 160.348 -+
 160.349 -+#ifdef __UCLIBC_MJN3_ONLY__
 160.350 -+#warning fix categories
 160.351 -+#endif
 160.352 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 160.353 -+#define _GLIBCXX_NUM_CATEGORIES 0
 160.354 -+ 
 160.355 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.356 -+namespace __gnu_cxx
 160.357 -+{
 160.358 -+  extern "C" __typeof(uselocale) __uselocale;
 160.359 -+}
 160.360 -+#endif
 160.361 -+
 160.362 -+namespace std
 160.363 -+{
 160.364 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.365 -+  typedef __locale_t		__c_locale;
 160.366 -+#else
 160.367 -+  typedef int*			__c_locale;
 160.368 -+#endif
 160.369 -+
 160.370 -+  // Convert numeric value of type _Tv to string and return length of
 160.371 -+  // string.  If snprintf is available use it, otherwise fall back to
 160.372 -+  // the unsafe sprintf which, in general, can be dangerous and should
 160.373 -+  // be avoided.
 160.374 -+  template<typename _Tv>
 160.375 -+    int
 160.376 -+    __convert_from_v(char* __out, 
 160.377 -+		     const int __size __attribute__ ((__unused__)),
 160.378 -+		     const char* __fmt,
 160.379 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.380 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 160.381 -+    {
 160.382 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 160.383 -+#else
 160.384 -+		     _Tv __v, const __c_locale&, int __prec)
 160.385 -+    {
 160.386 -+# ifdef __UCLIBC_HAS_LOCALE__
 160.387 -+      char* __old = std::setlocale(LC_ALL, NULL);
 160.388 -+      char* __sav = new char[std::strlen(__old) + 1];
 160.389 -+      std::strcpy(__sav, __old);
 160.390 -+      std::setlocale(LC_ALL, "C");
 160.391 -+# endif
 160.392 -+#endif
 160.393 -+
 160.394 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 160.395 -+
 160.396 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.397 -+      __gnu_cxx::__uselocale(__old);
 160.398 -+#elif defined __UCLIBC_HAS_LOCALE__
 160.399 -+      std::setlocale(LC_ALL, __sav);
 160.400 -+      delete [] __sav;
 160.401 -+#endif
 160.402 -+      return __ret;
 160.403 -+    }
 160.404 -+}
 160.405 -+
 160.406 -+#endif
 160.407 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 160.408 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 160.409 -@@ -0,0 +1,306 @@
 160.410 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 160.411 -+
 160.412 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 160.413 -+//
 160.414 -+// This file is part of the GNU ISO C++ Library.  This library is free
 160.415 -+// software; you can redistribute it and/or modify it under the
 160.416 -+// terms of the GNU General Public License as published by the
 160.417 -+// Free Software Foundation; either version 2, or (at your option)
 160.418 -+// any later version.
 160.419 -+
 160.420 -+// This library is distributed in the hope that it will be useful,
 160.421 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 160.422 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 160.423 -+// GNU General Public License for more details.
 160.424 -+
 160.425 -+// You should have received a copy of the GNU General Public License along
 160.426 -+// with this library; see the file COPYING.  If not, write to the Free
 160.427 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 160.428 -+// USA.
 160.429 -+
 160.430 -+// As a special exception, you may use this file as part of a free software
 160.431 -+// library without restriction.  Specifically, if other files instantiate
 160.432 -+// templates or use macros or inline functions from this file, or you compile
 160.433 -+// this file and link it with other files to produce an executable, this
 160.434 -+// file does not by itself cause the resulting executable to be covered by
 160.435 -+// the GNU General Public License.  This exception does not however
 160.436 -+// invalidate any other reasons why the executable file might be covered by
 160.437 -+// the GNU General Public License.
 160.438 -+
 160.439 -+//
 160.440 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 160.441 -+//
 160.442 -+
 160.443 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 160.444 -+
 160.445 -+#include <locale>
 160.446 -+#include <bits/c++locale_internal.h>
 160.447 -+
 160.448 -+namespace std
 160.449 -+{
 160.450 -+  // Specializations.
 160.451 -+#ifdef _GLIBCXX_USE_WCHAR_T
 160.452 -+  codecvt_base::result
 160.453 -+  codecvt<wchar_t, char, mbstate_t>::
 160.454 -+  do_out(state_type& __state, const intern_type* __from, 
 160.455 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 160.456 -+	 extern_type* __to, extern_type* __to_end,
 160.457 -+	 extern_type*& __to_next) const
 160.458 -+  {
 160.459 -+    result __ret = ok;
 160.460 -+    state_type __tmp_state(__state);
 160.461 -+
 160.462 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.463 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 160.464 -+#endif
 160.465 -+
 160.466 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 160.467 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 160.468 -+    // NB: wcsnrtombs is a GNU extension
 160.469 -+    for (__from_next = __from, __to_next = __to;
 160.470 -+	 __from_next < __from_end && __to_next < __to_end
 160.471 -+	 && __ret == ok;)
 160.472 -+      {
 160.473 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 160.474 -+						      __from_end - __from_next);
 160.475 -+	if (!__from_chunk_end)
 160.476 -+	  __from_chunk_end = __from_end;
 160.477 -+
 160.478 -+	__from = __from_next;
 160.479 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 160.480 -+					 __from_chunk_end - __from_next,
 160.481 -+					 __to_end - __to_next, &__state);
 160.482 -+	if (__conv == static_cast<size_t>(-1))
 160.483 -+	  {
 160.484 -+	    // In case of error, in order to stop at the exact place we
 160.485 -+	    // have to start again from the beginning with a series of
 160.486 -+	    // wcrtomb.
 160.487 -+	    for (; __from < __from_next; ++__from)
 160.488 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 160.489 -+	    __state = __tmp_state;
 160.490 -+	    __ret = error;
 160.491 -+	  }
 160.492 -+	else if (__from_next && __from_next < __from_chunk_end)
 160.493 -+	  {
 160.494 -+	    __to_next += __conv;
 160.495 -+	    __ret = partial;
 160.496 -+	  }
 160.497 -+	else
 160.498 -+	  {
 160.499 -+	    __from_next = __from_chunk_end;
 160.500 -+	    __to_next += __conv;
 160.501 -+	  }
 160.502 -+
 160.503 -+	if (__from_next < __from_end && __ret == ok)
 160.504 -+	  {
 160.505 -+	    extern_type __buf[MB_LEN_MAX];
 160.506 -+	    __tmp_state = __state;
 160.507 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 160.508 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 160.509 -+	      __ret = partial;
 160.510 -+	    else
 160.511 -+	      {
 160.512 -+		memcpy(__to_next, __buf, __conv);
 160.513 -+		__state = __tmp_state;
 160.514 -+		__to_next += __conv;
 160.515 -+		++__from_next;
 160.516 -+	      }
 160.517 -+	  }
 160.518 -+      }
 160.519 -+
 160.520 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.521 -+    __uselocale(__old);
 160.522 -+#endif
 160.523 -+
 160.524 -+    return __ret; 
 160.525 -+  }
 160.526 -+  
 160.527 -+  codecvt_base::result
 160.528 -+  codecvt<wchar_t, char, mbstate_t>::
 160.529 -+  do_in(state_type& __state, const extern_type* __from, 
 160.530 -+	const extern_type* __from_end, const extern_type*& __from_next,
 160.531 -+	intern_type* __to, intern_type* __to_end,
 160.532 -+	intern_type*& __to_next) const
 160.533 -+  {
 160.534 -+    result __ret = ok;
 160.535 -+    state_type __tmp_state(__state);
 160.536 -+
 160.537 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.538 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 160.539 -+#endif
 160.540 -+
 160.541 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 160.542 -+    // in case we store a L'\0' and then continue, in a loop.
 160.543 -+    // NB: mbsnrtowcs is a GNU extension
 160.544 -+    for (__from_next = __from, __to_next = __to;
 160.545 -+	 __from_next < __from_end && __to_next < __to_end
 160.546 -+	 && __ret == ok;)
 160.547 -+      {
 160.548 -+	const extern_type* __from_chunk_end;
 160.549 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 160.550 -+								  __from_end
 160.551 -+								  - __from_next));
 160.552 -+	if (!__from_chunk_end)
 160.553 -+	  __from_chunk_end = __from_end;
 160.554 -+
 160.555 -+	__from = __from_next;
 160.556 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 160.557 -+				   __from_chunk_end - __from_next,
 160.558 -+				   __to_end - __to_next, &__state);
 160.559 -+	if (__conv == static_cast<size_t>(-1))
 160.560 -+	  {
 160.561 -+	    // In case of error, in order to stop at the exact place we
 160.562 -+	    // have to start again from the beginning with a series of
 160.563 -+	    // mbrtowc.
 160.564 -+	    for (;; ++__to_next, __from += __conv)
 160.565 -+	      {
 160.566 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 160.567 -+				 &__tmp_state);
 160.568 -+		if (__conv == static_cast<size_t>(-1)
 160.569 -+		    || __conv == static_cast<size_t>(-2))
 160.570 -+		  break;
 160.571 -+	      }
 160.572 -+	    __from_next = __from;
 160.573 -+	    __state = __tmp_state;	    
 160.574 -+	    __ret = error;
 160.575 -+	  }
 160.576 -+	else if (__from_next && __from_next < __from_chunk_end)
 160.577 -+	  {
 160.578 -+	    // It is unclear what to return in this case (see DR 382). 
 160.579 -+	    __to_next += __conv;
 160.580 -+	    __ret = partial;
 160.581 -+	  }
 160.582 -+	else
 160.583 -+	  {
 160.584 -+	    __from_next = __from_chunk_end;
 160.585 -+	    __to_next += __conv;
 160.586 -+	  }
 160.587 -+
 160.588 -+	if (__from_next < __from_end && __ret == ok)
 160.589 -+	  {
 160.590 -+	    if (__to_next < __to_end)
 160.591 -+	      {
 160.592 -+		// XXX Probably wrong for stateful encodings
 160.593 -+		__tmp_state = __state;		
 160.594 -+		++__from_next;
 160.595 -+		*__to_next++ = L'\0';
 160.596 -+	      }
 160.597 -+	    else
 160.598 -+	      __ret = partial;
 160.599 -+	  }
 160.600 -+      }
 160.601 -+
 160.602 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.603 -+    __uselocale(__old);
 160.604 -+#endif
 160.605 -+
 160.606 -+    return __ret; 
 160.607 -+  }
 160.608 -+
 160.609 -+  int 
 160.610 -+  codecvt<wchar_t, char, mbstate_t>::
 160.611 -+  do_encoding() const throw()
 160.612 -+  {
 160.613 -+    // XXX This implementation assumes that the encoding is
 160.614 -+    // stateless and is either single-byte or variable-width.
 160.615 -+    int __ret = 0;
 160.616 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.617 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 160.618 -+#endif
 160.619 -+    if (MB_CUR_MAX == 1)
 160.620 -+      __ret = 1;
 160.621 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.622 -+    __uselocale(__old);
 160.623 -+#endif
 160.624 -+    return __ret;
 160.625 -+  }  
 160.626 -+
 160.627 -+  int 
 160.628 -+  codecvt<wchar_t, char, mbstate_t>::
 160.629 -+  do_max_length() const throw()
 160.630 -+  {
 160.631 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.632 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 160.633 -+#endif
 160.634 -+    // XXX Probably wrong for stateful encodings.
 160.635 -+    int __ret = MB_CUR_MAX;
 160.636 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.637 -+    __uselocale(__old);
 160.638 -+#endif
 160.639 -+    return __ret;
 160.640 -+  }
 160.641 -+  
 160.642 -+  int 
 160.643 -+  codecvt<wchar_t, char, mbstate_t>::
 160.644 -+  do_length(state_type& __state, const extern_type* __from,
 160.645 -+	    const extern_type* __end, size_t __max) const
 160.646 -+  {
 160.647 -+    int __ret = 0;
 160.648 -+    state_type __tmp_state(__state);
 160.649 -+
 160.650 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.651 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 160.652 -+#endif
 160.653 -+
 160.654 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 160.655 -+    // in case we advance past it and then continue, in a loop.
 160.656 -+    // NB: mbsnrtowcs is a GNU extension
 160.657 -+  
 160.658 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 160.659 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 160.660 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 160.661 -+							   * __max));
 160.662 -+    while (__from < __end && __max)
 160.663 -+      {
 160.664 -+	const extern_type* __from_chunk_end;
 160.665 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 160.666 -+								  __end
 160.667 -+								  - __from));
 160.668 -+	if (!__from_chunk_end)
 160.669 -+	  __from_chunk_end = __end;
 160.670 -+
 160.671 -+	const extern_type* __tmp_from = __from;
 160.672 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 160.673 -+				   __from_chunk_end - __from,
 160.674 -+				   __max, &__state);
 160.675 -+	if (__conv == static_cast<size_t>(-1))
 160.676 -+	  {
 160.677 -+	    // In case of error, in order to stop at the exact place we
 160.678 -+	    // have to start again from the beginning with a series of
 160.679 -+	    // mbrtowc.
 160.680 -+	    for (__from = __tmp_from;; __from += __conv)
 160.681 -+	      {
 160.682 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 160.683 -+				 &__tmp_state);
 160.684 -+		if (__conv == static_cast<size_t>(-1)
 160.685 -+		    || __conv == static_cast<size_t>(-2))
 160.686 -+		  break;
 160.687 -+	      }
 160.688 -+	    __state = __tmp_state;
 160.689 -+	    __ret += __from - __tmp_from;
 160.690 -+	    break;
 160.691 -+	  }
 160.692 -+	if (!__from)
 160.693 -+	  __from = __from_chunk_end;
 160.694 -+	
 160.695 -+	__ret += __from - __tmp_from;
 160.696 -+	__max -= __conv;
 160.697 -+
 160.698 -+	if (__from < __end && __max)
 160.699 -+	  {
 160.700 -+	    // XXX Probably wrong for stateful encodings
 160.701 -+	    __tmp_state = __state;
 160.702 -+	    ++__from;
 160.703 -+	    ++__ret;
 160.704 -+	    --__max;
 160.705 -+	  }
 160.706 -+      }
 160.707 -+
 160.708 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.709 -+    __uselocale(__old);
 160.710 -+#endif
 160.711 -+
 160.712 -+    return __ret; 
 160.713 -+  }
 160.714 -+#endif
 160.715 -+}
 160.716 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc
 160.717 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
 160.718 -@@ -0,0 +1,80 @@
 160.719 -+// std::collate implementation details, GNU version -*- C++ -*-
 160.720 -+
 160.721 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 160.722 -+//
 160.723 -+// This file is part of the GNU ISO C++ Library.  This library is free
 160.724 -+// software; you can redistribute it and/or modify it under the
 160.725 -+// terms of the GNU General Public License as published by the
 160.726 -+// Free Software Foundation; either version 2, or (at your option)
 160.727 -+// any later version.
 160.728 -+
 160.729 -+// This library is distributed in the hope that it will be useful,
 160.730 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 160.731 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 160.732 -+// GNU General Public License for more details.
 160.733 -+
 160.734 -+// You should have received a copy of the GNU General Public License along
 160.735 -+// with this library; see the file COPYING.  If not, write to the Free
 160.736 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 160.737 -+// USA.
 160.738 -+
 160.739 -+// As a special exception, you may use this file as part of a free software
 160.740 -+// library without restriction.  Specifically, if other files instantiate
 160.741 -+// templates or use macros or inline functions from this file, or you compile
 160.742 -+// this file and link it with other files to produce an executable, this
 160.743 -+// file does not by itself cause the resulting executable to be covered by
 160.744 -+// the GNU General Public License.  This exception does not however
 160.745 -+// invalidate any other reasons why the executable file might be covered by
 160.746 -+// the GNU General Public License.
 160.747 -+
 160.748 -+//
 160.749 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 160.750 -+//
 160.751 -+
 160.752 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 160.753 -+
 160.754 -+#include <locale>
 160.755 -+#include <bits/c++locale_internal.h>
 160.756 -+
 160.757 -+#ifndef __UCLIBC_HAS_XLOCALE__
 160.758 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 160.759 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 160.760 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 160.761 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 160.762 -+#endif
 160.763 -+
 160.764 -+namespace std
 160.765 -+{
 160.766 -+  // These are basically extensions to char_traits, and perhaps should
 160.767 -+  // be put there instead of here.
 160.768 -+  template<>
 160.769 -+    int 
 160.770 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 160.771 -+    { 
 160.772 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 160.773 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 160.774 -+    }
 160.775 -+  
 160.776 -+  template<>
 160.777 -+    size_t
 160.778 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 160.779 -+				size_t __n) const 
 160.780 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 160.781 -+
 160.782 -+#ifdef _GLIBCXX_USE_WCHAR_T
 160.783 -+  template<>
 160.784 -+    int 
 160.785 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 160.786 -+				 const wchar_t* __two) const
 160.787 -+    {
 160.788 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 160.789 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 160.790 -+    }
 160.791 -+  
 160.792 -+  template<>
 160.793 -+    size_t
 160.794 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 160.795 -+				   size_t __n) const
 160.796 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 160.797 -+#endif
 160.798 -+}
 160.799 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 160.800 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 160.801 -@@ -0,0 +1,314 @@
 160.802 -+// std::ctype implementation details, GNU version -*- C++ -*-
 160.803 -+
 160.804 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 160.805 -+//
 160.806 -+// This file is part of the GNU ISO C++ Library.  This library is free
 160.807 -+// software; you can redistribute it and/or modify it under the
 160.808 -+// terms of the GNU General Public License as published by the
 160.809 -+// Free Software Foundation; either version 2, or (at your option)
 160.810 -+// any later version.
 160.811 -+
 160.812 -+// This library is distributed in the hope that it will be useful,
 160.813 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 160.814 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 160.815 -+// GNU General Public License for more details.
 160.816 -+
 160.817 -+// You should have received a copy of the GNU General Public License along
 160.818 -+// with this library; see the file COPYING.  If not, write to the Free
 160.819 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 160.820 -+// USA.
 160.821 -+
 160.822 -+// As a special exception, you may use this file as part of a free software
 160.823 -+// library without restriction.  Specifically, if other files instantiate
 160.824 -+// templates or use macros or inline functions from this file, or you compile
 160.825 -+// this file and link it with other files to produce an executable, this
 160.826 -+// file does not by itself cause the resulting executable to be covered by
 160.827 -+// the GNU General Public License.  This exception does not however
 160.828 -+// invalidate any other reasons why the executable file might be covered by
 160.829 -+// the GNU General Public License.
 160.830 -+
 160.831 -+//
 160.832 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 160.833 -+//
 160.834 -+
 160.835 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 160.836 -+
 160.837 -+#define _LIBC
 160.838 -+#include <locale>
 160.839 -+#undef _LIBC
 160.840 -+#include <bits/c++locale_internal.h>
 160.841 -+
 160.842 -+#ifndef __UCLIBC_HAS_XLOCALE__
 160.843 -+#define __wctype_l(S, L)           wctype((S))
 160.844 -+#define __towupper_l(C, L)         towupper((C))
 160.845 -+#define __towlower_l(C, L)         towlower((C))
 160.846 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 160.847 -+#endif
 160.848 -+
 160.849 -+namespace std
 160.850 -+{
 160.851 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 160.852 -+  // various /config/os/* files.
 160.853 -+  template<>
 160.854 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 160.855 -+    : ctype<char>(0, false, __refs) 
 160.856 -+    { 		
 160.857 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 160.858 -+	{
 160.859 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 160.860 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 160.861 -+#ifdef __UCLIBC_HAS_XLOCALE__
 160.862 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 160.863 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 160.864 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 160.865 -+#endif
 160.866 -+	}
 160.867 -+    }
 160.868 -+
 160.869 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 160.870 -+  ctype<wchar_t>::__wmask_type
 160.871 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 160.872 -+  {
 160.873 -+    __wmask_type __ret;
 160.874 -+    switch (__m)
 160.875 -+      {
 160.876 -+      case space:
 160.877 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 160.878 -+	break;
 160.879 -+      case print:
 160.880 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 160.881 -+	break;
 160.882 -+      case cntrl:
 160.883 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 160.884 -+	break;
 160.885 -+      case upper:
 160.886 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 160.887 -+	break;
 160.888 -+      case lower:
 160.889 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 160.890 -+	break;
 160.891 -+      case alpha:
 160.892 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 160.893 -+	break;
 160.894 -+      case digit:
 160.895 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 160.896 -+	break;
 160.897 -+      case punct:
 160.898 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 160.899 -+	break;
 160.900 -+      case xdigit:
 160.901 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 160.902 -+	break;
 160.903 -+      case alnum:
 160.904 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 160.905 -+	break;
 160.906 -+      case graph:
 160.907 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 160.908 -+	break;
 160.909 -+      default:
 160.910 -+	__ret = __wmask_type();
 160.911 -+      }
 160.912 -+    return __ret;
 160.913 -+  }
 160.914 -+  
 160.915 -+  wchar_t
 160.916 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 160.917 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 160.918 -+
 160.919 -+  const wchar_t*
 160.920 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 160.921 -+  {
 160.922 -+    while (__lo < __hi)
 160.923 -+      {
 160.924 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 160.925 -+        ++__lo;
 160.926 -+      }
 160.927 -+    return __hi;
 160.928 -+  }
 160.929 -+  
 160.930 -+  wchar_t
 160.931 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 160.932 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 160.933 -+  
 160.934 -+  const wchar_t*
 160.935 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 160.936 -+  {
 160.937 -+    while (__lo < __hi)
 160.938 -+      {
 160.939 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 160.940 -+        ++__lo;
 160.941 -+      }
 160.942 -+    return __hi;
 160.943 -+  }
 160.944 -+
 160.945 -+  bool
 160.946 -+  ctype<wchar_t>::
 160.947 -+  do_is(mask __m, wchar_t __c) const
 160.948 -+  { 
 160.949 -+    // The case of __m == ctype_base::space is particularly important,
 160.950 -+    // due to its use in many istream functions.  Therefore we deal with
 160.951 -+    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 160.952 -+    // is the mask corresponding to ctype_base::space.  NB: an encoding
 160.953 -+    // change would not affect correctness!
 160.954 -+    bool __ret = false;
 160.955 -+    if (__m == _M_bit[5])
 160.956 -+      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 160.957 -+    else
 160.958 -+      {
 160.959 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 160.960 -+	// library for blank.
 160.961 -+	const size_t __bitmasksize = 11;
 160.962 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 160.963 -+	  if (__m & _M_bit[__bitcur])
 160.964 -+	    {
 160.965 -+	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 160.966 -+		{
 160.967 -+		  __ret = true;
 160.968 -+		  break;
 160.969 -+		}
 160.970 -+	      else if (__m == _M_bit[__bitcur])
 160.971 -+		break;
 160.972 -+	    }
 160.973 -+      }
 160.974 -+    return __ret;    
 160.975 -+  }
 160.976 -+
 160.977 -+  const wchar_t* 
 160.978 -+  ctype<wchar_t>::
 160.979 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 160.980 -+  {
 160.981 -+    for (; __lo < __hi; ++__vec, ++__lo)
 160.982 -+      {
 160.983 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 160.984 -+	// library for blank.
 160.985 -+	const size_t __bitmasksize = 11; 
 160.986 -+	mask __m = 0;
 160.987 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 160.988 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 160.989 -+	    __m |= _M_bit[__bitcur];
 160.990 -+	*__vec = __m;
 160.991 -+      }
 160.992 -+    return __hi;
 160.993 -+  }
 160.994 -+  
 160.995 -+  const wchar_t* 
 160.996 -+  ctype<wchar_t>::
 160.997 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 160.998 -+  {
 160.999 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
160.1000 -+      ++__lo;
160.1001 -+    return __lo;
160.1002 -+  }
160.1003 -+
160.1004 -+  const wchar_t*
160.1005 -+  ctype<wchar_t>::
160.1006 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
160.1007 -+  {
160.1008 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
160.1009 -+      ++__lo;
160.1010 -+    return __lo;
160.1011 -+  }
160.1012 -+
160.1013 -+  wchar_t
160.1014 -+  ctype<wchar_t>::
160.1015 -+  do_widen(char __c) const
160.1016 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
160.1017 -+
160.1018 -+  const char* 
160.1019 -+  ctype<wchar_t>::
160.1020 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
160.1021 -+  {
160.1022 -+    while (__lo < __hi)
160.1023 -+      {
160.1024 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
160.1025 -+	++__lo;
160.1026 -+	++__dest;
160.1027 -+      }
160.1028 -+    return __hi;
160.1029 -+  }
160.1030 -+
160.1031 -+  char
160.1032 -+  ctype<wchar_t>::
160.1033 -+  do_narrow(wchar_t __wc, char __dfault) const
160.1034 -+  {
160.1035 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
160.1036 -+      return _M_narrow[__wc];
160.1037 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1038 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
160.1039 -+#endif
160.1040 -+    const int __c = wctob(__wc);
160.1041 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1042 -+    __uselocale(__old);
160.1043 -+#endif
160.1044 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
160.1045 -+  }
160.1046 -+
160.1047 -+  const wchar_t*
160.1048 -+  ctype<wchar_t>::
160.1049 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
160.1050 -+	    char* __dest) const
160.1051 -+  {
160.1052 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1053 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
160.1054 -+#endif
160.1055 -+    if (_M_narrow_ok)
160.1056 -+      while (__lo < __hi)
160.1057 -+	{
160.1058 -+	  if (*__lo >= 0 && *__lo < 128)
160.1059 -+	    *__dest = _M_narrow[*__lo];
160.1060 -+	  else
160.1061 -+	    {
160.1062 -+	      const int __c = wctob(*__lo);
160.1063 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
160.1064 -+	    }
160.1065 -+	  ++__lo;
160.1066 -+	  ++__dest;
160.1067 -+	}
160.1068 -+    else
160.1069 -+      while (__lo < __hi)
160.1070 -+	{
160.1071 -+	  const int __c = wctob(*__lo);
160.1072 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
160.1073 -+	  ++__lo;
160.1074 -+	  ++__dest;
160.1075 -+	}
160.1076 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1077 -+    __uselocale(__old);
160.1078 -+#endif
160.1079 -+    return __hi;
160.1080 -+  }
160.1081 -+
160.1082 -+  void
160.1083 -+  ctype<wchar_t>::_M_initialize_ctype()
160.1084 -+  {
160.1085 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1086 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
160.1087 -+#endif
160.1088 -+    wint_t __i;
160.1089 -+    for (__i = 0; __i < 128; ++__i)
160.1090 -+      {
160.1091 -+	const int __c = wctob(__i);
160.1092 -+	if (__c == EOF)
160.1093 -+	  break;
160.1094 -+	else
160.1095 -+	  _M_narrow[__i] = static_cast<char>(__c);
160.1096 -+      }
160.1097 -+    if (__i == 128)
160.1098 -+      _M_narrow_ok = true;
160.1099 -+    else
160.1100 -+      _M_narrow_ok = false;
160.1101 -+    for (size_t __j = 0;
160.1102 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
160.1103 -+      _M_widen[__j] = btowc(__j);
160.1104 -+
160.1105 -+    for (size_t __k = 0; __k <= 11; ++__k)
160.1106 -+      { 
160.1107 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
160.1108 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
160.1109 -+      }
160.1110 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1111 -+    __uselocale(__old);
160.1112 -+#endif
160.1113 -+  }
160.1114 -+#endif //  _GLIBCXX_USE_WCHAR_T
160.1115 -+}
160.1116 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc
160.1117 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
160.1118 -@@ -0,0 +1,100 @@
160.1119 -+// std::messages implementation details, GNU version -*- C++ -*-
160.1120 -+
160.1121 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
160.1122 -+//
160.1123 -+// This file is part of the GNU ISO C++ Library.  This library is free
160.1124 -+// software; you can redistribute it and/or modify it under the
160.1125 -+// terms of the GNU General Public License as published by the
160.1126 -+// Free Software Foundation; either version 2, or (at your option)
160.1127 -+// any later version.
160.1128 -+
160.1129 -+// This library is distributed in the hope that it will be useful,
160.1130 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
160.1131 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
160.1132 -+// GNU General Public License for more details.
160.1133 -+
160.1134 -+// You should have received a copy of the GNU General Public License along
160.1135 -+// with this library; see the file COPYING.  If not, write to the Free
160.1136 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
160.1137 -+// USA.
160.1138 -+
160.1139 -+// As a special exception, you may use this file as part of a free software
160.1140 -+// library without restriction.  Specifically, if other files instantiate
160.1141 -+// templates or use macros or inline functions from this file, or you compile
160.1142 -+// this file and link it with other files to produce an executable, this
160.1143 -+// file does not by itself cause the resulting executable to be covered by
160.1144 -+// the GNU General Public License.  This exception does not however
160.1145 -+// invalidate any other reasons why the executable file might be covered by
160.1146 -+// the GNU General Public License.
160.1147 -+
160.1148 -+//
160.1149 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
160.1150 -+//
160.1151 -+
160.1152 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
160.1153 -+
160.1154 -+#include <locale>
160.1155 -+#include <bits/c++locale_internal.h>
160.1156 -+
160.1157 -+#ifdef __UCLIBC_MJN3_ONLY__
160.1158 -+#warning fix gettext stuff
160.1159 -+#endif
160.1160 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
160.1161 -+extern "C" char *__dcgettext(const char *domainname,
160.1162 -+			     const char *msgid, int category);
160.1163 -+#undef gettext
160.1164 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
160.1165 -+#else
160.1166 -+#undef gettext
160.1167 -+#define gettext(msgid) (msgid)
160.1168 -+#endif
160.1169 -+
160.1170 -+namespace std
160.1171 -+{
160.1172 -+  // Specializations.
160.1173 -+  template<>
160.1174 -+    string
160.1175 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
160.1176 -+    {
160.1177 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1178 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
160.1179 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
160.1180 -+      __uselocale(__old);
160.1181 -+      return string(__msg);
160.1182 -+#elif defined __UCLIBC_HAS_LOCALE__
160.1183 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
160.1184 -+      setlocale(LC_ALL, _M_name_messages);
160.1185 -+      const char* __msg = gettext(__dfault.c_str());
160.1186 -+      setlocale(LC_ALL, __old);
160.1187 -+      free(__old);
160.1188 -+      return string(__msg);
160.1189 -+#else
160.1190 -+      const char* __msg = gettext(__dfault.c_str());
160.1191 -+      return string(__msg);
160.1192 -+#endif
160.1193 -+    }
160.1194 -+
160.1195 -+#ifdef _GLIBCXX_USE_WCHAR_T
160.1196 -+  template<>
160.1197 -+    wstring
160.1198 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
160.1199 -+    {
160.1200 -+# ifdef __UCLIBC_HAS_XLOCALE__
160.1201 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
160.1202 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
160.1203 -+      __uselocale(__old);
160.1204 -+      return _M_convert_from_char(__msg);
160.1205 -+# elif defined __UCLIBC_HAS_LOCALE__
160.1206 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
160.1207 -+      setlocale(LC_ALL, _M_name_messages);
160.1208 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
160.1209 -+      setlocale(LC_ALL, __old);
160.1210 -+      free(__old);
160.1211 -+      return _M_convert_from_char(__msg);
160.1212 -+# else
160.1213 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
160.1214 -+      return _M_convert_from_char(__msg);
160.1215 -+# endif
160.1216 -+    }
160.1217 -+#endif
160.1218 -+}
160.1219 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h
160.1220 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h
160.1221 -@@ -0,0 +1,121 @@
160.1222 -+// std::messages implementation details, GNU version -*- C++ -*-
160.1223 -+
160.1224 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
160.1225 -+//
160.1226 -+// This file is part of the GNU ISO C++ Library.  This library is free
160.1227 -+// software; you can redistribute it and/or modify it under the
160.1228 -+// terms of the GNU General Public License as published by the
160.1229 -+// Free Software Foundation; either version 2, or (at your option)
160.1230 -+// any later version.
160.1231 -+
160.1232 -+// This library is distributed in the hope that it will be useful,
160.1233 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
160.1234 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
160.1235 -+// GNU General Public License for more details.
160.1236 -+
160.1237 -+// You should have received a copy of the GNU General Public License along
160.1238 -+// with this library; see the file COPYING.  If not, write to the Free
160.1239 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
160.1240 -+// USA.
160.1241 -+
160.1242 -+// As a special exception, you may use this file as part of a free software
160.1243 -+// library without restriction.  Specifically, if other files instantiate
160.1244 -+// templates or use macros or inline functions from this file, or you compile
160.1245 -+// this file and link it with other files to produce an executable, this
160.1246 -+// file does not by itself cause the resulting executable to be covered by
160.1247 -+// the GNU General Public License.  This exception does not however
160.1248 -+// invalidate any other reasons why the executable file might be covered by
160.1249 -+// the GNU General Public License.
160.1250 -+
160.1251 -+//
160.1252 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
160.1253 -+//
160.1254 -+
160.1255 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
160.1256 -+
160.1257 -+#ifdef __UCLIBC_MJN3_ONLY__
160.1258 -+#warning fix prototypes for *textdomain funcs
160.1259 -+#endif
160.1260 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
160.1261 -+extern "C" char *__textdomain(const char *domainname);
160.1262 -+extern "C" char *__bindtextdomain(const char *domainname,
160.1263 -+				  const char *dirname);
160.1264 -+#else
160.1265 -+#undef __textdomain
160.1266 -+#undef __bindtextdomain
160.1267 -+#define __textdomain(D)           ((void)0)
160.1268 -+#define __bindtextdomain(D,P)     ((void)0)
160.1269 -+#endif
160.1270 -+
160.1271 -+  // Non-virtual member functions.
160.1272 -+  template<typename _CharT>
160.1273 -+     messages<_CharT>::messages(size_t __refs)
160.1274 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
160.1275 -+       _M_name_messages(_S_get_c_name())
160.1276 -+     { }
160.1277 -+
160.1278 -+  template<typename _CharT>
160.1279 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
160.1280 -+				size_t __refs) 
160.1281 -+     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
160.1282 -+     {
160.1283 -+       const size_t __len = std::strlen(__s) + 1;
160.1284 -+       char* __tmp = new char[__len];
160.1285 -+       std::memcpy(__tmp, __s, __len);
160.1286 -+       _M_name_messages = __tmp;
160.1287 -+
160.1288 -+       // Last to avoid leaking memory if new throws.
160.1289 -+       _M_c_locale_messages = _S_clone_c_locale(__cloc);
160.1290 -+     }
160.1291 -+
160.1292 -+  template<typename _CharT>
160.1293 -+    typename messages<_CharT>::catalog 
160.1294 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
160.1295 -+			   const char* __dir) const
160.1296 -+    { 
160.1297 -+      __bindtextdomain(__s.c_str(), __dir);
160.1298 -+      return this->do_open(__s, __loc); 
160.1299 -+    }
160.1300 -+
160.1301 -+  // Virtual member functions.
160.1302 -+  template<typename _CharT>
160.1303 -+    messages<_CharT>::~messages()
160.1304 -+    { 
160.1305 -+      if (_M_name_messages != _S_get_c_name())
160.1306 -+	delete [] _M_name_messages;
160.1307 -+      _S_destroy_c_locale(_M_c_locale_messages); 
160.1308 -+    }
160.1309 -+
160.1310 -+  template<typename _CharT>
160.1311 -+    typename messages<_CharT>::catalog 
160.1312 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
160.1313 -+			      const locale&) const
160.1314 -+    { 
160.1315 -+      // No error checking is done, assume the catalog exists and can
160.1316 -+      // be used.
160.1317 -+      __textdomain(__s.c_str());
160.1318 -+      return 0;
160.1319 -+    }
160.1320 -+
160.1321 -+  template<typename _CharT>
160.1322 -+    void    
160.1323 -+    messages<_CharT>::do_close(catalog) const 
160.1324 -+    { }
160.1325 -+
160.1326 -+   // messages_byname
160.1327 -+   template<typename _CharT>
160.1328 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
160.1329 -+     : messages<_CharT>(__refs) 
160.1330 -+     { 
160.1331 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
160.1332 -+	 delete [] this->_M_name_messages;
160.1333 -+       char* __tmp = new char[std::strlen(__s) + 1];
160.1334 -+       std::strcpy(__tmp, __s);
160.1335 -+       this->_M_name_messages = __tmp;
160.1336 -+
160.1337 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
160.1338 -+	 {
160.1339 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
160.1340 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
160.1341 -+	 }
160.1342 -+     }
160.1343 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc
160.1344 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
160.1345 -@@ -0,0 +1,692 @@
160.1346 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
160.1347 -+
160.1348 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
160.1349 -+//
160.1350 -+// This file is part of the GNU ISO C++ Library.  This library is free
160.1351 -+// software; you can redistribute it and/or modify it under the
160.1352 -+// terms of the GNU General Public License as published by the
160.1353 -+// Free Software Foundation; either version 2, or (at your option)
160.1354 -+// any later version.
160.1355 -+
160.1356 -+// This library is distributed in the hope that it will be useful,
160.1357 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
160.1358 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
160.1359 -+// GNU General Public License for more details.
160.1360 -+
160.1361 -+// You should have received a copy of the GNU General Public License along
160.1362 -+// with this library; see the file COPYING.  If not, write to the Free
160.1363 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
160.1364 -+// USA.
160.1365 -+
160.1366 -+// As a special exception, you may use this file as part of a free software
160.1367 -+// library without restriction.  Specifically, if other files instantiate
160.1368 -+// templates or use macros or inline functions from this file, or you compile
160.1369 -+// this file and link it with other files to produce an executable, this
160.1370 -+// file does not by itself cause the resulting executable to be covered by
160.1371 -+// the GNU General Public License.  This exception does not however
160.1372 -+// invalidate any other reasons why the executable file might be covered by
160.1373 -+// the GNU General Public License.
160.1374 -+
160.1375 -+//
160.1376 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
160.1377 -+//
160.1378 -+
160.1379 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
160.1380 -+
160.1381 -+#define _LIBC
160.1382 -+#include <locale>
160.1383 -+#undef _LIBC
160.1384 -+#include <bits/c++locale_internal.h>
160.1385 -+
160.1386 -+#ifdef __UCLIBC_MJN3_ONLY__
160.1387 -+#warning optimize this for uclibc
160.1388 -+#warning tailor for stub locale support
160.1389 -+#endif
160.1390 -+
160.1391 -+#ifndef __UCLIBC_HAS_XLOCALE__
160.1392 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
160.1393 -+#endif
160.1394 -+
160.1395 -+namespace std
160.1396 -+{
160.1397 -+  // Construct and return valid pattern consisting of some combination of:
160.1398 -+  // space none symbol sign value
160.1399 -+  money_base::pattern
160.1400 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
160.1401 -+  { 
160.1402 -+    pattern __ret;
160.1403 -+
160.1404 -+    // This insanely complicated routine attempts to construct a valid
160.1405 -+    // pattern for use with monyepunct. A couple of invariants:
160.1406 -+
160.1407 -+    // if (__precedes) symbol -> value
160.1408 -+    // else value -> symbol
160.1409 -+    
160.1410 -+    // if (__space) space
160.1411 -+    // else none
160.1412 -+
160.1413 -+    // none == never first
160.1414 -+    // space never first or last
160.1415 -+
160.1416 -+    // Any elegant implementations of this are welcome.
160.1417 -+    switch (__posn)
160.1418 -+      {
160.1419 -+      case 0:
160.1420 -+      case 1:
160.1421 -+	// 1 The sign precedes the value and symbol.
160.1422 -+	__ret.field[0] = sign;
160.1423 -+	if (__space)
160.1424 -+	  {
160.1425 -+	    // Pattern starts with sign.
160.1426 -+	    if (__precedes)
160.1427 -+	      {
160.1428 -+		__ret.field[1] = symbol;
160.1429 -+		__ret.field[3] = value;
160.1430 -+	      }
160.1431 -+	    else
160.1432 -+	      {
160.1433 -+		__ret.field[1] = value;
160.1434 -+		__ret.field[3] = symbol;
160.1435 -+	      }
160.1436 -+	    __ret.field[2] = space;
160.1437 -+	  }
160.1438 -+	else
160.1439 -+	  {
160.1440 -+	    // Pattern starts with sign and ends with none.
160.1441 -+	    if (__precedes)
160.1442 -+	      {
160.1443 -+		__ret.field[1] = symbol;
160.1444 -+		__ret.field[2] = value;
160.1445 -+	      }
160.1446 -+	    else
160.1447 -+	      {
160.1448 -+		__ret.field[1] = value;
160.1449 -+		__ret.field[2] = symbol;
160.1450 -+	      }
160.1451 -+	    __ret.field[3] = none;
160.1452 -+	  }
160.1453 -+	break;
160.1454 -+      case 2:
160.1455 -+	// 2 The sign follows the value and symbol.
160.1456 -+	if (__space)
160.1457 -+	  {
160.1458 -+	    // Pattern either ends with sign.
160.1459 -+	    if (__precedes)
160.1460 -+	      {
160.1461 -+		__ret.field[0] = symbol;
160.1462 -+		__ret.field[2] = value;
160.1463 -+	      }
160.1464 -+	    else
160.1465 -+	      {
160.1466 -+		__ret.field[0] = value;
160.1467 -+		__ret.field[2] = symbol;
160.1468 -+	      }
160.1469 -+	    __ret.field[1] = space;
160.1470 -+	    __ret.field[3] = sign;
160.1471 -+	  }
160.1472 -+	else
160.1473 -+	  {
160.1474 -+	    // Pattern ends with sign then none.
160.1475 -+	    if (__precedes)
160.1476 -+	      {
160.1477 -+		__ret.field[0] = symbol;
160.1478 -+		__ret.field[1] = value;
160.1479 -+	      }
160.1480 -+	    else
160.1481 -+	      {
160.1482 -+		__ret.field[0] = value;
160.1483 -+		__ret.field[1] = symbol;
160.1484 -+	      }
160.1485 -+	    __ret.field[2] = sign;
160.1486 -+	    __ret.field[3] = none;
160.1487 -+	  }
160.1488 -+	break;
160.1489 -+      case 3:
160.1490 -+	// 3 The sign immediately precedes the symbol.
160.1491 -+	if (__precedes)
160.1492 -+	  {
160.1493 -+	    __ret.field[0] = sign;
160.1494 -+	    __ret.field[1] = symbol;	    
160.1495 -+	    if (__space)
160.1496 -+	      {
160.1497 -+		__ret.field[2] = space;
160.1498 -+		__ret.field[3] = value;
160.1499 -+	      }
160.1500 -+	    else
160.1501 -+	      {
160.1502 -+		__ret.field[2] = value;		
160.1503 -+		__ret.field[3] = none;
160.1504 -+	      }
160.1505 -+	  }
160.1506 -+	else
160.1507 -+	  {
160.1508 -+	    __ret.field[0] = value;
160.1509 -+	    if (__space)
160.1510 -+	      {
160.1511 -+		__ret.field[1] = space;
160.1512 -+		__ret.field[2] = sign;
160.1513 -+		__ret.field[3] = symbol;
160.1514 -+	      }
160.1515 -+	    else
160.1516 -+	      {
160.1517 -+		__ret.field[1] = sign;
160.1518 -+		__ret.field[2] = symbol;
160.1519 -+		__ret.field[3] = none;
160.1520 -+	      }
160.1521 -+	  }
160.1522 -+	break;
160.1523 -+      case 4:
160.1524 -+	// 4 The sign immediately follows the symbol.
160.1525 -+	if (__precedes)
160.1526 -+	  {
160.1527 -+	    __ret.field[0] = symbol;
160.1528 -+	    __ret.field[1] = sign;
160.1529 -+	    if (__space)
160.1530 -+	      {
160.1531 -+		__ret.field[2] = space;
160.1532 -+		__ret.field[3] = value;
160.1533 -+	      }
160.1534 -+	    else
160.1535 -+	      {
160.1536 -+		__ret.field[2] = value;
160.1537 -+		__ret.field[3] = none;
160.1538 -+	      }
160.1539 -+	  }
160.1540 -+	else
160.1541 -+	  {
160.1542 -+	    __ret.field[0] = value;
160.1543 -+	    if (__space)
160.1544 -+	      {
160.1545 -+		__ret.field[1] = space;
160.1546 -+		__ret.field[2] = symbol;
160.1547 -+		__ret.field[3] = sign;
160.1548 -+	      }
160.1549 -+	    else
160.1550 -+	      {
160.1551 -+		__ret.field[1] = symbol;
160.1552 -+		__ret.field[2] = sign;
160.1553 -+		__ret.field[3] = none;
160.1554 -+	      }
160.1555 -+	  }
160.1556 -+	break;
160.1557 -+      default:
160.1558 -+	__ret = pattern();
160.1559 -+      }
160.1560 -+    return __ret;
160.1561 -+  }
160.1562 -+
160.1563 -+  template<> 
160.1564 -+    void
160.1565 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
160.1566 -+						     const char*)
160.1567 -+    {
160.1568 -+      if (!_M_data)
160.1569 -+	_M_data = new __moneypunct_cache<char, true>;
160.1570 -+
160.1571 -+      if (!__cloc)
160.1572 -+	{
160.1573 -+	  // "C" locale
160.1574 -+	  _M_data->_M_decimal_point = '.';
160.1575 -+	  _M_data->_M_thousands_sep = ',';
160.1576 -+	  _M_data->_M_grouping = "";
160.1577 -+	  _M_data->_M_grouping_size = 0;
160.1578 -+	  _M_data->_M_curr_symbol = "";
160.1579 -+	  _M_data->_M_curr_symbol_size = 0;
160.1580 -+	  _M_data->_M_positive_sign = "";
160.1581 -+	  _M_data->_M_positive_sign_size = 0;
160.1582 -+	  _M_data->_M_negative_sign = "";
160.1583 -+	  _M_data->_M_negative_sign_size = 0;
160.1584 -+	  _M_data->_M_frac_digits = 0;
160.1585 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
160.1586 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
160.1587 -+
160.1588 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
160.1589 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
160.1590 -+	}
160.1591 -+      else
160.1592 -+	{
160.1593 -+	  // Named locale.
160.1594 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
160.1595 -+							__cloc));
160.1596 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
160.1597 -+							__cloc));
160.1598 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
160.1599 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
160.1600 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
160.1601 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
160.1602 -+
160.1603 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
160.1604 -+	  if (!__nposn)
160.1605 -+	    _M_data->_M_negative_sign = "()";
160.1606 -+	  else
160.1607 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
160.1608 -+							__cloc);
160.1609 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
160.1610 -+
160.1611 -+	  // _Intl == true
160.1612 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
160.1613 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
160.1614 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
160.1615 -+						      __cloc));
160.1616 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
160.1617 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
160.1618 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
160.1619 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
160.1620 -+							__pposn);
160.1621 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
160.1622 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
160.1623 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
160.1624 -+							__nposn);
160.1625 -+	}
160.1626 -+    }
160.1627 -+
160.1628 -+  template<> 
160.1629 -+    void
160.1630 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
160.1631 -+						      const char*)
160.1632 -+    {
160.1633 -+      if (!_M_data)
160.1634 -+	_M_data = new __moneypunct_cache<char, false>;
160.1635 -+
160.1636 -+      if (!__cloc)
160.1637 -+	{
160.1638 -+	  // "C" locale
160.1639 -+	  _M_data->_M_decimal_point = '.';
160.1640 -+	  _M_data->_M_thousands_sep = ',';
160.1641 -+	  _M_data->_M_grouping = "";
160.1642 -+	  _M_data->_M_grouping_size = 0;
160.1643 -+	  _M_data->_M_curr_symbol = "";
160.1644 -+	  _M_data->_M_curr_symbol_size = 0;
160.1645 -+	  _M_data->_M_positive_sign = "";
160.1646 -+	  _M_data->_M_positive_sign_size = 0;
160.1647 -+	  _M_data->_M_negative_sign = "";
160.1648 -+	  _M_data->_M_negative_sign_size = 0;
160.1649 -+	  _M_data->_M_frac_digits = 0;
160.1650 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
160.1651 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
160.1652 -+
160.1653 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
160.1654 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
160.1655 -+	}
160.1656 -+      else
160.1657 -+	{
160.1658 -+	  // Named locale.
160.1659 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
160.1660 -+							__cloc));
160.1661 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
160.1662 -+							__cloc));
160.1663 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
160.1664 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
160.1665 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
160.1666 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
160.1667 -+
160.1668 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
160.1669 -+	  if (!__nposn)
160.1670 -+	    _M_data->_M_negative_sign = "()";
160.1671 -+	  else
160.1672 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
160.1673 -+							__cloc);
160.1674 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
160.1675 -+
160.1676 -+	  // _Intl == false
160.1677 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
160.1678 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
160.1679 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
160.1680 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
160.1681 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
160.1682 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
160.1683 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
160.1684 -+							__pposn);
160.1685 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
160.1686 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
160.1687 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
160.1688 -+							__nposn);
160.1689 -+	}
160.1690 -+    }
160.1691 -+
160.1692 -+  template<> 
160.1693 -+    moneypunct<char, true>::~moneypunct()
160.1694 -+    { delete _M_data; }
160.1695 -+
160.1696 -+  template<> 
160.1697 -+    moneypunct<char, false>::~moneypunct()
160.1698 -+    { delete _M_data; }
160.1699 -+
160.1700 -+#ifdef _GLIBCXX_USE_WCHAR_T
160.1701 -+  template<> 
160.1702 -+    void
160.1703 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
160.1704 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1705 -+							const char*)
160.1706 -+#else
160.1707 -+							const char* __name)
160.1708 -+#endif
160.1709 -+    {
160.1710 -+      if (!_M_data)
160.1711 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
160.1712 -+
160.1713 -+      if (!__cloc)
160.1714 -+	{
160.1715 -+	  // "C" locale
160.1716 -+	  _M_data->_M_decimal_point = L'.';
160.1717 -+	  _M_data->_M_thousands_sep = L',';
160.1718 -+	  _M_data->_M_grouping = "";
160.1719 -+	  _M_data->_M_grouping_size = 0;
160.1720 -+	  _M_data->_M_curr_symbol = L"";
160.1721 -+	  _M_data->_M_curr_symbol_size = 0;
160.1722 -+	  _M_data->_M_positive_sign = L"";
160.1723 -+	  _M_data->_M_positive_sign_size = 0;
160.1724 -+	  _M_data->_M_negative_sign = L"";
160.1725 -+	  _M_data->_M_negative_sign_size = 0;
160.1726 -+	  _M_data->_M_frac_digits = 0;
160.1727 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
160.1728 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
160.1729 -+
160.1730 -+	  // Use ctype::widen code without the facet...
160.1731 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
160.1732 -+	    _M_data->_M_atoms[__i] =
160.1733 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
160.1734 -+	}
160.1735 -+      else
160.1736 -+	{
160.1737 -+	  // Named locale.
160.1738 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1739 -+	  __c_locale __old = __uselocale(__cloc);
160.1740 -+#else
160.1741 -+	  // Switch to named locale so that mbsrtowcs will work.
160.1742 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
160.1743 -+	  setlocale(LC_ALL, __name);
160.1744 -+#endif
160.1745 -+
160.1746 -+#ifdef __UCLIBC_MJN3_ONLY__
160.1747 -+#warning fix this... should be monetary
160.1748 -+#endif
160.1749 -+#ifdef __UCLIBC__
160.1750 -+# ifdef __UCLIBC_HAS_XLOCALE__
160.1751 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
160.1752 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
160.1753 -+# elif defined __UCLIBC_HAS_LOCALE__
160.1754 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
160.1755 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
160.1756 -+# endif
160.1757 -+#else
160.1758 -+	  union { char *__s; wchar_t __w; } __u;
160.1759 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
160.1760 -+	  _M_data->_M_decimal_point = __u.__w;
160.1761 -+
160.1762 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
160.1763 -+	  _M_data->_M_thousands_sep = __u.__w;
160.1764 -+#endif
160.1765 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
160.1766 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
160.1767 -+
160.1768 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
160.1769 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
160.1770 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
160.1771 -+
160.1772 -+	  wchar_t* __wcs_ps = 0;
160.1773 -+	  wchar_t* __wcs_ns = 0;
160.1774 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
160.1775 -+	  try
160.1776 -+	    {
160.1777 -+	      mbstate_t __state;
160.1778 -+	      size_t __len = strlen(__cpossign);
160.1779 -+	      if (__len)
160.1780 -+		{
160.1781 -+		  ++__len;
160.1782 -+		  memset(&__state, 0, sizeof(mbstate_t));
160.1783 -+		  __wcs_ps = new wchar_t[__len];
160.1784 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
160.1785 -+		  _M_data->_M_positive_sign = __wcs_ps;
160.1786 -+		}
160.1787 -+	      else
160.1788 -+		_M_data->_M_positive_sign = L"";
160.1789 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
160.1790 -+	      
160.1791 -+	      __len = strlen(__cnegsign);
160.1792 -+	      if (!__nposn)
160.1793 -+		_M_data->_M_negative_sign = L"()";
160.1794 -+	      else if (__len)
160.1795 -+		{ 
160.1796 -+		  ++__len;
160.1797 -+		  memset(&__state, 0, sizeof(mbstate_t));
160.1798 -+		  __wcs_ns = new wchar_t[__len];
160.1799 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
160.1800 -+		  _M_data->_M_negative_sign = __wcs_ns;
160.1801 -+		}
160.1802 -+	      else
160.1803 -+		_M_data->_M_negative_sign = L"";
160.1804 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
160.1805 -+	      
160.1806 -+	      // _Intl == true.
160.1807 -+	      __len = strlen(__ccurr);
160.1808 -+	      if (__len)
160.1809 -+		{
160.1810 -+		  ++__len;
160.1811 -+		  memset(&__state, 0, sizeof(mbstate_t));
160.1812 -+		  wchar_t* __wcs = new wchar_t[__len];
160.1813 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
160.1814 -+		  _M_data->_M_curr_symbol = __wcs;
160.1815 -+		}
160.1816 -+	      else
160.1817 -+		_M_data->_M_curr_symbol = L"";
160.1818 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
160.1819 -+	    }
160.1820 -+	  catch (...)
160.1821 -+	    {
160.1822 -+	      delete _M_data;
160.1823 -+	      _M_data = 0;
160.1824 -+	      delete __wcs_ps;
160.1825 -+	      delete __wcs_ns;	      
160.1826 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1827 -+	      __uselocale(__old);
160.1828 -+#else
160.1829 -+	      setlocale(LC_ALL, __old);
160.1830 -+	      free(__old);
160.1831 -+#endif
160.1832 -+	      __throw_exception_again;
160.1833 -+	    } 
160.1834 -+	  
160.1835 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
160.1836 -+						      __cloc));
160.1837 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
160.1838 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
160.1839 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
160.1840 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
160.1841 -+							__pposn);
160.1842 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
160.1843 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
160.1844 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
160.1845 -+							__nposn);
160.1846 -+
160.1847 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1848 -+	  __uselocale(__old);
160.1849 -+#else
160.1850 -+	  setlocale(LC_ALL, __old);
160.1851 -+	  free(__old);
160.1852 -+#endif
160.1853 -+	}
160.1854 -+    }
160.1855 -+
160.1856 -+  template<> 
160.1857 -+  void
160.1858 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
160.1859 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1860 -+						       const char*)
160.1861 -+#else
160.1862 -+                                                       const char* __name)
160.1863 -+#endif
160.1864 -+  {
160.1865 -+    if (!_M_data)
160.1866 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
160.1867 -+
160.1868 -+    if (!__cloc)
160.1869 -+	{
160.1870 -+	  // "C" locale
160.1871 -+	  _M_data->_M_decimal_point = L'.';
160.1872 -+	  _M_data->_M_thousands_sep = L',';
160.1873 -+	  _M_data->_M_grouping = "";
160.1874 -+          _M_data->_M_grouping_size = 0;
160.1875 -+	  _M_data->_M_curr_symbol = L"";
160.1876 -+	  _M_data->_M_curr_symbol_size = 0;
160.1877 -+	  _M_data->_M_positive_sign = L"";
160.1878 -+	  _M_data->_M_positive_sign_size = 0;
160.1879 -+	  _M_data->_M_negative_sign = L"";
160.1880 -+	  _M_data->_M_negative_sign_size = 0;
160.1881 -+	  _M_data->_M_frac_digits = 0;
160.1882 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
160.1883 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
160.1884 -+
160.1885 -+	  // Use ctype::widen code without the facet...
160.1886 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
160.1887 -+	    _M_data->_M_atoms[__i] =
160.1888 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
160.1889 -+	}
160.1890 -+      else
160.1891 -+	{
160.1892 -+	  // Named locale.
160.1893 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1894 -+	  __c_locale __old = __uselocale(__cloc);
160.1895 -+#else
160.1896 -+	  // Switch to named locale so that mbsrtowcs will work.
160.1897 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
160.1898 -+	  setlocale(LC_ALL, __name);
160.1899 -+#endif
160.1900 -+
160.1901 -+#ifdef __UCLIBC_MJN3_ONLY__
160.1902 -+#warning fix this... should be monetary
160.1903 -+#endif
160.1904 -+#ifdef __UCLIBC__
160.1905 -+# ifdef __UCLIBC_HAS_XLOCALE__
160.1906 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
160.1907 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
160.1908 -+# elif defined __UCLIBC_HAS_LOCALE__
160.1909 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
160.1910 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
160.1911 -+# endif
160.1912 -+#else
160.1913 -+          union { char *__s; wchar_t __w; } __u;
160.1914 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
160.1915 -+	  _M_data->_M_decimal_point = __u.__w;
160.1916 -+
160.1917 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
160.1918 -+	  _M_data->_M_thousands_sep = __u.__w;
160.1919 -+#endif
160.1920 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
160.1921 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
160.1922 -+
160.1923 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
160.1924 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
160.1925 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
160.1926 -+
160.1927 -+	  wchar_t* __wcs_ps = 0;
160.1928 -+	  wchar_t* __wcs_ns = 0;
160.1929 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
160.1930 -+	  try
160.1931 -+            {
160.1932 -+              mbstate_t __state;
160.1933 -+              size_t __len;
160.1934 -+              __len = strlen(__cpossign);
160.1935 -+              if (__len)
160.1936 -+                {
160.1937 -+		  ++__len;
160.1938 -+		  memset(&__state, 0, sizeof(mbstate_t));
160.1939 -+		  __wcs_ps = new wchar_t[__len];
160.1940 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
160.1941 -+		  _M_data->_M_positive_sign = __wcs_ps;
160.1942 -+		}
160.1943 -+	      else
160.1944 -+		_M_data->_M_positive_sign = L"";
160.1945 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
160.1946 -+	      
160.1947 -+	      __len = strlen(__cnegsign);
160.1948 -+	      if (!__nposn)
160.1949 -+		_M_data->_M_negative_sign = L"()";
160.1950 -+	      else if (__len)
160.1951 -+		{ 
160.1952 -+		  ++__len;
160.1953 -+		  memset(&__state, 0, sizeof(mbstate_t));
160.1954 -+		  __wcs_ns = new wchar_t[__len];
160.1955 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
160.1956 -+		  _M_data->_M_negative_sign = __wcs_ns;
160.1957 -+		}
160.1958 -+	      else
160.1959 -+		_M_data->_M_negative_sign = L"";
160.1960 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
160.1961 -+
160.1962 -+	      // _Intl == true.
160.1963 -+	      __len = strlen(__ccurr);
160.1964 -+	      if (__len)
160.1965 -+		{
160.1966 -+		  ++__len;
160.1967 -+		  memset(&__state, 0, sizeof(mbstate_t));
160.1968 -+		  wchar_t* __wcs = new wchar_t[__len];
160.1969 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
160.1970 -+		  _M_data->_M_curr_symbol = __wcs;
160.1971 -+		}
160.1972 -+	      else
160.1973 -+		_M_data->_M_curr_symbol = L"";
160.1974 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
160.1975 -+	    }
160.1976 -+          catch (...)
160.1977 -+	    {
160.1978 -+	      delete _M_data;
160.1979 -+              _M_data = 0;
160.1980 -+	      delete __wcs_ps;
160.1981 -+	      delete __wcs_ns;	      
160.1982 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.1983 -+	      __uselocale(__old);
160.1984 -+#else
160.1985 -+	      setlocale(LC_ALL, __old);
160.1986 -+	      free(__old);
160.1987 -+#endif
160.1988 -+              __throw_exception_again;
160.1989 -+	    }
160.1990 -+
160.1991 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
160.1992 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
160.1993 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
160.1994 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
160.1995 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
160.1996 -+	                                                __pposn);
160.1997 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
160.1998 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
160.1999 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
160.2000 -+	                                                __nposn);
160.2001 -+
160.2002 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.2003 -+	  __uselocale(__old);
160.2004 -+#else
160.2005 -+	  setlocale(LC_ALL, __old);
160.2006 -+	  free(__old);
160.2007 -+#endif
160.2008 -+	}
160.2009 -+    }
160.2010 -+
160.2011 -+  template<> 
160.2012 -+    moneypunct<wchar_t, true>::~moneypunct()
160.2013 -+    {
160.2014 -+      if (_M_data->_M_positive_sign_size)
160.2015 -+	delete [] _M_data->_M_positive_sign;
160.2016 -+      if (_M_data->_M_negative_sign_size
160.2017 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
160.2018 -+	delete [] _M_data->_M_negative_sign;
160.2019 -+      if (_M_data->_M_curr_symbol_size)
160.2020 -+	delete [] _M_data->_M_curr_symbol;
160.2021 -+      delete _M_data;
160.2022 -+    }
160.2023 -+
160.2024 -+  template<> 
160.2025 -+    moneypunct<wchar_t, false>::~moneypunct()
160.2026 -+    {
160.2027 -+      if (_M_data->_M_positive_sign_size)
160.2028 -+	delete [] _M_data->_M_positive_sign;
160.2029 -+      if (_M_data->_M_negative_sign_size
160.2030 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
160.2031 -+	delete [] _M_data->_M_negative_sign;
160.2032 -+      if (_M_data->_M_curr_symbol_size)
160.2033 -+	delete [] _M_data->_M_curr_symbol;
160.2034 -+      delete _M_data;
160.2035 -+    }
160.2036 -+#endif
160.2037 -+}
160.2038 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc
160.2039 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
160.2040 -@@ -0,0 +1,173 @@
160.2041 -+// std::numpunct implementation details, GNU version -*- C++ -*-
160.2042 -+
160.2043 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
160.2044 -+//
160.2045 -+// This file is part of the GNU ISO C++ Library.  This library is free
160.2046 -+// software; you can redistribute it and/or modify it under the
160.2047 -+// terms of the GNU General Public License as published by the
160.2048 -+// Free Software Foundation; either version 2, or (at your option)
160.2049 -+// any later version.
160.2050 -+
160.2051 -+// This library is distributed in the hope that it will be useful,
160.2052 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
160.2053 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
160.2054 -+// GNU General Public License for more details.
160.2055 -+
160.2056 -+// You should have received a copy of the GNU General Public License along
160.2057 -+// with this library; see the file COPYING.  If not, write to the Free
160.2058 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
160.2059 -+// USA.
160.2060 -+
160.2061 -+// As a special exception, you may use this file as part of a free software
160.2062 -+// library without restriction.  Specifically, if other files instantiate
160.2063 -+// templates or use macros or inline functions from this file, or you compile
160.2064 -+// this file and link it with other files to produce an executable, this
160.2065 -+// file does not by itself cause the resulting executable to be covered by
160.2066 -+// the GNU General Public License.  This exception does not however
160.2067 -+// invalidate any other reasons why the executable file might be covered by
160.2068 -+// the GNU General Public License.
160.2069 -+
160.2070 -+//
160.2071 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
160.2072 -+//
160.2073 -+
160.2074 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
160.2075 -+
160.2076 -+#define _LIBC
160.2077 -+#include <locale>
160.2078 -+#undef _LIBC
160.2079 -+#include <bits/c++locale_internal.h>
160.2080 -+
160.2081 -+#ifdef __UCLIBC_MJN3_ONLY__
160.2082 -+#warning tailor for stub locale support
160.2083 -+#endif
160.2084 -+#ifndef __UCLIBC_HAS_XLOCALE__
160.2085 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
160.2086 -+#endif
160.2087 -+
160.2088 -+namespace std
160.2089 -+{
160.2090 -+  template<> 
160.2091 -+    void
160.2092 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
160.2093 -+    {
160.2094 -+      if (!_M_data)
160.2095 -+	_M_data = new __numpunct_cache<char>;
160.2096 -+
160.2097 -+      if (!__cloc)
160.2098 -+	{
160.2099 -+	  // "C" locale
160.2100 -+	  _M_data->_M_grouping = "";
160.2101 -+	  _M_data->_M_grouping_size = 0;
160.2102 -+	  _M_data->_M_use_grouping = false;
160.2103 -+
160.2104 -+	  _M_data->_M_decimal_point = '.';
160.2105 -+	  _M_data->_M_thousands_sep = ',';
160.2106 -+
160.2107 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
160.2108 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
160.2109 -+
160.2110 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
160.2111 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
160.2112 -+	}
160.2113 -+      else
160.2114 -+	{
160.2115 -+	  // Named locale.
160.2116 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
160.2117 -+							__cloc));
160.2118 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
160.2119 -+							__cloc));
160.2120 -+
160.2121 -+	  // Check for NULL, which implies no grouping.
160.2122 -+	  if (_M_data->_M_thousands_sep == '\0')
160.2123 -+	    _M_data->_M_grouping = "";
160.2124 -+	  else
160.2125 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
160.2126 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
160.2127 -+	}
160.2128 -+
160.2129 -+      // NB: There is no way to extact this info from posix locales.
160.2130 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
160.2131 -+      _M_data->_M_truename = "true";
160.2132 -+      _M_data->_M_truename_size = 4;
160.2133 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
160.2134 -+      _M_data->_M_falsename = "false";
160.2135 -+      _M_data->_M_falsename_size = 5;
160.2136 -+    }
160.2137 -+ 
160.2138 -+  template<> 
160.2139 -+    numpunct<char>::~numpunct()
160.2140 -+    { delete _M_data; }
160.2141 -+   
160.2142 -+#ifdef _GLIBCXX_USE_WCHAR_T
160.2143 -+  template<> 
160.2144 -+    void
160.2145 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
160.2146 -+    {
160.2147 -+      if (!_M_data)
160.2148 -+	_M_data = new __numpunct_cache<wchar_t>;
160.2149 -+
160.2150 -+      if (!__cloc)
160.2151 -+	{
160.2152 -+	  // "C" locale
160.2153 -+	  _M_data->_M_grouping = "";
160.2154 -+	  _M_data->_M_grouping_size = 0;
160.2155 -+	  _M_data->_M_use_grouping = false;
160.2156 -+
160.2157 -+	  _M_data->_M_decimal_point = L'.';
160.2158 -+	  _M_data->_M_thousands_sep = L',';
160.2159 -+
160.2160 -+	  // Use ctype::widen code without the facet...
160.2161 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
160.2162 -+	    _M_data->_M_atoms_out[__i] =
160.2163 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
160.2164 -+
160.2165 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
160.2166 -+	    _M_data->_M_atoms_in[__j] =
160.2167 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
160.2168 -+	}
160.2169 -+      else
160.2170 -+	{
160.2171 -+	  // Named locale.
160.2172 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
160.2173 -+#ifdef __UCLIBC_MJN3_ONLY__
160.2174 -+#warning fix this
160.2175 -+#endif
160.2176 -+#ifdef __UCLIBC__
160.2177 -+# ifdef __UCLIBC_HAS_XLOCALE__
160.2178 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
160.2179 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
160.2180 -+# elif defined __UCLIBC_HAS_LOCALE__
160.2181 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
160.2182 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
160.2183 -+# endif
160.2184 -+#else
160.2185 -+	  union { char *__s; wchar_t __w; } __u;
160.2186 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
160.2187 -+	  _M_data->_M_decimal_point = __u.__w;
160.2188 -+
160.2189 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
160.2190 -+	  _M_data->_M_thousands_sep = __u.__w;
160.2191 -+#endif
160.2192 -+
160.2193 -+	  if (_M_data->_M_thousands_sep == L'\0')
160.2194 -+	    _M_data->_M_grouping = "";
160.2195 -+	  else
160.2196 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
160.2197 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
160.2198 -+	}
160.2199 -+
160.2200 -+      // NB: There is no way to extact this info from posix locales.
160.2201 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
160.2202 -+      _M_data->_M_truename = L"true";
160.2203 -+      _M_data->_M_truename_size = 4;
160.2204 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
160.2205 -+      _M_data->_M_falsename = L"false";
160.2206 -+      _M_data->_M_falsename_size = 5;
160.2207 -+    }
160.2208 -+
160.2209 -+  template<> 
160.2210 -+    numpunct<wchar_t>::~numpunct()
160.2211 -+    { delete _M_data; }
160.2212 -+ #endif
160.2213 -+}
160.2214 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc
160.2215 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc
160.2216 -@@ -0,0 +1,406 @@
160.2217 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
160.2218 -+
160.2219 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
160.2220 -+//
160.2221 -+// This file is part of the GNU ISO C++ Library.  This library is free
160.2222 -+// software; you can redistribute it and/or modify it under the
160.2223 -+// terms of the GNU General Public License as published by the
160.2224 -+// Free Software Foundation; either version 2, or (at your option)
160.2225 -+// any later version.
160.2226 -+
160.2227 -+// This library is distributed in the hope that it will be useful,
160.2228 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
160.2229 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
160.2230 -+// GNU General Public License for more details.
160.2231 -+
160.2232 -+// You should have received a copy of the GNU General Public License along
160.2233 -+// with this library; see the file COPYING.  If not, write to the Free
160.2234 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
160.2235 -+// USA.
160.2236 -+
160.2237 -+// As a special exception, you may use this file as part of a free software
160.2238 -+// library without restriction.  Specifically, if other files instantiate
160.2239 -+// templates or use macros or inline functions from this file, or you compile
160.2240 -+// this file and link it with other files to produce an executable, this
160.2241 -+// file does not by itself cause the resulting executable to be covered by
160.2242 -+// the GNU General Public License.  This exception does not however
160.2243 -+// invalidate any other reasons why the executable file might be covered by
160.2244 -+// the GNU General Public License.
160.2245 -+
160.2246 -+//
160.2247 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
160.2248 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
160.2249 -+//
160.2250 -+
160.2251 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
160.2252 -+
160.2253 -+#include <locale>
160.2254 -+#include <bits/c++locale_internal.h>
160.2255 -+
160.2256 -+#ifdef __UCLIBC_MJN3_ONLY__
160.2257 -+#warning tailor for stub locale support
160.2258 -+#endif
160.2259 -+#ifndef __UCLIBC_HAS_XLOCALE__
160.2260 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
160.2261 -+#endif
160.2262 -+
160.2263 -+namespace std
160.2264 -+{
160.2265 -+  template<>
160.2266 -+    void
160.2267 -+    __timepunct<char>::
160.2268 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
160.2269 -+	   const tm* __tm) const
160.2270 -+    {
160.2271 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.2272 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
160.2273 -+					_M_c_locale_timepunct);
160.2274 -+#else
160.2275 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
160.2276 -+      setlocale(LC_ALL, _M_name_timepunct);
160.2277 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
160.2278 -+      setlocale(LC_ALL, __old);
160.2279 -+      free(__old);
160.2280 -+#endif
160.2281 -+      // Make sure __s is null terminated.
160.2282 -+      if (__len == 0)
160.2283 -+	__s[0] = '\0';
160.2284 -+    }
160.2285 -+
160.2286 -+  template<> 
160.2287 -+    void
160.2288 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
160.2289 -+    {
160.2290 -+      if (!_M_data)
160.2291 -+	_M_data = new __timepunct_cache<char>;
160.2292 -+
160.2293 -+      if (!__cloc)
160.2294 -+	{
160.2295 -+	  // "C" locale
160.2296 -+	  _M_c_locale_timepunct = _S_get_c_locale();
160.2297 -+
160.2298 -+	  _M_data->_M_date_format = "%m/%d/%y";
160.2299 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
160.2300 -+	  _M_data->_M_time_format = "%H:%M:%S";
160.2301 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
160.2302 -+	  _M_data->_M_date_time_format = "";
160.2303 -+	  _M_data->_M_date_time_era_format = "";
160.2304 -+	  _M_data->_M_am = "AM";
160.2305 -+	  _M_data->_M_pm = "PM";
160.2306 -+	  _M_data->_M_am_pm_format = "";
160.2307 -+
160.2308 -+	  // Day names, starting with "C"'s Sunday.
160.2309 -+	  _M_data->_M_day1 = "Sunday";
160.2310 -+	  _M_data->_M_day2 = "Monday";
160.2311 -+	  _M_data->_M_day3 = "Tuesday";
160.2312 -+	  _M_data->_M_day4 = "Wednesday";
160.2313 -+	  _M_data->_M_day5 = "Thursday";
160.2314 -+	  _M_data->_M_day6 = "Friday";
160.2315 -+	  _M_data->_M_day7 = "Saturday";
160.2316 -+
160.2317 -+	  // Abbreviated day names, starting with "C"'s Sun.
160.2318 -+	  _M_data->_M_aday1 = "Sun";
160.2319 -+	  _M_data->_M_aday2 = "Mon";
160.2320 -+	  _M_data->_M_aday3 = "Tue";
160.2321 -+	  _M_data->_M_aday4 = "Wed";
160.2322 -+	  _M_data->_M_aday5 = "Thu";
160.2323 -+	  _M_data->_M_aday6 = "Fri";
160.2324 -+	  _M_data->_M_aday7 = "Sat";
160.2325 -+
160.2326 -+	  // Month names, starting with "C"'s January.
160.2327 -+	  _M_data->_M_month01 = "January";
160.2328 -+	  _M_data->_M_month02 = "February";
160.2329 -+	  _M_data->_M_month03 = "March";
160.2330 -+	  _M_data->_M_month04 = "April";
160.2331 -+	  _M_data->_M_month05 = "May";
160.2332 -+	  _M_data->_M_month06 = "June";
160.2333 -+	  _M_data->_M_month07 = "July";
160.2334 -+	  _M_data->_M_month08 = "August";
160.2335 -+	  _M_data->_M_month09 = "September";
160.2336 -+	  _M_data->_M_month10 = "October";
160.2337 -+	  _M_data->_M_month11 = "November";
160.2338 -+	  _M_data->_M_month12 = "December";
160.2339 -+
160.2340 -+	  // Abbreviated month names, starting with "C"'s Jan.
160.2341 -+	  _M_data->_M_amonth01 = "Jan";
160.2342 -+	  _M_data->_M_amonth02 = "Feb";
160.2343 -+	  _M_data->_M_amonth03 = "Mar";
160.2344 -+	  _M_data->_M_amonth04 = "Apr";
160.2345 -+	  _M_data->_M_amonth05 = "May";
160.2346 -+	  _M_data->_M_amonth06 = "Jun";
160.2347 -+	  _M_data->_M_amonth07 = "Jul";
160.2348 -+	  _M_data->_M_amonth08 = "Aug";
160.2349 -+	  _M_data->_M_amonth09 = "Sep";
160.2350 -+	  _M_data->_M_amonth10 = "Oct";
160.2351 -+	  _M_data->_M_amonth11 = "Nov";
160.2352 -+	  _M_data->_M_amonth12 = "Dec";
160.2353 -+	}
160.2354 -+      else
160.2355 -+	{
160.2356 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
160.2357 -+
160.2358 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
160.2359 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
160.2360 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
160.2361 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
160.2362 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
160.2363 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
160.2364 -+							     __cloc);
160.2365 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
160.2366 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
160.2367 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
160.2368 -+
160.2369 -+	  // Day names, starting with "C"'s Sunday.
160.2370 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
160.2371 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
160.2372 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
160.2373 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
160.2374 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
160.2375 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
160.2376 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
160.2377 -+
160.2378 -+	  // Abbreviated day names, starting with "C"'s Sun.
160.2379 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
160.2380 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
160.2381 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
160.2382 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
160.2383 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
160.2384 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
160.2385 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
160.2386 -+
160.2387 -+	  // Month names, starting with "C"'s January.
160.2388 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
160.2389 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
160.2390 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
160.2391 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
160.2392 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
160.2393 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
160.2394 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
160.2395 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
160.2396 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
160.2397 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
160.2398 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
160.2399 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
160.2400 -+
160.2401 -+	  // Abbreviated month names, starting with "C"'s Jan.
160.2402 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
160.2403 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
160.2404 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
160.2405 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
160.2406 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
160.2407 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
160.2408 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
160.2409 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
160.2410 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
160.2411 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
160.2412 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
160.2413 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
160.2414 -+	}
160.2415 -+    }
160.2416 -+
160.2417 -+#ifdef _GLIBCXX_USE_WCHAR_T
160.2418 -+  template<>
160.2419 -+    void
160.2420 -+    __timepunct<wchar_t>::
160.2421 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
160.2422 -+	   const tm* __tm) const
160.2423 -+    {
160.2424 -+#ifdef __UCLIBC_HAS_XLOCALE__
160.2425 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
160.2426 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
160.2427 -+					_M_c_locale_timepunct);
160.2428 -+#else
160.2429 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
160.2430 -+      setlocale(LC_ALL, _M_name_timepunct);
160.2431 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
160.2432 -+      setlocale(LC_ALL, __old);
160.2433 -+      free(__old);
160.2434 -+#endif
160.2435 -+      // Make sure __s is null terminated.
160.2436 -+      if (__len == 0)
160.2437 -+	__s[0] = L'\0';
160.2438 -+    }
160.2439 -+
160.2440 -+  template<> 
160.2441 -+    void
160.2442 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
160.2443 -+    {
160.2444 -+      if (!_M_data)
160.2445 -+	_M_data = new __timepunct_cache<wchar_t>;
160.2446 -+
160.2447 -+#warning wide time stuff
160.2448 -+//       if (!__cloc)
160.2449 -+	{
160.2450 -+	  // "C" locale
160.2451 -+	  _M_c_locale_timepunct = _S_get_c_locale();
160.2452 -+
160.2453 -+	  _M_data->_M_date_format = L"%m/%d/%y";
160.2454 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
160.2455 -+	  _M_data->_M_time_format = L"%H:%M:%S";
160.2456 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
160.2457 -+	  _M_data->_M_date_time_format = L"";
160.2458 -+	  _M_data->_M_date_time_era_format = L"";
160.2459 -+	  _M_data->_M_am = L"AM";
160.2460 -+	  _M_data->_M_pm = L"PM";
160.2461 -+	  _M_data->_M_am_pm_format = L"";
160.2462 -+
160.2463 -+	  // Day names, starting with "C"'s Sunday.
160.2464 -+	  _M_data->_M_day1 = L"Sunday";
160.2465 -+	  _M_data->_M_day2 = L"Monday";
160.2466 -+	  _M_data->_M_day3 = L"Tuesday";
160.2467 -+	  _M_data->_M_day4 = L"Wednesday";
160.2468 -+	  _M_data->_M_day5 = L"Thursday";
160.2469 -+	  _M_data->_M_day6 = L"Friday";
160.2470 -+	  _M_data->_M_day7 = L"Saturday";
160.2471 -+
160.2472 -+	  // Abbreviated day names, starting with "C"'s Sun.
160.2473 -+	  _M_data->_M_aday1 = L"Sun";
160.2474 -+	  _M_data->_M_aday2 = L"Mon";
160.2475 -+	  _M_data->_M_aday3 = L"Tue";
160.2476 -+	  _M_data->_M_aday4 = L"Wed";
160.2477 -+	  _M_data->_M_aday5 = L"Thu";
160.2478 -+	  _M_data->_M_aday6 = L"Fri";
160.2479 -+	  _M_data->_M_aday7 = L"Sat";
160.2480 -+
160.2481 -+	  // Month names, starting with "C"'s January.
160.2482 -+	  _M_data->_M_month01 = L"January";
160.2483 -+	  _M_data->_M_month02 = L"February";
160.2484 -+	  _M_data->_M_month03 = L"March";
160.2485 -+	  _M_data->_M_month04 = L"April";
160.2486 -+	  _M_data->_M_month05 = L"May";
160.2487 -+	  _M_data->_M_month06 = L"June";
160.2488 -+	  _M_data->_M_month07 = L"July";
160.2489 -+	  _M_data->_M_month08 = L"August";
160.2490 -+	  _M_data->_M_month09 = L"September";
160.2491 -+	  _M_data->_M_month10 = L"October";
160.2492 -+	  _M_data->_M_month11 = L"November";
160.2493 -+	  _M_data->_M_month12 = L"December";
160.2494 -+
160.2495 -+	  // Abbreviated month names, starting with "C"'s Jan.
160.2496 -+	  _M_data->_M_amonth01 = L"Jan";
160.2497 -+	  _M_data->_M_amonth02 = L"Feb";
160.2498 -+	  _M_data->_M_amonth03 = L"Mar";
160.2499 -+	  _M_data->_M_amonth04 = L"Apr";
160.2500 -+	  _M_data->_M_amonth05 = L"May";
160.2501 -+	  _M_data->_M_amonth06 = L"Jun";
160.2502 -+	  _M_data->_M_amonth07 = L"Jul";
160.2503 -+	  _M_data->_M_amonth08 = L"Aug";
160.2504 -+	  _M_data->_M_amonth09 = L"Sep";
160.2505 -+	  _M_data->_M_amonth10 = L"Oct";
160.2506 -+	  _M_data->_M_amonth11 = L"Nov";
160.2507 -+	  _M_data->_M_amonth12 = L"Dec";
160.2508 -+	}
160.2509 -+#if 0
160.2510 -+      else
160.2511 -+	{
160.2512 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
160.2513 -+
160.2514 -+	  union { char *__s; wchar_t *__w; } __u;
160.2515 -+
160.2516 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
160.2517 -+	  _M_data->_M_date_format = __u.__w;
160.2518 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
160.2519 -+	  _M_data->_M_date_era_format = __u.__w;
160.2520 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
160.2521 -+	  _M_data->_M_time_format = __u.__w;
160.2522 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
160.2523 -+	  _M_data->_M_time_era_format = __u.__w;
160.2524 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
160.2525 -+	  _M_data->_M_date_time_format = __u.__w;
160.2526 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
160.2527 -+	  _M_data->_M_date_time_era_format = __u.__w;
160.2528 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
160.2529 -+	  _M_data->_M_am = __u.__w;
160.2530 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
160.2531 -+	  _M_data->_M_pm = __u.__w;
160.2532 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
160.2533 -+	  _M_data->_M_am_pm_format = __u.__w;
160.2534 -+
160.2535 -+	  // Day names, starting with "C"'s Sunday.
160.2536 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
160.2537 -+	  _M_data->_M_day1 = __u.__w;
160.2538 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
160.2539 -+	  _M_data->_M_day2 = __u.__w;
160.2540 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
160.2541 -+	  _M_data->_M_day3 = __u.__w;
160.2542 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
160.2543 -+	  _M_data->_M_day4 = __u.__w;
160.2544 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
160.2545 -+	  _M_data->_M_day5 = __u.__w;
160.2546 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
160.2547 -+	  _M_data->_M_day6 = __u.__w;
160.2548 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
160.2549 -+	  _M_data->_M_day7 = __u.__w;
160.2550 -+
160.2551 -+	  // Abbreviated day names, starting with "C"'s Sun.
160.2552 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
160.2553 -+	  _M_data->_M_aday1 = __u.__w;
160.2554 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
160.2555 -+	  _M_data->_M_aday2 = __u.__w;
160.2556 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
160.2557 -+	  _M_data->_M_aday3 = __u.__w;
160.2558 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
160.2559 -+	  _M_data->_M_aday4 = __u.__w;
160.2560 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
160.2561 -+	  _M_data->_M_aday5 = __u.__w;
160.2562 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
160.2563 -+	  _M_data->_M_aday6 = __u.__w;
160.2564 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
160.2565 -+	  _M_data->_M_aday7 = __u.__w;
160.2566 -+
160.2567 -+	  // Month names, starting with "C"'s January.
160.2568 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
160.2569 -+	  _M_data->_M_month01 = __u.__w;
160.2570 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
160.2571 -+	  _M_data->_M_month02 = __u.__w;
160.2572 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
160.2573 -+	  _M_data->_M_month03 = __u.__w;
160.2574 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
160.2575 -+	  _M_data->_M_month04 = __u.__w;
160.2576 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
160.2577 -+	  _M_data->_M_month05 = __u.__w;
160.2578 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
160.2579 -+	  _M_data->_M_month06 = __u.__w;
160.2580 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
160.2581 -+	  _M_data->_M_month07 = __u.__w;
160.2582 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
160.2583 -+	  _M_data->_M_month08 = __u.__w;
160.2584 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
160.2585 -+	  _M_data->_M_month09 = __u.__w;
160.2586 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
160.2587 -+	  _M_data->_M_month10 = __u.__w;
160.2588 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
160.2589 -+	  _M_data->_M_month11 = __u.__w;
160.2590 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
160.2591 -+	  _M_data->_M_month12 = __u.__w;
160.2592 -+
160.2593 -+	  // Abbreviated month names, starting with "C"'s Jan.
160.2594 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
160.2595 -+	  _M_data->_M_amonth01 = __u.__w;
160.2596 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
160.2597 -+	  _M_data->_M_amonth02 = __u.__w;
160.2598 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
160.2599 -+	  _M_data->_M_amonth03 = __u.__w;
160.2600 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
160.2601 -+	  _M_data->_M_amonth04 = __u.__w;
160.2602 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
160.2603 -+	  _M_data->_M_amonth05 = __u.__w;
160.2604 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
160.2605 -+	  _M_data->_M_amonth06 = __u.__w;
160.2606 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
160.2607 -+	  _M_data->_M_amonth07 = __u.__w;
160.2608 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
160.2609 -+	  _M_data->_M_amonth08 = __u.__w;
160.2610 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
160.2611 -+	  _M_data->_M_amonth09 = __u.__w;
160.2612 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
160.2613 -+	  _M_data->_M_amonth10 = __u.__w;
160.2614 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
160.2615 -+	  _M_data->_M_amonth11 = __u.__w;
160.2616 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
160.2617 -+	  _M_data->_M_amonth12 = __u.__w;
160.2618 -+	}
160.2619 -+#endif // 0
160.2620 -+    }
160.2621 -+#endif
160.2622 -+}
160.2623 ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h
160.2624 -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h
160.2625 -@@ -0,0 +1,76 @@
160.2626 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
160.2627 -+
160.2628 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
160.2629 -+//
160.2630 -+// This file is part of the GNU ISO C++ Library.  This library is free
160.2631 -+// software; you can redistribute it and/or modify it under the
160.2632 -+// terms of the GNU General Public License as published by the
160.2633 -+// Free Software Foundation; either version 2, or (at your option)
160.2634 -+// any later version.
160.2635 -+
160.2636 -+// This library is distributed in the hope that it will be useful,
160.2637 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
160.2638 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
160.2639 -+// GNU General Public License for more details.
160.2640 -+
160.2641 -+// You should have received a copy of the GNU General Public License along
160.2642 -+// with this library; see the file COPYING.  If not, write to the Free
160.2643 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
160.2644 -+// USA.
160.2645 -+
160.2646 -+// As a special exception, you may use this file as part of a free software
160.2647 -+// library without restriction.  Specifically, if other files instantiate
160.2648 -+// templates or use macros or inline functions from this file, or you compile
160.2649 -+// this file and link it with other files to produce an executable, this
160.2650 -+// file does not by itself cause the resulting executable to be covered by
160.2651 -+// the GNU General Public License.  This exception does not however
160.2652 -+// invalidate any other reasons why the executable file might be covered by
160.2653 -+// the GNU General Public License.
160.2654 -+
160.2655 -+//
160.2656 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
160.2657 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
160.2658 -+//
160.2659 -+
160.2660 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
160.2661 -+
160.2662 -+  template<typename _CharT>
160.2663 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
160.2664 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
160.2665 -+      _M_name_timepunct(_S_get_c_name())
160.2666 -+    { _M_initialize_timepunct(); }
160.2667 -+
160.2668 -+  template<typename _CharT>
160.2669 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
160.2670 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
160.2671 -+      _M_name_timepunct(_S_get_c_name())
160.2672 -+    { _M_initialize_timepunct(); }
160.2673 -+
160.2674 -+  template<typename _CharT>
160.2675 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
160.2676 -+				     size_t __refs) 
160.2677 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
160.2678 -+      _M_name_timepunct(NULL)
160.2679 -+    { 
160.2680 -+      const size_t __len = std::strlen(__s) + 1;
160.2681 -+      char* __tmp = new char[__len];
160.2682 -+      std::memcpy(__tmp, __s, __len);
160.2683 -+      _M_name_timepunct = __tmp;
160.2684 -+
160.2685 -+      try
160.2686 -+	{ _M_initialize_timepunct(__cloc); }
160.2687 -+      catch(...)
160.2688 -+	{
160.2689 -+	  delete [] _M_name_timepunct;
160.2690 -+	  __throw_exception_again;
160.2691 -+	}
160.2692 -+    }
160.2693 -+
160.2694 -+  template<typename _CharT>
160.2695 -+    __timepunct<_CharT>::~__timepunct()
160.2696 -+    { 
160.2697 -+      if (_M_name_timepunct != _S_get_c_name())
160.2698 -+	delete [] _M_name_timepunct;
160.2699 -+      delete _M_data; 
160.2700 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
160.2701 -+    }
160.2702 ---- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h
160.2703 -+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h
160.2704 -@@ -0,0 +1,64 @@
160.2705 -+// Locale support -*- C++ -*-
160.2706 -+
160.2707 -+// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
160.2708 -+// Free Software Foundation, Inc.
160.2709 -+//
160.2710 -+// This file is part of the GNU ISO C++ Library.  This library is free
160.2711 -+// software; you can redistribute it and/or modify it under the
160.2712 -+// terms of the GNU General Public License as published by the
160.2713 -+// Free Software Foundation; either version 2, or (at your option)
160.2714 -+// any later version.
160.2715 -+
160.2716 -+// This library is distributed in the hope that it will be useful,
160.2717 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
160.2718 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
160.2719 -+// GNU General Public License for more details.
160.2720 -+
160.2721 -+// You should have received a copy of the GNU General Public License along
160.2722 -+// with this library; see the file COPYING.  If not, write to the Free
160.2723 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
160.2724 -+// USA.
160.2725 -+
160.2726 -+// As a special exception, you may use this file as part of a free software
160.2727 -+// library without restriction.  Specifically, if other files instantiate
160.2728 -+// templates or use macros or inline functions from this file, or you compile
160.2729 -+// this file and link it with other files to produce an executable, this
160.2730 -+// file does not by itself cause the resulting executable to be covered by
160.2731 -+// the GNU General Public License.  This exception does not however
160.2732 -+// invalidate any other reasons why the executable file might be covered by
160.2733 -+// the GNU General Public License.
160.2734 -+
160.2735 -+//
160.2736 -+// ISO C++ 14882: 22.1  Locales
160.2737 -+//
160.2738 -+  
160.2739 -+/** @file ctype_base.h
160.2740 -+ *  This is an internal header file, included by other library headers.
160.2741 -+ *  You should not attempt to use it directly.
160.2742 -+ */
160.2743 -+
160.2744 -+// Information as gleaned from /usr/include/ctype.h
160.2745 -+  
160.2746 -+  /// @brief  Base class for ctype.
160.2747 -+  struct ctype_base
160.2748 -+  {
160.2749 -+    // Note: In uClibc, the following two types depend on configuration.
160.2750 -+ 
160.2751 -+    // Non-standard typedefs.
160.2752 -+    typedef const __ctype_touplow_t* __to_type;
160.2753 -+
160.2754 -+    // NB: Offsets into ctype<char>::_M_table force a particular size
160.2755 -+    // on the mask type. Because of this, we don't use an enum.
160.2756 -+    typedef __ctype_mask_t	mask;   
160.2757 -+    static const mask upper    	= _ISupper;
160.2758 -+    static const mask lower 	= _ISlower;
160.2759 -+    static const mask alpha 	= _ISalpha;
160.2760 -+    static const mask digit 	= _ISdigit;
160.2761 -+    static const mask xdigit 	= _ISxdigit;
160.2762 -+    static const mask space 	= _ISspace;
160.2763 -+    static const mask print 	= _ISprint;
160.2764 -+    static const mask graph 	= _ISalpha | _ISdigit | _ISpunct;
160.2765 -+    static const mask cntrl 	= _IScntrl;
160.2766 -+    static const mask punct 	= _ISpunct;
160.2767 -+    static const mask alnum 	= _ISalpha | _ISdigit;
160.2768 -+  };
160.2769 ---- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h
160.2770 -+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
160.2771 -@@ -0,0 +1,69 @@
160.2772 -+// Locale support -*- C++ -*-
160.2773 -+
160.2774 -+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
160.2775 -+//
160.2776 -+// This file is part of the GNU ISO C++ Library.  This library is free
160.2777 -+// software; you can redistribute it and/or modify it under the
160.2778 -+// terms of the GNU General Public License as published by the
160.2779 -+// Free Software Foundation; either version 2, or (at your option)
160.2780 -+// any later version.
160.2781 -+
160.2782 -+// This library is distributed in the hope that it will be useful,
160.2783 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
160.2784 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
160.2785 -+// GNU General Public License for more details.
160.2786 -+
160.2787 -+// You should have received a copy of the GNU General Public License along
160.2788 -+// with this library; see the file COPYING.  If not, write to the Free
160.2789 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
160.2790 -+// USA.
160.2791 -+
160.2792 -+// As a special exception, you may use this file as part of a free software
160.2793 -+// library without restriction.  Specifically, if other files instantiate
160.2794 -+// templates or use macros or inline functions from this file, or you compile
160.2795 -+// this file and link it with other files to produce an executable, this
160.2796 -+// file does not by itself cause the resulting executable to be covered by
160.2797 -+// the GNU General Public License.  This exception does not however
160.2798 -+// invalidate any other reasons why the executable file might be covered by
160.2799 -+// the GNU General Public License.
160.2800 -+
160.2801 -+//
160.2802 -+// ISO C++ 14882: 22.1  Locales
160.2803 -+//
160.2804 -+  
160.2805 -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
160.2806 -+// functions go in ctype.cc
160.2807 -+  
160.2808 -+  bool
160.2809 -+  ctype<char>::
160.2810 -+  is(mask __m, char __c) const
160.2811 -+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
160.2812 -+
160.2813 -+  const char*
160.2814 -+  ctype<char>::
160.2815 -+  is(const char* __low, const char* __high, mask* __vec) const
160.2816 -+  {
160.2817 -+    while (__low < __high)
160.2818 -+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
160.2819 -+    return __high;
160.2820 -+  }
160.2821 -+
160.2822 -+  const char*
160.2823 -+  ctype<char>::
160.2824 -+  scan_is(mask __m, const char* __low, const char* __high) const
160.2825 -+  {
160.2826 -+    while (__low < __high 
160.2827 -+	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
160.2828 -+      ++__low;
160.2829 -+    return __low;
160.2830 -+  }
160.2831 -+
160.2832 -+  const char*
160.2833 -+  ctype<char>::
160.2834 -+  scan_not(mask __m, const char* __low, const char* __high) const
160.2835 -+  {
160.2836 -+    while (__low < __high 
160.2837 -+	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
160.2838 -+      ++__low;
160.2839 -+    return __low;
160.2840 -+  }
160.2841 ---- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h
160.2842 -+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
160.2843 -@@ -0,0 +1,92 @@
160.2844 -+// Locale support -*- C++ -*-
160.2845 -+
160.2846 -+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
160.2847 -+// Free Software Foundation, Inc.
160.2848 -+//
160.2849 -+// This file is part of the GNU ISO C++ Library.  This library is free
160.2850 -+// software; you can redistribute it and/or modify it under the
160.2851 -+// terms of the GNU General Public License as published by the
160.2852 -+// Free Software Foundation; either version 2, or (at your option)
160.2853 -+// any later version.
160.2854 -+
160.2855 -+// This library is distributed in the hope that it will be useful,
160.2856 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
160.2857 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
160.2858 -+// GNU General Public License for more details.
160.2859 -+
160.2860 -+// You should have received a copy of the GNU General Public License along
160.2861 -+// with this library; see the file COPYING.  If not, write to the Free
160.2862 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
160.2863 -+// USA.
160.2864 -+
160.2865 -+// As a special exception, you may use this file as part of a free software
160.2866 -+// library without restriction.  Specifically, if other files instantiate
160.2867 -+// templates or use macros or inline functions from this file, or you compile
160.2868 -+// this file and link it with other files to produce an executable, this
160.2869 -+// file does not by itself cause the resulting executable to be covered by
160.2870 -+// the GNU General Public License.  This exception does not however
160.2871 -+// invalidate any other reasons why the executable file might be covered by
160.2872 -+// the GNU General Public License.
160.2873 -+
160.2874 -+//
160.2875 -+// ISO C++ 14882: 22.1  Locales
160.2876 -+//
160.2877 -+  
160.2878 -+// Information as gleaned from /usr/include/ctype.h
160.2879 -+
160.2880 -+  const ctype_base::mask*
160.2881 -+  ctype<char>::classic_table() throw()
160.2882 -+  { return __C_ctype_b; }
160.2883 -+
160.2884 -+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
160.2885 -+		     size_t __refs) 
160.2886 -+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
160.2887 -+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
160.2888 -+  {
160.2889 -+    _M_toupper = __C_ctype_toupper;
160.2890 -+    _M_tolower = __C_ctype_tolower;
160.2891 -+    _M_table = __table ? __table : __C_ctype_b;
160.2892 -+    memset(_M_widen, 0, sizeof(_M_widen));
160.2893 -+    memset(_M_narrow, 0, sizeof(_M_narrow));
160.2894 -+  }
160.2895 -+
160.2896 -+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
160.2897 -+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
160.2898 -+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
160.2899 -+  {
160.2900 -+    _M_toupper = __C_ctype_toupper;
160.2901 -+    _M_tolower = __C_ctype_tolower;
160.2902 -+    _M_table = __table ? __table : __C_ctype_b;
160.2903 -+    memset(_M_widen, 0, sizeof(_M_widen));
160.2904 -+    memset(_M_narrow, 0, sizeof(_M_narrow));
160.2905 -+  }
160.2906 -+
160.2907 -+  char
160.2908 -+  ctype<char>::do_toupper(char __c) const
160.2909 -+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
160.2910 -+
160.2911 -+  const char*
160.2912 -+  ctype<char>::do_toupper(char* __low, const char* __high) const
160.2913 -+  {
160.2914 -+    while (__low < __high)
160.2915 -+      {
160.2916 -+	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
160.2917 -+	++__low;
160.2918 -+      }
160.2919 -+    return __high;
160.2920 -+  }
160.2921 -+
160.2922 -+  char
160.2923 -+  ctype<char>::do_tolower(char __c) const
160.2924 -+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
160.2925 -+
160.2926 -+  const char* 
160.2927 -+  ctype<char>::do_tolower(char* __low, const char* __high) const
160.2928 -+  {
160.2929 -+    while (__low < __high)
160.2930 -+      {
160.2931 -+	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
160.2932 -+	++__low;
160.2933 -+      }
160.2934 -+    return __high;
160.2935 -+  }
160.2936 ---- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h
160.2937 -+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h
160.2938 -@@ -0,0 +1,44 @@
160.2939 -+// Specific definitions for GNU/Linux  -*- C++ -*-
160.2940 -+
160.2941 -+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
160.2942 -+//
160.2943 -+// This file is part of the GNU ISO C++ Library.  This library is free
160.2944 -+// software; you can redistribute it and/or modify it under the
160.2945 -+// terms of the GNU General Public License as published by the
160.2946 -+// Free Software Foundation; either version 2, or (at your option)
160.2947 -+// any later version.
160.2948 -+
160.2949 -+// This library is distributed in the hope that it will be useful,
160.2950 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
160.2951 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
160.2952 -+// GNU General Public License for more details.
160.2953 -+
160.2954 -+// You should have received a copy of the GNU General Public License along
160.2955 -+// with this library; see the file COPYING.  If not, write to the Free
160.2956 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
160.2957 -+// USA.
160.2958 -+
160.2959 -+// As a special exception, you may use this file as part of a free software
160.2960 -+// library without restriction.  Specifically, if other files instantiate
160.2961 -+// templates or use macros or inline functions from this file, or you compile
160.2962 -+// this file and link it with other files to produce an executable, this
160.2963 -+// file does not by itself cause the resulting executable to be covered by
160.2964 -+// the GNU General Public License.  This exception does not however
160.2965 -+// invalidate any other reasons why the executable file might be covered by
160.2966 -+// the GNU General Public License.
160.2967 -+
160.2968 -+#ifndef _GLIBCXX_OS_DEFINES
160.2969 -+#define _GLIBCXX_OS_DEFINES 1
160.2970 -+
160.2971 -+// System-specific #define, typedefs, corrections, etc, go here.  This
160.2972 -+// file will come before all others.
160.2973 -+
160.2974 -+// This keeps isanum, et al from being propagated as macros.
160.2975 -+#define __NO_CTYPE 1
160.2976 -+
160.2977 -+#include <features.h>
160.2978 -+
160.2979 -+// We must not see the optimized string functions GNU libc defines.
160.2980 -+#define __NO_STRING_INLINES
160.2981 -+
160.2982 -+#endif
160.2983 ---- gcc-4.1.0-dist/libstdc++-v3/configure
160.2984 -+++ gcc-4.1.0/libstdc++-v3/configure
160.2985 -@@ -4005,6 +4005,11 @@
160.2986 -   lt_cv_deplibs_check_method=pass_all
160.2987 -   ;;
160.2988 - 
160.2989 -+linux-uclibc*)
160.2990 -+  lt_cv_deplibs_check_method=pass_all
160.2991 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
160.2992 -+  ;;
160.2993 -+
160.2994 - netbsd* | knetbsd*-gnu)
160.2995 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
160.2996 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
160.2997 -@@ -5740,7 +5745,7 @@
160.2998 -   enableval="$enable_clocale"
160.2999 - 
160.3000 -       case "$enableval" in
160.3001 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
160.3002 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
160.3003 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
160.3004 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
160.3005 -    { (exit 1); exit 1; }; } ;;
160.3006 -@@ -5765,6 +5770,9 @@
160.3007 -   # Default to "generic".
160.3008 -   if test $enable_clocale_flag = auto; then
160.3009 -     case ${target_os} in
160.3010 -+      linux-uclibc*)
160.3011 -+        enable_clocale_flag=uclibc
160.3012 -+	;;
160.3013 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
160.3014 -         cat >conftest.$ac_ext <<_ACEOF
160.3015 - /* confdefs.h.  */
160.3016 -@@ -5995,6 +6003,76 @@
160.3017 -       CTIME_CC=config/locale/generic/time_members.cc
160.3018 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
160.3019 -       ;;
160.3020 -+    uclibc)
160.3021 -+      echo "$as_me:$LINENO: result: uclibc" >&5
160.3022 -+echo "${ECHO_T}uclibc" >&6
160.3023 -+
160.3024 -+      # Declare intention to use gettext, and add support for specific
160.3025 -+      # languages.
160.3026 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
160.3027 -+      ALL_LINGUAS="de fr"
160.3028 -+
160.3029 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
160.3030 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
160.3031 -+set dummy msgfmt; ac_word=$2
160.3032 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
160.3033 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
160.3034 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
160.3035 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
160.3036 -+else
160.3037 -+  if test -n "$check_msgfmt"; then
160.3038 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
160.3039 -+else
160.3040 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
160.3041 -+for as_dir in $PATH
160.3042 -+do
160.3043 -+  IFS=$as_save_IFS
160.3044 -+  test -z "$as_dir" && as_dir=.
160.3045 -+  for ac_exec_ext in '' $ac_executable_extensions; do
160.3046 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
160.3047 -+    ac_cv_prog_check_msgfmt="yes"
160.3048 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
160.3049 -+    break 2
160.3050 -+  fi
160.3051 -+done
160.3052 -+done
160.3053 -+
160.3054 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
160.3055 -+fi
160.3056 -+fi
160.3057 -+check_msgfmt=$ac_cv_prog_check_msgfmt
160.3058 -+if test -n "$check_msgfmt"; then
160.3059 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
160.3060 -+echo "${ECHO_T}$check_msgfmt" >&6
160.3061 -+else
160.3062 -+  echo "$as_me:$LINENO: result: no" >&5
160.3063 -+echo "${ECHO_T}no" >&6
160.3064 -+fi
160.3065 -+
160.3066 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
160.3067 -+        USE_NLS=yes
160.3068 -+      fi
160.3069 -+      # Export the build objects.
160.3070 -+      for ling in $ALL_LINGUAS; do \
160.3071 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
160.3072 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
160.3073 -+      done
160.3074 -+
160.3075 -+
160.3076 -+
160.3077 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
160.3078 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
160.3079 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
160.3080 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
160.3081 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
160.3082 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
160.3083 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
160.3084 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
160.3085 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
160.3086 -+      CTIME_H=config/locale/uclibc/time_members.h
160.3087 -+      CTIME_CC=config/locale/uclibc/time_members.cc
160.3088 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
160.3089 -+      ;;
160.3090 -   esac
160.3091 - 
160.3092 -   # This is where the testsuite looks for locale catalogs, using the
160.3093 ---- gcc-4.1.0-dist/libstdc++-v3/configure.host
160.3094 -+++ gcc-4.1.0/libstdc++-v3/configure.host
160.3095 -@@ -261,6 +261,12 @@
160.3096 -     ;;
160.3097 - esac
160.3098 - 
160.3099 -+# Override for uClibc since linux-uclibc gets mishandled above.
160.3100 -+case "${host_os}" in
160.3101 -+  *-uclibc*)
160.3102 -+    os_include_dir="os/uclibc"
160.3103 -+    ;;
160.3104 -+esac
160.3105 - 
160.3106 - # Set any OS-dependent and CPU-dependent bits.
160.3107 - # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
160.3108 ---- gcc-4.1.0-dist/libstdc++-v3/crossconfig.m4
160.3109 -+++ gcc-4.1.0/libstdc++-v3/crossconfig.m4
160.3110 -@@ -143,6 +143,99 @@
160.3111 - 	;;
160.3112 -     esac
160.3113 -     ;;
160.3114 -+  *-uclibc*)
160.3115 -+# Temporary hack until we implement the float versions of the libm funcs
160.3116 -+    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
160.3117 -+      machine/endian.h machine/param.h sys/machine.h sys/types.h \
160.3118 -+      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
160.3119 -+    SECTION_FLAGS='-ffunction-sections -fdata-sections'
160.3120 -+    AC_SUBST(SECTION_FLAGS)
160.3121 -+    GLIBCXX_CHECK_LINKER_FEATURES
160.3122 -+    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
160.3123 -+    GLIBCXX_CHECK_WCHAR_T_SUPPORT
160.3124 -+
160.3125 -+    # For LFS.
160.3126 -+    AC_DEFINE(HAVE_INT64_T)
160.3127 -+    case "$target" in
160.3128 -+      *-uclinux*)
160.3129 -+        # Don't enable LFS with uClinux
160.3130 -+        ;;
160.3131 -+      *)
160.3132 -+        AC_DEFINE(_GLIBCXX_USE_LFS)
160.3133 -+    esac
160.3134 -+
160.3135 -+    # For showmanyc_helper().
160.3136 -+    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
160.3137 -+    GLIBCXX_CHECK_POLL
160.3138 -+    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
160.3139 -+
160.3140 -+    # For xsputn_2().
160.3141 -+    AC_CHECK_HEADERS(sys/uio.h)
160.3142 -+    GLIBCXX_CHECK_WRITEV
160.3143 -+
160.3144 -+#     AC_DEFINE(HAVE_ACOSF)
160.3145 -+#     AC_DEFINE(HAVE_ASINF)
160.3146 -+#     AC_DEFINE(HAVE_ATANF)
160.3147 -+#     AC_DEFINE(HAVE_ATAN2F)
160.3148 -+    AC_DEFINE(HAVE_CEILF)
160.3149 -+    AC_DEFINE(HAVE_COPYSIGN)
160.3150 -+#     AC_DEFINE(HAVE_COPYSIGNF)
160.3151 -+#     AC_DEFINE(HAVE_COSF)
160.3152 -+#     AC_DEFINE(HAVE_COSHF)
160.3153 -+#     AC_DEFINE(HAVE_EXPF)
160.3154 -+#     AC_DEFINE(HAVE_FABSF)
160.3155 -+    AC_DEFINE(HAVE_FINITE)
160.3156 -+    AC_DEFINE(HAVE_FINITEF)
160.3157 -+    AC_DEFINE(HAVE_FLOORF)
160.3158 -+#     AC_DEFINE(HAVE_FMODF)
160.3159 -+#     AC_DEFINE(HAVE_FREXPF)
160.3160 -+    AC_DEFINE(HAVE_HYPOT)
160.3161 -+#     AC_DEFINE(HAVE_HYPOTF)
160.3162 -+    AC_DEFINE(HAVE_ISINF)
160.3163 -+    AC_DEFINE(HAVE_ISINFF)
160.3164 -+    AC_DEFINE(HAVE_ISNAN)
160.3165 -+    AC_DEFINE(HAVE_ISNANF)
160.3166 -+#     AC_DEFINE(HAVE_LOGF)
160.3167 -+#     AC_DEFINE(HAVE_LOG10F)
160.3168 -+#     AC_DEFINE(HAVE_MODFF)
160.3169 -+#     AC_DEFINE(HAVE_SINF)
160.3170 -+#     AC_DEFINE(HAVE_SINHF)
160.3171 -+#     AC_DEFINE(HAVE_SINCOS)
160.3172 -+#     AC_DEFINE(HAVE_SINCOSF)
160.3173 -+    AC_DEFINE(HAVE_SQRTF)
160.3174 -+#     AC_DEFINE(HAVE_TANF)
160.3175 -+#     AC_DEFINE(HAVE_TANHF)
160.3176 -+    if test x"long_double_math_on_this_cpu" = x"yes"; then
160.3177 -+      AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
160.3178 -+#       AC_DEFINE(HAVE_ACOSL)
160.3179 -+#       AC_DEFINE(HAVE_ASINL)
160.3180 -+#       AC_DEFINE(HAVE_ATANL)
160.3181 -+#       AC_DEFINE(HAVE_ATAN2L)
160.3182 -+#       AC_DEFINE(HAVE_CEILL)
160.3183 -+#       AC_DEFINE(HAVE_COPYSIGNL)
160.3184 -+#       AC_DEFINE(HAVE_COSL)
160.3185 -+#       AC_DEFINE(HAVE_COSHL)
160.3186 -+#       AC_DEFINE(HAVE_EXPL)
160.3187 -+#       AC_DEFINE(HAVE_FABSL)
160.3188 -+#       AC_DEFINE(HAVE_FINITEL)
160.3189 -+#       AC_DEFINE(HAVE_FLOORL)
160.3190 -+#       AC_DEFINE(HAVE_FMODL)
160.3191 -+#       AC_DEFINE(HAVE_FREXPL)
160.3192 -+#       AC_DEFINE(HAVE_HYPOTL)
160.3193 -+#       AC_DEFINE(HAVE_ISINFL)
160.3194 -+#       AC_DEFINE(HAVE_ISNANL)
160.3195 -+#       AC_DEFINE(HAVE_LOGL)
160.3196 -+#       AC_DEFINE(HAVE_LOG10L)
160.3197 -+#       AC_DEFINE(HAVE_MODFL)
160.3198 -+#       AC_DEFINE(HAVE_POWL)
160.3199 -+#       AC_DEFINE(HAVE_SINL)
160.3200 -+#       AC_DEFINE(HAVE_SINHL)
160.3201 -+#       AC_DEFINE(HAVE_SINCOSL)
160.3202 -+#       AC_DEFINE(HAVE_SQRTL)
160.3203 -+#       AC_DEFINE(HAVE_TANL)
160.3204 -+#       AC_DEFINE(HAVE_TANHL)
160.3205 -+    fi
160.3206 -+    ;;
160.3207 -   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
160.3208 -     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
160.3209 -       machine/endian.h machine/param.h sys/machine.h sys/types.h \
160.3210 -@@ -157,7 +250,7 @@
160.3211 -     AC_DEFINE(HAVE_INT64_T)
160.3212 -     case "$target" in
160.3213 -       *-uclinux*)
160.3214 --        # Don't enable LFS with uClibc
160.3215 -+        # Don't enable LFS with uClinux
160.3216 -         ;;
160.3217 -       *)
160.3218 -         AC_DEFINE(_GLIBCXX_USE_LFS)
160.3219 ---- gcc-4.1.0-dist/libstdc++-v3/include/c_compatibility/wchar.h
160.3220 -+++ gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h
160.3221 -@@ -101,7 +101,9 @@
160.3222 - using std::wmemcpy;
160.3223 - using std::wmemmove;
160.3224 - using std::wmemset;
160.3225 -+#if _GLIBCXX_HAVE_WCSFTIME
160.3226 - using std::wcsftime;
160.3227 -+#endif
160.3228 - 
160.3229 - #if _GLIBCXX_USE_C99
160.3230 - using std::wcstold;
160.3231 ---- gcc-4.1.0-dist/libstdc++-v3/include/c_std/std_cwchar.h
160.3232 -+++ gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h
160.3233 -@@ -180,7 +180,9 @@
160.3234 -   using ::wcscoll;
160.3235 -   using ::wcscpy;
160.3236 -   using ::wcscspn;
160.3237 -+#if _GLIBCXX_HAVE_WCSFTIME
160.3238 -   using ::wcsftime;
160.3239 -+#endif
160.3240 -   using ::wcslen;
160.3241 -   using ::wcsncat;
160.3242 -   using ::wcsncmp;
   161.1 --- a/patches/gcc/4.1.1/300-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   161.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   161.3 @@ -1,50 +0,0 @@
   161.4 -# DP: Build and install libstdc++_pic.a library.
   161.5 -
   161.6 ---- gcc/libstdc++-v3/src/Makefile.am
   161.7 -+++ gcc/libstdc++-v3/src/Makefile.am
   161.8 -@@ -214,6 +214,12 @@
   161.9 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
  161.10 - 
  161.11 - 
  161.12 -+install-exec-local:
  161.13 -+ifeq ($(enable_shared),yes)
  161.14 -+	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  161.15 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  161.16 -+endif
  161.17 -+
  161.18 - # Added bits to build debug library.
  161.19 - if GLIBCXX_BUILD_DEBUG
  161.20 - all-local: build_debug
  161.21 ---- gcc/libstdc++-v3/src/Makefile.in
  161.22 -+++ gcc/libstdc++-v3/src/Makefile.in
  161.23 -@@ -627,7 +627,7 @@
  161.24 - 
  161.25 - install-data-am: install-data-local
  161.26 - 
  161.27 --install-exec-am: install-toolexeclibLTLIBRARIES
  161.28 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  161.29 - 
  161.30 - install-info: install-info-am
  161.31 - 
  161.32 -@@ -660,6 +660,7 @@
  161.33 - 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  161.34 - 	html-am info info-am install install-am install-data \
  161.35 - 	install-data-am install-data-local install-exec \
  161.36 -+	install-exec-local \
  161.37 - 	install-exec-am install-info install-info-am install-man \
  161.38 - 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  161.39 - 	installcheck-am installdirs maintainer-clean \
  161.40 -@@ -743,6 +743,13 @@
  161.41 - install_debug:
  161.42 - 	(cd ${debugdir} && $(MAKE) \
  161.43 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  161.44 -+
  161.45 -+install-exec-local:
  161.46 -+ifeq ($(enable_shared),yes)
  161.47 -+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  161.48 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  161.49 -+endif
  161.50 -+
  161.51 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  161.52 - # Otherwise a system limit (for SysV at least) may be exceeded.
  161.53 - .NOEXPORT:
   162.1 --- a/patches/gcc/4.1.1/301-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   162.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   162.3 @@ -1,11 +0,0 @@
   162.4 ---- gcc-4.0.0/boehm-gc/include/gc.h-orig	2005-04-28 22:28:57.000000000 -0500
   162.5 -+++ gcc-4.0.0/boehm-gc/include/gc.h	2005-04-28 22:30:38.000000000 -0500
   162.6 -@@ -500,7 +500,7 @@
   162.7 - #ifdef __linux__
   162.8 - # include <features.h>
   162.9 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  162.10 --     && !defined(__ia64__)
  162.11 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  162.12 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  162.13 - #     define GC_HAVE_BUILTIN_BACKTRACE
  162.14 - #   endif
   163.1 --- a/patches/gcc/4.1.1/302-c99-snprintf.patch	Mon Jul 28 21:08:01 2008 +0000
   163.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   163.3 @@ -1,11 +0,0 @@
   163.4 ---- gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h-orig	2005-04-29 00:08:41.000000000 -0500
   163.5 -+++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h	2005-04-29 00:08:45.000000000 -0500
   163.6 -@@ -142,7 +142,7 @@
   163.7 -   using ::vsprintf;
   163.8 - }
   163.9 - 
  163.10 --#if _GLIBCXX_USE_C99
  163.11 -+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  163.12 - 
  163.13 - #undef snprintf
  163.14 - #undef vfscanf
   164.1 --- a/patches/gcc/4.1.1/303-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   164.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   164.3 @@ -1,12 +0,0 @@
   164.4 ---- gcc-4.0.0/libstdc++-v3/configure-old	2005-04-30 22:04:48.061603912 -0500
   164.5 -+++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 22:06:13.678588152 -0500
   164.6 -@@ -7194,6 +7194,9 @@
   164.7 - cat >>conftest.$ac_ext <<_ACEOF
   164.8 - /* end confdefs.h.  */
   164.9 - #include <complex.h>
  164.10 -+#ifdef __UCLIBC__
  164.11 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  164.12 -+#endif
  164.13 - int
  164.14 - main ()
  164.15 - {
   165.1 --- a/patches/gcc/4.1.1/304-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   165.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   165.3 @@ -1,24 +0,0 @@
   165.4 ---- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps	2006-03-24 01:49:51 +0100
   165.5 -+++ gcc-4.1.0/libstdc++-v3/include/ext/rope	2006-03-24 01:49:37 +0100
   165.6 -@@ -59,6 +59,9 @@
   165.7 - #include <bits/allocator.h>
   165.8 - #include <ext/hash_fun.h>
   165.9 - 
  165.10 -+/* cope w/ index defined as macro, SuSv3 proposal */
  165.11 -+#undef index
  165.12 -+
  165.13 - # ifdef __GC
  165.14 - #   define __GC_CONST const
  165.15 - # else
  165.16 ---- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps	2006-03-24 01:50:04 +0100
  165.17 -+++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h	2006-03-24 01:50:28 +0100
  165.18 -@@ -53,6 +53,9 @@
  165.19 - #include <ext/memory> // For uninitialized_copy_n
  165.20 - #include <ext/numeric> // For power
  165.21 - 
  165.22 -+/* cope w/ index defined as macro, SuSv3 proposal */
  165.23 -+#undef index
  165.24 -+
  165.25 - namespace __gnu_cxx
  165.26 - {
  165.27 -   using std::size_t;
   166.1 --- a/patches/gcc/4.1.1/740-sh-pr24836.patch	Mon Jul 28 21:08:01 2008 +0000
   166.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   166.3 @@ -1,25 +0,0 @@
   166.4 -http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
   166.5 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
   166.6 -
   166.7 ---- gcc/gcc/configure.ac	(revision 106699)
   166.8 -+++ gcc/gcc/configure.ac	(working copy)
   166.9 -@@ -2446,7 +2446,7 @@
  166.10 - 	tls_first_minor=14
  166.11 - 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  166.12 - 	;;
  166.13 --  sh-*-* | sh[34]-*-*)
  166.14 -+  sh-*-* | sh[34]*-*-*)
  166.15 -     conftest_s='
  166.16 - 	.section ".tdata","awT",@progbits
  166.17 - foo:	.long	25
  166.18 ---- gcc/gcc/configure
  166.19 -+++ gcc/gcc/configure
  166.20 -@@ -14846,7 +14846,7 @@
  166.21 - 	tls_first_minor=14
  166.22 - 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  166.23 - 	;;
  166.24 --  sh-*-* | sh[34]-*-*)
  166.25 -+  sh-*-* | sh[34]*-*-*)
  166.26 -     conftest_s='
  166.27 - 	.section ".tdata","awT",@progbits
  166.28 - foo:	.long	25
   167.1 --- a/patches/gcc/4.1.1/800-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
   167.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   167.3 @@ -1,67 +0,0 @@
   167.4 -By Lennert Buytenhek <buytenh@wantstofly.org>
   167.5 -Adds support for arm*b-linux* big-endian ARM targets
   167.6 -
   167.7 -See http://gcc.gnu.org/PR16350
   167.8 -
   167.9 ---- gcc-4.1.0/gcc/config/arm/linux-elf.h
  167.10 -+++ gcc-4.1.0/gcc/config/arm/linux-elf.h
  167.11 -@@ -28,19 +28,33 @@
  167.12 - #undef  TARGET_VERSION
  167.13 - #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  167.14 - 
  167.15 -+/*
  167.16 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  167.17 -+ * (big endian) configurations.
  167.18 -+ */
  167.19 -+#if TARGET_BIG_ENDIAN_DEFAULT
  167.20 -+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  167.21 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
  167.22 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
  167.23 -+#else
  167.24 -+#define TARGET_ENDIAN_DEFAULT 0
  167.25 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
  167.26 -+#define TARGET_LINKER_EMULATION "armelf_linux"
  167.27 -+#endif
  167.28 -+
  167.29 - #undef  TARGET_DEFAULT_FLOAT_ABI
  167.30 - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  167.31 - 
  167.32 - #undef  TARGET_DEFAULT
  167.33 --#define TARGET_DEFAULT (0)
  167.34 -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  167.35 - 
  167.36 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  167.37 - 
  167.38 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  167.39 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  167.40 - 
  167.41 - #undef  MULTILIB_DEFAULTS
  167.42 - #define MULTILIB_DEFAULTS \
  167.43 --	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  167.44 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  167.45 - 
  167.46 - /* Now we define the strings used to build the spec file.  */
  167.47 - #undef  LIB_SPEC
  167.48 -@@ -61,7 +75,7 @@
  167.49 -    %{rdynamic:-export-dynamic} \
  167.50 -    %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
  167.51 -    -X \
  167.52 --   %{mbig-endian:-EB}" \
  167.53 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  167.54 -    SUBTARGET_EXTRA_LINK_SPEC
  167.55 - 
  167.56 - #undef  LINK_SPEC
  167.57 ---- gcc-4.1.0/gcc/config.gcc
  167.58 -+++ gcc-4.1.0/gcc/config.gcc
  167.59 -@@ -672,6 +672,11 @@
  167.60 - 	;;
  167.61 - arm*-*-linux*)			# ARM GNU/Linux with ELF
  167.62 - 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" 
  167.63 -+	case $target in
  167.64 -+	arm*b-*)
  167.65 -+		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  167.66 -+		;;
  167.67 -+	esac
  167.68 - 	tmake_file="${tmake_file} t-linux arm/t-arm"
  167.69 - 	case ${target} in
  167.70 - 	arm*-*-linux-gnueabi)
   168.1 --- a/patches/gcc/4.1.1/801-softfloat-fix.patch	Mon Jul 28 21:08:01 2008 +0000
   168.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   168.3 @@ -1,58 +0,0 @@
   168.4 -This patch (C) 2007 Yann E. MORIN
   168.5 -Licensed under GPL v2.
   168.6 -
   168.7 -First hunk of this patch solves compiling uClibc-0.9.28{,.1} :
   168.8 -
   168.9 -make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  168.10 -  LD libuClibc-0.9.29.so
  168.11 -libc/libc_so.a(difftime.os): In function `difftime':
  168.12 -difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  168.13 -difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  168.14 -libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  168.15 -_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  168.16 -_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  168.17 -_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  168.18 -_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  168.19 -_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  168.20 -_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  168.21 -_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  168.22 -libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  168.23 -__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  168.24 -libc/libc_so.a(strtof.os): In function `strtof':
  168.25 -strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  168.26 -/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  168.27 -In function `__fixunsdfsi':
  168.28 -libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  168.29 -make[2]: *** [lib/libc.so] Error 1
  168.30 -make[1]: *** [lib/libc.so.0] Error 2
  168.31 -make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  168.32 -make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  168.33 -Error 2
  168.34 -
  168.35 -The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  168.36 -
  168.37 -
  168.38 -diff -dur gcc-4.1.1.no-softfloat-fix/gcc/config.gcc gcc-4.1.1/gcc/config.gcc
  168.39 ---- gcc-4.1.1.no-softfloat-fix/gcc/config.gcc	2007-02-01 21:57:17.000000000 +0100
  168.40 -+++ gcc-4.1.1/gcc/config.gcc	2007-02-01 22:11:06.000000000 +0100
  168.41 -@@ -690,7 +690,7 @@
  168.42 - 	    default_use_cxa_atexit=yes
  168.43 - 	    ;;
  168.44 - 	*)
  168.45 --	    tmake_file="$tmake_file arm/t-linux"
  168.46 -+	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  168.47 - 	    ;;
  168.48 - 	esac
  168.49 - 	tm_file="$tm_file arm/aout.h arm/arm.h"
  168.50 -diff -dur gcc-4.1.1.-lfloat/gcc/config/arm/linux-elf.h gcc-4.1.1/gcc/config/arm/linux-elf.h
  168.51 ---- gcc-4.1.1.-lfloat/gcc/config/arm/linux-elf.h	2007-02-01 21:57:17.000000000 +0100
  168.52 -+++ gcc-4.1.1/gcc/config/arm/linux-elf.h	2007-02-01 23:00:42.000000000 +0100
  168.53 -@@ -63,7 +63,7 @@
  168.54 -    %{shared:-lc} \
  168.55 -    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  168.56 - 
  168.57 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  168.58 -+#define LIBGCC_SPEC "-lgcc"
  168.59 - 
  168.60 - #ifdef USE_UCLIBC
  168.61 - #define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
   169.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   169.2 +++ b/patches/gcc/4.1.2/120-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   169.3 @@ -0,0 +1,3239 @@
   169.4 +--- gcc-4.1.2.orig/libstdc++-v3/acinclude.m4	2007-01-29 11:51:01.000000000 +0100
   169.5 ++++ gcc-4.1.2/libstdc++-v3/acinclude.m4	2007-03-04 23:31:57.000000000 +0100
   169.6 +@@ -1003,7 +1003,7 @@
   169.7 +   AC_MSG_CHECKING([for C locale to use])
   169.8 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
   169.9 +     [use MODEL for target locale package],
  169.10 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  169.11 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  169.12 +   
  169.13 +   # If they didn't use this option switch, or if they specified --enable
  169.14 +   # with no specific model, we'll have to look for one.  If they
  169.15 +@@ -1019,6 +1019,9 @@
  169.16 +   # Default to "generic".
  169.17 +   if test $enable_clocale_flag = auto; then
  169.18 +     case ${target_os} in
  169.19 ++      *-uclibc*)
  169.20 ++        enable_clocale_flag=uclibc
  169.21 ++        ;;
  169.22 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  169.23 +         AC_EGREP_CPP([_GLIBCXX_ok], [
  169.24 +         #include <features.h>
  169.25 +@@ -1162,6 +1165,40 @@
  169.26 +       CTIME_CC=config/locale/generic/time_members.cc
  169.27 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  169.28 +       ;;
  169.29 ++    uclibc)
  169.30 ++      AC_MSG_RESULT(uclibc)
  169.31 ++
  169.32 ++      # Declare intention to use gettext, and add support for specific
  169.33 ++      # languages.
  169.34 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  169.35 ++      ALL_LINGUAS="de fr"
  169.36 ++
  169.37 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  169.38 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  169.39 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  169.40 ++        USE_NLS=yes
  169.41 ++      fi
  169.42 ++      # Export the build objects.
  169.43 ++      for ling in $ALL_LINGUAS; do \
  169.44 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  169.45 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  169.46 ++      done
  169.47 ++      AC_SUBST(glibcxx_MOFILES)
  169.48 ++      AC_SUBST(glibcxx_POFILES)
  169.49 ++
  169.50 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  169.51 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  169.52 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  169.53 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  169.54 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  169.55 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  169.56 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  169.57 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  169.58 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  169.59 ++      CTIME_H=config/locale/uclibc/time_members.h
  169.60 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  169.61 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  169.62 ++      ;;
  169.63 +   esac
  169.64 + 
  169.65 +   # This is where the testsuite looks for locale catalogs, using the
  169.66 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
  169.67 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-03-04 23:31:57.000000000 +0100
  169.68 +@@ -0,0 +1,63 @@
  169.69 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  169.70 ++
  169.71 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  169.72 ++//
  169.73 ++// This file is part of the GNU ISO C++ Library.  This library is free
  169.74 ++// software; you can redistribute it and/or modify it under the
  169.75 ++// terms of the GNU General Public License as published by the
  169.76 ++// Free Software Foundation; either version 2, or (at your option)
  169.77 ++// any later version.
  169.78 ++
  169.79 ++// This library is distributed in the hope that it will be useful,
  169.80 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  169.81 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  169.82 ++// GNU General Public License for more details.
  169.83 ++
  169.84 ++// You should have received a copy of the GNU General Public License along
  169.85 ++// with this library; see the file COPYING.  If not, write to the Free
  169.86 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
  169.87 ++// USA.
  169.88 ++
  169.89 ++// As a special exception, you may use this file as part of a free software
  169.90 ++// library without restriction.  Specifically, if other files instantiate
  169.91 ++// templates or use macros or inline functions from this file, or you compile
  169.92 ++// this file and link it with other files to produce an executable, this
  169.93 ++// file does not by itself cause the resulting executable to be covered by
  169.94 ++// the GNU General Public License.  This exception does not however
  169.95 ++// invalidate any other reasons why the executable file might be covered by
  169.96 ++// the GNU General Public License.
  169.97 ++
  169.98 ++// Written by Jakub Jelinek <jakub@redhat.com>
  169.99 ++
 169.100 ++#include <bits/c++config.h>
 169.101 ++#include <clocale>
 169.102 ++
 169.103 ++#ifdef __UCLIBC_MJN3_ONLY__
 169.104 ++#warning clean this up
 169.105 ++#endif
 169.106 ++
 169.107 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.108 ++                                                  
 169.109 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 169.110 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 169.111 ++extern "C" __typeof(strftime_l) __strftime_l;
 169.112 ++extern "C" __typeof(strtod_l) __strtod_l;
 169.113 ++extern "C" __typeof(strtof_l) __strtof_l;
 169.114 ++extern "C" __typeof(strtold_l) __strtold_l;
 169.115 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 169.116 ++extern "C" __typeof(newlocale) __newlocale;
 169.117 ++extern "C" __typeof(freelocale) __freelocale;
 169.118 ++extern "C" __typeof(duplocale) __duplocale;
 169.119 ++extern "C" __typeof(uselocale) __uselocale;
 169.120 ++
 169.121 ++#ifdef _GLIBCXX_USE_WCHAR_T
 169.122 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 169.123 ++extern "C" __typeof(towlower_l) __towlower_l;
 169.124 ++extern "C" __typeof(towupper_l) __towupper_l;
 169.125 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 169.126 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 169.127 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 169.128 ++extern "C" __typeof(wctype_l) __wctype_l;
 169.129 ++#endif 
 169.130 ++
 169.131 ++#endif // GLIBC 2.3 and later
 169.132 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
 169.133 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-03-04 23:31:57.000000000 +0100
 169.134 +@@ -0,0 +1,152 @@
 169.135 ++// Wrapper for underlying C-language localization -*- C++ -*-
 169.136 ++
 169.137 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 
 169.138 ++// Free Software Foundation, Inc.
 169.139 ++//
 169.140 ++// This file is part of the GNU ISO C++ Library.  This library is free
 169.141 ++// software; you can redistribute it and/or modify it under the
 169.142 ++// terms of the GNU General Public License as published by the
 169.143 ++// Free Software Foundation; either version 2, or (at your option)
 169.144 ++// any later version.
 169.145 ++
 169.146 ++// This library is distributed in the hope that it will be useful,
 169.147 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 169.148 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 169.149 ++// GNU General Public License for more details.
 169.150 ++
 169.151 ++// You should have received a copy of the GNU General Public License along
 169.152 ++// with this library; see the file COPYING.  If not, write to the Free
 169.153 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 169.154 ++// USA.
 169.155 ++
 169.156 ++// As a special exception, you may use this file as part of a free software
 169.157 ++// library without restriction.  Specifically, if other files instantiate
 169.158 ++// templates or use macros or inline functions from this file, or you compile
 169.159 ++// this file and link it with other files to produce an executable, this
 169.160 ++// file does not by itself cause the resulting executable to be covered by
 169.161 ++// the GNU General Public License.  This exception does not however
 169.162 ++// invalidate any other reasons why the executable file might be covered by
 169.163 ++// the GNU General Public License.
 169.164 ++
 169.165 ++//
 169.166 ++// ISO C++ 14882: 22.8  Standard locale categories.
 169.167 ++//
 169.168 ++
 169.169 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 169.170 ++
 169.171 ++#include <cerrno>  // For errno
 169.172 ++#include <locale>
 169.173 ++#include <stdexcept>
 169.174 ++#include <langinfo.h>
 169.175 ++#include <bits/c++locale_internal.h>
 169.176 ++
 169.177 ++#ifndef __UCLIBC_HAS_XLOCALE__
 169.178 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 169.179 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 169.180 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 169.181 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 169.182 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 169.183 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 169.184 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 169.185 ++#warning should dummy __newlocale check for C|POSIX ?
 169.186 ++#define __newlocale(a, b, c)        NULL
 169.187 ++#define __freelocale(a)             ((void)0)
 169.188 ++#define __duplocale(a)              __c_locale()
 169.189 ++#endif
 169.190 ++
 169.191 ++namespace std 
 169.192 ++{
 169.193 ++  template<>
 169.194 ++    void
 169.195 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 169.196 ++		   const __c_locale& __cloc)
 169.197 ++    {
 169.198 ++      char* __sanity;
 169.199 ++      errno = 0;
 169.200 ++      float __f = __strtof_l(__s, &__sanity, __cloc);
 169.201 ++      if (__sanity != __s && errno != ERANGE)
 169.202 ++	__v = __f;
 169.203 ++      else
 169.204 ++	__err |= ios_base::failbit;
 169.205 ++    }
 169.206 ++
 169.207 ++  template<>
 169.208 ++    void
 169.209 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 169.210 ++		   const __c_locale& __cloc)
 169.211 ++    {
 169.212 ++      char* __sanity;
 169.213 ++      errno = 0;
 169.214 ++      double __d = __strtod_l(__s, &__sanity, __cloc);
 169.215 ++      if (__sanity != __s && errno != ERANGE)
 169.216 ++	__v = __d;
 169.217 ++      else
 169.218 ++	__err |= ios_base::failbit;
 169.219 ++    }
 169.220 ++
 169.221 ++  template<>
 169.222 ++    void
 169.223 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 169.224 ++		   const __c_locale& __cloc)
 169.225 ++    {
 169.226 ++      char* __sanity;
 169.227 ++      errno = 0;
 169.228 ++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
 169.229 ++      if (__sanity != __s && errno != ERANGE)
 169.230 ++	__v = __ld;
 169.231 ++      else
 169.232 ++	__err |= ios_base::failbit;
 169.233 ++    }
 169.234 ++
 169.235 ++  void
 169.236 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 169.237 ++				    __c_locale __old)
 169.238 ++  {
 169.239 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 169.240 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.241 ++    if (!__cloc)
 169.242 ++      {
 169.243 ++	// This named locale is not supported by the underlying OS.
 169.244 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 169.245 ++			      "name not valid"));
 169.246 ++      }
 169.247 ++#endif
 169.248 ++  }
 169.249 ++  
 169.250 ++  void
 169.251 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 169.252 ++  {
 169.253 ++    if (__cloc && _S_get_c_locale() != __cloc)
 169.254 ++      __freelocale(__cloc); 
 169.255 ++  }
 169.256 ++
 169.257 ++  __c_locale
 169.258 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 169.259 ++  { return __duplocale(__cloc); }
 169.260 ++} // namespace std
 169.261 ++
 169.262 ++namespace __gnu_cxx
 169.263 ++{
 169.264 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 169.265 ++    {
 169.266 ++      "LC_CTYPE", 
 169.267 ++      "LC_NUMERIC",
 169.268 ++      "LC_TIME", 
 169.269 ++      "LC_COLLATE", 
 169.270 ++      "LC_MONETARY",
 169.271 ++      "LC_MESSAGES", 
 169.272 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 169.273 ++      "LC_PAPER", 
 169.274 ++      "LC_NAME", 
 169.275 ++      "LC_ADDRESS",
 169.276 ++      "LC_TELEPHONE", 
 169.277 ++      "LC_MEASUREMENT", 
 169.278 ++      "LC_IDENTIFICATION" 
 169.279 ++#endif
 169.280 ++    };
 169.281 ++}
 169.282 ++
 169.283 ++namespace std
 169.284 ++{
 169.285 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 169.286 ++}  // namespace std
 169.287 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 169.288 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-03-04 23:31:57.000000000 +0100
 169.289 +@@ -0,0 +1,117 @@
 169.290 ++// Wrapper for underlying C-language localization -*- C++ -*-
 169.291 ++
 169.292 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 169.293 ++//
 169.294 ++// This file is part of the GNU ISO C++ Library.  This library is free
 169.295 ++// software; you can redistribute it and/or modify it under the
 169.296 ++// terms of the GNU General Public License as published by the
 169.297 ++// Free Software Foundation; either version 2, or (at your option)
 169.298 ++// any later version.
 169.299 ++
 169.300 ++// This library is distributed in the hope that it will be useful,
 169.301 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 169.302 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 169.303 ++// GNU General Public License for more details.
 169.304 ++
 169.305 ++// You should have received a copy of the GNU General Public License along
 169.306 ++// with this library; see the file COPYING.  If not, write to the Free
 169.307 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 169.308 ++// USA.
 169.309 ++
 169.310 ++// As a special exception, you may use this file as part of a free software
 169.311 ++// library without restriction.  Specifically, if other files instantiate
 169.312 ++// templates or use macros or inline functions from this file, or you compile
 169.313 ++// this file and link it with other files to produce an executable, this
 169.314 ++// file does not by itself cause the resulting executable to be covered by
 169.315 ++// the GNU General Public License.  This exception does not however
 169.316 ++// invalidate any other reasons why the executable file might be covered by
 169.317 ++// the GNU General Public License.
 169.318 ++
 169.319 ++//
 169.320 ++// ISO C++ 14882: 22.8  Standard locale categories.
 169.321 ++//
 169.322 ++
 169.323 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 169.324 ++
 169.325 ++#ifndef _C_LOCALE_H
 169.326 ++#define _C_LOCALE_H 1
 169.327 ++
 169.328 ++#pragma GCC system_header
 169.329 ++
 169.330 ++#include <cstring>              // get std::strlen
 169.331 ++#include <cstdio>               // get std::snprintf or std::sprintf
 169.332 ++#include <clocale>
 169.333 ++#include <langinfo.h>		// For codecvt
 169.334 ++#ifdef __UCLIBC_MJN3_ONLY__
 169.335 ++#warning fix this
 169.336 ++#endif
 169.337 ++#ifdef __UCLIBC_HAS_LOCALE__
 169.338 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 169.339 ++#endif
 169.340 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 169.341 ++#include <libintl.h> 		// For messages
 169.342 ++#endif
 169.343 ++
 169.344 ++#ifdef __UCLIBC_MJN3_ONLY__
 169.345 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 169.346 ++#endif
 169.347 ++#define _GLIBCXX_C_LOCALE_GNU 1
 169.348 ++
 169.349 ++#ifdef __UCLIBC_MJN3_ONLY__
 169.350 ++#warning fix categories
 169.351 ++#endif
 169.352 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 169.353 ++#define _GLIBCXX_NUM_CATEGORIES 0
 169.354 ++ 
 169.355 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.356 ++namespace __gnu_cxx
 169.357 ++{
 169.358 ++  extern "C" __typeof(uselocale) __uselocale;
 169.359 ++}
 169.360 ++#endif
 169.361 ++
 169.362 ++namespace std
 169.363 ++{
 169.364 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.365 ++  typedef __locale_t		__c_locale;
 169.366 ++#else
 169.367 ++  typedef int*			__c_locale;
 169.368 ++#endif
 169.369 ++
 169.370 ++  // Convert numeric value of type _Tv to string and return length of
 169.371 ++  // string.  If snprintf is available use it, otherwise fall back to
 169.372 ++  // the unsafe sprintf which, in general, can be dangerous and should
 169.373 ++  // be avoided.
 169.374 ++  template<typename _Tv>
 169.375 ++    int
 169.376 ++    __convert_from_v(char* __out, 
 169.377 ++		     const int __size __attribute__ ((__unused__)),
 169.378 ++		     const char* __fmt,
 169.379 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.380 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 169.381 ++    {
 169.382 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 169.383 ++#else
 169.384 ++		     _Tv __v, const __c_locale&, int __prec)
 169.385 ++    {
 169.386 ++# ifdef __UCLIBC_HAS_LOCALE__
 169.387 ++      char* __old = std::setlocale(LC_ALL, NULL);
 169.388 ++      char* __sav = new char[std::strlen(__old) + 1];
 169.389 ++      std::strcpy(__sav, __old);
 169.390 ++      std::setlocale(LC_ALL, "C");
 169.391 ++# endif
 169.392 ++#endif
 169.393 ++
 169.394 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 169.395 ++
 169.396 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.397 ++      __gnu_cxx::__uselocale(__old);
 169.398 ++#elif defined __UCLIBC_HAS_LOCALE__
 169.399 ++      std::setlocale(LC_ALL, __sav);
 169.400 ++      delete [] __sav;
 169.401 ++#endif
 169.402 ++      return __ret;
 169.403 ++    }
 169.404 ++}
 169.405 ++
 169.406 ++#endif
 169.407 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 169.408 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-03-04 23:31:57.000000000 +0100
 169.409 +@@ -0,0 +1,306 @@
 169.410 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 169.411 ++
 169.412 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 169.413 ++//
 169.414 ++// This file is part of the GNU ISO C++ Library.  This library is free
 169.415 ++// software; you can redistribute it and/or modify it under the
 169.416 ++// terms of the GNU General Public License as published by the
 169.417 ++// Free Software Foundation; either version 2, or (at your option)
 169.418 ++// any later version.
 169.419 ++
 169.420 ++// This library is distributed in the hope that it will be useful,
 169.421 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 169.422 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 169.423 ++// GNU General Public License for more details.
 169.424 ++
 169.425 ++// You should have received a copy of the GNU General Public License along
 169.426 ++// with this library; see the file COPYING.  If not, write to the Free
 169.427 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 169.428 ++// USA.
 169.429 ++
 169.430 ++// As a special exception, you may use this file as part of a free software
 169.431 ++// library without restriction.  Specifically, if other files instantiate
 169.432 ++// templates or use macros or inline functions from this file, or you compile
 169.433 ++// this file and link it with other files to produce an executable, this
 169.434 ++// file does not by itself cause the resulting executable to be covered by
 169.435 ++// the GNU General Public License.  This exception does not however
 169.436 ++// invalidate any other reasons why the executable file might be covered by
 169.437 ++// the GNU General Public License.
 169.438 ++
 169.439 ++//
 169.440 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 169.441 ++//
 169.442 ++
 169.443 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 169.444 ++
 169.445 ++#include <locale>
 169.446 ++#include <bits/c++locale_internal.h>
 169.447 ++
 169.448 ++namespace std
 169.449 ++{
 169.450 ++  // Specializations.
 169.451 ++#ifdef _GLIBCXX_USE_WCHAR_T
 169.452 ++  codecvt_base::result
 169.453 ++  codecvt<wchar_t, char, mbstate_t>::
 169.454 ++  do_out(state_type& __state, const intern_type* __from, 
 169.455 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 169.456 ++	 extern_type* __to, extern_type* __to_end,
 169.457 ++	 extern_type*& __to_next) const
 169.458 ++  {
 169.459 ++    result __ret = ok;
 169.460 ++    state_type __tmp_state(__state);
 169.461 ++
 169.462 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.463 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 169.464 ++#endif
 169.465 ++
 169.466 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 169.467 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 169.468 ++    // NB: wcsnrtombs is a GNU extension
 169.469 ++    for (__from_next = __from, __to_next = __to;
 169.470 ++	 __from_next < __from_end && __to_next < __to_end
 169.471 ++	 && __ret == ok;)
 169.472 ++      {
 169.473 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 169.474 ++						      __from_end - __from_next);
 169.475 ++	if (!__from_chunk_end)
 169.476 ++	  __from_chunk_end = __from_end;
 169.477 ++
 169.478 ++	__from = __from_next;
 169.479 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 169.480 ++					 __from_chunk_end - __from_next,
 169.481 ++					 __to_end - __to_next, &__state);
 169.482 ++	if (__conv == static_cast<size_t>(-1))
 169.483 ++	  {
 169.484 ++	    // In case of error, in order to stop at the exact place we
 169.485 ++	    // have to start again from the beginning with a series of
 169.486 ++	    // wcrtomb.
 169.487 ++	    for (; __from < __from_next; ++__from)
 169.488 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 169.489 ++	    __state = __tmp_state;
 169.490 ++	    __ret = error;
 169.491 ++	  }
 169.492 ++	else if (__from_next && __from_next < __from_chunk_end)
 169.493 ++	  {
 169.494 ++	    __to_next += __conv;
 169.495 ++	    __ret = partial;
 169.496 ++	  }
 169.497 ++	else
 169.498 ++	  {
 169.499 ++	    __from_next = __from_chunk_end;
 169.500 ++	    __to_next += __conv;
 169.501 ++	  }
 169.502 ++
 169.503 ++	if (__from_next < __from_end && __ret == ok)
 169.504 ++	  {
 169.505 ++	    extern_type __buf[MB_LEN_MAX];
 169.506 ++	    __tmp_state = __state;
 169.507 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 169.508 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 169.509 ++	      __ret = partial;
 169.510 ++	    else
 169.511 ++	      {
 169.512 ++		memcpy(__to_next, __buf, __conv);
 169.513 ++		__state = __tmp_state;
 169.514 ++		__to_next += __conv;
 169.515 ++		++__from_next;
 169.516 ++	      }
 169.517 ++	  }
 169.518 ++      }
 169.519 ++
 169.520 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.521 ++    __uselocale(__old);
 169.522 ++#endif
 169.523 ++
 169.524 ++    return __ret; 
 169.525 ++  }
 169.526 ++  
 169.527 ++  codecvt_base::result
 169.528 ++  codecvt<wchar_t, char, mbstate_t>::
 169.529 ++  do_in(state_type& __state, const extern_type* __from, 
 169.530 ++	const extern_type* __from_end, const extern_type*& __from_next,
 169.531 ++	intern_type* __to, intern_type* __to_end,
 169.532 ++	intern_type*& __to_next) const
 169.533 ++  {
 169.534 ++    result __ret = ok;
 169.535 ++    state_type __tmp_state(__state);
 169.536 ++
 169.537 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.538 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 169.539 ++#endif
 169.540 ++
 169.541 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 169.542 ++    // in case we store a L'\0' and then continue, in a loop.
 169.543 ++    // NB: mbsnrtowcs is a GNU extension
 169.544 ++    for (__from_next = __from, __to_next = __to;
 169.545 ++	 __from_next < __from_end && __to_next < __to_end
 169.546 ++	 && __ret == ok;)
 169.547 ++      {
 169.548 ++	const extern_type* __from_chunk_end;
 169.549 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 169.550 ++								  __from_end
 169.551 ++								  - __from_next));
 169.552 ++	if (!__from_chunk_end)
 169.553 ++	  __from_chunk_end = __from_end;
 169.554 ++
 169.555 ++	__from = __from_next;
 169.556 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 169.557 ++				   __from_chunk_end - __from_next,
 169.558 ++				   __to_end - __to_next, &__state);
 169.559 ++	if (__conv == static_cast<size_t>(-1))
 169.560 ++	  {
 169.561 ++	    // In case of error, in order to stop at the exact place we
 169.562 ++	    // have to start again from the beginning with a series of
 169.563 ++	    // mbrtowc.
 169.564 ++	    for (;; ++__to_next, __from += __conv)
 169.565 ++	      {
 169.566 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 169.567 ++				 &__tmp_state);
 169.568 ++		if (__conv == static_cast<size_t>(-1)
 169.569 ++		    || __conv == static_cast<size_t>(-2))
 169.570 ++		  break;
 169.571 ++	      }
 169.572 ++	    __from_next = __from;
 169.573 ++	    __state = __tmp_state;	    
 169.574 ++	    __ret = error;
 169.575 ++	  }
 169.576 ++	else if (__from_next && __from_next < __from_chunk_end)
 169.577 ++	  {
 169.578 ++	    // It is unclear what to return in this case (see DR 382). 
 169.579 ++	    __to_next += __conv;
 169.580 ++	    __ret = partial;
 169.581 ++	  }
 169.582 ++	else
 169.583 ++	  {
 169.584 ++	    __from_next = __from_chunk_end;
 169.585 ++	    __to_next += __conv;
 169.586 ++	  }
 169.587 ++
 169.588 ++	if (__from_next < __from_end && __ret == ok)
 169.589 ++	  {
 169.590 ++	    if (__to_next < __to_end)
 169.591 ++	      {
 169.592 ++		// XXX Probably wrong for stateful encodings
 169.593 ++		__tmp_state = __state;		
 169.594 ++		++__from_next;
 169.595 ++		*__to_next++ = L'\0';
 169.596 ++	      }
 169.597 ++	    else
 169.598 ++	      __ret = partial;
 169.599 ++	  }
 169.600 ++      }
 169.601 ++
 169.602 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.603 ++    __uselocale(__old);
 169.604 ++#endif
 169.605 ++
 169.606 ++    return __ret; 
 169.607 ++  }
 169.608 ++
 169.609 ++  int 
 169.610 ++  codecvt<wchar_t, char, mbstate_t>::
 169.611 ++  do_encoding() const throw()
 169.612 ++  {
 169.613 ++    // XXX This implementation assumes that the encoding is
 169.614 ++    // stateless and is either single-byte or variable-width.
 169.615 ++    int __ret = 0;
 169.616 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.617 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 169.618 ++#endif
 169.619 ++    if (MB_CUR_MAX == 1)
 169.620 ++      __ret = 1;
 169.621 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.622 ++    __uselocale(__old);
 169.623 ++#endif
 169.624 ++    return __ret;
 169.625 ++  }  
 169.626 ++
 169.627 ++  int 
 169.628 ++  codecvt<wchar_t, char, mbstate_t>::
 169.629 ++  do_max_length() const throw()
 169.630 ++  {
 169.631 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.632 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 169.633 ++#endif
 169.634 ++    // XXX Probably wrong for stateful encodings.
 169.635 ++    int __ret = MB_CUR_MAX;
 169.636 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.637 ++    __uselocale(__old);
 169.638 ++#endif
 169.639 ++    return __ret;
 169.640 ++  }
 169.641 ++  
 169.642 ++  int 
 169.643 ++  codecvt<wchar_t, char, mbstate_t>::
 169.644 ++  do_length(state_type& __state, const extern_type* __from,
 169.645 ++	    const extern_type* __end, size_t __max) const
 169.646 ++  {
 169.647 ++    int __ret = 0;
 169.648 ++    state_type __tmp_state(__state);
 169.649 ++
 169.650 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.651 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 169.652 ++#endif
 169.653 ++
 169.654 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 169.655 ++    // in case we advance past it and then continue, in a loop.
 169.656 ++    // NB: mbsnrtowcs is a GNU extension
 169.657 ++  
 169.658 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 169.659 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 169.660 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 169.661 ++							   * __max));
 169.662 ++    while (__from < __end && __max)
 169.663 ++      {
 169.664 ++	const extern_type* __from_chunk_end;
 169.665 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 169.666 ++								  __end
 169.667 ++								  - __from));
 169.668 ++	if (!__from_chunk_end)
 169.669 ++	  __from_chunk_end = __end;
 169.670 ++
 169.671 ++	const extern_type* __tmp_from = __from;
 169.672 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 169.673 ++				   __from_chunk_end - __from,
 169.674 ++				   __max, &__state);
 169.675 ++	if (__conv == static_cast<size_t>(-1))
 169.676 ++	  {
 169.677 ++	    // In case of error, in order to stop at the exact place we
 169.678 ++	    // have to start again from the beginning with a series of
 169.679 ++	    // mbrtowc.
 169.680 ++	    for (__from = __tmp_from;; __from += __conv)
 169.681 ++	      {
 169.682 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 169.683 ++				 &__tmp_state);
 169.684 ++		if (__conv == static_cast<size_t>(-1)
 169.685 ++		    || __conv == static_cast<size_t>(-2))
 169.686 ++		  break;
 169.687 ++	      }
 169.688 ++	    __state = __tmp_state;
 169.689 ++	    __ret += __from - __tmp_from;
 169.690 ++	    break;
 169.691 ++	  }
 169.692 ++	if (!__from)
 169.693 ++	  __from = __from_chunk_end;
 169.694 ++	
 169.695 ++	__ret += __from - __tmp_from;
 169.696 ++	__max -= __conv;
 169.697 ++
 169.698 ++	if (__from < __end && __max)
 169.699 ++	  {
 169.700 ++	    // XXX Probably wrong for stateful encodings
 169.701 ++	    __tmp_state = __state;
 169.702 ++	    ++__from;
 169.703 ++	    ++__ret;
 169.704 ++	    --__max;
 169.705 ++	  }
 169.706 ++      }
 169.707 ++
 169.708 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.709 ++    __uselocale(__old);
 169.710 ++#endif
 169.711 ++
 169.712 ++    return __ret; 
 169.713 ++  }
 169.714 ++#endif
 169.715 ++}
 169.716 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 169.717 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-03-04 23:31:57.000000000 +0100
 169.718 +@@ -0,0 +1,80 @@
 169.719 ++// std::collate implementation details, GNU version -*- C++ -*-
 169.720 ++
 169.721 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 169.722 ++//
 169.723 ++// This file is part of the GNU ISO C++ Library.  This library is free
 169.724 ++// software; you can redistribute it and/or modify it under the
 169.725 ++// terms of the GNU General Public License as published by the
 169.726 ++// Free Software Foundation; either version 2, or (at your option)
 169.727 ++// any later version.
 169.728 ++
 169.729 ++// This library is distributed in the hope that it will be useful,
 169.730 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 169.731 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 169.732 ++// GNU General Public License for more details.
 169.733 ++
 169.734 ++// You should have received a copy of the GNU General Public License along
 169.735 ++// with this library; see the file COPYING.  If not, write to the Free
 169.736 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 169.737 ++// USA.
 169.738 ++
 169.739 ++// As a special exception, you may use this file as part of a free software
 169.740 ++// library without restriction.  Specifically, if other files instantiate
 169.741 ++// templates or use macros or inline functions from this file, or you compile
 169.742 ++// this file and link it with other files to produce an executable, this
 169.743 ++// file does not by itself cause the resulting executable to be covered by
 169.744 ++// the GNU General Public License.  This exception does not however
 169.745 ++// invalidate any other reasons why the executable file might be covered by
 169.746 ++// the GNU General Public License.
 169.747 ++
 169.748 ++//
 169.749 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 169.750 ++//
 169.751 ++
 169.752 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 169.753 ++
 169.754 ++#include <locale>
 169.755 ++#include <bits/c++locale_internal.h>
 169.756 ++
 169.757 ++#ifndef __UCLIBC_HAS_XLOCALE__
 169.758 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 169.759 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 169.760 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 169.761 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 169.762 ++#endif
 169.763 ++
 169.764 ++namespace std
 169.765 ++{
 169.766 ++  // These are basically extensions to char_traits, and perhaps should
 169.767 ++  // be put there instead of here.
 169.768 ++  template<>
 169.769 ++    int 
 169.770 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 169.771 ++    { 
 169.772 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 169.773 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 169.774 ++    }
 169.775 ++  
 169.776 ++  template<>
 169.777 ++    size_t
 169.778 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 169.779 ++				size_t __n) const 
 169.780 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 169.781 ++
 169.782 ++#ifdef _GLIBCXX_USE_WCHAR_T
 169.783 ++  template<>
 169.784 ++    int 
 169.785 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 169.786 ++				 const wchar_t* __two) const
 169.787 ++    {
 169.788 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 169.789 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 169.790 ++    }
 169.791 ++  
 169.792 ++  template<>
 169.793 ++    size_t
 169.794 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 169.795 ++				   size_t __n) const
 169.796 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 169.797 ++#endif
 169.798 ++}
 169.799 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 169.800 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-03-04 23:31:57.000000000 +0100
 169.801 +@@ -0,0 +1,314 @@
 169.802 ++// std::ctype implementation details, GNU version -*- C++ -*-
 169.803 ++
 169.804 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 169.805 ++//
 169.806 ++// This file is part of the GNU ISO C++ Library.  This library is free
 169.807 ++// software; you can redistribute it and/or modify it under the
 169.808 ++// terms of the GNU General Public License as published by the
 169.809 ++// Free Software Foundation; either version 2, or (at your option)
 169.810 ++// any later version.
 169.811 ++
 169.812 ++// This library is distributed in the hope that it will be useful,
 169.813 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 169.814 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 169.815 ++// GNU General Public License for more details.
 169.816 ++
 169.817 ++// You should have received a copy of the GNU General Public License along
 169.818 ++// with this library; see the file COPYING.  If not, write to the Free
 169.819 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 169.820 ++// USA.
 169.821 ++
 169.822 ++// As a special exception, you may use this file as part of a free software
 169.823 ++// library without restriction.  Specifically, if other files instantiate
 169.824 ++// templates or use macros or inline functions from this file, or you compile
 169.825 ++// this file and link it with other files to produce an executable, this
 169.826 ++// file does not by itself cause the resulting executable to be covered by
 169.827 ++// the GNU General Public License.  This exception does not however
 169.828 ++// invalidate any other reasons why the executable file might be covered by
 169.829 ++// the GNU General Public License.
 169.830 ++
 169.831 ++//
 169.832 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 169.833 ++//
 169.834 ++
 169.835 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 169.836 ++
 169.837 ++#define _LIBC
 169.838 ++#include <locale>
 169.839 ++#undef _LIBC
 169.840 ++#include <bits/c++locale_internal.h>
 169.841 ++
 169.842 ++#ifndef __UCLIBC_HAS_XLOCALE__
 169.843 ++#define __wctype_l(S, L)           wctype((S))
 169.844 ++#define __towupper_l(C, L)         towupper((C))
 169.845 ++#define __towlower_l(C, L)         towlower((C))
 169.846 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 169.847 ++#endif
 169.848 ++
 169.849 ++namespace std
 169.850 ++{
 169.851 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 169.852 ++  // various /config/os/* files.
 169.853 ++  template<>
 169.854 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 169.855 ++    : ctype<char>(0, false, __refs) 
 169.856 ++    { 		
 169.857 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 169.858 ++	{
 169.859 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 169.860 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 169.861 ++#ifdef __UCLIBC_HAS_XLOCALE__
 169.862 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 169.863 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 169.864 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 169.865 ++#endif
 169.866 ++	}
 169.867 ++    }
 169.868 ++
 169.869 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 169.870 ++  ctype<wchar_t>::__wmask_type
 169.871 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 169.872 ++  {
 169.873 ++    __wmask_type __ret;
 169.874 ++    switch (__m)
 169.875 ++      {
 169.876 ++      case space:
 169.877 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 169.878 ++	break;
 169.879 ++      case print:
 169.880 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 169.881 ++	break;
 169.882 ++      case cntrl:
 169.883 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 169.884 ++	break;
 169.885 ++      case upper:
 169.886 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 169.887 ++	break;
 169.888 ++      case lower:
 169.889 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 169.890 ++	break;
 169.891 ++      case alpha:
 169.892 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 169.893 ++	break;
 169.894 ++      case digit:
 169.895 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 169.896 ++	break;
 169.897 ++      case punct:
 169.898 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 169.899 ++	break;
 169.900 ++      case xdigit:
 169.901 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 169.902 ++	break;
 169.903 ++      case alnum:
 169.904 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 169.905 ++	break;
 169.906 ++      case graph:
 169.907 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 169.908 ++	break;
 169.909 ++      default:
 169.910 ++	__ret = __wmask_type();
 169.911 ++      }
 169.912 ++    return __ret;
 169.913 ++  }
 169.914 ++  
 169.915 ++  wchar_t
 169.916 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 169.917 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 169.918 ++
 169.919 ++  const wchar_t*
 169.920 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 169.921 ++  {
 169.922 ++    while (__lo < __hi)
 169.923 ++      {
 169.924 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 169.925 ++        ++__lo;
 169.926 ++      }
 169.927 ++    return __hi;
 169.928 ++  }
 169.929 ++  
 169.930 ++  wchar_t
 169.931 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 169.932 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 169.933 ++  
 169.934 ++  const wchar_t*
 169.935 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 169.936 ++  {
 169.937 ++    while (__lo < __hi)
 169.938 ++      {
 169.939 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 169.940 ++        ++__lo;
 169.941 ++      }
 169.942 ++    return __hi;
 169.943 ++  }
 169.944 ++
 169.945 ++  bool
 169.946 ++  ctype<wchar_t>::
 169.947 ++  do_is(mask __m, wchar_t __c) const
 169.948 ++  { 
 169.949 ++    // The case of __m == ctype_base::space is particularly important,
 169.950 ++    // due to its use in many istream functions.  Therefore we deal with
 169.951 ++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 169.952 ++    // is the mask corresponding to ctype_base::space.  NB: an encoding
 169.953 ++    // change would not affect correctness!
 169.954 ++    bool __ret = false;
 169.955 ++    if (__m == _M_bit[5])
 169.956 ++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 169.957 ++    else
 169.958 ++      {
 169.959 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 169.960 ++	// library for blank.
 169.961 ++	const size_t __bitmasksize = 11;
 169.962 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 169.963 ++	  if (__m & _M_bit[__bitcur])
 169.964 ++	    {
 169.965 ++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 169.966 ++		{
 169.967 ++		  __ret = true;
 169.968 ++		  break;
 169.969 ++		}
 169.970 ++	      else if (__m == _M_bit[__bitcur])
 169.971 ++		break;
 169.972 ++	    }
 169.973 ++      }
 169.974 ++    return __ret;    
 169.975 ++  }
 169.976 ++
 169.977 ++  const wchar_t* 
 169.978 ++  ctype<wchar_t>::
 169.979 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 169.980 ++  {
 169.981 ++    for (; __lo < __hi; ++__vec, ++__lo)
 169.982 ++      {
 169.983 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 169.984 ++	// library for blank.
 169.985 ++	const size_t __bitmasksize = 11; 
 169.986 ++	mask __m = 0;
 169.987 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 169.988 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 169.989 ++	    __m |= _M_bit[__bitcur];
 169.990 ++	*__vec = __m;
 169.991 ++      }
 169.992 ++    return __hi;
 169.993 ++  }
 169.994 ++  
 169.995 ++  const wchar_t* 
 169.996 ++  ctype<wchar_t>::
 169.997 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 169.998 ++  {
 169.999 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
169.1000 ++      ++__lo;
169.1001 ++    return __lo;
169.1002 ++  }
169.1003 ++
169.1004 ++  const wchar_t*
169.1005 ++  ctype<wchar_t>::
169.1006 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
169.1007 ++  {
169.1008 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
169.1009 ++      ++__lo;
169.1010 ++    return __lo;
169.1011 ++  }
169.1012 ++
169.1013 ++  wchar_t
169.1014 ++  ctype<wchar_t>::
169.1015 ++  do_widen(char __c) const
169.1016 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
169.1017 ++
169.1018 ++  const char* 
169.1019 ++  ctype<wchar_t>::
169.1020 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
169.1021 ++  {
169.1022 ++    while (__lo < __hi)
169.1023 ++      {
169.1024 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
169.1025 ++	++__lo;
169.1026 ++	++__dest;
169.1027 ++      }
169.1028 ++    return __hi;
169.1029 ++  }
169.1030 ++
169.1031 ++  char
169.1032 ++  ctype<wchar_t>::
169.1033 ++  do_narrow(wchar_t __wc, char __dfault) const
169.1034 ++  {
169.1035 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
169.1036 ++      return _M_narrow[__wc];
169.1037 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1038 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
169.1039 ++#endif
169.1040 ++    const int __c = wctob(__wc);
169.1041 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1042 ++    __uselocale(__old);
169.1043 ++#endif
169.1044 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
169.1045 ++  }
169.1046 ++
169.1047 ++  const wchar_t*
169.1048 ++  ctype<wchar_t>::
169.1049 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
169.1050 ++	    char* __dest) const
169.1051 ++  {
169.1052 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1053 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
169.1054 ++#endif
169.1055 ++    if (_M_narrow_ok)
169.1056 ++      while (__lo < __hi)
169.1057 ++	{
169.1058 ++	  if (*__lo >= 0 && *__lo < 128)
169.1059 ++	    *__dest = _M_narrow[*__lo];
169.1060 ++	  else
169.1061 ++	    {
169.1062 ++	      const int __c = wctob(*__lo);
169.1063 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
169.1064 ++	    }
169.1065 ++	  ++__lo;
169.1066 ++	  ++__dest;
169.1067 ++	}
169.1068 ++    else
169.1069 ++      while (__lo < __hi)
169.1070 ++	{
169.1071 ++	  const int __c = wctob(*__lo);
169.1072 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
169.1073 ++	  ++__lo;
169.1074 ++	  ++__dest;
169.1075 ++	}
169.1076 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1077 ++    __uselocale(__old);
169.1078 ++#endif
169.1079 ++    return __hi;
169.1080 ++  }
169.1081 ++
169.1082 ++  void
169.1083 ++  ctype<wchar_t>::_M_initialize_ctype()
169.1084 ++  {
169.1085 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1086 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
169.1087 ++#endif
169.1088 ++    wint_t __i;
169.1089 ++    for (__i = 0; __i < 128; ++__i)
169.1090 ++      {
169.1091 ++	const int __c = wctob(__i);
169.1092 ++	if (__c == EOF)
169.1093 ++	  break;
169.1094 ++	else
169.1095 ++	  _M_narrow[__i] = static_cast<char>(__c);
169.1096 ++      }
169.1097 ++    if (__i == 128)
169.1098 ++      _M_narrow_ok = true;
169.1099 ++    else
169.1100 ++      _M_narrow_ok = false;
169.1101 ++    for (size_t __j = 0;
169.1102 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
169.1103 ++      _M_widen[__j] = btowc(__j);
169.1104 ++
169.1105 ++    for (size_t __k = 0; __k <= 11; ++__k)
169.1106 ++      { 
169.1107 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
169.1108 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
169.1109 ++      }
169.1110 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1111 ++    __uselocale(__old);
169.1112 ++#endif
169.1113 ++  }
169.1114 ++#endif //  _GLIBCXX_USE_WCHAR_T
169.1115 ++}
169.1116 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
169.1117 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-03-04 23:31:57.000000000 +0100
169.1118 +@@ -0,0 +1,100 @@
169.1119 ++// std::messages implementation details, GNU version -*- C++ -*-
169.1120 ++
169.1121 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
169.1122 ++//
169.1123 ++// This file is part of the GNU ISO C++ Library.  This library is free
169.1124 ++// software; you can redistribute it and/or modify it under the
169.1125 ++// terms of the GNU General Public License as published by the
169.1126 ++// Free Software Foundation; either version 2, or (at your option)
169.1127 ++// any later version.
169.1128 ++
169.1129 ++// This library is distributed in the hope that it will be useful,
169.1130 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
169.1131 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
169.1132 ++// GNU General Public License for more details.
169.1133 ++
169.1134 ++// You should have received a copy of the GNU General Public License along
169.1135 ++// with this library; see the file COPYING.  If not, write to the Free
169.1136 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
169.1137 ++// USA.
169.1138 ++
169.1139 ++// As a special exception, you may use this file as part of a free software
169.1140 ++// library without restriction.  Specifically, if other files instantiate
169.1141 ++// templates or use macros or inline functions from this file, or you compile
169.1142 ++// this file and link it with other files to produce an executable, this
169.1143 ++// file does not by itself cause the resulting executable to be covered by
169.1144 ++// the GNU General Public License.  This exception does not however
169.1145 ++// invalidate any other reasons why the executable file might be covered by
169.1146 ++// the GNU General Public License.
169.1147 ++
169.1148 ++//
169.1149 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
169.1150 ++//
169.1151 ++
169.1152 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
169.1153 ++
169.1154 ++#include <locale>
169.1155 ++#include <bits/c++locale_internal.h>
169.1156 ++
169.1157 ++#ifdef __UCLIBC_MJN3_ONLY__
169.1158 ++#warning fix gettext stuff
169.1159 ++#endif
169.1160 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
169.1161 ++extern "C" char *__dcgettext(const char *domainname,
169.1162 ++			     const char *msgid, int category);
169.1163 ++#undef gettext
169.1164 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
169.1165 ++#else
169.1166 ++#undef gettext
169.1167 ++#define gettext(msgid) (msgid)
169.1168 ++#endif
169.1169 ++
169.1170 ++namespace std
169.1171 ++{
169.1172 ++  // Specializations.
169.1173 ++  template<>
169.1174 ++    string
169.1175 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
169.1176 ++    {
169.1177 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1178 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
169.1179 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
169.1180 ++      __uselocale(__old);
169.1181 ++      return string(__msg);
169.1182 ++#elif defined __UCLIBC_HAS_LOCALE__
169.1183 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
169.1184 ++      setlocale(LC_ALL, _M_name_messages);
169.1185 ++      const char* __msg = gettext(__dfault.c_str());
169.1186 ++      setlocale(LC_ALL, __old);
169.1187 ++      free(__old);
169.1188 ++      return string(__msg);
169.1189 ++#else
169.1190 ++      const char* __msg = gettext(__dfault.c_str());
169.1191 ++      return string(__msg);
169.1192 ++#endif
169.1193 ++    }
169.1194 ++
169.1195 ++#ifdef _GLIBCXX_USE_WCHAR_T
169.1196 ++  template<>
169.1197 ++    wstring
169.1198 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
169.1199 ++    {
169.1200 ++# ifdef __UCLIBC_HAS_XLOCALE__
169.1201 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
169.1202 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
169.1203 ++      __uselocale(__old);
169.1204 ++      return _M_convert_from_char(__msg);
169.1205 ++# elif defined __UCLIBC_HAS_LOCALE__
169.1206 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
169.1207 ++      setlocale(LC_ALL, _M_name_messages);
169.1208 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
169.1209 ++      setlocale(LC_ALL, __old);
169.1210 ++      free(__old);
169.1211 ++      return _M_convert_from_char(__msg);
169.1212 ++# else
169.1213 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
169.1214 ++      return _M_convert_from_char(__msg);
169.1215 ++# endif
169.1216 ++    }
169.1217 ++#endif
169.1218 ++}
169.1219 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
169.1220 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-03-04 23:31:57.000000000 +0100
169.1221 +@@ -0,0 +1,121 @@
169.1222 ++// std::messages implementation details, GNU version -*- C++ -*-
169.1223 ++
169.1224 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
169.1225 ++//
169.1226 ++// This file is part of the GNU ISO C++ Library.  This library is free
169.1227 ++// software; you can redistribute it and/or modify it under the
169.1228 ++// terms of the GNU General Public License as published by the
169.1229 ++// Free Software Foundation; either version 2, or (at your option)
169.1230 ++// any later version.
169.1231 ++
169.1232 ++// This library is distributed in the hope that it will be useful,
169.1233 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
169.1234 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
169.1235 ++// GNU General Public License for more details.
169.1236 ++
169.1237 ++// You should have received a copy of the GNU General Public License along
169.1238 ++// with this library; see the file COPYING.  If not, write to the Free
169.1239 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
169.1240 ++// USA.
169.1241 ++
169.1242 ++// As a special exception, you may use this file as part of a free software
169.1243 ++// library without restriction.  Specifically, if other files instantiate
169.1244 ++// templates or use macros or inline functions from this file, or you compile
169.1245 ++// this file and link it with other files to produce an executable, this
169.1246 ++// file does not by itself cause the resulting executable to be covered by
169.1247 ++// the GNU General Public License.  This exception does not however
169.1248 ++// invalidate any other reasons why the executable file might be covered by
169.1249 ++// the GNU General Public License.
169.1250 ++
169.1251 ++//
169.1252 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
169.1253 ++//
169.1254 ++
169.1255 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
169.1256 ++
169.1257 ++#ifdef __UCLIBC_MJN3_ONLY__
169.1258 ++#warning fix prototypes for *textdomain funcs
169.1259 ++#endif
169.1260 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
169.1261 ++extern "C" char *__textdomain(const char *domainname);
169.1262 ++extern "C" char *__bindtextdomain(const char *domainname,
169.1263 ++				  const char *dirname);
169.1264 ++#else
169.1265 ++#undef __textdomain
169.1266 ++#undef __bindtextdomain
169.1267 ++#define __textdomain(D)           ((void)0)
169.1268 ++#define __bindtextdomain(D,P)     ((void)0)
169.1269 ++#endif
169.1270 ++
169.1271 ++  // Non-virtual member functions.
169.1272 ++  template<typename _CharT>
169.1273 ++     messages<_CharT>::messages(size_t __refs)
169.1274 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
169.1275 ++       _M_name_messages(_S_get_c_name())
169.1276 ++     { }
169.1277 ++
169.1278 ++  template<typename _CharT>
169.1279 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
169.1280 ++				size_t __refs) 
169.1281 ++     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
169.1282 ++     {
169.1283 ++       const size_t __len = std::strlen(__s) + 1;
169.1284 ++       char* __tmp = new char[__len];
169.1285 ++       std::memcpy(__tmp, __s, __len);
169.1286 ++       _M_name_messages = __tmp;
169.1287 ++
169.1288 ++       // Last to avoid leaking memory if new throws.
169.1289 ++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
169.1290 ++     }
169.1291 ++
169.1292 ++  template<typename _CharT>
169.1293 ++    typename messages<_CharT>::catalog 
169.1294 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
169.1295 ++			   const char* __dir) const
169.1296 ++    { 
169.1297 ++      __bindtextdomain(__s.c_str(), __dir);
169.1298 ++      return this->do_open(__s, __loc); 
169.1299 ++    }
169.1300 ++
169.1301 ++  // Virtual member functions.
169.1302 ++  template<typename _CharT>
169.1303 ++    messages<_CharT>::~messages()
169.1304 ++    { 
169.1305 ++      if (_M_name_messages != _S_get_c_name())
169.1306 ++	delete [] _M_name_messages;
169.1307 ++      _S_destroy_c_locale(_M_c_locale_messages); 
169.1308 ++    }
169.1309 ++
169.1310 ++  template<typename _CharT>
169.1311 ++    typename messages<_CharT>::catalog 
169.1312 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
169.1313 ++			      const locale&) const
169.1314 ++    { 
169.1315 ++      // No error checking is done, assume the catalog exists and can
169.1316 ++      // be used.
169.1317 ++      __textdomain(__s.c_str());
169.1318 ++      return 0;
169.1319 ++    }
169.1320 ++
169.1321 ++  template<typename _CharT>
169.1322 ++    void    
169.1323 ++    messages<_CharT>::do_close(catalog) const 
169.1324 ++    { }
169.1325 ++
169.1326 ++   // messages_byname
169.1327 ++   template<typename _CharT>
169.1328 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
169.1329 ++     : messages<_CharT>(__refs) 
169.1330 ++     { 
169.1331 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
169.1332 ++	 delete [] this->_M_name_messages;
169.1333 ++       char* __tmp = new char[std::strlen(__s) + 1];
169.1334 ++       std::strcpy(__tmp, __s);
169.1335 ++       this->_M_name_messages = __tmp;
169.1336 ++
169.1337 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
169.1338 ++	 {
169.1339 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
169.1340 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
169.1341 ++	 }
169.1342 ++     }
169.1343 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
169.1344 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-03-04 23:31:57.000000000 +0100
169.1345 +@@ -0,0 +1,692 @@
169.1346 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
169.1347 ++
169.1348 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
169.1349 ++//
169.1350 ++// This file is part of the GNU ISO C++ Library.  This library is free
169.1351 ++// software; you can redistribute it and/or modify it under the
169.1352 ++// terms of the GNU General Public License as published by the
169.1353 ++// Free Software Foundation; either version 2, or (at your option)
169.1354 ++// any later version.
169.1355 ++
169.1356 ++// This library is distributed in the hope that it will be useful,
169.1357 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
169.1358 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
169.1359 ++// GNU General Public License for more details.
169.1360 ++
169.1361 ++// You should have received a copy of the GNU General Public License along
169.1362 ++// with this library; see the file COPYING.  If not, write to the Free
169.1363 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
169.1364 ++// USA.
169.1365 ++
169.1366 ++// As a special exception, you may use this file as part of a free software
169.1367 ++// library without restriction.  Specifically, if other files instantiate
169.1368 ++// templates or use macros or inline functions from this file, or you compile
169.1369 ++// this file and link it with other files to produce an executable, this
169.1370 ++// file does not by itself cause the resulting executable to be covered by
169.1371 ++// the GNU General Public License.  This exception does not however
169.1372 ++// invalidate any other reasons why the executable file might be covered by
169.1373 ++// the GNU General Public License.
169.1374 ++
169.1375 ++//
169.1376 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
169.1377 ++//
169.1378 ++
169.1379 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
169.1380 ++
169.1381 ++#define _LIBC
169.1382 ++#include <locale>
169.1383 ++#undef _LIBC
169.1384 ++#include <bits/c++locale_internal.h>
169.1385 ++
169.1386 ++#ifdef __UCLIBC_MJN3_ONLY__
169.1387 ++#warning optimize this for uclibc
169.1388 ++#warning tailor for stub locale support
169.1389 ++#endif
169.1390 ++
169.1391 ++#ifndef __UCLIBC_HAS_XLOCALE__
169.1392 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
169.1393 ++#endif
169.1394 ++
169.1395 ++namespace std
169.1396 ++{
169.1397 ++  // Construct and return valid pattern consisting of some combination of:
169.1398 ++  // space none symbol sign value
169.1399 ++  money_base::pattern
169.1400 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
169.1401 ++  { 
169.1402 ++    pattern __ret;
169.1403 ++
169.1404 ++    // This insanely complicated routine attempts to construct a valid
169.1405 ++    // pattern for use with monyepunct. A couple of invariants:
169.1406 ++
169.1407 ++    // if (__precedes) symbol -> value
169.1408 ++    // else value -> symbol
169.1409 ++    
169.1410 ++    // if (__space) space
169.1411 ++    // else none
169.1412 ++
169.1413 ++    // none == never first
169.1414 ++    // space never first or last
169.1415 ++
169.1416 ++    // Any elegant implementations of this are welcome.
169.1417 ++    switch (__posn)
169.1418 ++      {
169.1419 ++      case 0:
169.1420 ++      case 1:
169.1421 ++	// 1 The sign precedes the value and symbol.
169.1422 ++	__ret.field[0] = sign;
169.1423 ++	if (__space)
169.1424 ++	  {
169.1425 ++	    // Pattern starts with sign.
169.1426 ++	    if (__precedes)
169.1427 ++	      {
169.1428 ++		__ret.field[1] = symbol;
169.1429 ++		__ret.field[3] = value;
169.1430 ++	      }
169.1431 ++	    else
169.1432 ++	      {
169.1433 ++		__ret.field[1] = value;
169.1434 ++		__ret.field[3] = symbol;
169.1435 ++	      }
169.1436 ++	    __ret.field[2] = space;
169.1437 ++	  }
169.1438 ++	else
169.1439 ++	  {
169.1440 ++	    // Pattern starts with sign and ends with none.
169.1441 ++	    if (__precedes)
169.1442 ++	      {
169.1443 ++		__ret.field[1] = symbol;
169.1444 ++		__ret.field[2] = value;
169.1445 ++	      }
169.1446 ++	    else
169.1447 ++	      {
169.1448 ++		__ret.field[1] = value;
169.1449 ++		__ret.field[2] = symbol;
169.1450 ++	      }
169.1451 ++	    __ret.field[3] = none;
169.1452 ++	  }
169.1453 ++	break;
169.1454 ++      case 2:
169.1455 ++	// 2 The sign follows the value and symbol.
169.1456 ++	if (__space)
169.1457 ++	  {
169.1458 ++	    // Pattern either ends with sign.
169.1459 ++	    if (__precedes)
169.1460 ++	      {
169.1461 ++		__ret.field[0] = symbol;
169.1462 ++		__ret.field[2] = value;
169.1463 ++	      }
169.1464 ++	    else
169.1465 ++	      {
169.1466 ++		__ret.field[0] = value;
169.1467 ++		__ret.field[2] = symbol;
169.1468 ++	      }
169.1469 ++	    __ret.field[1] = space;
169.1470 ++	    __ret.field[3] = sign;
169.1471 ++	  }
169.1472 ++	else
169.1473 ++	  {
169.1474 ++	    // Pattern ends with sign then none.
169.1475 ++	    if (__precedes)
169.1476 ++	      {
169.1477 ++		__ret.field[0] = symbol;
169.1478 ++		__ret.field[1] = value;
169.1479 ++	      }
169.1480 ++	    else
169.1481 ++	      {
169.1482 ++		__ret.field[0] = value;
169.1483 ++		__ret.field[1] = symbol;
169.1484 ++	      }
169.1485 ++	    __ret.field[2] = sign;
169.1486 ++	    __ret.field[3] = none;
169.1487 ++	  }
169.1488 ++	break;
169.1489 ++      case 3:
169.1490 ++	// 3 The sign immediately precedes the symbol.
169.1491 ++	if (__precedes)
169.1492 ++	  {
169.1493 ++	    __ret.field[0] = sign;
169.1494 ++	    __ret.field[1] = symbol;	    
169.1495 ++	    if (__space)
169.1496 ++	      {
169.1497 ++		__ret.field[2] = space;
169.1498 ++		__ret.field[3] = value;
169.1499 ++	      }
169.1500 ++	    else
169.1501 ++	      {
169.1502 ++		__ret.field[2] = value;		
169.1503 ++		__ret.field[3] = none;
169.1504 ++	      }
169.1505 ++	  }
169.1506 ++	else
169.1507 ++	  {
169.1508 ++	    __ret.field[0] = value;
169.1509 ++	    if (__space)
169.1510 ++	      {
169.1511 ++		__ret.field[1] = space;
169.1512 ++		__ret.field[2] = sign;
169.1513 ++		__ret.field[3] = symbol;
169.1514 ++	      }
169.1515 ++	    else
169.1516 ++	      {
169.1517 ++		__ret.field[1] = sign;
169.1518 ++		__ret.field[2] = symbol;
169.1519 ++		__ret.field[3] = none;
169.1520 ++	      }
169.1521 ++	  }
169.1522 ++	break;
169.1523 ++      case 4:
169.1524 ++	// 4 The sign immediately follows the symbol.
169.1525 ++	if (__precedes)
169.1526 ++	  {
169.1527 ++	    __ret.field[0] = symbol;
169.1528 ++	    __ret.field[1] = sign;
169.1529 ++	    if (__space)
169.1530 ++	      {
169.1531 ++		__ret.field[2] = space;
169.1532 ++		__ret.field[3] = value;
169.1533 ++	      }
169.1534 ++	    else
169.1535 ++	      {
169.1536 ++		__ret.field[2] = value;
169.1537 ++		__ret.field[3] = none;
169.1538 ++	      }
169.1539 ++	  }
169.1540 ++	else
169.1541 ++	  {
169.1542 ++	    __ret.field[0] = value;
169.1543 ++	    if (__space)
169.1544 ++	      {
169.1545 ++		__ret.field[1] = space;
169.1546 ++		__ret.field[2] = symbol;
169.1547 ++		__ret.field[3] = sign;
169.1548 ++	      }
169.1549 ++	    else
169.1550 ++	      {
169.1551 ++		__ret.field[1] = symbol;
169.1552 ++		__ret.field[2] = sign;
169.1553 ++		__ret.field[3] = none;
169.1554 ++	      }
169.1555 ++	  }
169.1556 ++	break;
169.1557 ++      default:
169.1558 ++	__ret = pattern();
169.1559 ++      }
169.1560 ++    return __ret;
169.1561 ++  }
169.1562 ++
169.1563 ++  template<> 
169.1564 ++    void
169.1565 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
169.1566 ++						     const char*)
169.1567 ++    {
169.1568 ++      if (!_M_data)
169.1569 ++	_M_data = new __moneypunct_cache<char, true>;
169.1570 ++
169.1571 ++      if (!__cloc)
169.1572 ++	{
169.1573 ++	  // "C" locale
169.1574 ++	  _M_data->_M_decimal_point = '.';
169.1575 ++	  _M_data->_M_thousands_sep = ',';
169.1576 ++	  _M_data->_M_grouping = "";
169.1577 ++	  _M_data->_M_grouping_size = 0;
169.1578 ++	  _M_data->_M_curr_symbol = "";
169.1579 ++	  _M_data->_M_curr_symbol_size = 0;
169.1580 ++	  _M_data->_M_positive_sign = "";
169.1581 ++	  _M_data->_M_positive_sign_size = 0;
169.1582 ++	  _M_data->_M_negative_sign = "";
169.1583 ++	  _M_data->_M_negative_sign_size = 0;
169.1584 ++	  _M_data->_M_frac_digits = 0;
169.1585 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
169.1586 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
169.1587 ++
169.1588 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
169.1589 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
169.1590 ++	}
169.1591 ++      else
169.1592 ++	{
169.1593 ++	  // Named locale.
169.1594 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
169.1595 ++							__cloc));
169.1596 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
169.1597 ++							__cloc));
169.1598 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
169.1599 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
169.1600 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
169.1601 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
169.1602 ++
169.1603 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
169.1604 ++	  if (!__nposn)
169.1605 ++	    _M_data->_M_negative_sign = "()";
169.1606 ++	  else
169.1607 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
169.1608 ++							__cloc);
169.1609 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
169.1610 ++
169.1611 ++	  // _Intl == true
169.1612 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
169.1613 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
169.1614 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
169.1615 ++						      __cloc));
169.1616 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
169.1617 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
169.1618 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
169.1619 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
169.1620 ++							__pposn);
169.1621 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
169.1622 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
169.1623 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
169.1624 ++							__nposn);
169.1625 ++	}
169.1626 ++    }
169.1627 ++
169.1628 ++  template<> 
169.1629 ++    void
169.1630 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
169.1631 ++						      const char*)
169.1632 ++    {
169.1633 ++      if (!_M_data)
169.1634 ++	_M_data = new __moneypunct_cache<char, false>;
169.1635 ++
169.1636 ++      if (!__cloc)
169.1637 ++	{
169.1638 ++	  // "C" locale
169.1639 ++	  _M_data->_M_decimal_point = '.';
169.1640 ++	  _M_data->_M_thousands_sep = ',';
169.1641 ++	  _M_data->_M_grouping = "";
169.1642 ++	  _M_data->_M_grouping_size = 0;
169.1643 ++	  _M_data->_M_curr_symbol = "";
169.1644 ++	  _M_data->_M_curr_symbol_size = 0;
169.1645 ++	  _M_data->_M_positive_sign = "";
169.1646 ++	  _M_data->_M_positive_sign_size = 0;
169.1647 ++	  _M_data->_M_negative_sign = "";
169.1648 ++	  _M_data->_M_negative_sign_size = 0;
169.1649 ++	  _M_data->_M_frac_digits = 0;
169.1650 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
169.1651 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
169.1652 ++
169.1653 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
169.1654 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
169.1655 ++	}
169.1656 ++      else
169.1657 ++	{
169.1658 ++	  // Named locale.
169.1659 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
169.1660 ++							__cloc));
169.1661 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
169.1662 ++							__cloc));
169.1663 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
169.1664 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
169.1665 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
169.1666 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
169.1667 ++
169.1668 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
169.1669 ++	  if (!__nposn)
169.1670 ++	    _M_data->_M_negative_sign = "()";
169.1671 ++	  else
169.1672 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
169.1673 ++							__cloc);
169.1674 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
169.1675 ++
169.1676 ++	  // _Intl == false
169.1677 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
169.1678 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
169.1679 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
169.1680 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
169.1681 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
169.1682 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
169.1683 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
169.1684 ++							__pposn);
169.1685 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
169.1686 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
169.1687 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
169.1688 ++							__nposn);
169.1689 ++	}
169.1690 ++    }
169.1691 ++
169.1692 ++  template<> 
169.1693 ++    moneypunct<char, true>::~moneypunct()
169.1694 ++    { delete _M_data; }
169.1695 ++
169.1696 ++  template<> 
169.1697 ++    moneypunct<char, false>::~moneypunct()
169.1698 ++    { delete _M_data; }
169.1699 ++
169.1700 ++#ifdef _GLIBCXX_USE_WCHAR_T
169.1701 ++  template<> 
169.1702 ++    void
169.1703 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
169.1704 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1705 ++							const char*)
169.1706 ++#else
169.1707 ++							const char* __name)
169.1708 ++#endif
169.1709 ++    {
169.1710 ++      if (!_M_data)
169.1711 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
169.1712 ++
169.1713 ++      if (!__cloc)
169.1714 ++	{
169.1715 ++	  // "C" locale
169.1716 ++	  _M_data->_M_decimal_point = L'.';
169.1717 ++	  _M_data->_M_thousands_sep = L',';
169.1718 ++	  _M_data->_M_grouping = "";
169.1719 ++	  _M_data->_M_grouping_size = 0;
169.1720 ++	  _M_data->_M_curr_symbol = L"";
169.1721 ++	  _M_data->_M_curr_symbol_size = 0;
169.1722 ++	  _M_data->_M_positive_sign = L"";
169.1723 ++	  _M_data->_M_positive_sign_size = 0;
169.1724 ++	  _M_data->_M_negative_sign = L"";
169.1725 ++	  _M_data->_M_negative_sign_size = 0;
169.1726 ++	  _M_data->_M_frac_digits = 0;
169.1727 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
169.1728 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
169.1729 ++
169.1730 ++	  // Use ctype::widen code without the facet...
169.1731 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
169.1732 ++	    _M_data->_M_atoms[__i] =
169.1733 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
169.1734 ++	}
169.1735 ++      else
169.1736 ++	{
169.1737 ++	  // Named locale.
169.1738 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1739 ++	  __c_locale __old = __uselocale(__cloc);
169.1740 ++#else
169.1741 ++	  // Switch to named locale so that mbsrtowcs will work.
169.1742 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
169.1743 ++	  setlocale(LC_ALL, __name);
169.1744 ++#endif
169.1745 ++
169.1746 ++#ifdef __UCLIBC_MJN3_ONLY__
169.1747 ++#warning fix this... should be monetary
169.1748 ++#endif
169.1749 ++#ifdef __UCLIBC__
169.1750 ++# ifdef __UCLIBC_HAS_XLOCALE__
169.1751 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
169.1752 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
169.1753 ++# elif defined __UCLIBC_HAS_LOCALE__
169.1754 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
169.1755 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
169.1756 ++# endif
169.1757 ++#else
169.1758 ++	  union { char *__s; wchar_t __w; } __u;
169.1759 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
169.1760 ++	  _M_data->_M_decimal_point = __u.__w;
169.1761 ++
169.1762 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
169.1763 ++	  _M_data->_M_thousands_sep = __u.__w;
169.1764 ++#endif
169.1765 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
169.1766 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
169.1767 ++
169.1768 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
169.1769 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
169.1770 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
169.1771 ++
169.1772 ++	  wchar_t* __wcs_ps = 0;
169.1773 ++	  wchar_t* __wcs_ns = 0;
169.1774 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
169.1775 ++	  try
169.1776 ++	    {
169.1777 ++	      mbstate_t __state;
169.1778 ++	      size_t __len = strlen(__cpossign);
169.1779 ++	      if (__len)
169.1780 ++		{
169.1781 ++		  ++__len;
169.1782 ++		  memset(&__state, 0, sizeof(mbstate_t));
169.1783 ++		  __wcs_ps = new wchar_t[__len];
169.1784 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
169.1785 ++		  _M_data->_M_positive_sign = __wcs_ps;
169.1786 ++		}
169.1787 ++	      else
169.1788 ++		_M_data->_M_positive_sign = L"";
169.1789 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
169.1790 ++	      
169.1791 ++	      __len = strlen(__cnegsign);
169.1792 ++	      if (!__nposn)
169.1793 ++		_M_data->_M_negative_sign = L"()";
169.1794 ++	      else if (__len)
169.1795 ++		{ 
169.1796 ++		  ++__len;
169.1797 ++		  memset(&__state, 0, sizeof(mbstate_t));
169.1798 ++		  __wcs_ns = new wchar_t[__len];
169.1799 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
169.1800 ++		  _M_data->_M_negative_sign = __wcs_ns;
169.1801 ++		}
169.1802 ++	      else
169.1803 ++		_M_data->_M_negative_sign = L"";
169.1804 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
169.1805 ++	      
169.1806 ++	      // _Intl == true.
169.1807 ++	      __len = strlen(__ccurr);
169.1808 ++	      if (__len)
169.1809 ++		{
169.1810 ++		  ++__len;
169.1811 ++		  memset(&__state, 0, sizeof(mbstate_t));
169.1812 ++		  wchar_t* __wcs = new wchar_t[__len];
169.1813 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
169.1814 ++		  _M_data->_M_curr_symbol = __wcs;
169.1815 ++		}
169.1816 ++	      else
169.1817 ++		_M_data->_M_curr_symbol = L"";
169.1818 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
169.1819 ++	    }
169.1820 ++	  catch (...)
169.1821 ++	    {
169.1822 ++	      delete _M_data;
169.1823 ++	      _M_data = 0;
169.1824 ++	      delete __wcs_ps;
169.1825 ++	      delete __wcs_ns;	      
169.1826 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1827 ++	      __uselocale(__old);
169.1828 ++#else
169.1829 ++	      setlocale(LC_ALL, __old);
169.1830 ++	      free(__old);
169.1831 ++#endif
169.1832 ++	      __throw_exception_again;
169.1833 ++	    } 
169.1834 ++	  
169.1835 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
169.1836 ++						      __cloc));
169.1837 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
169.1838 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
169.1839 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
169.1840 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
169.1841 ++							__pposn);
169.1842 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
169.1843 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
169.1844 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
169.1845 ++							__nposn);
169.1846 ++
169.1847 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1848 ++	  __uselocale(__old);
169.1849 ++#else
169.1850 ++	  setlocale(LC_ALL, __old);
169.1851 ++	  free(__old);
169.1852 ++#endif
169.1853 ++	}
169.1854 ++    }
169.1855 ++
169.1856 ++  template<> 
169.1857 ++  void
169.1858 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
169.1859 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1860 ++						       const char*)
169.1861 ++#else
169.1862 ++                                                       const char* __name)
169.1863 ++#endif
169.1864 ++  {
169.1865 ++    if (!_M_data)
169.1866 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
169.1867 ++
169.1868 ++    if (!__cloc)
169.1869 ++	{
169.1870 ++	  // "C" locale
169.1871 ++	  _M_data->_M_decimal_point = L'.';
169.1872 ++	  _M_data->_M_thousands_sep = L',';
169.1873 ++	  _M_data->_M_grouping = "";
169.1874 ++          _M_data->_M_grouping_size = 0;
169.1875 ++	  _M_data->_M_curr_symbol = L"";
169.1876 ++	  _M_data->_M_curr_symbol_size = 0;
169.1877 ++	  _M_data->_M_positive_sign = L"";
169.1878 ++	  _M_data->_M_positive_sign_size = 0;
169.1879 ++	  _M_data->_M_negative_sign = L"";
169.1880 ++	  _M_data->_M_negative_sign_size = 0;
169.1881 ++	  _M_data->_M_frac_digits = 0;
169.1882 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
169.1883 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
169.1884 ++
169.1885 ++	  // Use ctype::widen code without the facet...
169.1886 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
169.1887 ++	    _M_data->_M_atoms[__i] =
169.1888 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
169.1889 ++	}
169.1890 ++      else
169.1891 ++	{
169.1892 ++	  // Named locale.
169.1893 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1894 ++	  __c_locale __old = __uselocale(__cloc);
169.1895 ++#else
169.1896 ++	  // Switch to named locale so that mbsrtowcs will work.
169.1897 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
169.1898 ++	  setlocale(LC_ALL, __name);
169.1899 ++#endif
169.1900 ++
169.1901 ++#ifdef __UCLIBC_MJN3_ONLY__
169.1902 ++#warning fix this... should be monetary
169.1903 ++#endif
169.1904 ++#ifdef __UCLIBC__
169.1905 ++# ifdef __UCLIBC_HAS_XLOCALE__
169.1906 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
169.1907 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
169.1908 ++# elif defined __UCLIBC_HAS_LOCALE__
169.1909 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
169.1910 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
169.1911 ++# endif
169.1912 ++#else
169.1913 ++          union { char *__s; wchar_t __w; } __u;
169.1914 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
169.1915 ++	  _M_data->_M_decimal_point = __u.__w;
169.1916 ++
169.1917 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
169.1918 ++	  _M_data->_M_thousands_sep = __u.__w;
169.1919 ++#endif
169.1920 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
169.1921 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
169.1922 ++
169.1923 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
169.1924 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
169.1925 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
169.1926 ++
169.1927 ++	  wchar_t* __wcs_ps = 0;
169.1928 ++	  wchar_t* __wcs_ns = 0;
169.1929 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
169.1930 ++	  try
169.1931 ++            {
169.1932 ++              mbstate_t __state;
169.1933 ++              size_t __len;
169.1934 ++              __len = strlen(__cpossign);
169.1935 ++              if (__len)
169.1936 ++                {
169.1937 ++		  ++__len;
169.1938 ++		  memset(&__state, 0, sizeof(mbstate_t));
169.1939 ++		  __wcs_ps = new wchar_t[__len];
169.1940 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
169.1941 ++		  _M_data->_M_positive_sign = __wcs_ps;
169.1942 ++		}
169.1943 ++	      else
169.1944 ++		_M_data->_M_positive_sign = L"";
169.1945 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
169.1946 ++	      
169.1947 ++	      __len = strlen(__cnegsign);
169.1948 ++	      if (!__nposn)
169.1949 ++		_M_data->_M_negative_sign = L"()";
169.1950 ++	      else if (__len)
169.1951 ++		{ 
169.1952 ++		  ++__len;
169.1953 ++		  memset(&__state, 0, sizeof(mbstate_t));
169.1954 ++		  __wcs_ns = new wchar_t[__len];
169.1955 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
169.1956 ++		  _M_data->_M_negative_sign = __wcs_ns;
169.1957 ++		}
169.1958 ++	      else
169.1959 ++		_M_data->_M_negative_sign = L"";
169.1960 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
169.1961 ++
169.1962 ++	      // _Intl == true.
169.1963 ++	      __len = strlen(__ccurr);
169.1964 ++	      if (__len)
169.1965 ++		{
169.1966 ++		  ++__len;
169.1967 ++		  memset(&__state, 0, sizeof(mbstate_t));
169.1968 ++		  wchar_t* __wcs = new wchar_t[__len];
169.1969 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
169.1970 ++		  _M_data->_M_curr_symbol = __wcs;
169.1971 ++		}
169.1972 ++	      else
169.1973 ++		_M_data->_M_curr_symbol = L"";
169.1974 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
169.1975 ++	    }
169.1976 ++          catch (...)
169.1977 ++	    {
169.1978 ++	      delete _M_data;
169.1979 ++              _M_data = 0;
169.1980 ++	      delete __wcs_ps;
169.1981 ++	      delete __wcs_ns;	      
169.1982 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.1983 ++	      __uselocale(__old);
169.1984 ++#else
169.1985 ++	      setlocale(LC_ALL, __old);
169.1986 ++	      free(__old);
169.1987 ++#endif
169.1988 ++              __throw_exception_again;
169.1989 ++	    }
169.1990 ++
169.1991 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
169.1992 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
169.1993 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
169.1994 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
169.1995 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
169.1996 ++	                                                __pposn);
169.1997 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
169.1998 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
169.1999 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
169.2000 ++	                                                __nposn);
169.2001 ++
169.2002 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.2003 ++	  __uselocale(__old);
169.2004 ++#else
169.2005 ++	  setlocale(LC_ALL, __old);
169.2006 ++	  free(__old);
169.2007 ++#endif
169.2008 ++	}
169.2009 ++    }
169.2010 ++
169.2011 ++  template<> 
169.2012 ++    moneypunct<wchar_t, true>::~moneypunct()
169.2013 ++    {
169.2014 ++      if (_M_data->_M_positive_sign_size)
169.2015 ++	delete [] _M_data->_M_positive_sign;
169.2016 ++      if (_M_data->_M_negative_sign_size
169.2017 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
169.2018 ++	delete [] _M_data->_M_negative_sign;
169.2019 ++      if (_M_data->_M_curr_symbol_size)
169.2020 ++	delete [] _M_data->_M_curr_symbol;
169.2021 ++      delete _M_data;
169.2022 ++    }
169.2023 ++
169.2024 ++  template<> 
169.2025 ++    moneypunct<wchar_t, false>::~moneypunct()
169.2026 ++    {
169.2027 ++      if (_M_data->_M_positive_sign_size)
169.2028 ++	delete [] _M_data->_M_positive_sign;
169.2029 ++      if (_M_data->_M_negative_sign_size
169.2030 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
169.2031 ++	delete [] _M_data->_M_negative_sign;
169.2032 ++      if (_M_data->_M_curr_symbol_size)
169.2033 ++	delete [] _M_data->_M_curr_symbol;
169.2034 ++      delete _M_data;
169.2035 ++    }
169.2036 ++#endif
169.2037 ++}
169.2038 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
169.2039 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-03-04 23:31:57.000000000 +0100
169.2040 +@@ -0,0 +1,173 @@
169.2041 ++// std::numpunct implementation details, GNU version -*- C++ -*-
169.2042 ++
169.2043 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
169.2044 ++//
169.2045 ++// This file is part of the GNU ISO C++ Library.  This library is free
169.2046 ++// software; you can redistribute it and/or modify it under the
169.2047 ++// terms of the GNU General Public License as published by the
169.2048 ++// Free Software Foundation; either version 2, or (at your option)
169.2049 ++// any later version.
169.2050 ++
169.2051 ++// This library is distributed in the hope that it will be useful,
169.2052 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
169.2053 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
169.2054 ++// GNU General Public License for more details.
169.2055 ++
169.2056 ++// You should have received a copy of the GNU General Public License along
169.2057 ++// with this library; see the file COPYING.  If not, write to the Free
169.2058 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
169.2059 ++// USA.
169.2060 ++
169.2061 ++// As a special exception, you may use this file as part of a free software
169.2062 ++// library without restriction.  Specifically, if other files instantiate
169.2063 ++// templates or use macros or inline functions from this file, or you compile
169.2064 ++// this file and link it with other files to produce an executable, this
169.2065 ++// file does not by itself cause the resulting executable to be covered by
169.2066 ++// the GNU General Public License.  This exception does not however
169.2067 ++// invalidate any other reasons why the executable file might be covered by
169.2068 ++// the GNU General Public License.
169.2069 ++
169.2070 ++//
169.2071 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
169.2072 ++//
169.2073 ++
169.2074 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
169.2075 ++
169.2076 ++#define _LIBC
169.2077 ++#include <locale>
169.2078 ++#undef _LIBC
169.2079 ++#include <bits/c++locale_internal.h>
169.2080 ++
169.2081 ++#ifdef __UCLIBC_MJN3_ONLY__
169.2082 ++#warning tailor for stub locale support
169.2083 ++#endif
169.2084 ++#ifndef __UCLIBC_HAS_XLOCALE__
169.2085 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
169.2086 ++#endif
169.2087 ++
169.2088 ++namespace std
169.2089 ++{
169.2090 ++  template<> 
169.2091 ++    void
169.2092 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
169.2093 ++    {
169.2094 ++      if (!_M_data)
169.2095 ++	_M_data = new __numpunct_cache<char>;
169.2096 ++
169.2097 ++      if (!__cloc)
169.2098 ++	{
169.2099 ++	  // "C" locale
169.2100 ++	  _M_data->_M_grouping = "";
169.2101 ++	  _M_data->_M_grouping_size = 0;
169.2102 ++	  _M_data->_M_use_grouping = false;
169.2103 ++
169.2104 ++	  _M_data->_M_decimal_point = '.';
169.2105 ++	  _M_data->_M_thousands_sep = ',';
169.2106 ++
169.2107 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
169.2108 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
169.2109 ++
169.2110 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
169.2111 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
169.2112 ++	}
169.2113 ++      else
169.2114 ++	{
169.2115 ++	  // Named locale.
169.2116 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
169.2117 ++							__cloc));
169.2118 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
169.2119 ++							__cloc));
169.2120 ++
169.2121 ++	  // Check for NULL, which implies no grouping.
169.2122 ++	  if (_M_data->_M_thousands_sep == '\0')
169.2123 ++	    _M_data->_M_grouping = "";
169.2124 ++	  else
169.2125 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
169.2126 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
169.2127 ++	}
169.2128 ++
169.2129 ++      // NB: There is no way to extact this info from posix locales.
169.2130 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
169.2131 ++      _M_data->_M_truename = "true";
169.2132 ++      _M_data->_M_truename_size = 4;
169.2133 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
169.2134 ++      _M_data->_M_falsename = "false";
169.2135 ++      _M_data->_M_falsename_size = 5;
169.2136 ++    }
169.2137 ++ 
169.2138 ++  template<> 
169.2139 ++    numpunct<char>::~numpunct()
169.2140 ++    { delete _M_data; }
169.2141 ++   
169.2142 ++#ifdef _GLIBCXX_USE_WCHAR_T
169.2143 ++  template<> 
169.2144 ++    void
169.2145 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
169.2146 ++    {
169.2147 ++      if (!_M_data)
169.2148 ++	_M_data = new __numpunct_cache<wchar_t>;
169.2149 ++
169.2150 ++      if (!__cloc)
169.2151 ++	{
169.2152 ++	  // "C" locale
169.2153 ++	  _M_data->_M_grouping = "";
169.2154 ++	  _M_data->_M_grouping_size = 0;
169.2155 ++	  _M_data->_M_use_grouping = false;
169.2156 ++
169.2157 ++	  _M_data->_M_decimal_point = L'.';
169.2158 ++	  _M_data->_M_thousands_sep = L',';
169.2159 ++
169.2160 ++	  // Use ctype::widen code without the facet...
169.2161 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
169.2162 ++	    _M_data->_M_atoms_out[__i] =
169.2163 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
169.2164 ++
169.2165 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
169.2166 ++	    _M_data->_M_atoms_in[__j] =
169.2167 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
169.2168 ++	}
169.2169 ++      else
169.2170 ++	{
169.2171 ++	  // Named locale.
169.2172 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
169.2173 ++#ifdef __UCLIBC_MJN3_ONLY__
169.2174 ++#warning fix this
169.2175 ++#endif
169.2176 ++#ifdef __UCLIBC__
169.2177 ++# ifdef __UCLIBC_HAS_XLOCALE__
169.2178 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
169.2179 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
169.2180 ++# elif defined __UCLIBC_HAS_LOCALE__
169.2181 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
169.2182 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
169.2183 ++# endif
169.2184 ++#else
169.2185 ++	  union { char *__s; wchar_t __w; } __u;
169.2186 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
169.2187 ++	  _M_data->_M_decimal_point = __u.__w;
169.2188 ++
169.2189 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
169.2190 ++	  _M_data->_M_thousands_sep = __u.__w;
169.2191 ++#endif
169.2192 ++
169.2193 ++	  if (_M_data->_M_thousands_sep == L'\0')
169.2194 ++	    _M_data->_M_grouping = "";
169.2195 ++	  else
169.2196 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
169.2197 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
169.2198 ++	}
169.2199 ++
169.2200 ++      // NB: There is no way to extact this info from posix locales.
169.2201 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
169.2202 ++      _M_data->_M_truename = L"true";
169.2203 ++      _M_data->_M_truename_size = 4;
169.2204 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
169.2205 ++      _M_data->_M_falsename = L"false";
169.2206 ++      _M_data->_M_falsename_size = 5;
169.2207 ++    }
169.2208 ++
169.2209 ++  template<> 
169.2210 ++    numpunct<wchar_t>::~numpunct()
169.2211 ++    { delete _M_data; }
169.2212 ++ #endif
169.2213 ++}
169.2214 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
169.2215 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-03-04 23:31:57.000000000 +0100
169.2216 +@@ -0,0 +1,406 @@
169.2217 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
169.2218 ++
169.2219 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
169.2220 ++//
169.2221 ++// This file is part of the GNU ISO C++ Library.  This library is free
169.2222 ++// software; you can redistribute it and/or modify it under the
169.2223 ++// terms of the GNU General Public License as published by the
169.2224 ++// Free Software Foundation; either version 2, or (at your option)
169.2225 ++// any later version.
169.2226 ++
169.2227 ++// This library is distributed in the hope that it will be useful,
169.2228 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
169.2229 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
169.2230 ++// GNU General Public License for more details.
169.2231 ++
169.2232 ++// You should have received a copy of the GNU General Public License along
169.2233 ++// with this library; see the file COPYING.  If not, write to the Free
169.2234 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
169.2235 ++// USA.
169.2236 ++
169.2237 ++// As a special exception, you may use this file as part of a free software
169.2238 ++// library without restriction.  Specifically, if other files instantiate
169.2239 ++// templates or use macros or inline functions from this file, or you compile
169.2240 ++// this file and link it with other files to produce an executable, this
169.2241 ++// file does not by itself cause the resulting executable to be covered by
169.2242 ++// the GNU General Public License.  This exception does not however
169.2243 ++// invalidate any other reasons why the executable file might be covered by
169.2244 ++// the GNU General Public License.
169.2245 ++
169.2246 ++//
169.2247 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
169.2248 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
169.2249 ++//
169.2250 ++
169.2251 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
169.2252 ++
169.2253 ++#include <locale>
169.2254 ++#include <bits/c++locale_internal.h>
169.2255 ++
169.2256 ++#ifdef __UCLIBC_MJN3_ONLY__
169.2257 ++#warning tailor for stub locale support
169.2258 ++#endif
169.2259 ++#ifndef __UCLIBC_HAS_XLOCALE__
169.2260 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
169.2261 ++#endif
169.2262 ++
169.2263 ++namespace std
169.2264 ++{
169.2265 ++  template<>
169.2266 ++    void
169.2267 ++    __timepunct<char>::
169.2268 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
169.2269 ++	   const tm* __tm) const
169.2270 ++    {
169.2271 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.2272 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
169.2273 ++					_M_c_locale_timepunct);
169.2274 ++#else
169.2275 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
169.2276 ++      setlocale(LC_ALL, _M_name_timepunct);
169.2277 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
169.2278 ++      setlocale(LC_ALL, __old);
169.2279 ++      free(__old);
169.2280 ++#endif
169.2281 ++      // Make sure __s is null terminated.
169.2282 ++      if (__len == 0)
169.2283 ++	__s[0] = '\0';
169.2284 ++    }
169.2285 ++
169.2286 ++  template<> 
169.2287 ++    void
169.2288 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
169.2289 ++    {
169.2290 ++      if (!_M_data)
169.2291 ++	_M_data = new __timepunct_cache<char>;
169.2292 ++
169.2293 ++      if (!__cloc)
169.2294 ++	{
169.2295 ++	  // "C" locale
169.2296 ++	  _M_c_locale_timepunct = _S_get_c_locale();
169.2297 ++
169.2298 ++	  _M_data->_M_date_format = "%m/%d/%y";
169.2299 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
169.2300 ++	  _M_data->_M_time_format = "%H:%M:%S";
169.2301 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
169.2302 ++	  _M_data->_M_date_time_format = "";
169.2303 ++	  _M_data->_M_date_time_era_format = "";
169.2304 ++	  _M_data->_M_am = "AM";
169.2305 ++	  _M_data->_M_pm = "PM";
169.2306 ++	  _M_data->_M_am_pm_format = "";
169.2307 ++
169.2308 ++	  // Day names, starting with "C"'s Sunday.
169.2309 ++	  _M_data->_M_day1 = "Sunday";
169.2310 ++	  _M_data->_M_day2 = "Monday";
169.2311 ++	  _M_data->_M_day3 = "Tuesday";
169.2312 ++	  _M_data->_M_day4 = "Wednesday";
169.2313 ++	  _M_data->_M_day5 = "Thursday";
169.2314 ++	  _M_data->_M_day6 = "Friday";
169.2315 ++	  _M_data->_M_day7 = "Saturday";
169.2316 ++
169.2317 ++	  // Abbreviated day names, starting with "C"'s Sun.
169.2318 ++	  _M_data->_M_aday1 = "Sun";
169.2319 ++	  _M_data->_M_aday2 = "Mon";
169.2320 ++	  _M_data->_M_aday3 = "Tue";
169.2321 ++	  _M_data->_M_aday4 = "Wed";
169.2322 ++	  _M_data->_M_aday5 = "Thu";
169.2323 ++	  _M_data->_M_aday6 = "Fri";
169.2324 ++	  _M_data->_M_aday7 = "Sat";
169.2325 ++
169.2326 ++	  // Month names, starting with "C"'s January.
169.2327 ++	  _M_data->_M_month01 = "January";
169.2328 ++	  _M_data->_M_month02 = "February";
169.2329 ++	  _M_data->_M_month03 = "March";
169.2330 ++	  _M_data->_M_month04 = "April";
169.2331 ++	  _M_data->_M_month05 = "May";
169.2332 ++	  _M_data->_M_month06 = "June";
169.2333 ++	  _M_data->_M_month07 = "July";
169.2334 ++	  _M_data->_M_month08 = "August";
169.2335 ++	  _M_data->_M_month09 = "September";
169.2336 ++	  _M_data->_M_month10 = "October";
169.2337 ++	  _M_data->_M_month11 = "November";
169.2338 ++	  _M_data->_M_month12 = "December";
169.2339 ++
169.2340 ++	  // Abbreviated month names, starting with "C"'s Jan.
169.2341 ++	  _M_data->_M_amonth01 = "Jan";
169.2342 ++	  _M_data->_M_amonth02 = "Feb";
169.2343 ++	  _M_data->_M_amonth03 = "Mar";
169.2344 ++	  _M_data->_M_amonth04 = "Apr";
169.2345 ++	  _M_data->_M_amonth05 = "May";
169.2346 ++	  _M_data->_M_amonth06 = "Jun";
169.2347 ++	  _M_data->_M_amonth07 = "Jul";
169.2348 ++	  _M_data->_M_amonth08 = "Aug";
169.2349 ++	  _M_data->_M_amonth09 = "Sep";
169.2350 ++	  _M_data->_M_amonth10 = "Oct";
169.2351 ++	  _M_data->_M_amonth11 = "Nov";
169.2352 ++	  _M_data->_M_amonth12 = "Dec";
169.2353 ++	}
169.2354 ++      else
169.2355 ++	{
169.2356 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
169.2357 ++
169.2358 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
169.2359 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
169.2360 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
169.2361 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
169.2362 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
169.2363 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
169.2364 ++							     __cloc);
169.2365 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
169.2366 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
169.2367 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
169.2368 ++
169.2369 ++	  // Day names, starting with "C"'s Sunday.
169.2370 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
169.2371 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
169.2372 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
169.2373 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
169.2374 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
169.2375 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
169.2376 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
169.2377 ++
169.2378 ++	  // Abbreviated day names, starting with "C"'s Sun.
169.2379 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
169.2380 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
169.2381 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
169.2382 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
169.2383 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
169.2384 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
169.2385 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
169.2386 ++
169.2387 ++	  // Month names, starting with "C"'s January.
169.2388 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
169.2389 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
169.2390 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
169.2391 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
169.2392 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
169.2393 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
169.2394 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
169.2395 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
169.2396 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
169.2397 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
169.2398 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
169.2399 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
169.2400 ++
169.2401 ++	  // Abbreviated month names, starting with "C"'s Jan.
169.2402 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
169.2403 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
169.2404 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
169.2405 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
169.2406 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
169.2407 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
169.2408 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
169.2409 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
169.2410 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
169.2411 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
169.2412 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
169.2413 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
169.2414 ++	}
169.2415 ++    }
169.2416 ++
169.2417 ++#ifdef _GLIBCXX_USE_WCHAR_T
169.2418 ++  template<>
169.2419 ++    void
169.2420 ++    __timepunct<wchar_t>::
169.2421 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
169.2422 ++	   const tm* __tm) const
169.2423 ++    {
169.2424 ++#ifdef __UCLIBC_HAS_XLOCALE__
169.2425 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
169.2426 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
169.2427 ++					_M_c_locale_timepunct);
169.2428 ++#else
169.2429 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
169.2430 ++      setlocale(LC_ALL, _M_name_timepunct);
169.2431 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
169.2432 ++      setlocale(LC_ALL, __old);
169.2433 ++      free(__old);
169.2434 ++#endif
169.2435 ++      // Make sure __s is null terminated.
169.2436 ++      if (__len == 0)
169.2437 ++	__s[0] = L'\0';
169.2438 ++    }
169.2439 ++
169.2440 ++  template<> 
169.2441 ++    void
169.2442 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
169.2443 ++    {
169.2444 ++      if (!_M_data)
169.2445 ++	_M_data = new __timepunct_cache<wchar_t>;
169.2446 ++
169.2447 ++#warning wide time stuff
169.2448 ++//       if (!__cloc)
169.2449 ++	{
169.2450 ++	  // "C" locale
169.2451 ++	  _M_c_locale_timepunct = _S_get_c_locale();
169.2452 ++
169.2453 ++	  _M_data->_M_date_format = L"%m/%d/%y";
169.2454 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
169.2455 ++	  _M_data->_M_time_format = L"%H:%M:%S";
169.2456 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
169.2457 ++	  _M_data->_M_date_time_format = L"";
169.2458 ++	  _M_data->_M_date_time_era_format = L"";
169.2459 ++	  _M_data->_M_am = L"AM";
169.2460 ++	  _M_data->_M_pm = L"PM";
169.2461 ++	  _M_data->_M_am_pm_format = L"";
169.2462 ++
169.2463 ++	  // Day names, starting with "C"'s Sunday.
169.2464 ++	  _M_data->_M_day1 = L"Sunday";
169.2465 ++	  _M_data->_M_day2 = L"Monday";
169.2466 ++	  _M_data->_M_day3 = L"Tuesday";
169.2467 ++	  _M_data->_M_day4 = L"Wednesday";
169.2468 ++	  _M_data->_M_day5 = L"Thursday";
169.2469 ++	  _M_data->_M_day6 = L"Friday";
169.2470 ++	  _M_data->_M_day7 = L"Saturday";
169.2471 ++
169.2472 ++	  // Abbreviated day names, starting with "C"'s Sun.
169.2473 ++	  _M_data->_M_aday1 = L"Sun";
169.2474 ++	  _M_data->_M_aday2 = L"Mon";
169.2475 ++	  _M_data->_M_aday3 = L"Tue";
169.2476 ++	  _M_data->_M_aday4 = L"Wed";
169.2477 ++	  _M_data->_M_aday5 = L"Thu";
169.2478 ++	  _M_data->_M_aday6 = L"Fri";
169.2479 ++	  _M_data->_M_aday7 = L"Sat";
169.2480 ++
169.2481 ++	  // Month names, starting with "C"'s January.
169.2482 ++	  _M_data->_M_month01 = L"January";
169.2483 ++	  _M_data->_M_month02 = L"February";
169.2484 ++	  _M_data->_M_month03 = L"March";
169.2485 ++	  _M_data->_M_month04 = L"April";
169.2486 ++	  _M_data->_M_month05 = L"May";
169.2487 ++	  _M_data->_M_month06 = L"June";
169.2488 ++	  _M_data->_M_month07 = L"July";
169.2489 ++	  _M_data->_M_month08 = L"August";
169.2490 ++	  _M_data->_M_month09 = L"September";
169.2491 ++	  _M_data->_M_month10 = L"October";
169.2492 ++	  _M_data->_M_month11 = L"November";
169.2493 ++	  _M_data->_M_month12 = L"December";
169.2494 ++
169.2495 ++	  // Abbreviated month names, starting with "C"'s Jan.
169.2496 ++	  _M_data->_M_amonth01 = L"Jan";
169.2497 ++	  _M_data->_M_amonth02 = L"Feb";
169.2498 ++	  _M_data->_M_amonth03 = L"Mar";
169.2499 ++	  _M_data->_M_amonth04 = L"Apr";
169.2500 ++	  _M_data->_M_amonth05 = L"May";
169.2501 ++	  _M_data->_M_amonth06 = L"Jun";
169.2502 ++	  _M_data->_M_amonth07 = L"Jul";
169.2503 ++	  _M_data->_M_amonth08 = L"Aug";
169.2504 ++	  _M_data->_M_amonth09 = L"Sep";
169.2505 ++	  _M_data->_M_amonth10 = L"Oct";
169.2506 ++	  _M_data->_M_amonth11 = L"Nov";
169.2507 ++	  _M_data->_M_amonth12 = L"Dec";
169.2508 ++	}
169.2509 ++#if 0
169.2510 ++      else
169.2511 ++	{
169.2512 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
169.2513 ++
169.2514 ++	  union { char *__s; wchar_t *__w; } __u;
169.2515 ++
169.2516 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
169.2517 ++	  _M_data->_M_date_format = __u.__w;
169.2518 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
169.2519 ++	  _M_data->_M_date_era_format = __u.__w;
169.2520 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
169.2521 ++	  _M_data->_M_time_format = __u.__w;
169.2522 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
169.2523 ++	  _M_data->_M_time_era_format = __u.__w;
169.2524 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
169.2525 ++	  _M_data->_M_date_time_format = __u.__w;
169.2526 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
169.2527 ++	  _M_data->_M_date_time_era_format = __u.__w;
169.2528 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
169.2529 ++	  _M_data->_M_am = __u.__w;
169.2530 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
169.2531 ++	  _M_data->_M_pm = __u.__w;
169.2532 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
169.2533 ++	  _M_data->_M_am_pm_format = __u.__w;
169.2534 ++
169.2535 ++	  // Day names, starting with "C"'s Sunday.
169.2536 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
169.2537 ++	  _M_data->_M_day1 = __u.__w;
169.2538 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
169.2539 ++	  _M_data->_M_day2 = __u.__w;
169.2540 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
169.2541 ++	  _M_data->_M_day3 = __u.__w;
169.2542 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
169.2543 ++	  _M_data->_M_day4 = __u.__w;
169.2544 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
169.2545 ++	  _M_data->_M_day5 = __u.__w;
169.2546 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
169.2547 ++	  _M_data->_M_day6 = __u.__w;
169.2548 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
169.2549 ++	  _M_data->_M_day7 = __u.__w;
169.2550 ++
169.2551 ++	  // Abbreviated day names, starting with "C"'s Sun.
169.2552 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
169.2553 ++	  _M_data->_M_aday1 = __u.__w;
169.2554 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
169.2555 ++	  _M_data->_M_aday2 = __u.__w;
169.2556 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
169.2557 ++	  _M_data->_M_aday3 = __u.__w;
169.2558 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
169.2559 ++	  _M_data->_M_aday4 = __u.__w;
169.2560 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
169.2561 ++	  _M_data->_M_aday5 = __u.__w;
169.2562 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
169.2563 ++	  _M_data->_M_aday6 = __u.__w;
169.2564 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
169.2565 ++	  _M_data->_M_aday7 = __u.__w;
169.2566 ++
169.2567 ++	  // Month names, starting with "C"'s January.
169.2568 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
169.2569 ++	  _M_data->_M_month01 = __u.__w;
169.2570 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
169.2571 ++	  _M_data->_M_month02 = __u.__w;
169.2572 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
169.2573 ++	  _M_data->_M_month03 = __u.__w;
169.2574 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
169.2575 ++	  _M_data->_M_month04 = __u.__w;
169.2576 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
169.2577 ++	  _M_data->_M_month05 = __u.__w;
169.2578 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
169.2579 ++	  _M_data->_M_month06 = __u.__w;
169.2580 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
169.2581 ++	  _M_data->_M_month07 = __u.__w;
169.2582 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
169.2583 ++	  _M_data->_M_month08 = __u.__w;
169.2584 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
169.2585 ++	  _M_data->_M_month09 = __u.__w;
169.2586 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
169.2587 ++	  _M_data->_M_month10 = __u.__w;
169.2588 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
169.2589 ++	  _M_data->_M_month11 = __u.__w;
169.2590 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
169.2591 ++	  _M_data->_M_month12 = __u.__w;
169.2592 ++
169.2593 ++	  // Abbreviated month names, starting with "C"'s Jan.
169.2594 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
169.2595 ++	  _M_data->_M_amonth01 = __u.__w;
169.2596 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
169.2597 ++	  _M_data->_M_amonth02 = __u.__w;
169.2598 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
169.2599 ++	  _M_data->_M_amonth03 = __u.__w;
169.2600 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
169.2601 ++	  _M_data->_M_amonth04 = __u.__w;
169.2602 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
169.2603 ++	  _M_data->_M_amonth05 = __u.__w;
169.2604 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
169.2605 ++	  _M_data->_M_amonth06 = __u.__w;
169.2606 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
169.2607 ++	  _M_data->_M_amonth07 = __u.__w;
169.2608 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
169.2609 ++	  _M_data->_M_amonth08 = __u.__w;
169.2610 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
169.2611 ++	  _M_data->_M_amonth09 = __u.__w;
169.2612 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
169.2613 ++	  _M_data->_M_amonth10 = __u.__w;
169.2614 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
169.2615 ++	  _M_data->_M_amonth11 = __u.__w;
169.2616 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
169.2617 ++	  _M_data->_M_amonth12 = __u.__w;
169.2618 ++	}
169.2619 ++#endif // 0
169.2620 ++    }
169.2621 ++#endif
169.2622 ++}
169.2623 +--- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
169.2624 ++++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/time_members.h	2007-03-04 23:31:57.000000000 +0100
169.2625 +@@ -0,0 +1,76 @@
169.2626 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
169.2627 ++
169.2628 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
169.2629 ++//
169.2630 ++// This file is part of the GNU ISO C++ Library.  This library is free
169.2631 ++// software; you can redistribute it and/or modify it under the
169.2632 ++// terms of the GNU General Public License as published by the
169.2633 ++// Free Software Foundation; either version 2, or (at your option)
169.2634 ++// any later version.
169.2635 ++
169.2636 ++// This library is distributed in the hope that it will be useful,
169.2637 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
169.2638 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
169.2639 ++// GNU General Public License for more details.
169.2640 ++
169.2641 ++// You should have received a copy of the GNU General Public License along
169.2642 ++// with this library; see the file COPYING.  If not, write to the Free
169.2643 ++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
169.2644 ++// USA.
169.2645 ++
169.2646 ++// As a special exception, you may use this file as part of a free software
169.2647 ++// library without restriction.  Specifically, if other files instantiate
169.2648 ++// templates or use macros or inline functions from this file, or you compile
169.2649 ++// this file and link it with other files to produce an executable, this
169.2650 ++// file does not by itself cause the resulting executable to be covered by
169.2651 ++// the GNU General Public License.  This exception does not however
169.2652 ++// invalidate any other reasons why the executable file might be covered by
169.2653 ++// the GNU General Public License.
169.2654 ++
169.2655 ++//
169.2656 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
169.2657 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
169.2658 ++//
169.2659 ++
169.2660 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
169.2661 ++
169.2662 ++  template<typename _CharT>
169.2663 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
169.2664 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
169.2665 ++      _M_name_timepunct(_S_get_c_name())
169.2666 ++    { _M_initialize_timepunct(); }
169.2667 ++
169.2668 ++  template<typename _CharT>
169.2669 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
169.2670 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
169.2671 ++      _M_name_timepunct(_S_get_c_name())
169.2672 ++    { _M_initialize_timepunct(); }
169.2673 ++
169.2674 ++  template<typename _CharT>
169.2675 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
169.2676 ++				     size_t __refs) 
169.2677 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
169.2678 ++      _M_name_timepunct(NULL)
169.2679 ++    { 
169.2680 ++      const size_t __len = std::strlen(__s) + 1;
169.2681 ++      char* __tmp = new char[__len];
169.2682 ++      std::memcpy(__tmp, __s, __len);
169.2683 ++      _M_name_timepunct = __tmp;
169.2684 ++
169.2685 ++      try
169.2686 ++	{ _M_initialize_timepunct(__cloc); }
169.2687 ++      catch(...)
169.2688 ++	{
169.2689 ++	  delete [] _M_name_timepunct;
169.2690 ++	  __throw_exception_again;
169.2691 ++	}
169.2692 ++    }
169.2693 ++
169.2694 ++  template<typename _CharT>
169.2695 ++    __timepunct<_CharT>::~__timepunct()
169.2696 ++    { 
169.2697 ++      if (_M_name_timepunct != _S_get_c_name())
169.2698 ++	delete [] _M_name_timepunct;
169.2699 ++      delete _M_data; 
169.2700 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
169.2701 ++    }
169.2702 +--- gcc-4.1.2.orig/libstdc++-v3/config/os/uclibc/ctype_base.h	1970-01-01 01:00:00.000000000 +0100
169.2703 ++++ gcc-4.1.2/libstdc++-v3/config/os/uclibc/ctype_base.h	2007-03-04 23:31:57.000000000 +0100
169.2704 +@@ -0,0 +1,64 @@
169.2705 ++// Locale support -*- C++ -*-
169.2706 ++
169.2707 ++// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
169.2708 ++// Free Software Foundation, Inc.
169.2709 ++//
169.2710 ++// This file is part of the GNU ISO C++ Library.  This library is free
169.2711 ++// software; you can redistribute it and/or modify it under the
169.2712 ++// terms of the GNU General Public License as published by the
169.2713 ++// Free Software Foundation; either version 2, or (at your option)
169.2714 ++// any later version.
169.2715 ++
169.2716 ++// This library is distributed in the hope that it will be useful,
169.2717 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
169.2718 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
169.2719 ++// GNU General Public License for more details.
169.2720 ++
169.2721 ++// You should have received a copy of the GNU General Public License along
169.2722 ++// with this library; see the file COPYING.  If not, write to the Free
169.2723 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
169.2724 ++// USA.
169.2725 ++
169.2726 ++// As a special exception, you may use this file as part of a free software
169.2727 ++// library without restriction.  Specifically, if other files instantiate
169.2728 ++// templates or use macros or inline functions from this file, or you compile
169.2729 ++// this file and link it with other files to produce an executable, this
169.2730 ++// file does not by itself cause the resulting executable to be covered by
169.2731 ++// the GNU General Public License.  This exception does not however
169.2732 ++// invalidate any other reasons why the executable file might be covered by
169.2733 ++// the GNU General Public License.
169.2734 ++
169.2735 ++//
169.2736 ++// ISO C++ 14882: 22.1  Locales
169.2737 ++//
169.2738 ++  
169.2739 ++/** @file ctype_base.h
169.2740 ++ *  This is an internal header file, included by other library headers.
169.2741 ++ *  You should not attempt to use it directly.
169.2742 ++ */
169.2743 ++
169.2744 ++// Information as gleaned from /usr/include/ctype.h
169.2745 ++  
169.2746 ++  /// @brief  Base class for ctype.
169.2747 ++  struct ctype_base
169.2748 ++  {
169.2749 ++    // Note: In uClibc, the following two types depend on configuration.
169.2750 ++ 
169.2751 ++    // Non-standard typedefs.
169.2752 ++    typedef const __ctype_touplow_t* __to_type;
169.2753 ++
169.2754 ++    // NB: Offsets into ctype<char>::_M_table force a particular size
169.2755 ++    // on the mask type. Because of this, we don't use an enum.
169.2756 ++    typedef __ctype_mask_t	mask;   
169.2757 ++    static const mask upper    	= _ISupper;
169.2758 ++    static const mask lower 	= _ISlower;
169.2759 ++    static const mask alpha 	= _ISalpha;
169.2760 ++    static const mask digit 	= _ISdigit;
169.2761 ++    static const mask xdigit 	= _ISxdigit;
169.2762 ++    static const mask space 	= _ISspace;
169.2763 ++    static const mask print 	= _ISprint;
169.2764 ++    static const mask graph 	= _ISalpha | _ISdigit | _ISpunct;
169.2765 ++    static const mask cntrl 	= _IScntrl;
169.2766 ++    static const mask punct 	= _ISpunct;
169.2767 ++    static const mask alnum 	= _ISalpha | _ISdigit;
169.2768 ++  };
169.2769 +--- gcc-4.1.2.orig/libstdc++-v3/config/os/uclibc/ctype_inline.h	1970-01-01 01:00:00.000000000 +0100
169.2770 ++++ gcc-4.1.2/libstdc++-v3/config/os/uclibc/ctype_inline.h	2007-03-04 23:31:57.000000000 +0100
169.2771 +@@ -0,0 +1,69 @@
169.2772 ++// Locale support -*- C++ -*-
169.2773 ++
169.2774 ++// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
169.2775 ++//
169.2776 ++// This file is part of the GNU ISO C++ Library.  This library is free
169.2777 ++// software; you can redistribute it and/or modify it under the
169.2778 ++// terms of the GNU General Public License as published by the
169.2779 ++// Free Software Foundation; either version 2, or (at your option)
169.2780 ++// any later version.
169.2781 ++
169.2782 ++// This library is distributed in the hope that it will be useful,
169.2783 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
169.2784 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
169.2785 ++// GNU General Public License for more details.
169.2786 ++
169.2787 ++// You should have received a copy of the GNU General Public License along
169.2788 ++// with this library; see the file COPYING.  If not, write to the Free
169.2789 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
169.2790 ++// USA.
169.2791 ++
169.2792 ++// As a special exception, you may use this file as part of a free software
169.2793 ++// library without restriction.  Specifically, if other files instantiate
169.2794 ++// templates or use macros or inline functions from this file, or you compile
169.2795 ++// this file and link it with other files to produce an executable, this
169.2796 ++// file does not by itself cause the resulting executable to be covered by
169.2797 ++// the GNU General Public License.  This exception does not however
169.2798 ++// invalidate any other reasons why the executable file might be covered by
169.2799 ++// the GNU General Public License.
169.2800 ++
169.2801 ++//
169.2802 ++// ISO C++ 14882: 22.1  Locales
169.2803 ++//
169.2804 ++  
169.2805 ++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
169.2806 ++// functions go in ctype.cc
169.2807 ++  
169.2808 ++  bool
169.2809 ++  ctype<char>::
169.2810 ++  is(mask __m, char __c) const
169.2811 ++  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
169.2812 ++
169.2813 ++  const char*
169.2814 ++  ctype<char>::
169.2815 ++  is(const char* __low, const char* __high, mask* __vec) const
169.2816 ++  {
169.2817 ++    while (__low < __high)
169.2818 ++      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
169.2819 ++    return __high;
169.2820 ++  }
169.2821 ++
169.2822 ++  const char*
169.2823 ++  ctype<char>::
169.2824 ++  scan_is(mask __m, const char* __low, const char* __high) const
169.2825 ++  {
169.2826 ++    while (__low < __high 
169.2827 ++	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
169.2828 ++      ++__low;
169.2829 ++    return __low;
169.2830 ++  }
169.2831 ++
169.2832 ++  const char*
169.2833 ++  ctype<char>::
169.2834 ++  scan_not(mask __m, const char* __low, const char* __high) const
169.2835 ++  {
169.2836 ++    while (__low < __high 
169.2837 ++	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
169.2838 ++      ++__low;
169.2839 ++    return __low;
169.2840 ++  }
169.2841 +--- gcc-4.1.2.orig/libstdc++-v3/config/os/uclibc/ctype_noninline.h	1970-01-01 01:00:00.000000000 +0100
169.2842 ++++ gcc-4.1.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h	2007-03-04 23:31:57.000000000 +0100
169.2843 +@@ -0,0 +1,92 @@
169.2844 ++// Locale support -*- C++ -*-
169.2845 ++
169.2846 ++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
169.2847 ++// Free Software Foundation, Inc.
169.2848 ++//
169.2849 ++// This file is part of the GNU ISO C++ Library.  This library is free
169.2850 ++// software; you can redistribute it and/or modify it under the
169.2851 ++// terms of the GNU General Public License as published by the
169.2852 ++// Free Software Foundation; either version 2, or (at your option)
169.2853 ++// any later version.
169.2854 ++
169.2855 ++// This library is distributed in the hope that it will be useful,
169.2856 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
169.2857 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
169.2858 ++// GNU General Public License for more details.
169.2859 ++
169.2860 ++// You should have received a copy of the GNU General Public License along
169.2861 ++// with this library; see the file COPYING.  If not, write to the Free
169.2862 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
169.2863 ++// USA.
169.2864 ++
169.2865 ++// As a special exception, you may use this file as part of a free software
169.2866 ++// library without restriction.  Specifically, if other files instantiate
169.2867 ++// templates or use macros or inline functions from this file, or you compile
169.2868 ++// this file and link it with other files to produce an executable, this
169.2869 ++// file does not by itself cause the resulting executable to be covered by
169.2870 ++// the GNU General Public License.  This exception does not however
169.2871 ++// invalidate any other reasons why the executable file might be covered by
169.2872 ++// the GNU General Public License.
169.2873 ++
169.2874 ++//
169.2875 ++// ISO C++ 14882: 22.1  Locales
169.2876 ++//
169.2877 ++  
169.2878 ++// Information as gleaned from /usr/include/ctype.h
169.2879 ++
169.2880 ++  const ctype_base::mask*
169.2881 ++  ctype<char>::classic_table() throw()
169.2882 ++  { return __C_ctype_b; }
169.2883 ++
169.2884 ++  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
169.2885 ++		     size_t __refs) 
169.2886 ++  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
169.2887 ++  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
169.2888 ++  {
169.2889 ++    _M_toupper = __C_ctype_toupper;
169.2890 ++    _M_tolower = __C_ctype_tolower;
169.2891 ++    _M_table = __table ? __table : __C_ctype_b;
169.2892 ++    memset(_M_widen, 0, sizeof(_M_widen));
169.2893 ++    memset(_M_narrow, 0, sizeof(_M_narrow));
169.2894 ++  }
169.2895 ++
169.2896 ++  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
169.2897 ++  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
169.2898 ++  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
169.2899 ++  {
169.2900 ++    _M_toupper = __C_ctype_toupper;
169.2901 ++    _M_tolower = __C_ctype_tolower;
169.2902 ++    _M_table = __table ? __table : __C_ctype_b;
169.2903 ++    memset(_M_widen, 0, sizeof(_M_widen));
169.2904 ++    memset(_M_narrow, 0, sizeof(_M_narrow));
169.2905 ++  }
169.2906 ++
169.2907 ++  char
169.2908 ++  ctype<char>::do_toupper(char __c) const
169.2909 ++  { return _M_toupper[static_cast<unsigned char>(__c)]; }
169.2910 ++
169.2911 ++  const char*
169.2912 ++  ctype<char>::do_toupper(char* __low, const char* __high) const
169.2913 ++  {
169.2914 ++    while (__low < __high)
169.2915 ++      {
169.2916 ++	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
169.2917 ++	++__low;
169.2918 ++      }
169.2919 ++    return __high;
169.2920 ++  }
169.2921 ++
169.2922 ++  char
169.2923 ++  ctype<char>::do_tolower(char __c) const
169.2924 ++  { return _M_tolower[static_cast<unsigned char>(__c)]; }
169.2925 ++
169.2926 ++  const char* 
169.2927 ++  ctype<char>::do_tolower(char* __low, const char* __high) const
169.2928 ++  {
169.2929 ++    while (__low < __high)
169.2930 ++      {
169.2931 ++	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
169.2932 ++	++__low;
169.2933 ++      }
169.2934 ++    return __high;
169.2935 ++  }
169.2936 +--- gcc-4.1.2.orig/libstdc++-v3/config/os/uclibc/os_defines.h	1970-01-01 01:00:00.000000000 +0100
169.2937 ++++ gcc-4.1.2/libstdc++-v3/config/os/uclibc/os_defines.h	2007-03-04 23:31:57.000000000 +0100
169.2938 +@@ -0,0 +1,44 @@
169.2939 ++// Specific definitions for GNU/Linux  -*- C++ -*-
169.2940 ++
169.2941 ++// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
169.2942 ++//
169.2943 ++// This file is part of the GNU ISO C++ Library.  This library is free
169.2944 ++// software; you can redistribute it and/or modify it under the
169.2945 ++// terms of the GNU General Public License as published by the
169.2946 ++// Free Software Foundation; either version 2, or (at your option)
169.2947 ++// any later version.
169.2948 ++
169.2949 ++// This library is distributed in the hope that it will be useful,
169.2950 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
169.2951 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
169.2952 ++// GNU General Public License for more details.
169.2953 ++
169.2954 ++// You should have received a copy of the GNU General Public License along
169.2955 ++// with this library; see the file COPYING.  If not, write to the Free
169.2956 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
169.2957 ++// USA.
169.2958 ++
169.2959 ++// As a special exception, you may use this file as part of a free software
169.2960 ++// library without restriction.  Specifically, if other files instantiate
169.2961 ++// templates or use macros or inline functions from this file, or you compile
169.2962 ++// this file and link it with other files to produce an executable, this
169.2963 ++// file does not by itself cause the resulting executable to be covered by
169.2964 ++// the GNU General Public License.  This exception does not however
169.2965 ++// invalidate any other reasons why the executable file might be covered by
169.2966 ++// the GNU General Public License.
169.2967 ++
169.2968 ++#ifndef _GLIBCXX_OS_DEFINES
169.2969 ++#define _GLIBCXX_OS_DEFINES 1
169.2970 ++
169.2971 ++// System-specific #define, typedefs, corrections, etc, go here.  This
169.2972 ++// file will come before all others.
169.2973 ++
169.2974 ++// This keeps isanum, et al from being propagated as macros.
169.2975 ++#define __NO_CTYPE 1
169.2976 ++
169.2977 ++#include <features.h>
169.2978 ++
169.2979 ++// We must not see the optimized string functions GNU libc defines.
169.2980 ++#define __NO_STRING_INLINES
169.2981 ++
169.2982 ++#endif
169.2983 +--- gcc-4.1.2.orig/libstdc++-v3/configure	2007-01-29 11:51:01.000000000 +0100
169.2984 ++++ gcc-4.1.2/libstdc++-v3/configure	2007-03-04 23:31:57.000000000 +0100
169.2985 +@@ -4005,6 +4005,11 @@
169.2986 +   lt_cv_deplibs_check_method=pass_all
169.2987 +   ;;
169.2988 + 
169.2989 ++linux-uclibc*)
169.2990 ++  lt_cv_deplibs_check_method=pass_all
169.2991 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
169.2992 ++  ;;
169.2993 ++
169.2994 + netbsd* | knetbsd*-gnu)
169.2995 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
169.2996 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
169.2997 +@@ -5740,7 +5745,7 @@
169.2998 +   enableval="$enable_clocale"
169.2999 + 
169.3000 +       case "$enableval" in
169.3001 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
169.3002 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
169.3003 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
169.3004 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
169.3005 +    { (exit 1); exit 1; }; } ;;
169.3006 +@@ -5765,6 +5770,9 @@
169.3007 +   # Default to "generic".
169.3008 +   if test $enable_clocale_flag = auto; then
169.3009 +     case ${target_os} in
169.3010 ++      linux-uclibc*)
169.3011 ++        enable_clocale_flag=uclibc
169.3012 ++	;;
169.3013 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
169.3014 +         cat >conftest.$ac_ext <<_ACEOF
169.3015 + /* confdefs.h.  */
169.3016 +@@ -5995,6 +6003,76 @@
169.3017 +       CTIME_CC=config/locale/generic/time_members.cc
169.3018 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
169.3019 +       ;;
169.3020 ++    uclibc)
169.3021 ++      echo "$as_me:$LINENO: result: uclibc" >&5
169.3022 ++echo "${ECHO_T}uclibc" >&6
169.3023 ++
169.3024 ++      # Declare intention to use gettext, and add support for specific
169.3025 ++      # languages.
169.3026 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
169.3027 ++      ALL_LINGUAS="de fr"
169.3028 ++
169.3029 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
169.3030 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
169.3031 ++set dummy msgfmt; ac_word=$2
169.3032 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
169.3033 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
169.3034 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
169.3035 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
169.3036 ++else
169.3037 ++  if test -n "$check_msgfmt"; then
169.3038 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
169.3039 ++else
169.3040 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
169.3041 ++for as_dir in $PATH
169.3042 ++do
169.3043 ++  IFS=$as_save_IFS
169.3044 ++  test -z "$as_dir" && as_dir=.
169.3045 ++  for ac_exec_ext in '' $ac_executable_extensions; do
169.3046 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
169.3047 ++    ac_cv_prog_check_msgfmt="yes"
169.3048 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
169.3049 ++    break 2
169.3050 ++  fi
169.3051 ++done
169.3052 ++done
169.3053 ++
169.3054 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
169.3055 ++fi
169.3056 ++fi
169.3057 ++check_msgfmt=$ac_cv_prog_check_msgfmt
169.3058 ++if test -n "$check_msgfmt"; then
169.3059 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
169.3060 ++echo "${ECHO_T}$check_msgfmt" >&6
169.3061 ++else
169.3062 ++  echo "$as_me:$LINENO: result: no" >&5
169.3063 ++echo "${ECHO_T}no" >&6
169.3064 ++fi
169.3065 ++
169.3066 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
169.3067 ++        USE_NLS=yes
169.3068 ++      fi
169.3069 ++      # Export the build objects.
169.3070 ++      for ling in $ALL_LINGUAS; do \
169.3071 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
169.3072 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
169.3073 ++      done
169.3074 ++
169.3075 ++
169.3076 ++
169.3077 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
169.3078 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
169.3079 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
169.3080 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
169.3081 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
169.3082 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
169.3083 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
169.3084 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
169.3085 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
169.3086 ++      CTIME_H=config/locale/uclibc/time_members.h
169.3087 ++      CTIME_CC=config/locale/uclibc/time_members.cc
169.3088 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
169.3089 ++      ;;
169.3090 +   esac
169.3091 + 
169.3092 +   # This is where the testsuite looks for locale catalogs, using the
169.3093 +--- gcc-4.1.2.orig/libstdc++-v3/configure.host	2007-01-28 21:12:40.000000000 +0100
169.3094 ++++ gcc-4.1.2/libstdc++-v3/configure.host	2007-03-04 23:31:57.000000000 +0100
169.3095 +@@ -270,6 +270,12 @@
169.3096 +     ;;
169.3097 + esac
169.3098 + 
169.3099 ++# Override for uClibc since linux-uclibc gets mishandled above.
169.3100 ++case "${host_os}" in
169.3101 ++  *-uclibc*)
169.3102 ++    os_include_dir="os/uclibc"
169.3103 ++    ;;
169.3104 ++esac
169.3105 + 
169.3106 + # Set any OS-dependent and CPU-dependent bits.
169.3107 + # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
169.3108 +--- gcc-4.1.2.orig/libstdc++-v3/crossconfig.m4	2006-12-12 15:18:36.000000000 +0100
169.3109 ++++ gcc-4.1.2/libstdc++-v3/crossconfig.m4	2007-03-04 23:31:57.000000000 +0100
169.3110 +@@ -143,6 +143,99 @@
169.3111 + 	;;
169.3112 +     esac
169.3113 +     ;;
169.3114 ++  *-uclibc*)
169.3115 ++# Temporary hack until we implement the float versions of the libm funcs
169.3116 ++    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
169.3117 ++      machine/endian.h machine/param.h sys/machine.h sys/types.h \
169.3118 ++      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
169.3119 ++    SECTION_FLAGS='-ffunction-sections -fdata-sections'
169.3120 ++    AC_SUBST(SECTION_FLAGS)
169.3121 ++    GLIBCXX_CHECK_LINKER_FEATURES
169.3122 ++    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
169.3123 ++    GLIBCXX_CHECK_WCHAR_T_SUPPORT
169.3124 ++
169.3125 ++    # For LFS.
169.3126 ++    AC_DEFINE(HAVE_INT64_T)
169.3127 ++    case "$target" in
169.3128 ++      *-uclinux*)
169.3129 ++        # Don't enable LFS with uClinux
169.3130 ++        ;;
169.3131 ++      *)
169.3132 ++        AC_DEFINE(_GLIBCXX_USE_LFS)
169.3133 ++    esac
169.3134 ++
169.3135 ++    # For showmanyc_helper().
169.3136 ++    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
169.3137 ++    GLIBCXX_CHECK_POLL
169.3138 ++    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
169.3139 ++
169.3140 ++    # For xsputn_2().
169.3141 ++    AC_CHECK_HEADERS(sys/uio.h)
169.3142 ++    GLIBCXX_CHECK_WRITEV
169.3143 ++
169.3144 ++#     AC_DEFINE(HAVE_ACOSF)
169.3145 ++#     AC_DEFINE(HAVE_ASINF)
169.3146 ++#     AC_DEFINE(HAVE_ATANF)
169.3147 ++#     AC_DEFINE(HAVE_ATAN2F)
169.3148 ++    AC_DEFINE(HAVE_CEILF)
169.3149 ++    AC_DEFINE(HAVE_COPYSIGN)
169.3150 ++#     AC_DEFINE(HAVE_COPYSIGNF)
169.3151 ++#     AC_DEFINE(HAVE_COSF)
169.3152 ++#     AC_DEFINE(HAVE_COSHF)
169.3153 ++#     AC_DEFINE(HAVE_EXPF)
169.3154 ++#     AC_DEFINE(HAVE_FABSF)
169.3155 ++    AC_DEFINE(HAVE_FINITE)
169.3156 ++    AC_DEFINE(HAVE_FINITEF)
169.3157 ++    AC_DEFINE(HAVE_FLOORF)
169.3158 ++#     AC_DEFINE(HAVE_FMODF)
169.3159 ++#     AC_DEFINE(HAVE_FREXPF)
169.3160 ++    AC_DEFINE(HAVE_HYPOT)
169.3161 ++#     AC_DEFINE(HAVE_HYPOTF)
169.3162 ++    AC_DEFINE(HAVE_ISINF)
169.3163 ++    AC_DEFINE(HAVE_ISINFF)
169.3164 ++    AC_DEFINE(HAVE_ISNAN)
169.3165 ++    AC_DEFINE(HAVE_ISNANF)
169.3166 ++#     AC_DEFINE(HAVE_LOGF)
169.3167 ++#     AC_DEFINE(HAVE_LOG10F)
169.3168 ++#     AC_DEFINE(HAVE_MODFF)
169.3169 ++#     AC_DEFINE(HAVE_SINF)
169.3170 ++#     AC_DEFINE(HAVE_SINHF)
169.3171 ++#     AC_DEFINE(HAVE_SINCOS)
169.3172 ++#     AC_DEFINE(HAVE_SINCOSF)
169.3173 ++    AC_DEFINE(HAVE_SQRTF)
169.3174 ++#     AC_DEFINE(HAVE_TANF)
169.3175 ++#     AC_DEFINE(HAVE_TANHF)
169.3176 ++    if test x"long_double_math_on_this_cpu" = x"yes"; then
169.3177 ++      AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
169.3178 ++#       AC_DEFINE(HAVE_ACOSL)
169.3179 ++#       AC_DEFINE(HAVE_ASINL)
169.3180 ++#       AC_DEFINE(HAVE_ATANL)
169.3181 ++#       AC_DEFINE(HAVE_ATAN2L)
169.3182 ++#       AC_DEFINE(HAVE_CEILL)
169.3183 ++#       AC_DEFINE(HAVE_COPYSIGNL)
169.3184 ++#       AC_DEFINE(HAVE_COSL)
169.3185 ++#       AC_DEFINE(HAVE_COSHL)
169.3186 ++#       AC_DEFINE(HAVE_EXPL)
169.3187 ++#       AC_DEFINE(HAVE_FABSL)
169.3188 ++#       AC_DEFINE(HAVE_FINITEL)
169.3189 ++#       AC_DEFINE(HAVE_FLOORL)
169.3190 ++#       AC_DEFINE(HAVE_FMODL)
169.3191 ++#       AC_DEFINE(HAVE_FREXPL)
169.3192 ++#       AC_DEFINE(HAVE_HYPOTL)
169.3193 ++#       AC_DEFINE(HAVE_ISINFL)
169.3194 ++#       AC_DEFINE(HAVE_ISNANL)
169.3195 ++#       AC_DEFINE(HAVE_LOGL)
169.3196 ++#       AC_DEFINE(HAVE_LOG10L)
169.3197 ++#       AC_DEFINE(HAVE_MODFL)
169.3198 ++#       AC_DEFINE(HAVE_POWL)
169.3199 ++#       AC_DEFINE(HAVE_SINL)
169.3200 ++#       AC_DEFINE(HAVE_SINHL)
169.3201 ++#       AC_DEFINE(HAVE_SINCOSL)
169.3202 ++#       AC_DEFINE(HAVE_SQRTL)
169.3203 ++#       AC_DEFINE(HAVE_TANL)
169.3204 ++#       AC_DEFINE(HAVE_TANHL)
169.3205 ++    fi
169.3206 ++    ;;
169.3207 +   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
169.3208 +     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
169.3209 +       machine/endian.h machine/param.h sys/machine.h sys/types.h \
169.3210 +@@ -157,7 +250,7 @@
169.3211 +     AC_DEFINE(HAVE_INT64_T)
169.3212 +     case "$target" in
169.3213 +       *-uclinux*)
169.3214 +-        # Don't enable LFS with uClibc
169.3215 ++        # Don't enable LFS with uClinux
169.3216 +         ;;
169.3217 +       *)
169.3218 +         AC_DEFINE(_GLIBCXX_USE_LFS)
169.3219 +--- gcc-4.1.2.orig/libstdc++-v3/include/c_compatibility/wchar.h	2005-08-17 04:28:44.000000000 +0200
169.3220 ++++ gcc-4.1.2/libstdc++-v3/include/c_compatibility/wchar.h	2007-03-04 23:31:57.000000000 +0100
169.3221 +@@ -101,7 +101,9 @@
169.3222 + using std::wmemcpy;
169.3223 + using std::wmemmove;
169.3224 + using std::wmemset;
169.3225 ++#if _GLIBCXX_HAVE_WCSFTIME
169.3226 + using std::wcsftime;
169.3227 ++#endif
169.3228 + 
169.3229 + #if _GLIBCXX_USE_C99
169.3230 + using std::wcstold;
169.3231 +--- gcc-4.1.2.orig/libstdc++-v3/include/c_std/std_cwchar.h	2005-10-30 23:21:50.000000000 +0100
169.3232 ++++ gcc-4.1.2/libstdc++-v3/include/c_std/std_cwchar.h	2007-03-04 23:31:57.000000000 +0100
169.3233 +@@ -180,7 +180,9 @@
169.3234 +   using ::wcscoll;
169.3235 +   using ::wcscpy;
169.3236 +   using ::wcscspn;
169.3237 ++#if _GLIBCXX_HAVE_WCSFTIME
169.3238 +   using ::wcsftime;
169.3239 ++#endif
169.3240 +   using ::wcslen;
169.3241 +   using ::wcsncat;
169.3242 +   using ::wcsncmp;
   170.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   170.2 +++ b/patches/gcc/4.1.2/130-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   170.3 @@ -0,0 +1,48 @@
   170.4 +--- gcc-4.1.2.orig/libstdc++-v3/src/Makefile.am	2006-01-10 05:01:00.000000000 +0100
   170.5 ++++ gcc-4.1.2/libstdc++-v3/src/Makefile.am	2007-03-04 23:32:40.000000000 +0100
   170.6 +@@ -234,6 +234,12 @@
   170.7 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
   170.8 + 
   170.9 + 
  170.10 ++install-exec-local:
  170.11 ++ifeq ($(enable_shared),yes)
  170.12 ++	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  170.13 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  170.14 ++endif
  170.15 ++
  170.16 + # Added bits to build debug library.
  170.17 + if GLIBCXX_BUILD_DEBUG
  170.18 + all-local: build_debug
  170.19 +--- gcc-4.1.2.orig/libstdc++-v3/src/Makefile.in	2006-01-10 18:14:00.000000000 +0100
  170.20 ++++ gcc-4.1.2/libstdc++-v3/src/Makefile.in	2007-03-04 23:32:40.000000000 +0100
  170.21 +@@ -627,7 +627,7 @@
  170.22 + 
  170.23 + install-data-am: install-data-local
  170.24 + 
  170.25 +-install-exec-am: install-toolexeclibLTLIBRARIES
  170.26 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  170.27 + 
  170.28 + install-info: install-info-am
  170.29 + 
  170.30 +@@ -660,6 +660,7 @@
  170.31 + 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  170.32 + 	html-am info info-am install install-am install-data \
  170.33 + 	install-data-am install-data-local install-exec \
  170.34 ++	install-exec-local \
  170.35 + 	install-exec-am install-info install-info-am install-man \
  170.36 + 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  170.37 + 	installcheck-am installdirs maintainer-clean \
  170.38 +@@ -760,6 +761,13 @@
  170.39 + install_debug:
  170.40 + 	(cd ${debugdir} && $(MAKE) \
  170.41 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  170.42 ++
  170.43 ++install-exec-local:
  170.44 ++ifeq ($(enable_shared),yes)
  170.45 ++	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  170.46 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  170.47 ++endif
  170.48 ++
  170.49 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  170.50 + # Otherwise a system limit (for SysV at least) may be exceeded.
  170.51 + .NOEXPORT:
   171.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   171.2 +++ b/patches/gcc/4.1.2/140-missing-execinfo_h.patch	Mon Jul 28 21:32:33 2008 +0000
   171.3 @@ -0,0 +1,11 @@
   171.4 +--- gcc-4.1.2.orig/boehm-gc/include/gc.h	2005-01-02 04:35:57.000000000 +0100
   171.5 ++++ gcc-4.1.2/boehm-gc/include/gc.h	2007-03-04 23:33:07.000000000 +0100
   171.6 +@@ -500,7 +500,7 @@
   171.7 + #ifdef __linux__
   171.8 + # include <features.h>
   171.9 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  171.10 +-     && !defined(__ia64__)
  171.11 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  171.12 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  171.13 + #     define GC_HAVE_BUILTIN_BACKTRACE
  171.14 + #   endif
   172.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   172.2 +++ b/patches/gcc/4.1.2/150-c99-snprintf.patch	Mon Jul 28 21:32:33 2008 +0000
   172.3 @@ -0,0 +1,11 @@
   172.4 +--- gcc-4.1.2.orig/libstdc++-v3/include/c_std/std_cstdio.h	2005-10-30 23:21:50.000000000 +0100
   172.5 ++++ gcc-4.1.2/libstdc++-v3/include/c_std/std_cstdio.h	2007-03-04 23:33:27.000000000 +0100
   172.6 +@@ -143,7 +143,7 @@
   172.7 +   using ::vsprintf;
   172.8 + }
   172.9 + 
  172.10 +-#if _GLIBCXX_USE_C99
  172.11 ++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  172.12 + 
  172.13 + #undef snprintf
  172.14 + #undef vfscanf
   173.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   173.2 +++ b/patches/gcc/4.1.2/160-c99-complex-ugly-hack.patch	Mon Jul 28 21:32:33 2008 +0000
   173.3 @@ -0,0 +1,12 @@
   173.4 +--- gcc-4.1.2.orig/libstdc++-v3/configure	2007-03-04 23:32:31.000000000 +0100
   173.5 ++++ gcc-4.1.2/libstdc++-v3/configure	2007-03-04 23:33:54.000000000 +0100
   173.6 +@@ -7324,6 +7324,9 @@
   173.7 + cat >>conftest.$ac_ext <<_ACEOF
   173.8 + /* end confdefs.h.  */
   173.9 + #include <complex.h>
  173.10 ++#ifdef __UCLIBC__
  173.11 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  173.12 ++#endif
  173.13 + int
  173.14 + main ()
  173.15 + {
   174.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   174.2 +++ b/patches/gcc/4.1.2/170-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
   174.3 @@ -0,0 +1,24 @@
   174.4 +--- gcc-4.1.2.orig/libstdc++-v3/include/ext/rope	2005-08-17 04:28:44.000000000 +0200
   174.5 ++++ gcc-4.1.2/libstdc++-v3/include/ext/rope	2007-03-04 23:34:08.000000000 +0100
   174.6 +@@ -57,6 +57,9 @@
   174.7 + #include <bits/allocator.h>
   174.8 + #include <ext/hash_fun.h>
   174.9 + 
  174.10 ++/* cope w/ index defined as macro, SuSv3 proposal */
  174.11 ++#undef index
  174.12 ++
  174.13 + # ifdef __GC
  174.14 + #   define __GC_CONST const
  174.15 + # else
  174.16 +--- gcc-4.1.2.orig/libstdc++-v3/include/ext/ropeimpl.h	2005-08-17 04:28:44.000000000 +0200
  174.17 ++++ gcc-4.1.2/libstdc++-v3/include/ext/ropeimpl.h	2007-03-04 23:34:08.000000000 +0100
  174.18 +@@ -53,6 +53,9 @@
  174.19 + #include <ext/memory> // For uninitialized_copy_n
  174.20 + #include <ext/numeric> // For power
  174.21 + 
  174.22 ++/* cope w/ index defined as macro, SuSv3 proposal */
  174.23 ++#undef index
  174.24 ++
  174.25 + namespace __gnu_cxx
  174.26 + {
  174.27 +   using std::size_t;
   175.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   175.2 +++ b/patches/gcc/4.1.2/180-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:32:33 2008 +0000
   175.3 @@ -0,0 +1,11 @@
   175.4 +--- gcc-4.1.2.orig/gcc/Makefile.in	2006-11-01 15:40:44.000000000 +0100
   175.5 ++++ gcc-4.1.2/gcc/Makefile.in	2007-03-04 23:34:32.000000000 +0100
   175.6 +@@ -2522,7 +2522,7 @@
   175.7 + # FIXME: writing proper dependencies for this is a *LOT* of work.
   175.8 + libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
   175.9 +   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  175.10 +-  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  175.11 ++  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  175.12 + 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  175.13 + 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  175.14 + 	  -DLOCALEDIR=\"$(localedir)\" \
   176.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   176.2 +++ b/patches/gcc/4.1.2/190-sh-pr24836.patch	Mon Jul 28 21:32:33 2008 +0000
   176.3 @@ -0,0 +1,22 @@
   176.4 +--- gcc-4.1.2.orig/gcc/configure.ac	2006-11-13 23:09:55.000000000 +0100
   176.5 ++++ gcc-4.1.2/gcc/configure.ac	2007-03-04 23:34:53.000000000 +0100
   176.6 +@@ -2435,7 +2435,7 @@
   176.7 + 	tls_first_minor=14
   176.8 + 	tls_as_opt="-m64 -Aesame --fatal-warnings"
   176.9 + 	;;
  176.10 +-  sh-*-* | sh[34]-*-*)
  176.11 ++  sh-*-* | sh[34]*-*-*)
  176.12 +     conftest_s='
  176.13 + 	.section ".tdata","awT",@progbits
  176.14 + foo:	.long	25
  176.15 +--- gcc-4.1.2.orig/gcc/configure	2006-11-13 23:09:55.000000000 +0100
  176.16 ++++ gcc-4.1.2/gcc/configure	2007-03-04 23:34:53.000000000 +0100
  176.17 +@@ -14762,7 +14762,7 @@
  176.18 + 	tls_first_minor=14
  176.19 + 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  176.20 + 	;;
  176.21 +-  sh-*-* | sh[34]-*-*)
  176.22 ++  sh-*-* | sh[34]*-*-*)
  176.23 +     conftest_s='
  176.24 + 	.section ".tdata","awT",@progbits
  176.25 + foo:	.long	25
   177.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   177.2 +++ b/patches/gcc/4.1.2/200-arm-bigendian.patch	Mon Jul 28 21:32:33 2008 +0000
   177.3 @@ -0,0 +1,114 @@
   177.4 +--- gcc-4.1.2.orig/gcc/config/arm/linux-elf.h	2007-03-04 23:25:37.000000000 +0100
   177.5 ++++ gcc-4.1.2/gcc/config/arm/linux-elf.h	2007-03-04 23:35:09.000000000 +0100
   177.6 +@@ -28,19 +28,33 @@
   177.7 + #undef  TARGET_VERSION
   177.8 + #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
   177.9 + 
  177.10 ++/*
  177.11 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  177.12 ++ * (big endian) configurations.
  177.13 ++ */
  177.14 ++#if TARGET_BIG_ENDIAN_DEFAULT
  177.15 ++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  177.16 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
  177.17 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
  177.18 ++#else
  177.19 ++#define TARGET_ENDIAN_DEFAULT 0
  177.20 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
  177.21 ++#define TARGET_LINKER_EMULATION "armelf_linux"
  177.22 ++#endif
  177.23 ++
  177.24 + #undef  TARGET_DEFAULT_FLOAT_ABI
  177.25 + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  177.26 + 
  177.27 + #undef  TARGET_DEFAULT
  177.28 +-#define TARGET_DEFAULT (0)
  177.29 ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  177.30 + 
  177.31 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  177.32 + 
  177.33 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  177.34 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  177.35 + 
  177.36 + #undef  MULTILIB_DEFAULTS
  177.37 + #define MULTILIB_DEFAULTS \
  177.38 +-	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  177.39 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  177.40 + 
  177.41 + /* Now we define the strings used to build the spec file.  */
  177.42 + #undef  LIB_SPEC
  177.43 +@@ -65,7 +79,7 @@
  177.44 +    %{rdynamic:-export-dynamic} \
  177.45 +    %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
  177.46 +    -X \
  177.47 +-   %{mbig-endian:-EB}" \
  177.48 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  177.49 +    SUBTARGET_EXTRA_LINK_SPEC
  177.50 + 
  177.51 + #undef  LINK_SPEC
  177.52 +--- gcc-4.1.2.orig/gcc/config.gcc	2007-03-04 23:31:48.000000000 +0100
  177.53 ++++ gcc-4.1.2/gcc/config.gcc	2007-03-04 23:35:09.000000000 +0100
  177.54 +@@ -672,6 +672,11 @@
  177.55 + 	;;
  177.56 + arm*-*-linux*)			# ARM GNU/Linux with ELF
  177.57 + 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" 
  177.58 ++	case $target in
  177.59 ++	arm*b-*)
  177.60 ++		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  177.61 ++		;;
  177.62 ++	esac
  177.63 + 	tmake_file="${tmake_file} t-linux arm/t-arm"
  177.64 + 	case ${target} in
  177.65 + 	arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
  177.66 +--- gcc-4.1.2.orig/gcc/config/arm/linux-eabi.h	2007-03-04 23:31:48.000000000 +0100
  177.67 ++++ gcc-4.1.2/gcc/config/arm/linux-eabi.h	2007-03-04 23:35:09.000000000 +0100
  177.68 +@@ -20,6 +20,17 @@
  177.69 +    the Free Software Foundation, 51 Franklin Street, Fifth Floor,
  177.70 +    Boston, MA 02110-1301, USA.  */
  177.71 + 
  177.72 ++/*
  177.73 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  177.74 ++ * (big endian) configurations.
  177.75 ++ */
  177.76 ++#undef TARGET_LINKER_EMULATION
  177.77 ++#if TARGET_BIG_ENDIAN_DEFAULT
  177.78 ++#define TARGET_LINKER_EMULATION "armelfb_linux_eabi"
  177.79 ++#else
  177.80 ++#define TARGET_LINKER_EMULATION "armelf_linux_eabi"
  177.81 ++#endif
  177.82 ++
  177.83 + /* On EABI GNU/Linux, we want both the BPABI builtins and the
  177.84 +    GNU/Linux builtins.  */
  177.85 + #undef TARGET_OS_CPP_BUILTINS
  177.86 +@@ -48,7 +59,7 @@
  177.87 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
  177.88 + 
  177.89 + #undef SUBTARGET_EXTRA_LINK_SPEC
  177.90 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
  177.91 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
  177.92 + 
  177.93 + /* Use ld-linux.so.3 so that it will be possible to run "classic"
  177.94 +    GNU/Linux binaries on an EABI system.  */
  177.95 +--- gcc-4.1.2.orig/gcc/config/arm/bpabi.h	2005-12-13 02:35:37.000000000 +0100
  177.96 ++++ gcc-4.1.2/gcc/config/arm/bpabi.h	2007-03-04 23:35:09.000000000 +0100
  177.97 +@@ -33,9 +33,19 @@
  177.98 + #undef FPUTYPE_DEFAULT
  177.99 + #define FPUTYPE_DEFAULT FPUTYPE_VFP
 177.100 + 
 177.101 ++/*
 177.102 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
 177.103 ++ * (big endian) configurations.
 177.104 ++ */
 177.105 ++#if TARGET_BIG_ENDIAN_DEFAULT
 177.106 ++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
 177.107 ++#else
 177.108 ++#define TARGET_ENDIAN_DEFAULT 0
 177.109 ++#endif
 177.110 ++
 177.111 + /* EABI targets should enable interworking by default.  */
 177.112 + #undef TARGET_DEFAULT
 177.113 +-#define TARGET_DEFAULT MASK_INTERWORK
 177.114 ++#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
 177.115 + 
 177.116 + /* The ARM BPABI functions return a boolean; they use no special
 177.117 +    calling convention.  */
   178.1 --- a/patches/gcc/4.1.2/200-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   178.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   178.3 @@ -1,3239 +0,0 @@
   178.4 ---- gcc-4.1.2.orig/libstdc++-v3/acinclude.m4	2007-01-29 11:51:01.000000000 +0100
   178.5 -+++ gcc-4.1.2/libstdc++-v3/acinclude.m4	2007-03-04 23:31:57.000000000 +0100
   178.6 -@@ -1003,7 +1003,7 @@
   178.7 -   AC_MSG_CHECKING([for C locale to use])
   178.8 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
   178.9 -     [use MODEL for target locale package],
  178.10 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  178.11 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  178.12 -   
  178.13 -   # If they didn't use this option switch, or if they specified --enable
  178.14 -   # with no specific model, we'll have to look for one.  If they
  178.15 -@@ -1019,6 +1019,9 @@
  178.16 -   # Default to "generic".
  178.17 -   if test $enable_clocale_flag = auto; then
  178.18 -     case ${target_os} in
  178.19 -+      *-uclibc*)
  178.20 -+        enable_clocale_flag=uclibc
  178.21 -+        ;;
  178.22 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  178.23 -         AC_EGREP_CPP([_GLIBCXX_ok], [
  178.24 -         #include <features.h>
  178.25 -@@ -1162,6 +1165,40 @@
  178.26 -       CTIME_CC=config/locale/generic/time_members.cc
  178.27 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  178.28 -       ;;
  178.29 -+    uclibc)
  178.30 -+      AC_MSG_RESULT(uclibc)
  178.31 -+
  178.32 -+      # Declare intention to use gettext, and add support for specific
  178.33 -+      # languages.
  178.34 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  178.35 -+      ALL_LINGUAS="de fr"
  178.36 -+
  178.37 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  178.38 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  178.39 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  178.40 -+        USE_NLS=yes
  178.41 -+      fi
  178.42 -+      # Export the build objects.
  178.43 -+      for ling in $ALL_LINGUAS; do \
  178.44 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  178.45 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  178.46 -+      done
  178.47 -+      AC_SUBST(glibcxx_MOFILES)
  178.48 -+      AC_SUBST(glibcxx_POFILES)
  178.49 -+
  178.50 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  178.51 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  178.52 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  178.53 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  178.54 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  178.55 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  178.56 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  178.57 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  178.58 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  178.59 -+      CTIME_H=config/locale/uclibc/time_members.h
  178.60 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  178.61 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  178.62 -+      ;;
  178.63 -   esac
  178.64 - 
  178.65 -   # This is where the testsuite looks for locale catalogs, using the
  178.66 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
  178.67 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-03-04 23:31:57.000000000 +0100
  178.68 -@@ -0,0 +1,63 @@
  178.69 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  178.70 -+
  178.71 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  178.72 -+//
  178.73 -+// This file is part of the GNU ISO C++ Library.  This library is free
  178.74 -+// software; you can redistribute it and/or modify it under the
  178.75 -+// terms of the GNU General Public License as published by the
  178.76 -+// Free Software Foundation; either version 2, or (at your option)
  178.77 -+// any later version.
  178.78 -+
  178.79 -+// This library is distributed in the hope that it will be useful,
  178.80 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  178.81 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  178.82 -+// GNU General Public License for more details.
  178.83 -+
  178.84 -+// You should have received a copy of the GNU General Public License along
  178.85 -+// with this library; see the file COPYING.  If not, write to the Free
  178.86 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
  178.87 -+// USA.
  178.88 -+
  178.89 -+// As a special exception, you may use this file as part of a free software
  178.90 -+// library without restriction.  Specifically, if other files instantiate
  178.91 -+// templates or use macros or inline functions from this file, or you compile
  178.92 -+// this file and link it with other files to produce an executable, this
  178.93 -+// file does not by itself cause the resulting executable to be covered by
  178.94 -+// the GNU General Public License.  This exception does not however
  178.95 -+// invalidate any other reasons why the executable file might be covered by
  178.96 -+// the GNU General Public License.
  178.97 -+
  178.98 -+// Written by Jakub Jelinek <jakub@redhat.com>
  178.99 -+
 178.100 -+#include <bits/c++config.h>
 178.101 -+#include <clocale>
 178.102 -+
 178.103 -+#ifdef __UCLIBC_MJN3_ONLY__
 178.104 -+#warning clean this up
 178.105 -+#endif
 178.106 -+
 178.107 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.108 -+                                                  
 178.109 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 178.110 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 178.111 -+extern "C" __typeof(strftime_l) __strftime_l;
 178.112 -+extern "C" __typeof(strtod_l) __strtod_l;
 178.113 -+extern "C" __typeof(strtof_l) __strtof_l;
 178.114 -+extern "C" __typeof(strtold_l) __strtold_l;
 178.115 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 178.116 -+extern "C" __typeof(newlocale) __newlocale;
 178.117 -+extern "C" __typeof(freelocale) __freelocale;
 178.118 -+extern "C" __typeof(duplocale) __duplocale;
 178.119 -+extern "C" __typeof(uselocale) __uselocale;
 178.120 -+
 178.121 -+#ifdef _GLIBCXX_USE_WCHAR_T
 178.122 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 178.123 -+extern "C" __typeof(towlower_l) __towlower_l;
 178.124 -+extern "C" __typeof(towupper_l) __towupper_l;
 178.125 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 178.126 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 178.127 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 178.128 -+extern "C" __typeof(wctype_l) __wctype_l;
 178.129 -+#endif 
 178.130 -+
 178.131 -+#endif // GLIBC 2.3 and later
 178.132 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
 178.133 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-03-04 23:31:57.000000000 +0100
 178.134 -@@ -0,0 +1,152 @@
 178.135 -+// Wrapper for underlying C-language localization -*- C++ -*-
 178.136 -+
 178.137 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 
 178.138 -+// Free Software Foundation, Inc.
 178.139 -+//
 178.140 -+// This file is part of the GNU ISO C++ Library.  This library is free
 178.141 -+// software; you can redistribute it and/or modify it under the
 178.142 -+// terms of the GNU General Public License as published by the
 178.143 -+// Free Software Foundation; either version 2, or (at your option)
 178.144 -+// any later version.
 178.145 -+
 178.146 -+// This library is distributed in the hope that it will be useful,
 178.147 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 178.148 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 178.149 -+// GNU General Public License for more details.
 178.150 -+
 178.151 -+// You should have received a copy of the GNU General Public License along
 178.152 -+// with this library; see the file COPYING.  If not, write to the Free
 178.153 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 178.154 -+// USA.
 178.155 -+
 178.156 -+// As a special exception, you may use this file as part of a free software
 178.157 -+// library without restriction.  Specifically, if other files instantiate
 178.158 -+// templates or use macros or inline functions from this file, or you compile
 178.159 -+// this file and link it with other files to produce an executable, this
 178.160 -+// file does not by itself cause the resulting executable to be covered by
 178.161 -+// the GNU General Public License.  This exception does not however
 178.162 -+// invalidate any other reasons why the executable file might be covered by
 178.163 -+// the GNU General Public License.
 178.164 -+
 178.165 -+//
 178.166 -+// ISO C++ 14882: 22.8  Standard locale categories.
 178.167 -+//
 178.168 -+
 178.169 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 178.170 -+
 178.171 -+#include <cerrno>  // For errno
 178.172 -+#include <locale>
 178.173 -+#include <stdexcept>
 178.174 -+#include <langinfo.h>
 178.175 -+#include <bits/c++locale_internal.h>
 178.176 -+
 178.177 -+#ifndef __UCLIBC_HAS_XLOCALE__
 178.178 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 178.179 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 178.180 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 178.181 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 178.182 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 178.183 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 178.184 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 178.185 -+#warning should dummy __newlocale check for C|POSIX ?
 178.186 -+#define __newlocale(a, b, c)        NULL
 178.187 -+#define __freelocale(a)             ((void)0)
 178.188 -+#define __duplocale(a)              __c_locale()
 178.189 -+#endif
 178.190 -+
 178.191 -+namespace std 
 178.192 -+{
 178.193 -+  template<>
 178.194 -+    void
 178.195 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 178.196 -+		   const __c_locale& __cloc)
 178.197 -+    {
 178.198 -+      char* __sanity;
 178.199 -+      errno = 0;
 178.200 -+      float __f = __strtof_l(__s, &__sanity, __cloc);
 178.201 -+      if (__sanity != __s && errno != ERANGE)
 178.202 -+	__v = __f;
 178.203 -+      else
 178.204 -+	__err |= ios_base::failbit;
 178.205 -+    }
 178.206 -+
 178.207 -+  template<>
 178.208 -+    void
 178.209 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 178.210 -+		   const __c_locale& __cloc)
 178.211 -+    {
 178.212 -+      char* __sanity;
 178.213 -+      errno = 0;
 178.214 -+      double __d = __strtod_l(__s, &__sanity, __cloc);
 178.215 -+      if (__sanity != __s && errno != ERANGE)
 178.216 -+	__v = __d;
 178.217 -+      else
 178.218 -+	__err |= ios_base::failbit;
 178.219 -+    }
 178.220 -+
 178.221 -+  template<>
 178.222 -+    void
 178.223 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 178.224 -+		   const __c_locale& __cloc)
 178.225 -+    {
 178.226 -+      char* __sanity;
 178.227 -+      errno = 0;
 178.228 -+      long double __ld = __strtold_l(__s, &__sanity, __cloc);
 178.229 -+      if (__sanity != __s && errno != ERANGE)
 178.230 -+	__v = __ld;
 178.231 -+      else
 178.232 -+	__err |= ios_base::failbit;
 178.233 -+    }
 178.234 -+
 178.235 -+  void
 178.236 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 178.237 -+				    __c_locale __old)
 178.238 -+  {
 178.239 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 178.240 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.241 -+    if (!__cloc)
 178.242 -+      {
 178.243 -+	// This named locale is not supported by the underlying OS.
 178.244 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 178.245 -+			      "name not valid"));
 178.246 -+      }
 178.247 -+#endif
 178.248 -+  }
 178.249 -+  
 178.250 -+  void
 178.251 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 178.252 -+  {
 178.253 -+    if (__cloc && _S_get_c_locale() != __cloc)
 178.254 -+      __freelocale(__cloc); 
 178.255 -+  }
 178.256 -+
 178.257 -+  __c_locale
 178.258 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 178.259 -+  { return __duplocale(__cloc); }
 178.260 -+} // namespace std
 178.261 -+
 178.262 -+namespace __gnu_cxx
 178.263 -+{
 178.264 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 178.265 -+    {
 178.266 -+      "LC_CTYPE", 
 178.267 -+      "LC_NUMERIC",
 178.268 -+      "LC_TIME", 
 178.269 -+      "LC_COLLATE", 
 178.270 -+      "LC_MONETARY",
 178.271 -+      "LC_MESSAGES", 
 178.272 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 178.273 -+      "LC_PAPER", 
 178.274 -+      "LC_NAME", 
 178.275 -+      "LC_ADDRESS",
 178.276 -+      "LC_TELEPHONE", 
 178.277 -+      "LC_MEASUREMENT", 
 178.278 -+      "LC_IDENTIFICATION" 
 178.279 -+#endif
 178.280 -+    };
 178.281 -+}
 178.282 -+
 178.283 -+namespace std
 178.284 -+{
 178.285 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 178.286 -+}  // namespace std
 178.287 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 178.288 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-03-04 23:31:57.000000000 +0100
 178.289 -@@ -0,0 +1,117 @@
 178.290 -+// Wrapper for underlying C-language localization -*- C++ -*-
 178.291 -+
 178.292 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 178.293 -+//
 178.294 -+// This file is part of the GNU ISO C++ Library.  This library is free
 178.295 -+// software; you can redistribute it and/or modify it under the
 178.296 -+// terms of the GNU General Public License as published by the
 178.297 -+// Free Software Foundation; either version 2, or (at your option)
 178.298 -+// any later version.
 178.299 -+
 178.300 -+// This library is distributed in the hope that it will be useful,
 178.301 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 178.302 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 178.303 -+// GNU General Public License for more details.
 178.304 -+
 178.305 -+// You should have received a copy of the GNU General Public License along
 178.306 -+// with this library; see the file COPYING.  If not, write to the Free
 178.307 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 178.308 -+// USA.
 178.309 -+
 178.310 -+// As a special exception, you may use this file as part of a free software
 178.311 -+// library without restriction.  Specifically, if other files instantiate
 178.312 -+// templates or use macros or inline functions from this file, or you compile
 178.313 -+// this file and link it with other files to produce an executable, this
 178.314 -+// file does not by itself cause the resulting executable to be covered by
 178.315 -+// the GNU General Public License.  This exception does not however
 178.316 -+// invalidate any other reasons why the executable file might be covered by
 178.317 -+// the GNU General Public License.
 178.318 -+
 178.319 -+//
 178.320 -+// ISO C++ 14882: 22.8  Standard locale categories.
 178.321 -+//
 178.322 -+
 178.323 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 178.324 -+
 178.325 -+#ifndef _C_LOCALE_H
 178.326 -+#define _C_LOCALE_H 1
 178.327 -+
 178.328 -+#pragma GCC system_header
 178.329 -+
 178.330 -+#include <cstring>              // get std::strlen
 178.331 -+#include <cstdio>               // get std::snprintf or std::sprintf
 178.332 -+#include <clocale>
 178.333 -+#include <langinfo.h>		// For codecvt
 178.334 -+#ifdef __UCLIBC_MJN3_ONLY__
 178.335 -+#warning fix this
 178.336 -+#endif
 178.337 -+#ifdef __UCLIBC_HAS_LOCALE__
 178.338 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 178.339 -+#endif
 178.340 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 178.341 -+#include <libintl.h> 		// For messages
 178.342 -+#endif
 178.343 -+
 178.344 -+#ifdef __UCLIBC_MJN3_ONLY__
 178.345 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 178.346 -+#endif
 178.347 -+#define _GLIBCXX_C_LOCALE_GNU 1
 178.348 -+
 178.349 -+#ifdef __UCLIBC_MJN3_ONLY__
 178.350 -+#warning fix categories
 178.351 -+#endif
 178.352 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 178.353 -+#define _GLIBCXX_NUM_CATEGORIES 0
 178.354 -+ 
 178.355 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.356 -+namespace __gnu_cxx
 178.357 -+{
 178.358 -+  extern "C" __typeof(uselocale) __uselocale;
 178.359 -+}
 178.360 -+#endif
 178.361 -+
 178.362 -+namespace std
 178.363 -+{
 178.364 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.365 -+  typedef __locale_t		__c_locale;
 178.366 -+#else
 178.367 -+  typedef int*			__c_locale;
 178.368 -+#endif
 178.369 -+
 178.370 -+  // Convert numeric value of type _Tv to string and return length of
 178.371 -+  // string.  If snprintf is available use it, otherwise fall back to
 178.372 -+  // the unsafe sprintf which, in general, can be dangerous and should
 178.373 -+  // be avoided.
 178.374 -+  template<typename _Tv>
 178.375 -+    int
 178.376 -+    __convert_from_v(char* __out, 
 178.377 -+		     const int __size __attribute__ ((__unused__)),
 178.378 -+		     const char* __fmt,
 178.379 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.380 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 178.381 -+    {
 178.382 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 178.383 -+#else
 178.384 -+		     _Tv __v, const __c_locale&, int __prec)
 178.385 -+    {
 178.386 -+# ifdef __UCLIBC_HAS_LOCALE__
 178.387 -+      char* __old = std::setlocale(LC_ALL, NULL);
 178.388 -+      char* __sav = new char[std::strlen(__old) + 1];
 178.389 -+      std::strcpy(__sav, __old);
 178.390 -+      std::setlocale(LC_ALL, "C");
 178.391 -+# endif
 178.392 -+#endif
 178.393 -+
 178.394 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 178.395 -+
 178.396 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.397 -+      __gnu_cxx::__uselocale(__old);
 178.398 -+#elif defined __UCLIBC_HAS_LOCALE__
 178.399 -+      std::setlocale(LC_ALL, __sav);
 178.400 -+      delete [] __sav;
 178.401 -+#endif
 178.402 -+      return __ret;
 178.403 -+    }
 178.404 -+}
 178.405 -+
 178.406 -+#endif
 178.407 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 178.408 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-03-04 23:31:57.000000000 +0100
 178.409 -@@ -0,0 +1,306 @@
 178.410 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 178.411 -+
 178.412 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 178.413 -+//
 178.414 -+// This file is part of the GNU ISO C++ Library.  This library is free
 178.415 -+// software; you can redistribute it and/or modify it under the
 178.416 -+// terms of the GNU General Public License as published by the
 178.417 -+// Free Software Foundation; either version 2, or (at your option)
 178.418 -+// any later version.
 178.419 -+
 178.420 -+// This library is distributed in the hope that it will be useful,
 178.421 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 178.422 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 178.423 -+// GNU General Public License for more details.
 178.424 -+
 178.425 -+// You should have received a copy of the GNU General Public License along
 178.426 -+// with this library; see the file COPYING.  If not, write to the Free
 178.427 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 178.428 -+// USA.
 178.429 -+
 178.430 -+// As a special exception, you may use this file as part of a free software
 178.431 -+// library without restriction.  Specifically, if other files instantiate
 178.432 -+// templates or use macros or inline functions from this file, or you compile
 178.433 -+// this file and link it with other files to produce an executable, this
 178.434 -+// file does not by itself cause the resulting executable to be covered by
 178.435 -+// the GNU General Public License.  This exception does not however
 178.436 -+// invalidate any other reasons why the executable file might be covered by
 178.437 -+// the GNU General Public License.
 178.438 -+
 178.439 -+//
 178.440 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 178.441 -+//
 178.442 -+
 178.443 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 178.444 -+
 178.445 -+#include <locale>
 178.446 -+#include <bits/c++locale_internal.h>
 178.447 -+
 178.448 -+namespace std
 178.449 -+{
 178.450 -+  // Specializations.
 178.451 -+#ifdef _GLIBCXX_USE_WCHAR_T
 178.452 -+  codecvt_base::result
 178.453 -+  codecvt<wchar_t, char, mbstate_t>::
 178.454 -+  do_out(state_type& __state, const intern_type* __from, 
 178.455 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 178.456 -+	 extern_type* __to, extern_type* __to_end,
 178.457 -+	 extern_type*& __to_next) const
 178.458 -+  {
 178.459 -+    result __ret = ok;
 178.460 -+    state_type __tmp_state(__state);
 178.461 -+
 178.462 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.463 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 178.464 -+#endif
 178.465 -+
 178.466 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 178.467 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 178.468 -+    // NB: wcsnrtombs is a GNU extension
 178.469 -+    for (__from_next = __from, __to_next = __to;
 178.470 -+	 __from_next < __from_end && __to_next < __to_end
 178.471 -+	 && __ret == ok;)
 178.472 -+      {
 178.473 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 178.474 -+						      __from_end - __from_next);
 178.475 -+	if (!__from_chunk_end)
 178.476 -+	  __from_chunk_end = __from_end;
 178.477 -+
 178.478 -+	__from = __from_next;
 178.479 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 178.480 -+					 __from_chunk_end - __from_next,
 178.481 -+					 __to_end - __to_next, &__state);
 178.482 -+	if (__conv == static_cast<size_t>(-1))
 178.483 -+	  {
 178.484 -+	    // In case of error, in order to stop at the exact place we
 178.485 -+	    // have to start again from the beginning with a series of
 178.486 -+	    // wcrtomb.
 178.487 -+	    for (; __from < __from_next; ++__from)
 178.488 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 178.489 -+	    __state = __tmp_state;
 178.490 -+	    __ret = error;
 178.491 -+	  }
 178.492 -+	else if (__from_next && __from_next < __from_chunk_end)
 178.493 -+	  {
 178.494 -+	    __to_next += __conv;
 178.495 -+	    __ret = partial;
 178.496 -+	  }
 178.497 -+	else
 178.498 -+	  {
 178.499 -+	    __from_next = __from_chunk_end;
 178.500 -+	    __to_next += __conv;
 178.501 -+	  }
 178.502 -+
 178.503 -+	if (__from_next < __from_end && __ret == ok)
 178.504 -+	  {
 178.505 -+	    extern_type __buf[MB_LEN_MAX];
 178.506 -+	    __tmp_state = __state;
 178.507 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 178.508 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 178.509 -+	      __ret = partial;
 178.510 -+	    else
 178.511 -+	      {
 178.512 -+		memcpy(__to_next, __buf, __conv);
 178.513 -+		__state = __tmp_state;
 178.514 -+		__to_next += __conv;
 178.515 -+		++__from_next;
 178.516 -+	      }
 178.517 -+	  }
 178.518 -+      }
 178.519 -+
 178.520 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.521 -+    __uselocale(__old);
 178.522 -+#endif
 178.523 -+
 178.524 -+    return __ret; 
 178.525 -+  }
 178.526 -+  
 178.527 -+  codecvt_base::result
 178.528 -+  codecvt<wchar_t, char, mbstate_t>::
 178.529 -+  do_in(state_type& __state, const extern_type* __from, 
 178.530 -+	const extern_type* __from_end, const extern_type*& __from_next,
 178.531 -+	intern_type* __to, intern_type* __to_end,
 178.532 -+	intern_type*& __to_next) const
 178.533 -+  {
 178.534 -+    result __ret = ok;
 178.535 -+    state_type __tmp_state(__state);
 178.536 -+
 178.537 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.538 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 178.539 -+#endif
 178.540 -+
 178.541 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 178.542 -+    // in case we store a L'\0' and then continue, in a loop.
 178.543 -+    // NB: mbsnrtowcs is a GNU extension
 178.544 -+    for (__from_next = __from, __to_next = __to;
 178.545 -+	 __from_next < __from_end && __to_next < __to_end
 178.546 -+	 && __ret == ok;)
 178.547 -+      {
 178.548 -+	const extern_type* __from_chunk_end;
 178.549 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 178.550 -+								  __from_end
 178.551 -+								  - __from_next));
 178.552 -+	if (!__from_chunk_end)
 178.553 -+	  __from_chunk_end = __from_end;
 178.554 -+
 178.555 -+	__from = __from_next;
 178.556 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 178.557 -+				   __from_chunk_end - __from_next,
 178.558 -+				   __to_end - __to_next, &__state);
 178.559 -+	if (__conv == static_cast<size_t>(-1))
 178.560 -+	  {
 178.561 -+	    // In case of error, in order to stop at the exact place we
 178.562 -+	    // have to start again from the beginning with a series of
 178.563 -+	    // mbrtowc.
 178.564 -+	    for (;; ++__to_next, __from += __conv)
 178.565 -+	      {
 178.566 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 178.567 -+				 &__tmp_state);
 178.568 -+		if (__conv == static_cast<size_t>(-1)
 178.569 -+		    || __conv == static_cast<size_t>(-2))
 178.570 -+		  break;
 178.571 -+	      }
 178.572 -+	    __from_next = __from;
 178.573 -+	    __state = __tmp_state;	    
 178.574 -+	    __ret = error;
 178.575 -+	  }
 178.576 -+	else if (__from_next && __from_next < __from_chunk_end)
 178.577 -+	  {
 178.578 -+	    // It is unclear what to return in this case (see DR 382). 
 178.579 -+	    __to_next += __conv;
 178.580 -+	    __ret = partial;
 178.581 -+	  }
 178.582 -+	else
 178.583 -+	  {
 178.584 -+	    __from_next = __from_chunk_end;
 178.585 -+	    __to_next += __conv;
 178.586 -+	  }
 178.587 -+
 178.588 -+	if (__from_next < __from_end && __ret == ok)
 178.589 -+	  {
 178.590 -+	    if (__to_next < __to_end)
 178.591 -+	      {
 178.592 -+		// XXX Probably wrong for stateful encodings
 178.593 -+		__tmp_state = __state;		
 178.594 -+		++__from_next;
 178.595 -+		*__to_next++ = L'\0';
 178.596 -+	      }
 178.597 -+	    else
 178.598 -+	      __ret = partial;
 178.599 -+	  }
 178.600 -+      }
 178.601 -+
 178.602 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.603 -+    __uselocale(__old);
 178.604 -+#endif
 178.605 -+
 178.606 -+    return __ret; 
 178.607 -+  }
 178.608 -+
 178.609 -+  int 
 178.610 -+  codecvt<wchar_t, char, mbstate_t>::
 178.611 -+  do_encoding() const throw()
 178.612 -+  {
 178.613 -+    // XXX This implementation assumes that the encoding is
 178.614 -+    // stateless and is either single-byte or variable-width.
 178.615 -+    int __ret = 0;
 178.616 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.617 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 178.618 -+#endif
 178.619 -+    if (MB_CUR_MAX == 1)
 178.620 -+      __ret = 1;
 178.621 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.622 -+    __uselocale(__old);
 178.623 -+#endif
 178.624 -+    return __ret;
 178.625 -+  }  
 178.626 -+
 178.627 -+  int 
 178.628 -+  codecvt<wchar_t, char, mbstate_t>::
 178.629 -+  do_max_length() const throw()
 178.630 -+  {
 178.631 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.632 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 178.633 -+#endif
 178.634 -+    // XXX Probably wrong for stateful encodings.
 178.635 -+    int __ret = MB_CUR_MAX;
 178.636 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.637 -+    __uselocale(__old);
 178.638 -+#endif
 178.639 -+    return __ret;
 178.640 -+  }
 178.641 -+  
 178.642 -+  int 
 178.643 -+  codecvt<wchar_t, char, mbstate_t>::
 178.644 -+  do_length(state_type& __state, const extern_type* __from,
 178.645 -+	    const extern_type* __end, size_t __max) const
 178.646 -+  {
 178.647 -+    int __ret = 0;
 178.648 -+    state_type __tmp_state(__state);
 178.649 -+
 178.650 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.651 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 178.652 -+#endif
 178.653 -+
 178.654 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 178.655 -+    // in case we advance past it and then continue, in a loop.
 178.656 -+    // NB: mbsnrtowcs is a GNU extension
 178.657 -+  
 178.658 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 178.659 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 178.660 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 178.661 -+							   * __max));
 178.662 -+    while (__from < __end && __max)
 178.663 -+      {
 178.664 -+	const extern_type* __from_chunk_end;
 178.665 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 178.666 -+								  __end
 178.667 -+								  - __from));
 178.668 -+	if (!__from_chunk_end)
 178.669 -+	  __from_chunk_end = __end;
 178.670 -+
 178.671 -+	const extern_type* __tmp_from = __from;
 178.672 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 178.673 -+				   __from_chunk_end - __from,
 178.674 -+				   __max, &__state);
 178.675 -+	if (__conv == static_cast<size_t>(-1))
 178.676 -+	  {
 178.677 -+	    // In case of error, in order to stop at the exact place we
 178.678 -+	    // have to start again from the beginning with a series of
 178.679 -+	    // mbrtowc.
 178.680 -+	    for (__from = __tmp_from;; __from += __conv)
 178.681 -+	      {
 178.682 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 178.683 -+				 &__tmp_state);
 178.684 -+		if (__conv == static_cast<size_t>(-1)
 178.685 -+		    || __conv == static_cast<size_t>(-2))
 178.686 -+		  break;
 178.687 -+	      }
 178.688 -+	    __state = __tmp_state;
 178.689 -+	    __ret += __from - __tmp_from;
 178.690 -+	    break;
 178.691 -+	  }
 178.692 -+	if (!__from)
 178.693 -+	  __from = __from_chunk_end;
 178.694 -+	
 178.695 -+	__ret += __from - __tmp_from;
 178.696 -+	__max -= __conv;
 178.697 -+
 178.698 -+	if (__from < __end && __max)
 178.699 -+	  {
 178.700 -+	    // XXX Probably wrong for stateful encodings
 178.701 -+	    __tmp_state = __state;
 178.702 -+	    ++__from;
 178.703 -+	    ++__ret;
 178.704 -+	    --__max;
 178.705 -+	  }
 178.706 -+      }
 178.707 -+
 178.708 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.709 -+    __uselocale(__old);
 178.710 -+#endif
 178.711 -+
 178.712 -+    return __ret; 
 178.713 -+  }
 178.714 -+#endif
 178.715 -+}
 178.716 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 178.717 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-03-04 23:31:57.000000000 +0100
 178.718 -@@ -0,0 +1,80 @@
 178.719 -+// std::collate implementation details, GNU version -*- C++ -*-
 178.720 -+
 178.721 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 178.722 -+//
 178.723 -+// This file is part of the GNU ISO C++ Library.  This library is free
 178.724 -+// software; you can redistribute it and/or modify it under the
 178.725 -+// terms of the GNU General Public License as published by the
 178.726 -+// Free Software Foundation; either version 2, or (at your option)
 178.727 -+// any later version.
 178.728 -+
 178.729 -+// This library is distributed in the hope that it will be useful,
 178.730 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 178.731 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 178.732 -+// GNU General Public License for more details.
 178.733 -+
 178.734 -+// You should have received a copy of the GNU General Public License along
 178.735 -+// with this library; see the file COPYING.  If not, write to the Free
 178.736 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 178.737 -+// USA.
 178.738 -+
 178.739 -+// As a special exception, you may use this file as part of a free software
 178.740 -+// library without restriction.  Specifically, if other files instantiate
 178.741 -+// templates or use macros or inline functions from this file, or you compile
 178.742 -+// this file and link it with other files to produce an executable, this
 178.743 -+// file does not by itself cause the resulting executable to be covered by
 178.744 -+// the GNU General Public License.  This exception does not however
 178.745 -+// invalidate any other reasons why the executable file might be covered by
 178.746 -+// the GNU General Public License.
 178.747 -+
 178.748 -+//
 178.749 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 178.750 -+//
 178.751 -+
 178.752 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 178.753 -+
 178.754 -+#include <locale>
 178.755 -+#include <bits/c++locale_internal.h>
 178.756 -+
 178.757 -+#ifndef __UCLIBC_HAS_XLOCALE__
 178.758 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 178.759 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 178.760 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 178.761 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 178.762 -+#endif
 178.763 -+
 178.764 -+namespace std
 178.765 -+{
 178.766 -+  // These are basically extensions to char_traits, and perhaps should
 178.767 -+  // be put there instead of here.
 178.768 -+  template<>
 178.769 -+    int 
 178.770 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 178.771 -+    { 
 178.772 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 178.773 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 178.774 -+    }
 178.775 -+  
 178.776 -+  template<>
 178.777 -+    size_t
 178.778 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 178.779 -+				size_t __n) const 
 178.780 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 178.781 -+
 178.782 -+#ifdef _GLIBCXX_USE_WCHAR_T
 178.783 -+  template<>
 178.784 -+    int 
 178.785 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 178.786 -+				 const wchar_t* __two) const
 178.787 -+    {
 178.788 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 178.789 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 178.790 -+    }
 178.791 -+  
 178.792 -+  template<>
 178.793 -+    size_t
 178.794 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 178.795 -+				   size_t __n) const
 178.796 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 178.797 -+#endif
 178.798 -+}
 178.799 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 178.800 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-03-04 23:31:57.000000000 +0100
 178.801 -@@ -0,0 +1,314 @@
 178.802 -+// std::ctype implementation details, GNU version -*- C++ -*-
 178.803 -+
 178.804 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 178.805 -+//
 178.806 -+// This file is part of the GNU ISO C++ Library.  This library is free
 178.807 -+// software; you can redistribute it and/or modify it under the
 178.808 -+// terms of the GNU General Public License as published by the
 178.809 -+// Free Software Foundation; either version 2, or (at your option)
 178.810 -+// any later version.
 178.811 -+
 178.812 -+// This library is distributed in the hope that it will be useful,
 178.813 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 178.814 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 178.815 -+// GNU General Public License for more details.
 178.816 -+
 178.817 -+// You should have received a copy of the GNU General Public License along
 178.818 -+// with this library; see the file COPYING.  If not, write to the Free
 178.819 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 178.820 -+// USA.
 178.821 -+
 178.822 -+// As a special exception, you may use this file as part of a free software
 178.823 -+// library without restriction.  Specifically, if other files instantiate
 178.824 -+// templates or use macros or inline functions from this file, or you compile
 178.825 -+// this file and link it with other files to produce an executable, this
 178.826 -+// file does not by itself cause the resulting executable to be covered by
 178.827 -+// the GNU General Public License.  This exception does not however
 178.828 -+// invalidate any other reasons why the executable file might be covered by
 178.829 -+// the GNU General Public License.
 178.830 -+
 178.831 -+//
 178.832 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 178.833 -+//
 178.834 -+
 178.835 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 178.836 -+
 178.837 -+#define _LIBC
 178.838 -+#include <locale>
 178.839 -+#undef _LIBC
 178.840 -+#include <bits/c++locale_internal.h>
 178.841 -+
 178.842 -+#ifndef __UCLIBC_HAS_XLOCALE__
 178.843 -+#define __wctype_l(S, L)           wctype((S))
 178.844 -+#define __towupper_l(C, L)         towupper((C))
 178.845 -+#define __towlower_l(C, L)         towlower((C))
 178.846 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 178.847 -+#endif
 178.848 -+
 178.849 -+namespace std
 178.850 -+{
 178.851 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 178.852 -+  // various /config/os/* files.
 178.853 -+  template<>
 178.854 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 178.855 -+    : ctype<char>(0, false, __refs) 
 178.856 -+    { 		
 178.857 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 178.858 -+	{
 178.859 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 178.860 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 178.861 -+#ifdef __UCLIBC_HAS_XLOCALE__
 178.862 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 178.863 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 178.864 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 178.865 -+#endif
 178.866 -+	}
 178.867 -+    }
 178.868 -+
 178.869 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 178.870 -+  ctype<wchar_t>::__wmask_type
 178.871 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 178.872 -+  {
 178.873 -+    __wmask_type __ret;
 178.874 -+    switch (__m)
 178.875 -+      {
 178.876 -+      case space:
 178.877 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 178.878 -+	break;
 178.879 -+      case print:
 178.880 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 178.881 -+	break;
 178.882 -+      case cntrl:
 178.883 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 178.884 -+	break;
 178.885 -+      case upper:
 178.886 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 178.887 -+	break;
 178.888 -+      case lower:
 178.889 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 178.890 -+	break;
 178.891 -+      case alpha:
 178.892 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 178.893 -+	break;
 178.894 -+      case digit:
 178.895 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 178.896 -+	break;
 178.897 -+      case punct:
 178.898 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 178.899 -+	break;
 178.900 -+      case xdigit:
 178.901 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 178.902 -+	break;
 178.903 -+      case alnum:
 178.904 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 178.905 -+	break;
 178.906 -+      case graph:
 178.907 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 178.908 -+	break;
 178.909 -+      default:
 178.910 -+	__ret = __wmask_type();
 178.911 -+      }
 178.912 -+    return __ret;
 178.913 -+  }
 178.914 -+  
 178.915 -+  wchar_t
 178.916 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 178.917 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 178.918 -+
 178.919 -+  const wchar_t*
 178.920 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 178.921 -+  {
 178.922 -+    while (__lo < __hi)
 178.923 -+      {
 178.924 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 178.925 -+        ++__lo;
 178.926 -+      }
 178.927 -+    return __hi;
 178.928 -+  }
 178.929 -+  
 178.930 -+  wchar_t
 178.931 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 178.932 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 178.933 -+  
 178.934 -+  const wchar_t*
 178.935 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 178.936 -+  {
 178.937 -+    while (__lo < __hi)
 178.938 -+      {
 178.939 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 178.940 -+        ++__lo;
 178.941 -+      }
 178.942 -+    return __hi;
 178.943 -+  }
 178.944 -+
 178.945 -+  bool
 178.946 -+  ctype<wchar_t>::
 178.947 -+  do_is(mask __m, wchar_t __c) const
 178.948 -+  { 
 178.949 -+    // The case of __m == ctype_base::space is particularly important,
 178.950 -+    // due to its use in many istream functions.  Therefore we deal with
 178.951 -+    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 178.952 -+    // is the mask corresponding to ctype_base::space.  NB: an encoding
 178.953 -+    // change would not affect correctness!
 178.954 -+    bool __ret = false;
 178.955 -+    if (__m == _M_bit[5])
 178.956 -+      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 178.957 -+    else
 178.958 -+      {
 178.959 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 178.960 -+	// library for blank.
 178.961 -+	const size_t __bitmasksize = 11;
 178.962 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 178.963 -+	  if (__m & _M_bit[__bitcur])
 178.964 -+	    {
 178.965 -+	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 178.966 -+		{
 178.967 -+		  __ret = true;
 178.968 -+		  break;
 178.969 -+		}
 178.970 -+	      else if (__m == _M_bit[__bitcur])
 178.971 -+		break;
 178.972 -+	    }
 178.973 -+      }
 178.974 -+    return __ret;    
 178.975 -+  }
 178.976 -+
 178.977 -+  const wchar_t* 
 178.978 -+  ctype<wchar_t>::
 178.979 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 178.980 -+  {
 178.981 -+    for (; __lo < __hi; ++__vec, ++__lo)
 178.982 -+      {
 178.983 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 178.984 -+	// library for blank.
 178.985 -+	const size_t __bitmasksize = 11; 
 178.986 -+	mask __m = 0;
 178.987 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 178.988 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 178.989 -+	    __m |= _M_bit[__bitcur];
 178.990 -+	*__vec = __m;
 178.991 -+      }
 178.992 -+    return __hi;
 178.993 -+  }
 178.994 -+  
 178.995 -+  const wchar_t* 
 178.996 -+  ctype<wchar_t>::
 178.997 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 178.998 -+  {
 178.999 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
178.1000 -+      ++__lo;
178.1001 -+    return __lo;
178.1002 -+  }
178.1003 -+
178.1004 -+  const wchar_t*
178.1005 -+  ctype<wchar_t>::
178.1006 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
178.1007 -+  {
178.1008 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
178.1009 -+      ++__lo;
178.1010 -+    return __lo;
178.1011 -+  }
178.1012 -+
178.1013 -+  wchar_t
178.1014 -+  ctype<wchar_t>::
178.1015 -+  do_widen(char __c) const
178.1016 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
178.1017 -+
178.1018 -+  const char* 
178.1019 -+  ctype<wchar_t>::
178.1020 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
178.1021 -+  {
178.1022 -+    while (__lo < __hi)
178.1023 -+      {
178.1024 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
178.1025 -+	++__lo;
178.1026 -+	++__dest;
178.1027 -+      }
178.1028 -+    return __hi;
178.1029 -+  }
178.1030 -+
178.1031 -+  char
178.1032 -+  ctype<wchar_t>::
178.1033 -+  do_narrow(wchar_t __wc, char __dfault) const
178.1034 -+  {
178.1035 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
178.1036 -+      return _M_narrow[__wc];
178.1037 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1038 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
178.1039 -+#endif
178.1040 -+    const int __c = wctob(__wc);
178.1041 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1042 -+    __uselocale(__old);
178.1043 -+#endif
178.1044 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
178.1045 -+  }
178.1046 -+
178.1047 -+  const wchar_t*
178.1048 -+  ctype<wchar_t>::
178.1049 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
178.1050 -+	    char* __dest) const
178.1051 -+  {
178.1052 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1053 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
178.1054 -+#endif
178.1055 -+    if (_M_narrow_ok)
178.1056 -+      while (__lo < __hi)
178.1057 -+	{
178.1058 -+	  if (*__lo >= 0 && *__lo < 128)
178.1059 -+	    *__dest = _M_narrow[*__lo];
178.1060 -+	  else
178.1061 -+	    {
178.1062 -+	      const int __c = wctob(*__lo);
178.1063 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
178.1064 -+	    }
178.1065 -+	  ++__lo;
178.1066 -+	  ++__dest;
178.1067 -+	}
178.1068 -+    else
178.1069 -+      while (__lo < __hi)
178.1070 -+	{
178.1071 -+	  const int __c = wctob(*__lo);
178.1072 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
178.1073 -+	  ++__lo;
178.1074 -+	  ++__dest;
178.1075 -+	}
178.1076 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1077 -+    __uselocale(__old);
178.1078 -+#endif
178.1079 -+    return __hi;
178.1080 -+  }
178.1081 -+
178.1082 -+  void
178.1083 -+  ctype<wchar_t>::_M_initialize_ctype()
178.1084 -+  {
178.1085 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1086 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
178.1087 -+#endif
178.1088 -+    wint_t __i;
178.1089 -+    for (__i = 0; __i < 128; ++__i)
178.1090 -+      {
178.1091 -+	const int __c = wctob(__i);
178.1092 -+	if (__c == EOF)
178.1093 -+	  break;
178.1094 -+	else
178.1095 -+	  _M_narrow[__i] = static_cast<char>(__c);
178.1096 -+      }
178.1097 -+    if (__i == 128)
178.1098 -+      _M_narrow_ok = true;
178.1099 -+    else
178.1100 -+      _M_narrow_ok = false;
178.1101 -+    for (size_t __j = 0;
178.1102 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
178.1103 -+      _M_widen[__j] = btowc(__j);
178.1104 -+
178.1105 -+    for (size_t __k = 0; __k <= 11; ++__k)
178.1106 -+      { 
178.1107 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
178.1108 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
178.1109 -+      }
178.1110 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1111 -+    __uselocale(__old);
178.1112 -+#endif
178.1113 -+  }
178.1114 -+#endif //  _GLIBCXX_USE_WCHAR_T
178.1115 -+}
178.1116 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
178.1117 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-03-04 23:31:57.000000000 +0100
178.1118 -@@ -0,0 +1,100 @@
178.1119 -+// std::messages implementation details, GNU version -*- C++ -*-
178.1120 -+
178.1121 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
178.1122 -+//
178.1123 -+// This file is part of the GNU ISO C++ Library.  This library is free
178.1124 -+// software; you can redistribute it and/or modify it under the
178.1125 -+// terms of the GNU General Public License as published by the
178.1126 -+// Free Software Foundation; either version 2, or (at your option)
178.1127 -+// any later version.
178.1128 -+
178.1129 -+// This library is distributed in the hope that it will be useful,
178.1130 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
178.1131 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
178.1132 -+// GNU General Public License for more details.
178.1133 -+
178.1134 -+// You should have received a copy of the GNU General Public License along
178.1135 -+// with this library; see the file COPYING.  If not, write to the Free
178.1136 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
178.1137 -+// USA.
178.1138 -+
178.1139 -+// As a special exception, you may use this file as part of a free software
178.1140 -+// library without restriction.  Specifically, if other files instantiate
178.1141 -+// templates or use macros or inline functions from this file, or you compile
178.1142 -+// this file and link it with other files to produce an executable, this
178.1143 -+// file does not by itself cause the resulting executable to be covered by
178.1144 -+// the GNU General Public License.  This exception does not however
178.1145 -+// invalidate any other reasons why the executable file might be covered by
178.1146 -+// the GNU General Public License.
178.1147 -+
178.1148 -+//
178.1149 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
178.1150 -+//
178.1151 -+
178.1152 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
178.1153 -+
178.1154 -+#include <locale>
178.1155 -+#include <bits/c++locale_internal.h>
178.1156 -+
178.1157 -+#ifdef __UCLIBC_MJN3_ONLY__
178.1158 -+#warning fix gettext stuff
178.1159 -+#endif
178.1160 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
178.1161 -+extern "C" char *__dcgettext(const char *domainname,
178.1162 -+			     const char *msgid, int category);
178.1163 -+#undef gettext
178.1164 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
178.1165 -+#else
178.1166 -+#undef gettext
178.1167 -+#define gettext(msgid) (msgid)
178.1168 -+#endif
178.1169 -+
178.1170 -+namespace std
178.1171 -+{
178.1172 -+  // Specializations.
178.1173 -+  template<>
178.1174 -+    string
178.1175 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
178.1176 -+    {
178.1177 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1178 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
178.1179 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
178.1180 -+      __uselocale(__old);
178.1181 -+      return string(__msg);
178.1182 -+#elif defined __UCLIBC_HAS_LOCALE__
178.1183 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
178.1184 -+      setlocale(LC_ALL, _M_name_messages);
178.1185 -+      const char* __msg = gettext(__dfault.c_str());
178.1186 -+      setlocale(LC_ALL, __old);
178.1187 -+      free(__old);
178.1188 -+      return string(__msg);
178.1189 -+#else
178.1190 -+      const char* __msg = gettext(__dfault.c_str());
178.1191 -+      return string(__msg);
178.1192 -+#endif
178.1193 -+    }
178.1194 -+
178.1195 -+#ifdef _GLIBCXX_USE_WCHAR_T
178.1196 -+  template<>
178.1197 -+    wstring
178.1198 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
178.1199 -+    {
178.1200 -+# ifdef __UCLIBC_HAS_XLOCALE__
178.1201 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
178.1202 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
178.1203 -+      __uselocale(__old);
178.1204 -+      return _M_convert_from_char(__msg);
178.1205 -+# elif defined __UCLIBC_HAS_LOCALE__
178.1206 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
178.1207 -+      setlocale(LC_ALL, _M_name_messages);
178.1208 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
178.1209 -+      setlocale(LC_ALL, __old);
178.1210 -+      free(__old);
178.1211 -+      return _M_convert_from_char(__msg);
178.1212 -+# else
178.1213 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
178.1214 -+      return _M_convert_from_char(__msg);
178.1215 -+# endif
178.1216 -+    }
178.1217 -+#endif
178.1218 -+}
178.1219 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
178.1220 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-03-04 23:31:57.000000000 +0100
178.1221 -@@ -0,0 +1,121 @@
178.1222 -+// std::messages implementation details, GNU version -*- C++ -*-
178.1223 -+
178.1224 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
178.1225 -+//
178.1226 -+// This file is part of the GNU ISO C++ Library.  This library is free
178.1227 -+// software; you can redistribute it and/or modify it under the
178.1228 -+// terms of the GNU General Public License as published by the
178.1229 -+// Free Software Foundation; either version 2, or (at your option)
178.1230 -+// any later version.
178.1231 -+
178.1232 -+// This library is distributed in the hope that it will be useful,
178.1233 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
178.1234 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
178.1235 -+// GNU General Public License for more details.
178.1236 -+
178.1237 -+// You should have received a copy of the GNU General Public License along
178.1238 -+// with this library; see the file COPYING.  If not, write to the Free
178.1239 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
178.1240 -+// USA.
178.1241 -+
178.1242 -+// As a special exception, you may use this file as part of a free software
178.1243 -+// library without restriction.  Specifically, if other files instantiate
178.1244 -+// templates or use macros or inline functions from this file, or you compile
178.1245 -+// this file and link it with other files to produce an executable, this
178.1246 -+// file does not by itself cause the resulting executable to be covered by
178.1247 -+// the GNU General Public License.  This exception does not however
178.1248 -+// invalidate any other reasons why the executable file might be covered by
178.1249 -+// the GNU General Public License.
178.1250 -+
178.1251 -+//
178.1252 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
178.1253 -+//
178.1254 -+
178.1255 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
178.1256 -+
178.1257 -+#ifdef __UCLIBC_MJN3_ONLY__
178.1258 -+#warning fix prototypes for *textdomain funcs
178.1259 -+#endif
178.1260 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
178.1261 -+extern "C" char *__textdomain(const char *domainname);
178.1262 -+extern "C" char *__bindtextdomain(const char *domainname,
178.1263 -+				  const char *dirname);
178.1264 -+#else
178.1265 -+#undef __textdomain
178.1266 -+#undef __bindtextdomain
178.1267 -+#define __textdomain(D)           ((void)0)
178.1268 -+#define __bindtextdomain(D,P)     ((void)0)
178.1269 -+#endif
178.1270 -+
178.1271 -+  // Non-virtual member functions.
178.1272 -+  template<typename _CharT>
178.1273 -+     messages<_CharT>::messages(size_t __refs)
178.1274 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
178.1275 -+       _M_name_messages(_S_get_c_name())
178.1276 -+     { }
178.1277 -+
178.1278 -+  template<typename _CharT>
178.1279 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
178.1280 -+				size_t __refs) 
178.1281 -+     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
178.1282 -+     {
178.1283 -+       const size_t __len = std::strlen(__s) + 1;
178.1284 -+       char* __tmp = new char[__len];
178.1285 -+       std::memcpy(__tmp, __s, __len);
178.1286 -+       _M_name_messages = __tmp;
178.1287 -+
178.1288 -+       // Last to avoid leaking memory if new throws.
178.1289 -+       _M_c_locale_messages = _S_clone_c_locale(__cloc);
178.1290 -+     }
178.1291 -+
178.1292 -+  template<typename _CharT>
178.1293 -+    typename messages<_CharT>::catalog 
178.1294 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
178.1295 -+			   const char* __dir) const
178.1296 -+    { 
178.1297 -+      __bindtextdomain(__s.c_str(), __dir);
178.1298 -+      return this->do_open(__s, __loc); 
178.1299 -+    }
178.1300 -+
178.1301 -+  // Virtual member functions.
178.1302 -+  template<typename _CharT>
178.1303 -+    messages<_CharT>::~messages()
178.1304 -+    { 
178.1305 -+      if (_M_name_messages != _S_get_c_name())
178.1306 -+	delete [] _M_name_messages;
178.1307 -+      _S_destroy_c_locale(_M_c_locale_messages); 
178.1308 -+    }
178.1309 -+
178.1310 -+  template<typename _CharT>
178.1311 -+    typename messages<_CharT>::catalog 
178.1312 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
178.1313 -+			      const locale&) const
178.1314 -+    { 
178.1315 -+      // No error checking is done, assume the catalog exists and can
178.1316 -+      // be used.
178.1317 -+      __textdomain(__s.c_str());
178.1318 -+      return 0;
178.1319 -+    }
178.1320 -+
178.1321 -+  template<typename _CharT>
178.1322 -+    void    
178.1323 -+    messages<_CharT>::do_close(catalog) const 
178.1324 -+    { }
178.1325 -+
178.1326 -+   // messages_byname
178.1327 -+   template<typename _CharT>
178.1328 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
178.1329 -+     : messages<_CharT>(__refs) 
178.1330 -+     { 
178.1331 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
178.1332 -+	 delete [] this->_M_name_messages;
178.1333 -+       char* __tmp = new char[std::strlen(__s) + 1];
178.1334 -+       std::strcpy(__tmp, __s);
178.1335 -+       this->_M_name_messages = __tmp;
178.1336 -+
178.1337 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
178.1338 -+	 {
178.1339 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
178.1340 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
178.1341 -+	 }
178.1342 -+     }
178.1343 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
178.1344 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-03-04 23:31:57.000000000 +0100
178.1345 -@@ -0,0 +1,692 @@
178.1346 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
178.1347 -+
178.1348 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
178.1349 -+//
178.1350 -+// This file is part of the GNU ISO C++ Library.  This library is free
178.1351 -+// software; you can redistribute it and/or modify it under the
178.1352 -+// terms of the GNU General Public License as published by the
178.1353 -+// Free Software Foundation; either version 2, or (at your option)
178.1354 -+// any later version.
178.1355 -+
178.1356 -+// This library is distributed in the hope that it will be useful,
178.1357 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
178.1358 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
178.1359 -+// GNU General Public License for more details.
178.1360 -+
178.1361 -+// You should have received a copy of the GNU General Public License along
178.1362 -+// with this library; see the file COPYING.  If not, write to the Free
178.1363 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
178.1364 -+// USA.
178.1365 -+
178.1366 -+// As a special exception, you may use this file as part of a free software
178.1367 -+// library without restriction.  Specifically, if other files instantiate
178.1368 -+// templates or use macros or inline functions from this file, or you compile
178.1369 -+// this file and link it with other files to produce an executable, this
178.1370 -+// file does not by itself cause the resulting executable to be covered by
178.1371 -+// the GNU General Public License.  This exception does not however
178.1372 -+// invalidate any other reasons why the executable file might be covered by
178.1373 -+// the GNU General Public License.
178.1374 -+
178.1375 -+//
178.1376 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
178.1377 -+//
178.1378 -+
178.1379 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
178.1380 -+
178.1381 -+#define _LIBC
178.1382 -+#include <locale>
178.1383 -+#undef _LIBC
178.1384 -+#include <bits/c++locale_internal.h>
178.1385 -+
178.1386 -+#ifdef __UCLIBC_MJN3_ONLY__
178.1387 -+#warning optimize this for uclibc
178.1388 -+#warning tailor for stub locale support
178.1389 -+#endif
178.1390 -+
178.1391 -+#ifndef __UCLIBC_HAS_XLOCALE__
178.1392 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
178.1393 -+#endif
178.1394 -+
178.1395 -+namespace std
178.1396 -+{
178.1397 -+  // Construct and return valid pattern consisting of some combination of:
178.1398 -+  // space none symbol sign value
178.1399 -+  money_base::pattern
178.1400 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
178.1401 -+  { 
178.1402 -+    pattern __ret;
178.1403 -+
178.1404 -+    // This insanely complicated routine attempts to construct a valid
178.1405 -+    // pattern for use with monyepunct. A couple of invariants:
178.1406 -+
178.1407 -+    // if (__precedes) symbol -> value
178.1408 -+    // else value -> symbol
178.1409 -+    
178.1410 -+    // if (__space) space
178.1411 -+    // else none
178.1412 -+
178.1413 -+    // none == never first
178.1414 -+    // space never first or last
178.1415 -+
178.1416 -+    // Any elegant implementations of this are welcome.
178.1417 -+    switch (__posn)
178.1418 -+      {
178.1419 -+      case 0:
178.1420 -+      case 1:
178.1421 -+	// 1 The sign precedes the value and symbol.
178.1422 -+	__ret.field[0] = sign;
178.1423 -+	if (__space)
178.1424 -+	  {
178.1425 -+	    // Pattern starts with sign.
178.1426 -+	    if (__precedes)
178.1427 -+	      {
178.1428 -+		__ret.field[1] = symbol;
178.1429 -+		__ret.field[3] = value;
178.1430 -+	      }
178.1431 -+	    else
178.1432 -+	      {
178.1433 -+		__ret.field[1] = value;
178.1434 -+		__ret.field[3] = symbol;
178.1435 -+	      }
178.1436 -+	    __ret.field[2] = space;
178.1437 -+	  }
178.1438 -+	else
178.1439 -+	  {
178.1440 -+	    // Pattern starts with sign and ends with none.
178.1441 -+	    if (__precedes)
178.1442 -+	      {
178.1443 -+		__ret.field[1] = symbol;
178.1444 -+		__ret.field[2] = value;
178.1445 -+	      }
178.1446 -+	    else
178.1447 -+	      {
178.1448 -+		__ret.field[1] = value;
178.1449 -+		__ret.field[2] = symbol;
178.1450 -+	      }
178.1451 -+	    __ret.field[3] = none;
178.1452 -+	  }
178.1453 -+	break;
178.1454 -+      case 2:
178.1455 -+	// 2 The sign follows the value and symbol.
178.1456 -+	if (__space)
178.1457 -+	  {
178.1458 -+	    // Pattern either ends with sign.
178.1459 -+	    if (__precedes)
178.1460 -+	      {
178.1461 -+		__ret.field[0] = symbol;
178.1462 -+		__ret.field[2] = value;
178.1463 -+	      }
178.1464 -+	    else
178.1465 -+	      {
178.1466 -+		__ret.field[0] = value;
178.1467 -+		__ret.field[2] = symbol;
178.1468 -+	      }
178.1469 -+	    __ret.field[1] = space;
178.1470 -+	    __ret.field[3] = sign;
178.1471 -+	  }
178.1472 -+	else
178.1473 -+	  {
178.1474 -+	    // Pattern ends with sign then none.
178.1475 -+	    if (__precedes)
178.1476 -+	      {
178.1477 -+		__ret.field[0] = symbol;
178.1478 -+		__ret.field[1] = value;
178.1479 -+	      }
178.1480 -+	    else
178.1481 -+	      {
178.1482 -+		__ret.field[0] = value;
178.1483 -+		__ret.field[1] = symbol;
178.1484 -+	      }
178.1485 -+	    __ret.field[2] = sign;
178.1486 -+	    __ret.field[3] = none;
178.1487 -+	  }
178.1488 -+	break;
178.1489 -+      case 3:
178.1490 -+	// 3 The sign immediately precedes the symbol.
178.1491 -+	if (__precedes)
178.1492 -+	  {
178.1493 -+	    __ret.field[0] = sign;
178.1494 -+	    __ret.field[1] = symbol;	    
178.1495 -+	    if (__space)
178.1496 -+	      {
178.1497 -+		__ret.field[2] = space;
178.1498 -+		__ret.field[3] = value;
178.1499 -+	      }
178.1500 -+	    else
178.1501 -+	      {
178.1502 -+		__ret.field[2] = value;		
178.1503 -+		__ret.field[3] = none;
178.1504 -+	      }
178.1505 -+	  }
178.1506 -+	else
178.1507 -+	  {
178.1508 -+	    __ret.field[0] = value;
178.1509 -+	    if (__space)
178.1510 -+	      {
178.1511 -+		__ret.field[1] = space;
178.1512 -+		__ret.field[2] = sign;
178.1513 -+		__ret.field[3] = symbol;
178.1514 -+	      }
178.1515 -+	    else
178.1516 -+	      {
178.1517 -+		__ret.field[1] = sign;
178.1518 -+		__ret.field[2] = symbol;
178.1519 -+		__ret.field[3] = none;
178.1520 -+	      }
178.1521 -+	  }
178.1522 -+	break;
178.1523 -+      case 4:
178.1524 -+	// 4 The sign immediately follows the symbol.
178.1525 -+	if (__precedes)
178.1526 -+	  {
178.1527 -+	    __ret.field[0] = symbol;
178.1528 -+	    __ret.field[1] = sign;
178.1529 -+	    if (__space)
178.1530 -+	      {
178.1531 -+		__ret.field[2] = space;
178.1532 -+		__ret.field[3] = value;
178.1533 -+	      }
178.1534 -+	    else
178.1535 -+	      {
178.1536 -+		__ret.field[2] = value;
178.1537 -+		__ret.field[3] = none;
178.1538 -+	      }
178.1539 -+	  }
178.1540 -+	else
178.1541 -+	  {
178.1542 -+	    __ret.field[0] = value;
178.1543 -+	    if (__space)
178.1544 -+	      {
178.1545 -+		__ret.field[1] = space;
178.1546 -+		__ret.field[2] = symbol;
178.1547 -+		__ret.field[3] = sign;
178.1548 -+	      }
178.1549 -+	    else
178.1550 -+	      {
178.1551 -+		__ret.field[1] = symbol;
178.1552 -+		__ret.field[2] = sign;
178.1553 -+		__ret.field[3] = none;
178.1554 -+	      }
178.1555 -+	  }
178.1556 -+	break;
178.1557 -+      default:
178.1558 -+	__ret = pattern();
178.1559 -+      }
178.1560 -+    return __ret;
178.1561 -+  }
178.1562 -+
178.1563 -+  template<> 
178.1564 -+    void
178.1565 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
178.1566 -+						     const char*)
178.1567 -+    {
178.1568 -+      if (!_M_data)
178.1569 -+	_M_data = new __moneypunct_cache<char, true>;
178.1570 -+
178.1571 -+      if (!__cloc)
178.1572 -+	{
178.1573 -+	  // "C" locale
178.1574 -+	  _M_data->_M_decimal_point = '.';
178.1575 -+	  _M_data->_M_thousands_sep = ',';
178.1576 -+	  _M_data->_M_grouping = "";
178.1577 -+	  _M_data->_M_grouping_size = 0;
178.1578 -+	  _M_data->_M_curr_symbol = "";
178.1579 -+	  _M_data->_M_curr_symbol_size = 0;
178.1580 -+	  _M_data->_M_positive_sign = "";
178.1581 -+	  _M_data->_M_positive_sign_size = 0;
178.1582 -+	  _M_data->_M_negative_sign = "";
178.1583 -+	  _M_data->_M_negative_sign_size = 0;
178.1584 -+	  _M_data->_M_frac_digits = 0;
178.1585 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
178.1586 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
178.1587 -+
178.1588 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
178.1589 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
178.1590 -+	}
178.1591 -+      else
178.1592 -+	{
178.1593 -+	  // Named locale.
178.1594 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
178.1595 -+							__cloc));
178.1596 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
178.1597 -+							__cloc));
178.1598 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
178.1599 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
178.1600 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
178.1601 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
178.1602 -+
178.1603 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
178.1604 -+	  if (!__nposn)
178.1605 -+	    _M_data->_M_negative_sign = "()";
178.1606 -+	  else
178.1607 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
178.1608 -+							__cloc);
178.1609 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
178.1610 -+
178.1611 -+	  // _Intl == true
178.1612 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
178.1613 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
178.1614 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
178.1615 -+						      __cloc));
178.1616 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
178.1617 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
178.1618 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
178.1619 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
178.1620 -+							__pposn);
178.1621 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
178.1622 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
178.1623 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
178.1624 -+							__nposn);
178.1625 -+	}
178.1626 -+    }
178.1627 -+
178.1628 -+  template<> 
178.1629 -+    void
178.1630 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
178.1631 -+						      const char*)
178.1632 -+    {
178.1633 -+      if (!_M_data)
178.1634 -+	_M_data = new __moneypunct_cache<char, false>;
178.1635 -+
178.1636 -+      if (!__cloc)
178.1637 -+	{
178.1638 -+	  // "C" locale
178.1639 -+	  _M_data->_M_decimal_point = '.';
178.1640 -+	  _M_data->_M_thousands_sep = ',';
178.1641 -+	  _M_data->_M_grouping = "";
178.1642 -+	  _M_data->_M_grouping_size = 0;
178.1643 -+	  _M_data->_M_curr_symbol = "";
178.1644 -+	  _M_data->_M_curr_symbol_size = 0;
178.1645 -+	  _M_data->_M_positive_sign = "";
178.1646 -+	  _M_data->_M_positive_sign_size = 0;
178.1647 -+	  _M_data->_M_negative_sign = "";
178.1648 -+	  _M_data->_M_negative_sign_size = 0;
178.1649 -+	  _M_data->_M_frac_digits = 0;
178.1650 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
178.1651 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
178.1652 -+
178.1653 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
178.1654 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
178.1655 -+	}
178.1656 -+      else
178.1657 -+	{
178.1658 -+	  // Named locale.
178.1659 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
178.1660 -+							__cloc));
178.1661 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
178.1662 -+							__cloc));
178.1663 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
178.1664 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
178.1665 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
178.1666 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
178.1667 -+
178.1668 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
178.1669 -+	  if (!__nposn)
178.1670 -+	    _M_data->_M_negative_sign = "()";
178.1671 -+	  else
178.1672 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
178.1673 -+							__cloc);
178.1674 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
178.1675 -+
178.1676 -+	  // _Intl == false
178.1677 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
178.1678 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
178.1679 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
178.1680 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
178.1681 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
178.1682 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
178.1683 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
178.1684 -+							__pposn);
178.1685 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
178.1686 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
178.1687 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
178.1688 -+							__nposn);
178.1689 -+	}
178.1690 -+    }
178.1691 -+
178.1692 -+  template<> 
178.1693 -+    moneypunct<char, true>::~moneypunct()
178.1694 -+    { delete _M_data; }
178.1695 -+
178.1696 -+  template<> 
178.1697 -+    moneypunct<char, false>::~moneypunct()
178.1698 -+    { delete _M_data; }
178.1699 -+
178.1700 -+#ifdef _GLIBCXX_USE_WCHAR_T
178.1701 -+  template<> 
178.1702 -+    void
178.1703 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
178.1704 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1705 -+							const char*)
178.1706 -+#else
178.1707 -+							const char* __name)
178.1708 -+#endif
178.1709 -+    {
178.1710 -+      if (!_M_data)
178.1711 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
178.1712 -+
178.1713 -+      if (!__cloc)
178.1714 -+	{
178.1715 -+	  // "C" locale
178.1716 -+	  _M_data->_M_decimal_point = L'.';
178.1717 -+	  _M_data->_M_thousands_sep = L',';
178.1718 -+	  _M_data->_M_grouping = "";
178.1719 -+	  _M_data->_M_grouping_size = 0;
178.1720 -+	  _M_data->_M_curr_symbol = L"";
178.1721 -+	  _M_data->_M_curr_symbol_size = 0;
178.1722 -+	  _M_data->_M_positive_sign = L"";
178.1723 -+	  _M_data->_M_positive_sign_size = 0;
178.1724 -+	  _M_data->_M_negative_sign = L"";
178.1725 -+	  _M_data->_M_negative_sign_size = 0;
178.1726 -+	  _M_data->_M_frac_digits = 0;
178.1727 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
178.1728 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
178.1729 -+
178.1730 -+	  // Use ctype::widen code without the facet...
178.1731 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
178.1732 -+	    _M_data->_M_atoms[__i] =
178.1733 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
178.1734 -+	}
178.1735 -+      else
178.1736 -+	{
178.1737 -+	  // Named locale.
178.1738 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1739 -+	  __c_locale __old = __uselocale(__cloc);
178.1740 -+#else
178.1741 -+	  // Switch to named locale so that mbsrtowcs will work.
178.1742 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
178.1743 -+	  setlocale(LC_ALL, __name);
178.1744 -+#endif
178.1745 -+
178.1746 -+#ifdef __UCLIBC_MJN3_ONLY__
178.1747 -+#warning fix this... should be monetary
178.1748 -+#endif
178.1749 -+#ifdef __UCLIBC__
178.1750 -+# ifdef __UCLIBC_HAS_XLOCALE__
178.1751 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
178.1752 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
178.1753 -+# elif defined __UCLIBC_HAS_LOCALE__
178.1754 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
178.1755 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
178.1756 -+# endif
178.1757 -+#else
178.1758 -+	  union { char *__s; wchar_t __w; } __u;
178.1759 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
178.1760 -+	  _M_data->_M_decimal_point = __u.__w;
178.1761 -+
178.1762 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
178.1763 -+	  _M_data->_M_thousands_sep = __u.__w;
178.1764 -+#endif
178.1765 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
178.1766 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
178.1767 -+
178.1768 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
178.1769 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
178.1770 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
178.1771 -+
178.1772 -+	  wchar_t* __wcs_ps = 0;
178.1773 -+	  wchar_t* __wcs_ns = 0;
178.1774 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
178.1775 -+	  try
178.1776 -+	    {
178.1777 -+	      mbstate_t __state;
178.1778 -+	      size_t __len = strlen(__cpossign);
178.1779 -+	      if (__len)
178.1780 -+		{
178.1781 -+		  ++__len;
178.1782 -+		  memset(&__state, 0, sizeof(mbstate_t));
178.1783 -+		  __wcs_ps = new wchar_t[__len];
178.1784 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
178.1785 -+		  _M_data->_M_positive_sign = __wcs_ps;
178.1786 -+		}
178.1787 -+	      else
178.1788 -+		_M_data->_M_positive_sign = L"";
178.1789 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
178.1790 -+	      
178.1791 -+	      __len = strlen(__cnegsign);
178.1792 -+	      if (!__nposn)
178.1793 -+		_M_data->_M_negative_sign = L"()";
178.1794 -+	      else if (__len)
178.1795 -+		{ 
178.1796 -+		  ++__len;
178.1797 -+		  memset(&__state, 0, sizeof(mbstate_t));
178.1798 -+		  __wcs_ns = new wchar_t[__len];
178.1799 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
178.1800 -+		  _M_data->_M_negative_sign = __wcs_ns;
178.1801 -+		}
178.1802 -+	      else
178.1803 -+		_M_data->_M_negative_sign = L"";
178.1804 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
178.1805 -+	      
178.1806 -+	      // _Intl == true.
178.1807 -+	      __len = strlen(__ccurr);
178.1808 -+	      if (__len)
178.1809 -+		{
178.1810 -+		  ++__len;
178.1811 -+		  memset(&__state, 0, sizeof(mbstate_t));
178.1812 -+		  wchar_t* __wcs = new wchar_t[__len];
178.1813 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
178.1814 -+		  _M_data->_M_curr_symbol = __wcs;
178.1815 -+		}
178.1816 -+	      else
178.1817 -+		_M_data->_M_curr_symbol = L"";
178.1818 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
178.1819 -+	    }
178.1820 -+	  catch (...)
178.1821 -+	    {
178.1822 -+	      delete _M_data;
178.1823 -+	      _M_data = 0;
178.1824 -+	      delete __wcs_ps;
178.1825 -+	      delete __wcs_ns;	      
178.1826 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1827 -+	      __uselocale(__old);
178.1828 -+#else
178.1829 -+	      setlocale(LC_ALL, __old);
178.1830 -+	      free(__old);
178.1831 -+#endif
178.1832 -+	      __throw_exception_again;
178.1833 -+	    } 
178.1834 -+	  
178.1835 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
178.1836 -+						      __cloc));
178.1837 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
178.1838 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
178.1839 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
178.1840 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
178.1841 -+							__pposn);
178.1842 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
178.1843 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
178.1844 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
178.1845 -+							__nposn);
178.1846 -+
178.1847 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1848 -+	  __uselocale(__old);
178.1849 -+#else
178.1850 -+	  setlocale(LC_ALL, __old);
178.1851 -+	  free(__old);
178.1852 -+#endif
178.1853 -+	}
178.1854 -+    }
178.1855 -+
178.1856 -+  template<> 
178.1857 -+  void
178.1858 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
178.1859 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1860 -+						       const char*)
178.1861 -+#else
178.1862 -+                                                       const char* __name)
178.1863 -+#endif
178.1864 -+  {
178.1865 -+    if (!_M_data)
178.1866 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
178.1867 -+
178.1868 -+    if (!__cloc)
178.1869 -+	{
178.1870 -+	  // "C" locale
178.1871 -+	  _M_data->_M_decimal_point = L'.';
178.1872 -+	  _M_data->_M_thousands_sep = L',';
178.1873 -+	  _M_data->_M_grouping = "";
178.1874 -+          _M_data->_M_grouping_size = 0;
178.1875 -+	  _M_data->_M_curr_symbol = L"";
178.1876 -+	  _M_data->_M_curr_symbol_size = 0;
178.1877 -+	  _M_data->_M_positive_sign = L"";
178.1878 -+	  _M_data->_M_positive_sign_size = 0;
178.1879 -+	  _M_data->_M_negative_sign = L"";
178.1880 -+	  _M_data->_M_negative_sign_size = 0;
178.1881 -+	  _M_data->_M_frac_digits = 0;
178.1882 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
178.1883 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
178.1884 -+
178.1885 -+	  // Use ctype::widen code without the facet...
178.1886 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
178.1887 -+	    _M_data->_M_atoms[__i] =
178.1888 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
178.1889 -+	}
178.1890 -+      else
178.1891 -+	{
178.1892 -+	  // Named locale.
178.1893 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1894 -+	  __c_locale __old = __uselocale(__cloc);
178.1895 -+#else
178.1896 -+	  // Switch to named locale so that mbsrtowcs will work.
178.1897 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
178.1898 -+	  setlocale(LC_ALL, __name);
178.1899 -+#endif
178.1900 -+
178.1901 -+#ifdef __UCLIBC_MJN3_ONLY__
178.1902 -+#warning fix this... should be monetary
178.1903 -+#endif
178.1904 -+#ifdef __UCLIBC__
178.1905 -+# ifdef __UCLIBC_HAS_XLOCALE__
178.1906 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
178.1907 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
178.1908 -+# elif defined __UCLIBC_HAS_LOCALE__
178.1909 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
178.1910 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
178.1911 -+# endif
178.1912 -+#else
178.1913 -+          union { char *__s; wchar_t __w; } __u;
178.1914 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
178.1915 -+	  _M_data->_M_decimal_point = __u.__w;
178.1916 -+
178.1917 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
178.1918 -+	  _M_data->_M_thousands_sep = __u.__w;
178.1919 -+#endif
178.1920 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
178.1921 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
178.1922 -+
178.1923 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
178.1924 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
178.1925 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
178.1926 -+
178.1927 -+	  wchar_t* __wcs_ps = 0;
178.1928 -+	  wchar_t* __wcs_ns = 0;
178.1929 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
178.1930 -+	  try
178.1931 -+            {
178.1932 -+              mbstate_t __state;
178.1933 -+              size_t __len;
178.1934 -+              __len = strlen(__cpossign);
178.1935 -+              if (__len)
178.1936 -+                {
178.1937 -+		  ++__len;
178.1938 -+		  memset(&__state, 0, sizeof(mbstate_t));
178.1939 -+		  __wcs_ps = new wchar_t[__len];
178.1940 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
178.1941 -+		  _M_data->_M_positive_sign = __wcs_ps;
178.1942 -+		}
178.1943 -+	      else
178.1944 -+		_M_data->_M_positive_sign = L"";
178.1945 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
178.1946 -+	      
178.1947 -+	      __len = strlen(__cnegsign);
178.1948 -+	      if (!__nposn)
178.1949 -+		_M_data->_M_negative_sign = L"()";
178.1950 -+	      else if (__len)
178.1951 -+		{ 
178.1952 -+		  ++__len;
178.1953 -+		  memset(&__state, 0, sizeof(mbstate_t));
178.1954 -+		  __wcs_ns = new wchar_t[__len];
178.1955 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
178.1956 -+		  _M_data->_M_negative_sign = __wcs_ns;
178.1957 -+		}
178.1958 -+	      else
178.1959 -+		_M_data->_M_negative_sign = L"";
178.1960 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
178.1961 -+
178.1962 -+	      // _Intl == true.
178.1963 -+	      __len = strlen(__ccurr);
178.1964 -+	      if (__len)
178.1965 -+		{
178.1966 -+		  ++__len;
178.1967 -+		  memset(&__state, 0, sizeof(mbstate_t));
178.1968 -+		  wchar_t* __wcs = new wchar_t[__len];
178.1969 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
178.1970 -+		  _M_data->_M_curr_symbol = __wcs;
178.1971 -+		}
178.1972 -+	      else
178.1973 -+		_M_data->_M_curr_symbol = L"";
178.1974 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
178.1975 -+	    }
178.1976 -+          catch (...)
178.1977 -+	    {
178.1978 -+	      delete _M_data;
178.1979 -+              _M_data = 0;
178.1980 -+	      delete __wcs_ps;
178.1981 -+	      delete __wcs_ns;	      
178.1982 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.1983 -+	      __uselocale(__old);
178.1984 -+#else
178.1985 -+	      setlocale(LC_ALL, __old);
178.1986 -+	      free(__old);
178.1987 -+#endif
178.1988 -+              __throw_exception_again;
178.1989 -+	    }
178.1990 -+
178.1991 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
178.1992 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
178.1993 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
178.1994 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
178.1995 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
178.1996 -+	                                                __pposn);
178.1997 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
178.1998 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
178.1999 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
178.2000 -+	                                                __nposn);
178.2001 -+
178.2002 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.2003 -+	  __uselocale(__old);
178.2004 -+#else
178.2005 -+	  setlocale(LC_ALL, __old);
178.2006 -+	  free(__old);
178.2007 -+#endif
178.2008 -+	}
178.2009 -+    }
178.2010 -+
178.2011 -+  template<> 
178.2012 -+    moneypunct<wchar_t, true>::~moneypunct()
178.2013 -+    {
178.2014 -+      if (_M_data->_M_positive_sign_size)
178.2015 -+	delete [] _M_data->_M_positive_sign;
178.2016 -+      if (_M_data->_M_negative_sign_size
178.2017 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
178.2018 -+	delete [] _M_data->_M_negative_sign;
178.2019 -+      if (_M_data->_M_curr_symbol_size)
178.2020 -+	delete [] _M_data->_M_curr_symbol;
178.2021 -+      delete _M_data;
178.2022 -+    }
178.2023 -+
178.2024 -+  template<> 
178.2025 -+    moneypunct<wchar_t, false>::~moneypunct()
178.2026 -+    {
178.2027 -+      if (_M_data->_M_positive_sign_size)
178.2028 -+	delete [] _M_data->_M_positive_sign;
178.2029 -+      if (_M_data->_M_negative_sign_size
178.2030 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
178.2031 -+	delete [] _M_data->_M_negative_sign;
178.2032 -+      if (_M_data->_M_curr_symbol_size)
178.2033 -+	delete [] _M_data->_M_curr_symbol;
178.2034 -+      delete _M_data;
178.2035 -+    }
178.2036 -+#endif
178.2037 -+}
178.2038 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
178.2039 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-03-04 23:31:57.000000000 +0100
178.2040 -@@ -0,0 +1,173 @@
178.2041 -+// std::numpunct implementation details, GNU version -*- C++ -*-
178.2042 -+
178.2043 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
178.2044 -+//
178.2045 -+// This file is part of the GNU ISO C++ Library.  This library is free
178.2046 -+// software; you can redistribute it and/or modify it under the
178.2047 -+// terms of the GNU General Public License as published by the
178.2048 -+// Free Software Foundation; either version 2, or (at your option)
178.2049 -+// any later version.
178.2050 -+
178.2051 -+// This library is distributed in the hope that it will be useful,
178.2052 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
178.2053 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
178.2054 -+// GNU General Public License for more details.
178.2055 -+
178.2056 -+// You should have received a copy of the GNU General Public License along
178.2057 -+// with this library; see the file COPYING.  If not, write to the Free
178.2058 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
178.2059 -+// USA.
178.2060 -+
178.2061 -+// As a special exception, you may use this file as part of a free software
178.2062 -+// library without restriction.  Specifically, if other files instantiate
178.2063 -+// templates or use macros or inline functions from this file, or you compile
178.2064 -+// this file and link it with other files to produce an executable, this
178.2065 -+// file does not by itself cause the resulting executable to be covered by
178.2066 -+// the GNU General Public License.  This exception does not however
178.2067 -+// invalidate any other reasons why the executable file might be covered by
178.2068 -+// the GNU General Public License.
178.2069 -+
178.2070 -+//
178.2071 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
178.2072 -+//
178.2073 -+
178.2074 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
178.2075 -+
178.2076 -+#define _LIBC
178.2077 -+#include <locale>
178.2078 -+#undef _LIBC
178.2079 -+#include <bits/c++locale_internal.h>
178.2080 -+
178.2081 -+#ifdef __UCLIBC_MJN3_ONLY__
178.2082 -+#warning tailor for stub locale support
178.2083 -+#endif
178.2084 -+#ifndef __UCLIBC_HAS_XLOCALE__
178.2085 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
178.2086 -+#endif
178.2087 -+
178.2088 -+namespace std
178.2089 -+{
178.2090 -+  template<> 
178.2091 -+    void
178.2092 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
178.2093 -+    {
178.2094 -+      if (!_M_data)
178.2095 -+	_M_data = new __numpunct_cache<char>;
178.2096 -+
178.2097 -+      if (!__cloc)
178.2098 -+	{
178.2099 -+	  // "C" locale
178.2100 -+	  _M_data->_M_grouping = "";
178.2101 -+	  _M_data->_M_grouping_size = 0;
178.2102 -+	  _M_data->_M_use_grouping = false;
178.2103 -+
178.2104 -+	  _M_data->_M_decimal_point = '.';
178.2105 -+	  _M_data->_M_thousands_sep = ',';
178.2106 -+
178.2107 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
178.2108 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
178.2109 -+
178.2110 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
178.2111 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
178.2112 -+	}
178.2113 -+      else
178.2114 -+	{
178.2115 -+	  // Named locale.
178.2116 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
178.2117 -+							__cloc));
178.2118 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
178.2119 -+							__cloc));
178.2120 -+
178.2121 -+	  // Check for NULL, which implies no grouping.
178.2122 -+	  if (_M_data->_M_thousands_sep == '\0')
178.2123 -+	    _M_data->_M_grouping = "";
178.2124 -+	  else
178.2125 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
178.2126 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
178.2127 -+	}
178.2128 -+
178.2129 -+      // NB: There is no way to extact this info from posix locales.
178.2130 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
178.2131 -+      _M_data->_M_truename = "true";
178.2132 -+      _M_data->_M_truename_size = 4;
178.2133 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
178.2134 -+      _M_data->_M_falsename = "false";
178.2135 -+      _M_data->_M_falsename_size = 5;
178.2136 -+    }
178.2137 -+ 
178.2138 -+  template<> 
178.2139 -+    numpunct<char>::~numpunct()
178.2140 -+    { delete _M_data; }
178.2141 -+   
178.2142 -+#ifdef _GLIBCXX_USE_WCHAR_T
178.2143 -+  template<> 
178.2144 -+    void
178.2145 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
178.2146 -+    {
178.2147 -+      if (!_M_data)
178.2148 -+	_M_data = new __numpunct_cache<wchar_t>;
178.2149 -+
178.2150 -+      if (!__cloc)
178.2151 -+	{
178.2152 -+	  // "C" locale
178.2153 -+	  _M_data->_M_grouping = "";
178.2154 -+	  _M_data->_M_grouping_size = 0;
178.2155 -+	  _M_data->_M_use_grouping = false;
178.2156 -+
178.2157 -+	  _M_data->_M_decimal_point = L'.';
178.2158 -+	  _M_data->_M_thousands_sep = L',';
178.2159 -+
178.2160 -+	  // Use ctype::widen code without the facet...
178.2161 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
178.2162 -+	    _M_data->_M_atoms_out[__i] =
178.2163 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
178.2164 -+
178.2165 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
178.2166 -+	    _M_data->_M_atoms_in[__j] =
178.2167 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
178.2168 -+	}
178.2169 -+      else
178.2170 -+	{
178.2171 -+	  // Named locale.
178.2172 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
178.2173 -+#ifdef __UCLIBC_MJN3_ONLY__
178.2174 -+#warning fix this
178.2175 -+#endif
178.2176 -+#ifdef __UCLIBC__
178.2177 -+# ifdef __UCLIBC_HAS_XLOCALE__
178.2178 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
178.2179 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
178.2180 -+# elif defined __UCLIBC_HAS_LOCALE__
178.2181 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
178.2182 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
178.2183 -+# endif
178.2184 -+#else
178.2185 -+	  union { char *__s; wchar_t __w; } __u;
178.2186 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
178.2187 -+	  _M_data->_M_decimal_point = __u.__w;
178.2188 -+
178.2189 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
178.2190 -+	  _M_data->_M_thousands_sep = __u.__w;
178.2191 -+#endif
178.2192 -+
178.2193 -+	  if (_M_data->_M_thousands_sep == L'\0')
178.2194 -+	    _M_data->_M_grouping = "";
178.2195 -+	  else
178.2196 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
178.2197 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
178.2198 -+	}
178.2199 -+
178.2200 -+      // NB: There is no way to extact this info from posix locales.
178.2201 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
178.2202 -+      _M_data->_M_truename = L"true";
178.2203 -+      _M_data->_M_truename_size = 4;
178.2204 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
178.2205 -+      _M_data->_M_falsename = L"false";
178.2206 -+      _M_data->_M_falsename_size = 5;
178.2207 -+    }
178.2208 -+
178.2209 -+  template<> 
178.2210 -+    numpunct<wchar_t>::~numpunct()
178.2211 -+    { delete _M_data; }
178.2212 -+ #endif
178.2213 -+}
178.2214 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
178.2215 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-03-04 23:31:57.000000000 +0100
178.2216 -@@ -0,0 +1,406 @@
178.2217 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
178.2218 -+
178.2219 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
178.2220 -+//
178.2221 -+// This file is part of the GNU ISO C++ Library.  This library is free
178.2222 -+// software; you can redistribute it and/or modify it under the
178.2223 -+// terms of the GNU General Public License as published by the
178.2224 -+// Free Software Foundation; either version 2, or (at your option)
178.2225 -+// any later version.
178.2226 -+
178.2227 -+// This library is distributed in the hope that it will be useful,
178.2228 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
178.2229 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
178.2230 -+// GNU General Public License for more details.
178.2231 -+
178.2232 -+// You should have received a copy of the GNU General Public License along
178.2233 -+// with this library; see the file COPYING.  If not, write to the Free
178.2234 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
178.2235 -+// USA.
178.2236 -+
178.2237 -+// As a special exception, you may use this file as part of a free software
178.2238 -+// library without restriction.  Specifically, if other files instantiate
178.2239 -+// templates or use macros or inline functions from this file, or you compile
178.2240 -+// this file and link it with other files to produce an executable, this
178.2241 -+// file does not by itself cause the resulting executable to be covered by
178.2242 -+// the GNU General Public License.  This exception does not however
178.2243 -+// invalidate any other reasons why the executable file might be covered by
178.2244 -+// the GNU General Public License.
178.2245 -+
178.2246 -+//
178.2247 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
178.2248 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
178.2249 -+//
178.2250 -+
178.2251 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
178.2252 -+
178.2253 -+#include <locale>
178.2254 -+#include <bits/c++locale_internal.h>
178.2255 -+
178.2256 -+#ifdef __UCLIBC_MJN3_ONLY__
178.2257 -+#warning tailor for stub locale support
178.2258 -+#endif
178.2259 -+#ifndef __UCLIBC_HAS_XLOCALE__
178.2260 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
178.2261 -+#endif
178.2262 -+
178.2263 -+namespace std
178.2264 -+{
178.2265 -+  template<>
178.2266 -+    void
178.2267 -+    __timepunct<char>::
178.2268 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
178.2269 -+	   const tm* __tm) const
178.2270 -+    {
178.2271 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.2272 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
178.2273 -+					_M_c_locale_timepunct);
178.2274 -+#else
178.2275 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
178.2276 -+      setlocale(LC_ALL, _M_name_timepunct);
178.2277 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
178.2278 -+      setlocale(LC_ALL, __old);
178.2279 -+      free(__old);
178.2280 -+#endif
178.2281 -+      // Make sure __s is null terminated.
178.2282 -+      if (__len == 0)
178.2283 -+	__s[0] = '\0';
178.2284 -+    }
178.2285 -+
178.2286 -+  template<> 
178.2287 -+    void
178.2288 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
178.2289 -+    {
178.2290 -+      if (!_M_data)
178.2291 -+	_M_data = new __timepunct_cache<char>;
178.2292 -+
178.2293 -+      if (!__cloc)
178.2294 -+	{
178.2295 -+	  // "C" locale
178.2296 -+	  _M_c_locale_timepunct = _S_get_c_locale();
178.2297 -+
178.2298 -+	  _M_data->_M_date_format = "%m/%d/%y";
178.2299 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
178.2300 -+	  _M_data->_M_time_format = "%H:%M:%S";
178.2301 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
178.2302 -+	  _M_data->_M_date_time_format = "";
178.2303 -+	  _M_data->_M_date_time_era_format = "";
178.2304 -+	  _M_data->_M_am = "AM";
178.2305 -+	  _M_data->_M_pm = "PM";
178.2306 -+	  _M_data->_M_am_pm_format = "";
178.2307 -+
178.2308 -+	  // Day names, starting with "C"'s Sunday.
178.2309 -+	  _M_data->_M_day1 = "Sunday";
178.2310 -+	  _M_data->_M_day2 = "Monday";
178.2311 -+	  _M_data->_M_day3 = "Tuesday";
178.2312 -+	  _M_data->_M_day4 = "Wednesday";
178.2313 -+	  _M_data->_M_day5 = "Thursday";
178.2314 -+	  _M_data->_M_day6 = "Friday";
178.2315 -+	  _M_data->_M_day7 = "Saturday";
178.2316 -+
178.2317 -+	  // Abbreviated day names, starting with "C"'s Sun.
178.2318 -+	  _M_data->_M_aday1 = "Sun";
178.2319 -+	  _M_data->_M_aday2 = "Mon";
178.2320 -+	  _M_data->_M_aday3 = "Tue";
178.2321 -+	  _M_data->_M_aday4 = "Wed";
178.2322 -+	  _M_data->_M_aday5 = "Thu";
178.2323 -+	  _M_data->_M_aday6 = "Fri";
178.2324 -+	  _M_data->_M_aday7 = "Sat";
178.2325 -+
178.2326 -+	  // Month names, starting with "C"'s January.
178.2327 -+	  _M_data->_M_month01 = "January";
178.2328 -+	  _M_data->_M_month02 = "February";
178.2329 -+	  _M_data->_M_month03 = "March";
178.2330 -+	  _M_data->_M_month04 = "April";
178.2331 -+	  _M_data->_M_month05 = "May";
178.2332 -+	  _M_data->_M_month06 = "June";
178.2333 -+	  _M_data->_M_month07 = "July";
178.2334 -+	  _M_data->_M_month08 = "August";
178.2335 -+	  _M_data->_M_month09 = "September";
178.2336 -+	  _M_data->_M_month10 = "October";
178.2337 -+	  _M_data->_M_month11 = "November";
178.2338 -+	  _M_data->_M_month12 = "December";
178.2339 -+
178.2340 -+	  // Abbreviated month names, starting with "C"'s Jan.
178.2341 -+	  _M_data->_M_amonth01 = "Jan";
178.2342 -+	  _M_data->_M_amonth02 = "Feb";
178.2343 -+	  _M_data->_M_amonth03 = "Mar";
178.2344 -+	  _M_data->_M_amonth04 = "Apr";
178.2345 -+	  _M_data->_M_amonth05 = "May";
178.2346 -+	  _M_data->_M_amonth06 = "Jun";
178.2347 -+	  _M_data->_M_amonth07 = "Jul";
178.2348 -+	  _M_data->_M_amonth08 = "Aug";
178.2349 -+	  _M_data->_M_amonth09 = "Sep";
178.2350 -+	  _M_data->_M_amonth10 = "Oct";
178.2351 -+	  _M_data->_M_amonth11 = "Nov";
178.2352 -+	  _M_data->_M_amonth12 = "Dec";
178.2353 -+	}
178.2354 -+      else
178.2355 -+	{
178.2356 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
178.2357 -+
178.2358 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
178.2359 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
178.2360 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
178.2361 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
178.2362 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
178.2363 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
178.2364 -+							     __cloc);
178.2365 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
178.2366 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
178.2367 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
178.2368 -+
178.2369 -+	  // Day names, starting with "C"'s Sunday.
178.2370 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
178.2371 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
178.2372 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
178.2373 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
178.2374 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
178.2375 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
178.2376 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
178.2377 -+
178.2378 -+	  // Abbreviated day names, starting with "C"'s Sun.
178.2379 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
178.2380 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
178.2381 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
178.2382 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
178.2383 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
178.2384 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
178.2385 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
178.2386 -+
178.2387 -+	  // Month names, starting with "C"'s January.
178.2388 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
178.2389 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
178.2390 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
178.2391 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
178.2392 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
178.2393 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
178.2394 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
178.2395 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
178.2396 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
178.2397 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
178.2398 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
178.2399 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
178.2400 -+
178.2401 -+	  // Abbreviated month names, starting with "C"'s Jan.
178.2402 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
178.2403 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
178.2404 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
178.2405 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
178.2406 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
178.2407 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
178.2408 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
178.2409 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
178.2410 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
178.2411 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
178.2412 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
178.2413 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
178.2414 -+	}
178.2415 -+    }
178.2416 -+
178.2417 -+#ifdef _GLIBCXX_USE_WCHAR_T
178.2418 -+  template<>
178.2419 -+    void
178.2420 -+    __timepunct<wchar_t>::
178.2421 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
178.2422 -+	   const tm* __tm) const
178.2423 -+    {
178.2424 -+#ifdef __UCLIBC_HAS_XLOCALE__
178.2425 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
178.2426 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
178.2427 -+					_M_c_locale_timepunct);
178.2428 -+#else
178.2429 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
178.2430 -+      setlocale(LC_ALL, _M_name_timepunct);
178.2431 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
178.2432 -+      setlocale(LC_ALL, __old);
178.2433 -+      free(__old);
178.2434 -+#endif
178.2435 -+      // Make sure __s is null terminated.
178.2436 -+      if (__len == 0)
178.2437 -+	__s[0] = L'\0';
178.2438 -+    }
178.2439 -+
178.2440 -+  template<> 
178.2441 -+    void
178.2442 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
178.2443 -+    {
178.2444 -+      if (!_M_data)
178.2445 -+	_M_data = new __timepunct_cache<wchar_t>;
178.2446 -+
178.2447 -+#warning wide time stuff
178.2448 -+//       if (!__cloc)
178.2449 -+	{
178.2450 -+	  // "C" locale
178.2451 -+	  _M_c_locale_timepunct = _S_get_c_locale();
178.2452 -+
178.2453 -+	  _M_data->_M_date_format = L"%m/%d/%y";
178.2454 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
178.2455 -+	  _M_data->_M_time_format = L"%H:%M:%S";
178.2456 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
178.2457 -+	  _M_data->_M_date_time_format = L"";
178.2458 -+	  _M_data->_M_date_time_era_format = L"";
178.2459 -+	  _M_data->_M_am = L"AM";
178.2460 -+	  _M_data->_M_pm = L"PM";
178.2461 -+	  _M_data->_M_am_pm_format = L"";
178.2462 -+
178.2463 -+	  // Day names, starting with "C"'s Sunday.
178.2464 -+	  _M_data->_M_day1 = L"Sunday";
178.2465 -+	  _M_data->_M_day2 = L"Monday";
178.2466 -+	  _M_data->_M_day3 = L"Tuesday";
178.2467 -+	  _M_data->_M_day4 = L"Wednesday";
178.2468 -+	  _M_data->_M_day5 = L"Thursday";
178.2469 -+	  _M_data->_M_day6 = L"Friday";
178.2470 -+	  _M_data->_M_day7 = L"Saturday";
178.2471 -+
178.2472 -+	  // Abbreviated day names, starting with "C"'s Sun.
178.2473 -+	  _M_data->_M_aday1 = L"Sun";
178.2474 -+	  _M_data->_M_aday2 = L"Mon";
178.2475 -+	  _M_data->_M_aday3 = L"Tue";
178.2476 -+	  _M_data->_M_aday4 = L"Wed";
178.2477 -+	  _M_data->_M_aday5 = L"Thu";
178.2478 -+	  _M_data->_M_aday6 = L"Fri";
178.2479 -+	  _M_data->_M_aday7 = L"Sat";
178.2480 -+
178.2481 -+	  // Month names, starting with "C"'s January.
178.2482 -+	  _M_data->_M_month01 = L"January";
178.2483 -+	  _M_data->_M_month02 = L"February";
178.2484 -+	  _M_data->_M_month03 = L"March";
178.2485 -+	  _M_data->_M_month04 = L"April";
178.2486 -+	  _M_data->_M_month05 = L"May";
178.2487 -+	  _M_data->_M_month06 = L"June";
178.2488 -+	  _M_data->_M_month07 = L"July";
178.2489 -+	  _M_data->_M_month08 = L"August";
178.2490 -+	  _M_data->_M_month09 = L"September";
178.2491 -+	  _M_data->_M_month10 = L"October";
178.2492 -+	  _M_data->_M_month11 = L"November";
178.2493 -+	  _M_data->_M_month12 = L"December";
178.2494 -+
178.2495 -+	  // Abbreviated month names, starting with "C"'s Jan.
178.2496 -+	  _M_data->_M_amonth01 = L"Jan";
178.2497 -+	  _M_data->_M_amonth02 = L"Feb";
178.2498 -+	  _M_data->_M_amonth03 = L"Mar";
178.2499 -+	  _M_data->_M_amonth04 = L"Apr";
178.2500 -+	  _M_data->_M_amonth05 = L"May";
178.2501 -+	  _M_data->_M_amonth06 = L"Jun";
178.2502 -+	  _M_data->_M_amonth07 = L"Jul";
178.2503 -+	  _M_data->_M_amonth08 = L"Aug";
178.2504 -+	  _M_data->_M_amonth09 = L"Sep";
178.2505 -+	  _M_data->_M_amonth10 = L"Oct";
178.2506 -+	  _M_data->_M_amonth11 = L"Nov";
178.2507 -+	  _M_data->_M_amonth12 = L"Dec";
178.2508 -+	}
178.2509 -+#if 0
178.2510 -+      else
178.2511 -+	{
178.2512 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
178.2513 -+
178.2514 -+	  union { char *__s; wchar_t *__w; } __u;
178.2515 -+
178.2516 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
178.2517 -+	  _M_data->_M_date_format = __u.__w;
178.2518 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
178.2519 -+	  _M_data->_M_date_era_format = __u.__w;
178.2520 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
178.2521 -+	  _M_data->_M_time_format = __u.__w;
178.2522 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
178.2523 -+	  _M_data->_M_time_era_format = __u.__w;
178.2524 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
178.2525 -+	  _M_data->_M_date_time_format = __u.__w;
178.2526 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
178.2527 -+	  _M_data->_M_date_time_era_format = __u.__w;
178.2528 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
178.2529 -+	  _M_data->_M_am = __u.__w;
178.2530 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
178.2531 -+	  _M_data->_M_pm = __u.__w;
178.2532 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
178.2533 -+	  _M_data->_M_am_pm_format = __u.__w;
178.2534 -+
178.2535 -+	  // Day names, starting with "C"'s Sunday.
178.2536 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
178.2537 -+	  _M_data->_M_day1 = __u.__w;
178.2538 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
178.2539 -+	  _M_data->_M_day2 = __u.__w;
178.2540 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
178.2541 -+	  _M_data->_M_day3 = __u.__w;
178.2542 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
178.2543 -+	  _M_data->_M_day4 = __u.__w;
178.2544 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
178.2545 -+	  _M_data->_M_day5 = __u.__w;
178.2546 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
178.2547 -+	  _M_data->_M_day6 = __u.__w;
178.2548 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
178.2549 -+	  _M_data->_M_day7 = __u.__w;
178.2550 -+
178.2551 -+	  // Abbreviated day names, starting with "C"'s Sun.
178.2552 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
178.2553 -+	  _M_data->_M_aday1 = __u.__w;
178.2554 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
178.2555 -+	  _M_data->_M_aday2 = __u.__w;
178.2556 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
178.2557 -+	  _M_data->_M_aday3 = __u.__w;
178.2558 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
178.2559 -+	  _M_data->_M_aday4 = __u.__w;
178.2560 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
178.2561 -+	  _M_data->_M_aday5 = __u.__w;
178.2562 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
178.2563 -+	  _M_data->_M_aday6 = __u.__w;
178.2564 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
178.2565 -+	  _M_data->_M_aday7 = __u.__w;
178.2566 -+
178.2567 -+	  // Month names, starting with "C"'s January.
178.2568 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
178.2569 -+	  _M_data->_M_month01 = __u.__w;
178.2570 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
178.2571 -+	  _M_data->_M_month02 = __u.__w;
178.2572 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
178.2573 -+	  _M_data->_M_month03 = __u.__w;
178.2574 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
178.2575 -+	  _M_data->_M_month04 = __u.__w;
178.2576 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
178.2577 -+	  _M_data->_M_month05 = __u.__w;
178.2578 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
178.2579 -+	  _M_data->_M_month06 = __u.__w;
178.2580 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
178.2581 -+	  _M_data->_M_month07 = __u.__w;
178.2582 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
178.2583 -+	  _M_data->_M_month08 = __u.__w;
178.2584 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
178.2585 -+	  _M_data->_M_month09 = __u.__w;
178.2586 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
178.2587 -+	  _M_data->_M_month10 = __u.__w;
178.2588 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
178.2589 -+	  _M_data->_M_month11 = __u.__w;
178.2590 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
178.2591 -+	  _M_data->_M_month12 = __u.__w;
178.2592 -+
178.2593 -+	  // Abbreviated month names, starting with "C"'s Jan.
178.2594 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
178.2595 -+	  _M_data->_M_amonth01 = __u.__w;
178.2596 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
178.2597 -+	  _M_data->_M_amonth02 = __u.__w;
178.2598 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
178.2599 -+	  _M_data->_M_amonth03 = __u.__w;
178.2600 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
178.2601 -+	  _M_data->_M_amonth04 = __u.__w;
178.2602 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
178.2603 -+	  _M_data->_M_amonth05 = __u.__w;
178.2604 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
178.2605 -+	  _M_data->_M_amonth06 = __u.__w;
178.2606 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
178.2607 -+	  _M_data->_M_amonth07 = __u.__w;
178.2608 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
178.2609 -+	  _M_data->_M_amonth08 = __u.__w;
178.2610 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
178.2611 -+	  _M_data->_M_amonth09 = __u.__w;
178.2612 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
178.2613 -+	  _M_data->_M_amonth10 = __u.__w;
178.2614 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
178.2615 -+	  _M_data->_M_amonth11 = __u.__w;
178.2616 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
178.2617 -+	  _M_data->_M_amonth12 = __u.__w;
178.2618 -+	}
178.2619 -+#endif // 0
178.2620 -+    }
178.2621 -+#endif
178.2622 -+}
178.2623 ---- gcc-4.1.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
178.2624 -+++ gcc-4.1.2/libstdc++-v3/config/locale/uclibc/time_members.h	2007-03-04 23:31:57.000000000 +0100
178.2625 -@@ -0,0 +1,76 @@
178.2626 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
178.2627 -+
178.2628 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
178.2629 -+//
178.2630 -+// This file is part of the GNU ISO C++ Library.  This library is free
178.2631 -+// software; you can redistribute it and/or modify it under the
178.2632 -+// terms of the GNU General Public License as published by the
178.2633 -+// Free Software Foundation; either version 2, or (at your option)
178.2634 -+// any later version.
178.2635 -+
178.2636 -+// This library is distributed in the hope that it will be useful,
178.2637 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
178.2638 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
178.2639 -+// GNU General Public License for more details.
178.2640 -+
178.2641 -+// You should have received a copy of the GNU General Public License along
178.2642 -+// with this library; see the file COPYING.  If not, write to the Free
178.2643 -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
178.2644 -+// USA.
178.2645 -+
178.2646 -+// As a special exception, you may use this file as part of a free software
178.2647 -+// library without restriction.  Specifically, if other files instantiate
178.2648 -+// templates or use macros or inline functions from this file, or you compile
178.2649 -+// this file and link it with other files to produce an executable, this
178.2650 -+// file does not by itself cause the resulting executable to be covered by
178.2651 -+// the GNU General Public License.  This exception does not however
178.2652 -+// invalidate any other reasons why the executable file might be covered by
178.2653 -+// the GNU General Public License.
178.2654 -+
178.2655 -+//
178.2656 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
178.2657 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
178.2658 -+//
178.2659 -+
178.2660 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
178.2661 -+
178.2662 -+  template<typename _CharT>
178.2663 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
178.2664 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
178.2665 -+      _M_name_timepunct(_S_get_c_name())
178.2666 -+    { _M_initialize_timepunct(); }
178.2667 -+
178.2668 -+  template<typename _CharT>
178.2669 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
178.2670 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
178.2671 -+      _M_name_timepunct(_S_get_c_name())
178.2672 -+    { _M_initialize_timepunct(); }
178.2673 -+
178.2674 -+  template<typename _CharT>
178.2675 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
178.2676 -+				     size_t __refs) 
178.2677 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
178.2678 -+      _M_name_timepunct(NULL)
178.2679 -+    { 
178.2680 -+      const size_t __len = std::strlen(__s) + 1;
178.2681 -+      char* __tmp = new char[__len];
178.2682 -+      std::memcpy(__tmp, __s, __len);
178.2683 -+      _M_name_timepunct = __tmp;
178.2684 -+
178.2685 -+      try
178.2686 -+	{ _M_initialize_timepunct(__cloc); }
178.2687 -+      catch(...)
178.2688 -+	{
178.2689 -+	  delete [] _M_name_timepunct;
178.2690 -+	  __throw_exception_again;
178.2691 -+	}
178.2692 -+    }
178.2693 -+
178.2694 -+  template<typename _CharT>
178.2695 -+    __timepunct<_CharT>::~__timepunct()
178.2696 -+    { 
178.2697 -+      if (_M_name_timepunct != _S_get_c_name())
178.2698 -+	delete [] _M_name_timepunct;
178.2699 -+      delete _M_data; 
178.2700 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
178.2701 -+    }
178.2702 ---- gcc-4.1.2.orig/libstdc++-v3/config/os/uclibc/ctype_base.h	1970-01-01 01:00:00.000000000 +0100
178.2703 -+++ gcc-4.1.2/libstdc++-v3/config/os/uclibc/ctype_base.h	2007-03-04 23:31:57.000000000 +0100
178.2704 -@@ -0,0 +1,64 @@
178.2705 -+// Locale support -*- C++ -*-
178.2706 -+
178.2707 -+// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
178.2708 -+// Free Software Foundation, Inc.
178.2709 -+//
178.2710 -+// This file is part of the GNU ISO C++ Library.  This library is free
178.2711 -+// software; you can redistribute it and/or modify it under the
178.2712 -+// terms of the GNU General Public License as published by the
178.2713 -+// Free Software Foundation; either version 2, or (at your option)
178.2714 -+// any later version.
178.2715 -+
178.2716 -+// This library is distributed in the hope that it will be useful,
178.2717 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
178.2718 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
178.2719 -+// GNU General Public License for more details.
178.2720 -+
178.2721 -+// You should have received a copy of the GNU General Public License along
178.2722 -+// with this library; see the file COPYING.  If not, write to the Free
178.2723 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
178.2724 -+// USA.
178.2725 -+
178.2726 -+// As a special exception, you may use this file as part of a free software
178.2727 -+// library without restriction.  Specifically, if other files instantiate
178.2728 -+// templates or use macros or inline functions from this file, or you compile
178.2729 -+// this file and link it with other files to produce an executable, this
178.2730 -+// file does not by itself cause the resulting executable to be covered by
178.2731 -+// the GNU General Public License.  This exception does not however
178.2732 -+// invalidate any other reasons why the executable file might be covered by
178.2733 -+// the GNU General Public License.
178.2734 -+
178.2735 -+//
178.2736 -+// ISO C++ 14882: 22.1  Locales
178.2737 -+//
178.2738 -+  
178.2739 -+/** @file ctype_base.h
178.2740 -+ *  This is an internal header file, included by other library headers.
178.2741 -+ *  You should not attempt to use it directly.
178.2742 -+ */
178.2743 -+
178.2744 -+// Information as gleaned from /usr/include/ctype.h
178.2745 -+  
178.2746 -+  /// @brief  Base class for ctype.
178.2747 -+  struct ctype_base
178.2748 -+  {
178.2749 -+    // Note: In uClibc, the following two types depend on configuration.
178.2750 -+ 
178.2751 -+    // Non-standard typedefs.
178.2752 -+    typedef const __ctype_touplow_t* __to_type;
178.2753 -+
178.2754 -+    // NB: Offsets into ctype<char>::_M_table force a particular size
178.2755 -+    // on the mask type. Because of this, we don't use an enum.
178.2756 -+    typedef __ctype_mask_t	mask;   
178.2757 -+    static const mask upper    	= _ISupper;
178.2758 -+    static const mask lower 	= _ISlower;
178.2759 -+    static const mask alpha 	= _ISalpha;
178.2760 -+    static const mask digit 	= _ISdigit;
178.2761 -+    static const mask xdigit 	= _ISxdigit;
178.2762 -+    static const mask space 	= _ISspace;
178.2763 -+    static const mask print 	= _ISprint;
178.2764 -+    static const mask graph 	= _ISalpha | _ISdigit | _ISpunct;
178.2765 -+    static const mask cntrl 	= _IScntrl;
178.2766 -+    static const mask punct 	= _ISpunct;
178.2767 -+    static const mask alnum 	= _ISalpha | _ISdigit;
178.2768 -+  };
178.2769 ---- gcc-4.1.2.orig/libstdc++-v3/config/os/uclibc/ctype_inline.h	1970-01-01 01:00:00.000000000 +0100
178.2770 -+++ gcc-4.1.2/libstdc++-v3/config/os/uclibc/ctype_inline.h	2007-03-04 23:31:57.000000000 +0100
178.2771 -@@ -0,0 +1,69 @@
178.2772 -+// Locale support -*- C++ -*-
178.2773 -+
178.2774 -+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
178.2775 -+//
178.2776 -+// This file is part of the GNU ISO C++ Library.  This library is free
178.2777 -+// software; you can redistribute it and/or modify it under the
178.2778 -+// terms of the GNU General Public License as published by the
178.2779 -+// Free Software Foundation; either version 2, or (at your option)
178.2780 -+// any later version.
178.2781 -+
178.2782 -+// This library is distributed in the hope that it will be useful,
178.2783 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
178.2784 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
178.2785 -+// GNU General Public License for more details.
178.2786 -+
178.2787 -+// You should have received a copy of the GNU General Public License along
178.2788 -+// with this library; see the file COPYING.  If not, write to the Free
178.2789 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
178.2790 -+// USA.
178.2791 -+
178.2792 -+// As a special exception, you may use this file as part of a free software
178.2793 -+// library without restriction.  Specifically, if other files instantiate
178.2794 -+// templates or use macros or inline functions from this file, or you compile
178.2795 -+// this file and link it with other files to produce an executable, this
178.2796 -+// file does not by itself cause the resulting executable to be covered by
178.2797 -+// the GNU General Public License.  This exception does not however
178.2798 -+// invalidate any other reasons why the executable file might be covered by
178.2799 -+// the GNU General Public License.
178.2800 -+
178.2801 -+//
178.2802 -+// ISO C++ 14882: 22.1  Locales
178.2803 -+//
178.2804 -+  
178.2805 -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
178.2806 -+// functions go in ctype.cc
178.2807 -+  
178.2808 -+  bool
178.2809 -+  ctype<char>::
178.2810 -+  is(mask __m, char __c) const
178.2811 -+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
178.2812 -+
178.2813 -+  const char*
178.2814 -+  ctype<char>::
178.2815 -+  is(const char* __low, const char* __high, mask* __vec) const
178.2816 -+  {
178.2817 -+    while (__low < __high)
178.2818 -+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
178.2819 -+    return __high;
178.2820 -+  }
178.2821 -+
178.2822 -+  const char*
178.2823 -+  ctype<char>::
178.2824 -+  scan_is(mask __m, const char* __low, const char* __high) const
178.2825 -+  {
178.2826 -+    while (__low < __high 
178.2827 -+	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
178.2828 -+      ++__low;
178.2829 -+    return __low;
178.2830 -+  }
178.2831 -+
178.2832 -+  const char*
178.2833 -+  ctype<char>::
178.2834 -+  scan_not(mask __m, const char* __low, const char* __high) const
178.2835 -+  {
178.2836 -+    while (__low < __high 
178.2837 -+	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
178.2838 -+      ++__low;
178.2839 -+    return __low;
178.2840 -+  }
178.2841 ---- gcc-4.1.2.orig/libstdc++-v3/config/os/uclibc/ctype_noninline.h	1970-01-01 01:00:00.000000000 +0100
178.2842 -+++ gcc-4.1.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h	2007-03-04 23:31:57.000000000 +0100
178.2843 -@@ -0,0 +1,92 @@
178.2844 -+// Locale support -*- C++ -*-
178.2845 -+
178.2846 -+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
178.2847 -+// Free Software Foundation, Inc.
178.2848 -+//
178.2849 -+// This file is part of the GNU ISO C++ Library.  This library is free
178.2850 -+// software; you can redistribute it and/or modify it under the
178.2851 -+// terms of the GNU General Public License as published by the
178.2852 -+// Free Software Foundation; either version 2, or (at your option)
178.2853 -+// any later version.
178.2854 -+
178.2855 -+// This library is distributed in the hope that it will be useful,
178.2856 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
178.2857 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
178.2858 -+// GNU General Public License for more details.
178.2859 -+
178.2860 -+// You should have received a copy of the GNU General Public License along
178.2861 -+// with this library; see the file COPYING.  If not, write to the Free
178.2862 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
178.2863 -+// USA.
178.2864 -+
178.2865 -+// As a special exception, you may use this file as part of a free software
178.2866 -+// library without restriction.  Specifically, if other files instantiate
178.2867 -+// templates or use macros or inline functions from this file, or you compile
178.2868 -+// this file and link it with other files to produce an executable, this
178.2869 -+// file does not by itself cause the resulting executable to be covered by
178.2870 -+// the GNU General Public License.  This exception does not however
178.2871 -+// invalidate any other reasons why the executable file might be covered by
178.2872 -+// the GNU General Public License.
178.2873 -+
178.2874 -+//
178.2875 -+// ISO C++ 14882: 22.1  Locales
178.2876 -+//
178.2877 -+  
178.2878 -+// Information as gleaned from /usr/include/ctype.h
178.2879 -+
178.2880 -+  const ctype_base::mask*
178.2881 -+  ctype<char>::classic_table() throw()
178.2882 -+  { return __C_ctype_b; }
178.2883 -+
178.2884 -+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
178.2885 -+		     size_t __refs) 
178.2886 -+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
178.2887 -+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
178.2888 -+  {
178.2889 -+    _M_toupper = __C_ctype_toupper;
178.2890 -+    _M_tolower = __C_ctype_tolower;
178.2891 -+    _M_table = __table ? __table : __C_ctype_b;
178.2892 -+    memset(_M_widen, 0, sizeof(_M_widen));
178.2893 -+    memset(_M_narrow, 0, sizeof(_M_narrow));
178.2894 -+  }
178.2895 -+
178.2896 -+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
178.2897 -+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
178.2898 -+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
178.2899 -+  {
178.2900 -+    _M_toupper = __C_ctype_toupper;
178.2901 -+    _M_tolower = __C_ctype_tolower;
178.2902 -+    _M_table = __table ? __table : __C_ctype_b;
178.2903 -+    memset(_M_widen, 0, sizeof(_M_widen));
178.2904 -+    memset(_M_narrow, 0, sizeof(_M_narrow));
178.2905 -+  }
178.2906 -+
178.2907 -+  char
178.2908 -+  ctype<char>::do_toupper(char __c) const
178.2909 -+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
178.2910 -+
178.2911 -+  const char*
178.2912 -+  ctype<char>::do_toupper(char* __low, const char* __high) const
178.2913 -+  {
178.2914 -+    while (__low < __high)
178.2915 -+      {
178.2916 -+	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
178.2917 -+	++__low;
178.2918 -+      }
178.2919 -+    return __high;
178.2920 -+  }
178.2921 -+
178.2922 -+  char
178.2923 -+  ctype<char>::do_tolower(char __c) const
178.2924 -+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
178.2925 -+
178.2926 -+  const char* 
178.2927 -+  ctype<char>::do_tolower(char* __low, const char* __high) const
178.2928 -+  {
178.2929 -+    while (__low < __high)
178.2930 -+      {
178.2931 -+	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
178.2932 -+	++__low;
178.2933 -+      }
178.2934 -+    return __high;
178.2935 -+  }
178.2936 ---- gcc-4.1.2.orig/libstdc++-v3/config/os/uclibc/os_defines.h	1970-01-01 01:00:00.000000000 +0100
178.2937 -+++ gcc-4.1.2/libstdc++-v3/config/os/uclibc/os_defines.h	2007-03-04 23:31:57.000000000 +0100
178.2938 -@@ -0,0 +1,44 @@
178.2939 -+// Specific definitions for GNU/Linux  -*- C++ -*-
178.2940 -+
178.2941 -+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
178.2942 -+//
178.2943 -+// This file is part of the GNU ISO C++ Library.  This library is free
178.2944 -+// software; you can redistribute it and/or modify it under the
178.2945 -+// terms of the GNU General Public License as published by the
178.2946 -+// Free Software Foundation; either version 2, or (at your option)
178.2947 -+// any later version.
178.2948 -+
178.2949 -+// This library is distributed in the hope that it will be useful,
178.2950 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
178.2951 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
178.2952 -+// GNU General Public License for more details.
178.2953 -+
178.2954 -+// You should have received a copy of the GNU General Public License along
178.2955 -+// with this library; see the file COPYING.  If not, write to the Free
178.2956 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
178.2957 -+// USA.
178.2958 -+
178.2959 -+// As a special exception, you may use this file as part of a free software
178.2960 -+// library without restriction.  Specifically, if other files instantiate
178.2961 -+// templates or use macros or inline functions from this file, or you compile
178.2962 -+// this file and link it with other files to produce an executable, this
178.2963 -+// file does not by itself cause the resulting executable to be covered by
178.2964 -+// the GNU General Public License.  This exception does not however
178.2965 -+// invalidate any other reasons why the executable file might be covered by
178.2966 -+// the GNU General Public License.
178.2967 -+
178.2968 -+#ifndef _GLIBCXX_OS_DEFINES
178.2969 -+#define _GLIBCXX_OS_DEFINES 1
178.2970 -+
178.2971 -+// System-specific #define, typedefs, corrections, etc, go here.  This
178.2972 -+// file will come before all others.
178.2973 -+
178.2974 -+// This keeps isanum, et al from being propagated as macros.
178.2975 -+#define __NO_CTYPE 1
178.2976 -+
178.2977 -+#include <features.h>
178.2978 -+
178.2979 -+// We must not see the optimized string functions GNU libc defines.
178.2980 -+#define __NO_STRING_INLINES
178.2981 -+
178.2982 -+#endif
178.2983 ---- gcc-4.1.2.orig/libstdc++-v3/configure	2007-01-29 11:51:01.000000000 +0100
178.2984 -+++ gcc-4.1.2/libstdc++-v3/configure	2007-03-04 23:31:57.000000000 +0100
178.2985 -@@ -4005,6 +4005,11 @@
178.2986 -   lt_cv_deplibs_check_method=pass_all
178.2987 -   ;;
178.2988 - 
178.2989 -+linux-uclibc*)
178.2990 -+  lt_cv_deplibs_check_method=pass_all
178.2991 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
178.2992 -+  ;;
178.2993 -+
178.2994 - netbsd* | knetbsd*-gnu)
178.2995 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
178.2996 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
178.2997 -@@ -5740,7 +5745,7 @@
178.2998 -   enableval="$enable_clocale"
178.2999 - 
178.3000 -       case "$enableval" in
178.3001 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
178.3002 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
178.3003 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
178.3004 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
178.3005 -    { (exit 1); exit 1; }; } ;;
178.3006 -@@ -5765,6 +5770,9 @@
178.3007 -   # Default to "generic".
178.3008 -   if test $enable_clocale_flag = auto; then
178.3009 -     case ${target_os} in
178.3010 -+      linux-uclibc*)
178.3011 -+        enable_clocale_flag=uclibc
178.3012 -+	;;
178.3013 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
178.3014 -         cat >conftest.$ac_ext <<_ACEOF
178.3015 - /* confdefs.h.  */
178.3016 -@@ -5995,6 +6003,76 @@
178.3017 -       CTIME_CC=config/locale/generic/time_members.cc
178.3018 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
178.3019 -       ;;
178.3020 -+    uclibc)
178.3021 -+      echo "$as_me:$LINENO: result: uclibc" >&5
178.3022 -+echo "${ECHO_T}uclibc" >&6
178.3023 -+
178.3024 -+      # Declare intention to use gettext, and add support for specific
178.3025 -+      # languages.
178.3026 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
178.3027 -+      ALL_LINGUAS="de fr"
178.3028 -+
178.3029 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
178.3030 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
178.3031 -+set dummy msgfmt; ac_word=$2
178.3032 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
178.3033 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
178.3034 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
178.3035 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
178.3036 -+else
178.3037 -+  if test -n "$check_msgfmt"; then
178.3038 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
178.3039 -+else
178.3040 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
178.3041 -+for as_dir in $PATH
178.3042 -+do
178.3043 -+  IFS=$as_save_IFS
178.3044 -+  test -z "$as_dir" && as_dir=.
178.3045 -+  for ac_exec_ext in '' $ac_executable_extensions; do
178.3046 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
178.3047 -+    ac_cv_prog_check_msgfmt="yes"
178.3048 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
178.3049 -+    break 2
178.3050 -+  fi
178.3051 -+done
178.3052 -+done
178.3053 -+
178.3054 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
178.3055 -+fi
178.3056 -+fi
178.3057 -+check_msgfmt=$ac_cv_prog_check_msgfmt
178.3058 -+if test -n "$check_msgfmt"; then
178.3059 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
178.3060 -+echo "${ECHO_T}$check_msgfmt" >&6
178.3061 -+else
178.3062 -+  echo "$as_me:$LINENO: result: no" >&5
178.3063 -+echo "${ECHO_T}no" >&6
178.3064 -+fi
178.3065 -+
178.3066 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
178.3067 -+        USE_NLS=yes
178.3068 -+      fi
178.3069 -+      # Export the build objects.
178.3070 -+      for ling in $ALL_LINGUAS; do \
178.3071 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
178.3072 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
178.3073 -+      done
178.3074 -+
178.3075 -+
178.3076 -+
178.3077 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
178.3078 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
178.3079 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
178.3080 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
178.3081 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
178.3082 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
178.3083 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
178.3084 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
178.3085 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
178.3086 -+      CTIME_H=config/locale/uclibc/time_members.h
178.3087 -+      CTIME_CC=config/locale/uclibc/time_members.cc
178.3088 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
178.3089 -+      ;;
178.3090 -   esac
178.3091 - 
178.3092 -   # This is where the testsuite looks for locale catalogs, using the
178.3093 ---- gcc-4.1.2.orig/libstdc++-v3/configure.host	2007-01-28 21:12:40.000000000 +0100
178.3094 -+++ gcc-4.1.2/libstdc++-v3/configure.host	2007-03-04 23:31:57.000000000 +0100
178.3095 -@@ -270,6 +270,12 @@
178.3096 -     ;;
178.3097 - esac
178.3098 - 
178.3099 -+# Override for uClibc since linux-uclibc gets mishandled above.
178.3100 -+case "${host_os}" in
178.3101 -+  *-uclibc*)
178.3102 -+    os_include_dir="os/uclibc"
178.3103 -+    ;;
178.3104 -+esac
178.3105 - 
178.3106 - # Set any OS-dependent and CPU-dependent bits.
178.3107 - # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
178.3108 ---- gcc-4.1.2.orig/libstdc++-v3/crossconfig.m4	2006-12-12 15:18:36.000000000 +0100
178.3109 -+++ gcc-4.1.2/libstdc++-v3/crossconfig.m4	2007-03-04 23:31:57.000000000 +0100
178.3110 -@@ -143,6 +143,99 @@
178.3111 - 	;;
178.3112 -     esac
178.3113 -     ;;
178.3114 -+  *-uclibc*)
178.3115 -+# Temporary hack until we implement the float versions of the libm funcs
178.3116 -+    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
178.3117 -+      machine/endian.h machine/param.h sys/machine.h sys/types.h \
178.3118 -+      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
178.3119 -+    SECTION_FLAGS='-ffunction-sections -fdata-sections'
178.3120 -+    AC_SUBST(SECTION_FLAGS)
178.3121 -+    GLIBCXX_CHECK_LINKER_FEATURES
178.3122 -+    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
178.3123 -+    GLIBCXX_CHECK_WCHAR_T_SUPPORT
178.3124 -+
178.3125 -+    # For LFS.
178.3126 -+    AC_DEFINE(HAVE_INT64_T)
178.3127 -+    case "$target" in
178.3128 -+      *-uclinux*)
178.3129 -+        # Don't enable LFS with uClinux
178.3130 -+        ;;
178.3131 -+      *)
178.3132 -+        AC_DEFINE(_GLIBCXX_USE_LFS)
178.3133 -+    esac
178.3134 -+
178.3135 -+    # For showmanyc_helper().
178.3136 -+    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
178.3137 -+    GLIBCXX_CHECK_POLL
178.3138 -+    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
178.3139 -+
178.3140 -+    # For xsputn_2().
178.3141 -+    AC_CHECK_HEADERS(sys/uio.h)
178.3142 -+    GLIBCXX_CHECK_WRITEV
178.3143 -+
178.3144 -+#     AC_DEFINE(HAVE_ACOSF)
178.3145 -+#     AC_DEFINE(HAVE_ASINF)
178.3146 -+#     AC_DEFINE(HAVE_ATANF)
178.3147 -+#     AC_DEFINE(HAVE_ATAN2F)
178.3148 -+    AC_DEFINE(HAVE_CEILF)
178.3149 -+    AC_DEFINE(HAVE_COPYSIGN)
178.3150 -+#     AC_DEFINE(HAVE_COPYSIGNF)
178.3151 -+#     AC_DEFINE(HAVE_COSF)
178.3152 -+#     AC_DEFINE(HAVE_COSHF)
178.3153 -+#     AC_DEFINE(HAVE_EXPF)
178.3154 -+#     AC_DEFINE(HAVE_FABSF)
178.3155 -+    AC_DEFINE(HAVE_FINITE)
178.3156 -+    AC_DEFINE(HAVE_FINITEF)
178.3157 -+    AC_DEFINE(HAVE_FLOORF)
178.3158 -+#     AC_DEFINE(HAVE_FMODF)
178.3159 -+#     AC_DEFINE(HAVE_FREXPF)
178.3160 -+    AC_DEFINE(HAVE_HYPOT)
178.3161 -+#     AC_DEFINE(HAVE_HYPOTF)
178.3162 -+    AC_DEFINE(HAVE_ISINF)
178.3163 -+    AC_DEFINE(HAVE_ISINFF)
178.3164 -+    AC_DEFINE(HAVE_ISNAN)
178.3165 -+    AC_DEFINE(HAVE_ISNANF)
178.3166 -+#     AC_DEFINE(HAVE_LOGF)
178.3167 -+#     AC_DEFINE(HAVE_LOG10F)
178.3168 -+#     AC_DEFINE(HAVE_MODFF)
178.3169 -+#     AC_DEFINE(HAVE_SINF)
178.3170 -+#     AC_DEFINE(HAVE_SINHF)
178.3171 -+#     AC_DEFINE(HAVE_SINCOS)
178.3172 -+#     AC_DEFINE(HAVE_SINCOSF)
178.3173 -+    AC_DEFINE(HAVE_SQRTF)
178.3174 -+#     AC_DEFINE(HAVE_TANF)
178.3175 -+#     AC_DEFINE(HAVE_TANHF)
178.3176 -+    if test x"long_double_math_on_this_cpu" = x"yes"; then
178.3177 -+      AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
178.3178 -+#       AC_DEFINE(HAVE_ACOSL)
178.3179 -+#       AC_DEFINE(HAVE_ASINL)
178.3180 -+#       AC_DEFINE(HAVE_ATANL)
178.3181 -+#       AC_DEFINE(HAVE_ATAN2L)
178.3182 -+#       AC_DEFINE(HAVE_CEILL)
178.3183 -+#       AC_DEFINE(HAVE_COPYSIGNL)
178.3184 -+#       AC_DEFINE(HAVE_COSL)
178.3185 -+#       AC_DEFINE(HAVE_COSHL)
178.3186 -+#       AC_DEFINE(HAVE_EXPL)
178.3187 -+#       AC_DEFINE(HAVE_FABSL)
178.3188 -+#       AC_DEFINE(HAVE_FINITEL)
178.3189 -+#       AC_DEFINE(HAVE_FLOORL)
178.3190 -+#       AC_DEFINE(HAVE_FMODL)
178.3191 -+#       AC_DEFINE(HAVE_FREXPL)
178.3192 -+#       AC_DEFINE(HAVE_HYPOTL)
178.3193 -+#       AC_DEFINE(HAVE_ISINFL)
178.3194 -+#       AC_DEFINE(HAVE_ISNANL)
178.3195 -+#       AC_DEFINE(HAVE_LOGL)
178.3196 -+#       AC_DEFINE(HAVE_LOG10L)
178.3197 -+#       AC_DEFINE(HAVE_MODFL)
178.3198 -+#       AC_DEFINE(HAVE_POWL)
178.3199 -+#       AC_DEFINE(HAVE_SINL)
178.3200 -+#       AC_DEFINE(HAVE_SINHL)
178.3201 -+#       AC_DEFINE(HAVE_SINCOSL)
178.3202 -+#       AC_DEFINE(HAVE_SQRTL)
178.3203 -+#       AC_DEFINE(HAVE_TANL)
178.3204 -+#       AC_DEFINE(HAVE_TANHL)
178.3205 -+    fi
178.3206 -+    ;;
178.3207 -   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
178.3208 -     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
178.3209 -       machine/endian.h machine/param.h sys/machine.h sys/types.h \
178.3210 -@@ -157,7 +250,7 @@
178.3211 -     AC_DEFINE(HAVE_INT64_T)
178.3212 -     case "$target" in
178.3213 -       *-uclinux*)
178.3214 --        # Don't enable LFS with uClibc
178.3215 -+        # Don't enable LFS with uClinux
178.3216 -         ;;
178.3217 -       *)
178.3218 -         AC_DEFINE(_GLIBCXX_USE_LFS)
178.3219 ---- gcc-4.1.2.orig/libstdc++-v3/include/c_compatibility/wchar.h	2005-08-17 04:28:44.000000000 +0200
178.3220 -+++ gcc-4.1.2/libstdc++-v3/include/c_compatibility/wchar.h	2007-03-04 23:31:57.000000000 +0100
178.3221 -@@ -101,7 +101,9 @@
178.3222 - using std::wmemcpy;
178.3223 - using std::wmemmove;
178.3224 - using std::wmemset;
178.3225 -+#if _GLIBCXX_HAVE_WCSFTIME
178.3226 - using std::wcsftime;
178.3227 -+#endif
178.3228 - 
178.3229 - #if _GLIBCXX_USE_C99
178.3230 - using std::wcstold;
178.3231 ---- gcc-4.1.2.orig/libstdc++-v3/include/c_std/std_cwchar.h	2005-10-30 23:21:50.000000000 +0100
178.3232 -+++ gcc-4.1.2/libstdc++-v3/include/c_std/std_cwchar.h	2007-03-04 23:31:57.000000000 +0100
178.3233 -@@ -180,7 +180,9 @@
178.3234 -   using ::wcscoll;
178.3235 -   using ::wcscpy;
178.3236 -   using ::wcscspn;
178.3237 -+#if _GLIBCXX_HAVE_WCSFTIME
178.3238 -   using ::wcsftime;
178.3239 -+#endif
178.3240 -   using ::wcslen;
178.3241 -   using ::wcsncat;
178.3242 -   using ::wcsncmp;
   179.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   179.2 +++ b/patches/gcc/4.1.2/210-softfloat-fix.patch	Mon Jul 28 21:32:33 2008 +0000
   179.3 @@ -0,0 +1,58 @@
   179.4 +This patch (C) 2007 Yann E. MORIN
   179.5 +Licensed under GPL v2.
   179.6 +
   179.7 +First hunk of this patch solves compiling uClibc-0.9.28{,.1} :
   179.8 +
   179.9 +make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  179.10 +  LD libuClibc-0.9.29.so
  179.11 +libc/libc_so.a(difftime.os): In function `difftime':
  179.12 +difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  179.13 +difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  179.14 +libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  179.15 +_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  179.16 +_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  179.17 +_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  179.18 +_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  179.19 +_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  179.20 +_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  179.21 +_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  179.22 +libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  179.23 +__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  179.24 +libc/libc_so.a(strtof.os): In function `strtof':
  179.25 +strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  179.26 +/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  179.27 +In function `__fixunsdfsi':
  179.28 +libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  179.29 +make[2]: *** [lib/libc.so] Error 1
  179.30 +make[1]: *** [lib/libc.so.0] Error 2
  179.31 +make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  179.32 +make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  179.33 +Error 2
  179.34 +
  179.35 +The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  179.36 +
  179.37 +
  179.38 +diff -dur gcc-4.1.1.no-softfloat-fix/gcc/config.gcc gcc-4.1.1/gcc/config.gcc
  179.39 +--- gcc-4.1.1.no-softfloat-fix/gcc/config.gcc	2007-02-01 21:57:17.000000000 +0100
  179.40 ++++ gcc-4.1.1/gcc/config.gcc	2007-02-01 22:11:06.000000000 +0100
  179.41 +@@ -690,7 +690,7 @@
  179.42 + 	    default_use_cxa_atexit=yes
  179.43 + 	    ;;
  179.44 + 	*)
  179.45 +-	    tmake_file="$tmake_file arm/t-linux"
  179.46 ++	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  179.47 + 	    ;;
  179.48 + 	esac
  179.49 + 	tm_file="$tm_file arm/aout.h arm/arm.h"
  179.50 +diff -dur gcc-4.1.1.-lfloat/gcc/config/arm/linux-elf.h gcc-4.1.1/gcc/config/arm/linux-elf.h
  179.51 +--- gcc-4.1.1.-lfloat/gcc/config/arm/linux-elf.h	2007-02-01 21:57:17.000000000 +0100
  179.52 ++++ gcc-4.1.1/gcc/config/arm/linux-elf.h	2007-02-01 23:00:42.000000000 +0100
  179.53 +@@ -63,7 +63,7 @@
  179.54 +    %{shared:-lc} \
  179.55 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  179.56 + 
  179.57 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  179.58 ++#define LIBGCC_SPEC "-lgcc"
  179.59 + 
  179.60 + #ifdef USE_UCLIBC
  179.61 + #define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
   180.1 --- a/patches/gcc/4.1.2/300-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   180.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   180.3 @@ -1,48 +0,0 @@
   180.4 ---- gcc-4.1.2.orig/libstdc++-v3/src/Makefile.am	2006-01-10 05:01:00.000000000 +0100
   180.5 -+++ gcc-4.1.2/libstdc++-v3/src/Makefile.am	2007-03-04 23:32:40.000000000 +0100
   180.6 -@@ -234,6 +234,12 @@
   180.7 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
   180.8 - 
   180.9 - 
  180.10 -+install-exec-local:
  180.11 -+ifeq ($(enable_shared),yes)
  180.12 -+	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  180.13 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  180.14 -+endif
  180.15 -+
  180.16 - # Added bits to build debug library.
  180.17 - if GLIBCXX_BUILD_DEBUG
  180.18 - all-local: build_debug
  180.19 ---- gcc-4.1.2.orig/libstdc++-v3/src/Makefile.in	2006-01-10 18:14:00.000000000 +0100
  180.20 -+++ gcc-4.1.2/libstdc++-v3/src/Makefile.in	2007-03-04 23:32:40.000000000 +0100
  180.21 -@@ -627,7 +627,7 @@
  180.22 - 
  180.23 - install-data-am: install-data-local
  180.24 - 
  180.25 --install-exec-am: install-toolexeclibLTLIBRARIES
  180.26 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  180.27 - 
  180.28 - install-info: install-info-am
  180.29 - 
  180.30 -@@ -660,6 +660,7 @@
  180.31 - 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  180.32 - 	html-am info info-am install install-am install-data \
  180.33 - 	install-data-am install-data-local install-exec \
  180.34 -+	install-exec-local \
  180.35 - 	install-exec-am install-info install-info-am install-man \
  180.36 - 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  180.37 - 	installcheck-am installdirs maintainer-clean \
  180.38 -@@ -760,6 +761,13 @@
  180.39 - install_debug:
  180.40 - 	(cd ${debugdir} && $(MAKE) \
  180.41 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  180.42 -+
  180.43 -+install-exec-local:
  180.44 -+ifeq ($(enable_shared),yes)
  180.45 -+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  180.46 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  180.47 -+endif
  180.48 -+
  180.49 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  180.50 - # Otherwise a system limit (for SysV at least) may be exceeded.
  180.51 - .NOEXPORT:
   181.1 --- a/patches/gcc/4.1.2/301-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   181.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   181.3 @@ -1,11 +0,0 @@
   181.4 ---- gcc-4.1.2.orig/boehm-gc/include/gc.h	2005-01-02 04:35:57.000000000 +0100
   181.5 -+++ gcc-4.1.2/boehm-gc/include/gc.h	2007-03-04 23:33:07.000000000 +0100
   181.6 -@@ -500,7 +500,7 @@
   181.7 - #ifdef __linux__
   181.8 - # include <features.h>
   181.9 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  181.10 --     && !defined(__ia64__)
  181.11 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  181.12 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  181.13 - #     define GC_HAVE_BUILTIN_BACKTRACE
  181.14 - #   endif
   182.1 --- a/patches/gcc/4.1.2/302-c99-snprintf.patch	Mon Jul 28 21:08:01 2008 +0000
   182.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   182.3 @@ -1,11 +0,0 @@
   182.4 ---- gcc-4.1.2.orig/libstdc++-v3/include/c_std/std_cstdio.h	2005-10-30 23:21:50.000000000 +0100
   182.5 -+++ gcc-4.1.2/libstdc++-v3/include/c_std/std_cstdio.h	2007-03-04 23:33:27.000000000 +0100
   182.6 -@@ -143,7 +143,7 @@
   182.7 -   using ::vsprintf;
   182.8 - }
   182.9 - 
  182.10 --#if _GLIBCXX_USE_C99
  182.11 -+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  182.12 - 
  182.13 - #undef snprintf
  182.14 - #undef vfscanf
   183.1 --- a/patches/gcc/4.1.2/303-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   183.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   183.3 @@ -1,12 +0,0 @@
   183.4 ---- gcc-4.1.2.orig/libstdc++-v3/configure	2007-03-04 23:32:31.000000000 +0100
   183.5 -+++ gcc-4.1.2/libstdc++-v3/configure	2007-03-04 23:33:54.000000000 +0100
   183.6 -@@ -7324,6 +7324,9 @@
   183.7 - cat >>conftest.$ac_ext <<_ACEOF
   183.8 - /* end confdefs.h.  */
   183.9 - #include <complex.h>
  183.10 -+#ifdef __UCLIBC__
  183.11 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  183.12 -+#endif
  183.13 - int
  183.14 - main ()
  183.15 - {
   184.1 --- a/patches/gcc/4.1.2/304-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   184.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   184.3 @@ -1,24 +0,0 @@
   184.4 ---- gcc-4.1.2.orig/libstdc++-v3/include/ext/rope	2005-08-17 04:28:44.000000000 +0200
   184.5 -+++ gcc-4.1.2/libstdc++-v3/include/ext/rope	2007-03-04 23:34:08.000000000 +0100
   184.6 -@@ -57,6 +57,9 @@
   184.7 - #include <bits/allocator.h>
   184.8 - #include <ext/hash_fun.h>
   184.9 - 
  184.10 -+/* cope w/ index defined as macro, SuSv3 proposal */
  184.11 -+#undef index
  184.12 -+
  184.13 - # ifdef __GC
  184.14 - #   define __GC_CONST const
  184.15 - # else
  184.16 ---- gcc-4.1.2.orig/libstdc++-v3/include/ext/ropeimpl.h	2005-08-17 04:28:44.000000000 +0200
  184.17 -+++ gcc-4.1.2/libstdc++-v3/include/ext/ropeimpl.h	2007-03-04 23:34:08.000000000 +0100
  184.18 -@@ -53,6 +53,9 @@
  184.19 - #include <ext/memory> // For uninitialized_copy_n
  184.20 - #include <ext/numeric> // For power
  184.21 - 
  184.22 -+/* cope w/ index defined as macro, SuSv3 proposal */
  184.23 -+#undef index
  184.24 -+
  184.25 - namespace __gnu_cxx
  184.26 - {
  184.27 -   using std::size_t;
   185.1 --- a/patches/gcc/4.1.2/402-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:08:01 2008 +0000
   185.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   185.3 @@ -1,11 +0,0 @@
   185.4 ---- gcc-4.1.2.orig/gcc/Makefile.in	2006-11-01 15:40:44.000000000 +0100
   185.5 -+++ gcc-4.1.2/gcc/Makefile.in	2007-03-04 23:34:32.000000000 +0100
   185.6 -@@ -2522,7 +2522,7 @@
   185.7 - # FIXME: writing proper dependencies for this is a *LOT* of work.
   185.8 - libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
   185.9 -   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  185.10 --  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  185.11 -+  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  185.12 - 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  185.13 - 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  185.14 - 	  -DLOCALEDIR=\"$(localedir)\" \
   186.1 --- a/patches/gcc/4.1.2/740-sh-pr24836.patch	Mon Jul 28 21:08:01 2008 +0000
   186.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   186.3 @@ -1,22 +0,0 @@
   186.4 ---- gcc-4.1.2.orig/gcc/configure.ac	2006-11-13 23:09:55.000000000 +0100
   186.5 -+++ gcc-4.1.2/gcc/configure.ac	2007-03-04 23:34:53.000000000 +0100
   186.6 -@@ -2435,7 +2435,7 @@
   186.7 - 	tls_first_minor=14
   186.8 - 	tls_as_opt="-m64 -Aesame --fatal-warnings"
   186.9 - 	;;
  186.10 --  sh-*-* | sh[34]-*-*)
  186.11 -+  sh-*-* | sh[34]*-*-*)
  186.12 -     conftest_s='
  186.13 - 	.section ".tdata","awT",@progbits
  186.14 - foo:	.long	25
  186.15 ---- gcc-4.1.2.orig/gcc/configure	2006-11-13 23:09:55.000000000 +0100
  186.16 -+++ gcc-4.1.2/gcc/configure	2007-03-04 23:34:53.000000000 +0100
  186.17 -@@ -14762,7 +14762,7 @@
  186.18 - 	tls_first_minor=14
  186.19 - 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  186.20 - 	;;
  186.21 --  sh-*-* | sh[34]-*-*)
  186.22 -+  sh-*-* | sh[34]*-*-*)
  186.23 -     conftest_s='
  186.24 - 	.section ".tdata","awT",@progbits
  186.25 - foo:	.long	25
   187.1 --- a/patches/gcc/4.1.2/800-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
   187.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   187.3 @@ -1,114 +0,0 @@
   187.4 ---- gcc-4.1.2.orig/gcc/config/arm/linux-elf.h	2007-03-04 23:25:37.000000000 +0100
   187.5 -+++ gcc-4.1.2/gcc/config/arm/linux-elf.h	2007-03-04 23:35:09.000000000 +0100
   187.6 -@@ -28,19 +28,33 @@
   187.7 - #undef  TARGET_VERSION
   187.8 - #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
   187.9 - 
  187.10 -+/*
  187.11 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  187.12 -+ * (big endian) configurations.
  187.13 -+ */
  187.14 -+#if TARGET_BIG_ENDIAN_DEFAULT
  187.15 -+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  187.16 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
  187.17 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
  187.18 -+#else
  187.19 -+#define TARGET_ENDIAN_DEFAULT 0
  187.20 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
  187.21 -+#define TARGET_LINKER_EMULATION "armelf_linux"
  187.22 -+#endif
  187.23 -+
  187.24 - #undef  TARGET_DEFAULT_FLOAT_ABI
  187.25 - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  187.26 - 
  187.27 - #undef  TARGET_DEFAULT
  187.28 --#define TARGET_DEFAULT (0)
  187.29 -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  187.30 - 
  187.31 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  187.32 - 
  187.33 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  187.34 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  187.35 - 
  187.36 - #undef  MULTILIB_DEFAULTS
  187.37 - #define MULTILIB_DEFAULTS \
  187.38 --	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  187.39 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  187.40 - 
  187.41 - /* Now we define the strings used to build the spec file.  */
  187.42 - #undef  LIB_SPEC
  187.43 -@@ -65,7 +79,7 @@
  187.44 -    %{rdynamic:-export-dynamic} \
  187.45 -    %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
  187.46 -    -X \
  187.47 --   %{mbig-endian:-EB}" \
  187.48 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  187.49 -    SUBTARGET_EXTRA_LINK_SPEC
  187.50 - 
  187.51 - #undef  LINK_SPEC
  187.52 ---- gcc-4.1.2.orig/gcc/config.gcc	2007-03-04 23:31:48.000000000 +0100
  187.53 -+++ gcc-4.1.2/gcc/config.gcc	2007-03-04 23:35:09.000000000 +0100
  187.54 -@@ -672,6 +672,11 @@
  187.55 - 	;;
  187.56 - arm*-*-linux*)			# ARM GNU/Linux with ELF
  187.57 - 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" 
  187.58 -+	case $target in
  187.59 -+	arm*b-*)
  187.60 -+		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  187.61 -+		;;
  187.62 -+	esac
  187.63 - 	tmake_file="${tmake_file} t-linux arm/t-arm"
  187.64 - 	case ${target} in
  187.65 - 	arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
  187.66 ---- gcc-4.1.2.orig/gcc/config/arm/linux-eabi.h	2007-03-04 23:31:48.000000000 +0100
  187.67 -+++ gcc-4.1.2/gcc/config/arm/linux-eabi.h	2007-03-04 23:35:09.000000000 +0100
  187.68 -@@ -20,6 +20,17 @@
  187.69 -    the Free Software Foundation, 51 Franklin Street, Fifth Floor,
  187.70 -    Boston, MA 02110-1301, USA.  */
  187.71 - 
  187.72 -+/*
  187.73 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  187.74 -+ * (big endian) configurations.
  187.75 -+ */
  187.76 -+#undef TARGET_LINKER_EMULATION
  187.77 -+#if TARGET_BIG_ENDIAN_DEFAULT
  187.78 -+#define TARGET_LINKER_EMULATION "armelfb_linux_eabi"
  187.79 -+#else
  187.80 -+#define TARGET_LINKER_EMULATION "armelf_linux_eabi"
  187.81 -+#endif
  187.82 -+
  187.83 - /* On EABI GNU/Linux, we want both the BPABI builtins and the
  187.84 -    GNU/Linux builtins.  */
  187.85 - #undef TARGET_OS_CPP_BUILTINS
  187.86 -@@ -48,7 +59,7 @@
  187.87 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
  187.88 - 
  187.89 - #undef SUBTARGET_EXTRA_LINK_SPEC
  187.90 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
  187.91 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
  187.92 - 
  187.93 - /* Use ld-linux.so.3 so that it will be possible to run "classic"
  187.94 -    GNU/Linux binaries on an EABI system.  */
  187.95 ---- gcc-4.1.2.orig/gcc/config/arm/bpabi.h	2005-12-13 02:35:37.000000000 +0100
  187.96 -+++ gcc-4.1.2/gcc/config/arm/bpabi.h	2007-03-04 23:35:09.000000000 +0100
  187.97 -@@ -33,9 +33,19 @@
  187.98 - #undef FPUTYPE_DEFAULT
  187.99 - #define FPUTYPE_DEFAULT FPUTYPE_VFP
 187.100 - 
 187.101 -+/*
 187.102 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
 187.103 -+ * (big endian) configurations.
 187.104 -+ */
 187.105 -+#if TARGET_BIG_ENDIAN_DEFAULT
 187.106 -+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
 187.107 -+#else
 187.108 -+#define TARGET_ENDIAN_DEFAULT 0
 187.109 -+#endif
 187.110 -+
 187.111 - /* EABI targets should enable interworking by default.  */
 187.112 - #undef TARGET_DEFAULT
 187.113 --#define TARGET_DEFAULT MASK_INTERWORK
 187.114 -+#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
 187.115 - 
 187.116 - /* The ARM BPABI functions return a boolean; they use no special
 187.117 -    calling convention.  */
   188.1 --- a/patches/gcc/4.1.2/801-softfloat-fix.patch	Mon Jul 28 21:08:01 2008 +0000
   188.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   188.3 @@ -1,58 +0,0 @@
   188.4 -This patch (C) 2007 Yann E. MORIN
   188.5 -Licensed under GPL v2.
   188.6 -
   188.7 -First hunk of this patch solves compiling uClibc-0.9.28{,.1} :
   188.8 -
   188.9 -make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  188.10 -  LD libuClibc-0.9.29.so
  188.11 -libc/libc_so.a(difftime.os): In function `difftime':
  188.12 -difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  188.13 -difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  188.14 -libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  188.15 -_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  188.16 -_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  188.17 -_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  188.18 -_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  188.19 -_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  188.20 -_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  188.21 -_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  188.22 -libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  188.23 -__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  188.24 -libc/libc_so.a(strtof.os): In function `strtof':
  188.25 -strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  188.26 -/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  188.27 -In function `__fixunsdfsi':
  188.28 -libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  188.29 -make[2]: *** [lib/libc.so] Error 1
  188.30 -make[1]: *** [lib/libc.so.0] Error 2
  188.31 -make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  188.32 -make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  188.33 -Error 2
  188.34 -
  188.35 -The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  188.36 -
  188.37 -
  188.38 -diff -dur gcc-4.1.1.no-softfloat-fix/gcc/config.gcc gcc-4.1.1/gcc/config.gcc
  188.39 ---- gcc-4.1.1.no-softfloat-fix/gcc/config.gcc	2007-02-01 21:57:17.000000000 +0100
  188.40 -+++ gcc-4.1.1/gcc/config.gcc	2007-02-01 22:11:06.000000000 +0100
  188.41 -@@ -690,7 +690,7 @@
  188.42 - 	    default_use_cxa_atexit=yes
  188.43 - 	    ;;
  188.44 - 	*)
  188.45 --	    tmake_file="$tmake_file arm/t-linux"
  188.46 -+	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  188.47 - 	    ;;
  188.48 - 	esac
  188.49 - 	tm_file="$tm_file arm/aout.h arm/arm.h"
  188.50 -diff -dur gcc-4.1.1.-lfloat/gcc/config/arm/linux-elf.h gcc-4.1.1/gcc/config/arm/linux-elf.h
  188.51 ---- gcc-4.1.1.-lfloat/gcc/config/arm/linux-elf.h	2007-02-01 21:57:17.000000000 +0100
  188.52 -+++ gcc-4.1.1/gcc/config/arm/linux-elf.h	2007-02-01 23:00:42.000000000 +0100
  188.53 -@@ -63,7 +63,7 @@
  188.54 -    %{shared:-lc} \
  188.55 -    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  188.56 - 
  188.57 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  188.58 -+#define LIBGCC_SPEC "-lgcc"
  188.59 - 
  188.60 - #ifdef USE_UCLIBC
  188.61 - #define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
   189.1 --- a/patches/gcc/4.2.0/103-uclibc-conf-noupstream.patch	Mon Jul 28 21:08:01 2008 +0000
   189.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   189.3 @@ -1,11 +0,0 @@
   189.4 ---- gcc/gcc/config.gcc.uclibc100-sh~	2006-03-06 20:46:56 +0100
   189.5 -+++ gcc/gcc/config.gcc	2006-03-10 15:02:41 +0100
   189.6 -@@ -1905,7 +1905,7 @@
   189.7 - 	;;
   189.8 - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
   189.9 - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  189.10 --  sh-*-linux* | sh[346lbe]*-*-linux* | \
  189.11 -+  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  189.12 -   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  189.13 -    sh64-*-netbsd* | sh64l*-*-netbsd*)
  189.14 - 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   190.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   190.2 +++ b/patches/gcc/4.2.0/110-uclibc-conf-noupstream.patch	Mon Jul 28 21:32:33 2008 +0000
   190.3 @@ -0,0 +1,11 @@
   190.4 +--- gcc/gcc/config.gcc.uclibc100-sh~	2006-03-06 20:46:56 +0100
   190.5 ++++ gcc/gcc/config.gcc	2006-03-10 15:02:41 +0100
   190.6 +@@ -1905,7 +1905,7 @@
   190.7 + 	;;
   190.8 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
   190.9 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  190.10 +-  sh-*-linux* | sh[346lbe]*-*-linux* | \
  190.11 ++  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  190.12 +   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  190.13 +    sh64-*-netbsd* | sh64l*-*-netbsd*)
  190.14 + 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   191.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   191.2 +++ b/patches/gcc/4.2.0/120-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   191.3 @@ -0,0 +1,2790 @@
   191.4 +--- gcc/libstdc++-v3/acinclude.m4
   191.5 ++++ gcc/libstdc++-v3/acinclude.m4
   191.6 +@@ -1369,7 +1369,7 @@
   191.7 +   AC_MSG_CHECKING([for C locale to use])
   191.8 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
   191.9 +     [use MODEL for target locale package],
  191.10 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  191.11 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  191.12 +   
  191.13 +   # If they didn't use this option switch, or if they specified --enable
  191.14 +   # with no specific model, we'll have to look for one.  If they
  191.15 +@@ -1385,6 +1385,9 @@
  191.16 +   # Default to "generic".
  191.17 +   if test $enable_clocale_flag = auto; then
  191.18 +     case ${target_os} in
  191.19 ++      *-uclibc*)
  191.20 ++        enable_clocale_flag=uclibc
  191.21 ++        ;;
  191.22 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  191.23 +         AC_EGREP_CPP([_GLIBCXX_ok], [
  191.24 +         #include <features.h>
  191.25 +@@ -1528,6 +1531,40 @@
  191.26 +       CTIME_CC=config/locale/generic/time_members.cc
  191.27 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  191.28 +       ;;
  191.29 ++    uclibc)
  191.30 ++      AC_MSG_RESULT(uclibc)
  191.31 ++
  191.32 ++      # Declare intention to use gettext, and add support for specific
  191.33 ++      # languages.
  191.34 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  191.35 ++      ALL_LINGUAS="de fr"
  191.36 ++
  191.37 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  191.38 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  191.39 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  191.40 ++        USE_NLS=yes
  191.41 ++      fi
  191.42 ++      # Export the build objects.
  191.43 ++      for ling in $ALL_LINGUAS; do \
  191.44 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  191.45 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  191.46 ++      done
  191.47 ++      AC_SUBST(glibcxx_MOFILES)
  191.48 ++      AC_SUBST(glibcxx_POFILES)
  191.49 ++
  191.50 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  191.51 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  191.52 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  191.53 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  191.54 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  191.55 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  191.56 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  191.57 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  191.58 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  191.59 ++      CTIME_H=config/locale/uclibc/time_members.h
  191.60 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  191.61 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  191.62 ++      ;;
  191.63 +   esac
  191.64 + 
  191.65 +   # This is where the testsuite looks for locale catalogs, using the
  191.66 +--- gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  191.67 ++++ gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  191.68 +@@ -0,0 +1,63 @@
  191.69 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  191.70 ++
  191.71 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  191.72 ++//
  191.73 ++// This file is part of the GNU ISO C++ Library.  This library is free
  191.74 ++// software; you can redistribute it and/or modify it under the
  191.75 ++// terms of the GNU General Public License as published by the
  191.76 ++// Free Software Foundation; either version 2, or (at your option)
  191.77 ++// any later version.
  191.78 ++
  191.79 ++// This library is distributed in the hope that it will be useful,
  191.80 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  191.81 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  191.82 ++// GNU General Public License for more details.
  191.83 ++
  191.84 ++// You should have received a copy of the GNU General Public License along
  191.85 ++// with this library; see the file COPYING.  If not, write to the Free
  191.86 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  191.87 ++// USA.
  191.88 ++
  191.89 ++// As a special exception, you may use this file as part of a free software
  191.90 ++// library without restriction.  Specifically, if other files instantiate
  191.91 ++// templates or use macros or inline functions from this file, or you compile
  191.92 ++// this file and link it with other files to produce an executable, this
  191.93 ++// file does not by itself cause the resulting executable to be covered by
  191.94 ++// the GNU General Public License.  This exception does not however
  191.95 ++// invalidate any other reasons why the executable file might be covered by
  191.96 ++// the GNU General Public License.
  191.97 ++
  191.98 ++// Written by Jakub Jelinek <jakub@redhat.com>
  191.99 ++
 191.100 ++#include <bits/c++config.h>
 191.101 ++#include <clocale>
 191.102 ++
 191.103 ++#ifdef __UCLIBC_MJN3_ONLY__
 191.104 ++#warning clean this up
 191.105 ++#endif
 191.106 ++
 191.107 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.108 ++                                                  
 191.109 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 191.110 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 191.111 ++extern "C" __typeof(strftime_l) __strftime_l;
 191.112 ++extern "C" __typeof(strtod_l) __strtod_l;
 191.113 ++extern "C" __typeof(strtof_l) __strtof_l;
 191.114 ++extern "C" __typeof(strtold_l) __strtold_l;
 191.115 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 191.116 ++extern "C" __typeof(newlocale) __newlocale;
 191.117 ++extern "C" __typeof(freelocale) __freelocale;
 191.118 ++extern "C" __typeof(duplocale) __duplocale;
 191.119 ++extern "C" __typeof(uselocale) __uselocale;
 191.120 ++
 191.121 ++#ifdef _GLIBCXX_USE_WCHAR_T
 191.122 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 191.123 ++extern "C" __typeof(towlower_l) __towlower_l;
 191.124 ++extern "C" __typeof(towupper_l) __towupper_l;
 191.125 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 191.126 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 191.127 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 191.128 ++extern "C" __typeof(wctype_l) __wctype_l;
 191.129 ++#endif 
 191.130 ++
 191.131 ++#endif // GLIBC 2.3 and later
 191.132 +--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc
 191.133 ++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc
 191.134 +@@ -0,0 +1,160 @@
 191.135 ++// Wrapper for underlying C-language localization -*- C++ -*-
 191.136 ++
 191.137 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 191.138 ++//
 191.139 ++// This file is part of the GNU ISO C++ Library.  This library is free
 191.140 ++// software; you can redistribute it and/or modify it under the
 191.141 ++// terms of the GNU General Public License as published by the
 191.142 ++// Free Software Foundation; either version 2, or (at your option)
 191.143 ++// any later version.
 191.144 ++
 191.145 ++// This library is distributed in the hope that it will be useful,
 191.146 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 191.147 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 191.148 ++// GNU General Public License for more details.
 191.149 ++
 191.150 ++// You should have received a copy of the GNU General Public License along
 191.151 ++// with this library; see the file COPYING.  If not, write to the Free
 191.152 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 191.153 ++// USA.
 191.154 ++
 191.155 ++// As a special exception, you may use this file as part of a free software
 191.156 ++// library without restriction.  Specifically, if other files instantiate
 191.157 ++// templates or use macros or inline functions from this file, or you compile
 191.158 ++// this file and link it with other files to produce an executable, this
 191.159 ++// file does not by itself cause the resulting executable to be covered by
 191.160 ++// the GNU General Public License.  This exception does not however
 191.161 ++// invalidate any other reasons why the executable file might be covered by
 191.162 ++// the GNU General Public License.
 191.163 ++
 191.164 ++//
 191.165 ++// ISO C++ 14882: 22.8  Standard locale categories.
 191.166 ++//
 191.167 ++
 191.168 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 191.169 ++
 191.170 ++#include <cerrno>  // For errno
 191.171 ++#include <locale>
 191.172 ++#include <stdexcept>
 191.173 ++#include <langinfo.h>
 191.174 ++#include <bits/c++locale_internal.h>
 191.175 ++
 191.176 ++#ifndef __UCLIBC_HAS_XLOCALE__
 191.177 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 191.178 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 191.179 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 191.180 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 191.181 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 191.182 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 191.183 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 191.184 ++#warning should dummy __newlocale check for C|POSIX ?
 191.185 ++#define __newlocale(a, b, c)        NULL
 191.186 ++#define __freelocale(a)             ((void)0)
 191.187 ++#define __duplocale(a)              __c_locale()
 191.188 ++#endif
 191.189 ++
 191.190 ++namespace std 
 191.191 ++{
 191.192 ++  template<>
 191.193 ++    void
 191.194 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 191.195 ++		   const __c_locale& __cloc)
 191.196 ++    {
 191.197 ++      if (!(__err & ios_base::failbit))
 191.198 ++	{
 191.199 ++	  char* __sanity;
 191.200 ++	  errno = 0;
 191.201 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
 191.202 ++          if (__sanity != __s && errno != ERANGE)
 191.203 ++	    __v = __f;
 191.204 ++	  else
 191.205 ++	    __err |= ios_base::failbit;
 191.206 ++	}
 191.207 ++    }
 191.208 ++
 191.209 ++  template<>
 191.210 ++    void
 191.211 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 191.212 ++		   const __c_locale& __cloc)
 191.213 ++    {
 191.214 ++      if (!(__err & ios_base::failbit))
 191.215 ++	{
 191.216 ++	  char* __sanity;
 191.217 ++	  errno = 0;
 191.218 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
 191.219 ++          if (__sanity != __s && errno != ERANGE)
 191.220 ++	    __v = __d;
 191.221 ++	  else
 191.222 ++	    __err |= ios_base::failbit;
 191.223 ++	}
 191.224 ++    }
 191.225 ++
 191.226 ++  template<>
 191.227 ++    void
 191.228 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 191.229 ++		   const __c_locale& __cloc)
 191.230 ++    {
 191.231 ++      if (!(__err & ios_base::failbit))
 191.232 ++	{
 191.233 ++	  char* __sanity;
 191.234 ++	  errno = 0;
 191.235 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 191.236 ++          if (__sanity != __s && errno != ERANGE)
 191.237 ++	    __v = __ld;
 191.238 ++	  else
 191.239 ++	    __err |= ios_base::failbit;
 191.240 ++	}
 191.241 ++    }
 191.242 ++
 191.243 ++  void
 191.244 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 191.245 ++				    __c_locale __old)
 191.246 ++  {
 191.247 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 191.248 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.249 ++    if (!__cloc)
 191.250 ++      {
 191.251 ++	// This named locale is not supported by the underlying OS.
 191.252 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 191.253 ++			      "name not valid"));
 191.254 ++      }
 191.255 ++#endif
 191.256 ++  }
 191.257 ++  
 191.258 ++  void
 191.259 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 191.260 ++  {
 191.261 ++    if (_S_get_c_locale() != __cloc)
 191.262 ++      __freelocale(__cloc); 
 191.263 ++  }
 191.264 ++
 191.265 ++  __c_locale
 191.266 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 191.267 ++  { return __duplocale(__cloc); }
 191.268 ++} // namespace std
 191.269 ++
 191.270 ++namespace __gnu_cxx
 191.271 ++{
 191.272 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 191.273 ++    {
 191.274 ++      "LC_CTYPE", 
 191.275 ++      "LC_NUMERIC",
 191.276 ++      "LC_TIME", 
 191.277 ++      "LC_COLLATE", 
 191.278 ++      "LC_MONETARY",
 191.279 ++      "LC_MESSAGES", 
 191.280 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 191.281 ++      "LC_PAPER", 
 191.282 ++      "LC_NAME", 
 191.283 ++      "LC_ADDRESS",
 191.284 ++      "LC_TELEPHONE", 
 191.285 ++      "LC_MEASUREMENT", 
 191.286 ++      "LC_IDENTIFICATION" 
 191.287 ++#endif
 191.288 ++    };
 191.289 ++}
 191.290 ++
 191.291 ++namespace std
 191.292 ++{
 191.293 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 191.294 ++}  // namespace std
 191.295 +--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.h
 191.296 ++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.h
 191.297 +@@ -0,0 +1,117 @@
 191.298 ++// Wrapper for underlying C-language localization -*- C++ -*-
 191.299 ++
 191.300 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 191.301 ++//
 191.302 ++// This file is part of the GNU ISO C++ Library.  This library is free
 191.303 ++// software; you can redistribute it and/or modify it under the
 191.304 ++// terms of the GNU General Public License as published by the
 191.305 ++// Free Software Foundation; either version 2, or (at your option)
 191.306 ++// any later version.
 191.307 ++
 191.308 ++// This library is distributed in the hope that it will be useful,
 191.309 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 191.310 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 191.311 ++// GNU General Public License for more details.
 191.312 ++
 191.313 ++// You should have received a copy of the GNU General Public License along
 191.314 ++// with this library; see the file COPYING.  If not, write to the Free
 191.315 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 191.316 ++// USA.
 191.317 ++
 191.318 ++// As a special exception, you may use this file as part of a free software
 191.319 ++// library without restriction.  Specifically, if other files instantiate
 191.320 ++// templates or use macros or inline functions from this file, or you compile
 191.321 ++// this file and link it with other files to produce an executable, this
 191.322 ++// file does not by itself cause the resulting executable to be covered by
 191.323 ++// the GNU General Public License.  This exception does not however
 191.324 ++// invalidate any other reasons why the executable file might be covered by
 191.325 ++// the GNU General Public License.
 191.326 ++
 191.327 ++//
 191.328 ++// ISO C++ 14882: 22.8  Standard locale categories.
 191.329 ++//
 191.330 ++
 191.331 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 191.332 ++
 191.333 ++#ifndef _C_LOCALE_H
 191.334 ++#define _C_LOCALE_H 1
 191.335 ++
 191.336 ++#pragma GCC system_header
 191.337 ++
 191.338 ++#include <cstring>              // get std::strlen
 191.339 ++#include <cstdio>               // get std::snprintf or std::sprintf
 191.340 ++#include <clocale>
 191.341 ++#include <langinfo.h>		// For codecvt
 191.342 ++#ifdef __UCLIBC_MJN3_ONLY__
 191.343 ++#warning fix this
 191.344 ++#endif
 191.345 ++#ifdef __UCLIBC_HAS_LOCALE__
 191.346 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 191.347 ++#endif
 191.348 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 191.349 ++#include <libintl.h> 		// For messages
 191.350 ++#endif
 191.351 ++
 191.352 ++#ifdef __UCLIBC_MJN3_ONLY__
 191.353 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 191.354 ++#endif
 191.355 ++#define _GLIBCXX_C_LOCALE_GNU 1
 191.356 ++
 191.357 ++#ifdef __UCLIBC_MJN3_ONLY__
 191.358 ++#warning fix categories
 191.359 ++#endif
 191.360 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 191.361 ++#define _GLIBCXX_NUM_CATEGORIES 0
 191.362 ++ 
 191.363 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.364 ++namespace __gnu_cxx
 191.365 ++{
 191.366 ++  extern "C" __typeof(uselocale) __uselocale;
 191.367 ++}
 191.368 ++#endif
 191.369 ++
 191.370 ++namespace std
 191.371 ++{
 191.372 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.373 ++  typedef __locale_t		__c_locale;
 191.374 ++#else
 191.375 ++  typedef int*			__c_locale;
 191.376 ++#endif
 191.377 ++
 191.378 ++  // Convert numeric value of type _Tv to string and return length of
 191.379 ++  // string.  If snprintf is available use it, otherwise fall back to
 191.380 ++  // the unsafe sprintf which, in general, can be dangerous and should
 191.381 ++  // be avoided.
 191.382 ++  template<typename _Tv>
 191.383 ++    int
 191.384 ++    __convert_from_v(char* __out, 
 191.385 ++		     const int __size __attribute__ ((__unused__)),
 191.386 ++		     const char* __fmt,
 191.387 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 191.388 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 191.389 ++    {
 191.390 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 191.391 ++#else
 191.392 ++		     _Tv __v, const __c_locale&, int __prec)
 191.393 ++    {
 191.394 ++# ifdef __UCLIBC_HAS_LOCALE__
 191.395 ++      char* __old = std::setlocale(LC_ALL, NULL);
 191.396 ++      char* __sav = new char[std::strlen(__old) + 1];
 191.397 ++      std::strcpy(__sav, __old);
 191.398 ++      std::setlocale(LC_ALL, "C");
 191.399 ++# endif
 191.400 ++#endif
 191.401 ++
 191.402 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 191.403 ++
 191.404 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 191.405 ++      __gnu_cxx::__uselocale(__old);
 191.406 ++#elif defined __UCLIBC_HAS_LOCALE__
 191.407 ++      std::setlocale(LC_ALL, __sav);
 191.408 ++      delete [] __sav;
 191.409 ++#endif
 191.410 ++      return __ret;
 191.411 ++    }
 191.412 ++}
 191.413 ++
 191.414 ++#endif
 191.415 +--- gcc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 191.416 ++++ gcc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 191.417 +@@ -0,0 +1,306 @@
 191.418 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 191.419 ++
 191.420 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 191.421 ++//
 191.422 ++// This file is part of the GNU ISO C++ Library.  This library is free
 191.423 ++// software; you can redistribute it and/or modify it under the
 191.424 ++// terms of the GNU General Public License as published by the
 191.425 ++// Free Software Foundation; either version 2, or (at your option)
 191.426 ++// any later version.
 191.427 ++
 191.428 ++// This library is distributed in the hope that it will be useful,
 191.429 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 191.430 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 191.431 ++// GNU General Public License for more details.
 191.432 ++
 191.433 ++// You should have received a copy of the GNU General Public License along
 191.434 ++// with this library; see the file COPYING.  If not, write to the Free
 191.435 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 191.436 ++// USA.
 191.437 ++
 191.438 ++// As a special exception, you may use this file as part of a free software
 191.439 ++// library without restriction.  Specifically, if other files instantiate
 191.440 ++// templates or use macros or inline functions from this file, or you compile
 191.441 ++// this file and link it with other files to produce an executable, this
 191.442 ++// file does not by itself cause the resulting executable to be covered by
 191.443 ++// the GNU General Public License.  This exception does not however
 191.444 ++// invalidate any other reasons why the executable file might be covered by
 191.445 ++// the GNU General Public License.
 191.446 ++
 191.447 ++//
 191.448 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 191.449 ++//
 191.450 ++
 191.451 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 191.452 ++
 191.453 ++#include <locale>
 191.454 ++#include <bits/c++locale_internal.h>
 191.455 ++
 191.456 ++namespace std
 191.457 ++{
 191.458 ++  // Specializations.
 191.459 ++#ifdef _GLIBCXX_USE_WCHAR_T
 191.460 ++  codecvt_base::result
 191.461 ++  codecvt<wchar_t, char, mbstate_t>::
 191.462 ++  do_out(state_type& __state, const intern_type* __from, 
 191.463 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 191.464 ++	 extern_type* __to, extern_type* __to_end,
 191.465 ++	 extern_type*& __to_next) const
 191.466 ++  {
 191.467 ++    result __ret = ok;
 191.468 ++    state_type __tmp_state(__state);
 191.469 ++
 191.470 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.471 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 191.472 ++#endif
 191.473 ++
 191.474 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 191.475 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 191.476 ++    // NB: wcsnrtombs is a GNU extension
 191.477 ++    for (__from_next = __from, __to_next = __to;
 191.478 ++	 __from_next < __from_end && __to_next < __to_end
 191.479 ++	 && __ret == ok;)
 191.480 ++      {
 191.481 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 191.482 ++						      __from_end - __from_next);
 191.483 ++	if (!__from_chunk_end)
 191.484 ++	  __from_chunk_end = __from_end;
 191.485 ++
 191.486 ++	__from = __from_next;
 191.487 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 191.488 ++					 __from_chunk_end - __from_next,
 191.489 ++					 __to_end - __to_next, &__state);
 191.490 ++	if (__conv == static_cast<size_t>(-1))
 191.491 ++	  {
 191.492 ++	    // In case of error, in order to stop at the exact place we
 191.493 ++	    // have to start again from the beginning with a series of
 191.494 ++	    // wcrtomb.
 191.495 ++	    for (; __from < __from_next; ++__from)
 191.496 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 191.497 ++	    __state = __tmp_state;
 191.498 ++	    __ret = error;
 191.499 ++	  }
 191.500 ++	else if (__from_next && __from_next < __from_chunk_end)
 191.501 ++	  {
 191.502 ++	    __to_next += __conv;
 191.503 ++	    __ret = partial;
 191.504 ++	  }
 191.505 ++	else
 191.506 ++	  {
 191.507 ++	    __from_next = __from_chunk_end;
 191.508 ++	    __to_next += __conv;
 191.509 ++	  }
 191.510 ++
 191.511 ++	if (__from_next < __from_end && __ret == ok)
 191.512 ++	  {
 191.513 ++	    extern_type __buf[MB_LEN_MAX];
 191.514 ++	    __tmp_state = __state;
 191.515 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 191.516 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 191.517 ++	      __ret = partial;
 191.518 ++	    else
 191.519 ++	      {
 191.520 ++		memcpy(__to_next, __buf, __conv);
 191.521 ++		__state = __tmp_state;
 191.522 ++		__to_next += __conv;
 191.523 ++		++__from_next;
 191.524 ++	      }
 191.525 ++	  }
 191.526 ++      }
 191.527 ++
 191.528 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.529 ++    __uselocale(__old);
 191.530 ++#endif
 191.531 ++
 191.532 ++    return __ret; 
 191.533 ++  }
 191.534 ++  
 191.535 ++  codecvt_base::result
 191.536 ++  codecvt<wchar_t, char, mbstate_t>::
 191.537 ++  do_in(state_type& __state, const extern_type* __from, 
 191.538 ++	const extern_type* __from_end, const extern_type*& __from_next,
 191.539 ++	intern_type* __to, intern_type* __to_end,
 191.540 ++	intern_type*& __to_next) const
 191.541 ++  {
 191.542 ++    result __ret = ok;
 191.543 ++    state_type __tmp_state(__state);
 191.544 ++
 191.545 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.546 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 191.547 ++#endif
 191.548 ++
 191.549 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 191.550 ++    // in case we store a L'\0' and then continue, in a loop.
 191.551 ++    // NB: mbsnrtowcs is a GNU extension
 191.552 ++    for (__from_next = __from, __to_next = __to;
 191.553 ++	 __from_next < __from_end && __to_next < __to_end
 191.554 ++	 && __ret == ok;)
 191.555 ++      {
 191.556 ++	const extern_type* __from_chunk_end;
 191.557 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 191.558 ++								  __from_end
 191.559 ++								  - __from_next));
 191.560 ++	if (!__from_chunk_end)
 191.561 ++	  __from_chunk_end = __from_end;
 191.562 ++
 191.563 ++	__from = __from_next;
 191.564 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 191.565 ++				   __from_chunk_end - __from_next,
 191.566 ++				   __to_end - __to_next, &__state);
 191.567 ++	if (__conv == static_cast<size_t>(-1))
 191.568 ++	  {
 191.569 ++	    // In case of error, in order to stop at the exact place we
 191.570 ++	    // have to start again from the beginning with a series of
 191.571 ++	    // mbrtowc.
 191.572 ++	    for (;; ++__to_next, __from += __conv)
 191.573 ++	      {
 191.574 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 191.575 ++				 &__tmp_state);
 191.576 ++		if (__conv == static_cast<size_t>(-1)
 191.577 ++		    || __conv == static_cast<size_t>(-2))
 191.578 ++		  break;
 191.579 ++	      }
 191.580 ++	    __from_next = __from;
 191.581 ++	    __state = __tmp_state;	    
 191.582 ++	    __ret = error;
 191.583 ++	  }
 191.584 ++	else if (__from_next && __from_next < __from_chunk_end)
 191.585 ++	  {
 191.586 ++	    // It is unclear what to return in this case (see DR 382). 
 191.587 ++	    __to_next += __conv;
 191.588 ++	    __ret = partial;
 191.589 ++	  }
 191.590 ++	else
 191.591 ++	  {
 191.592 ++	    __from_next = __from_chunk_end;
 191.593 ++	    __to_next += __conv;
 191.594 ++	  }
 191.595 ++
 191.596 ++	if (__from_next < __from_end && __ret == ok)
 191.597 ++	  {
 191.598 ++	    if (__to_next < __to_end)
 191.599 ++	      {
 191.600 ++		// XXX Probably wrong for stateful encodings
 191.601 ++		__tmp_state = __state;		
 191.602 ++		++__from_next;
 191.603 ++		*__to_next++ = L'\0';
 191.604 ++	      }
 191.605 ++	    else
 191.606 ++	      __ret = partial;
 191.607 ++	  }
 191.608 ++      }
 191.609 ++
 191.610 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.611 ++    __uselocale(__old);
 191.612 ++#endif
 191.613 ++
 191.614 ++    return __ret; 
 191.615 ++  }
 191.616 ++
 191.617 ++  int 
 191.618 ++  codecvt<wchar_t, char, mbstate_t>::
 191.619 ++  do_encoding() const throw()
 191.620 ++  {
 191.621 ++    // XXX This implementation assumes that the encoding is
 191.622 ++    // stateless and is either single-byte or variable-width.
 191.623 ++    int __ret = 0;
 191.624 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.625 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 191.626 ++#endif
 191.627 ++    if (MB_CUR_MAX == 1)
 191.628 ++      __ret = 1;
 191.629 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.630 ++    __uselocale(__old);
 191.631 ++#endif
 191.632 ++    return __ret;
 191.633 ++  }  
 191.634 ++
 191.635 ++  int 
 191.636 ++  codecvt<wchar_t, char, mbstate_t>::
 191.637 ++  do_max_length() const throw()
 191.638 ++  {
 191.639 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.640 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 191.641 ++#endif
 191.642 ++    // XXX Probably wrong for stateful encodings.
 191.643 ++    int __ret = MB_CUR_MAX;
 191.644 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.645 ++    __uselocale(__old);
 191.646 ++#endif
 191.647 ++    return __ret;
 191.648 ++  }
 191.649 ++  
 191.650 ++  int 
 191.651 ++  codecvt<wchar_t, char, mbstate_t>::
 191.652 ++  do_length(state_type& __state, const extern_type* __from,
 191.653 ++	    const extern_type* __end, size_t __max) const
 191.654 ++  {
 191.655 ++    int __ret = 0;
 191.656 ++    state_type __tmp_state(__state);
 191.657 ++
 191.658 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.659 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 191.660 ++#endif
 191.661 ++
 191.662 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 191.663 ++    // in case we advance past it and then continue, in a loop.
 191.664 ++    // NB: mbsnrtowcs is a GNU extension
 191.665 ++  
 191.666 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 191.667 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 191.668 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 191.669 ++							   * __max));
 191.670 ++    while (__from < __end && __max)
 191.671 ++      {
 191.672 ++	const extern_type* __from_chunk_end;
 191.673 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 191.674 ++								  __end
 191.675 ++								  - __from));
 191.676 ++	if (!__from_chunk_end)
 191.677 ++	  __from_chunk_end = __end;
 191.678 ++
 191.679 ++	const extern_type* __tmp_from = __from;
 191.680 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 191.681 ++				   __from_chunk_end - __from,
 191.682 ++				   __max, &__state);
 191.683 ++	if (__conv == static_cast<size_t>(-1))
 191.684 ++	  {
 191.685 ++	    // In case of error, in order to stop at the exact place we
 191.686 ++	    // have to start again from the beginning with a series of
 191.687 ++	    // mbrtowc.
 191.688 ++	    for (__from = __tmp_from;; __from += __conv)
 191.689 ++	      {
 191.690 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 191.691 ++				 &__tmp_state);
 191.692 ++		if (__conv == static_cast<size_t>(-1)
 191.693 ++		    || __conv == static_cast<size_t>(-2))
 191.694 ++		  break;
 191.695 ++	      }
 191.696 ++	    __state = __tmp_state;
 191.697 ++	    __ret += __from - __tmp_from;
 191.698 ++	    break;
 191.699 ++	  }
 191.700 ++	if (!__from)
 191.701 ++	  __from = __from_chunk_end;
 191.702 ++	
 191.703 ++	__ret += __from - __tmp_from;
 191.704 ++	__max -= __conv;
 191.705 ++
 191.706 ++	if (__from < __end && __max)
 191.707 ++	  {
 191.708 ++	    // XXX Probably wrong for stateful encodings
 191.709 ++	    __tmp_state = __state;
 191.710 ++	    ++__from;
 191.711 ++	    ++__ret;
 191.712 ++	    --__max;
 191.713 ++	  }
 191.714 ++      }
 191.715 ++
 191.716 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.717 ++    __uselocale(__old);
 191.718 ++#endif
 191.719 ++
 191.720 ++    return __ret; 
 191.721 ++  }
 191.722 ++#endif
 191.723 ++}
 191.724 +--- gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc
 191.725 ++++ gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc
 191.726 +@@ -0,0 +1,80 @@
 191.727 ++// std::collate implementation details, GNU version -*- C++ -*-
 191.728 ++
 191.729 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 191.730 ++//
 191.731 ++// This file is part of the GNU ISO C++ Library.  This library is free
 191.732 ++// software; you can redistribute it and/or modify it under the
 191.733 ++// terms of the GNU General Public License as published by the
 191.734 ++// Free Software Foundation; either version 2, or (at your option)
 191.735 ++// any later version.
 191.736 ++
 191.737 ++// This library is distributed in the hope that it will be useful,
 191.738 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 191.739 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 191.740 ++// GNU General Public License for more details.
 191.741 ++
 191.742 ++// You should have received a copy of the GNU General Public License along
 191.743 ++// with this library; see the file COPYING.  If not, write to the Free
 191.744 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 191.745 ++// USA.
 191.746 ++
 191.747 ++// As a special exception, you may use this file as part of a free software
 191.748 ++// library without restriction.  Specifically, if other files instantiate
 191.749 ++// templates or use macros or inline functions from this file, or you compile
 191.750 ++// this file and link it with other files to produce an executable, this
 191.751 ++// file does not by itself cause the resulting executable to be covered by
 191.752 ++// the GNU General Public License.  This exception does not however
 191.753 ++// invalidate any other reasons why the executable file might be covered by
 191.754 ++// the GNU General Public License.
 191.755 ++
 191.756 ++//
 191.757 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 191.758 ++//
 191.759 ++
 191.760 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 191.761 ++
 191.762 ++#include <locale>
 191.763 ++#include <bits/c++locale_internal.h>
 191.764 ++
 191.765 ++#ifndef __UCLIBC_HAS_XLOCALE__
 191.766 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 191.767 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 191.768 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 191.769 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 191.770 ++#endif
 191.771 ++
 191.772 ++namespace std
 191.773 ++{
 191.774 ++  // These are basically extensions to char_traits, and perhaps should
 191.775 ++  // be put there instead of here.
 191.776 ++  template<>
 191.777 ++    int 
 191.778 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 191.779 ++    { 
 191.780 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 191.781 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 191.782 ++    }
 191.783 ++  
 191.784 ++  template<>
 191.785 ++    size_t
 191.786 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 191.787 ++				size_t __n) const 
 191.788 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 191.789 ++
 191.790 ++#ifdef _GLIBCXX_USE_WCHAR_T
 191.791 ++  template<>
 191.792 ++    int 
 191.793 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 191.794 ++				 const wchar_t* __two) const
 191.795 ++    {
 191.796 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 191.797 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 191.798 ++    }
 191.799 ++  
 191.800 ++  template<>
 191.801 ++    size_t
 191.802 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 191.803 ++				   size_t __n) const
 191.804 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 191.805 ++#endif
 191.806 ++}
 191.807 +--- gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 191.808 ++++ gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 191.809 +@@ -0,0 +1,300 @@
 191.810 ++// std::ctype implementation details, GNU version -*- C++ -*-
 191.811 ++
 191.812 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 191.813 ++//
 191.814 ++// This file is part of the GNU ISO C++ Library.  This library is free
 191.815 ++// software; you can redistribute it and/or modify it under the
 191.816 ++// terms of the GNU General Public License as published by the
 191.817 ++// Free Software Foundation; either version 2, or (at your option)
 191.818 ++// any later version.
 191.819 ++
 191.820 ++// This library is distributed in the hope that it will be useful,
 191.821 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 191.822 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 191.823 ++// GNU General Public License for more details.
 191.824 ++
 191.825 ++// You should have received a copy of the GNU General Public License along
 191.826 ++// with this library; see the file COPYING.  If not, write to the Free
 191.827 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 191.828 ++// USA.
 191.829 ++
 191.830 ++// As a special exception, you may use this file as part of a free software
 191.831 ++// library without restriction.  Specifically, if other files instantiate
 191.832 ++// templates or use macros or inline functions from this file, or you compile
 191.833 ++// this file and link it with other files to produce an executable, this
 191.834 ++// file does not by itself cause the resulting executable to be covered by
 191.835 ++// the GNU General Public License.  This exception does not however
 191.836 ++// invalidate any other reasons why the executable file might be covered by
 191.837 ++// the GNU General Public License.
 191.838 ++
 191.839 ++//
 191.840 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 191.841 ++//
 191.842 ++
 191.843 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 191.844 ++
 191.845 ++#define _LIBC
 191.846 ++#include <locale>
 191.847 ++#undef _LIBC
 191.848 ++#include <bits/c++locale_internal.h>
 191.849 ++
 191.850 ++#ifndef __UCLIBC_HAS_XLOCALE__
 191.851 ++#define __wctype_l(S, L)           wctype((S))
 191.852 ++#define __towupper_l(C, L)         towupper((C))
 191.853 ++#define __towlower_l(C, L)         towlower((C))
 191.854 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 191.855 ++#endif
 191.856 ++
 191.857 ++namespace std
 191.858 ++{
 191.859 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 191.860 ++  // various /config/os/* files.
 191.861 ++  template<>
 191.862 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 191.863 ++    : ctype<char>(0, false, __refs) 
 191.864 ++    { 		
 191.865 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 191.866 ++	{
 191.867 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 191.868 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 191.869 ++#ifdef __UCLIBC_HAS_XLOCALE__
 191.870 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 191.871 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 191.872 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 191.873 ++#endif
 191.874 ++	}
 191.875 ++    }
 191.876 ++
 191.877 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 191.878 ++  ctype<wchar_t>::__wmask_type
 191.879 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 191.880 ++  {
 191.881 ++    __wmask_type __ret;
 191.882 ++    switch (__m)
 191.883 ++      {
 191.884 ++      case space:
 191.885 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 191.886 ++	break;
 191.887 ++      case print:
 191.888 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 191.889 ++	break;
 191.890 ++      case cntrl:
 191.891 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 191.892 ++	break;
 191.893 ++      case upper:
 191.894 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 191.895 ++	break;
 191.896 ++      case lower:
 191.897 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 191.898 ++	break;
 191.899 ++      case alpha:
 191.900 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 191.901 ++	break;
 191.902 ++      case digit:
 191.903 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 191.904 ++	break;
 191.905 ++      case punct:
 191.906 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 191.907 ++	break;
 191.908 ++      case xdigit:
 191.909 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 191.910 ++	break;
 191.911 ++      case alnum:
 191.912 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 191.913 ++	break;
 191.914 ++      case graph:
 191.915 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 191.916 ++	break;
 191.917 ++      default:
 191.918 ++	__ret = __wmask_type();
 191.919 ++      }
 191.920 ++    return __ret;
 191.921 ++  }
 191.922 ++  
 191.923 ++  wchar_t
 191.924 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 191.925 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 191.926 ++
 191.927 ++  const wchar_t*
 191.928 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 191.929 ++  {
 191.930 ++    while (__lo < __hi)
 191.931 ++      {
 191.932 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 191.933 ++        ++__lo;
 191.934 ++      }
 191.935 ++    return __hi;
 191.936 ++  }
 191.937 ++  
 191.938 ++  wchar_t
 191.939 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 191.940 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 191.941 ++  
 191.942 ++  const wchar_t*
 191.943 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 191.944 ++  {
 191.945 ++    while (__lo < __hi)
 191.946 ++      {
 191.947 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 191.948 ++        ++__lo;
 191.949 ++      }
 191.950 ++    return __hi;
 191.951 ++  }
 191.952 ++
 191.953 ++  bool
 191.954 ++  ctype<wchar_t>::
 191.955 ++  do_is(mask __m, wchar_t __c) const
 191.956 ++  { 
 191.957 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
 191.958 ++    // library for blank.
 191.959 ++    bool __ret = false;
 191.960 ++    const size_t __bitmasksize = 11; 
 191.961 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 191.962 ++      if (__m & _M_bit[__bitcur]
 191.963 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 191.964 ++	{
 191.965 ++	  __ret = true;
 191.966 ++	  break;
 191.967 ++	}
 191.968 ++    return __ret;    
 191.969 ++  }
 191.970 ++  
 191.971 ++  const wchar_t* 
 191.972 ++  ctype<wchar_t>::
 191.973 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 191.974 ++  {
 191.975 ++    for (; __lo < __hi; ++__vec, ++__lo)
 191.976 ++      {
 191.977 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 191.978 ++	// library for blank.
 191.979 ++	const size_t __bitmasksize = 11; 
 191.980 ++	mask __m = 0;
 191.981 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 191.982 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 191.983 ++	    __m |= _M_bit[__bitcur];
 191.984 ++	*__vec = __m;
 191.985 ++      }
 191.986 ++    return __hi;
 191.987 ++  }
 191.988 ++  
 191.989 ++  const wchar_t* 
 191.990 ++  ctype<wchar_t>::
 191.991 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 191.992 ++  {
 191.993 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
 191.994 ++      ++__lo;
 191.995 ++    return __lo;
 191.996 ++  }
 191.997 ++
 191.998 ++  const wchar_t*
 191.999 ++  ctype<wchar_t>::
191.1000 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
191.1001 ++  {
191.1002 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
191.1003 ++      ++__lo;
191.1004 ++    return __lo;
191.1005 ++  }
191.1006 ++
191.1007 ++  wchar_t
191.1008 ++  ctype<wchar_t>::
191.1009 ++  do_widen(char __c) const
191.1010 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
191.1011 ++
191.1012 ++  const char* 
191.1013 ++  ctype<wchar_t>::
191.1014 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
191.1015 ++  {
191.1016 ++    while (__lo < __hi)
191.1017 ++      {
191.1018 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
191.1019 ++	++__lo;
191.1020 ++	++__dest;
191.1021 ++      }
191.1022 ++    return __hi;
191.1023 ++  }
191.1024 ++
191.1025 ++  char
191.1026 ++  ctype<wchar_t>::
191.1027 ++  do_narrow(wchar_t __wc, char __dfault) const
191.1028 ++  {
191.1029 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
191.1030 ++      return _M_narrow[__wc];
191.1031 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1032 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
191.1033 ++#endif
191.1034 ++    const int __c = wctob(__wc);
191.1035 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1036 ++    __uselocale(__old);
191.1037 ++#endif
191.1038 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
191.1039 ++  }
191.1040 ++
191.1041 ++  const wchar_t*
191.1042 ++  ctype<wchar_t>::
191.1043 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
191.1044 ++	    char* __dest) const
191.1045 ++  {
191.1046 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1047 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
191.1048 ++#endif
191.1049 ++    if (_M_narrow_ok)
191.1050 ++      while (__lo < __hi)
191.1051 ++	{
191.1052 ++	  if (*__lo >= 0 && *__lo < 128)
191.1053 ++	    *__dest = _M_narrow[*__lo];
191.1054 ++	  else
191.1055 ++	    {
191.1056 ++	      const int __c = wctob(*__lo);
191.1057 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
191.1058 ++	    }
191.1059 ++	  ++__lo;
191.1060 ++	  ++__dest;
191.1061 ++	}
191.1062 ++    else
191.1063 ++      while (__lo < __hi)
191.1064 ++	{
191.1065 ++	  const int __c = wctob(*__lo);
191.1066 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
191.1067 ++	  ++__lo;
191.1068 ++	  ++__dest;
191.1069 ++	}
191.1070 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1071 ++    __uselocale(__old);
191.1072 ++#endif
191.1073 ++    return __hi;
191.1074 ++  }
191.1075 ++
191.1076 ++  void
191.1077 ++  ctype<wchar_t>::_M_initialize_ctype()
191.1078 ++  {
191.1079 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1080 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
191.1081 ++#endif
191.1082 ++    wint_t __i;
191.1083 ++    for (__i = 0; __i < 128; ++__i)
191.1084 ++      {
191.1085 ++	const int __c = wctob(__i);
191.1086 ++	if (__c == EOF)
191.1087 ++	  break;
191.1088 ++	else
191.1089 ++	  _M_narrow[__i] = static_cast<char>(__c);
191.1090 ++      }
191.1091 ++    if (__i == 128)
191.1092 ++      _M_narrow_ok = true;
191.1093 ++    else
191.1094 ++      _M_narrow_ok = false;
191.1095 ++    for (size_t __j = 0;
191.1096 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
191.1097 ++      _M_widen[__j] = btowc(__j);
191.1098 ++
191.1099 ++    for (size_t __k = 0; __k <= 11; ++__k)
191.1100 ++      { 
191.1101 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
191.1102 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
191.1103 ++      }
191.1104 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1105 ++    __uselocale(__old);
191.1106 ++#endif
191.1107 ++  }
191.1108 ++#endif //  _GLIBCXX_USE_WCHAR_T
191.1109 ++}
191.1110 +--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc
191.1111 ++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc
191.1112 +@@ -0,0 +1,100 @@
191.1113 ++// std::messages implementation details, GNU version -*- C++ -*-
191.1114 ++
191.1115 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
191.1116 ++//
191.1117 ++// This file is part of the GNU ISO C++ Library.  This library is free
191.1118 ++// software; you can redistribute it and/or modify it under the
191.1119 ++// terms of the GNU General Public License as published by the
191.1120 ++// Free Software Foundation; either version 2, or (at your option)
191.1121 ++// any later version.
191.1122 ++
191.1123 ++// This library is distributed in the hope that it will be useful,
191.1124 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
191.1125 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
191.1126 ++// GNU General Public License for more details.
191.1127 ++
191.1128 ++// You should have received a copy of the GNU General Public License along
191.1129 ++// with this library; see the file COPYING.  If not, write to the Free
191.1130 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
191.1131 ++// USA.
191.1132 ++
191.1133 ++// As a special exception, you may use this file as part of a free software
191.1134 ++// library without restriction.  Specifically, if other files instantiate
191.1135 ++// templates or use macros or inline functions from this file, or you compile
191.1136 ++// this file and link it with other files to produce an executable, this
191.1137 ++// file does not by itself cause the resulting executable to be covered by
191.1138 ++// the GNU General Public License.  This exception does not however
191.1139 ++// invalidate any other reasons why the executable file might be covered by
191.1140 ++// the GNU General Public License.
191.1141 ++
191.1142 ++//
191.1143 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
191.1144 ++//
191.1145 ++
191.1146 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
191.1147 ++
191.1148 ++#include <locale>
191.1149 ++#include <bits/c++locale_internal.h>
191.1150 ++
191.1151 ++#ifdef __UCLIBC_MJN3_ONLY__
191.1152 ++#warning fix gettext stuff
191.1153 ++#endif
191.1154 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
191.1155 ++extern "C" char *__dcgettext(const char *domainname,
191.1156 ++			     const char *msgid, int category);
191.1157 ++#undef gettext
191.1158 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
191.1159 ++#else
191.1160 ++#undef gettext
191.1161 ++#define gettext(msgid) (msgid)
191.1162 ++#endif
191.1163 ++
191.1164 ++namespace std
191.1165 ++{
191.1166 ++  // Specializations.
191.1167 ++  template<>
191.1168 ++    string
191.1169 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
191.1170 ++    {
191.1171 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1172 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
191.1173 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
191.1174 ++      __uselocale(__old);
191.1175 ++      return string(__msg);
191.1176 ++#elif defined __UCLIBC_HAS_LOCALE__
191.1177 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
191.1178 ++      setlocale(LC_ALL, _M_name_messages);
191.1179 ++      const char* __msg = gettext(__dfault.c_str());
191.1180 ++      setlocale(LC_ALL, __old);
191.1181 ++      free(__old);
191.1182 ++      return string(__msg);
191.1183 ++#else
191.1184 ++      const char* __msg = gettext(__dfault.c_str());
191.1185 ++      return string(__msg);
191.1186 ++#endif
191.1187 ++    }
191.1188 ++
191.1189 ++#ifdef _GLIBCXX_USE_WCHAR_T
191.1190 ++  template<>
191.1191 ++    wstring
191.1192 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
191.1193 ++    {
191.1194 ++# ifdef __UCLIBC_HAS_XLOCALE__
191.1195 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
191.1196 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
191.1197 ++      __uselocale(__old);
191.1198 ++      return _M_convert_from_char(__msg);
191.1199 ++# elif defined __UCLIBC_HAS_LOCALE__
191.1200 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
191.1201 ++      setlocale(LC_ALL, _M_name_messages);
191.1202 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
191.1203 ++      setlocale(LC_ALL, __old);
191.1204 ++      free(__old);
191.1205 ++      return _M_convert_from_char(__msg);
191.1206 ++# else
191.1207 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
191.1208 ++      return _M_convert_from_char(__msg);
191.1209 ++# endif
191.1210 ++    }
191.1211 ++#endif
191.1212 ++}
191.1213 +--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.h
191.1214 ++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.h
191.1215 +@@ -0,0 +1,118 @@
191.1216 ++// std::messages implementation details, GNU version -*- C++ -*-
191.1217 ++
191.1218 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
191.1219 ++//
191.1220 ++// This file is part of the GNU ISO C++ Library.  This library is free
191.1221 ++// software; you can redistribute it and/or modify it under the
191.1222 ++// terms of the GNU General Public License as published by the
191.1223 ++// Free Software Foundation; either version 2, or (at your option)
191.1224 ++// any later version.
191.1225 ++
191.1226 ++// This library is distributed in the hope that it will be useful,
191.1227 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
191.1228 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
191.1229 ++// GNU General Public License for more details.
191.1230 ++
191.1231 ++// You should have received a copy of the GNU General Public License along
191.1232 ++// with this library; see the file COPYING.  If not, write to the Free
191.1233 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
191.1234 ++// USA.
191.1235 ++
191.1236 ++// As a special exception, you may use this file as part of a free software
191.1237 ++// library without restriction.  Specifically, if other files instantiate
191.1238 ++// templates or use macros or inline functions from this file, or you compile
191.1239 ++// this file and link it with other files to produce an executable, this
191.1240 ++// file does not by itself cause the resulting executable to be covered by
191.1241 ++// the GNU General Public License.  This exception does not however
191.1242 ++// invalidate any other reasons why the executable file might be covered by
191.1243 ++// the GNU General Public License.
191.1244 ++
191.1245 ++//
191.1246 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
191.1247 ++//
191.1248 ++
191.1249 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
191.1250 ++
191.1251 ++#ifdef __UCLIBC_MJN3_ONLY__
191.1252 ++#warning fix prototypes for *textdomain funcs
191.1253 ++#endif
191.1254 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
191.1255 ++extern "C" char *__textdomain(const char *domainname);
191.1256 ++extern "C" char *__bindtextdomain(const char *domainname,
191.1257 ++				  const char *dirname);
191.1258 ++#else
191.1259 ++#undef __textdomain
191.1260 ++#undef __bindtextdomain
191.1261 ++#define __textdomain(D)           ((void)0)
191.1262 ++#define __bindtextdomain(D,P)     ((void)0)
191.1263 ++#endif
191.1264 ++
191.1265 ++  // Non-virtual member functions.
191.1266 ++  template<typename _CharT>
191.1267 ++     messages<_CharT>::messages(size_t __refs)
191.1268 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
191.1269 ++     _M_name_messages(_S_get_c_name())
191.1270 ++     { }
191.1271 ++
191.1272 ++  template<typename _CharT>
191.1273 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
191.1274 ++				size_t __refs) 
191.1275 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
191.1276 ++     _M_name_messages(__s)
191.1277 ++     {
191.1278 ++       char* __tmp = new char[std::strlen(__s) + 1];
191.1279 ++       std::strcpy(__tmp, __s);
191.1280 ++       _M_name_messages = __tmp;
191.1281 ++     }
191.1282 ++
191.1283 ++  template<typename _CharT>
191.1284 ++    typename messages<_CharT>::catalog 
191.1285 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
191.1286 ++			   const char* __dir) const
191.1287 ++    { 
191.1288 ++      __bindtextdomain(__s.c_str(), __dir);
191.1289 ++      return this->do_open(__s, __loc); 
191.1290 ++    }
191.1291 ++
191.1292 ++  // Virtual member functions.
191.1293 ++  template<typename _CharT>
191.1294 ++    messages<_CharT>::~messages()
191.1295 ++    { 
191.1296 ++      if (_M_name_messages != _S_get_c_name())
191.1297 ++	delete [] _M_name_messages;
191.1298 ++      _S_destroy_c_locale(_M_c_locale_messages); 
191.1299 ++    }
191.1300 ++
191.1301 ++  template<typename _CharT>
191.1302 ++    typename messages<_CharT>::catalog 
191.1303 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
191.1304 ++			      const locale&) const
191.1305 ++    { 
191.1306 ++      // No error checking is done, assume the catalog exists and can
191.1307 ++      // be used.
191.1308 ++      __textdomain(__s.c_str());
191.1309 ++      return 0;
191.1310 ++    }
191.1311 ++
191.1312 ++  template<typename _CharT>
191.1313 ++    void    
191.1314 ++    messages<_CharT>::do_close(catalog) const 
191.1315 ++    { }
191.1316 ++
191.1317 ++   // messages_byname
191.1318 ++   template<typename _CharT>
191.1319 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
191.1320 ++     : messages<_CharT>(__refs) 
191.1321 ++     { 
191.1322 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
191.1323 ++	 delete [] this->_M_name_messages;
191.1324 ++       char* __tmp = new char[std::strlen(__s) + 1];
191.1325 ++       std::strcpy(__tmp, __s);
191.1326 ++       this->_M_name_messages = __tmp;
191.1327 ++
191.1328 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
191.1329 ++	 {
191.1330 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
191.1331 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
191.1332 ++	 }
191.1333 ++     }
191.1334 +--- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
191.1335 ++++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
191.1336 +@@ -0,0 +1,692 @@
191.1337 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
191.1338 ++
191.1339 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
191.1340 ++//
191.1341 ++// This file is part of the GNU ISO C++ Library.  This library is free
191.1342 ++// software; you can redistribute it and/or modify it under the
191.1343 ++// terms of the GNU General Public License as published by the
191.1344 ++// Free Software Foundation; either version 2, or (at your option)
191.1345 ++// any later version.
191.1346 ++
191.1347 ++// This library is distributed in the hope that it will be useful,
191.1348 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
191.1349 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
191.1350 ++// GNU General Public License for more details.
191.1351 ++
191.1352 ++// You should have received a copy of the GNU General Public License along
191.1353 ++// with this library; see the file COPYING.  If not, write to the Free
191.1354 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
191.1355 ++// USA.
191.1356 ++
191.1357 ++// As a special exception, you may use this file as part of a free software
191.1358 ++// library without restriction.  Specifically, if other files instantiate
191.1359 ++// templates or use macros or inline functions from this file, or you compile
191.1360 ++// this file and link it with other files to produce an executable, this
191.1361 ++// file does not by itself cause the resulting executable to be covered by
191.1362 ++// the GNU General Public License.  This exception does not however
191.1363 ++// invalidate any other reasons why the executable file might be covered by
191.1364 ++// the GNU General Public License.
191.1365 ++
191.1366 ++//
191.1367 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
191.1368 ++//
191.1369 ++
191.1370 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
191.1371 ++
191.1372 ++#define _LIBC
191.1373 ++#include <locale>
191.1374 ++#undef _LIBC
191.1375 ++#include <bits/c++locale_internal.h>
191.1376 ++
191.1377 ++#ifdef __UCLIBC_MJN3_ONLY__
191.1378 ++#warning optimize this for uclibc
191.1379 ++#warning tailor for stub locale support
191.1380 ++#endif
191.1381 ++
191.1382 ++#ifndef __UCLIBC_HAS_XLOCALE__
191.1383 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
191.1384 ++#endif
191.1385 ++
191.1386 ++namespace std
191.1387 ++{
191.1388 ++  // Construct and return valid pattern consisting of some combination of:
191.1389 ++  // space none symbol sign value
191.1390 ++  money_base::pattern
191.1391 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
191.1392 ++  { 
191.1393 ++    pattern __ret;
191.1394 ++
191.1395 ++    // This insanely complicated routine attempts to construct a valid
191.1396 ++    // pattern for use with monyepunct. A couple of invariants:
191.1397 ++
191.1398 ++    // if (__precedes) symbol -> value
191.1399 ++    // else value -> symbol
191.1400 ++    
191.1401 ++    // if (__space) space
191.1402 ++    // else none
191.1403 ++
191.1404 ++    // none == never first
191.1405 ++    // space never first or last
191.1406 ++
191.1407 ++    // Any elegant implementations of this are welcome.
191.1408 ++    switch (__posn)
191.1409 ++      {
191.1410 ++      case 0:
191.1411 ++      case 1:
191.1412 ++	// 1 The sign precedes the value and symbol.
191.1413 ++	__ret.field[0] = sign;
191.1414 ++	if (__space)
191.1415 ++	  {
191.1416 ++	    // Pattern starts with sign.
191.1417 ++	    if (__precedes)
191.1418 ++	      {
191.1419 ++		__ret.field[1] = symbol;
191.1420 ++		__ret.field[3] = value;
191.1421 ++	      }
191.1422 ++	    else
191.1423 ++	      {
191.1424 ++		__ret.field[1] = value;
191.1425 ++		__ret.field[3] = symbol;
191.1426 ++	      }
191.1427 ++	    __ret.field[2] = space;
191.1428 ++	  }
191.1429 ++	else
191.1430 ++	  {
191.1431 ++	    // Pattern starts with sign and ends with none.
191.1432 ++	    if (__precedes)
191.1433 ++	      {
191.1434 ++		__ret.field[1] = symbol;
191.1435 ++		__ret.field[2] = value;
191.1436 ++	      }
191.1437 ++	    else
191.1438 ++	      {
191.1439 ++		__ret.field[1] = value;
191.1440 ++		__ret.field[2] = symbol;
191.1441 ++	      }
191.1442 ++	    __ret.field[3] = none;
191.1443 ++	  }
191.1444 ++	break;
191.1445 ++      case 2:
191.1446 ++	// 2 The sign follows the value and symbol.
191.1447 ++	if (__space)
191.1448 ++	  {
191.1449 ++	    // Pattern either ends with sign.
191.1450 ++	    if (__precedes)
191.1451 ++	      {
191.1452 ++		__ret.field[0] = symbol;
191.1453 ++		__ret.field[2] = value;
191.1454 ++	      }
191.1455 ++	    else
191.1456 ++	      {
191.1457 ++		__ret.field[0] = value;
191.1458 ++		__ret.field[2] = symbol;
191.1459 ++	      }
191.1460 ++	    __ret.field[1] = space;
191.1461 ++	    __ret.field[3] = sign;
191.1462 ++	  }
191.1463 ++	else
191.1464 ++	  {
191.1465 ++	    // Pattern ends with sign then none.
191.1466 ++	    if (__precedes)
191.1467 ++	      {
191.1468 ++		__ret.field[0] = symbol;
191.1469 ++		__ret.field[1] = value;
191.1470 ++	      }
191.1471 ++	    else
191.1472 ++	      {
191.1473 ++		__ret.field[0] = value;
191.1474 ++		__ret.field[1] = symbol;
191.1475 ++	      }
191.1476 ++	    __ret.field[2] = sign;
191.1477 ++	    __ret.field[3] = none;
191.1478 ++	  }
191.1479 ++	break;
191.1480 ++      case 3:
191.1481 ++	// 3 The sign immediately precedes the symbol.
191.1482 ++	if (__precedes)
191.1483 ++	  {
191.1484 ++	    __ret.field[0] = sign;
191.1485 ++	    __ret.field[1] = symbol;	    
191.1486 ++	    if (__space)
191.1487 ++	      {
191.1488 ++		__ret.field[2] = space;
191.1489 ++		__ret.field[3] = value;
191.1490 ++	      }
191.1491 ++	    else
191.1492 ++	      {
191.1493 ++		__ret.field[2] = value;		
191.1494 ++		__ret.field[3] = none;
191.1495 ++	      }
191.1496 ++	  }
191.1497 ++	else
191.1498 ++	  {
191.1499 ++	    __ret.field[0] = value;
191.1500 ++	    if (__space)
191.1501 ++	      {
191.1502 ++		__ret.field[1] = space;
191.1503 ++		__ret.field[2] = sign;
191.1504 ++		__ret.field[3] = symbol;
191.1505 ++	      }
191.1506 ++	    else
191.1507 ++	      {
191.1508 ++		__ret.field[1] = sign;
191.1509 ++		__ret.field[2] = symbol;
191.1510 ++		__ret.field[3] = none;
191.1511 ++	      }
191.1512 ++	  }
191.1513 ++	break;
191.1514 ++      case 4:
191.1515 ++	// 4 The sign immediately follows the symbol.
191.1516 ++	if (__precedes)
191.1517 ++	  {
191.1518 ++	    __ret.field[0] = symbol;
191.1519 ++	    __ret.field[1] = sign;
191.1520 ++	    if (__space)
191.1521 ++	      {
191.1522 ++		__ret.field[2] = space;
191.1523 ++		__ret.field[3] = value;
191.1524 ++	      }
191.1525 ++	    else
191.1526 ++	      {
191.1527 ++		__ret.field[2] = value;
191.1528 ++		__ret.field[3] = none;
191.1529 ++	      }
191.1530 ++	  }
191.1531 ++	else
191.1532 ++	  {
191.1533 ++	    __ret.field[0] = value;
191.1534 ++	    if (__space)
191.1535 ++	      {
191.1536 ++		__ret.field[1] = space;
191.1537 ++		__ret.field[2] = symbol;
191.1538 ++		__ret.field[3] = sign;
191.1539 ++	      }
191.1540 ++	    else
191.1541 ++	      {
191.1542 ++		__ret.field[1] = symbol;
191.1543 ++		__ret.field[2] = sign;
191.1544 ++		__ret.field[3] = none;
191.1545 ++	      }
191.1546 ++	  }
191.1547 ++	break;
191.1548 ++      default:
191.1549 ++	;
191.1550 ++      }
191.1551 ++    return __ret;
191.1552 ++  }
191.1553 ++
191.1554 ++  template<> 
191.1555 ++    void
191.1556 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
191.1557 ++						     const char*)
191.1558 ++    {
191.1559 ++      if (!_M_data)
191.1560 ++	_M_data = new __moneypunct_cache<char, true>;
191.1561 ++
191.1562 ++      if (!__cloc)
191.1563 ++	{
191.1564 ++	  // "C" locale
191.1565 ++	  _M_data->_M_decimal_point = '.';
191.1566 ++	  _M_data->_M_thousands_sep = ',';
191.1567 ++	  _M_data->_M_grouping = "";
191.1568 ++	  _M_data->_M_grouping_size = 0;
191.1569 ++	  _M_data->_M_curr_symbol = "";
191.1570 ++	  _M_data->_M_curr_symbol_size = 0;
191.1571 ++	  _M_data->_M_positive_sign = "";
191.1572 ++	  _M_data->_M_positive_sign_size = 0;
191.1573 ++	  _M_data->_M_negative_sign = "";
191.1574 ++	  _M_data->_M_negative_sign_size = 0;
191.1575 ++	  _M_data->_M_frac_digits = 0;
191.1576 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
191.1577 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
191.1578 ++
191.1579 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
191.1580 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
191.1581 ++	}
191.1582 ++      else
191.1583 ++	{
191.1584 ++	  // Named locale.
191.1585 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
191.1586 ++							__cloc));
191.1587 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
191.1588 ++							__cloc));
191.1589 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
191.1590 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
191.1591 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
191.1592 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
191.1593 ++
191.1594 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
191.1595 ++	  if (!__nposn)
191.1596 ++	    _M_data->_M_negative_sign = "()";
191.1597 ++	  else
191.1598 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
191.1599 ++							__cloc);
191.1600 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
191.1601 ++
191.1602 ++	  // _Intl == true
191.1603 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
191.1604 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
191.1605 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
191.1606 ++						      __cloc));
191.1607 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
191.1608 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
191.1609 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
191.1610 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
191.1611 ++							__pposn);
191.1612 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
191.1613 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
191.1614 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
191.1615 ++							__nposn);
191.1616 ++	}
191.1617 ++    }
191.1618 ++
191.1619 ++  template<> 
191.1620 ++    void
191.1621 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
191.1622 ++						      const char*)
191.1623 ++    {
191.1624 ++      if (!_M_data)
191.1625 ++	_M_data = new __moneypunct_cache<char, false>;
191.1626 ++
191.1627 ++      if (!__cloc)
191.1628 ++	{
191.1629 ++	  // "C" locale
191.1630 ++	  _M_data->_M_decimal_point = '.';
191.1631 ++	  _M_data->_M_thousands_sep = ',';
191.1632 ++	  _M_data->_M_grouping = "";
191.1633 ++	  _M_data->_M_grouping_size = 0;
191.1634 ++	  _M_data->_M_curr_symbol = "";
191.1635 ++	  _M_data->_M_curr_symbol_size = 0;
191.1636 ++	  _M_data->_M_positive_sign = "";
191.1637 ++	  _M_data->_M_positive_sign_size = 0;
191.1638 ++	  _M_data->_M_negative_sign = "";
191.1639 ++	  _M_data->_M_negative_sign_size = 0;
191.1640 ++	  _M_data->_M_frac_digits = 0;
191.1641 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
191.1642 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
191.1643 ++
191.1644 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
191.1645 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
191.1646 ++	}
191.1647 ++      else
191.1648 ++	{
191.1649 ++	  // Named locale.
191.1650 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
191.1651 ++							__cloc));
191.1652 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
191.1653 ++							__cloc));
191.1654 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
191.1655 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
191.1656 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
191.1657 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
191.1658 ++
191.1659 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
191.1660 ++	  if (!__nposn)
191.1661 ++	    _M_data->_M_negative_sign = "()";
191.1662 ++	  else
191.1663 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
191.1664 ++							__cloc);
191.1665 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
191.1666 ++
191.1667 ++	  // _Intl == false
191.1668 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
191.1669 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
191.1670 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
191.1671 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
191.1672 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
191.1673 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
191.1674 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
191.1675 ++							__pposn);
191.1676 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
191.1677 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
191.1678 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
191.1679 ++							__nposn);
191.1680 ++	}
191.1681 ++    }
191.1682 ++
191.1683 ++  template<> 
191.1684 ++    moneypunct<char, true>::~moneypunct()
191.1685 ++    { delete _M_data; }
191.1686 ++
191.1687 ++  template<> 
191.1688 ++    moneypunct<char, false>::~moneypunct()
191.1689 ++    { delete _M_data; }
191.1690 ++
191.1691 ++#ifdef _GLIBCXX_USE_WCHAR_T
191.1692 ++  template<> 
191.1693 ++    void
191.1694 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
191.1695 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1696 ++							const char*)
191.1697 ++#else
191.1698 ++							const char* __name)
191.1699 ++#endif
191.1700 ++    {
191.1701 ++      if (!_M_data)
191.1702 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
191.1703 ++
191.1704 ++      if (!__cloc)
191.1705 ++	{
191.1706 ++	  // "C" locale
191.1707 ++	  _M_data->_M_decimal_point = L'.';
191.1708 ++	  _M_data->_M_thousands_sep = L',';
191.1709 ++	  _M_data->_M_grouping = "";
191.1710 ++	  _M_data->_M_grouping_size = 0;
191.1711 ++	  _M_data->_M_curr_symbol = L"";
191.1712 ++	  _M_data->_M_curr_symbol_size = 0;
191.1713 ++	  _M_data->_M_positive_sign = L"";
191.1714 ++	  _M_data->_M_positive_sign_size = 0;
191.1715 ++	  _M_data->_M_negative_sign = L"";
191.1716 ++	  _M_data->_M_negative_sign_size = 0;
191.1717 ++	  _M_data->_M_frac_digits = 0;
191.1718 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
191.1719 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
191.1720 ++
191.1721 ++	  // Use ctype::widen code without the facet...
191.1722 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
191.1723 ++	    _M_data->_M_atoms[__i] =
191.1724 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
191.1725 ++	}
191.1726 ++      else
191.1727 ++	{
191.1728 ++	  // Named locale.
191.1729 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1730 ++	  __c_locale __old = __uselocale(__cloc);
191.1731 ++#else
191.1732 ++	  // Switch to named locale so that mbsrtowcs will work.
191.1733 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
191.1734 ++	  setlocale(LC_ALL, __name);
191.1735 ++#endif
191.1736 ++
191.1737 ++#ifdef __UCLIBC_MJN3_ONLY__
191.1738 ++#warning fix this... should be monetary
191.1739 ++#endif
191.1740 ++#ifdef __UCLIBC__
191.1741 ++# ifdef __UCLIBC_HAS_XLOCALE__
191.1742 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
191.1743 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
191.1744 ++# else
191.1745 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
191.1746 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
191.1747 ++# endif
191.1748 ++#else
191.1749 ++	  union { char *__s; wchar_t __w; } __u;
191.1750 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
191.1751 ++	  _M_data->_M_decimal_point = __u.__w;
191.1752 ++
191.1753 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
191.1754 ++	  _M_data->_M_thousands_sep = __u.__w;
191.1755 ++#endif
191.1756 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
191.1757 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
191.1758 ++
191.1759 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
191.1760 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
191.1761 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
191.1762 ++
191.1763 ++	  wchar_t* __wcs_ps = 0;
191.1764 ++	  wchar_t* __wcs_ns = 0;
191.1765 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
191.1766 ++	  try
191.1767 ++	    {
191.1768 ++	      mbstate_t __state;
191.1769 ++	      size_t __len = strlen(__cpossign);
191.1770 ++	      if (__len)
191.1771 ++		{
191.1772 ++		  ++__len;
191.1773 ++		  memset(&__state, 0, sizeof(mbstate_t));
191.1774 ++		  __wcs_ps = new wchar_t[__len];
191.1775 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
191.1776 ++		  _M_data->_M_positive_sign = __wcs_ps;
191.1777 ++		}
191.1778 ++	      else
191.1779 ++		_M_data->_M_positive_sign = L"";
191.1780 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
191.1781 ++	      
191.1782 ++	      __len = strlen(__cnegsign);
191.1783 ++	      if (!__nposn)
191.1784 ++		_M_data->_M_negative_sign = L"()";
191.1785 ++	      else if (__len)
191.1786 ++		{ 
191.1787 ++		  ++__len;
191.1788 ++		  memset(&__state, 0, sizeof(mbstate_t));
191.1789 ++		  __wcs_ns = new wchar_t[__len];
191.1790 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
191.1791 ++		  _M_data->_M_negative_sign = __wcs_ns;
191.1792 ++		}
191.1793 ++	      else
191.1794 ++		_M_data->_M_negative_sign = L"";
191.1795 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
191.1796 ++	      
191.1797 ++	      // _Intl == true.
191.1798 ++	      __len = strlen(__ccurr);
191.1799 ++	      if (__len)
191.1800 ++		{
191.1801 ++		  ++__len;
191.1802 ++		  memset(&__state, 0, sizeof(mbstate_t));
191.1803 ++		  wchar_t* __wcs = new wchar_t[__len];
191.1804 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
191.1805 ++		  _M_data->_M_curr_symbol = __wcs;
191.1806 ++		}
191.1807 ++	      else
191.1808 ++		_M_data->_M_curr_symbol = L"";
191.1809 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
191.1810 ++	    }
191.1811 ++	  catch (...)
191.1812 ++	    {
191.1813 ++	      delete _M_data;
191.1814 ++	      _M_data = 0;
191.1815 ++	      delete __wcs_ps;
191.1816 ++	      delete __wcs_ns;	      
191.1817 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1818 ++	      __uselocale(__old);
191.1819 ++#else
191.1820 ++	      setlocale(LC_ALL, __old);
191.1821 ++	      free(__old);
191.1822 ++#endif
191.1823 ++	      __throw_exception_again;
191.1824 ++	    } 
191.1825 ++	  
191.1826 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
191.1827 ++						      __cloc));
191.1828 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
191.1829 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
191.1830 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
191.1831 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
191.1832 ++							__pposn);
191.1833 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
191.1834 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
191.1835 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
191.1836 ++							__nposn);
191.1837 ++
191.1838 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1839 ++	  __uselocale(__old);
191.1840 ++#else
191.1841 ++	  setlocale(LC_ALL, __old);
191.1842 ++	  free(__old);
191.1843 ++#endif
191.1844 ++	}
191.1845 ++    }
191.1846 ++
191.1847 ++  template<> 
191.1848 ++  void
191.1849 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
191.1850 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1851 ++						       const char*)
191.1852 ++#else
191.1853 ++                                                       const char* __name)
191.1854 ++#endif
191.1855 ++  {
191.1856 ++    if (!_M_data)
191.1857 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
191.1858 ++
191.1859 ++    if (!__cloc)
191.1860 ++	{
191.1861 ++	  // "C" locale
191.1862 ++	  _M_data->_M_decimal_point = L'.';
191.1863 ++	  _M_data->_M_thousands_sep = L',';
191.1864 ++	  _M_data->_M_grouping = "";
191.1865 ++          _M_data->_M_grouping_size = 0;
191.1866 ++	  _M_data->_M_curr_symbol = L"";
191.1867 ++	  _M_data->_M_curr_symbol_size = 0;
191.1868 ++	  _M_data->_M_positive_sign = L"";
191.1869 ++	  _M_data->_M_positive_sign_size = 0;
191.1870 ++	  _M_data->_M_negative_sign = L"";
191.1871 ++	  _M_data->_M_negative_sign_size = 0;
191.1872 ++	  _M_data->_M_frac_digits = 0;
191.1873 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
191.1874 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
191.1875 ++
191.1876 ++	  // Use ctype::widen code without the facet...
191.1877 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
191.1878 ++	    _M_data->_M_atoms[__i] =
191.1879 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
191.1880 ++	}
191.1881 ++      else
191.1882 ++	{
191.1883 ++	  // Named locale.
191.1884 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1885 ++	  __c_locale __old = __uselocale(__cloc);
191.1886 ++#else
191.1887 ++	  // Switch to named locale so that mbsrtowcs will work.
191.1888 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
191.1889 ++	  setlocale(LC_ALL, __name);
191.1890 ++#endif
191.1891 ++
191.1892 ++#ifdef __UCLIBC_MJN3_ONLY__
191.1893 ++#warning fix this... should be monetary
191.1894 ++#endif
191.1895 ++#ifdef __UCLIBC__
191.1896 ++# ifdef __UCLIBC_HAS_XLOCALE__
191.1897 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
191.1898 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
191.1899 ++# else
191.1900 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
191.1901 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
191.1902 ++# endif
191.1903 ++#else
191.1904 ++          union { char *__s; wchar_t __w; } __u;
191.1905 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
191.1906 ++	  _M_data->_M_decimal_point = __u.__w;
191.1907 ++
191.1908 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
191.1909 ++	  _M_data->_M_thousands_sep = __u.__w;
191.1910 ++#endif
191.1911 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
191.1912 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
191.1913 ++
191.1914 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
191.1915 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
191.1916 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
191.1917 ++
191.1918 ++	  wchar_t* __wcs_ps = 0;
191.1919 ++	  wchar_t* __wcs_ns = 0;
191.1920 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
191.1921 ++	  try
191.1922 ++            {
191.1923 ++              mbstate_t __state;
191.1924 ++              size_t __len;
191.1925 ++              __len = strlen(__cpossign);
191.1926 ++              if (__len)
191.1927 ++                {
191.1928 ++		  ++__len;
191.1929 ++		  memset(&__state, 0, sizeof(mbstate_t));
191.1930 ++		  __wcs_ps = new wchar_t[__len];
191.1931 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
191.1932 ++		  _M_data->_M_positive_sign = __wcs_ps;
191.1933 ++		}
191.1934 ++	      else
191.1935 ++		_M_data->_M_positive_sign = L"";
191.1936 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
191.1937 ++	      
191.1938 ++	      __len = strlen(__cnegsign);
191.1939 ++	      if (!__nposn)
191.1940 ++		_M_data->_M_negative_sign = L"()";
191.1941 ++	      else if (__len)
191.1942 ++		{ 
191.1943 ++		  ++__len;
191.1944 ++		  memset(&__state, 0, sizeof(mbstate_t));
191.1945 ++		  __wcs_ns = new wchar_t[__len];
191.1946 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
191.1947 ++		  _M_data->_M_negative_sign = __wcs_ns;
191.1948 ++		}
191.1949 ++	      else
191.1950 ++		_M_data->_M_negative_sign = L"";
191.1951 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
191.1952 ++
191.1953 ++	      // _Intl == true.
191.1954 ++	      __len = strlen(__ccurr);
191.1955 ++	      if (__len)
191.1956 ++		{
191.1957 ++		  ++__len;
191.1958 ++		  memset(&__state, 0, sizeof(mbstate_t));
191.1959 ++		  wchar_t* __wcs = new wchar_t[__len];
191.1960 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
191.1961 ++		  _M_data->_M_curr_symbol = __wcs;
191.1962 ++		}
191.1963 ++	      else
191.1964 ++		_M_data->_M_curr_symbol = L"";
191.1965 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
191.1966 ++	    }
191.1967 ++          catch (...)
191.1968 ++	    {
191.1969 ++	      delete _M_data;
191.1970 ++              _M_data = 0;
191.1971 ++	      delete __wcs_ps;
191.1972 ++	      delete __wcs_ns;	      
191.1973 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1974 ++	      __uselocale(__old);
191.1975 ++#else
191.1976 ++	      setlocale(LC_ALL, __old);
191.1977 ++	      free(__old);
191.1978 ++#endif
191.1979 ++              __throw_exception_again;
191.1980 ++	    }
191.1981 ++
191.1982 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
191.1983 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
191.1984 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
191.1985 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
191.1986 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
191.1987 ++	                                                __pposn);
191.1988 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
191.1989 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
191.1990 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
191.1991 ++	                                                __nposn);
191.1992 ++
191.1993 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.1994 ++	  __uselocale(__old);
191.1995 ++#else
191.1996 ++	  setlocale(LC_ALL, __old);
191.1997 ++	  free(__old);
191.1998 ++#endif
191.1999 ++	}
191.2000 ++    }
191.2001 ++
191.2002 ++  template<> 
191.2003 ++    moneypunct<wchar_t, true>::~moneypunct()
191.2004 ++    {
191.2005 ++      if (_M_data->_M_positive_sign_size)
191.2006 ++	delete [] _M_data->_M_positive_sign;
191.2007 ++      if (_M_data->_M_negative_sign_size
191.2008 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
191.2009 ++	delete [] _M_data->_M_negative_sign;
191.2010 ++      if (_M_data->_M_curr_symbol_size)
191.2011 ++	delete [] _M_data->_M_curr_symbol;
191.2012 ++      delete _M_data;
191.2013 ++    }
191.2014 ++
191.2015 ++  template<> 
191.2016 ++    moneypunct<wchar_t, false>::~moneypunct()
191.2017 ++    {
191.2018 ++      if (_M_data->_M_positive_sign_size)
191.2019 ++	delete [] _M_data->_M_positive_sign;
191.2020 ++      if (_M_data->_M_negative_sign_size
191.2021 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
191.2022 ++	delete [] _M_data->_M_negative_sign;
191.2023 ++      if (_M_data->_M_curr_symbol_size)
191.2024 ++	delete [] _M_data->_M_curr_symbol;
191.2025 ++      delete _M_data;
191.2026 ++    }
191.2027 ++#endif
191.2028 ++}
191.2029 +--- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
191.2030 ++++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
191.2031 +@@ -0,0 +1,160 @@
191.2032 ++// std::numpunct implementation details, GNU version -*- C++ -*-
191.2033 ++
191.2034 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
191.2035 ++//
191.2036 ++// This file is part of the GNU ISO C++ Library.  This library is free
191.2037 ++// software; you can redistribute it and/or modify it under the
191.2038 ++// terms of the GNU General Public License as published by the
191.2039 ++// Free Software Foundation; either version 2, or (at your option)
191.2040 ++// any later version.
191.2041 ++
191.2042 ++// This library is distributed in the hope that it will be useful,
191.2043 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
191.2044 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
191.2045 ++// GNU General Public License for more details.
191.2046 ++
191.2047 ++// You should have received a copy of the GNU General Public License along
191.2048 ++// with this library; see the file COPYING.  If not, write to the Free
191.2049 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
191.2050 ++// USA.
191.2051 ++
191.2052 ++// As a special exception, you may use this file as part of a free software
191.2053 ++// library without restriction.  Specifically, if other files instantiate
191.2054 ++// templates or use macros or inline functions from this file, or you compile
191.2055 ++// this file and link it with other files to produce an executable, this
191.2056 ++// file does not by itself cause the resulting executable to be covered by
191.2057 ++// the GNU General Public License.  This exception does not however
191.2058 ++// invalidate any other reasons why the executable file might be covered by
191.2059 ++// the GNU General Public License.
191.2060 ++
191.2061 ++//
191.2062 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
191.2063 ++//
191.2064 ++
191.2065 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
191.2066 ++
191.2067 ++#define _LIBC
191.2068 ++#include <locale>
191.2069 ++#undef _LIBC
191.2070 ++#include <bits/c++locale_internal.h>
191.2071 ++
191.2072 ++#ifdef __UCLIBC_MJN3_ONLY__
191.2073 ++#warning tailor for stub locale support
191.2074 ++#endif
191.2075 ++#ifndef __UCLIBC_HAS_XLOCALE__
191.2076 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
191.2077 ++#endif
191.2078 ++
191.2079 ++namespace std
191.2080 ++{
191.2081 ++  template<> 
191.2082 ++    void
191.2083 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
191.2084 ++    {
191.2085 ++      if (!_M_data)
191.2086 ++	_M_data = new __numpunct_cache<char>;
191.2087 ++
191.2088 ++      if (!__cloc)
191.2089 ++	{
191.2090 ++	  // "C" locale
191.2091 ++	  _M_data->_M_grouping = "";
191.2092 ++	  _M_data->_M_grouping_size = 0;
191.2093 ++	  _M_data->_M_use_grouping = false;
191.2094 ++
191.2095 ++	  _M_data->_M_decimal_point = '.';
191.2096 ++	  _M_data->_M_thousands_sep = ',';
191.2097 ++
191.2098 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
191.2099 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
191.2100 ++
191.2101 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
191.2102 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
191.2103 ++	}
191.2104 ++      else
191.2105 ++	{
191.2106 ++	  // Named locale.
191.2107 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
191.2108 ++							__cloc));
191.2109 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
191.2110 ++							__cloc));
191.2111 ++
191.2112 ++	  // Check for NULL, which implies no grouping.
191.2113 ++	  if (_M_data->_M_thousands_sep == '\0')
191.2114 ++	    _M_data->_M_grouping = "";
191.2115 ++	  else
191.2116 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
191.2117 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
191.2118 ++	}
191.2119 ++
191.2120 ++      // NB: There is no way to extact this info from posix locales.
191.2121 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
191.2122 ++      _M_data->_M_truename = "true";
191.2123 ++      _M_data->_M_truename_size = 4;
191.2124 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
191.2125 ++      _M_data->_M_falsename = "false";
191.2126 ++      _M_data->_M_falsename_size = 5;
191.2127 ++    }
191.2128 ++ 
191.2129 ++  template<> 
191.2130 ++    numpunct<char>::~numpunct()
191.2131 ++    { delete _M_data; }
191.2132 ++   
191.2133 ++#ifdef _GLIBCXX_USE_WCHAR_T
191.2134 ++  template<> 
191.2135 ++    void
191.2136 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
191.2137 ++    {
191.2138 ++      if (!_M_data)
191.2139 ++	_M_data = new __numpunct_cache<wchar_t>;
191.2140 ++
191.2141 ++      if (!__cloc)
191.2142 ++	{
191.2143 ++	  // "C" locale
191.2144 ++	  _M_data->_M_grouping = "";
191.2145 ++	  _M_data->_M_grouping_size = 0;
191.2146 ++	  _M_data->_M_use_grouping = false;
191.2147 ++
191.2148 ++	  _M_data->_M_decimal_point = L'.';
191.2149 ++	  _M_data->_M_thousands_sep = L',';
191.2150 ++
191.2151 ++	  // Use ctype::widen code without the facet...
191.2152 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
191.2153 ++	    _M_data->_M_atoms_out[__i] =
191.2154 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
191.2155 ++
191.2156 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
191.2157 ++	    _M_data->_M_atoms_in[__j] =
191.2158 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
191.2159 ++	}
191.2160 ++      else
191.2161 ++	{
191.2162 ++	  // Named locale.
191.2163 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
191.2164 ++	  union { char *__s; wchar_t __w; } __u;
191.2165 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
191.2166 ++	  _M_data->_M_decimal_point = __u.__w;
191.2167 ++
191.2168 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
191.2169 ++	  _M_data->_M_thousands_sep = __u.__w;
191.2170 ++
191.2171 ++	  if (_M_data->_M_thousands_sep == L'\0')
191.2172 ++	    _M_data->_M_grouping = "";
191.2173 ++	  else
191.2174 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
191.2175 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
191.2176 ++	}
191.2177 ++
191.2178 ++      // NB: There is no way to extact this info from posix locales.
191.2179 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
191.2180 ++      _M_data->_M_truename = L"true";
191.2181 ++      _M_data->_M_truename_size = 4;
191.2182 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
191.2183 ++      _M_data->_M_falsename = L"false";
191.2184 ++      _M_data->_M_falsename_size = 5;
191.2185 ++    }
191.2186 ++
191.2187 ++  template<> 
191.2188 ++    numpunct<wchar_t>::~numpunct()
191.2189 ++    { delete _M_data; }
191.2190 ++ #endif
191.2191 ++}
191.2192 +--- gcc/libstdc++-v3/config/locale/uclibc/time_members.cc
191.2193 ++++ gcc/libstdc++-v3/config/locale/uclibc/time_members.cc
191.2194 +@@ -0,0 +1,406 @@
191.2195 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
191.2196 ++
191.2197 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
191.2198 ++//
191.2199 ++// This file is part of the GNU ISO C++ Library.  This library is free
191.2200 ++// software; you can redistribute it and/or modify it under the
191.2201 ++// terms of the GNU General Public License as published by the
191.2202 ++// Free Software Foundation; either version 2, or (at your option)
191.2203 ++// any later version.
191.2204 ++
191.2205 ++// This library is distributed in the hope that it will be useful,
191.2206 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
191.2207 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
191.2208 ++// GNU General Public License for more details.
191.2209 ++
191.2210 ++// You should have received a copy of the GNU General Public License along
191.2211 ++// with this library; see the file COPYING.  If not, write to the Free
191.2212 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
191.2213 ++// USA.
191.2214 ++
191.2215 ++// As a special exception, you may use this file as part of a free software
191.2216 ++// library without restriction.  Specifically, if other files instantiate
191.2217 ++// templates or use macros or inline functions from this file, or you compile
191.2218 ++// this file and link it with other files to produce an executable, this
191.2219 ++// file does not by itself cause the resulting executable to be covered by
191.2220 ++// the GNU General Public License.  This exception does not however
191.2221 ++// invalidate any other reasons why the executable file might be covered by
191.2222 ++// the GNU General Public License.
191.2223 ++
191.2224 ++//
191.2225 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
191.2226 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
191.2227 ++//
191.2228 ++
191.2229 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
191.2230 ++
191.2231 ++#include <locale>
191.2232 ++#include <bits/c++locale_internal.h>
191.2233 ++
191.2234 ++#ifdef __UCLIBC_MJN3_ONLY__
191.2235 ++#warning tailor for stub locale support
191.2236 ++#endif
191.2237 ++#ifndef __UCLIBC_HAS_XLOCALE__
191.2238 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
191.2239 ++#endif
191.2240 ++
191.2241 ++namespace std
191.2242 ++{
191.2243 ++  template<>
191.2244 ++    void
191.2245 ++    __timepunct<char>::
191.2246 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
191.2247 ++	   const tm* __tm) const
191.2248 ++    {
191.2249 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.2250 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
191.2251 ++					_M_c_locale_timepunct);
191.2252 ++#else
191.2253 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
191.2254 ++      setlocale(LC_ALL, _M_name_timepunct);
191.2255 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
191.2256 ++      setlocale(LC_ALL, __old);
191.2257 ++      free(__old);
191.2258 ++#endif
191.2259 ++      // Make sure __s is null terminated.
191.2260 ++      if (__len == 0)
191.2261 ++	__s[0] = '\0';
191.2262 ++    }
191.2263 ++
191.2264 ++  template<> 
191.2265 ++    void
191.2266 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
191.2267 ++    {
191.2268 ++      if (!_M_data)
191.2269 ++	_M_data = new __timepunct_cache<char>;
191.2270 ++
191.2271 ++      if (!__cloc)
191.2272 ++	{
191.2273 ++	  // "C" locale
191.2274 ++	  _M_c_locale_timepunct = _S_get_c_locale();
191.2275 ++
191.2276 ++	  _M_data->_M_date_format = "%m/%d/%y";
191.2277 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
191.2278 ++	  _M_data->_M_time_format = "%H:%M:%S";
191.2279 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
191.2280 ++	  _M_data->_M_date_time_format = "";
191.2281 ++	  _M_data->_M_date_time_era_format = "";
191.2282 ++	  _M_data->_M_am = "AM";
191.2283 ++	  _M_data->_M_pm = "PM";
191.2284 ++	  _M_data->_M_am_pm_format = "";
191.2285 ++
191.2286 ++	  // Day names, starting with "C"'s Sunday.
191.2287 ++	  _M_data->_M_day1 = "Sunday";
191.2288 ++	  _M_data->_M_day2 = "Monday";
191.2289 ++	  _M_data->_M_day3 = "Tuesday";
191.2290 ++	  _M_data->_M_day4 = "Wednesday";
191.2291 ++	  _M_data->_M_day5 = "Thursday";
191.2292 ++	  _M_data->_M_day6 = "Friday";
191.2293 ++	  _M_data->_M_day7 = "Saturday";
191.2294 ++
191.2295 ++	  // Abbreviated day names, starting with "C"'s Sun.
191.2296 ++	  _M_data->_M_aday1 = "Sun";
191.2297 ++	  _M_data->_M_aday2 = "Mon";
191.2298 ++	  _M_data->_M_aday3 = "Tue";
191.2299 ++	  _M_data->_M_aday4 = "Wed";
191.2300 ++	  _M_data->_M_aday5 = "Thu";
191.2301 ++	  _M_data->_M_aday6 = "Fri";
191.2302 ++	  _M_data->_M_aday7 = "Sat";
191.2303 ++
191.2304 ++	  // Month names, starting with "C"'s January.
191.2305 ++	  _M_data->_M_month01 = "January";
191.2306 ++	  _M_data->_M_month02 = "February";
191.2307 ++	  _M_data->_M_month03 = "March";
191.2308 ++	  _M_data->_M_month04 = "April";
191.2309 ++	  _M_data->_M_month05 = "May";
191.2310 ++	  _M_data->_M_month06 = "June";
191.2311 ++	  _M_data->_M_month07 = "July";
191.2312 ++	  _M_data->_M_month08 = "August";
191.2313 ++	  _M_data->_M_month09 = "September";
191.2314 ++	  _M_data->_M_month10 = "October";
191.2315 ++	  _M_data->_M_month11 = "November";
191.2316 ++	  _M_data->_M_month12 = "December";
191.2317 ++
191.2318 ++	  // Abbreviated month names, starting with "C"'s Jan.
191.2319 ++	  _M_data->_M_amonth01 = "Jan";
191.2320 ++	  _M_data->_M_amonth02 = "Feb";
191.2321 ++	  _M_data->_M_amonth03 = "Mar";
191.2322 ++	  _M_data->_M_amonth04 = "Apr";
191.2323 ++	  _M_data->_M_amonth05 = "May";
191.2324 ++	  _M_data->_M_amonth06 = "Jun";
191.2325 ++	  _M_data->_M_amonth07 = "Jul";
191.2326 ++	  _M_data->_M_amonth08 = "Aug";
191.2327 ++	  _M_data->_M_amonth09 = "Sep";
191.2328 ++	  _M_data->_M_amonth10 = "Oct";
191.2329 ++	  _M_data->_M_amonth11 = "Nov";
191.2330 ++	  _M_data->_M_amonth12 = "Dec";
191.2331 ++	}
191.2332 ++      else
191.2333 ++	{
191.2334 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
191.2335 ++
191.2336 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
191.2337 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
191.2338 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
191.2339 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
191.2340 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
191.2341 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
191.2342 ++							     __cloc);
191.2343 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
191.2344 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
191.2345 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
191.2346 ++
191.2347 ++	  // Day names, starting with "C"'s Sunday.
191.2348 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
191.2349 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
191.2350 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
191.2351 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
191.2352 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
191.2353 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
191.2354 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
191.2355 ++
191.2356 ++	  // Abbreviated day names, starting with "C"'s Sun.
191.2357 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
191.2358 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
191.2359 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
191.2360 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
191.2361 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
191.2362 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
191.2363 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
191.2364 ++
191.2365 ++	  // Month names, starting with "C"'s January.
191.2366 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
191.2367 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
191.2368 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
191.2369 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
191.2370 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
191.2371 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
191.2372 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
191.2373 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
191.2374 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
191.2375 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
191.2376 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
191.2377 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
191.2378 ++
191.2379 ++	  // Abbreviated month names, starting with "C"'s Jan.
191.2380 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
191.2381 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
191.2382 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
191.2383 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
191.2384 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
191.2385 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
191.2386 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
191.2387 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
191.2388 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
191.2389 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
191.2390 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
191.2391 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
191.2392 ++	}
191.2393 ++    }
191.2394 ++
191.2395 ++#ifdef _GLIBCXX_USE_WCHAR_T
191.2396 ++  template<>
191.2397 ++    void
191.2398 ++    __timepunct<wchar_t>::
191.2399 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
191.2400 ++	   const tm* __tm) const
191.2401 ++    {
191.2402 ++#ifdef __UCLIBC_HAS_XLOCALE__
191.2403 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
191.2404 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
191.2405 ++					_M_c_locale_timepunct);
191.2406 ++#else
191.2407 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
191.2408 ++      setlocale(LC_ALL, _M_name_timepunct);
191.2409 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
191.2410 ++      setlocale(LC_ALL, __old);
191.2411 ++      free(__old);
191.2412 ++#endif
191.2413 ++      // Make sure __s is null terminated.
191.2414 ++      if (__len == 0)
191.2415 ++	__s[0] = L'\0';
191.2416 ++    }
191.2417 ++
191.2418 ++  template<> 
191.2419 ++    void
191.2420 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
191.2421 ++    {
191.2422 ++      if (!_M_data)
191.2423 ++	_M_data = new __timepunct_cache<wchar_t>;
191.2424 ++
191.2425 ++#warning wide time stuff
191.2426 ++//       if (!__cloc)
191.2427 ++	{
191.2428 ++	  // "C" locale
191.2429 ++	  _M_c_locale_timepunct = _S_get_c_locale();
191.2430 ++
191.2431 ++	  _M_data->_M_date_format = L"%m/%d/%y";
191.2432 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
191.2433 ++	  _M_data->_M_time_format = L"%H:%M:%S";
191.2434 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
191.2435 ++	  _M_data->_M_date_time_format = L"";
191.2436 ++	  _M_data->_M_date_time_era_format = L"";
191.2437 ++	  _M_data->_M_am = L"AM";
191.2438 ++	  _M_data->_M_pm = L"PM";
191.2439 ++	  _M_data->_M_am_pm_format = L"";
191.2440 ++
191.2441 ++	  // Day names, starting with "C"'s Sunday.
191.2442 ++	  _M_data->_M_day1 = L"Sunday";
191.2443 ++	  _M_data->_M_day2 = L"Monday";
191.2444 ++	  _M_data->_M_day3 = L"Tuesday";
191.2445 ++	  _M_data->_M_day4 = L"Wednesday";
191.2446 ++	  _M_data->_M_day5 = L"Thursday";
191.2447 ++	  _M_data->_M_day6 = L"Friday";
191.2448 ++	  _M_data->_M_day7 = L"Saturday";
191.2449 ++
191.2450 ++	  // Abbreviated day names, starting with "C"'s Sun.
191.2451 ++	  _M_data->_M_aday1 = L"Sun";
191.2452 ++	  _M_data->_M_aday2 = L"Mon";
191.2453 ++	  _M_data->_M_aday3 = L"Tue";
191.2454 ++	  _M_data->_M_aday4 = L"Wed";
191.2455 ++	  _M_data->_M_aday5 = L"Thu";
191.2456 ++	  _M_data->_M_aday6 = L"Fri";
191.2457 ++	  _M_data->_M_aday7 = L"Sat";
191.2458 ++
191.2459 ++	  // Month names, starting with "C"'s January.
191.2460 ++	  _M_data->_M_month01 = L"January";
191.2461 ++	  _M_data->_M_month02 = L"February";
191.2462 ++	  _M_data->_M_month03 = L"March";
191.2463 ++	  _M_data->_M_month04 = L"April";
191.2464 ++	  _M_data->_M_month05 = L"May";
191.2465 ++	  _M_data->_M_month06 = L"June";
191.2466 ++	  _M_data->_M_month07 = L"July";
191.2467 ++	  _M_data->_M_month08 = L"August";
191.2468 ++	  _M_data->_M_month09 = L"September";
191.2469 ++	  _M_data->_M_month10 = L"October";
191.2470 ++	  _M_data->_M_month11 = L"November";
191.2471 ++	  _M_data->_M_month12 = L"December";
191.2472 ++
191.2473 ++	  // Abbreviated month names, starting with "C"'s Jan.
191.2474 ++	  _M_data->_M_amonth01 = L"Jan";
191.2475 ++	  _M_data->_M_amonth02 = L"Feb";
191.2476 ++	  _M_data->_M_amonth03 = L"Mar";
191.2477 ++	  _M_data->_M_amonth04 = L"Apr";
191.2478 ++	  _M_data->_M_amonth05 = L"May";
191.2479 ++	  _M_data->_M_amonth06 = L"Jun";
191.2480 ++	  _M_data->_M_amonth07 = L"Jul";
191.2481 ++	  _M_data->_M_amonth08 = L"Aug";
191.2482 ++	  _M_data->_M_amonth09 = L"Sep";
191.2483 ++	  _M_data->_M_amonth10 = L"Oct";
191.2484 ++	  _M_data->_M_amonth11 = L"Nov";
191.2485 ++	  _M_data->_M_amonth12 = L"Dec";
191.2486 ++	}
191.2487 ++#if 0
191.2488 ++      else
191.2489 ++	{
191.2490 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
191.2491 ++
191.2492 ++	  union { char *__s; wchar_t *__w; } __u;
191.2493 ++
191.2494 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
191.2495 ++	  _M_data->_M_date_format = __u.__w;
191.2496 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
191.2497 ++	  _M_data->_M_date_era_format = __u.__w;
191.2498 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
191.2499 ++	  _M_data->_M_time_format = __u.__w;
191.2500 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
191.2501 ++	  _M_data->_M_time_era_format = __u.__w;
191.2502 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
191.2503 ++	  _M_data->_M_date_time_format = __u.__w;
191.2504 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
191.2505 ++	  _M_data->_M_date_time_era_format = __u.__w;
191.2506 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
191.2507 ++	  _M_data->_M_am = __u.__w;
191.2508 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
191.2509 ++	  _M_data->_M_pm = __u.__w;
191.2510 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
191.2511 ++	  _M_data->_M_am_pm_format = __u.__w;
191.2512 ++
191.2513 ++	  // Day names, starting with "C"'s Sunday.
191.2514 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
191.2515 ++	  _M_data->_M_day1 = __u.__w;
191.2516 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
191.2517 ++	  _M_data->_M_day2 = __u.__w;
191.2518 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
191.2519 ++	  _M_data->_M_day3 = __u.__w;
191.2520 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
191.2521 ++	  _M_data->_M_day4 = __u.__w;
191.2522 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
191.2523 ++	  _M_data->_M_day5 = __u.__w;
191.2524 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
191.2525 ++	  _M_data->_M_day6 = __u.__w;
191.2526 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
191.2527 ++	  _M_data->_M_day7 = __u.__w;
191.2528 ++
191.2529 ++	  // Abbreviated day names, starting with "C"'s Sun.
191.2530 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
191.2531 ++	  _M_data->_M_aday1 = __u.__w;
191.2532 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
191.2533 ++	  _M_data->_M_aday2 = __u.__w;
191.2534 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
191.2535 ++	  _M_data->_M_aday3 = __u.__w;
191.2536 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
191.2537 ++	  _M_data->_M_aday4 = __u.__w;
191.2538 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
191.2539 ++	  _M_data->_M_aday5 = __u.__w;
191.2540 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
191.2541 ++	  _M_data->_M_aday6 = __u.__w;
191.2542 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
191.2543 ++	  _M_data->_M_aday7 = __u.__w;
191.2544 ++
191.2545 ++	  // Month names, starting with "C"'s January.
191.2546 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
191.2547 ++	  _M_data->_M_month01 = __u.__w;
191.2548 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
191.2549 ++	  _M_data->_M_month02 = __u.__w;
191.2550 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
191.2551 ++	  _M_data->_M_month03 = __u.__w;
191.2552 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
191.2553 ++	  _M_data->_M_month04 = __u.__w;
191.2554 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
191.2555 ++	  _M_data->_M_month05 = __u.__w;
191.2556 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
191.2557 ++	  _M_data->_M_month06 = __u.__w;
191.2558 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
191.2559 ++	  _M_data->_M_month07 = __u.__w;
191.2560 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
191.2561 ++	  _M_data->_M_month08 = __u.__w;
191.2562 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
191.2563 ++	  _M_data->_M_month09 = __u.__w;
191.2564 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
191.2565 ++	  _M_data->_M_month10 = __u.__w;
191.2566 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
191.2567 ++	  _M_data->_M_month11 = __u.__w;
191.2568 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
191.2569 ++	  _M_data->_M_month12 = __u.__w;
191.2570 ++
191.2571 ++	  // Abbreviated month names, starting with "C"'s Jan.
191.2572 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
191.2573 ++	  _M_data->_M_amonth01 = __u.__w;
191.2574 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
191.2575 ++	  _M_data->_M_amonth02 = __u.__w;
191.2576 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
191.2577 ++	  _M_data->_M_amonth03 = __u.__w;
191.2578 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
191.2579 ++	  _M_data->_M_amonth04 = __u.__w;
191.2580 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
191.2581 ++	  _M_data->_M_amonth05 = __u.__w;
191.2582 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
191.2583 ++	  _M_data->_M_amonth06 = __u.__w;
191.2584 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
191.2585 ++	  _M_data->_M_amonth07 = __u.__w;
191.2586 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
191.2587 ++	  _M_data->_M_amonth08 = __u.__w;
191.2588 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
191.2589 ++	  _M_data->_M_amonth09 = __u.__w;
191.2590 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
191.2591 ++	  _M_data->_M_amonth10 = __u.__w;
191.2592 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
191.2593 ++	  _M_data->_M_amonth11 = __u.__w;
191.2594 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
191.2595 ++	  _M_data->_M_amonth12 = __u.__w;
191.2596 ++	}
191.2597 ++#endif // 0
191.2598 ++    }
191.2599 ++#endif
191.2600 ++}
191.2601 +--- gcc/libstdc++-v3/config/locale/uclibc/time_members.h
191.2602 ++++ gcc/libstdc++-v3/config/locale/uclibc/time_members.h
191.2603 +@@ -0,0 +1,68 @@
191.2604 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
191.2605 ++
191.2606 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
191.2607 ++//
191.2608 ++// This file is part of the GNU ISO C++ Library.  This library is free
191.2609 ++// software; you can redistribute it and/or modify it under the
191.2610 ++// terms of the GNU General Public License as published by the
191.2611 ++// Free Software Foundation; either version 2, or (at your option)
191.2612 ++// any later version.
191.2613 ++
191.2614 ++// This library is distributed in the hope that it will be useful,
191.2615 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
191.2616 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
191.2617 ++// GNU General Public License for more details.
191.2618 ++
191.2619 ++// You should have received a copy of the GNU General Public License along
191.2620 ++// with this library; see the file COPYING.  If not, write to the Free
191.2621 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
191.2622 ++// USA.
191.2623 ++
191.2624 ++// As a special exception, you may use this file as part of a free software
191.2625 ++// library without restriction.  Specifically, if other files instantiate
191.2626 ++// templates or use macros or inline functions from this file, or you compile
191.2627 ++// this file and link it with other files to produce an executable, this
191.2628 ++// file does not by itself cause the resulting executable to be covered by
191.2629 ++// the GNU General Public License.  This exception does not however
191.2630 ++// invalidate any other reasons why the executable file might be covered by
191.2631 ++// the GNU General Public License.
191.2632 ++
191.2633 ++//
191.2634 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
191.2635 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
191.2636 ++//
191.2637 ++
191.2638 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
191.2639 ++
191.2640 ++  template<typename _CharT>
191.2641 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
191.2642 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
191.2643 ++    _M_name_timepunct(_S_get_c_name())
191.2644 ++    { _M_initialize_timepunct(); }
191.2645 ++
191.2646 ++  template<typename _CharT>
191.2647 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
191.2648 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
191.2649 ++    _M_name_timepunct(_S_get_c_name())
191.2650 ++    { _M_initialize_timepunct(); }
191.2651 ++
191.2652 ++  template<typename _CharT>
191.2653 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
191.2654 ++				     size_t __refs) 
191.2655 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
191.2656 ++    _M_name_timepunct(__s)
191.2657 ++    { 
191.2658 ++      char* __tmp = new char[std::strlen(__s) + 1];
191.2659 ++      std::strcpy(__tmp, __s);
191.2660 ++      _M_name_timepunct = __tmp;
191.2661 ++      _M_initialize_timepunct(__cloc); 
191.2662 ++    }
191.2663 ++
191.2664 ++  template<typename _CharT>
191.2665 ++    __timepunct<_CharT>::~__timepunct()
191.2666 ++    { 
191.2667 ++      if (_M_name_timepunct != _S_get_c_name())
191.2668 ++	delete [] _M_name_timepunct;
191.2669 ++      delete _M_data; 
191.2670 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
191.2671 ++    }
191.2672 +--- gcc/libstdc++-v3/configure
191.2673 ++++ gcc/libstdc++-v3/configure
191.2674 +@@ -5764,7 +5764,7 @@
191.2675 +   enableval="$enable_clocale"
191.2676 + 
191.2677 +       case "$enableval" in
191.2678 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
191.2679 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
191.2680 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
191.2681 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
191.2682 +    { (exit 1); exit 1; }; } ;;
191.2683 +@@ -5789,6 +5789,9 @@
191.2684 +   # Default to "generic".
191.2685 +   if test $enable_clocale_flag = auto; then
191.2686 +     case ${target_os} in
191.2687 ++      linux-uclibc*)
191.2688 ++        enable_clocale_flag=uclibc
191.2689 ++	;;
191.2690 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
191.2691 +         cat >conftest.$ac_ext <<_ACEOF
191.2692 + /* confdefs.h.  */
191.2693 +@@ -6019,6 +6022,76 @@
191.2694 +       CTIME_CC=config/locale/generic/time_members.cc
191.2695 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
191.2696 +       ;;
191.2697 ++    uclibc)
191.2698 ++      echo "$as_me:$LINENO: result: uclibc" >&5
191.2699 ++echo "${ECHO_T}uclibc" >&6
191.2700 ++
191.2701 ++      # Declare intention to use gettext, and add support for specific
191.2702 ++      # languages.
191.2703 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
191.2704 ++      ALL_LINGUAS="de fr"
191.2705 ++
191.2706 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
191.2707 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
191.2708 ++set dummy msgfmt; ac_word=$2
191.2709 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
191.2710 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
191.2711 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
191.2712 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
191.2713 ++else
191.2714 ++  if test -n "$check_msgfmt"; then
191.2715 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
191.2716 ++else
191.2717 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
191.2718 ++for as_dir in $PATH
191.2719 ++do
191.2720 ++  IFS=$as_save_IFS
191.2721 ++  test -z "$as_dir" && as_dir=.
191.2722 ++  for ac_exec_ext in '' $ac_executable_extensions; do
191.2723 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
191.2724 ++    ac_cv_prog_check_msgfmt="yes"
191.2725 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
191.2726 ++    break 2
191.2727 ++  fi
191.2728 ++done
191.2729 ++done
191.2730 ++
191.2731 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
191.2732 ++fi
191.2733 ++fi
191.2734 ++check_msgfmt=$ac_cv_prog_check_msgfmt
191.2735 ++if test -n "$check_msgfmt"; then
191.2736 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
191.2737 ++echo "${ECHO_T}$check_msgfmt" >&6
191.2738 ++else
191.2739 ++  echo "$as_me:$LINENO: result: no" >&5
191.2740 ++echo "${ECHO_T}no" >&6
191.2741 ++fi
191.2742 ++
191.2743 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
191.2744 ++        USE_NLS=yes
191.2745 ++      fi
191.2746 ++      # Export the build objects.
191.2747 ++      for ling in $ALL_LINGUAS; do \
191.2748 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
191.2749 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
191.2750 ++      done
191.2751 ++
191.2752 ++
191.2753 ++
191.2754 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
191.2755 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
191.2756 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
191.2757 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
191.2758 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
191.2759 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
191.2760 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
191.2761 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
191.2762 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
191.2763 ++      CTIME_H=config/locale/uclibc/time_members.h
191.2764 ++      CTIME_CC=config/locale/uclibc/time_members.cc
191.2765 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
191.2766 ++      ;;
191.2767 +   esac
191.2768 + 
191.2769 +   # This is where the testsuite looks for locale catalogs, using the
191.2770 +--- gcc/libstdc++-v3/include/c_compatibility/wchar.h
191.2771 ++++ gcc/libstdc++-v3/include/c_compatibility/wchar.h
191.2772 +@@ -101,7 +101,9 @@
191.2773 + using std::wmemcpy;
191.2774 + using std::wmemmove;
191.2775 + using std::wmemset;
191.2776 ++#if _GLIBCXX_HAVE_WCSFTIME
191.2777 + using std::wcsftime;
191.2778 ++#endif
191.2779 + 
191.2780 + #if _GLIBCXX_USE_C99
191.2781 + using std::wcstold;
191.2782 +--- gcc/libstdc++-v3/include/c_std/std_cwchar.h
191.2783 ++++ gcc/libstdc++-v3/include/c_std/std_cwchar.h
191.2784 +@@ -182,7 +182,9 @@
191.2785 +   using ::wcscoll;
191.2786 +   using ::wcscpy;
191.2787 +   using ::wcscspn;
191.2788 ++#if _GLIBCXX_HAVE_WCSFTIME
191.2789 +   using ::wcsftime;
191.2790 ++#endif
191.2791 +   using ::wcslen;
191.2792 +   using ::wcsncat;
191.2793 +   using ::wcsncmp;
   192.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   192.2 +++ b/patches/gcc/4.2.0/130-uclibc-locale-no__x.patch	Mon Jul 28 21:32:33 2008 +0000
   192.3 @@ -0,0 +1,213 @@
   192.4 +--- gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h.uclibc200no__x~	2006-03-10 15:06:17 +0100
   192.5 ++++ gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2006-03-10 15:32:37 +0100
   192.6 +@@ -60,4 +60,49 @@
   192.7 + extern "C" __typeof(wctype_l) __wctype_l;
   192.8 + #endif 
   192.9 + 
  192.10 ++# define __nl_langinfo_l nl_langinfo_l
  192.11 ++# define __strcoll_l strcoll_l
  192.12 ++# define __strftime_l strftime_l
  192.13 ++# define __strtod_l strtod_l
  192.14 ++# define __strtof_l strtof_l
  192.15 ++# define __strtold_l strtold_l
  192.16 ++# define __strxfrm_l strxfrm_l
  192.17 ++# define __newlocale newlocale
  192.18 ++# define __freelocale freelocale
  192.19 ++# define __duplocale duplocale
  192.20 ++# define __uselocale uselocale
  192.21 ++
  192.22 ++# ifdef _GLIBCXX_USE_WCHAR_T
  192.23 ++#  define __iswctype_l iswctype_l
  192.24 ++#  define __towlower_l towlower_l
  192.25 ++#  define __towupper_l towupper_l
  192.26 ++#  define __wcscoll_l wcscoll_l
  192.27 ++#  define __wcsftime_l wcsftime_l
  192.28 ++#  define __wcsxfrm_l wcsxfrm_l
  192.29 ++#  define __wctype_l wctype_l
  192.30 ++# endif
  192.31 ++
  192.32 ++#else
  192.33 ++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  192.34 ++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  192.35 ++# define __strtod_l(S, E, L)         strtod((S), (E))
  192.36 ++# define __strtof_l(S, E, L)         strtof((S), (E))
  192.37 ++# define __strtold_l(S, E, L)        strtold((S), (E))
  192.38 ++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  192.39 ++# warning should dummy __newlocale check for C|POSIX ?
  192.40 ++# define __newlocale(a, b, c)        NULL
  192.41 ++# define __freelocale(a)             ((void)0)
  192.42 ++# define __duplocale(a)              __c_locale()
  192.43 ++//# define __uselocale ?
  192.44 ++//
  192.45 ++# ifdef _GLIBCXX_USE_WCHAR_T
  192.46 ++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  192.47 ++#  define __towlower_l(C, L)          towlower((C))
  192.48 ++#  define __towupper_l(C, L)          towupper((C))
  192.49 ++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  192.50 ++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  192.51 ++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  192.52 ++#  define __wctype_l(S, L)            wctype((S))
  192.53 ++# endif
  192.54 ++
  192.55 + #endif // GLIBC 2.3 and later
  192.56 +--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
  192.57 ++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc	2006-03-10 15:32:37 +0100
  192.58 +@@ -39,20 +39,6 @@
  192.59 + #include <langinfo.h>
  192.60 + #include <bits/c++locale_internal.h>
  192.61 + 
  192.62 +-#ifndef __UCLIBC_HAS_XLOCALE__
  192.63 +-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  192.64 +-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  192.65 +-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  192.66 +-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  192.67 +-#define __strtof_l(S, E, L)         strtof((S), (E))
  192.68 +-#define __strtod_l(S, E, L)         strtod((S), (E))
  192.69 +-#define __strtold_l(S, E, L)        strtold((S), (E))
  192.70 +-#warning should dummy __newlocale check for C|POSIX ?
  192.71 +-#define __newlocale(a, b, c)        NULL
  192.72 +-#define __freelocale(a)             ((void)0)
  192.73 +-#define __duplocale(a)              __c_locale()
  192.74 +-#endif
  192.75 +-
  192.76 + namespace std 
  192.77 + {
  192.78 +   template<>
  192.79 +--- gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
  192.80 ++++ gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc	2006-03-10 15:32:37 +0100
  192.81 +@@ -36,13 +36,6 @@
  192.82 + #include <locale>
  192.83 + #include <bits/c++locale_internal.h>
  192.84 + 
  192.85 +-#ifndef __UCLIBC_HAS_XLOCALE__
  192.86 +-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  192.87 +-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  192.88 +-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  192.89 +-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  192.90 +-#endif
  192.91 +-
  192.92 + namespace std
  192.93 + {
  192.94 +   // These are basically extensions to char_traits, and perhaps should
  192.95 +--- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
  192.96 ++++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2006-03-10 15:32:37 +0100
  192.97 +@@ -43,10 +43,6 @@
  192.98 + #warning tailor for stub locale support
  192.99 + #endif
 192.100 + 
 192.101 +-#ifndef __UCLIBC_HAS_XLOCALE__
 192.102 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 192.103 +-#endif
 192.104 +-
 192.105 + namespace std
 192.106 + {
 192.107 +   // Construct and return valid pattern consisting of some combination of:
 192.108 +--- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
 192.109 ++++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2006-03-10 15:32:37 +0100
 192.110 +@@ -41,9 +41,6 @@
 192.111 + #ifdef __UCLIBC_MJN3_ONLY__
 192.112 + #warning tailor for stub locale support
 192.113 + #endif
 192.114 +-#ifndef __UCLIBC_HAS_XLOCALE__
 192.115 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 192.116 +-#endif
 192.117 + 
 192.118 + namespace std
 192.119 + {
 192.120 +--- gcc/libstdc++-v3/config/locale/uclibc/time_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
 192.121 ++++ gcc/libstdc++-v3/config/locale/uclibc/time_members.cc	2006-03-10 15:32:37 +0100
 192.122 +@@ -40,9 +40,6 @@
 192.123 + #ifdef __UCLIBC_MJN3_ONLY__
 192.124 + #warning tailor for stub locale support
 192.125 + #endif
 192.126 +-#ifndef __UCLIBC_HAS_XLOCALE__
 192.127 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 192.128 +-#endif
 192.129 + 
 192.130 + namespace std
 192.131 + {
 192.132 +--- gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
 192.133 ++++ gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2006-03-10 15:32:37 +0100
 192.134 +@@ -38,13 +38,6 @@
 192.135 + #undef _LIBC
 192.136 + #include <bits/c++locale_internal.h>
 192.137 + 
 192.138 +-#ifndef __UCLIBC_HAS_XLOCALE__
 192.139 +-#define __wctype_l(S, L)           wctype((S))
 192.140 +-#define __towupper_l(C, L)         towupper((C))
 192.141 +-#define __towlower_l(C, L)         towlower((C))
 192.142 +-#define __iswctype_l(C, M, L)      iswctype((C), (M))
 192.143 +-#endif
 192.144 +-
 192.145 + namespace std
 192.146 + {
 192.147 +   // NB: The other ctype<char> specializations are in src/locale.cc and
 192.148 +--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
 192.149 ++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc	2006-03-10 15:32:37 +0100
 192.150 +@@ -39,13 +39,10 @@
 192.151 + #ifdef __UCLIBC_MJN3_ONLY__
 192.152 + #warning fix gettext stuff
 192.153 + #endif
 192.154 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 192.155 +-extern "C" char *__dcgettext(const char *domainname,
 192.156 +-			     const char *msgid, int category);
 192.157 + #undef gettext
 192.158 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 192.159 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 192.160 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 192.161 + #else
 192.162 +-#undef gettext
 192.163 + #define gettext(msgid) (msgid)
 192.164 + #endif
 192.165 + 
 192.166 +--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.h.uclibc200no__x~	2006-03-10 15:06:17 +0100
 192.167 ++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.h	2006-03-10 15:32:37 +0100
 192.168 +@@ -36,15 +36,11 @@
 192.169 + #ifdef __UCLIBC_MJN3_ONLY__
 192.170 + #warning fix prototypes for *textdomain funcs
 192.171 + #endif
 192.172 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 192.173 +-extern "C" char *__textdomain(const char *domainname);
 192.174 +-extern "C" char *__bindtextdomain(const char *domainname,
 192.175 +-				  const char *dirname);
 192.176 +-#else
 192.177 +-#undef __textdomain
 192.178 +-#undef __bindtextdomain
 192.179 +-#define __textdomain(D)           ((void)0)
 192.180 +-#define __bindtextdomain(D,P)     ((void)0)
 192.181 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 192.182 ++#undef textdomain
 192.183 ++#undef bindtextdomain
 192.184 ++#define textdomain(D)           ((void)0)
 192.185 ++#define bindtextdomain(D,P)     ((void)0)
 192.186 + #endif
 192.187 + 
 192.188 +   // Non-virtual member functions.
 192.189 +@@ -70,7 +66,7 @@
 192.190 +     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 192.191 + 			   const char* __dir) const
 192.192 +     { 
 192.193 +-      __bindtextdomain(__s.c_str(), __dir);
 192.194 ++      bindtextdomain(__s.c_str(), __dir);
 192.195 +       return this->do_open(__s, __loc); 
 192.196 +     }
 192.197 + 
 192.198 +@@ -90,7 +86,7 @@
 192.199 +     { 
 192.200 +       // No error checking is done, assume the catalog exists and can
 192.201 +       // be used.
 192.202 +-      __textdomain(__s.c_str());
 192.203 ++      textdomain(__s.c_str());
 192.204 +       return 0;
 192.205 +     }
 192.206 + 
 192.207 +--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.h.uclibc200no__x~	2006-03-10 15:06:17 +0100
 192.208 ++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.h	2006-03-10 15:32:37 +0100
 192.209 +@@ -68,6 +68,7 @@
 192.210 + {
 192.211 +   extern "C" __typeof(uselocale) __uselocale;
 192.212 + }
 192.213 ++#define __uselocale uselocale
 192.214 + #endif
 192.215 + 
 192.216 + namespace std
   193.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   193.2 +++ b/patches/gcc/4.2.0/140-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:32:33 2008 +0000
   193.3 @@ -0,0 +1,48 @@
   193.4 +--- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200_wchar~	2006-03-10 15:32:37 +0100
   193.5 ++++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2006-03-10 15:37:27 +0100
   193.6 +@@ -401,7 +401,7 @@
   193.7 + # ifdef __UCLIBC_HAS_XLOCALE__
   193.8 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
   193.9 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  193.10 +-# else
  193.11 ++# elif defined __UCLIBC_HAS_LOCALE__
  193.12 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  193.13 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  193.14 + # endif
  193.15 +@@ -556,7 +556,7 @@
  193.16 + # ifdef __UCLIBC_HAS_XLOCALE__
  193.17 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  193.18 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  193.19 +-# else
  193.20 ++# elif defined __UCLIBC_HAS_LOCALE__
  193.21 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  193.22 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  193.23 + # endif
  193.24 +--- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200_wchar~	2006-03-10 15:32:37 +0100
  193.25 ++++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2006-03-10 15:37:27 +0100
  193.26 +@@ -127,12 +127,25 @@
  193.27 + 	{
  193.28 + 	  // Named locale.
  193.29 + 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  193.30 ++#ifdef __UCLIBC_MJN3_ONLY__
  193.31 ++#warning fix this... should be numeric
  193.32 ++#endif
  193.33 ++#ifdef __UCLIBC__
  193.34 ++# ifdef __UCLIBC_HAS_XLOCALE__
  193.35 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  193.36 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  193.37 ++# elif defined __UCLIBC_HAS_LOCALE__
  193.38 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  193.39 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  193.40 ++# endif
  193.41 ++#else
  193.42 + 	  union { char *__s; wchar_t __w; } __u;
  193.43 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  193.44 + 	  _M_data->_M_decimal_point = __u.__w;
  193.45 + 
  193.46 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  193.47 + 	  _M_data->_M_thousands_sep = __u.__w;
  193.48 ++#endif
  193.49 + 
  193.50 + 	  if (_M_data->_M_thousands_sep == L'\0')
  193.51 + 	    _M_data->_M_grouping = "";
   194.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   194.2 +++ b/patches/gcc/4.2.0/150-uclibc-locale-update.patch	Mon Jul 28 21:32:33 2008 +0000
   194.3 @@ -0,0 +1,347 @@
   194.4 +--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc.uclibc200_update~	2006-03-10 15:32:37 +0100
   194.5 ++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc	2006-03-10 15:39:14 +0100
   194.6 +@@ -46,16 +47,13 @@
   194.7 +     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   194.8 + 		   const __c_locale& __cloc)
   194.9 +     {
  194.10 +-      if (!(__err & ios_base::failbit))
  194.11 +-	{
  194.12 +-	  char* __sanity;
  194.13 +-	  errno = 0;
  194.14 +-	  float __f = __strtof_l(__s, &__sanity, __cloc);
  194.15 +-          if (__sanity != __s && errno != ERANGE)
  194.16 +-	    __v = __f;
  194.17 +-	  else
  194.18 +-	    __err |= ios_base::failbit;
  194.19 +-	}
  194.20 ++      char* __sanity;
  194.21 ++      errno = 0;
  194.22 ++      float __f = __strtof_l(__s, &__sanity, __cloc);
  194.23 ++      if (__sanity != __s && errno != ERANGE)
  194.24 ++	__v = __f;
  194.25 ++      else
  194.26 ++	__err |= ios_base::failbit;
  194.27 +     }
  194.28 + 
  194.29 +   template<>
  194.30 +@@ -63,16 +61,13 @@
  194.31 +     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  194.32 + 		   const __c_locale& __cloc)
  194.33 +     {
  194.34 +-      if (!(__err & ios_base::failbit))
  194.35 +-	{
  194.36 +-	  char* __sanity;
  194.37 +-	  errno = 0;
  194.38 +-	  double __d = __strtod_l(__s, &__sanity, __cloc);
  194.39 +-          if (__sanity != __s && errno != ERANGE)
  194.40 +-	    __v = __d;
  194.41 +-	  else
  194.42 +-	    __err |= ios_base::failbit;
  194.43 +-	}
  194.44 ++      char* __sanity;
  194.45 ++      errno = 0;
  194.46 ++      double __d = __strtod_l(__s, &__sanity, __cloc);
  194.47 ++      if (__sanity != __s && errno != ERANGE)
  194.48 ++	__v = __d;
  194.49 ++      else
  194.50 ++	__err |= ios_base::failbit;
  194.51 +     }
  194.52 + 
  194.53 +   template<>
  194.54 +@@ -80,16 +75,13 @@
  194.55 +     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  194.56 + 		   const __c_locale& __cloc)
  194.57 +     {
  194.58 +-      if (!(__err & ios_base::failbit))
  194.59 +-	{
  194.60 +-	  char* __sanity;
  194.61 +-	  errno = 0;
  194.62 +-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  194.63 +-          if (__sanity != __s && errno != ERANGE)
  194.64 +-	    __v = __ld;
  194.65 +-	  else
  194.66 +-	    __err |= ios_base::failbit;
  194.67 +-	}
  194.68 ++      char* __sanity;
  194.69 ++      errno = 0;
  194.70 ++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  194.71 ++      if (__sanity != __s && errno != ERANGE)
  194.72 ++	__v = __ld;
  194.73 ++      else
  194.74 ++	__err |= ios_base::failbit;
  194.75 +     }
  194.76 + 
  194.77 +   void
  194.78 +@@ -110,7 +102,7 @@
  194.79 +   void
  194.80 +   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  194.81 +   {
  194.82 +-    if (_S_get_c_locale() != __cloc)
  194.83 ++    if (__cloc && _S_get_c_locale() != __cloc)
  194.84 +       __freelocale(__cloc); 
  194.85 +   }
  194.86 + 
  194.87 +--- gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc.uclibc200_update~	2006-03-10 15:32:37 +0100
  194.88 ++++ gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2006-03-10 15:39:14 +0100
  194.89 +@@ -33,9 +33,14 @@
  194.90 + 
  194.91 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  194.92 + 
  194.93 ++#include <features.h>
  194.94 ++#ifdef __UCLIBC_HAS_LOCALE__
  194.95 + #define _LIBC
  194.96 + #include <locale>
  194.97 + #undef _LIBC
  194.98 ++#else
  194.99 ++#include <locale>
 194.100 ++#endif
 194.101 + #include <bits/c++locale_internal.h>
 194.102 + 
 194.103 + namespace std
 194.104 +@@ -138,20 +143,34 @@
 194.105 +   ctype<wchar_t>::
 194.106 +   do_is(mask __m, wchar_t __c) const
 194.107 +   { 
 194.108 +-    // Highest bitmask in ctype_base == 10, but extra in "C"
 194.109 +-    // library for blank.
 194.110 ++    // The case of __m == ctype_base::space is particularly important,
 194.111 ++    // due to its use in many istream functions.  Therefore we deal with
 194.112 ++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 194.113 ++    // is the mask corresponding to ctype_base::space.  NB: an encoding
 194.114 ++    // change would not affect correctness!
 194.115 +     bool __ret = false;
 194.116 +-    const size_t __bitmasksize = 11; 
 194.117 +-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 194.118 +-      if (__m & _M_bit[__bitcur]
 194.119 +-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 194.120 +-	{
 194.121 +-	  __ret = true;
 194.122 +-	  break;
 194.123 +-	}
 194.124 ++    if (__m == _M_bit[5])
 194.125 ++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 194.126 ++    else
 194.127 ++      {
 194.128 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 194.129 ++	// library for blank.
 194.130 ++	const size_t __bitmasksize = 11;
 194.131 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 194.132 ++	  if (__m & _M_bit[__bitcur])
 194.133 ++	    {
 194.134 ++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 194.135 ++		{
 194.136 ++		  __ret = true;
 194.137 ++		  break;
 194.138 ++		}
 194.139 ++	      else if (__m == _M_bit[__bitcur])
 194.140 ++		break;
 194.141 ++	    }
 194.142 ++      }
 194.143 +     return __ret;    
 194.144 +   }
 194.145 +-  
 194.146 ++
 194.147 +   const wchar_t* 
 194.148 +   ctype<wchar_t>::
 194.149 +   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 194.150 +--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.h.uclibc200_update~	2006-03-10 15:32:37 +0100
 194.151 ++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.h	2006-03-10 15:39:14 +0100
 194.152 +@@ -47,18 +47,21 @@
 194.153 +   template<typename _CharT>
 194.154 +      messages<_CharT>::messages(size_t __refs)
 194.155 +      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 194.156 +-     _M_name_messages(_S_get_c_name())
 194.157 ++       _M_name_messages(_S_get_c_name())
 194.158 +      { }
 194.159 + 
 194.160 +   template<typename _CharT>
 194.161 +      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 194.162 + 				size_t __refs) 
 194.163 +-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 194.164 +-     _M_name_messages(__s)
 194.165 ++     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 194.166 +      {
 194.167 +-       char* __tmp = new char[std::strlen(__s) + 1];
 194.168 +-       std::strcpy(__tmp, __s);
 194.169 ++       const size_t __len = std::strlen(__s) + 1;
 194.170 ++       char* __tmp = new char[__len];
 194.171 ++       std::memcpy(__tmp, __s, __len);
 194.172 +        _M_name_messages = __tmp;
 194.173 ++
 194.174 ++       // Last to avoid leaking memory if new throws.
 194.175 ++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 194.176 +      }
 194.177 + 
 194.178 +   template<typename _CharT>
 194.179 +--- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200_update~	2006-03-10 15:37:27 +0100
 194.180 ++++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2006-03-10 15:39:14 +0100
 194.181 +@@ -33,9 +33,14 @@
 194.182 + 
 194.183 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 194.184 + 
 194.185 ++#include <features.h>
 194.186 ++#ifdef __UCLIBC_HAS_LOCALE__
 194.187 + #define _LIBC
 194.188 + #include <locale>
 194.189 + #undef _LIBC
 194.190 ++#else
 194.191 ++#include <locale>
 194.192 ++#endif
 194.193 + #include <bits/c++locale_internal.h>
 194.194 + 
 194.195 + #ifdef __UCLIBC_MJN3_ONLY__
 194.196 +@@ -206,7 +211,7 @@
 194.197 + 	  }
 194.198 + 	break;
 194.199 +       default:
 194.200 +-	;
 194.201 ++	__ret = pattern();
 194.202 +       }
 194.203 +     return __ret;
 194.204 +   }
 194.205 +--- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200_update~	2006-03-10 15:37:27 +0100
 194.206 ++++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2006-03-10 15:39:14 +0100
 194.207 +@@ -33,9 +33,14 @@
 194.208 + 
 194.209 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 194.210 + 
 194.211 ++#include <features.h>
 194.212 ++#ifdef __UCLIBC_HAS_LOCALE__
 194.213 + #define _LIBC
 194.214 + #include <locale>
 194.215 + #undef _LIBC
 194.216 ++#else
 194.217 ++#include <locale>
 194.218 ++#endif
 194.219 + #include <bits/c++locale_internal.h>
 194.220 + 
 194.221 + #ifdef __UCLIBC_MJN3_ONLY__
 194.222 +--- gcc/libstdc++-v3/config/locale/uclibc/time_members.h.uclibc200_update~	2006-03-10 15:06:17 +0100
 194.223 ++++ gcc/libstdc++-v3/config/locale/uclibc/time_members.h	2006-03-10 15:39:14 +0100
 194.224 +@@ -37,25 +37,33 @@
 194.225 +   template<typename _CharT>
 194.226 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
 194.227 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 194.228 +-    _M_name_timepunct(_S_get_c_name())
 194.229 ++      _M_name_timepunct(_S_get_c_name())
 194.230 +     { _M_initialize_timepunct(); }
 194.231 + 
 194.232 +   template<typename _CharT>
 194.233 +     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 194.234 +     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 194.235 +-    _M_name_timepunct(_S_get_c_name())
 194.236 ++      _M_name_timepunct(_S_get_c_name())
 194.237 +     { _M_initialize_timepunct(); }
 194.238 + 
 194.239 +   template<typename _CharT>
 194.240 +     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 194.241 + 				     size_t __refs) 
 194.242 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 194.243 +-    _M_name_timepunct(__s)
 194.244 ++      _M_name_timepunct(NULL)
 194.245 +     { 
 194.246 +-      char* __tmp = new char[std::strlen(__s) + 1];
 194.247 +-      std::strcpy(__tmp, __s);
 194.248 ++      const size_t __len = std::strlen(__s) + 1;
 194.249 ++      char* __tmp = new char[__len];
 194.250 ++      std::memcpy(__tmp, __s, __len);
 194.251 +       _M_name_timepunct = __tmp;
 194.252 +-      _M_initialize_timepunct(__cloc); 
 194.253 ++
 194.254 ++      try
 194.255 ++	{ _M_initialize_timepunct(__cloc); }
 194.256 ++      catch(...)
 194.257 ++	{
 194.258 ++	  delete [] _M_name_timepunct;
 194.259 ++	  __throw_exception_again;
 194.260 ++	}
 194.261 +     }
 194.262 + 
 194.263 +   template<typename _CharT>
 194.264 +--- gcc-4.2/libstdc++-v3/config/locale/uclibc/c_locale.h.old	2006-09-28 11:39:00.000000000 +0200
 194.265 ++++ gcc-4.2/libstdc++-v3/config/locale/uclibc/c_locale.h	2006-09-28 12:10:41.000000000 +0200
 194.266 +@@ -39,21 +39,23 @@
 194.267 + #pragma GCC system_header
 194.268 + 
 194.269 + #include <cstring>              // get std::strlen
 194.270 +-#include <cstdio>               // get std::snprintf or std::sprintf
 194.271 ++#include <cstdio>               // get std::vsnprintf or std::vsprintf
 194.272 + #include <clocale>
 194.273 + #include <langinfo.h>		// For codecvt
 194.274 + #ifdef __UCLIBC_MJN3_ONLY__
 194.275 + #warning fix this
 194.276 + #endif
 194.277 +-#ifdef __UCLIBC_HAS_LOCALE__
 194.278 ++#ifdef _GLIBCXX_USE_ICONV
 194.279 + #include <iconv.h>		// For codecvt using iconv, iconv_t
 194.280 + #endif
 194.281 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 194.282 +-#include <libintl.h> 		// For messages
 194.283 ++#ifdef HAVE_LIBINTL_H
 194.284 ++#include <libintl.h>		// For messages
 194.285 + #endif
 194.286 ++#include <cstdarg>
 194.287 + 
 194.288 + #ifdef __UCLIBC_MJN3_ONLY__
 194.289 + #warning what is _GLIBCXX_C_LOCALE_GNU for
 194.290 ++// psm: used in os/gnu-linux/ctype_noninline.h
 194.291 + #endif
 194.292 + #define _GLIBCXX_C_LOCALE_GNU 1
 194.293 + 
 194.294 +@@ -62,7 +64,7 @@
 194.295 + #endif
 194.296 + // #define _GLIBCXX_NUM_CATEGORIES 6
 194.297 + #define _GLIBCXX_NUM_CATEGORIES 0
 194.298 +- 
 194.299 ++
 194.300 + #ifdef __UCLIBC_HAS_XLOCALE__
 194.301 + namespace __gnu_cxx
 194.302 + {
 194.303 +@@ -79,22 +81,24 @@
 194.304 +   typedef int*			__c_locale;
 194.305 + #endif
 194.306 + 
 194.307 +-  // Convert numeric value of type _Tv to string and return length of
 194.308 +-  // string.  If snprintf is available use it, otherwise fall back to
 194.309 +-  // the unsafe sprintf which, in general, can be dangerous and should
 194.310 ++  // Convert numeric value of type double to string and return length of
 194.311 ++  // string.  If vsnprintf is available use it, otherwise fall back to
 194.312 ++  // the unsafe vsprintf which, in general, can be dangerous and should
 194.313 +   // be avoided.
 194.314 +-  template<typename _Tv>
 194.315 +-    int
 194.316 +-    __convert_from_v(char* __out, 
 194.317 +-		     const int __size __attribute__ ((__unused__)),
 194.318 +-		     const char* __fmt,
 194.319 +-#ifdef __UCLIBC_HAS_XCLOCALE__
 194.320 +-		     _Tv __v, const __c_locale& __cloc, int __prec)
 194.321 ++    inline int
 194.322 ++    __convert_from_v(const __c_locale&
 194.323 ++#ifndef __UCLIBC_HAS_XCLOCALE__
 194.324 ++					__cloc __attribute__ ((__unused__))
 194.325 ++#endif
 194.326 ++		     ,
 194.327 ++		     char* __out,
 194.328 ++		     const int __size,
 194.329 ++		     const char* __fmt, ...)
 194.330 +     {
 194.331 ++      va_list __args;
 194.332 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 194.333 +       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 194.334 + #else
 194.335 +-		     _Tv __v, const __c_locale&, int __prec)
 194.336 +-    {
 194.337 + # ifdef __UCLIBC_HAS_LOCALE__
 194.338 +       char* __old = std::setlocale(LC_ALL, NULL);
 194.339 +       char* __sav = new char[std::strlen(__old) + 1];
 194.340 +@@ -103,7 +107,9 @@
 194.341 + # endif
 194.342 + #endif
 194.343 + 
 194.344 +-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 194.345 ++      va_start(__args, __fmt);
 194.346 ++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 194.347 ++      va_end(__args);
 194.348 + 
 194.349 + #ifdef __UCLIBC_HAS_XCLOCALE__
 194.350 +       __gnu_cxx::__uselocale(__old);
   195.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   195.2 +++ b/patches/gcc/4.2.0/160-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   195.3 @@ -0,0 +1,50 @@
   195.4 +# DP: Build and install libstdc++_pic.a library.
   195.5 +
   195.6 +--- gcc/libstdc++-v3/src/Makefile.am
   195.7 ++++ gcc/libstdc++-v3/src/Makefile.am
   195.8 +@@ -214,6 +214,12 @@
   195.9 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
  195.10 + 
  195.11 + 
  195.12 ++install-exec-local:
  195.13 ++ifeq ($(enable_shared),yes)
  195.14 ++	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  195.15 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  195.16 ++endif
  195.17 ++
  195.18 + # Added bits to build debug library.
  195.19 + if GLIBCXX_BUILD_DEBUG
  195.20 + all-local: build_debug
  195.21 +--- gcc/libstdc++-v3/src/Makefile.in
  195.22 ++++ gcc/libstdc++-v3/src/Makefile.in
  195.23 +@@ -627,7 +627,7 @@
  195.24 + 
  195.25 + install-data-am: install-data-local
  195.26 + 
  195.27 +-install-exec-am: install-toolexeclibLTLIBRARIES
  195.28 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  195.29 + 
  195.30 + install-info: install-info-am
  195.31 + 
  195.32 +@@ -660,6 +660,7 @@
  195.33 + 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  195.34 + 	html-am info info-am install install-am install-data \
  195.35 + 	install-data-am install-data-local install-exec \
  195.36 ++	install-exec-local \
  195.37 + 	install-exec-am install-info install-info-am install-man \
  195.38 + 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  195.39 + 	installcheck-am installdirs maintainer-clean \
  195.40 +@@ -743,6 +743,13 @@
  195.41 + install_debug:
  195.42 + 	(cd ${debugdir} && $(MAKE) \
  195.43 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  195.44 ++
  195.45 ++install-exec-local:
  195.46 ++ifeq ($(enable_shared),yes)
  195.47 ++	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  195.48 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  195.49 ++endif
  195.50 ++
  195.51 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  195.52 + # Otherwise a system limit (for SysV at least) may be exceeded.
  195.53 + .NOEXPORT:
   196.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   196.2 +++ b/patches/gcc/4.2.0/170-missing-execinfo_h.patch	Mon Jul 28 21:32:33 2008 +0000
   196.3 @@ -0,0 +1,11 @@
   196.4 +--- gcc-4.0.0/boehm-gc/include/gc.h-orig	2005-04-28 22:28:57.000000000 -0500
   196.5 ++++ gcc-4.0.0/boehm-gc/include/gc.h	2005-04-28 22:30:38.000000000 -0500
   196.6 +@@ -500,7 +500,7 @@
   196.7 + #ifdef __linux__
   196.8 + # include <features.h>
   196.9 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  196.10 +-     && !defined(__ia64__)
  196.11 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  196.12 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  196.13 + #     define GC_HAVE_BUILTIN_BACKTRACE
  196.14 + #   endif
   197.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   197.2 +++ b/patches/gcc/4.2.0/180-c99-snprintf.patch	Mon Jul 28 21:32:33 2008 +0000
   197.3 @@ -0,0 +1,11 @@
   197.4 +--- gcc-4.2.0.orig/libstdc++-v3/include/c_std/std_cstdio.h	2006-12-07 10:33:51.000000000 +0100
   197.5 ++++ gcc-4.2.0/libstdc++-v3/include/c_std/std_cstdio.h	2007-05-20 01:05:38.000000000 +0200
   197.6 +@@ -144,7 +144,7 @@
   197.7 + 
   197.8 + _GLIBCXX_END_NAMESPACE
   197.9 + 
  197.10 +-#if _GLIBCXX_USE_C99
  197.11 ++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  197.12 + 
  197.13 + #undef snprintf
  197.14 + #undef vfscanf
   198.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   198.2 +++ b/patches/gcc/4.2.0/190-c99-complex-ugly-hack.patch	Mon Jul 28 21:32:33 2008 +0000
   198.3 @@ -0,0 +1,12 @@
   198.4 +--- gcc-4.0.0/libstdc++-v3/configure-old	2005-04-30 22:04:48.061603912 -0500
   198.5 ++++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 22:06:13.678588152 -0500
   198.6 +@@ -7194,6 +7194,9 @@
   198.7 + cat >>conftest.$ac_ext <<_ACEOF
   198.8 + /* end confdefs.h.  */
   198.9 + #include <complex.h>
  198.10 ++#ifdef __UCLIBC__
  198.11 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  198.12 ++#endif
  198.13 + int
  198.14 + main ()
  198.15 + {
   199.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   199.2 +++ b/patches/gcc/4.2.0/200-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
   199.3 @@ -0,0 +1,24 @@
   199.4 +--- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps	2006-03-24 01:49:51 +0100
   199.5 ++++ gcc-4.1.0/libstdc++-v3/include/ext/rope	2006-03-24 01:49:37 +0100
   199.6 +@@ -59,6 +59,9 @@
   199.7 + #include <bits/allocator.h>
   199.8 + #include <ext/hash_fun.h>
   199.9 + 
  199.10 ++/* cope w/ index defined as macro, SuSv3 proposal */
  199.11 ++#undef index
  199.12 ++
  199.13 + # ifdef __GC
  199.14 + #   define __GC_CONST const
  199.15 + # else
  199.16 +--- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps	2006-03-24 01:50:04 +0100
  199.17 ++++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h	2006-03-24 01:50:28 +0100
  199.18 +@@ -53,6 +53,9 @@
  199.19 + #include <ext/memory> // For uninitialized_copy_n
  199.20 + #include <ext/numeric> // For power
  199.21 + 
  199.22 ++/* cope w/ index defined as macro, SuSv3 proposal */
  199.23 ++#undef index
  199.24 ++
  199.25 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  199.26 +
  199.27 +   using std::size_t;
   200.1 --- a/patches/gcc/4.2.0/200-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   200.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   200.3 @@ -1,2790 +0,0 @@
   200.4 ---- gcc/libstdc++-v3/acinclude.m4
   200.5 -+++ gcc/libstdc++-v3/acinclude.m4
   200.6 -@@ -1369,7 +1369,7 @@
   200.7 -   AC_MSG_CHECKING([for C locale to use])
   200.8 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
   200.9 -     [use MODEL for target locale package],
  200.10 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  200.11 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  200.12 -   
  200.13 -   # If they didn't use this option switch, or if they specified --enable
  200.14 -   # with no specific model, we'll have to look for one.  If they
  200.15 -@@ -1385,6 +1385,9 @@
  200.16 -   # Default to "generic".
  200.17 -   if test $enable_clocale_flag = auto; then
  200.18 -     case ${target_os} in
  200.19 -+      *-uclibc*)
  200.20 -+        enable_clocale_flag=uclibc
  200.21 -+        ;;
  200.22 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  200.23 -         AC_EGREP_CPP([_GLIBCXX_ok], [
  200.24 -         #include <features.h>
  200.25 -@@ -1528,6 +1531,40 @@
  200.26 -       CTIME_CC=config/locale/generic/time_members.cc
  200.27 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  200.28 -       ;;
  200.29 -+    uclibc)
  200.30 -+      AC_MSG_RESULT(uclibc)
  200.31 -+
  200.32 -+      # Declare intention to use gettext, and add support for specific
  200.33 -+      # languages.
  200.34 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  200.35 -+      ALL_LINGUAS="de fr"
  200.36 -+
  200.37 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  200.38 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  200.39 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  200.40 -+        USE_NLS=yes
  200.41 -+      fi
  200.42 -+      # Export the build objects.
  200.43 -+      for ling in $ALL_LINGUAS; do \
  200.44 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  200.45 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  200.46 -+      done
  200.47 -+      AC_SUBST(glibcxx_MOFILES)
  200.48 -+      AC_SUBST(glibcxx_POFILES)
  200.49 -+
  200.50 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  200.51 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  200.52 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  200.53 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  200.54 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  200.55 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  200.56 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  200.57 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  200.58 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  200.59 -+      CTIME_H=config/locale/uclibc/time_members.h
  200.60 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  200.61 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  200.62 -+      ;;
  200.63 -   esac
  200.64 - 
  200.65 -   # This is where the testsuite looks for locale catalogs, using the
  200.66 ---- gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  200.67 -+++ gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  200.68 -@@ -0,0 +1,63 @@
  200.69 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  200.70 -+
  200.71 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  200.72 -+//
  200.73 -+// This file is part of the GNU ISO C++ Library.  This library is free
  200.74 -+// software; you can redistribute it and/or modify it under the
  200.75 -+// terms of the GNU General Public License as published by the
  200.76 -+// Free Software Foundation; either version 2, or (at your option)
  200.77 -+// any later version.
  200.78 -+
  200.79 -+// This library is distributed in the hope that it will be useful,
  200.80 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  200.81 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  200.82 -+// GNU General Public License for more details.
  200.83 -+
  200.84 -+// You should have received a copy of the GNU General Public License along
  200.85 -+// with this library; see the file COPYING.  If not, write to the Free
  200.86 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  200.87 -+// USA.
  200.88 -+
  200.89 -+// As a special exception, you may use this file as part of a free software
  200.90 -+// library without restriction.  Specifically, if other files instantiate
  200.91 -+// templates or use macros or inline functions from this file, or you compile
  200.92 -+// this file and link it with other files to produce an executable, this
  200.93 -+// file does not by itself cause the resulting executable to be covered by
  200.94 -+// the GNU General Public License.  This exception does not however
  200.95 -+// invalidate any other reasons why the executable file might be covered by
  200.96 -+// the GNU General Public License.
  200.97 -+
  200.98 -+// Written by Jakub Jelinek <jakub@redhat.com>
  200.99 -+
 200.100 -+#include <bits/c++config.h>
 200.101 -+#include <clocale>
 200.102 -+
 200.103 -+#ifdef __UCLIBC_MJN3_ONLY__
 200.104 -+#warning clean this up
 200.105 -+#endif
 200.106 -+
 200.107 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.108 -+                                                  
 200.109 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 200.110 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 200.111 -+extern "C" __typeof(strftime_l) __strftime_l;
 200.112 -+extern "C" __typeof(strtod_l) __strtod_l;
 200.113 -+extern "C" __typeof(strtof_l) __strtof_l;
 200.114 -+extern "C" __typeof(strtold_l) __strtold_l;
 200.115 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 200.116 -+extern "C" __typeof(newlocale) __newlocale;
 200.117 -+extern "C" __typeof(freelocale) __freelocale;
 200.118 -+extern "C" __typeof(duplocale) __duplocale;
 200.119 -+extern "C" __typeof(uselocale) __uselocale;
 200.120 -+
 200.121 -+#ifdef _GLIBCXX_USE_WCHAR_T
 200.122 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 200.123 -+extern "C" __typeof(towlower_l) __towlower_l;
 200.124 -+extern "C" __typeof(towupper_l) __towupper_l;
 200.125 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 200.126 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 200.127 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 200.128 -+extern "C" __typeof(wctype_l) __wctype_l;
 200.129 -+#endif 
 200.130 -+
 200.131 -+#endif // GLIBC 2.3 and later
 200.132 ---- gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc
 200.133 -+++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc
 200.134 -@@ -0,0 +1,160 @@
 200.135 -+// Wrapper for underlying C-language localization -*- C++ -*-
 200.136 -+
 200.137 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 200.138 -+//
 200.139 -+// This file is part of the GNU ISO C++ Library.  This library is free
 200.140 -+// software; you can redistribute it and/or modify it under the
 200.141 -+// terms of the GNU General Public License as published by the
 200.142 -+// Free Software Foundation; either version 2, or (at your option)
 200.143 -+// any later version.
 200.144 -+
 200.145 -+// This library is distributed in the hope that it will be useful,
 200.146 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 200.147 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 200.148 -+// GNU General Public License for more details.
 200.149 -+
 200.150 -+// You should have received a copy of the GNU General Public License along
 200.151 -+// with this library; see the file COPYING.  If not, write to the Free
 200.152 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 200.153 -+// USA.
 200.154 -+
 200.155 -+// As a special exception, you may use this file as part of a free software
 200.156 -+// library without restriction.  Specifically, if other files instantiate
 200.157 -+// templates or use macros or inline functions from this file, or you compile
 200.158 -+// this file and link it with other files to produce an executable, this
 200.159 -+// file does not by itself cause the resulting executable to be covered by
 200.160 -+// the GNU General Public License.  This exception does not however
 200.161 -+// invalidate any other reasons why the executable file might be covered by
 200.162 -+// the GNU General Public License.
 200.163 -+
 200.164 -+//
 200.165 -+// ISO C++ 14882: 22.8  Standard locale categories.
 200.166 -+//
 200.167 -+
 200.168 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 200.169 -+
 200.170 -+#include <cerrno>  // For errno
 200.171 -+#include <locale>
 200.172 -+#include <stdexcept>
 200.173 -+#include <langinfo.h>
 200.174 -+#include <bits/c++locale_internal.h>
 200.175 -+
 200.176 -+#ifndef __UCLIBC_HAS_XLOCALE__
 200.177 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 200.178 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 200.179 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 200.180 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 200.181 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 200.182 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 200.183 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 200.184 -+#warning should dummy __newlocale check for C|POSIX ?
 200.185 -+#define __newlocale(a, b, c)        NULL
 200.186 -+#define __freelocale(a)             ((void)0)
 200.187 -+#define __duplocale(a)              __c_locale()
 200.188 -+#endif
 200.189 -+
 200.190 -+namespace std 
 200.191 -+{
 200.192 -+  template<>
 200.193 -+    void
 200.194 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 200.195 -+		   const __c_locale& __cloc)
 200.196 -+    {
 200.197 -+      if (!(__err & ios_base::failbit))
 200.198 -+	{
 200.199 -+	  char* __sanity;
 200.200 -+	  errno = 0;
 200.201 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
 200.202 -+          if (__sanity != __s && errno != ERANGE)
 200.203 -+	    __v = __f;
 200.204 -+	  else
 200.205 -+	    __err |= ios_base::failbit;
 200.206 -+	}
 200.207 -+    }
 200.208 -+
 200.209 -+  template<>
 200.210 -+    void
 200.211 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 200.212 -+		   const __c_locale& __cloc)
 200.213 -+    {
 200.214 -+      if (!(__err & ios_base::failbit))
 200.215 -+	{
 200.216 -+	  char* __sanity;
 200.217 -+	  errno = 0;
 200.218 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
 200.219 -+          if (__sanity != __s && errno != ERANGE)
 200.220 -+	    __v = __d;
 200.221 -+	  else
 200.222 -+	    __err |= ios_base::failbit;
 200.223 -+	}
 200.224 -+    }
 200.225 -+
 200.226 -+  template<>
 200.227 -+    void
 200.228 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 200.229 -+		   const __c_locale& __cloc)
 200.230 -+    {
 200.231 -+      if (!(__err & ios_base::failbit))
 200.232 -+	{
 200.233 -+	  char* __sanity;
 200.234 -+	  errno = 0;
 200.235 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 200.236 -+          if (__sanity != __s && errno != ERANGE)
 200.237 -+	    __v = __ld;
 200.238 -+	  else
 200.239 -+	    __err |= ios_base::failbit;
 200.240 -+	}
 200.241 -+    }
 200.242 -+
 200.243 -+  void
 200.244 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 200.245 -+				    __c_locale __old)
 200.246 -+  {
 200.247 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 200.248 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.249 -+    if (!__cloc)
 200.250 -+      {
 200.251 -+	// This named locale is not supported by the underlying OS.
 200.252 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 200.253 -+			      "name not valid"));
 200.254 -+      }
 200.255 -+#endif
 200.256 -+  }
 200.257 -+  
 200.258 -+  void
 200.259 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 200.260 -+  {
 200.261 -+    if (_S_get_c_locale() != __cloc)
 200.262 -+      __freelocale(__cloc); 
 200.263 -+  }
 200.264 -+
 200.265 -+  __c_locale
 200.266 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 200.267 -+  { return __duplocale(__cloc); }
 200.268 -+} // namespace std
 200.269 -+
 200.270 -+namespace __gnu_cxx
 200.271 -+{
 200.272 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 200.273 -+    {
 200.274 -+      "LC_CTYPE", 
 200.275 -+      "LC_NUMERIC",
 200.276 -+      "LC_TIME", 
 200.277 -+      "LC_COLLATE", 
 200.278 -+      "LC_MONETARY",
 200.279 -+      "LC_MESSAGES", 
 200.280 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 200.281 -+      "LC_PAPER", 
 200.282 -+      "LC_NAME", 
 200.283 -+      "LC_ADDRESS",
 200.284 -+      "LC_TELEPHONE", 
 200.285 -+      "LC_MEASUREMENT", 
 200.286 -+      "LC_IDENTIFICATION" 
 200.287 -+#endif
 200.288 -+    };
 200.289 -+}
 200.290 -+
 200.291 -+namespace std
 200.292 -+{
 200.293 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 200.294 -+}  // namespace std
 200.295 ---- gcc/libstdc++-v3/config/locale/uclibc/c_locale.h
 200.296 -+++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.h
 200.297 -@@ -0,0 +1,117 @@
 200.298 -+// Wrapper for underlying C-language localization -*- C++ -*-
 200.299 -+
 200.300 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 200.301 -+//
 200.302 -+// This file is part of the GNU ISO C++ Library.  This library is free
 200.303 -+// software; you can redistribute it and/or modify it under the
 200.304 -+// terms of the GNU General Public License as published by the
 200.305 -+// Free Software Foundation; either version 2, or (at your option)
 200.306 -+// any later version.
 200.307 -+
 200.308 -+// This library is distributed in the hope that it will be useful,
 200.309 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 200.310 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 200.311 -+// GNU General Public License for more details.
 200.312 -+
 200.313 -+// You should have received a copy of the GNU General Public License along
 200.314 -+// with this library; see the file COPYING.  If not, write to the Free
 200.315 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 200.316 -+// USA.
 200.317 -+
 200.318 -+// As a special exception, you may use this file as part of a free software
 200.319 -+// library without restriction.  Specifically, if other files instantiate
 200.320 -+// templates or use macros or inline functions from this file, or you compile
 200.321 -+// this file and link it with other files to produce an executable, this
 200.322 -+// file does not by itself cause the resulting executable to be covered by
 200.323 -+// the GNU General Public License.  This exception does not however
 200.324 -+// invalidate any other reasons why the executable file might be covered by
 200.325 -+// the GNU General Public License.
 200.326 -+
 200.327 -+//
 200.328 -+// ISO C++ 14882: 22.8  Standard locale categories.
 200.329 -+//
 200.330 -+
 200.331 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 200.332 -+
 200.333 -+#ifndef _C_LOCALE_H
 200.334 -+#define _C_LOCALE_H 1
 200.335 -+
 200.336 -+#pragma GCC system_header
 200.337 -+
 200.338 -+#include <cstring>              // get std::strlen
 200.339 -+#include <cstdio>               // get std::snprintf or std::sprintf
 200.340 -+#include <clocale>
 200.341 -+#include <langinfo.h>		// For codecvt
 200.342 -+#ifdef __UCLIBC_MJN3_ONLY__
 200.343 -+#warning fix this
 200.344 -+#endif
 200.345 -+#ifdef __UCLIBC_HAS_LOCALE__
 200.346 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 200.347 -+#endif
 200.348 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 200.349 -+#include <libintl.h> 		// For messages
 200.350 -+#endif
 200.351 -+
 200.352 -+#ifdef __UCLIBC_MJN3_ONLY__
 200.353 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 200.354 -+#endif
 200.355 -+#define _GLIBCXX_C_LOCALE_GNU 1
 200.356 -+
 200.357 -+#ifdef __UCLIBC_MJN3_ONLY__
 200.358 -+#warning fix categories
 200.359 -+#endif
 200.360 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 200.361 -+#define _GLIBCXX_NUM_CATEGORIES 0
 200.362 -+ 
 200.363 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.364 -+namespace __gnu_cxx
 200.365 -+{
 200.366 -+  extern "C" __typeof(uselocale) __uselocale;
 200.367 -+}
 200.368 -+#endif
 200.369 -+
 200.370 -+namespace std
 200.371 -+{
 200.372 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.373 -+  typedef __locale_t		__c_locale;
 200.374 -+#else
 200.375 -+  typedef int*			__c_locale;
 200.376 -+#endif
 200.377 -+
 200.378 -+  // Convert numeric value of type _Tv to string and return length of
 200.379 -+  // string.  If snprintf is available use it, otherwise fall back to
 200.380 -+  // the unsafe sprintf which, in general, can be dangerous and should
 200.381 -+  // be avoided.
 200.382 -+  template<typename _Tv>
 200.383 -+    int
 200.384 -+    __convert_from_v(char* __out, 
 200.385 -+		     const int __size __attribute__ ((__unused__)),
 200.386 -+		     const char* __fmt,
 200.387 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 200.388 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 200.389 -+    {
 200.390 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 200.391 -+#else
 200.392 -+		     _Tv __v, const __c_locale&, int __prec)
 200.393 -+    {
 200.394 -+# ifdef __UCLIBC_HAS_LOCALE__
 200.395 -+      char* __old = std::setlocale(LC_ALL, NULL);
 200.396 -+      char* __sav = new char[std::strlen(__old) + 1];
 200.397 -+      std::strcpy(__sav, __old);
 200.398 -+      std::setlocale(LC_ALL, "C");
 200.399 -+# endif
 200.400 -+#endif
 200.401 -+
 200.402 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 200.403 -+
 200.404 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 200.405 -+      __gnu_cxx::__uselocale(__old);
 200.406 -+#elif defined __UCLIBC_HAS_LOCALE__
 200.407 -+      std::setlocale(LC_ALL, __sav);
 200.408 -+      delete [] __sav;
 200.409 -+#endif
 200.410 -+      return __ret;
 200.411 -+    }
 200.412 -+}
 200.413 -+
 200.414 -+#endif
 200.415 ---- gcc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 200.416 -+++ gcc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 200.417 -@@ -0,0 +1,306 @@
 200.418 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 200.419 -+
 200.420 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 200.421 -+//
 200.422 -+// This file is part of the GNU ISO C++ Library.  This library is free
 200.423 -+// software; you can redistribute it and/or modify it under the
 200.424 -+// terms of the GNU General Public License as published by the
 200.425 -+// Free Software Foundation; either version 2, or (at your option)
 200.426 -+// any later version.
 200.427 -+
 200.428 -+// This library is distributed in the hope that it will be useful,
 200.429 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 200.430 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 200.431 -+// GNU General Public License for more details.
 200.432 -+
 200.433 -+// You should have received a copy of the GNU General Public License along
 200.434 -+// with this library; see the file COPYING.  If not, write to the Free
 200.435 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 200.436 -+// USA.
 200.437 -+
 200.438 -+// As a special exception, you may use this file as part of a free software
 200.439 -+// library without restriction.  Specifically, if other files instantiate
 200.440 -+// templates or use macros or inline functions from this file, or you compile
 200.441 -+// this file and link it with other files to produce an executable, this
 200.442 -+// file does not by itself cause the resulting executable to be covered by
 200.443 -+// the GNU General Public License.  This exception does not however
 200.444 -+// invalidate any other reasons why the executable file might be covered by
 200.445 -+// the GNU General Public License.
 200.446 -+
 200.447 -+//
 200.448 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 200.449 -+//
 200.450 -+
 200.451 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 200.452 -+
 200.453 -+#include <locale>
 200.454 -+#include <bits/c++locale_internal.h>
 200.455 -+
 200.456 -+namespace std
 200.457 -+{
 200.458 -+  // Specializations.
 200.459 -+#ifdef _GLIBCXX_USE_WCHAR_T
 200.460 -+  codecvt_base::result
 200.461 -+  codecvt<wchar_t, char, mbstate_t>::
 200.462 -+  do_out(state_type& __state, const intern_type* __from, 
 200.463 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 200.464 -+	 extern_type* __to, extern_type* __to_end,
 200.465 -+	 extern_type*& __to_next) const
 200.466 -+  {
 200.467 -+    result __ret = ok;
 200.468 -+    state_type __tmp_state(__state);
 200.469 -+
 200.470 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.471 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 200.472 -+#endif
 200.473 -+
 200.474 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 200.475 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 200.476 -+    // NB: wcsnrtombs is a GNU extension
 200.477 -+    for (__from_next = __from, __to_next = __to;
 200.478 -+	 __from_next < __from_end && __to_next < __to_end
 200.479 -+	 && __ret == ok;)
 200.480 -+      {
 200.481 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 200.482 -+						      __from_end - __from_next);
 200.483 -+	if (!__from_chunk_end)
 200.484 -+	  __from_chunk_end = __from_end;
 200.485 -+
 200.486 -+	__from = __from_next;
 200.487 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 200.488 -+					 __from_chunk_end - __from_next,
 200.489 -+					 __to_end - __to_next, &__state);
 200.490 -+	if (__conv == static_cast<size_t>(-1))
 200.491 -+	  {
 200.492 -+	    // In case of error, in order to stop at the exact place we
 200.493 -+	    // have to start again from the beginning with a series of
 200.494 -+	    // wcrtomb.
 200.495 -+	    for (; __from < __from_next; ++__from)
 200.496 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 200.497 -+	    __state = __tmp_state;
 200.498 -+	    __ret = error;
 200.499 -+	  }
 200.500 -+	else if (__from_next && __from_next < __from_chunk_end)
 200.501 -+	  {
 200.502 -+	    __to_next += __conv;
 200.503 -+	    __ret = partial;
 200.504 -+	  }
 200.505 -+	else
 200.506 -+	  {
 200.507 -+	    __from_next = __from_chunk_end;
 200.508 -+	    __to_next += __conv;
 200.509 -+	  }
 200.510 -+
 200.511 -+	if (__from_next < __from_end && __ret == ok)
 200.512 -+	  {
 200.513 -+	    extern_type __buf[MB_LEN_MAX];
 200.514 -+	    __tmp_state = __state;
 200.515 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 200.516 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 200.517 -+	      __ret = partial;
 200.518 -+	    else
 200.519 -+	      {
 200.520 -+		memcpy(__to_next, __buf, __conv);
 200.521 -+		__state = __tmp_state;
 200.522 -+		__to_next += __conv;
 200.523 -+		++__from_next;
 200.524 -+	      }
 200.525 -+	  }
 200.526 -+      }
 200.527 -+
 200.528 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.529 -+    __uselocale(__old);
 200.530 -+#endif
 200.531 -+
 200.532 -+    return __ret; 
 200.533 -+  }
 200.534 -+  
 200.535 -+  codecvt_base::result
 200.536 -+  codecvt<wchar_t, char, mbstate_t>::
 200.537 -+  do_in(state_type& __state, const extern_type* __from, 
 200.538 -+	const extern_type* __from_end, const extern_type*& __from_next,
 200.539 -+	intern_type* __to, intern_type* __to_end,
 200.540 -+	intern_type*& __to_next) const
 200.541 -+  {
 200.542 -+    result __ret = ok;
 200.543 -+    state_type __tmp_state(__state);
 200.544 -+
 200.545 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.546 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 200.547 -+#endif
 200.548 -+
 200.549 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 200.550 -+    // in case we store a L'\0' and then continue, in a loop.
 200.551 -+    // NB: mbsnrtowcs is a GNU extension
 200.552 -+    for (__from_next = __from, __to_next = __to;
 200.553 -+	 __from_next < __from_end && __to_next < __to_end
 200.554 -+	 && __ret == ok;)
 200.555 -+      {
 200.556 -+	const extern_type* __from_chunk_end;
 200.557 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 200.558 -+								  __from_end
 200.559 -+								  - __from_next));
 200.560 -+	if (!__from_chunk_end)
 200.561 -+	  __from_chunk_end = __from_end;
 200.562 -+
 200.563 -+	__from = __from_next;
 200.564 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 200.565 -+				   __from_chunk_end - __from_next,
 200.566 -+				   __to_end - __to_next, &__state);
 200.567 -+	if (__conv == static_cast<size_t>(-1))
 200.568 -+	  {
 200.569 -+	    // In case of error, in order to stop at the exact place we
 200.570 -+	    // have to start again from the beginning with a series of
 200.571 -+	    // mbrtowc.
 200.572 -+	    for (;; ++__to_next, __from += __conv)
 200.573 -+	      {
 200.574 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 200.575 -+				 &__tmp_state);
 200.576 -+		if (__conv == static_cast<size_t>(-1)
 200.577 -+		    || __conv == static_cast<size_t>(-2))
 200.578 -+		  break;
 200.579 -+	      }
 200.580 -+	    __from_next = __from;
 200.581 -+	    __state = __tmp_state;	    
 200.582 -+	    __ret = error;
 200.583 -+	  }
 200.584 -+	else if (__from_next && __from_next < __from_chunk_end)
 200.585 -+	  {
 200.586 -+	    // It is unclear what to return in this case (see DR 382). 
 200.587 -+	    __to_next += __conv;
 200.588 -+	    __ret = partial;
 200.589 -+	  }
 200.590 -+	else
 200.591 -+	  {
 200.592 -+	    __from_next = __from_chunk_end;
 200.593 -+	    __to_next += __conv;
 200.594 -+	  }
 200.595 -+
 200.596 -+	if (__from_next < __from_end && __ret == ok)
 200.597 -+	  {
 200.598 -+	    if (__to_next < __to_end)
 200.599 -+	      {
 200.600 -+		// XXX Probably wrong for stateful encodings
 200.601 -+		__tmp_state = __state;		
 200.602 -+		++__from_next;
 200.603 -+		*__to_next++ = L'\0';
 200.604 -+	      }
 200.605 -+	    else
 200.606 -+	      __ret = partial;
 200.607 -+	  }
 200.608 -+      }
 200.609 -+
 200.610 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.611 -+    __uselocale(__old);
 200.612 -+#endif
 200.613 -+
 200.614 -+    return __ret; 
 200.615 -+  }
 200.616 -+
 200.617 -+  int 
 200.618 -+  codecvt<wchar_t, char, mbstate_t>::
 200.619 -+  do_encoding() const throw()
 200.620 -+  {
 200.621 -+    // XXX This implementation assumes that the encoding is
 200.622 -+    // stateless and is either single-byte or variable-width.
 200.623 -+    int __ret = 0;
 200.624 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.625 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 200.626 -+#endif
 200.627 -+    if (MB_CUR_MAX == 1)
 200.628 -+      __ret = 1;
 200.629 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.630 -+    __uselocale(__old);
 200.631 -+#endif
 200.632 -+    return __ret;
 200.633 -+  }  
 200.634 -+
 200.635 -+  int 
 200.636 -+  codecvt<wchar_t, char, mbstate_t>::
 200.637 -+  do_max_length() const throw()
 200.638 -+  {
 200.639 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.640 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 200.641 -+#endif
 200.642 -+    // XXX Probably wrong for stateful encodings.
 200.643 -+    int __ret = MB_CUR_MAX;
 200.644 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.645 -+    __uselocale(__old);
 200.646 -+#endif
 200.647 -+    return __ret;
 200.648 -+  }
 200.649 -+  
 200.650 -+  int 
 200.651 -+  codecvt<wchar_t, char, mbstate_t>::
 200.652 -+  do_length(state_type& __state, const extern_type* __from,
 200.653 -+	    const extern_type* __end, size_t __max) const
 200.654 -+  {
 200.655 -+    int __ret = 0;
 200.656 -+    state_type __tmp_state(__state);
 200.657 -+
 200.658 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.659 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 200.660 -+#endif
 200.661 -+
 200.662 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 200.663 -+    // in case we advance past it and then continue, in a loop.
 200.664 -+    // NB: mbsnrtowcs is a GNU extension
 200.665 -+  
 200.666 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 200.667 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 200.668 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 200.669 -+							   * __max));
 200.670 -+    while (__from < __end && __max)
 200.671 -+      {
 200.672 -+	const extern_type* __from_chunk_end;
 200.673 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 200.674 -+								  __end
 200.675 -+								  - __from));
 200.676 -+	if (!__from_chunk_end)
 200.677 -+	  __from_chunk_end = __end;
 200.678 -+
 200.679 -+	const extern_type* __tmp_from = __from;
 200.680 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 200.681 -+				   __from_chunk_end - __from,
 200.682 -+				   __max, &__state);
 200.683 -+	if (__conv == static_cast<size_t>(-1))
 200.684 -+	  {
 200.685 -+	    // In case of error, in order to stop at the exact place we
 200.686 -+	    // have to start again from the beginning with a series of
 200.687 -+	    // mbrtowc.
 200.688 -+	    for (__from = __tmp_from;; __from += __conv)
 200.689 -+	      {
 200.690 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 200.691 -+				 &__tmp_state);
 200.692 -+		if (__conv == static_cast<size_t>(-1)
 200.693 -+		    || __conv == static_cast<size_t>(-2))
 200.694 -+		  break;
 200.695 -+	      }
 200.696 -+	    __state = __tmp_state;
 200.697 -+	    __ret += __from - __tmp_from;
 200.698 -+	    break;
 200.699 -+	  }
 200.700 -+	if (!__from)
 200.701 -+	  __from = __from_chunk_end;
 200.702 -+	
 200.703 -+	__ret += __from - __tmp_from;
 200.704 -+	__max -= __conv;
 200.705 -+
 200.706 -+	if (__from < __end && __max)
 200.707 -+	  {
 200.708 -+	    // XXX Probably wrong for stateful encodings
 200.709 -+	    __tmp_state = __state;
 200.710 -+	    ++__from;
 200.711 -+	    ++__ret;
 200.712 -+	    --__max;
 200.713 -+	  }
 200.714 -+      }
 200.715 -+
 200.716 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.717 -+    __uselocale(__old);
 200.718 -+#endif
 200.719 -+
 200.720 -+    return __ret; 
 200.721 -+  }
 200.722 -+#endif
 200.723 -+}
 200.724 ---- gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc
 200.725 -+++ gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc
 200.726 -@@ -0,0 +1,80 @@
 200.727 -+// std::collate implementation details, GNU version -*- C++ -*-
 200.728 -+
 200.729 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 200.730 -+//
 200.731 -+// This file is part of the GNU ISO C++ Library.  This library is free
 200.732 -+// software; you can redistribute it and/or modify it under the
 200.733 -+// terms of the GNU General Public License as published by the
 200.734 -+// Free Software Foundation; either version 2, or (at your option)
 200.735 -+// any later version.
 200.736 -+
 200.737 -+// This library is distributed in the hope that it will be useful,
 200.738 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 200.739 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 200.740 -+// GNU General Public License for more details.
 200.741 -+
 200.742 -+// You should have received a copy of the GNU General Public License along
 200.743 -+// with this library; see the file COPYING.  If not, write to the Free
 200.744 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 200.745 -+// USA.
 200.746 -+
 200.747 -+// As a special exception, you may use this file as part of a free software
 200.748 -+// library without restriction.  Specifically, if other files instantiate
 200.749 -+// templates or use macros or inline functions from this file, or you compile
 200.750 -+// this file and link it with other files to produce an executable, this
 200.751 -+// file does not by itself cause the resulting executable to be covered by
 200.752 -+// the GNU General Public License.  This exception does not however
 200.753 -+// invalidate any other reasons why the executable file might be covered by
 200.754 -+// the GNU General Public License.
 200.755 -+
 200.756 -+//
 200.757 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 200.758 -+//
 200.759 -+
 200.760 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 200.761 -+
 200.762 -+#include <locale>
 200.763 -+#include <bits/c++locale_internal.h>
 200.764 -+
 200.765 -+#ifndef __UCLIBC_HAS_XLOCALE__
 200.766 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 200.767 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 200.768 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 200.769 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 200.770 -+#endif
 200.771 -+
 200.772 -+namespace std
 200.773 -+{
 200.774 -+  // These are basically extensions to char_traits, and perhaps should
 200.775 -+  // be put there instead of here.
 200.776 -+  template<>
 200.777 -+    int 
 200.778 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 200.779 -+    { 
 200.780 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 200.781 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 200.782 -+    }
 200.783 -+  
 200.784 -+  template<>
 200.785 -+    size_t
 200.786 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 200.787 -+				size_t __n) const 
 200.788 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 200.789 -+
 200.790 -+#ifdef _GLIBCXX_USE_WCHAR_T
 200.791 -+  template<>
 200.792 -+    int 
 200.793 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 200.794 -+				 const wchar_t* __two) const
 200.795 -+    {
 200.796 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 200.797 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 200.798 -+    }
 200.799 -+  
 200.800 -+  template<>
 200.801 -+    size_t
 200.802 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 200.803 -+				   size_t __n) const
 200.804 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 200.805 -+#endif
 200.806 -+}
 200.807 ---- gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 200.808 -+++ gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 200.809 -@@ -0,0 +1,300 @@
 200.810 -+// std::ctype implementation details, GNU version -*- C++ -*-
 200.811 -+
 200.812 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 200.813 -+//
 200.814 -+// This file is part of the GNU ISO C++ Library.  This library is free
 200.815 -+// software; you can redistribute it and/or modify it under the
 200.816 -+// terms of the GNU General Public License as published by the
 200.817 -+// Free Software Foundation; either version 2, or (at your option)
 200.818 -+// any later version.
 200.819 -+
 200.820 -+// This library is distributed in the hope that it will be useful,
 200.821 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 200.822 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 200.823 -+// GNU General Public License for more details.
 200.824 -+
 200.825 -+// You should have received a copy of the GNU General Public License along
 200.826 -+// with this library; see the file COPYING.  If not, write to the Free
 200.827 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 200.828 -+// USA.
 200.829 -+
 200.830 -+// As a special exception, you may use this file as part of a free software
 200.831 -+// library without restriction.  Specifically, if other files instantiate
 200.832 -+// templates or use macros or inline functions from this file, or you compile
 200.833 -+// this file and link it with other files to produce an executable, this
 200.834 -+// file does not by itself cause the resulting executable to be covered by
 200.835 -+// the GNU General Public License.  This exception does not however
 200.836 -+// invalidate any other reasons why the executable file might be covered by
 200.837 -+// the GNU General Public License.
 200.838 -+
 200.839 -+//
 200.840 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 200.841 -+//
 200.842 -+
 200.843 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 200.844 -+
 200.845 -+#define _LIBC
 200.846 -+#include <locale>
 200.847 -+#undef _LIBC
 200.848 -+#include <bits/c++locale_internal.h>
 200.849 -+
 200.850 -+#ifndef __UCLIBC_HAS_XLOCALE__
 200.851 -+#define __wctype_l(S, L)           wctype((S))
 200.852 -+#define __towupper_l(C, L)         towupper((C))
 200.853 -+#define __towlower_l(C, L)         towlower((C))
 200.854 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 200.855 -+#endif
 200.856 -+
 200.857 -+namespace std
 200.858 -+{
 200.859 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 200.860 -+  // various /config/os/* files.
 200.861 -+  template<>
 200.862 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 200.863 -+    : ctype<char>(0, false, __refs) 
 200.864 -+    { 		
 200.865 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 200.866 -+	{
 200.867 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 200.868 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 200.869 -+#ifdef __UCLIBC_HAS_XLOCALE__
 200.870 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 200.871 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 200.872 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 200.873 -+#endif
 200.874 -+	}
 200.875 -+    }
 200.876 -+
 200.877 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 200.878 -+  ctype<wchar_t>::__wmask_type
 200.879 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 200.880 -+  {
 200.881 -+    __wmask_type __ret;
 200.882 -+    switch (__m)
 200.883 -+      {
 200.884 -+      case space:
 200.885 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 200.886 -+	break;
 200.887 -+      case print:
 200.888 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 200.889 -+	break;
 200.890 -+      case cntrl:
 200.891 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 200.892 -+	break;
 200.893 -+      case upper:
 200.894 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 200.895 -+	break;
 200.896 -+      case lower:
 200.897 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 200.898 -+	break;
 200.899 -+      case alpha:
 200.900 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 200.901 -+	break;
 200.902 -+      case digit:
 200.903 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 200.904 -+	break;
 200.905 -+      case punct:
 200.906 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 200.907 -+	break;
 200.908 -+      case xdigit:
 200.909 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 200.910 -+	break;
 200.911 -+      case alnum:
 200.912 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 200.913 -+	break;
 200.914 -+      case graph:
 200.915 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 200.916 -+	break;
 200.917 -+      default:
 200.918 -+	__ret = __wmask_type();
 200.919 -+      }
 200.920 -+    return __ret;
 200.921 -+  }
 200.922 -+  
 200.923 -+  wchar_t
 200.924 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 200.925 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 200.926 -+
 200.927 -+  const wchar_t*
 200.928 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 200.929 -+  {
 200.930 -+    while (__lo < __hi)
 200.931 -+      {
 200.932 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 200.933 -+        ++__lo;
 200.934 -+      }
 200.935 -+    return __hi;
 200.936 -+  }
 200.937 -+  
 200.938 -+  wchar_t
 200.939 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 200.940 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 200.941 -+  
 200.942 -+  const wchar_t*
 200.943 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 200.944 -+  {
 200.945 -+    while (__lo < __hi)
 200.946 -+      {
 200.947 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 200.948 -+        ++__lo;
 200.949 -+      }
 200.950 -+    return __hi;
 200.951 -+  }
 200.952 -+
 200.953 -+  bool
 200.954 -+  ctype<wchar_t>::
 200.955 -+  do_is(mask __m, wchar_t __c) const
 200.956 -+  { 
 200.957 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
 200.958 -+    // library for blank.
 200.959 -+    bool __ret = false;
 200.960 -+    const size_t __bitmasksize = 11; 
 200.961 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 200.962 -+      if (__m & _M_bit[__bitcur]
 200.963 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 200.964 -+	{
 200.965 -+	  __ret = true;
 200.966 -+	  break;
 200.967 -+	}
 200.968 -+    return __ret;    
 200.969 -+  }
 200.970 -+  
 200.971 -+  const wchar_t* 
 200.972 -+  ctype<wchar_t>::
 200.973 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 200.974 -+  {
 200.975 -+    for (; __lo < __hi; ++__vec, ++__lo)
 200.976 -+      {
 200.977 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 200.978 -+	// library for blank.
 200.979 -+	const size_t __bitmasksize = 11; 
 200.980 -+	mask __m = 0;
 200.981 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 200.982 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 200.983 -+	    __m |= _M_bit[__bitcur];
 200.984 -+	*__vec = __m;
 200.985 -+      }
 200.986 -+    return __hi;
 200.987 -+  }
 200.988 -+  
 200.989 -+  const wchar_t* 
 200.990 -+  ctype<wchar_t>::
 200.991 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 200.992 -+  {
 200.993 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
 200.994 -+      ++__lo;
 200.995 -+    return __lo;
 200.996 -+  }
 200.997 -+
 200.998 -+  const wchar_t*
 200.999 -+  ctype<wchar_t>::
200.1000 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
200.1001 -+  {
200.1002 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
200.1003 -+      ++__lo;
200.1004 -+    return __lo;
200.1005 -+  }
200.1006 -+
200.1007 -+  wchar_t
200.1008 -+  ctype<wchar_t>::
200.1009 -+  do_widen(char __c) const
200.1010 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
200.1011 -+
200.1012 -+  const char* 
200.1013 -+  ctype<wchar_t>::
200.1014 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
200.1015 -+  {
200.1016 -+    while (__lo < __hi)
200.1017 -+      {
200.1018 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
200.1019 -+	++__lo;
200.1020 -+	++__dest;
200.1021 -+      }
200.1022 -+    return __hi;
200.1023 -+  }
200.1024 -+
200.1025 -+  char
200.1026 -+  ctype<wchar_t>::
200.1027 -+  do_narrow(wchar_t __wc, char __dfault) const
200.1028 -+  {
200.1029 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
200.1030 -+      return _M_narrow[__wc];
200.1031 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1032 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
200.1033 -+#endif
200.1034 -+    const int __c = wctob(__wc);
200.1035 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1036 -+    __uselocale(__old);
200.1037 -+#endif
200.1038 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
200.1039 -+  }
200.1040 -+
200.1041 -+  const wchar_t*
200.1042 -+  ctype<wchar_t>::
200.1043 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
200.1044 -+	    char* __dest) const
200.1045 -+  {
200.1046 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1047 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
200.1048 -+#endif
200.1049 -+    if (_M_narrow_ok)
200.1050 -+      while (__lo < __hi)
200.1051 -+	{
200.1052 -+	  if (*__lo >= 0 && *__lo < 128)
200.1053 -+	    *__dest = _M_narrow[*__lo];
200.1054 -+	  else
200.1055 -+	    {
200.1056 -+	      const int __c = wctob(*__lo);
200.1057 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
200.1058 -+	    }
200.1059 -+	  ++__lo;
200.1060 -+	  ++__dest;
200.1061 -+	}
200.1062 -+    else
200.1063 -+      while (__lo < __hi)
200.1064 -+	{
200.1065 -+	  const int __c = wctob(*__lo);
200.1066 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
200.1067 -+	  ++__lo;
200.1068 -+	  ++__dest;
200.1069 -+	}
200.1070 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1071 -+    __uselocale(__old);
200.1072 -+#endif
200.1073 -+    return __hi;
200.1074 -+  }
200.1075 -+
200.1076 -+  void
200.1077 -+  ctype<wchar_t>::_M_initialize_ctype()
200.1078 -+  {
200.1079 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1080 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
200.1081 -+#endif
200.1082 -+    wint_t __i;
200.1083 -+    for (__i = 0; __i < 128; ++__i)
200.1084 -+      {
200.1085 -+	const int __c = wctob(__i);
200.1086 -+	if (__c == EOF)
200.1087 -+	  break;
200.1088 -+	else
200.1089 -+	  _M_narrow[__i] = static_cast<char>(__c);
200.1090 -+      }
200.1091 -+    if (__i == 128)
200.1092 -+      _M_narrow_ok = true;
200.1093 -+    else
200.1094 -+      _M_narrow_ok = false;
200.1095 -+    for (size_t __j = 0;
200.1096 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
200.1097 -+      _M_widen[__j] = btowc(__j);
200.1098 -+
200.1099 -+    for (size_t __k = 0; __k <= 11; ++__k)
200.1100 -+      { 
200.1101 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
200.1102 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
200.1103 -+      }
200.1104 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1105 -+    __uselocale(__old);
200.1106 -+#endif
200.1107 -+  }
200.1108 -+#endif //  _GLIBCXX_USE_WCHAR_T
200.1109 -+}
200.1110 ---- gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc
200.1111 -+++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc
200.1112 -@@ -0,0 +1,100 @@
200.1113 -+// std::messages implementation details, GNU version -*- C++ -*-
200.1114 -+
200.1115 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
200.1116 -+//
200.1117 -+// This file is part of the GNU ISO C++ Library.  This library is free
200.1118 -+// software; you can redistribute it and/or modify it under the
200.1119 -+// terms of the GNU General Public License as published by the
200.1120 -+// Free Software Foundation; either version 2, or (at your option)
200.1121 -+// any later version.
200.1122 -+
200.1123 -+// This library is distributed in the hope that it will be useful,
200.1124 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
200.1125 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
200.1126 -+// GNU General Public License for more details.
200.1127 -+
200.1128 -+// You should have received a copy of the GNU General Public License along
200.1129 -+// with this library; see the file COPYING.  If not, write to the Free
200.1130 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
200.1131 -+// USA.
200.1132 -+
200.1133 -+// As a special exception, you may use this file as part of a free software
200.1134 -+// library without restriction.  Specifically, if other files instantiate
200.1135 -+// templates or use macros or inline functions from this file, or you compile
200.1136 -+// this file and link it with other files to produce an executable, this
200.1137 -+// file does not by itself cause the resulting executable to be covered by
200.1138 -+// the GNU General Public License.  This exception does not however
200.1139 -+// invalidate any other reasons why the executable file might be covered by
200.1140 -+// the GNU General Public License.
200.1141 -+
200.1142 -+//
200.1143 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
200.1144 -+//
200.1145 -+
200.1146 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
200.1147 -+
200.1148 -+#include <locale>
200.1149 -+#include <bits/c++locale_internal.h>
200.1150 -+
200.1151 -+#ifdef __UCLIBC_MJN3_ONLY__
200.1152 -+#warning fix gettext stuff
200.1153 -+#endif
200.1154 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
200.1155 -+extern "C" char *__dcgettext(const char *domainname,
200.1156 -+			     const char *msgid, int category);
200.1157 -+#undef gettext
200.1158 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
200.1159 -+#else
200.1160 -+#undef gettext
200.1161 -+#define gettext(msgid) (msgid)
200.1162 -+#endif
200.1163 -+
200.1164 -+namespace std
200.1165 -+{
200.1166 -+  // Specializations.
200.1167 -+  template<>
200.1168 -+    string
200.1169 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
200.1170 -+    {
200.1171 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1172 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
200.1173 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
200.1174 -+      __uselocale(__old);
200.1175 -+      return string(__msg);
200.1176 -+#elif defined __UCLIBC_HAS_LOCALE__
200.1177 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
200.1178 -+      setlocale(LC_ALL, _M_name_messages);
200.1179 -+      const char* __msg = gettext(__dfault.c_str());
200.1180 -+      setlocale(LC_ALL, __old);
200.1181 -+      free(__old);
200.1182 -+      return string(__msg);
200.1183 -+#else
200.1184 -+      const char* __msg = gettext(__dfault.c_str());
200.1185 -+      return string(__msg);
200.1186 -+#endif
200.1187 -+    }
200.1188 -+
200.1189 -+#ifdef _GLIBCXX_USE_WCHAR_T
200.1190 -+  template<>
200.1191 -+    wstring
200.1192 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
200.1193 -+    {
200.1194 -+# ifdef __UCLIBC_HAS_XLOCALE__
200.1195 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
200.1196 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
200.1197 -+      __uselocale(__old);
200.1198 -+      return _M_convert_from_char(__msg);
200.1199 -+# elif defined __UCLIBC_HAS_LOCALE__
200.1200 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
200.1201 -+      setlocale(LC_ALL, _M_name_messages);
200.1202 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
200.1203 -+      setlocale(LC_ALL, __old);
200.1204 -+      free(__old);
200.1205 -+      return _M_convert_from_char(__msg);
200.1206 -+# else
200.1207 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
200.1208 -+      return _M_convert_from_char(__msg);
200.1209 -+# endif
200.1210 -+    }
200.1211 -+#endif
200.1212 -+}
200.1213 ---- gcc/libstdc++-v3/config/locale/uclibc/messages_members.h
200.1214 -+++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.h
200.1215 -@@ -0,0 +1,118 @@
200.1216 -+// std::messages implementation details, GNU version -*- C++ -*-
200.1217 -+
200.1218 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
200.1219 -+//
200.1220 -+// This file is part of the GNU ISO C++ Library.  This library is free
200.1221 -+// software; you can redistribute it and/or modify it under the
200.1222 -+// terms of the GNU General Public License as published by the
200.1223 -+// Free Software Foundation; either version 2, or (at your option)
200.1224 -+// any later version.
200.1225 -+
200.1226 -+// This library is distributed in the hope that it will be useful,
200.1227 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
200.1228 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
200.1229 -+// GNU General Public License for more details.
200.1230 -+
200.1231 -+// You should have received a copy of the GNU General Public License along
200.1232 -+// with this library; see the file COPYING.  If not, write to the Free
200.1233 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
200.1234 -+// USA.
200.1235 -+
200.1236 -+// As a special exception, you may use this file as part of a free software
200.1237 -+// library without restriction.  Specifically, if other files instantiate
200.1238 -+// templates or use macros or inline functions from this file, or you compile
200.1239 -+// this file and link it with other files to produce an executable, this
200.1240 -+// file does not by itself cause the resulting executable to be covered by
200.1241 -+// the GNU General Public License.  This exception does not however
200.1242 -+// invalidate any other reasons why the executable file might be covered by
200.1243 -+// the GNU General Public License.
200.1244 -+
200.1245 -+//
200.1246 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
200.1247 -+//
200.1248 -+
200.1249 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
200.1250 -+
200.1251 -+#ifdef __UCLIBC_MJN3_ONLY__
200.1252 -+#warning fix prototypes for *textdomain funcs
200.1253 -+#endif
200.1254 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
200.1255 -+extern "C" char *__textdomain(const char *domainname);
200.1256 -+extern "C" char *__bindtextdomain(const char *domainname,
200.1257 -+				  const char *dirname);
200.1258 -+#else
200.1259 -+#undef __textdomain
200.1260 -+#undef __bindtextdomain
200.1261 -+#define __textdomain(D)           ((void)0)
200.1262 -+#define __bindtextdomain(D,P)     ((void)0)
200.1263 -+#endif
200.1264 -+
200.1265 -+  // Non-virtual member functions.
200.1266 -+  template<typename _CharT>
200.1267 -+     messages<_CharT>::messages(size_t __refs)
200.1268 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
200.1269 -+     _M_name_messages(_S_get_c_name())
200.1270 -+     { }
200.1271 -+
200.1272 -+  template<typename _CharT>
200.1273 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
200.1274 -+				size_t __refs) 
200.1275 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
200.1276 -+     _M_name_messages(__s)
200.1277 -+     {
200.1278 -+       char* __tmp = new char[std::strlen(__s) + 1];
200.1279 -+       std::strcpy(__tmp, __s);
200.1280 -+       _M_name_messages = __tmp;
200.1281 -+     }
200.1282 -+
200.1283 -+  template<typename _CharT>
200.1284 -+    typename messages<_CharT>::catalog 
200.1285 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
200.1286 -+			   const char* __dir) const
200.1287 -+    { 
200.1288 -+      __bindtextdomain(__s.c_str(), __dir);
200.1289 -+      return this->do_open(__s, __loc); 
200.1290 -+    }
200.1291 -+
200.1292 -+  // Virtual member functions.
200.1293 -+  template<typename _CharT>
200.1294 -+    messages<_CharT>::~messages()
200.1295 -+    { 
200.1296 -+      if (_M_name_messages != _S_get_c_name())
200.1297 -+	delete [] _M_name_messages;
200.1298 -+      _S_destroy_c_locale(_M_c_locale_messages); 
200.1299 -+    }
200.1300 -+
200.1301 -+  template<typename _CharT>
200.1302 -+    typename messages<_CharT>::catalog 
200.1303 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
200.1304 -+			      const locale&) const
200.1305 -+    { 
200.1306 -+      // No error checking is done, assume the catalog exists and can
200.1307 -+      // be used.
200.1308 -+      __textdomain(__s.c_str());
200.1309 -+      return 0;
200.1310 -+    }
200.1311 -+
200.1312 -+  template<typename _CharT>
200.1313 -+    void    
200.1314 -+    messages<_CharT>::do_close(catalog) const 
200.1315 -+    { }
200.1316 -+
200.1317 -+   // messages_byname
200.1318 -+   template<typename _CharT>
200.1319 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
200.1320 -+     : messages<_CharT>(__refs) 
200.1321 -+     { 
200.1322 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
200.1323 -+	 delete [] this->_M_name_messages;
200.1324 -+       char* __tmp = new char[std::strlen(__s) + 1];
200.1325 -+       std::strcpy(__tmp, __s);
200.1326 -+       this->_M_name_messages = __tmp;
200.1327 -+
200.1328 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
200.1329 -+	 {
200.1330 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
200.1331 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
200.1332 -+	 }
200.1333 -+     }
200.1334 ---- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
200.1335 -+++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
200.1336 -@@ -0,0 +1,692 @@
200.1337 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
200.1338 -+
200.1339 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
200.1340 -+//
200.1341 -+// This file is part of the GNU ISO C++ Library.  This library is free
200.1342 -+// software; you can redistribute it and/or modify it under the
200.1343 -+// terms of the GNU General Public License as published by the
200.1344 -+// Free Software Foundation; either version 2, or (at your option)
200.1345 -+// any later version.
200.1346 -+
200.1347 -+// This library is distributed in the hope that it will be useful,
200.1348 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
200.1349 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
200.1350 -+// GNU General Public License for more details.
200.1351 -+
200.1352 -+// You should have received a copy of the GNU General Public License along
200.1353 -+// with this library; see the file COPYING.  If not, write to the Free
200.1354 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
200.1355 -+// USA.
200.1356 -+
200.1357 -+// As a special exception, you may use this file as part of a free software
200.1358 -+// library without restriction.  Specifically, if other files instantiate
200.1359 -+// templates or use macros or inline functions from this file, or you compile
200.1360 -+// this file and link it with other files to produce an executable, this
200.1361 -+// file does not by itself cause the resulting executable to be covered by
200.1362 -+// the GNU General Public License.  This exception does not however
200.1363 -+// invalidate any other reasons why the executable file might be covered by
200.1364 -+// the GNU General Public License.
200.1365 -+
200.1366 -+//
200.1367 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
200.1368 -+//
200.1369 -+
200.1370 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
200.1371 -+
200.1372 -+#define _LIBC
200.1373 -+#include <locale>
200.1374 -+#undef _LIBC
200.1375 -+#include <bits/c++locale_internal.h>
200.1376 -+
200.1377 -+#ifdef __UCLIBC_MJN3_ONLY__
200.1378 -+#warning optimize this for uclibc
200.1379 -+#warning tailor for stub locale support
200.1380 -+#endif
200.1381 -+
200.1382 -+#ifndef __UCLIBC_HAS_XLOCALE__
200.1383 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
200.1384 -+#endif
200.1385 -+
200.1386 -+namespace std
200.1387 -+{
200.1388 -+  // Construct and return valid pattern consisting of some combination of:
200.1389 -+  // space none symbol sign value
200.1390 -+  money_base::pattern
200.1391 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
200.1392 -+  { 
200.1393 -+    pattern __ret;
200.1394 -+
200.1395 -+    // This insanely complicated routine attempts to construct a valid
200.1396 -+    // pattern for use with monyepunct. A couple of invariants:
200.1397 -+
200.1398 -+    // if (__precedes) symbol -> value
200.1399 -+    // else value -> symbol
200.1400 -+    
200.1401 -+    // if (__space) space
200.1402 -+    // else none
200.1403 -+
200.1404 -+    // none == never first
200.1405 -+    // space never first or last
200.1406 -+
200.1407 -+    // Any elegant implementations of this are welcome.
200.1408 -+    switch (__posn)
200.1409 -+      {
200.1410 -+      case 0:
200.1411 -+      case 1:
200.1412 -+	// 1 The sign precedes the value and symbol.
200.1413 -+	__ret.field[0] = sign;
200.1414 -+	if (__space)
200.1415 -+	  {
200.1416 -+	    // Pattern starts with sign.
200.1417 -+	    if (__precedes)
200.1418 -+	      {
200.1419 -+		__ret.field[1] = symbol;
200.1420 -+		__ret.field[3] = value;
200.1421 -+	      }
200.1422 -+	    else
200.1423 -+	      {
200.1424 -+		__ret.field[1] = value;
200.1425 -+		__ret.field[3] = symbol;
200.1426 -+	      }
200.1427 -+	    __ret.field[2] = space;
200.1428 -+	  }
200.1429 -+	else
200.1430 -+	  {
200.1431 -+	    // Pattern starts with sign and ends with none.
200.1432 -+	    if (__precedes)
200.1433 -+	      {
200.1434 -+		__ret.field[1] = symbol;
200.1435 -+		__ret.field[2] = value;
200.1436 -+	      }
200.1437 -+	    else
200.1438 -+	      {
200.1439 -+		__ret.field[1] = value;
200.1440 -+		__ret.field[2] = symbol;
200.1441 -+	      }
200.1442 -+	    __ret.field[3] = none;
200.1443 -+	  }
200.1444 -+	break;
200.1445 -+      case 2:
200.1446 -+	// 2 The sign follows the value and symbol.
200.1447 -+	if (__space)
200.1448 -+	  {
200.1449 -+	    // Pattern either ends with sign.
200.1450 -+	    if (__precedes)
200.1451 -+	      {
200.1452 -+		__ret.field[0] = symbol;
200.1453 -+		__ret.field[2] = value;
200.1454 -+	      }
200.1455 -+	    else
200.1456 -+	      {
200.1457 -+		__ret.field[0] = value;
200.1458 -+		__ret.field[2] = symbol;
200.1459 -+	      }
200.1460 -+	    __ret.field[1] = space;
200.1461 -+	    __ret.field[3] = sign;
200.1462 -+	  }
200.1463 -+	else
200.1464 -+	  {
200.1465 -+	    // Pattern ends with sign then none.
200.1466 -+	    if (__precedes)
200.1467 -+	      {
200.1468 -+		__ret.field[0] = symbol;
200.1469 -+		__ret.field[1] = value;
200.1470 -+	      }
200.1471 -+	    else
200.1472 -+	      {
200.1473 -+		__ret.field[0] = value;
200.1474 -+		__ret.field[1] = symbol;
200.1475 -+	      }
200.1476 -+	    __ret.field[2] = sign;
200.1477 -+	    __ret.field[3] = none;
200.1478 -+	  }
200.1479 -+	break;
200.1480 -+      case 3:
200.1481 -+	// 3 The sign immediately precedes the symbol.
200.1482 -+	if (__precedes)
200.1483 -+	  {
200.1484 -+	    __ret.field[0] = sign;
200.1485 -+	    __ret.field[1] = symbol;	    
200.1486 -+	    if (__space)
200.1487 -+	      {
200.1488 -+		__ret.field[2] = space;
200.1489 -+		__ret.field[3] = value;
200.1490 -+	      }
200.1491 -+	    else
200.1492 -+	      {
200.1493 -+		__ret.field[2] = value;		
200.1494 -+		__ret.field[3] = none;
200.1495 -+	      }
200.1496 -+	  }
200.1497 -+	else
200.1498 -+	  {
200.1499 -+	    __ret.field[0] = value;
200.1500 -+	    if (__space)
200.1501 -+	      {
200.1502 -+		__ret.field[1] = space;
200.1503 -+		__ret.field[2] = sign;
200.1504 -+		__ret.field[3] = symbol;
200.1505 -+	      }
200.1506 -+	    else
200.1507 -+	      {
200.1508 -+		__ret.field[1] = sign;
200.1509 -+		__ret.field[2] = symbol;
200.1510 -+		__ret.field[3] = none;
200.1511 -+	      }
200.1512 -+	  }
200.1513 -+	break;
200.1514 -+      case 4:
200.1515 -+	// 4 The sign immediately follows the symbol.
200.1516 -+	if (__precedes)
200.1517 -+	  {
200.1518 -+	    __ret.field[0] = symbol;
200.1519 -+	    __ret.field[1] = sign;
200.1520 -+	    if (__space)
200.1521 -+	      {
200.1522 -+		__ret.field[2] = space;
200.1523 -+		__ret.field[3] = value;
200.1524 -+	      }
200.1525 -+	    else
200.1526 -+	      {
200.1527 -+		__ret.field[2] = value;
200.1528 -+		__ret.field[3] = none;
200.1529 -+	      }
200.1530 -+	  }
200.1531 -+	else
200.1532 -+	  {
200.1533 -+	    __ret.field[0] = value;
200.1534 -+	    if (__space)
200.1535 -+	      {
200.1536 -+		__ret.field[1] = space;
200.1537 -+		__ret.field[2] = symbol;
200.1538 -+		__ret.field[3] = sign;
200.1539 -+	      }
200.1540 -+	    else
200.1541 -+	      {
200.1542 -+		__ret.field[1] = symbol;
200.1543 -+		__ret.field[2] = sign;
200.1544 -+		__ret.field[3] = none;
200.1545 -+	      }
200.1546 -+	  }
200.1547 -+	break;
200.1548 -+      default:
200.1549 -+	;
200.1550 -+      }
200.1551 -+    return __ret;
200.1552 -+  }
200.1553 -+
200.1554 -+  template<> 
200.1555 -+    void
200.1556 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
200.1557 -+						     const char*)
200.1558 -+    {
200.1559 -+      if (!_M_data)
200.1560 -+	_M_data = new __moneypunct_cache<char, true>;
200.1561 -+
200.1562 -+      if (!__cloc)
200.1563 -+	{
200.1564 -+	  // "C" locale
200.1565 -+	  _M_data->_M_decimal_point = '.';
200.1566 -+	  _M_data->_M_thousands_sep = ',';
200.1567 -+	  _M_data->_M_grouping = "";
200.1568 -+	  _M_data->_M_grouping_size = 0;
200.1569 -+	  _M_data->_M_curr_symbol = "";
200.1570 -+	  _M_data->_M_curr_symbol_size = 0;
200.1571 -+	  _M_data->_M_positive_sign = "";
200.1572 -+	  _M_data->_M_positive_sign_size = 0;
200.1573 -+	  _M_data->_M_negative_sign = "";
200.1574 -+	  _M_data->_M_negative_sign_size = 0;
200.1575 -+	  _M_data->_M_frac_digits = 0;
200.1576 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
200.1577 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
200.1578 -+
200.1579 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
200.1580 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
200.1581 -+	}
200.1582 -+      else
200.1583 -+	{
200.1584 -+	  // Named locale.
200.1585 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
200.1586 -+							__cloc));
200.1587 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
200.1588 -+							__cloc));
200.1589 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
200.1590 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
200.1591 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
200.1592 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
200.1593 -+
200.1594 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
200.1595 -+	  if (!__nposn)
200.1596 -+	    _M_data->_M_negative_sign = "()";
200.1597 -+	  else
200.1598 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
200.1599 -+							__cloc);
200.1600 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
200.1601 -+
200.1602 -+	  // _Intl == true
200.1603 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
200.1604 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
200.1605 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
200.1606 -+						      __cloc));
200.1607 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
200.1608 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
200.1609 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
200.1610 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
200.1611 -+							__pposn);
200.1612 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
200.1613 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
200.1614 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
200.1615 -+							__nposn);
200.1616 -+	}
200.1617 -+    }
200.1618 -+
200.1619 -+  template<> 
200.1620 -+    void
200.1621 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
200.1622 -+						      const char*)
200.1623 -+    {
200.1624 -+      if (!_M_data)
200.1625 -+	_M_data = new __moneypunct_cache<char, false>;
200.1626 -+
200.1627 -+      if (!__cloc)
200.1628 -+	{
200.1629 -+	  // "C" locale
200.1630 -+	  _M_data->_M_decimal_point = '.';
200.1631 -+	  _M_data->_M_thousands_sep = ',';
200.1632 -+	  _M_data->_M_grouping = "";
200.1633 -+	  _M_data->_M_grouping_size = 0;
200.1634 -+	  _M_data->_M_curr_symbol = "";
200.1635 -+	  _M_data->_M_curr_symbol_size = 0;
200.1636 -+	  _M_data->_M_positive_sign = "";
200.1637 -+	  _M_data->_M_positive_sign_size = 0;
200.1638 -+	  _M_data->_M_negative_sign = "";
200.1639 -+	  _M_data->_M_negative_sign_size = 0;
200.1640 -+	  _M_data->_M_frac_digits = 0;
200.1641 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
200.1642 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
200.1643 -+
200.1644 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
200.1645 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
200.1646 -+	}
200.1647 -+      else
200.1648 -+	{
200.1649 -+	  // Named locale.
200.1650 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
200.1651 -+							__cloc));
200.1652 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
200.1653 -+							__cloc));
200.1654 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
200.1655 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
200.1656 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
200.1657 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
200.1658 -+
200.1659 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
200.1660 -+	  if (!__nposn)
200.1661 -+	    _M_data->_M_negative_sign = "()";
200.1662 -+	  else
200.1663 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
200.1664 -+							__cloc);
200.1665 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
200.1666 -+
200.1667 -+	  // _Intl == false
200.1668 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
200.1669 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
200.1670 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
200.1671 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
200.1672 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
200.1673 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
200.1674 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
200.1675 -+							__pposn);
200.1676 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
200.1677 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
200.1678 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
200.1679 -+							__nposn);
200.1680 -+	}
200.1681 -+    }
200.1682 -+
200.1683 -+  template<> 
200.1684 -+    moneypunct<char, true>::~moneypunct()
200.1685 -+    { delete _M_data; }
200.1686 -+
200.1687 -+  template<> 
200.1688 -+    moneypunct<char, false>::~moneypunct()
200.1689 -+    { delete _M_data; }
200.1690 -+
200.1691 -+#ifdef _GLIBCXX_USE_WCHAR_T
200.1692 -+  template<> 
200.1693 -+    void
200.1694 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
200.1695 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1696 -+							const char*)
200.1697 -+#else
200.1698 -+							const char* __name)
200.1699 -+#endif
200.1700 -+    {
200.1701 -+      if (!_M_data)
200.1702 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
200.1703 -+
200.1704 -+      if (!__cloc)
200.1705 -+	{
200.1706 -+	  // "C" locale
200.1707 -+	  _M_data->_M_decimal_point = L'.';
200.1708 -+	  _M_data->_M_thousands_sep = L',';
200.1709 -+	  _M_data->_M_grouping = "";
200.1710 -+	  _M_data->_M_grouping_size = 0;
200.1711 -+	  _M_data->_M_curr_symbol = L"";
200.1712 -+	  _M_data->_M_curr_symbol_size = 0;
200.1713 -+	  _M_data->_M_positive_sign = L"";
200.1714 -+	  _M_data->_M_positive_sign_size = 0;
200.1715 -+	  _M_data->_M_negative_sign = L"";
200.1716 -+	  _M_data->_M_negative_sign_size = 0;
200.1717 -+	  _M_data->_M_frac_digits = 0;
200.1718 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
200.1719 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
200.1720 -+
200.1721 -+	  // Use ctype::widen code without the facet...
200.1722 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
200.1723 -+	    _M_data->_M_atoms[__i] =
200.1724 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
200.1725 -+	}
200.1726 -+      else
200.1727 -+	{
200.1728 -+	  // Named locale.
200.1729 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1730 -+	  __c_locale __old = __uselocale(__cloc);
200.1731 -+#else
200.1732 -+	  // Switch to named locale so that mbsrtowcs will work.
200.1733 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
200.1734 -+	  setlocale(LC_ALL, __name);
200.1735 -+#endif
200.1736 -+
200.1737 -+#ifdef __UCLIBC_MJN3_ONLY__
200.1738 -+#warning fix this... should be monetary
200.1739 -+#endif
200.1740 -+#ifdef __UCLIBC__
200.1741 -+# ifdef __UCLIBC_HAS_XLOCALE__
200.1742 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
200.1743 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
200.1744 -+# else
200.1745 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
200.1746 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
200.1747 -+# endif
200.1748 -+#else
200.1749 -+	  union { char *__s; wchar_t __w; } __u;
200.1750 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
200.1751 -+	  _M_data->_M_decimal_point = __u.__w;
200.1752 -+
200.1753 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
200.1754 -+	  _M_data->_M_thousands_sep = __u.__w;
200.1755 -+#endif
200.1756 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
200.1757 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
200.1758 -+
200.1759 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
200.1760 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
200.1761 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
200.1762 -+
200.1763 -+	  wchar_t* __wcs_ps = 0;
200.1764 -+	  wchar_t* __wcs_ns = 0;
200.1765 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
200.1766 -+	  try
200.1767 -+	    {
200.1768 -+	      mbstate_t __state;
200.1769 -+	      size_t __len = strlen(__cpossign);
200.1770 -+	      if (__len)
200.1771 -+		{
200.1772 -+		  ++__len;
200.1773 -+		  memset(&__state, 0, sizeof(mbstate_t));
200.1774 -+		  __wcs_ps = new wchar_t[__len];
200.1775 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
200.1776 -+		  _M_data->_M_positive_sign = __wcs_ps;
200.1777 -+		}
200.1778 -+	      else
200.1779 -+		_M_data->_M_positive_sign = L"";
200.1780 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
200.1781 -+	      
200.1782 -+	      __len = strlen(__cnegsign);
200.1783 -+	      if (!__nposn)
200.1784 -+		_M_data->_M_negative_sign = L"()";
200.1785 -+	      else if (__len)
200.1786 -+		{ 
200.1787 -+		  ++__len;
200.1788 -+		  memset(&__state, 0, sizeof(mbstate_t));
200.1789 -+		  __wcs_ns = new wchar_t[__len];
200.1790 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
200.1791 -+		  _M_data->_M_negative_sign = __wcs_ns;
200.1792 -+		}
200.1793 -+	      else
200.1794 -+		_M_data->_M_negative_sign = L"";
200.1795 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
200.1796 -+	      
200.1797 -+	      // _Intl == true.
200.1798 -+	      __len = strlen(__ccurr);
200.1799 -+	      if (__len)
200.1800 -+		{
200.1801 -+		  ++__len;
200.1802 -+		  memset(&__state, 0, sizeof(mbstate_t));
200.1803 -+		  wchar_t* __wcs = new wchar_t[__len];
200.1804 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
200.1805 -+		  _M_data->_M_curr_symbol = __wcs;
200.1806 -+		}
200.1807 -+	      else
200.1808 -+		_M_data->_M_curr_symbol = L"";
200.1809 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
200.1810 -+	    }
200.1811 -+	  catch (...)
200.1812 -+	    {
200.1813 -+	      delete _M_data;
200.1814 -+	      _M_data = 0;
200.1815 -+	      delete __wcs_ps;
200.1816 -+	      delete __wcs_ns;	      
200.1817 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1818 -+	      __uselocale(__old);
200.1819 -+#else
200.1820 -+	      setlocale(LC_ALL, __old);
200.1821 -+	      free(__old);
200.1822 -+#endif
200.1823 -+	      __throw_exception_again;
200.1824 -+	    } 
200.1825 -+	  
200.1826 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
200.1827 -+						      __cloc));
200.1828 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
200.1829 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
200.1830 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
200.1831 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
200.1832 -+							__pposn);
200.1833 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
200.1834 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
200.1835 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
200.1836 -+							__nposn);
200.1837 -+
200.1838 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1839 -+	  __uselocale(__old);
200.1840 -+#else
200.1841 -+	  setlocale(LC_ALL, __old);
200.1842 -+	  free(__old);
200.1843 -+#endif
200.1844 -+	}
200.1845 -+    }
200.1846 -+
200.1847 -+  template<> 
200.1848 -+  void
200.1849 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
200.1850 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1851 -+						       const char*)
200.1852 -+#else
200.1853 -+                                                       const char* __name)
200.1854 -+#endif
200.1855 -+  {
200.1856 -+    if (!_M_data)
200.1857 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
200.1858 -+
200.1859 -+    if (!__cloc)
200.1860 -+	{
200.1861 -+	  // "C" locale
200.1862 -+	  _M_data->_M_decimal_point = L'.';
200.1863 -+	  _M_data->_M_thousands_sep = L',';
200.1864 -+	  _M_data->_M_grouping = "";
200.1865 -+          _M_data->_M_grouping_size = 0;
200.1866 -+	  _M_data->_M_curr_symbol = L"";
200.1867 -+	  _M_data->_M_curr_symbol_size = 0;
200.1868 -+	  _M_data->_M_positive_sign = L"";
200.1869 -+	  _M_data->_M_positive_sign_size = 0;
200.1870 -+	  _M_data->_M_negative_sign = L"";
200.1871 -+	  _M_data->_M_negative_sign_size = 0;
200.1872 -+	  _M_data->_M_frac_digits = 0;
200.1873 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
200.1874 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
200.1875 -+
200.1876 -+	  // Use ctype::widen code without the facet...
200.1877 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
200.1878 -+	    _M_data->_M_atoms[__i] =
200.1879 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
200.1880 -+	}
200.1881 -+      else
200.1882 -+	{
200.1883 -+	  // Named locale.
200.1884 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1885 -+	  __c_locale __old = __uselocale(__cloc);
200.1886 -+#else
200.1887 -+	  // Switch to named locale so that mbsrtowcs will work.
200.1888 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
200.1889 -+	  setlocale(LC_ALL, __name);
200.1890 -+#endif
200.1891 -+
200.1892 -+#ifdef __UCLIBC_MJN3_ONLY__
200.1893 -+#warning fix this... should be monetary
200.1894 -+#endif
200.1895 -+#ifdef __UCLIBC__
200.1896 -+# ifdef __UCLIBC_HAS_XLOCALE__
200.1897 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
200.1898 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
200.1899 -+# else
200.1900 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
200.1901 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
200.1902 -+# endif
200.1903 -+#else
200.1904 -+          union { char *__s; wchar_t __w; } __u;
200.1905 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
200.1906 -+	  _M_data->_M_decimal_point = __u.__w;
200.1907 -+
200.1908 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
200.1909 -+	  _M_data->_M_thousands_sep = __u.__w;
200.1910 -+#endif
200.1911 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
200.1912 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
200.1913 -+
200.1914 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
200.1915 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
200.1916 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
200.1917 -+
200.1918 -+	  wchar_t* __wcs_ps = 0;
200.1919 -+	  wchar_t* __wcs_ns = 0;
200.1920 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
200.1921 -+	  try
200.1922 -+            {
200.1923 -+              mbstate_t __state;
200.1924 -+              size_t __len;
200.1925 -+              __len = strlen(__cpossign);
200.1926 -+              if (__len)
200.1927 -+                {
200.1928 -+		  ++__len;
200.1929 -+		  memset(&__state, 0, sizeof(mbstate_t));
200.1930 -+		  __wcs_ps = new wchar_t[__len];
200.1931 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
200.1932 -+		  _M_data->_M_positive_sign = __wcs_ps;
200.1933 -+		}
200.1934 -+	      else
200.1935 -+		_M_data->_M_positive_sign = L"";
200.1936 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
200.1937 -+	      
200.1938 -+	      __len = strlen(__cnegsign);
200.1939 -+	      if (!__nposn)
200.1940 -+		_M_data->_M_negative_sign = L"()";
200.1941 -+	      else if (__len)
200.1942 -+		{ 
200.1943 -+		  ++__len;
200.1944 -+		  memset(&__state, 0, sizeof(mbstate_t));
200.1945 -+		  __wcs_ns = new wchar_t[__len];
200.1946 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
200.1947 -+		  _M_data->_M_negative_sign = __wcs_ns;
200.1948 -+		}
200.1949 -+	      else
200.1950 -+		_M_data->_M_negative_sign = L"";
200.1951 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
200.1952 -+
200.1953 -+	      // _Intl == true.
200.1954 -+	      __len = strlen(__ccurr);
200.1955 -+	      if (__len)
200.1956 -+		{
200.1957 -+		  ++__len;
200.1958 -+		  memset(&__state, 0, sizeof(mbstate_t));
200.1959 -+		  wchar_t* __wcs = new wchar_t[__len];
200.1960 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
200.1961 -+		  _M_data->_M_curr_symbol = __wcs;
200.1962 -+		}
200.1963 -+	      else
200.1964 -+		_M_data->_M_curr_symbol = L"";
200.1965 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
200.1966 -+	    }
200.1967 -+          catch (...)
200.1968 -+	    {
200.1969 -+	      delete _M_data;
200.1970 -+              _M_data = 0;
200.1971 -+	      delete __wcs_ps;
200.1972 -+	      delete __wcs_ns;	      
200.1973 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1974 -+	      __uselocale(__old);
200.1975 -+#else
200.1976 -+	      setlocale(LC_ALL, __old);
200.1977 -+	      free(__old);
200.1978 -+#endif
200.1979 -+              __throw_exception_again;
200.1980 -+	    }
200.1981 -+
200.1982 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
200.1983 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
200.1984 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
200.1985 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
200.1986 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
200.1987 -+	                                                __pposn);
200.1988 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
200.1989 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
200.1990 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
200.1991 -+	                                                __nposn);
200.1992 -+
200.1993 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.1994 -+	  __uselocale(__old);
200.1995 -+#else
200.1996 -+	  setlocale(LC_ALL, __old);
200.1997 -+	  free(__old);
200.1998 -+#endif
200.1999 -+	}
200.2000 -+    }
200.2001 -+
200.2002 -+  template<> 
200.2003 -+    moneypunct<wchar_t, true>::~moneypunct()
200.2004 -+    {
200.2005 -+      if (_M_data->_M_positive_sign_size)
200.2006 -+	delete [] _M_data->_M_positive_sign;
200.2007 -+      if (_M_data->_M_negative_sign_size
200.2008 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
200.2009 -+	delete [] _M_data->_M_negative_sign;
200.2010 -+      if (_M_data->_M_curr_symbol_size)
200.2011 -+	delete [] _M_data->_M_curr_symbol;
200.2012 -+      delete _M_data;
200.2013 -+    }
200.2014 -+
200.2015 -+  template<> 
200.2016 -+    moneypunct<wchar_t, false>::~moneypunct()
200.2017 -+    {
200.2018 -+      if (_M_data->_M_positive_sign_size)
200.2019 -+	delete [] _M_data->_M_positive_sign;
200.2020 -+      if (_M_data->_M_negative_sign_size
200.2021 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
200.2022 -+	delete [] _M_data->_M_negative_sign;
200.2023 -+      if (_M_data->_M_curr_symbol_size)
200.2024 -+	delete [] _M_data->_M_curr_symbol;
200.2025 -+      delete _M_data;
200.2026 -+    }
200.2027 -+#endif
200.2028 -+}
200.2029 ---- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
200.2030 -+++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
200.2031 -@@ -0,0 +1,160 @@
200.2032 -+// std::numpunct implementation details, GNU version -*- C++ -*-
200.2033 -+
200.2034 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
200.2035 -+//
200.2036 -+// This file is part of the GNU ISO C++ Library.  This library is free
200.2037 -+// software; you can redistribute it and/or modify it under the
200.2038 -+// terms of the GNU General Public License as published by the
200.2039 -+// Free Software Foundation; either version 2, or (at your option)
200.2040 -+// any later version.
200.2041 -+
200.2042 -+// This library is distributed in the hope that it will be useful,
200.2043 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
200.2044 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
200.2045 -+// GNU General Public License for more details.
200.2046 -+
200.2047 -+// You should have received a copy of the GNU General Public License along
200.2048 -+// with this library; see the file COPYING.  If not, write to the Free
200.2049 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
200.2050 -+// USA.
200.2051 -+
200.2052 -+// As a special exception, you may use this file as part of a free software
200.2053 -+// library without restriction.  Specifically, if other files instantiate
200.2054 -+// templates or use macros or inline functions from this file, or you compile
200.2055 -+// this file and link it with other files to produce an executable, this
200.2056 -+// file does not by itself cause the resulting executable to be covered by
200.2057 -+// the GNU General Public License.  This exception does not however
200.2058 -+// invalidate any other reasons why the executable file might be covered by
200.2059 -+// the GNU General Public License.
200.2060 -+
200.2061 -+//
200.2062 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
200.2063 -+//
200.2064 -+
200.2065 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
200.2066 -+
200.2067 -+#define _LIBC
200.2068 -+#include <locale>
200.2069 -+#undef _LIBC
200.2070 -+#include <bits/c++locale_internal.h>
200.2071 -+
200.2072 -+#ifdef __UCLIBC_MJN3_ONLY__
200.2073 -+#warning tailor for stub locale support
200.2074 -+#endif
200.2075 -+#ifndef __UCLIBC_HAS_XLOCALE__
200.2076 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
200.2077 -+#endif
200.2078 -+
200.2079 -+namespace std
200.2080 -+{
200.2081 -+  template<> 
200.2082 -+    void
200.2083 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
200.2084 -+    {
200.2085 -+      if (!_M_data)
200.2086 -+	_M_data = new __numpunct_cache<char>;
200.2087 -+
200.2088 -+      if (!__cloc)
200.2089 -+	{
200.2090 -+	  // "C" locale
200.2091 -+	  _M_data->_M_grouping = "";
200.2092 -+	  _M_data->_M_grouping_size = 0;
200.2093 -+	  _M_data->_M_use_grouping = false;
200.2094 -+
200.2095 -+	  _M_data->_M_decimal_point = '.';
200.2096 -+	  _M_data->_M_thousands_sep = ',';
200.2097 -+
200.2098 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
200.2099 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
200.2100 -+
200.2101 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
200.2102 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
200.2103 -+	}
200.2104 -+      else
200.2105 -+	{
200.2106 -+	  // Named locale.
200.2107 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
200.2108 -+							__cloc));
200.2109 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
200.2110 -+							__cloc));
200.2111 -+
200.2112 -+	  // Check for NULL, which implies no grouping.
200.2113 -+	  if (_M_data->_M_thousands_sep == '\0')
200.2114 -+	    _M_data->_M_grouping = "";
200.2115 -+	  else
200.2116 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
200.2117 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
200.2118 -+	}
200.2119 -+
200.2120 -+      // NB: There is no way to extact this info from posix locales.
200.2121 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
200.2122 -+      _M_data->_M_truename = "true";
200.2123 -+      _M_data->_M_truename_size = 4;
200.2124 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
200.2125 -+      _M_data->_M_falsename = "false";
200.2126 -+      _M_data->_M_falsename_size = 5;
200.2127 -+    }
200.2128 -+ 
200.2129 -+  template<> 
200.2130 -+    numpunct<char>::~numpunct()
200.2131 -+    { delete _M_data; }
200.2132 -+   
200.2133 -+#ifdef _GLIBCXX_USE_WCHAR_T
200.2134 -+  template<> 
200.2135 -+    void
200.2136 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
200.2137 -+    {
200.2138 -+      if (!_M_data)
200.2139 -+	_M_data = new __numpunct_cache<wchar_t>;
200.2140 -+
200.2141 -+      if (!__cloc)
200.2142 -+	{
200.2143 -+	  // "C" locale
200.2144 -+	  _M_data->_M_grouping = "";
200.2145 -+	  _M_data->_M_grouping_size = 0;
200.2146 -+	  _M_data->_M_use_grouping = false;
200.2147 -+
200.2148 -+	  _M_data->_M_decimal_point = L'.';
200.2149 -+	  _M_data->_M_thousands_sep = L',';
200.2150 -+
200.2151 -+	  // Use ctype::widen code without the facet...
200.2152 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
200.2153 -+	    _M_data->_M_atoms_out[__i] =
200.2154 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
200.2155 -+
200.2156 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
200.2157 -+	    _M_data->_M_atoms_in[__j] =
200.2158 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
200.2159 -+	}
200.2160 -+      else
200.2161 -+	{
200.2162 -+	  // Named locale.
200.2163 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
200.2164 -+	  union { char *__s; wchar_t __w; } __u;
200.2165 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
200.2166 -+	  _M_data->_M_decimal_point = __u.__w;
200.2167 -+
200.2168 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
200.2169 -+	  _M_data->_M_thousands_sep = __u.__w;
200.2170 -+
200.2171 -+	  if (_M_data->_M_thousands_sep == L'\0')
200.2172 -+	    _M_data->_M_grouping = "";
200.2173 -+	  else
200.2174 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
200.2175 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
200.2176 -+	}
200.2177 -+
200.2178 -+      // NB: There is no way to extact this info from posix locales.
200.2179 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
200.2180 -+      _M_data->_M_truename = L"true";
200.2181 -+      _M_data->_M_truename_size = 4;
200.2182 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
200.2183 -+      _M_data->_M_falsename = L"false";
200.2184 -+      _M_data->_M_falsename_size = 5;
200.2185 -+    }
200.2186 -+
200.2187 -+  template<> 
200.2188 -+    numpunct<wchar_t>::~numpunct()
200.2189 -+    { delete _M_data; }
200.2190 -+ #endif
200.2191 -+}
200.2192 ---- gcc/libstdc++-v3/config/locale/uclibc/time_members.cc
200.2193 -+++ gcc/libstdc++-v3/config/locale/uclibc/time_members.cc
200.2194 -@@ -0,0 +1,406 @@
200.2195 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
200.2196 -+
200.2197 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
200.2198 -+//
200.2199 -+// This file is part of the GNU ISO C++ Library.  This library is free
200.2200 -+// software; you can redistribute it and/or modify it under the
200.2201 -+// terms of the GNU General Public License as published by the
200.2202 -+// Free Software Foundation; either version 2, or (at your option)
200.2203 -+// any later version.
200.2204 -+
200.2205 -+// This library is distributed in the hope that it will be useful,
200.2206 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
200.2207 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
200.2208 -+// GNU General Public License for more details.
200.2209 -+
200.2210 -+// You should have received a copy of the GNU General Public License along
200.2211 -+// with this library; see the file COPYING.  If not, write to the Free
200.2212 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
200.2213 -+// USA.
200.2214 -+
200.2215 -+// As a special exception, you may use this file as part of a free software
200.2216 -+// library without restriction.  Specifically, if other files instantiate
200.2217 -+// templates or use macros or inline functions from this file, or you compile
200.2218 -+// this file and link it with other files to produce an executable, this
200.2219 -+// file does not by itself cause the resulting executable to be covered by
200.2220 -+// the GNU General Public License.  This exception does not however
200.2221 -+// invalidate any other reasons why the executable file might be covered by
200.2222 -+// the GNU General Public License.
200.2223 -+
200.2224 -+//
200.2225 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
200.2226 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
200.2227 -+//
200.2228 -+
200.2229 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
200.2230 -+
200.2231 -+#include <locale>
200.2232 -+#include <bits/c++locale_internal.h>
200.2233 -+
200.2234 -+#ifdef __UCLIBC_MJN3_ONLY__
200.2235 -+#warning tailor for stub locale support
200.2236 -+#endif
200.2237 -+#ifndef __UCLIBC_HAS_XLOCALE__
200.2238 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
200.2239 -+#endif
200.2240 -+
200.2241 -+namespace std
200.2242 -+{
200.2243 -+  template<>
200.2244 -+    void
200.2245 -+    __timepunct<char>::
200.2246 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
200.2247 -+	   const tm* __tm) const
200.2248 -+    {
200.2249 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.2250 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
200.2251 -+					_M_c_locale_timepunct);
200.2252 -+#else
200.2253 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
200.2254 -+      setlocale(LC_ALL, _M_name_timepunct);
200.2255 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
200.2256 -+      setlocale(LC_ALL, __old);
200.2257 -+      free(__old);
200.2258 -+#endif
200.2259 -+      // Make sure __s is null terminated.
200.2260 -+      if (__len == 0)
200.2261 -+	__s[0] = '\0';
200.2262 -+    }
200.2263 -+
200.2264 -+  template<> 
200.2265 -+    void
200.2266 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
200.2267 -+    {
200.2268 -+      if (!_M_data)
200.2269 -+	_M_data = new __timepunct_cache<char>;
200.2270 -+
200.2271 -+      if (!__cloc)
200.2272 -+	{
200.2273 -+	  // "C" locale
200.2274 -+	  _M_c_locale_timepunct = _S_get_c_locale();
200.2275 -+
200.2276 -+	  _M_data->_M_date_format = "%m/%d/%y";
200.2277 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
200.2278 -+	  _M_data->_M_time_format = "%H:%M:%S";
200.2279 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
200.2280 -+	  _M_data->_M_date_time_format = "";
200.2281 -+	  _M_data->_M_date_time_era_format = "";
200.2282 -+	  _M_data->_M_am = "AM";
200.2283 -+	  _M_data->_M_pm = "PM";
200.2284 -+	  _M_data->_M_am_pm_format = "";
200.2285 -+
200.2286 -+	  // Day names, starting with "C"'s Sunday.
200.2287 -+	  _M_data->_M_day1 = "Sunday";
200.2288 -+	  _M_data->_M_day2 = "Monday";
200.2289 -+	  _M_data->_M_day3 = "Tuesday";
200.2290 -+	  _M_data->_M_day4 = "Wednesday";
200.2291 -+	  _M_data->_M_day5 = "Thursday";
200.2292 -+	  _M_data->_M_day6 = "Friday";
200.2293 -+	  _M_data->_M_day7 = "Saturday";
200.2294 -+
200.2295 -+	  // Abbreviated day names, starting with "C"'s Sun.
200.2296 -+	  _M_data->_M_aday1 = "Sun";
200.2297 -+	  _M_data->_M_aday2 = "Mon";
200.2298 -+	  _M_data->_M_aday3 = "Tue";
200.2299 -+	  _M_data->_M_aday4 = "Wed";
200.2300 -+	  _M_data->_M_aday5 = "Thu";
200.2301 -+	  _M_data->_M_aday6 = "Fri";
200.2302 -+	  _M_data->_M_aday7 = "Sat";
200.2303 -+
200.2304 -+	  // Month names, starting with "C"'s January.
200.2305 -+	  _M_data->_M_month01 = "January";
200.2306 -+	  _M_data->_M_month02 = "February";
200.2307 -+	  _M_data->_M_month03 = "March";
200.2308 -+	  _M_data->_M_month04 = "April";
200.2309 -+	  _M_data->_M_month05 = "May";
200.2310 -+	  _M_data->_M_month06 = "June";
200.2311 -+	  _M_data->_M_month07 = "July";
200.2312 -+	  _M_data->_M_month08 = "August";
200.2313 -+	  _M_data->_M_month09 = "September";
200.2314 -+	  _M_data->_M_month10 = "October";
200.2315 -+	  _M_data->_M_month11 = "November";
200.2316 -+	  _M_data->_M_month12 = "December";
200.2317 -+
200.2318 -+	  // Abbreviated month names, starting with "C"'s Jan.
200.2319 -+	  _M_data->_M_amonth01 = "Jan";
200.2320 -+	  _M_data->_M_amonth02 = "Feb";
200.2321 -+	  _M_data->_M_amonth03 = "Mar";
200.2322 -+	  _M_data->_M_amonth04 = "Apr";
200.2323 -+	  _M_data->_M_amonth05 = "May";
200.2324 -+	  _M_data->_M_amonth06 = "Jun";
200.2325 -+	  _M_data->_M_amonth07 = "Jul";
200.2326 -+	  _M_data->_M_amonth08 = "Aug";
200.2327 -+	  _M_data->_M_amonth09 = "Sep";
200.2328 -+	  _M_data->_M_amonth10 = "Oct";
200.2329 -+	  _M_data->_M_amonth11 = "Nov";
200.2330 -+	  _M_data->_M_amonth12 = "Dec";
200.2331 -+	}
200.2332 -+      else
200.2333 -+	{
200.2334 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
200.2335 -+
200.2336 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
200.2337 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
200.2338 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
200.2339 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
200.2340 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
200.2341 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
200.2342 -+							     __cloc);
200.2343 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
200.2344 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
200.2345 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
200.2346 -+
200.2347 -+	  // Day names, starting with "C"'s Sunday.
200.2348 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
200.2349 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
200.2350 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
200.2351 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
200.2352 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
200.2353 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
200.2354 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
200.2355 -+
200.2356 -+	  // Abbreviated day names, starting with "C"'s Sun.
200.2357 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
200.2358 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
200.2359 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
200.2360 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
200.2361 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
200.2362 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
200.2363 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
200.2364 -+
200.2365 -+	  // Month names, starting with "C"'s January.
200.2366 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
200.2367 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
200.2368 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
200.2369 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
200.2370 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
200.2371 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
200.2372 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
200.2373 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
200.2374 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
200.2375 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
200.2376 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
200.2377 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
200.2378 -+
200.2379 -+	  // Abbreviated month names, starting with "C"'s Jan.
200.2380 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
200.2381 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
200.2382 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
200.2383 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
200.2384 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
200.2385 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
200.2386 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
200.2387 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
200.2388 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
200.2389 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
200.2390 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
200.2391 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
200.2392 -+	}
200.2393 -+    }
200.2394 -+
200.2395 -+#ifdef _GLIBCXX_USE_WCHAR_T
200.2396 -+  template<>
200.2397 -+    void
200.2398 -+    __timepunct<wchar_t>::
200.2399 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
200.2400 -+	   const tm* __tm) const
200.2401 -+    {
200.2402 -+#ifdef __UCLIBC_HAS_XLOCALE__
200.2403 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
200.2404 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
200.2405 -+					_M_c_locale_timepunct);
200.2406 -+#else
200.2407 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
200.2408 -+      setlocale(LC_ALL, _M_name_timepunct);
200.2409 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
200.2410 -+      setlocale(LC_ALL, __old);
200.2411 -+      free(__old);
200.2412 -+#endif
200.2413 -+      // Make sure __s is null terminated.
200.2414 -+      if (__len == 0)
200.2415 -+	__s[0] = L'\0';
200.2416 -+    }
200.2417 -+
200.2418 -+  template<> 
200.2419 -+    void
200.2420 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
200.2421 -+    {
200.2422 -+      if (!_M_data)
200.2423 -+	_M_data = new __timepunct_cache<wchar_t>;
200.2424 -+
200.2425 -+#warning wide time stuff
200.2426 -+//       if (!__cloc)
200.2427 -+	{
200.2428 -+	  // "C" locale
200.2429 -+	  _M_c_locale_timepunct = _S_get_c_locale();
200.2430 -+
200.2431 -+	  _M_data->_M_date_format = L"%m/%d/%y";
200.2432 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
200.2433 -+	  _M_data->_M_time_format = L"%H:%M:%S";
200.2434 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
200.2435 -+	  _M_data->_M_date_time_format = L"";
200.2436 -+	  _M_data->_M_date_time_era_format = L"";
200.2437 -+	  _M_data->_M_am = L"AM";
200.2438 -+	  _M_data->_M_pm = L"PM";
200.2439 -+	  _M_data->_M_am_pm_format = L"";
200.2440 -+
200.2441 -+	  // Day names, starting with "C"'s Sunday.
200.2442 -+	  _M_data->_M_day1 = L"Sunday";
200.2443 -+	  _M_data->_M_day2 = L"Monday";
200.2444 -+	  _M_data->_M_day3 = L"Tuesday";
200.2445 -+	  _M_data->_M_day4 = L"Wednesday";
200.2446 -+	  _M_data->_M_day5 = L"Thursday";
200.2447 -+	  _M_data->_M_day6 = L"Friday";
200.2448 -+	  _M_data->_M_day7 = L"Saturday";
200.2449 -+
200.2450 -+	  // Abbreviated day names, starting with "C"'s Sun.
200.2451 -+	  _M_data->_M_aday1 = L"Sun";
200.2452 -+	  _M_data->_M_aday2 = L"Mon";
200.2453 -+	  _M_data->_M_aday3 = L"Tue";
200.2454 -+	  _M_data->_M_aday4 = L"Wed";
200.2455 -+	  _M_data->_M_aday5 = L"Thu";
200.2456 -+	  _M_data->_M_aday6 = L"Fri";
200.2457 -+	  _M_data->_M_aday7 = L"Sat";
200.2458 -+
200.2459 -+	  // Month names, starting with "C"'s January.
200.2460 -+	  _M_data->_M_month01 = L"January";
200.2461 -+	  _M_data->_M_month02 = L"February";
200.2462 -+	  _M_data->_M_month03 = L"March";
200.2463 -+	  _M_data->_M_month04 = L"April";
200.2464 -+	  _M_data->_M_month05 = L"May";
200.2465 -+	  _M_data->_M_month06 = L"June";
200.2466 -+	  _M_data->_M_month07 = L"July";
200.2467 -+	  _M_data->_M_month08 = L"August";
200.2468 -+	  _M_data->_M_month09 = L"September";
200.2469 -+	  _M_data->_M_month10 = L"October";
200.2470 -+	  _M_data->_M_month11 = L"November";
200.2471 -+	  _M_data->_M_month12 = L"December";
200.2472 -+
200.2473 -+	  // Abbreviated month names, starting with "C"'s Jan.
200.2474 -+	  _M_data->_M_amonth01 = L"Jan";
200.2475 -+	  _M_data->_M_amonth02 = L"Feb";
200.2476 -+	  _M_data->_M_amonth03 = L"Mar";
200.2477 -+	  _M_data->_M_amonth04 = L"Apr";
200.2478 -+	  _M_data->_M_amonth05 = L"May";
200.2479 -+	  _M_data->_M_amonth06 = L"Jun";
200.2480 -+	  _M_data->_M_amonth07 = L"Jul";
200.2481 -+	  _M_data->_M_amonth08 = L"Aug";
200.2482 -+	  _M_data->_M_amonth09 = L"Sep";
200.2483 -+	  _M_data->_M_amonth10 = L"Oct";
200.2484 -+	  _M_data->_M_amonth11 = L"Nov";
200.2485 -+	  _M_data->_M_amonth12 = L"Dec";
200.2486 -+	}
200.2487 -+#if 0
200.2488 -+      else
200.2489 -+	{
200.2490 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
200.2491 -+
200.2492 -+	  union { char *__s; wchar_t *__w; } __u;
200.2493 -+
200.2494 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
200.2495 -+	  _M_data->_M_date_format = __u.__w;
200.2496 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
200.2497 -+	  _M_data->_M_date_era_format = __u.__w;
200.2498 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
200.2499 -+	  _M_data->_M_time_format = __u.__w;
200.2500 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
200.2501 -+	  _M_data->_M_time_era_format = __u.__w;
200.2502 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
200.2503 -+	  _M_data->_M_date_time_format = __u.__w;
200.2504 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
200.2505 -+	  _M_data->_M_date_time_era_format = __u.__w;
200.2506 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
200.2507 -+	  _M_data->_M_am = __u.__w;
200.2508 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
200.2509 -+	  _M_data->_M_pm = __u.__w;
200.2510 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
200.2511 -+	  _M_data->_M_am_pm_format = __u.__w;
200.2512 -+
200.2513 -+	  // Day names, starting with "C"'s Sunday.
200.2514 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
200.2515 -+	  _M_data->_M_day1 = __u.__w;
200.2516 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
200.2517 -+	  _M_data->_M_day2 = __u.__w;
200.2518 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
200.2519 -+	  _M_data->_M_day3 = __u.__w;
200.2520 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
200.2521 -+	  _M_data->_M_day4 = __u.__w;
200.2522 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
200.2523 -+	  _M_data->_M_day5 = __u.__w;
200.2524 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
200.2525 -+	  _M_data->_M_day6 = __u.__w;
200.2526 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
200.2527 -+	  _M_data->_M_day7 = __u.__w;
200.2528 -+
200.2529 -+	  // Abbreviated day names, starting with "C"'s Sun.
200.2530 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
200.2531 -+	  _M_data->_M_aday1 = __u.__w;
200.2532 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
200.2533 -+	  _M_data->_M_aday2 = __u.__w;
200.2534 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
200.2535 -+	  _M_data->_M_aday3 = __u.__w;
200.2536 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
200.2537 -+	  _M_data->_M_aday4 = __u.__w;
200.2538 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
200.2539 -+	  _M_data->_M_aday5 = __u.__w;
200.2540 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
200.2541 -+	  _M_data->_M_aday6 = __u.__w;
200.2542 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
200.2543 -+	  _M_data->_M_aday7 = __u.__w;
200.2544 -+
200.2545 -+	  // Month names, starting with "C"'s January.
200.2546 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
200.2547 -+	  _M_data->_M_month01 = __u.__w;
200.2548 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
200.2549 -+	  _M_data->_M_month02 = __u.__w;
200.2550 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
200.2551 -+	  _M_data->_M_month03 = __u.__w;
200.2552 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
200.2553 -+	  _M_data->_M_month04 = __u.__w;
200.2554 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
200.2555 -+	  _M_data->_M_month05 = __u.__w;
200.2556 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
200.2557 -+	  _M_data->_M_month06 = __u.__w;
200.2558 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
200.2559 -+	  _M_data->_M_month07 = __u.__w;
200.2560 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
200.2561 -+	  _M_data->_M_month08 = __u.__w;
200.2562 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
200.2563 -+	  _M_data->_M_month09 = __u.__w;
200.2564 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
200.2565 -+	  _M_data->_M_month10 = __u.__w;
200.2566 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
200.2567 -+	  _M_data->_M_month11 = __u.__w;
200.2568 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
200.2569 -+	  _M_data->_M_month12 = __u.__w;
200.2570 -+
200.2571 -+	  // Abbreviated month names, starting with "C"'s Jan.
200.2572 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
200.2573 -+	  _M_data->_M_amonth01 = __u.__w;
200.2574 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
200.2575 -+	  _M_data->_M_amonth02 = __u.__w;
200.2576 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
200.2577 -+	  _M_data->_M_amonth03 = __u.__w;
200.2578 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
200.2579 -+	  _M_data->_M_amonth04 = __u.__w;
200.2580 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
200.2581 -+	  _M_data->_M_amonth05 = __u.__w;
200.2582 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
200.2583 -+	  _M_data->_M_amonth06 = __u.__w;
200.2584 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
200.2585 -+	  _M_data->_M_amonth07 = __u.__w;
200.2586 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
200.2587 -+	  _M_data->_M_amonth08 = __u.__w;
200.2588 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
200.2589 -+	  _M_data->_M_amonth09 = __u.__w;
200.2590 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
200.2591 -+	  _M_data->_M_amonth10 = __u.__w;
200.2592 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
200.2593 -+	  _M_data->_M_amonth11 = __u.__w;
200.2594 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
200.2595 -+	  _M_data->_M_amonth12 = __u.__w;
200.2596 -+	}
200.2597 -+#endif // 0
200.2598 -+    }
200.2599 -+#endif
200.2600 -+}
200.2601 ---- gcc/libstdc++-v3/config/locale/uclibc/time_members.h
200.2602 -+++ gcc/libstdc++-v3/config/locale/uclibc/time_members.h
200.2603 -@@ -0,0 +1,68 @@
200.2604 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
200.2605 -+
200.2606 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
200.2607 -+//
200.2608 -+// This file is part of the GNU ISO C++ Library.  This library is free
200.2609 -+// software; you can redistribute it and/or modify it under the
200.2610 -+// terms of the GNU General Public License as published by the
200.2611 -+// Free Software Foundation; either version 2, or (at your option)
200.2612 -+// any later version.
200.2613 -+
200.2614 -+// This library is distributed in the hope that it will be useful,
200.2615 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
200.2616 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
200.2617 -+// GNU General Public License for more details.
200.2618 -+
200.2619 -+// You should have received a copy of the GNU General Public License along
200.2620 -+// with this library; see the file COPYING.  If not, write to the Free
200.2621 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
200.2622 -+// USA.
200.2623 -+
200.2624 -+// As a special exception, you may use this file as part of a free software
200.2625 -+// library without restriction.  Specifically, if other files instantiate
200.2626 -+// templates or use macros or inline functions from this file, or you compile
200.2627 -+// this file and link it with other files to produce an executable, this
200.2628 -+// file does not by itself cause the resulting executable to be covered by
200.2629 -+// the GNU General Public License.  This exception does not however
200.2630 -+// invalidate any other reasons why the executable file might be covered by
200.2631 -+// the GNU General Public License.
200.2632 -+
200.2633 -+//
200.2634 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
200.2635 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
200.2636 -+//
200.2637 -+
200.2638 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
200.2639 -+
200.2640 -+  template<typename _CharT>
200.2641 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
200.2642 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
200.2643 -+    _M_name_timepunct(_S_get_c_name())
200.2644 -+    { _M_initialize_timepunct(); }
200.2645 -+
200.2646 -+  template<typename _CharT>
200.2647 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
200.2648 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
200.2649 -+    _M_name_timepunct(_S_get_c_name())
200.2650 -+    { _M_initialize_timepunct(); }
200.2651 -+
200.2652 -+  template<typename _CharT>
200.2653 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
200.2654 -+				     size_t __refs) 
200.2655 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
200.2656 -+    _M_name_timepunct(__s)
200.2657 -+    { 
200.2658 -+      char* __tmp = new char[std::strlen(__s) + 1];
200.2659 -+      std::strcpy(__tmp, __s);
200.2660 -+      _M_name_timepunct = __tmp;
200.2661 -+      _M_initialize_timepunct(__cloc); 
200.2662 -+    }
200.2663 -+
200.2664 -+  template<typename _CharT>
200.2665 -+    __timepunct<_CharT>::~__timepunct()
200.2666 -+    { 
200.2667 -+      if (_M_name_timepunct != _S_get_c_name())
200.2668 -+	delete [] _M_name_timepunct;
200.2669 -+      delete _M_data; 
200.2670 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
200.2671 -+    }
200.2672 ---- gcc/libstdc++-v3/configure
200.2673 -+++ gcc/libstdc++-v3/configure
200.2674 -@@ -5764,7 +5764,7 @@
200.2675 -   enableval="$enable_clocale"
200.2676 - 
200.2677 -       case "$enableval" in
200.2678 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
200.2679 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
200.2680 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
200.2681 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
200.2682 -    { (exit 1); exit 1; }; } ;;
200.2683 -@@ -5789,6 +5789,9 @@
200.2684 -   # Default to "generic".
200.2685 -   if test $enable_clocale_flag = auto; then
200.2686 -     case ${target_os} in
200.2687 -+      linux-uclibc*)
200.2688 -+        enable_clocale_flag=uclibc
200.2689 -+	;;
200.2690 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
200.2691 -         cat >conftest.$ac_ext <<_ACEOF
200.2692 - /* confdefs.h.  */
200.2693 -@@ -6019,6 +6022,76 @@
200.2694 -       CTIME_CC=config/locale/generic/time_members.cc
200.2695 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
200.2696 -       ;;
200.2697 -+    uclibc)
200.2698 -+      echo "$as_me:$LINENO: result: uclibc" >&5
200.2699 -+echo "${ECHO_T}uclibc" >&6
200.2700 -+
200.2701 -+      # Declare intention to use gettext, and add support for specific
200.2702 -+      # languages.
200.2703 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
200.2704 -+      ALL_LINGUAS="de fr"
200.2705 -+
200.2706 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
200.2707 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
200.2708 -+set dummy msgfmt; ac_word=$2
200.2709 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
200.2710 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
200.2711 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
200.2712 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
200.2713 -+else
200.2714 -+  if test -n "$check_msgfmt"; then
200.2715 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
200.2716 -+else
200.2717 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
200.2718 -+for as_dir in $PATH
200.2719 -+do
200.2720 -+  IFS=$as_save_IFS
200.2721 -+  test -z "$as_dir" && as_dir=.
200.2722 -+  for ac_exec_ext in '' $ac_executable_extensions; do
200.2723 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
200.2724 -+    ac_cv_prog_check_msgfmt="yes"
200.2725 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
200.2726 -+    break 2
200.2727 -+  fi
200.2728 -+done
200.2729 -+done
200.2730 -+
200.2731 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
200.2732 -+fi
200.2733 -+fi
200.2734 -+check_msgfmt=$ac_cv_prog_check_msgfmt
200.2735 -+if test -n "$check_msgfmt"; then
200.2736 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
200.2737 -+echo "${ECHO_T}$check_msgfmt" >&6
200.2738 -+else
200.2739 -+  echo "$as_me:$LINENO: result: no" >&5
200.2740 -+echo "${ECHO_T}no" >&6
200.2741 -+fi
200.2742 -+
200.2743 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
200.2744 -+        USE_NLS=yes
200.2745 -+      fi
200.2746 -+      # Export the build objects.
200.2747 -+      for ling in $ALL_LINGUAS; do \
200.2748 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
200.2749 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
200.2750 -+      done
200.2751 -+
200.2752 -+
200.2753 -+
200.2754 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
200.2755 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
200.2756 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
200.2757 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
200.2758 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
200.2759 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
200.2760 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
200.2761 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
200.2762 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
200.2763 -+      CTIME_H=config/locale/uclibc/time_members.h
200.2764 -+      CTIME_CC=config/locale/uclibc/time_members.cc
200.2765 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
200.2766 -+      ;;
200.2767 -   esac
200.2768 - 
200.2769 -   # This is where the testsuite looks for locale catalogs, using the
200.2770 ---- gcc/libstdc++-v3/include/c_compatibility/wchar.h
200.2771 -+++ gcc/libstdc++-v3/include/c_compatibility/wchar.h
200.2772 -@@ -101,7 +101,9 @@
200.2773 - using std::wmemcpy;
200.2774 - using std::wmemmove;
200.2775 - using std::wmemset;
200.2776 -+#if _GLIBCXX_HAVE_WCSFTIME
200.2777 - using std::wcsftime;
200.2778 -+#endif
200.2779 - 
200.2780 - #if _GLIBCXX_USE_C99
200.2781 - using std::wcstold;
200.2782 ---- gcc/libstdc++-v3/include/c_std/std_cwchar.h
200.2783 -+++ gcc/libstdc++-v3/include/c_std/std_cwchar.h
200.2784 -@@ -182,7 +182,9 @@
200.2785 -   using ::wcscoll;
200.2786 -   using ::wcscpy;
200.2787 -   using ::wcscspn;
200.2788 -+#if _GLIBCXX_HAVE_WCSFTIME
200.2789 -   using ::wcsftime;
200.2790 -+#endif
200.2791 -   using ::wcslen;
200.2792 -   using ::wcsncat;
200.2793 -   using ::wcsncmp;
   201.1 --- a/patches/gcc/4.2.0/203-uclibc-locale-no__x.patch	Mon Jul 28 21:08:01 2008 +0000
   201.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   201.3 @@ -1,213 +0,0 @@
   201.4 ---- gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h.uclibc200no__x~	2006-03-10 15:06:17 +0100
   201.5 -+++ gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2006-03-10 15:32:37 +0100
   201.6 -@@ -60,4 +60,49 @@
   201.7 - extern "C" __typeof(wctype_l) __wctype_l;
   201.8 - #endif 
   201.9 - 
  201.10 -+# define __nl_langinfo_l nl_langinfo_l
  201.11 -+# define __strcoll_l strcoll_l
  201.12 -+# define __strftime_l strftime_l
  201.13 -+# define __strtod_l strtod_l
  201.14 -+# define __strtof_l strtof_l
  201.15 -+# define __strtold_l strtold_l
  201.16 -+# define __strxfrm_l strxfrm_l
  201.17 -+# define __newlocale newlocale
  201.18 -+# define __freelocale freelocale
  201.19 -+# define __duplocale duplocale
  201.20 -+# define __uselocale uselocale
  201.21 -+
  201.22 -+# ifdef _GLIBCXX_USE_WCHAR_T
  201.23 -+#  define __iswctype_l iswctype_l
  201.24 -+#  define __towlower_l towlower_l
  201.25 -+#  define __towupper_l towupper_l
  201.26 -+#  define __wcscoll_l wcscoll_l
  201.27 -+#  define __wcsftime_l wcsftime_l
  201.28 -+#  define __wcsxfrm_l wcsxfrm_l
  201.29 -+#  define __wctype_l wctype_l
  201.30 -+# endif
  201.31 -+
  201.32 -+#else
  201.33 -+# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  201.34 -+# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  201.35 -+# define __strtod_l(S, E, L)         strtod((S), (E))
  201.36 -+# define __strtof_l(S, E, L)         strtof((S), (E))
  201.37 -+# define __strtold_l(S, E, L)        strtold((S), (E))
  201.38 -+# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  201.39 -+# warning should dummy __newlocale check for C|POSIX ?
  201.40 -+# define __newlocale(a, b, c)        NULL
  201.41 -+# define __freelocale(a)             ((void)0)
  201.42 -+# define __duplocale(a)              __c_locale()
  201.43 -+//# define __uselocale ?
  201.44 -+//
  201.45 -+# ifdef _GLIBCXX_USE_WCHAR_T
  201.46 -+#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  201.47 -+#  define __towlower_l(C, L)          towlower((C))
  201.48 -+#  define __towupper_l(C, L)          towupper((C))
  201.49 -+#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  201.50 -+//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  201.51 -+#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  201.52 -+#  define __wctype_l(S, L)            wctype((S))
  201.53 -+# endif
  201.54 -+
  201.55 - #endif // GLIBC 2.3 and later
  201.56 ---- gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
  201.57 -+++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc	2006-03-10 15:32:37 +0100
  201.58 -@@ -39,20 +39,6 @@
  201.59 - #include <langinfo.h>
  201.60 - #include <bits/c++locale_internal.h>
  201.61 - 
  201.62 --#ifndef __UCLIBC_HAS_XLOCALE__
  201.63 --#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  201.64 --#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  201.65 --#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  201.66 --#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  201.67 --#define __strtof_l(S, E, L)         strtof((S), (E))
  201.68 --#define __strtod_l(S, E, L)         strtod((S), (E))
  201.69 --#define __strtold_l(S, E, L)        strtold((S), (E))
  201.70 --#warning should dummy __newlocale check for C|POSIX ?
  201.71 --#define __newlocale(a, b, c)        NULL
  201.72 --#define __freelocale(a)             ((void)0)
  201.73 --#define __duplocale(a)              __c_locale()
  201.74 --#endif
  201.75 --
  201.76 - namespace std 
  201.77 - {
  201.78 -   template<>
  201.79 ---- gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
  201.80 -+++ gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc	2006-03-10 15:32:37 +0100
  201.81 -@@ -36,13 +36,6 @@
  201.82 - #include <locale>
  201.83 - #include <bits/c++locale_internal.h>
  201.84 - 
  201.85 --#ifndef __UCLIBC_HAS_XLOCALE__
  201.86 --#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  201.87 --#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  201.88 --#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  201.89 --#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  201.90 --#endif
  201.91 --
  201.92 - namespace std
  201.93 - {
  201.94 -   // These are basically extensions to char_traits, and perhaps should
  201.95 ---- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
  201.96 -+++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2006-03-10 15:32:37 +0100
  201.97 -@@ -43,10 +43,6 @@
  201.98 - #warning tailor for stub locale support
  201.99 - #endif
 201.100 - 
 201.101 --#ifndef __UCLIBC_HAS_XLOCALE__
 201.102 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 201.103 --#endif
 201.104 --
 201.105 - namespace std
 201.106 - {
 201.107 -   // Construct and return valid pattern consisting of some combination of:
 201.108 ---- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
 201.109 -+++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2006-03-10 15:32:37 +0100
 201.110 -@@ -41,9 +41,6 @@
 201.111 - #ifdef __UCLIBC_MJN3_ONLY__
 201.112 - #warning tailor for stub locale support
 201.113 - #endif
 201.114 --#ifndef __UCLIBC_HAS_XLOCALE__
 201.115 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 201.116 --#endif
 201.117 - 
 201.118 - namespace std
 201.119 - {
 201.120 ---- gcc/libstdc++-v3/config/locale/uclibc/time_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
 201.121 -+++ gcc/libstdc++-v3/config/locale/uclibc/time_members.cc	2006-03-10 15:32:37 +0100
 201.122 -@@ -40,9 +40,6 @@
 201.123 - #ifdef __UCLIBC_MJN3_ONLY__
 201.124 - #warning tailor for stub locale support
 201.125 - #endif
 201.126 --#ifndef __UCLIBC_HAS_XLOCALE__
 201.127 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 201.128 --#endif
 201.129 - 
 201.130 - namespace std
 201.131 - {
 201.132 ---- gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
 201.133 -+++ gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2006-03-10 15:32:37 +0100
 201.134 -@@ -38,13 +38,6 @@
 201.135 - #undef _LIBC
 201.136 - #include <bits/c++locale_internal.h>
 201.137 - 
 201.138 --#ifndef __UCLIBC_HAS_XLOCALE__
 201.139 --#define __wctype_l(S, L)           wctype((S))
 201.140 --#define __towupper_l(C, L)         towupper((C))
 201.141 --#define __towlower_l(C, L)         towlower((C))
 201.142 --#define __iswctype_l(C, M, L)      iswctype((C), (M))
 201.143 --#endif
 201.144 --
 201.145 - namespace std
 201.146 - {
 201.147 -   // NB: The other ctype<char> specializations are in src/locale.cc and
 201.148 ---- gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc.uclibc200no__x~	2006-03-10 15:06:17 +0100
 201.149 -+++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc	2006-03-10 15:32:37 +0100
 201.150 -@@ -39,13 +39,10 @@
 201.151 - #ifdef __UCLIBC_MJN3_ONLY__
 201.152 - #warning fix gettext stuff
 201.153 - #endif
 201.154 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 201.155 --extern "C" char *__dcgettext(const char *domainname,
 201.156 --			     const char *msgid, int category);
 201.157 - #undef gettext
 201.158 --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 201.159 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 201.160 -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 201.161 - #else
 201.162 --#undef gettext
 201.163 - #define gettext(msgid) (msgid)
 201.164 - #endif
 201.165 - 
 201.166 ---- gcc/libstdc++-v3/config/locale/uclibc/messages_members.h.uclibc200no__x~	2006-03-10 15:06:17 +0100
 201.167 -+++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.h	2006-03-10 15:32:37 +0100
 201.168 -@@ -36,15 +36,11 @@
 201.169 - #ifdef __UCLIBC_MJN3_ONLY__
 201.170 - #warning fix prototypes for *textdomain funcs
 201.171 - #endif
 201.172 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 201.173 --extern "C" char *__textdomain(const char *domainname);
 201.174 --extern "C" char *__bindtextdomain(const char *domainname,
 201.175 --				  const char *dirname);
 201.176 --#else
 201.177 --#undef __textdomain
 201.178 --#undef __bindtextdomain
 201.179 --#define __textdomain(D)           ((void)0)
 201.180 --#define __bindtextdomain(D,P)     ((void)0)
 201.181 -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 201.182 -+#undef textdomain
 201.183 -+#undef bindtextdomain
 201.184 -+#define textdomain(D)           ((void)0)
 201.185 -+#define bindtextdomain(D,P)     ((void)0)
 201.186 - #endif
 201.187 - 
 201.188 -   // Non-virtual member functions.
 201.189 -@@ -70,7 +66,7 @@
 201.190 -     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 201.191 - 			   const char* __dir) const
 201.192 -     { 
 201.193 --      __bindtextdomain(__s.c_str(), __dir);
 201.194 -+      bindtextdomain(__s.c_str(), __dir);
 201.195 -       return this->do_open(__s, __loc); 
 201.196 -     }
 201.197 - 
 201.198 -@@ -90,7 +86,7 @@
 201.199 -     { 
 201.200 -       // No error checking is done, assume the catalog exists and can
 201.201 -       // be used.
 201.202 --      __textdomain(__s.c_str());
 201.203 -+      textdomain(__s.c_str());
 201.204 -       return 0;
 201.205 -     }
 201.206 - 
 201.207 ---- gcc/libstdc++-v3/config/locale/uclibc/c_locale.h.uclibc200no__x~	2006-03-10 15:06:17 +0100
 201.208 -+++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.h	2006-03-10 15:32:37 +0100
 201.209 -@@ -68,6 +68,7 @@
 201.210 - {
 201.211 -   extern "C" __typeof(uselocale) __uselocale;
 201.212 - }
 201.213 -+#define __uselocale uselocale
 201.214 - #endif
 201.215 - 
 201.216 - namespace std
   202.1 --- a/patches/gcc/4.2.0/204-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:08:01 2008 +0000
   202.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   202.3 @@ -1,48 +0,0 @@
   202.4 ---- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200_wchar~	2006-03-10 15:32:37 +0100
   202.5 -+++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2006-03-10 15:37:27 +0100
   202.6 -@@ -401,7 +401,7 @@
   202.7 - # ifdef __UCLIBC_HAS_XLOCALE__
   202.8 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
   202.9 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  202.10 --# else
  202.11 -+# elif defined __UCLIBC_HAS_LOCALE__
  202.12 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  202.13 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  202.14 - # endif
  202.15 -@@ -556,7 +556,7 @@
  202.16 - # ifdef __UCLIBC_HAS_XLOCALE__
  202.17 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  202.18 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  202.19 --# else
  202.20 -+# elif defined __UCLIBC_HAS_LOCALE__
  202.21 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  202.22 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  202.23 - # endif
  202.24 ---- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200_wchar~	2006-03-10 15:32:37 +0100
  202.25 -+++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2006-03-10 15:37:27 +0100
  202.26 -@@ -127,12 +127,25 @@
  202.27 - 	{
  202.28 - 	  // Named locale.
  202.29 - 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  202.30 -+#ifdef __UCLIBC_MJN3_ONLY__
  202.31 -+#warning fix this... should be numeric
  202.32 -+#endif
  202.33 -+#ifdef __UCLIBC__
  202.34 -+# ifdef __UCLIBC_HAS_XLOCALE__
  202.35 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  202.36 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  202.37 -+# elif defined __UCLIBC_HAS_LOCALE__
  202.38 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  202.39 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  202.40 -+# endif
  202.41 -+#else
  202.42 - 	  union { char *__s; wchar_t __w; } __u;
  202.43 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  202.44 - 	  _M_data->_M_decimal_point = __u.__w;
  202.45 - 
  202.46 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  202.47 - 	  _M_data->_M_thousands_sep = __u.__w;
  202.48 -+#endif
  202.49 - 
  202.50 - 	  if (_M_data->_M_thousands_sep == L'\0')
  202.51 - 	    _M_data->_M_grouping = "";
   203.1 --- a/patches/gcc/4.2.0/205-uclibc-locale-update.patch	Mon Jul 28 21:08:01 2008 +0000
   203.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   203.3 @@ -1,347 +0,0 @@
   203.4 ---- gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc.uclibc200_update~	2006-03-10 15:32:37 +0100
   203.5 -+++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc	2006-03-10 15:39:14 +0100
   203.6 -@@ -46,16 +47,13 @@
   203.7 -     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   203.8 - 		   const __c_locale& __cloc)
   203.9 -     {
  203.10 --      if (!(__err & ios_base::failbit))
  203.11 --	{
  203.12 --	  char* __sanity;
  203.13 --	  errno = 0;
  203.14 --	  float __f = __strtof_l(__s, &__sanity, __cloc);
  203.15 --          if (__sanity != __s && errno != ERANGE)
  203.16 --	    __v = __f;
  203.17 --	  else
  203.18 --	    __err |= ios_base::failbit;
  203.19 --	}
  203.20 -+      char* __sanity;
  203.21 -+      errno = 0;
  203.22 -+      float __f = __strtof_l(__s, &__sanity, __cloc);
  203.23 -+      if (__sanity != __s && errno != ERANGE)
  203.24 -+	__v = __f;
  203.25 -+      else
  203.26 -+	__err |= ios_base::failbit;
  203.27 -     }
  203.28 - 
  203.29 -   template<>
  203.30 -@@ -63,16 +61,13 @@
  203.31 -     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  203.32 - 		   const __c_locale& __cloc)
  203.33 -     {
  203.34 --      if (!(__err & ios_base::failbit))
  203.35 --	{
  203.36 --	  char* __sanity;
  203.37 --	  errno = 0;
  203.38 --	  double __d = __strtod_l(__s, &__sanity, __cloc);
  203.39 --          if (__sanity != __s && errno != ERANGE)
  203.40 --	    __v = __d;
  203.41 --	  else
  203.42 --	    __err |= ios_base::failbit;
  203.43 --	}
  203.44 -+      char* __sanity;
  203.45 -+      errno = 0;
  203.46 -+      double __d = __strtod_l(__s, &__sanity, __cloc);
  203.47 -+      if (__sanity != __s && errno != ERANGE)
  203.48 -+	__v = __d;
  203.49 -+      else
  203.50 -+	__err |= ios_base::failbit;
  203.51 -     }
  203.52 - 
  203.53 -   template<>
  203.54 -@@ -80,16 +75,13 @@
  203.55 -     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  203.56 - 		   const __c_locale& __cloc)
  203.57 -     {
  203.58 --      if (!(__err & ios_base::failbit))
  203.59 --	{
  203.60 --	  char* __sanity;
  203.61 --	  errno = 0;
  203.62 --	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  203.63 --          if (__sanity != __s && errno != ERANGE)
  203.64 --	    __v = __ld;
  203.65 --	  else
  203.66 --	    __err |= ios_base::failbit;
  203.67 --	}
  203.68 -+      char* __sanity;
  203.69 -+      errno = 0;
  203.70 -+      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  203.71 -+      if (__sanity != __s && errno != ERANGE)
  203.72 -+	__v = __ld;
  203.73 -+      else
  203.74 -+	__err |= ios_base::failbit;
  203.75 -     }
  203.76 - 
  203.77 -   void
  203.78 -@@ -110,7 +102,7 @@
  203.79 -   void
  203.80 -   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  203.81 -   {
  203.82 --    if (_S_get_c_locale() != __cloc)
  203.83 -+    if (__cloc && _S_get_c_locale() != __cloc)
  203.84 -       __freelocale(__cloc); 
  203.85 -   }
  203.86 - 
  203.87 ---- gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc.uclibc200_update~	2006-03-10 15:32:37 +0100
  203.88 -+++ gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2006-03-10 15:39:14 +0100
  203.89 -@@ -33,9 +33,14 @@
  203.90 - 
  203.91 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  203.92 - 
  203.93 -+#include <features.h>
  203.94 -+#ifdef __UCLIBC_HAS_LOCALE__
  203.95 - #define _LIBC
  203.96 - #include <locale>
  203.97 - #undef _LIBC
  203.98 -+#else
  203.99 -+#include <locale>
 203.100 -+#endif
 203.101 - #include <bits/c++locale_internal.h>
 203.102 - 
 203.103 - namespace std
 203.104 -@@ -138,20 +143,34 @@
 203.105 -   ctype<wchar_t>::
 203.106 -   do_is(mask __m, wchar_t __c) const
 203.107 -   { 
 203.108 --    // Highest bitmask in ctype_base == 10, but extra in "C"
 203.109 --    // library for blank.
 203.110 -+    // The case of __m == ctype_base::space is particularly important,
 203.111 -+    // due to its use in many istream functions.  Therefore we deal with
 203.112 -+    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 203.113 -+    // is the mask corresponding to ctype_base::space.  NB: an encoding
 203.114 -+    // change would not affect correctness!
 203.115 -     bool __ret = false;
 203.116 --    const size_t __bitmasksize = 11; 
 203.117 --    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 203.118 --      if (__m & _M_bit[__bitcur]
 203.119 --	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 203.120 --	{
 203.121 --	  __ret = true;
 203.122 --	  break;
 203.123 --	}
 203.124 -+    if (__m == _M_bit[5])
 203.125 -+      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 203.126 -+    else
 203.127 -+      {
 203.128 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 203.129 -+	// library for blank.
 203.130 -+	const size_t __bitmasksize = 11;
 203.131 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 203.132 -+	  if (__m & _M_bit[__bitcur])
 203.133 -+	    {
 203.134 -+	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 203.135 -+		{
 203.136 -+		  __ret = true;
 203.137 -+		  break;
 203.138 -+		}
 203.139 -+	      else if (__m == _M_bit[__bitcur])
 203.140 -+		break;
 203.141 -+	    }
 203.142 -+      }
 203.143 -     return __ret;    
 203.144 -   }
 203.145 --  
 203.146 -+
 203.147 -   const wchar_t* 
 203.148 -   ctype<wchar_t>::
 203.149 -   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 203.150 ---- gcc/libstdc++-v3/config/locale/uclibc/messages_members.h.uclibc200_update~	2006-03-10 15:32:37 +0100
 203.151 -+++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.h	2006-03-10 15:39:14 +0100
 203.152 -@@ -47,18 +47,21 @@
 203.153 -   template<typename _CharT>
 203.154 -      messages<_CharT>::messages(size_t __refs)
 203.155 -      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 203.156 --     _M_name_messages(_S_get_c_name())
 203.157 -+       _M_name_messages(_S_get_c_name())
 203.158 -      { }
 203.159 - 
 203.160 -   template<typename _CharT>
 203.161 -      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 203.162 - 				size_t __refs) 
 203.163 --     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 203.164 --     _M_name_messages(__s)
 203.165 -+     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 203.166 -      {
 203.167 --       char* __tmp = new char[std::strlen(__s) + 1];
 203.168 --       std::strcpy(__tmp, __s);
 203.169 -+       const size_t __len = std::strlen(__s) + 1;
 203.170 -+       char* __tmp = new char[__len];
 203.171 -+       std::memcpy(__tmp, __s, __len);
 203.172 -        _M_name_messages = __tmp;
 203.173 -+
 203.174 -+       // Last to avoid leaking memory if new throws.
 203.175 -+       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 203.176 -      }
 203.177 - 
 203.178 -   template<typename _CharT>
 203.179 ---- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200_update~	2006-03-10 15:37:27 +0100
 203.180 -+++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2006-03-10 15:39:14 +0100
 203.181 -@@ -33,9 +33,14 @@
 203.182 - 
 203.183 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 203.184 - 
 203.185 -+#include <features.h>
 203.186 -+#ifdef __UCLIBC_HAS_LOCALE__
 203.187 - #define _LIBC
 203.188 - #include <locale>
 203.189 - #undef _LIBC
 203.190 -+#else
 203.191 -+#include <locale>
 203.192 -+#endif
 203.193 - #include <bits/c++locale_internal.h>
 203.194 - 
 203.195 - #ifdef __UCLIBC_MJN3_ONLY__
 203.196 -@@ -206,7 +211,7 @@
 203.197 - 	  }
 203.198 - 	break;
 203.199 -       default:
 203.200 --	;
 203.201 -+	__ret = pattern();
 203.202 -       }
 203.203 -     return __ret;
 203.204 -   }
 203.205 ---- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200_update~	2006-03-10 15:37:27 +0100
 203.206 -+++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2006-03-10 15:39:14 +0100
 203.207 -@@ -33,9 +33,14 @@
 203.208 - 
 203.209 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 203.210 - 
 203.211 -+#include <features.h>
 203.212 -+#ifdef __UCLIBC_HAS_LOCALE__
 203.213 - #define _LIBC
 203.214 - #include <locale>
 203.215 - #undef _LIBC
 203.216 -+#else
 203.217 -+#include <locale>
 203.218 -+#endif
 203.219 - #include <bits/c++locale_internal.h>
 203.220 - 
 203.221 - #ifdef __UCLIBC_MJN3_ONLY__
 203.222 ---- gcc/libstdc++-v3/config/locale/uclibc/time_members.h.uclibc200_update~	2006-03-10 15:06:17 +0100
 203.223 -+++ gcc/libstdc++-v3/config/locale/uclibc/time_members.h	2006-03-10 15:39:14 +0100
 203.224 -@@ -37,25 +37,33 @@
 203.225 -   template<typename _CharT>
 203.226 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
 203.227 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 203.228 --    _M_name_timepunct(_S_get_c_name())
 203.229 -+      _M_name_timepunct(_S_get_c_name())
 203.230 -     { _M_initialize_timepunct(); }
 203.231 - 
 203.232 -   template<typename _CharT>
 203.233 -     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 203.234 -     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 203.235 --    _M_name_timepunct(_S_get_c_name())
 203.236 -+      _M_name_timepunct(_S_get_c_name())
 203.237 -     { _M_initialize_timepunct(); }
 203.238 - 
 203.239 -   template<typename _CharT>
 203.240 -     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 203.241 - 				     size_t __refs) 
 203.242 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 203.243 --    _M_name_timepunct(__s)
 203.244 -+      _M_name_timepunct(NULL)
 203.245 -     { 
 203.246 --      char* __tmp = new char[std::strlen(__s) + 1];
 203.247 --      std::strcpy(__tmp, __s);
 203.248 -+      const size_t __len = std::strlen(__s) + 1;
 203.249 -+      char* __tmp = new char[__len];
 203.250 -+      std::memcpy(__tmp, __s, __len);
 203.251 -       _M_name_timepunct = __tmp;
 203.252 --      _M_initialize_timepunct(__cloc); 
 203.253 -+
 203.254 -+      try
 203.255 -+	{ _M_initialize_timepunct(__cloc); }
 203.256 -+      catch(...)
 203.257 -+	{
 203.258 -+	  delete [] _M_name_timepunct;
 203.259 -+	  __throw_exception_again;
 203.260 -+	}
 203.261 -     }
 203.262 - 
 203.263 -   template<typename _CharT>
 203.264 ---- gcc-4.2/libstdc++-v3/config/locale/uclibc/c_locale.h.old	2006-09-28 11:39:00.000000000 +0200
 203.265 -+++ gcc-4.2/libstdc++-v3/config/locale/uclibc/c_locale.h	2006-09-28 12:10:41.000000000 +0200
 203.266 -@@ -39,21 +39,23 @@
 203.267 - #pragma GCC system_header
 203.268 - 
 203.269 - #include <cstring>              // get std::strlen
 203.270 --#include <cstdio>               // get std::snprintf or std::sprintf
 203.271 -+#include <cstdio>               // get std::vsnprintf or std::vsprintf
 203.272 - #include <clocale>
 203.273 - #include <langinfo.h>		// For codecvt
 203.274 - #ifdef __UCLIBC_MJN3_ONLY__
 203.275 - #warning fix this
 203.276 - #endif
 203.277 --#ifdef __UCLIBC_HAS_LOCALE__
 203.278 -+#ifdef _GLIBCXX_USE_ICONV
 203.279 - #include <iconv.h>		// For codecvt using iconv, iconv_t
 203.280 - #endif
 203.281 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 203.282 --#include <libintl.h> 		// For messages
 203.283 -+#ifdef HAVE_LIBINTL_H
 203.284 -+#include <libintl.h>		// For messages
 203.285 - #endif
 203.286 -+#include <cstdarg>
 203.287 - 
 203.288 - #ifdef __UCLIBC_MJN3_ONLY__
 203.289 - #warning what is _GLIBCXX_C_LOCALE_GNU for
 203.290 -+// psm: used in os/gnu-linux/ctype_noninline.h
 203.291 - #endif
 203.292 - #define _GLIBCXX_C_LOCALE_GNU 1
 203.293 - 
 203.294 -@@ -62,7 +64,7 @@
 203.295 - #endif
 203.296 - // #define _GLIBCXX_NUM_CATEGORIES 6
 203.297 - #define _GLIBCXX_NUM_CATEGORIES 0
 203.298 -- 
 203.299 -+
 203.300 - #ifdef __UCLIBC_HAS_XLOCALE__
 203.301 - namespace __gnu_cxx
 203.302 - {
 203.303 -@@ -79,22 +81,24 @@
 203.304 -   typedef int*			__c_locale;
 203.305 - #endif
 203.306 - 
 203.307 --  // Convert numeric value of type _Tv to string and return length of
 203.308 --  // string.  If snprintf is available use it, otherwise fall back to
 203.309 --  // the unsafe sprintf which, in general, can be dangerous and should
 203.310 -+  // Convert numeric value of type double to string and return length of
 203.311 -+  // string.  If vsnprintf is available use it, otherwise fall back to
 203.312 -+  // the unsafe vsprintf which, in general, can be dangerous and should
 203.313 -   // be avoided.
 203.314 --  template<typename _Tv>
 203.315 --    int
 203.316 --    __convert_from_v(char* __out, 
 203.317 --		     const int __size __attribute__ ((__unused__)),
 203.318 --		     const char* __fmt,
 203.319 --#ifdef __UCLIBC_HAS_XCLOCALE__
 203.320 --		     _Tv __v, const __c_locale& __cloc, int __prec)
 203.321 -+    inline int
 203.322 -+    __convert_from_v(const __c_locale&
 203.323 -+#ifndef __UCLIBC_HAS_XCLOCALE__
 203.324 -+					__cloc __attribute__ ((__unused__))
 203.325 -+#endif
 203.326 -+		     ,
 203.327 -+		     char* __out,
 203.328 -+		     const int __size,
 203.329 -+		     const char* __fmt, ...)
 203.330 -     {
 203.331 -+      va_list __args;
 203.332 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 203.333 -       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 203.334 - #else
 203.335 --		     _Tv __v, const __c_locale&, int __prec)
 203.336 --    {
 203.337 - # ifdef __UCLIBC_HAS_LOCALE__
 203.338 -       char* __old = std::setlocale(LC_ALL, NULL);
 203.339 -       char* __sav = new char[std::strlen(__old) + 1];
 203.340 -@@ -103,7 +107,9 @@
 203.341 - # endif
 203.342 - #endif
 203.343 - 
 203.344 --      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 203.345 -+      va_start(__args, __fmt);
 203.346 -+      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 203.347 -+      va_end(__args);
 203.348 - 
 203.349 - #ifdef __UCLIBC_HAS_XCLOCALE__
 203.350 -       __gnu_cxx::__uselocale(__old);
   204.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   204.2 +++ b/patches/gcc/4.2.0/210-libmudflap-susv3-legacy.patch	Mon Jul 28 21:32:33 2008 +0000
   204.3 @@ -0,0 +1,49 @@
   204.4 +Index: gcc-4.2/libmudflap/mf-hooks2.c
   204.5 +===================================================================
   204.6 +--- gcc-4.2/libmudflap/mf-hooks2.c	(revision 119834)
   204.7 ++++ gcc-4.2/libmudflap/mf-hooks2.c	(working copy)
   204.8 +@@ -427,7 +427,7 @@
   204.9 + {
  204.10 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  204.11 +   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  204.12 +-  bzero (s, n);
  204.13 ++  memset (s, 0, n);
  204.14 + }
  204.15 + 
  204.16 + 
  204.17 +@@ -437,7 +437,7 @@
  204.18 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  204.19 +   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  204.20 +   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  204.21 +-  bcopy (src, dest, n);
  204.22 ++  memmove (dest, src, n);
  204.23 + }
  204.24 + 
  204.25 + 
  204.26 +@@ -447,7 +447,7 @@
  204.27 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  204.28 +   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  204.29 +   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  204.30 +-  return bcmp (s1, s2, n);
  204.31 ++  return n == 0 ? 0 : memcmp (s1, s2, n);
  204.32 + }
  204.33 + 
  204.34 + 
  204.35 +@@ -456,7 +456,7 @@
  204.36 +   size_t n = strlen (s);
  204.37 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  204.38 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  204.39 +-  return index (s, c);
  204.40 ++  return strchr (s, c);
  204.41 + }
  204.42 + 
  204.43 + 
  204.44 +@@ -465,7 +465,7 @@
  204.45 +   size_t n = strlen (s);
  204.46 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  204.47 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  204.48 +-  return rindex (s, c);
  204.49 ++  return strrchr (s, c);
  204.50 + }
  204.51 + 
  204.52 + /* XXX:  stpcpy, memccpy */
   205.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   205.2 +++ b/patches/gcc/4.2.0/220-libstdc++-namespace.patch	Mon Jul 28 21:32:33 2008 +0000
   205.3 @@ -0,0 +1,36 @@
   205.4 +diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
   205.5 +--- gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2006-12-22 13:06:56.000000000 +0100
   205.6 ++++ gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h	2006-12-22 15:23:41.000000000 +0100
   205.7 +@@ -32,7 +32,8 @@
   205.8 + //
   205.9 + 
  205.10 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  205.11 +-
  205.12 ++namespace std
  205.13 ++{
  205.14 + #ifdef __UCLIBC_MJN3_ONLY__
  205.15 + #warning fix prototypes for *textdomain funcs
  205.16 + #endif
  205.17 +@@ -115,3 +116,4 @@
  205.18 + 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  205.19 + 	 }
  205.20 +      }
  205.21 ++}
  205.22 +diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/time_members.h
  205.23 +--- gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2006-12-22 13:06:56.000000000 +0100
  205.24 ++++ gcc-4.2/libstdc++-v3/config/locale/uclibc/time_members.h	2006-12-22 15:20:31.000000000 +0100
  205.25 +@@ -33,7 +33,8 @@
  205.26 + //
  205.27 + 
  205.28 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  205.29 +-
  205.30 ++namespace std
  205.31 ++{
  205.32 +   template<typename _CharT>
  205.33 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
  205.34 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  205.35 +@@ -74,3 +75,4 @@
  205.36 +       delete _M_data; 
  205.37 +       _S_destroy_c_locale(_M_c_locale_timepunct); 
  205.38 +     }
  205.39 ++}
   206.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   206.2 +++ b/patches/gcc/4.2.0/230-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:32:33 2008 +0000
   206.3 @@ -0,0 +1,13 @@
   206.4 +Index: gcc-4.2/gcc/Makefile.in
   206.5 +===================================================================
   206.6 +--- gcc-4.2/gcc/Makefile.in	(revision 121758)
   206.7 ++++ gcc-4.2/gcc/Makefile.in	(working copy)
   206.8 +@@ -2658,7 +2658,7 @@ mips-tdump.o : mips-tdump.c $(CONFIG_H) 
   206.9 + # FIXME: writing proper dependencies for this is a *LOT* of work.
  206.10 + libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
  206.11 +   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  206.12 +-  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  206.13 ++  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  206.14 + 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  206.15 + 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  206.16 + 	  -DLOCALEDIR=\"$(localedir)\" \
   207.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   207.2 +++ b/patches/gcc/4.2.0/240-arm-bigendian.patch	Mon Jul 28 21:32:33 2008 +0000
   207.3 @@ -0,0 +1,67 @@
   207.4 +By Lennert Buytenhek <buytenh@wantstofly.org>
   207.5 +Adds support for arm*b-linux* big-endian ARM targets
   207.6 +
   207.7 +See http://gcc.gnu.org/PR16350
   207.8 +
   207.9 +--- gcc-4.2.0/gcc/config/arm/linux-elf.h
  207.10 ++++ gcc-4.2.0/gcc/config/arm/linux-elf.h
  207.11 +@@ -28,19 +28,33 @@
  207.12 + #undef  TARGET_VERSION
  207.13 + #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  207.14 + 
  207.15 ++/*
  207.16 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  207.17 ++ * (big endian) configurations.
  207.18 ++ */
  207.19 ++#if TARGET_BIG_ENDIAN_DEFAULT
  207.20 ++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  207.21 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
  207.22 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
  207.23 ++#else
  207.24 ++#define TARGET_ENDIAN_DEFAULT 0
  207.25 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
  207.26 ++#define TARGET_LINKER_EMULATION "armelf_linux"
  207.27 ++#endif
  207.28 ++
  207.29 + #undef  TARGET_DEFAULT_FLOAT_ABI
  207.30 + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  207.31 + 
  207.32 + #undef  TARGET_DEFAULT
  207.33 +-#define TARGET_DEFAULT (0)
  207.34 ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  207.35 + 
  207.36 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  207.37 + 
  207.38 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  207.39 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  207.40 + 
  207.41 + #undef  MULTILIB_DEFAULTS
  207.42 + #define MULTILIB_DEFAULTS \
  207.43 +-	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  207.44 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  207.45 + 
  207.46 + /* Now we define the strings used to build the spec file.  */
  207.47 + #undef  LIB_SPEC
  207.48 +@@ -61,7 +75,7 @@
  207.49 +    %{rdynamic:-export-dynamic} \
  207.50 +    %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
  207.51 +    -X \
  207.52 +-   %{mbig-endian:-EB}" \
  207.53 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  207.54 +    SUBTARGET_EXTRA_LINK_SPEC
  207.55 + 
  207.56 + #undef  LINK_SPEC
  207.57 +--- gcc-4.2.0/gcc/config.gcc.orig	2006-09-22 14:53:41.000000000 +0200
  207.58 ++++ gcc-4.2.0/gcc/config.gcc	2006-09-25 10:45:21.000000000 +0200
  207.59 +@@ -696,6 +696,11 @@
  207.60 + 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  207.61 + 	tmake_file="${tmake_file} t-linux arm/t-arm"
  207.62 + 	case ${target} in
  207.63 ++	arm*b-*)
  207.64 ++		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  207.65 ++		;;
  207.66 ++	esac
  207.67 ++	case ${target} in
  207.68 + 	arm*-*-linux-*eabi)
  207.69 + 	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
  207.70 + 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
   208.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   208.2 +++ b/patches/gcc/4.2.0/250-softfloat-fix.patch	Mon Jul 28 21:32:33 2008 +0000
   208.3 @@ -0,0 +1,58 @@
   208.4 +This patch (C) 2007 Yann E. MORIN
   208.5 +Licensed under GPL v2.
   208.6 +
   208.7 +First hunk of this patch solves compiling uClibc:
   208.8 +
   208.9 +make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  208.10 +  LD libuClibc-0.9.29.so
  208.11 +libc/libc_so.a(difftime.os): In function `difftime':
  208.12 +difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  208.13 +difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  208.14 +libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  208.15 +_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  208.16 +_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  208.17 +_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  208.18 +_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  208.19 +_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  208.20 +_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  208.21 +_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  208.22 +libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  208.23 +__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  208.24 +libc/libc_so.a(strtof.os): In function `strtof':
  208.25 +strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  208.26 +/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  208.27 +In function `__fixunsdfsi':
  208.28 +libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  208.29 +make[2]: *** [lib/libc.so] Error 1
  208.30 +make[1]: *** [lib/libc.so.0] Error 2
  208.31 +make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  208.32 +make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  208.33 +Error 2
  208.34 +
  208.35 +The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  208.36 +
  208.37 +
  208.38 +diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
  208.39 +--- gcc-4.2.0.orig/gcc/config.gcc	2007-07-15 11:24:18.000000000 +0200
  208.40 ++++ gcc-4.2.0/gcc/config.gcc	2007-07-15 11:26:02.000000000 +0200
  208.41 +@@ -721,7 +721,7 @@
  208.42 + 	    default_use_cxa_atexit=yes
  208.43 + 	    ;;
  208.44 + 	*)
  208.45 +-	    tmake_file="$tmake_file arm/t-linux"
  208.46 ++	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  208.47 + 	    ;;
  208.48 + 	esac
  208.49 + 	tm_file="$tm_file arm/aout.h arm/arm.h"
  208.50 +diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
  208.51 +--- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h	2007-07-15 11:24:18.000000000 +0200
  208.52 ++++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2007-07-15 11:26:02.000000000 +0200
  208.53 +@@ -63,7 +63,7 @@
  208.54 +    %{shared:-lc} \
  208.55 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  208.56 + 
  208.57 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  208.58 ++#define LIBGCC_SPEC "-lgcc"
  208.59 + 
  208.60 + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  208.61 + 
   209.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   209.2 +++ b/patches/gcc/4.2.0/260-flatten-switch-stmt-00.patch	Mon Jul 28 21:32:33 2008 +0000
   209.3 @@ -0,0 +1,153 @@
   209.4 +Hi,
   209.5 +
   209.6 +The attached patch makes sure that we create smaller object code for
   209.7 +simple switch statements. We just make sure to flatten the switch
   209.8 +statement into an if-else chain, basically.
   209.9 +
  209.10 +This fixes a size-regression as compared to gcc-3.4, as can be seen
  209.11 +below.
  209.12 +
  209.13 +2007-04-15  Bernhard Fischer  <..>
  209.14 +
  209.15 +	* stmt.c (expand_case): Do not create a complex binary tree when
  209.16 +	optimizing for size but rather use the simple ordered list.
  209.17 +	(emit_case_nodes): do not emit jumps to the default_label when
  209.18 +	optimizing for size.
  209.19 +
  209.20 +Not regtested so far.
  209.21 +Comments?
  209.22 +
  209.23 +Attached is the test switch.c mentioned below.
  209.24 +
  209.25 +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  209.26 +gcc-$i  -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
  209.27 +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  209.28 +gcc-$i  -UCHAIN -Os -o switch-$i.o -c switch.c ;done
  209.29 +
  209.30 +$ size switch-*.o
  209.31 +   text	   data	    bss	    dec	    hex	filename
  209.32 +    169	      0	      0	    169	     a9	switch-2.95.o
  209.33 +    115	      0	      0	    115	     73	switch-3.3.o
  209.34 +    103	      0	      0	    103	     67	switch-3.4.o
  209.35 +    124	      0	      0	    124	     7c	switch-4.0.o
  209.36 +    124	      0	      0	    124	     7c	switch-4.1.o
  209.37 +    124	      0	      0	    124	     7c	switch-4.2.orig-HEAD.o
  209.38 +     95	      0	      0	     95	     5f	switch-4.3-HEAD.o
  209.39 +    124	      0	      0	    124	     7c	switch-4.3.orig-HEAD.o
  209.40 +    166	      0	      0	    166	     a6	switch-CHAIN-2.95.o
  209.41 +    111	      0	      0	    111	     6f	switch-CHAIN-3.3.o
  209.42 +     95	      0	      0	     95	     5f	switch-CHAIN-3.4.o
  209.43 +     95	      0	      0	     95	     5f	switch-CHAIN-4.0.o
  209.44 +     95	      0	      0	     95	     5f	switch-CHAIN-4.1.o
  209.45 +     95	      0	      0	     95	     5f	switch-CHAIN-4.2.orig-HEAD.o
  209.46 +     95	      0	      0	     95	     5f	switch-CHAIN-4.3-HEAD.o
  209.47 +     95	      0	      0	     95	     5f	switch-CHAIN-4.3.orig-HEAD.o
  209.48 +
  209.49 +
  209.50 +Content-Type: text/x-diff; charset=us-ascii
  209.51 +Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
  209.52 +
  209.53 +Index: gcc-4.2.0/gcc/stmt.c
  209.54 +===================================================================
  209.55 +--- gcc-4.2.0.orig/gcc/stmt.c	(revision 123843)
  209.56 ++++ gcc-4.2.0/gcc/stmt.c	(working copy)
  209.57 +@@ -2517,7 +2517,11 @@ expand_case (tree exp)
  209.58 + 	  use_cost_table
  209.59 + 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  209.60 + 	       && estimate_case_costs (case_list));
  209.61 +-	  balance_case_nodes (&case_list, NULL);
  209.62 ++	  /* When optimizing for size, we want a straight list to avoid
  209.63 ++	     jumps as much as possible. This basically creates an if-else
  209.64 ++	     chain.  */
  209.65 ++	  if (!optimize_size)
  209.66 ++	    balance_case_nodes (&case_list, NULL);
  209.67 + 	  emit_case_nodes (index, case_list, default_label, index_type);
  209.68 + 	  emit_jump (default_label);
  209.69 + 	}
  209.70 +@@ -3075,6 +3079,7 @@ emit_case_nodes (rtx index, case_node_pt
  209.71 + 	    {
  209.72 + 	      if (!node_has_low_bound (node, index_type))
  209.73 + 		{
  209.74 ++		  if (!optimize_size) /* don't jl to the .default_label. */
  209.75 + 		  emit_cmp_and_jump_insns (index,
  209.76 + 					   convert_modes
  209.77 + 					   (mode, imode,
  209.78 +
  209.79 +
  209.80 +Content-Type: text/x-csrc; charset=us-ascii
  209.81 +Content-Disposition: attachment; filename="switch.c"
  209.82 +
  209.83 +int
  209.84 +commutative_tree_code (int code)
  209.85 +{
  209.86 +#define CASE(val, ret) case val:/* __asm__("# val="#val ",ret="#ret);*/ return ret;
  209.87 +#ifndef CHAIN
  209.88 +  switch (code)
  209.89 +    {
  209.90 +# if 1
  209.91 +  CASE(1,3)
  209.92 +  CASE(3,2)
  209.93 +  CASE(5,8)
  209.94 +  CASE(7,1)
  209.95 +  CASE(33,4)
  209.96 +  CASE(44,9)
  209.97 +  CASE(55,10)
  209.98 +  CASE(66,-1)
  209.99 +  CASE(77,99)
 209.100 +  CASE(666,0)
 209.101 +# else
 209.102 +    case 1:
 209.103 +      return 3;
 209.104 +    case 3:
 209.105 +      return 2;
 209.106 +    case 5:
 209.107 +      return 8;
 209.108 +    case 7:
 209.109 +      return 1;
 209.110 +    case 33:
 209.111 +      return 4;
 209.112 +    case 44:
 209.113 +      return 9;
 209.114 +    case 55:
 209.115 +      return 10;
 209.116 +    case 66:
 209.117 +      return -1;
 209.118 +    case 77:
 209.119 +      return 99;
 209.120 +    case 666:
 209.121 +      return 0;
 209.122 +# endif
 209.123 +    default:
 209.124 +      break;
 209.125 +    }
 209.126 +  return 4711;
 209.127 +
 209.128 +#else
 209.129 +   if (code == 1)
 209.130 +	return 3;
 209.131 +  else if (code == 3)
 209.132 +	return 2;
 209.133 +  else if (code == 5)
 209.134 +	return 8;
 209.135 +  else if (code == 7)
 209.136 +	return 1;
 209.137 +  else if (code == 33)
 209.138 +	return 4;
 209.139 +  else if (code == 44)
 209.140 +	return 9;
 209.141 +  else if (code == 55)
 209.142 +	return 10;
 209.143 +  else if (code == 66)
 209.144 +	return -1;
 209.145 +  else if (code == 77)
 209.146 +	return 99;
 209.147 +  else if (code == 666)
 209.148 +	return 0;
 209.149 +  else
 209.150 +	return 4711;
 209.151 +#endif
 209.152 +}
 209.153 +
 209.154 +
 209.155 +--AhhlLboLdkugWU4S--
 209.156 +
   210.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   210.2 +++ b/patches/gcc/4.2.0/270-soft-float.patch	Mon Jul 28 21:32:33 2008 +0000
   210.3 @@ -0,0 +1,21 @@
   210.4 +diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
   210.5 +--- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c	2007-03-05 11:54:00.000000000 -0500
   210.6 ++++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c	2008-01-31 17:51:24.000000000 -0500
   210.7 +@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
   210.8 +    but GCC currently generates poor code when a union is used to turn
   210.9 +    a long double into a pair of doubles.  */
  210.10 + 
  210.11 ++#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  210.12 ++
  210.13 + long double __gcc_qadd (double, double, double, double);
  210.14 + long double __gcc_qsub (double, double, double, double);
  210.15 + long double __gcc_qmul (double, double, double, double);
  210.16 +@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
  210.17 +   return z.ldval;
  210.18 + }
  210.19 + 
  210.20 +-#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  210.21 +-
  210.22 + long double __gcc_qneg (double, double);
  210.23 + int __gcc_qeq (double, double, double, double);
  210.24 + int __gcc_qne (double, double, double, double);
   211.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   211.2 +++ b/patches/gcc/4.2.0/280-alpha-signal_h.patch	Mon Jul 28 21:32:33 2008 +0000
   211.3 @@ -0,0 +1,17 @@
   211.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   211.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   211.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   211.7 + /* Do code reading to identify a signal frame, and set the frame
   211.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
   211.9 + 
  211.10 ++/* Don't use this if inhibit_libc is set
  211.11 ++   The build for this target will fail trying to include missing headers */
  211.12 ++#ifndef inhibit_libc
  211.13 + #include <signal.h>
  211.14 + #include <sys/ucontext.h>
  211.15 + 
  211.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  211.17 +   fs->retaddr_column = 64;
  211.18 +   return _URC_NO_REASON;
  211.19 + }
  211.20 ++#endif /* inhibit_libc */
   212.1 --- a/patches/gcc/4.2.0/300-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   212.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   212.3 @@ -1,50 +0,0 @@
   212.4 -# DP: Build and install libstdc++_pic.a library.
   212.5 -
   212.6 ---- gcc/libstdc++-v3/src/Makefile.am
   212.7 -+++ gcc/libstdc++-v3/src/Makefile.am
   212.8 -@@ -214,6 +214,12 @@
   212.9 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
  212.10 - 
  212.11 - 
  212.12 -+install-exec-local:
  212.13 -+ifeq ($(enable_shared),yes)
  212.14 -+	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  212.15 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  212.16 -+endif
  212.17 -+
  212.18 - # Added bits to build debug library.
  212.19 - if GLIBCXX_BUILD_DEBUG
  212.20 - all-local: build_debug
  212.21 ---- gcc/libstdc++-v3/src/Makefile.in
  212.22 -+++ gcc/libstdc++-v3/src/Makefile.in
  212.23 -@@ -627,7 +627,7 @@
  212.24 - 
  212.25 - install-data-am: install-data-local
  212.26 - 
  212.27 --install-exec-am: install-toolexeclibLTLIBRARIES
  212.28 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  212.29 - 
  212.30 - install-info: install-info-am
  212.31 - 
  212.32 -@@ -660,6 +660,7 @@
  212.33 - 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  212.34 - 	html-am info info-am install install-am install-data \
  212.35 - 	install-data-am install-data-local install-exec \
  212.36 -+	install-exec-local \
  212.37 - 	install-exec-am install-info install-info-am install-man \
  212.38 - 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  212.39 - 	installcheck-am installdirs maintainer-clean \
  212.40 -@@ -743,6 +743,13 @@
  212.41 - install_debug:
  212.42 - 	(cd ${debugdir} && $(MAKE) \
  212.43 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  212.44 -+
  212.45 -+install-exec-local:
  212.46 -+ifeq ($(enable_shared),yes)
  212.47 -+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  212.48 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  212.49 -+endif
  212.50 -+
  212.51 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  212.52 - # Otherwise a system limit (for SysV at least) may be exceeded.
  212.53 - .NOEXPORT:
   213.1 --- a/patches/gcc/4.2.0/301-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   213.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   213.3 @@ -1,11 +0,0 @@
   213.4 ---- gcc-4.0.0/boehm-gc/include/gc.h-orig	2005-04-28 22:28:57.000000000 -0500
   213.5 -+++ gcc-4.0.0/boehm-gc/include/gc.h	2005-04-28 22:30:38.000000000 -0500
   213.6 -@@ -500,7 +500,7 @@
   213.7 - #ifdef __linux__
   213.8 - # include <features.h>
   213.9 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  213.10 --     && !defined(__ia64__)
  213.11 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  213.12 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  213.13 - #     define GC_HAVE_BUILTIN_BACKTRACE
  213.14 - #   endif
   214.1 --- a/patches/gcc/4.2.0/302-c99-snprintf.patch	Mon Jul 28 21:08:01 2008 +0000
   214.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   214.3 @@ -1,11 +0,0 @@
   214.4 ---- gcc-4.2.0.orig/libstdc++-v3/include/c_std/std_cstdio.h	2006-12-07 10:33:51.000000000 +0100
   214.5 -+++ gcc-4.2.0/libstdc++-v3/include/c_std/std_cstdio.h	2007-05-20 01:05:38.000000000 +0200
   214.6 -@@ -144,7 +144,7 @@
   214.7 - 
   214.8 - _GLIBCXX_END_NAMESPACE
   214.9 - 
  214.10 --#if _GLIBCXX_USE_C99
  214.11 -+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  214.12 - 
  214.13 - #undef snprintf
  214.14 - #undef vfscanf
   215.1 --- a/patches/gcc/4.2.0/303-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   215.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   215.3 @@ -1,12 +0,0 @@
   215.4 ---- gcc-4.0.0/libstdc++-v3/configure-old	2005-04-30 22:04:48.061603912 -0500
   215.5 -+++ gcc-4.0.0/libstdc++-v3/configure	2005-04-30 22:06:13.678588152 -0500
   215.6 -@@ -7194,6 +7194,9 @@
   215.7 - cat >>conftest.$ac_ext <<_ACEOF
   215.8 - /* end confdefs.h.  */
   215.9 - #include <complex.h>
  215.10 -+#ifdef __UCLIBC__
  215.11 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  215.12 -+#endif
  215.13 - int
  215.14 - main ()
  215.15 - {
   216.1 --- a/patches/gcc/4.2.0/304-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   216.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   216.3 @@ -1,24 +0,0 @@
   216.4 ---- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps	2006-03-24 01:49:51 +0100
   216.5 -+++ gcc-4.1.0/libstdc++-v3/include/ext/rope	2006-03-24 01:49:37 +0100
   216.6 -@@ -59,6 +59,9 @@
   216.7 - #include <bits/allocator.h>
   216.8 - #include <ext/hash_fun.h>
   216.9 - 
  216.10 -+/* cope w/ index defined as macro, SuSv3 proposal */
  216.11 -+#undef index
  216.12 -+
  216.13 - # ifdef __GC
  216.14 - #   define __GC_CONST const
  216.15 - # else
  216.16 ---- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps	2006-03-24 01:50:04 +0100
  216.17 -+++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h	2006-03-24 01:50:28 +0100
  216.18 -@@ -53,6 +53,9 @@
  216.19 - #include <ext/memory> // For uninitialized_copy_n
  216.20 - #include <ext/numeric> // For power
  216.21 - 
  216.22 -+/* cope w/ index defined as macro, SuSv3 proposal */
  216.23 -+#undef index
  216.24 -+
  216.25 - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  216.26 -
  216.27 -   using std::size_t;
   217.1 --- a/patches/gcc/4.2.0/305-libmudflap-susv3-legacy.patch	Mon Jul 28 21:08:01 2008 +0000
   217.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   217.3 @@ -1,49 +0,0 @@
   217.4 -Index: gcc-4.2/libmudflap/mf-hooks2.c
   217.5 -===================================================================
   217.6 ---- gcc-4.2/libmudflap/mf-hooks2.c	(revision 119834)
   217.7 -+++ gcc-4.2/libmudflap/mf-hooks2.c	(working copy)
   217.8 -@@ -427,7 +427,7 @@
   217.9 - {
  217.10 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  217.11 -   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  217.12 --  bzero (s, n);
  217.13 -+  memset (s, 0, n);
  217.14 - }
  217.15 - 
  217.16 - 
  217.17 -@@ -437,7 +437,7 @@
  217.18 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  217.19 -   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  217.20 -   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  217.21 --  bcopy (src, dest, n);
  217.22 -+  memmove (dest, src, n);
  217.23 - }
  217.24 - 
  217.25 - 
  217.26 -@@ -447,7 +447,7 @@
  217.27 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  217.28 -   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  217.29 -   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  217.30 --  return bcmp (s1, s2, n);
  217.31 -+  return n == 0 ? 0 : memcmp (s1, s2, n);
  217.32 - }
  217.33 - 
  217.34 - 
  217.35 -@@ -456,7 +456,7 @@
  217.36 -   size_t n = strlen (s);
  217.37 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  217.38 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  217.39 --  return index (s, c);
  217.40 -+  return strchr (s, c);
  217.41 - }
  217.42 - 
  217.43 - 
  217.44 -@@ -465,7 +465,7 @@
  217.45 -   size_t n = strlen (s);
  217.46 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  217.47 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  217.48 --  return rindex (s, c);
  217.49 -+  return strrchr (s, c);
  217.50 - }
  217.51 - 
  217.52 - /* XXX:  stpcpy, memccpy */
   218.1 --- a/patches/gcc/4.2.0/306-libstdc++-namespace.patch	Mon Jul 28 21:08:01 2008 +0000
   218.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   218.3 @@ -1,36 +0,0 @@
   218.4 -diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
   218.5 ---- gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2006-12-22 13:06:56.000000000 +0100
   218.6 -+++ gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h	2006-12-22 15:23:41.000000000 +0100
   218.7 -@@ -32,7 +32,8 @@
   218.8 - //
   218.9 - 
  218.10 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  218.11 --
  218.12 -+namespace std
  218.13 -+{
  218.14 - #ifdef __UCLIBC_MJN3_ONLY__
  218.15 - #warning fix prototypes for *textdomain funcs
  218.16 - #endif
  218.17 -@@ -115,3 +116,4 @@
  218.18 - 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  218.19 - 	 }
  218.20 -      }
  218.21 -+}
  218.22 -diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/time_members.h
  218.23 ---- gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2006-12-22 13:06:56.000000000 +0100
  218.24 -+++ gcc-4.2/libstdc++-v3/config/locale/uclibc/time_members.h	2006-12-22 15:20:31.000000000 +0100
  218.25 -@@ -33,7 +33,8 @@
  218.26 - //
  218.27 - 
  218.28 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  218.29 --
  218.30 -+namespace std
  218.31 -+{
  218.32 -   template<typename _CharT>
  218.33 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
  218.34 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  218.35 -@@ -74,3 +75,4 @@
  218.36 -       delete _M_data; 
  218.37 -       _S_destroy_c_locale(_M_c_locale_timepunct); 
  218.38 -     }
  218.39 -+}
   219.1 --- a/patches/gcc/4.2.0/402-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:08:01 2008 +0000
   219.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   219.3 @@ -1,13 +0,0 @@
   219.4 -Index: gcc-4.2/gcc/Makefile.in
   219.5 -===================================================================
   219.6 ---- gcc-4.2/gcc/Makefile.in	(revision 121758)
   219.7 -+++ gcc-4.2/gcc/Makefile.in	(working copy)
   219.8 -@@ -2658,7 +2658,7 @@ mips-tdump.o : mips-tdump.c $(CONFIG_H) 
   219.9 - # FIXME: writing proper dependencies for this is a *LOT* of work.
  219.10 - libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
  219.11 -   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  219.12 --  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  219.13 -+  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  219.14 - 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  219.15 - 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  219.16 - 	  -DLOCALEDIR=\"$(localedir)\" \
   220.1 --- a/patches/gcc/4.2.0/800-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
   220.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   220.3 @@ -1,67 +0,0 @@
   220.4 -By Lennert Buytenhek <buytenh@wantstofly.org>
   220.5 -Adds support for arm*b-linux* big-endian ARM targets
   220.6 -
   220.7 -See http://gcc.gnu.org/PR16350
   220.8 -
   220.9 ---- gcc-4.2.0/gcc/config/arm/linux-elf.h
  220.10 -+++ gcc-4.2.0/gcc/config/arm/linux-elf.h
  220.11 -@@ -28,19 +28,33 @@
  220.12 - #undef  TARGET_VERSION
  220.13 - #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  220.14 - 
  220.15 -+/*
  220.16 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  220.17 -+ * (big endian) configurations.
  220.18 -+ */
  220.19 -+#if TARGET_BIG_ENDIAN_DEFAULT
  220.20 -+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  220.21 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
  220.22 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
  220.23 -+#else
  220.24 -+#define TARGET_ENDIAN_DEFAULT 0
  220.25 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
  220.26 -+#define TARGET_LINKER_EMULATION "armelf_linux"
  220.27 -+#endif
  220.28 -+
  220.29 - #undef  TARGET_DEFAULT_FLOAT_ABI
  220.30 - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  220.31 - 
  220.32 - #undef  TARGET_DEFAULT
  220.33 --#define TARGET_DEFAULT (0)
  220.34 -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  220.35 - 
  220.36 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  220.37 - 
  220.38 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  220.39 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  220.40 - 
  220.41 - #undef  MULTILIB_DEFAULTS
  220.42 - #define MULTILIB_DEFAULTS \
  220.43 --	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  220.44 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  220.45 - 
  220.46 - /* Now we define the strings used to build the spec file.  */
  220.47 - #undef  LIB_SPEC
  220.48 -@@ -61,7 +75,7 @@
  220.49 -    %{rdynamic:-export-dynamic} \
  220.50 -    %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
  220.51 -    -X \
  220.52 --   %{mbig-endian:-EB}" \
  220.53 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  220.54 -    SUBTARGET_EXTRA_LINK_SPEC
  220.55 - 
  220.56 - #undef  LINK_SPEC
  220.57 ---- gcc-4.2.0/gcc/config.gcc.orig	2006-09-22 14:53:41.000000000 +0200
  220.58 -+++ gcc-4.2.0/gcc/config.gcc	2006-09-25 10:45:21.000000000 +0200
  220.59 -@@ -696,6 +696,11 @@
  220.60 - 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  220.61 - 	tmake_file="${tmake_file} t-linux arm/t-arm"
  220.62 - 	case ${target} in
  220.63 -+	arm*b-*)
  220.64 -+		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  220.65 -+		;;
  220.66 -+	esac
  220.67 -+	case ${target} in
  220.68 - 	arm*-*-linux-*eabi)
  220.69 - 	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
  220.70 - 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
   221.1 --- a/patches/gcc/4.2.0/801-softfloat-fix.patch	Mon Jul 28 21:08:01 2008 +0000
   221.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   221.3 @@ -1,58 +0,0 @@
   221.4 -This patch (C) 2007 Yann E. MORIN
   221.5 -Licensed under GPL v2.
   221.6 -
   221.7 -First hunk of this patch solves compiling uClibc:
   221.8 -
   221.9 -make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  221.10 -  LD libuClibc-0.9.29.so
  221.11 -libc/libc_so.a(difftime.os): In function `difftime':
  221.12 -difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  221.13 -difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  221.14 -libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  221.15 -_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  221.16 -_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  221.17 -_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  221.18 -_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  221.19 -_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  221.20 -_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  221.21 -_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  221.22 -libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  221.23 -__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  221.24 -libc/libc_so.a(strtof.os): In function `strtof':
  221.25 -strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  221.26 -/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  221.27 -In function `__fixunsdfsi':
  221.28 -libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  221.29 -make[2]: *** [lib/libc.so] Error 1
  221.30 -make[1]: *** [lib/libc.so.0] Error 2
  221.31 -make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  221.32 -make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  221.33 -Error 2
  221.34 -
  221.35 -The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  221.36 -
  221.37 -
  221.38 -diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
  221.39 ---- gcc-4.2.0.orig/gcc/config.gcc	2007-07-15 11:24:18.000000000 +0200
  221.40 -+++ gcc-4.2.0/gcc/config.gcc	2007-07-15 11:26:02.000000000 +0200
  221.41 -@@ -721,7 +721,7 @@
  221.42 - 	    default_use_cxa_atexit=yes
  221.43 - 	    ;;
  221.44 - 	*)
  221.45 --	    tmake_file="$tmake_file arm/t-linux"
  221.46 -+	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  221.47 - 	    ;;
  221.48 - 	esac
  221.49 - 	tm_file="$tm_file arm/aout.h arm/arm.h"
  221.50 -diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
  221.51 ---- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h	2007-07-15 11:24:18.000000000 +0200
  221.52 -+++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2007-07-15 11:26:02.000000000 +0200
  221.53 -@@ -63,7 +63,7 @@
  221.54 -    %{shared:-lc} \
  221.55 -    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  221.56 - 
  221.57 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  221.58 -+#define LIBGCC_SPEC "-lgcc"
  221.59 - 
  221.60 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  221.61 - 
   222.1 --- a/patches/gcc/4.2.0/904-flatten-switch-stmt-00.patch	Mon Jul 28 21:08:01 2008 +0000
   222.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   222.3 @@ -1,153 +0,0 @@
   222.4 -Hi,
   222.5 -
   222.6 -The attached patch makes sure that we create smaller object code for
   222.7 -simple switch statements. We just make sure to flatten the switch
   222.8 -statement into an if-else chain, basically.
   222.9 -
  222.10 -This fixes a size-regression as compared to gcc-3.4, as can be seen
  222.11 -below.
  222.12 -
  222.13 -2007-04-15  Bernhard Fischer  <..>
  222.14 -
  222.15 -	* stmt.c (expand_case): Do not create a complex binary tree when
  222.16 -	optimizing for size but rather use the simple ordered list.
  222.17 -	(emit_case_nodes): do not emit jumps to the default_label when
  222.18 -	optimizing for size.
  222.19 -
  222.20 -Not regtested so far.
  222.21 -Comments?
  222.22 -
  222.23 -Attached is the test switch.c mentioned below.
  222.24 -
  222.25 -$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  222.26 -gcc-$i  -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
  222.27 -$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  222.28 -gcc-$i  -UCHAIN -Os -o switch-$i.o -c switch.c ;done
  222.29 -
  222.30 -$ size switch-*.o
  222.31 -   text	   data	    bss	    dec	    hex	filename
  222.32 -    169	      0	      0	    169	     a9	switch-2.95.o
  222.33 -    115	      0	      0	    115	     73	switch-3.3.o
  222.34 -    103	      0	      0	    103	     67	switch-3.4.o
  222.35 -    124	      0	      0	    124	     7c	switch-4.0.o
  222.36 -    124	      0	      0	    124	     7c	switch-4.1.o
  222.37 -    124	      0	      0	    124	     7c	switch-4.2.orig-HEAD.o
  222.38 -     95	      0	      0	     95	     5f	switch-4.3-HEAD.o
  222.39 -    124	      0	      0	    124	     7c	switch-4.3.orig-HEAD.o
  222.40 -    166	      0	      0	    166	     a6	switch-CHAIN-2.95.o
  222.41 -    111	      0	      0	    111	     6f	switch-CHAIN-3.3.o
  222.42 -     95	      0	      0	     95	     5f	switch-CHAIN-3.4.o
  222.43 -     95	      0	      0	     95	     5f	switch-CHAIN-4.0.o
  222.44 -     95	      0	      0	     95	     5f	switch-CHAIN-4.1.o
  222.45 -     95	      0	      0	     95	     5f	switch-CHAIN-4.2.orig-HEAD.o
  222.46 -     95	      0	      0	     95	     5f	switch-CHAIN-4.3-HEAD.o
  222.47 -     95	      0	      0	     95	     5f	switch-CHAIN-4.3.orig-HEAD.o
  222.48 -
  222.49 -
  222.50 -Content-Type: text/x-diff; charset=us-ascii
  222.51 -Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
  222.52 -
  222.53 -Index: gcc-4.2.0/gcc/stmt.c
  222.54 -===================================================================
  222.55 ---- gcc-4.2.0.orig/gcc/stmt.c	(revision 123843)
  222.56 -+++ gcc-4.2.0/gcc/stmt.c	(working copy)
  222.57 -@@ -2517,7 +2517,11 @@ expand_case (tree exp)
  222.58 - 	  use_cost_table
  222.59 - 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  222.60 - 	       && estimate_case_costs (case_list));
  222.61 --	  balance_case_nodes (&case_list, NULL);
  222.62 -+	  /* When optimizing for size, we want a straight list to avoid
  222.63 -+	     jumps as much as possible. This basically creates an if-else
  222.64 -+	     chain.  */
  222.65 -+	  if (!optimize_size)
  222.66 -+	    balance_case_nodes (&case_list, NULL);
  222.67 - 	  emit_case_nodes (index, case_list, default_label, index_type);
  222.68 - 	  emit_jump (default_label);
  222.69 - 	}
  222.70 -@@ -3075,6 +3079,7 @@ emit_case_nodes (rtx index, case_node_pt
  222.71 - 	    {
  222.72 - 	      if (!node_has_low_bound (node, index_type))
  222.73 - 		{
  222.74 -+		  if (!optimize_size) /* don't jl to the .default_label. */
  222.75 - 		  emit_cmp_and_jump_insns (index,
  222.76 - 					   convert_modes
  222.77 - 					   (mode, imode,
  222.78 -
  222.79 -
  222.80 -Content-Type: text/x-csrc; charset=us-ascii
  222.81 -Content-Disposition: attachment; filename="switch.c"
  222.82 -
  222.83 -int
  222.84 -commutative_tree_code (int code)
  222.85 -{
  222.86 -#define CASE(val, ret) case val:/* __asm__("# val="#val ",ret="#ret);*/ return ret;
  222.87 -#ifndef CHAIN
  222.88 -  switch (code)
  222.89 -    {
  222.90 -# if 1
  222.91 -  CASE(1,3)
  222.92 -  CASE(3,2)
  222.93 -  CASE(5,8)
  222.94 -  CASE(7,1)
  222.95 -  CASE(33,4)
  222.96 -  CASE(44,9)
  222.97 -  CASE(55,10)
  222.98 -  CASE(66,-1)
  222.99 -  CASE(77,99)
 222.100 -  CASE(666,0)
 222.101 -# else
 222.102 -    case 1:
 222.103 -      return 3;
 222.104 -    case 3:
 222.105 -      return 2;
 222.106 -    case 5:
 222.107 -      return 8;
 222.108 -    case 7:
 222.109 -      return 1;
 222.110 -    case 33:
 222.111 -      return 4;
 222.112 -    case 44:
 222.113 -      return 9;
 222.114 -    case 55:
 222.115 -      return 10;
 222.116 -    case 66:
 222.117 -      return -1;
 222.118 -    case 77:
 222.119 -      return 99;
 222.120 -    case 666:
 222.121 -      return 0;
 222.122 -# endif
 222.123 -    default:
 222.124 -      break;
 222.125 -    }
 222.126 -  return 4711;
 222.127 -
 222.128 -#else
 222.129 -   if (code == 1)
 222.130 -	return 3;
 222.131 -  else if (code == 3)
 222.132 -	return 2;
 222.133 -  else if (code == 5)
 222.134 -	return 8;
 222.135 -  else if (code == 7)
 222.136 -	return 1;
 222.137 -  else if (code == 33)
 222.138 -	return 4;
 222.139 -  else if (code == 44)
 222.140 -	return 9;
 222.141 -  else if (code == 55)
 222.142 -	return 10;
 222.143 -  else if (code == 66)
 222.144 -	return -1;
 222.145 -  else if (code == 77)
 222.146 -	return 99;
 222.147 -  else if (code == 666)
 222.148 -	return 0;
 222.149 -  else
 222.150 -	return 4711;
 222.151 -#endif
 222.152 -}
 222.153 -
 222.154 -
 222.155 ---AhhlLboLdkugWU4S--
 222.156 -
   223.1 --- a/patches/gcc/4.2.0/920-soft-float.patch	Mon Jul 28 21:08:01 2008 +0000
   223.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   223.3 @@ -1,21 +0,0 @@
   223.4 -diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
   223.5 ---- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c	2007-03-05 11:54:00.000000000 -0500
   223.6 -+++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c	2008-01-31 17:51:24.000000000 -0500
   223.7 -@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
   223.8 -    but GCC currently generates poor code when a union is used to turn
   223.9 -    a long double into a pair of doubles.  */
  223.10 - 
  223.11 -+#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  223.12 -+
  223.13 - long double __gcc_qadd (double, double, double, double);
  223.14 - long double __gcc_qsub (double, double, double, double);
  223.15 - long double __gcc_qmul (double, double, double, double);
  223.16 -@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
  223.17 -   return z.ldval;
  223.18 - }
  223.19 - 
  223.20 --#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  223.21 --
  223.22 - long double __gcc_qneg (double, double);
  223.23 - int __gcc_qeq (double, double, double, double);
  223.24 - int __gcc_qne (double, double, double, double);
   224.1 --- a/patches/gcc/4.2.0/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
   224.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   224.3 @@ -1,17 +0,0 @@
   224.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   224.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   224.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   224.7 - /* Do code reading to identify a signal frame, and set the frame
   224.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
   224.9 - 
  224.10 -+/* Don't use this if inhibit_libc is set
  224.11 -+   The build for this target will fail trying to include missing headers */
  224.12 -+#ifndef inhibit_libc
  224.13 - #include <signal.h>
  224.14 - #include <sys/ucontext.h>
  224.15 - 
  224.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  224.17 -   fs->retaddr_column = 64;
  224.18 -   return _URC_NO_REASON;
  224.19 - }
  224.20 -+#endif /* inhibit_libc */
   225.1 --- a/patches/gcc/4.2.1/103-uclibc-conf-noupstream.patch	Mon Jul 28 21:08:01 2008 +0000
   225.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   225.3 @@ -1,12 +0,0 @@
   225.4 -diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
   225.5 ---- gcc-4.2.1.orig/gcc/config.gcc	2007-02-03 06:25:20.000000000 +0100
   225.6 -+++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
   225.7 -@@ -1964,7 +1964,7 @@
   225.8 -         ;;
   225.9 - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  225.10 - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  225.11 --  sh-*-linux* | sh[346lbe]*-*-linux* | \
  225.12 -+  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  225.13 -   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  225.14 -    sh64-*-netbsd* | sh64l*-*-netbsd*)
  225.15 - 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   226.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   226.2 +++ b/patches/gcc/4.2.1/110-uclibc-conf-noupstream.patch	Mon Jul 28 21:32:33 2008 +0000
   226.3 @@ -0,0 +1,12 @@
   226.4 +diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
   226.5 +--- gcc-4.2.1.orig/gcc/config.gcc	2007-02-03 06:25:20.000000000 +0100
   226.6 ++++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
   226.7 +@@ -1964,7 +1964,7 @@
   226.8 +         ;;
   226.9 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  226.10 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  226.11 +-  sh-*-linux* | sh[346lbe]*-*-linux* | \
  226.12 ++  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  226.13 +   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  226.14 +    sh64-*-netbsd* | sh64l*-*-netbsd*)
  226.15 + 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   227.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   227.2 +++ b/patches/gcc/4.2.1/120-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   227.3 @@ -0,0 +1,2806 @@
   227.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 gcc-4.2.1/libstdc++-v3/acinclude.m4
   227.5 +--- gcc-4.2.1.orig/libstdc++-v3/acinclude.m4	2007-06-29 01:02:05.000000000 +0200
   227.6 ++++ gcc-4.2.1/libstdc++-v3/acinclude.m4	2007-08-03 20:30:21.000000000 +0200
   227.7 +@@ -1334,7 +1334,7 @@
   227.8 + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   227.9 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  227.10 +     [use MODEL for target locale package],
  227.11 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  227.12 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  227.13 + 
  227.14 +   # Deal with gettext issues.  Default to not using it (=no) until we detect
  227.15 +   # support for it later.  Let the user turn it off via --e/d, but let that
  227.16 +@@ -1355,6 +1355,9 @@
  227.17 +   # Default to "generic".
  227.18 +   if test $enable_clocale_flag = auto; then
  227.19 +     case ${target_os} in
  227.20 ++      *-uclibc*)
  227.21 ++        enable_clocale_flag=uclibc
  227.22 ++        ;;
  227.23 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  227.24 +         enable_clocale_flag=gnu	
  227.25 +         ;;
  227.26 +@@ -1526,6 +1529,40 @@
  227.27 +       CTIME_CC=config/locale/generic/time_members.cc
  227.28 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  227.29 +       ;;
  227.30 ++    uclibc)
  227.31 ++      AC_MSG_RESULT(uclibc)
  227.32 ++
  227.33 ++      # Declare intention to use gettext, and add support for specific
  227.34 ++      # languages.
  227.35 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  227.36 ++      ALL_LINGUAS="de fr"
  227.37 ++
  227.38 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  227.39 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  227.40 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  227.41 ++        USE_NLS=yes
  227.42 ++      fi
  227.43 ++      # Export the build objects.
  227.44 ++      for ling in $ALL_LINGUAS; do \
  227.45 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  227.46 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  227.47 ++      done
  227.48 ++      AC_SUBST(glibcxx_MOFILES)
  227.49 ++      AC_SUBST(glibcxx_POFILES)
  227.50 ++
  227.51 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  227.52 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  227.53 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  227.54 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  227.55 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  227.56 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  227.57 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  227.58 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  227.59 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  227.60 ++      CTIME_H=config/locale/uclibc/time_members.h
  227.61 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  227.62 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  227.63 ++      ;;
  227.64 +   esac
  227.65 + 
  227.66 +   # This is where the testsuite looks for locale catalogs, using the
  227.67 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
  227.68 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  227.69 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
  227.70 +@@ -0,0 +1,160 @@
  227.71 ++// Wrapper for underlying C-language localization -*- C++ -*-
  227.72 ++
  227.73 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  227.74 ++//
  227.75 ++// This file is part of the GNU ISO C++ Library.  This library is free
  227.76 ++// software; you can redistribute it and/or modify it under the
  227.77 ++// terms of the GNU General Public License as published by the
  227.78 ++// Free Software Foundation; either version 2, or (at your option)
  227.79 ++// any later version.
  227.80 ++
  227.81 ++// This library is distributed in the hope that it will be useful,
  227.82 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  227.83 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  227.84 ++// GNU General Public License for more details.
  227.85 ++
  227.86 ++// You should have received a copy of the GNU General Public License along
  227.87 ++// with this library; see the file COPYING.  If not, write to the Free
  227.88 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  227.89 ++// USA.
  227.90 ++
  227.91 ++// As a special exception, you may use this file as part of a free software
  227.92 ++// library without restriction.  Specifically, if other files instantiate
  227.93 ++// templates or use macros or inline functions from this file, or you compile
  227.94 ++// this file and link it with other files to produce an executable, this
  227.95 ++// file does not by itself cause the resulting executable to be covered by
  227.96 ++// the GNU General Public License.  This exception does not however
  227.97 ++// invalidate any other reasons why the executable file might be covered by
  227.98 ++// the GNU General Public License.
  227.99 ++
 227.100 ++//
 227.101 ++// ISO C++ 14882: 22.8  Standard locale categories.
 227.102 ++//
 227.103 ++
 227.104 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 227.105 ++
 227.106 ++#include <cerrno>  // For errno
 227.107 ++#include <locale>
 227.108 ++#include <stdexcept>
 227.109 ++#include <langinfo.h>
 227.110 ++#include <bits/c++locale_internal.h>
 227.111 ++
 227.112 ++#ifndef __UCLIBC_HAS_XLOCALE__
 227.113 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 227.114 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 227.115 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 227.116 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 227.117 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 227.118 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 227.119 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 227.120 ++#warning should dummy __newlocale check for C|POSIX ?
 227.121 ++#define __newlocale(a, b, c)        NULL
 227.122 ++#define __freelocale(a)             ((void)0)
 227.123 ++#define __duplocale(a)              __c_locale()
 227.124 ++#endif
 227.125 ++
 227.126 ++namespace std 
 227.127 ++{
 227.128 ++  template<>
 227.129 ++    void
 227.130 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 227.131 ++		   const __c_locale& __cloc)
 227.132 ++    {
 227.133 ++      if (!(__err & ios_base::failbit))
 227.134 ++	{
 227.135 ++	  char* __sanity;
 227.136 ++	  errno = 0;
 227.137 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
 227.138 ++          if (__sanity != __s && errno != ERANGE)
 227.139 ++	    __v = __f;
 227.140 ++	  else
 227.141 ++	    __err |= ios_base::failbit;
 227.142 ++	}
 227.143 ++    }
 227.144 ++
 227.145 ++  template<>
 227.146 ++    void
 227.147 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 227.148 ++		   const __c_locale& __cloc)
 227.149 ++    {
 227.150 ++      if (!(__err & ios_base::failbit))
 227.151 ++	{
 227.152 ++	  char* __sanity;
 227.153 ++	  errno = 0;
 227.154 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
 227.155 ++          if (__sanity != __s && errno != ERANGE)
 227.156 ++	    __v = __d;
 227.157 ++	  else
 227.158 ++	    __err |= ios_base::failbit;
 227.159 ++	}
 227.160 ++    }
 227.161 ++
 227.162 ++  template<>
 227.163 ++    void
 227.164 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 227.165 ++		   const __c_locale& __cloc)
 227.166 ++    {
 227.167 ++      if (!(__err & ios_base::failbit))
 227.168 ++	{
 227.169 ++	  char* __sanity;
 227.170 ++	  errno = 0;
 227.171 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 227.172 ++          if (__sanity != __s && errno != ERANGE)
 227.173 ++	    __v = __ld;
 227.174 ++	  else
 227.175 ++	    __err |= ios_base::failbit;
 227.176 ++	}
 227.177 ++    }
 227.178 ++
 227.179 ++  void
 227.180 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 227.181 ++				    __c_locale __old)
 227.182 ++  {
 227.183 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 227.184 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.185 ++    if (!__cloc)
 227.186 ++      {
 227.187 ++	// This named locale is not supported by the underlying OS.
 227.188 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 227.189 ++			      "name not valid"));
 227.190 ++      }
 227.191 ++#endif
 227.192 ++  }
 227.193 ++  
 227.194 ++  void
 227.195 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 227.196 ++  {
 227.197 ++    if (_S_get_c_locale() != __cloc)
 227.198 ++      __freelocale(__cloc); 
 227.199 ++  }
 227.200 ++
 227.201 ++  __c_locale
 227.202 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 227.203 ++  { return __duplocale(__cloc); }
 227.204 ++} // namespace std
 227.205 ++
 227.206 ++namespace __gnu_cxx
 227.207 ++{
 227.208 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 227.209 ++    {
 227.210 ++      "LC_CTYPE", 
 227.211 ++      "LC_NUMERIC",
 227.212 ++      "LC_TIME", 
 227.213 ++      "LC_COLLATE", 
 227.214 ++      "LC_MONETARY",
 227.215 ++      "LC_MESSAGES", 
 227.216 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 227.217 ++      "LC_PAPER", 
 227.218 ++      "LC_NAME", 
 227.219 ++      "LC_ADDRESS",
 227.220 ++      "LC_TELEPHONE", 
 227.221 ++      "LC_MEASUREMENT", 
 227.222 ++      "LC_IDENTIFICATION" 
 227.223 ++#endif
 227.224 ++    };
 227.225 ++}
 227.226 ++
 227.227 ++namespace std
 227.228 ++{
 227.229 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 227.230 ++}  // namespace std
 227.231 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
 227.232 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 227.233 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
 227.234 +@@ -0,0 +1,117 @@
 227.235 ++// Wrapper for underlying C-language localization -*- C++ -*-
 227.236 ++
 227.237 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 227.238 ++//
 227.239 ++// This file is part of the GNU ISO C++ Library.  This library is free
 227.240 ++// software; you can redistribute it and/or modify it under the
 227.241 ++// terms of the GNU General Public License as published by the
 227.242 ++// Free Software Foundation; either version 2, or (at your option)
 227.243 ++// any later version.
 227.244 ++
 227.245 ++// This library is distributed in the hope that it will be useful,
 227.246 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 227.247 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 227.248 ++// GNU General Public License for more details.
 227.249 ++
 227.250 ++// You should have received a copy of the GNU General Public License along
 227.251 ++// with this library; see the file COPYING.  If not, write to the Free
 227.252 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 227.253 ++// USA.
 227.254 ++
 227.255 ++// As a special exception, you may use this file as part of a free software
 227.256 ++// library without restriction.  Specifically, if other files instantiate
 227.257 ++// templates or use macros or inline functions from this file, or you compile
 227.258 ++// this file and link it with other files to produce an executable, this
 227.259 ++// file does not by itself cause the resulting executable to be covered by
 227.260 ++// the GNU General Public License.  This exception does not however
 227.261 ++// invalidate any other reasons why the executable file might be covered by
 227.262 ++// the GNU General Public License.
 227.263 ++
 227.264 ++//
 227.265 ++// ISO C++ 14882: 22.8  Standard locale categories.
 227.266 ++//
 227.267 ++
 227.268 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 227.269 ++
 227.270 ++#ifndef _C_LOCALE_H
 227.271 ++#define _C_LOCALE_H 1
 227.272 ++
 227.273 ++#pragma GCC system_header
 227.274 ++
 227.275 ++#include <cstring>              // get std::strlen
 227.276 ++#include <cstdio>               // get std::snprintf or std::sprintf
 227.277 ++#include <clocale>
 227.278 ++#include <langinfo.h>		// For codecvt
 227.279 ++#ifdef __UCLIBC_MJN3_ONLY__
 227.280 ++#warning fix this
 227.281 ++#endif
 227.282 ++#ifdef __UCLIBC_HAS_LOCALE__
 227.283 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 227.284 ++#endif
 227.285 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 227.286 ++#include <libintl.h> 		// For messages
 227.287 ++#endif
 227.288 ++
 227.289 ++#ifdef __UCLIBC_MJN3_ONLY__
 227.290 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 227.291 ++#endif
 227.292 ++#define _GLIBCXX_C_LOCALE_GNU 1
 227.293 ++
 227.294 ++#ifdef __UCLIBC_MJN3_ONLY__
 227.295 ++#warning fix categories
 227.296 ++#endif
 227.297 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 227.298 ++#define _GLIBCXX_NUM_CATEGORIES 0
 227.299 ++ 
 227.300 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.301 ++namespace __gnu_cxx
 227.302 ++{
 227.303 ++  extern "C" __typeof(uselocale) __uselocale;
 227.304 ++}
 227.305 ++#endif
 227.306 ++
 227.307 ++namespace std
 227.308 ++{
 227.309 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.310 ++  typedef __locale_t		__c_locale;
 227.311 ++#else
 227.312 ++  typedef int*			__c_locale;
 227.313 ++#endif
 227.314 ++
 227.315 ++  // Convert numeric value of type _Tv to string and return length of
 227.316 ++  // string.  If snprintf is available use it, otherwise fall back to
 227.317 ++  // the unsafe sprintf which, in general, can be dangerous and should
 227.318 ++  // be avoided.
 227.319 ++  template<typename _Tv>
 227.320 ++    int
 227.321 ++    __convert_from_v(char* __out, 
 227.322 ++		     const int __size __attribute__ ((__unused__)),
 227.323 ++		     const char* __fmt,
 227.324 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 227.325 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 227.326 ++    {
 227.327 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 227.328 ++#else
 227.329 ++		     _Tv __v, const __c_locale&, int __prec)
 227.330 ++    {
 227.331 ++# ifdef __UCLIBC_HAS_LOCALE__
 227.332 ++      char* __old = std::setlocale(LC_ALL, NULL);
 227.333 ++      char* __sav = new char[std::strlen(__old) + 1];
 227.334 ++      std::strcpy(__sav, __old);
 227.335 ++      std::setlocale(LC_ALL, "C");
 227.336 ++# endif
 227.337 ++#endif
 227.338 ++
 227.339 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 227.340 ++
 227.341 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 227.342 ++      __gnu_cxx::__uselocale(__old);
 227.343 ++#elif defined __UCLIBC_HAS_LOCALE__
 227.344 ++      std::setlocale(LC_ALL, __sav);
 227.345 ++      delete [] __sav;
 227.346 ++#endif
 227.347 ++      return __ret;
 227.348 ++    }
 227.349 ++}
 227.350 ++
 227.351 ++#endif
 227.352 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
 227.353 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
 227.354 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
 227.355 +@@ -0,0 +1,63 @@
 227.356 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
 227.357 ++
 227.358 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
 227.359 ++//
 227.360 ++// This file is part of the GNU ISO C++ Library.  This library is free
 227.361 ++// software; you can redistribute it and/or modify it under the
 227.362 ++// terms of the GNU General Public License as published by the
 227.363 ++// Free Software Foundation; either version 2, or (at your option)
 227.364 ++// any later version.
 227.365 ++
 227.366 ++// This library is distributed in the hope that it will be useful,
 227.367 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 227.368 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 227.369 ++// GNU General Public License for more details.
 227.370 ++
 227.371 ++// You should have received a copy of the GNU General Public License along
 227.372 ++// with this library; see the file COPYING.  If not, write to the Free
 227.373 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 227.374 ++// USA.
 227.375 ++
 227.376 ++// As a special exception, you may use this file as part of a free software
 227.377 ++// library without restriction.  Specifically, if other files instantiate
 227.378 ++// templates or use macros or inline functions from this file, or you compile
 227.379 ++// this file and link it with other files to produce an executable, this
 227.380 ++// file does not by itself cause the resulting executable to be covered by
 227.381 ++// the GNU General Public License.  This exception does not however
 227.382 ++// invalidate any other reasons why the executable file might be covered by
 227.383 ++// the GNU General Public License.
 227.384 ++
 227.385 ++// Written by Jakub Jelinek <jakub@redhat.com>
 227.386 ++
 227.387 ++#include <bits/c++config.h>
 227.388 ++#include <clocale>
 227.389 ++
 227.390 ++#ifdef __UCLIBC_MJN3_ONLY__
 227.391 ++#warning clean this up
 227.392 ++#endif
 227.393 ++
 227.394 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.395 ++                                                  
 227.396 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 227.397 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 227.398 ++extern "C" __typeof(strftime_l) __strftime_l;
 227.399 ++extern "C" __typeof(strtod_l) __strtod_l;
 227.400 ++extern "C" __typeof(strtof_l) __strtof_l;
 227.401 ++extern "C" __typeof(strtold_l) __strtold_l;
 227.402 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 227.403 ++extern "C" __typeof(newlocale) __newlocale;
 227.404 ++extern "C" __typeof(freelocale) __freelocale;
 227.405 ++extern "C" __typeof(duplocale) __duplocale;
 227.406 ++extern "C" __typeof(uselocale) __uselocale;
 227.407 ++
 227.408 ++#ifdef _GLIBCXX_USE_WCHAR_T
 227.409 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 227.410 ++extern "C" __typeof(towlower_l) __towlower_l;
 227.411 ++extern "C" __typeof(towupper_l) __towupper_l;
 227.412 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 227.413 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 227.414 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 227.415 ++extern "C" __typeof(wctype_l) __wctype_l;
 227.416 ++#endif 
 227.417 ++
 227.418 ++#endif // GLIBC 2.3 and later
 227.419 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 227.420 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 227.421 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-08-03 20:30:21.000000000 +0200
 227.422 +@@ -0,0 +1,306 @@
 227.423 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 227.424 ++
 227.425 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 227.426 ++//
 227.427 ++// This file is part of the GNU ISO C++ Library.  This library is free
 227.428 ++// software; you can redistribute it and/or modify it under the
 227.429 ++// terms of the GNU General Public License as published by the
 227.430 ++// Free Software Foundation; either version 2, or (at your option)
 227.431 ++// any later version.
 227.432 ++
 227.433 ++// This library is distributed in the hope that it will be useful,
 227.434 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 227.435 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 227.436 ++// GNU General Public License for more details.
 227.437 ++
 227.438 ++// You should have received a copy of the GNU General Public License along
 227.439 ++// with this library; see the file COPYING.  If not, write to the Free
 227.440 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 227.441 ++// USA.
 227.442 ++
 227.443 ++// As a special exception, you may use this file as part of a free software
 227.444 ++// library without restriction.  Specifically, if other files instantiate
 227.445 ++// templates or use macros or inline functions from this file, or you compile
 227.446 ++// this file and link it with other files to produce an executable, this
 227.447 ++// file does not by itself cause the resulting executable to be covered by
 227.448 ++// the GNU General Public License.  This exception does not however
 227.449 ++// invalidate any other reasons why the executable file might be covered by
 227.450 ++// the GNU General Public License.
 227.451 ++
 227.452 ++//
 227.453 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 227.454 ++//
 227.455 ++
 227.456 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 227.457 ++
 227.458 ++#include <locale>
 227.459 ++#include <bits/c++locale_internal.h>
 227.460 ++
 227.461 ++namespace std
 227.462 ++{
 227.463 ++  // Specializations.
 227.464 ++#ifdef _GLIBCXX_USE_WCHAR_T
 227.465 ++  codecvt_base::result
 227.466 ++  codecvt<wchar_t, char, mbstate_t>::
 227.467 ++  do_out(state_type& __state, const intern_type* __from, 
 227.468 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 227.469 ++	 extern_type* __to, extern_type* __to_end,
 227.470 ++	 extern_type*& __to_next) const
 227.471 ++  {
 227.472 ++    result __ret = ok;
 227.473 ++    state_type __tmp_state(__state);
 227.474 ++
 227.475 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.476 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 227.477 ++#endif
 227.478 ++
 227.479 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 227.480 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 227.481 ++    // NB: wcsnrtombs is a GNU extension
 227.482 ++    for (__from_next = __from, __to_next = __to;
 227.483 ++	 __from_next < __from_end && __to_next < __to_end
 227.484 ++	 && __ret == ok;)
 227.485 ++      {
 227.486 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 227.487 ++						      __from_end - __from_next);
 227.488 ++	if (!__from_chunk_end)
 227.489 ++	  __from_chunk_end = __from_end;
 227.490 ++
 227.491 ++	__from = __from_next;
 227.492 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 227.493 ++					 __from_chunk_end - __from_next,
 227.494 ++					 __to_end - __to_next, &__state);
 227.495 ++	if (__conv == static_cast<size_t>(-1))
 227.496 ++	  {
 227.497 ++	    // In case of error, in order to stop at the exact place we
 227.498 ++	    // have to start again from the beginning with a series of
 227.499 ++	    // wcrtomb.
 227.500 ++	    for (; __from < __from_next; ++__from)
 227.501 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 227.502 ++	    __state = __tmp_state;
 227.503 ++	    __ret = error;
 227.504 ++	  }
 227.505 ++	else if (__from_next && __from_next < __from_chunk_end)
 227.506 ++	  {
 227.507 ++	    __to_next += __conv;
 227.508 ++	    __ret = partial;
 227.509 ++	  }
 227.510 ++	else
 227.511 ++	  {
 227.512 ++	    __from_next = __from_chunk_end;
 227.513 ++	    __to_next += __conv;
 227.514 ++	  }
 227.515 ++
 227.516 ++	if (__from_next < __from_end && __ret == ok)
 227.517 ++	  {
 227.518 ++	    extern_type __buf[MB_LEN_MAX];
 227.519 ++	    __tmp_state = __state;
 227.520 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 227.521 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 227.522 ++	      __ret = partial;
 227.523 ++	    else
 227.524 ++	      {
 227.525 ++		memcpy(__to_next, __buf, __conv);
 227.526 ++		__state = __tmp_state;
 227.527 ++		__to_next += __conv;
 227.528 ++		++__from_next;
 227.529 ++	      }
 227.530 ++	  }
 227.531 ++      }
 227.532 ++
 227.533 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.534 ++    __uselocale(__old);
 227.535 ++#endif
 227.536 ++
 227.537 ++    return __ret; 
 227.538 ++  }
 227.539 ++  
 227.540 ++  codecvt_base::result
 227.541 ++  codecvt<wchar_t, char, mbstate_t>::
 227.542 ++  do_in(state_type& __state, const extern_type* __from, 
 227.543 ++	const extern_type* __from_end, const extern_type*& __from_next,
 227.544 ++	intern_type* __to, intern_type* __to_end,
 227.545 ++	intern_type*& __to_next) const
 227.546 ++  {
 227.547 ++    result __ret = ok;
 227.548 ++    state_type __tmp_state(__state);
 227.549 ++
 227.550 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.551 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 227.552 ++#endif
 227.553 ++
 227.554 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 227.555 ++    // in case we store a L'\0' and then continue, in a loop.
 227.556 ++    // NB: mbsnrtowcs is a GNU extension
 227.557 ++    for (__from_next = __from, __to_next = __to;
 227.558 ++	 __from_next < __from_end && __to_next < __to_end
 227.559 ++	 && __ret == ok;)
 227.560 ++      {
 227.561 ++	const extern_type* __from_chunk_end;
 227.562 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 227.563 ++								  __from_end
 227.564 ++								  - __from_next));
 227.565 ++	if (!__from_chunk_end)
 227.566 ++	  __from_chunk_end = __from_end;
 227.567 ++
 227.568 ++	__from = __from_next;
 227.569 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 227.570 ++				   __from_chunk_end - __from_next,
 227.571 ++				   __to_end - __to_next, &__state);
 227.572 ++	if (__conv == static_cast<size_t>(-1))
 227.573 ++	  {
 227.574 ++	    // In case of error, in order to stop at the exact place we
 227.575 ++	    // have to start again from the beginning with a series of
 227.576 ++	    // mbrtowc.
 227.577 ++	    for (;; ++__to_next, __from += __conv)
 227.578 ++	      {
 227.579 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 227.580 ++				 &__tmp_state);
 227.581 ++		if (__conv == static_cast<size_t>(-1)
 227.582 ++		    || __conv == static_cast<size_t>(-2))
 227.583 ++		  break;
 227.584 ++	      }
 227.585 ++	    __from_next = __from;
 227.586 ++	    __state = __tmp_state;	    
 227.587 ++	    __ret = error;
 227.588 ++	  }
 227.589 ++	else if (__from_next && __from_next < __from_chunk_end)
 227.590 ++	  {
 227.591 ++	    // It is unclear what to return in this case (see DR 382). 
 227.592 ++	    __to_next += __conv;
 227.593 ++	    __ret = partial;
 227.594 ++	  }
 227.595 ++	else
 227.596 ++	  {
 227.597 ++	    __from_next = __from_chunk_end;
 227.598 ++	    __to_next += __conv;
 227.599 ++	  }
 227.600 ++
 227.601 ++	if (__from_next < __from_end && __ret == ok)
 227.602 ++	  {
 227.603 ++	    if (__to_next < __to_end)
 227.604 ++	      {
 227.605 ++		// XXX Probably wrong for stateful encodings
 227.606 ++		__tmp_state = __state;		
 227.607 ++		++__from_next;
 227.608 ++		*__to_next++ = L'\0';
 227.609 ++	      }
 227.610 ++	    else
 227.611 ++	      __ret = partial;
 227.612 ++	  }
 227.613 ++      }
 227.614 ++
 227.615 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.616 ++    __uselocale(__old);
 227.617 ++#endif
 227.618 ++
 227.619 ++    return __ret; 
 227.620 ++  }
 227.621 ++
 227.622 ++  int 
 227.623 ++  codecvt<wchar_t, char, mbstate_t>::
 227.624 ++  do_encoding() const throw()
 227.625 ++  {
 227.626 ++    // XXX This implementation assumes that the encoding is
 227.627 ++    // stateless and is either single-byte or variable-width.
 227.628 ++    int __ret = 0;
 227.629 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.630 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 227.631 ++#endif
 227.632 ++    if (MB_CUR_MAX == 1)
 227.633 ++      __ret = 1;
 227.634 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.635 ++    __uselocale(__old);
 227.636 ++#endif
 227.637 ++    return __ret;
 227.638 ++  }  
 227.639 ++
 227.640 ++  int 
 227.641 ++  codecvt<wchar_t, char, mbstate_t>::
 227.642 ++  do_max_length() const throw()
 227.643 ++  {
 227.644 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.645 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 227.646 ++#endif
 227.647 ++    // XXX Probably wrong for stateful encodings.
 227.648 ++    int __ret = MB_CUR_MAX;
 227.649 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.650 ++    __uselocale(__old);
 227.651 ++#endif
 227.652 ++    return __ret;
 227.653 ++  }
 227.654 ++  
 227.655 ++  int 
 227.656 ++  codecvt<wchar_t, char, mbstate_t>::
 227.657 ++  do_length(state_type& __state, const extern_type* __from,
 227.658 ++	    const extern_type* __end, size_t __max) const
 227.659 ++  {
 227.660 ++    int __ret = 0;
 227.661 ++    state_type __tmp_state(__state);
 227.662 ++
 227.663 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.664 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 227.665 ++#endif
 227.666 ++
 227.667 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 227.668 ++    // in case we advance past it and then continue, in a loop.
 227.669 ++    // NB: mbsnrtowcs is a GNU extension
 227.670 ++  
 227.671 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 227.672 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 227.673 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 227.674 ++							   * __max));
 227.675 ++    while (__from < __end && __max)
 227.676 ++      {
 227.677 ++	const extern_type* __from_chunk_end;
 227.678 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 227.679 ++								  __end
 227.680 ++								  - __from));
 227.681 ++	if (!__from_chunk_end)
 227.682 ++	  __from_chunk_end = __end;
 227.683 ++
 227.684 ++	const extern_type* __tmp_from = __from;
 227.685 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 227.686 ++				   __from_chunk_end - __from,
 227.687 ++				   __max, &__state);
 227.688 ++	if (__conv == static_cast<size_t>(-1))
 227.689 ++	  {
 227.690 ++	    // In case of error, in order to stop at the exact place we
 227.691 ++	    // have to start again from the beginning with a series of
 227.692 ++	    // mbrtowc.
 227.693 ++	    for (__from = __tmp_from;; __from += __conv)
 227.694 ++	      {
 227.695 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 227.696 ++				 &__tmp_state);
 227.697 ++		if (__conv == static_cast<size_t>(-1)
 227.698 ++		    || __conv == static_cast<size_t>(-2))
 227.699 ++		  break;
 227.700 ++	      }
 227.701 ++	    __state = __tmp_state;
 227.702 ++	    __ret += __from - __tmp_from;
 227.703 ++	    break;
 227.704 ++	  }
 227.705 ++	if (!__from)
 227.706 ++	  __from = __from_chunk_end;
 227.707 ++	
 227.708 ++	__ret += __from - __tmp_from;
 227.709 ++	__max -= __conv;
 227.710 ++
 227.711 ++	if (__from < __end && __max)
 227.712 ++	  {
 227.713 ++	    // XXX Probably wrong for stateful encodings
 227.714 ++	    __tmp_state = __state;
 227.715 ++	    ++__from;
 227.716 ++	    ++__ret;
 227.717 ++	    --__max;
 227.718 ++	  }
 227.719 ++      }
 227.720 ++
 227.721 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.722 ++    __uselocale(__old);
 227.723 ++#endif
 227.724 ++
 227.725 ++    return __ret; 
 227.726 ++  }
 227.727 ++#endif
 227.728 ++}
 227.729 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
 227.730 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 227.731 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
 227.732 +@@ -0,0 +1,80 @@
 227.733 ++// std::collate implementation details, GNU version -*- C++ -*-
 227.734 ++
 227.735 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 227.736 ++//
 227.737 ++// This file is part of the GNU ISO C++ Library.  This library is free
 227.738 ++// software; you can redistribute it and/or modify it under the
 227.739 ++// terms of the GNU General Public License as published by the
 227.740 ++// Free Software Foundation; either version 2, or (at your option)
 227.741 ++// any later version.
 227.742 ++
 227.743 ++// This library is distributed in the hope that it will be useful,
 227.744 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 227.745 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 227.746 ++// GNU General Public License for more details.
 227.747 ++
 227.748 ++// You should have received a copy of the GNU General Public License along
 227.749 ++// with this library; see the file COPYING.  If not, write to the Free
 227.750 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 227.751 ++// USA.
 227.752 ++
 227.753 ++// As a special exception, you may use this file as part of a free software
 227.754 ++// library without restriction.  Specifically, if other files instantiate
 227.755 ++// templates or use macros or inline functions from this file, or you compile
 227.756 ++// this file and link it with other files to produce an executable, this
 227.757 ++// file does not by itself cause the resulting executable to be covered by
 227.758 ++// the GNU General Public License.  This exception does not however
 227.759 ++// invalidate any other reasons why the executable file might be covered by
 227.760 ++// the GNU General Public License.
 227.761 ++
 227.762 ++//
 227.763 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 227.764 ++//
 227.765 ++
 227.766 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 227.767 ++
 227.768 ++#include <locale>
 227.769 ++#include <bits/c++locale_internal.h>
 227.770 ++
 227.771 ++#ifndef __UCLIBC_HAS_XLOCALE__
 227.772 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 227.773 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 227.774 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 227.775 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 227.776 ++#endif
 227.777 ++
 227.778 ++namespace std
 227.779 ++{
 227.780 ++  // These are basically extensions to char_traits, and perhaps should
 227.781 ++  // be put there instead of here.
 227.782 ++  template<>
 227.783 ++    int 
 227.784 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 227.785 ++    { 
 227.786 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 227.787 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 227.788 ++    }
 227.789 ++  
 227.790 ++  template<>
 227.791 ++    size_t
 227.792 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 227.793 ++				size_t __n) const 
 227.794 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 227.795 ++
 227.796 ++#ifdef _GLIBCXX_USE_WCHAR_T
 227.797 ++  template<>
 227.798 ++    int 
 227.799 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 227.800 ++				 const wchar_t* __two) const
 227.801 ++    {
 227.802 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 227.803 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 227.804 ++    }
 227.805 ++  
 227.806 ++  template<>
 227.807 ++    size_t
 227.808 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 227.809 ++				   size_t __n) const
 227.810 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 227.811 ++#endif
 227.812 ++}
 227.813 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 227.814 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 227.815 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 227.816 +@@ -0,0 +1,300 @@
 227.817 ++// std::ctype implementation details, GNU version -*- C++ -*-
 227.818 ++
 227.819 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 227.820 ++//
 227.821 ++// This file is part of the GNU ISO C++ Library.  This library is free
 227.822 ++// software; you can redistribute it and/or modify it under the
 227.823 ++// terms of the GNU General Public License as published by the
 227.824 ++// Free Software Foundation; either version 2, or (at your option)
 227.825 ++// any later version.
 227.826 ++
 227.827 ++// This library is distributed in the hope that it will be useful,
 227.828 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 227.829 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 227.830 ++// GNU General Public License for more details.
 227.831 ++
 227.832 ++// You should have received a copy of the GNU General Public License along
 227.833 ++// with this library; see the file COPYING.  If not, write to the Free
 227.834 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 227.835 ++// USA.
 227.836 ++
 227.837 ++// As a special exception, you may use this file as part of a free software
 227.838 ++// library without restriction.  Specifically, if other files instantiate
 227.839 ++// templates or use macros or inline functions from this file, or you compile
 227.840 ++// this file and link it with other files to produce an executable, this
 227.841 ++// file does not by itself cause the resulting executable to be covered by
 227.842 ++// the GNU General Public License.  This exception does not however
 227.843 ++// invalidate any other reasons why the executable file might be covered by
 227.844 ++// the GNU General Public License.
 227.845 ++
 227.846 ++//
 227.847 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 227.848 ++//
 227.849 ++
 227.850 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 227.851 ++
 227.852 ++#define _LIBC
 227.853 ++#include <locale>
 227.854 ++#undef _LIBC
 227.855 ++#include <bits/c++locale_internal.h>
 227.856 ++
 227.857 ++#ifndef __UCLIBC_HAS_XLOCALE__
 227.858 ++#define __wctype_l(S, L)           wctype((S))
 227.859 ++#define __towupper_l(C, L)         towupper((C))
 227.860 ++#define __towlower_l(C, L)         towlower((C))
 227.861 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 227.862 ++#endif
 227.863 ++
 227.864 ++namespace std
 227.865 ++{
 227.866 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 227.867 ++  // various /config/os/* files.
 227.868 ++  template<>
 227.869 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 227.870 ++    : ctype<char>(0, false, __refs) 
 227.871 ++    { 		
 227.872 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 227.873 ++	{
 227.874 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 227.875 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 227.876 ++#ifdef __UCLIBC_HAS_XLOCALE__
 227.877 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 227.878 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 227.879 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 227.880 ++#endif
 227.881 ++	}
 227.882 ++    }
 227.883 ++
 227.884 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 227.885 ++  ctype<wchar_t>::__wmask_type
 227.886 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 227.887 ++  {
 227.888 ++    __wmask_type __ret;
 227.889 ++    switch (__m)
 227.890 ++      {
 227.891 ++      case space:
 227.892 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 227.893 ++	break;
 227.894 ++      case print:
 227.895 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 227.896 ++	break;
 227.897 ++      case cntrl:
 227.898 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 227.899 ++	break;
 227.900 ++      case upper:
 227.901 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 227.902 ++	break;
 227.903 ++      case lower:
 227.904 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 227.905 ++	break;
 227.906 ++      case alpha:
 227.907 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 227.908 ++	break;
 227.909 ++      case digit:
 227.910 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 227.911 ++	break;
 227.912 ++      case punct:
 227.913 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 227.914 ++	break;
 227.915 ++      case xdigit:
 227.916 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 227.917 ++	break;
 227.918 ++      case alnum:
 227.919 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 227.920 ++	break;
 227.921 ++      case graph:
 227.922 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 227.923 ++	break;
 227.924 ++      default:
 227.925 ++	__ret = __wmask_type();
 227.926 ++      }
 227.927 ++    return __ret;
 227.928 ++  }
 227.929 ++  
 227.930 ++  wchar_t
 227.931 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 227.932 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 227.933 ++
 227.934 ++  const wchar_t*
 227.935 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 227.936 ++  {
 227.937 ++    while (__lo < __hi)
 227.938 ++      {
 227.939 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 227.940 ++        ++__lo;
 227.941 ++      }
 227.942 ++    return __hi;
 227.943 ++  }
 227.944 ++  
 227.945 ++  wchar_t
 227.946 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 227.947 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 227.948 ++  
 227.949 ++  const wchar_t*
 227.950 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 227.951 ++  {
 227.952 ++    while (__lo < __hi)
 227.953 ++      {
 227.954 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 227.955 ++        ++__lo;
 227.956 ++      }
 227.957 ++    return __hi;
 227.958 ++  }
 227.959 ++
 227.960 ++  bool
 227.961 ++  ctype<wchar_t>::
 227.962 ++  do_is(mask __m, wchar_t __c) const
 227.963 ++  { 
 227.964 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
 227.965 ++    // library for blank.
 227.966 ++    bool __ret = false;
 227.967 ++    const size_t __bitmasksize = 11; 
 227.968 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 227.969 ++      if (__m & _M_bit[__bitcur]
 227.970 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 227.971 ++	{
 227.972 ++	  __ret = true;
 227.973 ++	  break;
 227.974 ++	}
 227.975 ++    return __ret;    
 227.976 ++  }
 227.977 ++  
 227.978 ++  const wchar_t* 
 227.979 ++  ctype<wchar_t>::
 227.980 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 227.981 ++  {
 227.982 ++    for (; __lo < __hi; ++__vec, ++__lo)
 227.983 ++      {
 227.984 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 227.985 ++	// library for blank.
 227.986 ++	const size_t __bitmasksize = 11; 
 227.987 ++	mask __m = 0;
 227.988 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 227.989 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 227.990 ++	    __m |= _M_bit[__bitcur];
 227.991 ++	*__vec = __m;
 227.992 ++      }
 227.993 ++    return __hi;
 227.994 ++  }
 227.995 ++  
 227.996 ++  const wchar_t* 
 227.997 ++  ctype<wchar_t>::
 227.998 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 227.999 ++  {
227.1000 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
227.1001 ++      ++__lo;
227.1002 ++    return __lo;
227.1003 ++  }
227.1004 ++
227.1005 ++  const wchar_t*
227.1006 ++  ctype<wchar_t>::
227.1007 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
227.1008 ++  {
227.1009 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
227.1010 ++      ++__lo;
227.1011 ++    return __lo;
227.1012 ++  }
227.1013 ++
227.1014 ++  wchar_t
227.1015 ++  ctype<wchar_t>::
227.1016 ++  do_widen(char __c) const
227.1017 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
227.1018 ++
227.1019 ++  const char* 
227.1020 ++  ctype<wchar_t>::
227.1021 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
227.1022 ++  {
227.1023 ++    while (__lo < __hi)
227.1024 ++      {
227.1025 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
227.1026 ++	++__lo;
227.1027 ++	++__dest;
227.1028 ++      }
227.1029 ++    return __hi;
227.1030 ++  }
227.1031 ++
227.1032 ++  char
227.1033 ++  ctype<wchar_t>::
227.1034 ++  do_narrow(wchar_t __wc, char __dfault) const
227.1035 ++  {
227.1036 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
227.1037 ++      return _M_narrow[__wc];
227.1038 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1039 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
227.1040 ++#endif
227.1041 ++    const int __c = wctob(__wc);
227.1042 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1043 ++    __uselocale(__old);
227.1044 ++#endif
227.1045 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
227.1046 ++  }
227.1047 ++
227.1048 ++  const wchar_t*
227.1049 ++  ctype<wchar_t>::
227.1050 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
227.1051 ++	    char* __dest) const
227.1052 ++  {
227.1053 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1054 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
227.1055 ++#endif
227.1056 ++    if (_M_narrow_ok)
227.1057 ++      while (__lo < __hi)
227.1058 ++	{
227.1059 ++	  if (*__lo >= 0 && *__lo < 128)
227.1060 ++	    *__dest = _M_narrow[*__lo];
227.1061 ++	  else
227.1062 ++	    {
227.1063 ++	      const int __c = wctob(*__lo);
227.1064 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
227.1065 ++	    }
227.1066 ++	  ++__lo;
227.1067 ++	  ++__dest;
227.1068 ++	}
227.1069 ++    else
227.1070 ++      while (__lo < __hi)
227.1071 ++	{
227.1072 ++	  const int __c = wctob(*__lo);
227.1073 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
227.1074 ++	  ++__lo;
227.1075 ++	  ++__dest;
227.1076 ++	}
227.1077 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1078 ++    __uselocale(__old);
227.1079 ++#endif
227.1080 ++    return __hi;
227.1081 ++  }
227.1082 ++
227.1083 ++  void
227.1084 ++  ctype<wchar_t>::_M_initialize_ctype()
227.1085 ++  {
227.1086 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1087 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
227.1088 ++#endif
227.1089 ++    wint_t __i;
227.1090 ++    for (__i = 0; __i < 128; ++__i)
227.1091 ++      {
227.1092 ++	const int __c = wctob(__i);
227.1093 ++	if (__c == EOF)
227.1094 ++	  break;
227.1095 ++	else
227.1096 ++	  _M_narrow[__i] = static_cast<char>(__c);
227.1097 ++      }
227.1098 ++    if (__i == 128)
227.1099 ++      _M_narrow_ok = true;
227.1100 ++    else
227.1101 ++      _M_narrow_ok = false;
227.1102 ++    for (size_t __j = 0;
227.1103 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
227.1104 ++      _M_widen[__j] = btowc(__j);
227.1105 ++
227.1106 ++    for (size_t __k = 0; __k <= 11; ++__k)
227.1107 ++      { 
227.1108 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
227.1109 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
227.1110 ++      }
227.1111 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1112 ++    __uselocale(__old);
227.1113 ++#endif
227.1114 ++  }
227.1115 ++#endif //  _GLIBCXX_USE_WCHAR_T
227.1116 ++}
227.1117 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
227.1118 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
227.1119 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
227.1120 +@@ -0,0 +1,100 @@
227.1121 ++// std::messages implementation details, GNU version -*- C++ -*-
227.1122 ++
227.1123 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
227.1124 ++//
227.1125 ++// This file is part of the GNU ISO C++ Library.  This library is free
227.1126 ++// software; you can redistribute it and/or modify it under the
227.1127 ++// terms of the GNU General Public License as published by the
227.1128 ++// Free Software Foundation; either version 2, or (at your option)
227.1129 ++// any later version.
227.1130 ++
227.1131 ++// This library is distributed in the hope that it will be useful,
227.1132 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
227.1133 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
227.1134 ++// GNU General Public License for more details.
227.1135 ++
227.1136 ++// You should have received a copy of the GNU General Public License along
227.1137 ++// with this library; see the file COPYING.  If not, write to the Free
227.1138 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
227.1139 ++// USA.
227.1140 ++
227.1141 ++// As a special exception, you may use this file as part of a free software
227.1142 ++// library without restriction.  Specifically, if other files instantiate
227.1143 ++// templates or use macros or inline functions from this file, or you compile
227.1144 ++// this file and link it with other files to produce an executable, this
227.1145 ++// file does not by itself cause the resulting executable to be covered by
227.1146 ++// the GNU General Public License.  This exception does not however
227.1147 ++// invalidate any other reasons why the executable file might be covered by
227.1148 ++// the GNU General Public License.
227.1149 ++
227.1150 ++//
227.1151 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
227.1152 ++//
227.1153 ++
227.1154 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
227.1155 ++
227.1156 ++#include <locale>
227.1157 ++#include <bits/c++locale_internal.h>
227.1158 ++
227.1159 ++#ifdef __UCLIBC_MJN3_ONLY__
227.1160 ++#warning fix gettext stuff
227.1161 ++#endif
227.1162 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
227.1163 ++extern "C" char *__dcgettext(const char *domainname,
227.1164 ++			     const char *msgid, int category);
227.1165 ++#undef gettext
227.1166 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
227.1167 ++#else
227.1168 ++#undef gettext
227.1169 ++#define gettext(msgid) (msgid)
227.1170 ++#endif
227.1171 ++
227.1172 ++namespace std
227.1173 ++{
227.1174 ++  // Specializations.
227.1175 ++  template<>
227.1176 ++    string
227.1177 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
227.1178 ++    {
227.1179 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1180 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
227.1181 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
227.1182 ++      __uselocale(__old);
227.1183 ++      return string(__msg);
227.1184 ++#elif defined __UCLIBC_HAS_LOCALE__
227.1185 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
227.1186 ++      setlocale(LC_ALL, _M_name_messages);
227.1187 ++      const char* __msg = gettext(__dfault.c_str());
227.1188 ++      setlocale(LC_ALL, __old);
227.1189 ++      free(__old);
227.1190 ++      return string(__msg);
227.1191 ++#else
227.1192 ++      const char* __msg = gettext(__dfault.c_str());
227.1193 ++      return string(__msg);
227.1194 ++#endif
227.1195 ++    }
227.1196 ++
227.1197 ++#ifdef _GLIBCXX_USE_WCHAR_T
227.1198 ++  template<>
227.1199 ++    wstring
227.1200 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
227.1201 ++    {
227.1202 ++# ifdef __UCLIBC_HAS_XLOCALE__
227.1203 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
227.1204 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
227.1205 ++      __uselocale(__old);
227.1206 ++      return _M_convert_from_char(__msg);
227.1207 ++# elif defined __UCLIBC_HAS_LOCALE__
227.1208 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
227.1209 ++      setlocale(LC_ALL, _M_name_messages);
227.1210 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
227.1211 ++      setlocale(LC_ALL, __old);
227.1212 ++      free(__old);
227.1213 ++      return _M_convert_from_char(__msg);
227.1214 ++# else
227.1215 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
227.1216 ++      return _M_convert_from_char(__msg);
227.1217 ++# endif
227.1218 ++    }
227.1219 ++#endif
227.1220 ++}
227.1221 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
227.1222 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
227.1223 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
227.1224 +@@ -0,0 +1,118 @@
227.1225 ++// std::messages implementation details, GNU version -*- C++ -*-
227.1226 ++
227.1227 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
227.1228 ++//
227.1229 ++// This file is part of the GNU ISO C++ Library.  This library is free
227.1230 ++// software; you can redistribute it and/or modify it under the
227.1231 ++// terms of the GNU General Public License as published by the
227.1232 ++// Free Software Foundation; either version 2, or (at your option)
227.1233 ++// any later version.
227.1234 ++
227.1235 ++// This library is distributed in the hope that it will be useful,
227.1236 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
227.1237 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
227.1238 ++// GNU General Public License for more details.
227.1239 ++
227.1240 ++// You should have received a copy of the GNU General Public License along
227.1241 ++// with this library; see the file COPYING.  If not, write to the Free
227.1242 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
227.1243 ++// USA.
227.1244 ++
227.1245 ++// As a special exception, you may use this file as part of a free software
227.1246 ++// library without restriction.  Specifically, if other files instantiate
227.1247 ++// templates or use macros or inline functions from this file, or you compile
227.1248 ++// this file and link it with other files to produce an executable, this
227.1249 ++// file does not by itself cause the resulting executable to be covered by
227.1250 ++// the GNU General Public License.  This exception does not however
227.1251 ++// invalidate any other reasons why the executable file might be covered by
227.1252 ++// the GNU General Public License.
227.1253 ++
227.1254 ++//
227.1255 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
227.1256 ++//
227.1257 ++
227.1258 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
227.1259 ++
227.1260 ++#ifdef __UCLIBC_MJN3_ONLY__
227.1261 ++#warning fix prototypes for *textdomain funcs
227.1262 ++#endif
227.1263 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
227.1264 ++extern "C" char *__textdomain(const char *domainname);
227.1265 ++extern "C" char *__bindtextdomain(const char *domainname,
227.1266 ++				  const char *dirname);
227.1267 ++#else
227.1268 ++#undef __textdomain
227.1269 ++#undef __bindtextdomain
227.1270 ++#define __textdomain(D)           ((void)0)
227.1271 ++#define __bindtextdomain(D,P)     ((void)0)
227.1272 ++#endif
227.1273 ++
227.1274 ++  // Non-virtual member functions.
227.1275 ++  template<typename _CharT>
227.1276 ++     messages<_CharT>::messages(size_t __refs)
227.1277 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
227.1278 ++     _M_name_messages(_S_get_c_name())
227.1279 ++     { }
227.1280 ++
227.1281 ++  template<typename _CharT>
227.1282 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
227.1283 ++				size_t __refs) 
227.1284 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
227.1285 ++     _M_name_messages(__s)
227.1286 ++     {
227.1287 ++       char* __tmp = new char[std::strlen(__s) + 1];
227.1288 ++       std::strcpy(__tmp, __s);
227.1289 ++       _M_name_messages = __tmp;
227.1290 ++     }
227.1291 ++
227.1292 ++  template<typename _CharT>
227.1293 ++    typename messages<_CharT>::catalog 
227.1294 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
227.1295 ++			   const char* __dir) const
227.1296 ++    { 
227.1297 ++      __bindtextdomain(__s.c_str(), __dir);
227.1298 ++      return this->do_open(__s, __loc); 
227.1299 ++    }
227.1300 ++
227.1301 ++  // Virtual member functions.
227.1302 ++  template<typename _CharT>
227.1303 ++    messages<_CharT>::~messages()
227.1304 ++    { 
227.1305 ++      if (_M_name_messages != _S_get_c_name())
227.1306 ++	delete [] _M_name_messages;
227.1307 ++      _S_destroy_c_locale(_M_c_locale_messages); 
227.1308 ++    }
227.1309 ++
227.1310 ++  template<typename _CharT>
227.1311 ++    typename messages<_CharT>::catalog 
227.1312 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
227.1313 ++			      const locale&) const
227.1314 ++    { 
227.1315 ++      // No error checking is done, assume the catalog exists and can
227.1316 ++      // be used.
227.1317 ++      __textdomain(__s.c_str());
227.1318 ++      return 0;
227.1319 ++    }
227.1320 ++
227.1321 ++  template<typename _CharT>
227.1322 ++    void    
227.1323 ++    messages<_CharT>::do_close(catalog) const 
227.1324 ++    { }
227.1325 ++
227.1326 ++   // messages_byname
227.1327 ++   template<typename _CharT>
227.1328 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
227.1329 ++     : messages<_CharT>(__refs) 
227.1330 ++     { 
227.1331 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
227.1332 ++	 delete [] this->_M_name_messages;
227.1333 ++       char* __tmp = new char[std::strlen(__s) + 1];
227.1334 ++       std::strcpy(__tmp, __s);
227.1335 ++       this->_M_name_messages = __tmp;
227.1336 ++
227.1337 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
227.1338 ++	 {
227.1339 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
227.1340 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
227.1341 ++	 }
227.1342 ++     }
227.1343 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
227.1344 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
227.1345 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
227.1346 +@@ -0,0 +1,692 @@
227.1347 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
227.1348 ++
227.1349 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
227.1350 ++//
227.1351 ++// This file is part of the GNU ISO C++ Library.  This library is free
227.1352 ++// software; you can redistribute it and/or modify it under the
227.1353 ++// terms of the GNU General Public License as published by the
227.1354 ++// Free Software Foundation; either version 2, or (at your option)
227.1355 ++// any later version.
227.1356 ++
227.1357 ++// This library is distributed in the hope that it will be useful,
227.1358 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
227.1359 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
227.1360 ++// GNU General Public License for more details.
227.1361 ++
227.1362 ++// You should have received a copy of the GNU General Public License along
227.1363 ++// with this library; see the file COPYING.  If not, write to the Free
227.1364 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
227.1365 ++// USA.
227.1366 ++
227.1367 ++// As a special exception, you may use this file as part of a free software
227.1368 ++// library without restriction.  Specifically, if other files instantiate
227.1369 ++// templates or use macros or inline functions from this file, or you compile
227.1370 ++// this file and link it with other files to produce an executable, this
227.1371 ++// file does not by itself cause the resulting executable to be covered by
227.1372 ++// the GNU General Public License.  This exception does not however
227.1373 ++// invalidate any other reasons why the executable file might be covered by
227.1374 ++// the GNU General Public License.
227.1375 ++
227.1376 ++//
227.1377 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
227.1378 ++//
227.1379 ++
227.1380 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
227.1381 ++
227.1382 ++#define _LIBC
227.1383 ++#include <locale>
227.1384 ++#undef _LIBC
227.1385 ++#include <bits/c++locale_internal.h>
227.1386 ++
227.1387 ++#ifdef __UCLIBC_MJN3_ONLY__
227.1388 ++#warning optimize this for uclibc
227.1389 ++#warning tailor for stub locale support
227.1390 ++#endif
227.1391 ++
227.1392 ++#ifndef __UCLIBC_HAS_XLOCALE__
227.1393 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
227.1394 ++#endif
227.1395 ++
227.1396 ++namespace std
227.1397 ++{
227.1398 ++  // Construct and return valid pattern consisting of some combination of:
227.1399 ++  // space none symbol sign value
227.1400 ++  money_base::pattern
227.1401 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
227.1402 ++  { 
227.1403 ++    pattern __ret;
227.1404 ++
227.1405 ++    // This insanely complicated routine attempts to construct a valid
227.1406 ++    // pattern for use with monyepunct. A couple of invariants:
227.1407 ++
227.1408 ++    // if (__precedes) symbol -> value
227.1409 ++    // else value -> symbol
227.1410 ++    
227.1411 ++    // if (__space) space
227.1412 ++    // else none
227.1413 ++
227.1414 ++    // none == never first
227.1415 ++    // space never first or last
227.1416 ++
227.1417 ++    // Any elegant implementations of this are welcome.
227.1418 ++    switch (__posn)
227.1419 ++      {
227.1420 ++      case 0:
227.1421 ++      case 1:
227.1422 ++	// 1 The sign precedes the value and symbol.
227.1423 ++	__ret.field[0] = sign;
227.1424 ++	if (__space)
227.1425 ++	  {
227.1426 ++	    // Pattern starts with sign.
227.1427 ++	    if (__precedes)
227.1428 ++	      {
227.1429 ++		__ret.field[1] = symbol;
227.1430 ++		__ret.field[3] = value;
227.1431 ++	      }
227.1432 ++	    else
227.1433 ++	      {
227.1434 ++		__ret.field[1] = value;
227.1435 ++		__ret.field[3] = symbol;
227.1436 ++	      }
227.1437 ++	    __ret.field[2] = space;
227.1438 ++	  }
227.1439 ++	else
227.1440 ++	  {
227.1441 ++	    // Pattern starts with sign and ends with none.
227.1442 ++	    if (__precedes)
227.1443 ++	      {
227.1444 ++		__ret.field[1] = symbol;
227.1445 ++		__ret.field[2] = value;
227.1446 ++	      }
227.1447 ++	    else
227.1448 ++	      {
227.1449 ++		__ret.field[1] = value;
227.1450 ++		__ret.field[2] = symbol;
227.1451 ++	      }
227.1452 ++	    __ret.field[3] = none;
227.1453 ++	  }
227.1454 ++	break;
227.1455 ++      case 2:
227.1456 ++	// 2 The sign follows the value and symbol.
227.1457 ++	if (__space)
227.1458 ++	  {
227.1459 ++	    // Pattern either ends with sign.
227.1460 ++	    if (__precedes)
227.1461 ++	      {
227.1462 ++		__ret.field[0] = symbol;
227.1463 ++		__ret.field[2] = value;
227.1464 ++	      }
227.1465 ++	    else
227.1466 ++	      {
227.1467 ++		__ret.field[0] = value;
227.1468 ++		__ret.field[2] = symbol;
227.1469 ++	      }
227.1470 ++	    __ret.field[1] = space;
227.1471 ++	    __ret.field[3] = sign;
227.1472 ++	  }
227.1473 ++	else
227.1474 ++	  {
227.1475 ++	    // Pattern ends with sign then none.
227.1476 ++	    if (__precedes)
227.1477 ++	      {
227.1478 ++		__ret.field[0] = symbol;
227.1479 ++		__ret.field[1] = value;
227.1480 ++	      }
227.1481 ++	    else
227.1482 ++	      {
227.1483 ++		__ret.field[0] = value;
227.1484 ++		__ret.field[1] = symbol;
227.1485 ++	      }
227.1486 ++	    __ret.field[2] = sign;
227.1487 ++	    __ret.field[3] = none;
227.1488 ++	  }
227.1489 ++	break;
227.1490 ++      case 3:
227.1491 ++	// 3 The sign immediately precedes the symbol.
227.1492 ++	if (__precedes)
227.1493 ++	  {
227.1494 ++	    __ret.field[0] = sign;
227.1495 ++	    __ret.field[1] = symbol;	    
227.1496 ++	    if (__space)
227.1497 ++	      {
227.1498 ++		__ret.field[2] = space;
227.1499 ++		__ret.field[3] = value;
227.1500 ++	      }
227.1501 ++	    else
227.1502 ++	      {
227.1503 ++		__ret.field[2] = value;		
227.1504 ++		__ret.field[3] = none;
227.1505 ++	      }
227.1506 ++	  }
227.1507 ++	else
227.1508 ++	  {
227.1509 ++	    __ret.field[0] = value;
227.1510 ++	    if (__space)
227.1511 ++	      {
227.1512 ++		__ret.field[1] = space;
227.1513 ++		__ret.field[2] = sign;
227.1514 ++		__ret.field[3] = symbol;
227.1515 ++	      }
227.1516 ++	    else
227.1517 ++	      {
227.1518 ++		__ret.field[1] = sign;
227.1519 ++		__ret.field[2] = symbol;
227.1520 ++		__ret.field[3] = none;
227.1521 ++	      }
227.1522 ++	  }
227.1523 ++	break;
227.1524 ++      case 4:
227.1525 ++	// 4 The sign immediately follows the symbol.
227.1526 ++	if (__precedes)
227.1527 ++	  {
227.1528 ++	    __ret.field[0] = symbol;
227.1529 ++	    __ret.field[1] = sign;
227.1530 ++	    if (__space)
227.1531 ++	      {
227.1532 ++		__ret.field[2] = space;
227.1533 ++		__ret.field[3] = value;
227.1534 ++	      }
227.1535 ++	    else
227.1536 ++	      {
227.1537 ++		__ret.field[2] = value;
227.1538 ++		__ret.field[3] = none;
227.1539 ++	      }
227.1540 ++	  }
227.1541 ++	else
227.1542 ++	  {
227.1543 ++	    __ret.field[0] = value;
227.1544 ++	    if (__space)
227.1545 ++	      {
227.1546 ++		__ret.field[1] = space;
227.1547 ++		__ret.field[2] = symbol;
227.1548 ++		__ret.field[3] = sign;
227.1549 ++	      }
227.1550 ++	    else
227.1551 ++	      {
227.1552 ++		__ret.field[1] = symbol;
227.1553 ++		__ret.field[2] = sign;
227.1554 ++		__ret.field[3] = none;
227.1555 ++	      }
227.1556 ++	  }
227.1557 ++	break;
227.1558 ++      default:
227.1559 ++	;
227.1560 ++      }
227.1561 ++    return __ret;
227.1562 ++  }
227.1563 ++
227.1564 ++  template<> 
227.1565 ++    void
227.1566 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
227.1567 ++						     const char*)
227.1568 ++    {
227.1569 ++      if (!_M_data)
227.1570 ++	_M_data = new __moneypunct_cache<char, true>;
227.1571 ++
227.1572 ++      if (!__cloc)
227.1573 ++	{
227.1574 ++	  // "C" locale
227.1575 ++	  _M_data->_M_decimal_point = '.';
227.1576 ++	  _M_data->_M_thousands_sep = ',';
227.1577 ++	  _M_data->_M_grouping = "";
227.1578 ++	  _M_data->_M_grouping_size = 0;
227.1579 ++	  _M_data->_M_curr_symbol = "";
227.1580 ++	  _M_data->_M_curr_symbol_size = 0;
227.1581 ++	  _M_data->_M_positive_sign = "";
227.1582 ++	  _M_data->_M_positive_sign_size = 0;
227.1583 ++	  _M_data->_M_negative_sign = "";
227.1584 ++	  _M_data->_M_negative_sign_size = 0;
227.1585 ++	  _M_data->_M_frac_digits = 0;
227.1586 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
227.1587 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
227.1588 ++
227.1589 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
227.1590 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
227.1591 ++	}
227.1592 ++      else
227.1593 ++	{
227.1594 ++	  // Named locale.
227.1595 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
227.1596 ++							__cloc));
227.1597 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
227.1598 ++							__cloc));
227.1599 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
227.1600 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
227.1601 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
227.1602 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
227.1603 ++
227.1604 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
227.1605 ++	  if (!__nposn)
227.1606 ++	    _M_data->_M_negative_sign = "()";
227.1607 ++	  else
227.1608 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
227.1609 ++							__cloc);
227.1610 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
227.1611 ++
227.1612 ++	  // _Intl == true
227.1613 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
227.1614 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
227.1615 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
227.1616 ++						      __cloc));
227.1617 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
227.1618 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
227.1619 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
227.1620 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
227.1621 ++							__pposn);
227.1622 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
227.1623 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
227.1624 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
227.1625 ++							__nposn);
227.1626 ++	}
227.1627 ++    }
227.1628 ++
227.1629 ++  template<> 
227.1630 ++    void
227.1631 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
227.1632 ++						      const char*)
227.1633 ++    {
227.1634 ++      if (!_M_data)
227.1635 ++	_M_data = new __moneypunct_cache<char, false>;
227.1636 ++
227.1637 ++      if (!__cloc)
227.1638 ++	{
227.1639 ++	  // "C" locale
227.1640 ++	  _M_data->_M_decimal_point = '.';
227.1641 ++	  _M_data->_M_thousands_sep = ',';
227.1642 ++	  _M_data->_M_grouping = "";
227.1643 ++	  _M_data->_M_grouping_size = 0;
227.1644 ++	  _M_data->_M_curr_symbol = "";
227.1645 ++	  _M_data->_M_curr_symbol_size = 0;
227.1646 ++	  _M_data->_M_positive_sign = "";
227.1647 ++	  _M_data->_M_positive_sign_size = 0;
227.1648 ++	  _M_data->_M_negative_sign = "";
227.1649 ++	  _M_data->_M_negative_sign_size = 0;
227.1650 ++	  _M_data->_M_frac_digits = 0;
227.1651 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
227.1652 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
227.1653 ++
227.1654 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
227.1655 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
227.1656 ++	}
227.1657 ++      else
227.1658 ++	{
227.1659 ++	  // Named locale.
227.1660 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
227.1661 ++							__cloc));
227.1662 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
227.1663 ++							__cloc));
227.1664 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
227.1665 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
227.1666 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
227.1667 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
227.1668 ++
227.1669 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
227.1670 ++	  if (!__nposn)
227.1671 ++	    _M_data->_M_negative_sign = "()";
227.1672 ++	  else
227.1673 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
227.1674 ++							__cloc);
227.1675 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
227.1676 ++
227.1677 ++	  // _Intl == false
227.1678 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
227.1679 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
227.1680 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
227.1681 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
227.1682 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
227.1683 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
227.1684 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
227.1685 ++							__pposn);
227.1686 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
227.1687 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
227.1688 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
227.1689 ++							__nposn);
227.1690 ++	}
227.1691 ++    }
227.1692 ++
227.1693 ++  template<> 
227.1694 ++    moneypunct<char, true>::~moneypunct()
227.1695 ++    { delete _M_data; }
227.1696 ++
227.1697 ++  template<> 
227.1698 ++    moneypunct<char, false>::~moneypunct()
227.1699 ++    { delete _M_data; }
227.1700 ++
227.1701 ++#ifdef _GLIBCXX_USE_WCHAR_T
227.1702 ++  template<> 
227.1703 ++    void
227.1704 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
227.1705 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1706 ++							const char*)
227.1707 ++#else
227.1708 ++							const char* __name)
227.1709 ++#endif
227.1710 ++    {
227.1711 ++      if (!_M_data)
227.1712 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
227.1713 ++
227.1714 ++      if (!__cloc)
227.1715 ++	{
227.1716 ++	  // "C" locale
227.1717 ++	  _M_data->_M_decimal_point = L'.';
227.1718 ++	  _M_data->_M_thousands_sep = L',';
227.1719 ++	  _M_data->_M_grouping = "";
227.1720 ++	  _M_data->_M_grouping_size = 0;
227.1721 ++	  _M_data->_M_curr_symbol = L"";
227.1722 ++	  _M_data->_M_curr_symbol_size = 0;
227.1723 ++	  _M_data->_M_positive_sign = L"";
227.1724 ++	  _M_data->_M_positive_sign_size = 0;
227.1725 ++	  _M_data->_M_negative_sign = L"";
227.1726 ++	  _M_data->_M_negative_sign_size = 0;
227.1727 ++	  _M_data->_M_frac_digits = 0;
227.1728 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
227.1729 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
227.1730 ++
227.1731 ++	  // Use ctype::widen code without the facet...
227.1732 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
227.1733 ++	    _M_data->_M_atoms[__i] =
227.1734 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
227.1735 ++	}
227.1736 ++      else
227.1737 ++	{
227.1738 ++	  // Named locale.
227.1739 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1740 ++	  __c_locale __old = __uselocale(__cloc);
227.1741 ++#else
227.1742 ++	  // Switch to named locale so that mbsrtowcs will work.
227.1743 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
227.1744 ++	  setlocale(LC_ALL, __name);
227.1745 ++#endif
227.1746 ++
227.1747 ++#ifdef __UCLIBC_MJN3_ONLY__
227.1748 ++#warning fix this... should be monetary
227.1749 ++#endif
227.1750 ++#ifdef __UCLIBC__
227.1751 ++# ifdef __UCLIBC_HAS_XLOCALE__
227.1752 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
227.1753 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
227.1754 ++# else
227.1755 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
227.1756 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
227.1757 ++# endif
227.1758 ++#else
227.1759 ++	  union { char *__s; wchar_t __w; } __u;
227.1760 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
227.1761 ++	  _M_data->_M_decimal_point = __u.__w;
227.1762 ++
227.1763 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
227.1764 ++	  _M_data->_M_thousands_sep = __u.__w;
227.1765 ++#endif
227.1766 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
227.1767 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
227.1768 ++
227.1769 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
227.1770 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
227.1771 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
227.1772 ++
227.1773 ++	  wchar_t* __wcs_ps = 0;
227.1774 ++	  wchar_t* __wcs_ns = 0;
227.1775 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
227.1776 ++	  try
227.1777 ++	    {
227.1778 ++	      mbstate_t __state;
227.1779 ++	      size_t __len = strlen(__cpossign);
227.1780 ++	      if (__len)
227.1781 ++		{
227.1782 ++		  ++__len;
227.1783 ++		  memset(&__state, 0, sizeof(mbstate_t));
227.1784 ++		  __wcs_ps = new wchar_t[__len];
227.1785 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
227.1786 ++		  _M_data->_M_positive_sign = __wcs_ps;
227.1787 ++		}
227.1788 ++	      else
227.1789 ++		_M_data->_M_positive_sign = L"";
227.1790 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
227.1791 ++	      
227.1792 ++	      __len = strlen(__cnegsign);
227.1793 ++	      if (!__nposn)
227.1794 ++		_M_data->_M_negative_sign = L"()";
227.1795 ++	      else if (__len)
227.1796 ++		{ 
227.1797 ++		  ++__len;
227.1798 ++		  memset(&__state, 0, sizeof(mbstate_t));
227.1799 ++		  __wcs_ns = new wchar_t[__len];
227.1800 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
227.1801 ++		  _M_data->_M_negative_sign = __wcs_ns;
227.1802 ++		}
227.1803 ++	      else
227.1804 ++		_M_data->_M_negative_sign = L"";
227.1805 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
227.1806 ++	      
227.1807 ++	      // _Intl == true.
227.1808 ++	      __len = strlen(__ccurr);
227.1809 ++	      if (__len)
227.1810 ++		{
227.1811 ++		  ++__len;
227.1812 ++		  memset(&__state, 0, sizeof(mbstate_t));
227.1813 ++		  wchar_t* __wcs = new wchar_t[__len];
227.1814 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
227.1815 ++		  _M_data->_M_curr_symbol = __wcs;
227.1816 ++		}
227.1817 ++	      else
227.1818 ++		_M_data->_M_curr_symbol = L"";
227.1819 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
227.1820 ++	    }
227.1821 ++	  catch (...)
227.1822 ++	    {
227.1823 ++	      delete _M_data;
227.1824 ++	      _M_data = 0;
227.1825 ++	      delete __wcs_ps;
227.1826 ++	      delete __wcs_ns;	      
227.1827 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1828 ++	      __uselocale(__old);
227.1829 ++#else
227.1830 ++	      setlocale(LC_ALL, __old);
227.1831 ++	      free(__old);
227.1832 ++#endif
227.1833 ++	      __throw_exception_again;
227.1834 ++	    } 
227.1835 ++	  
227.1836 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
227.1837 ++						      __cloc));
227.1838 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
227.1839 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
227.1840 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
227.1841 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
227.1842 ++							__pposn);
227.1843 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
227.1844 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
227.1845 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
227.1846 ++							__nposn);
227.1847 ++
227.1848 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1849 ++	  __uselocale(__old);
227.1850 ++#else
227.1851 ++	  setlocale(LC_ALL, __old);
227.1852 ++	  free(__old);
227.1853 ++#endif
227.1854 ++	}
227.1855 ++    }
227.1856 ++
227.1857 ++  template<> 
227.1858 ++  void
227.1859 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
227.1860 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1861 ++						       const char*)
227.1862 ++#else
227.1863 ++                                                       const char* __name)
227.1864 ++#endif
227.1865 ++  {
227.1866 ++    if (!_M_data)
227.1867 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
227.1868 ++
227.1869 ++    if (!__cloc)
227.1870 ++	{
227.1871 ++	  // "C" locale
227.1872 ++	  _M_data->_M_decimal_point = L'.';
227.1873 ++	  _M_data->_M_thousands_sep = L',';
227.1874 ++	  _M_data->_M_grouping = "";
227.1875 ++          _M_data->_M_grouping_size = 0;
227.1876 ++	  _M_data->_M_curr_symbol = L"";
227.1877 ++	  _M_data->_M_curr_symbol_size = 0;
227.1878 ++	  _M_data->_M_positive_sign = L"";
227.1879 ++	  _M_data->_M_positive_sign_size = 0;
227.1880 ++	  _M_data->_M_negative_sign = L"";
227.1881 ++	  _M_data->_M_negative_sign_size = 0;
227.1882 ++	  _M_data->_M_frac_digits = 0;
227.1883 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
227.1884 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
227.1885 ++
227.1886 ++	  // Use ctype::widen code without the facet...
227.1887 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
227.1888 ++	    _M_data->_M_atoms[__i] =
227.1889 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
227.1890 ++	}
227.1891 ++      else
227.1892 ++	{
227.1893 ++	  // Named locale.
227.1894 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1895 ++	  __c_locale __old = __uselocale(__cloc);
227.1896 ++#else
227.1897 ++	  // Switch to named locale so that mbsrtowcs will work.
227.1898 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
227.1899 ++	  setlocale(LC_ALL, __name);
227.1900 ++#endif
227.1901 ++
227.1902 ++#ifdef __UCLIBC_MJN3_ONLY__
227.1903 ++#warning fix this... should be monetary
227.1904 ++#endif
227.1905 ++#ifdef __UCLIBC__
227.1906 ++# ifdef __UCLIBC_HAS_XLOCALE__
227.1907 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
227.1908 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
227.1909 ++# else
227.1910 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
227.1911 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
227.1912 ++# endif
227.1913 ++#else
227.1914 ++          union { char *__s; wchar_t __w; } __u;
227.1915 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
227.1916 ++	  _M_data->_M_decimal_point = __u.__w;
227.1917 ++
227.1918 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
227.1919 ++	  _M_data->_M_thousands_sep = __u.__w;
227.1920 ++#endif
227.1921 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
227.1922 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
227.1923 ++
227.1924 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
227.1925 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
227.1926 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
227.1927 ++
227.1928 ++	  wchar_t* __wcs_ps = 0;
227.1929 ++	  wchar_t* __wcs_ns = 0;
227.1930 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
227.1931 ++	  try
227.1932 ++            {
227.1933 ++              mbstate_t __state;
227.1934 ++              size_t __len;
227.1935 ++              __len = strlen(__cpossign);
227.1936 ++              if (__len)
227.1937 ++                {
227.1938 ++		  ++__len;
227.1939 ++		  memset(&__state, 0, sizeof(mbstate_t));
227.1940 ++		  __wcs_ps = new wchar_t[__len];
227.1941 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
227.1942 ++		  _M_data->_M_positive_sign = __wcs_ps;
227.1943 ++		}
227.1944 ++	      else
227.1945 ++		_M_data->_M_positive_sign = L"";
227.1946 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
227.1947 ++	      
227.1948 ++	      __len = strlen(__cnegsign);
227.1949 ++	      if (!__nposn)
227.1950 ++		_M_data->_M_negative_sign = L"()";
227.1951 ++	      else if (__len)
227.1952 ++		{ 
227.1953 ++		  ++__len;
227.1954 ++		  memset(&__state, 0, sizeof(mbstate_t));
227.1955 ++		  __wcs_ns = new wchar_t[__len];
227.1956 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
227.1957 ++		  _M_data->_M_negative_sign = __wcs_ns;
227.1958 ++		}
227.1959 ++	      else
227.1960 ++		_M_data->_M_negative_sign = L"";
227.1961 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
227.1962 ++
227.1963 ++	      // _Intl == true.
227.1964 ++	      __len = strlen(__ccurr);
227.1965 ++	      if (__len)
227.1966 ++		{
227.1967 ++		  ++__len;
227.1968 ++		  memset(&__state, 0, sizeof(mbstate_t));
227.1969 ++		  wchar_t* __wcs = new wchar_t[__len];
227.1970 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
227.1971 ++		  _M_data->_M_curr_symbol = __wcs;
227.1972 ++		}
227.1973 ++	      else
227.1974 ++		_M_data->_M_curr_symbol = L"";
227.1975 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
227.1976 ++	    }
227.1977 ++          catch (...)
227.1978 ++	    {
227.1979 ++	      delete _M_data;
227.1980 ++              _M_data = 0;
227.1981 ++	      delete __wcs_ps;
227.1982 ++	      delete __wcs_ns;	      
227.1983 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.1984 ++	      __uselocale(__old);
227.1985 ++#else
227.1986 ++	      setlocale(LC_ALL, __old);
227.1987 ++	      free(__old);
227.1988 ++#endif
227.1989 ++              __throw_exception_again;
227.1990 ++	    }
227.1991 ++
227.1992 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
227.1993 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
227.1994 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
227.1995 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
227.1996 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
227.1997 ++	                                                __pposn);
227.1998 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
227.1999 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
227.2000 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
227.2001 ++	                                                __nposn);
227.2002 ++
227.2003 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.2004 ++	  __uselocale(__old);
227.2005 ++#else
227.2006 ++	  setlocale(LC_ALL, __old);
227.2007 ++	  free(__old);
227.2008 ++#endif
227.2009 ++	}
227.2010 ++    }
227.2011 ++
227.2012 ++  template<> 
227.2013 ++    moneypunct<wchar_t, true>::~moneypunct()
227.2014 ++    {
227.2015 ++      if (_M_data->_M_positive_sign_size)
227.2016 ++	delete [] _M_data->_M_positive_sign;
227.2017 ++      if (_M_data->_M_negative_sign_size
227.2018 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
227.2019 ++	delete [] _M_data->_M_negative_sign;
227.2020 ++      if (_M_data->_M_curr_symbol_size)
227.2021 ++	delete [] _M_data->_M_curr_symbol;
227.2022 ++      delete _M_data;
227.2023 ++    }
227.2024 ++
227.2025 ++  template<> 
227.2026 ++    moneypunct<wchar_t, false>::~moneypunct()
227.2027 ++    {
227.2028 ++      if (_M_data->_M_positive_sign_size)
227.2029 ++	delete [] _M_data->_M_positive_sign;
227.2030 ++      if (_M_data->_M_negative_sign_size
227.2031 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
227.2032 ++	delete [] _M_data->_M_negative_sign;
227.2033 ++      if (_M_data->_M_curr_symbol_size)
227.2034 ++	delete [] _M_data->_M_curr_symbol;
227.2035 ++      delete _M_data;
227.2036 ++    }
227.2037 ++#endif
227.2038 ++}
227.2039 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
227.2040 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
227.2041 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
227.2042 +@@ -0,0 +1,160 @@
227.2043 ++// std::numpunct implementation details, GNU version -*- C++ -*-
227.2044 ++
227.2045 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
227.2046 ++//
227.2047 ++// This file is part of the GNU ISO C++ Library.  This library is free
227.2048 ++// software; you can redistribute it and/or modify it under the
227.2049 ++// terms of the GNU General Public License as published by the
227.2050 ++// Free Software Foundation; either version 2, or (at your option)
227.2051 ++// any later version.
227.2052 ++
227.2053 ++// This library is distributed in the hope that it will be useful,
227.2054 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
227.2055 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
227.2056 ++// GNU General Public License for more details.
227.2057 ++
227.2058 ++// You should have received a copy of the GNU General Public License along
227.2059 ++// with this library; see the file COPYING.  If not, write to the Free
227.2060 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
227.2061 ++// USA.
227.2062 ++
227.2063 ++// As a special exception, you may use this file as part of a free software
227.2064 ++// library without restriction.  Specifically, if other files instantiate
227.2065 ++// templates or use macros or inline functions from this file, or you compile
227.2066 ++// this file and link it with other files to produce an executable, this
227.2067 ++// file does not by itself cause the resulting executable to be covered by
227.2068 ++// the GNU General Public License.  This exception does not however
227.2069 ++// invalidate any other reasons why the executable file might be covered by
227.2070 ++// the GNU General Public License.
227.2071 ++
227.2072 ++//
227.2073 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
227.2074 ++//
227.2075 ++
227.2076 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
227.2077 ++
227.2078 ++#define _LIBC
227.2079 ++#include <locale>
227.2080 ++#undef _LIBC
227.2081 ++#include <bits/c++locale_internal.h>
227.2082 ++
227.2083 ++#ifdef __UCLIBC_MJN3_ONLY__
227.2084 ++#warning tailor for stub locale support
227.2085 ++#endif
227.2086 ++#ifndef __UCLIBC_HAS_XLOCALE__
227.2087 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
227.2088 ++#endif
227.2089 ++
227.2090 ++namespace std
227.2091 ++{
227.2092 ++  template<> 
227.2093 ++    void
227.2094 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
227.2095 ++    {
227.2096 ++      if (!_M_data)
227.2097 ++	_M_data = new __numpunct_cache<char>;
227.2098 ++
227.2099 ++      if (!__cloc)
227.2100 ++	{
227.2101 ++	  // "C" locale
227.2102 ++	  _M_data->_M_grouping = "";
227.2103 ++	  _M_data->_M_grouping_size = 0;
227.2104 ++	  _M_data->_M_use_grouping = false;
227.2105 ++
227.2106 ++	  _M_data->_M_decimal_point = '.';
227.2107 ++	  _M_data->_M_thousands_sep = ',';
227.2108 ++
227.2109 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
227.2110 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
227.2111 ++
227.2112 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
227.2113 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
227.2114 ++	}
227.2115 ++      else
227.2116 ++	{
227.2117 ++	  // Named locale.
227.2118 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
227.2119 ++							__cloc));
227.2120 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
227.2121 ++							__cloc));
227.2122 ++
227.2123 ++	  // Check for NULL, which implies no grouping.
227.2124 ++	  if (_M_data->_M_thousands_sep == '\0')
227.2125 ++	    _M_data->_M_grouping = "";
227.2126 ++	  else
227.2127 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
227.2128 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
227.2129 ++	}
227.2130 ++
227.2131 ++      // NB: There is no way to extact this info from posix locales.
227.2132 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
227.2133 ++      _M_data->_M_truename = "true";
227.2134 ++      _M_data->_M_truename_size = 4;
227.2135 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
227.2136 ++      _M_data->_M_falsename = "false";
227.2137 ++      _M_data->_M_falsename_size = 5;
227.2138 ++    }
227.2139 ++ 
227.2140 ++  template<> 
227.2141 ++    numpunct<char>::~numpunct()
227.2142 ++    { delete _M_data; }
227.2143 ++   
227.2144 ++#ifdef _GLIBCXX_USE_WCHAR_T
227.2145 ++  template<> 
227.2146 ++    void
227.2147 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
227.2148 ++    {
227.2149 ++      if (!_M_data)
227.2150 ++	_M_data = new __numpunct_cache<wchar_t>;
227.2151 ++
227.2152 ++      if (!__cloc)
227.2153 ++	{
227.2154 ++	  // "C" locale
227.2155 ++	  _M_data->_M_grouping = "";
227.2156 ++	  _M_data->_M_grouping_size = 0;
227.2157 ++	  _M_data->_M_use_grouping = false;
227.2158 ++
227.2159 ++	  _M_data->_M_decimal_point = L'.';
227.2160 ++	  _M_data->_M_thousands_sep = L',';
227.2161 ++
227.2162 ++	  // Use ctype::widen code without the facet...
227.2163 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
227.2164 ++	    _M_data->_M_atoms_out[__i] =
227.2165 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
227.2166 ++
227.2167 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
227.2168 ++	    _M_data->_M_atoms_in[__j] =
227.2169 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
227.2170 ++	}
227.2171 ++      else
227.2172 ++	{
227.2173 ++	  // Named locale.
227.2174 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
227.2175 ++	  union { char *__s; wchar_t __w; } __u;
227.2176 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
227.2177 ++	  _M_data->_M_decimal_point = __u.__w;
227.2178 ++
227.2179 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
227.2180 ++	  _M_data->_M_thousands_sep = __u.__w;
227.2181 ++
227.2182 ++	  if (_M_data->_M_thousands_sep == L'\0')
227.2183 ++	    _M_data->_M_grouping = "";
227.2184 ++	  else
227.2185 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
227.2186 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
227.2187 ++	}
227.2188 ++
227.2189 ++      // NB: There is no way to extact this info from posix locales.
227.2190 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
227.2191 ++      _M_data->_M_truename = L"true";
227.2192 ++      _M_data->_M_truename_size = 4;
227.2193 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
227.2194 ++      _M_data->_M_falsename = L"false";
227.2195 ++      _M_data->_M_falsename_size = 5;
227.2196 ++    }
227.2197 ++
227.2198 ++  template<> 
227.2199 ++    numpunct<wchar_t>::~numpunct()
227.2200 ++    { delete _M_data; }
227.2201 ++ #endif
227.2202 ++}
227.2203 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
227.2204 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
227.2205 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
227.2206 +@@ -0,0 +1,406 @@
227.2207 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
227.2208 ++
227.2209 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
227.2210 ++//
227.2211 ++// This file is part of the GNU ISO C++ Library.  This library is free
227.2212 ++// software; you can redistribute it and/or modify it under the
227.2213 ++// terms of the GNU General Public License as published by the
227.2214 ++// Free Software Foundation; either version 2, or (at your option)
227.2215 ++// any later version.
227.2216 ++
227.2217 ++// This library is distributed in the hope that it will be useful,
227.2218 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
227.2219 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
227.2220 ++// GNU General Public License for more details.
227.2221 ++
227.2222 ++// You should have received a copy of the GNU General Public License along
227.2223 ++// with this library; see the file COPYING.  If not, write to the Free
227.2224 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
227.2225 ++// USA.
227.2226 ++
227.2227 ++// As a special exception, you may use this file as part of a free software
227.2228 ++// library without restriction.  Specifically, if other files instantiate
227.2229 ++// templates or use macros or inline functions from this file, or you compile
227.2230 ++// this file and link it with other files to produce an executable, this
227.2231 ++// file does not by itself cause the resulting executable to be covered by
227.2232 ++// the GNU General Public License.  This exception does not however
227.2233 ++// invalidate any other reasons why the executable file might be covered by
227.2234 ++// the GNU General Public License.
227.2235 ++
227.2236 ++//
227.2237 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
227.2238 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
227.2239 ++//
227.2240 ++
227.2241 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
227.2242 ++
227.2243 ++#include <locale>
227.2244 ++#include <bits/c++locale_internal.h>
227.2245 ++
227.2246 ++#ifdef __UCLIBC_MJN3_ONLY__
227.2247 ++#warning tailor for stub locale support
227.2248 ++#endif
227.2249 ++#ifndef __UCLIBC_HAS_XLOCALE__
227.2250 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
227.2251 ++#endif
227.2252 ++
227.2253 ++namespace std
227.2254 ++{
227.2255 ++  template<>
227.2256 ++    void
227.2257 ++    __timepunct<char>::
227.2258 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
227.2259 ++	   const tm* __tm) const
227.2260 ++    {
227.2261 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.2262 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
227.2263 ++					_M_c_locale_timepunct);
227.2264 ++#else
227.2265 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
227.2266 ++      setlocale(LC_ALL, _M_name_timepunct);
227.2267 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
227.2268 ++      setlocale(LC_ALL, __old);
227.2269 ++      free(__old);
227.2270 ++#endif
227.2271 ++      // Make sure __s is null terminated.
227.2272 ++      if (__len == 0)
227.2273 ++	__s[0] = '\0';
227.2274 ++    }
227.2275 ++
227.2276 ++  template<> 
227.2277 ++    void
227.2278 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
227.2279 ++    {
227.2280 ++      if (!_M_data)
227.2281 ++	_M_data = new __timepunct_cache<char>;
227.2282 ++
227.2283 ++      if (!__cloc)
227.2284 ++	{
227.2285 ++	  // "C" locale
227.2286 ++	  _M_c_locale_timepunct = _S_get_c_locale();
227.2287 ++
227.2288 ++	  _M_data->_M_date_format = "%m/%d/%y";
227.2289 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
227.2290 ++	  _M_data->_M_time_format = "%H:%M:%S";
227.2291 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
227.2292 ++	  _M_data->_M_date_time_format = "";
227.2293 ++	  _M_data->_M_date_time_era_format = "";
227.2294 ++	  _M_data->_M_am = "AM";
227.2295 ++	  _M_data->_M_pm = "PM";
227.2296 ++	  _M_data->_M_am_pm_format = "";
227.2297 ++
227.2298 ++	  // Day names, starting with "C"'s Sunday.
227.2299 ++	  _M_data->_M_day1 = "Sunday";
227.2300 ++	  _M_data->_M_day2 = "Monday";
227.2301 ++	  _M_data->_M_day3 = "Tuesday";
227.2302 ++	  _M_data->_M_day4 = "Wednesday";
227.2303 ++	  _M_data->_M_day5 = "Thursday";
227.2304 ++	  _M_data->_M_day6 = "Friday";
227.2305 ++	  _M_data->_M_day7 = "Saturday";
227.2306 ++
227.2307 ++	  // Abbreviated day names, starting with "C"'s Sun.
227.2308 ++	  _M_data->_M_aday1 = "Sun";
227.2309 ++	  _M_data->_M_aday2 = "Mon";
227.2310 ++	  _M_data->_M_aday3 = "Tue";
227.2311 ++	  _M_data->_M_aday4 = "Wed";
227.2312 ++	  _M_data->_M_aday5 = "Thu";
227.2313 ++	  _M_data->_M_aday6 = "Fri";
227.2314 ++	  _M_data->_M_aday7 = "Sat";
227.2315 ++
227.2316 ++	  // Month names, starting with "C"'s January.
227.2317 ++	  _M_data->_M_month01 = "January";
227.2318 ++	  _M_data->_M_month02 = "February";
227.2319 ++	  _M_data->_M_month03 = "March";
227.2320 ++	  _M_data->_M_month04 = "April";
227.2321 ++	  _M_data->_M_month05 = "May";
227.2322 ++	  _M_data->_M_month06 = "June";
227.2323 ++	  _M_data->_M_month07 = "July";
227.2324 ++	  _M_data->_M_month08 = "August";
227.2325 ++	  _M_data->_M_month09 = "September";
227.2326 ++	  _M_data->_M_month10 = "October";
227.2327 ++	  _M_data->_M_month11 = "November";
227.2328 ++	  _M_data->_M_month12 = "December";
227.2329 ++
227.2330 ++	  // Abbreviated month names, starting with "C"'s Jan.
227.2331 ++	  _M_data->_M_amonth01 = "Jan";
227.2332 ++	  _M_data->_M_amonth02 = "Feb";
227.2333 ++	  _M_data->_M_amonth03 = "Mar";
227.2334 ++	  _M_data->_M_amonth04 = "Apr";
227.2335 ++	  _M_data->_M_amonth05 = "May";
227.2336 ++	  _M_data->_M_amonth06 = "Jun";
227.2337 ++	  _M_data->_M_amonth07 = "Jul";
227.2338 ++	  _M_data->_M_amonth08 = "Aug";
227.2339 ++	  _M_data->_M_amonth09 = "Sep";
227.2340 ++	  _M_data->_M_amonth10 = "Oct";
227.2341 ++	  _M_data->_M_amonth11 = "Nov";
227.2342 ++	  _M_data->_M_amonth12 = "Dec";
227.2343 ++	}
227.2344 ++      else
227.2345 ++	{
227.2346 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
227.2347 ++
227.2348 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
227.2349 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
227.2350 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
227.2351 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
227.2352 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
227.2353 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
227.2354 ++							     __cloc);
227.2355 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
227.2356 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
227.2357 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
227.2358 ++
227.2359 ++	  // Day names, starting with "C"'s Sunday.
227.2360 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
227.2361 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
227.2362 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
227.2363 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
227.2364 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
227.2365 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
227.2366 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
227.2367 ++
227.2368 ++	  // Abbreviated day names, starting with "C"'s Sun.
227.2369 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
227.2370 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
227.2371 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
227.2372 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
227.2373 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
227.2374 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
227.2375 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
227.2376 ++
227.2377 ++	  // Month names, starting with "C"'s January.
227.2378 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
227.2379 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
227.2380 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
227.2381 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
227.2382 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
227.2383 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
227.2384 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
227.2385 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
227.2386 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
227.2387 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
227.2388 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
227.2389 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
227.2390 ++
227.2391 ++	  // Abbreviated month names, starting with "C"'s Jan.
227.2392 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
227.2393 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
227.2394 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
227.2395 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
227.2396 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
227.2397 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
227.2398 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
227.2399 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
227.2400 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
227.2401 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
227.2402 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
227.2403 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
227.2404 ++	}
227.2405 ++    }
227.2406 ++
227.2407 ++#ifdef _GLIBCXX_USE_WCHAR_T
227.2408 ++  template<>
227.2409 ++    void
227.2410 ++    __timepunct<wchar_t>::
227.2411 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
227.2412 ++	   const tm* __tm) const
227.2413 ++    {
227.2414 ++#ifdef __UCLIBC_HAS_XLOCALE__
227.2415 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
227.2416 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
227.2417 ++					_M_c_locale_timepunct);
227.2418 ++#else
227.2419 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
227.2420 ++      setlocale(LC_ALL, _M_name_timepunct);
227.2421 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
227.2422 ++      setlocale(LC_ALL, __old);
227.2423 ++      free(__old);
227.2424 ++#endif
227.2425 ++      // Make sure __s is null terminated.
227.2426 ++      if (__len == 0)
227.2427 ++	__s[0] = L'\0';
227.2428 ++    }
227.2429 ++
227.2430 ++  template<> 
227.2431 ++    void
227.2432 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
227.2433 ++    {
227.2434 ++      if (!_M_data)
227.2435 ++	_M_data = new __timepunct_cache<wchar_t>;
227.2436 ++
227.2437 ++#warning wide time stuff
227.2438 ++//       if (!__cloc)
227.2439 ++	{
227.2440 ++	  // "C" locale
227.2441 ++	  _M_c_locale_timepunct = _S_get_c_locale();
227.2442 ++
227.2443 ++	  _M_data->_M_date_format = L"%m/%d/%y";
227.2444 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
227.2445 ++	  _M_data->_M_time_format = L"%H:%M:%S";
227.2446 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
227.2447 ++	  _M_data->_M_date_time_format = L"";
227.2448 ++	  _M_data->_M_date_time_era_format = L"";
227.2449 ++	  _M_data->_M_am = L"AM";
227.2450 ++	  _M_data->_M_pm = L"PM";
227.2451 ++	  _M_data->_M_am_pm_format = L"";
227.2452 ++
227.2453 ++	  // Day names, starting with "C"'s Sunday.
227.2454 ++	  _M_data->_M_day1 = L"Sunday";
227.2455 ++	  _M_data->_M_day2 = L"Monday";
227.2456 ++	  _M_data->_M_day3 = L"Tuesday";
227.2457 ++	  _M_data->_M_day4 = L"Wednesday";
227.2458 ++	  _M_data->_M_day5 = L"Thursday";
227.2459 ++	  _M_data->_M_day6 = L"Friday";
227.2460 ++	  _M_data->_M_day7 = L"Saturday";
227.2461 ++
227.2462 ++	  // Abbreviated day names, starting with "C"'s Sun.
227.2463 ++	  _M_data->_M_aday1 = L"Sun";
227.2464 ++	  _M_data->_M_aday2 = L"Mon";
227.2465 ++	  _M_data->_M_aday3 = L"Tue";
227.2466 ++	  _M_data->_M_aday4 = L"Wed";
227.2467 ++	  _M_data->_M_aday5 = L"Thu";
227.2468 ++	  _M_data->_M_aday6 = L"Fri";
227.2469 ++	  _M_data->_M_aday7 = L"Sat";
227.2470 ++
227.2471 ++	  // Month names, starting with "C"'s January.
227.2472 ++	  _M_data->_M_month01 = L"January";
227.2473 ++	  _M_data->_M_month02 = L"February";
227.2474 ++	  _M_data->_M_month03 = L"March";
227.2475 ++	  _M_data->_M_month04 = L"April";
227.2476 ++	  _M_data->_M_month05 = L"May";
227.2477 ++	  _M_data->_M_month06 = L"June";
227.2478 ++	  _M_data->_M_month07 = L"July";
227.2479 ++	  _M_data->_M_month08 = L"August";
227.2480 ++	  _M_data->_M_month09 = L"September";
227.2481 ++	  _M_data->_M_month10 = L"October";
227.2482 ++	  _M_data->_M_month11 = L"November";
227.2483 ++	  _M_data->_M_month12 = L"December";
227.2484 ++
227.2485 ++	  // Abbreviated month names, starting with "C"'s Jan.
227.2486 ++	  _M_data->_M_amonth01 = L"Jan";
227.2487 ++	  _M_data->_M_amonth02 = L"Feb";
227.2488 ++	  _M_data->_M_amonth03 = L"Mar";
227.2489 ++	  _M_data->_M_amonth04 = L"Apr";
227.2490 ++	  _M_data->_M_amonth05 = L"May";
227.2491 ++	  _M_data->_M_amonth06 = L"Jun";
227.2492 ++	  _M_data->_M_amonth07 = L"Jul";
227.2493 ++	  _M_data->_M_amonth08 = L"Aug";
227.2494 ++	  _M_data->_M_amonth09 = L"Sep";
227.2495 ++	  _M_data->_M_amonth10 = L"Oct";
227.2496 ++	  _M_data->_M_amonth11 = L"Nov";
227.2497 ++	  _M_data->_M_amonth12 = L"Dec";
227.2498 ++	}
227.2499 ++#if 0
227.2500 ++      else
227.2501 ++	{
227.2502 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
227.2503 ++
227.2504 ++	  union { char *__s; wchar_t *__w; } __u;
227.2505 ++
227.2506 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
227.2507 ++	  _M_data->_M_date_format = __u.__w;
227.2508 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
227.2509 ++	  _M_data->_M_date_era_format = __u.__w;
227.2510 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
227.2511 ++	  _M_data->_M_time_format = __u.__w;
227.2512 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
227.2513 ++	  _M_data->_M_time_era_format = __u.__w;
227.2514 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
227.2515 ++	  _M_data->_M_date_time_format = __u.__w;
227.2516 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
227.2517 ++	  _M_data->_M_date_time_era_format = __u.__w;
227.2518 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
227.2519 ++	  _M_data->_M_am = __u.__w;
227.2520 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
227.2521 ++	  _M_data->_M_pm = __u.__w;
227.2522 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
227.2523 ++	  _M_data->_M_am_pm_format = __u.__w;
227.2524 ++
227.2525 ++	  // Day names, starting with "C"'s Sunday.
227.2526 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
227.2527 ++	  _M_data->_M_day1 = __u.__w;
227.2528 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
227.2529 ++	  _M_data->_M_day2 = __u.__w;
227.2530 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
227.2531 ++	  _M_data->_M_day3 = __u.__w;
227.2532 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
227.2533 ++	  _M_data->_M_day4 = __u.__w;
227.2534 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
227.2535 ++	  _M_data->_M_day5 = __u.__w;
227.2536 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
227.2537 ++	  _M_data->_M_day6 = __u.__w;
227.2538 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
227.2539 ++	  _M_data->_M_day7 = __u.__w;
227.2540 ++
227.2541 ++	  // Abbreviated day names, starting with "C"'s Sun.
227.2542 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
227.2543 ++	  _M_data->_M_aday1 = __u.__w;
227.2544 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
227.2545 ++	  _M_data->_M_aday2 = __u.__w;
227.2546 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
227.2547 ++	  _M_data->_M_aday3 = __u.__w;
227.2548 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
227.2549 ++	  _M_data->_M_aday4 = __u.__w;
227.2550 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
227.2551 ++	  _M_data->_M_aday5 = __u.__w;
227.2552 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
227.2553 ++	  _M_data->_M_aday6 = __u.__w;
227.2554 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
227.2555 ++	  _M_data->_M_aday7 = __u.__w;
227.2556 ++
227.2557 ++	  // Month names, starting with "C"'s January.
227.2558 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
227.2559 ++	  _M_data->_M_month01 = __u.__w;
227.2560 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
227.2561 ++	  _M_data->_M_month02 = __u.__w;
227.2562 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
227.2563 ++	  _M_data->_M_month03 = __u.__w;
227.2564 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
227.2565 ++	  _M_data->_M_month04 = __u.__w;
227.2566 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
227.2567 ++	  _M_data->_M_month05 = __u.__w;
227.2568 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
227.2569 ++	  _M_data->_M_month06 = __u.__w;
227.2570 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
227.2571 ++	  _M_data->_M_month07 = __u.__w;
227.2572 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
227.2573 ++	  _M_data->_M_month08 = __u.__w;
227.2574 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
227.2575 ++	  _M_data->_M_month09 = __u.__w;
227.2576 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
227.2577 ++	  _M_data->_M_month10 = __u.__w;
227.2578 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
227.2579 ++	  _M_data->_M_month11 = __u.__w;
227.2580 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
227.2581 ++	  _M_data->_M_month12 = __u.__w;
227.2582 ++
227.2583 ++	  // Abbreviated month names, starting with "C"'s Jan.
227.2584 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
227.2585 ++	  _M_data->_M_amonth01 = __u.__w;
227.2586 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
227.2587 ++	  _M_data->_M_amonth02 = __u.__w;
227.2588 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
227.2589 ++	  _M_data->_M_amonth03 = __u.__w;
227.2590 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
227.2591 ++	  _M_data->_M_amonth04 = __u.__w;
227.2592 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
227.2593 ++	  _M_data->_M_amonth05 = __u.__w;
227.2594 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
227.2595 ++	  _M_data->_M_amonth06 = __u.__w;
227.2596 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
227.2597 ++	  _M_data->_M_amonth07 = __u.__w;
227.2598 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
227.2599 ++	  _M_data->_M_amonth08 = __u.__w;
227.2600 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
227.2601 ++	  _M_data->_M_amonth09 = __u.__w;
227.2602 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
227.2603 ++	  _M_data->_M_amonth10 = __u.__w;
227.2604 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
227.2605 ++	  _M_data->_M_amonth11 = __u.__w;
227.2606 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
227.2607 ++	  _M_data->_M_amonth12 = __u.__w;
227.2608 ++	}
227.2609 ++#endif // 0
227.2610 ++    }
227.2611 ++#endif
227.2612 ++}
227.2613 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
227.2614 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
227.2615 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
227.2616 +@@ -0,0 +1,68 @@
227.2617 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
227.2618 ++
227.2619 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
227.2620 ++//
227.2621 ++// This file is part of the GNU ISO C++ Library.  This library is free
227.2622 ++// software; you can redistribute it and/or modify it under the
227.2623 ++// terms of the GNU General Public License as published by the
227.2624 ++// Free Software Foundation; either version 2, or (at your option)
227.2625 ++// any later version.
227.2626 ++
227.2627 ++// This library is distributed in the hope that it will be useful,
227.2628 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
227.2629 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
227.2630 ++// GNU General Public License for more details.
227.2631 ++
227.2632 ++// You should have received a copy of the GNU General Public License along
227.2633 ++// with this library; see the file COPYING.  If not, write to the Free
227.2634 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
227.2635 ++// USA.
227.2636 ++
227.2637 ++// As a special exception, you may use this file as part of a free software
227.2638 ++// library without restriction.  Specifically, if other files instantiate
227.2639 ++// templates or use macros or inline functions from this file, or you compile
227.2640 ++// this file and link it with other files to produce an executable, this
227.2641 ++// file does not by itself cause the resulting executable to be covered by
227.2642 ++// the GNU General Public License.  This exception does not however
227.2643 ++// invalidate any other reasons why the executable file might be covered by
227.2644 ++// the GNU General Public License.
227.2645 ++
227.2646 ++//
227.2647 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
227.2648 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
227.2649 ++//
227.2650 ++
227.2651 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
227.2652 ++
227.2653 ++  template<typename _CharT>
227.2654 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
227.2655 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
227.2656 ++    _M_name_timepunct(_S_get_c_name())
227.2657 ++    { _M_initialize_timepunct(); }
227.2658 ++
227.2659 ++  template<typename _CharT>
227.2660 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
227.2661 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
227.2662 ++    _M_name_timepunct(_S_get_c_name())
227.2663 ++    { _M_initialize_timepunct(); }
227.2664 ++
227.2665 ++  template<typename _CharT>
227.2666 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
227.2667 ++				     size_t __refs) 
227.2668 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
227.2669 ++    _M_name_timepunct(__s)
227.2670 ++    { 
227.2671 ++      char* __tmp = new char[std::strlen(__s) + 1];
227.2672 ++      std::strcpy(__tmp, __s);
227.2673 ++      _M_name_timepunct = __tmp;
227.2674 ++      _M_initialize_timepunct(__cloc); 
227.2675 ++    }
227.2676 ++
227.2677 ++  template<typename _CharT>
227.2678 ++    __timepunct<_CharT>::~__timepunct()
227.2679 ++    { 
227.2680 ++      if (_M_name_timepunct != _S_get_c_name())
227.2681 ++	delete [] _M_name_timepunct;
227.2682 ++      delete _M_data; 
227.2683 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
227.2684 ++    }
227.2685 +diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
227.2686 +--- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:29:22.000000000 +0200
227.2687 ++++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
227.2688 +@@ -5769,7 +5769,7 @@
227.2689 +   enableval="$enable_clocale"
227.2690 + 
227.2691 +       case "$enableval" in
227.2692 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
227.2693 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
227.2694 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
227.2695 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
227.2696 +    { (exit 1); exit 1; }; } ;;
227.2697 +@@ -5802,6 +5802,9 @@
227.2698 +   # Default to "generic".
227.2699 +   if test $enable_clocale_flag = auto; then
227.2700 +     case ${target_os} in
227.2701 ++      linux-uclibc*)
227.2702 ++        enable_clocale_flag=uclibc
227.2703 ++	;;
227.2704 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
227.2705 +         enable_clocale_flag=gnu
227.2706 +         ;;
227.2707 +@@ -6190,6 +6193,76 @@
227.2708 +       CTIME_CC=config/locale/generic/time_members.cc
227.2709 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
227.2710 +       ;;
227.2711 ++    uclibc)
227.2712 ++      echo "$as_me:$LINENO: result: uclibc" >&5
227.2713 ++echo "${ECHO_T}uclibc" >&6
227.2714 ++
227.2715 ++      # Declare intention to use gettext, and add support for specific
227.2716 ++      # languages.
227.2717 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
227.2718 ++      ALL_LINGUAS="de fr"
227.2719 ++
227.2720 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
227.2721 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
227.2722 ++set dummy msgfmt; ac_word=$2
227.2723 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
227.2724 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
227.2725 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
227.2726 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
227.2727 ++else
227.2728 ++  if test -n "$check_msgfmt"; then
227.2729 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
227.2730 ++else
227.2731 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
227.2732 ++for as_dir in $PATH
227.2733 ++do
227.2734 ++  IFS=$as_save_IFS
227.2735 ++  test -z "$as_dir" && as_dir=.
227.2736 ++  for ac_exec_ext in '' $ac_executable_extensions; do
227.2737 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
227.2738 ++    ac_cv_prog_check_msgfmt="yes"
227.2739 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
227.2740 ++    break 2
227.2741 ++  fi
227.2742 ++done
227.2743 ++done
227.2744 ++
227.2745 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
227.2746 ++fi
227.2747 ++fi
227.2748 ++check_msgfmt=$ac_cv_prog_check_msgfmt
227.2749 ++if test -n "$check_msgfmt"; then
227.2750 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
227.2751 ++echo "${ECHO_T}$check_msgfmt" >&6
227.2752 ++else
227.2753 ++  echo "$as_me:$LINENO: result: no" >&5
227.2754 ++echo "${ECHO_T}no" >&6
227.2755 ++fi
227.2756 ++
227.2757 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
227.2758 ++        USE_NLS=yes
227.2759 ++      fi
227.2760 ++      # Export the build objects.
227.2761 ++      for ling in $ALL_LINGUAS; do \
227.2762 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
227.2763 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
227.2764 ++      done
227.2765 ++
227.2766 ++
227.2767 ++
227.2768 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
227.2769 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
227.2770 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
227.2771 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
227.2772 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
227.2773 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
227.2774 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
227.2775 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
227.2776 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
227.2777 ++      CTIME_H=config/locale/uclibc/time_members.h
227.2778 ++      CTIME_CC=config/locale/uclibc/time_members.cc
227.2779 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
227.2780 ++      ;;
227.2781 +   esac
227.2782 + 
227.2783 +   # This is where the testsuite looks for locale catalogs, using the
227.2784 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h
227.2785 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2005-08-17 04:28:44.000000000 +0200
227.2786 ++++ gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h	2007-08-03 20:30:21.000000000 +0200
227.2787 +@@ -101,7 +101,9 @@
227.2788 + using std::wmemcpy;
227.2789 + using std::wmemmove;
227.2790 + using std::wmemset;
227.2791 ++#if _GLIBCXX_HAVE_WCSFTIME
227.2792 + using std::wcsftime;
227.2793 ++#endif
227.2794 + 
227.2795 + #if _GLIBCXX_USE_C99
227.2796 + using std::wcstold;
227.2797 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h
227.2798 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h	2006-12-07 10:33:51.000000000 +0100
227.2799 ++++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h	2007-08-03 20:30:21.000000000 +0200
227.2800 +@@ -182,7 +182,9 @@
227.2801 +   using ::wcscoll;
227.2802 +   using ::wcscpy;
227.2803 +   using ::wcscspn;
227.2804 ++#if _GLIBCXX_HAVE_WCSFTIME
227.2805 +   using ::wcsftime;
227.2806 ++#endif
227.2807 +   using ::wcslen;
227.2808 +   using ::wcsncat;
227.2809 +   using ::wcsncmp;
   228.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   228.2 +++ b/patches/gcc/4.2.1/130-uclibc-locale-no__x.patch	Mon Jul 28 21:32:33 2008 +0000
   228.3 @@ -0,0 +1,223 @@
   228.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   228.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
   228.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   228.7 +@@ -39,20 +39,6 @@
   228.8 + #include <langinfo.h>
   228.9 + #include <bits/c++locale_internal.h>
  228.10 + 
  228.11 +-#ifndef __UCLIBC_HAS_XLOCALE__
  228.12 +-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  228.13 +-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  228.14 +-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  228.15 +-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  228.16 +-#define __strtof_l(S, E, L)         strtof((S), (E))
  228.17 +-#define __strtod_l(S, E, L)         strtod((S), (E))
  228.18 +-#define __strtold_l(S, E, L)        strtold((S), (E))
  228.19 +-#warning should dummy __newlocale check for C|POSIX ?
  228.20 +-#define __newlocale(a, b, c)        NULL
  228.21 +-#define __freelocale(a)             ((void)0)
  228.22 +-#define __duplocale(a)              __c_locale()
  228.23 +-#endif
  228.24 +-
  228.25 + namespace std 
  228.26 + {
  228.27 +   template<>
  228.28 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  228.29 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
  228.30 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  228.31 +@@ -68,6 +68,7 @@
  228.32 + {
  228.33 +   extern "C" __typeof(uselocale) __uselocale;
  228.34 + }
  228.35 ++#define __uselocale uselocale
  228.36 + #endif
  228.37 + 
  228.38 + namespace std
  228.39 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  228.40 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
  228.41 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:53.000000000 +0200
  228.42 +@@ -60,4 +60,49 @@
  228.43 + extern "C" __typeof(wctype_l) __wctype_l;
  228.44 + #endif 
  228.45 + 
  228.46 ++# define __nl_langinfo_l nl_langinfo_l
  228.47 ++# define __strcoll_l strcoll_l
  228.48 ++# define __strftime_l strftime_l
  228.49 ++# define __strtod_l strtod_l
  228.50 ++# define __strtof_l strtof_l
  228.51 ++# define __strtold_l strtold_l
  228.52 ++# define __strxfrm_l strxfrm_l
  228.53 ++# define __newlocale newlocale
  228.54 ++# define __freelocale freelocale
  228.55 ++# define __duplocale duplocale
  228.56 ++# define __uselocale uselocale
  228.57 ++
  228.58 ++# ifdef _GLIBCXX_USE_WCHAR_T
  228.59 ++#  define __iswctype_l iswctype_l
  228.60 ++#  define __towlower_l towlower_l
  228.61 ++#  define __towupper_l towupper_l
  228.62 ++#  define __wcscoll_l wcscoll_l
  228.63 ++#  define __wcsftime_l wcsftime_l
  228.64 ++#  define __wcsxfrm_l wcsxfrm_l
  228.65 ++#  define __wctype_l wctype_l
  228.66 ++# endif
  228.67 ++
  228.68 ++#else
  228.69 ++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  228.70 ++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  228.71 ++# define __strtod_l(S, E, L)         strtod((S), (E))
  228.72 ++# define __strtof_l(S, E, L)         strtof((S), (E))
  228.73 ++# define __strtold_l(S, E, L)        strtold((S), (E))
  228.74 ++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  228.75 ++# warning should dummy __newlocale check for C|POSIX ?
  228.76 ++# define __newlocale(a, b, c)        NULL
  228.77 ++# define __freelocale(a)             ((void)0)
  228.78 ++# define __duplocale(a)              __c_locale()
  228.79 ++//# define __uselocale ?
  228.80 ++//
  228.81 ++# ifdef _GLIBCXX_USE_WCHAR_T
  228.82 ++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  228.83 ++#  define __towlower_l(C, L)          towlower((C))
  228.84 ++#  define __towupper_l(C, L)          towupper((C))
  228.85 ++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  228.86 ++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  228.87 ++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  228.88 ++#  define __wctype_l(S, L)            wctype((S))
  228.89 ++# endif
  228.90 ++
  228.91 + #endif // GLIBC 2.3 and later
  228.92 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
  228.93 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
  228.94 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:53.000000000 +0200
  228.95 +@@ -36,13 +36,6 @@
  228.96 + #include <locale>
  228.97 + #include <bits/c++locale_internal.h>
  228.98 + 
  228.99 +-#ifndef __UCLIBC_HAS_XLOCALE__
 228.100 +-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 228.101 +-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 228.102 +-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 228.103 +-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 228.104 +-#endif
 228.105 +-
 228.106 + namespace std
 228.107 + {
 228.108 +   // These are basically extensions to char_traits, and perhaps should
 228.109 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 228.110 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 228.111 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 228.112 +@@ -38,13 +38,6 @@
 228.113 + #undef _LIBC
 228.114 + #include <bits/c++locale_internal.h>
 228.115 + 
 228.116 +-#ifndef __UCLIBC_HAS_XLOCALE__
 228.117 +-#define __wctype_l(S, L)           wctype((S))
 228.118 +-#define __towupper_l(C, L)         towupper((C))
 228.119 +-#define __towlower_l(C, L)         towlower((C))
 228.120 +-#define __iswctype_l(C, M, L)      iswctype((C), (M))
 228.121 +-#endif
 228.122 +-
 228.123 + namespace std
 228.124 + {
 228.125 +   // NB: The other ctype<char> specializations are in src/locale.cc and
 228.126 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
 228.127 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
 228.128 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:53.000000000 +0200
 228.129 +@@ -39,13 +39,10 @@
 228.130 + #ifdef __UCLIBC_MJN3_ONLY__
 228.131 + #warning fix gettext stuff
 228.132 + #endif
 228.133 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 228.134 +-extern "C" char *__dcgettext(const char *domainname,
 228.135 +-			     const char *msgid, int category);
 228.136 + #undef gettext
 228.137 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 228.138 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 228.139 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 228.140 + #else
 228.141 +-#undef gettext
 228.142 + #define gettext(msgid) (msgid)
 228.143 + #endif
 228.144 + 
 228.145 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 228.146 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
 228.147 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 228.148 +@@ -36,15 +36,11 @@
 228.149 + #ifdef __UCLIBC_MJN3_ONLY__
 228.150 + #warning fix prototypes for *textdomain funcs
 228.151 + #endif
 228.152 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 228.153 +-extern "C" char *__textdomain(const char *domainname);
 228.154 +-extern "C" char *__bindtextdomain(const char *domainname,
 228.155 +-				  const char *dirname);
 228.156 +-#else
 228.157 +-#undef __textdomain
 228.158 +-#undef __bindtextdomain
 228.159 +-#define __textdomain(D)           ((void)0)
 228.160 +-#define __bindtextdomain(D,P)     ((void)0)
 228.161 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 228.162 ++#undef textdomain
 228.163 ++#undef bindtextdomain
 228.164 ++#define textdomain(D)           ((void)0)
 228.165 ++#define bindtextdomain(D,P)     ((void)0)
 228.166 + #endif
 228.167 + 
 228.168 +   // Non-virtual member functions.
 228.169 +@@ -70,7 +66,7 @@
 228.170 +     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 228.171 + 			   const char* __dir) const
 228.172 +     { 
 228.173 +-      __bindtextdomain(__s.c_str(), __dir);
 228.174 ++      bindtextdomain(__s.c_str(), __dir);
 228.175 +       return this->do_open(__s, __loc); 
 228.176 +     }
 228.177 + 
 228.178 +@@ -90,7 +86,7 @@
 228.179 +     { 
 228.180 +       // No error checking is done, assume the catalog exists and can
 228.181 +       // be used.
 228.182 +-      __textdomain(__s.c_str());
 228.183 ++      textdomain(__s.c_str());
 228.184 +       return 0;
 228.185 +     }
 228.186 + 
 228.187 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 228.188 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
 228.189 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
 228.190 +@@ -43,10 +43,6 @@
 228.191 + #warning tailor for stub locale support
 228.192 + #endif
 228.193 + 
 228.194 +-#ifndef __UCLIBC_HAS_XLOCALE__
 228.195 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 228.196 +-#endif
 228.197 +-
 228.198 + namespace std
 228.199 + {
 228.200 +   // Construct and return valid pattern consisting of some combination of:
 228.201 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 228.202 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
 228.203 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
 228.204 +@@ -41,9 +41,6 @@
 228.205 + #ifdef __UCLIBC_MJN3_ONLY__
 228.206 + #warning tailor for stub locale support
 228.207 + #endif
 228.208 +-#ifndef __UCLIBC_HAS_XLOCALE__
 228.209 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 228.210 +-#endif
 228.211 + 
 228.212 + namespace std
 228.213 + {
 228.214 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
 228.215 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
 228.216 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:53.000000000 +0200
 228.217 +@@ -40,9 +40,6 @@
 228.218 + #ifdef __UCLIBC_MJN3_ONLY__
 228.219 + #warning tailor for stub locale support
 228.220 + #endif
 228.221 +-#ifndef __UCLIBC_HAS_XLOCALE__
 228.222 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 228.223 +-#endif
 228.224 + 
 228.225 + namespace std
 228.226 + {
   229.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   229.2 +++ b/patches/gcc/4.2.1/140-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:32:33 2008 +0000
   229.3 @@ -0,0 +1,50 @@
   229.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   229.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
   229.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
   229.7 +@@ -401,7 +401,7 @@
   229.8 + # ifdef __UCLIBC_HAS_XLOCALE__
   229.9 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  229.10 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  229.11 +-# else
  229.12 ++# elif defined __UCLIBC_HAS_LOCALE__
  229.13 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  229.14 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  229.15 + # endif
  229.16 +@@ -556,7 +556,7 @@
  229.17 + # ifdef __UCLIBC_HAS_XLOCALE__
  229.18 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  229.19 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  229.20 +-# else
  229.21 ++# elif defined __UCLIBC_HAS_LOCALE__
  229.22 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  229.23 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  229.24 + # endif
  229.25 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  229.26 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
  229.27 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
  229.28 +@@ -127,12 +127,25 @@
  229.29 + 	{
  229.30 + 	  // Named locale.
  229.31 + 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  229.32 ++#ifdef __UCLIBC_MJN3_ONLY__
  229.33 ++#warning fix this... should be numeric
  229.34 ++#endif
  229.35 ++#ifdef __UCLIBC__
  229.36 ++# ifdef __UCLIBC_HAS_XLOCALE__
  229.37 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  229.38 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  229.39 ++# elif defined __UCLIBC_HAS_LOCALE__
  229.40 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  229.41 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  229.42 ++# endif
  229.43 ++#else
  229.44 + 	  union { char *__s; wchar_t __w; } __u;
  229.45 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  229.46 + 	  _M_data->_M_decimal_point = __u.__w;
  229.47 + 
  229.48 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  229.49 + 	  _M_data->_M_thousands_sep = __u.__w;
  229.50 ++#endif
  229.51 + 
  229.52 + 	  if (_M_data->_M_thousands_sep == L'\0')
  229.53 + 	    _M_data->_M_grouping = "";
   230.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   230.2 +++ b/patches/gcc/4.2.1/150-uclibc-locale-update.patch	Mon Jul 28 21:32:33 2008 +0000
   230.3 @@ -0,0 +1,354 @@
   230.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   230.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   230.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:31:54.000000000 +0200
   230.7 +@@ -46,16 +46,13 @@
   230.8 +     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   230.9 + 		   const __c_locale& __cloc)
  230.10 +     {
  230.11 +-      if (!(__err & ios_base::failbit))
  230.12 +-	{
  230.13 +-	  char* __sanity;
  230.14 +-	  errno = 0;
  230.15 +-	  float __f = __strtof_l(__s, &__sanity, __cloc);
  230.16 +-          if (__sanity != __s && errno != ERANGE)
  230.17 +-	    __v = __f;
  230.18 +-	  else
  230.19 +-	    __err |= ios_base::failbit;
  230.20 +-	}
  230.21 ++      char* __sanity;
  230.22 ++      errno = 0;
  230.23 ++      float __f = __strtof_l(__s, &__sanity, __cloc);
  230.24 ++      if (__sanity != __s && errno != ERANGE)
  230.25 ++	__v = __f;
  230.26 ++      else
  230.27 ++	__err |= ios_base::failbit;
  230.28 +     }
  230.29 + 
  230.30 +   template<>
  230.31 +@@ -63,16 +60,13 @@
  230.32 +     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  230.33 + 		   const __c_locale& __cloc)
  230.34 +     {
  230.35 +-      if (!(__err & ios_base::failbit))
  230.36 +-	{
  230.37 +-	  char* __sanity;
  230.38 +-	  errno = 0;
  230.39 +-	  double __d = __strtod_l(__s, &__sanity, __cloc);
  230.40 +-          if (__sanity != __s && errno != ERANGE)
  230.41 +-	    __v = __d;
  230.42 +-	  else
  230.43 +-	    __err |= ios_base::failbit;
  230.44 +-	}
  230.45 ++      char* __sanity;
  230.46 ++      errno = 0;
  230.47 ++      double __d = __strtod_l(__s, &__sanity, __cloc);
  230.48 ++      if (__sanity != __s && errno != ERANGE)
  230.49 ++	__v = __d;
  230.50 ++      else
  230.51 ++	__err |= ios_base::failbit;
  230.52 +     }
  230.53 + 
  230.54 +   template<>
  230.55 +@@ -80,16 +74,13 @@
  230.56 +     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  230.57 + 		   const __c_locale& __cloc)
  230.58 +     {
  230.59 +-      if (!(__err & ios_base::failbit))
  230.60 +-	{
  230.61 +-	  char* __sanity;
  230.62 +-	  errno = 0;
  230.63 +-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  230.64 +-          if (__sanity != __s && errno != ERANGE)
  230.65 +-	    __v = __ld;
  230.66 +-	  else
  230.67 +-	    __err |= ios_base::failbit;
  230.68 +-	}
  230.69 ++      char* __sanity;
  230.70 ++      errno = 0;
  230.71 ++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  230.72 ++      if (__sanity != __s && errno != ERANGE)
  230.73 ++	__v = __ld;
  230.74 ++      else
  230.75 ++	__err |= ios_base::failbit;
  230.76 +     }
  230.77 + 
  230.78 +   void
  230.79 +@@ -110,7 +101,7 @@
  230.80 +   void
  230.81 +   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  230.82 +   {
  230.83 +-    if (_S_get_c_locale() != __cloc)
  230.84 ++    if (__cloc && _S_get_c_locale() != __cloc)
  230.85 +       __freelocale(__cloc); 
  230.86 +   }
  230.87 + 
  230.88 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  230.89 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  230.90 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:31:54.000000000 +0200
  230.91 +@@ -39,21 +39,23 @@
  230.92 + #pragma GCC system_header
  230.93 + 
  230.94 + #include <cstring>              // get std::strlen
  230.95 +-#include <cstdio>               // get std::snprintf or std::sprintf
  230.96 ++#include <cstdio>               // get std::vsnprintf or std::vsprintf
  230.97 + #include <clocale>
  230.98 + #include <langinfo.h>		// For codecvt
  230.99 + #ifdef __UCLIBC_MJN3_ONLY__
 230.100 + #warning fix this
 230.101 + #endif
 230.102 +-#ifdef __UCLIBC_HAS_LOCALE__
 230.103 ++#ifdef _GLIBCXX_USE_ICONV
 230.104 + #include <iconv.h>		// For codecvt using iconv, iconv_t
 230.105 + #endif
 230.106 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 230.107 +-#include <libintl.h> 		// For messages
 230.108 ++#ifdef HAVE_LIBINTL_H
 230.109 ++#include <libintl.h>		// For messages
 230.110 + #endif
 230.111 ++#include <cstdarg>
 230.112 + 
 230.113 + #ifdef __UCLIBC_MJN3_ONLY__
 230.114 + #warning what is _GLIBCXX_C_LOCALE_GNU for
 230.115 ++// psm: used in os/gnu-linux/ctype_noninline.h
 230.116 + #endif
 230.117 + #define _GLIBCXX_C_LOCALE_GNU 1
 230.118 + 
 230.119 +@@ -62,7 +64,7 @@
 230.120 + #endif
 230.121 + // #define _GLIBCXX_NUM_CATEGORIES 6
 230.122 + #define _GLIBCXX_NUM_CATEGORIES 0
 230.123 +- 
 230.124 ++
 230.125 + #ifdef __UCLIBC_HAS_XLOCALE__
 230.126 + namespace __gnu_cxx
 230.127 + {
 230.128 +@@ -79,22 +81,24 @@
 230.129 +   typedef int*			__c_locale;
 230.130 + #endif
 230.131 + 
 230.132 +-  // Convert numeric value of type _Tv to string and return length of
 230.133 +-  // string.  If snprintf is available use it, otherwise fall back to
 230.134 +-  // the unsafe sprintf which, in general, can be dangerous and should
 230.135 ++  // Convert numeric value of type double to string and return length of
 230.136 ++  // string.  If vsnprintf is available use it, otherwise fall back to
 230.137 ++  // the unsafe vsprintf which, in general, can be dangerous and should
 230.138 +   // be avoided.
 230.139 +-  template<typename _Tv>
 230.140 +-    int
 230.141 +-    __convert_from_v(char* __out, 
 230.142 +-		     const int __size __attribute__ ((__unused__)),
 230.143 +-		     const char* __fmt,
 230.144 +-#ifdef __UCLIBC_HAS_XCLOCALE__
 230.145 +-		     _Tv __v, const __c_locale& __cloc, int __prec)
 230.146 ++    inline int
 230.147 ++    __convert_from_v(const __c_locale&
 230.148 ++#ifndef __UCLIBC_HAS_XCLOCALE__
 230.149 ++					__cloc __attribute__ ((__unused__))
 230.150 ++#endif
 230.151 ++		     ,
 230.152 ++		     char* __out,
 230.153 ++		     const int __size,
 230.154 ++		     const char* __fmt, ...)
 230.155 +     {
 230.156 ++      va_list __args;
 230.157 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 230.158 +       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 230.159 + #else
 230.160 +-		     _Tv __v, const __c_locale&, int __prec)
 230.161 +-    {
 230.162 + # ifdef __UCLIBC_HAS_LOCALE__
 230.163 +       char* __old = std::setlocale(LC_ALL, NULL);
 230.164 +       char* __sav = new char[std::strlen(__old) + 1];
 230.165 +@@ -103,7 +107,9 @@
 230.166 + # endif
 230.167 + #endif
 230.168 + 
 230.169 +-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 230.170 ++      va_start(__args, __fmt);
 230.171 ++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 230.172 ++      va_end(__args);
 230.173 + 
 230.174 + #ifdef __UCLIBC_HAS_XCLOCALE__
 230.175 +       __gnu_cxx::__uselocale(__old);
 230.176 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 230.177 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 230.178 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:31:54.000000000 +0200
 230.179 +@@ -33,9 +33,14 @@
 230.180 + 
 230.181 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 230.182 + 
 230.183 ++#include <features.h>
 230.184 ++#ifdef __UCLIBC_HAS_LOCALE__
 230.185 + #define _LIBC
 230.186 + #include <locale>
 230.187 + #undef _LIBC
 230.188 ++#else
 230.189 ++#include <locale>
 230.190 ++#endif
 230.191 + #include <bits/c++locale_internal.h>
 230.192 + 
 230.193 + namespace std
 230.194 +@@ -138,20 +143,34 @@
 230.195 +   ctype<wchar_t>::
 230.196 +   do_is(mask __m, wchar_t __c) const
 230.197 +   { 
 230.198 +-    // Highest bitmask in ctype_base == 10, but extra in "C"
 230.199 +-    // library for blank.
 230.200 ++    // The case of __m == ctype_base::space is particularly important,
 230.201 ++    // due to its use in many istream functions.  Therefore we deal with
 230.202 ++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 230.203 ++    // is the mask corresponding to ctype_base::space.  NB: an encoding
 230.204 ++    // change would not affect correctness!
 230.205 +     bool __ret = false;
 230.206 +-    const size_t __bitmasksize = 11; 
 230.207 +-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 230.208 +-      if (__m & _M_bit[__bitcur]
 230.209 +-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 230.210 +-	{
 230.211 +-	  __ret = true;
 230.212 +-	  break;
 230.213 +-	}
 230.214 ++    if (__m == _M_bit[5])
 230.215 ++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 230.216 ++    else
 230.217 ++      {
 230.218 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 230.219 ++	// library for blank.
 230.220 ++	const size_t __bitmasksize = 11;
 230.221 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 230.222 ++	  if (__m & _M_bit[__bitcur])
 230.223 ++	    {
 230.224 ++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 230.225 ++		{
 230.226 ++		  __ret = true;
 230.227 ++		  break;
 230.228 ++		}
 230.229 ++	      else if (__m == _M_bit[__bitcur])
 230.230 ++		break;
 230.231 ++	    }
 230.232 ++      }
 230.233 +     return __ret;    
 230.234 +   }
 230.235 +-  
 230.236 ++
 230.237 +   const wchar_t* 
 230.238 +   ctype<wchar_t>::
 230.239 +   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 230.240 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 230.241 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 230.242 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
 230.243 +@@ -47,18 +47,21 @@
 230.244 +   template<typename _CharT>
 230.245 +      messages<_CharT>::messages(size_t __refs)
 230.246 +      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 230.247 +-     _M_name_messages(_S_get_c_name())
 230.248 ++       _M_name_messages(_S_get_c_name())
 230.249 +      { }
 230.250 + 
 230.251 +   template<typename _CharT>
 230.252 +      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 230.253 + 				size_t __refs) 
 230.254 +-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 230.255 +-     _M_name_messages(__s)
 230.256 ++     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 230.257 +      {
 230.258 +-       char* __tmp = new char[std::strlen(__s) + 1];
 230.259 +-       std::strcpy(__tmp, __s);
 230.260 ++       const size_t __len = std::strlen(__s) + 1;
 230.261 ++       char* __tmp = new char[__len];
 230.262 ++       std::memcpy(__tmp, __s, __len);
 230.263 +        _M_name_messages = __tmp;
 230.264 ++
 230.265 ++       // Last to avoid leaking memory if new throws.
 230.266 ++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 230.267 +      }
 230.268 + 
 230.269 +   template<typename _CharT>
 230.270 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 230.271 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
 230.272 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:54.000000000 +0200
 230.273 +@@ -33,9 +33,14 @@
 230.274 + 
 230.275 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 230.276 + 
 230.277 ++#include <features.h>
 230.278 ++#ifdef __UCLIBC_HAS_LOCALE__
 230.279 + #define _LIBC
 230.280 + #include <locale>
 230.281 + #undef _LIBC
 230.282 ++#else
 230.283 ++#include <locale>
 230.284 ++#endif
 230.285 + #include <bits/c++locale_internal.h>
 230.286 + 
 230.287 + #ifdef __UCLIBC_MJN3_ONLY__
 230.288 +@@ -206,7 +211,7 @@
 230.289 + 	  }
 230.290 + 	break;
 230.291 +       default:
 230.292 +-	;
 230.293 ++	__ret = pattern();
 230.294 +       }
 230.295 +     return __ret;
 230.296 +   }
 230.297 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 230.298 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
 230.299 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:54.000000000 +0200
 230.300 +@@ -33,9 +33,14 @@
 230.301 + 
 230.302 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 230.303 + 
 230.304 ++#include <features.h>
 230.305 ++#ifdef __UCLIBC_HAS_LOCALE__
 230.306 + #define _LIBC
 230.307 + #include <locale>
 230.308 + #undef _LIBC
 230.309 ++#else
 230.310 ++#include <locale>
 230.311 ++#endif
 230.312 + #include <bits/c++locale_internal.h>
 230.313 + 
 230.314 + #ifdef __UCLIBC_MJN3_ONLY__
 230.315 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
 230.316 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
 230.317 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
 230.318 +@@ -37,25 +37,33 @@
 230.319 +   template<typename _CharT>
 230.320 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
 230.321 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 230.322 +-    _M_name_timepunct(_S_get_c_name())
 230.323 ++      _M_name_timepunct(_S_get_c_name())
 230.324 +     { _M_initialize_timepunct(); }
 230.325 + 
 230.326 +   template<typename _CharT>
 230.327 +     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 230.328 +     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 230.329 +-    _M_name_timepunct(_S_get_c_name())
 230.330 ++      _M_name_timepunct(_S_get_c_name())
 230.331 +     { _M_initialize_timepunct(); }
 230.332 + 
 230.333 +   template<typename _CharT>
 230.334 +     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 230.335 + 				     size_t __refs) 
 230.336 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 230.337 +-    _M_name_timepunct(__s)
 230.338 ++      _M_name_timepunct(NULL)
 230.339 +     { 
 230.340 +-      char* __tmp = new char[std::strlen(__s) + 1];
 230.341 +-      std::strcpy(__tmp, __s);
 230.342 ++      const size_t __len = std::strlen(__s) + 1;
 230.343 ++      char* __tmp = new char[__len];
 230.344 ++      std::memcpy(__tmp, __s, __len);
 230.345 +       _M_name_timepunct = __tmp;
 230.346 +-      _M_initialize_timepunct(__cloc); 
 230.347 ++
 230.348 ++      try
 230.349 ++	{ _M_initialize_timepunct(__cloc); }
 230.350 ++      catch(...)
 230.351 ++	{
 230.352 ++	  delete [] _M_name_timepunct;
 230.353 ++	  __throw_exception_again;
 230.354 ++	}
 230.355 +     }
 230.356 + 
 230.357 +   template<typename _CharT>
   231.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   231.2 +++ b/patches/gcc/4.2.1/160-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   231.3 @@ -0,0 +1,50 @@
   231.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am gcc-4.2.1/libstdc++-v3/src/Makefile.am
   231.5 +--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am	2006-07-28 06:57:34.000000000 +0200
   231.6 ++++ gcc-4.2.1/libstdc++-v3/src/Makefile.am	2007-08-03 20:32:27.000000000 +0200
   231.7 +@@ -257,6 +257,12 @@
   231.8 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
   231.9 + 
  231.10 + 
  231.11 ++install-exec-local:
  231.12 ++ifeq ($(enable_shared),yes)
  231.13 ++	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  231.14 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  231.15 ++endif
  231.16 ++
  231.17 + # Added bits to build debug library.
  231.18 + if GLIBCXX_BUILD_DEBUG
  231.19 + all-local: build_debug
  231.20 +diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in gcc-4.2.1/libstdc++-v3/src/Makefile.in
  231.21 +--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in	2006-10-16 21:08:22.000000000 +0200
  231.22 ++++ gcc-4.2.1/libstdc++-v3/src/Makefile.in	2007-08-03 20:32:27.000000000 +0200
  231.23 +@@ -657,7 +657,7 @@
  231.24 + 
  231.25 + install-data-am: install-data-local
  231.26 + 
  231.27 +-install-exec-am: install-toolexeclibLTLIBRARIES
  231.28 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  231.29 + 
  231.30 + install-info: install-info-am
  231.31 + 
  231.32 +@@ -690,6 +690,7 @@
  231.33 + 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  231.34 + 	html-am info info-am install install-am install-data \
  231.35 + 	install-data-am install-data-local install-exec \
  231.36 ++	install-exec-local \
  231.37 + 	install-exec-am install-info install-info-am install-man \
  231.38 + 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  231.39 + 	installcheck-am installdirs maintainer-clean \
  231.40 +@@ -799,6 +800,13 @@
  231.41 + install_debug:
  231.42 + 	(cd ${debugdir} && $(MAKE) \
  231.43 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  231.44 ++
  231.45 ++install-exec-local:
  231.46 ++ifeq ($(enable_shared),yes)
  231.47 ++	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  231.48 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  231.49 ++endif
  231.50 ++
  231.51 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  231.52 + # Otherwise a system limit (for SysV at least) may be exceeded.
  231.53 + .NOEXPORT:
   232.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   232.2 +++ b/patches/gcc/4.2.1/170-missing-execinfo_h.patch	Mon Jul 28 21:32:33 2008 +0000
   232.3 @@ -0,0 +1,12 @@
   232.4 +diff -durN gcc-4.2.1.orig/boehm-gc/include/gc.h gcc-4.2.1/boehm-gc/include/gc.h
   232.5 +--- gcc-4.2.1.orig/boehm-gc/include/gc.h	2006-09-18 20:45:08.000000000 +0200
   232.6 ++++ gcc-4.2.1/boehm-gc/include/gc.h	2007-08-03 20:33:00.000000000 +0200
   232.7 +@@ -502,7 +502,7 @@
   232.8 + #if defined(__linux__) || defined(__GLIBC__)
   232.9 + # include <features.h>
  232.10 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  232.11 +-     && !defined(__ia64__)
  232.12 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  232.13 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  232.14 + #     define GC_HAVE_BUILTIN_BACKTRACE
  232.15 + #   endif
   233.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   233.2 +++ b/patches/gcc/4.2.1/180-c99-snprintf.patch	Mon Jul 28 21:32:33 2008 +0000
   233.3 @@ -0,0 +1,12 @@
   233.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h
   233.5 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h	2006-12-07 10:33:51.000000000 +0100
   233.6 ++++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h	2007-08-03 20:33:24.000000000 +0200
   233.7 +@@ -144,7 +144,7 @@
   233.8 + 
   233.9 + _GLIBCXX_END_NAMESPACE
  233.10 + 
  233.11 +-#if _GLIBCXX_USE_C99
  233.12 ++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  233.13 + 
  233.14 + #undef snprintf
  233.15 + #undef vfscanf
   234.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   234.2 +++ b/patches/gcc/4.2.1/190-c99-complex-ugly-hack.patch	Mon Jul 28 21:32:33 2008 +0000
   234.3 @@ -0,0 +1,13 @@
   234.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
   234.5 +--- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
   234.6 ++++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:33:56.000000000 +0200
   234.7 +@@ -7514,6 +7514,9 @@
   234.8 + cat >>conftest.$ac_ext <<_ACEOF
   234.9 + /* end confdefs.h.  */
  234.10 + #include <complex.h>
  234.11 ++#ifdef __UCLIBC__
  234.12 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  234.13 ++#endif
  234.14 + int
  234.15 + main ()
  234.16 + {
   235.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   235.2 +++ b/patches/gcc/4.2.1/200-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
   235.3 @@ -0,0 +1,26 @@
   235.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/rope gcc-4.2.1/libstdc++-v3/include/ext/rope
   235.5 +--- gcc-4.2.1.orig/libstdc++-v3/include/ext/rope	2006-10-17 13:56:21.000000000 +0200
   235.6 ++++ gcc-4.2.1/libstdc++-v3/include/ext/rope	2007-08-03 20:34:23.000000000 +0200
   235.7 +@@ -58,6 +58,9 @@
   235.8 + #include <bits/allocator.h>
   235.9 + #include <ext/hash_fun.h>
  235.10 + 
  235.11 ++/* cope w/ index defined as macro, SuSv3 proposal */
  235.12 ++#undef index
  235.13 ++
  235.14 + # ifdef __GC
  235.15 + #   define __GC_CONST const
  235.16 + # else
  235.17 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h
  235.18 +--- gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2006-10-17 13:56:21.000000000 +0200
  235.19 ++++ gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h	2007-08-03 20:34:23.000000000 +0200
  235.20 +@@ -54,6 +54,9 @@
  235.21 + #include <ext/memory> // For uninitialized_copy_n
  235.22 + #include <ext/numeric> // For power
  235.23 + 
  235.24 ++/* cope w/ index defined as macro, SuSv3 proposal */
  235.25 ++#undef index
  235.26 ++
  235.27 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  235.28 + 
  235.29 +   using std::size_t;
   236.1 --- a/patches/gcc/4.2.1/200-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   236.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   236.3 @@ -1,2806 +0,0 @@
   236.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 gcc-4.2.1/libstdc++-v3/acinclude.m4
   236.5 ---- gcc-4.2.1.orig/libstdc++-v3/acinclude.m4	2007-06-29 01:02:05.000000000 +0200
   236.6 -+++ gcc-4.2.1/libstdc++-v3/acinclude.m4	2007-08-03 20:30:21.000000000 +0200
   236.7 -@@ -1334,7 +1334,7 @@
   236.8 - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   236.9 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  236.10 -     [use MODEL for target locale package],
  236.11 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  236.12 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  236.13 - 
  236.14 -   # Deal with gettext issues.  Default to not using it (=no) until we detect
  236.15 -   # support for it later.  Let the user turn it off via --e/d, but let that
  236.16 -@@ -1355,6 +1355,9 @@
  236.17 -   # Default to "generic".
  236.18 -   if test $enable_clocale_flag = auto; then
  236.19 -     case ${target_os} in
  236.20 -+      *-uclibc*)
  236.21 -+        enable_clocale_flag=uclibc
  236.22 -+        ;;
  236.23 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  236.24 -         enable_clocale_flag=gnu	
  236.25 -         ;;
  236.26 -@@ -1526,6 +1529,40 @@
  236.27 -       CTIME_CC=config/locale/generic/time_members.cc
  236.28 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  236.29 -       ;;
  236.30 -+    uclibc)
  236.31 -+      AC_MSG_RESULT(uclibc)
  236.32 -+
  236.33 -+      # Declare intention to use gettext, and add support for specific
  236.34 -+      # languages.
  236.35 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  236.36 -+      ALL_LINGUAS="de fr"
  236.37 -+
  236.38 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  236.39 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  236.40 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  236.41 -+        USE_NLS=yes
  236.42 -+      fi
  236.43 -+      # Export the build objects.
  236.44 -+      for ling in $ALL_LINGUAS; do \
  236.45 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  236.46 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  236.47 -+      done
  236.48 -+      AC_SUBST(glibcxx_MOFILES)
  236.49 -+      AC_SUBST(glibcxx_POFILES)
  236.50 -+
  236.51 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  236.52 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  236.53 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  236.54 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  236.55 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  236.56 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  236.57 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  236.58 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  236.59 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  236.60 -+      CTIME_H=config/locale/uclibc/time_members.h
  236.61 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  236.62 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  236.63 -+      ;;
  236.64 -   esac
  236.65 - 
  236.66 -   # This is where the testsuite looks for locale catalogs, using the
  236.67 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
  236.68 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  236.69 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
  236.70 -@@ -0,0 +1,160 @@
  236.71 -+// Wrapper for underlying C-language localization -*- C++ -*-
  236.72 -+
  236.73 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  236.74 -+//
  236.75 -+// This file is part of the GNU ISO C++ Library.  This library is free
  236.76 -+// software; you can redistribute it and/or modify it under the
  236.77 -+// terms of the GNU General Public License as published by the
  236.78 -+// Free Software Foundation; either version 2, or (at your option)
  236.79 -+// any later version.
  236.80 -+
  236.81 -+// This library is distributed in the hope that it will be useful,
  236.82 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  236.83 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  236.84 -+// GNU General Public License for more details.
  236.85 -+
  236.86 -+// You should have received a copy of the GNU General Public License along
  236.87 -+// with this library; see the file COPYING.  If not, write to the Free
  236.88 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  236.89 -+// USA.
  236.90 -+
  236.91 -+// As a special exception, you may use this file as part of a free software
  236.92 -+// library without restriction.  Specifically, if other files instantiate
  236.93 -+// templates or use macros or inline functions from this file, or you compile
  236.94 -+// this file and link it with other files to produce an executable, this
  236.95 -+// file does not by itself cause the resulting executable to be covered by
  236.96 -+// the GNU General Public License.  This exception does not however
  236.97 -+// invalidate any other reasons why the executable file might be covered by
  236.98 -+// the GNU General Public License.
  236.99 -+
 236.100 -+//
 236.101 -+// ISO C++ 14882: 22.8  Standard locale categories.
 236.102 -+//
 236.103 -+
 236.104 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 236.105 -+
 236.106 -+#include <cerrno>  // For errno
 236.107 -+#include <locale>
 236.108 -+#include <stdexcept>
 236.109 -+#include <langinfo.h>
 236.110 -+#include <bits/c++locale_internal.h>
 236.111 -+
 236.112 -+#ifndef __UCLIBC_HAS_XLOCALE__
 236.113 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 236.114 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 236.115 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 236.116 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 236.117 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 236.118 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 236.119 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 236.120 -+#warning should dummy __newlocale check for C|POSIX ?
 236.121 -+#define __newlocale(a, b, c)        NULL
 236.122 -+#define __freelocale(a)             ((void)0)
 236.123 -+#define __duplocale(a)              __c_locale()
 236.124 -+#endif
 236.125 -+
 236.126 -+namespace std 
 236.127 -+{
 236.128 -+  template<>
 236.129 -+    void
 236.130 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 236.131 -+		   const __c_locale& __cloc)
 236.132 -+    {
 236.133 -+      if (!(__err & ios_base::failbit))
 236.134 -+	{
 236.135 -+	  char* __sanity;
 236.136 -+	  errno = 0;
 236.137 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
 236.138 -+          if (__sanity != __s && errno != ERANGE)
 236.139 -+	    __v = __f;
 236.140 -+	  else
 236.141 -+	    __err |= ios_base::failbit;
 236.142 -+	}
 236.143 -+    }
 236.144 -+
 236.145 -+  template<>
 236.146 -+    void
 236.147 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 236.148 -+		   const __c_locale& __cloc)
 236.149 -+    {
 236.150 -+      if (!(__err & ios_base::failbit))
 236.151 -+	{
 236.152 -+	  char* __sanity;
 236.153 -+	  errno = 0;
 236.154 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
 236.155 -+          if (__sanity != __s && errno != ERANGE)
 236.156 -+	    __v = __d;
 236.157 -+	  else
 236.158 -+	    __err |= ios_base::failbit;
 236.159 -+	}
 236.160 -+    }
 236.161 -+
 236.162 -+  template<>
 236.163 -+    void
 236.164 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 236.165 -+		   const __c_locale& __cloc)
 236.166 -+    {
 236.167 -+      if (!(__err & ios_base::failbit))
 236.168 -+	{
 236.169 -+	  char* __sanity;
 236.170 -+	  errno = 0;
 236.171 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 236.172 -+          if (__sanity != __s && errno != ERANGE)
 236.173 -+	    __v = __ld;
 236.174 -+	  else
 236.175 -+	    __err |= ios_base::failbit;
 236.176 -+	}
 236.177 -+    }
 236.178 -+
 236.179 -+  void
 236.180 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 236.181 -+				    __c_locale __old)
 236.182 -+  {
 236.183 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 236.184 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.185 -+    if (!__cloc)
 236.186 -+      {
 236.187 -+	// This named locale is not supported by the underlying OS.
 236.188 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 236.189 -+			      "name not valid"));
 236.190 -+      }
 236.191 -+#endif
 236.192 -+  }
 236.193 -+  
 236.194 -+  void
 236.195 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 236.196 -+  {
 236.197 -+    if (_S_get_c_locale() != __cloc)
 236.198 -+      __freelocale(__cloc); 
 236.199 -+  }
 236.200 -+
 236.201 -+  __c_locale
 236.202 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 236.203 -+  { return __duplocale(__cloc); }
 236.204 -+} // namespace std
 236.205 -+
 236.206 -+namespace __gnu_cxx
 236.207 -+{
 236.208 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 236.209 -+    {
 236.210 -+      "LC_CTYPE", 
 236.211 -+      "LC_NUMERIC",
 236.212 -+      "LC_TIME", 
 236.213 -+      "LC_COLLATE", 
 236.214 -+      "LC_MONETARY",
 236.215 -+      "LC_MESSAGES", 
 236.216 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 236.217 -+      "LC_PAPER", 
 236.218 -+      "LC_NAME", 
 236.219 -+      "LC_ADDRESS",
 236.220 -+      "LC_TELEPHONE", 
 236.221 -+      "LC_MEASUREMENT", 
 236.222 -+      "LC_IDENTIFICATION" 
 236.223 -+#endif
 236.224 -+    };
 236.225 -+}
 236.226 -+
 236.227 -+namespace std
 236.228 -+{
 236.229 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 236.230 -+}  // namespace std
 236.231 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
 236.232 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 236.233 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
 236.234 -@@ -0,0 +1,117 @@
 236.235 -+// Wrapper for underlying C-language localization -*- C++ -*-
 236.236 -+
 236.237 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 236.238 -+//
 236.239 -+// This file is part of the GNU ISO C++ Library.  This library is free
 236.240 -+// software; you can redistribute it and/or modify it under the
 236.241 -+// terms of the GNU General Public License as published by the
 236.242 -+// Free Software Foundation; either version 2, or (at your option)
 236.243 -+// any later version.
 236.244 -+
 236.245 -+// This library is distributed in the hope that it will be useful,
 236.246 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 236.247 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 236.248 -+// GNU General Public License for more details.
 236.249 -+
 236.250 -+// You should have received a copy of the GNU General Public License along
 236.251 -+// with this library; see the file COPYING.  If not, write to the Free
 236.252 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 236.253 -+// USA.
 236.254 -+
 236.255 -+// As a special exception, you may use this file as part of a free software
 236.256 -+// library without restriction.  Specifically, if other files instantiate
 236.257 -+// templates or use macros or inline functions from this file, or you compile
 236.258 -+// this file and link it with other files to produce an executable, this
 236.259 -+// file does not by itself cause the resulting executable to be covered by
 236.260 -+// the GNU General Public License.  This exception does not however
 236.261 -+// invalidate any other reasons why the executable file might be covered by
 236.262 -+// the GNU General Public License.
 236.263 -+
 236.264 -+//
 236.265 -+// ISO C++ 14882: 22.8  Standard locale categories.
 236.266 -+//
 236.267 -+
 236.268 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 236.269 -+
 236.270 -+#ifndef _C_LOCALE_H
 236.271 -+#define _C_LOCALE_H 1
 236.272 -+
 236.273 -+#pragma GCC system_header
 236.274 -+
 236.275 -+#include <cstring>              // get std::strlen
 236.276 -+#include <cstdio>               // get std::snprintf or std::sprintf
 236.277 -+#include <clocale>
 236.278 -+#include <langinfo.h>		// For codecvt
 236.279 -+#ifdef __UCLIBC_MJN3_ONLY__
 236.280 -+#warning fix this
 236.281 -+#endif
 236.282 -+#ifdef __UCLIBC_HAS_LOCALE__
 236.283 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 236.284 -+#endif
 236.285 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 236.286 -+#include <libintl.h> 		// For messages
 236.287 -+#endif
 236.288 -+
 236.289 -+#ifdef __UCLIBC_MJN3_ONLY__
 236.290 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 236.291 -+#endif
 236.292 -+#define _GLIBCXX_C_LOCALE_GNU 1
 236.293 -+
 236.294 -+#ifdef __UCLIBC_MJN3_ONLY__
 236.295 -+#warning fix categories
 236.296 -+#endif
 236.297 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 236.298 -+#define _GLIBCXX_NUM_CATEGORIES 0
 236.299 -+ 
 236.300 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.301 -+namespace __gnu_cxx
 236.302 -+{
 236.303 -+  extern "C" __typeof(uselocale) __uselocale;
 236.304 -+}
 236.305 -+#endif
 236.306 -+
 236.307 -+namespace std
 236.308 -+{
 236.309 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.310 -+  typedef __locale_t		__c_locale;
 236.311 -+#else
 236.312 -+  typedef int*			__c_locale;
 236.313 -+#endif
 236.314 -+
 236.315 -+  // Convert numeric value of type _Tv to string and return length of
 236.316 -+  // string.  If snprintf is available use it, otherwise fall back to
 236.317 -+  // the unsafe sprintf which, in general, can be dangerous and should
 236.318 -+  // be avoided.
 236.319 -+  template<typename _Tv>
 236.320 -+    int
 236.321 -+    __convert_from_v(char* __out, 
 236.322 -+		     const int __size __attribute__ ((__unused__)),
 236.323 -+		     const char* __fmt,
 236.324 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 236.325 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 236.326 -+    {
 236.327 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 236.328 -+#else
 236.329 -+		     _Tv __v, const __c_locale&, int __prec)
 236.330 -+    {
 236.331 -+# ifdef __UCLIBC_HAS_LOCALE__
 236.332 -+      char* __old = std::setlocale(LC_ALL, NULL);
 236.333 -+      char* __sav = new char[std::strlen(__old) + 1];
 236.334 -+      std::strcpy(__sav, __old);
 236.335 -+      std::setlocale(LC_ALL, "C");
 236.336 -+# endif
 236.337 -+#endif
 236.338 -+
 236.339 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 236.340 -+
 236.341 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 236.342 -+      __gnu_cxx::__uselocale(__old);
 236.343 -+#elif defined __UCLIBC_HAS_LOCALE__
 236.344 -+      std::setlocale(LC_ALL, __sav);
 236.345 -+      delete [] __sav;
 236.346 -+#endif
 236.347 -+      return __ret;
 236.348 -+    }
 236.349 -+}
 236.350 -+
 236.351 -+#endif
 236.352 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
 236.353 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
 236.354 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
 236.355 -@@ -0,0 +1,63 @@
 236.356 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
 236.357 -+
 236.358 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
 236.359 -+//
 236.360 -+// This file is part of the GNU ISO C++ Library.  This library is free
 236.361 -+// software; you can redistribute it and/or modify it under the
 236.362 -+// terms of the GNU General Public License as published by the
 236.363 -+// Free Software Foundation; either version 2, or (at your option)
 236.364 -+// any later version.
 236.365 -+
 236.366 -+// This library is distributed in the hope that it will be useful,
 236.367 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 236.368 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 236.369 -+// GNU General Public License for more details.
 236.370 -+
 236.371 -+// You should have received a copy of the GNU General Public License along
 236.372 -+// with this library; see the file COPYING.  If not, write to the Free
 236.373 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 236.374 -+// USA.
 236.375 -+
 236.376 -+// As a special exception, you may use this file as part of a free software
 236.377 -+// library without restriction.  Specifically, if other files instantiate
 236.378 -+// templates or use macros or inline functions from this file, or you compile
 236.379 -+// this file and link it with other files to produce an executable, this
 236.380 -+// file does not by itself cause the resulting executable to be covered by
 236.381 -+// the GNU General Public License.  This exception does not however
 236.382 -+// invalidate any other reasons why the executable file might be covered by
 236.383 -+// the GNU General Public License.
 236.384 -+
 236.385 -+// Written by Jakub Jelinek <jakub@redhat.com>
 236.386 -+
 236.387 -+#include <bits/c++config.h>
 236.388 -+#include <clocale>
 236.389 -+
 236.390 -+#ifdef __UCLIBC_MJN3_ONLY__
 236.391 -+#warning clean this up
 236.392 -+#endif
 236.393 -+
 236.394 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.395 -+                                                  
 236.396 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 236.397 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 236.398 -+extern "C" __typeof(strftime_l) __strftime_l;
 236.399 -+extern "C" __typeof(strtod_l) __strtod_l;
 236.400 -+extern "C" __typeof(strtof_l) __strtof_l;
 236.401 -+extern "C" __typeof(strtold_l) __strtold_l;
 236.402 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 236.403 -+extern "C" __typeof(newlocale) __newlocale;
 236.404 -+extern "C" __typeof(freelocale) __freelocale;
 236.405 -+extern "C" __typeof(duplocale) __duplocale;
 236.406 -+extern "C" __typeof(uselocale) __uselocale;
 236.407 -+
 236.408 -+#ifdef _GLIBCXX_USE_WCHAR_T
 236.409 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 236.410 -+extern "C" __typeof(towlower_l) __towlower_l;
 236.411 -+extern "C" __typeof(towupper_l) __towupper_l;
 236.412 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 236.413 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 236.414 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 236.415 -+extern "C" __typeof(wctype_l) __wctype_l;
 236.416 -+#endif 
 236.417 -+
 236.418 -+#endif // GLIBC 2.3 and later
 236.419 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 236.420 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 236.421 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-08-03 20:30:21.000000000 +0200
 236.422 -@@ -0,0 +1,306 @@
 236.423 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 236.424 -+
 236.425 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 236.426 -+//
 236.427 -+// This file is part of the GNU ISO C++ Library.  This library is free
 236.428 -+// software; you can redistribute it and/or modify it under the
 236.429 -+// terms of the GNU General Public License as published by the
 236.430 -+// Free Software Foundation; either version 2, or (at your option)
 236.431 -+// any later version.
 236.432 -+
 236.433 -+// This library is distributed in the hope that it will be useful,
 236.434 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 236.435 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 236.436 -+// GNU General Public License for more details.
 236.437 -+
 236.438 -+// You should have received a copy of the GNU General Public License along
 236.439 -+// with this library; see the file COPYING.  If not, write to the Free
 236.440 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 236.441 -+// USA.
 236.442 -+
 236.443 -+// As a special exception, you may use this file as part of a free software
 236.444 -+// library without restriction.  Specifically, if other files instantiate
 236.445 -+// templates or use macros or inline functions from this file, or you compile
 236.446 -+// this file and link it with other files to produce an executable, this
 236.447 -+// file does not by itself cause the resulting executable to be covered by
 236.448 -+// the GNU General Public License.  This exception does not however
 236.449 -+// invalidate any other reasons why the executable file might be covered by
 236.450 -+// the GNU General Public License.
 236.451 -+
 236.452 -+//
 236.453 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 236.454 -+//
 236.455 -+
 236.456 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 236.457 -+
 236.458 -+#include <locale>
 236.459 -+#include <bits/c++locale_internal.h>
 236.460 -+
 236.461 -+namespace std
 236.462 -+{
 236.463 -+  // Specializations.
 236.464 -+#ifdef _GLIBCXX_USE_WCHAR_T
 236.465 -+  codecvt_base::result
 236.466 -+  codecvt<wchar_t, char, mbstate_t>::
 236.467 -+  do_out(state_type& __state, const intern_type* __from, 
 236.468 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 236.469 -+	 extern_type* __to, extern_type* __to_end,
 236.470 -+	 extern_type*& __to_next) const
 236.471 -+  {
 236.472 -+    result __ret = ok;
 236.473 -+    state_type __tmp_state(__state);
 236.474 -+
 236.475 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.476 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 236.477 -+#endif
 236.478 -+
 236.479 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 236.480 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 236.481 -+    // NB: wcsnrtombs is a GNU extension
 236.482 -+    for (__from_next = __from, __to_next = __to;
 236.483 -+	 __from_next < __from_end && __to_next < __to_end
 236.484 -+	 && __ret == ok;)
 236.485 -+      {
 236.486 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 236.487 -+						      __from_end - __from_next);
 236.488 -+	if (!__from_chunk_end)
 236.489 -+	  __from_chunk_end = __from_end;
 236.490 -+
 236.491 -+	__from = __from_next;
 236.492 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 236.493 -+					 __from_chunk_end - __from_next,
 236.494 -+					 __to_end - __to_next, &__state);
 236.495 -+	if (__conv == static_cast<size_t>(-1))
 236.496 -+	  {
 236.497 -+	    // In case of error, in order to stop at the exact place we
 236.498 -+	    // have to start again from the beginning with a series of
 236.499 -+	    // wcrtomb.
 236.500 -+	    for (; __from < __from_next; ++__from)
 236.501 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 236.502 -+	    __state = __tmp_state;
 236.503 -+	    __ret = error;
 236.504 -+	  }
 236.505 -+	else if (__from_next && __from_next < __from_chunk_end)
 236.506 -+	  {
 236.507 -+	    __to_next += __conv;
 236.508 -+	    __ret = partial;
 236.509 -+	  }
 236.510 -+	else
 236.511 -+	  {
 236.512 -+	    __from_next = __from_chunk_end;
 236.513 -+	    __to_next += __conv;
 236.514 -+	  }
 236.515 -+
 236.516 -+	if (__from_next < __from_end && __ret == ok)
 236.517 -+	  {
 236.518 -+	    extern_type __buf[MB_LEN_MAX];
 236.519 -+	    __tmp_state = __state;
 236.520 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 236.521 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 236.522 -+	      __ret = partial;
 236.523 -+	    else
 236.524 -+	      {
 236.525 -+		memcpy(__to_next, __buf, __conv);
 236.526 -+		__state = __tmp_state;
 236.527 -+		__to_next += __conv;
 236.528 -+		++__from_next;
 236.529 -+	      }
 236.530 -+	  }
 236.531 -+      }
 236.532 -+
 236.533 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.534 -+    __uselocale(__old);
 236.535 -+#endif
 236.536 -+
 236.537 -+    return __ret; 
 236.538 -+  }
 236.539 -+  
 236.540 -+  codecvt_base::result
 236.541 -+  codecvt<wchar_t, char, mbstate_t>::
 236.542 -+  do_in(state_type& __state, const extern_type* __from, 
 236.543 -+	const extern_type* __from_end, const extern_type*& __from_next,
 236.544 -+	intern_type* __to, intern_type* __to_end,
 236.545 -+	intern_type*& __to_next) const
 236.546 -+  {
 236.547 -+    result __ret = ok;
 236.548 -+    state_type __tmp_state(__state);
 236.549 -+
 236.550 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.551 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 236.552 -+#endif
 236.553 -+
 236.554 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 236.555 -+    // in case we store a L'\0' and then continue, in a loop.
 236.556 -+    // NB: mbsnrtowcs is a GNU extension
 236.557 -+    for (__from_next = __from, __to_next = __to;
 236.558 -+	 __from_next < __from_end && __to_next < __to_end
 236.559 -+	 && __ret == ok;)
 236.560 -+      {
 236.561 -+	const extern_type* __from_chunk_end;
 236.562 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 236.563 -+								  __from_end
 236.564 -+								  - __from_next));
 236.565 -+	if (!__from_chunk_end)
 236.566 -+	  __from_chunk_end = __from_end;
 236.567 -+
 236.568 -+	__from = __from_next;
 236.569 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 236.570 -+				   __from_chunk_end - __from_next,
 236.571 -+				   __to_end - __to_next, &__state);
 236.572 -+	if (__conv == static_cast<size_t>(-1))
 236.573 -+	  {
 236.574 -+	    // In case of error, in order to stop at the exact place we
 236.575 -+	    // have to start again from the beginning with a series of
 236.576 -+	    // mbrtowc.
 236.577 -+	    for (;; ++__to_next, __from += __conv)
 236.578 -+	      {
 236.579 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 236.580 -+				 &__tmp_state);
 236.581 -+		if (__conv == static_cast<size_t>(-1)
 236.582 -+		    || __conv == static_cast<size_t>(-2))
 236.583 -+		  break;
 236.584 -+	      }
 236.585 -+	    __from_next = __from;
 236.586 -+	    __state = __tmp_state;	    
 236.587 -+	    __ret = error;
 236.588 -+	  }
 236.589 -+	else if (__from_next && __from_next < __from_chunk_end)
 236.590 -+	  {
 236.591 -+	    // It is unclear what to return in this case (see DR 382). 
 236.592 -+	    __to_next += __conv;
 236.593 -+	    __ret = partial;
 236.594 -+	  }
 236.595 -+	else
 236.596 -+	  {
 236.597 -+	    __from_next = __from_chunk_end;
 236.598 -+	    __to_next += __conv;
 236.599 -+	  }
 236.600 -+
 236.601 -+	if (__from_next < __from_end && __ret == ok)
 236.602 -+	  {
 236.603 -+	    if (__to_next < __to_end)
 236.604 -+	      {
 236.605 -+		// XXX Probably wrong for stateful encodings
 236.606 -+		__tmp_state = __state;		
 236.607 -+		++__from_next;
 236.608 -+		*__to_next++ = L'\0';
 236.609 -+	      }
 236.610 -+	    else
 236.611 -+	      __ret = partial;
 236.612 -+	  }
 236.613 -+      }
 236.614 -+
 236.615 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.616 -+    __uselocale(__old);
 236.617 -+#endif
 236.618 -+
 236.619 -+    return __ret; 
 236.620 -+  }
 236.621 -+
 236.622 -+  int 
 236.623 -+  codecvt<wchar_t, char, mbstate_t>::
 236.624 -+  do_encoding() const throw()
 236.625 -+  {
 236.626 -+    // XXX This implementation assumes that the encoding is
 236.627 -+    // stateless and is either single-byte or variable-width.
 236.628 -+    int __ret = 0;
 236.629 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.630 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 236.631 -+#endif
 236.632 -+    if (MB_CUR_MAX == 1)
 236.633 -+      __ret = 1;
 236.634 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.635 -+    __uselocale(__old);
 236.636 -+#endif
 236.637 -+    return __ret;
 236.638 -+  }  
 236.639 -+
 236.640 -+  int 
 236.641 -+  codecvt<wchar_t, char, mbstate_t>::
 236.642 -+  do_max_length() const throw()
 236.643 -+  {
 236.644 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.645 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 236.646 -+#endif
 236.647 -+    // XXX Probably wrong for stateful encodings.
 236.648 -+    int __ret = MB_CUR_MAX;
 236.649 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.650 -+    __uselocale(__old);
 236.651 -+#endif
 236.652 -+    return __ret;
 236.653 -+  }
 236.654 -+  
 236.655 -+  int 
 236.656 -+  codecvt<wchar_t, char, mbstate_t>::
 236.657 -+  do_length(state_type& __state, const extern_type* __from,
 236.658 -+	    const extern_type* __end, size_t __max) const
 236.659 -+  {
 236.660 -+    int __ret = 0;
 236.661 -+    state_type __tmp_state(__state);
 236.662 -+
 236.663 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.664 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 236.665 -+#endif
 236.666 -+
 236.667 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 236.668 -+    // in case we advance past it and then continue, in a loop.
 236.669 -+    // NB: mbsnrtowcs is a GNU extension
 236.670 -+  
 236.671 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 236.672 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 236.673 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 236.674 -+							   * __max));
 236.675 -+    while (__from < __end && __max)
 236.676 -+      {
 236.677 -+	const extern_type* __from_chunk_end;
 236.678 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 236.679 -+								  __end
 236.680 -+								  - __from));
 236.681 -+	if (!__from_chunk_end)
 236.682 -+	  __from_chunk_end = __end;
 236.683 -+
 236.684 -+	const extern_type* __tmp_from = __from;
 236.685 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 236.686 -+				   __from_chunk_end - __from,
 236.687 -+				   __max, &__state);
 236.688 -+	if (__conv == static_cast<size_t>(-1))
 236.689 -+	  {
 236.690 -+	    // In case of error, in order to stop at the exact place we
 236.691 -+	    // have to start again from the beginning with a series of
 236.692 -+	    // mbrtowc.
 236.693 -+	    for (__from = __tmp_from;; __from += __conv)
 236.694 -+	      {
 236.695 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 236.696 -+				 &__tmp_state);
 236.697 -+		if (__conv == static_cast<size_t>(-1)
 236.698 -+		    || __conv == static_cast<size_t>(-2))
 236.699 -+		  break;
 236.700 -+	      }
 236.701 -+	    __state = __tmp_state;
 236.702 -+	    __ret += __from - __tmp_from;
 236.703 -+	    break;
 236.704 -+	  }
 236.705 -+	if (!__from)
 236.706 -+	  __from = __from_chunk_end;
 236.707 -+	
 236.708 -+	__ret += __from - __tmp_from;
 236.709 -+	__max -= __conv;
 236.710 -+
 236.711 -+	if (__from < __end && __max)
 236.712 -+	  {
 236.713 -+	    // XXX Probably wrong for stateful encodings
 236.714 -+	    __tmp_state = __state;
 236.715 -+	    ++__from;
 236.716 -+	    ++__ret;
 236.717 -+	    --__max;
 236.718 -+	  }
 236.719 -+      }
 236.720 -+
 236.721 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.722 -+    __uselocale(__old);
 236.723 -+#endif
 236.724 -+
 236.725 -+    return __ret; 
 236.726 -+  }
 236.727 -+#endif
 236.728 -+}
 236.729 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
 236.730 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 236.731 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
 236.732 -@@ -0,0 +1,80 @@
 236.733 -+// std::collate implementation details, GNU version -*- C++ -*-
 236.734 -+
 236.735 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 236.736 -+//
 236.737 -+// This file is part of the GNU ISO C++ Library.  This library is free
 236.738 -+// software; you can redistribute it and/or modify it under the
 236.739 -+// terms of the GNU General Public License as published by the
 236.740 -+// Free Software Foundation; either version 2, or (at your option)
 236.741 -+// any later version.
 236.742 -+
 236.743 -+// This library is distributed in the hope that it will be useful,
 236.744 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 236.745 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 236.746 -+// GNU General Public License for more details.
 236.747 -+
 236.748 -+// You should have received a copy of the GNU General Public License along
 236.749 -+// with this library; see the file COPYING.  If not, write to the Free
 236.750 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 236.751 -+// USA.
 236.752 -+
 236.753 -+// As a special exception, you may use this file as part of a free software
 236.754 -+// library without restriction.  Specifically, if other files instantiate
 236.755 -+// templates or use macros or inline functions from this file, or you compile
 236.756 -+// this file and link it with other files to produce an executable, this
 236.757 -+// file does not by itself cause the resulting executable to be covered by
 236.758 -+// the GNU General Public License.  This exception does not however
 236.759 -+// invalidate any other reasons why the executable file might be covered by
 236.760 -+// the GNU General Public License.
 236.761 -+
 236.762 -+//
 236.763 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 236.764 -+//
 236.765 -+
 236.766 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 236.767 -+
 236.768 -+#include <locale>
 236.769 -+#include <bits/c++locale_internal.h>
 236.770 -+
 236.771 -+#ifndef __UCLIBC_HAS_XLOCALE__
 236.772 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 236.773 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 236.774 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 236.775 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 236.776 -+#endif
 236.777 -+
 236.778 -+namespace std
 236.779 -+{
 236.780 -+  // These are basically extensions to char_traits, and perhaps should
 236.781 -+  // be put there instead of here.
 236.782 -+  template<>
 236.783 -+    int 
 236.784 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 236.785 -+    { 
 236.786 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 236.787 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 236.788 -+    }
 236.789 -+  
 236.790 -+  template<>
 236.791 -+    size_t
 236.792 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 236.793 -+				size_t __n) const 
 236.794 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 236.795 -+
 236.796 -+#ifdef _GLIBCXX_USE_WCHAR_T
 236.797 -+  template<>
 236.798 -+    int 
 236.799 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 236.800 -+				 const wchar_t* __two) const
 236.801 -+    {
 236.802 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 236.803 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 236.804 -+    }
 236.805 -+  
 236.806 -+  template<>
 236.807 -+    size_t
 236.808 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 236.809 -+				   size_t __n) const
 236.810 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 236.811 -+#endif
 236.812 -+}
 236.813 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 236.814 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 236.815 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 236.816 -@@ -0,0 +1,300 @@
 236.817 -+// std::ctype implementation details, GNU version -*- C++ -*-
 236.818 -+
 236.819 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 236.820 -+//
 236.821 -+// This file is part of the GNU ISO C++ Library.  This library is free
 236.822 -+// software; you can redistribute it and/or modify it under the
 236.823 -+// terms of the GNU General Public License as published by the
 236.824 -+// Free Software Foundation; either version 2, or (at your option)
 236.825 -+// any later version.
 236.826 -+
 236.827 -+// This library is distributed in the hope that it will be useful,
 236.828 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 236.829 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 236.830 -+// GNU General Public License for more details.
 236.831 -+
 236.832 -+// You should have received a copy of the GNU General Public License along
 236.833 -+// with this library; see the file COPYING.  If not, write to the Free
 236.834 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 236.835 -+// USA.
 236.836 -+
 236.837 -+// As a special exception, you may use this file as part of a free software
 236.838 -+// library without restriction.  Specifically, if other files instantiate
 236.839 -+// templates or use macros or inline functions from this file, or you compile
 236.840 -+// this file and link it with other files to produce an executable, this
 236.841 -+// file does not by itself cause the resulting executable to be covered by
 236.842 -+// the GNU General Public License.  This exception does not however
 236.843 -+// invalidate any other reasons why the executable file might be covered by
 236.844 -+// the GNU General Public License.
 236.845 -+
 236.846 -+//
 236.847 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 236.848 -+//
 236.849 -+
 236.850 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 236.851 -+
 236.852 -+#define _LIBC
 236.853 -+#include <locale>
 236.854 -+#undef _LIBC
 236.855 -+#include <bits/c++locale_internal.h>
 236.856 -+
 236.857 -+#ifndef __UCLIBC_HAS_XLOCALE__
 236.858 -+#define __wctype_l(S, L)           wctype((S))
 236.859 -+#define __towupper_l(C, L)         towupper((C))
 236.860 -+#define __towlower_l(C, L)         towlower((C))
 236.861 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 236.862 -+#endif
 236.863 -+
 236.864 -+namespace std
 236.865 -+{
 236.866 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 236.867 -+  // various /config/os/* files.
 236.868 -+  template<>
 236.869 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 236.870 -+    : ctype<char>(0, false, __refs) 
 236.871 -+    { 		
 236.872 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 236.873 -+	{
 236.874 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 236.875 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 236.876 -+#ifdef __UCLIBC_HAS_XLOCALE__
 236.877 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 236.878 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 236.879 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 236.880 -+#endif
 236.881 -+	}
 236.882 -+    }
 236.883 -+
 236.884 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 236.885 -+  ctype<wchar_t>::__wmask_type
 236.886 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 236.887 -+  {
 236.888 -+    __wmask_type __ret;
 236.889 -+    switch (__m)
 236.890 -+      {
 236.891 -+      case space:
 236.892 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 236.893 -+	break;
 236.894 -+      case print:
 236.895 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 236.896 -+	break;
 236.897 -+      case cntrl:
 236.898 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 236.899 -+	break;
 236.900 -+      case upper:
 236.901 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 236.902 -+	break;
 236.903 -+      case lower:
 236.904 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 236.905 -+	break;
 236.906 -+      case alpha:
 236.907 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 236.908 -+	break;
 236.909 -+      case digit:
 236.910 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 236.911 -+	break;
 236.912 -+      case punct:
 236.913 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 236.914 -+	break;
 236.915 -+      case xdigit:
 236.916 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 236.917 -+	break;
 236.918 -+      case alnum:
 236.919 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 236.920 -+	break;
 236.921 -+      case graph:
 236.922 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 236.923 -+	break;
 236.924 -+      default:
 236.925 -+	__ret = __wmask_type();
 236.926 -+      }
 236.927 -+    return __ret;
 236.928 -+  }
 236.929 -+  
 236.930 -+  wchar_t
 236.931 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 236.932 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 236.933 -+
 236.934 -+  const wchar_t*
 236.935 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 236.936 -+  {
 236.937 -+    while (__lo < __hi)
 236.938 -+      {
 236.939 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 236.940 -+        ++__lo;
 236.941 -+      }
 236.942 -+    return __hi;
 236.943 -+  }
 236.944 -+  
 236.945 -+  wchar_t
 236.946 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 236.947 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 236.948 -+  
 236.949 -+  const wchar_t*
 236.950 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 236.951 -+  {
 236.952 -+    while (__lo < __hi)
 236.953 -+      {
 236.954 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 236.955 -+        ++__lo;
 236.956 -+      }
 236.957 -+    return __hi;
 236.958 -+  }
 236.959 -+
 236.960 -+  bool
 236.961 -+  ctype<wchar_t>::
 236.962 -+  do_is(mask __m, wchar_t __c) const
 236.963 -+  { 
 236.964 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
 236.965 -+    // library for blank.
 236.966 -+    bool __ret = false;
 236.967 -+    const size_t __bitmasksize = 11; 
 236.968 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 236.969 -+      if (__m & _M_bit[__bitcur]
 236.970 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 236.971 -+	{
 236.972 -+	  __ret = true;
 236.973 -+	  break;
 236.974 -+	}
 236.975 -+    return __ret;    
 236.976 -+  }
 236.977 -+  
 236.978 -+  const wchar_t* 
 236.979 -+  ctype<wchar_t>::
 236.980 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 236.981 -+  {
 236.982 -+    for (; __lo < __hi; ++__vec, ++__lo)
 236.983 -+      {
 236.984 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 236.985 -+	// library for blank.
 236.986 -+	const size_t __bitmasksize = 11; 
 236.987 -+	mask __m = 0;
 236.988 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 236.989 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 236.990 -+	    __m |= _M_bit[__bitcur];
 236.991 -+	*__vec = __m;
 236.992 -+      }
 236.993 -+    return __hi;
 236.994 -+  }
 236.995 -+  
 236.996 -+  const wchar_t* 
 236.997 -+  ctype<wchar_t>::
 236.998 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 236.999 -+  {
236.1000 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
236.1001 -+      ++__lo;
236.1002 -+    return __lo;
236.1003 -+  }
236.1004 -+
236.1005 -+  const wchar_t*
236.1006 -+  ctype<wchar_t>::
236.1007 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
236.1008 -+  {
236.1009 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
236.1010 -+      ++__lo;
236.1011 -+    return __lo;
236.1012 -+  }
236.1013 -+
236.1014 -+  wchar_t
236.1015 -+  ctype<wchar_t>::
236.1016 -+  do_widen(char __c) const
236.1017 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
236.1018 -+
236.1019 -+  const char* 
236.1020 -+  ctype<wchar_t>::
236.1021 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
236.1022 -+  {
236.1023 -+    while (__lo < __hi)
236.1024 -+      {
236.1025 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
236.1026 -+	++__lo;
236.1027 -+	++__dest;
236.1028 -+      }
236.1029 -+    return __hi;
236.1030 -+  }
236.1031 -+
236.1032 -+  char
236.1033 -+  ctype<wchar_t>::
236.1034 -+  do_narrow(wchar_t __wc, char __dfault) const
236.1035 -+  {
236.1036 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
236.1037 -+      return _M_narrow[__wc];
236.1038 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1039 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
236.1040 -+#endif
236.1041 -+    const int __c = wctob(__wc);
236.1042 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1043 -+    __uselocale(__old);
236.1044 -+#endif
236.1045 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
236.1046 -+  }
236.1047 -+
236.1048 -+  const wchar_t*
236.1049 -+  ctype<wchar_t>::
236.1050 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
236.1051 -+	    char* __dest) const
236.1052 -+  {
236.1053 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1054 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
236.1055 -+#endif
236.1056 -+    if (_M_narrow_ok)
236.1057 -+      while (__lo < __hi)
236.1058 -+	{
236.1059 -+	  if (*__lo >= 0 && *__lo < 128)
236.1060 -+	    *__dest = _M_narrow[*__lo];
236.1061 -+	  else
236.1062 -+	    {
236.1063 -+	      const int __c = wctob(*__lo);
236.1064 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
236.1065 -+	    }
236.1066 -+	  ++__lo;
236.1067 -+	  ++__dest;
236.1068 -+	}
236.1069 -+    else
236.1070 -+      while (__lo < __hi)
236.1071 -+	{
236.1072 -+	  const int __c = wctob(*__lo);
236.1073 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
236.1074 -+	  ++__lo;
236.1075 -+	  ++__dest;
236.1076 -+	}
236.1077 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1078 -+    __uselocale(__old);
236.1079 -+#endif
236.1080 -+    return __hi;
236.1081 -+  }
236.1082 -+
236.1083 -+  void
236.1084 -+  ctype<wchar_t>::_M_initialize_ctype()
236.1085 -+  {
236.1086 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1087 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
236.1088 -+#endif
236.1089 -+    wint_t __i;
236.1090 -+    for (__i = 0; __i < 128; ++__i)
236.1091 -+      {
236.1092 -+	const int __c = wctob(__i);
236.1093 -+	if (__c == EOF)
236.1094 -+	  break;
236.1095 -+	else
236.1096 -+	  _M_narrow[__i] = static_cast<char>(__c);
236.1097 -+      }
236.1098 -+    if (__i == 128)
236.1099 -+      _M_narrow_ok = true;
236.1100 -+    else
236.1101 -+      _M_narrow_ok = false;
236.1102 -+    for (size_t __j = 0;
236.1103 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
236.1104 -+      _M_widen[__j] = btowc(__j);
236.1105 -+
236.1106 -+    for (size_t __k = 0; __k <= 11; ++__k)
236.1107 -+      { 
236.1108 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
236.1109 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
236.1110 -+      }
236.1111 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1112 -+    __uselocale(__old);
236.1113 -+#endif
236.1114 -+  }
236.1115 -+#endif //  _GLIBCXX_USE_WCHAR_T
236.1116 -+}
236.1117 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
236.1118 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
236.1119 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
236.1120 -@@ -0,0 +1,100 @@
236.1121 -+// std::messages implementation details, GNU version -*- C++ -*-
236.1122 -+
236.1123 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
236.1124 -+//
236.1125 -+// This file is part of the GNU ISO C++ Library.  This library is free
236.1126 -+// software; you can redistribute it and/or modify it under the
236.1127 -+// terms of the GNU General Public License as published by the
236.1128 -+// Free Software Foundation; either version 2, or (at your option)
236.1129 -+// any later version.
236.1130 -+
236.1131 -+// This library is distributed in the hope that it will be useful,
236.1132 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
236.1133 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
236.1134 -+// GNU General Public License for more details.
236.1135 -+
236.1136 -+// You should have received a copy of the GNU General Public License along
236.1137 -+// with this library; see the file COPYING.  If not, write to the Free
236.1138 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
236.1139 -+// USA.
236.1140 -+
236.1141 -+// As a special exception, you may use this file as part of a free software
236.1142 -+// library without restriction.  Specifically, if other files instantiate
236.1143 -+// templates or use macros or inline functions from this file, or you compile
236.1144 -+// this file and link it with other files to produce an executable, this
236.1145 -+// file does not by itself cause the resulting executable to be covered by
236.1146 -+// the GNU General Public License.  This exception does not however
236.1147 -+// invalidate any other reasons why the executable file might be covered by
236.1148 -+// the GNU General Public License.
236.1149 -+
236.1150 -+//
236.1151 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
236.1152 -+//
236.1153 -+
236.1154 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
236.1155 -+
236.1156 -+#include <locale>
236.1157 -+#include <bits/c++locale_internal.h>
236.1158 -+
236.1159 -+#ifdef __UCLIBC_MJN3_ONLY__
236.1160 -+#warning fix gettext stuff
236.1161 -+#endif
236.1162 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
236.1163 -+extern "C" char *__dcgettext(const char *domainname,
236.1164 -+			     const char *msgid, int category);
236.1165 -+#undef gettext
236.1166 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
236.1167 -+#else
236.1168 -+#undef gettext
236.1169 -+#define gettext(msgid) (msgid)
236.1170 -+#endif
236.1171 -+
236.1172 -+namespace std
236.1173 -+{
236.1174 -+  // Specializations.
236.1175 -+  template<>
236.1176 -+    string
236.1177 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
236.1178 -+    {
236.1179 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1180 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
236.1181 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
236.1182 -+      __uselocale(__old);
236.1183 -+      return string(__msg);
236.1184 -+#elif defined __UCLIBC_HAS_LOCALE__
236.1185 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
236.1186 -+      setlocale(LC_ALL, _M_name_messages);
236.1187 -+      const char* __msg = gettext(__dfault.c_str());
236.1188 -+      setlocale(LC_ALL, __old);
236.1189 -+      free(__old);
236.1190 -+      return string(__msg);
236.1191 -+#else
236.1192 -+      const char* __msg = gettext(__dfault.c_str());
236.1193 -+      return string(__msg);
236.1194 -+#endif
236.1195 -+    }
236.1196 -+
236.1197 -+#ifdef _GLIBCXX_USE_WCHAR_T
236.1198 -+  template<>
236.1199 -+    wstring
236.1200 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
236.1201 -+    {
236.1202 -+# ifdef __UCLIBC_HAS_XLOCALE__
236.1203 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
236.1204 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
236.1205 -+      __uselocale(__old);
236.1206 -+      return _M_convert_from_char(__msg);
236.1207 -+# elif defined __UCLIBC_HAS_LOCALE__
236.1208 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
236.1209 -+      setlocale(LC_ALL, _M_name_messages);
236.1210 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
236.1211 -+      setlocale(LC_ALL, __old);
236.1212 -+      free(__old);
236.1213 -+      return _M_convert_from_char(__msg);
236.1214 -+# else
236.1215 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
236.1216 -+      return _M_convert_from_char(__msg);
236.1217 -+# endif
236.1218 -+    }
236.1219 -+#endif
236.1220 -+}
236.1221 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
236.1222 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
236.1223 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
236.1224 -@@ -0,0 +1,118 @@
236.1225 -+// std::messages implementation details, GNU version -*- C++ -*-
236.1226 -+
236.1227 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
236.1228 -+//
236.1229 -+// This file is part of the GNU ISO C++ Library.  This library is free
236.1230 -+// software; you can redistribute it and/or modify it under the
236.1231 -+// terms of the GNU General Public License as published by the
236.1232 -+// Free Software Foundation; either version 2, or (at your option)
236.1233 -+// any later version.
236.1234 -+
236.1235 -+// This library is distributed in the hope that it will be useful,
236.1236 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
236.1237 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
236.1238 -+// GNU General Public License for more details.
236.1239 -+
236.1240 -+// You should have received a copy of the GNU General Public License along
236.1241 -+// with this library; see the file COPYING.  If not, write to the Free
236.1242 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
236.1243 -+// USA.
236.1244 -+
236.1245 -+// As a special exception, you may use this file as part of a free software
236.1246 -+// library without restriction.  Specifically, if other files instantiate
236.1247 -+// templates or use macros or inline functions from this file, or you compile
236.1248 -+// this file and link it with other files to produce an executable, this
236.1249 -+// file does not by itself cause the resulting executable to be covered by
236.1250 -+// the GNU General Public License.  This exception does not however
236.1251 -+// invalidate any other reasons why the executable file might be covered by
236.1252 -+// the GNU General Public License.
236.1253 -+
236.1254 -+//
236.1255 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
236.1256 -+//
236.1257 -+
236.1258 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
236.1259 -+
236.1260 -+#ifdef __UCLIBC_MJN3_ONLY__
236.1261 -+#warning fix prototypes for *textdomain funcs
236.1262 -+#endif
236.1263 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
236.1264 -+extern "C" char *__textdomain(const char *domainname);
236.1265 -+extern "C" char *__bindtextdomain(const char *domainname,
236.1266 -+				  const char *dirname);
236.1267 -+#else
236.1268 -+#undef __textdomain
236.1269 -+#undef __bindtextdomain
236.1270 -+#define __textdomain(D)           ((void)0)
236.1271 -+#define __bindtextdomain(D,P)     ((void)0)
236.1272 -+#endif
236.1273 -+
236.1274 -+  // Non-virtual member functions.
236.1275 -+  template<typename _CharT>
236.1276 -+     messages<_CharT>::messages(size_t __refs)
236.1277 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
236.1278 -+     _M_name_messages(_S_get_c_name())
236.1279 -+     { }
236.1280 -+
236.1281 -+  template<typename _CharT>
236.1282 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
236.1283 -+				size_t __refs) 
236.1284 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
236.1285 -+     _M_name_messages(__s)
236.1286 -+     {
236.1287 -+       char* __tmp = new char[std::strlen(__s) + 1];
236.1288 -+       std::strcpy(__tmp, __s);
236.1289 -+       _M_name_messages = __tmp;
236.1290 -+     }
236.1291 -+
236.1292 -+  template<typename _CharT>
236.1293 -+    typename messages<_CharT>::catalog 
236.1294 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
236.1295 -+			   const char* __dir) const
236.1296 -+    { 
236.1297 -+      __bindtextdomain(__s.c_str(), __dir);
236.1298 -+      return this->do_open(__s, __loc); 
236.1299 -+    }
236.1300 -+
236.1301 -+  // Virtual member functions.
236.1302 -+  template<typename _CharT>
236.1303 -+    messages<_CharT>::~messages()
236.1304 -+    { 
236.1305 -+      if (_M_name_messages != _S_get_c_name())
236.1306 -+	delete [] _M_name_messages;
236.1307 -+      _S_destroy_c_locale(_M_c_locale_messages); 
236.1308 -+    }
236.1309 -+
236.1310 -+  template<typename _CharT>
236.1311 -+    typename messages<_CharT>::catalog 
236.1312 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
236.1313 -+			      const locale&) const
236.1314 -+    { 
236.1315 -+      // No error checking is done, assume the catalog exists and can
236.1316 -+      // be used.
236.1317 -+      __textdomain(__s.c_str());
236.1318 -+      return 0;
236.1319 -+    }
236.1320 -+
236.1321 -+  template<typename _CharT>
236.1322 -+    void    
236.1323 -+    messages<_CharT>::do_close(catalog) const 
236.1324 -+    { }
236.1325 -+
236.1326 -+   // messages_byname
236.1327 -+   template<typename _CharT>
236.1328 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
236.1329 -+     : messages<_CharT>(__refs) 
236.1330 -+     { 
236.1331 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
236.1332 -+	 delete [] this->_M_name_messages;
236.1333 -+       char* __tmp = new char[std::strlen(__s) + 1];
236.1334 -+       std::strcpy(__tmp, __s);
236.1335 -+       this->_M_name_messages = __tmp;
236.1336 -+
236.1337 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
236.1338 -+	 {
236.1339 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
236.1340 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
236.1341 -+	 }
236.1342 -+     }
236.1343 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
236.1344 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
236.1345 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
236.1346 -@@ -0,0 +1,692 @@
236.1347 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
236.1348 -+
236.1349 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
236.1350 -+//
236.1351 -+// This file is part of the GNU ISO C++ Library.  This library is free
236.1352 -+// software; you can redistribute it and/or modify it under the
236.1353 -+// terms of the GNU General Public License as published by the
236.1354 -+// Free Software Foundation; either version 2, or (at your option)
236.1355 -+// any later version.
236.1356 -+
236.1357 -+// This library is distributed in the hope that it will be useful,
236.1358 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
236.1359 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
236.1360 -+// GNU General Public License for more details.
236.1361 -+
236.1362 -+// You should have received a copy of the GNU General Public License along
236.1363 -+// with this library; see the file COPYING.  If not, write to the Free
236.1364 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
236.1365 -+// USA.
236.1366 -+
236.1367 -+// As a special exception, you may use this file as part of a free software
236.1368 -+// library without restriction.  Specifically, if other files instantiate
236.1369 -+// templates or use macros or inline functions from this file, or you compile
236.1370 -+// this file and link it with other files to produce an executable, this
236.1371 -+// file does not by itself cause the resulting executable to be covered by
236.1372 -+// the GNU General Public License.  This exception does not however
236.1373 -+// invalidate any other reasons why the executable file might be covered by
236.1374 -+// the GNU General Public License.
236.1375 -+
236.1376 -+//
236.1377 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
236.1378 -+//
236.1379 -+
236.1380 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
236.1381 -+
236.1382 -+#define _LIBC
236.1383 -+#include <locale>
236.1384 -+#undef _LIBC
236.1385 -+#include <bits/c++locale_internal.h>
236.1386 -+
236.1387 -+#ifdef __UCLIBC_MJN3_ONLY__
236.1388 -+#warning optimize this for uclibc
236.1389 -+#warning tailor for stub locale support
236.1390 -+#endif
236.1391 -+
236.1392 -+#ifndef __UCLIBC_HAS_XLOCALE__
236.1393 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
236.1394 -+#endif
236.1395 -+
236.1396 -+namespace std
236.1397 -+{
236.1398 -+  // Construct and return valid pattern consisting of some combination of:
236.1399 -+  // space none symbol sign value
236.1400 -+  money_base::pattern
236.1401 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
236.1402 -+  { 
236.1403 -+    pattern __ret;
236.1404 -+
236.1405 -+    // This insanely complicated routine attempts to construct a valid
236.1406 -+    // pattern for use with monyepunct. A couple of invariants:
236.1407 -+
236.1408 -+    // if (__precedes) symbol -> value
236.1409 -+    // else value -> symbol
236.1410 -+    
236.1411 -+    // if (__space) space
236.1412 -+    // else none
236.1413 -+
236.1414 -+    // none == never first
236.1415 -+    // space never first or last
236.1416 -+
236.1417 -+    // Any elegant implementations of this are welcome.
236.1418 -+    switch (__posn)
236.1419 -+      {
236.1420 -+      case 0:
236.1421 -+      case 1:
236.1422 -+	// 1 The sign precedes the value and symbol.
236.1423 -+	__ret.field[0] = sign;
236.1424 -+	if (__space)
236.1425 -+	  {
236.1426 -+	    // Pattern starts with sign.
236.1427 -+	    if (__precedes)
236.1428 -+	      {
236.1429 -+		__ret.field[1] = symbol;
236.1430 -+		__ret.field[3] = value;
236.1431 -+	      }
236.1432 -+	    else
236.1433 -+	      {
236.1434 -+		__ret.field[1] = value;
236.1435 -+		__ret.field[3] = symbol;
236.1436 -+	      }
236.1437 -+	    __ret.field[2] = space;
236.1438 -+	  }
236.1439 -+	else
236.1440 -+	  {
236.1441 -+	    // Pattern starts with sign and ends with none.
236.1442 -+	    if (__precedes)
236.1443 -+	      {
236.1444 -+		__ret.field[1] = symbol;
236.1445 -+		__ret.field[2] = value;
236.1446 -+	      }
236.1447 -+	    else
236.1448 -+	      {
236.1449 -+		__ret.field[1] = value;
236.1450 -+		__ret.field[2] = symbol;
236.1451 -+	      }
236.1452 -+	    __ret.field[3] = none;
236.1453 -+	  }
236.1454 -+	break;
236.1455 -+      case 2:
236.1456 -+	// 2 The sign follows the value and symbol.
236.1457 -+	if (__space)
236.1458 -+	  {
236.1459 -+	    // Pattern either ends with sign.
236.1460 -+	    if (__precedes)
236.1461 -+	      {
236.1462 -+		__ret.field[0] = symbol;
236.1463 -+		__ret.field[2] = value;
236.1464 -+	      }
236.1465 -+	    else
236.1466 -+	      {
236.1467 -+		__ret.field[0] = value;
236.1468 -+		__ret.field[2] = symbol;
236.1469 -+	      }
236.1470 -+	    __ret.field[1] = space;
236.1471 -+	    __ret.field[3] = sign;
236.1472 -+	  }
236.1473 -+	else
236.1474 -+	  {
236.1475 -+	    // Pattern ends with sign then none.
236.1476 -+	    if (__precedes)
236.1477 -+	      {
236.1478 -+		__ret.field[0] = symbol;
236.1479 -+		__ret.field[1] = value;
236.1480 -+	      }
236.1481 -+	    else
236.1482 -+	      {
236.1483 -+		__ret.field[0] = value;
236.1484 -+		__ret.field[1] = symbol;
236.1485 -+	      }
236.1486 -+	    __ret.field[2] = sign;
236.1487 -+	    __ret.field[3] = none;
236.1488 -+	  }
236.1489 -+	break;
236.1490 -+      case 3:
236.1491 -+	// 3 The sign immediately precedes the symbol.
236.1492 -+	if (__precedes)
236.1493 -+	  {
236.1494 -+	    __ret.field[0] = sign;
236.1495 -+	    __ret.field[1] = symbol;	    
236.1496 -+	    if (__space)
236.1497 -+	      {
236.1498 -+		__ret.field[2] = space;
236.1499 -+		__ret.field[3] = value;
236.1500 -+	      }
236.1501 -+	    else
236.1502 -+	      {
236.1503 -+		__ret.field[2] = value;		
236.1504 -+		__ret.field[3] = none;
236.1505 -+	      }
236.1506 -+	  }
236.1507 -+	else
236.1508 -+	  {
236.1509 -+	    __ret.field[0] = value;
236.1510 -+	    if (__space)
236.1511 -+	      {
236.1512 -+		__ret.field[1] = space;
236.1513 -+		__ret.field[2] = sign;
236.1514 -+		__ret.field[3] = symbol;
236.1515 -+	      }
236.1516 -+	    else
236.1517 -+	      {
236.1518 -+		__ret.field[1] = sign;
236.1519 -+		__ret.field[2] = symbol;
236.1520 -+		__ret.field[3] = none;
236.1521 -+	      }
236.1522 -+	  }
236.1523 -+	break;
236.1524 -+      case 4:
236.1525 -+	// 4 The sign immediately follows the symbol.
236.1526 -+	if (__precedes)
236.1527 -+	  {
236.1528 -+	    __ret.field[0] = symbol;
236.1529 -+	    __ret.field[1] = sign;
236.1530 -+	    if (__space)
236.1531 -+	      {
236.1532 -+		__ret.field[2] = space;
236.1533 -+		__ret.field[3] = value;
236.1534 -+	      }
236.1535 -+	    else
236.1536 -+	      {
236.1537 -+		__ret.field[2] = value;
236.1538 -+		__ret.field[3] = none;
236.1539 -+	      }
236.1540 -+	  }
236.1541 -+	else
236.1542 -+	  {
236.1543 -+	    __ret.field[0] = value;
236.1544 -+	    if (__space)
236.1545 -+	      {
236.1546 -+		__ret.field[1] = space;
236.1547 -+		__ret.field[2] = symbol;
236.1548 -+		__ret.field[3] = sign;
236.1549 -+	      }
236.1550 -+	    else
236.1551 -+	      {
236.1552 -+		__ret.field[1] = symbol;
236.1553 -+		__ret.field[2] = sign;
236.1554 -+		__ret.field[3] = none;
236.1555 -+	      }
236.1556 -+	  }
236.1557 -+	break;
236.1558 -+      default:
236.1559 -+	;
236.1560 -+      }
236.1561 -+    return __ret;
236.1562 -+  }
236.1563 -+
236.1564 -+  template<> 
236.1565 -+    void
236.1566 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
236.1567 -+						     const char*)
236.1568 -+    {
236.1569 -+      if (!_M_data)
236.1570 -+	_M_data = new __moneypunct_cache<char, true>;
236.1571 -+
236.1572 -+      if (!__cloc)
236.1573 -+	{
236.1574 -+	  // "C" locale
236.1575 -+	  _M_data->_M_decimal_point = '.';
236.1576 -+	  _M_data->_M_thousands_sep = ',';
236.1577 -+	  _M_data->_M_grouping = "";
236.1578 -+	  _M_data->_M_grouping_size = 0;
236.1579 -+	  _M_data->_M_curr_symbol = "";
236.1580 -+	  _M_data->_M_curr_symbol_size = 0;
236.1581 -+	  _M_data->_M_positive_sign = "";
236.1582 -+	  _M_data->_M_positive_sign_size = 0;
236.1583 -+	  _M_data->_M_negative_sign = "";
236.1584 -+	  _M_data->_M_negative_sign_size = 0;
236.1585 -+	  _M_data->_M_frac_digits = 0;
236.1586 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
236.1587 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
236.1588 -+
236.1589 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
236.1590 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
236.1591 -+	}
236.1592 -+      else
236.1593 -+	{
236.1594 -+	  // Named locale.
236.1595 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
236.1596 -+							__cloc));
236.1597 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
236.1598 -+							__cloc));
236.1599 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
236.1600 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
236.1601 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
236.1602 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
236.1603 -+
236.1604 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
236.1605 -+	  if (!__nposn)
236.1606 -+	    _M_data->_M_negative_sign = "()";
236.1607 -+	  else
236.1608 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
236.1609 -+							__cloc);
236.1610 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
236.1611 -+
236.1612 -+	  // _Intl == true
236.1613 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
236.1614 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
236.1615 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
236.1616 -+						      __cloc));
236.1617 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
236.1618 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
236.1619 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
236.1620 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
236.1621 -+							__pposn);
236.1622 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
236.1623 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
236.1624 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
236.1625 -+							__nposn);
236.1626 -+	}
236.1627 -+    }
236.1628 -+
236.1629 -+  template<> 
236.1630 -+    void
236.1631 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
236.1632 -+						      const char*)
236.1633 -+    {
236.1634 -+      if (!_M_data)
236.1635 -+	_M_data = new __moneypunct_cache<char, false>;
236.1636 -+
236.1637 -+      if (!__cloc)
236.1638 -+	{
236.1639 -+	  // "C" locale
236.1640 -+	  _M_data->_M_decimal_point = '.';
236.1641 -+	  _M_data->_M_thousands_sep = ',';
236.1642 -+	  _M_data->_M_grouping = "";
236.1643 -+	  _M_data->_M_grouping_size = 0;
236.1644 -+	  _M_data->_M_curr_symbol = "";
236.1645 -+	  _M_data->_M_curr_symbol_size = 0;
236.1646 -+	  _M_data->_M_positive_sign = "";
236.1647 -+	  _M_data->_M_positive_sign_size = 0;
236.1648 -+	  _M_data->_M_negative_sign = "";
236.1649 -+	  _M_data->_M_negative_sign_size = 0;
236.1650 -+	  _M_data->_M_frac_digits = 0;
236.1651 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
236.1652 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
236.1653 -+
236.1654 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
236.1655 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
236.1656 -+	}
236.1657 -+      else
236.1658 -+	{
236.1659 -+	  // Named locale.
236.1660 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
236.1661 -+							__cloc));
236.1662 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
236.1663 -+							__cloc));
236.1664 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
236.1665 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
236.1666 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
236.1667 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
236.1668 -+
236.1669 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
236.1670 -+	  if (!__nposn)
236.1671 -+	    _M_data->_M_negative_sign = "()";
236.1672 -+	  else
236.1673 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
236.1674 -+							__cloc);
236.1675 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
236.1676 -+
236.1677 -+	  // _Intl == false
236.1678 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
236.1679 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
236.1680 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
236.1681 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
236.1682 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
236.1683 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
236.1684 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
236.1685 -+							__pposn);
236.1686 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
236.1687 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
236.1688 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
236.1689 -+							__nposn);
236.1690 -+	}
236.1691 -+    }
236.1692 -+
236.1693 -+  template<> 
236.1694 -+    moneypunct<char, true>::~moneypunct()
236.1695 -+    { delete _M_data; }
236.1696 -+
236.1697 -+  template<> 
236.1698 -+    moneypunct<char, false>::~moneypunct()
236.1699 -+    { delete _M_data; }
236.1700 -+
236.1701 -+#ifdef _GLIBCXX_USE_WCHAR_T
236.1702 -+  template<> 
236.1703 -+    void
236.1704 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
236.1705 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1706 -+							const char*)
236.1707 -+#else
236.1708 -+							const char* __name)
236.1709 -+#endif
236.1710 -+    {
236.1711 -+      if (!_M_data)
236.1712 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
236.1713 -+
236.1714 -+      if (!__cloc)
236.1715 -+	{
236.1716 -+	  // "C" locale
236.1717 -+	  _M_data->_M_decimal_point = L'.';
236.1718 -+	  _M_data->_M_thousands_sep = L',';
236.1719 -+	  _M_data->_M_grouping = "";
236.1720 -+	  _M_data->_M_grouping_size = 0;
236.1721 -+	  _M_data->_M_curr_symbol = L"";
236.1722 -+	  _M_data->_M_curr_symbol_size = 0;
236.1723 -+	  _M_data->_M_positive_sign = L"";
236.1724 -+	  _M_data->_M_positive_sign_size = 0;
236.1725 -+	  _M_data->_M_negative_sign = L"";
236.1726 -+	  _M_data->_M_negative_sign_size = 0;
236.1727 -+	  _M_data->_M_frac_digits = 0;
236.1728 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
236.1729 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
236.1730 -+
236.1731 -+	  // Use ctype::widen code without the facet...
236.1732 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
236.1733 -+	    _M_data->_M_atoms[__i] =
236.1734 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
236.1735 -+	}
236.1736 -+      else
236.1737 -+	{
236.1738 -+	  // Named locale.
236.1739 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1740 -+	  __c_locale __old = __uselocale(__cloc);
236.1741 -+#else
236.1742 -+	  // Switch to named locale so that mbsrtowcs will work.
236.1743 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
236.1744 -+	  setlocale(LC_ALL, __name);
236.1745 -+#endif
236.1746 -+
236.1747 -+#ifdef __UCLIBC_MJN3_ONLY__
236.1748 -+#warning fix this... should be monetary
236.1749 -+#endif
236.1750 -+#ifdef __UCLIBC__
236.1751 -+# ifdef __UCLIBC_HAS_XLOCALE__
236.1752 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
236.1753 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
236.1754 -+# else
236.1755 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
236.1756 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
236.1757 -+# endif
236.1758 -+#else
236.1759 -+	  union { char *__s; wchar_t __w; } __u;
236.1760 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
236.1761 -+	  _M_data->_M_decimal_point = __u.__w;
236.1762 -+
236.1763 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
236.1764 -+	  _M_data->_M_thousands_sep = __u.__w;
236.1765 -+#endif
236.1766 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
236.1767 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
236.1768 -+
236.1769 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
236.1770 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
236.1771 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
236.1772 -+
236.1773 -+	  wchar_t* __wcs_ps = 0;
236.1774 -+	  wchar_t* __wcs_ns = 0;
236.1775 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
236.1776 -+	  try
236.1777 -+	    {
236.1778 -+	      mbstate_t __state;
236.1779 -+	      size_t __len = strlen(__cpossign);
236.1780 -+	      if (__len)
236.1781 -+		{
236.1782 -+		  ++__len;
236.1783 -+		  memset(&__state, 0, sizeof(mbstate_t));
236.1784 -+		  __wcs_ps = new wchar_t[__len];
236.1785 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
236.1786 -+		  _M_data->_M_positive_sign = __wcs_ps;
236.1787 -+		}
236.1788 -+	      else
236.1789 -+		_M_data->_M_positive_sign = L"";
236.1790 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
236.1791 -+	      
236.1792 -+	      __len = strlen(__cnegsign);
236.1793 -+	      if (!__nposn)
236.1794 -+		_M_data->_M_negative_sign = L"()";
236.1795 -+	      else if (__len)
236.1796 -+		{ 
236.1797 -+		  ++__len;
236.1798 -+		  memset(&__state, 0, sizeof(mbstate_t));
236.1799 -+		  __wcs_ns = new wchar_t[__len];
236.1800 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
236.1801 -+		  _M_data->_M_negative_sign = __wcs_ns;
236.1802 -+		}
236.1803 -+	      else
236.1804 -+		_M_data->_M_negative_sign = L"";
236.1805 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
236.1806 -+	      
236.1807 -+	      // _Intl == true.
236.1808 -+	      __len = strlen(__ccurr);
236.1809 -+	      if (__len)
236.1810 -+		{
236.1811 -+		  ++__len;
236.1812 -+		  memset(&__state, 0, sizeof(mbstate_t));
236.1813 -+		  wchar_t* __wcs = new wchar_t[__len];
236.1814 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
236.1815 -+		  _M_data->_M_curr_symbol = __wcs;
236.1816 -+		}
236.1817 -+	      else
236.1818 -+		_M_data->_M_curr_symbol = L"";
236.1819 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
236.1820 -+	    }
236.1821 -+	  catch (...)
236.1822 -+	    {
236.1823 -+	      delete _M_data;
236.1824 -+	      _M_data = 0;
236.1825 -+	      delete __wcs_ps;
236.1826 -+	      delete __wcs_ns;	      
236.1827 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1828 -+	      __uselocale(__old);
236.1829 -+#else
236.1830 -+	      setlocale(LC_ALL, __old);
236.1831 -+	      free(__old);
236.1832 -+#endif
236.1833 -+	      __throw_exception_again;
236.1834 -+	    } 
236.1835 -+	  
236.1836 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
236.1837 -+						      __cloc));
236.1838 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
236.1839 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
236.1840 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
236.1841 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
236.1842 -+							__pposn);
236.1843 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
236.1844 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
236.1845 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
236.1846 -+							__nposn);
236.1847 -+
236.1848 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1849 -+	  __uselocale(__old);
236.1850 -+#else
236.1851 -+	  setlocale(LC_ALL, __old);
236.1852 -+	  free(__old);
236.1853 -+#endif
236.1854 -+	}
236.1855 -+    }
236.1856 -+
236.1857 -+  template<> 
236.1858 -+  void
236.1859 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
236.1860 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1861 -+						       const char*)
236.1862 -+#else
236.1863 -+                                                       const char* __name)
236.1864 -+#endif
236.1865 -+  {
236.1866 -+    if (!_M_data)
236.1867 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
236.1868 -+
236.1869 -+    if (!__cloc)
236.1870 -+	{
236.1871 -+	  // "C" locale
236.1872 -+	  _M_data->_M_decimal_point = L'.';
236.1873 -+	  _M_data->_M_thousands_sep = L',';
236.1874 -+	  _M_data->_M_grouping = "";
236.1875 -+          _M_data->_M_grouping_size = 0;
236.1876 -+	  _M_data->_M_curr_symbol = L"";
236.1877 -+	  _M_data->_M_curr_symbol_size = 0;
236.1878 -+	  _M_data->_M_positive_sign = L"";
236.1879 -+	  _M_data->_M_positive_sign_size = 0;
236.1880 -+	  _M_data->_M_negative_sign = L"";
236.1881 -+	  _M_data->_M_negative_sign_size = 0;
236.1882 -+	  _M_data->_M_frac_digits = 0;
236.1883 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
236.1884 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
236.1885 -+
236.1886 -+	  // Use ctype::widen code without the facet...
236.1887 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
236.1888 -+	    _M_data->_M_atoms[__i] =
236.1889 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
236.1890 -+	}
236.1891 -+      else
236.1892 -+	{
236.1893 -+	  // Named locale.
236.1894 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1895 -+	  __c_locale __old = __uselocale(__cloc);
236.1896 -+#else
236.1897 -+	  // Switch to named locale so that mbsrtowcs will work.
236.1898 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
236.1899 -+	  setlocale(LC_ALL, __name);
236.1900 -+#endif
236.1901 -+
236.1902 -+#ifdef __UCLIBC_MJN3_ONLY__
236.1903 -+#warning fix this... should be monetary
236.1904 -+#endif
236.1905 -+#ifdef __UCLIBC__
236.1906 -+# ifdef __UCLIBC_HAS_XLOCALE__
236.1907 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
236.1908 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
236.1909 -+# else
236.1910 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
236.1911 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
236.1912 -+# endif
236.1913 -+#else
236.1914 -+          union { char *__s; wchar_t __w; } __u;
236.1915 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
236.1916 -+	  _M_data->_M_decimal_point = __u.__w;
236.1917 -+
236.1918 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
236.1919 -+	  _M_data->_M_thousands_sep = __u.__w;
236.1920 -+#endif
236.1921 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
236.1922 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
236.1923 -+
236.1924 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
236.1925 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
236.1926 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
236.1927 -+
236.1928 -+	  wchar_t* __wcs_ps = 0;
236.1929 -+	  wchar_t* __wcs_ns = 0;
236.1930 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
236.1931 -+	  try
236.1932 -+            {
236.1933 -+              mbstate_t __state;
236.1934 -+              size_t __len;
236.1935 -+              __len = strlen(__cpossign);
236.1936 -+              if (__len)
236.1937 -+                {
236.1938 -+		  ++__len;
236.1939 -+		  memset(&__state, 0, sizeof(mbstate_t));
236.1940 -+		  __wcs_ps = new wchar_t[__len];
236.1941 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
236.1942 -+		  _M_data->_M_positive_sign = __wcs_ps;
236.1943 -+		}
236.1944 -+	      else
236.1945 -+		_M_data->_M_positive_sign = L"";
236.1946 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
236.1947 -+	      
236.1948 -+	      __len = strlen(__cnegsign);
236.1949 -+	      if (!__nposn)
236.1950 -+		_M_data->_M_negative_sign = L"()";
236.1951 -+	      else if (__len)
236.1952 -+		{ 
236.1953 -+		  ++__len;
236.1954 -+		  memset(&__state, 0, sizeof(mbstate_t));
236.1955 -+		  __wcs_ns = new wchar_t[__len];
236.1956 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
236.1957 -+		  _M_data->_M_negative_sign = __wcs_ns;
236.1958 -+		}
236.1959 -+	      else
236.1960 -+		_M_data->_M_negative_sign = L"";
236.1961 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
236.1962 -+
236.1963 -+	      // _Intl == true.
236.1964 -+	      __len = strlen(__ccurr);
236.1965 -+	      if (__len)
236.1966 -+		{
236.1967 -+		  ++__len;
236.1968 -+		  memset(&__state, 0, sizeof(mbstate_t));
236.1969 -+		  wchar_t* __wcs = new wchar_t[__len];
236.1970 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
236.1971 -+		  _M_data->_M_curr_symbol = __wcs;
236.1972 -+		}
236.1973 -+	      else
236.1974 -+		_M_data->_M_curr_symbol = L"";
236.1975 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
236.1976 -+	    }
236.1977 -+          catch (...)
236.1978 -+	    {
236.1979 -+	      delete _M_data;
236.1980 -+              _M_data = 0;
236.1981 -+	      delete __wcs_ps;
236.1982 -+	      delete __wcs_ns;	      
236.1983 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.1984 -+	      __uselocale(__old);
236.1985 -+#else
236.1986 -+	      setlocale(LC_ALL, __old);
236.1987 -+	      free(__old);
236.1988 -+#endif
236.1989 -+              __throw_exception_again;
236.1990 -+	    }
236.1991 -+
236.1992 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
236.1993 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
236.1994 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
236.1995 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
236.1996 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
236.1997 -+	                                                __pposn);
236.1998 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
236.1999 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
236.2000 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
236.2001 -+	                                                __nposn);
236.2002 -+
236.2003 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.2004 -+	  __uselocale(__old);
236.2005 -+#else
236.2006 -+	  setlocale(LC_ALL, __old);
236.2007 -+	  free(__old);
236.2008 -+#endif
236.2009 -+	}
236.2010 -+    }
236.2011 -+
236.2012 -+  template<> 
236.2013 -+    moneypunct<wchar_t, true>::~moneypunct()
236.2014 -+    {
236.2015 -+      if (_M_data->_M_positive_sign_size)
236.2016 -+	delete [] _M_data->_M_positive_sign;
236.2017 -+      if (_M_data->_M_negative_sign_size
236.2018 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
236.2019 -+	delete [] _M_data->_M_negative_sign;
236.2020 -+      if (_M_data->_M_curr_symbol_size)
236.2021 -+	delete [] _M_data->_M_curr_symbol;
236.2022 -+      delete _M_data;
236.2023 -+    }
236.2024 -+
236.2025 -+  template<> 
236.2026 -+    moneypunct<wchar_t, false>::~moneypunct()
236.2027 -+    {
236.2028 -+      if (_M_data->_M_positive_sign_size)
236.2029 -+	delete [] _M_data->_M_positive_sign;
236.2030 -+      if (_M_data->_M_negative_sign_size
236.2031 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
236.2032 -+	delete [] _M_data->_M_negative_sign;
236.2033 -+      if (_M_data->_M_curr_symbol_size)
236.2034 -+	delete [] _M_data->_M_curr_symbol;
236.2035 -+      delete _M_data;
236.2036 -+    }
236.2037 -+#endif
236.2038 -+}
236.2039 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
236.2040 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
236.2041 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
236.2042 -@@ -0,0 +1,160 @@
236.2043 -+// std::numpunct implementation details, GNU version -*- C++ -*-
236.2044 -+
236.2045 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
236.2046 -+//
236.2047 -+// This file is part of the GNU ISO C++ Library.  This library is free
236.2048 -+// software; you can redistribute it and/or modify it under the
236.2049 -+// terms of the GNU General Public License as published by the
236.2050 -+// Free Software Foundation; either version 2, or (at your option)
236.2051 -+// any later version.
236.2052 -+
236.2053 -+// This library is distributed in the hope that it will be useful,
236.2054 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
236.2055 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
236.2056 -+// GNU General Public License for more details.
236.2057 -+
236.2058 -+// You should have received a copy of the GNU General Public License along
236.2059 -+// with this library; see the file COPYING.  If not, write to the Free
236.2060 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
236.2061 -+// USA.
236.2062 -+
236.2063 -+// As a special exception, you may use this file as part of a free software
236.2064 -+// library without restriction.  Specifically, if other files instantiate
236.2065 -+// templates or use macros or inline functions from this file, or you compile
236.2066 -+// this file and link it with other files to produce an executable, this
236.2067 -+// file does not by itself cause the resulting executable to be covered by
236.2068 -+// the GNU General Public License.  This exception does not however
236.2069 -+// invalidate any other reasons why the executable file might be covered by
236.2070 -+// the GNU General Public License.
236.2071 -+
236.2072 -+//
236.2073 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
236.2074 -+//
236.2075 -+
236.2076 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
236.2077 -+
236.2078 -+#define _LIBC
236.2079 -+#include <locale>
236.2080 -+#undef _LIBC
236.2081 -+#include <bits/c++locale_internal.h>
236.2082 -+
236.2083 -+#ifdef __UCLIBC_MJN3_ONLY__
236.2084 -+#warning tailor for stub locale support
236.2085 -+#endif
236.2086 -+#ifndef __UCLIBC_HAS_XLOCALE__
236.2087 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
236.2088 -+#endif
236.2089 -+
236.2090 -+namespace std
236.2091 -+{
236.2092 -+  template<> 
236.2093 -+    void
236.2094 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
236.2095 -+    {
236.2096 -+      if (!_M_data)
236.2097 -+	_M_data = new __numpunct_cache<char>;
236.2098 -+
236.2099 -+      if (!__cloc)
236.2100 -+	{
236.2101 -+	  // "C" locale
236.2102 -+	  _M_data->_M_grouping = "";
236.2103 -+	  _M_data->_M_grouping_size = 0;
236.2104 -+	  _M_data->_M_use_grouping = false;
236.2105 -+
236.2106 -+	  _M_data->_M_decimal_point = '.';
236.2107 -+	  _M_data->_M_thousands_sep = ',';
236.2108 -+
236.2109 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
236.2110 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
236.2111 -+
236.2112 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
236.2113 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
236.2114 -+	}
236.2115 -+      else
236.2116 -+	{
236.2117 -+	  // Named locale.
236.2118 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
236.2119 -+							__cloc));
236.2120 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
236.2121 -+							__cloc));
236.2122 -+
236.2123 -+	  // Check for NULL, which implies no grouping.
236.2124 -+	  if (_M_data->_M_thousands_sep == '\0')
236.2125 -+	    _M_data->_M_grouping = "";
236.2126 -+	  else
236.2127 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
236.2128 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
236.2129 -+	}
236.2130 -+
236.2131 -+      // NB: There is no way to extact this info from posix locales.
236.2132 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
236.2133 -+      _M_data->_M_truename = "true";
236.2134 -+      _M_data->_M_truename_size = 4;
236.2135 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
236.2136 -+      _M_data->_M_falsename = "false";
236.2137 -+      _M_data->_M_falsename_size = 5;
236.2138 -+    }
236.2139 -+ 
236.2140 -+  template<> 
236.2141 -+    numpunct<char>::~numpunct()
236.2142 -+    { delete _M_data; }
236.2143 -+   
236.2144 -+#ifdef _GLIBCXX_USE_WCHAR_T
236.2145 -+  template<> 
236.2146 -+    void
236.2147 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
236.2148 -+    {
236.2149 -+      if (!_M_data)
236.2150 -+	_M_data = new __numpunct_cache<wchar_t>;
236.2151 -+
236.2152 -+      if (!__cloc)
236.2153 -+	{
236.2154 -+	  // "C" locale
236.2155 -+	  _M_data->_M_grouping = "";
236.2156 -+	  _M_data->_M_grouping_size = 0;
236.2157 -+	  _M_data->_M_use_grouping = false;
236.2158 -+
236.2159 -+	  _M_data->_M_decimal_point = L'.';
236.2160 -+	  _M_data->_M_thousands_sep = L',';
236.2161 -+
236.2162 -+	  // Use ctype::widen code without the facet...
236.2163 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
236.2164 -+	    _M_data->_M_atoms_out[__i] =
236.2165 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
236.2166 -+
236.2167 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
236.2168 -+	    _M_data->_M_atoms_in[__j] =
236.2169 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
236.2170 -+	}
236.2171 -+      else
236.2172 -+	{
236.2173 -+	  // Named locale.
236.2174 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
236.2175 -+	  union { char *__s; wchar_t __w; } __u;
236.2176 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
236.2177 -+	  _M_data->_M_decimal_point = __u.__w;
236.2178 -+
236.2179 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
236.2180 -+	  _M_data->_M_thousands_sep = __u.__w;
236.2181 -+
236.2182 -+	  if (_M_data->_M_thousands_sep == L'\0')
236.2183 -+	    _M_data->_M_grouping = "";
236.2184 -+	  else
236.2185 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
236.2186 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
236.2187 -+	}
236.2188 -+
236.2189 -+      // NB: There is no way to extact this info from posix locales.
236.2190 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
236.2191 -+      _M_data->_M_truename = L"true";
236.2192 -+      _M_data->_M_truename_size = 4;
236.2193 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
236.2194 -+      _M_data->_M_falsename = L"false";
236.2195 -+      _M_data->_M_falsename_size = 5;
236.2196 -+    }
236.2197 -+
236.2198 -+  template<> 
236.2199 -+    numpunct<wchar_t>::~numpunct()
236.2200 -+    { delete _M_data; }
236.2201 -+ #endif
236.2202 -+}
236.2203 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
236.2204 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
236.2205 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
236.2206 -@@ -0,0 +1,406 @@
236.2207 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
236.2208 -+
236.2209 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
236.2210 -+//
236.2211 -+// This file is part of the GNU ISO C++ Library.  This library is free
236.2212 -+// software; you can redistribute it and/or modify it under the
236.2213 -+// terms of the GNU General Public License as published by the
236.2214 -+// Free Software Foundation; either version 2, or (at your option)
236.2215 -+// any later version.
236.2216 -+
236.2217 -+// This library is distributed in the hope that it will be useful,
236.2218 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
236.2219 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
236.2220 -+// GNU General Public License for more details.
236.2221 -+
236.2222 -+// You should have received a copy of the GNU General Public License along
236.2223 -+// with this library; see the file COPYING.  If not, write to the Free
236.2224 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
236.2225 -+// USA.
236.2226 -+
236.2227 -+// As a special exception, you may use this file as part of a free software
236.2228 -+// library without restriction.  Specifically, if other files instantiate
236.2229 -+// templates or use macros or inline functions from this file, or you compile
236.2230 -+// this file and link it with other files to produce an executable, this
236.2231 -+// file does not by itself cause the resulting executable to be covered by
236.2232 -+// the GNU General Public License.  This exception does not however
236.2233 -+// invalidate any other reasons why the executable file might be covered by
236.2234 -+// the GNU General Public License.
236.2235 -+
236.2236 -+//
236.2237 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
236.2238 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
236.2239 -+//
236.2240 -+
236.2241 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
236.2242 -+
236.2243 -+#include <locale>
236.2244 -+#include <bits/c++locale_internal.h>
236.2245 -+
236.2246 -+#ifdef __UCLIBC_MJN3_ONLY__
236.2247 -+#warning tailor for stub locale support
236.2248 -+#endif
236.2249 -+#ifndef __UCLIBC_HAS_XLOCALE__
236.2250 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
236.2251 -+#endif
236.2252 -+
236.2253 -+namespace std
236.2254 -+{
236.2255 -+  template<>
236.2256 -+    void
236.2257 -+    __timepunct<char>::
236.2258 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
236.2259 -+	   const tm* __tm) const
236.2260 -+    {
236.2261 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.2262 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
236.2263 -+					_M_c_locale_timepunct);
236.2264 -+#else
236.2265 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
236.2266 -+      setlocale(LC_ALL, _M_name_timepunct);
236.2267 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
236.2268 -+      setlocale(LC_ALL, __old);
236.2269 -+      free(__old);
236.2270 -+#endif
236.2271 -+      // Make sure __s is null terminated.
236.2272 -+      if (__len == 0)
236.2273 -+	__s[0] = '\0';
236.2274 -+    }
236.2275 -+
236.2276 -+  template<> 
236.2277 -+    void
236.2278 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
236.2279 -+    {
236.2280 -+      if (!_M_data)
236.2281 -+	_M_data = new __timepunct_cache<char>;
236.2282 -+
236.2283 -+      if (!__cloc)
236.2284 -+	{
236.2285 -+	  // "C" locale
236.2286 -+	  _M_c_locale_timepunct = _S_get_c_locale();
236.2287 -+
236.2288 -+	  _M_data->_M_date_format = "%m/%d/%y";
236.2289 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
236.2290 -+	  _M_data->_M_time_format = "%H:%M:%S";
236.2291 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
236.2292 -+	  _M_data->_M_date_time_format = "";
236.2293 -+	  _M_data->_M_date_time_era_format = "";
236.2294 -+	  _M_data->_M_am = "AM";
236.2295 -+	  _M_data->_M_pm = "PM";
236.2296 -+	  _M_data->_M_am_pm_format = "";
236.2297 -+
236.2298 -+	  // Day names, starting with "C"'s Sunday.
236.2299 -+	  _M_data->_M_day1 = "Sunday";
236.2300 -+	  _M_data->_M_day2 = "Monday";
236.2301 -+	  _M_data->_M_day3 = "Tuesday";
236.2302 -+	  _M_data->_M_day4 = "Wednesday";
236.2303 -+	  _M_data->_M_day5 = "Thursday";
236.2304 -+	  _M_data->_M_day6 = "Friday";
236.2305 -+	  _M_data->_M_day7 = "Saturday";
236.2306 -+
236.2307 -+	  // Abbreviated day names, starting with "C"'s Sun.
236.2308 -+	  _M_data->_M_aday1 = "Sun";
236.2309 -+	  _M_data->_M_aday2 = "Mon";
236.2310 -+	  _M_data->_M_aday3 = "Tue";
236.2311 -+	  _M_data->_M_aday4 = "Wed";
236.2312 -+	  _M_data->_M_aday5 = "Thu";
236.2313 -+	  _M_data->_M_aday6 = "Fri";
236.2314 -+	  _M_data->_M_aday7 = "Sat";
236.2315 -+
236.2316 -+	  // Month names, starting with "C"'s January.
236.2317 -+	  _M_data->_M_month01 = "January";
236.2318 -+	  _M_data->_M_month02 = "February";
236.2319 -+	  _M_data->_M_month03 = "March";
236.2320 -+	  _M_data->_M_month04 = "April";
236.2321 -+	  _M_data->_M_month05 = "May";
236.2322 -+	  _M_data->_M_month06 = "June";
236.2323 -+	  _M_data->_M_month07 = "July";
236.2324 -+	  _M_data->_M_month08 = "August";
236.2325 -+	  _M_data->_M_month09 = "September";
236.2326 -+	  _M_data->_M_month10 = "October";
236.2327 -+	  _M_data->_M_month11 = "November";
236.2328 -+	  _M_data->_M_month12 = "December";
236.2329 -+
236.2330 -+	  // Abbreviated month names, starting with "C"'s Jan.
236.2331 -+	  _M_data->_M_amonth01 = "Jan";
236.2332 -+	  _M_data->_M_amonth02 = "Feb";
236.2333 -+	  _M_data->_M_amonth03 = "Mar";
236.2334 -+	  _M_data->_M_amonth04 = "Apr";
236.2335 -+	  _M_data->_M_amonth05 = "May";
236.2336 -+	  _M_data->_M_amonth06 = "Jun";
236.2337 -+	  _M_data->_M_amonth07 = "Jul";
236.2338 -+	  _M_data->_M_amonth08 = "Aug";
236.2339 -+	  _M_data->_M_amonth09 = "Sep";
236.2340 -+	  _M_data->_M_amonth10 = "Oct";
236.2341 -+	  _M_data->_M_amonth11 = "Nov";
236.2342 -+	  _M_data->_M_amonth12 = "Dec";
236.2343 -+	}
236.2344 -+      else
236.2345 -+	{
236.2346 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
236.2347 -+
236.2348 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
236.2349 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
236.2350 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
236.2351 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
236.2352 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
236.2353 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
236.2354 -+							     __cloc);
236.2355 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
236.2356 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
236.2357 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
236.2358 -+
236.2359 -+	  // Day names, starting with "C"'s Sunday.
236.2360 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
236.2361 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
236.2362 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
236.2363 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
236.2364 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
236.2365 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
236.2366 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
236.2367 -+
236.2368 -+	  // Abbreviated day names, starting with "C"'s Sun.
236.2369 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
236.2370 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
236.2371 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
236.2372 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
236.2373 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
236.2374 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
236.2375 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
236.2376 -+
236.2377 -+	  // Month names, starting with "C"'s January.
236.2378 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
236.2379 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
236.2380 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
236.2381 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
236.2382 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
236.2383 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
236.2384 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
236.2385 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
236.2386 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
236.2387 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
236.2388 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
236.2389 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
236.2390 -+
236.2391 -+	  // Abbreviated month names, starting with "C"'s Jan.
236.2392 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
236.2393 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
236.2394 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
236.2395 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
236.2396 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
236.2397 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
236.2398 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
236.2399 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
236.2400 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
236.2401 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
236.2402 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
236.2403 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
236.2404 -+	}
236.2405 -+    }
236.2406 -+
236.2407 -+#ifdef _GLIBCXX_USE_WCHAR_T
236.2408 -+  template<>
236.2409 -+    void
236.2410 -+    __timepunct<wchar_t>::
236.2411 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
236.2412 -+	   const tm* __tm) const
236.2413 -+    {
236.2414 -+#ifdef __UCLIBC_HAS_XLOCALE__
236.2415 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
236.2416 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
236.2417 -+					_M_c_locale_timepunct);
236.2418 -+#else
236.2419 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
236.2420 -+      setlocale(LC_ALL, _M_name_timepunct);
236.2421 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
236.2422 -+      setlocale(LC_ALL, __old);
236.2423 -+      free(__old);
236.2424 -+#endif
236.2425 -+      // Make sure __s is null terminated.
236.2426 -+      if (__len == 0)
236.2427 -+	__s[0] = L'\0';
236.2428 -+    }
236.2429 -+
236.2430 -+  template<> 
236.2431 -+    void
236.2432 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
236.2433 -+    {
236.2434 -+      if (!_M_data)
236.2435 -+	_M_data = new __timepunct_cache<wchar_t>;
236.2436 -+
236.2437 -+#warning wide time stuff
236.2438 -+//       if (!__cloc)
236.2439 -+	{
236.2440 -+	  // "C" locale
236.2441 -+	  _M_c_locale_timepunct = _S_get_c_locale();
236.2442 -+
236.2443 -+	  _M_data->_M_date_format = L"%m/%d/%y";
236.2444 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
236.2445 -+	  _M_data->_M_time_format = L"%H:%M:%S";
236.2446 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
236.2447 -+	  _M_data->_M_date_time_format = L"";
236.2448 -+	  _M_data->_M_date_time_era_format = L"";
236.2449 -+	  _M_data->_M_am = L"AM";
236.2450 -+	  _M_data->_M_pm = L"PM";
236.2451 -+	  _M_data->_M_am_pm_format = L"";
236.2452 -+
236.2453 -+	  // Day names, starting with "C"'s Sunday.
236.2454 -+	  _M_data->_M_day1 = L"Sunday";
236.2455 -+	  _M_data->_M_day2 = L"Monday";
236.2456 -+	  _M_data->_M_day3 = L"Tuesday";
236.2457 -+	  _M_data->_M_day4 = L"Wednesday";
236.2458 -+	  _M_data->_M_day5 = L"Thursday";
236.2459 -+	  _M_data->_M_day6 = L"Friday";
236.2460 -+	  _M_data->_M_day7 = L"Saturday";
236.2461 -+
236.2462 -+	  // Abbreviated day names, starting with "C"'s Sun.
236.2463 -+	  _M_data->_M_aday1 = L"Sun";
236.2464 -+	  _M_data->_M_aday2 = L"Mon";
236.2465 -+	  _M_data->_M_aday3 = L"Tue";
236.2466 -+	  _M_data->_M_aday4 = L"Wed";
236.2467 -+	  _M_data->_M_aday5 = L"Thu";
236.2468 -+	  _M_data->_M_aday6 = L"Fri";
236.2469 -+	  _M_data->_M_aday7 = L"Sat";
236.2470 -+
236.2471 -+	  // Month names, starting with "C"'s January.
236.2472 -+	  _M_data->_M_month01 = L"January";
236.2473 -+	  _M_data->_M_month02 = L"February";
236.2474 -+	  _M_data->_M_month03 = L"March";
236.2475 -+	  _M_data->_M_month04 = L"April";
236.2476 -+	  _M_data->_M_month05 = L"May";
236.2477 -+	  _M_data->_M_month06 = L"June";
236.2478 -+	  _M_data->_M_month07 = L"July";
236.2479 -+	  _M_data->_M_month08 = L"August";
236.2480 -+	  _M_data->_M_month09 = L"September";
236.2481 -+	  _M_data->_M_month10 = L"October";
236.2482 -+	  _M_data->_M_month11 = L"November";
236.2483 -+	  _M_data->_M_month12 = L"December";
236.2484 -+
236.2485 -+	  // Abbreviated month names, starting with "C"'s Jan.
236.2486 -+	  _M_data->_M_amonth01 = L"Jan";
236.2487 -+	  _M_data->_M_amonth02 = L"Feb";
236.2488 -+	  _M_data->_M_amonth03 = L"Mar";
236.2489 -+	  _M_data->_M_amonth04 = L"Apr";
236.2490 -+	  _M_data->_M_amonth05 = L"May";
236.2491 -+	  _M_data->_M_amonth06 = L"Jun";
236.2492 -+	  _M_data->_M_amonth07 = L"Jul";
236.2493 -+	  _M_data->_M_amonth08 = L"Aug";
236.2494 -+	  _M_data->_M_amonth09 = L"Sep";
236.2495 -+	  _M_data->_M_amonth10 = L"Oct";
236.2496 -+	  _M_data->_M_amonth11 = L"Nov";
236.2497 -+	  _M_data->_M_amonth12 = L"Dec";
236.2498 -+	}
236.2499 -+#if 0
236.2500 -+      else
236.2501 -+	{
236.2502 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
236.2503 -+
236.2504 -+	  union { char *__s; wchar_t *__w; } __u;
236.2505 -+
236.2506 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
236.2507 -+	  _M_data->_M_date_format = __u.__w;
236.2508 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
236.2509 -+	  _M_data->_M_date_era_format = __u.__w;
236.2510 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
236.2511 -+	  _M_data->_M_time_format = __u.__w;
236.2512 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
236.2513 -+	  _M_data->_M_time_era_format = __u.__w;
236.2514 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
236.2515 -+	  _M_data->_M_date_time_format = __u.__w;
236.2516 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
236.2517 -+	  _M_data->_M_date_time_era_format = __u.__w;
236.2518 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
236.2519 -+	  _M_data->_M_am = __u.__w;
236.2520 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
236.2521 -+	  _M_data->_M_pm = __u.__w;
236.2522 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
236.2523 -+	  _M_data->_M_am_pm_format = __u.__w;
236.2524 -+
236.2525 -+	  // Day names, starting with "C"'s Sunday.
236.2526 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
236.2527 -+	  _M_data->_M_day1 = __u.__w;
236.2528 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
236.2529 -+	  _M_data->_M_day2 = __u.__w;
236.2530 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
236.2531 -+	  _M_data->_M_day3 = __u.__w;
236.2532 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
236.2533 -+	  _M_data->_M_day4 = __u.__w;
236.2534 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
236.2535 -+	  _M_data->_M_day5 = __u.__w;
236.2536 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
236.2537 -+	  _M_data->_M_day6 = __u.__w;
236.2538 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
236.2539 -+	  _M_data->_M_day7 = __u.__w;
236.2540 -+
236.2541 -+	  // Abbreviated day names, starting with "C"'s Sun.
236.2542 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
236.2543 -+	  _M_data->_M_aday1 = __u.__w;
236.2544 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
236.2545 -+	  _M_data->_M_aday2 = __u.__w;
236.2546 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
236.2547 -+	  _M_data->_M_aday3 = __u.__w;
236.2548 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
236.2549 -+	  _M_data->_M_aday4 = __u.__w;
236.2550 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
236.2551 -+	  _M_data->_M_aday5 = __u.__w;
236.2552 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
236.2553 -+	  _M_data->_M_aday6 = __u.__w;
236.2554 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
236.2555 -+	  _M_data->_M_aday7 = __u.__w;
236.2556 -+
236.2557 -+	  // Month names, starting with "C"'s January.
236.2558 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
236.2559 -+	  _M_data->_M_month01 = __u.__w;
236.2560 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
236.2561 -+	  _M_data->_M_month02 = __u.__w;
236.2562 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
236.2563 -+	  _M_data->_M_month03 = __u.__w;
236.2564 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
236.2565 -+	  _M_data->_M_month04 = __u.__w;
236.2566 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
236.2567 -+	  _M_data->_M_month05 = __u.__w;
236.2568 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
236.2569 -+	  _M_data->_M_month06 = __u.__w;
236.2570 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
236.2571 -+	  _M_data->_M_month07 = __u.__w;
236.2572 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
236.2573 -+	  _M_data->_M_month08 = __u.__w;
236.2574 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
236.2575 -+	  _M_data->_M_month09 = __u.__w;
236.2576 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
236.2577 -+	  _M_data->_M_month10 = __u.__w;
236.2578 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
236.2579 -+	  _M_data->_M_month11 = __u.__w;
236.2580 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
236.2581 -+	  _M_data->_M_month12 = __u.__w;
236.2582 -+
236.2583 -+	  // Abbreviated month names, starting with "C"'s Jan.
236.2584 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
236.2585 -+	  _M_data->_M_amonth01 = __u.__w;
236.2586 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
236.2587 -+	  _M_data->_M_amonth02 = __u.__w;
236.2588 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
236.2589 -+	  _M_data->_M_amonth03 = __u.__w;
236.2590 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
236.2591 -+	  _M_data->_M_amonth04 = __u.__w;
236.2592 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
236.2593 -+	  _M_data->_M_amonth05 = __u.__w;
236.2594 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
236.2595 -+	  _M_data->_M_amonth06 = __u.__w;
236.2596 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
236.2597 -+	  _M_data->_M_amonth07 = __u.__w;
236.2598 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
236.2599 -+	  _M_data->_M_amonth08 = __u.__w;
236.2600 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
236.2601 -+	  _M_data->_M_amonth09 = __u.__w;
236.2602 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
236.2603 -+	  _M_data->_M_amonth10 = __u.__w;
236.2604 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
236.2605 -+	  _M_data->_M_amonth11 = __u.__w;
236.2606 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
236.2607 -+	  _M_data->_M_amonth12 = __u.__w;
236.2608 -+	}
236.2609 -+#endif // 0
236.2610 -+    }
236.2611 -+#endif
236.2612 -+}
236.2613 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
236.2614 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
236.2615 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
236.2616 -@@ -0,0 +1,68 @@
236.2617 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
236.2618 -+
236.2619 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
236.2620 -+//
236.2621 -+// This file is part of the GNU ISO C++ Library.  This library is free
236.2622 -+// software; you can redistribute it and/or modify it under the
236.2623 -+// terms of the GNU General Public License as published by the
236.2624 -+// Free Software Foundation; either version 2, or (at your option)
236.2625 -+// any later version.
236.2626 -+
236.2627 -+// This library is distributed in the hope that it will be useful,
236.2628 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
236.2629 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
236.2630 -+// GNU General Public License for more details.
236.2631 -+
236.2632 -+// You should have received a copy of the GNU General Public License along
236.2633 -+// with this library; see the file COPYING.  If not, write to the Free
236.2634 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
236.2635 -+// USA.
236.2636 -+
236.2637 -+// As a special exception, you may use this file as part of a free software
236.2638 -+// library without restriction.  Specifically, if other files instantiate
236.2639 -+// templates or use macros or inline functions from this file, or you compile
236.2640 -+// this file and link it with other files to produce an executable, this
236.2641 -+// file does not by itself cause the resulting executable to be covered by
236.2642 -+// the GNU General Public License.  This exception does not however
236.2643 -+// invalidate any other reasons why the executable file might be covered by
236.2644 -+// the GNU General Public License.
236.2645 -+
236.2646 -+//
236.2647 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
236.2648 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
236.2649 -+//
236.2650 -+
236.2651 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
236.2652 -+
236.2653 -+  template<typename _CharT>
236.2654 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
236.2655 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
236.2656 -+    _M_name_timepunct(_S_get_c_name())
236.2657 -+    { _M_initialize_timepunct(); }
236.2658 -+
236.2659 -+  template<typename _CharT>
236.2660 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
236.2661 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
236.2662 -+    _M_name_timepunct(_S_get_c_name())
236.2663 -+    { _M_initialize_timepunct(); }
236.2664 -+
236.2665 -+  template<typename _CharT>
236.2666 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
236.2667 -+				     size_t __refs) 
236.2668 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
236.2669 -+    _M_name_timepunct(__s)
236.2670 -+    { 
236.2671 -+      char* __tmp = new char[std::strlen(__s) + 1];
236.2672 -+      std::strcpy(__tmp, __s);
236.2673 -+      _M_name_timepunct = __tmp;
236.2674 -+      _M_initialize_timepunct(__cloc); 
236.2675 -+    }
236.2676 -+
236.2677 -+  template<typename _CharT>
236.2678 -+    __timepunct<_CharT>::~__timepunct()
236.2679 -+    { 
236.2680 -+      if (_M_name_timepunct != _S_get_c_name())
236.2681 -+	delete [] _M_name_timepunct;
236.2682 -+      delete _M_data; 
236.2683 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
236.2684 -+    }
236.2685 -diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
236.2686 ---- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:29:22.000000000 +0200
236.2687 -+++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
236.2688 -@@ -5769,7 +5769,7 @@
236.2689 -   enableval="$enable_clocale"
236.2690 - 
236.2691 -       case "$enableval" in
236.2692 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
236.2693 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
236.2694 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
236.2695 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
236.2696 -    { (exit 1); exit 1; }; } ;;
236.2697 -@@ -5802,6 +5802,9 @@
236.2698 -   # Default to "generic".
236.2699 -   if test $enable_clocale_flag = auto; then
236.2700 -     case ${target_os} in
236.2701 -+      linux-uclibc*)
236.2702 -+        enable_clocale_flag=uclibc
236.2703 -+	;;
236.2704 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
236.2705 -         enable_clocale_flag=gnu
236.2706 -         ;;
236.2707 -@@ -6190,6 +6193,76 @@
236.2708 -       CTIME_CC=config/locale/generic/time_members.cc
236.2709 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
236.2710 -       ;;
236.2711 -+    uclibc)
236.2712 -+      echo "$as_me:$LINENO: result: uclibc" >&5
236.2713 -+echo "${ECHO_T}uclibc" >&6
236.2714 -+
236.2715 -+      # Declare intention to use gettext, and add support for specific
236.2716 -+      # languages.
236.2717 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
236.2718 -+      ALL_LINGUAS="de fr"
236.2719 -+
236.2720 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
236.2721 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
236.2722 -+set dummy msgfmt; ac_word=$2
236.2723 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
236.2724 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
236.2725 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
236.2726 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
236.2727 -+else
236.2728 -+  if test -n "$check_msgfmt"; then
236.2729 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
236.2730 -+else
236.2731 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
236.2732 -+for as_dir in $PATH
236.2733 -+do
236.2734 -+  IFS=$as_save_IFS
236.2735 -+  test -z "$as_dir" && as_dir=.
236.2736 -+  for ac_exec_ext in '' $ac_executable_extensions; do
236.2737 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
236.2738 -+    ac_cv_prog_check_msgfmt="yes"
236.2739 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
236.2740 -+    break 2
236.2741 -+  fi
236.2742 -+done
236.2743 -+done
236.2744 -+
236.2745 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
236.2746 -+fi
236.2747 -+fi
236.2748 -+check_msgfmt=$ac_cv_prog_check_msgfmt
236.2749 -+if test -n "$check_msgfmt"; then
236.2750 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
236.2751 -+echo "${ECHO_T}$check_msgfmt" >&6
236.2752 -+else
236.2753 -+  echo "$as_me:$LINENO: result: no" >&5
236.2754 -+echo "${ECHO_T}no" >&6
236.2755 -+fi
236.2756 -+
236.2757 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
236.2758 -+        USE_NLS=yes
236.2759 -+      fi
236.2760 -+      # Export the build objects.
236.2761 -+      for ling in $ALL_LINGUAS; do \
236.2762 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
236.2763 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
236.2764 -+      done
236.2765 -+
236.2766 -+
236.2767 -+
236.2768 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
236.2769 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
236.2770 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
236.2771 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
236.2772 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
236.2773 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
236.2774 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
236.2775 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
236.2776 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
236.2777 -+      CTIME_H=config/locale/uclibc/time_members.h
236.2778 -+      CTIME_CC=config/locale/uclibc/time_members.cc
236.2779 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
236.2780 -+      ;;
236.2781 -   esac
236.2782 - 
236.2783 -   # This is where the testsuite looks for locale catalogs, using the
236.2784 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h
236.2785 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2005-08-17 04:28:44.000000000 +0200
236.2786 -+++ gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h	2007-08-03 20:30:21.000000000 +0200
236.2787 -@@ -101,7 +101,9 @@
236.2788 - using std::wmemcpy;
236.2789 - using std::wmemmove;
236.2790 - using std::wmemset;
236.2791 -+#if _GLIBCXX_HAVE_WCSFTIME
236.2792 - using std::wcsftime;
236.2793 -+#endif
236.2794 - 
236.2795 - #if _GLIBCXX_USE_C99
236.2796 - using std::wcstold;
236.2797 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h
236.2798 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h	2006-12-07 10:33:51.000000000 +0100
236.2799 -+++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h	2007-08-03 20:30:21.000000000 +0200
236.2800 -@@ -182,7 +182,9 @@
236.2801 -   using ::wcscoll;
236.2802 -   using ::wcscpy;
236.2803 -   using ::wcscspn;
236.2804 -+#if _GLIBCXX_HAVE_WCSFTIME
236.2805 -   using ::wcsftime;
236.2806 -+#endif
236.2807 -   using ::wcslen;
236.2808 -   using ::wcsncat;
236.2809 -   using ::wcsncmp;
   237.1 --- a/patches/gcc/4.2.1/203-uclibc-locale-no__x.patch	Mon Jul 28 21:08:01 2008 +0000
   237.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   237.3 @@ -1,223 +0,0 @@
   237.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   237.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
   237.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   237.7 -@@ -39,20 +39,6 @@
   237.8 - #include <langinfo.h>
   237.9 - #include <bits/c++locale_internal.h>
  237.10 - 
  237.11 --#ifndef __UCLIBC_HAS_XLOCALE__
  237.12 --#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  237.13 --#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  237.14 --#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  237.15 --#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  237.16 --#define __strtof_l(S, E, L)         strtof((S), (E))
  237.17 --#define __strtod_l(S, E, L)         strtod((S), (E))
  237.18 --#define __strtold_l(S, E, L)        strtold((S), (E))
  237.19 --#warning should dummy __newlocale check for C|POSIX ?
  237.20 --#define __newlocale(a, b, c)        NULL
  237.21 --#define __freelocale(a)             ((void)0)
  237.22 --#define __duplocale(a)              __c_locale()
  237.23 --#endif
  237.24 --
  237.25 - namespace std 
  237.26 - {
  237.27 -   template<>
  237.28 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  237.29 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
  237.30 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  237.31 -@@ -68,6 +68,7 @@
  237.32 - {
  237.33 -   extern "C" __typeof(uselocale) __uselocale;
  237.34 - }
  237.35 -+#define __uselocale uselocale
  237.36 - #endif
  237.37 - 
  237.38 - namespace std
  237.39 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  237.40 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
  237.41 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:53.000000000 +0200
  237.42 -@@ -60,4 +60,49 @@
  237.43 - extern "C" __typeof(wctype_l) __wctype_l;
  237.44 - #endif 
  237.45 - 
  237.46 -+# define __nl_langinfo_l nl_langinfo_l
  237.47 -+# define __strcoll_l strcoll_l
  237.48 -+# define __strftime_l strftime_l
  237.49 -+# define __strtod_l strtod_l
  237.50 -+# define __strtof_l strtof_l
  237.51 -+# define __strtold_l strtold_l
  237.52 -+# define __strxfrm_l strxfrm_l
  237.53 -+# define __newlocale newlocale
  237.54 -+# define __freelocale freelocale
  237.55 -+# define __duplocale duplocale
  237.56 -+# define __uselocale uselocale
  237.57 -+
  237.58 -+# ifdef _GLIBCXX_USE_WCHAR_T
  237.59 -+#  define __iswctype_l iswctype_l
  237.60 -+#  define __towlower_l towlower_l
  237.61 -+#  define __towupper_l towupper_l
  237.62 -+#  define __wcscoll_l wcscoll_l
  237.63 -+#  define __wcsftime_l wcsftime_l
  237.64 -+#  define __wcsxfrm_l wcsxfrm_l
  237.65 -+#  define __wctype_l wctype_l
  237.66 -+# endif
  237.67 -+
  237.68 -+#else
  237.69 -+# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  237.70 -+# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  237.71 -+# define __strtod_l(S, E, L)         strtod((S), (E))
  237.72 -+# define __strtof_l(S, E, L)         strtof((S), (E))
  237.73 -+# define __strtold_l(S, E, L)        strtold((S), (E))
  237.74 -+# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  237.75 -+# warning should dummy __newlocale check for C|POSIX ?
  237.76 -+# define __newlocale(a, b, c)        NULL
  237.77 -+# define __freelocale(a)             ((void)0)
  237.78 -+# define __duplocale(a)              __c_locale()
  237.79 -+//# define __uselocale ?
  237.80 -+//
  237.81 -+# ifdef _GLIBCXX_USE_WCHAR_T
  237.82 -+#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  237.83 -+#  define __towlower_l(C, L)          towlower((C))
  237.84 -+#  define __towupper_l(C, L)          towupper((C))
  237.85 -+#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  237.86 -+//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  237.87 -+#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  237.88 -+#  define __wctype_l(S, L)            wctype((S))
  237.89 -+# endif
  237.90 -+
  237.91 - #endif // GLIBC 2.3 and later
  237.92 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
  237.93 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
  237.94 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:53.000000000 +0200
  237.95 -@@ -36,13 +36,6 @@
  237.96 - #include <locale>
  237.97 - #include <bits/c++locale_internal.h>
  237.98 - 
  237.99 --#ifndef __UCLIBC_HAS_XLOCALE__
 237.100 --#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 237.101 --#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 237.102 --#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 237.103 --#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 237.104 --#endif
 237.105 --
 237.106 - namespace std
 237.107 - {
 237.108 -   // These are basically extensions to char_traits, and perhaps should
 237.109 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 237.110 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 237.111 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 237.112 -@@ -38,13 +38,6 @@
 237.113 - #undef _LIBC
 237.114 - #include <bits/c++locale_internal.h>
 237.115 - 
 237.116 --#ifndef __UCLIBC_HAS_XLOCALE__
 237.117 --#define __wctype_l(S, L)           wctype((S))
 237.118 --#define __towupper_l(C, L)         towupper((C))
 237.119 --#define __towlower_l(C, L)         towlower((C))
 237.120 --#define __iswctype_l(C, M, L)      iswctype((C), (M))
 237.121 --#endif
 237.122 --
 237.123 - namespace std
 237.124 - {
 237.125 -   // NB: The other ctype<char> specializations are in src/locale.cc and
 237.126 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
 237.127 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
 237.128 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:53.000000000 +0200
 237.129 -@@ -39,13 +39,10 @@
 237.130 - #ifdef __UCLIBC_MJN3_ONLY__
 237.131 - #warning fix gettext stuff
 237.132 - #endif
 237.133 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 237.134 --extern "C" char *__dcgettext(const char *domainname,
 237.135 --			     const char *msgid, int category);
 237.136 - #undef gettext
 237.137 --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 237.138 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 237.139 -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 237.140 - #else
 237.141 --#undef gettext
 237.142 - #define gettext(msgid) (msgid)
 237.143 - #endif
 237.144 - 
 237.145 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 237.146 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
 237.147 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 237.148 -@@ -36,15 +36,11 @@
 237.149 - #ifdef __UCLIBC_MJN3_ONLY__
 237.150 - #warning fix prototypes for *textdomain funcs
 237.151 - #endif
 237.152 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 237.153 --extern "C" char *__textdomain(const char *domainname);
 237.154 --extern "C" char *__bindtextdomain(const char *domainname,
 237.155 --				  const char *dirname);
 237.156 --#else
 237.157 --#undef __textdomain
 237.158 --#undef __bindtextdomain
 237.159 --#define __textdomain(D)           ((void)0)
 237.160 --#define __bindtextdomain(D,P)     ((void)0)
 237.161 -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 237.162 -+#undef textdomain
 237.163 -+#undef bindtextdomain
 237.164 -+#define textdomain(D)           ((void)0)
 237.165 -+#define bindtextdomain(D,P)     ((void)0)
 237.166 - #endif
 237.167 - 
 237.168 -   // Non-virtual member functions.
 237.169 -@@ -70,7 +66,7 @@
 237.170 -     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 237.171 - 			   const char* __dir) const
 237.172 -     { 
 237.173 --      __bindtextdomain(__s.c_str(), __dir);
 237.174 -+      bindtextdomain(__s.c_str(), __dir);
 237.175 -       return this->do_open(__s, __loc); 
 237.176 -     }
 237.177 - 
 237.178 -@@ -90,7 +86,7 @@
 237.179 -     { 
 237.180 -       // No error checking is done, assume the catalog exists and can
 237.181 -       // be used.
 237.182 --      __textdomain(__s.c_str());
 237.183 -+      textdomain(__s.c_str());
 237.184 -       return 0;
 237.185 -     }
 237.186 - 
 237.187 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 237.188 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
 237.189 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
 237.190 -@@ -43,10 +43,6 @@
 237.191 - #warning tailor for stub locale support
 237.192 - #endif
 237.193 - 
 237.194 --#ifndef __UCLIBC_HAS_XLOCALE__
 237.195 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 237.196 --#endif
 237.197 --
 237.198 - namespace std
 237.199 - {
 237.200 -   // Construct and return valid pattern consisting of some combination of:
 237.201 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 237.202 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
 237.203 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
 237.204 -@@ -41,9 +41,6 @@
 237.205 - #ifdef __UCLIBC_MJN3_ONLY__
 237.206 - #warning tailor for stub locale support
 237.207 - #endif
 237.208 --#ifndef __UCLIBC_HAS_XLOCALE__
 237.209 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 237.210 --#endif
 237.211 - 
 237.212 - namespace std
 237.213 - {
 237.214 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
 237.215 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
 237.216 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:53.000000000 +0200
 237.217 -@@ -40,9 +40,6 @@
 237.218 - #ifdef __UCLIBC_MJN3_ONLY__
 237.219 - #warning tailor for stub locale support
 237.220 - #endif
 237.221 --#ifndef __UCLIBC_HAS_XLOCALE__
 237.222 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 237.223 --#endif
 237.224 - 
 237.225 - namespace std
 237.226 - {
   238.1 --- a/patches/gcc/4.2.1/204-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:08:01 2008 +0000
   238.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   238.3 @@ -1,50 +0,0 @@
   238.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   238.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
   238.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
   238.7 -@@ -401,7 +401,7 @@
   238.8 - # ifdef __UCLIBC_HAS_XLOCALE__
   238.9 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  238.10 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  238.11 --# else
  238.12 -+# elif defined __UCLIBC_HAS_LOCALE__
  238.13 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  238.14 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  238.15 - # endif
  238.16 -@@ -556,7 +556,7 @@
  238.17 - # ifdef __UCLIBC_HAS_XLOCALE__
  238.18 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  238.19 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  238.20 --# else
  238.21 -+# elif defined __UCLIBC_HAS_LOCALE__
  238.22 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  238.23 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  238.24 - # endif
  238.25 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  238.26 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
  238.27 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
  238.28 -@@ -127,12 +127,25 @@
  238.29 - 	{
  238.30 - 	  // Named locale.
  238.31 - 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  238.32 -+#ifdef __UCLIBC_MJN3_ONLY__
  238.33 -+#warning fix this... should be numeric
  238.34 -+#endif
  238.35 -+#ifdef __UCLIBC__
  238.36 -+# ifdef __UCLIBC_HAS_XLOCALE__
  238.37 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  238.38 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  238.39 -+# elif defined __UCLIBC_HAS_LOCALE__
  238.40 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  238.41 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  238.42 -+# endif
  238.43 -+#else
  238.44 - 	  union { char *__s; wchar_t __w; } __u;
  238.45 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  238.46 - 	  _M_data->_M_decimal_point = __u.__w;
  238.47 - 
  238.48 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  238.49 - 	  _M_data->_M_thousands_sep = __u.__w;
  238.50 -+#endif
  238.51 - 
  238.52 - 	  if (_M_data->_M_thousands_sep == L'\0')
  238.53 - 	    _M_data->_M_grouping = "";
   239.1 --- a/patches/gcc/4.2.1/205-uclibc-locale-update.patch	Mon Jul 28 21:08:01 2008 +0000
   239.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   239.3 @@ -1,354 +0,0 @@
   239.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   239.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   239.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:31:54.000000000 +0200
   239.7 -@@ -46,16 +46,13 @@
   239.8 -     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   239.9 - 		   const __c_locale& __cloc)
  239.10 -     {
  239.11 --      if (!(__err & ios_base::failbit))
  239.12 --	{
  239.13 --	  char* __sanity;
  239.14 --	  errno = 0;
  239.15 --	  float __f = __strtof_l(__s, &__sanity, __cloc);
  239.16 --          if (__sanity != __s && errno != ERANGE)
  239.17 --	    __v = __f;
  239.18 --	  else
  239.19 --	    __err |= ios_base::failbit;
  239.20 --	}
  239.21 -+      char* __sanity;
  239.22 -+      errno = 0;
  239.23 -+      float __f = __strtof_l(__s, &__sanity, __cloc);
  239.24 -+      if (__sanity != __s && errno != ERANGE)
  239.25 -+	__v = __f;
  239.26 -+      else
  239.27 -+	__err |= ios_base::failbit;
  239.28 -     }
  239.29 - 
  239.30 -   template<>
  239.31 -@@ -63,16 +60,13 @@
  239.32 -     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  239.33 - 		   const __c_locale& __cloc)
  239.34 -     {
  239.35 --      if (!(__err & ios_base::failbit))
  239.36 --	{
  239.37 --	  char* __sanity;
  239.38 --	  errno = 0;
  239.39 --	  double __d = __strtod_l(__s, &__sanity, __cloc);
  239.40 --          if (__sanity != __s && errno != ERANGE)
  239.41 --	    __v = __d;
  239.42 --	  else
  239.43 --	    __err |= ios_base::failbit;
  239.44 --	}
  239.45 -+      char* __sanity;
  239.46 -+      errno = 0;
  239.47 -+      double __d = __strtod_l(__s, &__sanity, __cloc);
  239.48 -+      if (__sanity != __s && errno != ERANGE)
  239.49 -+	__v = __d;
  239.50 -+      else
  239.51 -+	__err |= ios_base::failbit;
  239.52 -     }
  239.53 - 
  239.54 -   template<>
  239.55 -@@ -80,16 +74,13 @@
  239.56 -     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  239.57 - 		   const __c_locale& __cloc)
  239.58 -     {
  239.59 --      if (!(__err & ios_base::failbit))
  239.60 --	{
  239.61 --	  char* __sanity;
  239.62 --	  errno = 0;
  239.63 --	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  239.64 --          if (__sanity != __s && errno != ERANGE)
  239.65 --	    __v = __ld;
  239.66 --	  else
  239.67 --	    __err |= ios_base::failbit;
  239.68 --	}
  239.69 -+      char* __sanity;
  239.70 -+      errno = 0;
  239.71 -+      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  239.72 -+      if (__sanity != __s && errno != ERANGE)
  239.73 -+	__v = __ld;
  239.74 -+      else
  239.75 -+	__err |= ios_base::failbit;
  239.76 -     }
  239.77 - 
  239.78 -   void
  239.79 -@@ -110,7 +101,7 @@
  239.80 -   void
  239.81 -   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  239.82 -   {
  239.83 --    if (_S_get_c_locale() != __cloc)
  239.84 -+    if (__cloc && _S_get_c_locale() != __cloc)
  239.85 -       __freelocale(__cloc); 
  239.86 -   }
  239.87 - 
  239.88 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  239.89 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  239.90 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:31:54.000000000 +0200
  239.91 -@@ -39,21 +39,23 @@
  239.92 - #pragma GCC system_header
  239.93 - 
  239.94 - #include <cstring>              // get std::strlen
  239.95 --#include <cstdio>               // get std::snprintf or std::sprintf
  239.96 -+#include <cstdio>               // get std::vsnprintf or std::vsprintf
  239.97 - #include <clocale>
  239.98 - #include <langinfo.h>		// For codecvt
  239.99 - #ifdef __UCLIBC_MJN3_ONLY__
 239.100 - #warning fix this
 239.101 - #endif
 239.102 --#ifdef __UCLIBC_HAS_LOCALE__
 239.103 -+#ifdef _GLIBCXX_USE_ICONV
 239.104 - #include <iconv.h>		// For codecvt using iconv, iconv_t
 239.105 - #endif
 239.106 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 239.107 --#include <libintl.h> 		// For messages
 239.108 -+#ifdef HAVE_LIBINTL_H
 239.109 -+#include <libintl.h>		// For messages
 239.110 - #endif
 239.111 -+#include <cstdarg>
 239.112 - 
 239.113 - #ifdef __UCLIBC_MJN3_ONLY__
 239.114 - #warning what is _GLIBCXX_C_LOCALE_GNU for
 239.115 -+// psm: used in os/gnu-linux/ctype_noninline.h
 239.116 - #endif
 239.117 - #define _GLIBCXX_C_LOCALE_GNU 1
 239.118 - 
 239.119 -@@ -62,7 +64,7 @@
 239.120 - #endif
 239.121 - // #define _GLIBCXX_NUM_CATEGORIES 6
 239.122 - #define _GLIBCXX_NUM_CATEGORIES 0
 239.123 -- 
 239.124 -+
 239.125 - #ifdef __UCLIBC_HAS_XLOCALE__
 239.126 - namespace __gnu_cxx
 239.127 - {
 239.128 -@@ -79,22 +81,24 @@
 239.129 -   typedef int*			__c_locale;
 239.130 - #endif
 239.131 - 
 239.132 --  // Convert numeric value of type _Tv to string and return length of
 239.133 --  // string.  If snprintf is available use it, otherwise fall back to
 239.134 --  // the unsafe sprintf which, in general, can be dangerous and should
 239.135 -+  // Convert numeric value of type double to string and return length of
 239.136 -+  // string.  If vsnprintf is available use it, otherwise fall back to
 239.137 -+  // the unsafe vsprintf which, in general, can be dangerous and should
 239.138 -   // be avoided.
 239.139 --  template<typename _Tv>
 239.140 --    int
 239.141 --    __convert_from_v(char* __out, 
 239.142 --		     const int __size __attribute__ ((__unused__)),
 239.143 --		     const char* __fmt,
 239.144 --#ifdef __UCLIBC_HAS_XCLOCALE__
 239.145 --		     _Tv __v, const __c_locale& __cloc, int __prec)
 239.146 -+    inline int
 239.147 -+    __convert_from_v(const __c_locale&
 239.148 -+#ifndef __UCLIBC_HAS_XCLOCALE__
 239.149 -+					__cloc __attribute__ ((__unused__))
 239.150 -+#endif
 239.151 -+		     ,
 239.152 -+		     char* __out,
 239.153 -+		     const int __size,
 239.154 -+		     const char* __fmt, ...)
 239.155 -     {
 239.156 -+      va_list __args;
 239.157 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 239.158 -       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 239.159 - #else
 239.160 --		     _Tv __v, const __c_locale&, int __prec)
 239.161 --    {
 239.162 - # ifdef __UCLIBC_HAS_LOCALE__
 239.163 -       char* __old = std::setlocale(LC_ALL, NULL);
 239.164 -       char* __sav = new char[std::strlen(__old) + 1];
 239.165 -@@ -103,7 +107,9 @@
 239.166 - # endif
 239.167 - #endif
 239.168 - 
 239.169 --      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 239.170 -+      va_start(__args, __fmt);
 239.171 -+      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 239.172 -+      va_end(__args);
 239.173 - 
 239.174 - #ifdef __UCLIBC_HAS_XCLOCALE__
 239.175 -       __gnu_cxx::__uselocale(__old);
 239.176 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 239.177 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 239.178 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:31:54.000000000 +0200
 239.179 -@@ -33,9 +33,14 @@
 239.180 - 
 239.181 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 239.182 - 
 239.183 -+#include <features.h>
 239.184 -+#ifdef __UCLIBC_HAS_LOCALE__
 239.185 - #define _LIBC
 239.186 - #include <locale>
 239.187 - #undef _LIBC
 239.188 -+#else
 239.189 -+#include <locale>
 239.190 -+#endif
 239.191 - #include <bits/c++locale_internal.h>
 239.192 - 
 239.193 - namespace std
 239.194 -@@ -138,20 +143,34 @@
 239.195 -   ctype<wchar_t>::
 239.196 -   do_is(mask __m, wchar_t __c) const
 239.197 -   { 
 239.198 --    // Highest bitmask in ctype_base == 10, but extra in "C"
 239.199 --    // library for blank.
 239.200 -+    // The case of __m == ctype_base::space is particularly important,
 239.201 -+    // due to its use in many istream functions.  Therefore we deal with
 239.202 -+    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 239.203 -+    // is the mask corresponding to ctype_base::space.  NB: an encoding
 239.204 -+    // change would not affect correctness!
 239.205 -     bool __ret = false;
 239.206 --    const size_t __bitmasksize = 11; 
 239.207 --    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 239.208 --      if (__m & _M_bit[__bitcur]
 239.209 --	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 239.210 --	{
 239.211 --	  __ret = true;
 239.212 --	  break;
 239.213 --	}
 239.214 -+    if (__m == _M_bit[5])
 239.215 -+      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 239.216 -+    else
 239.217 -+      {
 239.218 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 239.219 -+	// library for blank.
 239.220 -+	const size_t __bitmasksize = 11;
 239.221 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 239.222 -+	  if (__m & _M_bit[__bitcur])
 239.223 -+	    {
 239.224 -+	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 239.225 -+		{
 239.226 -+		  __ret = true;
 239.227 -+		  break;
 239.228 -+		}
 239.229 -+	      else if (__m == _M_bit[__bitcur])
 239.230 -+		break;
 239.231 -+	    }
 239.232 -+      }
 239.233 -     return __ret;    
 239.234 -   }
 239.235 --  
 239.236 -+
 239.237 -   const wchar_t* 
 239.238 -   ctype<wchar_t>::
 239.239 -   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 239.240 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 239.241 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 239.242 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
 239.243 -@@ -47,18 +47,21 @@
 239.244 -   template<typename _CharT>
 239.245 -      messages<_CharT>::messages(size_t __refs)
 239.246 -      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 239.247 --     _M_name_messages(_S_get_c_name())
 239.248 -+       _M_name_messages(_S_get_c_name())
 239.249 -      { }
 239.250 - 
 239.251 -   template<typename _CharT>
 239.252 -      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 239.253 - 				size_t __refs) 
 239.254 --     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 239.255 --     _M_name_messages(__s)
 239.256 -+     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 239.257 -      {
 239.258 --       char* __tmp = new char[std::strlen(__s) + 1];
 239.259 --       std::strcpy(__tmp, __s);
 239.260 -+       const size_t __len = std::strlen(__s) + 1;
 239.261 -+       char* __tmp = new char[__len];
 239.262 -+       std::memcpy(__tmp, __s, __len);
 239.263 -        _M_name_messages = __tmp;
 239.264 -+
 239.265 -+       // Last to avoid leaking memory if new throws.
 239.266 -+       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 239.267 -      }
 239.268 - 
 239.269 -   template<typename _CharT>
 239.270 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 239.271 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
 239.272 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:54.000000000 +0200
 239.273 -@@ -33,9 +33,14 @@
 239.274 - 
 239.275 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 239.276 - 
 239.277 -+#include <features.h>
 239.278 -+#ifdef __UCLIBC_HAS_LOCALE__
 239.279 - #define _LIBC
 239.280 - #include <locale>
 239.281 - #undef _LIBC
 239.282 -+#else
 239.283 -+#include <locale>
 239.284 -+#endif
 239.285 - #include <bits/c++locale_internal.h>
 239.286 - 
 239.287 - #ifdef __UCLIBC_MJN3_ONLY__
 239.288 -@@ -206,7 +211,7 @@
 239.289 - 	  }
 239.290 - 	break;
 239.291 -       default:
 239.292 --	;
 239.293 -+	__ret = pattern();
 239.294 -       }
 239.295 -     return __ret;
 239.296 -   }
 239.297 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 239.298 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
 239.299 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:54.000000000 +0200
 239.300 -@@ -33,9 +33,14 @@
 239.301 - 
 239.302 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 239.303 - 
 239.304 -+#include <features.h>
 239.305 -+#ifdef __UCLIBC_HAS_LOCALE__
 239.306 - #define _LIBC
 239.307 - #include <locale>
 239.308 - #undef _LIBC
 239.309 -+#else
 239.310 -+#include <locale>
 239.311 -+#endif
 239.312 - #include <bits/c++locale_internal.h>
 239.313 - 
 239.314 - #ifdef __UCLIBC_MJN3_ONLY__
 239.315 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
 239.316 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
 239.317 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
 239.318 -@@ -37,25 +37,33 @@
 239.319 -   template<typename _CharT>
 239.320 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
 239.321 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 239.322 --    _M_name_timepunct(_S_get_c_name())
 239.323 -+      _M_name_timepunct(_S_get_c_name())
 239.324 -     { _M_initialize_timepunct(); }
 239.325 - 
 239.326 -   template<typename _CharT>
 239.327 -     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 239.328 -     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 239.329 --    _M_name_timepunct(_S_get_c_name())
 239.330 -+      _M_name_timepunct(_S_get_c_name())
 239.331 -     { _M_initialize_timepunct(); }
 239.332 - 
 239.333 -   template<typename _CharT>
 239.334 -     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 239.335 - 				     size_t __refs) 
 239.336 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 239.337 --    _M_name_timepunct(__s)
 239.338 -+      _M_name_timepunct(NULL)
 239.339 -     { 
 239.340 --      char* __tmp = new char[std::strlen(__s) + 1];
 239.341 --      std::strcpy(__tmp, __s);
 239.342 -+      const size_t __len = std::strlen(__s) + 1;
 239.343 -+      char* __tmp = new char[__len];
 239.344 -+      std::memcpy(__tmp, __s, __len);
 239.345 -       _M_name_timepunct = __tmp;
 239.346 --      _M_initialize_timepunct(__cloc); 
 239.347 -+
 239.348 -+      try
 239.349 -+	{ _M_initialize_timepunct(__cloc); }
 239.350 -+      catch(...)
 239.351 -+	{
 239.352 -+	  delete [] _M_name_timepunct;
 239.353 -+	  __throw_exception_again;
 239.354 -+	}
 239.355 -     }
 239.356 - 
 239.357 -   template<typename _CharT>
   240.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   240.2 +++ b/patches/gcc/4.2.1/210-libmudflap-susv3-legacy.patch	Mon Jul 28 21:32:33 2008 +0000
   240.3 @@ -0,0 +1,48 @@
   240.4 +diff -durN gcc-4.2.1.orig/libmudflap/mf-hooks2.c gcc-4.2.1/libmudflap/mf-hooks2.c
   240.5 +--- gcc-4.2.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   240.6 ++++ gcc-4.2.1/libmudflap/mf-hooks2.c	2007-08-03 20:35:09.000000000 +0200
   240.7 +@@ -427,7 +427,7 @@
   240.8 + {
   240.9 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  240.10 +   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  240.11 +-  bzero (s, n);
  240.12 ++  memset (s, 0, n);
  240.13 + }
  240.14 + 
  240.15 + 
  240.16 +@@ -437,7 +437,7 @@
  240.17 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  240.18 +   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  240.19 +   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  240.20 +-  bcopy (src, dest, n);
  240.21 ++  memmove (dest, src, n);
  240.22 + }
  240.23 + 
  240.24 + 
  240.25 +@@ -447,7 +447,7 @@
  240.26 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  240.27 +   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  240.28 +   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  240.29 +-  return bcmp (s1, s2, n);
  240.30 ++  return n == 0 ? 0 : memcmp (s1, s2, n);
  240.31 + }
  240.32 + 
  240.33 + 
  240.34 +@@ -456,7 +456,7 @@
  240.35 +   size_t n = strlen (s);
  240.36 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  240.37 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  240.38 +-  return index (s, c);
  240.39 ++  return strchr (s, c);
  240.40 + }
  240.41 + 
  240.42 + 
  240.43 +@@ -465,7 +465,7 @@
  240.44 +   size_t n = strlen (s);
  240.45 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  240.46 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  240.47 +-  return rindex (s, c);
  240.48 ++  return strrchr (s, c);
  240.49 + }
  240.50 + 
  240.51 + /* XXX:  stpcpy, memccpy */
   241.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   241.2 +++ b/patches/gcc/4.2.1/220-libstdc++-namespace.patch	Mon Jul 28 21:32:33 2008 +0000
   241.3 @@ -0,0 +1,36 @@
   241.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
   241.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
   241.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:35:40.000000000 +0200
   241.7 +@@ -32,7 +32,8 @@
   241.8 + //
   241.9 + 
  241.10 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  241.11 +-
  241.12 ++namespace std
  241.13 ++{
  241.14 + #ifdef __UCLIBC_MJN3_ONLY__
  241.15 + #warning fix prototypes for *textdomain funcs
  241.16 + #endif
  241.17 +@@ -115,3 +116,4 @@
  241.18 + 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  241.19 + 	 }
  241.20 +      }
  241.21 ++}
  241.22 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
  241.23 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
  241.24 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:35:40.000000000 +0200
  241.25 +@@ -33,7 +33,8 @@
  241.26 + //
  241.27 + 
  241.28 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  241.29 +-
  241.30 ++namespace std
  241.31 ++{
  241.32 +   template<typename _CharT>
  241.33 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
  241.34 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  241.35 +@@ -74,3 +75,4 @@
  241.36 +       delete _M_data; 
  241.37 +       _S_destroy_c_locale(_M_c_locale_timepunct); 
  241.38 +     }
  241.39 ++}
   242.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   242.2 +++ b/patches/gcc/4.2.1/230-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:32:33 2008 +0000
   242.3 @@ -0,0 +1,12 @@
   242.4 +diff -durN gcc-4.2.1.orig/gcc/Makefile.in gcc-4.2.1/gcc/Makefile.in
   242.5 +--- gcc-4.2.1.orig/gcc/Makefile.in	2007-05-31 17:37:38.000000000 +0200
   242.6 ++++ gcc-4.2.1/gcc/Makefile.in	2007-08-03 20:36:14.000000000 +0200
   242.7 +@@ -2660,7 +2660,7 @@
   242.8 + # FIXME: writing proper dependencies for this is a *LOT* of work.
   242.9 + libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
  242.10 +   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  242.11 +-  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  242.12 ++  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  242.13 + 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  242.14 + 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  242.15 + 	  -DLOCALEDIR=\"$(localedir)\" \
   243.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   243.2 +++ b/patches/gcc/4.2.1/240-arm-bigendian.patch	Mon Jul 28 21:32:33 2008 +0000
   243.3 @@ -0,0 +1,64 @@
   243.4 +diff -durN gcc-4.2.1.orig/gcc/config/arm/linux-elf.h gcc-4.2.1/gcc/config/arm/linux-elf.h
   243.5 +--- gcc-4.2.1.orig/gcc/config/arm/linux-elf.h	2006-02-17 00:29:10.000000000 +0100
   243.6 ++++ gcc-4.2.1/gcc/config/arm/linux-elf.h	2007-08-03 20:36:43.000000000 +0200
   243.7 +@@ -28,19 +28,33 @@
   243.8 + #undef  TARGET_VERSION
   243.9 + #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  243.10 + 
  243.11 ++/*
  243.12 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  243.13 ++ * (big endian) configurations.
  243.14 ++ */
  243.15 ++#if TARGET_BIG_ENDIAN_DEFAULT
  243.16 ++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  243.17 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
  243.18 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
  243.19 ++#else
  243.20 ++#define TARGET_ENDIAN_DEFAULT 0
  243.21 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
  243.22 ++#define TARGET_LINKER_EMULATION "armelf_linux"
  243.23 ++#endif
  243.24 ++
  243.25 + #undef  TARGET_DEFAULT_FLOAT_ABI
  243.26 + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  243.27 + 
  243.28 + #undef  TARGET_DEFAULT
  243.29 +-#define TARGET_DEFAULT (0)
  243.30 ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  243.31 + 
  243.32 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  243.33 + 
  243.34 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  243.35 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  243.36 + 
  243.37 + #undef  MULTILIB_DEFAULTS
  243.38 + #define MULTILIB_DEFAULTS \
  243.39 +-	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  243.40 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  243.41 + 
  243.42 + /* Now we define the strings used to build the spec file.  */
  243.43 + #undef  LIB_SPEC
  243.44 +@@ -61,7 +75,7 @@
  243.45 +    %{rdynamic:-export-dynamic} \
  243.46 +    %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
  243.47 +    -X \
  243.48 +-   %{mbig-endian:-EB}" \
  243.49 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  243.50 +    SUBTARGET_EXTRA_LINK_SPEC
  243.51 + 
  243.52 + #undef  LINK_SPEC
  243.53 +diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
  243.54 +--- gcc-4.2.1.orig/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
  243.55 ++++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:36:43.000000000 +0200
  243.56 +@@ -705,6 +705,11 @@
  243.57 + 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  243.58 + 	tmake_file="${tmake_file} t-linux arm/t-arm"
  243.59 + 	case ${target} in
  243.60 ++	arm*b-*)
  243.61 ++		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  243.62 ++		;;
  243.63 ++	esac
  243.64 ++	case ${target} in
  243.65 + 	arm*-*-linux-*eabi)
  243.66 + 	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
  243.67 + 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
   244.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   244.2 +++ b/patches/gcc/4.2.1/250-softfloat-fix.patch	Mon Jul 28 21:32:33 2008 +0000
   244.3 @@ -0,0 +1,58 @@
   244.4 +This patch (C) 2007 Yann E. MORIN
   244.5 +Licensed under GPL v2.
   244.6 +
   244.7 +First hunk of this patch solves compiling uClibc:
   244.8 +
   244.9 +make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  244.10 +  LD libuClibc-0.9.29.so
  244.11 +libc/libc_so.a(difftime.os): In function `difftime':
  244.12 +difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  244.13 +difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  244.14 +libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  244.15 +_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  244.16 +_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  244.17 +_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  244.18 +_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  244.19 +_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  244.20 +_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  244.21 +_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  244.22 +libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  244.23 +__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  244.24 +libc/libc_so.a(strtof.os): In function `strtof':
  244.25 +strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  244.26 +/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  244.27 +In function `__fixunsdfsi':
  244.28 +libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  244.29 +make[2]: *** [lib/libc.so] Error 1
  244.30 +make[1]: *** [lib/libc.so.0] Error 2
  244.31 +make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  244.32 +make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  244.33 +Error 2
  244.34 +
  244.35 +The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  244.36 +
  244.37 +
  244.38 +diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
  244.39 +--- gcc-4.2.0.orig/gcc/config.gcc	2007-07-15 11:24:18.000000000 +0200
  244.40 ++++ gcc-4.2.0/gcc/config.gcc	2007-07-15 11:26:02.000000000 +0200
  244.41 +@@ -721,7 +721,7 @@
  244.42 + 	    default_use_cxa_atexit=yes
  244.43 + 	    ;;
  244.44 + 	*)
  244.45 +-	    tmake_file="$tmake_file arm/t-linux"
  244.46 ++	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  244.47 + 	    ;;
  244.48 + 	esac
  244.49 + 	tm_file="$tm_file arm/aout.h arm/arm.h"
  244.50 +diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
  244.51 +--- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h	2007-07-15 11:24:18.000000000 +0200
  244.52 ++++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2007-07-15 11:26:02.000000000 +0200
  244.53 +@@ -63,7 +63,7 @@
  244.54 +    %{shared:-lc} \
  244.55 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  244.56 + 
  244.57 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  244.58 ++#define LIBGCC_SPEC "-lgcc"
  244.59 + 
  244.60 + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  244.61 + 
   245.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   245.2 +++ b/patches/gcc/4.2.1/260-flatten-switch-stmt-00.patch	Mon Jul 28 21:32:33 2008 +0000
   245.3 @@ -0,0 +1,24 @@
   245.4 +diff -durN gcc-4.2.1.orig/gcc/stmt.c gcc-4.2.1/gcc/stmt.c
   245.5 +--- gcc-4.2.1.orig/gcc/stmt.c	2007-07-19 05:25:32.000000000 +0200
   245.6 ++++ gcc-4.2.1/gcc/stmt.c	2007-08-03 20:37:19.000000000 +0200
   245.7 +@@ -2512,7 +2512,11 @@
   245.8 + 	  use_cost_table
   245.9 + 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  245.10 + 	       && estimate_case_costs (case_list));
  245.11 +-	  balance_case_nodes (&case_list, NULL);
  245.12 ++	  /* When optimizing for size, we want a straight list to avoid
  245.13 ++	     jumps as much as possible. This basically creates an if-else
  245.14 ++	     chain.  */
  245.15 ++	  if (!optimize_size)
  245.16 ++	    balance_case_nodes (&case_list, NULL);
  245.17 + 	  emit_case_nodes (index, case_list, default_label, index_type);
  245.18 + 	  emit_jump (default_label);
  245.19 + 	}
  245.20 +@@ -3070,6 +3074,7 @@
  245.21 + 	    {
  245.22 + 	      if (!node_has_low_bound (node, index_type))
  245.23 + 		{
  245.24 ++		  if (!optimize_size) /* don't jl to the .default_label. */
  245.25 + 		  emit_cmp_and_jump_insns (index,
  245.26 + 					   convert_modes
  245.27 + 					   (mode, imode,
   246.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   246.2 +++ b/patches/gcc/4.2.1/270-soft-float.patch	Mon Jul 28 21:32:33 2008 +0000
   246.3 @@ -0,0 +1,21 @@
   246.4 +diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
   246.5 +--- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c	2007-03-05 11:54:00.000000000 -0500
   246.6 ++++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c	2008-01-31 17:51:24.000000000 -0500
   246.7 +@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
   246.8 +    but GCC currently generates poor code when a union is used to turn
   246.9 +    a long double into a pair of doubles.  */
  246.10 + 
  246.11 ++#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  246.12 ++
  246.13 + long double __gcc_qadd (double, double, double, double);
  246.14 + long double __gcc_qsub (double, double, double, double);
  246.15 + long double __gcc_qmul (double, double, double, double);
  246.16 +@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
  246.17 +   return z.ldval;
  246.18 + }
  246.19 + 
  246.20 +-#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  246.21 +-
  246.22 + long double __gcc_qneg (double, double);
  246.23 + int __gcc_qeq (double, double, double, double);
  246.24 + int __gcc_qne (double, double, double, double);
   247.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   247.2 +++ b/patches/gcc/4.2.1/280-alpha-signal_h.patch	Mon Jul 28 21:32:33 2008 +0000
   247.3 @@ -0,0 +1,17 @@
   247.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   247.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   247.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   247.7 + /* Do code reading to identify a signal frame, and set the frame
   247.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
   247.9 + 
  247.10 ++/* Don't use this if inhibit_libc is set
  247.11 ++   The build for this target will fail trying to include missing headers */
  247.12 ++#ifndef inhibit_libc
  247.13 + #include <signal.h>
  247.14 + #include <sys/ucontext.h>
  247.15 + 
  247.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  247.17 +   fs->retaddr_column = 64;
  247.18 +   return _URC_NO_REASON;
  247.19 + }
  247.20 ++#endif /* inhibit_libc */
   248.1 --- a/patches/gcc/4.2.1/300-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   248.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   248.3 @@ -1,50 +0,0 @@
   248.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am gcc-4.2.1/libstdc++-v3/src/Makefile.am
   248.5 ---- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am	2006-07-28 06:57:34.000000000 +0200
   248.6 -+++ gcc-4.2.1/libstdc++-v3/src/Makefile.am	2007-08-03 20:32:27.000000000 +0200
   248.7 -@@ -257,6 +257,12 @@
   248.8 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
   248.9 - 
  248.10 - 
  248.11 -+install-exec-local:
  248.12 -+ifeq ($(enable_shared),yes)
  248.13 -+	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  248.14 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  248.15 -+endif
  248.16 -+
  248.17 - # Added bits to build debug library.
  248.18 - if GLIBCXX_BUILD_DEBUG
  248.19 - all-local: build_debug
  248.20 -diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in gcc-4.2.1/libstdc++-v3/src/Makefile.in
  248.21 ---- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in	2006-10-16 21:08:22.000000000 +0200
  248.22 -+++ gcc-4.2.1/libstdc++-v3/src/Makefile.in	2007-08-03 20:32:27.000000000 +0200
  248.23 -@@ -657,7 +657,7 @@
  248.24 - 
  248.25 - install-data-am: install-data-local
  248.26 - 
  248.27 --install-exec-am: install-toolexeclibLTLIBRARIES
  248.28 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  248.29 - 
  248.30 - install-info: install-info-am
  248.31 - 
  248.32 -@@ -690,6 +690,7 @@
  248.33 - 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  248.34 - 	html-am info info-am install install-am install-data \
  248.35 - 	install-data-am install-data-local install-exec \
  248.36 -+	install-exec-local \
  248.37 - 	install-exec-am install-info install-info-am install-man \
  248.38 - 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  248.39 - 	installcheck-am installdirs maintainer-clean \
  248.40 -@@ -799,6 +800,13 @@
  248.41 - install_debug:
  248.42 - 	(cd ${debugdir} && $(MAKE) \
  248.43 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  248.44 -+
  248.45 -+install-exec-local:
  248.46 -+ifeq ($(enable_shared),yes)
  248.47 -+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  248.48 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  248.49 -+endif
  248.50 -+
  248.51 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  248.52 - # Otherwise a system limit (for SysV at least) may be exceeded.
  248.53 - .NOEXPORT:
   249.1 --- a/patches/gcc/4.2.1/301-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   249.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   249.3 @@ -1,12 +0,0 @@
   249.4 -diff -durN gcc-4.2.1.orig/boehm-gc/include/gc.h gcc-4.2.1/boehm-gc/include/gc.h
   249.5 ---- gcc-4.2.1.orig/boehm-gc/include/gc.h	2006-09-18 20:45:08.000000000 +0200
   249.6 -+++ gcc-4.2.1/boehm-gc/include/gc.h	2007-08-03 20:33:00.000000000 +0200
   249.7 -@@ -502,7 +502,7 @@
   249.8 - #if defined(__linux__) || defined(__GLIBC__)
   249.9 - # include <features.h>
  249.10 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  249.11 --     && !defined(__ia64__)
  249.12 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  249.13 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  249.14 - #     define GC_HAVE_BUILTIN_BACKTRACE
  249.15 - #   endif
   250.1 --- a/patches/gcc/4.2.1/302-c99-snprintf.patch	Mon Jul 28 21:08:01 2008 +0000
   250.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   250.3 @@ -1,12 +0,0 @@
   250.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h
   250.5 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h	2006-12-07 10:33:51.000000000 +0100
   250.6 -+++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h	2007-08-03 20:33:24.000000000 +0200
   250.7 -@@ -144,7 +144,7 @@
   250.8 - 
   250.9 - _GLIBCXX_END_NAMESPACE
  250.10 - 
  250.11 --#if _GLIBCXX_USE_C99
  250.12 -+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  250.13 - 
  250.14 - #undef snprintf
  250.15 - #undef vfscanf
   251.1 --- a/patches/gcc/4.2.1/303-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   251.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   251.3 @@ -1,13 +0,0 @@
   251.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
   251.5 ---- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
   251.6 -+++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:33:56.000000000 +0200
   251.7 -@@ -7514,6 +7514,9 @@
   251.8 - cat >>conftest.$ac_ext <<_ACEOF
   251.9 - /* end confdefs.h.  */
  251.10 - #include <complex.h>
  251.11 -+#ifdef __UCLIBC__
  251.12 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  251.13 -+#endif
  251.14 - int
  251.15 - main ()
  251.16 - {
   252.1 --- a/patches/gcc/4.2.1/304-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   252.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   252.3 @@ -1,26 +0,0 @@
   252.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/rope gcc-4.2.1/libstdc++-v3/include/ext/rope
   252.5 ---- gcc-4.2.1.orig/libstdc++-v3/include/ext/rope	2006-10-17 13:56:21.000000000 +0200
   252.6 -+++ gcc-4.2.1/libstdc++-v3/include/ext/rope	2007-08-03 20:34:23.000000000 +0200
   252.7 -@@ -58,6 +58,9 @@
   252.8 - #include <bits/allocator.h>
   252.9 - #include <ext/hash_fun.h>
  252.10 - 
  252.11 -+/* cope w/ index defined as macro, SuSv3 proposal */
  252.12 -+#undef index
  252.13 -+
  252.14 - # ifdef __GC
  252.15 - #   define __GC_CONST const
  252.16 - # else
  252.17 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h
  252.18 ---- gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2006-10-17 13:56:21.000000000 +0200
  252.19 -+++ gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h	2007-08-03 20:34:23.000000000 +0200
  252.20 -@@ -54,6 +54,9 @@
  252.21 - #include <ext/memory> // For uninitialized_copy_n
  252.22 - #include <ext/numeric> // For power
  252.23 - 
  252.24 -+/* cope w/ index defined as macro, SuSv3 proposal */
  252.25 -+#undef index
  252.26 -+
  252.27 - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  252.28 - 
  252.29 -   using std::size_t;
   253.1 --- a/patches/gcc/4.2.1/305-libmudflap-susv3-legacy.patch	Mon Jul 28 21:08:01 2008 +0000
   253.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   253.3 @@ -1,48 +0,0 @@
   253.4 -diff -durN gcc-4.2.1.orig/libmudflap/mf-hooks2.c gcc-4.2.1/libmudflap/mf-hooks2.c
   253.5 ---- gcc-4.2.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   253.6 -+++ gcc-4.2.1/libmudflap/mf-hooks2.c	2007-08-03 20:35:09.000000000 +0200
   253.7 -@@ -427,7 +427,7 @@
   253.8 - {
   253.9 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  253.10 -   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  253.11 --  bzero (s, n);
  253.12 -+  memset (s, 0, n);
  253.13 - }
  253.14 - 
  253.15 - 
  253.16 -@@ -437,7 +437,7 @@
  253.17 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  253.18 -   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  253.19 -   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  253.20 --  bcopy (src, dest, n);
  253.21 -+  memmove (dest, src, n);
  253.22 - }
  253.23 - 
  253.24 - 
  253.25 -@@ -447,7 +447,7 @@
  253.26 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  253.27 -   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  253.28 -   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  253.29 --  return bcmp (s1, s2, n);
  253.30 -+  return n == 0 ? 0 : memcmp (s1, s2, n);
  253.31 - }
  253.32 - 
  253.33 - 
  253.34 -@@ -456,7 +456,7 @@
  253.35 -   size_t n = strlen (s);
  253.36 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  253.37 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  253.38 --  return index (s, c);
  253.39 -+  return strchr (s, c);
  253.40 - }
  253.41 - 
  253.42 - 
  253.43 -@@ -465,7 +465,7 @@
  253.44 -   size_t n = strlen (s);
  253.45 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  253.46 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  253.47 --  return rindex (s, c);
  253.48 -+  return strrchr (s, c);
  253.49 - }
  253.50 - 
  253.51 - /* XXX:  stpcpy, memccpy */
   254.1 --- a/patches/gcc/4.2.1/306-libstdc++-namespace.patch	Mon Jul 28 21:08:01 2008 +0000
   254.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   254.3 @@ -1,36 +0,0 @@
   254.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
   254.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
   254.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:35:40.000000000 +0200
   254.7 -@@ -32,7 +32,8 @@
   254.8 - //
   254.9 - 
  254.10 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  254.11 --
  254.12 -+namespace std
  254.13 -+{
  254.14 - #ifdef __UCLIBC_MJN3_ONLY__
  254.15 - #warning fix prototypes for *textdomain funcs
  254.16 - #endif
  254.17 -@@ -115,3 +116,4 @@
  254.18 - 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  254.19 - 	 }
  254.20 -      }
  254.21 -+}
  254.22 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
  254.23 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
  254.24 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:35:40.000000000 +0200
  254.25 -@@ -33,7 +33,8 @@
  254.26 - //
  254.27 - 
  254.28 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  254.29 --
  254.30 -+namespace std
  254.31 -+{
  254.32 -   template<typename _CharT>
  254.33 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
  254.34 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  254.35 -@@ -74,3 +75,4 @@
  254.36 -       delete _M_data; 
  254.37 -       _S_destroy_c_locale(_M_c_locale_timepunct); 
  254.38 -     }
  254.39 -+}
   255.1 --- a/patches/gcc/4.2.1/402-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:08:01 2008 +0000
   255.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   255.3 @@ -1,12 +0,0 @@
   255.4 -diff -durN gcc-4.2.1.orig/gcc/Makefile.in gcc-4.2.1/gcc/Makefile.in
   255.5 ---- gcc-4.2.1.orig/gcc/Makefile.in	2007-05-31 17:37:38.000000000 +0200
   255.6 -+++ gcc-4.2.1/gcc/Makefile.in	2007-08-03 20:36:14.000000000 +0200
   255.7 -@@ -2660,7 +2660,7 @@
   255.8 - # FIXME: writing proper dependencies for this is a *LOT* of work.
   255.9 - libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
  255.10 -   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  255.11 --  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  255.12 -+  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  255.13 - 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  255.14 - 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  255.15 - 	  -DLOCALEDIR=\"$(localedir)\" \
   256.1 --- a/patches/gcc/4.2.1/800-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
   256.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   256.3 @@ -1,64 +0,0 @@
   256.4 -diff -durN gcc-4.2.1.orig/gcc/config/arm/linux-elf.h gcc-4.2.1/gcc/config/arm/linux-elf.h
   256.5 ---- gcc-4.2.1.orig/gcc/config/arm/linux-elf.h	2006-02-17 00:29:10.000000000 +0100
   256.6 -+++ gcc-4.2.1/gcc/config/arm/linux-elf.h	2007-08-03 20:36:43.000000000 +0200
   256.7 -@@ -28,19 +28,33 @@
   256.8 - #undef  TARGET_VERSION
   256.9 - #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  256.10 - 
  256.11 -+/*
  256.12 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  256.13 -+ * (big endian) configurations.
  256.14 -+ */
  256.15 -+#if TARGET_BIG_ENDIAN_DEFAULT
  256.16 -+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  256.17 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
  256.18 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
  256.19 -+#else
  256.20 -+#define TARGET_ENDIAN_DEFAULT 0
  256.21 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
  256.22 -+#define TARGET_LINKER_EMULATION "armelf_linux"
  256.23 -+#endif
  256.24 -+
  256.25 - #undef  TARGET_DEFAULT_FLOAT_ABI
  256.26 - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  256.27 - 
  256.28 - #undef  TARGET_DEFAULT
  256.29 --#define TARGET_DEFAULT (0)
  256.30 -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  256.31 - 
  256.32 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  256.33 - 
  256.34 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  256.35 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  256.36 - 
  256.37 - #undef  MULTILIB_DEFAULTS
  256.38 - #define MULTILIB_DEFAULTS \
  256.39 --	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  256.40 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  256.41 - 
  256.42 - /* Now we define the strings used to build the spec file.  */
  256.43 - #undef  LIB_SPEC
  256.44 -@@ -61,7 +75,7 @@
  256.45 -    %{rdynamic:-export-dynamic} \
  256.46 -    %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
  256.47 -    -X \
  256.48 --   %{mbig-endian:-EB}" \
  256.49 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  256.50 -    SUBTARGET_EXTRA_LINK_SPEC
  256.51 - 
  256.52 - #undef  LINK_SPEC
  256.53 -diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
  256.54 ---- gcc-4.2.1.orig/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
  256.55 -+++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:36:43.000000000 +0200
  256.56 -@@ -705,6 +705,11 @@
  256.57 - 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  256.58 - 	tmake_file="${tmake_file} t-linux arm/t-arm"
  256.59 - 	case ${target} in
  256.60 -+	arm*b-*)
  256.61 -+		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  256.62 -+		;;
  256.63 -+	esac
  256.64 -+	case ${target} in
  256.65 - 	arm*-*-linux-*eabi)
  256.66 - 	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
  256.67 - 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
   257.1 --- a/patches/gcc/4.2.1/801-softfloat-fix.patch	Mon Jul 28 21:08:01 2008 +0000
   257.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   257.3 @@ -1,58 +0,0 @@
   257.4 -This patch (C) 2007 Yann E. MORIN
   257.5 -Licensed under GPL v2.
   257.6 -
   257.7 -First hunk of this patch solves compiling uClibc:
   257.8 -
   257.9 -make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  257.10 -  LD libuClibc-0.9.29.so
  257.11 -libc/libc_so.a(difftime.os): In function `difftime':
  257.12 -difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  257.13 -difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  257.14 -libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  257.15 -_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  257.16 -_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  257.17 -_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  257.18 -_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  257.19 -_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  257.20 -_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  257.21 -_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  257.22 -libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  257.23 -__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  257.24 -libc/libc_so.a(strtof.os): In function `strtof':
  257.25 -strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  257.26 -/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  257.27 -In function `__fixunsdfsi':
  257.28 -libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  257.29 -make[2]: *** [lib/libc.so] Error 1
  257.30 -make[1]: *** [lib/libc.so.0] Error 2
  257.31 -make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  257.32 -make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  257.33 -Error 2
  257.34 -
  257.35 -The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  257.36 -
  257.37 -
  257.38 -diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
  257.39 ---- gcc-4.2.0.orig/gcc/config.gcc	2007-07-15 11:24:18.000000000 +0200
  257.40 -+++ gcc-4.2.0/gcc/config.gcc	2007-07-15 11:26:02.000000000 +0200
  257.41 -@@ -721,7 +721,7 @@
  257.42 - 	    default_use_cxa_atexit=yes
  257.43 - 	    ;;
  257.44 - 	*)
  257.45 --	    tmake_file="$tmake_file arm/t-linux"
  257.46 -+	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  257.47 - 	    ;;
  257.48 - 	esac
  257.49 - 	tm_file="$tm_file arm/aout.h arm/arm.h"
  257.50 -diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
  257.51 ---- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h	2007-07-15 11:24:18.000000000 +0200
  257.52 -+++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2007-07-15 11:26:02.000000000 +0200
  257.53 -@@ -63,7 +63,7 @@
  257.54 -    %{shared:-lc} \
  257.55 -    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  257.56 - 
  257.57 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  257.58 -+#define LIBGCC_SPEC "-lgcc"
  257.59 - 
  257.60 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  257.61 - 
   258.1 --- a/patches/gcc/4.2.1/904-flatten-switch-stmt-00.patch	Mon Jul 28 21:08:01 2008 +0000
   258.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   258.3 @@ -1,24 +0,0 @@
   258.4 -diff -durN gcc-4.2.1.orig/gcc/stmt.c gcc-4.2.1/gcc/stmt.c
   258.5 ---- gcc-4.2.1.orig/gcc/stmt.c	2007-07-19 05:25:32.000000000 +0200
   258.6 -+++ gcc-4.2.1/gcc/stmt.c	2007-08-03 20:37:19.000000000 +0200
   258.7 -@@ -2512,7 +2512,11 @@
   258.8 - 	  use_cost_table
   258.9 - 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  258.10 - 	       && estimate_case_costs (case_list));
  258.11 --	  balance_case_nodes (&case_list, NULL);
  258.12 -+	  /* When optimizing for size, we want a straight list to avoid
  258.13 -+	     jumps as much as possible. This basically creates an if-else
  258.14 -+	     chain.  */
  258.15 -+	  if (!optimize_size)
  258.16 -+	    balance_case_nodes (&case_list, NULL);
  258.17 - 	  emit_case_nodes (index, case_list, default_label, index_type);
  258.18 - 	  emit_jump (default_label);
  258.19 - 	}
  258.20 -@@ -3070,6 +3074,7 @@
  258.21 - 	    {
  258.22 - 	      if (!node_has_low_bound (node, index_type))
  258.23 - 		{
  258.24 -+		  if (!optimize_size) /* don't jl to the .default_label. */
  258.25 - 		  emit_cmp_and_jump_insns (index,
  258.26 - 					   convert_modes
  258.27 - 					   (mode, imode,
   259.1 --- a/patches/gcc/4.2.1/920-soft-float.patch	Mon Jul 28 21:08:01 2008 +0000
   259.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   259.3 @@ -1,21 +0,0 @@
   259.4 -diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
   259.5 ---- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c	2007-03-05 11:54:00.000000000 -0500
   259.6 -+++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c	2008-01-31 17:51:24.000000000 -0500
   259.7 -@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
   259.8 -    but GCC currently generates poor code when a union is used to turn
   259.9 -    a long double into a pair of doubles.  */
  259.10 - 
  259.11 -+#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  259.12 -+
  259.13 - long double __gcc_qadd (double, double, double, double);
  259.14 - long double __gcc_qsub (double, double, double, double);
  259.15 - long double __gcc_qmul (double, double, double, double);
  259.16 -@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
  259.17 -   return z.ldval;
  259.18 - }
  259.19 - 
  259.20 --#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  259.21 --
  259.22 - long double __gcc_qneg (double, double);
  259.23 - int __gcc_qeq (double, double, double, double);
  259.24 - int __gcc_qne (double, double, double, double);
   260.1 --- a/patches/gcc/4.2.1/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
   260.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   260.3 @@ -1,17 +0,0 @@
   260.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   260.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   260.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   260.7 - /* Do code reading to identify a signal frame, and set the frame
   260.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
   260.9 - 
  260.10 -+/* Don't use this if inhibit_libc is set
  260.11 -+   The build for this target will fail trying to include missing headers */
  260.12 -+#ifndef inhibit_libc
  260.13 - #include <signal.h>
  260.14 - #include <sys/ucontext.h>
  260.15 - 
  260.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  260.17 -   fs->retaddr_column = 64;
  260.18 -   return _URC_NO_REASON;
  260.19 - }
  260.20 -+#endif /* inhibit_libc */
   261.1 --- a/patches/gcc/4.2.2/103-uclibc-conf-noupstream.patch	Mon Jul 28 21:08:01 2008 +0000
   261.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   261.3 @@ -1,12 +0,0 @@
   261.4 -diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
   261.5 ---- gcc-4.2.1.orig/gcc/config.gcc	2007-02-03 06:25:20.000000000 +0100
   261.6 -+++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
   261.7 -@@ -1964,7 +1964,7 @@
   261.8 -         ;;
   261.9 - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  261.10 - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  261.11 --  sh-*-linux* | sh[346lbe]*-*-linux* | \
  261.12 -+  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  261.13 -   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  261.14 -    sh64-*-netbsd* | sh64l*-*-netbsd*)
  261.15 - 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   262.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   262.2 +++ b/patches/gcc/4.2.2/110-uclibc-conf-noupstream.patch	Mon Jul 28 21:32:33 2008 +0000
   262.3 @@ -0,0 +1,12 @@
   262.4 +diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
   262.5 +--- gcc-4.2.1.orig/gcc/config.gcc	2007-02-03 06:25:20.000000000 +0100
   262.6 ++++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
   262.7 +@@ -1964,7 +1964,7 @@
   262.8 +         ;;
   262.9 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  262.10 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  262.11 +-  sh-*-linux* | sh[346lbe]*-*-linux* | \
  262.12 ++  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  262.13 +   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  262.14 +    sh64-*-netbsd* | sh64l*-*-netbsd*)
  262.15 + 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   263.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   263.2 +++ b/patches/gcc/4.2.2/120-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   263.3 @@ -0,0 +1,2806 @@
   263.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 gcc-4.2.1/libstdc++-v3/acinclude.m4
   263.5 +--- gcc-4.2.1.orig/libstdc++-v3/acinclude.m4	2007-06-29 01:02:05.000000000 +0200
   263.6 ++++ gcc-4.2.1/libstdc++-v3/acinclude.m4	2007-08-03 20:30:21.000000000 +0200
   263.7 +@@ -1334,7 +1334,7 @@
   263.8 + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   263.9 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  263.10 +     [use MODEL for target locale package],
  263.11 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  263.12 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  263.13 + 
  263.14 +   # Deal with gettext issues.  Default to not using it (=no) until we detect
  263.15 +   # support for it later.  Let the user turn it off via --e/d, but let that
  263.16 +@@ -1355,6 +1355,9 @@
  263.17 +   # Default to "generic".
  263.18 +   if test $enable_clocale_flag = auto; then
  263.19 +     case ${target_os} in
  263.20 ++      *-uclibc*)
  263.21 ++        enable_clocale_flag=uclibc
  263.22 ++        ;;
  263.23 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  263.24 +         enable_clocale_flag=gnu	
  263.25 +         ;;
  263.26 +@@ -1526,6 +1529,40 @@
  263.27 +       CTIME_CC=config/locale/generic/time_members.cc
  263.28 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  263.29 +       ;;
  263.30 ++    uclibc)
  263.31 ++      AC_MSG_RESULT(uclibc)
  263.32 ++
  263.33 ++      # Declare intention to use gettext, and add support for specific
  263.34 ++      # languages.
  263.35 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  263.36 ++      ALL_LINGUAS="de fr"
  263.37 ++
  263.38 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  263.39 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  263.40 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  263.41 ++        USE_NLS=yes
  263.42 ++      fi
  263.43 ++      # Export the build objects.
  263.44 ++      for ling in $ALL_LINGUAS; do \
  263.45 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  263.46 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  263.47 ++      done
  263.48 ++      AC_SUBST(glibcxx_MOFILES)
  263.49 ++      AC_SUBST(glibcxx_POFILES)
  263.50 ++
  263.51 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  263.52 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  263.53 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  263.54 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  263.55 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  263.56 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  263.57 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  263.58 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  263.59 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  263.60 ++      CTIME_H=config/locale/uclibc/time_members.h
  263.61 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  263.62 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  263.63 ++      ;;
  263.64 +   esac
  263.65 + 
  263.66 +   # This is where the testsuite looks for locale catalogs, using the
  263.67 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
  263.68 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  263.69 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
  263.70 +@@ -0,0 +1,160 @@
  263.71 ++// Wrapper for underlying C-language localization -*- C++ -*-
  263.72 ++
  263.73 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  263.74 ++//
  263.75 ++// This file is part of the GNU ISO C++ Library.  This library is free
  263.76 ++// software; you can redistribute it and/or modify it under the
  263.77 ++// terms of the GNU General Public License as published by the
  263.78 ++// Free Software Foundation; either version 2, or (at your option)
  263.79 ++// any later version.
  263.80 ++
  263.81 ++// This library is distributed in the hope that it will be useful,
  263.82 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  263.83 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  263.84 ++// GNU General Public License for more details.
  263.85 ++
  263.86 ++// You should have received a copy of the GNU General Public License along
  263.87 ++// with this library; see the file COPYING.  If not, write to the Free
  263.88 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  263.89 ++// USA.
  263.90 ++
  263.91 ++// As a special exception, you may use this file as part of a free software
  263.92 ++// library without restriction.  Specifically, if other files instantiate
  263.93 ++// templates or use macros or inline functions from this file, or you compile
  263.94 ++// this file and link it with other files to produce an executable, this
  263.95 ++// file does not by itself cause the resulting executable to be covered by
  263.96 ++// the GNU General Public License.  This exception does not however
  263.97 ++// invalidate any other reasons why the executable file might be covered by
  263.98 ++// the GNU General Public License.
  263.99 ++
 263.100 ++//
 263.101 ++// ISO C++ 14882: 22.8  Standard locale categories.
 263.102 ++//
 263.103 ++
 263.104 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 263.105 ++
 263.106 ++#include <cerrno>  // For errno
 263.107 ++#include <locale>
 263.108 ++#include <stdexcept>
 263.109 ++#include <langinfo.h>
 263.110 ++#include <bits/c++locale_internal.h>
 263.111 ++
 263.112 ++#ifndef __UCLIBC_HAS_XLOCALE__
 263.113 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 263.114 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 263.115 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 263.116 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 263.117 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 263.118 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 263.119 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 263.120 ++#warning should dummy __newlocale check for C|POSIX ?
 263.121 ++#define __newlocale(a, b, c)        NULL
 263.122 ++#define __freelocale(a)             ((void)0)
 263.123 ++#define __duplocale(a)              __c_locale()
 263.124 ++#endif
 263.125 ++
 263.126 ++namespace std 
 263.127 ++{
 263.128 ++  template<>
 263.129 ++    void
 263.130 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 263.131 ++		   const __c_locale& __cloc)
 263.132 ++    {
 263.133 ++      if (!(__err & ios_base::failbit))
 263.134 ++	{
 263.135 ++	  char* __sanity;
 263.136 ++	  errno = 0;
 263.137 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
 263.138 ++          if (__sanity != __s && errno != ERANGE)
 263.139 ++	    __v = __f;
 263.140 ++	  else
 263.141 ++	    __err |= ios_base::failbit;
 263.142 ++	}
 263.143 ++    }
 263.144 ++
 263.145 ++  template<>
 263.146 ++    void
 263.147 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 263.148 ++		   const __c_locale& __cloc)
 263.149 ++    {
 263.150 ++      if (!(__err & ios_base::failbit))
 263.151 ++	{
 263.152 ++	  char* __sanity;
 263.153 ++	  errno = 0;
 263.154 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
 263.155 ++          if (__sanity != __s && errno != ERANGE)
 263.156 ++	    __v = __d;
 263.157 ++	  else
 263.158 ++	    __err |= ios_base::failbit;
 263.159 ++	}
 263.160 ++    }
 263.161 ++
 263.162 ++  template<>
 263.163 ++    void
 263.164 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 263.165 ++		   const __c_locale& __cloc)
 263.166 ++    {
 263.167 ++      if (!(__err & ios_base::failbit))
 263.168 ++	{
 263.169 ++	  char* __sanity;
 263.170 ++	  errno = 0;
 263.171 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 263.172 ++          if (__sanity != __s && errno != ERANGE)
 263.173 ++	    __v = __ld;
 263.174 ++	  else
 263.175 ++	    __err |= ios_base::failbit;
 263.176 ++	}
 263.177 ++    }
 263.178 ++
 263.179 ++  void
 263.180 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 263.181 ++				    __c_locale __old)
 263.182 ++  {
 263.183 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 263.184 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.185 ++    if (!__cloc)
 263.186 ++      {
 263.187 ++	// This named locale is not supported by the underlying OS.
 263.188 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 263.189 ++			      "name not valid"));
 263.190 ++      }
 263.191 ++#endif
 263.192 ++  }
 263.193 ++  
 263.194 ++  void
 263.195 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 263.196 ++  {
 263.197 ++    if (_S_get_c_locale() != __cloc)
 263.198 ++      __freelocale(__cloc); 
 263.199 ++  }
 263.200 ++
 263.201 ++  __c_locale
 263.202 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 263.203 ++  { return __duplocale(__cloc); }
 263.204 ++} // namespace std
 263.205 ++
 263.206 ++namespace __gnu_cxx
 263.207 ++{
 263.208 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 263.209 ++    {
 263.210 ++      "LC_CTYPE", 
 263.211 ++      "LC_NUMERIC",
 263.212 ++      "LC_TIME", 
 263.213 ++      "LC_COLLATE", 
 263.214 ++      "LC_MONETARY",
 263.215 ++      "LC_MESSAGES", 
 263.216 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 263.217 ++      "LC_PAPER", 
 263.218 ++      "LC_NAME", 
 263.219 ++      "LC_ADDRESS",
 263.220 ++      "LC_TELEPHONE", 
 263.221 ++      "LC_MEASUREMENT", 
 263.222 ++      "LC_IDENTIFICATION" 
 263.223 ++#endif
 263.224 ++    };
 263.225 ++}
 263.226 ++
 263.227 ++namespace std
 263.228 ++{
 263.229 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 263.230 ++}  // namespace std
 263.231 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
 263.232 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 263.233 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
 263.234 +@@ -0,0 +1,117 @@
 263.235 ++// Wrapper for underlying C-language localization -*- C++ -*-
 263.236 ++
 263.237 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 263.238 ++//
 263.239 ++// This file is part of the GNU ISO C++ Library.  This library is free
 263.240 ++// software; you can redistribute it and/or modify it under the
 263.241 ++// terms of the GNU General Public License as published by the
 263.242 ++// Free Software Foundation; either version 2, or (at your option)
 263.243 ++// any later version.
 263.244 ++
 263.245 ++// This library is distributed in the hope that it will be useful,
 263.246 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 263.247 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 263.248 ++// GNU General Public License for more details.
 263.249 ++
 263.250 ++// You should have received a copy of the GNU General Public License along
 263.251 ++// with this library; see the file COPYING.  If not, write to the Free
 263.252 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 263.253 ++// USA.
 263.254 ++
 263.255 ++// As a special exception, you may use this file as part of a free software
 263.256 ++// library without restriction.  Specifically, if other files instantiate
 263.257 ++// templates or use macros or inline functions from this file, or you compile
 263.258 ++// this file and link it with other files to produce an executable, this
 263.259 ++// file does not by itself cause the resulting executable to be covered by
 263.260 ++// the GNU General Public License.  This exception does not however
 263.261 ++// invalidate any other reasons why the executable file might be covered by
 263.262 ++// the GNU General Public License.
 263.263 ++
 263.264 ++//
 263.265 ++// ISO C++ 14882: 22.8  Standard locale categories.
 263.266 ++//
 263.267 ++
 263.268 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 263.269 ++
 263.270 ++#ifndef _C_LOCALE_H
 263.271 ++#define _C_LOCALE_H 1
 263.272 ++
 263.273 ++#pragma GCC system_header
 263.274 ++
 263.275 ++#include <cstring>              // get std::strlen
 263.276 ++#include <cstdio>               // get std::snprintf or std::sprintf
 263.277 ++#include <clocale>
 263.278 ++#include <langinfo.h>		// For codecvt
 263.279 ++#ifdef __UCLIBC_MJN3_ONLY__
 263.280 ++#warning fix this
 263.281 ++#endif
 263.282 ++#ifdef __UCLIBC_HAS_LOCALE__
 263.283 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 263.284 ++#endif
 263.285 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 263.286 ++#include <libintl.h> 		// For messages
 263.287 ++#endif
 263.288 ++
 263.289 ++#ifdef __UCLIBC_MJN3_ONLY__
 263.290 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 263.291 ++#endif
 263.292 ++#define _GLIBCXX_C_LOCALE_GNU 1
 263.293 ++
 263.294 ++#ifdef __UCLIBC_MJN3_ONLY__
 263.295 ++#warning fix categories
 263.296 ++#endif
 263.297 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 263.298 ++#define _GLIBCXX_NUM_CATEGORIES 0
 263.299 ++ 
 263.300 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.301 ++namespace __gnu_cxx
 263.302 ++{
 263.303 ++  extern "C" __typeof(uselocale) __uselocale;
 263.304 ++}
 263.305 ++#endif
 263.306 ++
 263.307 ++namespace std
 263.308 ++{
 263.309 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.310 ++  typedef __locale_t		__c_locale;
 263.311 ++#else
 263.312 ++  typedef int*			__c_locale;
 263.313 ++#endif
 263.314 ++
 263.315 ++  // Convert numeric value of type _Tv to string and return length of
 263.316 ++  // string.  If snprintf is available use it, otherwise fall back to
 263.317 ++  // the unsafe sprintf which, in general, can be dangerous and should
 263.318 ++  // be avoided.
 263.319 ++  template<typename _Tv>
 263.320 ++    int
 263.321 ++    __convert_from_v(char* __out, 
 263.322 ++		     const int __size __attribute__ ((__unused__)),
 263.323 ++		     const char* __fmt,
 263.324 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 263.325 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 263.326 ++    {
 263.327 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 263.328 ++#else
 263.329 ++		     _Tv __v, const __c_locale&, int __prec)
 263.330 ++    {
 263.331 ++# ifdef __UCLIBC_HAS_LOCALE__
 263.332 ++      char* __old = std::setlocale(LC_ALL, NULL);
 263.333 ++      char* __sav = new char[std::strlen(__old) + 1];
 263.334 ++      std::strcpy(__sav, __old);
 263.335 ++      std::setlocale(LC_ALL, "C");
 263.336 ++# endif
 263.337 ++#endif
 263.338 ++
 263.339 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 263.340 ++
 263.341 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 263.342 ++      __gnu_cxx::__uselocale(__old);
 263.343 ++#elif defined __UCLIBC_HAS_LOCALE__
 263.344 ++      std::setlocale(LC_ALL, __sav);
 263.345 ++      delete [] __sav;
 263.346 ++#endif
 263.347 ++      return __ret;
 263.348 ++    }
 263.349 ++}
 263.350 ++
 263.351 ++#endif
 263.352 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
 263.353 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
 263.354 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
 263.355 +@@ -0,0 +1,63 @@
 263.356 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
 263.357 ++
 263.358 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
 263.359 ++//
 263.360 ++// This file is part of the GNU ISO C++ Library.  This library is free
 263.361 ++// software; you can redistribute it and/or modify it under the
 263.362 ++// terms of the GNU General Public License as published by the
 263.363 ++// Free Software Foundation; either version 2, or (at your option)
 263.364 ++// any later version.
 263.365 ++
 263.366 ++// This library is distributed in the hope that it will be useful,
 263.367 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 263.368 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 263.369 ++// GNU General Public License for more details.
 263.370 ++
 263.371 ++// You should have received a copy of the GNU General Public License along
 263.372 ++// with this library; see the file COPYING.  If not, write to the Free
 263.373 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 263.374 ++// USA.
 263.375 ++
 263.376 ++// As a special exception, you may use this file as part of a free software
 263.377 ++// library without restriction.  Specifically, if other files instantiate
 263.378 ++// templates or use macros or inline functions from this file, or you compile
 263.379 ++// this file and link it with other files to produce an executable, this
 263.380 ++// file does not by itself cause the resulting executable to be covered by
 263.381 ++// the GNU General Public License.  This exception does not however
 263.382 ++// invalidate any other reasons why the executable file might be covered by
 263.383 ++// the GNU General Public License.
 263.384 ++
 263.385 ++// Written by Jakub Jelinek <jakub@redhat.com>
 263.386 ++
 263.387 ++#include <bits/c++config.h>
 263.388 ++#include <clocale>
 263.389 ++
 263.390 ++#ifdef __UCLIBC_MJN3_ONLY__
 263.391 ++#warning clean this up
 263.392 ++#endif
 263.393 ++
 263.394 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.395 ++                                                  
 263.396 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 263.397 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 263.398 ++extern "C" __typeof(strftime_l) __strftime_l;
 263.399 ++extern "C" __typeof(strtod_l) __strtod_l;
 263.400 ++extern "C" __typeof(strtof_l) __strtof_l;
 263.401 ++extern "C" __typeof(strtold_l) __strtold_l;
 263.402 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 263.403 ++extern "C" __typeof(newlocale) __newlocale;
 263.404 ++extern "C" __typeof(freelocale) __freelocale;
 263.405 ++extern "C" __typeof(duplocale) __duplocale;
 263.406 ++extern "C" __typeof(uselocale) __uselocale;
 263.407 ++
 263.408 ++#ifdef _GLIBCXX_USE_WCHAR_T
 263.409 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 263.410 ++extern "C" __typeof(towlower_l) __towlower_l;
 263.411 ++extern "C" __typeof(towupper_l) __towupper_l;
 263.412 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 263.413 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 263.414 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 263.415 ++extern "C" __typeof(wctype_l) __wctype_l;
 263.416 ++#endif 
 263.417 ++
 263.418 ++#endif // GLIBC 2.3 and later
 263.419 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 263.420 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 263.421 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-08-03 20:30:21.000000000 +0200
 263.422 +@@ -0,0 +1,306 @@
 263.423 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 263.424 ++
 263.425 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 263.426 ++//
 263.427 ++// This file is part of the GNU ISO C++ Library.  This library is free
 263.428 ++// software; you can redistribute it and/or modify it under the
 263.429 ++// terms of the GNU General Public License as published by the
 263.430 ++// Free Software Foundation; either version 2, or (at your option)
 263.431 ++// any later version.
 263.432 ++
 263.433 ++// This library is distributed in the hope that it will be useful,
 263.434 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 263.435 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 263.436 ++// GNU General Public License for more details.
 263.437 ++
 263.438 ++// You should have received a copy of the GNU General Public License along
 263.439 ++// with this library; see the file COPYING.  If not, write to the Free
 263.440 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 263.441 ++// USA.
 263.442 ++
 263.443 ++// As a special exception, you may use this file as part of a free software
 263.444 ++// library without restriction.  Specifically, if other files instantiate
 263.445 ++// templates or use macros or inline functions from this file, or you compile
 263.446 ++// this file and link it with other files to produce an executable, this
 263.447 ++// file does not by itself cause the resulting executable to be covered by
 263.448 ++// the GNU General Public License.  This exception does not however
 263.449 ++// invalidate any other reasons why the executable file might be covered by
 263.450 ++// the GNU General Public License.
 263.451 ++
 263.452 ++//
 263.453 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 263.454 ++//
 263.455 ++
 263.456 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 263.457 ++
 263.458 ++#include <locale>
 263.459 ++#include <bits/c++locale_internal.h>
 263.460 ++
 263.461 ++namespace std
 263.462 ++{
 263.463 ++  // Specializations.
 263.464 ++#ifdef _GLIBCXX_USE_WCHAR_T
 263.465 ++  codecvt_base::result
 263.466 ++  codecvt<wchar_t, char, mbstate_t>::
 263.467 ++  do_out(state_type& __state, const intern_type* __from, 
 263.468 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 263.469 ++	 extern_type* __to, extern_type* __to_end,
 263.470 ++	 extern_type*& __to_next) const
 263.471 ++  {
 263.472 ++    result __ret = ok;
 263.473 ++    state_type __tmp_state(__state);
 263.474 ++
 263.475 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.476 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 263.477 ++#endif
 263.478 ++
 263.479 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 263.480 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 263.481 ++    // NB: wcsnrtombs is a GNU extension
 263.482 ++    for (__from_next = __from, __to_next = __to;
 263.483 ++	 __from_next < __from_end && __to_next < __to_end
 263.484 ++	 && __ret == ok;)
 263.485 ++      {
 263.486 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 263.487 ++						      __from_end - __from_next);
 263.488 ++	if (!__from_chunk_end)
 263.489 ++	  __from_chunk_end = __from_end;
 263.490 ++
 263.491 ++	__from = __from_next;
 263.492 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 263.493 ++					 __from_chunk_end - __from_next,
 263.494 ++					 __to_end - __to_next, &__state);
 263.495 ++	if (__conv == static_cast<size_t>(-1))
 263.496 ++	  {
 263.497 ++	    // In case of error, in order to stop at the exact place we
 263.498 ++	    // have to start again from the beginning with a series of
 263.499 ++	    // wcrtomb.
 263.500 ++	    for (; __from < __from_next; ++__from)
 263.501 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 263.502 ++	    __state = __tmp_state;
 263.503 ++	    __ret = error;
 263.504 ++	  }
 263.505 ++	else if (__from_next && __from_next < __from_chunk_end)
 263.506 ++	  {
 263.507 ++	    __to_next += __conv;
 263.508 ++	    __ret = partial;
 263.509 ++	  }
 263.510 ++	else
 263.511 ++	  {
 263.512 ++	    __from_next = __from_chunk_end;
 263.513 ++	    __to_next += __conv;
 263.514 ++	  }
 263.515 ++
 263.516 ++	if (__from_next < __from_end && __ret == ok)
 263.517 ++	  {
 263.518 ++	    extern_type __buf[MB_LEN_MAX];
 263.519 ++	    __tmp_state = __state;
 263.520 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 263.521 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 263.522 ++	      __ret = partial;
 263.523 ++	    else
 263.524 ++	      {
 263.525 ++		memcpy(__to_next, __buf, __conv);
 263.526 ++		__state = __tmp_state;
 263.527 ++		__to_next += __conv;
 263.528 ++		++__from_next;
 263.529 ++	      }
 263.530 ++	  }
 263.531 ++      }
 263.532 ++
 263.533 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.534 ++    __uselocale(__old);
 263.535 ++#endif
 263.536 ++
 263.537 ++    return __ret; 
 263.538 ++  }
 263.539 ++  
 263.540 ++  codecvt_base::result
 263.541 ++  codecvt<wchar_t, char, mbstate_t>::
 263.542 ++  do_in(state_type& __state, const extern_type* __from, 
 263.543 ++	const extern_type* __from_end, const extern_type*& __from_next,
 263.544 ++	intern_type* __to, intern_type* __to_end,
 263.545 ++	intern_type*& __to_next) const
 263.546 ++  {
 263.547 ++    result __ret = ok;
 263.548 ++    state_type __tmp_state(__state);
 263.549 ++
 263.550 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.551 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 263.552 ++#endif
 263.553 ++
 263.554 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 263.555 ++    // in case we store a L'\0' and then continue, in a loop.
 263.556 ++    // NB: mbsnrtowcs is a GNU extension
 263.557 ++    for (__from_next = __from, __to_next = __to;
 263.558 ++	 __from_next < __from_end && __to_next < __to_end
 263.559 ++	 && __ret == ok;)
 263.560 ++      {
 263.561 ++	const extern_type* __from_chunk_end;
 263.562 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 263.563 ++								  __from_end
 263.564 ++								  - __from_next));
 263.565 ++	if (!__from_chunk_end)
 263.566 ++	  __from_chunk_end = __from_end;
 263.567 ++
 263.568 ++	__from = __from_next;
 263.569 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 263.570 ++				   __from_chunk_end - __from_next,
 263.571 ++				   __to_end - __to_next, &__state);
 263.572 ++	if (__conv == static_cast<size_t>(-1))
 263.573 ++	  {
 263.574 ++	    // In case of error, in order to stop at the exact place we
 263.575 ++	    // have to start again from the beginning with a series of
 263.576 ++	    // mbrtowc.
 263.577 ++	    for (;; ++__to_next, __from += __conv)
 263.578 ++	      {
 263.579 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 263.580 ++				 &__tmp_state);
 263.581 ++		if (__conv == static_cast<size_t>(-1)
 263.582 ++		    || __conv == static_cast<size_t>(-2))
 263.583 ++		  break;
 263.584 ++	      }
 263.585 ++	    __from_next = __from;
 263.586 ++	    __state = __tmp_state;	    
 263.587 ++	    __ret = error;
 263.588 ++	  }
 263.589 ++	else if (__from_next && __from_next < __from_chunk_end)
 263.590 ++	  {
 263.591 ++	    // It is unclear what to return in this case (see DR 382). 
 263.592 ++	    __to_next += __conv;
 263.593 ++	    __ret = partial;
 263.594 ++	  }
 263.595 ++	else
 263.596 ++	  {
 263.597 ++	    __from_next = __from_chunk_end;
 263.598 ++	    __to_next += __conv;
 263.599 ++	  }
 263.600 ++
 263.601 ++	if (__from_next < __from_end && __ret == ok)
 263.602 ++	  {
 263.603 ++	    if (__to_next < __to_end)
 263.604 ++	      {
 263.605 ++		// XXX Probably wrong for stateful encodings
 263.606 ++		__tmp_state = __state;		
 263.607 ++		++__from_next;
 263.608 ++		*__to_next++ = L'\0';
 263.609 ++	      }
 263.610 ++	    else
 263.611 ++	      __ret = partial;
 263.612 ++	  }
 263.613 ++      }
 263.614 ++
 263.615 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.616 ++    __uselocale(__old);
 263.617 ++#endif
 263.618 ++
 263.619 ++    return __ret; 
 263.620 ++  }
 263.621 ++
 263.622 ++  int 
 263.623 ++  codecvt<wchar_t, char, mbstate_t>::
 263.624 ++  do_encoding() const throw()
 263.625 ++  {
 263.626 ++    // XXX This implementation assumes that the encoding is
 263.627 ++    // stateless and is either single-byte or variable-width.
 263.628 ++    int __ret = 0;
 263.629 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.630 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 263.631 ++#endif
 263.632 ++    if (MB_CUR_MAX == 1)
 263.633 ++      __ret = 1;
 263.634 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.635 ++    __uselocale(__old);
 263.636 ++#endif
 263.637 ++    return __ret;
 263.638 ++  }  
 263.639 ++
 263.640 ++  int 
 263.641 ++  codecvt<wchar_t, char, mbstate_t>::
 263.642 ++  do_max_length() const throw()
 263.643 ++  {
 263.644 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.645 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 263.646 ++#endif
 263.647 ++    // XXX Probably wrong for stateful encodings.
 263.648 ++    int __ret = MB_CUR_MAX;
 263.649 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.650 ++    __uselocale(__old);
 263.651 ++#endif
 263.652 ++    return __ret;
 263.653 ++  }
 263.654 ++  
 263.655 ++  int 
 263.656 ++  codecvt<wchar_t, char, mbstate_t>::
 263.657 ++  do_length(state_type& __state, const extern_type* __from,
 263.658 ++	    const extern_type* __end, size_t __max) const
 263.659 ++  {
 263.660 ++    int __ret = 0;
 263.661 ++    state_type __tmp_state(__state);
 263.662 ++
 263.663 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.664 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 263.665 ++#endif
 263.666 ++
 263.667 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 263.668 ++    // in case we advance past it and then continue, in a loop.
 263.669 ++    // NB: mbsnrtowcs is a GNU extension
 263.670 ++  
 263.671 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 263.672 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 263.673 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 263.674 ++							   * __max));
 263.675 ++    while (__from < __end && __max)
 263.676 ++      {
 263.677 ++	const extern_type* __from_chunk_end;
 263.678 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 263.679 ++								  __end
 263.680 ++								  - __from));
 263.681 ++	if (!__from_chunk_end)
 263.682 ++	  __from_chunk_end = __end;
 263.683 ++
 263.684 ++	const extern_type* __tmp_from = __from;
 263.685 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 263.686 ++				   __from_chunk_end - __from,
 263.687 ++				   __max, &__state);
 263.688 ++	if (__conv == static_cast<size_t>(-1))
 263.689 ++	  {
 263.690 ++	    // In case of error, in order to stop at the exact place we
 263.691 ++	    // have to start again from the beginning with a series of
 263.692 ++	    // mbrtowc.
 263.693 ++	    for (__from = __tmp_from;; __from += __conv)
 263.694 ++	      {
 263.695 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 263.696 ++				 &__tmp_state);
 263.697 ++		if (__conv == static_cast<size_t>(-1)
 263.698 ++		    || __conv == static_cast<size_t>(-2))
 263.699 ++		  break;
 263.700 ++	      }
 263.701 ++	    __state = __tmp_state;
 263.702 ++	    __ret += __from - __tmp_from;
 263.703 ++	    break;
 263.704 ++	  }
 263.705 ++	if (!__from)
 263.706 ++	  __from = __from_chunk_end;
 263.707 ++	
 263.708 ++	__ret += __from - __tmp_from;
 263.709 ++	__max -= __conv;
 263.710 ++
 263.711 ++	if (__from < __end && __max)
 263.712 ++	  {
 263.713 ++	    // XXX Probably wrong for stateful encodings
 263.714 ++	    __tmp_state = __state;
 263.715 ++	    ++__from;
 263.716 ++	    ++__ret;
 263.717 ++	    --__max;
 263.718 ++	  }
 263.719 ++      }
 263.720 ++
 263.721 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.722 ++    __uselocale(__old);
 263.723 ++#endif
 263.724 ++
 263.725 ++    return __ret; 
 263.726 ++  }
 263.727 ++#endif
 263.728 ++}
 263.729 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
 263.730 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 263.731 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
 263.732 +@@ -0,0 +1,80 @@
 263.733 ++// std::collate implementation details, GNU version -*- C++ -*-
 263.734 ++
 263.735 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 263.736 ++//
 263.737 ++// This file is part of the GNU ISO C++ Library.  This library is free
 263.738 ++// software; you can redistribute it and/or modify it under the
 263.739 ++// terms of the GNU General Public License as published by the
 263.740 ++// Free Software Foundation; either version 2, or (at your option)
 263.741 ++// any later version.
 263.742 ++
 263.743 ++// This library is distributed in the hope that it will be useful,
 263.744 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 263.745 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 263.746 ++// GNU General Public License for more details.
 263.747 ++
 263.748 ++// You should have received a copy of the GNU General Public License along
 263.749 ++// with this library; see the file COPYING.  If not, write to the Free
 263.750 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 263.751 ++// USA.
 263.752 ++
 263.753 ++// As a special exception, you may use this file as part of a free software
 263.754 ++// library without restriction.  Specifically, if other files instantiate
 263.755 ++// templates or use macros or inline functions from this file, or you compile
 263.756 ++// this file and link it with other files to produce an executable, this
 263.757 ++// file does not by itself cause the resulting executable to be covered by
 263.758 ++// the GNU General Public License.  This exception does not however
 263.759 ++// invalidate any other reasons why the executable file might be covered by
 263.760 ++// the GNU General Public License.
 263.761 ++
 263.762 ++//
 263.763 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 263.764 ++//
 263.765 ++
 263.766 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 263.767 ++
 263.768 ++#include <locale>
 263.769 ++#include <bits/c++locale_internal.h>
 263.770 ++
 263.771 ++#ifndef __UCLIBC_HAS_XLOCALE__
 263.772 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 263.773 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 263.774 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 263.775 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 263.776 ++#endif
 263.777 ++
 263.778 ++namespace std
 263.779 ++{
 263.780 ++  // These are basically extensions to char_traits, and perhaps should
 263.781 ++  // be put there instead of here.
 263.782 ++  template<>
 263.783 ++    int 
 263.784 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 263.785 ++    { 
 263.786 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 263.787 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 263.788 ++    }
 263.789 ++  
 263.790 ++  template<>
 263.791 ++    size_t
 263.792 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 263.793 ++				size_t __n) const 
 263.794 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 263.795 ++
 263.796 ++#ifdef _GLIBCXX_USE_WCHAR_T
 263.797 ++  template<>
 263.798 ++    int 
 263.799 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 263.800 ++				 const wchar_t* __two) const
 263.801 ++    {
 263.802 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 263.803 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 263.804 ++    }
 263.805 ++  
 263.806 ++  template<>
 263.807 ++    size_t
 263.808 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 263.809 ++				   size_t __n) const
 263.810 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 263.811 ++#endif
 263.812 ++}
 263.813 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 263.814 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 263.815 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 263.816 +@@ -0,0 +1,300 @@
 263.817 ++// std::ctype implementation details, GNU version -*- C++ -*-
 263.818 ++
 263.819 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 263.820 ++//
 263.821 ++// This file is part of the GNU ISO C++ Library.  This library is free
 263.822 ++// software; you can redistribute it and/or modify it under the
 263.823 ++// terms of the GNU General Public License as published by the
 263.824 ++// Free Software Foundation; either version 2, or (at your option)
 263.825 ++// any later version.
 263.826 ++
 263.827 ++// This library is distributed in the hope that it will be useful,
 263.828 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 263.829 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 263.830 ++// GNU General Public License for more details.
 263.831 ++
 263.832 ++// You should have received a copy of the GNU General Public License along
 263.833 ++// with this library; see the file COPYING.  If not, write to the Free
 263.834 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 263.835 ++// USA.
 263.836 ++
 263.837 ++// As a special exception, you may use this file as part of a free software
 263.838 ++// library without restriction.  Specifically, if other files instantiate
 263.839 ++// templates or use macros or inline functions from this file, or you compile
 263.840 ++// this file and link it with other files to produce an executable, this
 263.841 ++// file does not by itself cause the resulting executable to be covered by
 263.842 ++// the GNU General Public License.  This exception does not however
 263.843 ++// invalidate any other reasons why the executable file might be covered by
 263.844 ++// the GNU General Public License.
 263.845 ++
 263.846 ++//
 263.847 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 263.848 ++//
 263.849 ++
 263.850 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 263.851 ++
 263.852 ++#define _LIBC
 263.853 ++#include <locale>
 263.854 ++#undef _LIBC
 263.855 ++#include <bits/c++locale_internal.h>
 263.856 ++
 263.857 ++#ifndef __UCLIBC_HAS_XLOCALE__
 263.858 ++#define __wctype_l(S, L)           wctype((S))
 263.859 ++#define __towupper_l(C, L)         towupper((C))
 263.860 ++#define __towlower_l(C, L)         towlower((C))
 263.861 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 263.862 ++#endif
 263.863 ++
 263.864 ++namespace std
 263.865 ++{
 263.866 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 263.867 ++  // various /config/os/* files.
 263.868 ++  template<>
 263.869 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 263.870 ++    : ctype<char>(0, false, __refs) 
 263.871 ++    { 		
 263.872 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 263.873 ++	{
 263.874 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 263.875 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 263.876 ++#ifdef __UCLIBC_HAS_XLOCALE__
 263.877 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 263.878 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 263.879 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 263.880 ++#endif
 263.881 ++	}
 263.882 ++    }
 263.883 ++
 263.884 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 263.885 ++  ctype<wchar_t>::__wmask_type
 263.886 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 263.887 ++  {
 263.888 ++    __wmask_type __ret;
 263.889 ++    switch (__m)
 263.890 ++      {
 263.891 ++      case space:
 263.892 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 263.893 ++	break;
 263.894 ++      case print:
 263.895 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 263.896 ++	break;
 263.897 ++      case cntrl:
 263.898 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 263.899 ++	break;
 263.900 ++      case upper:
 263.901 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 263.902 ++	break;
 263.903 ++      case lower:
 263.904 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 263.905 ++	break;
 263.906 ++      case alpha:
 263.907 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 263.908 ++	break;
 263.909 ++      case digit:
 263.910 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 263.911 ++	break;
 263.912 ++      case punct:
 263.913 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 263.914 ++	break;
 263.915 ++      case xdigit:
 263.916 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 263.917 ++	break;
 263.918 ++      case alnum:
 263.919 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 263.920 ++	break;
 263.921 ++      case graph:
 263.922 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 263.923 ++	break;
 263.924 ++      default:
 263.925 ++	__ret = __wmask_type();
 263.926 ++      }
 263.927 ++    return __ret;
 263.928 ++  }
 263.929 ++  
 263.930 ++  wchar_t
 263.931 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 263.932 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 263.933 ++
 263.934 ++  const wchar_t*
 263.935 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 263.936 ++  {
 263.937 ++    while (__lo < __hi)
 263.938 ++      {
 263.939 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 263.940 ++        ++__lo;
 263.941 ++      }
 263.942 ++    return __hi;
 263.943 ++  }
 263.944 ++  
 263.945 ++  wchar_t
 263.946 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 263.947 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 263.948 ++  
 263.949 ++  const wchar_t*
 263.950 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 263.951 ++  {
 263.952 ++    while (__lo < __hi)
 263.953 ++      {
 263.954 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 263.955 ++        ++__lo;
 263.956 ++      }
 263.957 ++    return __hi;
 263.958 ++  }
 263.959 ++
 263.960 ++  bool
 263.961 ++  ctype<wchar_t>::
 263.962 ++  do_is(mask __m, wchar_t __c) const
 263.963 ++  { 
 263.964 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
 263.965 ++    // library for blank.
 263.966 ++    bool __ret = false;
 263.967 ++    const size_t __bitmasksize = 11; 
 263.968 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 263.969 ++      if (__m & _M_bit[__bitcur]
 263.970 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 263.971 ++	{
 263.972 ++	  __ret = true;
 263.973 ++	  break;
 263.974 ++	}
 263.975 ++    return __ret;    
 263.976 ++  }
 263.977 ++  
 263.978 ++  const wchar_t* 
 263.979 ++  ctype<wchar_t>::
 263.980 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 263.981 ++  {
 263.982 ++    for (; __lo < __hi; ++__vec, ++__lo)
 263.983 ++      {
 263.984 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 263.985 ++	// library for blank.
 263.986 ++	const size_t __bitmasksize = 11; 
 263.987 ++	mask __m = 0;
 263.988 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 263.989 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 263.990 ++	    __m |= _M_bit[__bitcur];
 263.991 ++	*__vec = __m;
 263.992 ++      }
 263.993 ++    return __hi;
 263.994 ++  }
 263.995 ++  
 263.996 ++  const wchar_t* 
 263.997 ++  ctype<wchar_t>::
 263.998 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 263.999 ++  {
263.1000 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
263.1001 ++      ++__lo;
263.1002 ++    return __lo;
263.1003 ++  }
263.1004 ++
263.1005 ++  const wchar_t*
263.1006 ++  ctype<wchar_t>::
263.1007 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
263.1008 ++  {
263.1009 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
263.1010 ++      ++__lo;
263.1011 ++    return __lo;
263.1012 ++  }
263.1013 ++
263.1014 ++  wchar_t
263.1015 ++  ctype<wchar_t>::
263.1016 ++  do_widen(char __c) const
263.1017 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
263.1018 ++
263.1019 ++  const char* 
263.1020 ++  ctype<wchar_t>::
263.1021 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
263.1022 ++  {
263.1023 ++    while (__lo < __hi)
263.1024 ++      {
263.1025 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
263.1026 ++	++__lo;
263.1027 ++	++__dest;
263.1028 ++      }
263.1029 ++    return __hi;
263.1030 ++  }
263.1031 ++
263.1032 ++  char
263.1033 ++  ctype<wchar_t>::
263.1034 ++  do_narrow(wchar_t __wc, char __dfault) const
263.1035 ++  {
263.1036 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
263.1037 ++      return _M_narrow[__wc];
263.1038 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1039 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
263.1040 ++#endif
263.1041 ++    const int __c = wctob(__wc);
263.1042 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1043 ++    __uselocale(__old);
263.1044 ++#endif
263.1045 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
263.1046 ++  }
263.1047 ++
263.1048 ++  const wchar_t*
263.1049 ++  ctype<wchar_t>::
263.1050 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
263.1051 ++	    char* __dest) const
263.1052 ++  {
263.1053 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1054 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
263.1055 ++#endif
263.1056 ++    if (_M_narrow_ok)
263.1057 ++      while (__lo < __hi)
263.1058 ++	{
263.1059 ++	  if (*__lo >= 0 && *__lo < 128)
263.1060 ++	    *__dest = _M_narrow[*__lo];
263.1061 ++	  else
263.1062 ++	    {
263.1063 ++	      const int __c = wctob(*__lo);
263.1064 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
263.1065 ++	    }
263.1066 ++	  ++__lo;
263.1067 ++	  ++__dest;
263.1068 ++	}
263.1069 ++    else
263.1070 ++      while (__lo < __hi)
263.1071 ++	{
263.1072 ++	  const int __c = wctob(*__lo);
263.1073 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
263.1074 ++	  ++__lo;
263.1075 ++	  ++__dest;
263.1076 ++	}
263.1077 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1078 ++    __uselocale(__old);
263.1079 ++#endif
263.1080 ++    return __hi;
263.1081 ++  }
263.1082 ++
263.1083 ++  void
263.1084 ++  ctype<wchar_t>::_M_initialize_ctype()
263.1085 ++  {
263.1086 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1087 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
263.1088 ++#endif
263.1089 ++    wint_t __i;
263.1090 ++    for (__i = 0; __i < 128; ++__i)
263.1091 ++      {
263.1092 ++	const int __c = wctob(__i);
263.1093 ++	if (__c == EOF)
263.1094 ++	  break;
263.1095 ++	else
263.1096 ++	  _M_narrow[__i] = static_cast<char>(__c);
263.1097 ++      }
263.1098 ++    if (__i == 128)
263.1099 ++      _M_narrow_ok = true;
263.1100 ++    else
263.1101 ++      _M_narrow_ok = false;
263.1102 ++    for (size_t __j = 0;
263.1103 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
263.1104 ++      _M_widen[__j] = btowc(__j);
263.1105 ++
263.1106 ++    for (size_t __k = 0; __k <= 11; ++__k)
263.1107 ++      { 
263.1108 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
263.1109 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
263.1110 ++      }
263.1111 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1112 ++    __uselocale(__old);
263.1113 ++#endif
263.1114 ++  }
263.1115 ++#endif //  _GLIBCXX_USE_WCHAR_T
263.1116 ++}
263.1117 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
263.1118 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
263.1119 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
263.1120 +@@ -0,0 +1,100 @@
263.1121 ++// std::messages implementation details, GNU version -*- C++ -*-
263.1122 ++
263.1123 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
263.1124 ++//
263.1125 ++// This file is part of the GNU ISO C++ Library.  This library is free
263.1126 ++// software; you can redistribute it and/or modify it under the
263.1127 ++// terms of the GNU General Public License as published by the
263.1128 ++// Free Software Foundation; either version 2, or (at your option)
263.1129 ++// any later version.
263.1130 ++
263.1131 ++// This library is distributed in the hope that it will be useful,
263.1132 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
263.1133 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
263.1134 ++// GNU General Public License for more details.
263.1135 ++
263.1136 ++// You should have received a copy of the GNU General Public License along
263.1137 ++// with this library; see the file COPYING.  If not, write to the Free
263.1138 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
263.1139 ++// USA.
263.1140 ++
263.1141 ++// As a special exception, you may use this file as part of a free software
263.1142 ++// library without restriction.  Specifically, if other files instantiate
263.1143 ++// templates or use macros or inline functions from this file, or you compile
263.1144 ++// this file and link it with other files to produce an executable, this
263.1145 ++// file does not by itself cause the resulting executable to be covered by
263.1146 ++// the GNU General Public License.  This exception does not however
263.1147 ++// invalidate any other reasons why the executable file might be covered by
263.1148 ++// the GNU General Public License.
263.1149 ++
263.1150 ++//
263.1151 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
263.1152 ++//
263.1153 ++
263.1154 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
263.1155 ++
263.1156 ++#include <locale>
263.1157 ++#include <bits/c++locale_internal.h>
263.1158 ++
263.1159 ++#ifdef __UCLIBC_MJN3_ONLY__
263.1160 ++#warning fix gettext stuff
263.1161 ++#endif
263.1162 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
263.1163 ++extern "C" char *__dcgettext(const char *domainname,
263.1164 ++			     const char *msgid, int category);
263.1165 ++#undef gettext
263.1166 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
263.1167 ++#else
263.1168 ++#undef gettext
263.1169 ++#define gettext(msgid) (msgid)
263.1170 ++#endif
263.1171 ++
263.1172 ++namespace std
263.1173 ++{
263.1174 ++  // Specializations.
263.1175 ++  template<>
263.1176 ++    string
263.1177 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
263.1178 ++    {
263.1179 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1180 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
263.1181 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
263.1182 ++      __uselocale(__old);
263.1183 ++      return string(__msg);
263.1184 ++#elif defined __UCLIBC_HAS_LOCALE__
263.1185 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
263.1186 ++      setlocale(LC_ALL, _M_name_messages);
263.1187 ++      const char* __msg = gettext(__dfault.c_str());
263.1188 ++      setlocale(LC_ALL, __old);
263.1189 ++      free(__old);
263.1190 ++      return string(__msg);
263.1191 ++#else
263.1192 ++      const char* __msg = gettext(__dfault.c_str());
263.1193 ++      return string(__msg);
263.1194 ++#endif
263.1195 ++    }
263.1196 ++
263.1197 ++#ifdef _GLIBCXX_USE_WCHAR_T
263.1198 ++  template<>
263.1199 ++    wstring
263.1200 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
263.1201 ++    {
263.1202 ++# ifdef __UCLIBC_HAS_XLOCALE__
263.1203 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
263.1204 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
263.1205 ++      __uselocale(__old);
263.1206 ++      return _M_convert_from_char(__msg);
263.1207 ++# elif defined __UCLIBC_HAS_LOCALE__
263.1208 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
263.1209 ++      setlocale(LC_ALL, _M_name_messages);
263.1210 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
263.1211 ++      setlocale(LC_ALL, __old);
263.1212 ++      free(__old);
263.1213 ++      return _M_convert_from_char(__msg);
263.1214 ++# else
263.1215 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
263.1216 ++      return _M_convert_from_char(__msg);
263.1217 ++# endif
263.1218 ++    }
263.1219 ++#endif
263.1220 ++}
263.1221 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
263.1222 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
263.1223 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
263.1224 +@@ -0,0 +1,118 @@
263.1225 ++// std::messages implementation details, GNU version -*- C++ -*-
263.1226 ++
263.1227 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
263.1228 ++//
263.1229 ++// This file is part of the GNU ISO C++ Library.  This library is free
263.1230 ++// software; you can redistribute it and/or modify it under the
263.1231 ++// terms of the GNU General Public License as published by the
263.1232 ++// Free Software Foundation; either version 2, or (at your option)
263.1233 ++// any later version.
263.1234 ++
263.1235 ++// This library is distributed in the hope that it will be useful,
263.1236 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
263.1237 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
263.1238 ++// GNU General Public License for more details.
263.1239 ++
263.1240 ++// You should have received a copy of the GNU General Public License along
263.1241 ++// with this library; see the file COPYING.  If not, write to the Free
263.1242 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
263.1243 ++// USA.
263.1244 ++
263.1245 ++// As a special exception, you may use this file as part of a free software
263.1246 ++// library without restriction.  Specifically, if other files instantiate
263.1247 ++// templates or use macros or inline functions from this file, or you compile
263.1248 ++// this file and link it with other files to produce an executable, this
263.1249 ++// file does not by itself cause the resulting executable to be covered by
263.1250 ++// the GNU General Public License.  This exception does not however
263.1251 ++// invalidate any other reasons why the executable file might be covered by
263.1252 ++// the GNU General Public License.
263.1253 ++
263.1254 ++//
263.1255 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
263.1256 ++//
263.1257 ++
263.1258 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
263.1259 ++
263.1260 ++#ifdef __UCLIBC_MJN3_ONLY__
263.1261 ++#warning fix prototypes for *textdomain funcs
263.1262 ++#endif
263.1263 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
263.1264 ++extern "C" char *__textdomain(const char *domainname);
263.1265 ++extern "C" char *__bindtextdomain(const char *domainname,
263.1266 ++				  const char *dirname);
263.1267 ++#else
263.1268 ++#undef __textdomain
263.1269 ++#undef __bindtextdomain
263.1270 ++#define __textdomain(D)           ((void)0)
263.1271 ++#define __bindtextdomain(D,P)     ((void)0)
263.1272 ++#endif
263.1273 ++
263.1274 ++  // Non-virtual member functions.
263.1275 ++  template<typename _CharT>
263.1276 ++     messages<_CharT>::messages(size_t __refs)
263.1277 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
263.1278 ++     _M_name_messages(_S_get_c_name())
263.1279 ++     { }
263.1280 ++
263.1281 ++  template<typename _CharT>
263.1282 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
263.1283 ++				size_t __refs) 
263.1284 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
263.1285 ++     _M_name_messages(__s)
263.1286 ++     {
263.1287 ++       char* __tmp = new char[std::strlen(__s) + 1];
263.1288 ++       std::strcpy(__tmp, __s);
263.1289 ++       _M_name_messages = __tmp;
263.1290 ++     }
263.1291 ++
263.1292 ++  template<typename _CharT>
263.1293 ++    typename messages<_CharT>::catalog 
263.1294 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
263.1295 ++			   const char* __dir) const
263.1296 ++    { 
263.1297 ++      __bindtextdomain(__s.c_str(), __dir);
263.1298 ++      return this->do_open(__s, __loc); 
263.1299 ++    }
263.1300 ++
263.1301 ++  // Virtual member functions.
263.1302 ++  template<typename _CharT>
263.1303 ++    messages<_CharT>::~messages()
263.1304 ++    { 
263.1305 ++      if (_M_name_messages != _S_get_c_name())
263.1306 ++	delete [] _M_name_messages;
263.1307 ++      _S_destroy_c_locale(_M_c_locale_messages); 
263.1308 ++    }
263.1309 ++
263.1310 ++  template<typename _CharT>
263.1311 ++    typename messages<_CharT>::catalog 
263.1312 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
263.1313 ++			      const locale&) const
263.1314 ++    { 
263.1315 ++      // No error checking is done, assume the catalog exists and can
263.1316 ++      // be used.
263.1317 ++      __textdomain(__s.c_str());
263.1318 ++      return 0;
263.1319 ++    }
263.1320 ++
263.1321 ++  template<typename _CharT>
263.1322 ++    void    
263.1323 ++    messages<_CharT>::do_close(catalog) const 
263.1324 ++    { }
263.1325 ++
263.1326 ++   // messages_byname
263.1327 ++   template<typename _CharT>
263.1328 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
263.1329 ++     : messages<_CharT>(__refs) 
263.1330 ++     { 
263.1331 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
263.1332 ++	 delete [] this->_M_name_messages;
263.1333 ++       char* __tmp = new char[std::strlen(__s) + 1];
263.1334 ++       std::strcpy(__tmp, __s);
263.1335 ++       this->_M_name_messages = __tmp;
263.1336 ++
263.1337 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
263.1338 ++	 {
263.1339 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
263.1340 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
263.1341 ++	 }
263.1342 ++     }
263.1343 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
263.1344 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
263.1345 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
263.1346 +@@ -0,0 +1,692 @@
263.1347 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
263.1348 ++
263.1349 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
263.1350 ++//
263.1351 ++// This file is part of the GNU ISO C++ Library.  This library is free
263.1352 ++// software; you can redistribute it and/or modify it under the
263.1353 ++// terms of the GNU General Public License as published by the
263.1354 ++// Free Software Foundation; either version 2, or (at your option)
263.1355 ++// any later version.
263.1356 ++
263.1357 ++// This library is distributed in the hope that it will be useful,
263.1358 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
263.1359 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
263.1360 ++// GNU General Public License for more details.
263.1361 ++
263.1362 ++// You should have received a copy of the GNU General Public License along
263.1363 ++// with this library; see the file COPYING.  If not, write to the Free
263.1364 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
263.1365 ++// USA.
263.1366 ++
263.1367 ++// As a special exception, you may use this file as part of a free software
263.1368 ++// library without restriction.  Specifically, if other files instantiate
263.1369 ++// templates or use macros or inline functions from this file, or you compile
263.1370 ++// this file and link it with other files to produce an executable, this
263.1371 ++// file does not by itself cause the resulting executable to be covered by
263.1372 ++// the GNU General Public License.  This exception does not however
263.1373 ++// invalidate any other reasons why the executable file might be covered by
263.1374 ++// the GNU General Public License.
263.1375 ++
263.1376 ++//
263.1377 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
263.1378 ++//
263.1379 ++
263.1380 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
263.1381 ++
263.1382 ++#define _LIBC
263.1383 ++#include <locale>
263.1384 ++#undef _LIBC
263.1385 ++#include <bits/c++locale_internal.h>
263.1386 ++
263.1387 ++#ifdef __UCLIBC_MJN3_ONLY__
263.1388 ++#warning optimize this for uclibc
263.1389 ++#warning tailor for stub locale support
263.1390 ++#endif
263.1391 ++
263.1392 ++#ifndef __UCLIBC_HAS_XLOCALE__
263.1393 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
263.1394 ++#endif
263.1395 ++
263.1396 ++namespace std
263.1397 ++{
263.1398 ++  // Construct and return valid pattern consisting of some combination of:
263.1399 ++  // space none symbol sign value
263.1400 ++  money_base::pattern
263.1401 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
263.1402 ++  { 
263.1403 ++    pattern __ret;
263.1404 ++
263.1405 ++    // This insanely complicated routine attempts to construct a valid
263.1406 ++    // pattern for use with monyepunct. A couple of invariants:
263.1407 ++
263.1408 ++    // if (__precedes) symbol -> value
263.1409 ++    // else value -> symbol
263.1410 ++    
263.1411 ++    // if (__space) space
263.1412 ++    // else none
263.1413 ++
263.1414 ++    // none == never first
263.1415 ++    // space never first or last
263.1416 ++
263.1417 ++    // Any elegant implementations of this are welcome.
263.1418 ++    switch (__posn)
263.1419 ++      {
263.1420 ++      case 0:
263.1421 ++      case 1:
263.1422 ++	// 1 The sign precedes the value and symbol.
263.1423 ++	__ret.field[0] = sign;
263.1424 ++	if (__space)
263.1425 ++	  {
263.1426 ++	    // Pattern starts with sign.
263.1427 ++	    if (__precedes)
263.1428 ++	      {
263.1429 ++		__ret.field[1] = symbol;
263.1430 ++		__ret.field[3] = value;
263.1431 ++	      }
263.1432 ++	    else
263.1433 ++	      {
263.1434 ++		__ret.field[1] = value;
263.1435 ++		__ret.field[3] = symbol;
263.1436 ++	      }
263.1437 ++	    __ret.field[2] = space;
263.1438 ++	  }
263.1439 ++	else
263.1440 ++	  {
263.1441 ++	    // Pattern starts with sign and ends with none.
263.1442 ++	    if (__precedes)
263.1443 ++	      {
263.1444 ++		__ret.field[1] = symbol;
263.1445 ++		__ret.field[2] = value;
263.1446 ++	      }
263.1447 ++	    else
263.1448 ++	      {
263.1449 ++		__ret.field[1] = value;
263.1450 ++		__ret.field[2] = symbol;
263.1451 ++	      }
263.1452 ++	    __ret.field[3] = none;
263.1453 ++	  }
263.1454 ++	break;
263.1455 ++      case 2:
263.1456 ++	// 2 The sign follows the value and symbol.
263.1457 ++	if (__space)
263.1458 ++	  {
263.1459 ++	    // Pattern either ends with sign.
263.1460 ++	    if (__precedes)
263.1461 ++	      {
263.1462 ++		__ret.field[0] = symbol;
263.1463 ++		__ret.field[2] = value;
263.1464 ++	      }
263.1465 ++	    else
263.1466 ++	      {
263.1467 ++		__ret.field[0] = value;
263.1468 ++		__ret.field[2] = symbol;
263.1469 ++	      }
263.1470 ++	    __ret.field[1] = space;
263.1471 ++	    __ret.field[3] = sign;
263.1472 ++	  }
263.1473 ++	else
263.1474 ++	  {
263.1475 ++	    // Pattern ends with sign then none.
263.1476 ++	    if (__precedes)
263.1477 ++	      {
263.1478 ++		__ret.field[0] = symbol;
263.1479 ++		__ret.field[1] = value;
263.1480 ++	      }
263.1481 ++	    else
263.1482 ++	      {
263.1483 ++		__ret.field[0] = value;
263.1484 ++		__ret.field[1] = symbol;
263.1485 ++	      }
263.1486 ++	    __ret.field[2] = sign;
263.1487 ++	    __ret.field[3] = none;
263.1488 ++	  }
263.1489 ++	break;
263.1490 ++      case 3:
263.1491 ++	// 3 The sign immediately precedes the symbol.
263.1492 ++	if (__precedes)
263.1493 ++	  {
263.1494 ++	    __ret.field[0] = sign;
263.1495 ++	    __ret.field[1] = symbol;	    
263.1496 ++	    if (__space)
263.1497 ++	      {
263.1498 ++		__ret.field[2] = space;
263.1499 ++		__ret.field[3] = value;
263.1500 ++	      }
263.1501 ++	    else
263.1502 ++	      {
263.1503 ++		__ret.field[2] = value;		
263.1504 ++		__ret.field[3] = none;
263.1505 ++	      }
263.1506 ++	  }
263.1507 ++	else
263.1508 ++	  {
263.1509 ++	    __ret.field[0] = value;
263.1510 ++	    if (__space)
263.1511 ++	      {
263.1512 ++		__ret.field[1] = space;
263.1513 ++		__ret.field[2] = sign;
263.1514 ++		__ret.field[3] = symbol;
263.1515 ++	      }
263.1516 ++	    else
263.1517 ++	      {
263.1518 ++		__ret.field[1] = sign;
263.1519 ++		__ret.field[2] = symbol;
263.1520 ++		__ret.field[3] = none;
263.1521 ++	      }
263.1522 ++	  }
263.1523 ++	break;
263.1524 ++      case 4:
263.1525 ++	// 4 The sign immediately follows the symbol.
263.1526 ++	if (__precedes)
263.1527 ++	  {
263.1528 ++	    __ret.field[0] = symbol;
263.1529 ++	    __ret.field[1] = sign;
263.1530 ++	    if (__space)
263.1531 ++	      {
263.1532 ++		__ret.field[2] = space;
263.1533 ++		__ret.field[3] = value;
263.1534 ++	      }
263.1535 ++	    else
263.1536 ++	      {
263.1537 ++		__ret.field[2] = value;
263.1538 ++		__ret.field[3] = none;
263.1539 ++	      }
263.1540 ++	  }
263.1541 ++	else
263.1542 ++	  {
263.1543 ++	    __ret.field[0] = value;
263.1544 ++	    if (__space)
263.1545 ++	      {
263.1546 ++		__ret.field[1] = space;
263.1547 ++		__ret.field[2] = symbol;
263.1548 ++		__ret.field[3] = sign;
263.1549 ++	      }
263.1550 ++	    else
263.1551 ++	      {
263.1552 ++		__ret.field[1] = symbol;
263.1553 ++		__ret.field[2] = sign;
263.1554 ++		__ret.field[3] = none;
263.1555 ++	      }
263.1556 ++	  }
263.1557 ++	break;
263.1558 ++      default:
263.1559 ++	;
263.1560 ++      }
263.1561 ++    return __ret;
263.1562 ++  }
263.1563 ++
263.1564 ++  template<> 
263.1565 ++    void
263.1566 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
263.1567 ++						     const char*)
263.1568 ++    {
263.1569 ++      if (!_M_data)
263.1570 ++	_M_data = new __moneypunct_cache<char, true>;
263.1571 ++
263.1572 ++      if (!__cloc)
263.1573 ++	{
263.1574 ++	  // "C" locale
263.1575 ++	  _M_data->_M_decimal_point = '.';
263.1576 ++	  _M_data->_M_thousands_sep = ',';
263.1577 ++	  _M_data->_M_grouping = "";
263.1578 ++	  _M_data->_M_grouping_size = 0;
263.1579 ++	  _M_data->_M_curr_symbol = "";
263.1580 ++	  _M_data->_M_curr_symbol_size = 0;
263.1581 ++	  _M_data->_M_positive_sign = "";
263.1582 ++	  _M_data->_M_positive_sign_size = 0;
263.1583 ++	  _M_data->_M_negative_sign = "";
263.1584 ++	  _M_data->_M_negative_sign_size = 0;
263.1585 ++	  _M_data->_M_frac_digits = 0;
263.1586 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
263.1587 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
263.1588 ++
263.1589 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
263.1590 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
263.1591 ++	}
263.1592 ++      else
263.1593 ++	{
263.1594 ++	  // Named locale.
263.1595 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
263.1596 ++							__cloc));
263.1597 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
263.1598 ++							__cloc));
263.1599 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
263.1600 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
263.1601 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
263.1602 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
263.1603 ++
263.1604 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
263.1605 ++	  if (!__nposn)
263.1606 ++	    _M_data->_M_negative_sign = "()";
263.1607 ++	  else
263.1608 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
263.1609 ++							__cloc);
263.1610 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
263.1611 ++
263.1612 ++	  // _Intl == true
263.1613 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
263.1614 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
263.1615 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
263.1616 ++						      __cloc));
263.1617 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
263.1618 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
263.1619 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
263.1620 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
263.1621 ++							__pposn);
263.1622 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
263.1623 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
263.1624 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
263.1625 ++							__nposn);
263.1626 ++	}
263.1627 ++    }
263.1628 ++
263.1629 ++  template<> 
263.1630 ++    void
263.1631 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
263.1632 ++						      const char*)
263.1633 ++    {
263.1634 ++      if (!_M_data)
263.1635 ++	_M_data = new __moneypunct_cache<char, false>;
263.1636 ++
263.1637 ++      if (!__cloc)
263.1638 ++	{
263.1639 ++	  // "C" locale
263.1640 ++	  _M_data->_M_decimal_point = '.';
263.1641 ++	  _M_data->_M_thousands_sep = ',';
263.1642 ++	  _M_data->_M_grouping = "";
263.1643 ++	  _M_data->_M_grouping_size = 0;
263.1644 ++	  _M_data->_M_curr_symbol = "";
263.1645 ++	  _M_data->_M_curr_symbol_size = 0;
263.1646 ++	  _M_data->_M_positive_sign = "";
263.1647 ++	  _M_data->_M_positive_sign_size = 0;
263.1648 ++	  _M_data->_M_negative_sign = "";
263.1649 ++	  _M_data->_M_negative_sign_size = 0;
263.1650 ++	  _M_data->_M_frac_digits = 0;
263.1651 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
263.1652 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
263.1653 ++
263.1654 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
263.1655 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
263.1656 ++	}
263.1657 ++      else
263.1658 ++	{
263.1659 ++	  // Named locale.
263.1660 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
263.1661 ++							__cloc));
263.1662 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
263.1663 ++							__cloc));
263.1664 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
263.1665 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
263.1666 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
263.1667 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
263.1668 ++
263.1669 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
263.1670 ++	  if (!__nposn)
263.1671 ++	    _M_data->_M_negative_sign = "()";
263.1672 ++	  else
263.1673 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
263.1674 ++							__cloc);
263.1675 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
263.1676 ++
263.1677 ++	  // _Intl == false
263.1678 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
263.1679 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
263.1680 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
263.1681 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
263.1682 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
263.1683 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
263.1684 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
263.1685 ++							__pposn);
263.1686 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
263.1687 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
263.1688 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
263.1689 ++							__nposn);
263.1690 ++	}
263.1691 ++    }
263.1692 ++
263.1693 ++  template<> 
263.1694 ++    moneypunct<char, true>::~moneypunct()
263.1695 ++    { delete _M_data; }
263.1696 ++
263.1697 ++  template<> 
263.1698 ++    moneypunct<char, false>::~moneypunct()
263.1699 ++    { delete _M_data; }
263.1700 ++
263.1701 ++#ifdef _GLIBCXX_USE_WCHAR_T
263.1702 ++  template<> 
263.1703 ++    void
263.1704 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
263.1705 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1706 ++							const char*)
263.1707 ++#else
263.1708 ++							const char* __name)
263.1709 ++#endif
263.1710 ++    {
263.1711 ++      if (!_M_data)
263.1712 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
263.1713 ++
263.1714 ++      if (!__cloc)
263.1715 ++	{
263.1716 ++	  // "C" locale
263.1717 ++	  _M_data->_M_decimal_point = L'.';
263.1718 ++	  _M_data->_M_thousands_sep = L',';
263.1719 ++	  _M_data->_M_grouping = "";
263.1720 ++	  _M_data->_M_grouping_size = 0;
263.1721 ++	  _M_data->_M_curr_symbol = L"";
263.1722 ++	  _M_data->_M_curr_symbol_size = 0;
263.1723 ++	  _M_data->_M_positive_sign = L"";
263.1724 ++	  _M_data->_M_positive_sign_size = 0;
263.1725 ++	  _M_data->_M_negative_sign = L"";
263.1726 ++	  _M_data->_M_negative_sign_size = 0;
263.1727 ++	  _M_data->_M_frac_digits = 0;
263.1728 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
263.1729 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
263.1730 ++
263.1731 ++	  // Use ctype::widen code without the facet...
263.1732 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
263.1733 ++	    _M_data->_M_atoms[__i] =
263.1734 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
263.1735 ++	}
263.1736 ++      else
263.1737 ++	{
263.1738 ++	  // Named locale.
263.1739 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1740 ++	  __c_locale __old = __uselocale(__cloc);
263.1741 ++#else
263.1742 ++	  // Switch to named locale so that mbsrtowcs will work.
263.1743 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
263.1744 ++	  setlocale(LC_ALL, __name);
263.1745 ++#endif
263.1746 ++
263.1747 ++#ifdef __UCLIBC_MJN3_ONLY__
263.1748 ++#warning fix this... should be monetary
263.1749 ++#endif
263.1750 ++#ifdef __UCLIBC__
263.1751 ++# ifdef __UCLIBC_HAS_XLOCALE__
263.1752 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
263.1753 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
263.1754 ++# else
263.1755 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
263.1756 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
263.1757 ++# endif
263.1758 ++#else
263.1759 ++	  union { char *__s; wchar_t __w; } __u;
263.1760 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
263.1761 ++	  _M_data->_M_decimal_point = __u.__w;
263.1762 ++
263.1763 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
263.1764 ++	  _M_data->_M_thousands_sep = __u.__w;
263.1765 ++#endif
263.1766 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
263.1767 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
263.1768 ++
263.1769 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
263.1770 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
263.1771 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
263.1772 ++
263.1773 ++	  wchar_t* __wcs_ps = 0;
263.1774 ++	  wchar_t* __wcs_ns = 0;
263.1775 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
263.1776 ++	  try
263.1777 ++	    {
263.1778 ++	      mbstate_t __state;
263.1779 ++	      size_t __len = strlen(__cpossign);
263.1780 ++	      if (__len)
263.1781 ++		{
263.1782 ++		  ++__len;
263.1783 ++		  memset(&__state, 0, sizeof(mbstate_t));
263.1784 ++		  __wcs_ps = new wchar_t[__len];
263.1785 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
263.1786 ++		  _M_data->_M_positive_sign = __wcs_ps;
263.1787 ++		}
263.1788 ++	      else
263.1789 ++		_M_data->_M_positive_sign = L"";
263.1790 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
263.1791 ++	      
263.1792 ++	      __len = strlen(__cnegsign);
263.1793 ++	      if (!__nposn)
263.1794 ++		_M_data->_M_negative_sign = L"()";
263.1795 ++	      else if (__len)
263.1796 ++		{ 
263.1797 ++		  ++__len;
263.1798 ++		  memset(&__state, 0, sizeof(mbstate_t));
263.1799 ++		  __wcs_ns = new wchar_t[__len];
263.1800 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
263.1801 ++		  _M_data->_M_negative_sign = __wcs_ns;
263.1802 ++		}
263.1803 ++	      else
263.1804 ++		_M_data->_M_negative_sign = L"";
263.1805 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
263.1806 ++	      
263.1807 ++	      // _Intl == true.
263.1808 ++	      __len = strlen(__ccurr);
263.1809 ++	      if (__len)
263.1810 ++		{
263.1811 ++		  ++__len;
263.1812 ++		  memset(&__state, 0, sizeof(mbstate_t));
263.1813 ++		  wchar_t* __wcs = new wchar_t[__len];
263.1814 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
263.1815 ++		  _M_data->_M_curr_symbol = __wcs;
263.1816 ++		}
263.1817 ++	      else
263.1818 ++		_M_data->_M_curr_symbol = L"";
263.1819 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
263.1820 ++	    }
263.1821 ++	  catch (...)
263.1822 ++	    {
263.1823 ++	      delete _M_data;
263.1824 ++	      _M_data = 0;
263.1825 ++	      delete __wcs_ps;
263.1826 ++	      delete __wcs_ns;	      
263.1827 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1828 ++	      __uselocale(__old);
263.1829 ++#else
263.1830 ++	      setlocale(LC_ALL, __old);
263.1831 ++	      free(__old);
263.1832 ++#endif
263.1833 ++	      __throw_exception_again;
263.1834 ++	    } 
263.1835 ++	  
263.1836 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
263.1837 ++						      __cloc));
263.1838 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
263.1839 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
263.1840 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
263.1841 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
263.1842 ++							__pposn);
263.1843 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
263.1844 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
263.1845 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
263.1846 ++							__nposn);
263.1847 ++
263.1848 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1849 ++	  __uselocale(__old);
263.1850 ++#else
263.1851 ++	  setlocale(LC_ALL, __old);
263.1852 ++	  free(__old);
263.1853 ++#endif
263.1854 ++	}
263.1855 ++    }
263.1856 ++
263.1857 ++  template<> 
263.1858 ++  void
263.1859 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
263.1860 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1861 ++						       const char*)
263.1862 ++#else
263.1863 ++                                                       const char* __name)
263.1864 ++#endif
263.1865 ++  {
263.1866 ++    if (!_M_data)
263.1867 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
263.1868 ++
263.1869 ++    if (!__cloc)
263.1870 ++	{
263.1871 ++	  // "C" locale
263.1872 ++	  _M_data->_M_decimal_point = L'.';
263.1873 ++	  _M_data->_M_thousands_sep = L',';
263.1874 ++	  _M_data->_M_grouping = "";
263.1875 ++          _M_data->_M_grouping_size = 0;
263.1876 ++	  _M_data->_M_curr_symbol = L"";
263.1877 ++	  _M_data->_M_curr_symbol_size = 0;
263.1878 ++	  _M_data->_M_positive_sign = L"";
263.1879 ++	  _M_data->_M_positive_sign_size = 0;
263.1880 ++	  _M_data->_M_negative_sign = L"";
263.1881 ++	  _M_data->_M_negative_sign_size = 0;
263.1882 ++	  _M_data->_M_frac_digits = 0;
263.1883 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
263.1884 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
263.1885 ++
263.1886 ++	  // Use ctype::widen code without the facet...
263.1887 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
263.1888 ++	    _M_data->_M_atoms[__i] =
263.1889 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
263.1890 ++	}
263.1891 ++      else
263.1892 ++	{
263.1893 ++	  // Named locale.
263.1894 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1895 ++	  __c_locale __old = __uselocale(__cloc);
263.1896 ++#else
263.1897 ++	  // Switch to named locale so that mbsrtowcs will work.
263.1898 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
263.1899 ++	  setlocale(LC_ALL, __name);
263.1900 ++#endif
263.1901 ++
263.1902 ++#ifdef __UCLIBC_MJN3_ONLY__
263.1903 ++#warning fix this... should be monetary
263.1904 ++#endif
263.1905 ++#ifdef __UCLIBC__
263.1906 ++# ifdef __UCLIBC_HAS_XLOCALE__
263.1907 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
263.1908 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
263.1909 ++# else
263.1910 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
263.1911 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
263.1912 ++# endif
263.1913 ++#else
263.1914 ++          union { char *__s; wchar_t __w; } __u;
263.1915 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
263.1916 ++	  _M_data->_M_decimal_point = __u.__w;
263.1917 ++
263.1918 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
263.1919 ++	  _M_data->_M_thousands_sep = __u.__w;
263.1920 ++#endif
263.1921 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
263.1922 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
263.1923 ++
263.1924 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
263.1925 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
263.1926 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
263.1927 ++
263.1928 ++	  wchar_t* __wcs_ps = 0;
263.1929 ++	  wchar_t* __wcs_ns = 0;
263.1930 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
263.1931 ++	  try
263.1932 ++            {
263.1933 ++              mbstate_t __state;
263.1934 ++              size_t __len;
263.1935 ++              __len = strlen(__cpossign);
263.1936 ++              if (__len)
263.1937 ++                {
263.1938 ++		  ++__len;
263.1939 ++		  memset(&__state, 0, sizeof(mbstate_t));
263.1940 ++		  __wcs_ps = new wchar_t[__len];
263.1941 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
263.1942 ++		  _M_data->_M_positive_sign = __wcs_ps;
263.1943 ++		}
263.1944 ++	      else
263.1945 ++		_M_data->_M_positive_sign = L"";
263.1946 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
263.1947 ++	      
263.1948 ++	      __len = strlen(__cnegsign);
263.1949 ++	      if (!__nposn)
263.1950 ++		_M_data->_M_negative_sign = L"()";
263.1951 ++	      else if (__len)
263.1952 ++		{ 
263.1953 ++		  ++__len;
263.1954 ++		  memset(&__state, 0, sizeof(mbstate_t));
263.1955 ++		  __wcs_ns = new wchar_t[__len];
263.1956 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
263.1957 ++		  _M_data->_M_negative_sign = __wcs_ns;
263.1958 ++		}
263.1959 ++	      else
263.1960 ++		_M_data->_M_negative_sign = L"";
263.1961 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
263.1962 ++
263.1963 ++	      // _Intl == true.
263.1964 ++	      __len = strlen(__ccurr);
263.1965 ++	      if (__len)
263.1966 ++		{
263.1967 ++		  ++__len;
263.1968 ++		  memset(&__state, 0, sizeof(mbstate_t));
263.1969 ++		  wchar_t* __wcs = new wchar_t[__len];
263.1970 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
263.1971 ++		  _M_data->_M_curr_symbol = __wcs;
263.1972 ++		}
263.1973 ++	      else
263.1974 ++		_M_data->_M_curr_symbol = L"";
263.1975 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
263.1976 ++	    }
263.1977 ++          catch (...)
263.1978 ++	    {
263.1979 ++	      delete _M_data;
263.1980 ++              _M_data = 0;
263.1981 ++	      delete __wcs_ps;
263.1982 ++	      delete __wcs_ns;	      
263.1983 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.1984 ++	      __uselocale(__old);
263.1985 ++#else
263.1986 ++	      setlocale(LC_ALL, __old);
263.1987 ++	      free(__old);
263.1988 ++#endif
263.1989 ++              __throw_exception_again;
263.1990 ++	    }
263.1991 ++
263.1992 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
263.1993 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
263.1994 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
263.1995 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
263.1996 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
263.1997 ++	                                                __pposn);
263.1998 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
263.1999 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
263.2000 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
263.2001 ++	                                                __nposn);
263.2002 ++
263.2003 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.2004 ++	  __uselocale(__old);
263.2005 ++#else
263.2006 ++	  setlocale(LC_ALL, __old);
263.2007 ++	  free(__old);
263.2008 ++#endif
263.2009 ++	}
263.2010 ++    }
263.2011 ++
263.2012 ++  template<> 
263.2013 ++    moneypunct<wchar_t, true>::~moneypunct()
263.2014 ++    {
263.2015 ++      if (_M_data->_M_positive_sign_size)
263.2016 ++	delete [] _M_data->_M_positive_sign;
263.2017 ++      if (_M_data->_M_negative_sign_size
263.2018 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
263.2019 ++	delete [] _M_data->_M_negative_sign;
263.2020 ++      if (_M_data->_M_curr_symbol_size)
263.2021 ++	delete [] _M_data->_M_curr_symbol;
263.2022 ++      delete _M_data;
263.2023 ++    }
263.2024 ++
263.2025 ++  template<> 
263.2026 ++    moneypunct<wchar_t, false>::~moneypunct()
263.2027 ++    {
263.2028 ++      if (_M_data->_M_positive_sign_size)
263.2029 ++	delete [] _M_data->_M_positive_sign;
263.2030 ++      if (_M_data->_M_negative_sign_size
263.2031 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
263.2032 ++	delete [] _M_data->_M_negative_sign;
263.2033 ++      if (_M_data->_M_curr_symbol_size)
263.2034 ++	delete [] _M_data->_M_curr_symbol;
263.2035 ++      delete _M_data;
263.2036 ++    }
263.2037 ++#endif
263.2038 ++}
263.2039 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
263.2040 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
263.2041 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
263.2042 +@@ -0,0 +1,160 @@
263.2043 ++// std::numpunct implementation details, GNU version -*- C++ -*-
263.2044 ++
263.2045 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
263.2046 ++//
263.2047 ++// This file is part of the GNU ISO C++ Library.  This library is free
263.2048 ++// software; you can redistribute it and/or modify it under the
263.2049 ++// terms of the GNU General Public License as published by the
263.2050 ++// Free Software Foundation; either version 2, or (at your option)
263.2051 ++// any later version.
263.2052 ++
263.2053 ++// This library is distributed in the hope that it will be useful,
263.2054 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
263.2055 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
263.2056 ++// GNU General Public License for more details.
263.2057 ++
263.2058 ++// You should have received a copy of the GNU General Public License along
263.2059 ++// with this library; see the file COPYING.  If not, write to the Free
263.2060 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
263.2061 ++// USA.
263.2062 ++
263.2063 ++// As a special exception, you may use this file as part of a free software
263.2064 ++// library without restriction.  Specifically, if other files instantiate
263.2065 ++// templates or use macros or inline functions from this file, or you compile
263.2066 ++// this file and link it with other files to produce an executable, this
263.2067 ++// file does not by itself cause the resulting executable to be covered by
263.2068 ++// the GNU General Public License.  This exception does not however
263.2069 ++// invalidate any other reasons why the executable file might be covered by
263.2070 ++// the GNU General Public License.
263.2071 ++
263.2072 ++//
263.2073 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
263.2074 ++//
263.2075 ++
263.2076 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
263.2077 ++
263.2078 ++#define _LIBC
263.2079 ++#include <locale>
263.2080 ++#undef _LIBC
263.2081 ++#include <bits/c++locale_internal.h>
263.2082 ++
263.2083 ++#ifdef __UCLIBC_MJN3_ONLY__
263.2084 ++#warning tailor for stub locale support
263.2085 ++#endif
263.2086 ++#ifndef __UCLIBC_HAS_XLOCALE__
263.2087 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
263.2088 ++#endif
263.2089 ++
263.2090 ++namespace std
263.2091 ++{
263.2092 ++  template<> 
263.2093 ++    void
263.2094 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
263.2095 ++    {
263.2096 ++      if (!_M_data)
263.2097 ++	_M_data = new __numpunct_cache<char>;
263.2098 ++
263.2099 ++      if (!__cloc)
263.2100 ++	{
263.2101 ++	  // "C" locale
263.2102 ++	  _M_data->_M_grouping = "";
263.2103 ++	  _M_data->_M_grouping_size = 0;
263.2104 ++	  _M_data->_M_use_grouping = false;
263.2105 ++
263.2106 ++	  _M_data->_M_decimal_point = '.';
263.2107 ++	  _M_data->_M_thousands_sep = ',';
263.2108 ++
263.2109 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
263.2110 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
263.2111 ++
263.2112 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
263.2113 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
263.2114 ++	}
263.2115 ++      else
263.2116 ++	{
263.2117 ++	  // Named locale.
263.2118 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
263.2119 ++							__cloc));
263.2120 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
263.2121 ++							__cloc));
263.2122 ++
263.2123 ++	  // Check for NULL, which implies no grouping.
263.2124 ++	  if (_M_data->_M_thousands_sep == '\0')
263.2125 ++	    _M_data->_M_grouping = "";
263.2126 ++	  else
263.2127 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
263.2128 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
263.2129 ++	}
263.2130 ++
263.2131 ++      // NB: There is no way to extact this info from posix locales.
263.2132 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
263.2133 ++      _M_data->_M_truename = "true";
263.2134 ++      _M_data->_M_truename_size = 4;
263.2135 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
263.2136 ++      _M_data->_M_falsename = "false";
263.2137 ++      _M_data->_M_falsename_size = 5;
263.2138 ++    }
263.2139 ++ 
263.2140 ++  template<> 
263.2141 ++    numpunct<char>::~numpunct()
263.2142 ++    { delete _M_data; }
263.2143 ++   
263.2144 ++#ifdef _GLIBCXX_USE_WCHAR_T
263.2145 ++  template<> 
263.2146 ++    void
263.2147 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
263.2148 ++    {
263.2149 ++      if (!_M_data)
263.2150 ++	_M_data = new __numpunct_cache<wchar_t>;
263.2151 ++
263.2152 ++      if (!__cloc)
263.2153 ++	{
263.2154 ++	  // "C" locale
263.2155 ++	  _M_data->_M_grouping = "";
263.2156 ++	  _M_data->_M_grouping_size = 0;
263.2157 ++	  _M_data->_M_use_grouping = false;
263.2158 ++
263.2159 ++	  _M_data->_M_decimal_point = L'.';
263.2160 ++	  _M_data->_M_thousands_sep = L',';
263.2161 ++
263.2162 ++	  // Use ctype::widen code without the facet...
263.2163 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
263.2164 ++	    _M_data->_M_atoms_out[__i] =
263.2165 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
263.2166 ++
263.2167 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
263.2168 ++	    _M_data->_M_atoms_in[__j] =
263.2169 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
263.2170 ++	}
263.2171 ++      else
263.2172 ++	{
263.2173 ++	  // Named locale.
263.2174 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
263.2175 ++	  union { char *__s; wchar_t __w; } __u;
263.2176 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
263.2177 ++	  _M_data->_M_decimal_point = __u.__w;
263.2178 ++
263.2179 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
263.2180 ++	  _M_data->_M_thousands_sep = __u.__w;
263.2181 ++
263.2182 ++	  if (_M_data->_M_thousands_sep == L'\0')
263.2183 ++	    _M_data->_M_grouping = "";
263.2184 ++	  else
263.2185 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
263.2186 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
263.2187 ++	}
263.2188 ++
263.2189 ++      // NB: There is no way to extact this info from posix locales.
263.2190 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
263.2191 ++      _M_data->_M_truename = L"true";
263.2192 ++      _M_data->_M_truename_size = 4;
263.2193 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
263.2194 ++      _M_data->_M_falsename = L"false";
263.2195 ++      _M_data->_M_falsename_size = 5;
263.2196 ++    }
263.2197 ++
263.2198 ++  template<> 
263.2199 ++    numpunct<wchar_t>::~numpunct()
263.2200 ++    { delete _M_data; }
263.2201 ++ #endif
263.2202 ++}
263.2203 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
263.2204 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
263.2205 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
263.2206 +@@ -0,0 +1,406 @@
263.2207 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
263.2208 ++
263.2209 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
263.2210 ++//
263.2211 ++// This file is part of the GNU ISO C++ Library.  This library is free
263.2212 ++// software; you can redistribute it and/or modify it under the
263.2213 ++// terms of the GNU General Public License as published by the
263.2214 ++// Free Software Foundation; either version 2, or (at your option)
263.2215 ++// any later version.
263.2216 ++
263.2217 ++// This library is distributed in the hope that it will be useful,
263.2218 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
263.2219 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
263.2220 ++// GNU General Public License for more details.
263.2221 ++
263.2222 ++// You should have received a copy of the GNU General Public License along
263.2223 ++// with this library; see the file COPYING.  If not, write to the Free
263.2224 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
263.2225 ++// USA.
263.2226 ++
263.2227 ++// As a special exception, you may use this file as part of a free software
263.2228 ++// library without restriction.  Specifically, if other files instantiate
263.2229 ++// templates or use macros or inline functions from this file, or you compile
263.2230 ++// this file and link it with other files to produce an executable, this
263.2231 ++// file does not by itself cause the resulting executable to be covered by
263.2232 ++// the GNU General Public License.  This exception does not however
263.2233 ++// invalidate any other reasons why the executable file might be covered by
263.2234 ++// the GNU General Public License.
263.2235 ++
263.2236 ++//
263.2237 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
263.2238 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
263.2239 ++//
263.2240 ++
263.2241 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
263.2242 ++
263.2243 ++#include <locale>
263.2244 ++#include <bits/c++locale_internal.h>
263.2245 ++
263.2246 ++#ifdef __UCLIBC_MJN3_ONLY__
263.2247 ++#warning tailor for stub locale support
263.2248 ++#endif
263.2249 ++#ifndef __UCLIBC_HAS_XLOCALE__
263.2250 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
263.2251 ++#endif
263.2252 ++
263.2253 ++namespace std
263.2254 ++{
263.2255 ++  template<>
263.2256 ++    void
263.2257 ++    __timepunct<char>::
263.2258 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
263.2259 ++	   const tm* __tm) const
263.2260 ++    {
263.2261 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.2262 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
263.2263 ++					_M_c_locale_timepunct);
263.2264 ++#else
263.2265 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
263.2266 ++      setlocale(LC_ALL, _M_name_timepunct);
263.2267 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
263.2268 ++      setlocale(LC_ALL, __old);
263.2269 ++      free(__old);
263.2270 ++#endif
263.2271 ++      // Make sure __s is null terminated.
263.2272 ++      if (__len == 0)
263.2273 ++	__s[0] = '\0';
263.2274 ++    }
263.2275 ++
263.2276 ++  template<> 
263.2277 ++    void
263.2278 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
263.2279 ++    {
263.2280 ++      if (!_M_data)
263.2281 ++	_M_data = new __timepunct_cache<char>;
263.2282 ++
263.2283 ++      if (!__cloc)
263.2284 ++	{
263.2285 ++	  // "C" locale
263.2286 ++	  _M_c_locale_timepunct = _S_get_c_locale();
263.2287 ++
263.2288 ++	  _M_data->_M_date_format = "%m/%d/%y";
263.2289 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
263.2290 ++	  _M_data->_M_time_format = "%H:%M:%S";
263.2291 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
263.2292 ++	  _M_data->_M_date_time_format = "";
263.2293 ++	  _M_data->_M_date_time_era_format = "";
263.2294 ++	  _M_data->_M_am = "AM";
263.2295 ++	  _M_data->_M_pm = "PM";
263.2296 ++	  _M_data->_M_am_pm_format = "";
263.2297 ++
263.2298 ++	  // Day names, starting with "C"'s Sunday.
263.2299 ++	  _M_data->_M_day1 = "Sunday";
263.2300 ++	  _M_data->_M_day2 = "Monday";
263.2301 ++	  _M_data->_M_day3 = "Tuesday";
263.2302 ++	  _M_data->_M_day4 = "Wednesday";
263.2303 ++	  _M_data->_M_day5 = "Thursday";
263.2304 ++	  _M_data->_M_day6 = "Friday";
263.2305 ++	  _M_data->_M_day7 = "Saturday";
263.2306 ++
263.2307 ++	  // Abbreviated day names, starting with "C"'s Sun.
263.2308 ++	  _M_data->_M_aday1 = "Sun";
263.2309 ++	  _M_data->_M_aday2 = "Mon";
263.2310 ++	  _M_data->_M_aday3 = "Tue";
263.2311 ++	  _M_data->_M_aday4 = "Wed";
263.2312 ++	  _M_data->_M_aday5 = "Thu";
263.2313 ++	  _M_data->_M_aday6 = "Fri";
263.2314 ++	  _M_data->_M_aday7 = "Sat";
263.2315 ++
263.2316 ++	  // Month names, starting with "C"'s January.
263.2317 ++	  _M_data->_M_month01 = "January";
263.2318 ++	  _M_data->_M_month02 = "February";
263.2319 ++	  _M_data->_M_month03 = "March";
263.2320 ++	  _M_data->_M_month04 = "April";
263.2321 ++	  _M_data->_M_month05 = "May";
263.2322 ++	  _M_data->_M_month06 = "June";
263.2323 ++	  _M_data->_M_month07 = "July";
263.2324 ++	  _M_data->_M_month08 = "August";
263.2325 ++	  _M_data->_M_month09 = "September";
263.2326 ++	  _M_data->_M_month10 = "October";
263.2327 ++	  _M_data->_M_month11 = "November";
263.2328 ++	  _M_data->_M_month12 = "December";
263.2329 ++
263.2330 ++	  // Abbreviated month names, starting with "C"'s Jan.
263.2331 ++	  _M_data->_M_amonth01 = "Jan";
263.2332 ++	  _M_data->_M_amonth02 = "Feb";
263.2333 ++	  _M_data->_M_amonth03 = "Mar";
263.2334 ++	  _M_data->_M_amonth04 = "Apr";
263.2335 ++	  _M_data->_M_amonth05 = "May";
263.2336 ++	  _M_data->_M_amonth06 = "Jun";
263.2337 ++	  _M_data->_M_amonth07 = "Jul";
263.2338 ++	  _M_data->_M_amonth08 = "Aug";
263.2339 ++	  _M_data->_M_amonth09 = "Sep";
263.2340 ++	  _M_data->_M_amonth10 = "Oct";
263.2341 ++	  _M_data->_M_amonth11 = "Nov";
263.2342 ++	  _M_data->_M_amonth12 = "Dec";
263.2343 ++	}
263.2344 ++      else
263.2345 ++	{
263.2346 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
263.2347 ++
263.2348 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
263.2349 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
263.2350 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
263.2351 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
263.2352 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
263.2353 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
263.2354 ++							     __cloc);
263.2355 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
263.2356 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
263.2357 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
263.2358 ++
263.2359 ++	  // Day names, starting with "C"'s Sunday.
263.2360 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
263.2361 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
263.2362 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
263.2363 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
263.2364 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
263.2365 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
263.2366 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
263.2367 ++
263.2368 ++	  // Abbreviated day names, starting with "C"'s Sun.
263.2369 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
263.2370 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
263.2371 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
263.2372 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
263.2373 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
263.2374 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
263.2375 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
263.2376 ++
263.2377 ++	  // Month names, starting with "C"'s January.
263.2378 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
263.2379 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
263.2380 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
263.2381 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
263.2382 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
263.2383 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
263.2384 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
263.2385 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
263.2386 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
263.2387 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
263.2388 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
263.2389 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
263.2390 ++
263.2391 ++	  // Abbreviated month names, starting with "C"'s Jan.
263.2392 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
263.2393 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
263.2394 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
263.2395 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
263.2396 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
263.2397 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
263.2398 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
263.2399 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
263.2400 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
263.2401 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
263.2402 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
263.2403 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
263.2404 ++	}
263.2405 ++    }
263.2406 ++
263.2407 ++#ifdef _GLIBCXX_USE_WCHAR_T
263.2408 ++  template<>
263.2409 ++    void
263.2410 ++    __timepunct<wchar_t>::
263.2411 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
263.2412 ++	   const tm* __tm) const
263.2413 ++    {
263.2414 ++#ifdef __UCLIBC_HAS_XLOCALE__
263.2415 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
263.2416 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
263.2417 ++					_M_c_locale_timepunct);
263.2418 ++#else
263.2419 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
263.2420 ++      setlocale(LC_ALL, _M_name_timepunct);
263.2421 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
263.2422 ++      setlocale(LC_ALL, __old);
263.2423 ++      free(__old);
263.2424 ++#endif
263.2425 ++      // Make sure __s is null terminated.
263.2426 ++      if (__len == 0)
263.2427 ++	__s[0] = L'\0';
263.2428 ++    }
263.2429 ++
263.2430 ++  template<> 
263.2431 ++    void
263.2432 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
263.2433 ++    {
263.2434 ++      if (!_M_data)
263.2435 ++	_M_data = new __timepunct_cache<wchar_t>;
263.2436 ++
263.2437 ++#warning wide time stuff
263.2438 ++//       if (!__cloc)
263.2439 ++	{
263.2440 ++	  // "C" locale
263.2441 ++	  _M_c_locale_timepunct = _S_get_c_locale();
263.2442 ++
263.2443 ++	  _M_data->_M_date_format = L"%m/%d/%y";
263.2444 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
263.2445 ++	  _M_data->_M_time_format = L"%H:%M:%S";
263.2446 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
263.2447 ++	  _M_data->_M_date_time_format = L"";
263.2448 ++	  _M_data->_M_date_time_era_format = L"";
263.2449 ++	  _M_data->_M_am = L"AM";
263.2450 ++	  _M_data->_M_pm = L"PM";
263.2451 ++	  _M_data->_M_am_pm_format = L"";
263.2452 ++
263.2453 ++	  // Day names, starting with "C"'s Sunday.
263.2454 ++	  _M_data->_M_day1 = L"Sunday";
263.2455 ++	  _M_data->_M_day2 = L"Monday";
263.2456 ++	  _M_data->_M_day3 = L"Tuesday";
263.2457 ++	  _M_data->_M_day4 = L"Wednesday";
263.2458 ++	  _M_data->_M_day5 = L"Thursday";
263.2459 ++	  _M_data->_M_day6 = L"Friday";
263.2460 ++	  _M_data->_M_day7 = L"Saturday";
263.2461 ++
263.2462 ++	  // Abbreviated day names, starting with "C"'s Sun.
263.2463 ++	  _M_data->_M_aday1 = L"Sun";
263.2464 ++	  _M_data->_M_aday2 = L"Mon";
263.2465 ++	  _M_data->_M_aday3 = L"Tue";
263.2466 ++	  _M_data->_M_aday4 = L"Wed";
263.2467 ++	  _M_data->_M_aday5 = L"Thu";
263.2468 ++	  _M_data->_M_aday6 = L"Fri";
263.2469 ++	  _M_data->_M_aday7 = L"Sat";
263.2470 ++
263.2471 ++	  // Month names, starting with "C"'s January.
263.2472 ++	  _M_data->_M_month01 = L"January";
263.2473 ++	  _M_data->_M_month02 = L"February";
263.2474 ++	  _M_data->_M_month03 = L"March";
263.2475 ++	  _M_data->_M_month04 = L"April";
263.2476 ++	  _M_data->_M_month05 = L"May";
263.2477 ++	  _M_data->_M_month06 = L"June";
263.2478 ++	  _M_data->_M_month07 = L"July";
263.2479 ++	  _M_data->_M_month08 = L"August";
263.2480 ++	  _M_data->_M_month09 = L"September";
263.2481 ++	  _M_data->_M_month10 = L"October";
263.2482 ++	  _M_data->_M_month11 = L"November";
263.2483 ++	  _M_data->_M_month12 = L"December";
263.2484 ++
263.2485 ++	  // Abbreviated month names, starting with "C"'s Jan.
263.2486 ++	  _M_data->_M_amonth01 = L"Jan";
263.2487 ++	  _M_data->_M_amonth02 = L"Feb";
263.2488 ++	  _M_data->_M_amonth03 = L"Mar";
263.2489 ++	  _M_data->_M_amonth04 = L"Apr";
263.2490 ++	  _M_data->_M_amonth05 = L"May";
263.2491 ++	  _M_data->_M_amonth06 = L"Jun";
263.2492 ++	  _M_data->_M_amonth07 = L"Jul";
263.2493 ++	  _M_data->_M_amonth08 = L"Aug";
263.2494 ++	  _M_data->_M_amonth09 = L"Sep";
263.2495 ++	  _M_data->_M_amonth10 = L"Oct";
263.2496 ++	  _M_data->_M_amonth11 = L"Nov";
263.2497 ++	  _M_data->_M_amonth12 = L"Dec";
263.2498 ++	}
263.2499 ++#if 0
263.2500 ++      else
263.2501 ++	{
263.2502 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
263.2503 ++
263.2504 ++	  union { char *__s; wchar_t *__w; } __u;
263.2505 ++
263.2506 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
263.2507 ++	  _M_data->_M_date_format = __u.__w;
263.2508 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
263.2509 ++	  _M_data->_M_date_era_format = __u.__w;
263.2510 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
263.2511 ++	  _M_data->_M_time_format = __u.__w;
263.2512 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
263.2513 ++	  _M_data->_M_time_era_format = __u.__w;
263.2514 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
263.2515 ++	  _M_data->_M_date_time_format = __u.__w;
263.2516 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
263.2517 ++	  _M_data->_M_date_time_era_format = __u.__w;
263.2518 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
263.2519 ++	  _M_data->_M_am = __u.__w;
263.2520 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
263.2521 ++	  _M_data->_M_pm = __u.__w;
263.2522 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
263.2523 ++	  _M_data->_M_am_pm_format = __u.__w;
263.2524 ++
263.2525 ++	  // Day names, starting with "C"'s Sunday.
263.2526 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
263.2527 ++	  _M_data->_M_day1 = __u.__w;
263.2528 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
263.2529 ++	  _M_data->_M_day2 = __u.__w;
263.2530 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
263.2531 ++	  _M_data->_M_day3 = __u.__w;
263.2532 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
263.2533 ++	  _M_data->_M_day4 = __u.__w;
263.2534 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
263.2535 ++	  _M_data->_M_day5 = __u.__w;
263.2536 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
263.2537 ++	  _M_data->_M_day6 = __u.__w;
263.2538 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
263.2539 ++	  _M_data->_M_day7 = __u.__w;
263.2540 ++
263.2541 ++	  // Abbreviated day names, starting with "C"'s Sun.
263.2542 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
263.2543 ++	  _M_data->_M_aday1 = __u.__w;
263.2544 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
263.2545 ++	  _M_data->_M_aday2 = __u.__w;
263.2546 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
263.2547 ++	  _M_data->_M_aday3 = __u.__w;
263.2548 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
263.2549 ++	  _M_data->_M_aday4 = __u.__w;
263.2550 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
263.2551 ++	  _M_data->_M_aday5 = __u.__w;
263.2552 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
263.2553 ++	  _M_data->_M_aday6 = __u.__w;
263.2554 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
263.2555 ++	  _M_data->_M_aday7 = __u.__w;
263.2556 ++
263.2557 ++	  // Month names, starting with "C"'s January.
263.2558 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
263.2559 ++	  _M_data->_M_month01 = __u.__w;
263.2560 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
263.2561 ++	  _M_data->_M_month02 = __u.__w;
263.2562 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
263.2563 ++	  _M_data->_M_month03 = __u.__w;
263.2564 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
263.2565 ++	  _M_data->_M_month04 = __u.__w;
263.2566 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
263.2567 ++	  _M_data->_M_month05 = __u.__w;
263.2568 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
263.2569 ++	  _M_data->_M_month06 = __u.__w;
263.2570 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
263.2571 ++	  _M_data->_M_month07 = __u.__w;
263.2572 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
263.2573 ++	  _M_data->_M_month08 = __u.__w;
263.2574 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
263.2575 ++	  _M_data->_M_month09 = __u.__w;
263.2576 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
263.2577 ++	  _M_data->_M_month10 = __u.__w;
263.2578 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
263.2579 ++	  _M_data->_M_month11 = __u.__w;
263.2580 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
263.2581 ++	  _M_data->_M_month12 = __u.__w;
263.2582 ++
263.2583 ++	  // Abbreviated month names, starting with "C"'s Jan.
263.2584 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
263.2585 ++	  _M_data->_M_amonth01 = __u.__w;
263.2586 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
263.2587 ++	  _M_data->_M_amonth02 = __u.__w;
263.2588 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
263.2589 ++	  _M_data->_M_amonth03 = __u.__w;
263.2590 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
263.2591 ++	  _M_data->_M_amonth04 = __u.__w;
263.2592 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
263.2593 ++	  _M_data->_M_amonth05 = __u.__w;
263.2594 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
263.2595 ++	  _M_data->_M_amonth06 = __u.__w;
263.2596 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
263.2597 ++	  _M_data->_M_amonth07 = __u.__w;
263.2598 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
263.2599 ++	  _M_data->_M_amonth08 = __u.__w;
263.2600 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
263.2601 ++	  _M_data->_M_amonth09 = __u.__w;
263.2602 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
263.2603 ++	  _M_data->_M_amonth10 = __u.__w;
263.2604 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
263.2605 ++	  _M_data->_M_amonth11 = __u.__w;
263.2606 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
263.2607 ++	  _M_data->_M_amonth12 = __u.__w;
263.2608 ++	}
263.2609 ++#endif // 0
263.2610 ++    }
263.2611 ++#endif
263.2612 ++}
263.2613 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
263.2614 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
263.2615 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
263.2616 +@@ -0,0 +1,68 @@
263.2617 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
263.2618 ++
263.2619 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
263.2620 ++//
263.2621 ++// This file is part of the GNU ISO C++ Library.  This library is free
263.2622 ++// software; you can redistribute it and/or modify it under the
263.2623 ++// terms of the GNU General Public License as published by the
263.2624 ++// Free Software Foundation; either version 2, or (at your option)
263.2625 ++// any later version.
263.2626 ++
263.2627 ++// This library is distributed in the hope that it will be useful,
263.2628 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
263.2629 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
263.2630 ++// GNU General Public License for more details.
263.2631 ++
263.2632 ++// You should have received a copy of the GNU General Public License along
263.2633 ++// with this library; see the file COPYING.  If not, write to the Free
263.2634 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
263.2635 ++// USA.
263.2636 ++
263.2637 ++// As a special exception, you may use this file as part of a free software
263.2638 ++// library without restriction.  Specifically, if other files instantiate
263.2639 ++// templates or use macros or inline functions from this file, or you compile
263.2640 ++// this file and link it with other files to produce an executable, this
263.2641 ++// file does not by itself cause the resulting executable to be covered by
263.2642 ++// the GNU General Public License.  This exception does not however
263.2643 ++// invalidate any other reasons why the executable file might be covered by
263.2644 ++// the GNU General Public License.
263.2645 ++
263.2646 ++//
263.2647 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
263.2648 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
263.2649 ++//
263.2650 ++
263.2651 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
263.2652 ++
263.2653 ++  template<typename _CharT>
263.2654 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
263.2655 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
263.2656 ++    _M_name_timepunct(_S_get_c_name())
263.2657 ++    { _M_initialize_timepunct(); }
263.2658 ++
263.2659 ++  template<typename _CharT>
263.2660 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
263.2661 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
263.2662 ++    _M_name_timepunct(_S_get_c_name())
263.2663 ++    { _M_initialize_timepunct(); }
263.2664 ++
263.2665 ++  template<typename _CharT>
263.2666 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
263.2667 ++				     size_t __refs) 
263.2668 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
263.2669 ++    _M_name_timepunct(__s)
263.2670 ++    { 
263.2671 ++      char* __tmp = new char[std::strlen(__s) + 1];
263.2672 ++      std::strcpy(__tmp, __s);
263.2673 ++      _M_name_timepunct = __tmp;
263.2674 ++      _M_initialize_timepunct(__cloc); 
263.2675 ++    }
263.2676 ++
263.2677 ++  template<typename _CharT>
263.2678 ++    __timepunct<_CharT>::~__timepunct()
263.2679 ++    { 
263.2680 ++      if (_M_name_timepunct != _S_get_c_name())
263.2681 ++	delete [] _M_name_timepunct;
263.2682 ++      delete _M_data; 
263.2683 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
263.2684 ++    }
263.2685 +diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
263.2686 +--- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:29:22.000000000 +0200
263.2687 ++++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
263.2688 +@@ -5769,7 +5769,7 @@
263.2689 +   enableval="$enable_clocale"
263.2690 + 
263.2691 +       case "$enableval" in
263.2692 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
263.2693 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
263.2694 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
263.2695 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
263.2696 +    { (exit 1); exit 1; }; } ;;
263.2697 +@@ -5802,6 +5802,9 @@
263.2698 +   # Default to "generic".
263.2699 +   if test $enable_clocale_flag = auto; then
263.2700 +     case ${target_os} in
263.2701 ++      linux-uclibc*)
263.2702 ++        enable_clocale_flag=uclibc
263.2703 ++	;;
263.2704 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
263.2705 +         enable_clocale_flag=gnu
263.2706 +         ;;
263.2707 +@@ -6190,6 +6193,76 @@
263.2708 +       CTIME_CC=config/locale/generic/time_members.cc
263.2709 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
263.2710 +       ;;
263.2711 ++    uclibc)
263.2712 ++      echo "$as_me:$LINENO: result: uclibc" >&5
263.2713 ++echo "${ECHO_T}uclibc" >&6
263.2714 ++
263.2715 ++      # Declare intention to use gettext, and add support for specific
263.2716 ++      # languages.
263.2717 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
263.2718 ++      ALL_LINGUAS="de fr"
263.2719 ++
263.2720 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
263.2721 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
263.2722 ++set dummy msgfmt; ac_word=$2
263.2723 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
263.2724 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
263.2725 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
263.2726 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
263.2727 ++else
263.2728 ++  if test -n "$check_msgfmt"; then
263.2729 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
263.2730 ++else
263.2731 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
263.2732 ++for as_dir in $PATH
263.2733 ++do
263.2734 ++  IFS=$as_save_IFS
263.2735 ++  test -z "$as_dir" && as_dir=.
263.2736 ++  for ac_exec_ext in '' $ac_executable_extensions; do
263.2737 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
263.2738 ++    ac_cv_prog_check_msgfmt="yes"
263.2739 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
263.2740 ++    break 2
263.2741 ++  fi
263.2742 ++done
263.2743 ++done
263.2744 ++
263.2745 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
263.2746 ++fi
263.2747 ++fi
263.2748 ++check_msgfmt=$ac_cv_prog_check_msgfmt
263.2749 ++if test -n "$check_msgfmt"; then
263.2750 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
263.2751 ++echo "${ECHO_T}$check_msgfmt" >&6
263.2752 ++else
263.2753 ++  echo "$as_me:$LINENO: result: no" >&5
263.2754 ++echo "${ECHO_T}no" >&6
263.2755 ++fi
263.2756 ++
263.2757 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
263.2758 ++        USE_NLS=yes
263.2759 ++      fi
263.2760 ++      # Export the build objects.
263.2761 ++      for ling in $ALL_LINGUAS; do \
263.2762 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
263.2763 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
263.2764 ++      done
263.2765 ++
263.2766 ++
263.2767 ++
263.2768 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
263.2769 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
263.2770 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
263.2771 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
263.2772 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
263.2773 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
263.2774 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
263.2775 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
263.2776 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
263.2777 ++      CTIME_H=config/locale/uclibc/time_members.h
263.2778 ++      CTIME_CC=config/locale/uclibc/time_members.cc
263.2779 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
263.2780 ++      ;;
263.2781 +   esac
263.2782 + 
263.2783 +   # This is where the testsuite looks for locale catalogs, using the
263.2784 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h
263.2785 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2005-08-17 04:28:44.000000000 +0200
263.2786 ++++ gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h	2007-08-03 20:30:21.000000000 +0200
263.2787 +@@ -101,7 +101,9 @@
263.2788 + using std::wmemcpy;
263.2789 + using std::wmemmove;
263.2790 + using std::wmemset;
263.2791 ++#if _GLIBCXX_HAVE_WCSFTIME
263.2792 + using std::wcsftime;
263.2793 ++#endif
263.2794 + 
263.2795 + #if _GLIBCXX_USE_C99
263.2796 + using std::wcstold;
263.2797 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h
263.2798 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h	2006-12-07 10:33:51.000000000 +0100
263.2799 ++++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h	2007-08-03 20:30:21.000000000 +0200
263.2800 +@@ -182,7 +182,9 @@
263.2801 +   using ::wcscoll;
263.2802 +   using ::wcscpy;
263.2803 +   using ::wcscspn;
263.2804 ++#if _GLIBCXX_HAVE_WCSFTIME
263.2805 +   using ::wcsftime;
263.2806 ++#endif
263.2807 +   using ::wcslen;
263.2808 +   using ::wcsncat;
263.2809 +   using ::wcsncmp;
   264.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   264.2 +++ b/patches/gcc/4.2.2/130-uclibc-locale-no__x.patch	Mon Jul 28 21:32:33 2008 +0000
   264.3 @@ -0,0 +1,223 @@
   264.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   264.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
   264.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   264.7 +@@ -39,20 +39,6 @@
   264.8 + #include <langinfo.h>
   264.9 + #include <bits/c++locale_internal.h>
  264.10 + 
  264.11 +-#ifndef __UCLIBC_HAS_XLOCALE__
  264.12 +-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  264.13 +-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  264.14 +-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  264.15 +-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  264.16 +-#define __strtof_l(S, E, L)         strtof((S), (E))
  264.17 +-#define __strtod_l(S, E, L)         strtod((S), (E))
  264.18 +-#define __strtold_l(S, E, L)        strtold((S), (E))
  264.19 +-#warning should dummy __newlocale check for C|POSIX ?
  264.20 +-#define __newlocale(a, b, c)        NULL
  264.21 +-#define __freelocale(a)             ((void)0)
  264.22 +-#define __duplocale(a)              __c_locale()
  264.23 +-#endif
  264.24 +-
  264.25 + namespace std 
  264.26 + {
  264.27 +   template<>
  264.28 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  264.29 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
  264.30 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  264.31 +@@ -68,6 +68,7 @@
  264.32 + {
  264.33 +   extern "C" __typeof(uselocale) __uselocale;
  264.34 + }
  264.35 ++#define __uselocale uselocale
  264.36 + #endif
  264.37 + 
  264.38 + namespace std
  264.39 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  264.40 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
  264.41 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:53.000000000 +0200
  264.42 +@@ -60,4 +60,49 @@
  264.43 + extern "C" __typeof(wctype_l) __wctype_l;
  264.44 + #endif 
  264.45 + 
  264.46 ++# define __nl_langinfo_l nl_langinfo_l
  264.47 ++# define __strcoll_l strcoll_l
  264.48 ++# define __strftime_l strftime_l
  264.49 ++# define __strtod_l strtod_l
  264.50 ++# define __strtof_l strtof_l
  264.51 ++# define __strtold_l strtold_l
  264.52 ++# define __strxfrm_l strxfrm_l
  264.53 ++# define __newlocale newlocale
  264.54 ++# define __freelocale freelocale
  264.55 ++# define __duplocale duplocale
  264.56 ++# define __uselocale uselocale
  264.57 ++
  264.58 ++# ifdef _GLIBCXX_USE_WCHAR_T
  264.59 ++#  define __iswctype_l iswctype_l
  264.60 ++#  define __towlower_l towlower_l
  264.61 ++#  define __towupper_l towupper_l
  264.62 ++#  define __wcscoll_l wcscoll_l
  264.63 ++#  define __wcsftime_l wcsftime_l
  264.64 ++#  define __wcsxfrm_l wcsxfrm_l
  264.65 ++#  define __wctype_l wctype_l
  264.66 ++# endif
  264.67 ++
  264.68 ++#else
  264.69 ++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  264.70 ++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  264.71 ++# define __strtod_l(S, E, L)         strtod((S), (E))
  264.72 ++# define __strtof_l(S, E, L)         strtof((S), (E))
  264.73 ++# define __strtold_l(S, E, L)        strtold((S), (E))
  264.74 ++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  264.75 ++# warning should dummy __newlocale check for C|POSIX ?
  264.76 ++# define __newlocale(a, b, c)        NULL
  264.77 ++# define __freelocale(a)             ((void)0)
  264.78 ++# define __duplocale(a)              __c_locale()
  264.79 ++//# define __uselocale ?
  264.80 ++//
  264.81 ++# ifdef _GLIBCXX_USE_WCHAR_T
  264.82 ++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  264.83 ++#  define __towlower_l(C, L)          towlower((C))
  264.84 ++#  define __towupper_l(C, L)          towupper((C))
  264.85 ++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  264.86 ++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  264.87 ++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  264.88 ++#  define __wctype_l(S, L)            wctype((S))
  264.89 ++# endif
  264.90 ++
  264.91 + #endif // GLIBC 2.3 and later
  264.92 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
  264.93 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
  264.94 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:53.000000000 +0200
  264.95 +@@ -36,13 +36,6 @@
  264.96 + #include <locale>
  264.97 + #include <bits/c++locale_internal.h>
  264.98 + 
  264.99 +-#ifndef __UCLIBC_HAS_XLOCALE__
 264.100 +-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 264.101 +-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 264.102 +-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 264.103 +-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 264.104 +-#endif
 264.105 +-
 264.106 + namespace std
 264.107 + {
 264.108 +   // These are basically extensions to char_traits, and perhaps should
 264.109 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 264.110 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 264.111 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 264.112 +@@ -38,13 +38,6 @@
 264.113 + #undef _LIBC
 264.114 + #include <bits/c++locale_internal.h>
 264.115 + 
 264.116 +-#ifndef __UCLIBC_HAS_XLOCALE__
 264.117 +-#define __wctype_l(S, L)           wctype((S))
 264.118 +-#define __towupper_l(C, L)         towupper((C))
 264.119 +-#define __towlower_l(C, L)         towlower((C))
 264.120 +-#define __iswctype_l(C, M, L)      iswctype((C), (M))
 264.121 +-#endif
 264.122 +-
 264.123 + namespace std
 264.124 + {
 264.125 +   // NB: The other ctype<char> specializations are in src/locale.cc and
 264.126 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
 264.127 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
 264.128 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:53.000000000 +0200
 264.129 +@@ -39,13 +39,10 @@
 264.130 + #ifdef __UCLIBC_MJN3_ONLY__
 264.131 + #warning fix gettext stuff
 264.132 + #endif
 264.133 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 264.134 +-extern "C" char *__dcgettext(const char *domainname,
 264.135 +-			     const char *msgid, int category);
 264.136 + #undef gettext
 264.137 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 264.138 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 264.139 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 264.140 + #else
 264.141 +-#undef gettext
 264.142 + #define gettext(msgid) (msgid)
 264.143 + #endif
 264.144 + 
 264.145 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 264.146 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
 264.147 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 264.148 +@@ -36,15 +36,11 @@
 264.149 + #ifdef __UCLIBC_MJN3_ONLY__
 264.150 + #warning fix prototypes for *textdomain funcs
 264.151 + #endif
 264.152 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 264.153 +-extern "C" char *__textdomain(const char *domainname);
 264.154 +-extern "C" char *__bindtextdomain(const char *domainname,
 264.155 +-				  const char *dirname);
 264.156 +-#else
 264.157 +-#undef __textdomain
 264.158 +-#undef __bindtextdomain
 264.159 +-#define __textdomain(D)           ((void)0)
 264.160 +-#define __bindtextdomain(D,P)     ((void)0)
 264.161 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 264.162 ++#undef textdomain
 264.163 ++#undef bindtextdomain
 264.164 ++#define textdomain(D)           ((void)0)
 264.165 ++#define bindtextdomain(D,P)     ((void)0)
 264.166 + #endif
 264.167 + 
 264.168 +   // Non-virtual member functions.
 264.169 +@@ -70,7 +66,7 @@
 264.170 +     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 264.171 + 			   const char* __dir) const
 264.172 +     { 
 264.173 +-      __bindtextdomain(__s.c_str(), __dir);
 264.174 ++      bindtextdomain(__s.c_str(), __dir);
 264.175 +       return this->do_open(__s, __loc); 
 264.176 +     }
 264.177 + 
 264.178 +@@ -90,7 +86,7 @@
 264.179 +     { 
 264.180 +       // No error checking is done, assume the catalog exists and can
 264.181 +       // be used.
 264.182 +-      __textdomain(__s.c_str());
 264.183 ++      textdomain(__s.c_str());
 264.184 +       return 0;
 264.185 +     }
 264.186 + 
 264.187 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 264.188 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
 264.189 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
 264.190 +@@ -43,10 +43,6 @@
 264.191 + #warning tailor for stub locale support
 264.192 + #endif
 264.193 + 
 264.194 +-#ifndef __UCLIBC_HAS_XLOCALE__
 264.195 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 264.196 +-#endif
 264.197 +-
 264.198 + namespace std
 264.199 + {
 264.200 +   // Construct and return valid pattern consisting of some combination of:
 264.201 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 264.202 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
 264.203 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
 264.204 +@@ -41,9 +41,6 @@
 264.205 + #ifdef __UCLIBC_MJN3_ONLY__
 264.206 + #warning tailor for stub locale support
 264.207 + #endif
 264.208 +-#ifndef __UCLIBC_HAS_XLOCALE__
 264.209 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 264.210 +-#endif
 264.211 + 
 264.212 + namespace std
 264.213 + {
 264.214 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
 264.215 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
 264.216 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:53.000000000 +0200
 264.217 +@@ -40,9 +40,6 @@
 264.218 + #ifdef __UCLIBC_MJN3_ONLY__
 264.219 + #warning tailor for stub locale support
 264.220 + #endif
 264.221 +-#ifndef __UCLIBC_HAS_XLOCALE__
 264.222 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 264.223 +-#endif
 264.224 + 
 264.225 + namespace std
 264.226 + {
   265.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   265.2 +++ b/patches/gcc/4.2.2/140-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:32:33 2008 +0000
   265.3 @@ -0,0 +1,50 @@
   265.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   265.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
   265.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
   265.7 +@@ -401,7 +401,7 @@
   265.8 + # ifdef __UCLIBC_HAS_XLOCALE__
   265.9 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  265.10 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  265.11 +-# else
  265.12 ++# elif defined __UCLIBC_HAS_LOCALE__
  265.13 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  265.14 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  265.15 + # endif
  265.16 +@@ -556,7 +556,7 @@
  265.17 + # ifdef __UCLIBC_HAS_XLOCALE__
  265.18 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  265.19 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  265.20 +-# else
  265.21 ++# elif defined __UCLIBC_HAS_LOCALE__
  265.22 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  265.23 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  265.24 + # endif
  265.25 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  265.26 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
  265.27 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
  265.28 +@@ -127,12 +127,25 @@
  265.29 + 	{
  265.30 + 	  // Named locale.
  265.31 + 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  265.32 ++#ifdef __UCLIBC_MJN3_ONLY__
  265.33 ++#warning fix this... should be numeric
  265.34 ++#endif
  265.35 ++#ifdef __UCLIBC__
  265.36 ++# ifdef __UCLIBC_HAS_XLOCALE__
  265.37 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  265.38 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  265.39 ++# elif defined __UCLIBC_HAS_LOCALE__
  265.40 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  265.41 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  265.42 ++# endif
  265.43 ++#else
  265.44 + 	  union { char *__s; wchar_t __w; } __u;
  265.45 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  265.46 + 	  _M_data->_M_decimal_point = __u.__w;
  265.47 + 
  265.48 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  265.49 + 	  _M_data->_M_thousands_sep = __u.__w;
  265.50 ++#endif
  265.51 + 
  265.52 + 	  if (_M_data->_M_thousands_sep == L'\0')
  265.53 + 	    _M_data->_M_grouping = "";
   266.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   266.2 +++ b/patches/gcc/4.2.2/150-uclibc-locale-update.patch	Mon Jul 28 21:32:33 2008 +0000
   266.3 @@ -0,0 +1,354 @@
   266.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   266.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   266.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:31:54.000000000 +0200
   266.7 +@@ -46,16 +46,13 @@
   266.8 +     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   266.9 + 		   const __c_locale& __cloc)
  266.10 +     {
  266.11 +-      if (!(__err & ios_base::failbit))
  266.12 +-	{
  266.13 +-	  char* __sanity;
  266.14 +-	  errno = 0;
  266.15 +-	  float __f = __strtof_l(__s, &__sanity, __cloc);
  266.16 +-          if (__sanity != __s && errno != ERANGE)
  266.17 +-	    __v = __f;
  266.18 +-	  else
  266.19 +-	    __err |= ios_base::failbit;
  266.20 +-	}
  266.21 ++      char* __sanity;
  266.22 ++      errno = 0;
  266.23 ++      float __f = __strtof_l(__s, &__sanity, __cloc);
  266.24 ++      if (__sanity != __s && errno != ERANGE)
  266.25 ++	__v = __f;
  266.26 ++      else
  266.27 ++	__err |= ios_base::failbit;
  266.28 +     }
  266.29 + 
  266.30 +   template<>
  266.31 +@@ -63,16 +60,13 @@
  266.32 +     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  266.33 + 		   const __c_locale& __cloc)
  266.34 +     {
  266.35 +-      if (!(__err & ios_base::failbit))
  266.36 +-	{
  266.37 +-	  char* __sanity;
  266.38 +-	  errno = 0;
  266.39 +-	  double __d = __strtod_l(__s, &__sanity, __cloc);
  266.40 +-          if (__sanity != __s && errno != ERANGE)
  266.41 +-	    __v = __d;
  266.42 +-	  else
  266.43 +-	    __err |= ios_base::failbit;
  266.44 +-	}
  266.45 ++      char* __sanity;
  266.46 ++      errno = 0;
  266.47 ++      double __d = __strtod_l(__s, &__sanity, __cloc);
  266.48 ++      if (__sanity != __s && errno != ERANGE)
  266.49 ++	__v = __d;
  266.50 ++      else
  266.51 ++	__err |= ios_base::failbit;
  266.52 +     }
  266.53 + 
  266.54 +   template<>
  266.55 +@@ -80,16 +74,13 @@
  266.56 +     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  266.57 + 		   const __c_locale& __cloc)
  266.58 +     {
  266.59 +-      if (!(__err & ios_base::failbit))
  266.60 +-	{
  266.61 +-	  char* __sanity;
  266.62 +-	  errno = 0;
  266.63 +-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  266.64 +-          if (__sanity != __s && errno != ERANGE)
  266.65 +-	    __v = __ld;
  266.66 +-	  else
  266.67 +-	    __err |= ios_base::failbit;
  266.68 +-	}
  266.69 ++      char* __sanity;
  266.70 ++      errno = 0;
  266.71 ++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  266.72 ++      if (__sanity != __s && errno != ERANGE)
  266.73 ++	__v = __ld;
  266.74 ++      else
  266.75 ++	__err |= ios_base::failbit;
  266.76 +     }
  266.77 + 
  266.78 +   void
  266.79 +@@ -110,7 +101,7 @@
  266.80 +   void
  266.81 +   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  266.82 +   {
  266.83 +-    if (_S_get_c_locale() != __cloc)
  266.84 ++    if (__cloc && _S_get_c_locale() != __cloc)
  266.85 +       __freelocale(__cloc); 
  266.86 +   }
  266.87 + 
  266.88 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  266.89 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  266.90 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:31:54.000000000 +0200
  266.91 +@@ -39,21 +39,23 @@
  266.92 + #pragma GCC system_header
  266.93 + 
  266.94 + #include <cstring>              // get std::strlen
  266.95 +-#include <cstdio>               // get std::snprintf or std::sprintf
  266.96 ++#include <cstdio>               // get std::vsnprintf or std::vsprintf
  266.97 + #include <clocale>
  266.98 + #include <langinfo.h>		// For codecvt
  266.99 + #ifdef __UCLIBC_MJN3_ONLY__
 266.100 + #warning fix this
 266.101 + #endif
 266.102 +-#ifdef __UCLIBC_HAS_LOCALE__
 266.103 ++#ifdef _GLIBCXX_USE_ICONV
 266.104 + #include <iconv.h>		// For codecvt using iconv, iconv_t
 266.105 + #endif
 266.106 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 266.107 +-#include <libintl.h> 		// For messages
 266.108 ++#ifdef HAVE_LIBINTL_H
 266.109 ++#include <libintl.h>		// For messages
 266.110 + #endif
 266.111 ++#include <cstdarg>
 266.112 + 
 266.113 + #ifdef __UCLIBC_MJN3_ONLY__
 266.114 + #warning what is _GLIBCXX_C_LOCALE_GNU for
 266.115 ++// psm: used in os/gnu-linux/ctype_noninline.h
 266.116 + #endif
 266.117 + #define _GLIBCXX_C_LOCALE_GNU 1
 266.118 + 
 266.119 +@@ -62,7 +64,7 @@
 266.120 + #endif
 266.121 + // #define _GLIBCXX_NUM_CATEGORIES 6
 266.122 + #define _GLIBCXX_NUM_CATEGORIES 0
 266.123 +- 
 266.124 ++
 266.125 + #ifdef __UCLIBC_HAS_XLOCALE__
 266.126 + namespace __gnu_cxx
 266.127 + {
 266.128 +@@ -79,22 +81,24 @@
 266.129 +   typedef int*			__c_locale;
 266.130 + #endif
 266.131 + 
 266.132 +-  // Convert numeric value of type _Tv to string and return length of
 266.133 +-  // string.  If snprintf is available use it, otherwise fall back to
 266.134 +-  // the unsafe sprintf which, in general, can be dangerous and should
 266.135 ++  // Convert numeric value of type double to string and return length of
 266.136 ++  // string.  If vsnprintf is available use it, otherwise fall back to
 266.137 ++  // the unsafe vsprintf which, in general, can be dangerous and should
 266.138 +   // be avoided.
 266.139 +-  template<typename _Tv>
 266.140 +-    int
 266.141 +-    __convert_from_v(char* __out, 
 266.142 +-		     const int __size __attribute__ ((__unused__)),
 266.143 +-		     const char* __fmt,
 266.144 +-#ifdef __UCLIBC_HAS_XCLOCALE__
 266.145 +-		     _Tv __v, const __c_locale& __cloc, int __prec)
 266.146 ++    inline int
 266.147 ++    __convert_from_v(const __c_locale&
 266.148 ++#ifndef __UCLIBC_HAS_XCLOCALE__
 266.149 ++					__cloc __attribute__ ((__unused__))
 266.150 ++#endif
 266.151 ++		     ,
 266.152 ++		     char* __out,
 266.153 ++		     const int __size,
 266.154 ++		     const char* __fmt, ...)
 266.155 +     {
 266.156 ++      va_list __args;
 266.157 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 266.158 +       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 266.159 + #else
 266.160 +-		     _Tv __v, const __c_locale&, int __prec)
 266.161 +-    {
 266.162 + # ifdef __UCLIBC_HAS_LOCALE__
 266.163 +       char* __old = std::setlocale(LC_ALL, NULL);
 266.164 +       char* __sav = new char[std::strlen(__old) + 1];
 266.165 +@@ -103,7 +107,9 @@
 266.166 + # endif
 266.167 + #endif
 266.168 + 
 266.169 +-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 266.170 ++      va_start(__args, __fmt);
 266.171 ++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 266.172 ++      va_end(__args);
 266.173 + 
 266.174 + #ifdef __UCLIBC_HAS_XCLOCALE__
 266.175 +       __gnu_cxx::__uselocale(__old);
 266.176 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 266.177 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 266.178 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:31:54.000000000 +0200
 266.179 +@@ -33,9 +33,14 @@
 266.180 + 
 266.181 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 266.182 + 
 266.183 ++#include <features.h>
 266.184 ++#ifdef __UCLIBC_HAS_LOCALE__
 266.185 + #define _LIBC
 266.186 + #include <locale>
 266.187 + #undef _LIBC
 266.188 ++#else
 266.189 ++#include <locale>
 266.190 ++#endif
 266.191 + #include <bits/c++locale_internal.h>
 266.192 + 
 266.193 + namespace std
 266.194 +@@ -138,20 +143,34 @@
 266.195 +   ctype<wchar_t>::
 266.196 +   do_is(mask __m, wchar_t __c) const
 266.197 +   { 
 266.198 +-    // Highest bitmask in ctype_base == 10, but extra in "C"
 266.199 +-    // library for blank.
 266.200 ++    // The case of __m == ctype_base::space is particularly important,
 266.201 ++    // due to its use in many istream functions.  Therefore we deal with
 266.202 ++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 266.203 ++    // is the mask corresponding to ctype_base::space.  NB: an encoding
 266.204 ++    // change would not affect correctness!
 266.205 +     bool __ret = false;
 266.206 +-    const size_t __bitmasksize = 11; 
 266.207 +-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 266.208 +-      if (__m & _M_bit[__bitcur]
 266.209 +-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 266.210 +-	{
 266.211 +-	  __ret = true;
 266.212 +-	  break;
 266.213 +-	}
 266.214 ++    if (__m == _M_bit[5])
 266.215 ++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 266.216 ++    else
 266.217 ++      {
 266.218 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 266.219 ++	// library for blank.
 266.220 ++	const size_t __bitmasksize = 11;
 266.221 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 266.222 ++	  if (__m & _M_bit[__bitcur])
 266.223 ++	    {
 266.224 ++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 266.225 ++		{
 266.226 ++		  __ret = true;
 266.227 ++		  break;
 266.228 ++		}
 266.229 ++	      else if (__m == _M_bit[__bitcur])
 266.230 ++		break;
 266.231 ++	    }
 266.232 ++      }
 266.233 +     return __ret;    
 266.234 +   }
 266.235 +-  
 266.236 ++
 266.237 +   const wchar_t* 
 266.238 +   ctype<wchar_t>::
 266.239 +   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 266.240 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 266.241 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 266.242 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
 266.243 +@@ -47,18 +47,21 @@
 266.244 +   template<typename _CharT>
 266.245 +      messages<_CharT>::messages(size_t __refs)
 266.246 +      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 266.247 +-     _M_name_messages(_S_get_c_name())
 266.248 ++       _M_name_messages(_S_get_c_name())
 266.249 +      { }
 266.250 + 
 266.251 +   template<typename _CharT>
 266.252 +      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 266.253 + 				size_t __refs) 
 266.254 +-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 266.255 +-     _M_name_messages(__s)
 266.256 ++     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 266.257 +      {
 266.258 +-       char* __tmp = new char[std::strlen(__s) + 1];
 266.259 +-       std::strcpy(__tmp, __s);
 266.260 ++       const size_t __len = std::strlen(__s) + 1;
 266.261 ++       char* __tmp = new char[__len];
 266.262 ++       std::memcpy(__tmp, __s, __len);
 266.263 +        _M_name_messages = __tmp;
 266.264 ++
 266.265 ++       // Last to avoid leaking memory if new throws.
 266.266 ++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 266.267 +      }
 266.268 + 
 266.269 +   template<typename _CharT>
 266.270 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 266.271 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
 266.272 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:54.000000000 +0200
 266.273 +@@ -33,9 +33,14 @@
 266.274 + 
 266.275 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 266.276 + 
 266.277 ++#include <features.h>
 266.278 ++#ifdef __UCLIBC_HAS_LOCALE__
 266.279 + #define _LIBC
 266.280 + #include <locale>
 266.281 + #undef _LIBC
 266.282 ++#else
 266.283 ++#include <locale>
 266.284 ++#endif
 266.285 + #include <bits/c++locale_internal.h>
 266.286 + 
 266.287 + #ifdef __UCLIBC_MJN3_ONLY__
 266.288 +@@ -206,7 +211,7 @@
 266.289 + 	  }
 266.290 + 	break;
 266.291 +       default:
 266.292 +-	;
 266.293 ++	__ret = pattern();
 266.294 +       }
 266.295 +     return __ret;
 266.296 +   }
 266.297 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 266.298 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
 266.299 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:54.000000000 +0200
 266.300 +@@ -33,9 +33,14 @@
 266.301 + 
 266.302 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 266.303 + 
 266.304 ++#include <features.h>
 266.305 ++#ifdef __UCLIBC_HAS_LOCALE__
 266.306 + #define _LIBC
 266.307 + #include <locale>
 266.308 + #undef _LIBC
 266.309 ++#else
 266.310 ++#include <locale>
 266.311 ++#endif
 266.312 + #include <bits/c++locale_internal.h>
 266.313 + 
 266.314 + #ifdef __UCLIBC_MJN3_ONLY__
 266.315 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
 266.316 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
 266.317 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
 266.318 +@@ -37,25 +37,33 @@
 266.319 +   template<typename _CharT>
 266.320 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
 266.321 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 266.322 +-    _M_name_timepunct(_S_get_c_name())
 266.323 ++      _M_name_timepunct(_S_get_c_name())
 266.324 +     { _M_initialize_timepunct(); }
 266.325 + 
 266.326 +   template<typename _CharT>
 266.327 +     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 266.328 +     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 266.329 +-    _M_name_timepunct(_S_get_c_name())
 266.330 ++      _M_name_timepunct(_S_get_c_name())
 266.331 +     { _M_initialize_timepunct(); }
 266.332 + 
 266.333 +   template<typename _CharT>
 266.334 +     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 266.335 + 				     size_t __refs) 
 266.336 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 266.337 +-    _M_name_timepunct(__s)
 266.338 ++      _M_name_timepunct(NULL)
 266.339 +     { 
 266.340 +-      char* __tmp = new char[std::strlen(__s) + 1];
 266.341 +-      std::strcpy(__tmp, __s);
 266.342 ++      const size_t __len = std::strlen(__s) + 1;
 266.343 ++      char* __tmp = new char[__len];
 266.344 ++      std::memcpy(__tmp, __s, __len);
 266.345 +       _M_name_timepunct = __tmp;
 266.346 +-      _M_initialize_timepunct(__cloc); 
 266.347 ++
 266.348 ++      try
 266.349 ++	{ _M_initialize_timepunct(__cloc); }
 266.350 ++      catch(...)
 266.351 ++	{
 266.352 ++	  delete [] _M_name_timepunct;
 266.353 ++	  __throw_exception_again;
 266.354 ++	}
 266.355 +     }
 266.356 + 
 266.357 +   template<typename _CharT>
   267.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   267.2 +++ b/patches/gcc/4.2.2/160-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   267.3 @@ -0,0 +1,50 @@
   267.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am gcc-4.2.1/libstdc++-v3/src/Makefile.am
   267.5 +--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am	2006-07-28 06:57:34.000000000 +0200
   267.6 ++++ gcc-4.2.1/libstdc++-v3/src/Makefile.am	2007-08-03 20:32:27.000000000 +0200
   267.7 +@@ -257,6 +257,12 @@
   267.8 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
   267.9 + 
  267.10 + 
  267.11 ++install-exec-local:
  267.12 ++ifeq ($(enable_shared),yes)
  267.13 ++	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  267.14 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  267.15 ++endif
  267.16 ++
  267.17 + # Added bits to build debug library.
  267.18 + if GLIBCXX_BUILD_DEBUG
  267.19 + all-local: build_debug
  267.20 +diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in gcc-4.2.1/libstdc++-v3/src/Makefile.in
  267.21 +--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in	2006-10-16 21:08:22.000000000 +0200
  267.22 ++++ gcc-4.2.1/libstdc++-v3/src/Makefile.in	2007-08-03 20:32:27.000000000 +0200
  267.23 +@@ -657,7 +657,7 @@
  267.24 + 
  267.25 + install-data-am: install-data-local
  267.26 + 
  267.27 +-install-exec-am: install-toolexeclibLTLIBRARIES
  267.28 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  267.29 + 
  267.30 + install-info: install-info-am
  267.31 + 
  267.32 +@@ -690,6 +690,7 @@
  267.33 + 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  267.34 + 	html-am info info-am install install-am install-data \
  267.35 + 	install-data-am install-data-local install-exec \
  267.36 ++	install-exec-local \
  267.37 + 	install-exec-am install-info install-info-am install-man \
  267.38 + 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  267.39 + 	installcheck-am installdirs maintainer-clean \
  267.40 +@@ -799,6 +800,13 @@
  267.41 + install_debug:
  267.42 + 	(cd ${debugdir} && $(MAKE) \
  267.43 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  267.44 ++
  267.45 ++install-exec-local:
  267.46 ++ifeq ($(enable_shared),yes)
  267.47 ++	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  267.48 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  267.49 ++endif
  267.50 ++
  267.51 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  267.52 + # Otherwise a system limit (for SysV at least) may be exceeded.
  267.53 + .NOEXPORT:
   268.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   268.2 +++ b/patches/gcc/4.2.2/170-missing-execinfo_h.patch	Mon Jul 28 21:32:33 2008 +0000
   268.3 @@ -0,0 +1,12 @@
   268.4 +diff -durN gcc-4.2.1.orig/boehm-gc/include/gc.h gcc-4.2.1/boehm-gc/include/gc.h
   268.5 +--- gcc-4.2.1.orig/boehm-gc/include/gc.h	2006-09-18 20:45:08.000000000 +0200
   268.6 ++++ gcc-4.2.1/boehm-gc/include/gc.h	2007-08-03 20:33:00.000000000 +0200
   268.7 +@@ -502,7 +502,7 @@
   268.8 + #if defined(__linux__) || defined(__GLIBC__)
   268.9 + # include <features.h>
  268.10 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  268.11 +-     && !defined(__ia64__)
  268.12 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  268.13 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  268.14 + #     define GC_HAVE_BUILTIN_BACKTRACE
  268.15 + #   endif
   269.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   269.2 +++ b/patches/gcc/4.2.2/180-c99-snprintf.patch	Mon Jul 28 21:32:33 2008 +0000
   269.3 @@ -0,0 +1,12 @@
   269.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h
   269.5 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h	2006-12-07 10:33:51.000000000 +0100
   269.6 ++++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h	2007-08-03 20:33:24.000000000 +0200
   269.7 +@@ -144,7 +144,7 @@
   269.8 + 
   269.9 + _GLIBCXX_END_NAMESPACE
  269.10 + 
  269.11 +-#if _GLIBCXX_USE_C99
  269.12 ++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  269.13 + 
  269.14 + #undef snprintf
  269.15 + #undef vfscanf
   270.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   270.2 +++ b/patches/gcc/4.2.2/190-c99-complex-ugly-hack.patch	Mon Jul 28 21:32:33 2008 +0000
   270.3 @@ -0,0 +1,13 @@
   270.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
   270.5 +--- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
   270.6 ++++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:33:56.000000000 +0200
   270.7 +@@ -7514,6 +7514,9 @@
   270.8 + cat >>conftest.$ac_ext <<_ACEOF
   270.9 + /* end confdefs.h.  */
  270.10 + #include <complex.h>
  270.11 ++#ifdef __UCLIBC__
  270.12 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  270.13 ++#endif
  270.14 + int
  270.15 + main ()
  270.16 + {
   271.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   271.2 +++ b/patches/gcc/4.2.2/200-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
   271.3 @@ -0,0 +1,26 @@
   271.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/rope gcc-4.2.1/libstdc++-v3/include/ext/rope
   271.5 +--- gcc-4.2.1.orig/libstdc++-v3/include/ext/rope	2006-10-17 13:56:21.000000000 +0200
   271.6 ++++ gcc-4.2.1/libstdc++-v3/include/ext/rope	2007-08-03 20:34:23.000000000 +0200
   271.7 +@@ -58,6 +58,9 @@
   271.8 + #include <bits/allocator.h>
   271.9 + #include <ext/hash_fun.h>
  271.10 + 
  271.11 ++/* cope w/ index defined as macro, SuSv3 proposal */
  271.12 ++#undef index
  271.13 ++
  271.14 + # ifdef __GC
  271.15 + #   define __GC_CONST const
  271.16 + # else
  271.17 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h
  271.18 +--- gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2006-10-17 13:56:21.000000000 +0200
  271.19 ++++ gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h	2007-08-03 20:34:23.000000000 +0200
  271.20 +@@ -54,6 +54,9 @@
  271.21 + #include <ext/memory> // For uninitialized_copy_n
  271.22 + #include <ext/numeric> // For power
  271.23 + 
  271.24 ++/* cope w/ index defined as macro, SuSv3 proposal */
  271.25 ++#undef index
  271.26 ++
  271.27 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  271.28 + 
  271.29 +   using std::size_t;
   272.1 --- a/patches/gcc/4.2.2/200-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   272.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   272.3 @@ -1,2806 +0,0 @@
   272.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 gcc-4.2.1/libstdc++-v3/acinclude.m4
   272.5 ---- gcc-4.2.1.orig/libstdc++-v3/acinclude.m4	2007-06-29 01:02:05.000000000 +0200
   272.6 -+++ gcc-4.2.1/libstdc++-v3/acinclude.m4	2007-08-03 20:30:21.000000000 +0200
   272.7 -@@ -1334,7 +1334,7 @@
   272.8 - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   272.9 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  272.10 -     [use MODEL for target locale package],
  272.11 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  272.12 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  272.13 - 
  272.14 -   # Deal with gettext issues.  Default to not using it (=no) until we detect
  272.15 -   # support for it later.  Let the user turn it off via --e/d, but let that
  272.16 -@@ -1355,6 +1355,9 @@
  272.17 -   # Default to "generic".
  272.18 -   if test $enable_clocale_flag = auto; then
  272.19 -     case ${target_os} in
  272.20 -+      *-uclibc*)
  272.21 -+        enable_clocale_flag=uclibc
  272.22 -+        ;;
  272.23 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  272.24 -         enable_clocale_flag=gnu	
  272.25 -         ;;
  272.26 -@@ -1526,6 +1529,40 @@
  272.27 -       CTIME_CC=config/locale/generic/time_members.cc
  272.28 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  272.29 -       ;;
  272.30 -+    uclibc)
  272.31 -+      AC_MSG_RESULT(uclibc)
  272.32 -+
  272.33 -+      # Declare intention to use gettext, and add support for specific
  272.34 -+      # languages.
  272.35 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  272.36 -+      ALL_LINGUAS="de fr"
  272.37 -+
  272.38 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  272.39 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  272.40 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  272.41 -+        USE_NLS=yes
  272.42 -+      fi
  272.43 -+      # Export the build objects.
  272.44 -+      for ling in $ALL_LINGUAS; do \
  272.45 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  272.46 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  272.47 -+      done
  272.48 -+      AC_SUBST(glibcxx_MOFILES)
  272.49 -+      AC_SUBST(glibcxx_POFILES)
  272.50 -+
  272.51 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  272.52 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  272.53 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  272.54 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  272.55 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  272.56 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  272.57 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  272.58 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  272.59 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  272.60 -+      CTIME_H=config/locale/uclibc/time_members.h
  272.61 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  272.62 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  272.63 -+      ;;
  272.64 -   esac
  272.65 - 
  272.66 -   # This is where the testsuite looks for locale catalogs, using the
  272.67 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
  272.68 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  272.69 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
  272.70 -@@ -0,0 +1,160 @@
  272.71 -+// Wrapper for underlying C-language localization -*- C++ -*-
  272.72 -+
  272.73 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  272.74 -+//
  272.75 -+// This file is part of the GNU ISO C++ Library.  This library is free
  272.76 -+// software; you can redistribute it and/or modify it under the
  272.77 -+// terms of the GNU General Public License as published by the
  272.78 -+// Free Software Foundation; either version 2, or (at your option)
  272.79 -+// any later version.
  272.80 -+
  272.81 -+// This library is distributed in the hope that it will be useful,
  272.82 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  272.83 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  272.84 -+// GNU General Public License for more details.
  272.85 -+
  272.86 -+// You should have received a copy of the GNU General Public License along
  272.87 -+// with this library; see the file COPYING.  If not, write to the Free
  272.88 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  272.89 -+// USA.
  272.90 -+
  272.91 -+// As a special exception, you may use this file as part of a free software
  272.92 -+// library without restriction.  Specifically, if other files instantiate
  272.93 -+// templates or use macros or inline functions from this file, or you compile
  272.94 -+// this file and link it with other files to produce an executable, this
  272.95 -+// file does not by itself cause the resulting executable to be covered by
  272.96 -+// the GNU General Public License.  This exception does not however
  272.97 -+// invalidate any other reasons why the executable file might be covered by
  272.98 -+// the GNU General Public License.
  272.99 -+
 272.100 -+//
 272.101 -+// ISO C++ 14882: 22.8  Standard locale categories.
 272.102 -+//
 272.103 -+
 272.104 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 272.105 -+
 272.106 -+#include <cerrno>  // For errno
 272.107 -+#include <locale>
 272.108 -+#include <stdexcept>
 272.109 -+#include <langinfo.h>
 272.110 -+#include <bits/c++locale_internal.h>
 272.111 -+
 272.112 -+#ifndef __UCLIBC_HAS_XLOCALE__
 272.113 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 272.114 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 272.115 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 272.116 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 272.117 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 272.118 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 272.119 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 272.120 -+#warning should dummy __newlocale check for C|POSIX ?
 272.121 -+#define __newlocale(a, b, c)        NULL
 272.122 -+#define __freelocale(a)             ((void)0)
 272.123 -+#define __duplocale(a)              __c_locale()
 272.124 -+#endif
 272.125 -+
 272.126 -+namespace std 
 272.127 -+{
 272.128 -+  template<>
 272.129 -+    void
 272.130 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 272.131 -+		   const __c_locale& __cloc)
 272.132 -+    {
 272.133 -+      if (!(__err & ios_base::failbit))
 272.134 -+	{
 272.135 -+	  char* __sanity;
 272.136 -+	  errno = 0;
 272.137 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
 272.138 -+          if (__sanity != __s && errno != ERANGE)
 272.139 -+	    __v = __f;
 272.140 -+	  else
 272.141 -+	    __err |= ios_base::failbit;
 272.142 -+	}
 272.143 -+    }
 272.144 -+
 272.145 -+  template<>
 272.146 -+    void
 272.147 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 272.148 -+		   const __c_locale& __cloc)
 272.149 -+    {
 272.150 -+      if (!(__err & ios_base::failbit))
 272.151 -+	{
 272.152 -+	  char* __sanity;
 272.153 -+	  errno = 0;
 272.154 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
 272.155 -+          if (__sanity != __s && errno != ERANGE)
 272.156 -+	    __v = __d;
 272.157 -+	  else
 272.158 -+	    __err |= ios_base::failbit;
 272.159 -+	}
 272.160 -+    }
 272.161 -+
 272.162 -+  template<>
 272.163 -+    void
 272.164 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 272.165 -+		   const __c_locale& __cloc)
 272.166 -+    {
 272.167 -+      if (!(__err & ios_base::failbit))
 272.168 -+	{
 272.169 -+	  char* __sanity;
 272.170 -+	  errno = 0;
 272.171 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 272.172 -+          if (__sanity != __s && errno != ERANGE)
 272.173 -+	    __v = __ld;
 272.174 -+	  else
 272.175 -+	    __err |= ios_base::failbit;
 272.176 -+	}
 272.177 -+    }
 272.178 -+
 272.179 -+  void
 272.180 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 272.181 -+				    __c_locale __old)
 272.182 -+  {
 272.183 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 272.184 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.185 -+    if (!__cloc)
 272.186 -+      {
 272.187 -+	// This named locale is not supported by the underlying OS.
 272.188 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 272.189 -+			      "name not valid"));
 272.190 -+      }
 272.191 -+#endif
 272.192 -+  }
 272.193 -+  
 272.194 -+  void
 272.195 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 272.196 -+  {
 272.197 -+    if (_S_get_c_locale() != __cloc)
 272.198 -+      __freelocale(__cloc); 
 272.199 -+  }
 272.200 -+
 272.201 -+  __c_locale
 272.202 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 272.203 -+  { return __duplocale(__cloc); }
 272.204 -+} // namespace std
 272.205 -+
 272.206 -+namespace __gnu_cxx
 272.207 -+{
 272.208 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 272.209 -+    {
 272.210 -+      "LC_CTYPE", 
 272.211 -+      "LC_NUMERIC",
 272.212 -+      "LC_TIME", 
 272.213 -+      "LC_COLLATE", 
 272.214 -+      "LC_MONETARY",
 272.215 -+      "LC_MESSAGES", 
 272.216 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 272.217 -+      "LC_PAPER", 
 272.218 -+      "LC_NAME", 
 272.219 -+      "LC_ADDRESS",
 272.220 -+      "LC_TELEPHONE", 
 272.221 -+      "LC_MEASUREMENT", 
 272.222 -+      "LC_IDENTIFICATION" 
 272.223 -+#endif
 272.224 -+    };
 272.225 -+}
 272.226 -+
 272.227 -+namespace std
 272.228 -+{
 272.229 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 272.230 -+}  // namespace std
 272.231 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
 272.232 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 272.233 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
 272.234 -@@ -0,0 +1,117 @@
 272.235 -+// Wrapper for underlying C-language localization -*- C++ -*-
 272.236 -+
 272.237 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 272.238 -+//
 272.239 -+// This file is part of the GNU ISO C++ Library.  This library is free
 272.240 -+// software; you can redistribute it and/or modify it under the
 272.241 -+// terms of the GNU General Public License as published by the
 272.242 -+// Free Software Foundation; either version 2, or (at your option)
 272.243 -+// any later version.
 272.244 -+
 272.245 -+// This library is distributed in the hope that it will be useful,
 272.246 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 272.247 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 272.248 -+// GNU General Public License for more details.
 272.249 -+
 272.250 -+// You should have received a copy of the GNU General Public License along
 272.251 -+// with this library; see the file COPYING.  If not, write to the Free
 272.252 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 272.253 -+// USA.
 272.254 -+
 272.255 -+// As a special exception, you may use this file as part of a free software
 272.256 -+// library without restriction.  Specifically, if other files instantiate
 272.257 -+// templates or use macros or inline functions from this file, or you compile
 272.258 -+// this file and link it with other files to produce an executable, this
 272.259 -+// file does not by itself cause the resulting executable to be covered by
 272.260 -+// the GNU General Public License.  This exception does not however
 272.261 -+// invalidate any other reasons why the executable file might be covered by
 272.262 -+// the GNU General Public License.
 272.263 -+
 272.264 -+//
 272.265 -+// ISO C++ 14882: 22.8  Standard locale categories.
 272.266 -+//
 272.267 -+
 272.268 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 272.269 -+
 272.270 -+#ifndef _C_LOCALE_H
 272.271 -+#define _C_LOCALE_H 1
 272.272 -+
 272.273 -+#pragma GCC system_header
 272.274 -+
 272.275 -+#include <cstring>              // get std::strlen
 272.276 -+#include <cstdio>               // get std::snprintf or std::sprintf
 272.277 -+#include <clocale>
 272.278 -+#include <langinfo.h>		// For codecvt
 272.279 -+#ifdef __UCLIBC_MJN3_ONLY__
 272.280 -+#warning fix this
 272.281 -+#endif
 272.282 -+#ifdef __UCLIBC_HAS_LOCALE__
 272.283 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 272.284 -+#endif
 272.285 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 272.286 -+#include <libintl.h> 		// For messages
 272.287 -+#endif
 272.288 -+
 272.289 -+#ifdef __UCLIBC_MJN3_ONLY__
 272.290 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 272.291 -+#endif
 272.292 -+#define _GLIBCXX_C_LOCALE_GNU 1
 272.293 -+
 272.294 -+#ifdef __UCLIBC_MJN3_ONLY__
 272.295 -+#warning fix categories
 272.296 -+#endif
 272.297 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 272.298 -+#define _GLIBCXX_NUM_CATEGORIES 0
 272.299 -+ 
 272.300 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.301 -+namespace __gnu_cxx
 272.302 -+{
 272.303 -+  extern "C" __typeof(uselocale) __uselocale;
 272.304 -+}
 272.305 -+#endif
 272.306 -+
 272.307 -+namespace std
 272.308 -+{
 272.309 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.310 -+  typedef __locale_t		__c_locale;
 272.311 -+#else
 272.312 -+  typedef int*			__c_locale;
 272.313 -+#endif
 272.314 -+
 272.315 -+  // Convert numeric value of type _Tv to string and return length of
 272.316 -+  // string.  If snprintf is available use it, otherwise fall back to
 272.317 -+  // the unsafe sprintf which, in general, can be dangerous and should
 272.318 -+  // be avoided.
 272.319 -+  template<typename _Tv>
 272.320 -+    int
 272.321 -+    __convert_from_v(char* __out, 
 272.322 -+		     const int __size __attribute__ ((__unused__)),
 272.323 -+		     const char* __fmt,
 272.324 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 272.325 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 272.326 -+    {
 272.327 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 272.328 -+#else
 272.329 -+		     _Tv __v, const __c_locale&, int __prec)
 272.330 -+    {
 272.331 -+# ifdef __UCLIBC_HAS_LOCALE__
 272.332 -+      char* __old = std::setlocale(LC_ALL, NULL);
 272.333 -+      char* __sav = new char[std::strlen(__old) + 1];
 272.334 -+      std::strcpy(__sav, __old);
 272.335 -+      std::setlocale(LC_ALL, "C");
 272.336 -+# endif
 272.337 -+#endif
 272.338 -+
 272.339 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 272.340 -+
 272.341 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 272.342 -+      __gnu_cxx::__uselocale(__old);
 272.343 -+#elif defined __UCLIBC_HAS_LOCALE__
 272.344 -+      std::setlocale(LC_ALL, __sav);
 272.345 -+      delete [] __sav;
 272.346 -+#endif
 272.347 -+      return __ret;
 272.348 -+    }
 272.349 -+}
 272.350 -+
 272.351 -+#endif
 272.352 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
 272.353 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
 272.354 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
 272.355 -@@ -0,0 +1,63 @@
 272.356 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
 272.357 -+
 272.358 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
 272.359 -+//
 272.360 -+// This file is part of the GNU ISO C++ Library.  This library is free
 272.361 -+// software; you can redistribute it and/or modify it under the
 272.362 -+// terms of the GNU General Public License as published by the
 272.363 -+// Free Software Foundation; either version 2, or (at your option)
 272.364 -+// any later version.
 272.365 -+
 272.366 -+// This library is distributed in the hope that it will be useful,
 272.367 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 272.368 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 272.369 -+// GNU General Public License for more details.
 272.370 -+
 272.371 -+// You should have received a copy of the GNU General Public License along
 272.372 -+// with this library; see the file COPYING.  If not, write to the Free
 272.373 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 272.374 -+// USA.
 272.375 -+
 272.376 -+// As a special exception, you may use this file as part of a free software
 272.377 -+// library without restriction.  Specifically, if other files instantiate
 272.378 -+// templates or use macros or inline functions from this file, or you compile
 272.379 -+// this file and link it with other files to produce an executable, this
 272.380 -+// file does not by itself cause the resulting executable to be covered by
 272.381 -+// the GNU General Public License.  This exception does not however
 272.382 -+// invalidate any other reasons why the executable file might be covered by
 272.383 -+// the GNU General Public License.
 272.384 -+
 272.385 -+// Written by Jakub Jelinek <jakub@redhat.com>
 272.386 -+
 272.387 -+#include <bits/c++config.h>
 272.388 -+#include <clocale>
 272.389 -+
 272.390 -+#ifdef __UCLIBC_MJN3_ONLY__
 272.391 -+#warning clean this up
 272.392 -+#endif
 272.393 -+
 272.394 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.395 -+                                                  
 272.396 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 272.397 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 272.398 -+extern "C" __typeof(strftime_l) __strftime_l;
 272.399 -+extern "C" __typeof(strtod_l) __strtod_l;
 272.400 -+extern "C" __typeof(strtof_l) __strtof_l;
 272.401 -+extern "C" __typeof(strtold_l) __strtold_l;
 272.402 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 272.403 -+extern "C" __typeof(newlocale) __newlocale;
 272.404 -+extern "C" __typeof(freelocale) __freelocale;
 272.405 -+extern "C" __typeof(duplocale) __duplocale;
 272.406 -+extern "C" __typeof(uselocale) __uselocale;
 272.407 -+
 272.408 -+#ifdef _GLIBCXX_USE_WCHAR_T
 272.409 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 272.410 -+extern "C" __typeof(towlower_l) __towlower_l;
 272.411 -+extern "C" __typeof(towupper_l) __towupper_l;
 272.412 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 272.413 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 272.414 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 272.415 -+extern "C" __typeof(wctype_l) __wctype_l;
 272.416 -+#endif 
 272.417 -+
 272.418 -+#endif // GLIBC 2.3 and later
 272.419 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 272.420 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 272.421 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-08-03 20:30:21.000000000 +0200
 272.422 -@@ -0,0 +1,306 @@
 272.423 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 272.424 -+
 272.425 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 272.426 -+//
 272.427 -+// This file is part of the GNU ISO C++ Library.  This library is free
 272.428 -+// software; you can redistribute it and/or modify it under the
 272.429 -+// terms of the GNU General Public License as published by the
 272.430 -+// Free Software Foundation; either version 2, or (at your option)
 272.431 -+// any later version.
 272.432 -+
 272.433 -+// This library is distributed in the hope that it will be useful,
 272.434 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 272.435 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 272.436 -+// GNU General Public License for more details.
 272.437 -+
 272.438 -+// You should have received a copy of the GNU General Public License along
 272.439 -+// with this library; see the file COPYING.  If not, write to the Free
 272.440 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 272.441 -+// USA.
 272.442 -+
 272.443 -+// As a special exception, you may use this file as part of a free software
 272.444 -+// library without restriction.  Specifically, if other files instantiate
 272.445 -+// templates or use macros or inline functions from this file, or you compile
 272.446 -+// this file and link it with other files to produce an executable, this
 272.447 -+// file does not by itself cause the resulting executable to be covered by
 272.448 -+// the GNU General Public License.  This exception does not however
 272.449 -+// invalidate any other reasons why the executable file might be covered by
 272.450 -+// the GNU General Public License.
 272.451 -+
 272.452 -+//
 272.453 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 272.454 -+//
 272.455 -+
 272.456 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 272.457 -+
 272.458 -+#include <locale>
 272.459 -+#include <bits/c++locale_internal.h>
 272.460 -+
 272.461 -+namespace std
 272.462 -+{
 272.463 -+  // Specializations.
 272.464 -+#ifdef _GLIBCXX_USE_WCHAR_T
 272.465 -+  codecvt_base::result
 272.466 -+  codecvt<wchar_t, char, mbstate_t>::
 272.467 -+  do_out(state_type& __state, const intern_type* __from, 
 272.468 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 272.469 -+	 extern_type* __to, extern_type* __to_end,
 272.470 -+	 extern_type*& __to_next) const
 272.471 -+  {
 272.472 -+    result __ret = ok;
 272.473 -+    state_type __tmp_state(__state);
 272.474 -+
 272.475 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.476 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 272.477 -+#endif
 272.478 -+
 272.479 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 272.480 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 272.481 -+    // NB: wcsnrtombs is a GNU extension
 272.482 -+    for (__from_next = __from, __to_next = __to;
 272.483 -+	 __from_next < __from_end && __to_next < __to_end
 272.484 -+	 && __ret == ok;)
 272.485 -+      {
 272.486 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 272.487 -+						      __from_end - __from_next);
 272.488 -+	if (!__from_chunk_end)
 272.489 -+	  __from_chunk_end = __from_end;
 272.490 -+
 272.491 -+	__from = __from_next;
 272.492 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 272.493 -+					 __from_chunk_end - __from_next,
 272.494 -+					 __to_end - __to_next, &__state);
 272.495 -+	if (__conv == static_cast<size_t>(-1))
 272.496 -+	  {
 272.497 -+	    // In case of error, in order to stop at the exact place we
 272.498 -+	    // have to start again from the beginning with a series of
 272.499 -+	    // wcrtomb.
 272.500 -+	    for (; __from < __from_next; ++__from)
 272.501 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 272.502 -+	    __state = __tmp_state;
 272.503 -+	    __ret = error;
 272.504 -+	  }
 272.505 -+	else if (__from_next && __from_next < __from_chunk_end)
 272.506 -+	  {
 272.507 -+	    __to_next += __conv;
 272.508 -+	    __ret = partial;
 272.509 -+	  }
 272.510 -+	else
 272.511 -+	  {
 272.512 -+	    __from_next = __from_chunk_end;
 272.513 -+	    __to_next += __conv;
 272.514 -+	  }
 272.515 -+
 272.516 -+	if (__from_next < __from_end && __ret == ok)
 272.517 -+	  {
 272.518 -+	    extern_type __buf[MB_LEN_MAX];
 272.519 -+	    __tmp_state = __state;
 272.520 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 272.521 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 272.522 -+	      __ret = partial;
 272.523 -+	    else
 272.524 -+	      {
 272.525 -+		memcpy(__to_next, __buf, __conv);
 272.526 -+		__state = __tmp_state;
 272.527 -+		__to_next += __conv;
 272.528 -+		++__from_next;
 272.529 -+	      }
 272.530 -+	  }
 272.531 -+      }
 272.532 -+
 272.533 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.534 -+    __uselocale(__old);
 272.535 -+#endif
 272.536 -+
 272.537 -+    return __ret; 
 272.538 -+  }
 272.539 -+  
 272.540 -+  codecvt_base::result
 272.541 -+  codecvt<wchar_t, char, mbstate_t>::
 272.542 -+  do_in(state_type& __state, const extern_type* __from, 
 272.543 -+	const extern_type* __from_end, const extern_type*& __from_next,
 272.544 -+	intern_type* __to, intern_type* __to_end,
 272.545 -+	intern_type*& __to_next) const
 272.546 -+  {
 272.547 -+    result __ret = ok;
 272.548 -+    state_type __tmp_state(__state);
 272.549 -+
 272.550 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.551 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 272.552 -+#endif
 272.553 -+
 272.554 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 272.555 -+    // in case we store a L'\0' and then continue, in a loop.
 272.556 -+    // NB: mbsnrtowcs is a GNU extension
 272.557 -+    for (__from_next = __from, __to_next = __to;
 272.558 -+	 __from_next < __from_end && __to_next < __to_end
 272.559 -+	 && __ret == ok;)
 272.560 -+      {
 272.561 -+	const extern_type* __from_chunk_end;
 272.562 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 272.563 -+								  __from_end
 272.564 -+								  - __from_next));
 272.565 -+	if (!__from_chunk_end)
 272.566 -+	  __from_chunk_end = __from_end;
 272.567 -+
 272.568 -+	__from = __from_next;
 272.569 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 272.570 -+				   __from_chunk_end - __from_next,
 272.571 -+				   __to_end - __to_next, &__state);
 272.572 -+	if (__conv == static_cast<size_t>(-1))
 272.573 -+	  {
 272.574 -+	    // In case of error, in order to stop at the exact place we
 272.575 -+	    // have to start again from the beginning with a series of
 272.576 -+	    // mbrtowc.
 272.577 -+	    for (;; ++__to_next, __from += __conv)
 272.578 -+	      {
 272.579 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 272.580 -+				 &__tmp_state);
 272.581 -+		if (__conv == static_cast<size_t>(-1)
 272.582 -+		    || __conv == static_cast<size_t>(-2))
 272.583 -+		  break;
 272.584 -+	      }
 272.585 -+	    __from_next = __from;
 272.586 -+	    __state = __tmp_state;	    
 272.587 -+	    __ret = error;
 272.588 -+	  }
 272.589 -+	else if (__from_next && __from_next < __from_chunk_end)
 272.590 -+	  {
 272.591 -+	    // It is unclear what to return in this case (see DR 382). 
 272.592 -+	    __to_next += __conv;
 272.593 -+	    __ret = partial;
 272.594 -+	  }
 272.595 -+	else
 272.596 -+	  {
 272.597 -+	    __from_next = __from_chunk_end;
 272.598 -+	    __to_next += __conv;
 272.599 -+	  }
 272.600 -+
 272.601 -+	if (__from_next < __from_end && __ret == ok)
 272.602 -+	  {
 272.603 -+	    if (__to_next < __to_end)
 272.604 -+	      {
 272.605 -+		// XXX Probably wrong for stateful encodings
 272.606 -+		__tmp_state = __state;		
 272.607 -+		++__from_next;
 272.608 -+		*__to_next++ = L'\0';
 272.609 -+	      }
 272.610 -+	    else
 272.611 -+	      __ret = partial;
 272.612 -+	  }
 272.613 -+      }
 272.614 -+
 272.615 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.616 -+    __uselocale(__old);
 272.617 -+#endif
 272.618 -+
 272.619 -+    return __ret; 
 272.620 -+  }
 272.621 -+
 272.622 -+  int 
 272.623 -+  codecvt<wchar_t, char, mbstate_t>::
 272.624 -+  do_encoding() const throw()
 272.625 -+  {
 272.626 -+    // XXX This implementation assumes that the encoding is
 272.627 -+    // stateless and is either single-byte or variable-width.
 272.628 -+    int __ret = 0;
 272.629 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.630 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 272.631 -+#endif
 272.632 -+    if (MB_CUR_MAX == 1)
 272.633 -+      __ret = 1;
 272.634 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.635 -+    __uselocale(__old);
 272.636 -+#endif
 272.637 -+    return __ret;
 272.638 -+  }  
 272.639 -+
 272.640 -+  int 
 272.641 -+  codecvt<wchar_t, char, mbstate_t>::
 272.642 -+  do_max_length() const throw()
 272.643 -+  {
 272.644 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.645 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 272.646 -+#endif
 272.647 -+    // XXX Probably wrong for stateful encodings.
 272.648 -+    int __ret = MB_CUR_MAX;
 272.649 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.650 -+    __uselocale(__old);
 272.651 -+#endif
 272.652 -+    return __ret;
 272.653 -+  }
 272.654 -+  
 272.655 -+  int 
 272.656 -+  codecvt<wchar_t, char, mbstate_t>::
 272.657 -+  do_length(state_type& __state, const extern_type* __from,
 272.658 -+	    const extern_type* __end, size_t __max) const
 272.659 -+  {
 272.660 -+    int __ret = 0;
 272.661 -+    state_type __tmp_state(__state);
 272.662 -+
 272.663 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.664 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 272.665 -+#endif
 272.666 -+
 272.667 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 272.668 -+    // in case we advance past it and then continue, in a loop.
 272.669 -+    // NB: mbsnrtowcs is a GNU extension
 272.670 -+  
 272.671 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 272.672 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 272.673 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 272.674 -+							   * __max));
 272.675 -+    while (__from < __end && __max)
 272.676 -+      {
 272.677 -+	const extern_type* __from_chunk_end;
 272.678 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 272.679 -+								  __end
 272.680 -+								  - __from));
 272.681 -+	if (!__from_chunk_end)
 272.682 -+	  __from_chunk_end = __end;
 272.683 -+
 272.684 -+	const extern_type* __tmp_from = __from;
 272.685 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 272.686 -+				   __from_chunk_end - __from,
 272.687 -+				   __max, &__state);
 272.688 -+	if (__conv == static_cast<size_t>(-1))
 272.689 -+	  {
 272.690 -+	    // In case of error, in order to stop at the exact place we
 272.691 -+	    // have to start again from the beginning with a series of
 272.692 -+	    // mbrtowc.
 272.693 -+	    for (__from = __tmp_from;; __from += __conv)
 272.694 -+	      {
 272.695 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 272.696 -+				 &__tmp_state);
 272.697 -+		if (__conv == static_cast<size_t>(-1)
 272.698 -+		    || __conv == static_cast<size_t>(-2))
 272.699 -+		  break;
 272.700 -+	      }
 272.701 -+	    __state = __tmp_state;
 272.702 -+	    __ret += __from - __tmp_from;
 272.703 -+	    break;
 272.704 -+	  }
 272.705 -+	if (!__from)
 272.706 -+	  __from = __from_chunk_end;
 272.707 -+	
 272.708 -+	__ret += __from - __tmp_from;
 272.709 -+	__max -= __conv;
 272.710 -+
 272.711 -+	if (__from < __end && __max)
 272.712 -+	  {
 272.713 -+	    // XXX Probably wrong for stateful encodings
 272.714 -+	    __tmp_state = __state;
 272.715 -+	    ++__from;
 272.716 -+	    ++__ret;
 272.717 -+	    --__max;
 272.718 -+	  }
 272.719 -+      }
 272.720 -+
 272.721 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.722 -+    __uselocale(__old);
 272.723 -+#endif
 272.724 -+
 272.725 -+    return __ret; 
 272.726 -+  }
 272.727 -+#endif
 272.728 -+}
 272.729 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
 272.730 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 272.731 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
 272.732 -@@ -0,0 +1,80 @@
 272.733 -+// std::collate implementation details, GNU version -*- C++ -*-
 272.734 -+
 272.735 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 272.736 -+//
 272.737 -+// This file is part of the GNU ISO C++ Library.  This library is free
 272.738 -+// software; you can redistribute it and/or modify it under the
 272.739 -+// terms of the GNU General Public License as published by the
 272.740 -+// Free Software Foundation; either version 2, or (at your option)
 272.741 -+// any later version.
 272.742 -+
 272.743 -+// This library is distributed in the hope that it will be useful,
 272.744 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 272.745 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 272.746 -+// GNU General Public License for more details.
 272.747 -+
 272.748 -+// You should have received a copy of the GNU General Public License along
 272.749 -+// with this library; see the file COPYING.  If not, write to the Free
 272.750 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 272.751 -+// USA.
 272.752 -+
 272.753 -+// As a special exception, you may use this file as part of a free software
 272.754 -+// library without restriction.  Specifically, if other files instantiate
 272.755 -+// templates or use macros or inline functions from this file, or you compile
 272.756 -+// this file and link it with other files to produce an executable, this
 272.757 -+// file does not by itself cause the resulting executable to be covered by
 272.758 -+// the GNU General Public License.  This exception does not however
 272.759 -+// invalidate any other reasons why the executable file might be covered by
 272.760 -+// the GNU General Public License.
 272.761 -+
 272.762 -+//
 272.763 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 272.764 -+//
 272.765 -+
 272.766 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 272.767 -+
 272.768 -+#include <locale>
 272.769 -+#include <bits/c++locale_internal.h>
 272.770 -+
 272.771 -+#ifndef __UCLIBC_HAS_XLOCALE__
 272.772 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 272.773 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 272.774 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 272.775 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 272.776 -+#endif
 272.777 -+
 272.778 -+namespace std
 272.779 -+{
 272.780 -+  // These are basically extensions to char_traits, and perhaps should
 272.781 -+  // be put there instead of here.
 272.782 -+  template<>
 272.783 -+    int 
 272.784 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 272.785 -+    { 
 272.786 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 272.787 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 272.788 -+    }
 272.789 -+  
 272.790 -+  template<>
 272.791 -+    size_t
 272.792 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 272.793 -+				size_t __n) const 
 272.794 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 272.795 -+
 272.796 -+#ifdef _GLIBCXX_USE_WCHAR_T
 272.797 -+  template<>
 272.798 -+    int 
 272.799 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 272.800 -+				 const wchar_t* __two) const
 272.801 -+    {
 272.802 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 272.803 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 272.804 -+    }
 272.805 -+  
 272.806 -+  template<>
 272.807 -+    size_t
 272.808 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 272.809 -+				   size_t __n) const
 272.810 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 272.811 -+#endif
 272.812 -+}
 272.813 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 272.814 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 272.815 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 272.816 -@@ -0,0 +1,300 @@
 272.817 -+// std::ctype implementation details, GNU version -*- C++ -*-
 272.818 -+
 272.819 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 272.820 -+//
 272.821 -+// This file is part of the GNU ISO C++ Library.  This library is free
 272.822 -+// software; you can redistribute it and/or modify it under the
 272.823 -+// terms of the GNU General Public License as published by the
 272.824 -+// Free Software Foundation; either version 2, or (at your option)
 272.825 -+// any later version.
 272.826 -+
 272.827 -+// This library is distributed in the hope that it will be useful,
 272.828 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 272.829 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 272.830 -+// GNU General Public License for more details.
 272.831 -+
 272.832 -+// You should have received a copy of the GNU General Public License along
 272.833 -+// with this library; see the file COPYING.  If not, write to the Free
 272.834 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 272.835 -+// USA.
 272.836 -+
 272.837 -+// As a special exception, you may use this file as part of a free software
 272.838 -+// library without restriction.  Specifically, if other files instantiate
 272.839 -+// templates or use macros or inline functions from this file, or you compile
 272.840 -+// this file and link it with other files to produce an executable, this
 272.841 -+// file does not by itself cause the resulting executable to be covered by
 272.842 -+// the GNU General Public License.  This exception does not however
 272.843 -+// invalidate any other reasons why the executable file might be covered by
 272.844 -+// the GNU General Public License.
 272.845 -+
 272.846 -+//
 272.847 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 272.848 -+//
 272.849 -+
 272.850 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 272.851 -+
 272.852 -+#define _LIBC
 272.853 -+#include <locale>
 272.854 -+#undef _LIBC
 272.855 -+#include <bits/c++locale_internal.h>
 272.856 -+
 272.857 -+#ifndef __UCLIBC_HAS_XLOCALE__
 272.858 -+#define __wctype_l(S, L)           wctype((S))
 272.859 -+#define __towupper_l(C, L)         towupper((C))
 272.860 -+#define __towlower_l(C, L)         towlower((C))
 272.861 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 272.862 -+#endif
 272.863 -+
 272.864 -+namespace std
 272.865 -+{
 272.866 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 272.867 -+  // various /config/os/* files.
 272.868 -+  template<>
 272.869 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 272.870 -+    : ctype<char>(0, false, __refs) 
 272.871 -+    { 		
 272.872 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 272.873 -+	{
 272.874 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 272.875 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 272.876 -+#ifdef __UCLIBC_HAS_XLOCALE__
 272.877 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 272.878 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 272.879 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 272.880 -+#endif
 272.881 -+	}
 272.882 -+    }
 272.883 -+
 272.884 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 272.885 -+  ctype<wchar_t>::__wmask_type
 272.886 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 272.887 -+  {
 272.888 -+    __wmask_type __ret;
 272.889 -+    switch (__m)
 272.890 -+      {
 272.891 -+      case space:
 272.892 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 272.893 -+	break;
 272.894 -+      case print:
 272.895 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 272.896 -+	break;
 272.897 -+      case cntrl:
 272.898 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 272.899 -+	break;
 272.900 -+      case upper:
 272.901 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 272.902 -+	break;
 272.903 -+      case lower:
 272.904 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 272.905 -+	break;
 272.906 -+      case alpha:
 272.907 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 272.908 -+	break;
 272.909 -+      case digit:
 272.910 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 272.911 -+	break;
 272.912 -+      case punct:
 272.913 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 272.914 -+	break;
 272.915 -+      case xdigit:
 272.916 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 272.917 -+	break;
 272.918 -+      case alnum:
 272.919 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 272.920 -+	break;
 272.921 -+      case graph:
 272.922 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 272.923 -+	break;
 272.924 -+      default:
 272.925 -+	__ret = __wmask_type();
 272.926 -+      }
 272.927 -+    return __ret;
 272.928 -+  }
 272.929 -+  
 272.930 -+  wchar_t
 272.931 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 272.932 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 272.933 -+
 272.934 -+  const wchar_t*
 272.935 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 272.936 -+  {
 272.937 -+    while (__lo < __hi)
 272.938 -+      {
 272.939 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 272.940 -+        ++__lo;
 272.941 -+      }
 272.942 -+    return __hi;
 272.943 -+  }
 272.944 -+  
 272.945 -+  wchar_t
 272.946 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 272.947 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 272.948 -+  
 272.949 -+  const wchar_t*
 272.950 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 272.951 -+  {
 272.952 -+    while (__lo < __hi)
 272.953 -+      {
 272.954 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 272.955 -+        ++__lo;
 272.956 -+      }
 272.957 -+    return __hi;
 272.958 -+  }
 272.959 -+
 272.960 -+  bool
 272.961 -+  ctype<wchar_t>::
 272.962 -+  do_is(mask __m, wchar_t __c) const
 272.963 -+  { 
 272.964 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
 272.965 -+    // library for blank.
 272.966 -+    bool __ret = false;
 272.967 -+    const size_t __bitmasksize = 11; 
 272.968 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 272.969 -+      if (__m & _M_bit[__bitcur]
 272.970 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 272.971 -+	{
 272.972 -+	  __ret = true;
 272.973 -+	  break;
 272.974 -+	}
 272.975 -+    return __ret;    
 272.976 -+  }
 272.977 -+  
 272.978 -+  const wchar_t* 
 272.979 -+  ctype<wchar_t>::
 272.980 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 272.981 -+  {
 272.982 -+    for (; __lo < __hi; ++__vec, ++__lo)
 272.983 -+      {
 272.984 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 272.985 -+	// library for blank.
 272.986 -+	const size_t __bitmasksize = 11; 
 272.987 -+	mask __m = 0;
 272.988 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 272.989 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 272.990 -+	    __m |= _M_bit[__bitcur];
 272.991 -+	*__vec = __m;
 272.992 -+      }
 272.993 -+    return __hi;
 272.994 -+  }
 272.995 -+  
 272.996 -+  const wchar_t* 
 272.997 -+  ctype<wchar_t>::
 272.998 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 272.999 -+  {
272.1000 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
272.1001 -+      ++__lo;
272.1002 -+    return __lo;
272.1003 -+  }
272.1004 -+
272.1005 -+  const wchar_t*
272.1006 -+  ctype<wchar_t>::
272.1007 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
272.1008 -+  {
272.1009 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
272.1010 -+      ++__lo;
272.1011 -+    return __lo;
272.1012 -+  }
272.1013 -+
272.1014 -+  wchar_t
272.1015 -+  ctype<wchar_t>::
272.1016 -+  do_widen(char __c) const
272.1017 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
272.1018 -+
272.1019 -+  const char* 
272.1020 -+  ctype<wchar_t>::
272.1021 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
272.1022 -+  {
272.1023 -+    while (__lo < __hi)
272.1024 -+      {
272.1025 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
272.1026 -+	++__lo;
272.1027 -+	++__dest;
272.1028 -+      }
272.1029 -+    return __hi;
272.1030 -+  }
272.1031 -+
272.1032 -+  char
272.1033 -+  ctype<wchar_t>::
272.1034 -+  do_narrow(wchar_t __wc, char __dfault) const
272.1035 -+  {
272.1036 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
272.1037 -+      return _M_narrow[__wc];
272.1038 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1039 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
272.1040 -+#endif
272.1041 -+    const int __c = wctob(__wc);
272.1042 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1043 -+    __uselocale(__old);
272.1044 -+#endif
272.1045 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
272.1046 -+  }
272.1047 -+
272.1048 -+  const wchar_t*
272.1049 -+  ctype<wchar_t>::
272.1050 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
272.1051 -+	    char* __dest) const
272.1052 -+  {
272.1053 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1054 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
272.1055 -+#endif
272.1056 -+    if (_M_narrow_ok)
272.1057 -+      while (__lo < __hi)
272.1058 -+	{
272.1059 -+	  if (*__lo >= 0 && *__lo < 128)
272.1060 -+	    *__dest = _M_narrow[*__lo];
272.1061 -+	  else
272.1062 -+	    {
272.1063 -+	      const int __c = wctob(*__lo);
272.1064 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
272.1065 -+	    }
272.1066 -+	  ++__lo;
272.1067 -+	  ++__dest;
272.1068 -+	}
272.1069 -+    else
272.1070 -+      while (__lo < __hi)
272.1071 -+	{
272.1072 -+	  const int __c = wctob(*__lo);
272.1073 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
272.1074 -+	  ++__lo;
272.1075 -+	  ++__dest;
272.1076 -+	}
272.1077 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1078 -+    __uselocale(__old);
272.1079 -+#endif
272.1080 -+    return __hi;
272.1081 -+  }
272.1082 -+
272.1083 -+  void
272.1084 -+  ctype<wchar_t>::_M_initialize_ctype()
272.1085 -+  {
272.1086 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1087 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
272.1088 -+#endif
272.1089 -+    wint_t __i;
272.1090 -+    for (__i = 0; __i < 128; ++__i)
272.1091 -+      {
272.1092 -+	const int __c = wctob(__i);
272.1093 -+	if (__c == EOF)
272.1094 -+	  break;
272.1095 -+	else
272.1096 -+	  _M_narrow[__i] = static_cast<char>(__c);
272.1097 -+      }
272.1098 -+    if (__i == 128)
272.1099 -+      _M_narrow_ok = true;
272.1100 -+    else
272.1101 -+      _M_narrow_ok = false;
272.1102 -+    for (size_t __j = 0;
272.1103 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
272.1104 -+      _M_widen[__j] = btowc(__j);
272.1105 -+
272.1106 -+    for (size_t __k = 0; __k <= 11; ++__k)
272.1107 -+      { 
272.1108 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
272.1109 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
272.1110 -+      }
272.1111 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1112 -+    __uselocale(__old);
272.1113 -+#endif
272.1114 -+  }
272.1115 -+#endif //  _GLIBCXX_USE_WCHAR_T
272.1116 -+}
272.1117 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
272.1118 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
272.1119 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
272.1120 -@@ -0,0 +1,100 @@
272.1121 -+// std::messages implementation details, GNU version -*- C++ -*-
272.1122 -+
272.1123 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
272.1124 -+//
272.1125 -+// This file is part of the GNU ISO C++ Library.  This library is free
272.1126 -+// software; you can redistribute it and/or modify it under the
272.1127 -+// terms of the GNU General Public License as published by the
272.1128 -+// Free Software Foundation; either version 2, or (at your option)
272.1129 -+// any later version.
272.1130 -+
272.1131 -+// This library is distributed in the hope that it will be useful,
272.1132 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
272.1133 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
272.1134 -+// GNU General Public License for more details.
272.1135 -+
272.1136 -+// You should have received a copy of the GNU General Public License along
272.1137 -+// with this library; see the file COPYING.  If not, write to the Free
272.1138 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
272.1139 -+// USA.
272.1140 -+
272.1141 -+// As a special exception, you may use this file as part of a free software
272.1142 -+// library without restriction.  Specifically, if other files instantiate
272.1143 -+// templates or use macros or inline functions from this file, or you compile
272.1144 -+// this file and link it with other files to produce an executable, this
272.1145 -+// file does not by itself cause the resulting executable to be covered by
272.1146 -+// the GNU General Public License.  This exception does not however
272.1147 -+// invalidate any other reasons why the executable file might be covered by
272.1148 -+// the GNU General Public License.
272.1149 -+
272.1150 -+//
272.1151 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
272.1152 -+//
272.1153 -+
272.1154 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
272.1155 -+
272.1156 -+#include <locale>
272.1157 -+#include <bits/c++locale_internal.h>
272.1158 -+
272.1159 -+#ifdef __UCLIBC_MJN3_ONLY__
272.1160 -+#warning fix gettext stuff
272.1161 -+#endif
272.1162 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
272.1163 -+extern "C" char *__dcgettext(const char *domainname,
272.1164 -+			     const char *msgid, int category);
272.1165 -+#undef gettext
272.1166 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
272.1167 -+#else
272.1168 -+#undef gettext
272.1169 -+#define gettext(msgid) (msgid)
272.1170 -+#endif
272.1171 -+
272.1172 -+namespace std
272.1173 -+{
272.1174 -+  // Specializations.
272.1175 -+  template<>
272.1176 -+    string
272.1177 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
272.1178 -+    {
272.1179 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1180 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
272.1181 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
272.1182 -+      __uselocale(__old);
272.1183 -+      return string(__msg);
272.1184 -+#elif defined __UCLIBC_HAS_LOCALE__
272.1185 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
272.1186 -+      setlocale(LC_ALL, _M_name_messages);
272.1187 -+      const char* __msg = gettext(__dfault.c_str());
272.1188 -+      setlocale(LC_ALL, __old);
272.1189 -+      free(__old);
272.1190 -+      return string(__msg);
272.1191 -+#else
272.1192 -+      const char* __msg = gettext(__dfault.c_str());
272.1193 -+      return string(__msg);
272.1194 -+#endif
272.1195 -+    }
272.1196 -+
272.1197 -+#ifdef _GLIBCXX_USE_WCHAR_T
272.1198 -+  template<>
272.1199 -+    wstring
272.1200 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
272.1201 -+    {
272.1202 -+# ifdef __UCLIBC_HAS_XLOCALE__
272.1203 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
272.1204 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
272.1205 -+      __uselocale(__old);
272.1206 -+      return _M_convert_from_char(__msg);
272.1207 -+# elif defined __UCLIBC_HAS_LOCALE__
272.1208 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
272.1209 -+      setlocale(LC_ALL, _M_name_messages);
272.1210 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
272.1211 -+      setlocale(LC_ALL, __old);
272.1212 -+      free(__old);
272.1213 -+      return _M_convert_from_char(__msg);
272.1214 -+# else
272.1215 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
272.1216 -+      return _M_convert_from_char(__msg);
272.1217 -+# endif
272.1218 -+    }
272.1219 -+#endif
272.1220 -+}
272.1221 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
272.1222 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
272.1223 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
272.1224 -@@ -0,0 +1,118 @@
272.1225 -+// std::messages implementation details, GNU version -*- C++ -*-
272.1226 -+
272.1227 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
272.1228 -+//
272.1229 -+// This file is part of the GNU ISO C++ Library.  This library is free
272.1230 -+// software; you can redistribute it and/or modify it under the
272.1231 -+// terms of the GNU General Public License as published by the
272.1232 -+// Free Software Foundation; either version 2, or (at your option)
272.1233 -+// any later version.
272.1234 -+
272.1235 -+// This library is distributed in the hope that it will be useful,
272.1236 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
272.1237 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
272.1238 -+// GNU General Public License for more details.
272.1239 -+
272.1240 -+// You should have received a copy of the GNU General Public License along
272.1241 -+// with this library; see the file COPYING.  If not, write to the Free
272.1242 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
272.1243 -+// USA.
272.1244 -+
272.1245 -+// As a special exception, you may use this file as part of a free software
272.1246 -+// library without restriction.  Specifically, if other files instantiate
272.1247 -+// templates or use macros or inline functions from this file, or you compile
272.1248 -+// this file and link it with other files to produce an executable, this
272.1249 -+// file does not by itself cause the resulting executable to be covered by
272.1250 -+// the GNU General Public License.  This exception does not however
272.1251 -+// invalidate any other reasons why the executable file might be covered by
272.1252 -+// the GNU General Public License.
272.1253 -+
272.1254 -+//
272.1255 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
272.1256 -+//
272.1257 -+
272.1258 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
272.1259 -+
272.1260 -+#ifdef __UCLIBC_MJN3_ONLY__
272.1261 -+#warning fix prototypes for *textdomain funcs
272.1262 -+#endif
272.1263 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
272.1264 -+extern "C" char *__textdomain(const char *domainname);
272.1265 -+extern "C" char *__bindtextdomain(const char *domainname,
272.1266 -+				  const char *dirname);
272.1267 -+#else
272.1268 -+#undef __textdomain
272.1269 -+#undef __bindtextdomain
272.1270 -+#define __textdomain(D)           ((void)0)
272.1271 -+#define __bindtextdomain(D,P)     ((void)0)
272.1272 -+#endif
272.1273 -+
272.1274 -+  // Non-virtual member functions.
272.1275 -+  template<typename _CharT>
272.1276 -+     messages<_CharT>::messages(size_t __refs)
272.1277 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
272.1278 -+     _M_name_messages(_S_get_c_name())
272.1279 -+     { }
272.1280 -+
272.1281 -+  template<typename _CharT>
272.1282 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
272.1283 -+				size_t __refs) 
272.1284 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
272.1285 -+     _M_name_messages(__s)
272.1286 -+     {
272.1287 -+       char* __tmp = new char[std::strlen(__s) + 1];
272.1288 -+       std::strcpy(__tmp, __s);
272.1289 -+       _M_name_messages = __tmp;
272.1290 -+     }
272.1291 -+
272.1292 -+  template<typename _CharT>
272.1293 -+    typename messages<_CharT>::catalog 
272.1294 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
272.1295 -+			   const char* __dir) const
272.1296 -+    { 
272.1297 -+      __bindtextdomain(__s.c_str(), __dir);
272.1298 -+      return this->do_open(__s, __loc); 
272.1299 -+    }
272.1300 -+
272.1301 -+  // Virtual member functions.
272.1302 -+  template<typename _CharT>
272.1303 -+    messages<_CharT>::~messages()
272.1304 -+    { 
272.1305 -+      if (_M_name_messages != _S_get_c_name())
272.1306 -+	delete [] _M_name_messages;
272.1307 -+      _S_destroy_c_locale(_M_c_locale_messages); 
272.1308 -+    }
272.1309 -+
272.1310 -+  template<typename _CharT>
272.1311 -+    typename messages<_CharT>::catalog 
272.1312 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
272.1313 -+			      const locale&) const
272.1314 -+    { 
272.1315 -+      // No error checking is done, assume the catalog exists and can
272.1316 -+      // be used.
272.1317 -+      __textdomain(__s.c_str());
272.1318 -+      return 0;
272.1319 -+    }
272.1320 -+
272.1321 -+  template<typename _CharT>
272.1322 -+    void    
272.1323 -+    messages<_CharT>::do_close(catalog) const 
272.1324 -+    { }
272.1325 -+
272.1326 -+   // messages_byname
272.1327 -+   template<typename _CharT>
272.1328 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
272.1329 -+     : messages<_CharT>(__refs) 
272.1330 -+     { 
272.1331 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
272.1332 -+	 delete [] this->_M_name_messages;
272.1333 -+       char* __tmp = new char[std::strlen(__s) + 1];
272.1334 -+       std::strcpy(__tmp, __s);
272.1335 -+       this->_M_name_messages = __tmp;
272.1336 -+
272.1337 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
272.1338 -+	 {
272.1339 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
272.1340 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
272.1341 -+	 }
272.1342 -+     }
272.1343 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
272.1344 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
272.1345 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
272.1346 -@@ -0,0 +1,692 @@
272.1347 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
272.1348 -+
272.1349 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
272.1350 -+//
272.1351 -+// This file is part of the GNU ISO C++ Library.  This library is free
272.1352 -+// software; you can redistribute it and/or modify it under the
272.1353 -+// terms of the GNU General Public License as published by the
272.1354 -+// Free Software Foundation; either version 2, or (at your option)
272.1355 -+// any later version.
272.1356 -+
272.1357 -+// This library is distributed in the hope that it will be useful,
272.1358 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
272.1359 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
272.1360 -+// GNU General Public License for more details.
272.1361 -+
272.1362 -+// You should have received a copy of the GNU General Public License along
272.1363 -+// with this library; see the file COPYING.  If not, write to the Free
272.1364 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
272.1365 -+// USA.
272.1366 -+
272.1367 -+// As a special exception, you may use this file as part of a free software
272.1368 -+// library without restriction.  Specifically, if other files instantiate
272.1369 -+// templates or use macros or inline functions from this file, or you compile
272.1370 -+// this file and link it with other files to produce an executable, this
272.1371 -+// file does not by itself cause the resulting executable to be covered by
272.1372 -+// the GNU General Public License.  This exception does not however
272.1373 -+// invalidate any other reasons why the executable file might be covered by
272.1374 -+// the GNU General Public License.
272.1375 -+
272.1376 -+//
272.1377 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
272.1378 -+//
272.1379 -+
272.1380 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
272.1381 -+
272.1382 -+#define _LIBC
272.1383 -+#include <locale>
272.1384 -+#undef _LIBC
272.1385 -+#include <bits/c++locale_internal.h>
272.1386 -+
272.1387 -+#ifdef __UCLIBC_MJN3_ONLY__
272.1388 -+#warning optimize this for uclibc
272.1389 -+#warning tailor for stub locale support
272.1390 -+#endif
272.1391 -+
272.1392 -+#ifndef __UCLIBC_HAS_XLOCALE__
272.1393 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
272.1394 -+#endif
272.1395 -+
272.1396 -+namespace std
272.1397 -+{
272.1398 -+  // Construct and return valid pattern consisting of some combination of:
272.1399 -+  // space none symbol sign value
272.1400 -+  money_base::pattern
272.1401 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
272.1402 -+  { 
272.1403 -+    pattern __ret;
272.1404 -+
272.1405 -+    // This insanely complicated routine attempts to construct a valid
272.1406 -+    // pattern for use with monyepunct. A couple of invariants:
272.1407 -+
272.1408 -+    // if (__precedes) symbol -> value
272.1409 -+    // else value -> symbol
272.1410 -+    
272.1411 -+    // if (__space) space
272.1412 -+    // else none
272.1413 -+
272.1414 -+    // none == never first
272.1415 -+    // space never first or last
272.1416 -+
272.1417 -+    // Any elegant implementations of this are welcome.
272.1418 -+    switch (__posn)
272.1419 -+      {
272.1420 -+      case 0:
272.1421 -+      case 1:
272.1422 -+	// 1 The sign precedes the value and symbol.
272.1423 -+	__ret.field[0] = sign;
272.1424 -+	if (__space)
272.1425 -+	  {
272.1426 -+	    // Pattern starts with sign.
272.1427 -+	    if (__precedes)
272.1428 -+	      {
272.1429 -+		__ret.field[1] = symbol;
272.1430 -+		__ret.field[3] = value;
272.1431 -+	      }
272.1432 -+	    else
272.1433 -+	      {
272.1434 -+		__ret.field[1] = value;
272.1435 -+		__ret.field[3] = symbol;
272.1436 -+	      }
272.1437 -+	    __ret.field[2] = space;
272.1438 -+	  }
272.1439 -+	else
272.1440 -+	  {
272.1441 -+	    // Pattern starts with sign and ends with none.
272.1442 -+	    if (__precedes)
272.1443 -+	      {
272.1444 -+		__ret.field[1] = symbol;
272.1445 -+		__ret.field[2] = value;
272.1446 -+	      }
272.1447 -+	    else
272.1448 -+	      {
272.1449 -+		__ret.field[1] = value;
272.1450 -+		__ret.field[2] = symbol;
272.1451 -+	      }
272.1452 -+	    __ret.field[3] = none;
272.1453 -+	  }
272.1454 -+	break;
272.1455 -+      case 2:
272.1456 -+	// 2 The sign follows the value and symbol.
272.1457 -+	if (__space)
272.1458 -+	  {
272.1459 -+	    // Pattern either ends with sign.
272.1460 -+	    if (__precedes)
272.1461 -+	      {
272.1462 -+		__ret.field[0] = symbol;
272.1463 -+		__ret.field[2] = value;
272.1464 -+	      }
272.1465 -+	    else
272.1466 -+	      {
272.1467 -+		__ret.field[0] = value;
272.1468 -+		__ret.field[2] = symbol;
272.1469 -+	      }
272.1470 -+	    __ret.field[1] = space;
272.1471 -+	    __ret.field[3] = sign;
272.1472 -+	  }
272.1473 -+	else
272.1474 -+	  {
272.1475 -+	    // Pattern ends with sign then none.
272.1476 -+	    if (__precedes)
272.1477 -+	      {
272.1478 -+		__ret.field[0] = symbol;
272.1479 -+		__ret.field[1] = value;
272.1480 -+	      }
272.1481 -+	    else
272.1482 -+	      {
272.1483 -+		__ret.field[0] = value;
272.1484 -+		__ret.field[1] = symbol;
272.1485 -+	      }
272.1486 -+	    __ret.field[2] = sign;
272.1487 -+	    __ret.field[3] = none;
272.1488 -+	  }
272.1489 -+	break;
272.1490 -+      case 3:
272.1491 -+	// 3 The sign immediately precedes the symbol.
272.1492 -+	if (__precedes)
272.1493 -+	  {
272.1494 -+	    __ret.field[0] = sign;
272.1495 -+	    __ret.field[1] = symbol;	    
272.1496 -+	    if (__space)
272.1497 -+	      {
272.1498 -+		__ret.field[2] = space;
272.1499 -+		__ret.field[3] = value;
272.1500 -+	      }
272.1501 -+	    else
272.1502 -+	      {
272.1503 -+		__ret.field[2] = value;		
272.1504 -+		__ret.field[3] = none;
272.1505 -+	      }
272.1506 -+	  }
272.1507 -+	else
272.1508 -+	  {
272.1509 -+	    __ret.field[0] = value;
272.1510 -+	    if (__space)
272.1511 -+	      {
272.1512 -+		__ret.field[1] = space;
272.1513 -+		__ret.field[2] = sign;
272.1514 -+		__ret.field[3] = symbol;
272.1515 -+	      }
272.1516 -+	    else
272.1517 -+	      {
272.1518 -+		__ret.field[1] = sign;
272.1519 -+		__ret.field[2] = symbol;
272.1520 -+		__ret.field[3] = none;
272.1521 -+	      }
272.1522 -+	  }
272.1523 -+	break;
272.1524 -+      case 4:
272.1525 -+	// 4 The sign immediately follows the symbol.
272.1526 -+	if (__precedes)
272.1527 -+	  {
272.1528 -+	    __ret.field[0] = symbol;
272.1529 -+	    __ret.field[1] = sign;
272.1530 -+	    if (__space)
272.1531 -+	      {
272.1532 -+		__ret.field[2] = space;
272.1533 -+		__ret.field[3] = value;
272.1534 -+	      }
272.1535 -+	    else
272.1536 -+	      {
272.1537 -+		__ret.field[2] = value;
272.1538 -+		__ret.field[3] = none;
272.1539 -+	      }
272.1540 -+	  }
272.1541 -+	else
272.1542 -+	  {
272.1543 -+	    __ret.field[0] = value;
272.1544 -+	    if (__space)
272.1545 -+	      {
272.1546 -+		__ret.field[1] = space;
272.1547 -+		__ret.field[2] = symbol;
272.1548 -+		__ret.field[3] = sign;
272.1549 -+	      }
272.1550 -+	    else
272.1551 -+	      {
272.1552 -+		__ret.field[1] = symbol;
272.1553 -+		__ret.field[2] = sign;
272.1554 -+		__ret.field[3] = none;
272.1555 -+	      }
272.1556 -+	  }
272.1557 -+	break;
272.1558 -+      default:
272.1559 -+	;
272.1560 -+      }
272.1561 -+    return __ret;
272.1562 -+  }
272.1563 -+
272.1564 -+  template<> 
272.1565 -+    void
272.1566 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
272.1567 -+						     const char*)
272.1568 -+    {
272.1569 -+      if (!_M_data)
272.1570 -+	_M_data = new __moneypunct_cache<char, true>;
272.1571 -+
272.1572 -+      if (!__cloc)
272.1573 -+	{
272.1574 -+	  // "C" locale
272.1575 -+	  _M_data->_M_decimal_point = '.';
272.1576 -+	  _M_data->_M_thousands_sep = ',';
272.1577 -+	  _M_data->_M_grouping = "";
272.1578 -+	  _M_data->_M_grouping_size = 0;
272.1579 -+	  _M_data->_M_curr_symbol = "";
272.1580 -+	  _M_data->_M_curr_symbol_size = 0;
272.1581 -+	  _M_data->_M_positive_sign = "";
272.1582 -+	  _M_data->_M_positive_sign_size = 0;
272.1583 -+	  _M_data->_M_negative_sign = "";
272.1584 -+	  _M_data->_M_negative_sign_size = 0;
272.1585 -+	  _M_data->_M_frac_digits = 0;
272.1586 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
272.1587 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
272.1588 -+
272.1589 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
272.1590 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
272.1591 -+	}
272.1592 -+      else
272.1593 -+	{
272.1594 -+	  // Named locale.
272.1595 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
272.1596 -+							__cloc));
272.1597 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
272.1598 -+							__cloc));
272.1599 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
272.1600 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
272.1601 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
272.1602 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
272.1603 -+
272.1604 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
272.1605 -+	  if (!__nposn)
272.1606 -+	    _M_data->_M_negative_sign = "()";
272.1607 -+	  else
272.1608 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
272.1609 -+							__cloc);
272.1610 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
272.1611 -+
272.1612 -+	  // _Intl == true
272.1613 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
272.1614 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
272.1615 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
272.1616 -+						      __cloc));
272.1617 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
272.1618 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
272.1619 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
272.1620 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
272.1621 -+							__pposn);
272.1622 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
272.1623 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
272.1624 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
272.1625 -+							__nposn);
272.1626 -+	}
272.1627 -+    }
272.1628 -+
272.1629 -+  template<> 
272.1630 -+    void
272.1631 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
272.1632 -+						      const char*)
272.1633 -+    {
272.1634 -+      if (!_M_data)
272.1635 -+	_M_data = new __moneypunct_cache<char, false>;
272.1636 -+
272.1637 -+      if (!__cloc)
272.1638 -+	{
272.1639 -+	  // "C" locale
272.1640 -+	  _M_data->_M_decimal_point = '.';
272.1641 -+	  _M_data->_M_thousands_sep = ',';
272.1642 -+	  _M_data->_M_grouping = "";
272.1643 -+	  _M_data->_M_grouping_size = 0;
272.1644 -+	  _M_data->_M_curr_symbol = "";
272.1645 -+	  _M_data->_M_curr_symbol_size = 0;
272.1646 -+	  _M_data->_M_positive_sign = "";
272.1647 -+	  _M_data->_M_positive_sign_size = 0;
272.1648 -+	  _M_data->_M_negative_sign = "";
272.1649 -+	  _M_data->_M_negative_sign_size = 0;
272.1650 -+	  _M_data->_M_frac_digits = 0;
272.1651 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
272.1652 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
272.1653 -+
272.1654 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
272.1655 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
272.1656 -+	}
272.1657 -+      else
272.1658 -+	{
272.1659 -+	  // Named locale.
272.1660 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
272.1661 -+							__cloc));
272.1662 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
272.1663 -+							__cloc));
272.1664 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
272.1665 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
272.1666 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
272.1667 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
272.1668 -+
272.1669 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
272.1670 -+	  if (!__nposn)
272.1671 -+	    _M_data->_M_negative_sign = "()";
272.1672 -+	  else
272.1673 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
272.1674 -+							__cloc);
272.1675 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
272.1676 -+
272.1677 -+	  // _Intl == false
272.1678 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
272.1679 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
272.1680 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
272.1681 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
272.1682 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
272.1683 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
272.1684 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
272.1685 -+							__pposn);
272.1686 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
272.1687 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
272.1688 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
272.1689 -+							__nposn);
272.1690 -+	}
272.1691 -+    }
272.1692 -+
272.1693 -+  template<> 
272.1694 -+    moneypunct<char, true>::~moneypunct()
272.1695 -+    { delete _M_data; }
272.1696 -+
272.1697 -+  template<> 
272.1698 -+    moneypunct<char, false>::~moneypunct()
272.1699 -+    { delete _M_data; }
272.1700 -+
272.1701 -+#ifdef _GLIBCXX_USE_WCHAR_T
272.1702 -+  template<> 
272.1703 -+    void
272.1704 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
272.1705 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1706 -+							const char*)
272.1707 -+#else
272.1708 -+							const char* __name)
272.1709 -+#endif
272.1710 -+    {
272.1711 -+      if (!_M_data)
272.1712 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
272.1713 -+
272.1714 -+      if (!__cloc)
272.1715 -+	{
272.1716 -+	  // "C" locale
272.1717 -+	  _M_data->_M_decimal_point = L'.';
272.1718 -+	  _M_data->_M_thousands_sep = L',';
272.1719 -+	  _M_data->_M_grouping = "";
272.1720 -+	  _M_data->_M_grouping_size = 0;
272.1721 -+	  _M_data->_M_curr_symbol = L"";
272.1722 -+	  _M_data->_M_curr_symbol_size = 0;
272.1723 -+	  _M_data->_M_positive_sign = L"";
272.1724 -+	  _M_data->_M_positive_sign_size = 0;
272.1725 -+	  _M_data->_M_negative_sign = L"";
272.1726 -+	  _M_data->_M_negative_sign_size = 0;
272.1727 -+	  _M_data->_M_frac_digits = 0;
272.1728 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
272.1729 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
272.1730 -+
272.1731 -+	  // Use ctype::widen code without the facet...
272.1732 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
272.1733 -+	    _M_data->_M_atoms[__i] =
272.1734 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
272.1735 -+	}
272.1736 -+      else
272.1737 -+	{
272.1738 -+	  // Named locale.
272.1739 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1740 -+	  __c_locale __old = __uselocale(__cloc);
272.1741 -+#else
272.1742 -+	  // Switch to named locale so that mbsrtowcs will work.
272.1743 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
272.1744 -+	  setlocale(LC_ALL, __name);
272.1745 -+#endif
272.1746 -+
272.1747 -+#ifdef __UCLIBC_MJN3_ONLY__
272.1748 -+#warning fix this... should be monetary
272.1749 -+#endif
272.1750 -+#ifdef __UCLIBC__
272.1751 -+# ifdef __UCLIBC_HAS_XLOCALE__
272.1752 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
272.1753 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
272.1754 -+# else
272.1755 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
272.1756 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
272.1757 -+# endif
272.1758 -+#else
272.1759 -+	  union { char *__s; wchar_t __w; } __u;
272.1760 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
272.1761 -+	  _M_data->_M_decimal_point = __u.__w;
272.1762 -+
272.1763 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
272.1764 -+	  _M_data->_M_thousands_sep = __u.__w;
272.1765 -+#endif
272.1766 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
272.1767 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
272.1768 -+
272.1769 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
272.1770 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
272.1771 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
272.1772 -+
272.1773 -+	  wchar_t* __wcs_ps = 0;
272.1774 -+	  wchar_t* __wcs_ns = 0;
272.1775 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
272.1776 -+	  try
272.1777 -+	    {
272.1778 -+	      mbstate_t __state;
272.1779 -+	      size_t __len = strlen(__cpossign);
272.1780 -+	      if (__len)
272.1781 -+		{
272.1782 -+		  ++__len;
272.1783 -+		  memset(&__state, 0, sizeof(mbstate_t));
272.1784 -+		  __wcs_ps = new wchar_t[__len];
272.1785 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
272.1786 -+		  _M_data->_M_positive_sign = __wcs_ps;
272.1787 -+		}
272.1788 -+	      else
272.1789 -+		_M_data->_M_positive_sign = L"";
272.1790 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
272.1791 -+	      
272.1792 -+	      __len = strlen(__cnegsign);
272.1793 -+	      if (!__nposn)
272.1794 -+		_M_data->_M_negative_sign = L"()";
272.1795 -+	      else if (__len)
272.1796 -+		{ 
272.1797 -+		  ++__len;
272.1798 -+		  memset(&__state, 0, sizeof(mbstate_t));
272.1799 -+		  __wcs_ns = new wchar_t[__len];
272.1800 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
272.1801 -+		  _M_data->_M_negative_sign = __wcs_ns;
272.1802 -+		}
272.1803 -+	      else
272.1804 -+		_M_data->_M_negative_sign = L"";
272.1805 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
272.1806 -+	      
272.1807 -+	      // _Intl == true.
272.1808 -+	      __len = strlen(__ccurr);
272.1809 -+	      if (__len)
272.1810 -+		{
272.1811 -+		  ++__len;
272.1812 -+		  memset(&__state, 0, sizeof(mbstate_t));
272.1813 -+		  wchar_t* __wcs = new wchar_t[__len];
272.1814 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
272.1815 -+		  _M_data->_M_curr_symbol = __wcs;
272.1816 -+		}
272.1817 -+	      else
272.1818 -+		_M_data->_M_curr_symbol = L"";
272.1819 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
272.1820 -+	    }
272.1821 -+	  catch (...)
272.1822 -+	    {
272.1823 -+	      delete _M_data;
272.1824 -+	      _M_data = 0;
272.1825 -+	      delete __wcs_ps;
272.1826 -+	      delete __wcs_ns;	      
272.1827 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1828 -+	      __uselocale(__old);
272.1829 -+#else
272.1830 -+	      setlocale(LC_ALL, __old);
272.1831 -+	      free(__old);
272.1832 -+#endif
272.1833 -+	      __throw_exception_again;
272.1834 -+	    } 
272.1835 -+	  
272.1836 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
272.1837 -+						      __cloc));
272.1838 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
272.1839 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
272.1840 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
272.1841 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
272.1842 -+							__pposn);
272.1843 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
272.1844 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
272.1845 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
272.1846 -+							__nposn);
272.1847 -+
272.1848 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1849 -+	  __uselocale(__old);
272.1850 -+#else
272.1851 -+	  setlocale(LC_ALL, __old);
272.1852 -+	  free(__old);
272.1853 -+#endif
272.1854 -+	}
272.1855 -+    }
272.1856 -+
272.1857 -+  template<> 
272.1858 -+  void
272.1859 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
272.1860 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1861 -+						       const char*)
272.1862 -+#else
272.1863 -+                                                       const char* __name)
272.1864 -+#endif
272.1865 -+  {
272.1866 -+    if (!_M_data)
272.1867 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
272.1868 -+
272.1869 -+    if (!__cloc)
272.1870 -+	{
272.1871 -+	  // "C" locale
272.1872 -+	  _M_data->_M_decimal_point = L'.';
272.1873 -+	  _M_data->_M_thousands_sep = L',';
272.1874 -+	  _M_data->_M_grouping = "";
272.1875 -+          _M_data->_M_grouping_size = 0;
272.1876 -+	  _M_data->_M_curr_symbol = L"";
272.1877 -+	  _M_data->_M_curr_symbol_size = 0;
272.1878 -+	  _M_data->_M_positive_sign = L"";
272.1879 -+	  _M_data->_M_positive_sign_size = 0;
272.1880 -+	  _M_data->_M_negative_sign = L"";
272.1881 -+	  _M_data->_M_negative_sign_size = 0;
272.1882 -+	  _M_data->_M_frac_digits = 0;
272.1883 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
272.1884 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
272.1885 -+
272.1886 -+	  // Use ctype::widen code without the facet...
272.1887 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
272.1888 -+	    _M_data->_M_atoms[__i] =
272.1889 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
272.1890 -+	}
272.1891 -+      else
272.1892 -+	{
272.1893 -+	  // Named locale.
272.1894 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1895 -+	  __c_locale __old = __uselocale(__cloc);
272.1896 -+#else
272.1897 -+	  // Switch to named locale so that mbsrtowcs will work.
272.1898 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
272.1899 -+	  setlocale(LC_ALL, __name);
272.1900 -+#endif
272.1901 -+
272.1902 -+#ifdef __UCLIBC_MJN3_ONLY__
272.1903 -+#warning fix this... should be monetary
272.1904 -+#endif
272.1905 -+#ifdef __UCLIBC__
272.1906 -+# ifdef __UCLIBC_HAS_XLOCALE__
272.1907 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
272.1908 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
272.1909 -+# else
272.1910 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
272.1911 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
272.1912 -+# endif
272.1913 -+#else
272.1914 -+          union { char *__s; wchar_t __w; } __u;
272.1915 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
272.1916 -+	  _M_data->_M_decimal_point = __u.__w;
272.1917 -+
272.1918 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
272.1919 -+	  _M_data->_M_thousands_sep = __u.__w;
272.1920 -+#endif
272.1921 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
272.1922 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
272.1923 -+
272.1924 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
272.1925 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
272.1926 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
272.1927 -+
272.1928 -+	  wchar_t* __wcs_ps = 0;
272.1929 -+	  wchar_t* __wcs_ns = 0;
272.1930 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
272.1931 -+	  try
272.1932 -+            {
272.1933 -+              mbstate_t __state;
272.1934 -+              size_t __len;
272.1935 -+              __len = strlen(__cpossign);
272.1936 -+              if (__len)
272.1937 -+                {
272.1938 -+		  ++__len;
272.1939 -+		  memset(&__state, 0, sizeof(mbstate_t));
272.1940 -+		  __wcs_ps = new wchar_t[__len];
272.1941 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
272.1942 -+		  _M_data->_M_positive_sign = __wcs_ps;
272.1943 -+		}
272.1944 -+	      else
272.1945 -+		_M_data->_M_positive_sign = L"";
272.1946 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
272.1947 -+	      
272.1948 -+	      __len = strlen(__cnegsign);
272.1949 -+	      if (!__nposn)
272.1950 -+		_M_data->_M_negative_sign = L"()";
272.1951 -+	      else if (__len)
272.1952 -+		{ 
272.1953 -+		  ++__len;
272.1954 -+		  memset(&__state, 0, sizeof(mbstate_t));
272.1955 -+		  __wcs_ns = new wchar_t[__len];
272.1956 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
272.1957 -+		  _M_data->_M_negative_sign = __wcs_ns;
272.1958 -+		}
272.1959 -+	      else
272.1960 -+		_M_data->_M_negative_sign = L"";
272.1961 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
272.1962 -+
272.1963 -+	      // _Intl == true.
272.1964 -+	      __len = strlen(__ccurr);
272.1965 -+	      if (__len)
272.1966 -+		{
272.1967 -+		  ++__len;
272.1968 -+		  memset(&__state, 0, sizeof(mbstate_t));
272.1969 -+		  wchar_t* __wcs = new wchar_t[__len];
272.1970 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
272.1971 -+		  _M_data->_M_curr_symbol = __wcs;
272.1972 -+		}
272.1973 -+	      else
272.1974 -+		_M_data->_M_curr_symbol = L"";
272.1975 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
272.1976 -+	    }
272.1977 -+          catch (...)
272.1978 -+	    {
272.1979 -+	      delete _M_data;
272.1980 -+              _M_data = 0;
272.1981 -+	      delete __wcs_ps;
272.1982 -+	      delete __wcs_ns;	      
272.1983 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.1984 -+	      __uselocale(__old);
272.1985 -+#else
272.1986 -+	      setlocale(LC_ALL, __old);
272.1987 -+	      free(__old);
272.1988 -+#endif
272.1989 -+              __throw_exception_again;
272.1990 -+	    }
272.1991 -+
272.1992 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
272.1993 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
272.1994 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
272.1995 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
272.1996 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
272.1997 -+	                                                __pposn);
272.1998 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
272.1999 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
272.2000 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
272.2001 -+	                                                __nposn);
272.2002 -+
272.2003 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.2004 -+	  __uselocale(__old);
272.2005 -+#else
272.2006 -+	  setlocale(LC_ALL, __old);
272.2007 -+	  free(__old);
272.2008 -+#endif
272.2009 -+	}
272.2010 -+    }
272.2011 -+
272.2012 -+  template<> 
272.2013 -+    moneypunct<wchar_t, true>::~moneypunct()
272.2014 -+    {
272.2015 -+      if (_M_data->_M_positive_sign_size)
272.2016 -+	delete [] _M_data->_M_positive_sign;
272.2017 -+      if (_M_data->_M_negative_sign_size
272.2018 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
272.2019 -+	delete [] _M_data->_M_negative_sign;
272.2020 -+      if (_M_data->_M_curr_symbol_size)
272.2021 -+	delete [] _M_data->_M_curr_symbol;
272.2022 -+      delete _M_data;
272.2023 -+    }
272.2024 -+
272.2025 -+  template<> 
272.2026 -+    moneypunct<wchar_t, false>::~moneypunct()
272.2027 -+    {
272.2028 -+      if (_M_data->_M_positive_sign_size)
272.2029 -+	delete [] _M_data->_M_positive_sign;
272.2030 -+      if (_M_data->_M_negative_sign_size
272.2031 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
272.2032 -+	delete [] _M_data->_M_negative_sign;
272.2033 -+      if (_M_data->_M_curr_symbol_size)
272.2034 -+	delete [] _M_data->_M_curr_symbol;
272.2035 -+      delete _M_data;
272.2036 -+    }
272.2037 -+#endif
272.2038 -+}
272.2039 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
272.2040 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
272.2041 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
272.2042 -@@ -0,0 +1,160 @@
272.2043 -+// std::numpunct implementation details, GNU version -*- C++ -*-
272.2044 -+
272.2045 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
272.2046 -+//
272.2047 -+// This file is part of the GNU ISO C++ Library.  This library is free
272.2048 -+// software; you can redistribute it and/or modify it under the
272.2049 -+// terms of the GNU General Public License as published by the
272.2050 -+// Free Software Foundation; either version 2, or (at your option)
272.2051 -+// any later version.
272.2052 -+
272.2053 -+// This library is distributed in the hope that it will be useful,
272.2054 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
272.2055 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
272.2056 -+// GNU General Public License for more details.
272.2057 -+
272.2058 -+// You should have received a copy of the GNU General Public License along
272.2059 -+// with this library; see the file COPYING.  If not, write to the Free
272.2060 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
272.2061 -+// USA.
272.2062 -+
272.2063 -+// As a special exception, you may use this file as part of a free software
272.2064 -+// library without restriction.  Specifically, if other files instantiate
272.2065 -+// templates or use macros or inline functions from this file, or you compile
272.2066 -+// this file and link it with other files to produce an executable, this
272.2067 -+// file does not by itself cause the resulting executable to be covered by
272.2068 -+// the GNU General Public License.  This exception does not however
272.2069 -+// invalidate any other reasons why the executable file might be covered by
272.2070 -+// the GNU General Public License.
272.2071 -+
272.2072 -+//
272.2073 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
272.2074 -+//
272.2075 -+
272.2076 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
272.2077 -+
272.2078 -+#define _LIBC
272.2079 -+#include <locale>
272.2080 -+#undef _LIBC
272.2081 -+#include <bits/c++locale_internal.h>
272.2082 -+
272.2083 -+#ifdef __UCLIBC_MJN3_ONLY__
272.2084 -+#warning tailor for stub locale support
272.2085 -+#endif
272.2086 -+#ifndef __UCLIBC_HAS_XLOCALE__
272.2087 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
272.2088 -+#endif
272.2089 -+
272.2090 -+namespace std
272.2091 -+{
272.2092 -+  template<> 
272.2093 -+    void
272.2094 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
272.2095 -+    {
272.2096 -+      if (!_M_data)
272.2097 -+	_M_data = new __numpunct_cache<char>;
272.2098 -+
272.2099 -+      if (!__cloc)
272.2100 -+	{
272.2101 -+	  // "C" locale
272.2102 -+	  _M_data->_M_grouping = "";
272.2103 -+	  _M_data->_M_grouping_size = 0;
272.2104 -+	  _M_data->_M_use_grouping = false;
272.2105 -+
272.2106 -+	  _M_data->_M_decimal_point = '.';
272.2107 -+	  _M_data->_M_thousands_sep = ',';
272.2108 -+
272.2109 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
272.2110 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
272.2111 -+
272.2112 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
272.2113 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
272.2114 -+	}
272.2115 -+      else
272.2116 -+	{
272.2117 -+	  // Named locale.
272.2118 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
272.2119 -+							__cloc));
272.2120 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
272.2121 -+							__cloc));
272.2122 -+
272.2123 -+	  // Check for NULL, which implies no grouping.
272.2124 -+	  if (_M_data->_M_thousands_sep == '\0')
272.2125 -+	    _M_data->_M_grouping = "";
272.2126 -+	  else
272.2127 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
272.2128 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
272.2129 -+	}
272.2130 -+
272.2131 -+      // NB: There is no way to extact this info from posix locales.
272.2132 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
272.2133 -+      _M_data->_M_truename = "true";
272.2134 -+      _M_data->_M_truename_size = 4;
272.2135 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
272.2136 -+      _M_data->_M_falsename = "false";
272.2137 -+      _M_data->_M_falsename_size = 5;
272.2138 -+    }
272.2139 -+ 
272.2140 -+  template<> 
272.2141 -+    numpunct<char>::~numpunct()
272.2142 -+    { delete _M_data; }
272.2143 -+   
272.2144 -+#ifdef _GLIBCXX_USE_WCHAR_T
272.2145 -+  template<> 
272.2146 -+    void
272.2147 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
272.2148 -+    {
272.2149 -+      if (!_M_data)
272.2150 -+	_M_data = new __numpunct_cache<wchar_t>;
272.2151 -+
272.2152 -+      if (!__cloc)
272.2153 -+	{
272.2154 -+	  // "C" locale
272.2155 -+	  _M_data->_M_grouping = "";
272.2156 -+	  _M_data->_M_grouping_size = 0;
272.2157 -+	  _M_data->_M_use_grouping = false;
272.2158 -+
272.2159 -+	  _M_data->_M_decimal_point = L'.';
272.2160 -+	  _M_data->_M_thousands_sep = L',';
272.2161 -+
272.2162 -+	  // Use ctype::widen code without the facet...
272.2163 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
272.2164 -+	    _M_data->_M_atoms_out[__i] =
272.2165 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
272.2166 -+
272.2167 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
272.2168 -+	    _M_data->_M_atoms_in[__j] =
272.2169 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
272.2170 -+	}
272.2171 -+      else
272.2172 -+	{
272.2173 -+	  // Named locale.
272.2174 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
272.2175 -+	  union { char *__s; wchar_t __w; } __u;
272.2176 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
272.2177 -+	  _M_data->_M_decimal_point = __u.__w;
272.2178 -+
272.2179 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
272.2180 -+	  _M_data->_M_thousands_sep = __u.__w;
272.2181 -+
272.2182 -+	  if (_M_data->_M_thousands_sep == L'\0')
272.2183 -+	    _M_data->_M_grouping = "";
272.2184 -+	  else
272.2185 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
272.2186 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
272.2187 -+	}
272.2188 -+
272.2189 -+      // NB: There is no way to extact this info from posix locales.
272.2190 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
272.2191 -+      _M_data->_M_truename = L"true";
272.2192 -+      _M_data->_M_truename_size = 4;
272.2193 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
272.2194 -+      _M_data->_M_falsename = L"false";
272.2195 -+      _M_data->_M_falsename_size = 5;
272.2196 -+    }
272.2197 -+
272.2198 -+  template<> 
272.2199 -+    numpunct<wchar_t>::~numpunct()
272.2200 -+    { delete _M_data; }
272.2201 -+ #endif
272.2202 -+}
272.2203 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
272.2204 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
272.2205 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
272.2206 -@@ -0,0 +1,406 @@
272.2207 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
272.2208 -+
272.2209 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
272.2210 -+//
272.2211 -+// This file is part of the GNU ISO C++ Library.  This library is free
272.2212 -+// software; you can redistribute it and/or modify it under the
272.2213 -+// terms of the GNU General Public License as published by the
272.2214 -+// Free Software Foundation; either version 2, or (at your option)
272.2215 -+// any later version.
272.2216 -+
272.2217 -+// This library is distributed in the hope that it will be useful,
272.2218 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
272.2219 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
272.2220 -+// GNU General Public License for more details.
272.2221 -+
272.2222 -+// You should have received a copy of the GNU General Public License along
272.2223 -+// with this library; see the file COPYING.  If not, write to the Free
272.2224 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
272.2225 -+// USA.
272.2226 -+
272.2227 -+// As a special exception, you may use this file as part of a free software
272.2228 -+// library without restriction.  Specifically, if other files instantiate
272.2229 -+// templates or use macros or inline functions from this file, or you compile
272.2230 -+// this file and link it with other files to produce an executable, this
272.2231 -+// file does not by itself cause the resulting executable to be covered by
272.2232 -+// the GNU General Public License.  This exception does not however
272.2233 -+// invalidate any other reasons why the executable file might be covered by
272.2234 -+// the GNU General Public License.
272.2235 -+
272.2236 -+//
272.2237 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
272.2238 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
272.2239 -+//
272.2240 -+
272.2241 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
272.2242 -+
272.2243 -+#include <locale>
272.2244 -+#include <bits/c++locale_internal.h>
272.2245 -+
272.2246 -+#ifdef __UCLIBC_MJN3_ONLY__
272.2247 -+#warning tailor for stub locale support
272.2248 -+#endif
272.2249 -+#ifndef __UCLIBC_HAS_XLOCALE__
272.2250 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
272.2251 -+#endif
272.2252 -+
272.2253 -+namespace std
272.2254 -+{
272.2255 -+  template<>
272.2256 -+    void
272.2257 -+    __timepunct<char>::
272.2258 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
272.2259 -+	   const tm* __tm) const
272.2260 -+    {
272.2261 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.2262 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
272.2263 -+					_M_c_locale_timepunct);
272.2264 -+#else
272.2265 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
272.2266 -+      setlocale(LC_ALL, _M_name_timepunct);
272.2267 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
272.2268 -+      setlocale(LC_ALL, __old);
272.2269 -+      free(__old);
272.2270 -+#endif
272.2271 -+      // Make sure __s is null terminated.
272.2272 -+      if (__len == 0)
272.2273 -+	__s[0] = '\0';
272.2274 -+    }
272.2275 -+
272.2276 -+  template<> 
272.2277 -+    void
272.2278 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
272.2279 -+    {
272.2280 -+      if (!_M_data)
272.2281 -+	_M_data = new __timepunct_cache<char>;
272.2282 -+
272.2283 -+      if (!__cloc)
272.2284 -+	{
272.2285 -+	  // "C" locale
272.2286 -+	  _M_c_locale_timepunct = _S_get_c_locale();
272.2287 -+
272.2288 -+	  _M_data->_M_date_format = "%m/%d/%y";
272.2289 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
272.2290 -+	  _M_data->_M_time_format = "%H:%M:%S";
272.2291 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
272.2292 -+	  _M_data->_M_date_time_format = "";
272.2293 -+	  _M_data->_M_date_time_era_format = "";
272.2294 -+	  _M_data->_M_am = "AM";
272.2295 -+	  _M_data->_M_pm = "PM";
272.2296 -+	  _M_data->_M_am_pm_format = "";
272.2297 -+
272.2298 -+	  // Day names, starting with "C"'s Sunday.
272.2299 -+	  _M_data->_M_day1 = "Sunday";
272.2300 -+	  _M_data->_M_day2 = "Monday";
272.2301 -+	  _M_data->_M_day3 = "Tuesday";
272.2302 -+	  _M_data->_M_day4 = "Wednesday";
272.2303 -+	  _M_data->_M_day5 = "Thursday";
272.2304 -+	  _M_data->_M_day6 = "Friday";
272.2305 -+	  _M_data->_M_day7 = "Saturday";
272.2306 -+
272.2307 -+	  // Abbreviated day names, starting with "C"'s Sun.
272.2308 -+	  _M_data->_M_aday1 = "Sun";
272.2309 -+	  _M_data->_M_aday2 = "Mon";
272.2310 -+	  _M_data->_M_aday3 = "Tue";
272.2311 -+	  _M_data->_M_aday4 = "Wed";
272.2312 -+	  _M_data->_M_aday5 = "Thu";
272.2313 -+	  _M_data->_M_aday6 = "Fri";
272.2314 -+	  _M_data->_M_aday7 = "Sat";
272.2315 -+
272.2316 -+	  // Month names, starting with "C"'s January.
272.2317 -+	  _M_data->_M_month01 = "January";
272.2318 -+	  _M_data->_M_month02 = "February";
272.2319 -+	  _M_data->_M_month03 = "March";
272.2320 -+	  _M_data->_M_month04 = "April";
272.2321 -+	  _M_data->_M_month05 = "May";
272.2322 -+	  _M_data->_M_month06 = "June";
272.2323 -+	  _M_data->_M_month07 = "July";
272.2324 -+	  _M_data->_M_month08 = "August";
272.2325 -+	  _M_data->_M_month09 = "September";
272.2326 -+	  _M_data->_M_month10 = "October";
272.2327 -+	  _M_data->_M_month11 = "November";
272.2328 -+	  _M_data->_M_month12 = "December";
272.2329 -+
272.2330 -+	  // Abbreviated month names, starting with "C"'s Jan.
272.2331 -+	  _M_data->_M_amonth01 = "Jan";
272.2332 -+	  _M_data->_M_amonth02 = "Feb";
272.2333 -+	  _M_data->_M_amonth03 = "Mar";
272.2334 -+	  _M_data->_M_amonth04 = "Apr";
272.2335 -+	  _M_data->_M_amonth05 = "May";
272.2336 -+	  _M_data->_M_amonth06 = "Jun";
272.2337 -+	  _M_data->_M_amonth07 = "Jul";
272.2338 -+	  _M_data->_M_amonth08 = "Aug";
272.2339 -+	  _M_data->_M_amonth09 = "Sep";
272.2340 -+	  _M_data->_M_amonth10 = "Oct";
272.2341 -+	  _M_data->_M_amonth11 = "Nov";
272.2342 -+	  _M_data->_M_amonth12 = "Dec";
272.2343 -+	}
272.2344 -+      else
272.2345 -+	{
272.2346 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
272.2347 -+
272.2348 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
272.2349 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
272.2350 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
272.2351 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
272.2352 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
272.2353 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
272.2354 -+							     __cloc);
272.2355 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
272.2356 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
272.2357 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
272.2358 -+
272.2359 -+	  // Day names, starting with "C"'s Sunday.
272.2360 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
272.2361 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
272.2362 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
272.2363 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
272.2364 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
272.2365 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
272.2366 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
272.2367 -+
272.2368 -+	  // Abbreviated day names, starting with "C"'s Sun.
272.2369 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
272.2370 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
272.2371 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
272.2372 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
272.2373 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
272.2374 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
272.2375 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
272.2376 -+
272.2377 -+	  // Month names, starting with "C"'s January.
272.2378 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
272.2379 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
272.2380 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
272.2381 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
272.2382 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
272.2383 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
272.2384 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
272.2385 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
272.2386 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
272.2387 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
272.2388 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
272.2389 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
272.2390 -+
272.2391 -+	  // Abbreviated month names, starting with "C"'s Jan.
272.2392 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
272.2393 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
272.2394 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
272.2395 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
272.2396 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
272.2397 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
272.2398 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
272.2399 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
272.2400 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
272.2401 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
272.2402 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
272.2403 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
272.2404 -+	}
272.2405 -+    }
272.2406 -+
272.2407 -+#ifdef _GLIBCXX_USE_WCHAR_T
272.2408 -+  template<>
272.2409 -+    void
272.2410 -+    __timepunct<wchar_t>::
272.2411 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
272.2412 -+	   const tm* __tm) const
272.2413 -+    {
272.2414 -+#ifdef __UCLIBC_HAS_XLOCALE__
272.2415 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
272.2416 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
272.2417 -+					_M_c_locale_timepunct);
272.2418 -+#else
272.2419 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
272.2420 -+      setlocale(LC_ALL, _M_name_timepunct);
272.2421 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
272.2422 -+      setlocale(LC_ALL, __old);
272.2423 -+      free(__old);
272.2424 -+#endif
272.2425 -+      // Make sure __s is null terminated.
272.2426 -+      if (__len == 0)
272.2427 -+	__s[0] = L'\0';
272.2428 -+    }
272.2429 -+
272.2430 -+  template<> 
272.2431 -+    void
272.2432 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
272.2433 -+    {
272.2434 -+      if (!_M_data)
272.2435 -+	_M_data = new __timepunct_cache<wchar_t>;
272.2436 -+
272.2437 -+#warning wide time stuff
272.2438 -+//       if (!__cloc)
272.2439 -+	{
272.2440 -+	  // "C" locale
272.2441 -+	  _M_c_locale_timepunct = _S_get_c_locale();
272.2442 -+
272.2443 -+	  _M_data->_M_date_format = L"%m/%d/%y";
272.2444 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
272.2445 -+	  _M_data->_M_time_format = L"%H:%M:%S";
272.2446 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
272.2447 -+	  _M_data->_M_date_time_format = L"";
272.2448 -+	  _M_data->_M_date_time_era_format = L"";
272.2449 -+	  _M_data->_M_am = L"AM";
272.2450 -+	  _M_data->_M_pm = L"PM";
272.2451 -+	  _M_data->_M_am_pm_format = L"";
272.2452 -+
272.2453 -+	  // Day names, starting with "C"'s Sunday.
272.2454 -+	  _M_data->_M_day1 = L"Sunday";
272.2455 -+	  _M_data->_M_day2 = L"Monday";
272.2456 -+	  _M_data->_M_day3 = L"Tuesday";
272.2457 -+	  _M_data->_M_day4 = L"Wednesday";
272.2458 -+	  _M_data->_M_day5 = L"Thursday";
272.2459 -+	  _M_data->_M_day6 = L"Friday";
272.2460 -+	  _M_data->_M_day7 = L"Saturday";
272.2461 -+
272.2462 -+	  // Abbreviated day names, starting with "C"'s Sun.
272.2463 -+	  _M_data->_M_aday1 = L"Sun";
272.2464 -+	  _M_data->_M_aday2 = L"Mon";
272.2465 -+	  _M_data->_M_aday3 = L"Tue";
272.2466 -+	  _M_data->_M_aday4 = L"Wed";
272.2467 -+	  _M_data->_M_aday5 = L"Thu";
272.2468 -+	  _M_data->_M_aday6 = L"Fri";
272.2469 -+	  _M_data->_M_aday7 = L"Sat";
272.2470 -+
272.2471 -+	  // Month names, starting with "C"'s January.
272.2472 -+	  _M_data->_M_month01 = L"January";
272.2473 -+	  _M_data->_M_month02 = L"February";
272.2474 -+	  _M_data->_M_month03 = L"March";
272.2475 -+	  _M_data->_M_month04 = L"April";
272.2476 -+	  _M_data->_M_month05 = L"May";
272.2477 -+	  _M_data->_M_month06 = L"June";
272.2478 -+	  _M_data->_M_month07 = L"July";
272.2479 -+	  _M_data->_M_month08 = L"August";
272.2480 -+	  _M_data->_M_month09 = L"September";
272.2481 -+	  _M_data->_M_month10 = L"October";
272.2482 -+	  _M_data->_M_month11 = L"November";
272.2483 -+	  _M_data->_M_month12 = L"December";
272.2484 -+
272.2485 -+	  // Abbreviated month names, starting with "C"'s Jan.
272.2486 -+	  _M_data->_M_amonth01 = L"Jan";
272.2487 -+	  _M_data->_M_amonth02 = L"Feb";
272.2488 -+	  _M_data->_M_amonth03 = L"Mar";
272.2489 -+	  _M_data->_M_amonth04 = L"Apr";
272.2490 -+	  _M_data->_M_amonth05 = L"May";
272.2491 -+	  _M_data->_M_amonth06 = L"Jun";
272.2492 -+	  _M_data->_M_amonth07 = L"Jul";
272.2493 -+	  _M_data->_M_amonth08 = L"Aug";
272.2494 -+	  _M_data->_M_amonth09 = L"Sep";
272.2495 -+	  _M_data->_M_amonth10 = L"Oct";
272.2496 -+	  _M_data->_M_amonth11 = L"Nov";
272.2497 -+	  _M_data->_M_amonth12 = L"Dec";
272.2498 -+	}
272.2499 -+#if 0
272.2500 -+      else
272.2501 -+	{
272.2502 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
272.2503 -+
272.2504 -+	  union { char *__s; wchar_t *__w; } __u;
272.2505 -+
272.2506 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
272.2507 -+	  _M_data->_M_date_format = __u.__w;
272.2508 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
272.2509 -+	  _M_data->_M_date_era_format = __u.__w;
272.2510 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
272.2511 -+	  _M_data->_M_time_format = __u.__w;
272.2512 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
272.2513 -+	  _M_data->_M_time_era_format = __u.__w;
272.2514 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
272.2515 -+	  _M_data->_M_date_time_format = __u.__w;
272.2516 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
272.2517 -+	  _M_data->_M_date_time_era_format = __u.__w;
272.2518 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
272.2519 -+	  _M_data->_M_am = __u.__w;
272.2520 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
272.2521 -+	  _M_data->_M_pm = __u.__w;
272.2522 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
272.2523 -+	  _M_data->_M_am_pm_format = __u.__w;
272.2524 -+
272.2525 -+	  // Day names, starting with "C"'s Sunday.
272.2526 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
272.2527 -+	  _M_data->_M_day1 = __u.__w;
272.2528 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
272.2529 -+	  _M_data->_M_day2 = __u.__w;
272.2530 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
272.2531 -+	  _M_data->_M_day3 = __u.__w;
272.2532 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
272.2533 -+	  _M_data->_M_day4 = __u.__w;
272.2534 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
272.2535 -+	  _M_data->_M_day5 = __u.__w;
272.2536 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
272.2537 -+	  _M_data->_M_day6 = __u.__w;
272.2538 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
272.2539 -+	  _M_data->_M_day7 = __u.__w;
272.2540 -+
272.2541 -+	  // Abbreviated day names, starting with "C"'s Sun.
272.2542 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
272.2543 -+	  _M_data->_M_aday1 = __u.__w;
272.2544 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
272.2545 -+	  _M_data->_M_aday2 = __u.__w;
272.2546 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
272.2547 -+	  _M_data->_M_aday3 = __u.__w;
272.2548 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
272.2549 -+	  _M_data->_M_aday4 = __u.__w;
272.2550 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
272.2551 -+	  _M_data->_M_aday5 = __u.__w;
272.2552 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
272.2553 -+	  _M_data->_M_aday6 = __u.__w;
272.2554 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
272.2555 -+	  _M_data->_M_aday7 = __u.__w;
272.2556 -+
272.2557 -+	  // Month names, starting with "C"'s January.
272.2558 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
272.2559 -+	  _M_data->_M_month01 = __u.__w;
272.2560 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
272.2561 -+	  _M_data->_M_month02 = __u.__w;
272.2562 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
272.2563 -+	  _M_data->_M_month03 = __u.__w;
272.2564 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
272.2565 -+	  _M_data->_M_month04 = __u.__w;
272.2566 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
272.2567 -+	  _M_data->_M_month05 = __u.__w;
272.2568 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
272.2569 -+	  _M_data->_M_month06 = __u.__w;
272.2570 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
272.2571 -+	  _M_data->_M_month07 = __u.__w;
272.2572 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
272.2573 -+	  _M_data->_M_month08 = __u.__w;
272.2574 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
272.2575 -+	  _M_data->_M_month09 = __u.__w;
272.2576 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
272.2577 -+	  _M_data->_M_month10 = __u.__w;
272.2578 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
272.2579 -+	  _M_data->_M_month11 = __u.__w;
272.2580 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
272.2581 -+	  _M_data->_M_month12 = __u.__w;
272.2582 -+
272.2583 -+	  // Abbreviated month names, starting with "C"'s Jan.
272.2584 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
272.2585 -+	  _M_data->_M_amonth01 = __u.__w;
272.2586 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
272.2587 -+	  _M_data->_M_amonth02 = __u.__w;
272.2588 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
272.2589 -+	  _M_data->_M_amonth03 = __u.__w;
272.2590 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
272.2591 -+	  _M_data->_M_amonth04 = __u.__w;
272.2592 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
272.2593 -+	  _M_data->_M_amonth05 = __u.__w;
272.2594 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
272.2595 -+	  _M_data->_M_amonth06 = __u.__w;
272.2596 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
272.2597 -+	  _M_data->_M_amonth07 = __u.__w;
272.2598 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
272.2599 -+	  _M_data->_M_amonth08 = __u.__w;
272.2600 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
272.2601 -+	  _M_data->_M_amonth09 = __u.__w;
272.2602 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
272.2603 -+	  _M_data->_M_amonth10 = __u.__w;
272.2604 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
272.2605 -+	  _M_data->_M_amonth11 = __u.__w;
272.2606 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
272.2607 -+	  _M_data->_M_amonth12 = __u.__w;
272.2608 -+	}
272.2609 -+#endif // 0
272.2610 -+    }
272.2611 -+#endif
272.2612 -+}
272.2613 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
272.2614 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
272.2615 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
272.2616 -@@ -0,0 +1,68 @@
272.2617 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
272.2618 -+
272.2619 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
272.2620 -+//
272.2621 -+// This file is part of the GNU ISO C++ Library.  This library is free
272.2622 -+// software; you can redistribute it and/or modify it under the
272.2623 -+// terms of the GNU General Public License as published by the
272.2624 -+// Free Software Foundation; either version 2, or (at your option)
272.2625 -+// any later version.
272.2626 -+
272.2627 -+// This library is distributed in the hope that it will be useful,
272.2628 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
272.2629 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
272.2630 -+// GNU General Public License for more details.
272.2631 -+
272.2632 -+// You should have received a copy of the GNU General Public License along
272.2633 -+// with this library; see the file COPYING.  If not, write to the Free
272.2634 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
272.2635 -+// USA.
272.2636 -+
272.2637 -+// As a special exception, you may use this file as part of a free software
272.2638 -+// library without restriction.  Specifically, if other files instantiate
272.2639 -+// templates or use macros or inline functions from this file, or you compile
272.2640 -+// this file and link it with other files to produce an executable, this
272.2641 -+// file does not by itself cause the resulting executable to be covered by
272.2642 -+// the GNU General Public License.  This exception does not however
272.2643 -+// invalidate any other reasons why the executable file might be covered by
272.2644 -+// the GNU General Public License.
272.2645 -+
272.2646 -+//
272.2647 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
272.2648 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
272.2649 -+//
272.2650 -+
272.2651 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
272.2652 -+
272.2653 -+  template<typename _CharT>
272.2654 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
272.2655 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
272.2656 -+    _M_name_timepunct(_S_get_c_name())
272.2657 -+    { _M_initialize_timepunct(); }
272.2658 -+
272.2659 -+  template<typename _CharT>
272.2660 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
272.2661 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
272.2662 -+    _M_name_timepunct(_S_get_c_name())
272.2663 -+    { _M_initialize_timepunct(); }
272.2664 -+
272.2665 -+  template<typename _CharT>
272.2666 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
272.2667 -+				     size_t __refs) 
272.2668 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
272.2669 -+    _M_name_timepunct(__s)
272.2670 -+    { 
272.2671 -+      char* __tmp = new char[std::strlen(__s) + 1];
272.2672 -+      std::strcpy(__tmp, __s);
272.2673 -+      _M_name_timepunct = __tmp;
272.2674 -+      _M_initialize_timepunct(__cloc); 
272.2675 -+    }
272.2676 -+
272.2677 -+  template<typename _CharT>
272.2678 -+    __timepunct<_CharT>::~__timepunct()
272.2679 -+    { 
272.2680 -+      if (_M_name_timepunct != _S_get_c_name())
272.2681 -+	delete [] _M_name_timepunct;
272.2682 -+      delete _M_data; 
272.2683 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
272.2684 -+    }
272.2685 -diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
272.2686 ---- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:29:22.000000000 +0200
272.2687 -+++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
272.2688 -@@ -5769,7 +5769,7 @@
272.2689 -   enableval="$enable_clocale"
272.2690 - 
272.2691 -       case "$enableval" in
272.2692 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
272.2693 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
272.2694 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
272.2695 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
272.2696 -    { (exit 1); exit 1; }; } ;;
272.2697 -@@ -5802,6 +5802,9 @@
272.2698 -   # Default to "generic".
272.2699 -   if test $enable_clocale_flag = auto; then
272.2700 -     case ${target_os} in
272.2701 -+      linux-uclibc*)
272.2702 -+        enable_clocale_flag=uclibc
272.2703 -+	;;
272.2704 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
272.2705 -         enable_clocale_flag=gnu
272.2706 -         ;;
272.2707 -@@ -6190,6 +6193,76 @@
272.2708 -       CTIME_CC=config/locale/generic/time_members.cc
272.2709 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
272.2710 -       ;;
272.2711 -+    uclibc)
272.2712 -+      echo "$as_me:$LINENO: result: uclibc" >&5
272.2713 -+echo "${ECHO_T}uclibc" >&6
272.2714 -+
272.2715 -+      # Declare intention to use gettext, and add support for specific
272.2716 -+      # languages.
272.2717 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
272.2718 -+      ALL_LINGUAS="de fr"
272.2719 -+
272.2720 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
272.2721 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
272.2722 -+set dummy msgfmt; ac_word=$2
272.2723 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
272.2724 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
272.2725 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
272.2726 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
272.2727 -+else
272.2728 -+  if test -n "$check_msgfmt"; then
272.2729 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
272.2730 -+else
272.2731 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
272.2732 -+for as_dir in $PATH
272.2733 -+do
272.2734 -+  IFS=$as_save_IFS
272.2735 -+  test -z "$as_dir" && as_dir=.
272.2736 -+  for ac_exec_ext in '' $ac_executable_extensions; do
272.2737 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
272.2738 -+    ac_cv_prog_check_msgfmt="yes"
272.2739 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
272.2740 -+    break 2
272.2741 -+  fi
272.2742 -+done
272.2743 -+done
272.2744 -+
272.2745 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
272.2746 -+fi
272.2747 -+fi
272.2748 -+check_msgfmt=$ac_cv_prog_check_msgfmt
272.2749 -+if test -n "$check_msgfmt"; then
272.2750 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
272.2751 -+echo "${ECHO_T}$check_msgfmt" >&6
272.2752 -+else
272.2753 -+  echo "$as_me:$LINENO: result: no" >&5
272.2754 -+echo "${ECHO_T}no" >&6
272.2755 -+fi
272.2756 -+
272.2757 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
272.2758 -+        USE_NLS=yes
272.2759 -+      fi
272.2760 -+      # Export the build objects.
272.2761 -+      for ling in $ALL_LINGUAS; do \
272.2762 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
272.2763 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
272.2764 -+      done
272.2765 -+
272.2766 -+
272.2767 -+
272.2768 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
272.2769 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
272.2770 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
272.2771 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
272.2772 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
272.2773 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
272.2774 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
272.2775 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
272.2776 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
272.2777 -+      CTIME_H=config/locale/uclibc/time_members.h
272.2778 -+      CTIME_CC=config/locale/uclibc/time_members.cc
272.2779 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
272.2780 -+      ;;
272.2781 -   esac
272.2782 - 
272.2783 -   # This is where the testsuite looks for locale catalogs, using the
272.2784 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h
272.2785 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2005-08-17 04:28:44.000000000 +0200
272.2786 -+++ gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h	2007-08-03 20:30:21.000000000 +0200
272.2787 -@@ -101,7 +101,9 @@
272.2788 - using std::wmemcpy;
272.2789 - using std::wmemmove;
272.2790 - using std::wmemset;
272.2791 -+#if _GLIBCXX_HAVE_WCSFTIME
272.2792 - using std::wcsftime;
272.2793 -+#endif
272.2794 - 
272.2795 - #if _GLIBCXX_USE_C99
272.2796 - using std::wcstold;
272.2797 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h
272.2798 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h	2006-12-07 10:33:51.000000000 +0100
272.2799 -+++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h	2007-08-03 20:30:21.000000000 +0200
272.2800 -@@ -182,7 +182,9 @@
272.2801 -   using ::wcscoll;
272.2802 -   using ::wcscpy;
272.2803 -   using ::wcscspn;
272.2804 -+#if _GLIBCXX_HAVE_WCSFTIME
272.2805 -   using ::wcsftime;
272.2806 -+#endif
272.2807 -   using ::wcslen;
272.2808 -   using ::wcsncat;
272.2809 -   using ::wcsncmp;
   273.1 --- a/patches/gcc/4.2.2/203-uclibc-locale-no__x.patch	Mon Jul 28 21:08:01 2008 +0000
   273.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   273.3 @@ -1,223 +0,0 @@
   273.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   273.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
   273.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   273.7 -@@ -39,20 +39,6 @@
   273.8 - #include <langinfo.h>
   273.9 - #include <bits/c++locale_internal.h>
  273.10 - 
  273.11 --#ifndef __UCLIBC_HAS_XLOCALE__
  273.12 --#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  273.13 --#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  273.14 --#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  273.15 --#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  273.16 --#define __strtof_l(S, E, L)         strtof((S), (E))
  273.17 --#define __strtod_l(S, E, L)         strtod((S), (E))
  273.18 --#define __strtold_l(S, E, L)        strtold((S), (E))
  273.19 --#warning should dummy __newlocale check for C|POSIX ?
  273.20 --#define __newlocale(a, b, c)        NULL
  273.21 --#define __freelocale(a)             ((void)0)
  273.22 --#define __duplocale(a)              __c_locale()
  273.23 --#endif
  273.24 --
  273.25 - namespace std 
  273.26 - {
  273.27 -   template<>
  273.28 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  273.29 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
  273.30 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  273.31 -@@ -68,6 +68,7 @@
  273.32 - {
  273.33 -   extern "C" __typeof(uselocale) __uselocale;
  273.34 - }
  273.35 -+#define __uselocale uselocale
  273.36 - #endif
  273.37 - 
  273.38 - namespace std
  273.39 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  273.40 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
  273.41 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:53.000000000 +0200
  273.42 -@@ -60,4 +60,49 @@
  273.43 - extern "C" __typeof(wctype_l) __wctype_l;
  273.44 - #endif 
  273.45 - 
  273.46 -+# define __nl_langinfo_l nl_langinfo_l
  273.47 -+# define __strcoll_l strcoll_l
  273.48 -+# define __strftime_l strftime_l
  273.49 -+# define __strtod_l strtod_l
  273.50 -+# define __strtof_l strtof_l
  273.51 -+# define __strtold_l strtold_l
  273.52 -+# define __strxfrm_l strxfrm_l
  273.53 -+# define __newlocale newlocale
  273.54 -+# define __freelocale freelocale
  273.55 -+# define __duplocale duplocale
  273.56 -+# define __uselocale uselocale
  273.57 -+
  273.58 -+# ifdef _GLIBCXX_USE_WCHAR_T
  273.59 -+#  define __iswctype_l iswctype_l
  273.60 -+#  define __towlower_l towlower_l
  273.61 -+#  define __towupper_l towupper_l
  273.62 -+#  define __wcscoll_l wcscoll_l
  273.63 -+#  define __wcsftime_l wcsftime_l
  273.64 -+#  define __wcsxfrm_l wcsxfrm_l
  273.65 -+#  define __wctype_l wctype_l
  273.66 -+# endif
  273.67 -+
  273.68 -+#else
  273.69 -+# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  273.70 -+# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  273.71 -+# define __strtod_l(S, E, L)         strtod((S), (E))
  273.72 -+# define __strtof_l(S, E, L)         strtof((S), (E))
  273.73 -+# define __strtold_l(S, E, L)        strtold((S), (E))
  273.74 -+# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  273.75 -+# warning should dummy __newlocale check for C|POSIX ?
  273.76 -+# define __newlocale(a, b, c)        NULL
  273.77 -+# define __freelocale(a)             ((void)0)
  273.78 -+# define __duplocale(a)              __c_locale()
  273.79 -+//# define __uselocale ?
  273.80 -+//
  273.81 -+# ifdef _GLIBCXX_USE_WCHAR_T
  273.82 -+#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  273.83 -+#  define __towlower_l(C, L)          towlower((C))
  273.84 -+#  define __towupper_l(C, L)          towupper((C))
  273.85 -+#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  273.86 -+//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  273.87 -+#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  273.88 -+#  define __wctype_l(S, L)            wctype((S))
  273.89 -+# endif
  273.90 -+
  273.91 - #endif // GLIBC 2.3 and later
  273.92 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
  273.93 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
  273.94 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:53.000000000 +0200
  273.95 -@@ -36,13 +36,6 @@
  273.96 - #include <locale>
  273.97 - #include <bits/c++locale_internal.h>
  273.98 - 
  273.99 --#ifndef __UCLIBC_HAS_XLOCALE__
 273.100 --#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 273.101 --#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 273.102 --#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 273.103 --#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 273.104 --#endif
 273.105 --
 273.106 - namespace std
 273.107 - {
 273.108 -   // These are basically extensions to char_traits, and perhaps should
 273.109 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 273.110 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 273.111 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 273.112 -@@ -38,13 +38,6 @@
 273.113 - #undef _LIBC
 273.114 - #include <bits/c++locale_internal.h>
 273.115 - 
 273.116 --#ifndef __UCLIBC_HAS_XLOCALE__
 273.117 --#define __wctype_l(S, L)           wctype((S))
 273.118 --#define __towupper_l(C, L)         towupper((C))
 273.119 --#define __towlower_l(C, L)         towlower((C))
 273.120 --#define __iswctype_l(C, M, L)      iswctype((C), (M))
 273.121 --#endif
 273.122 --
 273.123 - namespace std
 273.124 - {
 273.125 -   // NB: The other ctype<char> specializations are in src/locale.cc and
 273.126 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
 273.127 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
 273.128 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:53.000000000 +0200
 273.129 -@@ -39,13 +39,10 @@
 273.130 - #ifdef __UCLIBC_MJN3_ONLY__
 273.131 - #warning fix gettext stuff
 273.132 - #endif
 273.133 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 273.134 --extern "C" char *__dcgettext(const char *domainname,
 273.135 --			     const char *msgid, int category);
 273.136 - #undef gettext
 273.137 --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 273.138 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 273.139 -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 273.140 - #else
 273.141 --#undef gettext
 273.142 - #define gettext(msgid) (msgid)
 273.143 - #endif
 273.144 - 
 273.145 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 273.146 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
 273.147 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 273.148 -@@ -36,15 +36,11 @@
 273.149 - #ifdef __UCLIBC_MJN3_ONLY__
 273.150 - #warning fix prototypes for *textdomain funcs
 273.151 - #endif
 273.152 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 273.153 --extern "C" char *__textdomain(const char *domainname);
 273.154 --extern "C" char *__bindtextdomain(const char *domainname,
 273.155 --				  const char *dirname);
 273.156 --#else
 273.157 --#undef __textdomain
 273.158 --#undef __bindtextdomain
 273.159 --#define __textdomain(D)           ((void)0)
 273.160 --#define __bindtextdomain(D,P)     ((void)0)
 273.161 -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 273.162 -+#undef textdomain
 273.163 -+#undef bindtextdomain
 273.164 -+#define textdomain(D)           ((void)0)
 273.165 -+#define bindtextdomain(D,P)     ((void)0)
 273.166 - #endif
 273.167 - 
 273.168 -   // Non-virtual member functions.
 273.169 -@@ -70,7 +66,7 @@
 273.170 -     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 273.171 - 			   const char* __dir) const
 273.172 -     { 
 273.173 --      __bindtextdomain(__s.c_str(), __dir);
 273.174 -+      bindtextdomain(__s.c_str(), __dir);
 273.175 -       return this->do_open(__s, __loc); 
 273.176 -     }
 273.177 - 
 273.178 -@@ -90,7 +86,7 @@
 273.179 -     { 
 273.180 -       // No error checking is done, assume the catalog exists and can
 273.181 -       // be used.
 273.182 --      __textdomain(__s.c_str());
 273.183 -+      textdomain(__s.c_str());
 273.184 -       return 0;
 273.185 -     }
 273.186 - 
 273.187 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 273.188 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
 273.189 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
 273.190 -@@ -43,10 +43,6 @@
 273.191 - #warning tailor for stub locale support
 273.192 - #endif
 273.193 - 
 273.194 --#ifndef __UCLIBC_HAS_XLOCALE__
 273.195 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 273.196 --#endif
 273.197 --
 273.198 - namespace std
 273.199 - {
 273.200 -   // Construct and return valid pattern consisting of some combination of:
 273.201 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 273.202 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
 273.203 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
 273.204 -@@ -41,9 +41,6 @@
 273.205 - #ifdef __UCLIBC_MJN3_ONLY__
 273.206 - #warning tailor for stub locale support
 273.207 - #endif
 273.208 --#ifndef __UCLIBC_HAS_XLOCALE__
 273.209 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 273.210 --#endif
 273.211 - 
 273.212 - namespace std
 273.213 - {
 273.214 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
 273.215 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
 273.216 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:53.000000000 +0200
 273.217 -@@ -40,9 +40,6 @@
 273.218 - #ifdef __UCLIBC_MJN3_ONLY__
 273.219 - #warning tailor for stub locale support
 273.220 - #endif
 273.221 --#ifndef __UCLIBC_HAS_XLOCALE__
 273.222 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 273.223 --#endif
 273.224 - 
 273.225 - namespace std
 273.226 - {
   274.1 --- a/patches/gcc/4.2.2/204-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:08:01 2008 +0000
   274.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   274.3 @@ -1,50 +0,0 @@
   274.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   274.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
   274.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
   274.7 -@@ -401,7 +401,7 @@
   274.8 - # ifdef __UCLIBC_HAS_XLOCALE__
   274.9 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  274.10 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  274.11 --# else
  274.12 -+# elif defined __UCLIBC_HAS_LOCALE__
  274.13 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  274.14 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  274.15 - # endif
  274.16 -@@ -556,7 +556,7 @@
  274.17 - # ifdef __UCLIBC_HAS_XLOCALE__
  274.18 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  274.19 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  274.20 --# else
  274.21 -+# elif defined __UCLIBC_HAS_LOCALE__
  274.22 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  274.23 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  274.24 - # endif
  274.25 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  274.26 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
  274.27 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
  274.28 -@@ -127,12 +127,25 @@
  274.29 - 	{
  274.30 - 	  // Named locale.
  274.31 - 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  274.32 -+#ifdef __UCLIBC_MJN3_ONLY__
  274.33 -+#warning fix this... should be numeric
  274.34 -+#endif
  274.35 -+#ifdef __UCLIBC__
  274.36 -+# ifdef __UCLIBC_HAS_XLOCALE__
  274.37 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  274.38 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  274.39 -+# elif defined __UCLIBC_HAS_LOCALE__
  274.40 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  274.41 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  274.42 -+# endif
  274.43 -+#else
  274.44 - 	  union { char *__s; wchar_t __w; } __u;
  274.45 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  274.46 - 	  _M_data->_M_decimal_point = __u.__w;
  274.47 - 
  274.48 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  274.49 - 	  _M_data->_M_thousands_sep = __u.__w;
  274.50 -+#endif
  274.51 - 
  274.52 - 	  if (_M_data->_M_thousands_sep == L'\0')
  274.53 - 	    _M_data->_M_grouping = "";
   275.1 --- a/patches/gcc/4.2.2/205-uclibc-locale-update.patch	Mon Jul 28 21:08:01 2008 +0000
   275.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   275.3 @@ -1,354 +0,0 @@
   275.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   275.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   275.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:31:54.000000000 +0200
   275.7 -@@ -46,16 +46,13 @@
   275.8 -     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   275.9 - 		   const __c_locale& __cloc)
  275.10 -     {
  275.11 --      if (!(__err & ios_base::failbit))
  275.12 --	{
  275.13 --	  char* __sanity;
  275.14 --	  errno = 0;
  275.15 --	  float __f = __strtof_l(__s, &__sanity, __cloc);
  275.16 --          if (__sanity != __s && errno != ERANGE)
  275.17 --	    __v = __f;
  275.18 --	  else
  275.19 --	    __err |= ios_base::failbit;
  275.20 --	}
  275.21 -+      char* __sanity;
  275.22 -+      errno = 0;
  275.23 -+      float __f = __strtof_l(__s, &__sanity, __cloc);
  275.24 -+      if (__sanity != __s && errno != ERANGE)
  275.25 -+	__v = __f;
  275.26 -+      else
  275.27 -+	__err |= ios_base::failbit;
  275.28 -     }
  275.29 - 
  275.30 -   template<>
  275.31 -@@ -63,16 +60,13 @@
  275.32 -     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  275.33 - 		   const __c_locale& __cloc)
  275.34 -     {
  275.35 --      if (!(__err & ios_base::failbit))
  275.36 --	{
  275.37 --	  char* __sanity;
  275.38 --	  errno = 0;
  275.39 --	  double __d = __strtod_l(__s, &__sanity, __cloc);
  275.40 --          if (__sanity != __s && errno != ERANGE)
  275.41 --	    __v = __d;
  275.42 --	  else
  275.43 --	    __err |= ios_base::failbit;
  275.44 --	}
  275.45 -+      char* __sanity;
  275.46 -+      errno = 0;
  275.47 -+      double __d = __strtod_l(__s, &__sanity, __cloc);
  275.48 -+      if (__sanity != __s && errno != ERANGE)
  275.49 -+	__v = __d;
  275.50 -+      else
  275.51 -+	__err |= ios_base::failbit;
  275.52 -     }
  275.53 - 
  275.54 -   template<>
  275.55 -@@ -80,16 +74,13 @@
  275.56 -     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  275.57 - 		   const __c_locale& __cloc)
  275.58 -     {
  275.59 --      if (!(__err & ios_base::failbit))
  275.60 --	{
  275.61 --	  char* __sanity;
  275.62 --	  errno = 0;
  275.63 --	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  275.64 --          if (__sanity != __s && errno != ERANGE)
  275.65 --	    __v = __ld;
  275.66 --	  else
  275.67 --	    __err |= ios_base::failbit;
  275.68 --	}
  275.69 -+      char* __sanity;
  275.70 -+      errno = 0;
  275.71 -+      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  275.72 -+      if (__sanity != __s && errno != ERANGE)
  275.73 -+	__v = __ld;
  275.74 -+      else
  275.75 -+	__err |= ios_base::failbit;
  275.76 -     }
  275.77 - 
  275.78 -   void
  275.79 -@@ -110,7 +101,7 @@
  275.80 -   void
  275.81 -   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  275.82 -   {
  275.83 --    if (_S_get_c_locale() != __cloc)
  275.84 -+    if (__cloc && _S_get_c_locale() != __cloc)
  275.85 -       __freelocale(__cloc); 
  275.86 -   }
  275.87 - 
  275.88 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  275.89 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  275.90 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:31:54.000000000 +0200
  275.91 -@@ -39,21 +39,23 @@
  275.92 - #pragma GCC system_header
  275.93 - 
  275.94 - #include <cstring>              // get std::strlen
  275.95 --#include <cstdio>               // get std::snprintf or std::sprintf
  275.96 -+#include <cstdio>               // get std::vsnprintf or std::vsprintf
  275.97 - #include <clocale>
  275.98 - #include <langinfo.h>		// For codecvt
  275.99 - #ifdef __UCLIBC_MJN3_ONLY__
 275.100 - #warning fix this
 275.101 - #endif
 275.102 --#ifdef __UCLIBC_HAS_LOCALE__
 275.103 -+#ifdef _GLIBCXX_USE_ICONV
 275.104 - #include <iconv.h>		// For codecvt using iconv, iconv_t
 275.105 - #endif
 275.106 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 275.107 --#include <libintl.h> 		// For messages
 275.108 -+#ifdef HAVE_LIBINTL_H
 275.109 -+#include <libintl.h>		// For messages
 275.110 - #endif
 275.111 -+#include <cstdarg>
 275.112 - 
 275.113 - #ifdef __UCLIBC_MJN3_ONLY__
 275.114 - #warning what is _GLIBCXX_C_LOCALE_GNU for
 275.115 -+// psm: used in os/gnu-linux/ctype_noninline.h
 275.116 - #endif
 275.117 - #define _GLIBCXX_C_LOCALE_GNU 1
 275.118 - 
 275.119 -@@ -62,7 +64,7 @@
 275.120 - #endif
 275.121 - // #define _GLIBCXX_NUM_CATEGORIES 6
 275.122 - #define _GLIBCXX_NUM_CATEGORIES 0
 275.123 -- 
 275.124 -+
 275.125 - #ifdef __UCLIBC_HAS_XLOCALE__
 275.126 - namespace __gnu_cxx
 275.127 - {
 275.128 -@@ -79,22 +81,24 @@
 275.129 -   typedef int*			__c_locale;
 275.130 - #endif
 275.131 - 
 275.132 --  // Convert numeric value of type _Tv to string and return length of
 275.133 --  // string.  If snprintf is available use it, otherwise fall back to
 275.134 --  // the unsafe sprintf which, in general, can be dangerous and should
 275.135 -+  // Convert numeric value of type double to string and return length of
 275.136 -+  // string.  If vsnprintf is available use it, otherwise fall back to
 275.137 -+  // the unsafe vsprintf which, in general, can be dangerous and should
 275.138 -   // be avoided.
 275.139 --  template<typename _Tv>
 275.140 --    int
 275.141 --    __convert_from_v(char* __out, 
 275.142 --		     const int __size __attribute__ ((__unused__)),
 275.143 --		     const char* __fmt,
 275.144 --#ifdef __UCLIBC_HAS_XCLOCALE__
 275.145 --		     _Tv __v, const __c_locale& __cloc, int __prec)
 275.146 -+    inline int
 275.147 -+    __convert_from_v(const __c_locale&
 275.148 -+#ifndef __UCLIBC_HAS_XCLOCALE__
 275.149 -+					__cloc __attribute__ ((__unused__))
 275.150 -+#endif
 275.151 -+		     ,
 275.152 -+		     char* __out,
 275.153 -+		     const int __size,
 275.154 -+		     const char* __fmt, ...)
 275.155 -     {
 275.156 -+      va_list __args;
 275.157 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 275.158 -       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 275.159 - #else
 275.160 --		     _Tv __v, const __c_locale&, int __prec)
 275.161 --    {
 275.162 - # ifdef __UCLIBC_HAS_LOCALE__
 275.163 -       char* __old = std::setlocale(LC_ALL, NULL);
 275.164 -       char* __sav = new char[std::strlen(__old) + 1];
 275.165 -@@ -103,7 +107,9 @@
 275.166 - # endif
 275.167 - #endif
 275.168 - 
 275.169 --      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 275.170 -+      va_start(__args, __fmt);
 275.171 -+      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 275.172 -+      va_end(__args);
 275.173 - 
 275.174 - #ifdef __UCLIBC_HAS_XCLOCALE__
 275.175 -       __gnu_cxx::__uselocale(__old);
 275.176 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 275.177 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 275.178 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:31:54.000000000 +0200
 275.179 -@@ -33,9 +33,14 @@
 275.180 - 
 275.181 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 275.182 - 
 275.183 -+#include <features.h>
 275.184 -+#ifdef __UCLIBC_HAS_LOCALE__
 275.185 - #define _LIBC
 275.186 - #include <locale>
 275.187 - #undef _LIBC
 275.188 -+#else
 275.189 -+#include <locale>
 275.190 -+#endif
 275.191 - #include <bits/c++locale_internal.h>
 275.192 - 
 275.193 - namespace std
 275.194 -@@ -138,20 +143,34 @@
 275.195 -   ctype<wchar_t>::
 275.196 -   do_is(mask __m, wchar_t __c) const
 275.197 -   { 
 275.198 --    // Highest bitmask in ctype_base == 10, but extra in "C"
 275.199 --    // library for blank.
 275.200 -+    // The case of __m == ctype_base::space is particularly important,
 275.201 -+    // due to its use in many istream functions.  Therefore we deal with
 275.202 -+    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 275.203 -+    // is the mask corresponding to ctype_base::space.  NB: an encoding
 275.204 -+    // change would not affect correctness!
 275.205 -     bool __ret = false;
 275.206 --    const size_t __bitmasksize = 11; 
 275.207 --    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 275.208 --      if (__m & _M_bit[__bitcur]
 275.209 --	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 275.210 --	{
 275.211 --	  __ret = true;
 275.212 --	  break;
 275.213 --	}
 275.214 -+    if (__m == _M_bit[5])
 275.215 -+      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 275.216 -+    else
 275.217 -+      {
 275.218 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 275.219 -+	// library for blank.
 275.220 -+	const size_t __bitmasksize = 11;
 275.221 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 275.222 -+	  if (__m & _M_bit[__bitcur])
 275.223 -+	    {
 275.224 -+	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 275.225 -+		{
 275.226 -+		  __ret = true;
 275.227 -+		  break;
 275.228 -+		}
 275.229 -+	      else if (__m == _M_bit[__bitcur])
 275.230 -+		break;
 275.231 -+	    }
 275.232 -+      }
 275.233 -     return __ret;    
 275.234 -   }
 275.235 --  
 275.236 -+
 275.237 -   const wchar_t* 
 275.238 -   ctype<wchar_t>::
 275.239 -   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 275.240 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 275.241 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 275.242 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
 275.243 -@@ -47,18 +47,21 @@
 275.244 -   template<typename _CharT>
 275.245 -      messages<_CharT>::messages(size_t __refs)
 275.246 -      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 275.247 --     _M_name_messages(_S_get_c_name())
 275.248 -+       _M_name_messages(_S_get_c_name())
 275.249 -      { }
 275.250 - 
 275.251 -   template<typename _CharT>
 275.252 -      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 275.253 - 				size_t __refs) 
 275.254 --     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 275.255 --     _M_name_messages(__s)
 275.256 -+     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 275.257 -      {
 275.258 --       char* __tmp = new char[std::strlen(__s) + 1];
 275.259 --       std::strcpy(__tmp, __s);
 275.260 -+       const size_t __len = std::strlen(__s) + 1;
 275.261 -+       char* __tmp = new char[__len];
 275.262 -+       std::memcpy(__tmp, __s, __len);
 275.263 -        _M_name_messages = __tmp;
 275.264 -+
 275.265 -+       // Last to avoid leaking memory if new throws.
 275.266 -+       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 275.267 -      }
 275.268 - 
 275.269 -   template<typename _CharT>
 275.270 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 275.271 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
 275.272 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:54.000000000 +0200
 275.273 -@@ -33,9 +33,14 @@
 275.274 - 
 275.275 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 275.276 - 
 275.277 -+#include <features.h>
 275.278 -+#ifdef __UCLIBC_HAS_LOCALE__
 275.279 - #define _LIBC
 275.280 - #include <locale>
 275.281 - #undef _LIBC
 275.282 -+#else
 275.283 -+#include <locale>
 275.284 -+#endif
 275.285 - #include <bits/c++locale_internal.h>
 275.286 - 
 275.287 - #ifdef __UCLIBC_MJN3_ONLY__
 275.288 -@@ -206,7 +211,7 @@
 275.289 - 	  }
 275.290 - 	break;
 275.291 -       default:
 275.292 --	;
 275.293 -+	__ret = pattern();
 275.294 -       }
 275.295 -     return __ret;
 275.296 -   }
 275.297 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 275.298 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
 275.299 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:54.000000000 +0200
 275.300 -@@ -33,9 +33,14 @@
 275.301 - 
 275.302 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 275.303 - 
 275.304 -+#include <features.h>
 275.305 -+#ifdef __UCLIBC_HAS_LOCALE__
 275.306 - #define _LIBC
 275.307 - #include <locale>
 275.308 - #undef _LIBC
 275.309 -+#else
 275.310 -+#include <locale>
 275.311 -+#endif
 275.312 - #include <bits/c++locale_internal.h>
 275.313 - 
 275.314 - #ifdef __UCLIBC_MJN3_ONLY__
 275.315 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
 275.316 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
 275.317 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
 275.318 -@@ -37,25 +37,33 @@
 275.319 -   template<typename _CharT>
 275.320 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
 275.321 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 275.322 --    _M_name_timepunct(_S_get_c_name())
 275.323 -+      _M_name_timepunct(_S_get_c_name())
 275.324 -     { _M_initialize_timepunct(); }
 275.325 - 
 275.326 -   template<typename _CharT>
 275.327 -     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 275.328 -     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 275.329 --    _M_name_timepunct(_S_get_c_name())
 275.330 -+      _M_name_timepunct(_S_get_c_name())
 275.331 -     { _M_initialize_timepunct(); }
 275.332 - 
 275.333 -   template<typename _CharT>
 275.334 -     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 275.335 - 				     size_t __refs) 
 275.336 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 275.337 --    _M_name_timepunct(__s)
 275.338 -+      _M_name_timepunct(NULL)
 275.339 -     { 
 275.340 --      char* __tmp = new char[std::strlen(__s) + 1];
 275.341 --      std::strcpy(__tmp, __s);
 275.342 -+      const size_t __len = std::strlen(__s) + 1;
 275.343 -+      char* __tmp = new char[__len];
 275.344 -+      std::memcpy(__tmp, __s, __len);
 275.345 -       _M_name_timepunct = __tmp;
 275.346 --      _M_initialize_timepunct(__cloc); 
 275.347 -+
 275.348 -+      try
 275.349 -+	{ _M_initialize_timepunct(__cloc); }
 275.350 -+      catch(...)
 275.351 -+	{
 275.352 -+	  delete [] _M_name_timepunct;
 275.353 -+	  __throw_exception_again;
 275.354 -+	}
 275.355 -     }
 275.356 - 
 275.357 -   template<typename _CharT>
   276.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   276.2 +++ b/patches/gcc/4.2.2/210-libmudflap-susv3-legacy.patch	Mon Jul 28 21:32:33 2008 +0000
   276.3 @@ -0,0 +1,48 @@
   276.4 +diff -durN gcc-4.2.1.orig/libmudflap/mf-hooks2.c gcc-4.2.1/libmudflap/mf-hooks2.c
   276.5 +--- gcc-4.2.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   276.6 ++++ gcc-4.2.1/libmudflap/mf-hooks2.c	2007-08-03 20:35:09.000000000 +0200
   276.7 +@@ -427,7 +427,7 @@
   276.8 + {
   276.9 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  276.10 +   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  276.11 +-  bzero (s, n);
  276.12 ++  memset (s, 0, n);
  276.13 + }
  276.14 + 
  276.15 + 
  276.16 +@@ -437,7 +437,7 @@
  276.17 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  276.18 +   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  276.19 +   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  276.20 +-  bcopy (src, dest, n);
  276.21 ++  memmove (dest, src, n);
  276.22 + }
  276.23 + 
  276.24 + 
  276.25 +@@ -447,7 +447,7 @@
  276.26 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  276.27 +   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  276.28 +   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  276.29 +-  return bcmp (s1, s2, n);
  276.30 ++  return n == 0 ? 0 : memcmp (s1, s2, n);
  276.31 + }
  276.32 + 
  276.33 + 
  276.34 +@@ -456,7 +456,7 @@
  276.35 +   size_t n = strlen (s);
  276.36 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  276.37 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  276.38 +-  return index (s, c);
  276.39 ++  return strchr (s, c);
  276.40 + }
  276.41 + 
  276.42 + 
  276.43 +@@ -465,7 +465,7 @@
  276.44 +   size_t n = strlen (s);
  276.45 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  276.46 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  276.47 +-  return rindex (s, c);
  276.48 ++  return strrchr (s, c);
  276.49 + }
  276.50 + 
  276.51 + /* XXX:  stpcpy, memccpy */
   277.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   277.2 +++ b/patches/gcc/4.2.2/220-libstdc++-namespace.patch	Mon Jul 28 21:32:33 2008 +0000
   277.3 @@ -0,0 +1,36 @@
   277.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
   277.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
   277.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:35:40.000000000 +0200
   277.7 +@@ -32,7 +32,8 @@
   277.8 + //
   277.9 + 
  277.10 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  277.11 +-
  277.12 ++namespace std
  277.13 ++{
  277.14 + #ifdef __UCLIBC_MJN3_ONLY__
  277.15 + #warning fix prototypes for *textdomain funcs
  277.16 + #endif
  277.17 +@@ -115,3 +116,4 @@
  277.18 + 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  277.19 + 	 }
  277.20 +      }
  277.21 ++}
  277.22 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
  277.23 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
  277.24 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:35:40.000000000 +0200
  277.25 +@@ -33,7 +33,8 @@
  277.26 + //
  277.27 + 
  277.28 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  277.29 +-
  277.30 ++namespace std
  277.31 ++{
  277.32 +   template<typename _CharT>
  277.33 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
  277.34 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  277.35 +@@ -74,3 +75,4 @@
  277.36 +       delete _M_data; 
  277.37 +       _S_destroy_c_locale(_M_c_locale_timepunct); 
  277.38 +     }
  277.39 ++}
   278.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   278.2 +++ b/patches/gcc/4.2.2/230-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:32:33 2008 +0000
   278.3 @@ -0,0 +1,12 @@
   278.4 +diff -durN gcc-4.2.1.orig/gcc/Makefile.in gcc-4.2.1/gcc/Makefile.in
   278.5 +--- gcc-4.2.1.orig/gcc/Makefile.in	2007-05-31 17:37:38.000000000 +0200
   278.6 ++++ gcc-4.2.1/gcc/Makefile.in	2007-08-03 20:36:14.000000000 +0200
   278.7 +@@ -2660,7 +2660,7 @@
   278.8 + # FIXME: writing proper dependencies for this is a *LOT* of work.
   278.9 + libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
  278.10 +   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  278.11 +-  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  278.12 ++  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  278.13 + 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  278.14 + 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  278.15 + 	  -DLOCALEDIR=\"$(localedir)\" \
   279.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   279.2 +++ b/patches/gcc/4.2.2/240-arm-bigendian.patch	Mon Jul 28 21:32:33 2008 +0000
   279.3 @@ -0,0 +1,64 @@
   279.4 +diff -durN gcc-4.2.1.orig/gcc/config/arm/linux-elf.h gcc-4.2.1/gcc/config/arm/linux-elf.h
   279.5 +--- gcc-4.2.1.orig/gcc/config/arm/linux-elf.h	2006-02-17 00:29:10.000000000 +0100
   279.6 ++++ gcc-4.2.1/gcc/config/arm/linux-elf.h	2007-08-03 20:36:43.000000000 +0200
   279.7 +@@ -28,19 +28,33 @@
   279.8 + #undef  TARGET_VERSION
   279.9 + #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  279.10 + 
  279.11 ++/*
  279.12 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  279.13 ++ * (big endian) configurations.
  279.14 ++ */
  279.15 ++#if TARGET_BIG_ENDIAN_DEFAULT
  279.16 ++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  279.17 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
  279.18 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
  279.19 ++#else
  279.20 ++#define TARGET_ENDIAN_DEFAULT 0
  279.21 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
  279.22 ++#define TARGET_LINKER_EMULATION "armelf_linux"
  279.23 ++#endif
  279.24 ++
  279.25 + #undef  TARGET_DEFAULT_FLOAT_ABI
  279.26 + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  279.27 + 
  279.28 + #undef  TARGET_DEFAULT
  279.29 +-#define TARGET_DEFAULT (0)
  279.30 ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  279.31 + 
  279.32 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  279.33 + 
  279.34 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  279.35 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  279.36 + 
  279.37 + #undef  MULTILIB_DEFAULTS
  279.38 + #define MULTILIB_DEFAULTS \
  279.39 +-	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  279.40 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  279.41 + 
  279.42 + /* Now we define the strings used to build the spec file.  */
  279.43 + #undef  LIB_SPEC
  279.44 +@@ -61,7 +75,7 @@
  279.45 +    %{rdynamic:-export-dynamic} \
  279.46 +    %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
  279.47 +    -X \
  279.48 +-   %{mbig-endian:-EB}" \
  279.49 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  279.50 +    SUBTARGET_EXTRA_LINK_SPEC
  279.51 + 
  279.52 + #undef  LINK_SPEC
  279.53 +diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
  279.54 +--- gcc-4.2.1.orig/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
  279.55 ++++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:36:43.000000000 +0200
  279.56 +@@ -705,6 +705,11 @@
  279.57 + 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  279.58 + 	tmake_file="${tmake_file} t-linux arm/t-arm"
  279.59 + 	case ${target} in
  279.60 ++	arm*b-*)
  279.61 ++		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  279.62 ++		;;
  279.63 ++	esac
  279.64 ++	case ${target} in
  279.65 + 	arm*-*-linux-*eabi)
  279.66 + 	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
  279.67 + 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
   280.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   280.2 +++ b/patches/gcc/4.2.2/250-softfloat-fix.patch	Mon Jul 28 21:32:33 2008 +0000
   280.3 @@ -0,0 +1,58 @@
   280.4 +This patch (C) 2007 Yann E. MORIN
   280.5 +Licensed under GPL v2.
   280.6 +
   280.7 +First hunk of this patch solves compiling uClibc:
   280.8 +
   280.9 +make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  280.10 +  LD libuClibc-0.9.29.so
  280.11 +libc/libc_so.a(difftime.os): In function `difftime':
  280.12 +difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  280.13 +difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  280.14 +libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  280.15 +_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  280.16 +_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  280.17 +_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  280.18 +_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  280.19 +_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  280.20 +_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  280.21 +_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  280.22 +libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  280.23 +__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  280.24 +libc/libc_so.a(strtof.os): In function `strtof':
  280.25 +strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  280.26 +/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  280.27 +In function `__fixunsdfsi':
  280.28 +libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  280.29 +make[2]: *** [lib/libc.so] Error 1
  280.30 +make[1]: *** [lib/libc.so.0] Error 2
  280.31 +make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  280.32 +make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  280.33 +Error 2
  280.34 +
  280.35 +The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  280.36 +
  280.37 +
  280.38 +diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
  280.39 +--- gcc-4.2.0.orig/gcc/config.gcc	2007-07-15 11:24:18.000000000 +0200
  280.40 ++++ gcc-4.2.0/gcc/config.gcc	2007-07-15 11:26:02.000000000 +0200
  280.41 +@@ -721,7 +721,7 @@
  280.42 + 	    default_use_cxa_atexit=yes
  280.43 + 	    ;;
  280.44 + 	*)
  280.45 +-	    tmake_file="$tmake_file arm/t-linux"
  280.46 ++	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  280.47 + 	    ;;
  280.48 + 	esac
  280.49 + 	tm_file="$tm_file arm/aout.h arm/arm.h"
  280.50 +diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
  280.51 +--- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h	2007-07-15 11:24:18.000000000 +0200
  280.52 ++++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2007-07-15 11:26:02.000000000 +0200
  280.53 +@@ -63,7 +63,7 @@
  280.54 +    %{shared:-lc} \
  280.55 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  280.56 + 
  280.57 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  280.58 ++#define LIBGCC_SPEC "-lgcc"
  280.59 + 
  280.60 + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  280.61 + 
   281.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   281.2 +++ b/patches/gcc/4.2.2/260-flatten-switch-stmt-00.patch	Mon Jul 28 21:32:33 2008 +0000
   281.3 @@ -0,0 +1,24 @@
   281.4 +diff -durN gcc-4.2.1.orig/gcc/stmt.c gcc-4.2.1/gcc/stmt.c
   281.5 +--- gcc-4.2.1.orig/gcc/stmt.c	2007-07-19 05:25:32.000000000 +0200
   281.6 ++++ gcc-4.2.1/gcc/stmt.c	2007-08-03 20:37:19.000000000 +0200
   281.7 +@@ -2512,7 +2512,11 @@
   281.8 + 	  use_cost_table
   281.9 + 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  281.10 + 	       && estimate_case_costs (case_list));
  281.11 +-	  balance_case_nodes (&case_list, NULL);
  281.12 ++	  /* When optimizing for size, we want a straight list to avoid
  281.13 ++	     jumps as much as possible. This basically creates an if-else
  281.14 ++	     chain.  */
  281.15 ++	  if (!optimize_size)
  281.16 ++	    balance_case_nodes (&case_list, NULL);
  281.17 + 	  emit_case_nodes (index, case_list, default_label, index_type);
  281.18 + 	  emit_jump (default_label);
  281.19 + 	}
  281.20 +@@ -3070,6 +3074,7 @@
  281.21 + 	    {
  281.22 + 	      if (!node_has_low_bound (node, index_type))
  281.23 + 		{
  281.24 ++		  if (!optimize_size) /* don't jl to the .default_label. */
  281.25 + 		  emit_cmp_and_jump_insns (index,
  281.26 + 					   convert_modes
  281.27 + 					   (mode, imode,
   282.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   282.2 +++ b/patches/gcc/4.2.2/270-soft-float.patch	Mon Jul 28 21:32:33 2008 +0000
   282.3 @@ -0,0 +1,21 @@
   282.4 +diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
   282.5 +--- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c	2007-03-05 11:54:00.000000000 -0500
   282.6 ++++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c	2008-01-31 17:51:24.000000000 -0500
   282.7 +@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
   282.8 +    but GCC currently generates poor code when a union is used to turn
   282.9 +    a long double into a pair of doubles.  */
  282.10 + 
  282.11 ++#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  282.12 ++
  282.13 + long double __gcc_qadd (double, double, double, double);
  282.14 + long double __gcc_qsub (double, double, double, double);
  282.15 + long double __gcc_qmul (double, double, double, double);
  282.16 +@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
  282.17 +   return z.ldval;
  282.18 + }
  282.19 + 
  282.20 +-#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  282.21 +-
  282.22 + long double __gcc_qneg (double, double);
  282.23 + int __gcc_qeq (double, double, double, double);
  282.24 + int __gcc_qne (double, double, double, double);
   283.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   283.2 +++ b/patches/gcc/4.2.2/280-alpha-signal_h.patch	Mon Jul 28 21:32:33 2008 +0000
   283.3 @@ -0,0 +1,17 @@
   283.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   283.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   283.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   283.7 + /* Do code reading to identify a signal frame, and set the frame
   283.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
   283.9 + 
  283.10 ++/* Don't use this if inhibit_libc is set
  283.11 ++   The build for this target will fail trying to include missing headers */
  283.12 ++#ifndef inhibit_libc
  283.13 + #include <signal.h>
  283.14 + #include <sys/ucontext.h>
  283.15 + 
  283.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  283.17 +   fs->retaddr_column = 64;
  283.18 +   return _URC_NO_REASON;
  283.19 + }
  283.20 ++#endif /* inhibit_libc */
   284.1 --- a/patches/gcc/4.2.2/300-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   284.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   284.3 @@ -1,50 +0,0 @@
   284.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am gcc-4.2.1/libstdc++-v3/src/Makefile.am
   284.5 ---- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am	2006-07-28 06:57:34.000000000 +0200
   284.6 -+++ gcc-4.2.1/libstdc++-v3/src/Makefile.am	2007-08-03 20:32:27.000000000 +0200
   284.7 -@@ -257,6 +257,12 @@
   284.8 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
   284.9 - 
  284.10 - 
  284.11 -+install-exec-local:
  284.12 -+ifeq ($(enable_shared),yes)
  284.13 -+	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  284.14 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  284.15 -+endif
  284.16 -+
  284.17 - # Added bits to build debug library.
  284.18 - if GLIBCXX_BUILD_DEBUG
  284.19 - all-local: build_debug
  284.20 -diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in gcc-4.2.1/libstdc++-v3/src/Makefile.in
  284.21 ---- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in	2006-10-16 21:08:22.000000000 +0200
  284.22 -+++ gcc-4.2.1/libstdc++-v3/src/Makefile.in	2007-08-03 20:32:27.000000000 +0200
  284.23 -@@ -657,7 +657,7 @@
  284.24 - 
  284.25 - install-data-am: install-data-local
  284.26 - 
  284.27 --install-exec-am: install-toolexeclibLTLIBRARIES
  284.28 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  284.29 - 
  284.30 - install-info: install-info-am
  284.31 - 
  284.32 -@@ -690,6 +690,7 @@
  284.33 - 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  284.34 - 	html-am info info-am install install-am install-data \
  284.35 - 	install-data-am install-data-local install-exec \
  284.36 -+	install-exec-local \
  284.37 - 	install-exec-am install-info install-info-am install-man \
  284.38 - 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  284.39 - 	installcheck-am installdirs maintainer-clean \
  284.40 -@@ -799,6 +800,13 @@
  284.41 - install_debug:
  284.42 - 	(cd ${debugdir} && $(MAKE) \
  284.43 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  284.44 -+
  284.45 -+install-exec-local:
  284.46 -+ifeq ($(enable_shared),yes)
  284.47 -+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  284.48 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  284.49 -+endif
  284.50 -+
  284.51 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  284.52 - # Otherwise a system limit (for SysV at least) may be exceeded.
  284.53 - .NOEXPORT:
   285.1 --- a/patches/gcc/4.2.2/301-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   285.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   285.3 @@ -1,12 +0,0 @@
   285.4 -diff -durN gcc-4.2.1.orig/boehm-gc/include/gc.h gcc-4.2.1/boehm-gc/include/gc.h
   285.5 ---- gcc-4.2.1.orig/boehm-gc/include/gc.h	2006-09-18 20:45:08.000000000 +0200
   285.6 -+++ gcc-4.2.1/boehm-gc/include/gc.h	2007-08-03 20:33:00.000000000 +0200
   285.7 -@@ -502,7 +502,7 @@
   285.8 - #if defined(__linux__) || defined(__GLIBC__)
   285.9 - # include <features.h>
  285.10 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  285.11 --     && !defined(__ia64__)
  285.12 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  285.13 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  285.14 - #     define GC_HAVE_BUILTIN_BACKTRACE
  285.15 - #   endif
   286.1 --- a/patches/gcc/4.2.2/302-c99-snprintf.patch	Mon Jul 28 21:08:01 2008 +0000
   286.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   286.3 @@ -1,12 +0,0 @@
   286.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h
   286.5 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h	2006-12-07 10:33:51.000000000 +0100
   286.6 -+++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h	2007-08-03 20:33:24.000000000 +0200
   286.7 -@@ -144,7 +144,7 @@
   286.8 - 
   286.9 - _GLIBCXX_END_NAMESPACE
  286.10 - 
  286.11 --#if _GLIBCXX_USE_C99
  286.12 -+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  286.13 - 
  286.14 - #undef snprintf
  286.15 - #undef vfscanf
   287.1 --- a/patches/gcc/4.2.2/303-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   287.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   287.3 @@ -1,13 +0,0 @@
   287.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
   287.5 ---- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
   287.6 -+++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:33:56.000000000 +0200
   287.7 -@@ -7514,6 +7514,9 @@
   287.8 - cat >>conftest.$ac_ext <<_ACEOF
   287.9 - /* end confdefs.h.  */
  287.10 - #include <complex.h>
  287.11 -+#ifdef __UCLIBC__
  287.12 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  287.13 -+#endif
  287.14 - int
  287.15 - main ()
  287.16 - {
   288.1 --- a/patches/gcc/4.2.2/304-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   288.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   288.3 @@ -1,26 +0,0 @@
   288.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/rope gcc-4.2.1/libstdc++-v3/include/ext/rope
   288.5 ---- gcc-4.2.1.orig/libstdc++-v3/include/ext/rope	2006-10-17 13:56:21.000000000 +0200
   288.6 -+++ gcc-4.2.1/libstdc++-v3/include/ext/rope	2007-08-03 20:34:23.000000000 +0200
   288.7 -@@ -58,6 +58,9 @@
   288.8 - #include <bits/allocator.h>
   288.9 - #include <ext/hash_fun.h>
  288.10 - 
  288.11 -+/* cope w/ index defined as macro, SuSv3 proposal */
  288.12 -+#undef index
  288.13 -+
  288.14 - # ifdef __GC
  288.15 - #   define __GC_CONST const
  288.16 - # else
  288.17 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h
  288.18 ---- gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2006-10-17 13:56:21.000000000 +0200
  288.19 -+++ gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h	2007-08-03 20:34:23.000000000 +0200
  288.20 -@@ -54,6 +54,9 @@
  288.21 - #include <ext/memory> // For uninitialized_copy_n
  288.22 - #include <ext/numeric> // For power
  288.23 - 
  288.24 -+/* cope w/ index defined as macro, SuSv3 proposal */
  288.25 -+#undef index
  288.26 -+
  288.27 - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  288.28 - 
  288.29 -   using std::size_t;
   289.1 --- a/patches/gcc/4.2.2/305-libmudflap-susv3-legacy.patch	Mon Jul 28 21:08:01 2008 +0000
   289.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   289.3 @@ -1,48 +0,0 @@
   289.4 -diff -durN gcc-4.2.1.orig/libmudflap/mf-hooks2.c gcc-4.2.1/libmudflap/mf-hooks2.c
   289.5 ---- gcc-4.2.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   289.6 -+++ gcc-4.2.1/libmudflap/mf-hooks2.c	2007-08-03 20:35:09.000000000 +0200
   289.7 -@@ -427,7 +427,7 @@
   289.8 - {
   289.9 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  289.10 -   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  289.11 --  bzero (s, n);
  289.12 -+  memset (s, 0, n);
  289.13 - }
  289.14 - 
  289.15 - 
  289.16 -@@ -437,7 +437,7 @@
  289.17 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  289.18 -   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  289.19 -   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  289.20 --  bcopy (src, dest, n);
  289.21 -+  memmove (dest, src, n);
  289.22 - }
  289.23 - 
  289.24 - 
  289.25 -@@ -447,7 +447,7 @@
  289.26 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  289.27 -   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  289.28 -   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  289.29 --  return bcmp (s1, s2, n);
  289.30 -+  return n == 0 ? 0 : memcmp (s1, s2, n);
  289.31 - }
  289.32 - 
  289.33 - 
  289.34 -@@ -456,7 +456,7 @@
  289.35 -   size_t n = strlen (s);
  289.36 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  289.37 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  289.38 --  return index (s, c);
  289.39 -+  return strchr (s, c);
  289.40 - }
  289.41 - 
  289.42 - 
  289.43 -@@ -465,7 +465,7 @@
  289.44 -   size_t n = strlen (s);
  289.45 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  289.46 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  289.47 --  return rindex (s, c);
  289.48 -+  return strrchr (s, c);
  289.49 - }
  289.50 - 
  289.51 - /* XXX:  stpcpy, memccpy */
   290.1 --- a/patches/gcc/4.2.2/306-libstdc++-namespace.patch	Mon Jul 28 21:08:01 2008 +0000
   290.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   290.3 @@ -1,36 +0,0 @@
   290.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
   290.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
   290.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:35:40.000000000 +0200
   290.7 -@@ -32,7 +32,8 @@
   290.8 - //
   290.9 - 
  290.10 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  290.11 --
  290.12 -+namespace std
  290.13 -+{
  290.14 - #ifdef __UCLIBC_MJN3_ONLY__
  290.15 - #warning fix prototypes for *textdomain funcs
  290.16 - #endif
  290.17 -@@ -115,3 +116,4 @@
  290.18 - 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  290.19 - 	 }
  290.20 -      }
  290.21 -+}
  290.22 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
  290.23 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
  290.24 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:35:40.000000000 +0200
  290.25 -@@ -33,7 +33,8 @@
  290.26 - //
  290.27 - 
  290.28 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  290.29 --
  290.30 -+namespace std
  290.31 -+{
  290.32 -   template<typename _CharT>
  290.33 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
  290.34 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  290.35 -@@ -74,3 +75,4 @@
  290.36 -       delete _M_data; 
  290.37 -       _S_destroy_c_locale(_M_c_locale_timepunct); 
  290.38 -     }
  290.39 -+}
   291.1 --- a/patches/gcc/4.2.2/402-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:08:01 2008 +0000
   291.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   291.3 @@ -1,12 +0,0 @@
   291.4 -diff -durN gcc-4.2.1.orig/gcc/Makefile.in gcc-4.2.1/gcc/Makefile.in
   291.5 ---- gcc-4.2.1.orig/gcc/Makefile.in	2007-05-31 17:37:38.000000000 +0200
   291.6 -+++ gcc-4.2.1/gcc/Makefile.in	2007-08-03 20:36:14.000000000 +0200
   291.7 -@@ -2660,7 +2660,7 @@
   291.8 - # FIXME: writing proper dependencies for this is a *LOT* of work.
   291.9 - libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
  291.10 -   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  291.11 --  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  291.12 -+  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  291.13 - 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  291.14 - 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  291.15 - 	  -DLOCALEDIR=\"$(localedir)\" \
   292.1 --- a/patches/gcc/4.2.2/800-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
   292.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   292.3 @@ -1,64 +0,0 @@
   292.4 -diff -durN gcc-4.2.1.orig/gcc/config/arm/linux-elf.h gcc-4.2.1/gcc/config/arm/linux-elf.h
   292.5 ---- gcc-4.2.1.orig/gcc/config/arm/linux-elf.h	2006-02-17 00:29:10.000000000 +0100
   292.6 -+++ gcc-4.2.1/gcc/config/arm/linux-elf.h	2007-08-03 20:36:43.000000000 +0200
   292.7 -@@ -28,19 +28,33 @@
   292.8 - #undef  TARGET_VERSION
   292.9 - #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  292.10 - 
  292.11 -+/*
  292.12 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  292.13 -+ * (big endian) configurations.
  292.14 -+ */
  292.15 -+#if TARGET_BIG_ENDIAN_DEFAULT
  292.16 -+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  292.17 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
  292.18 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
  292.19 -+#else
  292.20 -+#define TARGET_ENDIAN_DEFAULT 0
  292.21 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
  292.22 -+#define TARGET_LINKER_EMULATION "armelf_linux"
  292.23 -+#endif
  292.24 -+
  292.25 - #undef  TARGET_DEFAULT_FLOAT_ABI
  292.26 - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  292.27 - 
  292.28 - #undef  TARGET_DEFAULT
  292.29 --#define TARGET_DEFAULT (0)
  292.30 -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  292.31 - 
  292.32 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  292.33 - 
  292.34 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  292.35 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  292.36 - 
  292.37 - #undef  MULTILIB_DEFAULTS
  292.38 - #define MULTILIB_DEFAULTS \
  292.39 --	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  292.40 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  292.41 - 
  292.42 - /* Now we define the strings used to build the spec file.  */
  292.43 - #undef  LIB_SPEC
  292.44 -@@ -61,7 +75,7 @@
  292.45 -    %{rdynamic:-export-dynamic} \
  292.46 -    %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
  292.47 -    -X \
  292.48 --   %{mbig-endian:-EB}" \
  292.49 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  292.50 -    SUBTARGET_EXTRA_LINK_SPEC
  292.51 - 
  292.52 - #undef  LINK_SPEC
  292.53 -diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
  292.54 ---- gcc-4.2.1.orig/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
  292.55 -+++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:36:43.000000000 +0200
  292.56 -@@ -705,6 +705,11 @@
  292.57 - 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  292.58 - 	tmake_file="${tmake_file} t-linux arm/t-arm"
  292.59 - 	case ${target} in
  292.60 -+	arm*b-*)
  292.61 -+		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  292.62 -+		;;
  292.63 -+	esac
  292.64 -+	case ${target} in
  292.65 - 	arm*-*-linux-*eabi)
  292.66 - 	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
  292.67 - 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
   293.1 --- a/patches/gcc/4.2.2/801-softfloat-fix.patch	Mon Jul 28 21:08:01 2008 +0000
   293.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   293.3 @@ -1,58 +0,0 @@
   293.4 -This patch (C) 2007 Yann E. MORIN
   293.5 -Licensed under GPL v2.
   293.6 -
   293.7 -First hunk of this patch solves compiling uClibc:
   293.8 -
   293.9 -make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  293.10 -  LD libuClibc-0.9.29.so
  293.11 -libc/libc_so.a(difftime.os): In function `difftime':
  293.12 -difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  293.13 -difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  293.14 -libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  293.15 -_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  293.16 -_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  293.17 -_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  293.18 -_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  293.19 -_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  293.20 -_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  293.21 -_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  293.22 -libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  293.23 -__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  293.24 -libc/libc_so.a(strtof.os): In function `strtof':
  293.25 -strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  293.26 -/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  293.27 -In function `__fixunsdfsi':
  293.28 -libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  293.29 -make[2]: *** [lib/libc.so] Error 1
  293.30 -make[1]: *** [lib/libc.so.0] Error 2
  293.31 -make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  293.32 -make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  293.33 -Error 2
  293.34 -
  293.35 -The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  293.36 -
  293.37 -
  293.38 -diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
  293.39 ---- gcc-4.2.0.orig/gcc/config.gcc	2007-07-15 11:24:18.000000000 +0200
  293.40 -+++ gcc-4.2.0/gcc/config.gcc	2007-07-15 11:26:02.000000000 +0200
  293.41 -@@ -721,7 +721,7 @@
  293.42 - 	    default_use_cxa_atexit=yes
  293.43 - 	    ;;
  293.44 - 	*)
  293.45 --	    tmake_file="$tmake_file arm/t-linux"
  293.46 -+	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  293.47 - 	    ;;
  293.48 - 	esac
  293.49 - 	tm_file="$tm_file arm/aout.h arm/arm.h"
  293.50 -diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
  293.51 ---- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h	2007-07-15 11:24:18.000000000 +0200
  293.52 -+++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2007-07-15 11:26:02.000000000 +0200
  293.53 -@@ -63,7 +63,7 @@
  293.54 -    %{shared:-lc} \
  293.55 -    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  293.56 - 
  293.57 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  293.58 -+#define LIBGCC_SPEC "-lgcc"
  293.59 - 
  293.60 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  293.61 - 
   294.1 --- a/patches/gcc/4.2.2/904-flatten-switch-stmt-00.patch	Mon Jul 28 21:08:01 2008 +0000
   294.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   294.3 @@ -1,24 +0,0 @@
   294.4 -diff -durN gcc-4.2.1.orig/gcc/stmt.c gcc-4.2.1/gcc/stmt.c
   294.5 ---- gcc-4.2.1.orig/gcc/stmt.c	2007-07-19 05:25:32.000000000 +0200
   294.6 -+++ gcc-4.2.1/gcc/stmt.c	2007-08-03 20:37:19.000000000 +0200
   294.7 -@@ -2512,7 +2512,11 @@
   294.8 - 	  use_cost_table
   294.9 - 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  294.10 - 	       && estimate_case_costs (case_list));
  294.11 --	  balance_case_nodes (&case_list, NULL);
  294.12 -+	  /* When optimizing for size, we want a straight list to avoid
  294.13 -+	     jumps as much as possible. This basically creates an if-else
  294.14 -+	     chain.  */
  294.15 -+	  if (!optimize_size)
  294.16 -+	    balance_case_nodes (&case_list, NULL);
  294.17 - 	  emit_case_nodes (index, case_list, default_label, index_type);
  294.18 - 	  emit_jump (default_label);
  294.19 - 	}
  294.20 -@@ -3070,6 +3074,7 @@
  294.21 - 	    {
  294.22 - 	      if (!node_has_low_bound (node, index_type))
  294.23 - 		{
  294.24 -+		  if (!optimize_size) /* don't jl to the .default_label. */
  294.25 - 		  emit_cmp_and_jump_insns (index,
  294.26 - 					   convert_modes
  294.27 - 					   (mode, imode,
   295.1 --- a/patches/gcc/4.2.2/920-soft-float.patch	Mon Jul 28 21:08:01 2008 +0000
   295.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   295.3 @@ -1,21 +0,0 @@
   295.4 -diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
   295.5 ---- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c	2007-03-05 11:54:00.000000000 -0500
   295.6 -+++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c	2008-01-31 17:51:24.000000000 -0500
   295.7 -@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
   295.8 -    but GCC currently generates poor code when a union is used to turn
   295.9 -    a long double into a pair of doubles.  */
  295.10 - 
  295.11 -+#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  295.12 -+
  295.13 - long double __gcc_qadd (double, double, double, double);
  295.14 - long double __gcc_qsub (double, double, double, double);
  295.15 - long double __gcc_qmul (double, double, double, double);
  295.16 -@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
  295.17 -   return z.ldval;
  295.18 - }
  295.19 - 
  295.20 --#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  295.21 --
  295.22 - long double __gcc_qneg (double, double);
  295.23 - int __gcc_qeq (double, double, double, double);
  295.24 - int __gcc_qne (double, double, double, double);
   296.1 --- a/patches/gcc/4.2.2/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
   296.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   296.3 @@ -1,17 +0,0 @@
   296.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   296.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   296.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   296.7 - /* Do code reading to identify a signal frame, and set the frame
   296.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
   296.9 - 
  296.10 -+/* Don't use this if inhibit_libc is set
  296.11 -+   The build for this target will fail trying to include missing headers */
  296.12 -+#ifndef inhibit_libc
  296.13 - #include <signal.h>
  296.14 - #include <sys/ucontext.h>
  296.15 - 
  296.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  296.17 -   fs->retaddr_column = 64;
  296.18 -   return _URC_NO_REASON;
  296.19 - }
  296.20 -+#endif /* inhibit_libc */
   297.1 --- a/patches/gcc/4.2.3/103-uclibc-conf-noupstream.patch	Mon Jul 28 21:08:01 2008 +0000
   297.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   297.3 @@ -1,12 +0,0 @@
   297.4 -diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
   297.5 ---- gcc-4.2.1.orig/gcc/config.gcc	2007-02-03 06:25:20.000000000 +0100
   297.6 -+++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
   297.7 -@@ -1964,7 +1964,7 @@
   297.8 -         ;;
   297.9 - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  297.10 - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  297.11 --  sh-*-linux* | sh[346lbe]*-*-linux* | \
  297.12 -+  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  297.13 -   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  297.14 -    sh64-*-netbsd* | sh64l*-*-netbsd*)
  297.15 - 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   298.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   298.2 +++ b/patches/gcc/4.2.3/110-uclibc-conf-noupstream.patch	Mon Jul 28 21:32:33 2008 +0000
   298.3 @@ -0,0 +1,12 @@
   298.4 +diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
   298.5 +--- gcc-4.2.1.orig/gcc/config.gcc	2007-02-03 06:25:20.000000000 +0100
   298.6 ++++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
   298.7 +@@ -1964,7 +1964,7 @@
   298.8 +         ;;
   298.9 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  298.10 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  298.11 +-  sh-*-linux* | sh[346lbe]*-*-linux* | \
  298.12 ++  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  298.13 +   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  298.14 +    sh64-*-netbsd* | sh64l*-*-netbsd*)
  298.15 + 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   299.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   299.2 +++ b/patches/gcc/4.2.3/120-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   299.3 @@ -0,0 +1,2806 @@
   299.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 gcc-4.2.1/libstdc++-v3/acinclude.m4
   299.5 +--- gcc-4.2.1.orig/libstdc++-v3/acinclude.m4	2007-06-29 01:02:05.000000000 +0200
   299.6 ++++ gcc-4.2.1/libstdc++-v3/acinclude.m4	2007-08-03 20:30:21.000000000 +0200
   299.7 +@@ -1334,7 +1334,7 @@
   299.8 + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   299.9 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  299.10 +     [use MODEL for target locale package],
  299.11 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  299.12 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  299.13 + 
  299.14 +   # Deal with gettext issues.  Default to not using it (=no) until we detect
  299.15 +   # support for it later.  Let the user turn it off via --e/d, but let that
  299.16 +@@ -1355,6 +1355,9 @@
  299.17 +   # Default to "generic".
  299.18 +   if test $enable_clocale_flag = auto; then
  299.19 +     case ${target_os} in
  299.20 ++      *-uclibc*)
  299.21 ++        enable_clocale_flag=uclibc
  299.22 ++        ;;
  299.23 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  299.24 +         enable_clocale_flag=gnu	
  299.25 +         ;;
  299.26 +@@ -1526,6 +1529,40 @@
  299.27 +       CTIME_CC=config/locale/generic/time_members.cc
  299.28 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  299.29 +       ;;
  299.30 ++    uclibc)
  299.31 ++      AC_MSG_RESULT(uclibc)
  299.32 ++
  299.33 ++      # Declare intention to use gettext, and add support for specific
  299.34 ++      # languages.
  299.35 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  299.36 ++      ALL_LINGUAS="de fr"
  299.37 ++
  299.38 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  299.39 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  299.40 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  299.41 ++        USE_NLS=yes
  299.42 ++      fi
  299.43 ++      # Export the build objects.
  299.44 ++      for ling in $ALL_LINGUAS; do \
  299.45 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  299.46 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  299.47 ++      done
  299.48 ++      AC_SUBST(glibcxx_MOFILES)
  299.49 ++      AC_SUBST(glibcxx_POFILES)
  299.50 ++
  299.51 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  299.52 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  299.53 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  299.54 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  299.55 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  299.56 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  299.57 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  299.58 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  299.59 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  299.60 ++      CTIME_H=config/locale/uclibc/time_members.h
  299.61 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  299.62 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  299.63 ++      ;;
  299.64 +   esac
  299.65 + 
  299.66 +   # This is where the testsuite looks for locale catalogs, using the
  299.67 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
  299.68 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  299.69 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
  299.70 +@@ -0,0 +1,160 @@
  299.71 ++// Wrapper for underlying C-language localization -*- C++ -*-
  299.72 ++
  299.73 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  299.74 ++//
  299.75 ++// This file is part of the GNU ISO C++ Library.  This library is free
  299.76 ++// software; you can redistribute it and/or modify it under the
  299.77 ++// terms of the GNU General Public License as published by the
  299.78 ++// Free Software Foundation; either version 2, or (at your option)
  299.79 ++// any later version.
  299.80 ++
  299.81 ++// This library is distributed in the hope that it will be useful,
  299.82 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  299.83 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  299.84 ++// GNU General Public License for more details.
  299.85 ++
  299.86 ++// You should have received a copy of the GNU General Public License along
  299.87 ++// with this library; see the file COPYING.  If not, write to the Free
  299.88 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  299.89 ++// USA.
  299.90 ++
  299.91 ++// As a special exception, you may use this file as part of a free software
  299.92 ++// library without restriction.  Specifically, if other files instantiate
  299.93 ++// templates or use macros or inline functions from this file, or you compile
  299.94 ++// this file and link it with other files to produce an executable, this
  299.95 ++// file does not by itself cause the resulting executable to be covered by
  299.96 ++// the GNU General Public License.  This exception does not however
  299.97 ++// invalidate any other reasons why the executable file might be covered by
  299.98 ++// the GNU General Public License.
  299.99 ++
 299.100 ++//
 299.101 ++// ISO C++ 14882: 22.8  Standard locale categories.
 299.102 ++//
 299.103 ++
 299.104 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 299.105 ++
 299.106 ++#include <cerrno>  // For errno
 299.107 ++#include <locale>
 299.108 ++#include <stdexcept>
 299.109 ++#include <langinfo.h>
 299.110 ++#include <bits/c++locale_internal.h>
 299.111 ++
 299.112 ++#ifndef __UCLIBC_HAS_XLOCALE__
 299.113 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 299.114 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 299.115 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 299.116 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 299.117 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 299.118 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 299.119 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 299.120 ++#warning should dummy __newlocale check for C|POSIX ?
 299.121 ++#define __newlocale(a, b, c)        NULL
 299.122 ++#define __freelocale(a)             ((void)0)
 299.123 ++#define __duplocale(a)              __c_locale()
 299.124 ++#endif
 299.125 ++
 299.126 ++namespace std 
 299.127 ++{
 299.128 ++  template<>
 299.129 ++    void
 299.130 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 299.131 ++		   const __c_locale& __cloc)
 299.132 ++    {
 299.133 ++      if (!(__err & ios_base::failbit))
 299.134 ++	{
 299.135 ++	  char* __sanity;
 299.136 ++	  errno = 0;
 299.137 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
 299.138 ++          if (__sanity != __s && errno != ERANGE)
 299.139 ++	    __v = __f;
 299.140 ++	  else
 299.141 ++	    __err |= ios_base::failbit;
 299.142 ++	}
 299.143 ++    }
 299.144 ++
 299.145 ++  template<>
 299.146 ++    void
 299.147 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 299.148 ++		   const __c_locale& __cloc)
 299.149 ++    {
 299.150 ++      if (!(__err & ios_base::failbit))
 299.151 ++	{
 299.152 ++	  char* __sanity;
 299.153 ++	  errno = 0;
 299.154 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
 299.155 ++          if (__sanity != __s && errno != ERANGE)
 299.156 ++	    __v = __d;
 299.157 ++	  else
 299.158 ++	    __err |= ios_base::failbit;
 299.159 ++	}
 299.160 ++    }
 299.161 ++
 299.162 ++  template<>
 299.163 ++    void
 299.164 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 299.165 ++		   const __c_locale& __cloc)
 299.166 ++    {
 299.167 ++      if (!(__err & ios_base::failbit))
 299.168 ++	{
 299.169 ++	  char* __sanity;
 299.170 ++	  errno = 0;
 299.171 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 299.172 ++          if (__sanity != __s && errno != ERANGE)
 299.173 ++	    __v = __ld;
 299.174 ++	  else
 299.175 ++	    __err |= ios_base::failbit;
 299.176 ++	}
 299.177 ++    }
 299.178 ++
 299.179 ++  void
 299.180 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 299.181 ++				    __c_locale __old)
 299.182 ++  {
 299.183 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 299.184 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.185 ++    if (!__cloc)
 299.186 ++      {
 299.187 ++	// This named locale is not supported by the underlying OS.
 299.188 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 299.189 ++			      "name not valid"));
 299.190 ++      }
 299.191 ++#endif
 299.192 ++  }
 299.193 ++  
 299.194 ++  void
 299.195 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 299.196 ++  {
 299.197 ++    if (_S_get_c_locale() != __cloc)
 299.198 ++      __freelocale(__cloc); 
 299.199 ++  }
 299.200 ++
 299.201 ++  __c_locale
 299.202 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 299.203 ++  { return __duplocale(__cloc); }
 299.204 ++} // namespace std
 299.205 ++
 299.206 ++namespace __gnu_cxx
 299.207 ++{
 299.208 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 299.209 ++    {
 299.210 ++      "LC_CTYPE", 
 299.211 ++      "LC_NUMERIC",
 299.212 ++      "LC_TIME", 
 299.213 ++      "LC_COLLATE", 
 299.214 ++      "LC_MONETARY",
 299.215 ++      "LC_MESSAGES", 
 299.216 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 299.217 ++      "LC_PAPER", 
 299.218 ++      "LC_NAME", 
 299.219 ++      "LC_ADDRESS",
 299.220 ++      "LC_TELEPHONE", 
 299.221 ++      "LC_MEASUREMENT", 
 299.222 ++      "LC_IDENTIFICATION" 
 299.223 ++#endif
 299.224 ++    };
 299.225 ++}
 299.226 ++
 299.227 ++namespace std
 299.228 ++{
 299.229 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 299.230 ++}  // namespace std
 299.231 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
 299.232 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 299.233 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
 299.234 +@@ -0,0 +1,117 @@
 299.235 ++// Wrapper for underlying C-language localization -*- C++ -*-
 299.236 ++
 299.237 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 299.238 ++//
 299.239 ++// This file is part of the GNU ISO C++ Library.  This library is free
 299.240 ++// software; you can redistribute it and/or modify it under the
 299.241 ++// terms of the GNU General Public License as published by the
 299.242 ++// Free Software Foundation; either version 2, or (at your option)
 299.243 ++// any later version.
 299.244 ++
 299.245 ++// This library is distributed in the hope that it will be useful,
 299.246 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 299.247 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 299.248 ++// GNU General Public License for more details.
 299.249 ++
 299.250 ++// You should have received a copy of the GNU General Public License along
 299.251 ++// with this library; see the file COPYING.  If not, write to the Free
 299.252 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 299.253 ++// USA.
 299.254 ++
 299.255 ++// As a special exception, you may use this file as part of a free software
 299.256 ++// library without restriction.  Specifically, if other files instantiate
 299.257 ++// templates or use macros or inline functions from this file, or you compile
 299.258 ++// this file and link it with other files to produce an executable, this
 299.259 ++// file does not by itself cause the resulting executable to be covered by
 299.260 ++// the GNU General Public License.  This exception does not however
 299.261 ++// invalidate any other reasons why the executable file might be covered by
 299.262 ++// the GNU General Public License.
 299.263 ++
 299.264 ++//
 299.265 ++// ISO C++ 14882: 22.8  Standard locale categories.
 299.266 ++//
 299.267 ++
 299.268 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 299.269 ++
 299.270 ++#ifndef _C_LOCALE_H
 299.271 ++#define _C_LOCALE_H 1
 299.272 ++
 299.273 ++#pragma GCC system_header
 299.274 ++
 299.275 ++#include <cstring>              // get std::strlen
 299.276 ++#include <cstdio>               // get std::snprintf or std::sprintf
 299.277 ++#include <clocale>
 299.278 ++#include <langinfo.h>		// For codecvt
 299.279 ++#ifdef __UCLIBC_MJN3_ONLY__
 299.280 ++#warning fix this
 299.281 ++#endif
 299.282 ++#ifdef __UCLIBC_HAS_LOCALE__
 299.283 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 299.284 ++#endif
 299.285 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 299.286 ++#include <libintl.h> 		// For messages
 299.287 ++#endif
 299.288 ++
 299.289 ++#ifdef __UCLIBC_MJN3_ONLY__
 299.290 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 299.291 ++#endif
 299.292 ++#define _GLIBCXX_C_LOCALE_GNU 1
 299.293 ++
 299.294 ++#ifdef __UCLIBC_MJN3_ONLY__
 299.295 ++#warning fix categories
 299.296 ++#endif
 299.297 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 299.298 ++#define _GLIBCXX_NUM_CATEGORIES 0
 299.299 ++ 
 299.300 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.301 ++namespace __gnu_cxx
 299.302 ++{
 299.303 ++  extern "C" __typeof(uselocale) __uselocale;
 299.304 ++}
 299.305 ++#endif
 299.306 ++
 299.307 ++namespace std
 299.308 ++{
 299.309 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.310 ++  typedef __locale_t		__c_locale;
 299.311 ++#else
 299.312 ++  typedef int*			__c_locale;
 299.313 ++#endif
 299.314 ++
 299.315 ++  // Convert numeric value of type _Tv to string and return length of
 299.316 ++  // string.  If snprintf is available use it, otherwise fall back to
 299.317 ++  // the unsafe sprintf which, in general, can be dangerous and should
 299.318 ++  // be avoided.
 299.319 ++  template<typename _Tv>
 299.320 ++    int
 299.321 ++    __convert_from_v(char* __out, 
 299.322 ++		     const int __size __attribute__ ((__unused__)),
 299.323 ++		     const char* __fmt,
 299.324 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 299.325 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 299.326 ++    {
 299.327 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 299.328 ++#else
 299.329 ++		     _Tv __v, const __c_locale&, int __prec)
 299.330 ++    {
 299.331 ++# ifdef __UCLIBC_HAS_LOCALE__
 299.332 ++      char* __old = std::setlocale(LC_ALL, NULL);
 299.333 ++      char* __sav = new char[std::strlen(__old) + 1];
 299.334 ++      std::strcpy(__sav, __old);
 299.335 ++      std::setlocale(LC_ALL, "C");
 299.336 ++# endif
 299.337 ++#endif
 299.338 ++
 299.339 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 299.340 ++
 299.341 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 299.342 ++      __gnu_cxx::__uselocale(__old);
 299.343 ++#elif defined __UCLIBC_HAS_LOCALE__
 299.344 ++      std::setlocale(LC_ALL, __sav);
 299.345 ++      delete [] __sav;
 299.346 ++#endif
 299.347 ++      return __ret;
 299.348 ++    }
 299.349 ++}
 299.350 ++
 299.351 ++#endif
 299.352 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
 299.353 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
 299.354 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
 299.355 +@@ -0,0 +1,63 @@
 299.356 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
 299.357 ++
 299.358 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
 299.359 ++//
 299.360 ++// This file is part of the GNU ISO C++ Library.  This library is free
 299.361 ++// software; you can redistribute it and/or modify it under the
 299.362 ++// terms of the GNU General Public License as published by the
 299.363 ++// Free Software Foundation; either version 2, or (at your option)
 299.364 ++// any later version.
 299.365 ++
 299.366 ++// This library is distributed in the hope that it will be useful,
 299.367 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 299.368 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 299.369 ++// GNU General Public License for more details.
 299.370 ++
 299.371 ++// You should have received a copy of the GNU General Public License along
 299.372 ++// with this library; see the file COPYING.  If not, write to the Free
 299.373 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 299.374 ++// USA.
 299.375 ++
 299.376 ++// As a special exception, you may use this file as part of a free software
 299.377 ++// library without restriction.  Specifically, if other files instantiate
 299.378 ++// templates or use macros or inline functions from this file, or you compile
 299.379 ++// this file and link it with other files to produce an executable, this
 299.380 ++// file does not by itself cause the resulting executable to be covered by
 299.381 ++// the GNU General Public License.  This exception does not however
 299.382 ++// invalidate any other reasons why the executable file might be covered by
 299.383 ++// the GNU General Public License.
 299.384 ++
 299.385 ++// Written by Jakub Jelinek <jakub@redhat.com>
 299.386 ++
 299.387 ++#include <bits/c++config.h>
 299.388 ++#include <clocale>
 299.389 ++
 299.390 ++#ifdef __UCLIBC_MJN3_ONLY__
 299.391 ++#warning clean this up
 299.392 ++#endif
 299.393 ++
 299.394 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.395 ++                                                  
 299.396 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 299.397 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 299.398 ++extern "C" __typeof(strftime_l) __strftime_l;
 299.399 ++extern "C" __typeof(strtod_l) __strtod_l;
 299.400 ++extern "C" __typeof(strtof_l) __strtof_l;
 299.401 ++extern "C" __typeof(strtold_l) __strtold_l;
 299.402 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 299.403 ++extern "C" __typeof(newlocale) __newlocale;
 299.404 ++extern "C" __typeof(freelocale) __freelocale;
 299.405 ++extern "C" __typeof(duplocale) __duplocale;
 299.406 ++extern "C" __typeof(uselocale) __uselocale;
 299.407 ++
 299.408 ++#ifdef _GLIBCXX_USE_WCHAR_T
 299.409 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 299.410 ++extern "C" __typeof(towlower_l) __towlower_l;
 299.411 ++extern "C" __typeof(towupper_l) __towupper_l;
 299.412 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 299.413 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 299.414 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 299.415 ++extern "C" __typeof(wctype_l) __wctype_l;
 299.416 ++#endif 
 299.417 ++
 299.418 ++#endif // GLIBC 2.3 and later
 299.419 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 299.420 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 299.421 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-08-03 20:30:21.000000000 +0200
 299.422 +@@ -0,0 +1,306 @@
 299.423 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 299.424 ++
 299.425 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 299.426 ++//
 299.427 ++// This file is part of the GNU ISO C++ Library.  This library is free
 299.428 ++// software; you can redistribute it and/or modify it under the
 299.429 ++// terms of the GNU General Public License as published by the
 299.430 ++// Free Software Foundation; either version 2, or (at your option)
 299.431 ++// any later version.
 299.432 ++
 299.433 ++// This library is distributed in the hope that it will be useful,
 299.434 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 299.435 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 299.436 ++// GNU General Public License for more details.
 299.437 ++
 299.438 ++// You should have received a copy of the GNU General Public License along
 299.439 ++// with this library; see the file COPYING.  If not, write to the Free
 299.440 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 299.441 ++// USA.
 299.442 ++
 299.443 ++// As a special exception, you may use this file as part of a free software
 299.444 ++// library without restriction.  Specifically, if other files instantiate
 299.445 ++// templates or use macros or inline functions from this file, or you compile
 299.446 ++// this file and link it with other files to produce an executable, this
 299.447 ++// file does not by itself cause the resulting executable to be covered by
 299.448 ++// the GNU General Public License.  This exception does not however
 299.449 ++// invalidate any other reasons why the executable file might be covered by
 299.450 ++// the GNU General Public License.
 299.451 ++
 299.452 ++//
 299.453 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 299.454 ++//
 299.455 ++
 299.456 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 299.457 ++
 299.458 ++#include <locale>
 299.459 ++#include <bits/c++locale_internal.h>
 299.460 ++
 299.461 ++namespace std
 299.462 ++{
 299.463 ++  // Specializations.
 299.464 ++#ifdef _GLIBCXX_USE_WCHAR_T
 299.465 ++  codecvt_base::result
 299.466 ++  codecvt<wchar_t, char, mbstate_t>::
 299.467 ++  do_out(state_type& __state, const intern_type* __from, 
 299.468 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 299.469 ++	 extern_type* __to, extern_type* __to_end,
 299.470 ++	 extern_type*& __to_next) const
 299.471 ++  {
 299.472 ++    result __ret = ok;
 299.473 ++    state_type __tmp_state(__state);
 299.474 ++
 299.475 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.476 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 299.477 ++#endif
 299.478 ++
 299.479 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 299.480 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 299.481 ++    // NB: wcsnrtombs is a GNU extension
 299.482 ++    for (__from_next = __from, __to_next = __to;
 299.483 ++	 __from_next < __from_end && __to_next < __to_end
 299.484 ++	 && __ret == ok;)
 299.485 ++      {
 299.486 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 299.487 ++						      __from_end - __from_next);
 299.488 ++	if (!__from_chunk_end)
 299.489 ++	  __from_chunk_end = __from_end;
 299.490 ++
 299.491 ++	__from = __from_next;
 299.492 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 299.493 ++					 __from_chunk_end - __from_next,
 299.494 ++					 __to_end - __to_next, &__state);
 299.495 ++	if (__conv == static_cast<size_t>(-1))
 299.496 ++	  {
 299.497 ++	    // In case of error, in order to stop at the exact place we
 299.498 ++	    // have to start again from the beginning with a series of
 299.499 ++	    // wcrtomb.
 299.500 ++	    for (; __from < __from_next; ++__from)
 299.501 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 299.502 ++	    __state = __tmp_state;
 299.503 ++	    __ret = error;
 299.504 ++	  }
 299.505 ++	else if (__from_next && __from_next < __from_chunk_end)
 299.506 ++	  {
 299.507 ++	    __to_next += __conv;
 299.508 ++	    __ret = partial;
 299.509 ++	  }
 299.510 ++	else
 299.511 ++	  {
 299.512 ++	    __from_next = __from_chunk_end;
 299.513 ++	    __to_next += __conv;
 299.514 ++	  }
 299.515 ++
 299.516 ++	if (__from_next < __from_end && __ret == ok)
 299.517 ++	  {
 299.518 ++	    extern_type __buf[MB_LEN_MAX];
 299.519 ++	    __tmp_state = __state;
 299.520 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 299.521 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 299.522 ++	      __ret = partial;
 299.523 ++	    else
 299.524 ++	      {
 299.525 ++		memcpy(__to_next, __buf, __conv);
 299.526 ++		__state = __tmp_state;
 299.527 ++		__to_next += __conv;
 299.528 ++		++__from_next;
 299.529 ++	      }
 299.530 ++	  }
 299.531 ++      }
 299.532 ++
 299.533 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.534 ++    __uselocale(__old);
 299.535 ++#endif
 299.536 ++
 299.537 ++    return __ret; 
 299.538 ++  }
 299.539 ++  
 299.540 ++  codecvt_base::result
 299.541 ++  codecvt<wchar_t, char, mbstate_t>::
 299.542 ++  do_in(state_type& __state, const extern_type* __from, 
 299.543 ++	const extern_type* __from_end, const extern_type*& __from_next,
 299.544 ++	intern_type* __to, intern_type* __to_end,
 299.545 ++	intern_type*& __to_next) const
 299.546 ++  {
 299.547 ++    result __ret = ok;
 299.548 ++    state_type __tmp_state(__state);
 299.549 ++
 299.550 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.551 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 299.552 ++#endif
 299.553 ++
 299.554 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 299.555 ++    // in case we store a L'\0' and then continue, in a loop.
 299.556 ++    // NB: mbsnrtowcs is a GNU extension
 299.557 ++    for (__from_next = __from, __to_next = __to;
 299.558 ++	 __from_next < __from_end && __to_next < __to_end
 299.559 ++	 && __ret == ok;)
 299.560 ++      {
 299.561 ++	const extern_type* __from_chunk_end;
 299.562 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 299.563 ++								  __from_end
 299.564 ++								  - __from_next));
 299.565 ++	if (!__from_chunk_end)
 299.566 ++	  __from_chunk_end = __from_end;
 299.567 ++
 299.568 ++	__from = __from_next;
 299.569 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 299.570 ++				   __from_chunk_end - __from_next,
 299.571 ++				   __to_end - __to_next, &__state);
 299.572 ++	if (__conv == static_cast<size_t>(-1))
 299.573 ++	  {
 299.574 ++	    // In case of error, in order to stop at the exact place we
 299.575 ++	    // have to start again from the beginning with a series of
 299.576 ++	    // mbrtowc.
 299.577 ++	    for (;; ++__to_next, __from += __conv)
 299.578 ++	      {
 299.579 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 299.580 ++				 &__tmp_state);
 299.581 ++		if (__conv == static_cast<size_t>(-1)
 299.582 ++		    || __conv == static_cast<size_t>(-2))
 299.583 ++		  break;
 299.584 ++	      }
 299.585 ++	    __from_next = __from;
 299.586 ++	    __state = __tmp_state;	    
 299.587 ++	    __ret = error;
 299.588 ++	  }
 299.589 ++	else if (__from_next && __from_next < __from_chunk_end)
 299.590 ++	  {
 299.591 ++	    // It is unclear what to return in this case (see DR 382). 
 299.592 ++	    __to_next += __conv;
 299.593 ++	    __ret = partial;
 299.594 ++	  }
 299.595 ++	else
 299.596 ++	  {
 299.597 ++	    __from_next = __from_chunk_end;
 299.598 ++	    __to_next += __conv;
 299.599 ++	  }
 299.600 ++
 299.601 ++	if (__from_next < __from_end && __ret == ok)
 299.602 ++	  {
 299.603 ++	    if (__to_next < __to_end)
 299.604 ++	      {
 299.605 ++		// XXX Probably wrong for stateful encodings
 299.606 ++		__tmp_state = __state;		
 299.607 ++		++__from_next;
 299.608 ++		*__to_next++ = L'\0';
 299.609 ++	      }
 299.610 ++	    else
 299.611 ++	      __ret = partial;
 299.612 ++	  }
 299.613 ++      }
 299.614 ++
 299.615 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.616 ++    __uselocale(__old);
 299.617 ++#endif
 299.618 ++
 299.619 ++    return __ret; 
 299.620 ++  }
 299.621 ++
 299.622 ++  int 
 299.623 ++  codecvt<wchar_t, char, mbstate_t>::
 299.624 ++  do_encoding() const throw()
 299.625 ++  {
 299.626 ++    // XXX This implementation assumes that the encoding is
 299.627 ++    // stateless and is either single-byte or variable-width.
 299.628 ++    int __ret = 0;
 299.629 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.630 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 299.631 ++#endif
 299.632 ++    if (MB_CUR_MAX == 1)
 299.633 ++      __ret = 1;
 299.634 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.635 ++    __uselocale(__old);
 299.636 ++#endif
 299.637 ++    return __ret;
 299.638 ++  }  
 299.639 ++
 299.640 ++  int 
 299.641 ++  codecvt<wchar_t, char, mbstate_t>::
 299.642 ++  do_max_length() const throw()
 299.643 ++  {
 299.644 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.645 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 299.646 ++#endif
 299.647 ++    // XXX Probably wrong for stateful encodings.
 299.648 ++    int __ret = MB_CUR_MAX;
 299.649 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.650 ++    __uselocale(__old);
 299.651 ++#endif
 299.652 ++    return __ret;
 299.653 ++  }
 299.654 ++  
 299.655 ++  int 
 299.656 ++  codecvt<wchar_t, char, mbstate_t>::
 299.657 ++  do_length(state_type& __state, const extern_type* __from,
 299.658 ++	    const extern_type* __end, size_t __max) const
 299.659 ++  {
 299.660 ++    int __ret = 0;
 299.661 ++    state_type __tmp_state(__state);
 299.662 ++
 299.663 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.664 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 299.665 ++#endif
 299.666 ++
 299.667 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 299.668 ++    // in case we advance past it and then continue, in a loop.
 299.669 ++    // NB: mbsnrtowcs is a GNU extension
 299.670 ++  
 299.671 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 299.672 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 299.673 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 299.674 ++							   * __max));
 299.675 ++    while (__from < __end && __max)
 299.676 ++      {
 299.677 ++	const extern_type* __from_chunk_end;
 299.678 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 299.679 ++								  __end
 299.680 ++								  - __from));
 299.681 ++	if (!__from_chunk_end)
 299.682 ++	  __from_chunk_end = __end;
 299.683 ++
 299.684 ++	const extern_type* __tmp_from = __from;
 299.685 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 299.686 ++				   __from_chunk_end - __from,
 299.687 ++				   __max, &__state);
 299.688 ++	if (__conv == static_cast<size_t>(-1))
 299.689 ++	  {
 299.690 ++	    // In case of error, in order to stop at the exact place we
 299.691 ++	    // have to start again from the beginning with a series of
 299.692 ++	    // mbrtowc.
 299.693 ++	    for (__from = __tmp_from;; __from += __conv)
 299.694 ++	      {
 299.695 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 299.696 ++				 &__tmp_state);
 299.697 ++		if (__conv == static_cast<size_t>(-1)
 299.698 ++		    || __conv == static_cast<size_t>(-2))
 299.699 ++		  break;
 299.700 ++	      }
 299.701 ++	    __state = __tmp_state;
 299.702 ++	    __ret += __from - __tmp_from;
 299.703 ++	    break;
 299.704 ++	  }
 299.705 ++	if (!__from)
 299.706 ++	  __from = __from_chunk_end;
 299.707 ++	
 299.708 ++	__ret += __from - __tmp_from;
 299.709 ++	__max -= __conv;
 299.710 ++
 299.711 ++	if (__from < __end && __max)
 299.712 ++	  {
 299.713 ++	    // XXX Probably wrong for stateful encodings
 299.714 ++	    __tmp_state = __state;
 299.715 ++	    ++__from;
 299.716 ++	    ++__ret;
 299.717 ++	    --__max;
 299.718 ++	  }
 299.719 ++      }
 299.720 ++
 299.721 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.722 ++    __uselocale(__old);
 299.723 ++#endif
 299.724 ++
 299.725 ++    return __ret; 
 299.726 ++  }
 299.727 ++#endif
 299.728 ++}
 299.729 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
 299.730 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 299.731 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
 299.732 +@@ -0,0 +1,80 @@
 299.733 ++// std::collate implementation details, GNU version -*- C++ -*-
 299.734 ++
 299.735 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 299.736 ++//
 299.737 ++// This file is part of the GNU ISO C++ Library.  This library is free
 299.738 ++// software; you can redistribute it and/or modify it under the
 299.739 ++// terms of the GNU General Public License as published by the
 299.740 ++// Free Software Foundation; either version 2, or (at your option)
 299.741 ++// any later version.
 299.742 ++
 299.743 ++// This library is distributed in the hope that it will be useful,
 299.744 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 299.745 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 299.746 ++// GNU General Public License for more details.
 299.747 ++
 299.748 ++// You should have received a copy of the GNU General Public License along
 299.749 ++// with this library; see the file COPYING.  If not, write to the Free
 299.750 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 299.751 ++// USA.
 299.752 ++
 299.753 ++// As a special exception, you may use this file as part of a free software
 299.754 ++// library without restriction.  Specifically, if other files instantiate
 299.755 ++// templates or use macros or inline functions from this file, or you compile
 299.756 ++// this file and link it with other files to produce an executable, this
 299.757 ++// file does not by itself cause the resulting executable to be covered by
 299.758 ++// the GNU General Public License.  This exception does not however
 299.759 ++// invalidate any other reasons why the executable file might be covered by
 299.760 ++// the GNU General Public License.
 299.761 ++
 299.762 ++//
 299.763 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 299.764 ++//
 299.765 ++
 299.766 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 299.767 ++
 299.768 ++#include <locale>
 299.769 ++#include <bits/c++locale_internal.h>
 299.770 ++
 299.771 ++#ifndef __UCLIBC_HAS_XLOCALE__
 299.772 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 299.773 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 299.774 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 299.775 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 299.776 ++#endif
 299.777 ++
 299.778 ++namespace std
 299.779 ++{
 299.780 ++  // These are basically extensions to char_traits, and perhaps should
 299.781 ++  // be put there instead of here.
 299.782 ++  template<>
 299.783 ++    int 
 299.784 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 299.785 ++    { 
 299.786 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 299.787 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 299.788 ++    }
 299.789 ++  
 299.790 ++  template<>
 299.791 ++    size_t
 299.792 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 299.793 ++				size_t __n) const 
 299.794 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 299.795 ++
 299.796 ++#ifdef _GLIBCXX_USE_WCHAR_T
 299.797 ++  template<>
 299.798 ++    int 
 299.799 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 299.800 ++				 const wchar_t* __two) const
 299.801 ++    {
 299.802 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 299.803 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 299.804 ++    }
 299.805 ++  
 299.806 ++  template<>
 299.807 ++    size_t
 299.808 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 299.809 ++				   size_t __n) const
 299.810 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 299.811 ++#endif
 299.812 ++}
 299.813 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 299.814 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 299.815 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 299.816 +@@ -0,0 +1,300 @@
 299.817 ++// std::ctype implementation details, GNU version -*- C++ -*-
 299.818 ++
 299.819 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 299.820 ++//
 299.821 ++// This file is part of the GNU ISO C++ Library.  This library is free
 299.822 ++// software; you can redistribute it and/or modify it under the
 299.823 ++// terms of the GNU General Public License as published by the
 299.824 ++// Free Software Foundation; either version 2, or (at your option)
 299.825 ++// any later version.
 299.826 ++
 299.827 ++// This library is distributed in the hope that it will be useful,
 299.828 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 299.829 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 299.830 ++// GNU General Public License for more details.
 299.831 ++
 299.832 ++// You should have received a copy of the GNU General Public License along
 299.833 ++// with this library; see the file COPYING.  If not, write to the Free
 299.834 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 299.835 ++// USA.
 299.836 ++
 299.837 ++// As a special exception, you may use this file as part of a free software
 299.838 ++// library without restriction.  Specifically, if other files instantiate
 299.839 ++// templates or use macros or inline functions from this file, or you compile
 299.840 ++// this file and link it with other files to produce an executable, this
 299.841 ++// file does not by itself cause the resulting executable to be covered by
 299.842 ++// the GNU General Public License.  This exception does not however
 299.843 ++// invalidate any other reasons why the executable file might be covered by
 299.844 ++// the GNU General Public License.
 299.845 ++
 299.846 ++//
 299.847 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 299.848 ++//
 299.849 ++
 299.850 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 299.851 ++
 299.852 ++#define _LIBC
 299.853 ++#include <locale>
 299.854 ++#undef _LIBC
 299.855 ++#include <bits/c++locale_internal.h>
 299.856 ++
 299.857 ++#ifndef __UCLIBC_HAS_XLOCALE__
 299.858 ++#define __wctype_l(S, L)           wctype((S))
 299.859 ++#define __towupper_l(C, L)         towupper((C))
 299.860 ++#define __towlower_l(C, L)         towlower((C))
 299.861 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 299.862 ++#endif
 299.863 ++
 299.864 ++namespace std
 299.865 ++{
 299.866 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 299.867 ++  // various /config/os/* files.
 299.868 ++  template<>
 299.869 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 299.870 ++    : ctype<char>(0, false, __refs) 
 299.871 ++    { 		
 299.872 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 299.873 ++	{
 299.874 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 299.875 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 299.876 ++#ifdef __UCLIBC_HAS_XLOCALE__
 299.877 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 299.878 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 299.879 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 299.880 ++#endif
 299.881 ++	}
 299.882 ++    }
 299.883 ++
 299.884 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 299.885 ++  ctype<wchar_t>::__wmask_type
 299.886 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 299.887 ++  {
 299.888 ++    __wmask_type __ret;
 299.889 ++    switch (__m)
 299.890 ++      {
 299.891 ++      case space:
 299.892 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 299.893 ++	break;
 299.894 ++      case print:
 299.895 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 299.896 ++	break;
 299.897 ++      case cntrl:
 299.898 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 299.899 ++	break;
 299.900 ++      case upper:
 299.901 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 299.902 ++	break;
 299.903 ++      case lower:
 299.904 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 299.905 ++	break;
 299.906 ++      case alpha:
 299.907 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 299.908 ++	break;
 299.909 ++      case digit:
 299.910 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 299.911 ++	break;
 299.912 ++      case punct:
 299.913 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 299.914 ++	break;
 299.915 ++      case xdigit:
 299.916 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 299.917 ++	break;
 299.918 ++      case alnum:
 299.919 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 299.920 ++	break;
 299.921 ++      case graph:
 299.922 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 299.923 ++	break;
 299.924 ++      default:
 299.925 ++	__ret = __wmask_type();
 299.926 ++      }
 299.927 ++    return __ret;
 299.928 ++  }
 299.929 ++  
 299.930 ++  wchar_t
 299.931 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 299.932 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 299.933 ++
 299.934 ++  const wchar_t*
 299.935 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 299.936 ++  {
 299.937 ++    while (__lo < __hi)
 299.938 ++      {
 299.939 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 299.940 ++        ++__lo;
 299.941 ++      }
 299.942 ++    return __hi;
 299.943 ++  }
 299.944 ++  
 299.945 ++  wchar_t
 299.946 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 299.947 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 299.948 ++  
 299.949 ++  const wchar_t*
 299.950 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 299.951 ++  {
 299.952 ++    while (__lo < __hi)
 299.953 ++      {
 299.954 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 299.955 ++        ++__lo;
 299.956 ++      }
 299.957 ++    return __hi;
 299.958 ++  }
 299.959 ++
 299.960 ++  bool
 299.961 ++  ctype<wchar_t>::
 299.962 ++  do_is(mask __m, wchar_t __c) const
 299.963 ++  { 
 299.964 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
 299.965 ++    // library for blank.
 299.966 ++    bool __ret = false;
 299.967 ++    const size_t __bitmasksize = 11; 
 299.968 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 299.969 ++      if (__m & _M_bit[__bitcur]
 299.970 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 299.971 ++	{
 299.972 ++	  __ret = true;
 299.973 ++	  break;
 299.974 ++	}
 299.975 ++    return __ret;    
 299.976 ++  }
 299.977 ++  
 299.978 ++  const wchar_t* 
 299.979 ++  ctype<wchar_t>::
 299.980 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 299.981 ++  {
 299.982 ++    for (; __lo < __hi; ++__vec, ++__lo)
 299.983 ++      {
 299.984 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 299.985 ++	// library for blank.
 299.986 ++	const size_t __bitmasksize = 11; 
 299.987 ++	mask __m = 0;
 299.988 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 299.989 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 299.990 ++	    __m |= _M_bit[__bitcur];
 299.991 ++	*__vec = __m;
 299.992 ++      }
 299.993 ++    return __hi;
 299.994 ++  }
 299.995 ++  
 299.996 ++  const wchar_t* 
 299.997 ++  ctype<wchar_t>::
 299.998 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 299.999 ++  {
299.1000 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
299.1001 ++      ++__lo;
299.1002 ++    return __lo;
299.1003 ++  }
299.1004 ++
299.1005 ++  const wchar_t*
299.1006 ++  ctype<wchar_t>::
299.1007 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
299.1008 ++  {
299.1009 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
299.1010 ++      ++__lo;
299.1011 ++    return __lo;
299.1012 ++  }
299.1013 ++
299.1014 ++  wchar_t
299.1015 ++  ctype<wchar_t>::
299.1016 ++  do_widen(char __c) const
299.1017 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
299.1018 ++
299.1019 ++  const char* 
299.1020 ++  ctype<wchar_t>::
299.1021 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
299.1022 ++  {
299.1023 ++    while (__lo < __hi)
299.1024 ++      {
299.1025 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
299.1026 ++	++__lo;
299.1027 ++	++__dest;
299.1028 ++      }
299.1029 ++    return __hi;
299.1030 ++  }
299.1031 ++
299.1032 ++  char
299.1033 ++  ctype<wchar_t>::
299.1034 ++  do_narrow(wchar_t __wc, char __dfault) const
299.1035 ++  {
299.1036 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
299.1037 ++      return _M_narrow[__wc];
299.1038 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1039 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
299.1040 ++#endif
299.1041 ++    const int __c = wctob(__wc);
299.1042 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1043 ++    __uselocale(__old);
299.1044 ++#endif
299.1045 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
299.1046 ++  }
299.1047 ++
299.1048 ++  const wchar_t*
299.1049 ++  ctype<wchar_t>::
299.1050 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
299.1051 ++	    char* __dest) const
299.1052 ++  {
299.1053 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1054 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
299.1055 ++#endif
299.1056 ++    if (_M_narrow_ok)
299.1057 ++      while (__lo < __hi)
299.1058 ++	{
299.1059 ++	  if (*__lo >= 0 && *__lo < 128)
299.1060 ++	    *__dest = _M_narrow[*__lo];
299.1061 ++	  else
299.1062 ++	    {
299.1063 ++	      const int __c = wctob(*__lo);
299.1064 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
299.1065 ++	    }
299.1066 ++	  ++__lo;
299.1067 ++	  ++__dest;
299.1068 ++	}
299.1069 ++    else
299.1070 ++      while (__lo < __hi)
299.1071 ++	{
299.1072 ++	  const int __c = wctob(*__lo);
299.1073 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
299.1074 ++	  ++__lo;
299.1075 ++	  ++__dest;
299.1076 ++	}
299.1077 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1078 ++    __uselocale(__old);
299.1079 ++#endif
299.1080 ++    return __hi;
299.1081 ++  }
299.1082 ++
299.1083 ++  void
299.1084 ++  ctype<wchar_t>::_M_initialize_ctype()
299.1085 ++  {
299.1086 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1087 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
299.1088 ++#endif
299.1089 ++    wint_t __i;
299.1090 ++    for (__i = 0; __i < 128; ++__i)
299.1091 ++      {
299.1092 ++	const int __c = wctob(__i);
299.1093 ++	if (__c == EOF)
299.1094 ++	  break;
299.1095 ++	else
299.1096 ++	  _M_narrow[__i] = static_cast<char>(__c);
299.1097 ++      }
299.1098 ++    if (__i == 128)
299.1099 ++      _M_narrow_ok = true;
299.1100 ++    else
299.1101 ++      _M_narrow_ok = false;
299.1102 ++    for (size_t __j = 0;
299.1103 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
299.1104 ++      _M_widen[__j] = btowc(__j);
299.1105 ++
299.1106 ++    for (size_t __k = 0; __k <= 11; ++__k)
299.1107 ++      { 
299.1108 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
299.1109 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
299.1110 ++      }
299.1111 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1112 ++    __uselocale(__old);
299.1113 ++#endif
299.1114 ++  }
299.1115 ++#endif //  _GLIBCXX_USE_WCHAR_T
299.1116 ++}
299.1117 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
299.1118 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
299.1119 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
299.1120 +@@ -0,0 +1,100 @@
299.1121 ++// std::messages implementation details, GNU version -*- C++ -*-
299.1122 ++
299.1123 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
299.1124 ++//
299.1125 ++// This file is part of the GNU ISO C++ Library.  This library is free
299.1126 ++// software; you can redistribute it and/or modify it under the
299.1127 ++// terms of the GNU General Public License as published by the
299.1128 ++// Free Software Foundation; either version 2, or (at your option)
299.1129 ++// any later version.
299.1130 ++
299.1131 ++// This library is distributed in the hope that it will be useful,
299.1132 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
299.1133 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
299.1134 ++// GNU General Public License for more details.
299.1135 ++
299.1136 ++// You should have received a copy of the GNU General Public License along
299.1137 ++// with this library; see the file COPYING.  If not, write to the Free
299.1138 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
299.1139 ++// USA.
299.1140 ++
299.1141 ++// As a special exception, you may use this file as part of a free software
299.1142 ++// library without restriction.  Specifically, if other files instantiate
299.1143 ++// templates or use macros or inline functions from this file, or you compile
299.1144 ++// this file and link it with other files to produce an executable, this
299.1145 ++// file does not by itself cause the resulting executable to be covered by
299.1146 ++// the GNU General Public License.  This exception does not however
299.1147 ++// invalidate any other reasons why the executable file might be covered by
299.1148 ++// the GNU General Public License.
299.1149 ++
299.1150 ++//
299.1151 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
299.1152 ++//
299.1153 ++
299.1154 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
299.1155 ++
299.1156 ++#include <locale>
299.1157 ++#include <bits/c++locale_internal.h>
299.1158 ++
299.1159 ++#ifdef __UCLIBC_MJN3_ONLY__
299.1160 ++#warning fix gettext stuff
299.1161 ++#endif
299.1162 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
299.1163 ++extern "C" char *__dcgettext(const char *domainname,
299.1164 ++			     const char *msgid, int category);
299.1165 ++#undef gettext
299.1166 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
299.1167 ++#else
299.1168 ++#undef gettext
299.1169 ++#define gettext(msgid) (msgid)
299.1170 ++#endif
299.1171 ++
299.1172 ++namespace std
299.1173 ++{
299.1174 ++  // Specializations.
299.1175 ++  template<>
299.1176 ++    string
299.1177 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
299.1178 ++    {
299.1179 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1180 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
299.1181 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
299.1182 ++      __uselocale(__old);
299.1183 ++      return string(__msg);
299.1184 ++#elif defined __UCLIBC_HAS_LOCALE__
299.1185 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
299.1186 ++      setlocale(LC_ALL, _M_name_messages);
299.1187 ++      const char* __msg = gettext(__dfault.c_str());
299.1188 ++      setlocale(LC_ALL, __old);
299.1189 ++      free(__old);
299.1190 ++      return string(__msg);
299.1191 ++#else
299.1192 ++      const char* __msg = gettext(__dfault.c_str());
299.1193 ++      return string(__msg);
299.1194 ++#endif
299.1195 ++    }
299.1196 ++
299.1197 ++#ifdef _GLIBCXX_USE_WCHAR_T
299.1198 ++  template<>
299.1199 ++    wstring
299.1200 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
299.1201 ++    {
299.1202 ++# ifdef __UCLIBC_HAS_XLOCALE__
299.1203 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
299.1204 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
299.1205 ++      __uselocale(__old);
299.1206 ++      return _M_convert_from_char(__msg);
299.1207 ++# elif defined __UCLIBC_HAS_LOCALE__
299.1208 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
299.1209 ++      setlocale(LC_ALL, _M_name_messages);
299.1210 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
299.1211 ++      setlocale(LC_ALL, __old);
299.1212 ++      free(__old);
299.1213 ++      return _M_convert_from_char(__msg);
299.1214 ++# else
299.1215 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
299.1216 ++      return _M_convert_from_char(__msg);
299.1217 ++# endif
299.1218 ++    }
299.1219 ++#endif
299.1220 ++}
299.1221 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
299.1222 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
299.1223 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
299.1224 +@@ -0,0 +1,118 @@
299.1225 ++// std::messages implementation details, GNU version -*- C++ -*-
299.1226 ++
299.1227 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
299.1228 ++//
299.1229 ++// This file is part of the GNU ISO C++ Library.  This library is free
299.1230 ++// software; you can redistribute it and/or modify it under the
299.1231 ++// terms of the GNU General Public License as published by the
299.1232 ++// Free Software Foundation; either version 2, or (at your option)
299.1233 ++// any later version.
299.1234 ++
299.1235 ++// This library is distributed in the hope that it will be useful,
299.1236 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
299.1237 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
299.1238 ++// GNU General Public License for more details.
299.1239 ++
299.1240 ++// You should have received a copy of the GNU General Public License along
299.1241 ++// with this library; see the file COPYING.  If not, write to the Free
299.1242 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
299.1243 ++// USA.
299.1244 ++
299.1245 ++// As a special exception, you may use this file as part of a free software
299.1246 ++// library without restriction.  Specifically, if other files instantiate
299.1247 ++// templates or use macros or inline functions from this file, or you compile
299.1248 ++// this file and link it with other files to produce an executable, this
299.1249 ++// file does not by itself cause the resulting executable to be covered by
299.1250 ++// the GNU General Public License.  This exception does not however
299.1251 ++// invalidate any other reasons why the executable file might be covered by
299.1252 ++// the GNU General Public License.
299.1253 ++
299.1254 ++//
299.1255 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
299.1256 ++//
299.1257 ++
299.1258 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
299.1259 ++
299.1260 ++#ifdef __UCLIBC_MJN3_ONLY__
299.1261 ++#warning fix prototypes for *textdomain funcs
299.1262 ++#endif
299.1263 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
299.1264 ++extern "C" char *__textdomain(const char *domainname);
299.1265 ++extern "C" char *__bindtextdomain(const char *domainname,
299.1266 ++				  const char *dirname);
299.1267 ++#else
299.1268 ++#undef __textdomain
299.1269 ++#undef __bindtextdomain
299.1270 ++#define __textdomain(D)           ((void)0)
299.1271 ++#define __bindtextdomain(D,P)     ((void)0)
299.1272 ++#endif
299.1273 ++
299.1274 ++  // Non-virtual member functions.
299.1275 ++  template<typename _CharT>
299.1276 ++     messages<_CharT>::messages(size_t __refs)
299.1277 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
299.1278 ++     _M_name_messages(_S_get_c_name())
299.1279 ++     { }
299.1280 ++
299.1281 ++  template<typename _CharT>
299.1282 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
299.1283 ++				size_t __refs) 
299.1284 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
299.1285 ++     _M_name_messages(__s)
299.1286 ++     {
299.1287 ++       char* __tmp = new char[std::strlen(__s) + 1];
299.1288 ++       std::strcpy(__tmp, __s);
299.1289 ++       _M_name_messages = __tmp;
299.1290 ++     }
299.1291 ++
299.1292 ++  template<typename _CharT>
299.1293 ++    typename messages<_CharT>::catalog 
299.1294 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
299.1295 ++			   const char* __dir) const
299.1296 ++    { 
299.1297 ++      __bindtextdomain(__s.c_str(), __dir);
299.1298 ++      return this->do_open(__s, __loc); 
299.1299 ++    }
299.1300 ++
299.1301 ++  // Virtual member functions.
299.1302 ++  template<typename _CharT>
299.1303 ++    messages<_CharT>::~messages()
299.1304 ++    { 
299.1305 ++      if (_M_name_messages != _S_get_c_name())
299.1306 ++	delete [] _M_name_messages;
299.1307 ++      _S_destroy_c_locale(_M_c_locale_messages); 
299.1308 ++    }
299.1309 ++
299.1310 ++  template<typename _CharT>
299.1311 ++    typename messages<_CharT>::catalog 
299.1312 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
299.1313 ++			      const locale&) const
299.1314 ++    { 
299.1315 ++      // No error checking is done, assume the catalog exists and can
299.1316 ++      // be used.
299.1317 ++      __textdomain(__s.c_str());
299.1318 ++      return 0;
299.1319 ++    }
299.1320 ++
299.1321 ++  template<typename _CharT>
299.1322 ++    void    
299.1323 ++    messages<_CharT>::do_close(catalog) const 
299.1324 ++    { }
299.1325 ++
299.1326 ++   // messages_byname
299.1327 ++   template<typename _CharT>
299.1328 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
299.1329 ++     : messages<_CharT>(__refs) 
299.1330 ++     { 
299.1331 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
299.1332 ++	 delete [] this->_M_name_messages;
299.1333 ++       char* __tmp = new char[std::strlen(__s) + 1];
299.1334 ++       std::strcpy(__tmp, __s);
299.1335 ++       this->_M_name_messages = __tmp;
299.1336 ++
299.1337 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
299.1338 ++	 {
299.1339 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
299.1340 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
299.1341 ++	 }
299.1342 ++     }
299.1343 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
299.1344 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
299.1345 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
299.1346 +@@ -0,0 +1,692 @@
299.1347 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
299.1348 ++
299.1349 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
299.1350 ++//
299.1351 ++// This file is part of the GNU ISO C++ Library.  This library is free
299.1352 ++// software; you can redistribute it and/or modify it under the
299.1353 ++// terms of the GNU General Public License as published by the
299.1354 ++// Free Software Foundation; either version 2, or (at your option)
299.1355 ++// any later version.
299.1356 ++
299.1357 ++// This library is distributed in the hope that it will be useful,
299.1358 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
299.1359 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
299.1360 ++// GNU General Public License for more details.
299.1361 ++
299.1362 ++// You should have received a copy of the GNU General Public License along
299.1363 ++// with this library; see the file COPYING.  If not, write to the Free
299.1364 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
299.1365 ++// USA.
299.1366 ++
299.1367 ++// As a special exception, you may use this file as part of a free software
299.1368 ++// library without restriction.  Specifically, if other files instantiate
299.1369 ++// templates or use macros or inline functions from this file, or you compile
299.1370 ++// this file and link it with other files to produce an executable, this
299.1371 ++// file does not by itself cause the resulting executable to be covered by
299.1372 ++// the GNU General Public License.  This exception does not however
299.1373 ++// invalidate any other reasons why the executable file might be covered by
299.1374 ++// the GNU General Public License.
299.1375 ++
299.1376 ++//
299.1377 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
299.1378 ++//
299.1379 ++
299.1380 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
299.1381 ++
299.1382 ++#define _LIBC
299.1383 ++#include <locale>
299.1384 ++#undef _LIBC
299.1385 ++#include <bits/c++locale_internal.h>
299.1386 ++
299.1387 ++#ifdef __UCLIBC_MJN3_ONLY__
299.1388 ++#warning optimize this for uclibc
299.1389 ++#warning tailor for stub locale support
299.1390 ++#endif
299.1391 ++
299.1392 ++#ifndef __UCLIBC_HAS_XLOCALE__
299.1393 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
299.1394 ++#endif
299.1395 ++
299.1396 ++namespace std
299.1397 ++{
299.1398 ++  // Construct and return valid pattern consisting of some combination of:
299.1399 ++  // space none symbol sign value
299.1400 ++  money_base::pattern
299.1401 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
299.1402 ++  { 
299.1403 ++    pattern __ret;
299.1404 ++
299.1405 ++    // This insanely complicated routine attempts to construct a valid
299.1406 ++    // pattern for use with monyepunct. A couple of invariants:
299.1407 ++
299.1408 ++    // if (__precedes) symbol -> value
299.1409 ++    // else value -> symbol
299.1410 ++    
299.1411 ++    // if (__space) space
299.1412 ++    // else none
299.1413 ++
299.1414 ++    // none == never first
299.1415 ++    // space never first or last
299.1416 ++
299.1417 ++    // Any elegant implementations of this are welcome.
299.1418 ++    switch (__posn)
299.1419 ++      {
299.1420 ++      case 0:
299.1421 ++      case 1:
299.1422 ++	// 1 The sign precedes the value and symbol.
299.1423 ++	__ret.field[0] = sign;
299.1424 ++	if (__space)
299.1425 ++	  {
299.1426 ++	    // Pattern starts with sign.
299.1427 ++	    if (__precedes)
299.1428 ++	      {
299.1429 ++		__ret.field[1] = symbol;
299.1430 ++		__ret.field[3] = value;
299.1431 ++	      }
299.1432 ++	    else
299.1433 ++	      {
299.1434 ++		__ret.field[1] = value;
299.1435 ++		__ret.field[3] = symbol;
299.1436 ++	      }
299.1437 ++	    __ret.field[2] = space;
299.1438 ++	  }
299.1439 ++	else
299.1440 ++	  {
299.1441 ++	    // Pattern starts with sign and ends with none.
299.1442 ++	    if (__precedes)
299.1443 ++	      {
299.1444 ++		__ret.field[1] = symbol;
299.1445 ++		__ret.field[2] = value;
299.1446 ++	      }
299.1447 ++	    else
299.1448 ++	      {
299.1449 ++		__ret.field[1] = value;
299.1450 ++		__ret.field[2] = symbol;
299.1451 ++	      }
299.1452 ++	    __ret.field[3] = none;
299.1453 ++	  }
299.1454 ++	break;
299.1455 ++      case 2:
299.1456 ++	// 2 The sign follows the value and symbol.
299.1457 ++	if (__space)
299.1458 ++	  {
299.1459 ++	    // Pattern either ends with sign.
299.1460 ++	    if (__precedes)
299.1461 ++	      {
299.1462 ++		__ret.field[0] = symbol;
299.1463 ++		__ret.field[2] = value;
299.1464 ++	      }
299.1465 ++	    else
299.1466 ++	      {
299.1467 ++		__ret.field[0] = value;
299.1468 ++		__ret.field[2] = symbol;
299.1469 ++	      }
299.1470 ++	    __ret.field[1] = space;
299.1471 ++	    __ret.field[3] = sign;
299.1472 ++	  }
299.1473 ++	else
299.1474 ++	  {
299.1475 ++	    // Pattern ends with sign then none.
299.1476 ++	    if (__precedes)
299.1477 ++	      {
299.1478 ++		__ret.field[0] = symbol;
299.1479 ++		__ret.field[1] = value;
299.1480 ++	      }
299.1481 ++	    else
299.1482 ++	      {
299.1483 ++		__ret.field[0] = value;
299.1484 ++		__ret.field[1] = symbol;
299.1485 ++	      }
299.1486 ++	    __ret.field[2] = sign;
299.1487 ++	    __ret.field[3] = none;
299.1488 ++	  }
299.1489 ++	break;
299.1490 ++      case 3:
299.1491 ++	// 3 The sign immediately precedes the symbol.
299.1492 ++	if (__precedes)
299.1493 ++	  {
299.1494 ++	    __ret.field[0] = sign;
299.1495 ++	    __ret.field[1] = symbol;	    
299.1496 ++	    if (__space)
299.1497 ++	      {
299.1498 ++		__ret.field[2] = space;
299.1499 ++		__ret.field[3] = value;
299.1500 ++	      }
299.1501 ++	    else
299.1502 ++	      {
299.1503 ++		__ret.field[2] = value;		
299.1504 ++		__ret.field[3] = none;
299.1505 ++	      }
299.1506 ++	  }
299.1507 ++	else
299.1508 ++	  {
299.1509 ++	    __ret.field[0] = value;
299.1510 ++	    if (__space)
299.1511 ++	      {
299.1512 ++		__ret.field[1] = space;
299.1513 ++		__ret.field[2] = sign;
299.1514 ++		__ret.field[3] = symbol;
299.1515 ++	      }
299.1516 ++	    else
299.1517 ++	      {
299.1518 ++		__ret.field[1] = sign;
299.1519 ++		__ret.field[2] = symbol;
299.1520 ++		__ret.field[3] = none;
299.1521 ++	      }
299.1522 ++	  }
299.1523 ++	break;
299.1524 ++      case 4:
299.1525 ++	// 4 The sign immediately follows the symbol.
299.1526 ++	if (__precedes)
299.1527 ++	  {
299.1528 ++	    __ret.field[0] = symbol;
299.1529 ++	    __ret.field[1] = sign;
299.1530 ++	    if (__space)
299.1531 ++	      {
299.1532 ++		__ret.field[2] = space;
299.1533 ++		__ret.field[3] = value;
299.1534 ++	      }
299.1535 ++	    else
299.1536 ++	      {
299.1537 ++		__ret.field[2] = value;
299.1538 ++		__ret.field[3] = none;
299.1539 ++	      }
299.1540 ++	  }
299.1541 ++	else
299.1542 ++	  {
299.1543 ++	    __ret.field[0] = value;
299.1544 ++	    if (__space)
299.1545 ++	      {
299.1546 ++		__ret.field[1] = space;
299.1547 ++		__ret.field[2] = symbol;
299.1548 ++		__ret.field[3] = sign;
299.1549 ++	      }
299.1550 ++	    else
299.1551 ++	      {
299.1552 ++		__ret.field[1] = symbol;
299.1553 ++		__ret.field[2] = sign;
299.1554 ++		__ret.field[3] = none;
299.1555 ++	      }
299.1556 ++	  }
299.1557 ++	break;
299.1558 ++      default:
299.1559 ++	;
299.1560 ++      }
299.1561 ++    return __ret;
299.1562 ++  }
299.1563 ++
299.1564 ++  template<> 
299.1565 ++    void
299.1566 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
299.1567 ++						     const char*)
299.1568 ++    {
299.1569 ++      if (!_M_data)
299.1570 ++	_M_data = new __moneypunct_cache<char, true>;
299.1571 ++
299.1572 ++      if (!__cloc)
299.1573 ++	{
299.1574 ++	  // "C" locale
299.1575 ++	  _M_data->_M_decimal_point = '.';
299.1576 ++	  _M_data->_M_thousands_sep = ',';
299.1577 ++	  _M_data->_M_grouping = "";
299.1578 ++	  _M_data->_M_grouping_size = 0;
299.1579 ++	  _M_data->_M_curr_symbol = "";
299.1580 ++	  _M_data->_M_curr_symbol_size = 0;
299.1581 ++	  _M_data->_M_positive_sign = "";
299.1582 ++	  _M_data->_M_positive_sign_size = 0;
299.1583 ++	  _M_data->_M_negative_sign = "";
299.1584 ++	  _M_data->_M_negative_sign_size = 0;
299.1585 ++	  _M_data->_M_frac_digits = 0;
299.1586 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
299.1587 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
299.1588 ++
299.1589 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
299.1590 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
299.1591 ++	}
299.1592 ++      else
299.1593 ++	{
299.1594 ++	  // Named locale.
299.1595 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
299.1596 ++							__cloc));
299.1597 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
299.1598 ++							__cloc));
299.1599 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
299.1600 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
299.1601 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
299.1602 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
299.1603 ++
299.1604 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
299.1605 ++	  if (!__nposn)
299.1606 ++	    _M_data->_M_negative_sign = "()";
299.1607 ++	  else
299.1608 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
299.1609 ++							__cloc);
299.1610 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
299.1611 ++
299.1612 ++	  // _Intl == true
299.1613 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
299.1614 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
299.1615 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
299.1616 ++						      __cloc));
299.1617 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
299.1618 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
299.1619 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
299.1620 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
299.1621 ++							__pposn);
299.1622 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
299.1623 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
299.1624 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
299.1625 ++							__nposn);
299.1626 ++	}
299.1627 ++    }
299.1628 ++
299.1629 ++  template<> 
299.1630 ++    void
299.1631 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
299.1632 ++						      const char*)
299.1633 ++    {
299.1634 ++      if (!_M_data)
299.1635 ++	_M_data = new __moneypunct_cache<char, false>;
299.1636 ++
299.1637 ++      if (!__cloc)
299.1638 ++	{
299.1639 ++	  // "C" locale
299.1640 ++	  _M_data->_M_decimal_point = '.';
299.1641 ++	  _M_data->_M_thousands_sep = ',';
299.1642 ++	  _M_data->_M_grouping = "";
299.1643 ++	  _M_data->_M_grouping_size = 0;
299.1644 ++	  _M_data->_M_curr_symbol = "";
299.1645 ++	  _M_data->_M_curr_symbol_size = 0;
299.1646 ++	  _M_data->_M_positive_sign = "";
299.1647 ++	  _M_data->_M_positive_sign_size = 0;
299.1648 ++	  _M_data->_M_negative_sign = "";
299.1649 ++	  _M_data->_M_negative_sign_size = 0;
299.1650 ++	  _M_data->_M_frac_digits = 0;
299.1651 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
299.1652 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
299.1653 ++
299.1654 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
299.1655 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
299.1656 ++	}
299.1657 ++      else
299.1658 ++	{
299.1659 ++	  // Named locale.
299.1660 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
299.1661 ++							__cloc));
299.1662 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
299.1663 ++							__cloc));
299.1664 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
299.1665 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
299.1666 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
299.1667 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
299.1668 ++
299.1669 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
299.1670 ++	  if (!__nposn)
299.1671 ++	    _M_data->_M_negative_sign = "()";
299.1672 ++	  else
299.1673 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
299.1674 ++							__cloc);
299.1675 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
299.1676 ++
299.1677 ++	  // _Intl == false
299.1678 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
299.1679 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
299.1680 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
299.1681 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
299.1682 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
299.1683 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
299.1684 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
299.1685 ++							__pposn);
299.1686 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
299.1687 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
299.1688 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
299.1689 ++							__nposn);
299.1690 ++	}
299.1691 ++    }
299.1692 ++
299.1693 ++  template<> 
299.1694 ++    moneypunct<char, true>::~moneypunct()
299.1695 ++    { delete _M_data; }
299.1696 ++
299.1697 ++  template<> 
299.1698 ++    moneypunct<char, false>::~moneypunct()
299.1699 ++    { delete _M_data; }
299.1700 ++
299.1701 ++#ifdef _GLIBCXX_USE_WCHAR_T
299.1702 ++  template<> 
299.1703 ++    void
299.1704 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
299.1705 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1706 ++							const char*)
299.1707 ++#else
299.1708 ++							const char* __name)
299.1709 ++#endif
299.1710 ++    {
299.1711 ++      if (!_M_data)
299.1712 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
299.1713 ++
299.1714 ++      if (!__cloc)
299.1715 ++	{
299.1716 ++	  // "C" locale
299.1717 ++	  _M_data->_M_decimal_point = L'.';
299.1718 ++	  _M_data->_M_thousands_sep = L',';
299.1719 ++	  _M_data->_M_grouping = "";
299.1720 ++	  _M_data->_M_grouping_size = 0;
299.1721 ++	  _M_data->_M_curr_symbol = L"";
299.1722 ++	  _M_data->_M_curr_symbol_size = 0;
299.1723 ++	  _M_data->_M_positive_sign = L"";
299.1724 ++	  _M_data->_M_positive_sign_size = 0;
299.1725 ++	  _M_data->_M_negative_sign = L"";
299.1726 ++	  _M_data->_M_negative_sign_size = 0;
299.1727 ++	  _M_data->_M_frac_digits = 0;
299.1728 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
299.1729 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
299.1730 ++
299.1731 ++	  // Use ctype::widen code without the facet...
299.1732 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
299.1733 ++	    _M_data->_M_atoms[__i] =
299.1734 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
299.1735 ++	}
299.1736 ++      else
299.1737 ++	{
299.1738 ++	  // Named locale.
299.1739 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1740 ++	  __c_locale __old = __uselocale(__cloc);
299.1741 ++#else
299.1742 ++	  // Switch to named locale so that mbsrtowcs will work.
299.1743 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
299.1744 ++	  setlocale(LC_ALL, __name);
299.1745 ++#endif
299.1746 ++
299.1747 ++#ifdef __UCLIBC_MJN3_ONLY__
299.1748 ++#warning fix this... should be monetary
299.1749 ++#endif
299.1750 ++#ifdef __UCLIBC__
299.1751 ++# ifdef __UCLIBC_HAS_XLOCALE__
299.1752 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
299.1753 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
299.1754 ++# else
299.1755 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
299.1756 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
299.1757 ++# endif
299.1758 ++#else
299.1759 ++	  union { char *__s; wchar_t __w; } __u;
299.1760 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
299.1761 ++	  _M_data->_M_decimal_point = __u.__w;
299.1762 ++
299.1763 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
299.1764 ++	  _M_data->_M_thousands_sep = __u.__w;
299.1765 ++#endif
299.1766 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
299.1767 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
299.1768 ++
299.1769 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
299.1770 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
299.1771 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
299.1772 ++
299.1773 ++	  wchar_t* __wcs_ps = 0;
299.1774 ++	  wchar_t* __wcs_ns = 0;
299.1775 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
299.1776 ++	  try
299.1777 ++	    {
299.1778 ++	      mbstate_t __state;
299.1779 ++	      size_t __len = strlen(__cpossign);
299.1780 ++	      if (__len)
299.1781 ++		{
299.1782 ++		  ++__len;
299.1783 ++		  memset(&__state, 0, sizeof(mbstate_t));
299.1784 ++		  __wcs_ps = new wchar_t[__len];
299.1785 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
299.1786 ++		  _M_data->_M_positive_sign = __wcs_ps;
299.1787 ++		}
299.1788 ++	      else
299.1789 ++		_M_data->_M_positive_sign = L"";
299.1790 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
299.1791 ++	      
299.1792 ++	      __len = strlen(__cnegsign);
299.1793 ++	      if (!__nposn)
299.1794 ++		_M_data->_M_negative_sign = L"()";
299.1795 ++	      else if (__len)
299.1796 ++		{ 
299.1797 ++		  ++__len;
299.1798 ++		  memset(&__state, 0, sizeof(mbstate_t));
299.1799 ++		  __wcs_ns = new wchar_t[__len];
299.1800 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
299.1801 ++		  _M_data->_M_negative_sign = __wcs_ns;
299.1802 ++		}
299.1803 ++	      else
299.1804 ++		_M_data->_M_negative_sign = L"";
299.1805 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
299.1806 ++	      
299.1807 ++	      // _Intl == true.
299.1808 ++	      __len = strlen(__ccurr);
299.1809 ++	      if (__len)
299.1810 ++		{
299.1811 ++		  ++__len;
299.1812 ++		  memset(&__state, 0, sizeof(mbstate_t));
299.1813 ++		  wchar_t* __wcs = new wchar_t[__len];
299.1814 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
299.1815 ++		  _M_data->_M_curr_symbol = __wcs;
299.1816 ++		}
299.1817 ++	      else
299.1818 ++		_M_data->_M_curr_symbol = L"";
299.1819 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
299.1820 ++	    }
299.1821 ++	  catch (...)
299.1822 ++	    {
299.1823 ++	      delete _M_data;
299.1824 ++	      _M_data = 0;
299.1825 ++	      delete __wcs_ps;
299.1826 ++	      delete __wcs_ns;	      
299.1827 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1828 ++	      __uselocale(__old);
299.1829 ++#else
299.1830 ++	      setlocale(LC_ALL, __old);
299.1831 ++	      free(__old);
299.1832 ++#endif
299.1833 ++	      __throw_exception_again;
299.1834 ++	    } 
299.1835 ++	  
299.1836 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
299.1837 ++						      __cloc));
299.1838 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
299.1839 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
299.1840 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
299.1841 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
299.1842 ++							__pposn);
299.1843 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
299.1844 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
299.1845 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
299.1846 ++							__nposn);
299.1847 ++
299.1848 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1849 ++	  __uselocale(__old);
299.1850 ++#else
299.1851 ++	  setlocale(LC_ALL, __old);
299.1852 ++	  free(__old);
299.1853 ++#endif
299.1854 ++	}
299.1855 ++    }
299.1856 ++
299.1857 ++  template<> 
299.1858 ++  void
299.1859 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
299.1860 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1861 ++						       const char*)
299.1862 ++#else
299.1863 ++                                                       const char* __name)
299.1864 ++#endif
299.1865 ++  {
299.1866 ++    if (!_M_data)
299.1867 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
299.1868 ++
299.1869 ++    if (!__cloc)
299.1870 ++	{
299.1871 ++	  // "C" locale
299.1872 ++	  _M_data->_M_decimal_point = L'.';
299.1873 ++	  _M_data->_M_thousands_sep = L',';
299.1874 ++	  _M_data->_M_grouping = "";
299.1875 ++          _M_data->_M_grouping_size = 0;
299.1876 ++	  _M_data->_M_curr_symbol = L"";
299.1877 ++	  _M_data->_M_curr_symbol_size = 0;
299.1878 ++	  _M_data->_M_positive_sign = L"";
299.1879 ++	  _M_data->_M_positive_sign_size = 0;
299.1880 ++	  _M_data->_M_negative_sign = L"";
299.1881 ++	  _M_data->_M_negative_sign_size = 0;
299.1882 ++	  _M_data->_M_frac_digits = 0;
299.1883 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
299.1884 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
299.1885 ++
299.1886 ++	  // Use ctype::widen code without the facet...
299.1887 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
299.1888 ++	    _M_data->_M_atoms[__i] =
299.1889 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
299.1890 ++	}
299.1891 ++      else
299.1892 ++	{
299.1893 ++	  // Named locale.
299.1894 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1895 ++	  __c_locale __old = __uselocale(__cloc);
299.1896 ++#else
299.1897 ++	  // Switch to named locale so that mbsrtowcs will work.
299.1898 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
299.1899 ++	  setlocale(LC_ALL, __name);
299.1900 ++#endif
299.1901 ++
299.1902 ++#ifdef __UCLIBC_MJN3_ONLY__
299.1903 ++#warning fix this... should be monetary
299.1904 ++#endif
299.1905 ++#ifdef __UCLIBC__
299.1906 ++# ifdef __UCLIBC_HAS_XLOCALE__
299.1907 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
299.1908 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
299.1909 ++# else
299.1910 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
299.1911 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
299.1912 ++# endif
299.1913 ++#else
299.1914 ++          union { char *__s; wchar_t __w; } __u;
299.1915 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
299.1916 ++	  _M_data->_M_decimal_point = __u.__w;
299.1917 ++
299.1918 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
299.1919 ++	  _M_data->_M_thousands_sep = __u.__w;
299.1920 ++#endif
299.1921 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
299.1922 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
299.1923 ++
299.1924 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
299.1925 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
299.1926 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
299.1927 ++
299.1928 ++	  wchar_t* __wcs_ps = 0;
299.1929 ++	  wchar_t* __wcs_ns = 0;
299.1930 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
299.1931 ++	  try
299.1932 ++            {
299.1933 ++              mbstate_t __state;
299.1934 ++              size_t __len;
299.1935 ++              __len = strlen(__cpossign);
299.1936 ++              if (__len)
299.1937 ++                {
299.1938 ++		  ++__len;
299.1939 ++		  memset(&__state, 0, sizeof(mbstate_t));
299.1940 ++		  __wcs_ps = new wchar_t[__len];
299.1941 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
299.1942 ++		  _M_data->_M_positive_sign = __wcs_ps;
299.1943 ++		}
299.1944 ++	      else
299.1945 ++		_M_data->_M_positive_sign = L"";
299.1946 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
299.1947 ++	      
299.1948 ++	      __len = strlen(__cnegsign);
299.1949 ++	      if (!__nposn)
299.1950 ++		_M_data->_M_negative_sign = L"()";
299.1951 ++	      else if (__len)
299.1952 ++		{ 
299.1953 ++		  ++__len;
299.1954 ++		  memset(&__state, 0, sizeof(mbstate_t));
299.1955 ++		  __wcs_ns = new wchar_t[__len];
299.1956 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
299.1957 ++		  _M_data->_M_negative_sign = __wcs_ns;
299.1958 ++		}
299.1959 ++	      else
299.1960 ++		_M_data->_M_negative_sign = L"";
299.1961 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
299.1962 ++
299.1963 ++	      // _Intl == true.
299.1964 ++	      __len = strlen(__ccurr);
299.1965 ++	      if (__len)
299.1966 ++		{
299.1967 ++		  ++__len;
299.1968 ++		  memset(&__state, 0, sizeof(mbstate_t));
299.1969 ++		  wchar_t* __wcs = new wchar_t[__len];
299.1970 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
299.1971 ++		  _M_data->_M_curr_symbol = __wcs;
299.1972 ++		}
299.1973 ++	      else
299.1974 ++		_M_data->_M_curr_symbol = L"";
299.1975 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
299.1976 ++	    }
299.1977 ++          catch (...)
299.1978 ++	    {
299.1979 ++	      delete _M_data;
299.1980 ++              _M_data = 0;
299.1981 ++	      delete __wcs_ps;
299.1982 ++	      delete __wcs_ns;	      
299.1983 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.1984 ++	      __uselocale(__old);
299.1985 ++#else
299.1986 ++	      setlocale(LC_ALL, __old);
299.1987 ++	      free(__old);
299.1988 ++#endif
299.1989 ++              __throw_exception_again;
299.1990 ++	    }
299.1991 ++
299.1992 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
299.1993 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
299.1994 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
299.1995 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
299.1996 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
299.1997 ++	                                                __pposn);
299.1998 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
299.1999 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
299.2000 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
299.2001 ++	                                                __nposn);
299.2002 ++
299.2003 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.2004 ++	  __uselocale(__old);
299.2005 ++#else
299.2006 ++	  setlocale(LC_ALL, __old);
299.2007 ++	  free(__old);
299.2008 ++#endif
299.2009 ++	}
299.2010 ++    }
299.2011 ++
299.2012 ++  template<> 
299.2013 ++    moneypunct<wchar_t, true>::~moneypunct()
299.2014 ++    {
299.2015 ++      if (_M_data->_M_positive_sign_size)
299.2016 ++	delete [] _M_data->_M_positive_sign;
299.2017 ++      if (_M_data->_M_negative_sign_size
299.2018 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
299.2019 ++	delete [] _M_data->_M_negative_sign;
299.2020 ++      if (_M_data->_M_curr_symbol_size)
299.2021 ++	delete [] _M_data->_M_curr_symbol;
299.2022 ++      delete _M_data;
299.2023 ++    }
299.2024 ++
299.2025 ++  template<> 
299.2026 ++    moneypunct<wchar_t, false>::~moneypunct()
299.2027 ++    {
299.2028 ++      if (_M_data->_M_positive_sign_size)
299.2029 ++	delete [] _M_data->_M_positive_sign;
299.2030 ++      if (_M_data->_M_negative_sign_size
299.2031 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
299.2032 ++	delete [] _M_data->_M_negative_sign;
299.2033 ++      if (_M_data->_M_curr_symbol_size)
299.2034 ++	delete [] _M_data->_M_curr_symbol;
299.2035 ++      delete _M_data;
299.2036 ++    }
299.2037 ++#endif
299.2038 ++}
299.2039 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
299.2040 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
299.2041 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
299.2042 +@@ -0,0 +1,160 @@
299.2043 ++// std::numpunct implementation details, GNU version -*- C++ -*-
299.2044 ++
299.2045 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
299.2046 ++//
299.2047 ++// This file is part of the GNU ISO C++ Library.  This library is free
299.2048 ++// software; you can redistribute it and/or modify it under the
299.2049 ++// terms of the GNU General Public License as published by the
299.2050 ++// Free Software Foundation; either version 2, or (at your option)
299.2051 ++// any later version.
299.2052 ++
299.2053 ++// This library is distributed in the hope that it will be useful,
299.2054 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
299.2055 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
299.2056 ++// GNU General Public License for more details.
299.2057 ++
299.2058 ++// You should have received a copy of the GNU General Public License along
299.2059 ++// with this library; see the file COPYING.  If not, write to the Free
299.2060 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
299.2061 ++// USA.
299.2062 ++
299.2063 ++// As a special exception, you may use this file as part of a free software
299.2064 ++// library without restriction.  Specifically, if other files instantiate
299.2065 ++// templates or use macros or inline functions from this file, or you compile
299.2066 ++// this file and link it with other files to produce an executable, this
299.2067 ++// file does not by itself cause the resulting executable to be covered by
299.2068 ++// the GNU General Public License.  This exception does not however
299.2069 ++// invalidate any other reasons why the executable file might be covered by
299.2070 ++// the GNU General Public License.
299.2071 ++
299.2072 ++//
299.2073 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
299.2074 ++//
299.2075 ++
299.2076 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
299.2077 ++
299.2078 ++#define _LIBC
299.2079 ++#include <locale>
299.2080 ++#undef _LIBC
299.2081 ++#include <bits/c++locale_internal.h>
299.2082 ++
299.2083 ++#ifdef __UCLIBC_MJN3_ONLY__
299.2084 ++#warning tailor for stub locale support
299.2085 ++#endif
299.2086 ++#ifndef __UCLIBC_HAS_XLOCALE__
299.2087 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
299.2088 ++#endif
299.2089 ++
299.2090 ++namespace std
299.2091 ++{
299.2092 ++  template<> 
299.2093 ++    void
299.2094 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
299.2095 ++    {
299.2096 ++      if (!_M_data)
299.2097 ++	_M_data = new __numpunct_cache<char>;
299.2098 ++
299.2099 ++      if (!__cloc)
299.2100 ++	{
299.2101 ++	  // "C" locale
299.2102 ++	  _M_data->_M_grouping = "";
299.2103 ++	  _M_data->_M_grouping_size = 0;
299.2104 ++	  _M_data->_M_use_grouping = false;
299.2105 ++
299.2106 ++	  _M_data->_M_decimal_point = '.';
299.2107 ++	  _M_data->_M_thousands_sep = ',';
299.2108 ++
299.2109 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
299.2110 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
299.2111 ++
299.2112 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
299.2113 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
299.2114 ++	}
299.2115 ++      else
299.2116 ++	{
299.2117 ++	  // Named locale.
299.2118 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
299.2119 ++							__cloc));
299.2120 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
299.2121 ++							__cloc));
299.2122 ++
299.2123 ++	  // Check for NULL, which implies no grouping.
299.2124 ++	  if (_M_data->_M_thousands_sep == '\0')
299.2125 ++	    _M_data->_M_grouping = "";
299.2126 ++	  else
299.2127 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
299.2128 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
299.2129 ++	}
299.2130 ++
299.2131 ++      // NB: There is no way to extact this info from posix locales.
299.2132 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
299.2133 ++      _M_data->_M_truename = "true";
299.2134 ++      _M_data->_M_truename_size = 4;
299.2135 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
299.2136 ++      _M_data->_M_falsename = "false";
299.2137 ++      _M_data->_M_falsename_size = 5;
299.2138 ++    }
299.2139 ++ 
299.2140 ++  template<> 
299.2141 ++    numpunct<char>::~numpunct()
299.2142 ++    { delete _M_data; }
299.2143 ++   
299.2144 ++#ifdef _GLIBCXX_USE_WCHAR_T
299.2145 ++  template<> 
299.2146 ++    void
299.2147 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
299.2148 ++    {
299.2149 ++      if (!_M_data)
299.2150 ++	_M_data = new __numpunct_cache<wchar_t>;
299.2151 ++
299.2152 ++      if (!__cloc)
299.2153 ++	{
299.2154 ++	  // "C" locale
299.2155 ++	  _M_data->_M_grouping = "";
299.2156 ++	  _M_data->_M_grouping_size = 0;
299.2157 ++	  _M_data->_M_use_grouping = false;
299.2158 ++
299.2159 ++	  _M_data->_M_decimal_point = L'.';
299.2160 ++	  _M_data->_M_thousands_sep = L',';
299.2161 ++
299.2162 ++	  // Use ctype::widen code without the facet...
299.2163 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
299.2164 ++	    _M_data->_M_atoms_out[__i] =
299.2165 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
299.2166 ++
299.2167 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
299.2168 ++	    _M_data->_M_atoms_in[__j] =
299.2169 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
299.2170 ++	}
299.2171 ++      else
299.2172 ++	{
299.2173 ++	  // Named locale.
299.2174 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
299.2175 ++	  union { char *__s; wchar_t __w; } __u;
299.2176 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
299.2177 ++	  _M_data->_M_decimal_point = __u.__w;
299.2178 ++
299.2179 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
299.2180 ++	  _M_data->_M_thousands_sep = __u.__w;
299.2181 ++
299.2182 ++	  if (_M_data->_M_thousands_sep == L'\0')
299.2183 ++	    _M_data->_M_grouping = "";
299.2184 ++	  else
299.2185 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
299.2186 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
299.2187 ++	}
299.2188 ++
299.2189 ++      // NB: There is no way to extact this info from posix locales.
299.2190 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
299.2191 ++      _M_data->_M_truename = L"true";
299.2192 ++      _M_data->_M_truename_size = 4;
299.2193 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
299.2194 ++      _M_data->_M_falsename = L"false";
299.2195 ++      _M_data->_M_falsename_size = 5;
299.2196 ++    }
299.2197 ++
299.2198 ++  template<> 
299.2199 ++    numpunct<wchar_t>::~numpunct()
299.2200 ++    { delete _M_data; }
299.2201 ++ #endif
299.2202 ++}
299.2203 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
299.2204 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
299.2205 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
299.2206 +@@ -0,0 +1,406 @@
299.2207 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
299.2208 ++
299.2209 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
299.2210 ++//
299.2211 ++// This file is part of the GNU ISO C++ Library.  This library is free
299.2212 ++// software; you can redistribute it and/or modify it under the
299.2213 ++// terms of the GNU General Public License as published by the
299.2214 ++// Free Software Foundation; either version 2, or (at your option)
299.2215 ++// any later version.
299.2216 ++
299.2217 ++// This library is distributed in the hope that it will be useful,
299.2218 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
299.2219 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
299.2220 ++// GNU General Public License for more details.
299.2221 ++
299.2222 ++// You should have received a copy of the GNU General Public License along
299.2223 ++// with this library; see the file COPYING.  If not, write to the Free
299.2224 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
299.2225 ++// USA.
299.2226 ++
299.2227 ++// As a special exception, you may use this file as part of a free software
299.2228 ++// library without restriction.  Specifically, if other files instantiate
299.2229 ++// templates or use macros or inline functions from this file, or you compile
299.2230 ++// this file and link it with other files to produce an executable, this
299.2231 ++// file does not by itself cause the resulting executable to be covered by
299.2232 ++// the GNU General Public License.  This exception does not however
299.2233 ++// invalidate any other reasons why the executable file might be covered by
299.2234 ++// the GNU General Public License.
299.2235 ++
299.2236 ++//
299.2237 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
299.2238 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
299.2239 ++//
299.2240 ++
299.2241 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
299.2242 ++
299.2243 ++#include <locale>
299.2244 ++#include <bits/c++locale_internal.h>
299.2245 ++
299.2246 ++#ifdef __UCLIBC_MJN3_ONLY__
299.2247 ++#warning tailor for stub locale support
299.2248 ++#endif
299.2249 ++#ifndef __UCLIBC_HAS_XLOCALE__
299.2250 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
299.2251 ++#endif
299.2252 ++
299.2253 ++namespace std
299.2254 ++{
299.2255 ++  template<>
299.2256 ++    void
299.2257 ++    __timepunct<char>::
299.2258 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
299.2259 ++	   const tm* __tm) const
299.2260 ++    {
299.2261 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.2262 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
299.2263 ++					_M_c_locale_timepunct);
299.2264 ++#else
299.2265 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
299.2266 ++      setlocale(LC_ALL, _M_name_timepunct);
299.2267 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
299.2268 ++      setlocale(LC_ALL, __old);
299.2269 ++      free(__old);
299.2270 ++#endif
299.2271 ++      // Make sure __s is null terminated.
299.2272 ++      if (__len == 0)
299.2273 ++	__s[0] = '\0';
299.2274 ++    }
299.2275 ++
299.2276 ++  template<> 
299.2277 ++    void
299.2278 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
299.2279 ++    {
299.2280 ++      if (!_M_data)
299.2281 ++	_M_data = new __timepunct_cache<char>;
299.2282 ++
299.2283 ++      if (!__cloc)
299.2284 ++	{
299.2285 ++	  // "C" locale
299.2286 ++	  _M_c_locale_timepunct = _S_get_c_locale();
299.2287 ++
299.2288 ++	  _M_data->_M_date_format = "%m/%d/%y";
299.2289 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
299.2290 ++	  _M_data->_M_time_format = "%H:%M:%S";
299.2291 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
299.2292 ++	  _M_data->_M_date_time_format = "";
299.2293 ++	  _M_data->_M_date_time_era_format = "";
299.2294 ++	  _M_data->_M_am = "AM";
299.2295 ++	  _M_data->_M_pm = "PM";
299.2296 ++	  _M_data->_M_am_pm_format = "";
299.2297 ++
299.2298 ++	  // Day names, starting with "C"'s Sunday.
299.2299 ++	  _M_data->_M_day1 = "Sunday";
299.2300 ++	  _M_data->_M_day2 = "Monday";
299.2301 ++	  _M_data->_M_day3 = "Tuesday";
299.2302 ++	  _M_data->_M_day4 = "Wednesday";
299.2303 ++	  _M_data->_M_day5 = "Thursday";
299.2304 ++	  _M_data->_M_day6 = "Friday";
299.2305 ++	  _M_data->_M_day7 = "Saturday";
299.2306 ++
299.2307 ++	  // Abbreviated day names, starting with "C"'s Sun.
299.2308 ++	  _M_data->_M_aday1 = "Sun";
299.2309 ++	  _M_data->_M_aday2 = "Mon";
299.2310 ++	  _M_data->_M_aday3 = "Tue";
299.2311 ++	  _M_data->_M_aday4 = "Wed";
299.2312 ++	  _M_data->_M_aday5 = "Thu";
299.2313 ++	  _M_data->_M_aday6 = "Fri";
299.2314 ++	  _M_data->_M_aday7 = "Sat";
299.2315 ++
299.2316 ++	  // Month names, starting with "C"'s January.
299.2317 ++	  _M_data->_M_month01 = "January";
299.2318 ++	  _M_data->_M_month02 = "February";
299.2319 ++	  _M_data->_M_month03 = "March";
299.2320 ++	  _M_data->_M_month04 = "April";
299.2321 ++	  _M_data->_M_month05 = "May";
299.2322 ++	  _M_data->_M_month06 = "June";
299.2323 ++	  _M_data->_M_month07 = "July";
299.2324 ++	  _M_data->_M_month08 = "August";
299.2325 ++	  _M_data->_M_month09 = "September";
299.2326 ++	  _M_data->_M_month10 = "October";
299.2327 ++	  _M_data->_M_month11 = "November";
299.2328 ++	  _M_data->_M_month12 = "December";
299.2329 ++
299.2330 ++	  // Abbreviated month names, starting with "C"'s Jan.
299.2331 ++	  _M_data->_M_amonth01 = "Jan";
299.2332 ++	  _M_data->_M_amonth02 = "Feb";
299.2333 ++	  _M_data->_M_amonth03 = "Mar";
299.2334 ++	  _M_data->_M_amonth04 = "Apr";
299.2335 ++	  _M_data->_M_amonth05 = "May";
299.2336 ++	  _M_data->_M_amonth06 = "Jun";
299.2337 ++	  _M_data->_M_amonth07 = "Jul";
299.2338 ++	  _M_data->_M_amonth08 = "Aug";
299.2339 ++	  _M_data->_M_amonth09 = "Sep";
299.2340 ++	  _M_data->_M_amonth10 = "Oct";
299.2341 ++	  _M_data->_M_amonth11 = "Nov";
299.2342 ++	  _M_data->_M_amonth12 = "Dec";
299.2343 ++	}
299.2344 ++      else
299.2345 ++	{
299.2346 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
299.2347 ++
299.2348 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
299.2349 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
299.2350 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
299.2351 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
299.2352 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
299.2353 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
299.2354 ++							     __cloc);
299.2355 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
299.2356 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
299.2357 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
299.2358 ++
299.2359 ++	  // Day names, starting with "C"'s Sunday.
299.2360 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
299.2361 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
299.2362 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
299.2363 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
299.2364 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
299.2365 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
299.2366 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
299.2367 ++
299.2368 ++	  // Abbreviated day names, starting with "C"'s Sun.
299.2369 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
299.2370 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
299.2371 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
299.2372 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
299.2373 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
299.2374 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
299.2375 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
299.2376 ++
299.2377 ++	  // Month names, starting with "C"'s January.
299.2378 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
299.2379 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
299.2380 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
299.2381 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
299.2382 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
299.2383 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
299.2384 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
299.2385 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
299.2386 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
299.2387 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
299.2388 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
299.2389 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
299.2390 ++
299.2391 ++	  // Abbreviated month names, starting with "C"'s Jan.
299.2392 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
299.2393 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
299.2394 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
299.2395 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
299.2396 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
299.2397 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
299.2398 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
299.2399 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
299.2400 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
299.2401 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
299.2402 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
299.2403 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
299.2404 ++	}
299.2405 ++    }
299.2406 ++
299.2407 ++#ifdef _GLIBCXX_USE_WCHAR_T
299.2408 ++  template<>
299.2409 ++    void
299.2410 ++    __timepunct<wchar_t>::
299.2411 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
299.2412 ++	   const tm* __tm) const
299.2413 ++    {
299.2414 ++#ifdef __UCLIBC_HAS_XLOCALE__
299.2415 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
299.2416 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
299.2417 ++					_M_c_locale_timepunct);
299.2418 ++#else
299.2419 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
299.2420 ++      setlocale(LC_ALL, _M_name_timepunct);
299.2421 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
299.2422 ++      setlocale(LC_ALL, __old);
299.2423 ++      free(__old);
299.2424 ++#endif
299.2425 ++      // Make sure __s is null terminated.
299.2426 ++      if (__len == 0)
299.2427 ++	__s[0] = L'\0';
299.2428 ++    }
299.2429 ++
299.2430 ++  template<> 
299.2431 ++    void
299.2432 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
299.2433 ++    {
299.2434 ++      if (!_M_data)
299.2435 ++	_M_data = new __timepunct_cache<wchar_t>;
299.2436 ++
299.2437 ++#warning wide time stuff
299.2438 ++//       if (!__cloc)
299.2439 ++	{
299.2440 ++	  // "C" locale
299.2441 ++	  _M_c_locale_timepunct = _S_get_c_locale();
299.2442 ++
299.2443 ++	  _M_data->_M_date_format = L"%m/%d/%y";
299.2444 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
299.2445 ++	  _M_data->_M_time_format = L"%H:%M:%S";
299.2446 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
299.2447 ++	  _M_data->_M_date_time_format = L"";
299.2448 ++	  _M_data->_M_date_time_era_format = L"";
299.2449 ++	  _M_data->_M_am = L"AM";
299.2450 ++	  _M_data->_M_pm = L"PM";
299.2451 ++	  _M_data->_M_am_pm_format = L"";
299.2452 ++
299.2453 ++	  // Day names, starting with "C"'s Sunday.
299.2454 ++	  _M_data->_M_day1 = L"Sunday";
299.2455 ++	  _M_data->_M_day2 = L"Monday";
299.2456 ++	  _M_data->_M_day3 = L"Tuesday";
299.2457 ++	  _M_data->_M_day4 = L"Wednesday";
299.2458 ++	  _M_data->_M_day5 = L"Thursday";
299.2459 ++	  _M_data->_M_day6 = L"Friday";
299.2460 ++	  _M_data->_M_day7 = L"Saturday";
299.2461 ++
299.2462 ++	  // Abbreviated day names, starting with "C"'s Sun.
299.2463 ++	  _M_data->_M_aday1 = L"Sun";
299.2464 ++	  _M_data->_M_aday2 = L"Mon";
299.2465 ++	  _M_data->_M_aday3 = L"Tue";
299.2466 ++	  _M_data->_M_aday4 = L"Wed";
299.2467 ++	  _M_data->_M_aday5 = L"Thu";
299.2468 ++	  _M_data->_M_aday6 = L"Fri";
299.2469 ++	  _M_data->_M_aday7 = L"Sat";
299.2470 ++
299.2471 ++	  // Month names, starting with "C"'s January.
299.2472 ++	  _M_data->_M_month01 = L"January";
299.2473 ++	  _M_data->_M_month02 = L"February";
299.2474 ++	  _M_data->_M_month03 = L"March";
299.2475 ++	  _M_data->_M_month04 = L"April";
299.2476 ++	  _M_data->_M_month05 = L"May";
299.2477 ++	  _M_data->_M_month06 = L"June";
299.2478 ++	  _M_data->_M_month07 = L"July";
299.2479 ++	  _M_data->_M_month08 = L"August";
299.2480 ++	  _M_data->_M_month09 = L"September";
299.2481 ++	  _M_data->_M_month10 = L"October";
299.2482 ++	  _M_data->_M_month11 = L"November";
299.2483 ++	  _M_data->_M_month12 = L"December";
299.2484 ++
299.2485 ++	  // Abbreviated month names, starting with "C"'s Jan.
299.2486 ++	  _M_data->_M_amonth01 = L"Jan";
299.2487 ++	  _M_data->_M_amonth02 = L"Feb";
299.2488 ++	  _M_data->_M_amonth03 = L"Mar";
299.2489 ++	  _M_data->_M_amonth04 = L"Apr";
299.2490 ++	  _M_data->_M_amonth05 = L"May";
299.2491 ++	  _M_data->_M_amonth06 = L"Jun";
299.2492 ++	  _M_data->_M_amonth07 = L"Jul";
299.2493 ++	  _M_data->_M_amonth08 = L"Aug";
299.2494 ++	  _M_data->_M_amonth09 = L"Sep";
299.2495 ++	  _M_data->_M_amonth10 = L"Oct";
299.2496 ++	  _M_data->_M_amonth11 = L"Nov";
299.2497 ++	  _M_data->_M_amonth12 = L"Dec";
299.2498 ++	}
299.2499 ++#if 0
299.2500 ++      else
299.2501 ++	{
299.2502 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
299.2503 ++
299.2504 ++	  union { char *__s; wchar_t *__w; } __u;
299.2505 ++
299.2506 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
299.2507 ++	  _M_data->_M_date_format = __u.__w;
299.2508 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
299.2509 ++	  _M_data->_M_date_era_format = __u.__w;
299.2510 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
299.2511 ++	  _M_data->_M_time_format = __u.__w;
299.2512 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
299.2513 ++	  _M_data->_M_time_era_format = __u.__w;
299.2514 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
299.2515 ++	  _M_data->_M_date_time_format = __u.__w;
299.2516 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
299.2517 ++	  _M_data->_M_date_time_era_format = __u.__w;
299.2518 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
299.2519 ++	  _M_data->_M_am = __u.__w;
299.2520 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
299.2521 ++	  _M_data->_M_pm = __u.__w;
299.2522 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
299.2523 ++	  _M_data->_M_am_pm_format = __u.__w;
299.2524 ++
299.2525 ++	  // Day names, starting with "C"'s Sunday.
299.2526 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
299.2527 ++	  _M_data->_M_day1 = __u.__w;
299.2528 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
299.2529 ++	  _M_data->_M_day2 = __u.__w;
299.2530 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
299.2531 ++	  _M_data->_M_day3 = __u.__w;
299.2532 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
299.2533 ++	  _M_data->_M_day4 = __u.__w;
299.2534 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
299.2535 ++	  _M_data->_M_day5 = __u.__w;
299.2536 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
299.2537 ++	  _M_data->_M_day6 = __u.__w;
299.2538 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
299.2539 ++	  _M_data->_M_day7 = __u.__w;
299.2540 ++
299.2541 ++	  // Abbreviated day names, starting with "C"'s Sun.
299.2542 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
299.2543 ++	  _M_data->_M_aday1 = __u.__w;
299.2544 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
299.2545 ++	  _M_data->_M_aday2 = __u.__w;
299.2546 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
299.2547 ++	  _M_data->_M_aday3 = __u.__w;
299.2548 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
299.2549 ++	  _M_data->_M_aday4 = __u.__w;
299.2550 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
299.2551 ++	  _M_data->_M_aday5 = __u.__w;
299.2552 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
299.2553 ++	  _M_data->_M_aday6 = __u.__w;
299.2554 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
299.2555 ++	  _M_data->_M_aday7 = __u.__w;
299.2556 ++
299.2557 ++	  // Month names, starting with "C"'s January.
299.2558 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
299.2559 ++	  _M_data->_M_month01 = __u.__w;
299.2560 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
299.2561 ++	  _M_data->_M_month02 = __u.__w;
299.2562 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
299.2563 ++	  _M_data->_M_month03 = __u.__w;
299.2564 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
299.2565 ++	  _M_data->_M_month04 = __u.__w;
299.2566 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
299.2567 ++	  _M_data->_M_month05 = __u.__w;
299.2568 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
299.2569 ++	  _M_data->_M_month06 = __u.__w;
299.2570 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
299.2571 ++	  _M_data->_M_month07 = __u.__w;
299.2572 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
299.2573 ++	  _M_data->_M_month08 = __u.__w;
299.2574 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
299.2575 ++	  _M_data->_M_month09 = __u.__w;
299.2576 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
299.2577 ++	  _M_data->_M_month10 = __u.__w;
299.2578 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
299.2579 ++	  _M_data->_M_month11 = __u.__w;
299.2580 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
299.2581 ++	  _M_data->_M_month12 = __u.__w;
299.2582 ++
299.2583 ++	  // Abbreviated month names, starting with "C"'s Jan.
299.2584 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
299.2585 ++	  _M_data->_M_amonth01 = __u.__w;
299.2586 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
299.2587 ++	  _M_data->_M_amonth02 = __u.__w;
299.2588 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
299.2589 ++	  _M_data->_M_amonth03 = __u.__w;
299.2590 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
299.2591 ++	  _M_data->_M_amonth04 = __u.__w;
299.2592 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
299.2593 ++	  _M_data->_M_amonth05 = __u.__w;
299.2594 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
299.2595 ++	  _M_data->_M_amonth06 = __u.__w;
299.2596 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
299.2597 ++	  _M_data->_M_amonth07 = __u.__w;
299.2598 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
299.2599 ++	  _M_data->_M_amonth08 = __u.__w;
299.2600 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
299.2601 ++	  _M_data->_M_amonth09 = __u.__w;
299.2602 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
299.2603 ++	  _M_data->_M_amonth10 = __u.__w;
299.2604 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
299.2605 ++	  _M_data->_M_amonth11 = __u.__w;
299.2606 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
299.2607 ++	  _M_data->_M_amonth12 = __u.__w;
299.2608 ++	}
299.2609 ++#endif // 0
299.2610 ++    }
299.2611 ++#endif
299.2612 ++}
299.2613 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
299.2614 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
299.2615 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
299.2616 +@@ -0,0 +1,68 @@
299.2617 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
299.2618 ++
299.2619 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
299.2620 ++//
299.2621 ++// This file is part of the GNU ISO C++ Library.  This library is free
299.2622 ++// software; you can redistribute it and/or modify it under the
299.2623 ++// terms of the GNU General Public License as published by the
299.2624 ++// Free Software Foundation; either version 2, or (at your option)
299.2625 ++// any later version.
299.2626 ++
299.2627 ++// This library is distributed in the hope that it will be useful,
299.2628 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
299.2629 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
299.2630 ++// GNU General Public License for more details.
299.2631 ++
299.2632 ++// You should have received a copy of the GNU General Public License along
299.2633 ++// with this library; see the file COPYING.  If not, write to the Free
299.2634 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
299.2635 ++// USA.
299.2636 ++
299.2637 ++// As a special exception, you may use this file as part of a free software
299.2638 ++// library without restriction.  Specifically, if other files instantiate
299.2639 ++// templates or use macros or inline functions from this file, or you compile
299.2640 ++// this file and link it with other files to produce an executable, this
299.2641 ++// file does not by itself cause the resulting executable to be covered by
299.2642 ++// the GNU General Public License.  This exception does not however
299.2643 ++// invalidate any other reasons why the executable file might be covered by
299.2644 ++// the GNU General Public License.
299.2645 ++
299.2646 ++//
299.2647 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
299.2648 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
299.2649 ++//
299.2650 ++
299.2651 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
299.2652 ++
299.2653 ++  template<typename _CharT>
299.2654 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
299.2655 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
299.2656 ++    _M_name_timepunct(_S_get_c_name())
299.2657 ++    { _M_initialize_timepunct(); }
299.2658 ++
299.2659 ++  template<typename _CharT>
299.2660 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
299.2661 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
299.2662 ++    _M_name_timepunct(_S_get_c_name())
299.2663 ++    { _M_initialize_timepunct(); }
299.2664 ++
299.2665 ++  template<typename _CharT>
299.2666 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
299.2667 ++				     size_t __refs) 
299.2668 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
299.2669 ++    _M_name_timepunct(__s)
299.2670 ++    { 
299.2671 ++      char* __tmp = new char[std::strlen(__s) + 1];
299.2672 ++      std::strcpy(__tmp, __s);
299.2673 ++      _M_name_timepunct = __tmp;
299.2674 ++      _M_initialize_timepunct(__cloc); 
299.2675 ++    }
299.2676 ++
299.2677 ++  template<typename _CharT>
299.2678 ++    __timepunct<_CharT>::~__timepunct()
299.2679 ++    { 
299.2680 ++      if (_M_name_timepunct != _S_get_c_name())
299.2681 ++	delete [] _M_name_timepunct;
299.2682 ++      delete _M_data; 
299.2683 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
299.2684 ++    }
299.2685 +diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
299.2686 +--- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:29:22.000000000 +0200
299.2687 ++++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
299.2688 +@@ -5769,7 +5769,7 @@
299.2689 +   enableval="$enable_clocale"
299.2690 + 
299.2691 +       case "$enableval" in
299.2692 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
299.2693 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
299.2694 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
299.2695 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
299.2696 +    { (exit 1); exit 1; }; } ;;
299.2697 +@@ -5802,6 +5802,9 @@
299.2698 +   # Default to "generic".
299.2699 +   if test $enable_clocale_flag = auto; then
299.2700 +     case ${target_os} in
299.2701 ++      linux-uclibc*)
299.2702 ++        enable_clocale_flag=uclibc
299.2703 ++	;;
299.2704 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
299.2705 +         enable_clocale_flag=gnu
299.2706 +         ;;
299.2707 +@@ -6190,6 +6193,76 @@
299.2708 +       CTIME_CC=config/locale/generic/time_members.cc
299.2709 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
299.2710 +       ;;
299.2711 ++    uclibc)
299.2712 ++      echo "$as_me:$LINENO: result: uclibc" >&5
299.2713 ++echo "${ECHO_T}uclibc" >&6
299.2714 ++
299.2715 ++      # Declare intention to use gettext, and add support for specific
299.2716 ++      # languages.
299.2717 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
299.2718 ++      ALL_LINGUAS="de fr"
299.2719 ++
299.2720 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
299.2721 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
299.2722 ++set dummy msgfmt; ac_word=$2
299.2723 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
299.2724 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
299.2725 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
299.2726 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
299.2727 ++else
299.2728 ++  if test -n "$check_msgfmt"; then
299.2729 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
299.2730 ++else
299.2731 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
299.2732 ++for as_dir in $PATH
299.2733 ++do
299.2734 ++  IFS=$as_save_IFS
299.2735 ++  test -z "$as_dir" && as_dir=.
299.2736 ++  for ac_exec_ext in '' $ac_executable_extensions; do
299.2737 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
299.2738 ++    ac_cv_prog_check_msgfmt="yes"
299.2739 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
299.2740 ++    break 2
299.2741 ++  fi
299.2742 ++done
299.2743 ++done
299.2744 ++
299.2745 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
299.2746 ++fi
299.2747 ++fi
299.2748 ++check_msgfmt=$ac_cv_prog_check_msgfmt
299.2749 ++if test -n "$check_msgfmt"; then
299.2750 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
299.2751 ++echo "${ECHO_T}$check_msgfmt" >&6
299.2752 ++else
299.2753 ++  echo "$as_me:$LINENO: result: no" >&5
299.2754 ++echo "${ECHO_T}no" >&6
299.2755 ++fi
299.2756 ++
299.2757 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
299.2758 ++        USE_NLS=yes
299.2759 ++      fi
299.2760 ++      # Export the build objects.
299.2761 ++      for ling in $ALL_LINGUAS; do \
299.2762 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
299.2763 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
299.2764 ++      done
299.2765 ++
299.2766 ++
299.2767 ++
299.2768 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
299.2769 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
299.2770 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
299.2771 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
299.2772 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
299.2773 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
299.2774 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
299.2775 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
299.2776 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
299.2777 ++      CTIME_H=config/locale/uclibc/time_members.h
299.2778 ++      CTIME_CC=config/locale/uclibc/time_members.cc
299.2779 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
299.2780 ++      ;;
299.2781 +   esac
299.2782 + 
299.2783 +   # This is where the testsuite looks for locale catalogs, using the
299.2784 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h
299.2785 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2005-08-17 04:28:44.000000000 +0200
299.2786 ++++ gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h	2007-08-03 20:30:21.000000000 +0200
299.2787 +@@ -101,7 +101,9 @@
299.2788 + using std::wmemcpy;
299.2789 + using std::wmemmove;
299.2790 + using std::wmemset;
299.2791 ++#if _GLIBCXX_HAVE_WCSFTIME
299.2792 + using std::wcsftime;
299.2793 ++#endif
299.2794 + 
299.2795 + #if _GLIBCXX_USE_C99
299.2796 + using std::wcstold;
299.2797 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h
299.2798 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h	2006-12-07 10:33:51.000000000 +0100
299.2799 ++++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h	2007-08-03 20:30:21.000000000 +0200
299.2800 +@@ -182,7 +182,9 @@
299.2801 +   using ::wcscoll;
299.2802 +   using ::wcscpy;
299.2803 +   using ::wcscspn;
299.2804 ++#if _GLIBCXX_HAVE_WCSFTIME
299.2805 +   using ::wcsftime;
299.2806 ++#endif
299.2807 +   using ::wcslen;
299.2808 +   using ::wcsncat;
299.2809 +   using ::wcsncmp;
   300.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   300.2 +++ b/patches/gcc/4.2.3/130-uclibc-locale-no__x.patch	Mon Jul 28 21:32:33 2008 +0000
   300.3 @@ -0,0 +1,223 @@
   300.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   300.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
   300.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   300.7 +@@ -39,20 +39,6 @@
   300.8 + #include <langinfo.h>
   300.9 + #include <bits/c++locale_internal.h>
  300.10 + 
  300.11 +-#ifndef __UCLIBC_HAS_XLOCALE__
  300.12 +-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  300.13 +-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  300.14 +-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  300.15 +-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  300.16 +-#define __strtof_l(S, E, L)         strtof((S), (E))
  300.17 +-#define __strtod_l(S, E, L)         strtod((S), (E))
  300.18 +-#define __strtold_l(S, E, L)        strtold((S), (E))
  300.19 +-#warning should dummy __newlocale check for C|POSIX ?
  300.20 +-#define __newlocale(a, b, c)        NULL
  300.21 +-#define __freelocale(a)             ((void)0)
  300.22 +-#define __duplocale(a)              __c_locale()
  300.23 +-#endif
  300.24 +-
  300.25 + namespace std 
  300.26 + {
  300.27 +   template<>
  300.28 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  300.29 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
  300.30 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  300.31 +@@ -68,6 +68,7 @@
  300.32 + {
  300.33 +   extern "C" __typeof(uselocale) __uselocale;
  300.34 + }
  300.35 ++#define __uselocale uselocale
  300.36 + #endif
  300.37 + 
  300.38 + namespace std
  300.39 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  300.40 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
  300.41 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:53.000000000 +0200
  300.42 +@@ -60,4 +60,49 @@
  300.43 + extern "C" __typeof(wctype_l) __wctype_l;
  300.44 + #endif 
  300.45 + 
  300.46 ++# define __nl_langinfo_l nl_langinfo_l
  300.47 ++# define __strcoll_l strcoll_l
  300.48 ++# define __strftime_l strftime_l
  300.49 ++# define __strtod_l strtod_l
  300.50 ++# define __strtof_l strtof_l
  300.51 ++# define __strtold_l strtold_l
  300.52 ++# define __strxfrm_l strxfrm_l
  300.53 ++# define __newlocale newlocale
  300.54 ++# define __freelocale freelocale
  300.55 ++# define __duplocale duplocale
  300.56 ++# define __uselocale uselocale
  300.57 ++
  300.58 ++# ifdef _GLIBCXX_USE_WCHAR_T
  300.59 ++#  define __iswctype_l iswctype_l
  300.60 ++#  define __towlower_l towlower_l
  300.61 ++#  define __towupper_l towupper_l
  300.62 ++#  define __wcscoll_l wcscoll_l
  300.63 ++#  define __wcsftime_l wcsftime_l
  300.64 ++#  define __wcsxfrm_l wcsxfrm_l
  300.65 ++#  define __wctype_l wctype_l
  300.66 ++# endif
  300.67 ++
  300.68 ++#else
  300.69 ++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  300.70 ++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  300.71 ++# define __strtod_l(S, E, L)         strtod((S), (E))
  300.72 ++# define __strtof_l(S, E, L)         strtof((S), (E))
  300.73 ++# define __strtold_l(S, E, L)        strtold((S), (E))
  300.74 ++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  300.75 ++# warning should dummy __newlocale check for C|POSIX ?
  300.76 ++# define __newlocale(a, b, c)        NULL
  300.77 ++# define __freelocale(a)             ((void)0)
  300.78 ++# define __duplocale(a)              __c_locale()
  300.79 ++//# define __uselocale ?
  300.80 ++//
  300.81 ++# ifdef _GLIBCXX_USE_WCHAR_T
  300.82 ++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  300.83 ++#  define __towlower_l(C, L)          towlower((C))
  300.84 ++#  define __towupper_l(C, L)          towupper((C))
  300.85 ++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  300.86 ++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  300.87 ++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  300.88 ++#  define __wctype_l(S, L)            wctype((S))
  300.89 ++# endif
  300.90 ++
  300.91 + #endif // GLIBC 2.3 and later
  300.92 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
  300.93 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
  300.94 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:53.000000000 +0200
  300.95 +@@ -36,13 +36,6 @@
  300.96 + #include <locale>
  300.97 + #include <bits/c++locale_internal.h>
  300.98 + 
  300.99 +-#ifndef __UCLIBC_HAS_XLOCALE__
 300.100 +-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 300.101 +-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 300.102 +-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 300.103 +-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 300.104 +-#endif
 300.105 +-
 300.106 + namespace std
 300.107 + {
 300.108 +   // These are basically extensions to char_traits, and perhaps should
 300.109 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 300.110 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 300.111 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 300.112 +@@ -38,13 +38,6 @@
 300.113 + #undef _LIBC
 300.114 + #include <bits/c++locale_internal.h>
 300.115 + 
 300.116 +-#ifndef __UCLIBC_HAS_XLOCALE__
 300.117 +-#define __wctype_l(S, L)           wctype((S))
 300.118 +-#define __towupper_l(C, L)         towupper((C))
 300.119 +-#define __towlower_l(C, L)         towlower((C))
 300.120 +-#define __iswctype_l(C, M, L)      iswctype((C), (M))
 300.121 +-#endif
 300.122 +-
 300.123 + namespace std
 300.124 + {
 300.125 +   // NB: The other ctype<char> specializations are in src/locale.cc and
 300.126 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
 300.127 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
 300.128 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:53.000000000 +0200
 300.129 +@@ -39,13 +39,10 @@
 300.130 + #ifdef __UCLIBC_MJN3_ONLY__
 300.131 + #warning fix gettext stuff
 300.132 + #endif
 300.133 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 300.134 +-extern "C" char *__dcgettext(const char *domainname,
 300.135 +-			     const char *msgid, int category);
 300.136 + #undef gettext
 300.137 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 300.138 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 300.139 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 300.140 + #else
 300.141 +-#undef gettext
 300.142 + #define gettext(msgid) (msgid)
 300.143 + #endif
 300.144 + 
 300.145 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 300.146 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
 300.147 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 300.148 +@@ -36,15 +36,11 @@
 300.149 + #ifdef __UCLIBC_MJN3_ONLY__
 300.150 + #warning fix prototypes for *textdomain funcs
 300.151 + #endif
 300.152 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 300.153 +-extern "C" char *__textdomain(const char *domainname);
 300.154 +-extern "C" char *__bindtextdomain(const char *domainname,
 300.155 +-				  const char *dirname);
 300.156 +-#else
 300.157 +-#undef __textdomain
 300.158 +-#undef __bindtextdomain
 300.159 +-#define __textdomain(D)           ((void)0)
 300.160 +-#define __bindtextdomain(D,P)     ((void)0)
 300.161 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 300.162 ++#undef textdomain
 300.163 ++#undef bindtextdomain
 300.164 ++#define textdomain(D)           ((void)0)
 300.165 ++#define bindtextdomain(D,P)     ((void)0)
 300.166 + #endif
 300.167 + 
 300.168 +   // Non-virtual member functions.
 300.169 +@@ -70,7 +66,7 @@
 300.170 +     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 300.171 + 			   const char* __dir) const
 300.172 +     { 
 300.173 +-      __bindtextdomain(__s.c_str(), __dir);
 300.174 ++      bindtextdomain(__s.c_str(), __dir);
 300.175 +       return this->do_open(__s, __loc); 
 300.176 +     }
 300.177 + 
 300.178 +@@ -90,7 +86,7 @@
 300.179 +     { 
 300.180 +       // No error checking is done, assume the catalog exists and can
 300.181 +       // be used.
 300.182 +-      __textdomain(__s.c_str());
 300.183 ++      textdomain(__s.c_str());
 300.184 +       return 0;
 300.185 +     }
 300.186 + 
 300.187 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 300.188 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
 300.189 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
 300.190 +@@ -43,10 +43,6 @@
 300.191 + #warning tailor for stub locale support
 300.192 + #endif
 300.193 + 
 300.194 +-#ifndef __UCLIBC_HAS_XLOCALE__
 300.195 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 300.196 +-#endif
 300.197 +-
 300.198 + namespace std
 300.199 + {
 300.200 +   // Construct and return valid pattern consisting of some combination of:
 300.201 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 300.202 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
 300.203 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
 300.204 +@@ -41,9 +41,6 @@
 300.205 + #ifdef __UCLIBC_MJN3_ONLY__
 300.206 + #warning tailor for stub locale support
 300.207 + #endif
 300.208 +-#ifndef __UCLIBC_HAS_XLOCALE__
 300.209 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 300.210 +-#endif
 300.211 + 
 300.212 + namespace std
 300.213 + {
 300.214 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
 300.215 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
 300.216 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:53.000000000 +0200
 300.217 +@@ -40,9 +40,6 @@
 300.218 + #ifdef __UCLIBC_MJN3_ONLY__
 300.219 + #warning tailor for stub locale support
 300.220 + #endif
 300.221 +-#ifndef __UCLIBC_HAS_XLOCALE__
 300.222 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 300.223 +-#endif
 300.224 + 
 300.225 + namespace std
 300.226 + {
   301.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   301.2 +++ b/patches/gcc/4.2.3/140-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:32:33 2008 +0000
   301.3 @@ -0,0 +1,50 @@
   301.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   301.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
   301.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
   301.7 +@@ -401,7 +401,7 @@
   301.8 + # ifdef __UCLIBC_HAS_XLOCALE__
   301.9 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  301.10 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  301.11 +-# else
  301.12 ++# elif defined __UCLIBC_HAS_LOCALE__
  301.13 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  301.14 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  301.15 + # endif
  301.16 +@@ -556,7 +556,7 @@
  301.17 + # ifdef __UCLIBC_HAS_XLOCALE__
  301.18 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  301.19 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  301.20 +-# else
  301.21 ++# elif defined __UCLIBC_HAS_LOCALE__
  301.22 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  301.23 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  301.24 + # endif
  301.25 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  301.26 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
  301.27 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
  301.28 +@@ -127,12 +127,25 @@
  301.29 + 	{
  301.30 + 	  // Named locale.
  301.31 + 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  301.32 ++#ifdef __UCLIBC_MJN3_ONLY__
  301.33 ++#warning fix this... should be numeric
  301.34 ++#endif
  301.35 ++#ifdef __UCLIBC__
  301.36 ++# ifdef __UCLIBC_HAS_XLOCALE__
  301.37 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  301.38 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  301.39 ++# elif defined __UCLIBC_HAS_LOCALE__
  301.40 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  301.41 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  301.42 ++# endif
  301.43 ++#else
  301.44 + 	  union { char *__s; wchar_t __w; } __u;
  301.45 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  301.46 + 	  _M_data->_M_decimal_point = __u.__w;
  301.47 + 
  301.48 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  301.49 + 	  _M_data->_M_thousands_sep = __u.__w;
  301.50 ++#endif
  301.51 + 
  301.52 + 	  if (_M_data->_M_thousands_sep == L'\0')
  301.53 + 	    _M_data->_M_grouping = "";
   302.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   302.2 +++ b/patches/gcc/4.2.3/150-uclibc-locale-update.patch	Mon Jul 28 21:32:33 2008 +0000
   302.3 @@ -0,0 +1,354 @@
   302.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   302.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   302.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:31:54.000000000 +0200
   302.7 +@@ -46,16 +46,13 @@
   302.8 +     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   302.9 + 		   const __c_locale& __cloc)
  302.10 +     {
  302.11 +-      if (!(__err & ios_base::failbit))
  302.12 +-	{
  302.13 +-	  char* __sanity;
  302.14 +-	  errno = 0;
  302.15 +-	  float __f = __strtof_l(__s, &__sanity, __cloc);
  302.16 +-          if (__sanity != __s && errno != ERANGE)
  302.17 +-	    __v = __f;
  302.18 +-	  else
  302.19 +-	    __err |= ios_base::failbit;
  302.20 +-	}
  302.21 ++      char* __sanity;
  302.22 ++      errno = 0;
  302.23 ++      float __f = __strtof_l(__s, &__sanity, __cloc);
  302.24 ++      if (__sanity != __s && errno != ERANGE)
  302.25 ++	__v = __f;
  302.26 ++      else
  302.27 ++	__err |= ios_base::failbit;
  302.28 +     }
  302.29 + 
  302.30 +   template<>
  302.31 +@@ -63,16 +60,13 @@
  302.32 +     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  302.33 + 		   const __c_locale& __cloc)
  302.34 +     {
  302.35 +-      if (!(__err & ios_base::failbit))
  302.36 +-	{
  302.37 +-	  char* __sanity;
  302.38 +-	  errno = 0;
  302.39 +-	  double __d = __strtod_l(__s, &__sanity, __cloc);
  302.40 +-          if (__sanity != __s && errno != ERANGE)
  302.41 +-	    __v = __d;
  302.42 +-	  else
  302.43 +-	    __err |= ios_base::failbit;
  302.44 +-	}
  302.45 ++      char* __sanity;
  302.46 ++      errno = 0;
  302.47 ++      double __d = __strtod_l(__s, &__sanity, __cloc);
  302.48 ++      if (__sanity != __s && errno != ERANGE)
  302.49 ++	__v = __d;
  302.50 ++      else
  302.51 ++	__err |= ios_base::failbit;
  302.52 +     }
  302.53 + 
  302.54 +   template<>
  302.55 +@@ -80,16 +74,13 @@
  302.56 +     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  302.57 + 		   const __c_locale& __cloc)
  302.58 +     {
  302.59 +-      if (!(__err & ios_base::failbit))
  302.60 +-	{
  302.61 +-	  char* __sanity;
  302.62 +-	  errno = 0;
  302.63 +-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  302.64 +-          if (__sanity != __s && errno != ERANGE)
  302.65 +-	    __v = __ld;
  302.66 +-	  else
  302.67 +-	    __err |= ios_base::failbit;
  302.68 +-	}
  302.69 ++      char* __sanity;
  302.70 ++      errno = 0;
  302.71 ++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  302.72 ++      if (__sanity != __s && errno != ERANGE)
  302.73 ++	__v = __ld;
  302.74 ++      else
  302.75 ++	__err |= ios_base::failbit;
  302.76 +     }
  302.77 + 
  302.78 +   void
  302.79 +@@ -110,7 +101,7 @@
  302.80 +   void
  302.81 +   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  302.82 +   {
  302.83 +-    if (_S_get_c_locale() != __cloc)
  302.84 ++    if (__cloc && _S_get_c_locale() != __cloc)
  302.85 +       __freelocale(__cloc); 
  302.86 +   }
  302.87 + 
  302.88 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  302.89 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  302.90 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:31:54.000000000 +0200
  302.91 +@@ -39,21 +39,23 @@
  302.92 + #pragma GCC system_header
  302.93 + 
  302.94 + #include <cstring>              // get std::strlen
  302.95 +-#include <cstdio>               // get std::snprintf or std::sprintf
  302.96 ++#include <cstdio>               // get std::vsnprintf or std::vsprintf
  302.97 + #include <clocale>
  302.98 + #include <langinfo.h>		// For codecvt
  302.99 + #ifdef __UCLIBC_MJN3_ONLY__
 302.100 + #warning fix this
 302.101 + #endif
 302.102 +-#ifdef __UCLIBC_HAS_LOCALE__
 302.103 ++#ifdef _GLIBCXX_USE_ICONV
 302.104 + #include <iconv.h>		// For codecvt using iconv, iconv_t
 302.105 + #endif
 302.106 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 302.107 +-#include <libintl.h> 		// For messages
 302.108 ++#ifdef HAVE_LIBINTL_H
 302.109 ++#include <libintl.h>		// For messages
 302.110 + #endif
 302.111 ++#include <cstdarg>
 302.112 + 
 302.113 + #ifdef __UCLIBC_MJN3_ONLY__
 302.114 + #warning what is _GLIBCXX_C_LOCALE_GNU for
 302.115 ++// psm: used in os/gnu-linux/ctype_noninline.h
 302.116 + #endif
 302.117 + #define _GLIBCXX_C_LOCALE_GNU 1
 302.118 + 
 302.119 +@@ -62,7 +64,7 @@
 302.120 + #endif
 302.121 + // #define _GLIBCXX_NUM_CATEGORIES 6
 302.122 + #define _GLIBCXX_NUM_CATEGORIES 0
 302.123 +- 
 302.124 ++
 302.125 + #ifdef __UCLIBC_HAS_XLOCALE__
 302.126 + namespace __gnu_cxx
 302.127 + {
 302.128 +@@ -79,22 +81,24 @@
 302.129 +   typedef int*			__c_locale;
 302.130 + #endif
 302.131 + 
 302.132 +-  // Convert numeric value of type _Tv to string and return length of
 302.133 +-  // string.  If snprintf is available use it, otherwise fall back to
 302.134 +-  // the unsafe sprintf which, in general, can be dangerous and should
 302.135 ++  // Convert numeric value of type double to string and return length of
 302.136 ++  // string.  If vsnprintf is available use it, otherwise fall back to
 302.137 ++  // the unsafe vsprintf which, in general, can be dangerous and should
 302.138 +   // be avoided.
 302.139 +-  template<typename _Tv>
 302.140 +-    int
 302.141 +-    __convert_from_v(char* __out, 
 302.142 +-		     const int __size __attribute__ ((__unused__)),
 302.143 +-		     const char* __fmt,
 302.144 +-#ifdef __UCLIBC_HAS_XCLOCALE__
 302.145 +-		     _Tv __v, const __c_locale& __cloc, int __prec)
 302.146 ++    inline int
 302.147 ++    __convert_from_v(const __c_locale&
 302.148 ++#ifndef __UCLIBC_HAS_XCLOCALE__
 302.149 ++					__cloc __attribute__ ((__unused__))
 302.150 ++#endif
 302.151 ++		     ,
 302.152 ++		     char* __out,
 302.153 ++		     const int __size,
 302.154 ++		     const char* __fmt, ...)
 302.155 +     {
 302.156 ++      va_list __args;
 302.157 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 302.158 +       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 302.159 + #else
 302.160 +-		     _Tv __v, const __c_locale&, int __prec)
 302.161 +-    {
 302.162 + # ifdef __UCLIBC_HAS_LOCALE__
 302.163 +       char* __old = std::setlocale(LC_ALL, NULL);
 302.164 +       char* __sav = new char[std::strlen(__old) + 1];
 302.165 +@@ -103,7 +107,9 @@
 302.166 + # endif
 302.167 + #endif
 302.168 + 
 302.169 +-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 302.170 ++      va_start(__args, __fmt);
 302.171 ++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 302.172 ++      va_end(__args);
 302.173 + 
 302.174 + #ifdef __UCLIBC_HAS_XCLOCALE__
 302.175 +       __gnu_cxx::__uselocale(__old);
 302.176 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 302.177 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 302.178 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:31:54.000000000 +0200
 302.179 +@@ -33,9 +33,14 @@
 302.180 + 
 302.181 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 302.182 + 
 302.183 ++#include <features.h>
 302.184 ++#ifdef __UCLIBC_HAS_LOCALE__
 302.185 + #define _LIBC
 302.186 + #include <locale>
 302.187 + #undef _LIBC
 302.188 ++#else
 302.189 ++#include <locale>
 302.190 ++#endif
 302.191 + #include <bits/c++locale_internal.h>
 302.192 + 
 302.193 + namespace std
 302.194 +@@ -138,20 +143,34 @@
 302.195 +   ctype<wchar_t>::
 302.196 +   do_is(mask __m, wchar_t __c) const
 302.197 +   { 
 302.198 +-    // Highest bitmask in ctype_base == 10, but extra in "C"
 302.199 +-    // library for blank.
 302.200 ++    // The case of __m == ctype_base::space is particularly important,
 302.201 ++    // due to its use in many istream functions.  Therefore we deal with
 302.202 ++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 302.203 ++    // is the mask corresponding to ctype_base::space.  NB: an encoding
 302.204 ++    // change would not affect correctness!
 302.205 +     bool __ret = false;
 302.206 +-    const size_t __bitmasksize = 11; 
 302.207 +-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 302.208 +-      if (__m & _M_bit[__bitcur]
 302.209 +-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 302.210 +-	{
 302.211 +-	  __ret = true;
 302.212 +-	  break;
 302.213 +-	}
 302.214 ++    if (__m == _M_bit[5])
 302.215 ++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 302.216 ++    else
 302.217 ++      {
 302.218 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 302.219 ++	// library for blank.
 302.220 ++	const size_t __bitmasksize = 11;
 302.221 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 302.222 ++	  if (__m & _M_bit[__bitcur])
 302.223 ++	    {
 302.224 ++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 302.225 ++		{
 302.226 ++		  __ret = true;
 302.227 ++		  break;
 302.228 ++		}
 302.229 ++	      else if (__m == _M_bit[__bitcur])
 302.230 ++		break;
 302.231 ++	    }
 302.232 ++      }
 302.233 +     return __ret;    
 302.234 +   }
 302.235 +-  
 302.236 ++
 302.237 +   const wchar_t* 
 302.238 +   ctype<wchar_t>::
 302.239 +   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 302.240 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 302.241 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 302.242 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
 302.243 +@@ -47,18 +47,21 @@
 302.244 +   template<typename _CharT>
 302.245 +      messages<_CharT>::messages(size_t __refs)
 302.246 +      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 302.247 +-     _M_name_messages(_S_get_c_name())
 302.248 ++       _M_name_messages(_S_get_c_name())
 302.249 +      { }
 302.250 + 
 302.251 +   template<typename _CharT>
 302.252 +      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 302.253 + 				size_t __refs) 
 302.254 +-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 302.255 +-     _M_name_messages(__s)
 302.256 ++     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 302.257 +      {
 302.258 +-       char* __tmp = new char[std::strlen(__s) + 1];
 302.259 +-       std::strcpy(__tmp, __s);
 302.260 ++       const size_t __len = std::strlen(__s) + 1;
 302.261 ++       char* __tmp = new char[__len];
 302.262 ++       std::memcpy(__tmp, __s, __len);
 302.263 +        _M_name_messages = __tmp;
 302.264 ++
 302.265 ++       // Last to avoid leaking memory if new throws.
 302.266 ++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 302.267 +      }
 302.268 + 
 302.269 +   template<typename _CharT>
 302.270 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 302.271 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
 302.272 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:54.000000000 +0200
 302.273 +@@ -33,9 +33,14 @@
 302.274 + 
 302.275 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 302.276 + 
 302.277 ++#include <features.h>
 302.278 ++#ifdef __UCLIBC_HAS_LOCALE__
 302.279 + #define _LIBC
 302.280 + #include <locale>
 302.281 + #undef _LIBC
 302.282 ++#else
 302.283 ++#include <locale>
 302.284 ++#endif
 302.285 + #include <bits/c++locale_internal.h>
 302.286 + 
 302.287 + #ifdef __UCLIBC_MJN3_ONLY__
 302.288 +@@ -206,7 +211,7 @@
 302.289 + 	  }
 302.290 + 	break;
 302.291 +       default:
 302.292 +-	;
 302.293 ++	__ret = pattern();
 302.294 +       }
 302.295 +     return __ret;
 302.296 +   }
 302.297 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 302.298 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
 302.299 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:54.000000000 +0200
 302.300 +@@ -33,9 +33,14 @@
 302.301 + 
 302.302 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 302.303 + 
 302.304 ++#include <features.h>
 302.305 ++#ifdef __UCLIBC_HAS_LOCALE__
 302.306 + #define _LIBC
 302.307 + #include <locale>
 302.308 + #undef _LIBC
 302.309 ++#else
 302.310 ++#include <locale>
 302.311 ++#endif
 302.312 + #include <bits/c++locale_internal.h>
 302.313 + 
 302.314 + #ifdef __UCLIBC_MJN3_ONLY__
 302.315 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
 302.316 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
 302.317 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
 302.318 +@@ -37,25 +37,33 @@
 302.319 +   template<typename _CharT>
 302.320 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
 302.321 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 302.322 +-    _M_name_timepunct(_S_get_c_name())
 302.323 ++      _M_name_timepunct(_S_get_c_name())
 302.324 +     { _M_initialize_timepunct(); }
 302.325 + 
 302.326 +   template<typename _CharT>
 302.327 +     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 302.328 +     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 302.329 +-    _M_name_timepunct(_S_get_c_name())
 302.330 ++      _M_name_timepunct(_S_get_c_name())
 302.331 +     { _M_initialize_timepunct(); }
 302.332 + 
 302.333 +   template<typename _CharT>
 302.334 +     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 302.335 + 				     size_t __refs) 
 302.336 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 302.337 +-    _M_name_timepunct(__s)
 302.338 ++      _M_name_timepunct(NULL)
 302.339 +     { 
 302.340 +-      char* __tmp = new char[std::strlen(__s) + 1];
 302.341 +-      std::strcpy(__tmp, __s);
 302.342 ++      const size_t __len = std::strlen(__s) + 1;
 302.343 ++      char* __tmp = new char[__len];
 302.344 ++      std::memcpy(__tmp, __s, __len);
 302.345 +       _M_name_timepunct = __tmp;
 302.346 +-      _M_initialize_timepunct(__cloc); 
 302.347 ++
 302.348 ++      try
 302.349 ++	{ _M_initialize_timepunct(__cloc); }
 302.350 ++      catch(...)
 302.351 ++	{
 302.352 ++	  delete [] _M_name_timepunct;
 302.353 ++	  __throw_exception_again;
 302.354 ++	}
 302.355 +     }
 302.356 + 
 302.357 +   template<typename _CharT>
   303.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   303.2 +++ b/patches/gcc/4.2.3/160-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   303.3 @@ -0,0 +1,50 @@
   303.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am gcc-4.2.1/libstdc++-v3/src/Makefile.am
   303.5 +--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am	2006-07-28 06:57:34.000000000 +0200
   303.6 ++++ gcc-4.2.1/libstdc++-v3/src/Makefile.am	2007-08-03 20:32:27.000000000 +0200
   303.7 +@@ -257,6 +257,12 @@
   303.8 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
   303.9 + 
  303.10 + 
  303.11 ++install-exec-local:
  303.12 ++ifeq ($(enable_shared),yes)
  303.13 ++	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  303.14 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  303.15 ++endif
  303.16 ++
  303.17 + # Added bits to build debug library.
  303.18 + if GLIBCXX_BUILD_DEBUG
  303.19 + all-local: build_debug
  303.20 +diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in gcc-4.2.1/libstdc++-v3/src/Makefile.in
  303.21 +--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in	2006-10-16 21:08:22.000000000 +0200
  303.22 ++++ gcc-4.2.1/libstdc++-v3/src/Makefile.in	2007-08-03 20:32:27.000000000 +0200
  303.23 +@@ -657,7 +657,7 @@
  303.24 + 
  303.25 + install-data-am: install-data-local
  303.26 + 
  303.27 +-install-exec-am: install-toolexeclibLTLIBRARIES
  303.28 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  303.29 + 
  303.30 + install-info: install-info-am
  303.31 + 
  303.32 +@@ -690,6 +690,7 @@
  303.33 + 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  303.34 + 	html-am info info-am install install-am install-data \
  303.35 + 	install-data-am install-data-local install-exec \
  303.36 ++	install-exec-local \
  303.37 + 	install-exec-am install-info install-info-am install-man \
  303.38 + 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  303.39 + 	installcheck-am installdirs maintainer-clean \
  303.40 +@@ -799,6 +800,13 @@
  303.41 + install_debug:
  303.42 + 	(cd ${debugdir} && $(MAKE) \
  303.43 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  303.44 ++
  303.45 ++install-exec-local:
  303.46 ++ifeq ($(enable_shared),yes)
  303.47 ++	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  303.48 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  303.49 ++endif
  303.50 ++
  303.51 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  303.52 + # Otherwise a system limit (for SysV at least) may be exceeded.
  303.53 + .NOEXPORT:
   304.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   304.2 +++ b/patches/gcc/4.2.3/170-missing-execinfo_h.patch	Mon Jul 28 21:32:33 2008 +0000
   304.3 @@ -0,0 +1,12 @@
   304.4 +diff -durN gcc-4.2.1.orig/boehm-gc/include/gc.h gcc-4.2.1/boehm-gc/include/gc.h
   304.5 +--- gcc-4.2.1.orig/boehm-gc/include/gc.h	2006-09-18 20:45:08.000000000 +0200
   304.6 ++++ gcc-4.2.1/boehm-gc/include/gc.h	2007-08-03 20:33:00.000000000 +0200
   304.7 +@@ -502,7 +502,7 @@
   304.8 + #if defined(__linux__) || defined(__GLIBC__)
   304.9 + # include <features.h>
  304.10 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  304.11 +-     && !defined(__ia64__)
  304.12 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  304.13 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  304.14 + #     define GC_HAVE_BUILTIN_BACKTRACE
  304.15 + #   endif
   305.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   305.2 +++ b/patches/gcc/4.2.3/180-c99-snprintf.patch	Mon Jul 28 21:32:33 2008 +0000
   305.3 @@ -0,0 +1,12 @@
   305.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h
   305.5 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h	2006-12-07 10:33:51.000000000 +0100
   305.6 ++++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h	2007-08-03 20:33:24.000000000 +0200
   305.7 +@@ -144,7 +144,7 @@
   305.8 + 
   305.9 + _GLIBCXX_END_NAMESPACE
  305.10 + 
  305.11 +-#if _GLIBCXX_USE_C99
  305.12 ++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  305.13 + 
  305.14 + #undef snprintf
  305.15 + #undef vfscanf
   306.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   306.2 +++ b/patches/gcc/4.2.3/190-c99-complex-ugly-hack.patch	Mon Jul 28 21:32:33 2008 +0000
   306.3 @@ -0,0 +1,13 @@
   306.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
   306.5 +--- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
   306.6 ++++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:33:56.000000000 +0200
   306.7 +@@ -7514,6 +7514,9 @@
   306.8 + cat >>conftest.$ac_ext <<_ACEOF
   306.9 + /* end confdefs.h.  */
  306.10 + #include <complex.h>
  306.11 ++#ifdef __UCLIBC__
  306.12 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  306.13 ++#endif
  306.14 + int
  306.15 + main ()
  306.16 + {
   307.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   307.2 +++ b/patches/gcc/4.2.3/200-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
   307.3 @@ -0,0 +1,26 @@
   307.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/rope gcc-4.2.1/libstdc++-v3/include/ext/rope
   307.5 +--- gcc-4.2.1.orig/libstdc++-v3/include/ext/rope	2006-10-17 13:56:21.000000000 +0200
   307.6 ++++ gcc-4.2.1/libstdc++-v3/include/ext/rope	2007-08-03 20:34:23.000000000 +0200
   307.7 +@@ -58,6 +58,9 @@
   307.8 + #include <bits/allocator.h>
   307.9 + #include <ext/hash_fun.h>
  307.10 + 
  307.11 ++/* cope w/ index defined as macro, SuSv3 proposal */
  307.12 ++#undef index
  307.13 ++
  307.14 + # ifdef __GC
  307.15 + #   define __GC_CONST const
  307.16 + # else
  307.17 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h
  307.18 +--- gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2006-10-17 13:56:21.000000000 +0200
  307.19 ++++ gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h	2007-08-03 20:34:23.000000000 +0200
  307.20 +@@ -54,6 +54,9 @@
  307.21 + #include <ext/memory> // For uninitialized_copy_n
  307.22 + #include <ext/numeric> // For power
  307.23 + 
  307.24 ++/* cope w/ index defined as macro, SuSv3 proposal */
  307.25 ++#undef index
  307.26 ++
  307.27 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  307.28 + 
  307.29 +   using std::size_t;
   308.1 --- a/patches/gcc/4.2.3/200-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   308.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   308.3 @@ -1,2806 +0,0 @@
   308.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 gcc-4.2.1/libstdc++-v3/acinclude.m4
   308.5 ---- gcc-4.2.1.orig/libstdc++-v3/acinclude.m4	2007-06-29 01:02:05.000000000 +0200
   308.6 -+++ gcc-4.2.1/libstdc++-v3/acinclude.m4	2007-08-03 20:30:21.000000000 +0200
   308.7 -@@ -1334,7 +1334,7 @@
   308.8 - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   308.9 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  308.10 -     [use MODEL for target locale package],
  308.11 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  308.12 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  308.13 - 
  308.14 -   # Deal with gettext issues.  Default to not using it (=no) until we detect
  308.15 -   # support for it later.  Let the user turn it off via --e/d, but let that
  308.16 -@@ -1355,6 +1355,9 @@
  308.17 -   # Default to "generic".
  308.18 -   if test $enable_clocale_flag = auto; then
  308.19 -     case ${target_os} in
  308.20 -+      *-uclibc*)
  308.21 -+        enable_clocale_flag=uclibc
  308.22 -+        ;;
  308.23 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  308.24 -         enable_clocale_flag=gnu	
  308.25 -         ;;
  308.26 -@@ -1526,6 +1529,40 @@
  308.27 -       CTIME_CC=config/locale/generic/time_members.cc
  308.28 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  308.29 -       ;;
  308.30 -+    uclibc)
  308.31 -+      AC_MSG_RESULT(uclibc)
  308.32 -+
  308.33 -+      # Declare intention to use gettext, and add support for specific
  308.34 -+      # languages.
  308.35 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  308.36 -+      ALL_LINGUAS="de fr"
  308.37 -+
  308.38 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  308.39 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  308.40 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  308.41 -+        USE_NLS=yes
  308.42 -+      fi
  308.43 -+      # Export the build objects.
  308.44 -+      for ling in $ALL_LINGUAS; do \
  308.45 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  308.46 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  308.47 -+      done
  308.48 -+      AC_SUBST(glibcxx_MOFILES)
  308.49 -+      AC_SUBST(glibcxx_POFILES)
  308.50 -+
  308.51 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  308.52 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  308.53 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  308.54 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  308.55 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  308.56 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  308.57 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  308.58 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  308.59 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  308.60 -+      CTIME_H=config/locale/uclibc/time_members.h
  308.61 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  308.62 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  308.63 -+      ;;
  308.64 -   esac
  308.65 - 
  308.66 -   # This is where the testsuite looks for locale catalogs, using the
  308.67 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
  308.68 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  308.69 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
  308.70 -@@ -0,0 +1,160 @@
  308.71 -+// Wrapper for underlying C-language localization -*- C++ -*-
  308.72 -+
  308.73 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  308.74 -+//
  308.75 -+// This file is part of the GNU ISO C++ Library.  This library is free
  308.76 -+// software; you can redistribute it and/or modify it under the
  308.77 -+// terms of the GNU General Public License as published by the
  308.78 -+// Free Software Foundation; either version 2, or (at your option)
  308.79 -+// any later version.
  308.80 -+
  308.81 -+// This library is distributed in the hope that it will be useful,
  308.82 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  308.83 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  308.84 -+// GNU General Public License for more details.
  308.85 -+
  308.86 -+// You should have received a copy of the GNU General Public License along
  308.87 -+// with this library; see the file COPYING.  If not, write to the Free
  308.88 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  308.89 -+// USA.
  308.90 -+
  308.91 -+// As a special exception, you may use this file as part of a free software
  308.92 -+// library without restriction.  Specifically, if other files instantiate
  308.93 -+// templates or use macros or inline functions from this file, or you compile
  308.94 -+// this file and link it with other files to produce an executable, this
  308.95 -+// file does not by itself cause the resulting executable to be covered by
  308.96 -+// the GNU General Public License.  This exception does not however
  308.97 -+// invalidate any other reasons why the executable file might be covered by
  308.98 -+// the GNU General Public License.
  308.99 -+
 308.100 -+//
 308.101 -+// ISO C++ 14882: 22.8  Standard locale categories.
 308.102 -+//
 308.103 -+
 308.104 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 308.105 -+
 308.106 -+#include <cerrno>  // For errno
 308.107 -+#include <locale>
 308.108 -+#include <stdexcept>
 308.109 -+#include <langinfo.h>
 308.110 -+#include <bits/c++locale_internal.h>
 308.111 -+
 308.112 -+#ifndef __UCLIBC_HAS_XLOCALE__
 308.113 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 308.114 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 308.115 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 308.116 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 308.117 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 308.118 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 308.119 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 308.120 -+#warning should dummy __newlocale check for C|POSIX ?
 308.121 -+#define __newlocale(a, b, c)        NULL
 308.122 -+#define __freelocale(a)             ((void)0)
 308.123 -+#define __duplocale(a)              __c_locale()
 308.124 -+#endif
 308.125 -+
 308.126 -+namespace std 
 308.127 -+{
 308.128 -+  template<>
 308.129 -+    void
 308.130 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 308.131 -+		   const __c_locale& __cloc)
 308.132 -+    {
 308.133 -+      if (!(__err & ios_base::failbit))
 308.134 -+	{
 308.135 -+	  char* __sanity;
 308.136 -+	  errno = 0;
 308.137 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
 308.138 -+          if (__sanity != __s && errno != ERANGE)
 308.139 -+	    __v = __f;
 308.140 -+	  else
 308.141 -+	    __err |= ios_base::failbit;
 308.142 -+	}
 308.143 -+    }
 308.144 -+
 308.145 -+  template<>
 308.146 -+    void
 308.147 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 308.148 -+		   const __c_locale& __cloc)
 308.149 -+    {
 308.150 -+      if (!(__err & ios_base::failbit))
 308.151 -+	{
 308.152 -+	  char* __sanity;
 308.153 -+	  errno = 0;
 308.154 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
 308.155 -+          if (__sanity != __s && errno != ERANGE)
 308.156 -+	    __v = __d;
 308.157 -+	  else
 308.158 -+	    __err |= ios_base::failbit;
 308.159 -+	}
 308.160 -+    }
 308.161 -+
 308.162 -+  template<>
 308.163 -+    void
 308.164 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 308.165 -+		   const __c_locale& __cloc)
 308.166 -+    {
 308.167 -+      if (!(__err & ios_base::failbit))
 308.168 -+	{
 308.169 -+	  char* __sanity;
 308.170 -+	  errno = 0;
 308.171 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 308.172 -+          if (__sanity != __s && errno != ERANGE)
 308.173 -+	    __v = __ld;
 308.174 -+	  else
 308.175 -+	    __err |= ios_base::failbit;
 308.176 -+	}
 308.177 -+    }
 308.178 -+
 308.179 -+  void
 308.180 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 308.181 -+				    __c_locale __old)
 308.182 -+  {
 308.183 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 308.184 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.185 -+    if (!__cloc)
 308.186 -+      {
 308.187 -+	// This named locale is not supported by the underlying OS.
 308.188 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 308.189 -+			      "name not valid"));
 308.190 -+      }
 308.191 -+#endif
 308.192 -+  }
 308.193 -+  
 308.194 -+  void
 308.195 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 308.196 -+  {
 308.197 -+    if (_S_get_c_locale() != __cloc)
 308.198 -+      __freelocale(__cloc); 
 308.199 -+  }
 308.200 -+
 308.201 -+  __c_locale
 308.202 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 308.203 -+  { return __duplocale(__cloc); }
 308.204 -+} // namespace std
 308.205 -+
 308.206 -+namespace __gnu_cxx
 308.207 -+{
 308.208 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 308.209 -+    {
 308.210 -+      "LC_CTYPE", 
 308.211 -+      "LC_NUMERIC",
 308.212 -+      "LC_TIME", 
 308.213 -+      "LC_COLLATE", 
 308.214 -+      "LC_MONETARY",
 308.215 -+      "LC_MESSAGES", 
 308.216 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 308.217 -+      "LC_PAPER", 
 308.218 -+      "LC_NAME", 
 308.219 -+      "LC_ADDRESS",
 308.220 -+      "LC_TELEPHONE", 
 308.221 -+      "LC_MEASUREMENT", 
 308.222 -+      "LC_IDENTIFICATION" 
 308.223 -+#endif
 308.224 -+    };
 308.225 -+}
 308.226 -+
 308.227 -+namespace std
 308.228 -+{
 308.229 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 308.230 -+}  // namespace std
 308.231 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
 308.232 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 308.233 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
 308.234 -@@ -0,0 +1,117 @@
 308.235 -+// Wrapper for underlying C-language localization -*- C++ -*-
 308.236 -+
 308.237 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 308.238 -+//
 308.239 -+// This file is part of the GNU ISO C++ Library.  This library is free
 308.240 -+// software; you can redistribute it and/or modify it under the
 308.241 -+// terms of the GNU General Public License as published by the
 308.242 -+// Free Software Foundation; either version 2, or (at your option)
 308.243 -+// any later version.
 308.244 -+
 308.245 -+// This library is distributed in the hope that it will be useful,
 308.246 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 308.247 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 308.248 -+// GNU General Public License for more details.
 308.249 -+
 308.250 -+// You should have received a copy of the GNU General Public License along
 308.251 -+// with this library; see the file COPYING.  If not, write to the Free
 308.252 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 308.253 -+// USA.
 308.254 -+
 308.255 -+// As a special exception, you may use this file as part of a free software
 308.256 -+// library without restriction.  Specifically, if other files instantiate
 308.257 -+// templates or use macros or inline functions from this file, or you compile
 308.258 -+// this file and link it with other files to produce an executable, this
 308.259 -+// file does not by itself cause the resulting executable to be covered by
 308.260 -+// the GNU General Public License.  This exception does not however
 308.261 -+// invalidate any other reasons why the executable file might be covered by
 308.262 -+// the GNU General Public License.
 308.263 -+
 308.264 -+//
 308.265 -+// ISO C++ 14882: 22.8  Standard locale categories.
 308.266 -+//
 308.267 -+
 308.268 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 308.269 -+
 308.270 -+#ifndef _C_LOCALE_H
 308.271 -+#define _C_LOCALE_H 1
 308.272 -+
 308.273 -+#pragma GCC system_header
 308.274 -+
 308.275 -+#include <cstring>              // get std::strlen
 308.276 -+#include <cstdio>               // get std::snprintf or std::sprintf
 308.277 -+#include <clocale>
 308.278 -+#include <langinfo.h>		// For codecvt
 308.279 -+#ifdef __UCLIBC_MJN3_ONLY__
 308.280 -+#warning fix this
 308.281 -+#endif
 308.282 -+#ifdef __UCLIBC_HAS_LOCALE__
 308.283 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 308.284 -+#endif
 308.285 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 308.286 -+#include <libintl.h> 		// For messages
 308.287 -+#endif
 308.288 -+
 308.289 -+#ifdef __UCLIBC_MJN3_ONLY__
 308.290 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 308.291 -+#endif
 308.292 -+#define _GLIBCXX_C_LOCALE_GNU 1
 308.293 -+
 308.294 -+#ifdef __UCLIBC_MJN3_ONLY__
 308.295 -+#warning fix categories
 308.296 -+#endif
 308.297 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 308.298 -+#define _GLIBCXX_NUM_CATEGORIES 0
 308.299 -+ 
 308.300 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.301 -+namespace __gnu_cxx
 308.302 -+{
 308.303 -+  extern "C" __typeof(uselocale) __uselocale;
 308.304 -+}
 308.305 -+#endif
 308.306 -+
 308.307 -+namespace std
 308.308 -+{
 308.309 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.310 -+  typedef __locale_t		__c_locale;
 308.311 -+#else
 308.312 -+  typedef int*			__c_locale;
 308.313 -+#endif
 308.314 -+
 308.315 -+  // Convert numeric value of type _Tv to string and return length of
 308.316 -+  // string.  If snprintf is available use it, otherwise fall back to
 308.317 -+  // the unsafe sprintf which, in general, can be dangerous and should
 308.318 -+  // be avoided.
 308.319 -+  template<typename _Tv>
 308.320 -+    int
 308.321 -+    __convert_from_v(char* __out, 
 308.322 -+		     const int __size __attribute__ ((__unused__)),
 308.323 -+		     const char* __fmt,
 308.324 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 308.325 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 308.326 -+    {
 308.327 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 308.328 -+#else
 308.329 -+		     _Tv __v, const __c_locale&, int __prec)
 308.330 -+    {
 308.331 -+# ifdef __UCLIBC_HAS_LOCALE__
 308.332 -+      char* __old = std::setlocale(LC_ALL, NULL);
 308.333 -+      char* __sav = new char[std::strlen(__old) + 1];
 308.334 -+      std::strcpy(__sav, __old);
 308.335 -+      std::setlocale(LC_ALL, "C");
 308.336 -+# endif
 308.337 -+#endif
 308.338 -+
 308.339 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 308.340 -+
 308.341 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 308.342 -+      __gnu_cxx::__uselocale(__old);
 308.343 -+#elif defined __UCLIBC_HAS_LOCALE__
 308.344 -+      std::setlocale(LC_ALL, __sav);
 308.345 -+      delete [] __sav;
 308.346 -+#endif
 308.347 -+      return __ret;
 308.348 -+    }
 308.349 -+}
 308.350 -+
 308.351 -+#endif
 308.352 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
 308.353 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
 308.354 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
 308.355 -@@ -0,0 +1,63 @@
 308.356 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
 308.357 -+
 308.358 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
 308.359 -+//
 308.360 -+// This file is part of the GNU ISO C++ Library.  This library is free
 308.361 -+// software; you can redistribute it and/or modify it under the
 308.362 -+// terms of the GNU General Public License as published by the
 308.363 -+// Free Software Foundation; either version 2, or (at your option)
 308.364 -+// any later version.
 308.365 -+
 308.366 -+// This library is distributed in the hope that it will be useful,
 308.367 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 308.368 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 308.369 -+// GNU General Public License for more details.
 308.370 -+
 308.371 -+// You should have received a copy of the GNU General Public License along
 308.372 -+// with this library; see the file COPYING.  If not, write to the Free
 308.373 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 308.374 -+// USA.
 308.375 -+
 308.376 -+// As a special exception, you may use this file as part of a free software
 308.377 -+// library without restriction.  Specifically, if other files instantiate
 308.378 -+// templates or use macros or inline functions from this file, or you compile
 308.379 -+// this file and link it with other files to produce an executable, this
 308.380 -+// file does not by itself cause the resulting executable to be covered by
 308.381 -+// the GNU General Public License.  This exception does not however
 308.382 -+// invalidate any other reasons why the executable file might be covered by
 308.383 -+// the GNU General Public License.
 308.384 -+
 308.385 -+// Written by Jakub Jelinek <jakub@redhat.com>
 308.386 -+
 308.387 -+#include <bits/c++config.h>
 308.388 -+#include <clocale>
 308.389 -+
 308.390 -+#ifdef __UCLIBC_MJN3_ONLY__
 308.391 -+#warning clean this up
 308.392 -+#endif
 308.393 -+
 308.394 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.395 -+                                                  
 308.396 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 308.397 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 308.398 -+extern "C" __typeof(strftime_l) __strftime_l;
 308.399 -+extern "C" __typeof(strtod_l) __strtod_l;
 308.400 -+extern "C" __typeof(strtof_l) __strtof_l;
 308.401 -+extern "C" __typeof(strtold_l) __strtold_l;
 308.402 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 308.403 -+extern "C" __typeof(newlocale) __newlocale;
 308.404 -+extern "C" __typeof(freelocale) __freelocale;
 308.405 -+extern "C" __typeof(duplocale) __duplocale;
 308.406 -+extern "C" __typeof(uselocale) __uselocale;
 308.407 -+
 308.408 -+#ifdef _GLIBCXX_USE_WCHAR_T
 308.409 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 308.410 -+extern "C" __typeof(towlower_l) __towlower_l;
 308.411 -+extern "C" __typeof(towupper_l) __towupper_l;
 308.412 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 308.413 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 308.414 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 308.415 -+extern "C" __typeof(wctype_l) __wctype_l;
 308.416 -+#endif 
 308.417 -+
 308.418 -+#endif // GLIBC 2.3 and later
 308.419 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 308.420 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 308.421 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-08-03 20:30:21.000000000 +0200
 308.422 -@@ -0,0 +1,306 @@
 308.423 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 308.424 -+
 308.425 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 308.426 -+//
 308.427 -+// This file is part of the GNU ISO C++ Library.  This library is free
 308.428 -+// software; you can redistribute it and/or modify it under the
 308.429 -+// terms of the GNU General Public License as published by the
 308.430 -+// Free Software Foundation; either version 2, or (at your option)
 308.431 -+// any later version.
 308.432 -+
 308.433 -+// This library is distributed in the hope that it will be useful,
 308.434 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 308.435 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 308.436 -+// GNU General Public License for more details.
 308.437 -+
 308.438 -+// You should have received a copy of the GNU General Public License along
 308.439 -+// with this library; see the file COPYING.  If not, write to the Free
 308.440 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 308.441 -+// USA.
 308.442 -+
 308.443 -+// As a special exception, you may use this file as part of a free software
 308.444 -+// library without restriction.  Specifically, if other files instantiate
 308.445 -+// templates or use macros or inline functions from this file, or you compile
 308.446 -+// this file and link it with other files to produce an executable, this
 308.447 -+// file does not by itself cause the resulting executable to be covered by
 308.448 -+// the GNU General Public License.  This exception does not however
 308.449 -+// invalidate any other reasons why the executable file might be covered by
 308.450 -+// the GNU General Public License.
 308.451 -+
 308.452 -+//
 308.453 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 308.454 -+//
 308.455 -+
 308.456 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 308.457 -+
 308.458 -+#include <locale>
 308.459 -+#include <bits/c++locale_internal.h>
 308.460 -+
 308.461 -+namespace std
 308.462 -+{
 308.463 -+  // Specializations.
 308.464 -+#ifdef _GLIBCXX_USE_WCHAR_T
 308.465 -+  codecvt_base::result
 308.466 -+  codecvt<wchar_t, char, mbstate_t>::
 308.467 -+  do_out(state_type& __state, const intern_type* __from, 
 308.468 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 308.469 -+	 extern_type* __to, extern_type* __to_end,
 308.470 -+	 extern_type*& __to_next) const
 308.471 -+  {
 308.472 -+    result __ret = ok;
 308.473 -+    state_type __tmp_state(__state);
 308.474 -+
 308.475 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.476 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 308.477 -+#endif
 308.478 -+
 308.479 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 308.480 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 308.481 -+    // NB: wcsnrtombs is a GNU extension
 308.482 -+    for (__from_next = __from, __to_next = __to;
 308.483 -+	 __from_next < __from_end && __to_next < __to_end
 308.484 -+	 && __ret == ok;)
 308.485 -+      {
 308.486 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 308.487 -+						      __from_end - __from_next);
 308.488 -+	if (!__from_chunk_end)
 308.489 -+	  __from_chunk_end = __from_end;
 308.490 -+
 308.491 -+	__from = __from_next;
 308.492 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 308.493 -+					 __from_chunk_end - __from_next,
 308.494 -+					 __to_end - __to_next, &__state);
 308.495 -+	if (__conv == static_cast<size_t>(-1))
 308.496 -+	  {
 308.497 -+	    // In case of error, in order to stop at the exact place we
 308.498 -+	    // have to start again from the beginning with a series of
 308.499 -+	    // wcrtomb.
 308.500 -+	    for (; __from < __from_next; ++__from)
 308.501 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 308.502 -+	    __state = __tmp_state;
 308.503 -+	    __ret = error;
 308.504 -+	  }
 308.505 -+	else if (__from_next && __from_next < __from_chunk_end)
 308.506 -+	  {
 308.507 -+	    __to_next += __conv;
 308.508 -+	    __ret = partial;
 308.509 -+	  }
 308.510 -+	else
 308.511 -+	  {
 308.512 -+	    __from_next = __from_chunk_end;
 308.513 -+	    __to_next += __conv;
 308.514 -+	  }
 308.515 -+
 308.516 -+	if (__from_next < __from_end && __ret == ok)
 308.517 -+	  {
 308.518 -+	    extern_type __buf[MB_LEN_MAX];
 308.519 -+	    __tmp_state = __state;
 308.520 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 308.521 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 308.522 -+	      __ret = partial;
 308.523 -+	    else
 308.524 -+	      {
 308.525 -+		memcpy(__to_next, __buf, __conv);
 308.526 -+		__state = __tmp_state;
 308.527 -+		__to_next += __conv;
 308.528 -+		++__from_next;
 308.529 -+	      }
 308.530 -+	  }
 308.531 -+      }
 308.532 -+
 308.533 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.534 -+    __uselocale(__old);
 308.535 -+#endif
 308.536 -+
 308.537 -+    return __ret; 
 308.538 -+  }
 308.539 -+  
 308.540 -+  codecvt_base::result
 308.541 -+  codecvt<wchar_t, char, mbstate_t>::
 308.542 -+  do_in(state_type& __state, const extern_type* __from, 
 308.543 -+	const extern_type* __from_end, const extern_type*& __from_next,
 308.544 -+	intern_type* __to, intern_type* __to_end,
 308.545 -+	intern_type*& __to_next) const
 308.546 -+  {
 308.547 -+    result __ret = ok;
 308.548 -+    state_type __tmp_state(__state);
 308.549 -+
 308.550 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.551 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 308.552 -+#endif
 308.553 -+
 308.554 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 308.555 -+    // in case we store a L'\0' and then continue, in a loop.
 308.556 -+    // NB: mbsnrtowcs is a GNU extension
 308.557 -+    for (__from_next = __from, __to_next = __to;
 308.558 -+	 __from_next < __from_end && __to_next < __to_end
 308.559 -+	 && __ret == ok;)
 308.560 -+      {
 308.561 -+	const extern_type* __from_chunk_end;
 308.562 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 308.563 -+								  __from_end
 308.564 -+								  - __from_next));
 308.565 -+	if (!__from_chunk_end)
 308.566 -+	  __from_chunk_end = __from_end;
 308.567 -+
 308.568 -+	__from = __from_next;
 308.569 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 308.570 -+				   __from_chunk_end - __from_next,
 308.571 -+				   __to_end - __to_next, &__state);
 308.572 -+	if (__conv == static_cast<size_t>(-1))
 308.573 -+	  {
 308.574 -+	    // In case of error, in order to stop at the exact place we
 308.575 -+	    // have to start again from the beginning with a series of
 308.576 -+	    // mbrtowc.
 308.577 -+	    for (;; ++__to_next, __from += __conv)
 308.578 -+	      {
 308.579 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 308.580 -+				 &__tmp_state);
 308.581 -+		if (__conv == static_cast<size_t>(-1)
 308.582 -+		    || __conv == static_cast<size_t>(-2))
 308.583 -+		  break;
 308.584 -+	      }
 308.585 -+	    __from_next = __from;
 308.586 -+	    __state = __tmp_state;	    
 308.587 -+	    __ret = error;
 308.588 -+	  }
 308.589 -+	else if (__from_next && __from_next < __from_chunk_end)
 308.590 -+	  {
 308.591 -+	    // It is unclear what to return in this case (see DR 382). 
 308.592 -+	    __to_next += __conv;
 308.593 -+	    __ret = partial;
 308.594 -+	  }
 308.595 -+	else
 308.596 -+	  {
 308.597 -+	    __from_next = __from_chunk_end;
 308.598 -+	    __to_next += __conv;
 308.599 -+	  }
 308.600 -+
 308.601 -+	if (__from_next < __from_end && __ret == ok)
 308.602 -+	  {
 308.603 -+	    if (__to_next < __to_end)
 308.604 -+	      {
 308.605 -+		// XXX Probably wrong for stateful encodings
 308.606 -+		__tmp_state = __state;		
 308.607 -+		++__from_next;
 308.608 -+		*__to_next++ = L'\0';
 308.609 -+	      }
 308.610 -+	    else
 308.611 -+	      __ret = partial;
 308.612 -+	  }
 308.613 -+      }
 308.614 -+
 308.615 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.616 -+    __uselocale(__old);
 308.617 -+#endif
 308.618 -+
 308.619 -+    return __ret; 
 308.620 -+  }
 308.621 -+
 308.622 -+  int 
 308.623 -+  codecvt<wchar_t, char, mbstate_t>::
 308.624 -+  do_encoding() const throw()
 308.625 -+  {
 308.626 -+    // XXX This implementation assumes that the encoding is
 308.627 -+    // stateless and is either single-byte or variable-width.
 308.628 -+    int __ret = 0;
 308.629 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.630 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 308.631 -+#endif
 308.632 -+    if (MB_CUR_MAX == 1)
 308.633 -+      __ret = 1;
 308.634 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.635 -+    __uselocale(__old);
 308.636 -+#endif
 308.637 -+    return __ret;
 308.638 -+  }  
 308.639 -+
 308.640 -+  int 
 308.641 -+  codecvt<wchar_t, char, mbstate_t>::
 308.642 -+  do_max_length() const throw()
 308.643 -+  {
 308.644 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.645 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 308.646 -+#endif
 308.647 -+    // XXX Probably wrong for stateful encodings.
 308.648 -+    int __ret = MB_CUR_MAX;
 308.649 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.650 -+    __uselocale(__old);
 308.651 -+#endif
 308.652 -+    return __ret;
 308.653 -+  }
 308.654 -+  
 308.655 -+  int 
 308.656 -+  codecvt<wchar_t, char, mbstate_t>::
 308.657 -+  do_length(state_type& __state, const extern_type* __from,
 308.658 -+	    const extern_type* __end, size_t __max) const
 308.659 -+  {
 308.660 -+    int __ret = 0;
 308.661 -+    state_type __tmp_state(__state);
 308.662 -+
 308.663 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.664 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 308.665 -+#endif
 308.666 -+
 308.667 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 308.668 -+    // in case we advance past it and then continue, in a loop.
 308.669 -+    // NB: mbsnrtowcs is a GNU extension
 308.670 -+  
 308.671 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 308.672 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 308.673 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 308.674 -+							   * __max));
 308.675 -+    while (__from < __end && __max)
 308.676 -+      {
 308.677 -+	const extern_type* __from_chunk_end;
 308.678 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 308.679 -+								  __end
 308.680 -+								  - __from));
 308.681 -+	if (!__from_chunk_end)
 308.682 -+	  __from_chunk_end = __end;
 308.683 -+
 308.684 -+	const extern_type* __tmp_from = __from;
 308.685 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 308.686 -+				   __from_chunk_end - __from,
 308.687 -+				   __max, &__state);
 308.688 -+	if (__conv == static_cast<size_t>(-1))
 308.689 -+	  {
 308.690 -+	    // In case of error, in order to stop at the exact place we
 308.691 -+	    // have to start again from the beginning with a series of
 308.692 -+	    // mbrtowc.
 308.693 -+	    for (__from = __tmp_from;; __from += __conv)
 308.694 -+	      {
 308.695 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 308.696 -+				 &__tmp_state);
 308.697 -+		if (__conv == static_cast<size_t>(-1)
 308.698 -+		    || __conv == static_cast<size_t>(-2))
 308.699 -+		  break;
 308.700 -+	      }
 308.701 -+	    __state = __tmp_state;
 308.702 -+	    __ret += __from - __tmp_from;
 308.703 -+	    break;
 308.704 -+	  }
 308.705 -+	if (!__from)
 308.706 -+	  __from = __from_chunk_end;
 308.707 -+	
 308.708 -+	__ret += __from - __tmp_from;
 308.709 -+	__max -= __conv;
 308.710 -+
 308.711 -+	if (__from < __end && __max)
 308.712 -+	  {
 308.713 -+	    // XXX Probably wrong for stateful encodings
 308.714 -+	    __tmp_state = __state;
 308.715 -+	    ++__from;
 308.716 -+	    ++__ret;
 308.717 -+	    --__max;
 308.718 -+	  }
 308.719 -+      }
 308.720 -+
 308.721 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.722 -+    __uselocale(__old);
 308.723 -+#endif
 308.724 -+
 308.725 -+    return __ret; 
 308.726 -+  }
 308.727 -+#endif
 308.728 -+}
 308.729 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
 308.730 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 308.731 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
 308.732 -@@ -0,0 +1,80 @@
 308.733 -+// std::collate implementation details, GNU version -*- C++ -*-
 308.734 -+
 308.735 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 308.736 -+//
 308.737 -+// This file is part of the GNU ISO C++ Library.  This library is free
 308.738 -+// software; you can redistribute it and/or modify it under the
 308.739 -+// terms of the GNU General Public License as published by the
 308.740 -+// Free Software Foundation; either version 2, or (at your option)
 308.741 -+// any later version.
 308.742 -+
 308.743 -+// This library is distributed in the hope that it will be useful,
 308.744 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 308.745 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 308.746 -+// GNU General Public License for more details.
 308.747 -+
 308.748 -+// You should have received a copy of the GNU General Public License along
 308.749 -+// with this library; see the file COPYING.  If not, write to the Free
 308.750 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 308.751 -+// USA.
 308.752 -+
 308.753 -+// As a special exception, you may use this file as part of a free software
 308.754 -+// library without restriction.  Specifically, if other files instantiate
 308.755 -+// templates or use macros or inline functions from this file, or you compile
 308.756 -+// this file and link it with other files to produce an executable, this
 308.757 -+// file does not by itself cause the resulting executable to be covered by
 308.758 -+// the GNU General Public License.  This exception does not however
 308.759 -+// invalidate any other reasons why the executable file might be covered by
 308.760 -+// the GNU General Public License.
 308.761 -+
 308.762 -+//
 308.763 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 308.764 -+//
 308.765 -+
 308.766 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 308.767 -+
 308.768 -+#include <locale>
 308.769 -+#include <bits/c++locale_internal.h>
 308.770 -+
 308.771 -+#ifndef __UCLIBC_HAS_XLOCALE__
 308.772 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 308.773 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 308.774 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 308.775 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 308.776 -+#endif
 308.777 -+
 308.778 -+namespace std
 308.779 -+{
 308.780 -+  // These are basically extensions to char_traits, and perhaps should
 308.781 -+  // be put there instead of here.
 308.782 -+  template<>
 308.783 -+    int 
 308.784 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 308.785 -+    { 
 308.786 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 308.787 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 308.788 -+    }
 308.789 -+  
 308.790 -+  template<>
 308.791 -+    size_t
 308.792 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 308.793 -+				size_t __n) const 
 308.794 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 308.795 -+
 308.796 -+#ifdef _GLIBCXX_USE_WCHAR_T
 308.797 -+  template<>
 308.798 -+    int 
 308.799 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 308.800 -+				 const wchar_t* __two) const
 308.801 -+    {
 308.802 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 308.803 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 308.804 -+    }
 308.805 -+  
 308.806 -+  template<>
 308.807 -+    size_t
 308.808 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 308.809 -+				   size_t __n) const
 308.810 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 308.811 -+#endif
 308.812 -+}
 308.813 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 308.814 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 308.815 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 308.816 -@@ -0,0 +1,300 @@
 308.817 -+// std::ctype implementation details, GNU version -*- C++ -*-
 308.818 -+
 308.819 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 308.820 -+//
 308.821 -+// This file is part of the GNU ISO C++ Library.  This library is free
 308.822 -+// software; you can redistribute it and/or modify it under the
 308.823 -+// terms of the GNU General Public License as published by the
 308.824 -+// Free Software Foundation; either version 2, or (at your option)
 308.825 -+// any later version.
 308.826 -+
 308.827 -+// This library is distributed in the hope that it will be useful,
 308.828 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 308.829 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 308.830 -+// GNU General Public License for more details.
 308.831 -+
 308.832 -+// You should have received a copy of the GNU General Public License along
 308.833 -+// with this library; see the file COPYING.  If not, write to the Free
 308.834 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 308.835 -+// USA.
 308.836 -+
 308.837 -+// As a special exception, you may use this file as part of a free software
 308.838 -+// library without restriction.  Specifically, if other files instantiate
 308.839 -+// templates or use macros or inline functions from this file, or you compile
 308.840 -+// this file and link it with other files to produce an executable, this
 308.841 -+// file does not by itself cause the resulting executable to be covered by
 308.842 -+// the GNU General Public License.  This exception does not however
 308.843 -+// invalidate any other reasons why the executable file might be covered by
 308.844 -+// the GNU General Public License.
 308.845 -+
 308.846 -+//
 308.847 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 308.848 -+//
 308.849 -+
 308.850 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 308.851 -+
 308.852 -+#define _LIBC
 308.853 -+#include <locale>
 308.854 -+#undef _LIBC
 308.855 -+#include <bits/c++locale_internal.h>
 308.856 -+
 308.857 -+#ifndef __UCLIBC_HAS_XLOCALE__
 308.858 -+#define __wctype_l(S, L)           wctype((S))
 308.859 -+#define __towupper_l(C, L)         towupper((C))
 308.860 -+#define __towlower_l(C, L)         towlower((C))
 308.861 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 308.862 -+#endif
 308.863 -+
 308.864 -+namespace std
 308.865 -+{
 308.866 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 308.867 -+  // various /config/os/* files.
 308.868 -+  template<>
 308.869 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 308.870 -+    : ctype<char>(0, false, __refs) 
 308.871 -+    { 		
 308.872 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 308.873 -+	{
 308.874 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 308.875 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 308.876 -+#ifdef __UCLIBC_HAS_XLOCALE__
 308.877 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 308.878 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 308.879 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 308.880 -+#endif
 308.881 -+	}
 308.882 -+    }
 308.883 -+
 308.884 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 308.885 -+  ctype<wchar_t>::__wmask_type
 308.886 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 308.887 -+  {
 308.888 -+    __wmask_type __ret;
 308.889 -+    switch (__m)
 308.890 -+      {
 308.891 -+      case space:
 308.892 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 308.893 -+	break;
 308.894 -+      case print:
 308.895 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 308.896 -+	break;
 308.897 -+      case cntrl:
 308.898 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 308.899 -+	break;
 308.900 -+      case upper:
 308.901 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 308.902 -+	break;
 308.903 -+      case lower:
 308.904 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 308.905 -+	break;
 308.906 -+      case alpha:
 308.907 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 308.908 -+	break;
 308.909 -+      case digit:
 308.910 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 308.911 -+	break;
 308.912 -+      case punct:
 308.913 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 308.914 -+	break;
 308.915 -+      case xdigit:
 308.916 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 308.917 -+	break;
 308.918 -+      case alnum:
 308.919 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 308.920 -+	break;
 308.921 -+      case graph:
 308.922 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 308.923 -+	break;
 308.924 -+      default:
 308.925 -+	__ret = __wmask_type();
 308.926 -+      }
 308.927 -+    return __ret;
 308.928 -+  }
 308.929 -+  
 308.930 -+  wchar_t
 308.931 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 308.932 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 308.933 -+
 308.934 -+  const wchar_t*
 308.935 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 308.936 -+  {
 308.937 -+    while (__lo < __hi)
 308.938 -+      {
 308.939 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 308.940 -+        ++__lo;
 308.941 -+      }
 308.942 -+    return __hi;
 308.943 -+  }
 308.944 -+  
 308.945 -+  wchar_t
 308.946 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 308.947 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 308.948 -+  
 308.949 -+  const wchar_t*
 308.950 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 308.951 -+  {
 308.952 -+    while (__lo < __hi)
 308.953 -+      {
 308.954 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 308.955 -+        ++__lo;
 308.956 -+      }
 308.957 -+    return __hi;
 308.958 -+  }
 308.959 -+
 308.960 -+  bool
 308.961 -+  ctype<wchar_t>::
 308.962 -+  do_is(mask __m, wchar_t __c) const
 308.963 -+  { 
 308.964 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
 308.965 -+    // library for blank.
 308.966 -+    bool __ret = false;
 308.967 -+    const size_t __bitmasksize = 11; 
 308.968 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 308.969 -+      if (__m & _M_bit[__bitcur]
 308.970 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 308.971 -+	{
 308.972 -+	  __ret = true;
 308.973 -+	  break;
 308.974 -+	}
 308.975 -+    return __ret;    
 308.976 -+  }
 308.977 -+  
 308.978 -+  const wchar_t* 
 308.979 -+  ctype<wchar_t>::
 308.980 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 308.981 -+  {
 308.982 -+    for (; __lo < __hi; ++__vec, ++__lo)
 308.983 -+      {
 308.984 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 308.985 -+	// library for blank.
 308.986 -+	const size_t __bitmasksize = 11; 
 308.987 -+	mask __m = 0;
 308.988 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 308.989 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 308.990 -+	    __m |= _M_bit[__bitcur];
 308.991 -+	*__vec = __m;
 308.992 -+      }
 308.993 -+    return __hi;
 308.994 -+  }
 308.995 -+  
 308.996 -+  const wchar_t* 
 308.997 -+  ctype<wchar_t>::
 308.998 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 308.999 -+  {
308.1000 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
308.1001 -+      ++__lo;
308.1002 -+    return __lo;
308.1003 -+  }
308.1004 -+
308.1005 -+  const wchar_t*
308.1006 -+  ctype<wchar_t>::
308.1007 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
308.1008 -+  {
308.1009 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
308.1010 -+      ++__lo;
308.1011 -+    return __lo;
308.1012 -+  }
308.1013 -+
308.1014 -+  wchar_t
308.1015 -+  ctype<wchar_t>::
308.1016 -+  do_widen(char __c) const
308.1017 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
308.1018 -+
308.1019 -+  const char* 
308.1020 -+  ctype<wchar_t>::
308.1021 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
308.1022 -+  {
308.1023 -+    while (__lo < __hi)
308.1024 -+      {
308.1025 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
308.1026 -+	++__lo;
308.1027 -+	++__dest;
308.1028 -+      }
308.1029 -+    return __hi;
308.1030 -+  }
308.1031 -+
308.1032 -+  char
308.1033 -+  ctype<wchar_t>::
308.1034 -+  do_narrow(wchar_t __wc, char __dfault) const
308.1035 -+  {
308.1036 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
308.1037 -+      return _M_narrow[__wc];
308.1038 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1039 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
308.1040 -+#endif
308.1041 -+    const int __c = wctob(__wc);
308.1042 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1043 -+    __uselocale(__old);
308.1044 -+#endif
308.1045 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
308.1046 -+  }
308.1047 -+
308.1048 -+  const wchar_t*
308.1049 -+  ctype<wchar_t>::
308.1050 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
308.1051 -+	    char* __dest) const
308.1052 -+  {
308.1053 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1054 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
308.1055 -+#endif
308.1056 -+    if (_M_narrow_ok)
308.1057 -+      while (__lo < __hi)
308.1058 -+	{
308.1059 -+	  if (*__lo >= 0 && *__lo < 128)
308.1060 -+	    *__dest = _M_narrow[*__lo];
308.1061 -+	  else
308.1062 -+	    {
308.1063 -+	      const int __c = wctob(*__lo);
308.1064 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
308.1065 -+	    }
308.1066 -+	  ++__lo;
308.1067 -+	  ++__dest;
308.1068 -+	}
308.1069 -+    else
308.1070 -+      while (__lo < __hi)
308.1071 -+	{
308.1072 -+	  const int __c = wctob(*__lo);
308.1073 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
308.1074 -+	  ++__lo;
308.1075 -+	  ++__dest;
308.1076 -+	}
308.1077 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1078 -+    __uselocale(__old);
308.1079 -+#endif
308.1080 -+    return __hi;
308.1081 -+  }
308.1082 -+
308.1083 -+  void
308.1084 -+  ctype<wchar_t>::_M_initialize_ctype()
308.1085 -+  {
308.1086 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1087 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
308.1088 -+#endif
308.1089 -+    wint_t __i;
308.1090 -+    for (__i = 0; __i < 128; ++__i)
308.1091 -+      {
308.1092 -+	const int __c = wctob(__i);
308.1093 -+	if (__c == EOF)
308.1094 -+	  break;
308.1095 -+	else
308.1096 -+	  _M_narrow[__i] = static_cast<char>(__c);
308.1097 -+      }
308.1098 -+    if (__i == 128)
308.1099 -+      _M_narrow_ok = true;
308.1100 -+    else
308.1101 -+      _M_narrow_ok = false;
308.1102 -+    for (size_t __j = 0;
308.1103 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
308.1104 -+      _M_widen[__j] = btowc(__j);
308.1105 -+
308.1106 -+    for (size_t __k = 0; __k <= 11; ++__k)
308.1107 -+      { 
308.1108 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
308.1109 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
308.1110 -+      }
308.1111 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1112 -+    __uselocale(__old);
308.1113 -+#endif
308.1114 -+  }
308.1115 -+#endif //  _GLIBCXX_USE_WCHAR_T
308.1116 -+}
308.1117 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
308.1118 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
308.1119 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
308.1120 -@@ -0,0 +1,100 @@
308.1121 -+// std::messages implementation details, GNU version -*- C++ -*-
308.1122 -+
308.1123 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
308.1124 -+//
308.1125 -+// This file is part of the GNU ISO C++ Library.  This library is free
308.1126 -+// software; you can redistribute it and/or modify it under the
308.1127 -+// terms of the GNU General Public License as published by the
308.1128 -+// Free Software Foundation; either version 2, or (at your option)
308.1129 -+// any later version.
308.1130 -+
308.1131 -+// This library is distributed in the hope that it will be useful,
308.1132 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
308.1133 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
308.1134 -+// GNU General Public License for more details.
308.1135 -+
308.1136 -+// You should have received a copy of the GNU General Public License along
308.1137 -+// with this library; see the file COPYING.  If not, write to the Free
308.1138 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
308.1139 -+// USA.
308.1140 -+
308.1141 -+// As a special exception, you may use this file as part of a free software
308.1142 -+// library without restriction.  Specifically, if other files instantiate
308.1143 -+// templates or use macros or inline functions from this file, or you compile
308.1144 -+// this file and link it with other files to produce an executable, this
308.1145 -+// file does not by itself cause the resulting executable to be covered by
308.1146 -+// the GNU General Public License.  This exception does not however
308.1147 -+// invalidate any other reasons why the executable file might be covered by
308.1148 -+// the GNU General Public License.
308.1149 -+
308.1150 -+//
308.1151 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
308.1152 -+//
308.1153 -+
308.1154 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
308.1155 -+
308.1156 -+#include <locale>
308.1157 -+#include <bits/c++locale_internal.h>
308.1158 -+
308.1159 -+#ifdef __UCLIBC_MJN3_ONLY__
308.1160 -+#warning fix gettext stuff
308.1161 -+#endif
308.1162 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
308.1163 -+extern "C" char *__dcgettext(const char *domainname,
308.1164 -+			     const char *msgid, int category);
308.1165 -+#undef gettext
308.1166 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
308.1167 -+#else
308.1168 -+#undef gettext
308.1169 -+#define gettext(msgid) (msgid)
308.1170 -+#endif
308.1171 -+
308.1172 -+namespace std
308.1173 -+{
308.1174 -+  // Specializations.
308.1175 -+  template<>
308.1176 -+    string
308.1177 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
308.1178 -+    {
308.1179 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1180 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
308.1181 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
308.1182 -+      __uselocale(__old);
308.1183 -+      return string(__msg);
308.1184 -+#elif defined __UCLIBC_HAS_LOCALE__
308.1185 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
308.1186 -+      setlocale(LC_ALL, _M_name_messages);
308.1187 -+      const char* __msg = gettext(__dfault.c_str());
308.1188 -+      setlocale(LC_ALL, __old);
308.1189 -+      free(__old);
308.1190 -+      return string(__msg);
308.1191 -+#else
308.1192 -+      const char* __msg = gettext(__dfault.c_str());
308.1193 -+      return string(__msg);
308.1194 -+#endif
308.1195 -+    }
308.1196 -+
308.1197 -+#ifdef _GLIBCXX_USE_WCHAR_T
308.1198 -+  template<>
308.1199 -+    wstring
308.1200 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
308.1201 -+    {
308.1202 -+# ifdef __UCLIBC_HAS_XLOCALE__
308.1203 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
308.1204 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
308.1205 -+      __uselocale(__old);
308.1206 -+      return _M_convert_from_char(__msg);
308.1207 -+# elif defined __UCLIBC_HAS_LOCALE__
308.1208 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
308.1209 -+      setlocale(LC_ALL, _M_name_messages);
308.1210 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
308.1211 -+      setlocale(LC_ALL, __old);
308.1212 -+      free(__old);
308.1213 -+      return _M_convert_from_char(__msg);
308.1214 -+# else
308.1215 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
308.1216 -+      return _M_convert_from_char(__msg);
308.1217 -+# endif
308.1218 -+    }
308.1219 -+#endif
308.1220 -+}
308.1221 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
308.1222 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
308.1223 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
308.1224 -@@ -0,0 +1,118 @@
308.1225 -+// std::messages implementation details, GNU version -*- C++ -*-
308.1226 -+
308.1227 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
308.1228 -+//
308.1229 -+// This file is part of the GNU ISO C++ Library.  This library is free
308.1230 -+// software; you can redistribute it and/or modify it under the
308.1231 -+// terms of the GNU General Public License as published by the
308.1232 -+// Free Software Foundation; either version 2, or (at your option)
308.1233 -+// any later version.
308.1234 -+
308.1235 -+// This library is distributed in the hope that it will be useful,
308.1236 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
308.1237 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
308.1238 -+// GNU General Public License for more details.
308.1239 -+
308.1240 -+// You should have received a copy of the GNU General Public License along
308.1241 -+// with this library; see the file COPYING.  If not, write to the Free
308.1242 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
308.1243 -+// USA.
308.1244 -+
308.1245 -+// As a special exception, you may use this file as part of a free software
308.1246 -+// library without restriction.  Specifically, if other files instantiate
308.1247 -+// templates or use macros or inline functions from this file, or you compile
308.1248 -+// this file and link it with other files to produce an executable, this
308.1249 -+// file does not by itself cause the resulting executable to be covered by
308.1250 -+// the GNU General Public License.  This exception does not however
308.1251 -+// invalidate any other reasons why the executable file might be covered by
308.1252 -+// the GNU General Public License.
308.1253 -+
308.1254 -+//
308.1255 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
308.1256 -+//
308.1257 -+
308.1258 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
308.1259 -+
308.1260 -+#ifdef __UCLIBC_MJN3_ONLY__
308.1261 -+#warning fix prototypes for *textdomain funcs
308.1262 -+#endif
308.1263 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
308.1264 -+extern "C" char *__textdomain(const char *domainname);
308.1265 -+extern "C" char *__bindtextdomain(const char *domainname,
308.1266 -+				  const char *dirname);
308.1267 -+#else
308.1268 -+#undef __textdomain
308.1269 -+#undef __bindtextdomain
308.1270 -+#define __textdomain(D)           ((void)0)
308.1271 -+#define __bindtextdomain(D,P)     ((void)0)
308.1272 -+#endif
308.1273 -+
308.1274 -+  // Non-virtual member functions.
308.1275 -+  template<typename _CharT>
308.1276 -+     messages<_CharT>::messages(size_t __refs)
308.1277 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
308.1278 -+     _M_name_messages(_S_get_c_name())
308.1279 -+     { }
308.1280 -+
308.1281 -+  template<typename _CharT>
308.1282 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
308.1283 -+				size_t __refs) 
308.1284 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
308.1285 -+     _M_name_messages(__s)
308.1286 -+     {
308.1287 -+       char* __tmp = new char[std::strlen(__s) + 1];
308.1288 -+       std::strcpy(__tmp, __s);
308.1289 -+       _M_name_messages = __tmp;
308.1290 -+     }
308.1291 -+
308.1292 -+  template<typename _CharT>
308.1293 -+    typename messages<_CharT>::catalog 
308.1294 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
308.1295 -+			   const char* __dir) const
308.1296 -+    { 
308.1297 -+      __bindtextdomain(__s.c_str(), __dir);
308.1298 -+      return this->do_open(__s, __loc); 
308.1299 -+    }
308.1300 -+
308.1301 -+  // Virtual member functions.
308.1302 -+  template<typename _CharT>
308.1303 -+    messages<_CharT>::~messages()
308.1304 -+    { 
308.1305 -+      if (_M_name_messages != _S_get_c_name())
308.1306 -+	delete [] _M_name_messages;
308.1307 -+      _S_destroy_c_locale(_M_c_locale_messages); 
308.1308 -+    }
308.1309 -+
308.1310 -+  template<typename _CharT>
308.1311 -+    typename messages<_CharT>::catalog 
308.1312 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
308.1313 -+			      const locale&) const
308.1314 -+    { 
308.1315 -+      // No error checking is done, assume the catalog exists and can
308.1316 -+      // be used.
308.1317 -+      __textdomain(__s.c_str());
308.1318 -+      return 0;
308.1319 -+    }
308.1320 -+
308.1321 -+  template<typename _CharT>
308.1322 -+    void    
308.1323 -+    messages<_CharT>::do_close(catalog) const 
308.1324 -+    { }
308.1325 -+
308.1326 -+   // messages_byname
308.1327 -+   template<typename _CharT>
308.1328 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
308.1329 -+     : messages<_CharT>(__refs) 
308.1330 -+     { 
308.1331 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
308.1332 -+	 delete [] this->_M_name_messages;
308.1333 -+       char* __tmp = new char[std::strlen(__s) + 1];
308.1334 -+       std::strcpy(__tmp, __s);
308.1335 -+       this->_M_name_messages = __tmp;
308.1336 -+
308.1337 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
308.1338 -+	 {
308.1339 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
308.1340 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
308.1341 -+	 }
308.1342 -+     }
308.1343 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
308.1344 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
308.1345 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
308.1346 -@@ -0,0 +1,692 @@
308.1347 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
308.1348 -+
308.1349 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
308.1350 -+//
308.1351 -+// This file is part of the GNU ISO C++ Library.  This library is free
308.1352 -+// software; you can redistribute it and/or modify it under the
308.1353 -+// terms of the GNU General Public License as published by the
308.1354 -+// Free Software Foundation; either version 2, or (at your option)
308.1355 -+// any later version.
308.1356 -+
308.1357 -+// This library is distributed in the hope that it will be useful,
308.1358 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
308.1359 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
308.1360 -+// GNU General Public License for more details.
308.1361 -+
308.1362 -+// You should have received a copy of the GNU General Public License along
308.1363 -+// with this library; see the file COPYING.  If not, write to the Free
308.1364 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
308.1365 -+// USA.
308.1366 -+
308.1367 -+// As a special exception, you may use this file as part of a free software
308.1368 -+// library without restriction.  Specifically, if other files instantiate
308.1369 -+// templates or use macros or inline functions from this file, or you compile
308.1370 -+// this file and link it with other files to produce an executable, this
308.1371 -+// file does not by itself cause the resulting executable to be covered by
308.1372 -+// the GNU General Public License.  This exception does not however
308.1373 -+// invalidate any other reasons why the executable file might be covered by
308.1374 -+// the GNU General Public License.
308.1375 -+
308.1376 -+//
308.1377 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
308.1378 -+//
308.1379 -+
308.1380 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
308.1381 -+
308.1382 -+#define _LIBC
308.1383 -+#include <locale>
308.1384 -+#undef _LIBC
308.1385 -+#include <bits/c++locale_internal.h>
308.1386 -+
308.1387 -+#ifdef __UCLIBC_MJN3_ONLY__
308.1388 -+#warning optimize this for uclibc
308.1389 -+#warning tailor for stub locale support
308.1390 -+#endif
308.1391 -+
308.1392 -+#ifndef __UCLIBC_HAS_XLOCALE__
308.1393 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
308.1394 -+#endif
308.1395 -+
308.1396 -+namespace std
308.1397 -+{
308.1398 -+  // Construct and return valid pattern consisting of some combination of:
308.1399 -+  // space none symbol sign value
308.1400 -+  money_base::pattern
308.1401 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
308.1402 -+  { 
308.1403 -+    pattern __ret;
308.1404 -+
308.1405 -+    // This insanely complicated routine attempts to construct a valid
308.1406 -+    // pattern for use with monyepunct. A couple of invariants:
308.1407 -+
308.1408 -+    // if (__precedes) symbol -> value
308.1409 -+    // else value -> symbol
308.1410 -+    
308.1411 -+    // if (__space) space
308.1412 -+    // else none
308.1413 -+
308.1414 -+    // none == never first
308.1415 -+    // space never first or last
308.1416 -+
308.1417 -+    // Any elegant implementations of this are welcome.
308.1418 -+    switch (__posn)
308.1419 -+      {
308.1420 -+      case 0:
308.1421 -+      case 1:
308.1422 -+	// 1 The sign precedes the value and symbol.
308.1423 -+	__ret.field[0] = sign;
308.1424 -+	if (__space)
308.1425 -+	  {
308.1426 -+	    // Pattern starts with sign.
308.1427 -+	    if (__precedes)
308.1428 -+	      {
308.1429 -+		__ret.field[1] = symbol;
308.1430 -+		__ret.field[3] = value;
308.1431 -+	      }
308.1432 -+	    else
308.1433 -+	      {
308.1434 -+		__ret.field[1] = value;
308.1435 -+		__ret.field[3] = symbol;
308.1436 -+	      }
308.1437 -+	    __ret.field[2] = space;
308.1438 -+	  }
308.1439 -+	else
308.1440 -+	  {
308.1441 -+	    // Pattern starts with sign and ends with none.
308.1442 -+	    if (__precedes)
308.1443 -+	      {
308.1444 -+		__ret.field[1] = symbol;
308.1445 -+		__ret.field[2] = value;
308.1446 -+	      }
308.1447 -+	    else
308.1448 -+	      {
308.1449 -+		__ret.field[1] = value;
308.1450 -+		__ret.field[2] = symbol;
308.1451 -+	      }
308.1452 -+	    __ret.field[3] = none;
308.1453 -+	  }
308.1454 -+	break;
308.1455 -+      case 2:
308.1456 -+	// 2 The sign follows the value and symbol.
308.1457 -+	if (__space)
308.1458 -+	  {
308.1459 -+	    // Pattern either ends with sign.
308.1460 -+	    if (__precedes)
308.1461 -+	      {
308.1462 -+		__ret.field[0] = symbol;
308.1463 -+		__ret.field[2] = value;
308.1464 -+	      }
308.1465 -+	    else
308.1466 -+	      {
308.1467 -+		__ret.field[0] = value;
308.1468 -+		__ret.field[2] = symbol;
308.1469 -+	      }
308.1470 -+	    __ret.field[1] = space;
308.1471 -+	    __ret.field[3] = sign;
308.1472 -+	  }
308.1473 -+	else
308.1474 -+	  {
308.1475 -+	    // Pattern ends with sign then none.
308.1476 -+	    if (__precedes)
308.1477 -+	      {
308.1478 -+		__ret.field[0] = symbol;
308.1479 -+		__ret.field[1] = value;
308.1480 -+	      }
308.1481 -+	    else
308.1482 -+	      {
308.1483 -+		__ret.field[0] = value;
308.1484 -+		__ret.field[1] = symbol;
308.1485 -+	      }
308.1486 -+	    __ret.field[2] = sign;
308.1487 -+	    __ret.field[3] = none;
308.1488 -+	  }
308.1489 -+	break;
308.1490 -+      case 3:
308.1491 -+	// 3 The sign immediately precedes the symbol.
308.1492 -+	if (__precedes)
308.1493 -+	  {
308.1494 -+	    __ret.field[0] = sign;
308.1495 -+	    __ret.field[1] = symbol;	    
308.1496 -+	    if (__space)
308.1497 -+	      {
308.1498 -+		__ret.field[2] = space;
308.1499 -+		__ret.field[3] = value;
308.1500 -+	      }
308.1501 -+	    else
308.1502 -+	      {
308.1503 -+		__ret.field[2] = value;		
308.1504 -+		__ret.field[3] = none;
308.1505 -+	      }
308.1506 -+	  }
308.1507 -+	else
308.1508 -+	  {
308.1509 -+	    __ret.field[0] = value;
308.1510 -+	    if (__space)
308.1511 -+	      {
308.1512 -+		__ret.field[1] = space;
308.1513 -+		__ret.field[2] = sign;
308.1514 -+		__ret.field[3] = symbol;
308.1515 -+	      }
308.1516 -+	    else
308.1517 -+	      {
308.1518 -+		__ret.field[1] = sign;
308.1519 -+		__ret.field[2] = symbol;
308.1520 -+		__ret.field[3] = none;
308.1521 -+	      }
308.1522 -+	  }
308.1523 -+	break;
308.1524 -+      case 4:
308.1525 -+	// 4 The sign immediately follows the symbol.
308.1526 -+	if (__precedes)
308.1527 -+	  {
308.1528 -+	    __ret.field[0] = symbol;
308.1529 -+	    __ret.field[1] = sign;
308.1530 -+	    if (__space)
308.1531 -+	      {
308.1532 -+		__ret.field[2] = space;
308.1533 -+		__ret.field[3] = value;
308.1534 -+	      }
308.1535 -+	    else
308.1536 -+	      {
308.1537 -+		__ret.field[2] = value;
308.1538 -+		__ret.field[3] = none;
308.1539 -+	      }
308.1540 -+	  }
308.1541 -+	else
308.1542 -+	  {
308.1543 -+	    __ret.field[0] = value;
308.1544 -+	    if (__space)
308.1545 -+	      {
308.1546 -+		__ret.field[1] = space;
308.1547 -+		__ret.field[2] = symbol;
308.1548 -+		__ret.field[3] = sign;
308.1549 -+	      }
308.1550 -+	    else
308.1551 -+	      {
308.1552 -+		__ret.field[1] = symbol;
308.1553 -+		__ret.field[2] = sign;
308.1554 -+		__ret.field[3] = none;
308.1555 -+	      }
308.1556 -+	  }
308.1557 -+	break;
308.1558 -+      default:
308.1559 -+	;
308.1560 -+      }
308.1561 -+    return __ret;
308.1562 -+  }
308.1563 -+
308.1564 -+  template<> 
308.1565 -+    void
308.1566 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
308.1567 -+						     const char*)
308.1568 -+    {
308.1569 -+      if (!_M_data)
308.1570 -+	_M_data = new __moneypunct_cache<char, true>;
308.1571 -+
308.1572 -+      if (!__cloc)
308.1573 -+	{
308.1574 -+	  // "C" locale
308.1575 -+	  _M_data->_M_decimal_point = '.';
308.1576 -+	  _M_data->_M_thousands_sep = ',';
308.1577 -+	  _M_data->_M_grouping = "";
308.1578 -+	  _M_data->_M_grouping_size = 0;
308.1579 -+	  _M_data->_M_curr_symbol = "";
308.1580 -+	  _M_data->_M_curr_symbol_size = 0;
308.1581 -+	  _M_data->_M_positive_sign = "";
308.1582 -+	  _M_data->_M_positive_sign_size = 0;
308.1583 -+	  _M_data->_M_negative_sign = "";
308.1584 -+	  _M_data->_M_negative_sign_size = 0;
308.1585 -+	  _M_data->_M_frac_digits = 0;
308.1586 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
308.1587 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
308.1588 -+
308.1589 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
308.1590 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
308.1591 -+	}
308.1592 -+      else
308.1593 -+	{
308.1594 -+	  // Named locale.
308.1595 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
308.1596 -+							__cloc));
308.1597 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
308.1598 -+							__cloc));
308.1599 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
308.1600 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
308.1601 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
308.1602 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
308.1603 -+
308.1604 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
308.1605 -+	  if (!__nposn)
308.1606 -+	    _M_data->_M_negative_sign = "()";
308.1607 -+	  else
308.1608 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
308.1609 -+							__cloc);
308.1610 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
308.1611 -+
308.1612 -+	  // _Intl == true
308.1613 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
308.1614 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
308.1615 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
308.1616 -+						      __cloc));
308.1617 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
308.1618 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
308.1619 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
308.1620 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
308.1621 -+							__pposn);
308.1622 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
308.1623 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
308.1624 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
308.1625 -+							__nposn);
308.1626 -+	}
308.1627 -+    }
308.1628 -+
308.1629 -+  template<> 
308.1630 -+    void
308.1631 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
308.1632 -+						      const char*)
308.1633 -+    {
308.1634 -+      if (!_M_data)
308.1635 -+	_M_data = new __moneypunct_cache<char, false>;
308.1636 -+
308.1637 -+      if (!__cloc)
308.1638 -+	{
308.1639 -+	  // "C" locale
308.1640 -+	  _M_data->_M_decimal_point = '.';
308.1641 -+	  _M_data->_M_thousands_sep = ',';
308.1642 -+	  _M_data->_M_grouping = "";
308.1643 -+	  _M_data->_M_grouping_size = 0;
308.1644 -+	  _M_data->_M_curr_symbol = "";
308.1645 -+	  _M_data->_M_curr_symbol_size = 0;
308.1646 -+	  _M_data->_M_positive_sign = "";
308.1647 -+	  _M_data->_M_positive_sign_size = 0;
308.1648 -+	  _M_data->_M_negative_sign = "";
308.1649 -+	  _M_data->_M_negative_sign_size = 0;
308.1650 -+	  _M_data->_M_frac_digits = 0;
308.1651 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
308.1652 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
308.1653 -+
308.1654 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
308.1655 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
308.1656 -+	}
308.1657 -+      else
308.1658 -+	{
308.1659 -+	  // Named locale.
308.1660 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
308.1661 -+							__cloc));
308.1662 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
308.1663 -+							__cloc));
308.1664 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
308.1665 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
308.1666 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
308.1667 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
308.1668 -+
308.1669 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
308.1670 -+	  if (!__nposn)
308.1671 -+	    _M_data->_M_negative_sign = "()";
308.1672 -+	  else
308.1673 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
308.1674 -+							__cloc);
308.1675 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
308.1676 -+
308.1677 -+	  // _Intl == false
308.1678 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
308.1679 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
308.1680 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
308.1681 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
308.1682 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
308.1683 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
308.1684 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
308.1685 -+							__pposn);
308.1686 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
308.1687 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
308.1688 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
308.1689 -+							__nposn);
308.1690 -+	}
308.1691 -+    }
308.1692 -+
308.1693 -+  template<> 
308.1694 -+    moneypunct<char, true>::~moneypunct()
308.1695 -+    { delete _M_data; }
308.1696 -+
308.1697 -+  template<> 
308.1698 -+    moneypunct<char, false>::~moneypunct()
308.1699 -+    { delete _M_data; }
308.1700 -+
308.1701 -+#ifdef _GLIBCXX_USE_WCHAR_T
308.1702 -+  template<> 
308.1703 -+    void
308.1704 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
308.1705 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1706 -+							const char*)
308.1707 -+#else
308.1708 -+							const char* __name)
308.1709 -+#endif
308.1710 -+    {
308.1711 -+      if (!_M_data)
308.1712 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
308.1713 -+
308.1714 -+      if (!__cloc)
308.1715 -+	{
308.1716 -+	  // "C" locale
308.1717 -+	  _M_data->_M_decimal_point = L'.';
308.1718 -+	  _M_data->_M_thousands_sep = L',';
308.1719 -+	  _M_data->_M_grouping = "";
308.1720 -+	  _M_data->_M_grouping_size = 0;
308.1721 -+	  _M_data->_M_curr_symbol = L"";
308.1722 -+	  _M_data->_M_curr_symbol_size = 0;
308.1723 -+	  _M_data->_M_positive_sign = L"";
308.1724 -+	  _M_data->_M_positive_sign_size = 0;
308.1725 -+	  _M_data->_M_negative_sign = L"";
308.1726 -+	  _M_data->_M_negative_sign_size = 0;
308.1727 -+	  _M_data->_M_frac_digits = 0;
308.1728 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
308.1729 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
308.1730 -+
308.1731 -+	  // Use ctype::widen code without the facet...
308.1732 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
308.1733 -+	    _M_data->_M_atoms[__i] =
308.1734 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
308.1735 -+	}
308.1736 -+      else
308.1737 -+	{
308.1738 -+	  // Named locale.
308.1739 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1740 -+	  __c_locale __old = __uselocale(__cloc);
308.1741 -+#else
308.1742 -+	  // Switch to named locale so that mbsrtowcs will work.
308.1743 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
308.1744 -+	  setlocale(LC_ALL, __name);
308.1745 -+#endif
308.1746 -+
308.1747 -+#ifdef __UCLIBC_MJN3_ONLY__
308.1748 -+#warning fix this... should be monetary
308.1749 -+#endif
308.1750 -+#ifdef __UCLIBC__
308.1751 -+# ifdef __UCLIBC_HAS_XLOCALE__
308.1752 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
308.1753 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
308.1754 -+# else
308.1755 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
308.1756 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
308.1757 -+# endif
308.1758 -+#else
308.1759 -+	  union { char *__s; wchar_t __w; } __u;
308.1760 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
308.1761 -+	  _M_data->_M_decimal_point = __u.__w;
308.1762 -+
308.1763 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
308.1764 -+	  _M_data->_M_thousands_sep = __u.__w;
308.1765 -+#endif
308.1766 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
308.1767 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
308.1768 -+
308.1769 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
308.1770 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
308.1771 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
308.1772 -+
308.1773 -+	  wchar_t* __wcs_ps = 0;
308.1774 -+	  wchar_t* __wcs_ns = 0;
308.1775 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
308.1776 -+	  try
308.1777 -+	    {
308.1778 -+	      mbstate_t __state;
308.1779 -+	      size_t __len = strlen(__cpossign);
308.1780 -+	      if (__len)
308.1781 -+		{
308.1782 -+		  ++__len;
308.1783 -+		  memset(&__state, 0, sizeof(mbstate_t));
308.1784 -+		  __wcs_ps = new wchar_t[__len];
308.1785 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
308.1786 -+		  _M_data->_M_positive_sign = __wcs_ps;
308.1787 -+		}
308.1788 -+	      else
308.1789 -+		_M_data->_M_positive_sign = L"";
308.1790 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
308.1791 -+	      
308.1792 -+	      __len = strlen(__cnegsign);
308.1793 -+	      if (!__nposn)
308.1794 -+		_M_data->_M_negative_sign = L"()";
308.1795 -+	      else if (__len)
308.1796 -+		{ 
308.1797 -+		  ++__len;
308.1798 -+		  memset(&__state, 0, sizeof(mbstate_t));
308.1799 -+		  __wcs_ns = new wchar_t[__len];
308.1800 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
308.1801 -+		  _M_data->_M_negative_sign = __wcs_ns;
308.1802 -+		}
308.1803 -+	      else
308.1804 -+		_M_data->_M_negative_sign = L"";
308.1805 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
308.1806 -+	      
308.1807 -+	      // _Intl == true.
308.1808 -+	      __len = strlen(__ccurr);
308.1809 -+	      if (__len)
308.1810 -+		{
308.1811 -+		  ++__len;
308.1812 -+		  memset(&__state, 0, sizeof(mbstate_t));
308.1813 -+		  wchar_t* __wcs = new wchar_t[__len];
308.1814 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
308.1815 -+		  _M_data->_M_curr_symbol = __wcs;
308.1816 -+		}
308.1817 -+	      else
308.1818 -+		_M_data->_M_curr_symbol = L"";
308.1819 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
308.1820 -+	    }
308.1821 -+	  catch (...)
308.1822 -+	    {
308.1823 -+	      delete _M_data;
308.1824 -+	      _M_data = 0;
308.1825 -+	      delete __wcs_ps;
308.1826 -+	      delete __wcs_ns;	      
308.1827 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1828 -+	      __uselocale(__old);
308.1829 -+#else
308.1830 -+	      setlocale(LC_ALL, __old);
308.1831 -+	      free(__old);
308.1832 -+#endif
308.1833 -+	      __throw_exception_again;
308.1834 -+	    } 
308.1835 -+	  
308.1836 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
308.1837 -+						      __cloc));
308.1838 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
308.1839 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
308.1840 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
308.1841 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
308.1842 -+							__pposn);
308.1843 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
308.1844 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
308.1845 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
308.1846 -+							__nposn);
308.1847 -+
308.1848 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1849 -+	  __uselocale(__old);
308.1850 -+#else
308.1851 -+	  setlocale(LC_ALL, __old);
308.1852 -+	  free(__old);
308.1853 -+#endif
308.1854 -+	}
308.1855 -+    }
308.1856 -+
308.1857 -+  template<> 
308.1858 -+  void
308.1859 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
308.1860 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1861 -+						       const char*)
308.1862 -+#else
308.1863 -+                                                       const char* __name)
308.1864 -+#endif
308.1865 -+  {
308.1866 -+    if (!_M_data)
308.1867 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
308.1868 -+
308.1869 -+    if (!__cloc)
308.1870 -+	{
308.1871 -+	  // "C" locale
308.1872 -+	  _M_data->_M_decimal_point = L'.';
308.1873 -+	  _M_data->_M_thousands_sep = L',';
308.1874 -+	  _M_data->_M_grouping = "";
308.1875 -+          _M_data->_M_grouping_size = 0;
308.1876 -+	  _M_data->_M_curr_symbol = L"";
308.1877 -+	  _M_data->_M_curr_symbol_size = 0;
308.1878 -+	  _M_data->_M_positive_sign = L"";
308.1879 -+	  _M_data->_M_positive_sign_size = 0;
308.1880 -+	  _M_data->_M_negative_sign = L"";
308.1881 -+	  _M_data->_M_negative_sign_size = 0;
308.1882 -+	  _M_data->_M_frac_digits = 0;
308.1883 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
308.1884 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
308.1885 -+
308.1886 -+	  // Use ctype::widen code without the facet...
308.1887 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
308.1888 -+	    _M_data->_M_atoms[__i] =
308.1889 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
308.1890 -+	}
308.1891 -+      else
308.1892 -+	{
308.1893 -+	  // Named locale.
308.1894 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1895 -+	  __c_locale __old = __uselocale(__cloc);
308.1896 -+#else
308.1897 -+	  // Switch to named locale so that mbsrtowcs will work.
308.1898 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
308.1899 -+	  setlocale(LC_ALL, __name);
308.1900 -+#endif
308.1901 -+
308.1902 -+#ifdef __UCLIBC_MJN3_ONLY__
308.1903 -+#warning fix this... should be monetary
308.1904 -+#endif
308.1905 -+#ifdef __UCLIBC__
308.1906 -+# ifdef __UCLIBC_HAS_XLOCALE__
308.1907 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
308.1908 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
308.1909 -+# else
308.1910 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
308.1911 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
308.1912 -+# endif
308.1913 -+#else
308.1914 -+          union { char *__s; wchar_t __w; } __u;
308.1915 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
308.1916 -+	  _M_data->_M_decimal_point = __u.__w;
308.1917 -+
308.1918 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
308.1919 -+	  _M_data->_M_thousands_sep = __u.__w;
308.1920 -+#endif
308.1921 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
308.1922 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
308.1923 -+
308.1924 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
308.1925 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
308.1926 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
308.1927 -+
308.1928 -+	  wchar_t* __wcs_ps = 0;
308.1929 -+	  wchar_t* __wcs_ns = 0;
308.1930 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
308.1931 -+	  try
308.1932 -+            {
308.1933 -+              mbstate_t __state;
308.1934 -+              size_t __len;
308.1935 -+              __len = strlen(__cpossign);
308.1936 -+              if (__len)
308.1937 -+                {
308.1938 -+		  ++__len;
308.1939 -+		  memset(&__state, 0, sizeof(mbstate_t));
308.1940 -+		  __wcs_ps = new wchar_t[__len];
308.1941 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
308.1942 -+		  _M_data->_M_positive_sign = __wcs_ps;
308.1943 -+		}
308.1944 -+	      else
308.1945 -+		_M_data->_M_positive_sign = L"";
308.1946 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
308.1947 -+	      
308.1948 -+	      __len = strlen(__cnegsign);
308.1949 -+	      if (!__nposn)
308.1950 -+		_M_data->_M_negative_sign = L"()";
308.1951 -+	      else if (__len)
308.1952 -+		{ 
308.1953 -+		  ++__len;
308.1954 -+		  memset(&__state, 0, sizeof(mbstate_t));
308.1955 -+		  __wcs_ns = new wchar_t[__len];
308.1956 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
308.1957 -+		  _M_data->_M_negative_sign = __wcs_ns;
308.1958 -+		}
308.1959 -+	      else
308.1960 -+		_M_data->_M_negative_sign = L"";
308.1961 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
308.1962 -+
308.1963 -+	      // _Intl == true.
308.1964 -+	      __len = strlen(__ccurr);
308.1965 -+	      if (__len)
308.1966 -+		{
308.1967 -+		  ++__len;
308.1968 -+		  memset(&__state, 0, sizeof(mbstate_t));
308.1969 -+		  wchar_t* __wcs = new wchar_t[__len];
308.1970 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
308.1971 -+		  _M_data->_M_curr_symbol = __wcs;
308.1972 -+		}
308.1973 -+	      else
308.1974 -+		_M_data->_M_curr_symbol = L"";
308.1975 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
308.1976 -+	    }
308.1977 -+          catch (...)
308.1978 -+	    {
308.1979 -+	      delete _M_data;
308.1980 -+              _M_data = 0;
308.1981 -+	      delete __wcs_ps;
308.1982 -+	      delete __wcs_ns;	      
308.1983 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.1984 -+	      __uselocale(__old);
308.1985 -+#else
308.1986 -+	      setlocale(LC_ALL, __old);
308.1987 -+	      free(__old);
308.1988 -+#endif
308.1989 -+              __throw_exception_again;
308.1990 -+	    }
308.1991 -+
308.1992 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
308.1993 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
308.1994 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
308.1995 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
308.1996 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
308.1997 -+	                                                __pposn);
308.1998 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
308.1999 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
308.2000 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
308.2001 -+	                                                __nposn);
308.2002 -+
308.2003 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.2004 -+	  __uselocale(__old);
308.2005 -+#else
308.2006 -+	  setlocale(LC_ALL, __old);
308.2007 -+	  free(__old);
308.2008 -+#endif
308.2009 -+	}
308.2010 -+    }
308.2011 -+
308.2012 -+  template<> 
308.2013 -+    moneypunct<wchar_t, true>::~moneypunct()
308.2014 -+    {
308.2015 -+      if (_M_data->_M_positive_sign_size)
308.2016 -+	delete [] _M_data->_M_positive_sign;
308.2017 -+      if (_M_data->_M_negative_sign_size
308.2018 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
308.2019 -+	delete [] _M_data->_M_negative_sign;
308.2020 -+      if (_M_data->_M_curr_symbol_size)
308.2021 -+	delete [] _M_data->_M_curr_symbol;
308.2022 -+      delete _M_data;
308.2023 -+    }
308.2024 -+
308.2025 -+  template<> 
308.2026 -+    moneypunct<wchar_t, false>::~moneypunct()
308.2027 -+    {
308.2028 -+      if (_M_data->_M_positive_sign_size)
308.2029 -+	delete [] _M_data->_M_positive_sign;
308.2030 -+      if (_M_data->_M_negative_sign_size
308.2031 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
308.2032 -+	delete [] _M_data->_M_negative_sign;
308.2033 -+      if (_M_data->_M_curr_symbol_size)
308.2034 -+	delete [] _M_data->_M_curr_symbol;
308.2035 -+      delete _M_data;
308.2036 -+    }
308.2037 -+#endif
308.2038 -+}
308.2039 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
308.2040 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
308.2041 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
308.2042 -@@ -0,0 +1,160 @@
308.2043 -+// std::numpunct implementation details, GNU version -*- C++ -*-
308.2044 -+
308.2045 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
308.2046 -+//
308.2047 -+// This file is part of the GNU ISO C++ Library.  This library is free
308.2048 -+// software; you can redistribute it and/or modify it under the
308.2049 -+// terms of the GNU General Public License as published by the
308.2050 -+// Free Software Foundation; either version 2, or (at your option)
308.2051 -+// any later version.
308.2052 -+
308.2053 -+// This library is distributed in the hope that it will be useful,
308.2054 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
308.2055 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
308.2056 -+// GNU General Public License for more details.
308.2057 -+
308.2058 -+// You should have received a copy of the GNU General Public License along
308.2059 -+// with this library; see the file COPYING.  If not, write to the Free
308.2060 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
308.2061 -+// USA.
308.2062 -+
308.2063 -+// As a special exception, you may use this file as part of a free software
308.2064 -+// library without restriction.  Specifically, if other files instantiate
308.2065 -+// templates or use macros or inline functions from this file, or you compile
308.2066 -+// this file and link it with other files to produce an executable, this
308.2067 -+// file does not by itself cause the resulting executable to be covered by
308.2068 -+// the GNU General Public License.  This exception does not however
308.2069 -+// invalidate any other reasons why the executable file might be covered by
308.2070 -+// the GNU General Public License.
308.2071 -+
308.2072 -+//
308.2073 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
308.2074 -+//
308.2075 -+
308.2076 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
308.2077 -+
308.2078 -+#define _LIBC
308.2079 -+#include <locale>
308.2080 -+#undef _LIBC
308.2081 -+#include <bits/c++locale_internal.h>
308.2082 -+
308.2083 -+#ifdef __UCLIBC_MJN3_ONLY__
308.2084 -+#warning tailor for stub locale support
308.2085 -+#endif
308.2086 -+#ifndef __UCLIBC_HAS_XLOCALE__
308.2087 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
308.2088 -+#endif
308.2089 -+
308.2090 -+namespace std
308.2091 -+{
308.2092 -+  template<> 
308.2093 -+    void
308.2094 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
308.2095 -+    {
308.2096 -+      if (!_M_data)
308.2097 -+	_M_data = new __numpunct_cache<char>;
308.2098 -+
308.2099 -+      if (!__cloc)
308.2100 -+	{
308.2101 -+	  // "C" locale
308.2102 -+	  _M_data->_M_grouping = "";
308.2103 -+	  _M_data->_M_grouping_size = 0;
308.2104 -+	  _M_data->_M_use_grouping = false;
308.2105 -+
308.2106 -+	  _M_data->_M_decimal_point = '.';
308.2107 -+	  _M_data->_M_thousands_sep = ',';
308.2108 -+
308.2109 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
308.2110 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
308.2111 -+
308.2112 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
308.2113 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
308.2114 -+	}
308.2115 -+      else
308.2116 -+	{
308.2117 -+	  // Named locale.
308.2118 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
308.2119 -+							__cloc));
308.2120 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
308.2121 -+							__cloc));
308.2122 -+
308.2123 -+	  // Check for NULL, which implies no grouping.
308.2124 -+	  if (_M_data->_M_thousands_sep == '\0')
308.2125 -+	    _M_data->_M_grouping = "";
308.2126 -+	  else
308.2127 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
308.2128 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
308.2129 -+	}
308.2130 -+
308.2131 -+      // NB: There is no way to extact this info from posix locales.
308.2132 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
308.2133 -+      _M_data->_M_truename = "true";
308.2134 -+      _M_data->_M_truename_size = 4;
308.2135 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
308.2136 -+      _M_data->_M_falsename = "false";
308.2137 -+      _M_data->_M_falsename_size = 5;
308.2138 -+    }
308.2139 -+ 
308.2140 -+  template<> 
308.2141 -+    numpunct<char>::~numpunct()
308.2142 -+    { delete _M_data; }
308.2143 -+   
308.2144 -+#ifdef _GLIBCXX_USE_WCHAR_T
308.2145 -+  template<> 
308.2146 -+    void
308.2147 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
308.2148 -+    {
308.2149 -+      if (!_M_data)
308.2150 -+	_M_data = new __numpunct_cache<wchar_t>;
308.2151 -+
308.2152 -+      if (!__cloc)
308.2153 -+	{
308.2154 -+	  // "C" locale
308.2155 -+	  _M_data->_M_grouping = "";
308.2156 -+	  _M_data->_M_grouping_size = 0;
308.2157 -+	  _M_data->_M_use_grouping = false;
308.2158 -+
308.2159 -+	  _M_data->_M_decimal_point = L'.';
308.2160 -+	  _M_data->_M_thousands_sep = L',';
308.2161 -+
308.2162 -+	  // Use ctype::widen code without the facet...
308.2163 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
308.2164 -+	    _M_data->_M_atoms_out[__i] =
308.2165 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
308.2166 -+
308.2167 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
308.2168 -+	    _M_data->_M_atoms_in[__j] =
308.2169 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
308.2170 -+	}
308.2171 -+      else
308.2172 -+	{
308.2173 -+	  // Named locale.
308.2174 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
308.2175 -+	  union { char *__s; wchar_t __w; } __u;
308.2176 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
308.2177 -+	  _M_data->_M_decimal_point = __u.__w;
308.2178 -+
308.2179 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
308.2180 -+	  _M_data->_M_thousands_sep = __u.__w;
308.2181 -+
308.2182 -+	  if (_M_data->_M_thousands_sep == L'\0')
308.2183 -+	    _M_data->_M_grouping = "";
308.2184 -+	  else
308.2185 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
308.2186 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
308.2187 -+	}
308.2188 -+
308.2189 -+      // NB: There is no way to extact this info from posix locales.
308.2190 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
308.2191 -+      _M_data->_M_truename = L"true";
308.2192 -+      _M_data->_M_truename_size = 4;
308.2193 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
308.2194 -+      _M_data->_M_falsename = L"false";
308.2195 -+      _M_data->_M_falsename_size = 5;
308.2196 -+    }
308.2197 -+
308.2198 -+  template<> 
308.2199 -+    numpunct<wchar_t>::~numpunct()
308.2200 -+    { delete _M_data; }
308.2201 -+ #endif
308.2202 -+}
308.2203 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
308.2204 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
308.2205 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
308.2206 -@@ -0,0 +1,406 @@
308.2207 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
308.2208 -+
308.2209 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
308.2210 -+//
308.2211 -+// This file is part of the GNU ISO C++ Library.  This library is free
308.2212 -+// software; you can redistribute it and/or modify it under the
308.2213 -+// terms of the GNU General Public License as published by the
308.2214 -+// Free Software Foundation; either version 2, or (at your option)
308.2215 -+// any later version.
308.2216 -+
308.2217 -+// This library is distributed in the hope that it will be useful,
308.2218 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
308.2219 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
308.2220 -+// GNU General Public License for more details.
308.2221 -+
308.2222 -+// You should have received a copy of the GNU General Public License along
308.2223 -+// with this library; see the file COPYING.  If not, write to the Free
308.2224 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
308.2225 -+// USA.
308.2226 -+
308.2227 -+// As a special exception, you may use this file as part of a free software
308.2228 -+// library without restriction.  Specifically, if other files instantiate
308.2229 -+// templates or use macros or inline functions from this file, or you compile
308.2230 -+// this file and link it with other files to produce an executable, this
308.2231 -+// file does not by itself cause the resulting executable to be covered by
308.2232 -+// the GNU General Public License.  This exception does not however
308.2233 -+// invalidate any other reasons why the executable file might be covered by
308.2234 -+// the GNU General Public License.
308.2235 -+
308.2236 -+//
308.2237 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
308.2238 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
308.2239 -+//
308.2240 -+
308.2241 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
308.2242 -+
308.2243 -+#include <locale>
308.2244 -+#include <bits/c++locale_internal.h>
308.2245 -+
308.2246 -+#ifdef __UCLIBC_MJN3_ONLY__
308.2247 -+#warning tailor for stub locale support
308.2248 -+#endif
308.2249 -+#ifndef __UCLIBC_HAS_XLOCALE__
308.2250 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
308.2251 -+#endif
308.2252 -+
308.2253 -+namespace std
308.2254 -+{
308.2255 -+  template<>
308.2256 -+    void
308.2257 -+    __timepunct<char>::
308.2258 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
308.2259 -+	   const tm* __tm) const
308.2260 -+    {
308.2261 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.2262 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
308.2263 -+					_M_c_locale_timepunct);
308.2264 -+#else
308.2265 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
308.2266 -+      setlocale(LC_ALL, _M_name_timepunct);
308.2267 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
308.2268 -+      setlocale(LC_ALL, __old);
308.2269 -+      free(__old);
308.2270 -+#endif
308.2271 -+      // Make sure __s is null terminated.
308.2272 -+      if (__len == 0)
308.2273 -+	__s[0] = '\0';
308.2274 -+    }
308.2275 -+
308.2276 -+  template<> 
308.2277 -+    void
308.2278 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
308.2279 -+    {
308.2280 -+      if (!_M_data)
308.2281 -+	_M_data = new __timepunct_cache<char>;
308.2282 -+
308.2283 -+      if (!__cloc)
308.2284 -+	{
308.2285 -+	  // "C" locale
308.2286 -+	  _M_c_locale_timepunct = _S_get_c_locale();
308.2287 -+
308.2288 -+	  _M_data->_M_date_format = "%m/%d/%y";
308.2289 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
308.2290 -+	  _M_data->_M_time_format = "%H:%M:%S";
308.2291 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
308.2292 -+	  _M_data->_M_date_time_format = "";
308.2293 -+	  _M_data->_M_date_time_era_format = "";
308.2294 -+	  _M_data->_M_am = "AM";
308.2295 -+	  _M_data->_M_pm = "PM";
308.2296 -+	  _M_data->_M_am_pm_format = "";
308.2297 -+
308.2298 -+	  // Day names, starting with "C"'s Sunday.
308.2299 -+	  _M_data->_M_day1 = "Sunday";
308.2300 -+	  _M_data->_M_day2 = "Monday";
308.2301 -+	  _M_data->_M_day3 = "Tuesday";
308.2302 -+	  _M_data->_M_day4 = "Wednesday";
308.2303 -+	  _M_data->_M_day5 = "Thursday";
308.2304 -+	  _M_data->_M_day6 = "Friday";
308.2305 -+	  _M_data->_M_day7 = "Saturday";
308.2306 -+
308.2307 -+	  // Abbreviated day names, starting with "C"'s Sun.
308.2308 -+	  _M_data->_M_aday1 = "Sun";
308.2309 -+	  _M_data->_M_aday2 = "Mon";
308.2310 -+	  _M_data->_M_aday3 = "Tue";
308.2311 -+	  _M_data->_M_aday4 = "Wed";
308.2312 -+	  _M_data->_M_aday5 = "Thu";
308.2313 -+	  _M_data->_M_aday6 = "Fri";
308.2314 -+	  _M_data->_M_aday7 = "Sat";
308.2315 -+
308.2316 -+	  // Month names, starting with "C"'s January.
308.2317 -+	  _M_data->_M_month01 = "January";
308.2318 -+	  _M_data->_M_month02 = "February";
308.2319 -+	  _M_data->_M_month03 = "March";
308.2320 -+	  _M_data->_M_month04 = "April";
308.2321 -+	  _M_data->_M_month05 = "May";
308.2322 -+	  _M_data->_M_month06 = "June";
308.2323 -+	  _M_data->_M_month07 = "July";
308.2324 -+	  _M_data->_M_month08 = "August";
308.2325 -+	  _M_data->_M_month09 = "September";
308.2326 -+	  _M_data->_M_month10 = "October";
308.2327 -+	  _M_data->_M_month11 = "November";
308.2328 -+	  _M_data->_M_month12 = "December";
308.2329 -+
308.2330 -+	  // Abbreviated month names, starting with "C"'s Jan.
308.2331 -+	  _M_data->_M_amonth01 = "Jan";
308.2332 -+	  _M_data->_M_amonth02 = "Feb";
308.2333 -+	  _M_data->_M_amonth03 = "Mar";
308.2334 -+	  _M_data->_M_amonth04 = "Apr";
308.2335 -+	  _M_data->_M_amonth05 = "May";
308.2336 -+	  _M_data->_M_amonth06 = "Jun";
308.2337 -+	  _M_data->_M_amonth07 = "Jul";
308.2338 -+	  _M_data->_M_amonth08 = "Aug";
308.2339 -+	  _M_data->_M_amonth09 = "Sep";
308.2340 -+	  _M_data->_M_amonth10 = "Oct";
308.2341 -+	  _M_data->_M_amonth11 = "Nov";
308.2342 -+	  _M_data->_M_amonth12 = "Dec";
308.2343 -+	}
308.2344 -+      else
308.2345 -+	{
308.2346 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
308.2347 -+
308.2348 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
308.2349 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
308.2350 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
308.2351 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
308.2352 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
308.2353 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
308.2354 -+							     __cloc);
308.2355 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
308.2356 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
308.2357 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
308.2358 -+
308.2359 -+	  // Day names, starting with "C"'s Sunday.
308.2360 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
308.2361 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
308.2362 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
308.2363 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
308.2364 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
308.2365 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
308.2366 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
308.2367 -+
308.2368 -+	  // Abbreviated day names, starting with "C"'s Sun.
308.2369 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
308.2370 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
308.2371 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
308.2372 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
308.2373 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
308.2374 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
308.2375 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
308.2376 -+
308.2377 -+	  // Month names, starting with "C"'s January.
308.2378 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
308.2379 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
308.2380 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
308.2381 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
308.2382 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
308.2383 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
308.2384 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
308.2385 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
308.2386 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
308.2387 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
308.2388 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
308.2389 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
308.2390 -+
308.2391 -+	  // Abbreviated month names, starting with "C"'s Jan.
308.2392 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
308.2393 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
308.2394 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
308.2395 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
308.2396 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
308.2397 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
308.2398 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
308.2399 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
308.2400 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
308.2401 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
308.2402 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
308.2403 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
308.2404 -+	}
308.2405 -+    }
308.2406 -+
308.2407 -+#ifdef _GLIBCXX_USE_WCHAR_T
308.2408 -+  template<>
308.2409 -+    void
308.2410 -+    __timepunct<wchar_t>::
308.2411 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
308.2412 -+	   const tm* __tm) const
308.2413 -+    {
308.2414 -+#ifdef __UCLIBC_HAS_XLOCALE__
308.2415 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
308.2416 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
308.2417 -+					_M_c_locale_timepunct);
308.2418 -+#else
308.2419 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
308.2420 -+      setlocale(LC_ALL, _M_name_timepunct);
308.2421 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
308.2422 -+      setlocale(LC_ALL, __old);
308.2423 -+      free(__old);
308.2424 -+#endif
308.2425 -+      // Make sure __s is null terminated.
308.2426 -+      if (__len == 0)
308.2427 -+	__s[0] = L'\0';
308.2428 -+    }
308.2429 -+
308.2430 -+  template<> 
308.2431 -+    void
308.2432 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
308.2433 -+    {
308.2434 -+      if (!_M_data)
308.2435 -+	_M_data = new __timepunct_cache<wchar_t>;
308.2436 -+
308.2437 -+#warning wide time stuff
308.2438 -+//       if (!__cloc)
308.2439 -+	{
308.2440 -+	  // "C" locale
308.2441 -+	  _M_c_locale_timepunct = _S_get_c_locale();
308.2442 -+
308.2443 -+	  _M_data->_M_date_format = L"%m/%d/%y";
308.2444 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
308.2445 -+	  _M_data->_M_time_format = L"%H:%M:%S";
308.2446 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
308.2447 -+	  _M_data->_M_date_time_format = L"";
308.2448 -+	  _M_data->_M_date_time_era_format = L"";
308.2449 -+	  _M_data->_M_am = L"AM";
308.2450 -+	  _M_data->_M_pm = L"PM";
308.2451 -+	  _M_data->_M_am_pm_format = L"";
308.2452 -+
308.2453 -+	  // Day names, starting with "C"'s Sunday.
308.2454 -+	  _M_data->_M_day1 = L"Sunday";
308.2455 -+	  _M_data->_M_day2 = L"Monday";
308.2456 -+	  _M_data->_M_day3 = L"Tuesday";
308.2457 -+	  _M_data->_M_day4 = L"Wednesday";
308.2458 -+	  _M_data->_M_day5 = L"Thursday";
308.2459 -+	  _M_data->_M_day6 = L"Friday";
308.2460 -+	  _M_data->_M_day7 = L"Saturday";
308.2461 -+
308.2462 -+	  // Abbreviated day names, starting with "C"'s Sun.
308.2463 -+	  _M_data->_M_aday1 = L"Sun";
308.2464 -+	  _M_data->_M_aday2 = L"Mon";
308.2465 -+	  _M_data->_M_aday3 = L"Tue";
308.2466 -+	  _M_data->_M_aday4 = L"Wed";
308.2467 -+	  _M_data->_M_aday5 = L"Thu";
308.2468 -+	  _M_data->_M_aday6 = L"Fri";
308.2469 -+	  _M_data->_M_aday7 = L"Sat";
308.2470 -+
308.2471 -+	  // Month names, starting with "C"'s January.
308.2472 -+	  _M_data->_M_month01 = L"January";
308.2473 -+	  _M_data->_M_month02 = L"February";
308.2474 -+	  _M_data->_M_month03 = L"March";
308.2475 -+	  _M_data->_M_month04 = L"April";
308.2476 -+	  _M_data->_M_month05 = L"May";
308.2477 -+	  _M_data->_M_month06 = L"June";
308.2478 -+	  _M_data->_M_month07 = L"July";
308.2479 -+	  _M_data->_M_month08 = L"August";
308.2480 -+	  _M_data->_M_month09 = L"September";
308.2481 -+	  _M_data->_M_month10 = L"October";
308.2482 -+	  _M_data->_M_month11 = L"November";
308.2483 -+	  _M_data->_M_month12 = L"December";
308.2484 -+
308.2485 -+	  // Abbreviated month names, starting with "C"'s Jan.
308.2486 -+	  _M_data->_M_amonth01 = L"Jan";
308.2487 -+	  _M_data->_M_amonth02 = L"Feb";
308.2488 -+	  _M_data->_M_amonth03 = L"Mar";
308.2489 -+	  _M_data->_M_amonth04 = L"Apr";
308.2490 -+	  _M_data->_M_amonth05 = L"May";
308.2491 -+	  _M_data->_M_amonth06 = L"Jun";
308.2492 -+	  _M_data->_M_amonth07 = L"Jul";
308.2493 -+	  _M_data->_M_amonth08 = L"Aug";
308.2494 -+	  _M_data->_M_amonth09 = L"Sep";
308.2495 -+	  _M_data->_M_amonth10 = L"Oct";
308.2496 -+	  _M_data->_M_amonth11 = L"Nov";
308.2497 -+	  _M_data->_M_amonth12 = L"Dec";
308.2498 -+	}
308.2499 -+#if 0
308.2500 -+      else
308.2501 -+	{
308.2502 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
308.2503 -+
308.2504 -+	  union { char *__s; wchar_t *__w; } __u;
308.2505 -+
308.2506 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
308.2507 -+	  _M_data->_M_date_format = __u.__w;
308.2508 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
308.2509 -+	  _M_data->_M_date_era_format = __u.__w;
308.2510 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
308.2511 -+	  _M_data->_M_time_format = __u.__w;
308.2512 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
308.2513 -+	  _M_data->_M_time_era_format = __u.__w;
308.2514 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
308.2515 -+	  _M_data->_M_date_time_format = __u.__w;
308.2516 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
308.2517 -+	  _M_data->_M_date_time_era_format = __u.__w;
308.2518 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
308.2519 -+	  _M_data->_M_am = __u.__w;
308.2520 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
308.2521 -+	  _M_data->_M_pm = __u.__w;
308.2522 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
308.2523 -+	  _M_data->_M_am_pm_format = __u.__w;
308.2524 -+
308.2525 -+	  // Day names, starting with "C"'s Sunday.
308.2526 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
308.2527 -+	  _M_data->_M_day1 = __u.__w;
308.2528 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
308.2529 -+	  _M_data->_M_day2 = __u.__w;
308.2530 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
308.2531 -+	  _M_data->_M_day3 = __u.__w;
308.2532 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
308.2533 -+	  _M_data->_M_day4 = __u.__w;
308.2534 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
308.2535 -+	  _M_data->_M_day5 = __u.__w;
308.2536 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
308.2537 -+	  _M_data->_M_day6 = __u.__w;
308.2538 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
308.2539 -+	  _M_data->_M_day7 = __u.__w;
308.2540 -+
308.2541 -+	  // Abbreviated day names, starting with "C"'s Sun.
308.2542 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
308.2543 -+	  _M_data->_M_aday1 = __u.__w;
308.2544 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
308.2545 -+	  _M_data->_M_aday2 = __u.__w;
308.2546 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
308.2547 -+	  _M_data->_M_aday3 = __u.__w;
308.2548 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
308.2549 -+	  _M_data->_M_aday4 = __u.__w;
308.2550 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
308.2551 -+	  _M_data->_M_aday5 = __u.__w;
308.2552 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
308.2553 -+	  _M_data->_M_aday6 = __u.__w;
308.2554 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
308.2555 -+	  _M_data->_M_aday7 = __u.__w;
308.2556 -+
308.2557 -+	  // Month names, starting with "C"'s January.
308.2558 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
308.2559 -+	  _M_data->_M_month01 = __u.__w;
308.2560 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
308.2561 -+	  _M_data->_M_month02 = __u.__w;
308.2562 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
308.2563 -+	  _M_data->_M_month03 = __u.__w;
308.2564 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
308.2565 -+	  _M_data->_M_month04 = __u.__w;
308.2566 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
308.2567 -+	  _M_data->_M_month05 = __u.__w;
308.2568 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
308.2569 -+	  _M_data->_M_month06 = __u.__w;
308.2570 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
308.2571 -+	  _M_data->_M_month07 = __u.__w;
308.2572 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
308.2573 -+	  _M_data->_M_month08 = __u.__w;
308.2574 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
308.2575 -+	  _M_data->_M_month09 = __u.__w;
308.2576 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
308.2577 -+	  _M_data->_M_month10 = __u.__w;
308.2578 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
308.2579 -+	  _M_data->_M_month11 = __u.__w;
308.2580 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
308.2581 -+	  _M_data->_M_month12 = __u.__w;
308.2582 -+
308.2583 -+	  // Abbreviated month names, starting with "C"'s Jan.
308.2584 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
308.2585 -+	  _M_data->_M_amonth01 = __u.__w;
308.2586 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
308.2587 -+	  _M_data->_M_amonth02 = __u.__w;
308.2588 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
308.2589 -+	  _M_data->_M_amonth03 = __u.__w;
308.2590 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
308.2591 -+	  _M_data->_M_amonth04 = __u.__w;
308.2592 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
308.2593 -+	  _M_data->_M_amonth05 = __u.__w;
308.2594 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
308.2595 -+	  _M_data->_M_amonth06 = __u.__w;
308.2596 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
308.2597 -+	  _M_data->_M_amonth07 = __u.__w;
308.2598 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
308.2599 -+	  _M_data->_M_amonth08 = __u.__w;
308.2600 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
308.2601 -+	  _M_data->_M_amonth09 = __u.__w;
308.2602 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
308.2603 -+	  _M_data->_M_amonth10 = __u.__w;
308.2604 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
308.2605 -+	  _M_data->_M_amonth11 = __u.__w;
308.2606 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
308.2607 -+	  _M_data->_M_amonth12 = __u.__w;
308.2608 -+	}
308.2609 -+#endif // 0
308.2610 -+    }
308.2611 -+#endif
308.2612 -+}
308.2613 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
308.2614 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
308.2615 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
308.2616 -@@ -0,0 +1,68 @@
308.2617 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
308.2618 -+
308.2619 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
308.2620 -+//
308.2621 -+// This file is part of the GNU ISO C++ Library.  This library is free
308.2622 -+// software; you can redistribute it and/or modify it under the
308.2623 -+// terms of the GNU General Public License as published by the
308.2624 -+// Free Software Foundation; either version 2, or (at your option)
308.2625 -+// any later version.
308.2626 -+
308.2627 -+// This library is distributed in the hope that it will be useful,
308.2628 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
308.2629 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
308.2630 -+// GNU General Public License for more details.
308.2631 -+
308.2632 -+// You should have received a copy of the GNU General Public License along
308.2633 -+// with this library; see the file COPYING.  If not, write to the Free
308.2634 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
308.2635 -+// USA.
308.2636 -+
308.2637 -+// As a special exception, you may use this file as part of a free software
308.2638 -+// library without restriction.  Specifically, if other files instantiate
308.2639 -+// templates or use macros or inline functions from this file, or you compile
308.2640 -+// this file and link it with other files to produce an executable, this
308.2641 -+// file does not by itself cause the resulting executable to be covered by
308.2642 -+// the GNU General Public License.  This exception does not however
308.2643 -+// invalidate any other reasons why the executable file might be covered by
308.2644 -+// the GNU General Public License.
308.2645 -+
308.2646 -+//
308.2647 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
308.2648 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
308.2649 -+//
308.2650 -+
308.2651 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
308.2652 -+
308.2653 -+  template<typename _CharT>
308.2654 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
308.2655 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
308.2656 -+    _M_name_timepunct(_S_get_c_name())
308.2657 -+    { _M_initialize_timepunct(); }
308.2658 -+
308.2659 -+  template<typename _CharT>
308.2660 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
308.2661 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
308.2662 -+    _M_name_timepunct(_S_get_c_name())
308.2663 -+    { _M_initialize_timepunct(); }
308.2664 -+
308.2665 -+  template<typename _CharT>
308.2666 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
308.2667 -+				     size_t __refs) 
308.2668 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
308.2669 -+    _M_name_timepunct(__s)
308.2670 -+    { 
308.2671 -+      char* __tmp = new char[std::strlen(__s) + 1];
308.2672 -+      std::strcpy(__tmp, __s);
308.2673 -+      _M_name_timepunct = __tmp;
308.2674 -+      _M_initialize_timepunct(__cloc); 
308.2675 -+    }
308.2676 -+
308.2677 -+  template<typename _CharT>
308.2678 -+    __timepunct<_CharT>::~__timepunct()
308.2679 -+    { 
308.2680 -+      if (_M_name_timepunct != _S_get_c_name())
308.2681 -+	delete [] _M_name_timepunct;
308.2682 -+      delete _M_data; 
308.2683 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
308.2684 -+    }
308.2685 -diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
308.2686 ---- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:29:22.000000000 +0200
308.2687 -+++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
308.2688 -@@ -5769,7 +5769,7 @@
308.2689 -   enableval="$enable_clocale"
308.2690 - 
308.2691 -       case "$enableval" in
308.2692 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
308.2693 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
308.2694 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
308.2695 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
308.2696 -    { (exit 1); exit 1; }; } ;;
308.2697 -@@ -5802,6 +5802,9 @@
308.2698 -   # Default to "generic".
308.2699 -   if test $enable_clocale_flag = auto; then
308.2700 -     case ${target_os} in
308.2701 -+      linux-uclibc*)
308.2702 -+        enable_clocale_flag=uclibc
308.2703 -+	;;
308.2704 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
308.2705 -         enable_clocale_flag=gnu
308.2706 -         ;;
308.2707 -@@ -6190,6 +6193,76 @@
308.2708 -       CTIME_CC=config/locale/generic/time_members.cc
308.2709 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
308.2710 -       ;;
308.2711 -+    uclibc)
308.2712 -+      echo "$as_me:$LINENO: result: uclibc" >&5
308.2713 -+echo "${ECHO_T}uclibc" >&6
308.2714 -+
308.2715 -+      # Declare intention to use gettext, and add support for specific
308.2716 -+      # languages.
308.2717 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
308.2718 -+      ALL_LINGUAS="de fr"
308.2719 -+
308.2720 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
308.2721 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
308.2722 -+set dummy msgfmt; ac_word=$2
308.2723 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
308.2724 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
308.2725 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
308.2726 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
308.2727 -+else
308.2728 -+  if test -n "$check_msgfmt"; then
308.2729 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
308.2730 -+else
308.2731 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
308.2732 -+for as_dir in $PATH
308.2733 -+do
308.2734 -+  IFS=$as_save_IFS
308.2735 -+  test -z "$as_dir" && as_dir=.
308.2736 -+  for ac_exec_ext in '' $ac_executable_extensions; do
308.2737 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
308.2738 -+    ac_cv_prog_check_msgfmt="yes"
308.2739 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
308.2740 -+    break 2
308.2741 -+  fi
308.2742 -+done
308.2743 -+done
308.2744 -+
308.2745 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
308.2746 -+fi
308.2747 -+fi
308.2748 -+check_msgfmt=$ac_cv_prog_check_msgfmt
308.2749 -+if test -n "$check_msgfmt"; then
308.2750 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
308.2751 -+echo "${ECHO_T}$check_msgfmt" >&6
308.2752 -+else
308.2753 -+  echo "$as_me:$LINENO: result: no" >&5
308.2754 -+echo "${ECHO_T}no" >&6
308.2755 -+fi
308.2756 -+
308.2757 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
308.2758 -+        USE_NLS=yes
308.2759 -+      fi
308.2760 -+      # Export the build objects.
308.2761 -+      for ling in $ALL_LINGUAS; do \
308.2762 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
308.2763 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
308.2764 -+      done
308.2765 -+
308.2766 -+
308.2767 -+
308.2768 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
308.2769 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
308.2770 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
308.2771 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
308.2772 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
308.2773 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
308.2774 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
308.2775 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
308.2776 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
308.2777 -+      CTIME_H=config/locale/uclibc/time_members.h
308.2778 -+      CTIME_CC=config/locale/uclibc/time_members.cc
308.2779 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
308.2780 -+      ;;
308.2781 -   esac
308.2782 - 
308.2783 -   # This is where the testsuite looks for locale catalogs, using the
308.2784 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h
308.2785 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2005-08-17 04:28:44.000000000 +0200
308.2786 -+++ gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h	2007-08-03 20:30:21.000000000 +0200
308.2787 -@@ -101,7 +101,9 @@
308.2788 - using std::wmemcpy;
308.2789 - using std::wmemmove;
308.2790 - using std::wmemset;
308.2791 -+#if _GLIBCXX_HAVE_WCSFTIME
308.2792 - using std::wcsftime;
308.2793 -+#endif
308.2794 - 
308.2795 - #if _GLIBCXX_USE_C99
308.2796 - using std::wcstold;
308.2797 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h
308.2798 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h	2006-12-07 10:33:51.000000000 +0100
308.2799 -+++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h	2007-08-03 20:30:21.000000000 +0200
308.2800 -@@ -182,7 +182,9 @@
308.2801 -   using ::wcscoll;
308.2802 -   using ::wcscpy;
308.2803 -   using ::wcscspn;
308.2804 -+#if _GLIBCXX_HAVE_WCSFTIME
308.2805 -   using ::wcsftime;
308.2806 -+#endif
308.2807 -   using ::wcslen;
308.2808 -   using ::wcsncat;
308.2809 -   using ::wcsncmp;
   309.1 --- a/patches/gcc/4.2.3/203-uclibc-locale-no__x.patch	Mon Jul 28 21:08:01 2008 +0000
   309.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   309.3 @@ -1,223 +0,0 @@
   309.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   309.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
   309.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   309.7 -@@ -39,20 +39,6 @@
   309.8 - #include <langinfo.h>
   309.9 - #include <bits/c++locale_internal.h>
  309.10 - 
  309.11 --#ifndef __UCLIBC_HAS_XLOCALE__
  309.12 --#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  309.13 --#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  309.14 --#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  309.15 --#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  309.16 --#define __strtof_l(S, E, L)         strtof((S), (E))
  309.17 --#define __strtod_l(S, E, L)         strtod((S), (E))
  309.18 --#define __strtold_l(S, E, L)        strtold((S), (E))
  309.19 --#warning should dummy __newlocale check for C|POSIX ?
  309.20 --#define __newlocale(a, b, c)        NULL
  309.21 --#define __freelocale(a)             ((void)0)
  309.22 --#define __duplocale(a)              __c_locale()
  309.23 --#endif
  309.24 --
  309.25 - namespace std 
  309.26 - {
  309.27 -   template<>
  309.28 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  309.29 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
  309.30 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  309.31 -@@ -68,6 +68,7 @@
  309.32 - {
  309.33 -   extern "C" __typeof(uselocale) __uselocale;
  309.34 - }
  309.35 -+#define __uselocale uselocale
  309.36 - #endif
  309.37 - 
  309.38 - namespace std
  309.39 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  309.40 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
  309.41 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:53.000000000 +0200
  309.42 -@@ -60,4 +60,49 @@
  309.43 - extern "C" __typeof(wctype_l) __wctype_l;
  309.44 - #endif 
  309.45 - 
  309.46 -+# define __nl_langinfo_l nl_langinfo_l
  309.47 -+# define __strcoll_l strcoll_l
  309.48 -+# define __strftime_l strftime_l
  309.49 -+# define __strtod_l strtod_l
  309.50 -+# define __strtof_l strtof_l
  309.51 -+# define __strtold_l strtold_l
  309.52 -+# define __strxfrm_l strxfrm_l
  309.53 -+# define __newlocale newlocale
  309.54 -+# define __freelocale freelocale
  309.55 -+# define __duplocale duplocale
  309.56 -+# define __uselocale uselocale
  309.57 -+
  309.58 -+# ifdef _GLIBCXX_USE_WCHAR_T
  309.59 -+#  define __iswctype_l iswctype_l
  309.60 -+#  define __towlower_l towlower_l
  309.61 -+#  define __towupper_l towupper_l
  309.62 -+#  define __wcscoll_l wcscoll_l
  309.63 -+#  define __wcsftime_l wcsftime_l
  309.64 -+#  define __wcsxfrm_l wcsxfrm_l
  309.65 -+#  define __wctype_l wctype_l
  309.66 -+# endif
  309.67 -+
  309.68 -+#else
  309.69 -+# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  309.70 -+# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  309.71 -+# define __strtod_l(S, E, L)         strtod((S), (E))
  309.72 -+# define __strtof_l(S, E, L)         strtof((S), (E))
  309.73 -+# define __strtold_l(S, E, L)        strtold((S), (E))
  309.74 -+# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  309.75 -+# warning should dummy __newlocale check for C|POSIX ?
  309.76 -+# define __newlocale(a, b, c)        NULL
  309.77 -+# define __freelocale(a)             ((void)0)
  309.78 -+# define __duplocale(a)              __c_locale()
  309.79 -+//# define __uselocale ?
  309.80 -+//
  309.81 -+# ifdef _GLIBCXX_USE_WCHAR_T
  309.82 -+#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  309.83 -+#  define __towlower_l(C, L)          towlower((C))
  309.84 -+#  define __towupper_l(C, L)          towupper((C))
  309.85 -+#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  309.86 -+//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  309.87 -+#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  309.88 -+#  define __wctype_l(S, L)            wctype((S))
  309.89 -+# endif
  309.90 -+
  309.91 - #endif // GLIBC 2.3 and later
  309.92 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
  309.93 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
  309.94 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:53.000000000 +0200
  309.95 -@@ -36,13 +36,6 @@
  309.96 - #include <locale>
  309.97 - #include <bits/c++locale_internal.h>
  309.98 - 
  309.99 --#ifndef __UCLIBC_HAS_XLOCALE__
 309.100 --#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 309.101 --#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 309.102 --#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 309.103 --#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 309.104 --#endif
 309.105 --
 309.106 - namespace std
 309.107 - {
 309.108 -   // These are basically extensions to char_traits, and perhaps should
 309.109 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 309.110 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 309.111 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 309.112 -@@ -38,13 +38,6 @@
 309.113 - #undef _LIBC
 309.114 - #include <bits/c++locale_internal.h>
 309.115 - 
 309.116 --#ifndef __UCLIBC_HAS_XLOCALE__
 309.117 --#define __wctype_l(S, L)           wctype((S))
 309.118 --#define __towupper_l(C, L)         towupper((C))
 309.119 --#define __towlower_l(C, L)         towlower((C))
 309.120 --#define __iswctype_l(C, M, L)      iswctype((C), (M))
 309.121 --#endif
 309.122 --
 309.123 - namespace std
 309.124 - {
 309.125 -   // NB: The other ctype<char> specializations are in src/locale.cc and
 309.126 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
 309.127 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
 309.128 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:53.000000000 +0200
 309.129 -@@ -39,13 +39,10 @@
 309.130 - #ifdef __UCLIBC_MJN3_ONLY__
 309.131 - #warning fix gettext stuff
 309.132 - #endif
 309.133 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 309.134 --extern "C" char *__dcgettext(const char *domainname,
 309.135 --			     const char *msgid, int category);
 309.136 - #undef gettext
 309.137 --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 309.138 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 309.139 -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 309.140 - #else
 309.141 --#undef gettext
 309.142 - #define gettext(msgid) (msgid)
 309.143 - #endif
 309.144 - 
 309.145 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 309.146 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
 309.147 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 309.148 -@@ -36,15 +36,11 @@
 309.149 - #ifdef __UCLIBC_MJN3_ONLY__
 309.150 - #warning fix prototypes for *textdomain funcs
 309.151 - #endif
 309.152 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 309.153 --extern "C" char *__textdomain(const char *domainname);
 309.154 --extern "C" char *__bindtextdomain(const char *domainname,
 309.155 --				  const char *dirname);
 309.156 --#else
 309.157 --#undef __textdomain
 309.158 --#undef __bindtextdomain
 309.159 --#define __textdomain(D)           ((void)0)
 309.160 --#define __bindtextdomain(D,P)     ((void)0)
 309.161 -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 309.162 -+#undef textdomain
 309.163 -+#undef bindtextdomain
 309.164 -+#define textdomain(D)           ((void)0)
 309.165 -+#define bindtextdomain(D,P)     ((void)0)
 309.166 - #endif
 309.167 - 
 309.168 -   // Non-virtual member functions.
 309.169 -@@ -70,7 +66,7 @@
 309.170 -     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 309.171 - 			   const char* __dir) const
 309.172 -     { 
 309.173 --      __bindtextdomain(__s.c_str(), __dir);
 309.174 -+      bindtextdomain(__s.c_str(), __dir);
 309.175 -       return this->do_open(__s, __loc); 
 309.176 -     }
 309.177 - 
 309.178 -@@ -90,7 +86,7 @@
 309.179 -     { 
 309.180 -       // No error checking is done, assume the catalog exists and can
 309.181 -       // be used.
 309.182 --      __textdomain(__s.c_str());
 309.183 -+      textdomain(__s.c_str());
 309.184 -       return 0;
 309.185 -     }
 309.186 - 
 309.187 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 309.188 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
 309.189 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
 309.190 -@@ -43,10 +43,6 @@
 309.191 - #warning tailor for stub locale support
 309.192 - #endif
 309.193 - 
 309.194 --#ifndef __UCLIBC_HAS_XLOCALE__
 309.195 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 309.196 --#endif
 309.197 --
 309.198 - namespace std
 309.199 - {
 309.200 -   // Construct and return valid pattern consisting of some combination of:
 309.201 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 309.202 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
 309.203 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
 309.204 -@@ -41,9 +41,6 @@
 309.205 - #ifdef __UCLIBC_MJN3_ONLY__
 309.206 - #warning tailor for stub locale support
 309.207 - #endif
 309.208 --#ifndef __UCLIBC_HAS_XLOCALE__
 309.209 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 309.210 --#endif
 309.211 - 
 309.212 - namespace std
 309.213 - {
 309.214 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
 309.215 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
 309.216 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:53.000000000 +0200
 309.217 -@@ -40,9 +40,6 @@
 309.218 - #ifdef __UCLIBC_MJN3_ONLY__
 309.219 - #warning tailor for stub locale support
 309.220 - #endif
 309.221 --#ifndef __UCLIBC_HAS_XLOCALE__
 309.222 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 309.223 --#endif
 309.224 - 
 309.225 - namespace std
 309.226 - {
   310.1 --- a/patches/gcc/4.2.3/204-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:08:01 2008 +0000
   310.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   310.3 @@ -1,50 +0,0 @@
   310.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   310.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
   310.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
   310.7 -@@ -401,7 +401,7 @@
   310.8 - # ifdef __UCLIBC_HAS_XLOCALE__
   310.9 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  310.10 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  310.11 --# else
  310.12 -+# elif defined __UCLIBC_HAS_LOCALE__
  310.13 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  310.14 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  310.15 - # endif
  310.16 -@@ -556,7 +556,7 @@
  310.17 - # ifdef __UCLIBC_HAS_XLOCALE__
  310.18 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  310.19 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  310.20 --# else
  310.21 -+# elif defined __UCLIBC_HAS_LOCALE__
  310.22 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  310.23 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  310.24 - # endif
  310.25 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  310.26 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
  310.27 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
  310.28 -@@ -127,12 +127,25 @@
  310.29 - 	{
  310.30 - 	  // Named locale.
  310.31 - 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  310.32 -+#ifdef __UCLIBC_MJN3_ONLY__
  310.33 -+#warning fix this... should be numeric
  310.34 -+#endif
  310.35 -+#ifdef __UCLIBC__
  310.36 -+# ifdef __UCLIBC_HAS_XLOCALE__
  310.37 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  310.38 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  310.39 -+# elif defined __UCLIBC_HAS_LOCALE__
  310.40 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  310.41 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  310.42 -+# endif
  310.43 -+#else
  310.44 - 	  union { char *__s; wchar_t __w; } __u;
  310.45 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  310.46 - 	  _M_data->_M_decimal_point = __u.__w;
  310.47 - 
  310.48 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  310.49 - 	  _M_data->_M_thousands_sep = __u.__w;
  310.50 -+#endif
  310.51 - 
  310.52 - 	  if (_M_data->_M_thousands_sep == L'\0')
  310.53 - 	    _M_data->_M_grouping = "";
   311.1 --- a/patches/gcc/4.2.3/205-uclibc-locale-update.patch	Mon Jul 28 21:08:01 2008 +0000
   311.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   311.3 @@ -1,354 +0,0 @@
   311.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   311.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   311.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:31:54.000000000 +0200
   311.7 -@@ -46,16 +46,13 @@
   311.8 -     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   311.9 - 		   const __c_locale& __cloc)
  311.10 -     {
  311.11 --      if (!(__err & ios_base::failbit))
  311.12 --	{
  311.13 --	  char* __sanity;
  311.14 --	  errno = 0;
  311.15 --	  float __f = __strtof_l(__s, &__sanity, __cloc);
  311.16 --          if (__sanity != __s && errno != ERANGE)
  311.17 --	    __v = __f;
  311.18 --	  else
  311.19 --	    __err |= ios_base::failbit;
  311.20 --	}
  311.21 -+      char* __sanity;
  311.22 -+      errno = 0;
  311.23 -+      float __f = __strtof_l(__s, &__sanity, __cloc);
  311.24 -+      if (__sanity != __s && errno != ERANGE)
  311.25 -+	__v = __f;
  311.26 -+      else
  311.27 -+	__err |= ios_base::failbit;
  311.28 -     }
  311.29 - 
  311.30 -   template<>
  311.31 -@@ -63,16 +60,13 @@
  311.32 -     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  311.33 - 		   const __c_locale& __cloc)
  311.34 -     {
  311.35 --      if (!(__err & ios_base::failbit))
  311.36 --	{
  311.37 --	  char* __sanity;
  311.38 --	  errno = 0;
  311.39 --	  double __d = __strtod_l(__s, &__sanity, __cloc);
  311.40 --          if (__sanity != __s && errno != ERANGE)
  311.41 --	    __v = __d;
  311.42 --	  else
  311.43 --	    __err |= ios_base::failbit;
  311.44 --	}
  311.45 -+      char* __sanity;
  311.46 -+      errno = 0;
  311.47 -+      double __d = __strtod_l(__s, &__sanity, __cloc);
  311.48 -+      if (__sanity != __s && errno != ERANGE)
  311.49 -+	__v = __d;
  311.50 -+      else
  311.51 -+	__err |= ios_base::failbit;
  311.52 -     }
  311.53 - 
  311.54 -   template<>
  311.55 -@@ -80,16 +74,13 @@
  311.56 -     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  311.57 - 		   const __c_locale& __cloc)
  311.58 -     {
  311.59 --      if (!(__err & ios_base::failbit))
  311.60 --	{
  311.61 --	  char* __sanity;
  311.62 --	  errno = 0;
  311.63 --	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  311.64 --          if (__sanity != __s && errno != ERANGE)
  311.65 --	    __v = __ld;
  311.66 --	  else
  311.67 --	    __err |= ios_base::failbit;
  311.68 --	}
  311.69 -+      char* __sanity;
  311.70 -+      errno = 0;
  311.71 -+      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  311.72 -+      if (__sanity != __s && errno != ERANGE)
  311.73 -+	__v = __ld;
  311.74 -+      else
  311.75 -+	__err |= ios_base::failbit;
  311.76 -     }
  311.77 - 
  311.78 -   void
  311.79 -@@ -110,7 +101,7 @@
  311.80 -   void
  311.81 -   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  311.82 -   {
  311.83 --    if (_S_get_c_locale() != __cloc)
  311.84 -+    if (__cloc && _S_get_c_locale() != __cloc)
  311.85 -       __freelocale(__cloc); 
  311.86 -   }
  311.87 - 
  311.88 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  311.89 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  311.90 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:31:54.000000000 +0200
  311.91 -@@ -39,21 +39,23 @@
  311.92 - #pragma GCC system_header
  311.93 - 
  311.94 - #include <cstring>              // get std::strlen
  311.95 --#include <cstdio>               // get std::snprintf or std::sprintf
  311.96 -+#include <cstdio>               // get std::vsnprintf or std::vsprintf
  311.97 - #include <clocale>
  311.98 - #include <langinfo.h>		// For codecvt
  311.99 - #ifdef __UCLIBC_MJN3_ONLY__
 311.100 - #warning fix this
 311.101 - #endif
 311.102 --#ifdef __UCLIBC_HAS_LOCALE__
 311.103 -+#ifdef _GLIBCXX_USE_ICONV
 311.104 - #include <iconv.h>		// For codecvt using iconv, iconv_t
 311.105 - #endif
 311.106 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 311.107 --#include <libintl.h> 		// For messages
 311.108 -+#ifdef HAVE_LIBINTL_H
 311.109 -+#include <libintl.h>		// For messages
 311.110 - #endif
 311.111 -+#include <cstdarg>
 311.112 - 
 311.113 - #ifdef __UCLIBC_MJN3_ONLY__
 311.114 - #warning what is _GLIBCXX_C_LOCALE_GNU for
 311.115 -+// psm: used in os/gnu-linux/ctype_noninline.h
 311.116 - #endif
 311.117 - #define _GLIBCXX_C_LOCALE_GNU 1
 311.118 - 
 311.119 -@@ -62,7 +64,7 @@
 311.120 - #endif
 311.121 - // #define _GLIBCXX_NUM_CATEGORIES 6
 311.122 - #define _GLIBCXX_NUM_CATEGORIES 0
 311.123 -- 
 311.124 -+
 311.125 - #ifdef __UCLIBC_HAS_XLOCALE__
 311.126 - namespace __gnu_cxx
 311.127 - {
 311.128 -@@ -79,22 +81,24 @@
 311.129 -   typedef int*			__c_locale;
 311.130 - #endif
 311.131 - 
 311.132 --  // Convert numeric value of type _Tv to string and return length of
 311.133 --  // string.  If snprintf is available use it, otherwise fall back to
 311.134 --  // the unsafe sprintf which, in general, can be dangerous and should
 311.135 -+  // Convert numeric value of type double to string and return length of
 311.136 -+  // string.  If vsnprintf is available use it, otherwise fall back to
 311.137 -+  // the unsafe vsprintf which, in general, can be dangerous and should
 311.138 -   // be avoided.
 311.139 --  template<typename _Tv>
 311.140 --    int
 311.141 --    __convert_from_v(char* __out, 
 311.142 --		     const int __size __attribute__ ((__unused__)),
 311.143 --		     const char* __fmt,
 311.144 --#ifdef __UCLIBC_HAS_XCLOCALE__
 311.145 --		     _Tv __v, const __c_locale& __cloc, int __prec)
 311.146 -+    inline int
 311.147 -+    __convert_from_v(const __c_locale&
 311.148 -+#ifndef __UCLIBC_HAS_XCLOCALE__
 311.149 -+					__cloc __attribute__ ((__unused__))
 311.150 -+#endif
 311.151 -+		     ,
 311.152 -+		     char* __out,
 311.153 -+		     const int __size,
 311.154 -+		     const char* __fmt, ...)
 311.155 -     {
 311.156 -+      va_list __args;
 311.157 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 311.158 -       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 311.159 - #else
 311.160 --		     _Tv __v, const __c_locale&, int __prec)
 311.161 --    {
 311.162 - # ifdef __UCLIBC_HAS_LOCALE__
 311.163 -       char* __old = std::setlocale(LC_ALL, NULL);
 311.164 -       char* __sav = new char[std::strlen(__old) + 1];
 311.165 -@@ -103,7 +107,9 @@
 311.166 - # endif
 311.167 - #endif
 311.168 - 
 311.169 --      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 311.170 -+      va_start(__args, __fmt);
 311.171 -+      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 311.172 -+      va_end(__args);
 311.173 - 
 311.174 - #ifdef __UCLIBC_HAS_XCLOCALE__
 311.175 -       __gnu_cxx::__uselocale(__old);
 311.176 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 311.177 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 311.178 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:31:54.000000000 +0200
 311.179 -@@ -33,9 +33,14 @@
 311.180 - 
 311.181 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 311.182 - 
 311.183 -+#include <features.h>
 311.184 -+#ifdef __UCLIBC_HAS_LOCALE__
 311.185 - #define _LIBC
 311.186 - #include <locale>
 311.187 - #undef _LIBC
 311.188 -+#else
 311.189 -+#include <locale>
 311.190 -+#endif
 311.191 - #include <bits/c++locale_internal.h>
 311.192 - 
 311.193 - namespace std
 311.194 -@@ -138,20 +143,34 @@
 311.195 -   ctype<wchar_t>::
 311.196 -   do_is(mask __m, wchar_t __c) const
 311.197 -   { 
 311.198 --    // Highest bitmask in ctype_base == 10, but extra in "C"
 311.199 --    // library for blank.
 311.200 -+    // The case of __m == ctype_base::space is particularly important,
 311.201 -+    // due to its use in many istream functions.  Therefore we deal with
 311.202 -+    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 311.203 -+    // is the mask corresponding to ctype_base::space.  NB: an encoding
 311.204 -+    // change would not affect correctness!
 311.205 -     bool __ret = false;
 311.206 --    const size_t __bitmasksize = 11; 
 311.207 --    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 311.208 --      if (__m & _M_bit[__bitcur]
 311.209 --	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 311.210 --	{
 311.211 --	  __ret = true;
 311.212 --	  break;
 311.213 --	}
 311.214 -+    if (__m == _M_bit[5])
 311.215 -+      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 311.216 -+    else
 311.217 -+      {
 311.218 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 311.219 -+	// library for blank.
 311.220 -+	const size_t __bitmasksize = 11;
 311.221 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 311.222 -+	  if (__m & _M_bit[__bitcur])
 311.223 -+	    {
 311.224 -+	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 311.225 -+		{
 311.226 -+		  __ret = true;
 311.227 -+		  break;
 311.228 -+		}
 311.229 -+	      else if (__m == _M_bit[__bitcur])
 311.230 -+		break;
 311.231 -+	    }
 311.232 -+      }
 311.233 -     return __ret;    
 311.234 -   }
 311.235 --  
 311.236 -+
 311.237 -   const wchar_t* 
 311.238 -   ctype<wchar_t>::
 311.239 -   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 311.240 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 311.241 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 311.242 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
 311.243 -@@ -47,18 +47,21 @@
 311.244 -   template<typename _CharT>
 311.245 -      messages<_CharT>::messages(size_t __refs)
 311.246 -      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 311.247 --     _M_name_messages(_S_get_c_name())
 311.248 -+       _M_name_messages(_S_get_c_name())
 311.249 -      { }
 311.250 - 
 311.251 -   template<typename _CharT>
 311.252 -      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 311.253 - 				size_t __refs) 
 311.254 --     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 311.255 --     _M_name_messages(__s)
 311.256 -+     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 311.257 -      {
 311.258 --       char* __tmp = new char[std::strlen(__s) + 1];
 311.259 --       std::strcpy(__tmp, __s);
 311.260 -+       const size_t __len = std::strlen(__s) + 1;
 311.261 -+       char* __tmp = new char[__len];
 311.262 -+       std::memcpy(__tmp, __s, __len);
 311.263 -        _M_name_messages = __tmp;
 311.264 -+
 311.265 -+       // Last to avoid leaking memory if new throws.
 311.266 -+       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 311.267 -      }
 311.268 - 
 311.269 -   template<typename _CharT>
 311.270 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 311.271 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
 311.272 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:54.000000000 +0200
 311.273 -@@ -33,9 +33,14 @@
 311.274 - 
 311.275 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 311.276 - 
 311.277 -+#include <features.h>
 311.278 -+#ifdef __UCLIBC_HAS_LOCALE__
 311.279 - #define _LIBC
 311.280 - #include <locale>
 311.281 - #undef _LIBC
 311.282 -+#else
 311.283 -+#include <locale>
 311.284 -+#endif
 311.285 - #include <bits/c++locale_internal.h>
 311.286 - 
 311.287 - #ifdef __UCLIBC_MJN3_ONLY__
 311.288 -@@ -206,7 +211,7 @@
 311.289 - 	  }
 311.290 - 	break;
 311.291 -       default:
 311.292 --	;
 311.293 -+	__ret = pattern();
 311.294 -       }
 311.295 -     return __ret;
 311.296 -   }
 311.297 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 311.298 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
 311.299 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:54.000000000 +0200
 311.300 -@@ -33,9 +33,14 @@
 311.301 - 
 311.302 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 311.303 - 
 311.304 -+#include <features.h>
 311.305 -+#ifdef __UCLIBC_HAS_LOCALE__
 311.306 - #define _LIBC
 311.307 - #include <locale>
 311.308 - #undef _LIBC
 311.309 -+#else
 311.310 -+#include <locale>
 311.311 -+#endif
 311.312 - #include <bits/c++locale_internal.h>
 311.313 - 
 311.314 - #ifdef __UCLIBC_MJN3_ONLY__
 311.315 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
 311.316 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
 311.317 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
 311.318 -@@ -37,25 +37,33 @@
 311.319 -   template<typename _CharT>
 311.320 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
 311.321 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 311.322 --    _M_name_timepunct(_S_get_c_name())
 311.323 -+      _M_name_timepunct(_S_get_c_name())
 311.324 -     { _M_initialize_timepunct(); }
 311.325 - 
 311.326 -   template<typename _CharT>
 311.327 -     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 311.328 -     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 311.329 --    _M_name_timepunct(_S_get_c_name())
 311.330 -+      _M_name_timepunct(_S_get_c_name())
 311.331 -     { _M_initialize_timepunct(); }
 311.332 - 
 311.333 -   template<typename _CharT>
 311.334 -     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 311.335 - 				     size_t __refs) 
 311.336 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 311.337 --    _M_name_timepunct(__s)
 311.338 -+      _M_name_timepunct(NULL)
 311.339 -     { 
 311.340 --      char* __tmp = new char[std::strlen(__s) + 1];
 311.341 --      std::strcpy(__tmp, __s);
 311.342 -+      const size_t __len = std::strlen(__s) + 1;
 311.343 -+      char* __tmp = new char[__len];
 311.344 -+      std::memcpy(__tmp, __s, __len);
 311.345 -       _M_name_timepunct = __tmp;
 311.346 --      _M_initialize_timepunct(__cloc); 
 311.347 -+
 311.348 -+      try
 311.349 -+	{ _M_initialize_timepunct(__cloc); }
 311.350 -+      catch(...)
 311.351 -+	{
 311.352 -+	  delete [] _M_name_timepunct;
 311.353 -+	  __throw_exception_again;
 311.354 -+	}
 311.355 -     }
 311.356 - 
 311.357 -   template<typename _CharT>
   312.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   312.2 +++ b/patches/gcc/4.2.3/210-libmudflap-susv3-legacy.patch	Mon Jul 28 21:32:33 2008 +0000
   312.3 @@ -0,0 +1,48 @@
   312.4 +diff -durN gcc-4.2.1.orig/libmudflap/mf-hooks2.c gcc-4.2.1/libmudflap/mf-hooks2.c
   312.5 +--- gcc-4.2.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   312.6 ++++ gcc-4.2.1/libmudflap/mf-hooks2.c	2007-08-03 20:35:09.000000000 +0200
   312.7 +@@ -427,7 +427,7 @@
   312.8 + {
   312.9 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  312.10 +   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  312.11 +-  bzero (s, n);
  312.12 ++  memset (s, 0, n);
  312.13 + }
  312.14 + 
  312.15 + 
  312.16 +@@ -437,7 +437,7 @@
  312.17 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  312.18 +   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  312.19 +   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  312.20 +-  bcopy (src, dest, n);
  312.21 ++  memmove (dest, src, n);
  312.22 + }
  312.23 + 
  312.24 + 
  312.25 +@@ -447,7 +447,7 @@
  312.26 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  312.27 +   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  312.28 +   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  312.29 +-  return bcmp (s1, s2, n);
  312.30 ++  return n == 0 ? 0 : memcmp (s1, s2, n);
  312.31 + }
  312.32 + 
  312.33 + 
  312.34 +@@ -456,7 +456,7 @@
  312.35 +   size_t n = strlen (s);
  312.36 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  312.37 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  312.38 +-  return index (s, c);
  312.39 ++  return strchr (s, c);
  312.40 + }
  312.41 + 
  312.42 + 
  312.43 +@@ -465,7 +465,7 @@
  312.44 +   size_t n = strlen (s);
  312.45 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  312.46 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  312.47 +-  return rindex (s, c);
  312.48 ++  return strrchr (s, c);
  312.49 + }
  312.50 + 
  312.51 + /* XXX:  stpcpy, memccpy */
   313.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   313.2 +++ b/patches/gcc/4.2.3/220-libstdc++-namespace.patch	Mon Jul 28 21:32:33 2008 +0000
   313.3 @@ -0,0 +1,36 @@
   313.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
   313.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
   313.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:35:40.000000000 +0200
   313.7 +@@ -32,7 +32,8 @@
   313.8 + //
   313.9 + 
  313.10 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  313.11 +-
  313.12 ++namespace std
  313.13 ++{
  313.14 + #ifdef __UCLIBC_MJN3_ONLY__
  313.15 + #warning fix prototypes for *textdomain funcs
  313.16 + #endif
  313.17 +@@ -115,3 +116,4 @@
  313.18 + 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  313.19 + 	 }
  313.20 +      }
  313.21 ++}
  313.22 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
  313.23 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
  313.24 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:35:40.000000000 +0200
  313.25 +@@ -33,7 +33,8 @@
  313.26 + //
  313.27 + 
  313.28 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  313.29 +-
  313.30 ++namespace std
  313.31 ++{
  313.32 +   template<typename _CharT>
  313.33 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
  313.34 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  313.35 +@@ -74,3 +75,4 @@
  313.36 +       delete _M_data; 
  313.37 +       _S_destroy_c_locale(_M_c_locale_timepunct); 
  313.38 +     }
  313.39 ++}
   314.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   314.2 +++ b/patches/gcc/4.2.3/230-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:32:33 2008 +0000
   314.3 @@ -0,0 +1,12 @@
   314.4 +diff -durN gcc-4.2.1.orig/gcc/Makefile.in gcc-4.2.1/gcc/Makefile.in
   314.5 +--- gcc-4.2.1.orig/gcc/Makefile.in	2007-05-31 17:37:38.000000000 +0200
   314.6 ++++ gcc-4.2.1/gcc/Makefile.in	2007-08-03 20:36:14.000000000 +0200
   314.7 +@@ -2660,7 +2660,7 @@
   314.8 + # FIXME: writing proper dependencies for this is a *LOT* of work.
   314.9 + libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
  314.10 +   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  314.11 +-  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  314.12 ++  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  314.13 + 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  314.14 + 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  314.15 + 	  -DLOCALEDIR=\"$(localedir)\" \
   315.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   315.2 +++ b/patches/gcc/4.2.3/240-arm-bigendian.patch	Mon Jul 28 21:32:33 2008 +0000
   315.3 @@ -0,0 +1,64 @@
   315.4 +diff -durN gcc-4.2.1.orig/gcc/config/arm/linux-elf.h gcc-4.2.1/gcc/config/arm/linux-elf.h
   315.5 +--- gcc-4.2.1.orig/gcc/config/arm/linux-elf.h	2006-02-17 00:29:10.000000000 +0100
   315.6 ++++ gcc-4.2.1/gcc/config/arm/linux-elf.h	2007-08-03 20:36:43.000000000 +0200
   315.7 +@@ -28,19 +28,33 @@
   315.8 + #undef  TARGET_VERSION
   315.9 + #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  315.10 + 
  315.11 ++/*
  315.12 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  315.13 ++ * (big endian) configurations.
  315.14 ++ */
  315.15 ++#if TARGET_BIG_ENDIAN_DEFAULT
  315.16 ++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  315.17 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
  315.18 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
  315.19 ++#else
  315.20 ++#define TARGET_ENDIAN_DEFAULT 0
  315.21 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
  315.22 ++#define TARGET_LINKER_EMULATION "armelf_linux"
  315.23 ++#endif
  315.24 ++
  315.25 + #undef  TARGET_DEFAULT_FLOAT_ABI
  315.26 + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  315.27 + 
  315.28 + #undef  TARGET_DEFAULT
  315.29 +-#define TARGET_DEFAULT (0)
  315.30 ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  315.31 + 
  315.32 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  315.33 + 
  315.34 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  315.35 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  315.36 + 
  315.37 + #undef  MULTILIB_DEFAULTS
  315.38 + #define MULTILIB_DEFAULTS \
  315.39 +-	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  315.40 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  315.41 + 
  315.42 + /* Now we define the strings used to build the spec file.  */
  315.43 + #undef  LIB_SPEC
  315.44 +@@ -61,7 +75,7 @@
  315.45 +    %{rdynamic:-export-dynamic} \
  315.46 +    %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
  315.47 +    -X \
  315.48 +-   %{mbig-endian:-EB}" \
  315.49 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  315.50 +    SUBTARGET_EXTRA_LINK_SPEC
  315.51 + 
  315.52 + #undef  LINK_SPEC
  315.53 +diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
  315.54 +--- gcc-4.2.1.orig/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
  315.55 ++++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:36:43.000000000 +0200
  315.56 +@@ -705,6 +705,11 @@
  315.57 + 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  315.58 + 	tmake_file="${tmake_file} t-linux arm/t-arm"
  315.59 + 	case ${target} in
  315.60 ++	arm*b-*)
  315.61 ++		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  315.62 ++		;;
  315.63 ++	esac
  315.64 ++	case ${target} in
  315.65 + 	arm*-*-linux-*eabi)
  315.66 + 	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
  315.67 + 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
   316.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   316.2 +++ b/patches/gcc/4.2.3/250-softfloat-fix.patch	Mon Jul 28 21:32:33 2008 +0000
   316.3 @@ -0,0 +1,58 @@
   316.4 +This patch (C) 2007 Yann E. MORIN
   316.5 +Licensed under GPL v2.
   316.6 +
   316.7 +First hunk of this patch solves compiling uClibc:
   316.8 +
   316.9 +make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  316.10 +  LD libuClibc-0.9.29.so
  316.11 +libc/libc_so.a(difftime.os): In function `difftime':
  316.12 +difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  316.13 +difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  316.14 +libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  316.15 +_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  316.16 +_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  316.17 +_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  316.18 +_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  316.19 +_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  316.20 +_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  316.21 +_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  316.22 +libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  316.23 +__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  316.24 +libc/libc_so.a(strtof.os): In function `strtof':
  316.25 +strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  316.26 +/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  316.27 +In function `__fixunsdfsi':
  316.28 +libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  316.29 +make[2]: *** [lib/libc.so] Error 1
  316.30 +make[1]: *** [lib/libc.so.0] Error 2
  316.31 +make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  316.32 +make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  316.33 +Error 2
  316.34 +
  316.35 +The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  316.36 +
  316.37 +
  316.38 +diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
  316.39 +--- gcc-4.2.0.orig/gcc/config.gcc	2007-07-15 11:24:18.000000000 +0200
  316.40 ++++ gcc-4.2.0/gcc/config.gcc	2007-07-15 11:26:02.000000000 +0200
  316.41 +@@ -721,7 +721,7 @@
  316.42 + 	    default_use_cxa_atexit=yes
  316.43 + 	    ;;
  316.44 + 	*)
  316.45 +-	    tmake_file="$tmake_file arm/t-linux"
  316.46 ++	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  316.47 + 	    ;;
  316.48 + 	esac
  316.49 + 	tm_file="$tm_file arm/aout.h arm/arm.h"
  316.50 +diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
  316.51 +--- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h	2007-07-15 11:24:18.000000000 +0200
  316.52 ++++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2007-07-15 11:26:02.000000000 +0200
  316.53 +@@ -63,7 +63,7 @@
  316.54 +    %{shared:-lc} \
  316.55 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  316.56 + 
  316.57 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  316.58 ++#define LIBGCC_SPEC "-lgcc"
  316.59 + 
  316.60 + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  316.61 + 
   317.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   317.2 +++ b/patches/gcc/4.2.3/260-flatten-switch-stmt-00.patch	Mon Jul 28 21:32:33 2008 +0000
   317.3 @@ -0,0 +1,24 @@
   317.4 +diff -durN gcc-4.2.1.orig/gcc/stmt.c gcc-4.2.1/gcc/stmt.c
   317.5 +--- gcc-4.2.1.orig/gcc/stmt.c	2007-07-19 05:25:32.000000000 +0200
   317.6 ++++ gcc-4.2.1/gcc/stmt.c	2007-08-03 20:37:19.000000000 +0200
   317.7 +@@ -2512,7 +2512,11 @@
   317.8 + 	  use_cost_table
   317.9 + 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  317.10 + 	       && estimate_case_costs (case_list));
  317.11 +-	  balance_case_nodes (&case_list, NULL);
  317.12 ++	  /* When optimizing for size, we want a straight list to avoid
  317.13 ++	     jumps as much as possible. This basically creates an if-else
  317.14 ++	     chain.  */
  317.15 ++	  if (!optimize_size)
  317.16 ++	    balance_case_nodes (&case_list, NULL);
  317.17 + 	  emit_case_nodes (index, case_list, default_label, index_type);
  317.18 + 	  emit_jump (default_label);
  317.19 + 	}
  317.20 +@@ -3070,6 +3074,7 @@
  317.21 + 	    {
  317.22 + 	      if (!node_has_low_bound (node, index_type))
  317.23 + 		{
  317.24 ++		  if (!optimize_size) /* don't jl to the .default_label. */
  317.25 + 		  emit_cmp_and_jump_insns (index,
  317.26 + 					   convert_modes
  317.27 + 					   (mode, imode,
   318.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   318.2 +++ b/patches/gcc/4.2.3/270-soft-float.patch	Mon Jul 28 21:32:33 2008 +0000
   318.3 @@ -0,0 +1,21 @@
   318.4 +diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
   318.5 +--- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c	2007-03-05 11:54:00.000000000 -0500
   318.6 ++++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c	2008-01-31 17:51:24.000000000 -0500
   318.7 +@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
   318.8 +    but GCC currently generates poor code when a union is used to turn
   318.9 +    a long double into a pair of doubles.  */
  318.10 + 
  318.11 ++#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  318.12 ++
  318.13 + long double __gcc_qadd (double, double, double, double);
  318.14 + long double __gcc_qsub (double, double, double, double);
  318.15 + long double __gcc_qmul (double, double, double, double);
  318.16 +@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
  318.17 +   return z.ldval;
  318.18 + }
  318.19 + 
  318.20 +-#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  318.21 +-
  318.22 + long double __gcc_qneg (double, double);
  318.23 + int __gcc_qeq (double, double, double, double);
  318.24 + int __gcc_qne (double, double, double, double);
   319.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   319.2 +++ b/patches/gcc/4.2.3/280-eabi_fixes.patch	Mon Jul 28 21:32:33 2008 +0000
   319.3 @@ -0,0 +1,13 @@
   319.4 +diff -durN gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h gcc-4.2.3/gcc/config/arm/linux-eabi.h
   319.5 +--- gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h	2007-09-01 17:28:30.000000000 +0200
   319.6 ++++ gcc-4.2.3/gcc/config/arm/linux-eabi.h	2008-05-25 23:47:36.000000000 +0200
   319.7 +@@ -47,7 +47,8 @@
   319.8 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
   319.9 + 
  319.10 + #undef SUBTARGET_EXTRA_LINK_SPEC
  319.11 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
  319.12 ++#define SUBTARGET_EXTRA_LINK_SPEC	\
  319.13 ++	" %{mlittle-endian:-m armelf_linux_eabi} %{mbig-endian:-m armelfb_linux_eabi}"
  319.14 + 
  319.15 + /* Use ld-linux.so.3 so that it will be possible to run "classic"
  319.16 +    GNU/Linux binaries on an EABI system.  */
   320.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   320.2 +++ b/patches/gcc/4.2.3/290-alpha-signal_h.patch	Mon Jul 28 21:32:33 2008 +0000
   320.3 @@ -0,0 +1,17 @@
   320.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   320.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   320.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   320.7 + /* Do code reading to identify a signal frame, and set the frame
   320.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
   320.9 + 
  320.10 ++/* Don't use this if inhibit_libc is set
  320.11 ++   The build for this target will fail trying to include missing headers */
  320.12 ++#ifndef inhibit_libc
  320.13 + #include <signal.h>
  320.14 + #include <sys/ucontext.h>
  320.15 + 
  320.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  320.17 +   fs->retaddr_column = 64;
  320.18 +   return _URC_NO_REASON;
  320.19 + }
  320.20 ++#endif /* inhibit_libc */
   321.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   321.2 +++ b/patches/gcc/4.2.3/300-fortran-signed-TImode.patch	Mon Jul 28 21:32:33 2008 +0000
   321.3 @@ -0,0 +1,43 @@
   321.4 +Fix building gfortran for ARM.
   321.5 +http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01010.html
   321.6 +----
   321.7 +
   321.8 +The patch below fixes a crash building libgfortran on arm-linux-gnueabi.
   321.9 +
  321.10 +This target doesn't really have a 128-bit integer type, however it does use 
  321.11 +TImode to represent the return value of certain special ABI defined library 
  321.12 +functions. This results in type_for_size(TImode) being called.
  321.13 +
  321.14 +Because TImode deosn't correspond to any gfortran integer kind 
  321.15 +gfc_type_for_size returns NULL and we segfault shortly after.
  321.16 +
  321.17 +The patch below fixes this by making gfc_type_for_size handle TImode in the 
  321.18 +same way as the C frontend.
  321.19 +
  321.20 +Tested on x86_64-linux and arm-linux-gnueabi.
  321.21 +Applied to trunk.
  321.22 +
  321.23 +Paul
  321.24 +
  321.25 +2007-05-15  Paul Brook  <paul@codesourcery.com>
  321.26 +
  321.27 +    gcc/fortran/
  321.28 +    * trans-types.c (gfc_type_for_size): Handle signed TImode.
  321.29 +
  321.30 +diff -durN gcc-4.2.3.old/gcc/fortran/trans-types.c gcc-4.2.3/gcc/fortran/trans-types.c
  321.31 +--- gcc-4.2.3.old/gcc/fortran/trans-types.c	2007-08-31 10:27:50.000000000 +0200
  321.32 ++++ gcc-4.2.3/gcc/fortran/trans-types.c	2008-07-17 09:54:20.000000000 +0200
  321.33 +@@ -1799,6 +1799,13 @@
  321.34 + 	  if (type && bits == TYPE_PRECISION (type))
  321.35 + 	    return type;
  321.36 + 	}
  321.37 ++
  321.38 ++	/* Handle TImode as a special case because it is used by some backends
  321.39 ++	   (eg. ARM) even though it is not available for normal use.  */
  321.40 ++#if HOST_BITS_PER_WIDE_INT >= 64
  321.41 ++	if (bits == TYPE_PRECISION (intTI_type_node))
  321.42 ++	  return intTI_type_node;
  321.43 ++#endif
  321.44 +     }
  321.45 +   else
  321.46 +     {
   322.1 --- a/patches/gcc/4.2.3/300-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   322.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   322.3 @@ -1,50 +0,0 @@
   322.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am gcc-4.2.1/libstdc++-v3/src/Makefile.am
   322.5 ---- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am	2006-07-28 06:57:34.000000000 +0200
   322.6 -+++ gcc-4.2.1/libstdc++-v3/src/Makefile.am	2007-08-03 20:32:27.000000000 +0200
   322.7 -@@ -257,6 +257,12 @@
   322.8 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
   322.9 - 
  322.10 - 
  322.11 -+install-exec-local:
  322.12 -+ifeq ($(enable_shared),yes)
  322.13 -+	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  322.14 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  322.15 -+endif
  322.16 -+
  322.17 - # Added bits to build debug library.
  322.18 - if GLIBCXX_BUILD_DEBUG
  322.19 - all-local: build_debug
  322.20 -diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in gcc-4.2.1/libstdc++-v3/src/Makefile.in
  322.21 ---- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in	2006-10-16 21:08:22.000000000 +0200
  322.22 -+++ gcc-4.2.1/libstdc++-v3/src/Makefile.in	2007-08-03 20:32:27.000000000 +0200
  322.23 -@@ -657,7 +657,7 @@
  322.24 - 
  322.25 - install-data-am: install-data-local
  322.26 - 
  322.27 --install-exec-am: install-toolexeclibLTLIBRARIES
  322.28 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  322.29 - 
  322.30 - install-info: install-info-am
  322.31 - 
  322.32 -@@ -690,6 +690,7 @@
  322.33 - 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  322.34 - 	html-am info info-am install install-am install-data \
  322.35 - 	install-data-am install-data-local install-exec \
  322.36 -+	install-exec-local \
  322.37 - 	install-exec-am install-info install-info-am install-man \
  322.38 - 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  322.39 - 	installcheck-am installdirs maintainer-clean \
  322.40 -@@ -799,6 +800,13 @@
  322.41 - install_debug:
  322.42 - 	(cd ${debugdir} && $(MAKE) \
  322.43 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  322.44 -+
  322.45 -+install-exec-local:
  322.46 -+ifeq ($(enable_shared),yes)
  322.47 -+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  322.48 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  322.49 -+endif
  322.50 -+
  322.51 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  322.52 - # Otherwise a system limit (for SysV at least) may be exceeded.
  322.53 - .NOEXPORT:
   323.1 --- a/patches/gcc/4.2.3/301-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   323.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   323.3 @@ -1,12 +0,0 @@
   323.4 -diff -durN gcc-4.2.1.orig/boehm-gc/include/gc.h gcc-4.2.1/boehm-gc/include/gc.h
   323.5 ---- gcc-4.2.1.orig/boehm-gc/include/gc.h	2006-09-18 20:45:08.000000000 +0200
   323.6 -+++ gcc-4.2.1/boehm-gc/include/gc.h	2007-08-03 20:33:00.000000000 +0200
   323.7 -@@ -502,7 +502,7 @@
   323.8 - #if defined(__linux__) || defined(__GLIBC__)
   323.9 - # include <features.h>
  323.10 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  323.11 --     && !defined(__ia64__)
  323.12 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  323.13 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  323.14 - #     define GC_HAVE_BUILTIN_BACKTRACE
  323.15 - #   endif
   324.1 --- a/patches/gcc/4.2.3/302-c99-snprintf.patch	Mon Jul 28 21:08:01 2008 +0000
   324.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   324.3 @@ -1,12 +0,0 @@
   324.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h
   324.5 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h	2006-12-07 10:33:51.000000000 +0100
   324.6 -+++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h	2007-08-03 20:33:24.000000000 +0200
   324.7 -@@ -144,7 +144,7 @@
   324.8 - 
   324.9 - _GLIBCXX_END_NAMESPACE
  324.10 - 
  324.11 --#if _GLIBCXX_USE_C99
  324.12 -+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  324.13 - 
  324.14 - #undef snprintf
  324.15 - #undef vfscanf
   325.1 --- a/patches/gcc/4.2.3/303-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   325.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   325.3 @@ -1,13 +0,0 @@
   325.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
   325.5 ---- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
   325.6 -+++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:33:56.000000000 +0200
   325.7 -@@ -7514,6 +7514,9 @@
   325.8 - cat >>conftest.$ac_ext <<_ACEOF
   325.9 - /* end confdefs.h.  */
  325.10 - #include <complex.h>
  325.11 -+#ifdef __UCLIBC__
  325.12 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  325.13 -+#endif
  325.14 - int
  325.15 - main ()
  325.16 - {
   326.1 --- a/patches/gcc/4.2.3/304-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   326.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   326.3 @@ -1,26 +0,0 @@
   326.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/rope gcc-4.2.1/libstdc++-v3/include/ext/rope
   326.5 ---- gcc-4.2.1.orig/libstdc++-v3/include/ext/rope	2006-10-17 13:56:21.000000000 +0200
   326.6 -+++ gcc-4.2.1/libstdc++-v3/include/ext/rope	2007-08-03 20:34:23.000000000 +0200
   326.7 -@@ -58,6 +58,9 @@
   326.8 - #include <bits/allocator.h>
   326.9 - #include <ext/hash_fun.h>
  326.10 - 
  326.11 -+/* cope w/ index defined as macro, SuSv3 proposal */
  326.12 -+#undef index
  326.13 -+
  326.14 - # ifdef __GC
  326.15 - #   define __GC_CONST const
  326.16 - # else
  326.17 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h
  326.18 ---- gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2006-10-17 13:56:21.000000000 +0200
  326.19 -+++ gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h	2007-08-03 20:34:23.000000000 +0200
  326.20 -@@ -54,6 +54,9 @@
  326.21 - #include <ext/memory> // For uninitialized_copy_n
  326.22 - #include <ext/numeric> // For power
  326.23 - 
  326.24 -+/* cope w/ index defined as macro, SuSv3 proposal */
  326.25 -+#undef index
  326.26 -+
  326.27 - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  326.28 - 
  326.29 -   using std::size_t;
   327.1 --- a/patches/gcc/4.2.3/305-libmudflap-susv3-legacy.patch	Mon Jul 28 21:08:01 2008 +0000
   327.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   327.3 @@ -1,48 +0,0 @@
   327.4 -diff -durN gcc-4.2.1.orig/libmudflap/mf-hooks2.c gcc-4.2.1/libmudflap/mf-hooks2.c
   327.5 ---- gcc-4.2.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   327.6 -+++ gcc-4.2.1/libmudflap/mf-hooks2.c	2007-08-03 20:35:09.000000000 +0200
   327.7 -@@ -427,7 +427,7 @@
   327.8 - {
   327.9 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  327.10 -   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  327.11 --  bzero (s, n);
  327.12 -+  memset (s, 0, n);
  327.13 - }
  327.14 - 
  327.15 - 
  327.16 -@@ -437,7 +437,7 @@
  327.17 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  327.18 -   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  327.19 -   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  327.20 --  bcopy (src, dest, n);
  327.21 -+  memmove (dest, src, n);
  327.22 - }
  327.23 - 
  327.24 - 
  327.25 -@@ -447,7 +447,7 @@
  327.26 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  327.27 -   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  327.28 -   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  327.29 --  return bcmp (s1, s2, n);
  327.30 -+  return n == 0 ? 0 : memcmp (s1, s2, n);
  327.31 - }
  327.32 - 
  327.33 - 
  327.34 -@@ -456,7 +456,7 @@
  327.35 -   size_t n = strlen (s);
  327.36 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  327.37 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  327.38 --  return index (s, c);
  327.39 -+  return strchr (s, c);
  327.40 - }
  327.41 - 
  327.42 - 
  327.43 -@@ -465,7 +465,7 @@
  327.44 -   size_t n = strlen (s);
  327.45 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  327.46 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  327.47 --  return rindex (s, c);
  327.48 -+  return strrchr (s, c);
  327.49 - }
  327.50 - 
  327.51 - /* XXX:  stpcpy, memccpy */
   328.1 --- a/patches/gcc/4.2.3/306-libstdc++-namespace.patch	Mon Jul 28 21:08:01 2008 +0000
   328.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   328.3 @@ -1,36 +0,0 @@
   328.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
   328.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
   328.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:35:40.000000000 +0200
   328.7 -@@ -32,7 +32,8 @@
   328.8 - //
   328.9 - 
  328.10 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  328.11 --
  328.12 -+namespace std
  328.13 -+{
  328.14 - #ifdef __UCLIBC_MJN3_ONLY__
  328.15 - #warning fix prototypes for *textdomain funcs
  328.16 - #endif
  328.17 -@@ -115,3 +116,4 @@
  328.18 - 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  328.19 - 	 }
  328.20 -      }
  328.21 -+}
  328.22 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
  328.23 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
  328.24 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:35:40.000000000 +0200
  328.25 -@@ -33,7 +33,8 @@
  328.26 - //
  328.27 - 
  328.28 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  328.29 --
  328.30 -+namespace std
  328.31 -+{
  328.32 -   template<typename _CharT>
  328.33 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
  328.34 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  328.35 -@@ -74,3 +75,4 @@
  328.36 -       delete _M_data; 
  328.37 -       _S_destroy_c_locale(_M_c_locale_timepunct); 
  328.38 -     }
  328.39 -+}
   329.1 --- a/patches/gcc/4.2.3/402-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:08:01 2008 +0000
   329.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   329.3 @@ -1,12 +0,0 @@
   329.4 -diff -durN gcc-4.2.1.orig/gcc/Makefile.in gcc-4.2.1/gcc/Makefile.in
   329.5 ---- gcc-4.2.1.orig/gcc/Makefile.in	2007-05-31 17:37:38.000000000 +0200
   329.6 -+++ gcc-4.2.1/gcc/Makefile.in	2007-08-03 20:36:14.000000000 +0200
   329.7 -@@ -2660,7 +2660,7 @@
   329.8 - # FIXME: writing proper dependencies for this is a *LOT* of work.
   329.9 - libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
  329.10 -   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  329.11 --  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  329.12 -+  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  329.13 - 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  329.14 - 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  329.15 - 	  -DLOCALEDIR=\"$(localedir)\" \
   330.1 --- a/patches/gcc/4.2.3/800-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
   330.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   330.3 @@ -1,64 +0,0 @@
   330.4 -diff -durN gcc-4.2.1.orig/gcc/config/arm/linux-elf.h gcc-4.2.1/gcc/config/arm/linux-elf.h
   330.5 ---- gcc-4.2.1.orig/gcc/config/arm/linux-elf.h	2006-02-17 00:29:10.000000000 +0100
   330.6 -+++ gcc-4.2.1/gcc/config/arm/linux-elf.h	2007-08-03 20:36:43.000000000 +0200
   330.7 -@@ -28,19 +28,33 @@
   330.8 - #undef  TARGET_VERSION
   330.9 - #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  330.10 - 
  330.11 -+/*
  330.12 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  330.13 -+ * (big endian) configurations.
  330.14 -+ */
  330.15 -+#if TARGET_BIG_ENDIAN_DEFAULT
  330.16 -+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  330.17 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
  330.18 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
  330.19 -+#else
  330.20 -+#define TARGET_ENDIAN_DEFAULT 0
  330.21 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
  330.22 -+#define TARGET_LINKER_EMULATION "armelf_linux"
  330.23 -+#endif
  330.24 -+
  330.25 - #undef  TARGET_DEFAULT_FLOAT_ABI
  330.26 - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  330.27 - 
  330.28 - #undef  TARGET_DEFAULT
  330.29 --#define TARGET_DEFAULT (0)
  330.30 -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  330.31 - 
  330.32 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  330.33 - 
  330.34 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  330.35 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  330.36 - 
  330.37 - #undef  MULTILIB_DEFAULTS
  330.38 - #define MULTILIB_DEFAULTS \
  330.39 --	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  330.40 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  330.41 - 
  330.42 - /* Now we define the strings used to build the spec file.  */
  330.43 - #undef  LIB_SPEC
  330.44 -@@ -61,7 +75,7 @@
  330.45 -    %{rdynamic:-export-dynamic} \
  330.46 -    %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
  330.47 -    -X \
  330.48 --   %{mbig-endian:-EB}" \
  330.49 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  330.50 -    SUBTARGET_EXTRA_LINK_SPEC
  330.51 - 
  330.52 - #undef  LINK_SPEC
  330.53 -diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
  330.54 ---- gcc-4.2.1.orig/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
  330.55 -+++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:36:43.000000000 +0200
  330.56 -@@ -705,6 +705,11 @@
  330.57 - 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  330.58 - 	tmake_file="${tmake_file} t-linux arm/t-arm"
  330.59 - 	case ${target} in
  330.60 -+	arm*b-*)
  330.61 -+		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  330.62 -+		;;
  330.63 -+	esac
  330.64 -+	case ${target} in
  330.65 - 	arm*-*-linux-*eabi)
  330.66 - 	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
  330.67 - 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
   331.1 --- a/patches/gcc/4.2.3/801-softfloat-fix.patch	Mon Jul 28 21:08:01 2008 +0000
   331.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   331.3 @@ -1,58 +0,0 @@
   331.4 -This patch (C) 2007 Yann E. MORIN
   331.5 -Licensed under GPL v2.
   331.6 -
   331.7 -First hunk of this patch solves compiling uClibc:
   331.8 -
   331.9 -make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  331.10 -  LD libuClibc-0.9.29.so
  331.11 -libc/libc_so.a(difftime.os): In function `difftime':
  331.12 -difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  331.13 -difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  331.14 -libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  331.15 -_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  331.16 -_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  331.17 -_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  331.18 -_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  331.19 -_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  331.20 -_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  331.21 -_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  331.22 -libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  331.23 -__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  331.24 -libc/libc_so.a(strtof.os): In function `strtof':
  331.25 -strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  331.26 -/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  331.27 -In function `__fixunsdfsi':
  331.28 -libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  331.29 -make[2]: *** [lib/libc.so] Error 1
  331.30 -make[1]: *** [lib/libc.so.0] Error 2
  331.31 -make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  331.32 -make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  331.33 -Error 2
  331.34 -
  331.35 -The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  331.36 -
  331.37 -
  331.38 -diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
  331.39 ---- gcc-4.2.0.orig/gcc/config.gcc	2007-07-15 11:24:18.000000000 +0200
  331.40 -+++ gcc-4.2.0/gcc/config.gcc	2007-07-15 11:26:02.000000000 +0200
  331.41 -@@ -721,7 +721,7 @@
  331.42 - 	    default_use_cxa_atexit=yes
  331.43 - 	    ;;
  331.44 - 	*)
  331.45 --	    tmake_file="$tmake_file arm/t-linux"
  331.46 -+	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  331.47 - 	    ;;
  331.48 - 	esac
  331.49 - 	tm_file="$tm_file arm/aout.h arm/arm.h"
  331.50 -diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
  331.51 ---- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h	2007-07-15 11:24:18.000000000 +0200
  331.52 -+++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2007-07-15 11:26:02.000000000 +0200
  331.53 -@@ -63,7 +63,7 @@
  331.54 -    %{shared:-lc} \
  331.55 -    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  331.56 - 
  331.57 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  331.58 -+#define LIBGCC_SPEC "-lgcc"
  331.59 - 
  331.60 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  331.61 - 
   332.1 --- a/patches/gcc/4.2.3/904-flatten-switch-stmt-00.patch	Mon Jul 28 21:08:01 2008 +0000
   332.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   332.3 @@ -1,24 +0,0 @@
   332.4 -diff -durN gcc-4.2.1.orig/gcc/stmt.c gcc-4.2.1/gcc/stmt.c
   332.5 ---- gcc-4.2.1.orig/gcc/stmt.c	2007-07-19 05:25:32.000000000 +0200
   332.6 -+++ gcc-4.2.1/gcc/stmt.c	2007-08-03 20:37:19.000000000 +0200
   332.7 -@@ -2512,7 +2512,11 @@
   332.8 - 	  use_cost_table
   332.9 - 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  332.10 - 	       && estimate_case_costs (case_list));
  332.11 --	  balance_case_nodes (&case_list, NULL);
  332.12 -+	  /* When optimizing for size, we want a straight list to avoid
  332.13 -+	     jumps as much as possible. This basically creates an if-else
  332.14 -+	     chain.  */
  332.15 -+	  if (!optimize_size)
  332.16 -+	    balance_case_nodes (&case_list, NULL);
  332.17 - 	  emit_case_nodes (index, case_list, default_label, index_type);
  332.18 - 	  emit_jump (default_label);
  332.19 - 	}
  332.20 -@@ -3070,6 +3074,7 @@
  332.21 - 	    {
  332.22 - 	      if (!node_has_low_bound (node, index_type))
  332.23 - 		{
  332.24 -+		  if (!optimize_size) /* don't jl to the .default_label. */
  332.25 - 		  emit_cmp_and_jump_insns (index,
  332.26 - 					   convert_modes
  332.27 - 					   (mode, imode,
   333.1 --- a/patches/gcc/4.2.3/920-soft-float.patch	Mon Jul 28 21:08:01 2008 +0000
   333.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   333.3 @@ -1,21 +0,0 @@
   333.4 -diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
   333.5 ---- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c	2007-03-05 11:54:00.000000000 -0500
   333.6 -+++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c	2008-01-31 17:51:24.000000000 -0500
   333.7 -@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
   333.8 -    but GCC currently generates poor code when a union is used to turn
   333.9 -    a long double into a pair of doubles.  */
  333.10 - 
  333.11 -+#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  333.12 -+
  333.13 - long double __gcc_qadd (double, double, double, double);
  333.14 - long double __gcc_qsub (double, double, double, double);
  333.15 - long double __gcc_qmul (double, double, double, double);
  333.16 -@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
  333.17 -   return z.ldval;
  333.18 - }
  333.19 - 
  333.20 --#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  333.21 --
  333.22 - long double __gcc_qneg (double, double);
  333.23 - int __gcc_qeq (double, double, double, double);
  333.24 - int __gcc_qne (double, double, double, double);
   334.1 --- a/patches/gcc/4.2.3/930-eabi_fixes.patch	Mon Jul 28 21:08:01 2008 +0000
   334.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   334.3 @@ -1,13 +0,0 @@
   334.4 -diff -durN gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h gcc-4.2.3/gcc/config/arm/linux-eabi.h
   334.5 ---- gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h	2007-09-01 17:28:30.000000000 +0200
   334.6 -+++ gcc-4.2.3/gcc/config/arm/linux-eabi.h	2008-05-25 23:47:36.000000000 +0200
   334.7 -@@ -47,7 +47,8 @@
   334.8 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
   334.9 - 
  334.10 - #undef SUBTARGET_EXTRA_LINK_SPEC
  334.11 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
  334.12 -+#define SUBTARGET_EXTRA_LINK_SPEC	\
  334.13 -+	" %{mlittle-endian:-m armelf_linux_eabi} %{mbig-endian:-m armelfb_linux_eabi}"
  334.14 - 
  334.15 - /* Use ld-linux.so.3 so that it will be possible to run "classic"
  334.16 -    GNU/Linux binaries on an EABI system.  */
   335.1 --- a/patches/gcc/4.2.3/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
   335.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   335.3 @@ -1,17 +0,0 @@
   335.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   335.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   335.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   335.7 - /* Do code reading to identify a signal frame, and set the frame
   335.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
   335.9 - 
  335.10 -+/* Don't use this if inhibit_libc is set
  335.11 -+   The build for this target will fail trying to include missing headers */
  335.12 -+#ifndef inhibit_libc
  335.13 - #include <signal.h>
  335.14 - #include <sys/ucontext.h>
  335.15 - 
  335.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  335.17 -   fs->retaddr_column = 64;
  335.18 -   return _URC_NO_REASON;
  335.19 - }
  335.20 -+#endif /* inhibit_libc */
   336.1 --- a/patches/gcc/4.2.3/950-fortran-signed-TImode.patch	Mon Jul 28 21:08:01 2008 +0000
   336.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   336.3 @@ -1,43 +0,0 @@
   336.4 -Fix building gfortran for ARM.
   336.5 -http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01010.html
   336.6 -----
   336.7 -
   336.8 -The patch below fixes a crash building libgfortran on arm-linux-gnueabi.
   336.9 -
  336.10 -This target doesn't really have a 128-bit integer type, however it does use 
  336.11 -TImode to represent the return value of certain special ABI defined library 
  336.12 -functions. This results in type_for_size(TImode) being called.
  336.13 -
  336.14 -Because TImode deosn't correspond to any gfortran integer kind 
  336.15 -gfc_type_for_size returns NULL and we segfault shortly after.
  336.16 -
  336.17 -The patch below fixes this by making gfc_type_for_size handle TImode in the 
  336.18 -same way as the C frontend.
  336.19 -
  336.20 -Tested on x86_64-linux and arm-linux-gnueabi.
  336.21 -Applied to trunk.
  336.22 -
  336.23 -Paul
  336.24 -
  336.25 -2007-05-15  Paul Brook  <paul@codesourcery.com>
  336.26 -
  336.27 -    gcc/fortran/
  336.28 -    * trans-types.c (gfc_type_for_size): Handle signed TImode.
  336.29 -
  336.30 -diff -durN gcc-4.2.3.old/gcc/fortran/trans-types.c gcc-4.2.3/gcc/fortran/trans-types.c
  336.31 ---- gcc-4.2.3.old/gcc/fortran/trans-types.c	2007-08-31 10:27:50.000000000 +0200
  336.32 -+++ gcc-4.2.3/gcc/fortran/trans-types.c	2008-07-17 09:54:20.000000000 +0200
  336.33 -@@ -1799,6 +1799,13 @@
  336.34 - 	  if (type && bits == TYPE_PRECISION (type))
  336.35 - 	    return type;
  336.36 - 	}
  336.37 -+
  336.38 -+	/* Handle TImode as a special case because it is used by some backends
  336.39 -+	   (eg. ARM) even though it is not available for normal use.  */
  336.40 -+#if HOST_BITS_PER_WIDE_INT >= 64
  336.41 -+	if (bits == TYPE_PRECISION (intTI_type_node))
  336.42 -+	  return intTI_type_node;
  336.43 -+#endif
  336.44 -     }
  336.45 -   else
  336.46 -     {
   337.1 --- a/patches/gcc/4.2.4/103-uclibc-conf-noupstream.patch	Mon Jul 28 21:08:01 2008 +0000
   337.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   337.3 @@ -1,12 +0,0 @@
   337.4 -diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
   337.5 ---- gcc-4.2.1.orig/gcc/config.gcc	2007-02-03 06:25:20.000000000 +0100
   337.6 -+++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
   337.7 -@@ -1964,7 +1964,7 @@
   337.8 -         ;;
   337.9 - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  337.10 - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  337.11 --  sh-*-linux* | sh[346lbe]*-*-linux* | \
  337.12 -+  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  337.13 -   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  337.14 -    sh64-*-netbsd* | sh64l*-*-netbsd*)
  337.15 - 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   338.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   338.2 +++ b/patches/gcc/4.2.4/110-uclibc-conf-noupstream.patch	Mon Jul 28 21:32:33 2008 +0000
   338.3 @@ -0,0 +1,12 @@
   338.4 +diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
   338.5 +--- gcc-4.2.1.orig/gcc/config.gcc	2007-02-03 06:25:20.000000000 +0100
   338.6 ++++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
   338.7 +@@ -1964,7 +1964,7 @@
   338.8 +         ;;
   338.9 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  338.10 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  338.11 +-  sh-*-linux* | sh[346lbe]*-*-linux* | \
  338.12 ++  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  338.13 +   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  338.14 +    sh64-*-netbsd* | sh64l*-*-netbsd*)
  338.15 + 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   339.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   339.2 +++ b/patches/gcc/4.2.4/120-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   339.3 @@ -0,0 +1,2806 @@
   339.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 gcc-4.2.1/libstdc++-v3/acinclude.m4
   339.5 +--- gcc-4.2.1.orig/libstdc++-v3/acinclude.m4	2007-06-29 01:02:05.000000000 +0200
   339.6 ++++ gcc-4.2.1/libstdc++-v3/acinclude.m4	2007-08-03 20:30:21.000000000 +0200
   339.7 +@@ -1334,7 +1334,7 @@
   339.8 + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   339.9 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  339.10 +     [use MODEL for target locale package],
  339.11 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  339.12 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  339.13 + 
  339.14 +   # Deal with gettext issues.  Default to not using it (=no) until we detect
  339.15 +   # support for it later.  Let the user turn it off via --e/d, but let that
  339.16 +@@ -1355,6 +1355,9 @@
  339.17 +   # Default to "generic".
  339.18 +   if test $enable_clocale_flag = auto; then
  339.19 +     case ${target_os} in
  339.20 ++      *-uclibc*)
  339.21 ++        enable_clocale_flag=uclibc
  339.22 ++        ;;
  339.23 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  339.24 +         enable_clocale_flag=gnu	
  339.25 +         ;;
  339.26 +@@ -1526,6 +1529,40 @@
  339.27 +       CTIME_CC=config/locale/generic/time_members.cc
  339.28 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  339.29 +       ;;
  339.30 ++    uclibc)
  339.31 ++      AC_MSG_RESULT(uclibc)
  339.32 ++
  339.33 ++      # Declare intention to use gettext, and add support for specific
  339.34 ++      # languages.
  339.35 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  339.36 ++      ALL_LINGUAS="de fr"
  339.37 ++
  339.38 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  339.39 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  339.40 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  339.41 ++        USE_NLS=yes
  339.42 ++      fi
  339.43 ++      # Export the build objects.
  339.44 ++      for ling in $ALL_LINGUAS; do \
  339.45 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  339.46 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  339.47 ++      done
  339.48 ++      AC_SUBST(glibcxx_MOFILES)
  339.49 ++      AC_SUBST(glibcxx_POFILES)
  339.50 ++
  339.51 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  339.52 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  339.53 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  339.54 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  339.55 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  339.56 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  339.57 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  339.58 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  339.59 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  339.60 ++      CTIME_H=config/locale/uclibc/time_members.h
  339.61 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  339.62 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  339.63 ++      ;;
  339.64 +   esac
  339.65 + 
  339.66 +   # This is where the testsuite looks for locale catalogs, using the
  339.67 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
  339.68 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  339.69 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
  339.70 +@@ -0,0 +1,160 @@
  339.71 ++// Wrapper for underlying C-language localization -*- C++ -*-
  339.72 ++
  339.73 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  339.74 ++//
  339.75 ++// This file is part of the GNU ISO C++ Library.  This library is free
  339.76 ++// software; you can redistribute it and/or modify it under the
  339.77 ++// terms of the GNU General Public License as published by the
  339.78 ++// Free Software Foundation; either version 2, or (at your option)
  339.79 ++// any later version.
  339.80 ++
  339.81 ++// This library is distributed in the hope that it will be useful,
  339.82 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  339.83 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  339.84 ++// GNU General Public License for more details.
  339.85 ++
  339.86 ++// You should have received a copy of the GNU General Public License along
  339.87 ++// with this library; see the file COPYING.  If not, write to the Free
  339.88 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  339.89 ++// USA.
  339.90 ++
  339.91 ++// As a special exception, you may use this file as part of a free software
  339.92 ++// library without restriction.  Specifically, if other files instantiate
  339.93 ++// templates or use macros or inline functions from this file, or you compile
  339.94 ++// this file and link it with other files to produce an executable, this
  339.95 ++// file does not by itself cause the resulting executable to be covered by
  339.96 ++// the GNU General Public License.  This exception does not however
  339.97 ++// invalidate any other reasons why the executable file might be covered by
  339.98 ++// the GNU General Public License.
  339.99 ++
 339.100 ++//
 339.101 ++// ISO C++ 14882: 22.8  Standard locale categories.
 339.102 ++//
 339.103 ++
 339.104 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 339.105 ++
 339.106 ++#include <cerrno>  // For errno
 339.107 ++#include <locale>
 339.108 ++#include <stdexcept>
 339.109 ++#include <langinfo.h>
 339.110 ++#include <bits/c++locale_internal.h>
 339.111 ++
 339.112 ++#ifndef __UCLIBC_HAS_XLOCALE__
 339.113 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 339.114 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 339.115 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 339.116 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 339.117 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 339.118 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 339.119 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 339.120 ++#warning should dummy __newlocale check for C|POSIX ?
 339.121 ++#define __newlocale(a, b, c)        NULL
 339.122 ++#define __freelocale(a)             ((void)0)
 339.123 ++#define __duplocale(a)              __c_locale()
 339.124 ++#endif
 339.125 ++
 339.126 ++namespace std 
 339.127 ++{
 339.128 ++  template<>
 339.129 ++    void
 339.130 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 339.131 ++		   const __c_locale& __cloc)
 339.132 ++    {
 339.133 ++      if (!(__err & ios_base::failbit))
 339.134 ++	{
 339.135 ++	  char* __sanity;
 339.136 ++	  errno = 0;
 339.137 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
 339.138 ++          if (__sanity != __s && errno != ERANGE)
 339.139 ++	    __v = __f;
 339.140 ++	  else
 339.141 ++	    __err |= ios_base::failbit;
 339.142 ++	}
 339.143 ++    }
 339.144 ++
 339.145 ++  template<>
 339.146 ++    void
 339.147 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 339.148 ++		   const __c_locale& __cloc)
 339.149 ++    {
 339.150 ++      if (!(__err & ios_base::failbit))
 339.151 ++	{
 339.152 ++	  char* __sanity;
 339.153 ++	  errno = 0;
 339.154 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
 339.155 ++          if (__sanity != __s && errno != ERANGE)
 339.156 ++	    __v = __d;
 339.157 ++	  else
 339.158 ++	    __err |= ios_base::failbit;
 339.159 ++	}
 339.160 ++    }
 339.161 ++
 339.162 ++  template<>
 339.163 ++    void
 339.164 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 339.165 ++		   const __c_locale& __cloc)
 339.166 ++    {
 339.167 ++      if (!(__err & ios_base::failbit))
 339.168 ++	{
 339.169 ++	  char* __sanity;
 339.170 ++	  errno = 0;
 339.171 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 339.172 ++          if (__sanity != __s && errno != ERANGE)
 339.173 ++	    __v = __ld;
 339.174 ++	  else
 339.175 ++	    __err |= ios_base::failbit;
 339.176 ++	}
 339.177 ++    }
 339.178 ++
 339.179 ++  void
 339.180 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 339.181 ++				    __c_locale __old)
 339.182 ++  {
 339.183 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 339.184 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.185 ++    if (!__cloc)
 339.186 ++      {
 339.187 ++	// This named locale is not supported by the underlying OS.
 339.188 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 339.189 ++			      "name not valid"));
 339.190 ++      }
 339.191 ++#endif
 339.192 ++  }
 339.193 ++  
 339.194 ++  void
 339.195 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 339.196 ++  {
 339.197 ++    if (_S_get_c_locale() != __cloc)
 339.198 ++      __freelocale(__cloc); 
 339.199 ++  }
 339.200 ++
 339.201 ++  __c_locale
 339.202 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 339.203 ++  { return __duplocale(__cloc); }
 339.204 ++} // namespace std
 339.205 ++
 339.206 ++namespace __gnu_cxx
 339.207 ++{
 339.208 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 339.209 ++    {
 339.210 ++      "LC_CTYPE", 
 339.211 ++      "LC_NUMERIC",
 339.212 ++      "LC_TIME", 
 339.213 ++      "LC_COLLATE", 
 339.214 ++      "LC_MONETARY",
 339.215 ++      "LC_MESSAGES", 
 339.216 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 339.217 ++      "LC_PAPER", 
 339.218 ++      "LC_NAME", 
 339.219 ++      "LC_ADDRESS",
 339.220 ++      "LC_TELEPHONE", 
 339.221 ++      "LC_MEASUREMENT", 
 339.222 ++      "LC_IDENTIFICATION" 
 339.223 ++#endif
 339.224 ++    };
 339.225 ++}
 339.226 ++
 339.227 ++namespace std
 339.228 ++{
 339.229 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 339.230 ++}  // namespace std
 339.231 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
 339.232 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 339.233 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
 339.234 +@@ -0,0 +1,117 @@
 339.235 ++// Wrapper for underlying C-language localization -*- C++ -*-
 339.236 ++
 339.237 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 339.238 ++//
 339.239 ++// This file is part of the GNU ISO C++ Library.  This library is free
 339.240 ++// software; you can redistribute it and/or modify it under the
 339.241 ++// terms of the GNU General Public License as published by the
 339.242 ++// Free Software Foundation; either version 2, or (at your option)
 339.243 ++// any later version.
 339.244 ++
 339.245 ++// This library is distributed in the hope that it will be useful,
 339.246 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 339.247 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 339.248 ++// GNU General Public License for more details.
 339.249 ++
 339.250 ++// You should have received a copy of the GNU General Public License along
 339.251 ++// with this library; see the file COPYING.  If not, write to the Free
 339.252 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 339.253 ++// USA.
 339.254 ++
 339.255 ++// As a special exception, you may use this file as part of a free software
 339.256 ++// library without restriction.  Specifically, if other files instantiate
 339.257 ++// templates or use macros or inline functions from this file, or you compile
 339.258 ++// this file and link it with other files to produce an executable, this
 339.259 ++// file does not by itself cause the resulting executable to be covered by
 339.260 ++// the GNU General Public License.  This exception does not however
 339.261 ++// invalidate any other reasons why the executable file might be covered by
 339.262 ++// the GNU General Public License.
 339.263 ++
 339.264 ++//
 339.265 ++// ISO C++ 14882: 22.8  Standard locale categories.
 339.266 ++//
 339.267 ++
 339.268 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 339.269 ++
 339.270 ++#ifndef _C_LOCALE_H
 339.271 ++#define _C_LOCALE_H 1
 339.272 ++
 339.273 ++#pragma GCC system_header
 339.274 ++
 339.275 ++#include <cstring>              // get std::strlen
 339.276 ++#include <cstdio>               // get std::snprintf or std::sprintf
 339.277 ++#include <clocale>
 339.278 ++#include <langinfo.h>		// For codecvt
 339.279 ++#ifdef __UCLIBC_MJN3_ONLY__
 339.280 ++#warning fix this
 339.281 ++#endif
 339.282 ++#ifdef __UCLIBC_HAS_LOCALE__
 339.283 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 339.284 ++#endif
 339.285 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 339.286 ++#include <libintl.h> 		// For messages
 339.287 ++#endif
 339.288 ++
 339.289 ++#ifdef __UCLIBC_MJN3_ONLY__
 339.290 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 339.291 ++#endif
 339.292 ++#define _GLIBCXX_C_LOCALE_GNU 1
 339.293 ++
 339.294 ++#ifdef __UCLIBC_MJN3_ONLY__
 339.295 ++#warning fix categories
 339.296 ++#endif
 339.297 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 339.298 ++#define _GLIBCXX_NUM_CATEGORIES 0
 339.299 ++ 
 339.300 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.301 ++namespace __gnu_cxx
 339.302 ++{
 339.303 ++  extern "C" __typeof(uselocale) __uselocale;
 339.304 ++}
 339.305 ++#endif
 339.306 ++
 339.307 ++namespace std
 339.308 ++{
 339.309 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.310 ++  typedef __locale_t		__c_locale;
 339.311 ++#else
 339.312 ++  typedef int*			__c_locale;
 339.313 ++#endif
 339.314 ++
 339.315 ++  // Convert numeric value of type _Tv to string and return length of
 339.316 ++  // string.  If snprintf is available use it, otherwise fall back to
 339.317 ++  // the unsafe sprintf which, in general, can be dangerous and should
 339.318 ++  // be avoided.
 339.319 ++  template<typename _Tv>
 339.320 ++    int
 339.321 ++    __convert_from_v(char* __out, 
 339.322 ++		     const int __size __attribute__ ((__unused__)),
 339.323 ++		     const char* __fmt,
 339.324 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 339.325 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 339.326 ++    {
 339.327 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 339.328 ++#else
 339.329 ++		     _Tv __v, const __c_locale&, int __prec)
 339.330 ++    {
 339.331 ++# ifdef __UCLIBC_HAS_LOCALE__
 339.332 ++      char* __old = std::setlocale(LC_ALL, NULL);
 339.333 ++      char* __sav = new char[std::strlen(__old) + 1];
 339.334 ++      std::strcpy(__sav, __old);
 339.335 ++      std::setlocale(LC_ALL, "C");
 339.336 ++# endif
 339.337 ++#endif
 339.338 ++
 339.339 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 339.340 ++
 339.341 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 339.342 ++      __gnu_cxx::__uselocale(__old);
 339.343 ++#elif defined __UCLIBC_HAS_LOCALE__
 339.344 ++      std::setlocale(LC_ALL, __sav);
 339.345 ++      delete [] __sav;
 339.346 ++#endif
 339.347 ++      return __ret;
 339.348 ++    }
 339.349 ++}
 339.350 ++
 339.351 ++#endif
 339.352 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
 339.353 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
 339.354 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
 339.355 +@@ -0,0 +1,63 @@
 339.356 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
 339.357 ++
 339.358 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
 339.359 ++//
 339.360 ++// This file is part of the GNU ISO C++ Library.  This library is free
 339.361 ++// software; you can redistribute it and/or modify it under the
 339.362 ++// terms of the GNU General Public License as published by the
 339.363 ++// Free Software Foundation; either version 2, or (at your option)
 339.364 ++// any later version.
 339.365 ++
 339.366 ++// This library is distributed in the hope that it will be useful,
 339.367 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 339.368 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 339.369 ++// GNU General Public License for more details.
 339.370 ++
 339.371 ++// You should have received a copy of the GNU General Public License along
 339.372 ++// with this library; see the file COPYING.  If not, write to the Free
 339.373 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 339.374 ++// USA.
 339.375 ++
 339.376 ++// As a special exception, you may use this file as part of a free software
 339.377 ++// library without restriction.  Specifically, if other files instantiate
 339.378 ++// templates or use macros or inline functions from this file, or you compile
 339.379 ++// this file and link it with other files to produce an executable, this
 339.380 ++// file does not by itself cause the resulting executable to be covered by
 339.381 ++// the GNU General Public License.  This exception does not however
 339.382 ++// invalidate any other reasons why the executable file might be covered by
 339.383 ++// the GNU General Public License.
 339.384 ++
 339.385 ++// Written by Jakub Jelinek <jakub@redhat.com>
 339.386 ++
 339.387 ++#include <bits/c++config.h>
 339.388 ++#include <clocale>
 339.389 ++
 339.390 ++#ifdef __UCLIBC_MJN3_ONLY__
 339.391 ++#warning clean this up
 339.392 ++#endif
 339.393 ++
 339.394 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.395 ++                                                  
 339.396 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 339.397 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 339.398 ++extern "C" __typeof(strftime_l) __strftime_l;
 339.399 ++extern "C" __typeof(strtod_l) __strtod_l;
 339.400 ++extern "C" __typeof(strtof_l) __strtof_l;
 339.401 ++extern "C" __typeof(strtold_l) __strtold_l;
 339.402 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 339.403 ++extern "C" __typeof(newlocale) __newlocale;
 339.404 ++extern "C" __typeof(freelocale) __freelocale;
 339.405 ++extern "C" __typeof(duplocale) __duplocale;
 339.406 ++extern "C" __typeof(uselocale) __uselocale;
 339.407 ++
 339.408 ++#ifdef _GLIBCXX_USE_WCHAR_T
 339.409 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 339.410 ++extern "C" __typeof(towlower_l) __towlower_l;
 339.411 ++extern "C" __typeof(towupper_l) __towupper_l;
 339.412 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 339.413 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 339.414 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 339.415 ++extern "C" __typeof(wctype_l) __wctype_l;
 339.416 ++#endif 
 339.417 ++
 339.418 ++#endif // GLIBC 2.3 and later
 339.419 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 339.420 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 339.421 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-08-03 20:30:21.000000000 +0200
 339.422 +@@ -0,0 +1,306 @@
 339.423 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 339.424 ++
 339.425 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 339.426 ++//
 339.427 ++// This file is part of the GNU ISO C++ Library.  This library is free
 339.428 ++// software; you can redistribute it and/or modify it under the
 339.429 ++// terms of the GNU General Public License as published by the
 339.430 ++// Free Software Foundation; either version 2, or (at your option)
 339.431 ++// any later version.
 339.432 ++
 339.433 ++// This library is distributed in the hope that it will be useful,
 339.434 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 339.435 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 339.436 ++// GNU General Public License for more details.
 339.437 ++
 339.438 ++// You should have received a copy of the GNU General Public License along
 339.439 ++// with this library; see the file COPYING.  If not, write to the Free
 339.440 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 339.441 ++// USA.
 339.442 ++
 339.443 ++// As a special exception, you may use this file as part of a free software
 339.444 ++// library without restriction.  Specifically, if other files instantiate
 339.445 ++// templates or use macros or inline functions from this file, or you compile
 339.446 ++// this file and link it with other files to produce an executable, this
 339.447 ++// file does not by itself cause the resulting executable to be covered by
 339.448 ++// the GNU General Public License.  This exception does not however
 339.449 ++// invalidate any other reasons why the executable file might be covered by
 339.450 ++// the GNU General Public License.
 339.451 ++
 339.452 ++//
 339.453 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 339.454 ++//
 339.455 ++
 339.456 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 339.457 ++
 339.458 ++#include <locale>
 339.459 ++#include <bits/c++locale_internal.h>
 339.460 ++
 339.461 ++namespace std
 339.462 ++{
 339.463 ++  // Specializations.
 339.464 ++#ifdef _GLIBCXX_USE_WCHAR_T
 339.465 ++  codecvt_base::result
 339.466 ++  codecvt<wchar_t, char, mbstate_t>::
 339.467 ++  do_out(state_type& __state, const intern_type* __from, 
 339.468 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 339.469 ++	 extern_type* __to, extern_type* __to_end,
 339.470 ++	 extern_type*& __to_next) const
 339.471 ++  {
 339.472 ++    result __ret = ok;
 339.473 ++    state_type __tmp_state(__state);
 339.474 ++
 339.475 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.476 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 339.477 ++#endif
 339.478 ++
 339.479 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 339.480 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 339.481 ++    // NB: wcsnrtombs is a GNU extension
 339.482 ++    for (__from_next = __from, __to_next = __to;
 339.483 ++	 __from_next < __from_end && __to_next < __to_end
 339.484 ++	 && __ret == ok;)
 339.485 ++      {
 339.486 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 339.487 ++						      __from_end - __from_next);
 339.488 ++	if (!__from_chunk_end)
 339.489 ++	  __from_chunk_end = __from_end;
 339.490 ++
 339.491 ++	__from = __from_next;
 339.492 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 339.493 ++					 __from_chunk_end - __from_next,
 339.494 ++					 __to_end - __to_next, &__state);
 339.495 ++	if (__conv == static_cast<size_t>(-1))
 339.496 ++	  {
 339.497 ++	    // In case of error, in order to stop at the exact place we
 339.498 ++	    // have to start again from the beginning with a series of
 339.499 ++	    // wcrtomb.
 339.500 ++	    for (; __from < __from_next; ++__from)
 339.501 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 339.502 ++	    __state = __tmp_state;
 339.503 ++	    __ret = error;
 339.504 ++	  }
 339.505 ++	else if (__from_next && __from_next < __from_chunk_end)
 339.506 ++	  {
 339.507 ++	    __to_next += __conv;
 339.508 ++	    __ret = partial;
 339.509 ++	  }
 339.510 ++	else
 339.511 ++	  {
 339.512 ++	    __from_next = __from_chunk_end;
 339.513 ++	    __to_next += __conv;
 339.514 ++	  }
 339.515 ++
 339.516 ++	if (__from_next < __from_end && __ret == ok)
 339.517 ++	  {
 339.518 ++	    extern_type __buf[MB_LEN_MAX];
 339.519 ++	    __tmp_state = __state;
 339.520 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 339.521 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 339.522 ++	      __ret = partial;
 339.523 ++	    else
 339.524 ++	      {
 339.525 ++		memcpy(__to_next, __buf, __conv);
 339.526 ++		__state = __tmp_state;
 339.527 ++		__to_next += __conv;
 339.528 ++		++__from_next;
 339.529 ++	      }
 339.530 ++	  }
 339.531 ++      }
 339.532 ++
 339.533 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.534 ++    __uselocale(__old);
 339.535 ++#endif
 339.536 ++
 339.537 ++    return __ret; 
 339.538 ++  }
 339.539 ++  
 339.540 ++  codecvt_base::result
 339.541 ++  codecvt<wchar_t, char, mbstate_t>::
 339.542 ++  do_in(state_type& __state, const extern_type* __from, 
 339.543 ++	const extern_type* __from_end, const extern_type*& __from_next,
 339.544 ++	intern_type* __to, intern_type* __to_end,
 339.545 ++	intern_type*& __to_next) const
 339.546 ++  {
 339.547 ++    result __ret = ok;
 339.548 ++    state_type __tmp_state(__state);
 339.549 ++
 339.550 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.551 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 339.552 ++#endif
 339.553 ++
 339.554 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 339.555 ++    // in case we store a L'\0' and then continue, in a loop.
 339.556 ++    // NB: mbsnrtowcs is a GNU extension
 339.557 ++    for (__from_next = __from, __to_next = __to;
 339.558 ++	 __from_next < __from_end && __to_next < __to_end
 339.559 ++	 && __ret == ok;)
 339.560 ++      {
 339.561 ++	const extern_type* __from_chunk_end;
 339.562 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 339.563 ++								  __from_end
 339.564 ++								  - __from_next));
 339.565 ++	if (!__from_chunk_end)
 339.566 ++	  __from_chunk_end = __from_end;
 339.567 ++
 339.568 ++	__from = __from_next;
 339.569 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 339.570 ++				   __from_chunk_end - __from_next,
 339.571 ++				   __to_end - __to_next, &__state);
 339.572 ++	if (__conv == static_cast<size_t>(-1))
 339.573 ++	  {
 339.574 ++	    // In case of error, in order to stop at the exact place we
 339.575 ++	    // have to start again from the beginning with a series of
 339.576 ++	    // mbrtowc.
 339.577 ++	    for (;; ++__to_next, __from += __conv)
 339.578 ++	      {
 339.579 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 339.580 ++				 &__tmp_state);
 339.581 ++		if (__conv == static_cast<size_t>(-1)
 339.582 ++		    || __conv == static_cast<size_t>(-2))
 339.583 ++		  break;
 339.584 ++	      }
 339.585 ++	    __from_next = __from;
 339.586 ++	    __state = __tmp_state;	    
 339.587 ++	    __ret = error;
 339.588 ++	  }
 339.589 ++	else if (__from_next && __from_next < __from_chunk_end)
 339.590 ++	  {
 339.591 ++	    // It is unclear what to return in this case (see DR 382). 
 339.592 ++	    __to_next += __conv;
 339.593 ++	    __ret = partial;
 339.594 ++	  }
 339.595 ++	else
 339.596 ++	  {
 339.597 ++	    __from_next = __from_chunk_end;
 339.598 ++	    __to_next += __conv;
 339.599 ++	  }
 339.600 ++
 339.601 ++	if (__from_next < __from_end && __ret == ok)
 339.602 ++	  {
 339.603 ++	    if (__to_next < __to_end)
 339.604 ++	      {
 339.605 ++		// XXX Probably wrong for stateful encodings
 339.606 ++		__tmp_state = __state;		
 339.607 ++		++__from_next;
 339.608 ++		*__to_next++ = L'\0';
 339.609 ++	      }
 339.610 ++	    else
 339.611 ++	      __ret = partial;
 339.612 ++	  }
 339.613 ++      }
 339.614 ++
 339.615 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.616 ++    __uselocale(__old);
 339.617 ++#endif
 339.618 ++
 339.619 ++    return __ret; 
 339.620 ++  }
 339.621 ++
 339.622 ++  int 
 339.623 ++  codecvt<wchar_t, char, mbstate_t>::
 339.624 ++  do_encoding() const throw()
 339.625 ++  {
 339.626 ++    // XXX This implementation assumes that the encoding is
 339.627 ++    // stateless and is either single-byte or variable-width.
 339.628 ++    int __ret = 0;
 339.629 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.630 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 339.631 ++#endif
 339.632 ++    if (MB_CUR_MAX == 1)
 339.633 ++      __ret = 1;
 339.634 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.635 ++    __uselocale(__old);
 339.636 ++#endif
 339.637 ++    return __ret;
 339.638 ++  }  
 339.639 ++
 339.640 ++  int 
 339.641 ++  codecvt<wchar_t, char, mbstate_t>::
 339.642 ++  do_max_length() const throw()
 339.643 ++  {
 339.644 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.645 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 339.646 ++#endif
 339.647 ++    // XXX Probably wrong for stateful encodings.
 339.648 ++    int __ret = MB_CUR_MAX;
 339.649 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.650 ++    __uselocale(__old);
 339.651 ++#endif
 339.652 ++    return __ret;
 339.653 ++  }
 339.654 ++  
 339.655 ++  int 
 339.656 ++  codecvt<wchar_t, char, mbstate_t>::
 339.657 ++  do_length(state_type& __state, const extern_type* __from,
 339.658 ++	    const extern_type* __end, size_t __max) const
 339.659 ++  {
 339.660 ++    int __ret = 0;
 339.661 ++    state_type __tmp_state(__state);
 339.662 ++
 339.663 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.664 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 339.665 ++#endif
 339.666 ++
 339.667 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 339.668 ++    // in case we advance past it and then continue, in a loop.
 339.669 ++    // NB: mbsnrtowcs is a GNU extension
 339.670 ++  
 339.671 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 339.672 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 339.673 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 339.674 ++							   * __max));
 339.675 ++    while (__from < __end && __max)
 339.676 ++      {
 339.677 ++	const extern_type* __from_chunk_end;
 339.678 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 339.679 ++								  __end
 339.680 ++								  - __from));
 339.681 ++	if (!__from_chunk_end)
 339.682 ++	  __from_chunk_end = __end;
 339.683 ++
 339.684 ++	const extern_type* __tmp_from = __from;
 339.685 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 339.686 ++				   __from_chunk_end - __from,
 339.687 ++				   __max, &__state);
 339.688 ++	if (__conv == static_cast<size_t>(-1))
 339.689 ++	  {
 339.690 ++	    // In case of error, in order to stop at the exact place we
 339.691 ++	    // have to start again from the beginning with a series of
 339.692 ++	    // mbrtowc.
 339.693 ++	    for (__from = __tmp_from;; __from += __conv)
 339.694 ++	      {
 339.695 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 339.696 ++				 &__tmp_state);
 339.697 ++		if (__conv == static_cast<size_t>(-1)
 339.698 ++		    || __conv == static_cast<size_t>(-2))
 339.699 ++		  break;
 339.700 ++	      }
 339.701 ++	    __state = __tmp_state;
 339.702 ++	    __ret += __from - __tmp_from;
 339.703 ++	    break;
 339.704 ++	  }
 339.705 ++	if (!__from)
 339.706 ++	  __from = __from_chunk_end;
 339.707 ++	
 339.708 ++	__ret += __from - __tmp_from;
 339.709 ++	__max -= __conv;
 339.710 ++
 339.711 ++	if (__from < __end && __max)
 339.712 ++	  {
 339.713 ++	    // XXX Probably wrong for stateful encodings
 339.714 ++	    __tmp_state = __state;
 339.715 ++	    ++__from;
 339.716 ++	    ++__ret;
 339.717 ++	    --__max;
 339.718 ++	  }
 339.719 ++      }
 339.720 ++
 339.721 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.722 ++    __uselocale(__old);
 339.723 ++#endif
 339.724 ++
 339.725 ++    return __ret; 
 339.726 ++  }
 339.727 ++#endif
 339.728 ++}
 339.729 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
 339.730 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 339.731 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
 339.732 +@@ -0,0 +1,80 @@
 339.733 ++// std::collate implementation details, GNU version -*- C++ -*-
 339.734 ++
 339.735 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 339.736 ++//
 339.737 ++// This file is part of the GNU ISO C++ Library.  This library is free
 339.738 ++// software; you can redistribute it and/or modify it under the
 339.739 ++// terms of the GNU General Public License as published by the
 339.740 ++// Free Software Foundation; either version 2, or (at your option)
 339.741 ++// any later version.
 339.742 ++
 339.743 ++// This library is distributed in the hope that it will be useful,
 339.744 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 339.745 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 339.746 ++// GNU General Public License for more details.
 339.747 ++
 339.748 ++// You should have received a copy of the GNU General Public License along
 339.749 ++// with this library; see the file COPYING.  If not, write to the Free
 339.750 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 339.751 ++// USA.
 339.752 ++
 339.753 ++// As a special exception, you may use this file as part of a free software
 339.754 ++// library without restriction.  Specifically, if other files instantiate
 339.755 ++// templates or use macros or inline functions from this file, or you compile
 339.756 ++// this file and link it with other files to produce an executable, this
 339.757 ++// file does not by itself cause the resulting executable to be covered by
 339.758 ++// the GNU General Public License.  This exception does not however
 339.759 ++// invalidate any other reasons why the executable file might be covered by
 339.760 ++// the GNU General Public License.
 339.761 ++
 339.762 ++//
 339.763 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 339.764 ++//
 339.765 ++
 339.766 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 339.767 ++
 339.768 ++#include <locale>
 339.769 ++#include <bits/c++locale_internal.h>
 339.770 ++
 339.771 ++#ifndef __UCLIBC_HAS_XLOCALE__
 339.772 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 339.773 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 339.774 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 339.775 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 339.776 ++#endif
 339.777 ++
 339.778 ++namespace std
 339.779 ++{
 339.780 ++  // These are basically extensions to char_traits, and perhaps should
 339.781 ++  // be put there instead of here.
 339.782 ++  template<>
 339.783 ++    int 
 339.784 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 339.785 ++    { 
 339.786 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 339.787 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 339.788 ++    }
 339.789 ++  
 339.790 ++  template<>
 339.791 ++    size_t
 339.792 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 339.793 ++				size_t __n) const 
 339.794 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 339.795 ++
 339.796 ++#ifdef _GLIBCXX_USE_WCHAR_T
 339.797 ++  template<>
 339.798 ++    int 
 339.799 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 339.800 ++				 const wchar_t* __two) const
 339.801 ++    {
 339.802 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 339.803 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 339.804 ++    }
 339.805 ++  
 339.806 ++  template<>
 339.807 ++    size_t
 339.808 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 339.809 ++				   size_t __n) const
 339.810 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 339.811 ++#endif
 339.812 ++}
 339.813 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 339.814 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 339.815 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 339.816 +@@ -0,0 +1,300 @@
 339.817 ++// std::ctype implementation details, GNU version -*- C++ -*-
 339.818 ++
 339.819 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 339.820 ++//
 339.821 ++// This file is part of the GNU ISO C++ Library.  This library is free
 339.822 ++// software; you can redistribute it and/or modify it under the
 339.823 ++// terms of the GNU General Public License as published by the
 339.824 ++// Free Software Foundation; either version 2, or (at your option)
 339.825 ++// any later version.
 339.826 ++
 339.827 ++// This library is distributed in the hope that it will be useful,
 339.828 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 339.829 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 339.830 ++// GNU General Public License for more details.
 339.831 ++
 339.832 ++// You should have received a copy of the GNU General Public License along
 339.833 ++// with this library; see the file COPYING.  If not, write to the Free
 339.834 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 339.835 ++// USA.
 339.836 ++
 339.837 ++// As a special exception, you may use this file as part of a free software
 339.838 ++// library without restriction.  Specifically, if other files instantiate
 339.839 ++// templates or use macros or inline functions from this file, or you compile
 339.840 ++// this file and link it with other files to produce an executable, this
 339.841 ++// file does not by itself cause the resulting executable to be covered by
 339.842 ++// the GNU General Public License.  This exception does not however
 339.843 ++// invalidate any other reasons why the executable file might be covered by
 339.844 ++// the GNU General Public License.
 339.845 ++
 339.846 ++//
 339.847 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 339.848 ++//
 339.849 ++
 339.850 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 339.851 ++
 339.852 ++#define _LIBC
 339.853 ++#include <locale>
 339.854 ++#undef _LIBC
 339.855 ++#include <bits/c++locale_internal.h>
 339.856 ++
 339.857 ++#ifndef __UCLIBC_HAS_XLOCALE__
 339.858 ++#define __wctype_l(S, L)           wctype((S))
 339.859 ++#define __towupper_l(C, L)         towupper((C))
 339.860 ++#define __towlower_l(C, L)         towlower((C))
 339.861 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 339.862 ++#endif
 339.863 ++
 339.864 ++namespace std
 339.865 ++{
 339.866 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 339.867 ++  // various /config/os/* files.
 339.868 ++  template<>
 339.869 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 339.870 ++    : ctype<char>(0, false, __refs) 
 339.871 ++    { 		
 339.872 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 339.873 ++	{
 339.874 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 339.875 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 339.876 ++#ifdef __UCLIBC_HAS_XLOCALE__
 339.877 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 339.878 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 339.879 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 339.880 ++#endif
 339.881 ++	}
 339.882 ++    }
 339.883 ++
 339.884 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 339.885 ++  ctype<wchar_t>::__wmask_type
 339.886 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 339.887 ++  {
 339.888 ++    __wmask_type __ret;
 339.889 ++    switch (__m)
 339.890 ++      {
 339.891 ++      case space:
 339.892 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 339.893 ++	break;
 339.894 ++      case print:
 339.895 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 339.896 ++	break;
 339.897 ++      case cntrl:
 339.898 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 339.899 ++	break;
 339.900 ++      case upper:
 339.901 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 339.902 ++	break;
 339.903 ++      case lower:
 339.904 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 339.905 ++	break;
 339.906 ++      case alpha:
 339.907 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 339.908 ++	break;
 339.909 ++      case digit:
 339.910 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 339.911 ++	break;
 339.912 ++      case punct:
 339.913 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 339.914 ++	break;
 339.915 ++      case xdigit:
 339.916 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 339.917 ++	break;
 339.918 ++      case alnum:
 339.919 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 339.920 ++	break;
 339.921 ++      case graph:
 339.922 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 339.923 ++	break;
 339.924 ++      default:
 339.925 ++	__ret = __wmask_type();
 339.926 ++      }
 339.927 ++    return __ret;
 339.928 ++  }
 339.929 ++  
 339.930 ++  wchar_t
 339.931 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 339.932 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 339.933 ++
 339.934 ++  const wchar_t*
 339.935 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 339.936 ++  {
 339.937 ++    while (__lo < __hi)
 339.938 ++      {
 339.939 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 339.940 ++        ++__lo;
 339.941 ++      }
 339.942 ++    return __hi;
 339.943 ++  }
 339.944 ++  
 339.945 ++  wchar_t
 339.946 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 339.947 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 339.948 ++  
 339.949 ++  const wchar_t*
 339.950 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 339.951 ++  {
 339.952 ++    while (__lo < __hi)
 339.953 ++      {
 339.954 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 339.955 ++        ++__lo;
 339.956 ++      }
 339.957 ++    return __hi;
 339.958 ++  }
 339.959 ++
 339.960 ++  bool
 339.961 ++  ctype<wchar_t>::
 339.962 ++  do_is(mask __m, wchar_t __c) const
 339.963 ++  { 
 339.964 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
 339.965 ++    // library for blank.
 339.966 ++    bool __ret = false;
 339.967 ++    const size_t __bitmasksize = 11; 
 339.968 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 339.969 ++      if (__m & _M_bit[__bitcur]
 339.970 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 339.971 ++	{
 339.972 ++	  __ret = true;
 339.973 ++	  break;
 339.974 ++	}
 339.975 ++    return __ret;    
 339.976 ++  }
 339.977 ++  
 339.978 ++  const wchar_t* 
 339.979 ++  ctype<wchar_t>::
 339.980 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 339.981 ++  {
 339.982 ++    for (; __lo < __hi; ++__vec, ++__lo)
 339.983 ++      {
 339.984 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 339.985 ++	// library for blank.
 339.986 ++	const size_t __bitmasksize = 11; 
 339.987 ++	mask __m = 0;
 339.988 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 339.989 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 339.990 ++	    __m |= _M_bit[__bitcur];
 339.991 ++	*__vec = __m;
 339.992 ++      }
 339.993 ++    return __hi;
 339.994 ++  }
 339.995 ++  
 339.996 ++  const wchar_t* 
 339.997 ++  ctype<wchar_t>::
 339.998 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 339.999 ++  {
339.1000 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
339.1001 ++      ++__lo;
339.1002 ++    return __lo;
339.1003 ++  }
339.1004 ++
339.1005 ++  const wchar_t*
339.1006 ++  ctype<wchar_t>::
339.1007 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
339.1008 ++  {
339.1009 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
339.1010 ++      ++__lo;
339.1011 ++    return __lo;
339.1012 ++  }
339.1013 ++
339.1014 ++  wchar_t
339.1015 ++  ctype<wchar_t>::
339.1016 ++  do_widen(char __c) const
339.1017 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
339.1018 ++
339.1019 ++  const char* 
339.1020 ++  ctype<wchar_t>::
339.1021 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
339.1022 ++  {
339.1023 ++    while (__lo < __hi)
339.1024 ++      {
339.1025 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
339.1026 ++	++__lo;
339.1027 ++	++__dest;
339.1028 ++      }
339.1029 ++    return __hi;
339.1030 ++  }
339.1031 ++
339.1032 ++  char
339.1033 ++  ctype<wchar_t>::
339.1034 ++  do_narrow(wchar_t __wc, char __dfault) const
339.1035 ++  {
339.1036 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
339.1037 ++      return _M_narrow[__wc];
339.1038 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1039 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
339.1040 ++#endif
339.1041 ++    const int __c = wctob(__wc);
339.1042 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1043 ++    __uselocale(__old);
339.1044 ++#endif
339.1045 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
339.1046 ++  }
339.1047 ++
339.1048 ++  const wchar_t*
339.1049 ++  ctype<wchar_t>::
339.1050 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
339.1051 ++	    char* __dest) const
339.1052 ++  {
339.1053 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1054 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
339.1055 ++#endif
339.1056 ++    if (_M_narrow_ok)
339.1057 ++      while (__lo < __hi)
339.1058 ++	{
339.1059 ++	  if (*__lo >= 0 && *__lo < 128)
339.1060 ++	    *__dest = _M_narrow[*__lo];
339.1061 ++	  else
339.1062 ++	    {
339.1063 ++	      const int __c = wctob(*__lo);
339.1064 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
339.1065 ++	    }
339.1066 ++	  ++__lo;
339.1067 ++	  ++__dest;
339.1068 ++	}
339.1069 ++    else
339.1070 ++      while (__lo < __hi)
339.1071 ++	{
339.1072 ++	  const int __c = wctob(*__lo);
339.1073 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
339.1074 ++	  ++__lo;
339.1075 ++	  ++__dest;
339.1076 ++	}
339.1077 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1078 ++    __uselocale(__old);
339.1079 ++#endif
339.1080 ++    return __hi;
339.1081 ++  }
339.1082 ++
339.1083 ++  void
339.1084 ++  ctype<wchar_t>::_M_initialize_ctype()
339.1085 ++  {
339.1086 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1087 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
339.1088 ++#endif
339.1089 ++    wint_t __i;
339.1090 ++    for (__i = 0; __i < 128; ++__i)
339.1091 ++      {
339.1092 ++	const int __c = wctob(__i);
339.1093 ++	if (__c == EOF)
339.1094 ++	  break;
339.1095 ++	else
339.1096 ++	  _M_narrow[__i] = static_cast<char>(__c);
339.1097 ++      }
339.1098 ++    if (__i == 128)
339.1099 ++      _M_narrow_ok = true;
339.1100 ++    else
339.1101 ++      _M_narrow_ok = false;
339.1102 ++    for (size_t __j = 0;
339.1103 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
339.1104 ++      _M_widen[__j] = btowc(__j);
339.1105 ++
339.1106 ++    for (size_t __k = 0; __k <= 11; ++__k)
339.1107 ++      { 
339.1108 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
339.1109 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
339.1110 ++      }
339.1111 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1112 ++    __uselocale(__old);
339.1113 ++#endif
339.1114 ++  }
339.1115 ++#endif //  _GLIBCXX_USE_WCHAR_T
339.1116 ++}
339.1117 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
339.1118 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
339.1119 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
339.1120 +@@ -0,0 +1,100 @@
339.1121 ++// std::messages implementation details, GNU version -*- C++ -*-
339.1122 ++
339.1123 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
339.1124 ++//
339.1125 ++// This file is part of the GNU ISO C++ Library.  This library is free
339.1126 ++// software; you can redistribute it and/or modify it under the
339.1127 ++// terms of the GNU General Public License as published by the
339.1128 ++// Free Software Foundation; either version 2, or (at your option)
339.1129 ++// any later version.
339.1130 ++
339.1131 ++// This library is distributed in the hope that it will be useful,
339.1132 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
339.1133 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
339.1134 ++// GNU General Public License for more details.
339.1135 ++
339.1136 ++// You should have received a copy of the GNU General Public License along
339.1137 ++// with this library; see the file COPYING.  If not, write to the Free
339.1138 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
339.1139 ++// USA.
339.1140 ++
339.1141 ++// As a special exception, you may use this file as part of a free software
339.1142 ++// library without restriction.  Specifically, if other files instantiate
339.1143 ++// templates or use macros or inline functions from this file, or you compile
339.1144 ++// this file and link it with other files to produce an executable, this
339.1145 ++// file does not by itself cause the resulting executable to be covered by
339.1146 ++// the GNU General Public License.  This exception does not however
339.1147 ++// invalidate any other reasons why the executable file might be covered by
339.1148 ++// the GNU General Public License.
339.1149 ++
339.1150 ++//
339.1151 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
339.1152 ++//
339.1153 ++
339.1154 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
339.1155 ++
339.1156 ++#include <locale>
339.1157 ++#include <bits/c++locale_internal.h>
339.1158 ++
339.1159 ++#ifdef __UCLIBC_MJN3_ONLY__
339.1160 ++#warning fix gettext stuff
339.1161 ++#endif
339.1162 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
339.1163 ++extern "C" char *__dcgettext(const char *domainname,
339.1164 ++			     const char *msgid, int category);
339.1165 ++#undef gettext
339.1166 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
339.1167 ++#else
339.1168 ++#undef gettext
339.1169 ++#define gettext(msgid) (msgid)
339.1170 ++#endif
339.1171 ++
339.1172 ++namespace std
339.1173 ++{
339.1174 ++  // Specializations.
339.1175 ++  template<>
339.1176 ++    string
339.1177 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
339.1178 ++    {
339.1179 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1180 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
339.1181 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
339.1182 ++      __uselocale(__old);
339.1183 ++      return string(__msg);
339.1184 ++#elif defined __UCLIBC_HAS_LOCALE__
339.1185 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
339.1186 ++      setlocale(LC_ALL, _M_name_messages);
339.1187 ++      const char* __msg = gettext(__dfault.c_str());
339.1188 ++      setlocale(LC_ALL, __old);
339.1189 ++      free(__old);
339.1190 ++      return string(__msg);
339.1191 ++#else
339.1192 ++      const char* __msg = gettext(__dfault.c_str());
339.1193 ++      return string(__msg);
339.1194 ++#endif
339.1195 ++    }
339.1196 ++
339.1197 ++#ifdef _GLIBCXX_USE_WCHAR_T
339.1198 ++  template<>
339.1199 ++    wstring
339.1200 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
339.1201 ++    {
339.1202 ++# ifdef __UCLIBC_HAS_XLOCALE__
339.1203 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
339.1204 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
339.1205 ++      __uselocale(__old);
339.1206 ++      return _M_convert_from_char(__msg);
339.1207 ++# elif defined __UCLIBC_HAS_LOCALE__
339.1208 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
339.1209 ++      setlocale(LC_ALL, _M_name_messages);
339.1210 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
339.1211 ++      setlocale(LC_ALL, __old);
339.1212 ++      free(__old);
339.1213 ++      return _M_convert_from_char(__msg);
339.1214 ++# else
339.1215 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
339.1216 ++      return _M_convert_from_char(__msg);
339.1217 ++# endif
339.1218 ++    }
339.1219 ++#endif
339.1220 ++}
339.1221 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
339.1222 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
339.1223 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
339.1224 +@@ -0,0 +1,118 @@
339.1225 ++// std::messages implementation details, GNU version -*- C++ -*-
339.1226 ++
339.1227 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
339.1228 ++//
339.1229 ++// This file is part of the GNU ISO C++ Library.  This library is free
339.1230 ++// software; you can redistribute it and/or modify it under the
339.1231 ++// terms of the GNU General Public License as published by the
339.1232 ++// Free Software Foundation; either version 2, or (at your option)
339.1233 ++// any later version.
339.1234 ++
339.1235 ++// This library is distributed in the hope that it will be useful,
339.1236 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
339.1237 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
339.1238 ++// GNU General Public License for more details.
339.1239 ++
339.1240 ++// You should have received a copy of the GNU General Public License along
339.1241 ++// with this library; see the file COPYING.  If not, write to the Free
339.1242 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
339.1243 ++// USA.
339.1244 ++
339.1245 ++// As a special exception, you may use this file as part of a free software
339.1246 ++// library without restriction.  Specifically, if other files instantiate
339.1247 ++// templates or use macros or inline functions from this file, or you compile
339.1248 ++// this file and link it with other files to produce an executable, this
339.1249 ++// file does not by itself cause the resulting executable to be covered by
339.1250 ++// the GNU General Public License.  This exception does not however
339.1251 ++// invalidate any other reasons why the executable file might be covered by
339.1252 ++// the GNU General Public License.
339.1253 ++
339.1254 ++//
339.1255 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
339.1256 ++//
339.1257 ++
339.1258 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
339.1259 ++
339.1260 ++#ifdef __UCLIBC_MJN3_ONLY__
339.1261 ++#warning fix prototypes for *textdomain funcs
339.1262 ++#endif
339.1263 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
339.1264 ++extern "C" char *__textdomain(const char *domainname);
339.1265 ++extern "C" char *__bindtextdomain(const char *domainname,
339.1266 ++				  const char *dirname);
339.1267 ++#else
339.1268 ++#undef __textdomain
339.1269 ++#undef __bindtextdomain
339.1270 ++#define __textdomain(D)           ((void)0)
339.1271 ++#define __bindtextdomain(D,P)     ((void)0)
339.1272 ++#endif
339.1273 ++
339.1274 ++  // Non-virtual member functions.
339.1275 ++  template<typename _CharT>
339.1276 ++     messages<_CharT>::messages(size_t __refs)
339.1277 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
339.1278 ++     _M_name_messages(_S_get_c_name())
339.1279 ++     { }
339.1280 ++
339.1281 ++  template<typename _CharT>
339.1282 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
339.1283 ++				size_t __refs) 
339.1284 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
339.1285 ++     _M_name_messages(__s)
339.1286 ++     {
339.1287 ++       char* __tmp = new char[std::strlen(__s) + 1];
339.1288 ++       std::strcpy(__tmp, __s);
339.1289 ++       _M_name_messages = __tmp;
339.1290 ++     }
339.1291 ++
339.1292 ++  template<typename _CharT>
339.1293 ++    typename messages<_CharT>::catalog 
339.1294 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
339.1295 ++			   const char* __dir) const
339.1296 ++    { 
339.1297 ++      __bindtextdomain(__s.c_str(), __dir);
339.1298 ++      return this->do_open(__s, __loc); 
339.1299 ++    }
339.1300 ++
339.1301 ++  // Virtual member functions.
339.1302 ++  template<typename _CharT>
339.1303 ++    messages<_CharT>::~messages()
339.1304 ++    { 
339.1305 ++      if (_M_name_messages != _S_get_c_name())
339.1306 ++	delete [] _M_name_messages;
339.1307 ++      _S_destroy_c_locale(_M_c_locale_messages); 
339.1308 ++    }
339.1309 ++
339.1310 ++  template<typename _CharT>
339.1311 ++    typename messages<_CharT>::catalog 
339.1312 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
339.1313 ++			      const locale&) const
339.1314 ++    { 
339.1315 ++      // No error checking is done, assume the catalog exists and can
339.1316 ++      // be used.
339.1317 ++      __textdomain(__s.c_str());
339.1318 ++      return 0;
339.1319 ++    }
339.1320 ++
339.1321 ++  template<typename _CharT>
339.1322 ++    void    
339.1323 ++    messages<_CharT>::do_close(catalog) const 
339.1324 ++    { }
339.1325 ++
339.1326 ++   // messages_byname
339.1327 ++   template<typename _CharT>
339.1328 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
339.1329 ++     : messages<_CharT>(__refs) 
339.1330 ++     { 
339.1331 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
339.1332 ++	 delete [] this->_M_name_messages;
339.1333 ++       char* __tmp = new char[std::strlen(__s) + 1];
339.1334 ++       std::strcpy(__tmp, __s);
339.1335 ++       this->_M_name_messages = __tmp;
339.1336 ++
339.1337 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
339.1338 ++	 {
339.1339 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
339.1340 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
339.1341 ++	 }
339.1342 ++     }
339.1343 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
339.1344 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
339.1345 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
339.1346 +@@ -0,0 +1,692 @@
339.1347 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
339.1348 ++
339.1349 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
339.1350 ++//
339.1351 ++// This file is part of the GNU ISO C++ Library.  This library is free
339.1352 ++// software; you can redistribute it and/or modify it under the
339.1353 ++// terms of the GNU General Public License as published by the
339.1354 ++// Free Software Foundation; either version 2, or (at your option)
339.1355 ++// any later version.
339.1356 ++
339.1357 ++// This library is distributed in the hope that it will be useful,
339.1358 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
339.1359 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
339.1360 ++// GNU General Public License for more details.
339.1361 ++
339.1362 ++// You should have received a copy of the GNU General Public License along
339.1363 ++// with this library; see the file COPYING.  If not, write to the Free
339.1364 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
339.1365 ++// USA.
339.1366 ++
339.1367 ++// As a special exception, you may use this file as part of a free software
339.1368 ++// library without restriction.  Specifically, if other files instantiate
339.1369 ++// templates or use macros or inline functions from this file, or you compile
339.1370 ++// this file and link it with other files to produce an executable, this
339.1371 ++// file does not by itself cause the resulting executable to be covered by
339.1372 ++// the GNU General Public License.  This exception does not however
339.1373 ++// invalidate any other reasons why the executable file might be covered by
339.1374 ++// the GNU General Public License.
339.1375 ++
339.1376 ++//
339.1377 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
339.1378 ++//
339.1379 ++
339.1380 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
339.1381 ++
339.1382 ++#define _LIBC
339.1383 ++#include <locale>
339.1384 ++#undef _LIBC
339.1385 ++#include <bits/c++locale_internal.h>
339.1386 ++
339.1387 ++#ifdef __UCLIBC_MJN3_ONLY__
339.1388 ++#warning optimize this for uclibc
339.1389 ++#warning tailor for stub locale support
339.1390 ++#endif
339.1391 ++
339.1392 ++#ifndef __UCLIBC_HAS_XLOCALE__
339.1393 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
339.1394 ++#endif
339.1395 ++
339.1396 ++namespace std
339.1397 ++{
339.1398 ++  // Construct and return valid pattern consisting of some combination of:
339.1399 ++  // space none symbol sign value
339.1400 ++  money_base::pattern
339.1401 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
339.1402 ++  { 
339.1403 ++    pattern __ret;
339.1404 ++
339.1405 ++    // This insanely complicated routine attempts to construct a valid
339.1406 ++    // pattern for use with monyepunct. A couple of invariants:
339.1407 ++
339.1408 ++    // if (__precedes) symbol -> value
339.1409 ++    // else value -> symbol
339.1410 ++    
339.1411 ++    // if (__space) space
339.1412 ++    // else none
339.1413 ++
339.1414 ++    // none == never first
339.1415 ++    // space never first or last
339.1416 ++
339.1417 ++    // Any elegant implementations of this are welcome.
339.1418 ++    switch (__posn)
339.1419 ++      {
339.1420 ++      case 0:
339.1421 ++      case 1:
339.1422 ++	// 1 The sign precedes the value and symbol.
339.1423 ++	__ret.field[0] = sign;
339.1424 ++	if (__space)
339.1425 ++	  {
339.1426 ++	    // Pattern starts with sign.
339.1427 ++	    if (__precedes)
339.1428 ++	      {
339.1429 ++		__ret.field[1] = symbol;
339.1430 ++		__ret.field[3] = value;
339.1431 ++	      }
339.1432 ++	    else
339.1433 ++	      {
339.1434 ++		__ret.field[1] = value;
339.1435 ++		__ret.field[3] = symbol;
339.1436 ++	      }
339.1437 ++	    __ret.field[2] = space;
339.1438 ++	  }
339.1439 ++	else
339.1440 ++	  {
339.1441 ++	    // Pattern starts with sign and ends with none.
339.1442 ++	    if (__precedes)
339.1443 ++	      {
339.1444 ++		__ret.field[1] = symbol;
339.1445 ++		__ret.field[2] = value;
339.1446 ++	      }
339.1447 ++	    else
339.1448 ++	      {
339.1449 ++		__ret.field[1] = value;
339.1450 ++		__ret.field[2] = symbol;
339.1451 ++	      }
339.1452 ++	    __ret.field[3] = none;
339.1453 ++	  }
339.1454 ++	break;
339.1455 ++      case 2:
339.1456 ++	// 2 The sign follows the value and symbol.
339.1457 ++	if (__space)
339.1458 ++	  {
339.1459 ++	    // Pattern either ends with sign.
339.1460 ++	    if (__precedes)
339.1461 ++	      {
339.1462 ++		__ret.field[0] = symbol;
339.1463 ++		__ret.field[2] = value;
339.1464 ++	      }
339.1465 ++	    else
339.1466 ++	      {
339.1467 ++		__ret.field[0] = value;
339.1468 ++		__ret.field[2] = symbol;
339.1469 ++	      }
339.1470 ++	    __ret.field[1] = space;
339.1471 ++	    __ret.field[3] = sign;
339.1472 ++	  }
339.1473 ++	else
339.1474 ++	  {
339.1475 ++	    // Pattern ends with sign then none.
339.1476 ++	    if (__precedes)
339.1477 ++	      {
339.1478 ++		__ret.field[0] = symbol;
339.1479 ++		__ret.field[1] = value;
339.1480 ++	      }
339.1481 ++	    else
339.1482 ++	      {
339.1483 ++		__ret.field[0] = value;
339.1484 ++		__ret.field[1] = symbol;
339.1485 ++	      }
339.1486 ++	    __ret.field[2] = sign;
339.1487 ++	    __ret.field[3] = none;
339.1488 ++	  }
339.1489 ++	break;
339.1490 ++      case 3:
339.1491 ++	// 3 The sign immediately precedes the symbol.
339.1492 ++	if (__precedes)
339.1493 ++	  {
339.1494 ++	    __ret.field[0] = sign;
339.1495 ++	    __ret.field[1] = symbol;	    
339.1496 ++	    if (__space)
339.1497 ++	      {
339.1498 ++		__ret.field[2] = space;
339.1499 ++		__ret.field[3] = value;
339.1500 ++	      }
339.1501 ++	    else
339.1502 ++	      {
339.1503 ++		__ret.field[2] = value;		
339.1504 ++		__ret.field[3] = none;
339.1505 ++	      }
339.1506 ++	  }
339.1507 ++	else
339.1508 ++	  {
339.1509 ++	    __ret.field[0] = value;
339.1510 ++	    if (__space)
339.1511 ++	      {
339.1512 ++		__ret.field[1] = space;
339.1513 ++		__ret.field[2] = sign;
339.1514 ++		__ret.field[3] = symbol;
339.1515 ++	      }
339.1516 ++	    else
339.1517 ++	      {
339.1518 ++		__ret.field[1] = sign;
339.1519 ++		__ret.field[2] = symbol;
339.1520 ++		__ret.field[3] = none;
339.1521 ++	      }
339.1522 ++	  }
339.1523 ++	break;
339.1524 ++      case 4:
339.1525 ++	// 4 The sign immediately follows the symbol.
339.1526 ++	if (__precedes)
339.1527 ++	  {
339.1528 ++	    __ret.field[0] = symbol;
339.1529 ++	    __ret.field[1] = sign;
339.1530 ++	    if (__space)
339.1531 ++	      {
339.1532 ++		__ret.field[2] = space;
339.1533 ++		__ret.field[3] = value;
339.1534 ++	      }
339.1535 ++	    else
339.1536 ++	      {
339.1537 ++		__ret.field[2] = value;
339.1538 ++		__ret.field[3] = none;
339.1539 ++	      }
339.1540 ++	  }
339.1541 ++	else
339.1542 ++	  {
339.1543 ++	    __ret.field[0] = value;
339.1544 ++	    if (__space)
339.1545 ++	      {
339.1546 ++		__ret.field[1] = space;
339.1547 ++		__ret.field[2] = symbol;
339.1548 ++		__ret.field[3] = sign;
339.1549 ++	      }
339.1550 ++	    else
339.1551 ++	      {
339.1552 ++		__ret.field[1] = symbol;
339.1553 ++		__ret.field[2] = sign;
339.1554 ++		__ret.field[3] = none;
339.1555 ++	      }
339.1556 ++	  }
339.1557 ++	break;
339.1558 ++      default:
339.1559 ++	;
339.1560 ++      }
339.1561 ++    return __ret;
339.1562 ++  }
339.1563 ++
339.1564 ++  template<> 
339.1565 ++    void
339.1566 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
339.1567 ++						     const char*)
339.1568 ++    {
339.1569 ++      if (!_M_data)
339.1570 ++	_M_data = new __moneypunct_cache<char, true>;
339.1571 ++
339.1572 ++      if (!__cloc)
339.1573 ++	{
339.1574 ++	  // "C" locale
339.1575 ++	  _M_data->_M_decimal_point = '.';
339.1576 ++	  _M_data->_M_thousands_sep = ',';
339.1577 ++	  _M_data->_M_grouping = "";
339.1578 ++	  _M_data->_M_grouping_size = 0;
339.1579 ++	  _M_data->_M_curr_symbol = "";
339.1580 ++	  _M_data->_M_curr_symbol_size = 0;
339.1581 ++	  _M_data->_M_positive_sign = "";
339.1582 ++	  _M_data->_M_positive_sign_size = 0;
339.1583 ++	  _M_data->_M_negative_sign = "";
339.1584 ++	  _M_data->_M_negative_sign_size = 0;
339.1585 ++	  _M_data->_M_frac_digits = 0;
339.1586 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
339.1587 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
339.1588 ++
339.1589 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
339.1590 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
339.1591 ++	}
339.1592 ++      else
339.1593 ++	{
339.1594 ++	  // Named locale.
339.1595 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
339.1596 ++							__cloc));
339.1597 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
339.1598 ++							__cloc));
339.1599 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
339.1600 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
339.1601 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
339.1602 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
339.1603 ++
339.1604 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
339.1605 ++	  if (!__nposn)
339.1606 ++	    _M_data->_M_negative_sign = "()";
339.1607 ++	  else
339.1608 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
339.1609 ++							__cloc);
339.1610 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
339.1611 ++
339.1612 ++	  // _Intl == true
339.1613 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
339.1614 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
339.1615 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
339.1616 ++						      __cloc));
339.1617 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
339.1618 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
339.1619 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
339.1620 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
339.1621 ++							__pposn);
339.1622 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
339.1623 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
339.1624 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
339.1625 ++							__nposn);
339.1626 ++	}
339.1627 ++    }
339.1628 ++
339.1629 ++  template<> 
339.1630 ++    void
339.1631 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
339.1632 ++						      const char*)
339.1633 ++    {
339.1634 ++      if (!_M_data)
339.1635 ++	_M_data = new __moneypunct_cache<char, false>;
339.1636 ++
339.1637 ++      if (!__cloc)
339.1638 ++	{
339.1639 ++	  // "C" locale
339.1640 ++	  _M_data->_M_decimal_point = '.';
339.1641 ++	  _M_data->_M_thousands_sep = ',';
339.1642 ++	  _M_data->_M_grouping = "";
339.1643 ++	  _M_data->_M_grouping_size = 0;
339.1644 ++	  _M_data->_M_curr_symbol = "";
339.1645 ++	  _M_data->_M_curr_symbol_size = 0;
339.1646 ++	  _M_data->_M_positive_sign = "";
339.1647 ++	  _M_data->_M_positive_sign_size = 0;
339.1648 ++	  _M_data->_M_negative_sign = "";
339.1649 ++	  _M_data->_M_negative_sign_size = 0;
339.1650 ++	  _M_data->_M_frac_digits = 0;
339.1651 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
339.1652 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
339.1653 ++
339.1654 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
339.1655 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
339.1656 ++	}
339.1657 ++      else
339.1658 ++	{
339.1659 ++	  // Named locale.
339.1660 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
339.1661 ++							__cloc));
339.1662 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
339.1663 ++							__cloc));
339.1664 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
339.1665 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
339.1666 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
339.1667 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
339.1668 ++
339.1669 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
339.1670 ++	  if (!__nposn)
339.1671 ++	    _M_data->_M_negative_sign = "()";
339.1672 ++	  else
339.1673 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
339.1674 ++							__cloc);
339.1675 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
339.1676 ++
339.1677 ++	  // _Intl == false
339.1678 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
339.1679 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
339.1680 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
339.1681 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
339.1682 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
339.1683 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
339.1684 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
339.1685 ++							__pposn);
339.1686 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
339.1687 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
339.1688 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
339.1689 ++							__nposn);
339.1690 ++	}
339.1691 ++    }
339.1692 ++
339.1693 ++  template<> 
339.1694 ++    moneypunct<char, true>::~moneypunct()
339.1695 ++    { delete _M_data; }
339.1696 ++
339.1697 ++  template<> 
339.1698 ++    moneypunct<char, false>::~moneypunct()
339.1699 ++    { delete _M_data; }
339.1700 ++
339.1701 ++#ifdef _GLIBCXX_USE_WCHAR_T
339.1702 ++  template<> 
339.1703 ++    void
339.1704 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
339.1705 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1706 ++							const char*)
339.1707 ++#else
339.1708 ++							const char* __name)
339.1709 ++#endif
339.1710 ++    {
339.1711 ++      if (!_M_data)
339.1712 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
339.1713 ++
339.1714 ++      if (!__cloc)
339.1715 ++	{
339.1716 ++	  // "C" locale
339.1717 ++	  _M_data->_M_decimal_point = L'.';
339.1718 ++	  _M_data->_M_thousands_sep = L',';
339.1719 ++	  _M_data->_M_grouping = "";
339.1720 ++	  _M_data->_M_grouping_size = 0;
339.1721 ++	  _M_data->_M_curr_symbol = L"";
339.1722 ++	  _M_data->_M_curr_symbol_size = 0;
339.1723 ++	  _M_data->_M_positive_sign = L"";
339.1724 ++	  _M_data->_M_positive_sign_size = 0;
339.1725 ++	  _M_data->_M_negative_sign = L"";
339.1726 ++	  _M_data->_M_negative_sign_size = 0;
339.1727 ++	  _M_data->_M_frac_digits = 0;
339.1728 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
339.1729 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
339.1730 ++
339.1731 ++	  // Use ctype::widen code without the facet...
339.1732 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
339.1733 ++	    _M_data->_M_atoms[__i] =
339.1734 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
339.1735 ++	}
339.1736 ++      else
339.1737 ++	{
339.1738 ++	  // Named locale.
339.1739 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1740 ++	  __c_locale __old = __uselocale(__cloc);
339.1741 ++#else
339.1742 ++	  // Switch to named locale so that mbsrtowcs will work.
339.1743 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
339.1744 ++	  setlocale(LC_ALL, __name);
339.1745 ++#endif
339.1746 ++
339.1747 ++#ifdef __UCLIBC_MJN3_ONLY__
339.1748 ++#warning fix this... should be monetary
339.1749 ++#endif
339.1750 ++#ifdef __UCLIBC__
339.1751 ++# ifdef __UCLIBC_HAS_XLOCALE__
339.1752 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
339.1753 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
339.1754 ++# else
339.1755 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
339.1756 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
339.1757 ++# endif
339.1758 ++#else
339.1759 ++	  union { char *__s; wchar_t __w; } __u;
339.1760 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
339.1761 ++	  _M_data->_M_decimal_point = __u.__w;
339.1762 ++
339.1763 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
339.1764 ++	  _M_data->_M_thousands_sep = __u.__w;
339.1765 ++#endif
339.1766 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
339.1767 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
339.1768 ++
339.1769 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
339.1770 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
339.1771 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
339.1772 ++
339.1773 ++	  wchar_t* __wcs_ps = 0;
339.1774 ++	  wchar_t* __wcs_ns = 0;
339.1775 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
339.1776 ++	  try
339.1777 ++	    {
339.1778 ++	      mbstate_t __state;
339.1779 ++	      size_t __len = strlen(__cpossign);
339.1780 ++	      if (__len)
339.1781 ++		{
339.1782 ++		  ++__len;
339.1783 ++		  memset(&__state, 0, sizeof(mbstate_t));
339.1784 ++		  __wcs_ps = new wchar_t[__len];
339.1785 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
339.1786 ++		  _M_data->_M_positive_sign = __wcs_ps;
339.1787 ++		}
339.1788 ++	      else
339.1789 ++		_M_data->_M_positive_sign = L"";
339.1790 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
339.1791 ++	      
339.1792 ++	      __len = strlen(__cnegsign);
339.1793 ++	      if (!__nposn)
339.1794 ++		_M_data->_M_negative_sign = L"()";
339.1795 ++	      else if (__len)
339.1796 ++		{ 
339.1797 ++		  ++__len;
339.1798 ++		  memset(&__state, 0, sizeof(mbstate_t));
339.1799 ++		  __wcs_ns = new wchar_t[__len];
339.1800 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
339.1801 ++		  _M_data->_M_negative_sign = __wcs_ns;
339.1802 ++		}
339.1803 ++	      else
339.1804 ++		_M_data->_M_negative_sign = L"";
339.1805 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
339.1806 ++	      
339.1807 ++	      // _Intl == true.
339.1808 ++	      __len = strlen(__ccurr);
339.1809 ++	      if (__len)
339.1810 ++		{
339.1811 ++		  ++__len;
339.1812 ++		  memset(&__state, 0, sizeof(mbstate_t));
339.1813 ++		  wchar_t* __wcs = new wchar_t[__len];
339.1814 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
339.1815 ++		  _M_data->_M_curr_symbol = __wcs;
339.1816 ++		}
339.1817 ++	      else
339.1818 ++		_M_data->_M_curr_symbol = L"";
339.1819 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
339.1820 ++	    }
339.1821 ++	  catch (...)
339.1822 ++	    {
339.1823 ++	      delete _M_data;
339.1824 ++	      _M_data = 0;
339.1825 ++	      delete __wcs_ps;
339.1826 ++	      delete __wcs_ns;	      
339.1827 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1828 ++	      __uselocale(__old);
339.1829 ++#else
339.1830 ++	      setlocale(LC_ALL, __old);
339.1831 ++	      free(__old);
339.1832 ++#endif
339.1833 ++	      __throw_exception_again;
339.1834 ++	    } 
339.1835 ++	  
339.1836 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
339.1837 ++						      __cloc));
339.1838 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
339.1839 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
339.1840 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
339.1841 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
339.1842 ++							__pposn);
339.1843 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
339.1844 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
339.1845 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
339.1846 ++							__nposn);
339.1847 ++
339.1848 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1849 ++	  __uselocale(__old);
339.1850 ++#else
339.1851 ++	  setlocale(LC_ALL, __old);
339.1852 ++	  free(__old);
339.1853 ++#endif
339.1854 ++	}
339.1855 ++    }
339.1856 ++
339.1857 ++  template<> 
339.1858 ++  void
339.1859 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
339.1860 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1861 ++						       const char*)
339.1862 ++#else
339.1863 ++                                                       const char* __name)
339.1864 ++#endif
339.1865 ++  {
339.1866 ++    if (!_M_data)
339.1867 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
339.1868 ++
339.1869 ++    if (!__cloc)
339.1870 ++	{
339.1871 ++	  // "C" locale
339.1872 ++	  _M_data->_M_decimal_point = L'.';
339.1873 ++	  _M_data->_M_thousands_sep = L',';
339.1874 ++	  _M_data->_M_grouping = "";
339.1875 ++          _M_data->_M_grouping_size = 0;
339.1876 ++	  _M_data->_M_curr_symbol = L"";
339.1877 ++	  _M_data->_M_curr_symbol_size = 0;
339.1878 ++	  _M_data->_M_positive_sign = L"";
339.1879 ++	  _M_data->_M_positive_sign_size = 0;
339.1880 ++	  _M_data->_M_negative_sign = L"";
339.1881 ++	  _M_data->_M_negative_sign_size = 0;
339.1882 ++	  _M_data->_M_frac_digits = 0;
339.1883 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
339.1884 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
339.1885 ++
339.1886 ++	  // Use ctype::widen code without the facet...
339.1887 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
339.1888 ++	    _M_data->_M_atoms[__i] =
339.1889 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
339.1890 ++	}
339.1891 ++      else
339.1892 ++	{
339.1893 ++	  // Named locale.
339.1894 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1895 ++	  __c_locale __old = __uselocale(__cloc);
339.1896 ++#else
339.1897 ++	  // Switch to named locale so that mbsrtowcs will work.
339.1898 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
339.1899 ++	  setlocale(LC_ALL, __name);
339.1900 ++#endif
339.1901 ++
339.1902 ++#ifdef __UCLIBC_MJN3_ONLY__
339.1903 ++#warning fix this... should be monetary
339.1904 ++#endif
339.1905 ++#ifdef __UCLIBC__
339.1906 ++# ifdef __UCLIBC_HAS_XLOCALE__
339.1907 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
339.1908 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
339.1909 ++# else
339.1910 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
339.1911 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
339.1912 ++# endif
339.1913 ++#else
339.1914 ++          union { char *__s; wchar_t __w; } __u;
339.1915 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
339.1916 ++	  _M_data->_M_decimal_point = __u.__w;
339.1917 ++
339.1918 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
339.1919 ++	  _M_data->_M_thousands_sep = __u.__w;
339.1920 ++#endif
339.1921 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
339.1922 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
339.1923 ++
339.1924 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
339.1925 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
339.1926 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
339.1927 ++
339.1928 ++	  wchar_t* __wcs_ps = 0;
339.1929 ++	  wchar_t* __wcs_ns = 0;
339.1930 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
339.1931 ++	  try
339.1932 ++            {
339.1933 ++              mbstate_t __state;
339.1934 ++              size_t __len;
339.1935 ++              __len = strlen(__cpossign);
339.1936 ++              if (__len)
339.1937 ++                {
339.1938 ++		  ++__len;
339.1939 ++		  memset(&__state, 0, sizeof(mbstate_t));
339.1940 ++		  __wcs_ps = new wchar_t[__len];
339.1941 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
339.1942 ++		  _M_data->_M_positive_sign = __wcs_ps;
339.1943 ++		}
339.1944 ++	      else
339.1945 ++		_M_data->_M_positive_sign = L"";
339.1946 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
339.1947 ++	      
339.1948 ++	      __len = strlen(__cnegsign);
339.1949 ++	      if (!__nposn)
339.1950 ++		_M_data->_M_negative_sign = L"()";
339.1951 ++	      else if (__len)
339.1952 ++		{ 
339.1953 ++		  ++__len;
339.1954 ++		  memset(&__state, 0, sizeof(mbstate_t));
339.1955 ++		  __wcs_ns = new wchar_t[__len];
339.1956 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
339.1957 ++		  _M_data->_M_negative_sign = __wcs_ns;
339.1958 ++		}
339.1959 ++	      else
339.1960 ++		_M_data->_M_negative_sign = L"";
339.1961 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
339.1962 ++
339.1963 ++	      // _Intl == true.
339.1964 ++	      __len = strlen(__ccurr);
339.1965 ++	      if (__len)
339.1966 ++		{
339.1967 ++		  ++__len;
339.1968 ++		  memset(&__state, 0, sizeof(mbstate_t));
339.1969 ++		  wchar_t* __wcs = new wchar_t[__len];
339.1970 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
339.1971 ++		  _M_data->_M_curr_symbol = __wcs;
339.1972 ++		}
339.1973 ++	      else
339.1974 ++		_M_data->_M_curr_symbol = L"";
339.1975 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
339.1976 ++	    }
339.1977 ++          catch (...)
339.1978 ++	    {
339.1979 ++	      delete _M_data;
339.1980 ++              _M_data = 0;
339.1981 ++	      delete __wcs_ps;
339.1982 ++	      delete __wcs_ns;	      
339.1983 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.1984 ++	      __uselocale(__old);
339.1985 ++#else
339.1986 ++	      setlocale(LC_ALL, __old);
339.1987 ++	      free(__old);
339.1988 ++#endif
339.1989 ++              __throw_exception_again;
339.1990 ++	    }
339.1991 ++
339.1992 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
339.1993 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
339.1994 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
339.1995 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
339.1996 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
339.1997 ++	                                                __pposn);
339.1998 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
339.1999 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
339.2000 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
339.2001 ++	                                                __nposn);
339.2002 ++
339.2003 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.2004 ++	  __uselocale(__old);
339.2005 ++#else
339.2006 ++	  setlocale(LC_ALL, __old);
339.2007 ++	  free(__old);
339.2008 ++#endif
339.2009 ++	}
339.2010 ++    }
339.2011 ++
339.2012 ++  template<> 
339.2013 ++    moneypunct<wchar_t, true>::~moneypunct()
339.2014 ++    {
339.2015 ++      if (_M_data->_M_positive_sign_size)
339.2016 ++	delete [] _M_data->_M_positive_sign;
339.2017 ++      if (_M_data->_M_negative_sign_size
339.2018 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
339.2019 ++	delete [] _M_data->_M_negative_sign;
339.2020 ++      if (_M_data->_M_curr_symbol_size)
339.2021 ++	delete [] _M_data->_M_curr_symbol;
339.2022 ++      delete _M_data;
339.2023 ++    }
339.2024 ++
339.2025 ++  template<> 
339.2026 ++    moneypunct<wchar_t, false>::~moneypunct()
339.2027 ++    {
339.2028 ++      if (_M_data->_M_positive_sign_size)
339.2029 ++	delete [] _M_data->_M_positive_sign;
339.2030 ++      if (_M_data->_M_negative_sign_size
339.2031 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
339.2032 ++	delete [] _M_data->_M_negative_sign;
339.2033 ++      if (_M_data->_M_curr_symbol_size)
339.2034 ++	delete [] _M_data->_M_curr_symbol;
339.2035 ++      delete _M_data;
339.2036 ++    }
339.2037 ++#endif
339.2038 ++}
339.2039 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
339.2040 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
339.2041 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
339.2042 +@@ -0,0 +1,160 @@
339.2043 ++// std::numpunct implementation details, GNU version -*- C++ -*-
339.2044 ++
339.2045 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
339.2046 ++//
339.2047 ++// This file is part of the GNU ISO C++ Library.  This library is free
339.2048 ++// software; you can redistribute it and/or modify it under the
339.2049 ++// terms of the GNU General Public License as published by the
339.2050 ++// Free Software Foundation; either version 2, or (at your option)
339.2051 ++// any later version.
339.2052 ++
339.2053 ++// This library is distributed in the hope that it will be useful,
339.2054 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
339.2055 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
339.2056 ++// GNU General Public License for more details.
339.2057 ++
339.2058 ++// You should have received a copy of the GNU General Public License along
339.2059 ++// with this library; see the file COPYING.  If not, write to the Free
339.2060 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
339.2061 ++// USA.
339.2062 ++
339.2063 ++// As a special exception, you may use this file as part of a free software
339.2064 ++// library without restriction.  Specifically, if other files instantiate
339.2065 ++// templates or use macros or inline functions from this file, or you compile
339.2066 ++// this file and link it with other files to produce an executable, this
339.2067 ++// file does not by itself cause the resulting executable to be covered by
339.2068 ++// the GNU General Public License.  This exception does not however
339.2069 ++// invalidate any other reasons why the executable file might be covered by
339.2070 ++// the GNU General Public License.
339.2071 ++
339.2072 ++//
339.2073 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
339.2074 ++//
339.2075 ++
339.2076 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
339.2077 ++
339.2078 ++#define _LIBC
339.2079 ++#include <locale>
339.2080 ++#undef _LIBC
339.2081 ++#include <bits/c++locale_internal.h>
339.2082 ++
339.2083 ++#ifdef __UCLIBC_MJN3_ONLY__
339.2084 ++#warning tailor for stub locale support
339.2085 ++#endif
339.2086 ++#ifndef __UCLIBC_HAS_XLOCALE__
339.2087 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
339.2088 ++#endif
339.2089 ++
339.2090 ++namespace std
339.2091 ++{
339.2092 ++  template<> 
339.2093 ++    void
339.2094 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
339.2095 ++    {
339.2096 ++      if (!_M_data)
339.2097 ++	_M_data = new __numpunct_cache<char>;
339.2098 ++
339.2099 ++      if (!__cloc)
339.2100 ++	{
339.2101 ++	  // "C" locale
339.2102 ++	  _M_data->_M_grouping = "";
339.2103 ++	  _M_data->_M_grouping_size = 0;
339.2104 ++	  _M_data->_M_use_grouping = false;
339.2105 ++
339.2106 ++	  _M_data->_M_decimal_point = '.';
339.2107 ++	  _M_data->_M_thousands_sep = ',';
339.2108 ++
339.2109 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
339.2110 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
339.2111 ++
339.2112 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
339.2113 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
339.2114 ++	}
339.2115 ++      else
339.2116 ++	{
339.2117 ++	  // Named locale.
339.2118 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
339.2119 ++							__cloc));
339.2120 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
339.2121 ++							__cloc));
339.2122 ++
339.2123 ++	  // Check for NULL, which implies no grouping.
339.2124 ++	  if (_M_data->_M_thousands_sep == '\0')
339.2125 ++	    _M_data->_M_grouping = "";
339.2126 ++	  else
339.2127 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
339.2128 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
339.2129 ++	}
339.2130 ++
339.2131 ++      // NB: There is no way to extact this info from posix locales.
339.2132 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
339.2133 ++      _M_data->_M_truename = "true";
339.2134 ++      _M_data->_M_truename_size = 4;
339.2135 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
339.2136 ++      _M_data->_M_falsename = "false";
339.2137 ++      _M_data->_M_falsename_size = 5;
339.2138 ++    }
339.2139 ++ 
339.2140 ++  template<> 
339.2141 ++    numpunct<char>::~numpunct()
339.2142 ++    { delete _M_data; }
339.2143 ++   
339.2144 ++#ifdef _GLIBCXX_USE_WCHAR_T
339.2145 ++  template<> 
339.2146 ++    void
339.2147 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
339.2148 ++    {
339.2149 ++      if (!_M_data)
339.2150 ++	_M_data = new __numpunct_cache<wchar_t>;
339.2151 ++
339.2152 ++      if (!__cloc)
339.2153 ++	{
339.2154 ++	  // "C" locale
339.2155 ++	  _M_data->_M_grouping = "";
339.2156 ++	  _M_data->_M_grouping_size = 0;
339.2157 ++	  _M_data->_M_use_grouping = false;
339.2158 ++
339.2159 ++	  _M_data->_M_decimal_point = L'.';
339.2160 ++	  _M_data->_M_thousands_sep = L',';
339.2161 ++
339.2162 ++	  // Use ctype::widen code without the facet...
339.2163 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
339.2164 ++	    _M_data->_M_atoms_out[__i] =
339.2165 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
339.2166 ++
339.2167 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
339.2168 ++	    _M_data->_M_atoms_in[__j] =
339.2169 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
339.2170 ++	}
339.2171 ++      else
339.2172 ++	{
339.2173 ++	  // Named locale.
339.2174 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
339.2175 ++	  union { char *__s; wchar_t __w; } __u;
339.2176 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
339.2177 ++	  _M_data->_M_decimal_point = __u.__w;
339.2178 ++
339.2179 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
339.2180 ++	  _M_data->_M_thousands_sep = __u.__w;
339.2181 ++
339.2182 ++	  if (_M_data->_M_thousands_sep == L'\0')
339.2183 ++	    _M_data->_M_grouping = "";
339.2184 ++	  else
339.2185 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
339.2186 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
339.2187 ++	}
339.2188 ++
339.2189 ++      // NB: There is no way to extact this info from posix locales.
339.2190 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
339.2191 ++      _M_data->_M_truename = L"true";
339.2192 ++      _M_data->_M_truename_size = 4;
339.2193 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
339.2194 ++      _M_data->_M_falsename = L"false";
339.2195 ++      _M_data->_M_falsename_size = 5;
339.2196 ++    }
339.2197 ++
339.2198 ++  template<> 
339.2199 ++    numpunct<wchar_t>::~numpunct()
339.2200 ++    { delete _M_data; }
339.2201 ++ #endif
339.2202 ++}
339.2203 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
339.2204 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
339.2205 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
339.2206 +@@ -0,0 +1,406 @@
339.2207 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
339.2208 ++
339.2209 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
339.2210 ++//
339.2211 ++// This file is part of the GNU ISO C++ Library.  This library is free
339.2212 ++// software; you can redistribute it and/or modify it under the
339.2213 ++// terms of the GNU General Public License as published by the
339.2214 ++// Free Software Foundation; either version 2, or (at your option)
339.2215 ++// any later version.
339.2216 ++
339.2217 ++// This library is distributed in the hope that it will be useful,
339.2218 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
339.2219 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
339.2220 ++// GNU General Public License for more details.
339.2221 ++
339.2222 ++// You should have received a copy of the GNU General Public License along
339.2223 ++// with this library; see the file COPYING.  If not, write to the Free
339.2224 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
339.2225 ++// USA.
339.2226 ++
339.2227 ++// As a special exception, you may use this file as part of a free software
339.2228 ++// library without restriction.  Specifically, if other files instantiate
339.2229 ++// templates or use macros or inline functions from this file, or you compile
339.2230 ++// this file and link it with other files to produce an executable, this
339.2231 ++// file does not by itself cause the resulting executable to be covered by
339.2232 ++// the GNU General Public License.  This exception does not however
339.2233 ++// invalidate any other reasons why the executable file might be covered by
339.2234 ++// the GNU General Public License.
339.2235 ++
339.2236 ++//
339.2237 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
339.2238 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
339.2239 ++//
339.2240 ++
339.2241 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
339.2242 ++
339.2243 ++#include <locale>
339.2244 ++#include <bits/c++locale_internal.h>
339.2245 ++
339.2246 ++#ifdef __UCLIBC_MJN3_ONLY__
339.2247 ++#warning tailor for stub locale support
339.2248 ++#endif
339.2249 ++#ifndef __UCLIBC_HAS_XLOCALE__
339.2250 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
339.2251 ++#endif
339.2252 ++
339.2253 ++namespace std
339.2254 ++{
339.2255 ++  template<>
339.2256 ++    void
339.2257 ++    __timepunct<char>::
339.2258 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
339.2259 ++	   const tm* __tm) const
339.2260 ++    {
339.2261 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.2262 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
339.2263 ++					_M_c_locale_timepunct);
339.2264 ++#else
339.2265 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
339.2266 ++      setlocale(LC_ALL, _M_name_timepunct);
339.2267 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
339.2268 ++      setlocale(LC_ALL, __old);
339.2269 ++      free(__old);
339.2270 ++#endif
339.2271 ++      // Make sure __s is null terminated.
339.2272 ++      if (__len == 0)
339.2273 ++	__s[0] = '\0';
339.2274 ++    }
339.2275 ++
339.2276 ++  template<> 
339.2277 ++    void
339.2278 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
339.2279 ++    {
339.2280 ++      if (!_M_data)
339.2281 ++	_M_data = new __timepunct_cache<char>;
339.2282 ++
339.2283 ++      if (!__cloc)
339.2284 ++	{
339.2285 ++	  // "C" locale
339.2286 ++	  _M_c_locale_timepunct = _S_get_c_locale();
339.2287 ++
339.2288 ++	  _M_data->_M_date_format = "%m/%d/%y";
339.2289 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
339.2290 ++	  _M_data->_M_time_format = "%H:%M:%S";
339.2291 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
339.2292 ++	  _M_data->_M_date_time_format = "";
339.2293 ++	  _M_data->_M_date_time_era_format = "";
339.2294 ++	  _M_data->_M_am = "AM";
339.2295 ++	  _M_data->_M_pm = "PM";
339.2296 ++	  _M_data->_M_am_pm_format = "";
339.2297 ++
339.2298 ++	  // Day names, starting with "C"'s Sunday.
339.2299 ++	  _M_data->_M_day1 = "Sunday";
339.2300 ++	  _M_data->_M_day2 = "Monday";
339.2301 ++	  _M_data->_M_day3 = "Tuesday";
339.2302 ++	  _M_data->_M_day4 = "Wednesday";
339.2303 ++	  _M_data->_M_day5 = "Thursday";
339.2304 ++	  _M_data->_M_day6 = "Friday";
339.2305 ++	  _M_data->_M_day7 = "Saturday";
339.2306 ++
339.2307 ++	  // Abbreviated day names, starting with "C"'s Sun.
339.2308 ++	  _M_data->_M_aday1 = "Sun";
339.2309 ++	  _M_data->_M_aday2 = "Mon";
339.2310 ++	  _M_data->_M_aday3 = "Tue";
339.2311 ++	  _M_data->_M_aday4 = "Wed";
339.2312 ++	  _M_data->_M_aday5 = "Thu";
339.2313 ++	  _M_data->_M_aday6 = "Fri";
339.2314 ++	  _M_data->_M_aday7 = "Sat";
339.2315 ++
339.2316 ++	  // Month names, starting with "C"'s January.
339.2317 ++	  _M_data->_M_month01 = "January";
339.2318 ++	  _M_data->_M_month02 = "February";
339.2319 ++	  _M_data->_M_month03 = "March";
339.2320 ++	  _M_data->_M_month04 = "April";
339.2321 ++	  _M_data->_M_month05 = "May";
339.2322 ++	  _M_data->_M_month06 = "June";
339.2323 ++	  _M_data->_M_month07 = "July";
339.2324 ++	  _M_data->_M_month08 = "August";
339.2325 ++	  _M_data->_M_month09 = "September";
339.2326 ++	  _M_data->_M_month10 = "October";
339.2327 ++	  _M_data->_M_month11 = "November";
339.2328 ++	  _M_data->_M_month12 = "December";
339.2329 ++
339.2330 ++	  // Abbreviated month names, starting with "C"'s Jan.
339.2331 ++	  _M_data->_M_amonth01 = "Jan";
339.2332 ++	  _M_data->_M_amonth02 = "Feb";
339.2333 ++	  _M_data->_M_amonth03 = "Mar";
339.2334 ++	  _M_data->_M_amonth04 = "Apr";
339.2335 ++	  _M_data->_M_amonth05 = "May";
339.2336 ++	  _M_data->_M_amonth06 = "Jun";
339.2337 ++	  _M_data->_M_amonth07 = "Jul";
339.2338 ++	  _M_data->_M_amonth08 = "Aug";
339.2339 ++	  _M_data->_M_amonth09 = "Sep";
339.2340 ++	  _M_data->_M_amonth10 = "Oct";
339.2341 ++	  _M_data->_M_amonth11 = "Nov";
339.2342 ++	  _M_data->_M_amonth12 = "Dec";
339.2343 ++	}
339.2344 ++      else
339.2345 ++	{
339.2346 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
339.2347 ++
339.2348 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
339.2349 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
339.2350 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
339.2351 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
339.2352 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
339.2353 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
339.2354 ++							     __cloc);
339.2355 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
339.2356 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
339.2357 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
339.2358 ++
339.2359 ++	  // Day names, starting with "C"'s Sunday.
339.2360 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
339.2361 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
339.2362 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
339.2363 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
339.2364 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
339.2365 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
339.2366 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
339.2367 ++
339.2368 ++	  // Abbreviated day names, starting with "C"'s Sun.
339.2369 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
339.2370 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
339.2371 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
339.2372 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
339.2373 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
339.2374 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
339.2375 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
339.2376 ++
339.2377 ++	  // Month names, starting with "C"'s January.
339.2378 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
339.2379 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
339.2380 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
339.2381 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
339.2382 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
339.2383 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
339.2384 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
339.2385 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
339.2386 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
339.2387 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
339.2388 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
339.2389 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
339.2390 ++
339.2391 ++	  // Abbreviated month names, starting with "C"'s Jan.
339.2392 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
339.2393 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
339.2394 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
339.2395 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
339.2396 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
339.2397 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
339.2398 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
339.2399 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
339.2400 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
339.2401 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
339.2402 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
339.2403 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
339.2404 ++	}
339.2405 ++    }
339.2406 ++
339.2407 ++#ifdef _GLIBCXX_USE_WCHAR_T
339.2408 ++  template<>
339.2409 ++    void
339.2410 ++    __timepunct<wchar_t>::
339.2411 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
339.2412 ++	   const tm* __tm) const
339.2413 ++    {
339.2414 ++#ifdef __UCLIBC_HAS_XLOCALE__
339.2415 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
339.2416 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
339.2417 ++					_M_c_locale_timepunct);
339.2418 ++#else
339.2419 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
339.2420 ++      setlocale(LC_ALL, _M_name_timepunct);
339.2421 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
339.2422 ++      setlocale(LC_ALL, __old);
339.2423 ++      free(__old);
339.2424 ++#endif
339.2425 ++      // Make sure __s is null terminated.
339.2426 ++      if (__len == 0)
339.2427 ++	__s[0] = L'\0';
339.2428 ++    }
339.2429 ++
339.2430 ++  template<> 
339.2431 ++    void
339.2432 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
339.2433 ++    {
339.2434 ++      if (!_M_data)
339.2435 ++	_M_data = new __timepunct_cache<wchar_t>;
339.2436 ++
339.2437 ++#warning wide time stuff
339.2438 ++//       if (!__cloc)
339.2439 ++	{
339.2440 ++	  // "C" locale
339.2441 ++	  _M_c_locale_timepunct = _S_get_c_locale();
339.2442 ++
339.2443 ++	  _M_data->_M_date_format = L"%m/%d/%y";
339.2444 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
339.2445 ++	  _M_data->_M_time_format = L"%H:%M:%S";
339.2446 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
339.2447 ++	  _M_data->_M_date_time_format = L"";
339.2448 ++	  _M_data->_M_date_time_era_format = L"";
339.2449 ++	  _M_data->_M_am = L"AM";
339.2450 ++	  _M_data->_M_pm = L"PM";
339.2451 ++	  _M_data->_M_am_pm_format = L"";
339.2452 ++
339.2453 ++	  // Day names, starting with "C"'s Sunday.
339.2454 ++	  _M_data->_M_day1 = L"Sunday";
339.2455 ++	  _M_data->_M_day2 = L"Monday";
339.2456 ++	  _M_data->_M_day3 = L"Tuesday";
339.2457 ++	  _M_data->_M_day4 = L"Wednesday";
339.2458 ++	  _M_data->_M_day5 = L"Thursday";
339.2459 ++	  _M_data->_M_day6 = L"Friday";
339.2460 ++	  _M_data->_M_day7 = L"Saturday";
339.2461 ++
339.2462 ++	  // Abbreviated day names, starting with "C"'s Sun.
339.2463 ++	  _M_data->_M_aday1 = L"Sun";
339.2464 ++	  _M_data->_M_aday2 = L"Mon";
339.2465 ++	  _M_data->_M_aday3 = L"Tue";
339.2466 ++	  _M_data->_M_aday4 = L"Wed";
339.2467 ++	  _M_data->_M_aday5 = L"Thu";
339.2468 ++	  _M_data->_M_aday6 = L"Fri";
339.2469 ++	  _M_data->_M_aday7 = L"Sat";
339.2470 ++
339.2471 ++	  // Month names, starting with "C"'s January.
339.2472 ++	  _M_data->_M_month01 = L"January";
339.2473 ++	  _M_data->_M_month02 = L"February";
339.2474 ++	  _M_data->_M_month03 = L"March";
339.2475 ++	  _M_data->_M_month04 = L"April";
339.2476 ++	  _M_data->_M_month05 = L"May";
339.2477 ++	  _M_data->_M_month06 = L"June";
339.2478 ++	  _M_data->_M_month07 = L"July";
339.2479 ++	  _M_data->_M_month08 = L"August";
339.2480 ++	  _M_data->_M_month09 = L"September";
339.2481 ++	  _M_data->_M_month10 = L"October";
339.2482 ++	  _M_data->_M_month11 = L"November";
339.2483 ++	  _M_data->_M_month12 = L"December";
339.2484 ++
339.2485 ++	  // Abbreviated month names, starting with "C"'s Jan.
339.2486 ++	  _M_data->_M_amonth01 = L"Jan";
339.2487 ++	  _M_data->_M_amonth02 = L"Feb";
339.2488 ++	  _M_data->_M_amonth03 = L"Mar";
339.2489 ++	  _M_data->_M_amonth04 = L"Apr";
339.2490 ++	  _M_data->_M_amonth05 = L"May";
339.2491 ++	  _M_data->_M_amonth06 = L"Jun";
339.2492 ++	  _M_data->_M_amonth07 = L"Jul";
339.2493 ++	  _M_data->_M_amonth08 = L"Aug";
339.2494 ++	  _M_data->_M_amonth09 = L"Sep";
339.2495 ++	  _M_data->_M_amonth10 = L"Oct";
339.2496 ++	  _M_data->_M_amonth11 = L"Nov";
339.2497 ++	  _M_data->_M_amonth12 = L"Dec";
339.2498 ++	}
339.2499 ++#if 0
339.2500 ++      else
339.2501 ++	{
339.2502 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
339.2503 ++
339.2504 ++	  union { char *__s; wchar_t *__w; } __u;
339.2505 ++
339.2506 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
339.2507 ++	  _M_data->_M_date_format = __u.__w;
339.2508 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
339.2509 ++	  _M_data->_M_date_era_format = __u.__w;
339.2510 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
339.2511 ++	  _M_data->_M_time_format = __u.__w;
339.2512 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
339.2513 ++	  _M_data->_M_time_era_format = __u.__w;
339.2514 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
339.2515 ++	  _M_data->_M_date_time_format = __u.__w;
339.2516 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
339.2517 ++	  _M_data->_M_date_time_era_format = __u.__w;
339.2518 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
339.2519 ++	  _M_data->_M_am = __u.__w;
339.2520 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
339.2521 ++	  _M_data->_M_pm = __u.__w;
339.2522 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
339.2523 ++	  _M_data->_M_am_pm_format = __u.__w;
339.2524 ++
339.2525 ++	  // Day names, starting with "C"'s Sunday.
339.2526 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
339.2527 ++	  _M_data->_M_day1 = __u.__w;
339.2528 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
339.2529 ++	  _M_data->_M_day2 = __u.__w;
339.2530 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
339.2531 ++	  _M_data->_M_day3 = __u.__w;
339.2532 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
339.2533 ++	  _M_data->_M_day4 = __u.__w;
339.2534 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
339.2535 ++	  _M_data->_M_day5 = __u.__w;
339.2536 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
339.2537 ++	  _M_data->_M_day6 = __u.__w;
339.2538 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
339.2539 ++	  _M_data->_M_day7 = __u.__w;
339.2540 ++
339.2541 ++	  // Abbreviated day names, starting with "C"'s Sun.
339.2542 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
339.2543 ++	  _M_data->_M_aday1 = __u.__w;
339.2544 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
339.2545 ++	  _M_data->_M_aday2 = __u.__w;
339.2546 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
339.2547 ++	  _M_data->_M_aday3 = __u.__w;
339.2548 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
339.2549 ++	  _M_data->_M_aday4 = __u.__w;
339.2550 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
339.2551 ++	  _M_data->_M_aday5 = __u.__w;
339.2552 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
339.2553 ++	  _M_data->_M_aday6 = __u.__w;
339.2554 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
339.2555 ++	  _M_data->_M_aday7 = __u.__w;
339.2556 ++
339.2557 ++	  // Month names, starting with "C"'s January.
339.2558 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
339.2559 ++	  _M_data->_M_month01 = __u.__w;
339.2560 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
339.2561 ++	  _M_data->_M_month02 = __u.__w;
339.2562 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
339.2563 ++	  _M_data->_M_month03 = __u.__w;
339.2564 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
339.2565 ++	  _M_data->_M_month04 = __u.__w;
339.2566 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
339.2567 ++	  _M_data->_M_month05 = __u.__w;
339.2568 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
339.2569 ++	  _M_data->_M_month06 = __u.__w;
339.2570 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
339.2571 ++	  _M_data->_M_month07 = __u.__w;
339.2572 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
339.2573 ++	  _M_data->_M_month08 = __u.__w;
339.2574 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
339.2575 ++	  _M_data->_M_month09 = __u.__w;
339.2576 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
339.2577 ++	  _M_data->_M_month10 = __u.__w;
339.2578 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
339.2579 ++	  _M_data->_M_month11 = __u.__w;
339.2580 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
339.2581 ++	  _M_data->_M_month12 = __u.__w;
339.2582 ++
339.2583 ++	  // Abbreviated month names, starting with "C"'s Jan.
339.2584 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
339.2585 ++	  _M_data->_M_amonth01 = __u.__w;
339.2586 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
339.2587 ++	  _M_data->_M_amonth02 = __u.__w;
339.2588 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
339.2589 ++	  _M_data->_M_amonth03 = __u.__w;
339.2590 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
339.2591 ++	  _M_data->_M_amonth04 = __u.__w;
339.2592 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
339.2593 ++	  _M_data->_M_amonth05 = __u.__w;
339.2594 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
339.2595 ++	  _M_data->_M_amonth06 = __u.__w;
339.2596 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
339.2597 ++	  _M_data->_M_amonth07 = __u.__w;
339.2598 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
339.2599 ++	  _M_data->_M_amonth08 = __u.__w;
339.2600 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
339.2601 ++	  _M_data->_M_amonth09 = __u.__w;
339.2602 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
339.2603 ++	  _M_data->_M_amonth10 = __u.__w;
339.2604 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
339.2605 ++	  _M_data->_M_amonth11 = __u.__w;
339.2606 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
339.2607 ++	  _M_data->_M_amonth12 = __u.__w;
339.2608 ++	}
339.2609 ++#endif // 0
339.2610 ++    }
339.2611 ++#endif
339.2612 ++}
339.2613 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
339.2614 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
339.2615 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
339.2616 +@@ -0,0 +1,68 @@
339.2617 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
339.2618 ++
339.2619 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
339.2620 ++//
339.2621 ++// This file is part of the GNU ISO C++ Library.  This library is free
339.2622 ++// software; you can redistribute it and/or modify it under the
339.2623 ++// terms of the GNU General Public License as published by the
339.2624 ++// Free Software Foundation; either version 2, or (at your option)
339.2625 ++// any later version.
339.2626 ++
339.2627 ++// This library is distributed in the hope that it will be useful,
339.2628 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
339.2629 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
339.2630 ++// GNU General Public License for more details.
339.2631 ++
339.2632 ++// You should have received a copy of the GNU General Public License along
339.2633 ++// with this library; see the file COPYING.  If not, write to the Free
339.2634 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
339.2635 ++// USA.
339.2636 ++
339.2637 ++// As a special exception, you may use this file as part of a free software
339.2638 ++// library without restriction.  Specifically, if other files instantiate
339.2639 ++// templates or use macros or inline functions from this file, or you compile
339.2640 ++// this file and link it with other files to produce an executable, this
339.2641 ++// file does not by itself cause the resulting executable to be covered by
339.2642 ++// the GNU General Public License.  This exception does not however
339.2643 ++// invalidate any other reasons why the executable file might be covered by
339.2644 ++// the GNU General Public License.
339.2645 ++
339.2646 ++//
339.2647 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
339.2648 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
339.2649 ++//
339.2650 ++
339.2651 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
339.2652 ++
339.2653 ++  template<typename _CharT>
339.2654 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
339.2655 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
339.2656 ++    _M_name_timepunct(_S_get_c_name())
339.2657 ++    { _M_initialize_timepunct(); }
339.2658 ++
339.2659 ++  template<typename _CharT>
339.2660 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
339.2661 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
339.2662 ++    _M_name_timepunct(_S_get_c_name())
339.2663 ++    { _M_initialize_timepunct(); }
339.2664 ++
339.2665 ++  template<typename _CharT>
339.2666 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
339.2667 ++				     size_t __refs) 
339.2668 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
339.2669 ++    _M_name_timepunct(__s)
339.2670 ++    { 
339.2671 ++      char* __tmp = new char[std::strlen(__s) + 1];
339.2672 ++      std::strcpy(__tmp, __s);
339.2673 ++      _M_name_timepunct = __tmp;
339.2674 ++      _M_initialize_timepunct(__cloc); 
339.2675 ++    }
339.2676 ++
339.2677 ++  template<typename _CharT>
339.2678 ++    __timepunct<_CharT>::~__timepunct()
339.2679 ++    { 
339.2680 ++      if (_M_name_timepunct != _S_get_c_name())
339.2681 ++	delete [] _M_name_timepunct;
339.2682 ++      delete _M_data; 
339.2683 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
339.2684 ++    }
339.2685 +diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
339.2686 +--- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:29:22.000000000 +0200
339.2687 ++++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
339.2688 +@@ -5769,7 +5769,7 @@
339.2689 +   enableval="$enable_clocale"
339.2690 + 
339.2691 +       case "$enableval" in
339.2692 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
339.2693 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
339.2694 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
339.2695 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
339.2696 +    { (exit 1); exit 1; }; } ;;
339.2697 +@@ -5802,6 +5802,9 @@
339.2698 +   # Default to "generic".
339.2699 +   if test $enable_clocale_flag = auto; then
339.2700 +     case ${target_os} in
339.2701 ++      linux-uclibc*)
339.2702 ++        enable_clocale_flag=uclibc
339.2703 ++	;;
339.2704 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
339.2705 +         enable_clocale_flag=gnu
339.2706 +         ;;
339.2707 +@@ -6190,6 +6193,76 @@
339.2708 +       CTIME_CC=config/locale/generic/time_members.cc
339.2709 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
339.2710 +       ;;
339.2711 ++    uclibc)
339.2712 ++      echo "$as_me:$LINENO: result: uclibc" >&5
339.2713 ++echo "${ECHO_T}uclibc" >&6
339.2714 ++
339.2715 ++      # Declare intention to use gettext, and add support for specific
339.2716 ++      # languages.
339.2717 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
339.2718 ++      ALL_LINGUAS="de fr"
339.2719 ++
339.2720 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
339.2721 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
339.2722 ++set dummy msgfmt; ac_word=$2
339.2723 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
339.2724 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
339.2725 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
339.2726 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
339.2727 ++else
339.2728 ++  if test -n "$check_msgfmt"; then
339.2729 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
339.2730 ++else
339.2731 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
339.2732 ++for as_dir in $PATH
339.2733 ++do
339.2734 ++  IFS=$as_save_IFS
339.2735 ++  test -z "$as_dir" && as_dir=.
339.2736 ++  for ac_exec_ext in '' $ac_executable_extensions; do
339.2737 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
339.2738 ++    ac_cv_prog_check_msgfmt="yes"
339.2739 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
339.2740 ++    break 2
339.2741 ++  fi
339.2742 ++done
339.2743 ++done
339.2744 ++
339.2745 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
339.2746 ++fi
339.2747 ++fi
339.2748 ++check_msgfmt=$ac_cv_prog_check_msgfmt
339.2749 ++if test -n "$check_msgfmt"; then
339.2750 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
339.2751 ++echo "${ECHO_T}$check_msgfmt" >&6
339.2752 ++else
339.2753 ++  echo "$as_me:$LINENO: result: no" >&5
339.2754 ++echo "${ECHO_T}no" >&6
339.2755 ++fi
339.2756 ++
339.2757 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
339.2758 ++        USE_NLS=yes
339.2759 ++      fi
339.2760 ++      # Export the build objects.
339.2761 ++      for ling in $ALL_LINGUAS; do \
339.2762 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
339.2763 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
339.2764 ++      done
339.2765 ++
339.2766 ++
339.2767 ++
339.2768 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
339.2769 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
339.2770 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
339.2771 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
339.2772 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
339.2773 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
339.2774 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
339.2775 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
339.2776 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
339.2777 ++      CTIME_H=config/locale/uclibc/time_members.h
339.2778 ++      CTIME_CC=config/locale/uclibc/time_members.cc
339.2779 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
339.2780 ++      ;;
339.2781 +   esac
339.2782 + 
339.2783 +   # This is where the testsuite looks for locale catalogs, using the
339.2784 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h
339.2785 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2005-08-17 04:28:44.000000000 +0200
339.2786 ++++ gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h	2007-08-03 20:30:21.000000000 +0200
339.2787 +@@ -101,7 +101,9 @@
339.2788 + using std::wmemcpy;
339.2789 + using std::wmemmove;
339.2790 + using std::wmemset;
339.2791 ++#if _GLIBCXX_HAVE_WCSFTIME
339.2792 + using std::wcsftime;
339.2793 ++#endif
339.2794 + 
339.2795 + #if _GLIBCXX_USE_C99
339.2796 + using std::wcstold;
339.2797 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h
339.2798 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h	2006-12-07 10:33:51.000000000 +0100
339.2799 ++++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h	2007-08-03 20:30:21.000000000 +0200
339.2800 +@@ -182,7 +182,9 @@
339.2801 +   using ::wcscoll;
339.2802 +   using ::wcscpy;
339.2803 +   using ::wcscspn;
339.2804 ++#if _GLIBCXX_HAVE_WCSFTIME
339.2805 +   using ::wcsftime;
339.2806 ++#endif
339.2807 +   using ::wcslen;
339.2808 +   using ::wcsncat;
339.2809 +   using ::wcsncmp;
   340.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   340.2 +++ b/patches/gcc/4.2.4/130-uclibc-locale-no__x.patch	Mon Jul 28 21:32:33 2008 +0000
   340.3 @@ -0,0 +1,223 @@
   340.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   340.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
   340.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   340.7 +@@ -39,20 +39,6 @@
   340.8 + #include <langinfo.h>
   340.9 + #include <bits/c++locale_internal.h>
  340.10 + 
  340.11 +-#ifndef __UCLIBC_HAS_XLOCALE__
  340.12 +-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  340.13 +-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  340.14 +-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  340.15 +-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  340.16 +-#define __strtof_l(S, E, L)         strtof((S), (E))
  340.17 +-#define __strtod_l(S, E, L)         strtod((S), (E))
  340.18 +-#define __strtold_l(S, E, L)        strtold((S), (E))
  340.19 +-#warning should dummy __newlocale check for C|POSIX ?
  340.20 +-#define __newlocale(a, b, c)        NULL
  340.21 +-#define __freelocale(a)             ((void)0)
  340.22 +-#define __duplocale(a)              __c_locale()
  340.23 +-#endif
  340.24 +-
  340.25 + namespace std 
  340.26 + {
  340.27 +   template<>
  340.28 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  340.29 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
  340.30 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  340.31 +@@ -68,6 +68,7 @@
  340.32 + {
  340.33 +   extern "C" __typeof(uselocale) __uselocale;
  340.34 + }
  340.35 ++#define __uselocale uselocale
  340.36 + #endif
  340.37 + 
  340.38 + namespace std
  340.39 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  340.40 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
  340.41 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:53.000000000 +0200
  340.42 +@@ -60,4 +60,49 @@
  340.43 + extern "C" __typeof(wctype_l) __wctype_l;
  340.44 + #endif 
  340.45 + 
  340.46 ++# define __nl_langinfo_l nl_langinfo_l
  340.47 ++# define __strcoll_l strcoll_l
  340.48 ++# define __strftime_l strftime_l
  340.49 ++# define __strtod_l strtod_l
  340.50 ++# define __strtof_l strtof_l
  340.51 ++# define __strtold_l strtold_l
  340.52 ++# define __strxfrm_l strxfrm_l
  340.53 ++# define __newlocale newlocale
  340.54 ++# define __freelocale freelocale
  340.55 ++# define __duplocale duplocale
  340.56 ++# define __uselocale uselocale
  340.57 ++
  340.58 ++# ifdef _GLIBCXX_USE_WCHAR_T
  340.59 ++#  define __iswctype_l iswctype_l
  340.60 ++#  define __towlower_l towlower_l
  340.61 ++#  define __towupper_l towupper_l
  340.62 ++#  define __wcscoll_l wcscoll_l
  340.63 ++#  define __wcsftime_l wcsftime_l
  340.64 ++#  define __wcsxfrm_l wcsxfrm_l
  340.65 ++#  define __wctype_l wctype_l
  340.66 ++# endif
  340.67 ++
  340.68 ++#else
  340.69 ++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  340.70 ++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  340.71 ++# define __strtod_l(S, E, L)         strtod((S), (E))
  340.72 ++# define __strtof_l(S, E, L)         strtof((S), (E))
  340.73 ++# define __strtold_l(S, E, L)        strtold((S), (E))
  340.74 ++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  340.75 ++# warning should dummy __newlocale check for C|POSIX ?
  340.76 ++# define __newlocale(a, b, c)        NULL
  340.77 ++# define __freelocale(a)             ((void)0)
  340.78 ++# define __duplocale(a)              __c_locale()
  340.79 ++//# define __uselocale ?
  340.80 ++//
  340.81 ++# ifdef _GLIBCXX_USE_WCHAR_T
  340.82 ++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  340.83 ++#  define __towlower_l(C, L)          towlower((C))
  340.84 ++#  define __towupper_l(C, L)          towupper((C))
  340.85 ++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  340.86 ++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  340.87 ++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  340.88 ++#  define __wctype_l(S, L)            wctype((S))
  340.89 ++# endif
  340.90 ++
  340.91 + #endif // GLIBC 2.3 and later
  340.92 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
  340.93 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
  340.94 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:53.000000000 +0200
  340.95 +@@ -36,13 +36,6 @@
  340.96 + #include <locale>
  340.97 + #include <bits/c++locale_internal.h>
  340.98 + 
  340.99 +-#ifndef __UCLIBC_HAS_XLOCALE__
 340.100 +-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 340.101 +-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 340.102 +-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 340.103 +-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 340.104 +-#endif
 340.105 +-
 340.106 + namespace std
 340.107 + {
 340.108 +   // These are basically extensions to char_traits, and perhaps should
 340.109 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 340.110 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 340.111 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 340.112 +@@ -38,13 +38,6 @@
 340.113 + #undef _LIBC
 340.114 + #include <bits/c++locale_internal.h>
 340.115 + 
 340.116 +-#ifndef __UCLIBC_HAS_XLOCALE__
 340.117 +-#define __wctype_l(S, L)           wctype((S))
 340.118 +-#define __towupper_l(C, L)         towupper((C))
 340.119 +-#define __towlower_l(C, L)         towlower((C))
 340.120 +-#define __iswctype_l(C, M, L)      iswctype((C), (M))
 340.121 +-#endif
 340.122 +-
 340.123 + namespace std
 340.124 + {
 340.125 +   // NB: The other ctype<char> specializations are in src/locale.cc and
 340.126 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
 340.127 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
 340.128 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:53.000000000 +0200
 340.129 +@@ -39,13 +39,10 @@
 340.130 + #ifdef __UCLIBC_MJN3_ONLY__
 340.131 + #warning fix gettext stuff
 340.132 + #endif
 340.133 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 340.134 +-extern "C" char *__dcgettext(const char *domainname,
 340.135 +-			     const char *msgid, int category);
 340.136 + #undef gettext
 340.137 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 340.138 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 340.139 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 340.140 + #else
 340.141 +-#undef gettext
 340.142 + #define gettext(msgid) (msgid)
 340.143 + #endif
 340.144 + 
 340.145 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 340.146 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
 340.147 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 340.148 +@@ -36,15 +36,11 @@
 340.149 + #ifdef __UCLIBC_MJN3_ONLY__
 340.150 + #warning fix prototypes for *textdomain funcs
 340.151 + #endif
 340.152 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 340.153 +-extern "C" char *__textdomain(const char *domainname);
 340.154 +-extern "C" char *__bindtextdomain(const char *domainname,
 340.155 +-				  const char *dirname);
 340.156 +-#else
 340.157 +-#undef __textdomain
 340.158 +-#undef __bindtextdomain
 340.159 +-#define __textdomain(D)           ((void)0)
 340.160 +-#define __bindtextdomain(D,P)     ((void)0)
 340.161 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 340.162 ++#undef textdomain
 340.163 ++#undef bindtextdomain
 340.164 ++#define textdomain(D)           ((void)0)
 340.165 ++#define bindtextdomain(D,P)     ((void)0)
 340.166 + #endif
 340.167 + 
 340.168 +   // Non-virtual member functions.
 340.169 +@@ -70,7 +66,7 @@
 340.170 +     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 340.171 + 			   const char* __dir) const
 340.172 +     { 
 340.173 +-      __bindtextdomain(__s.c_str(), __dir);
 340.174 ++      bindtextdomain(__s.c_str(), __dir);
 340.175 +       return this->do_open(__s, __loc); 
 340.176 +     }
 340.177 + 
 340.178 +@@ -90,7 +86,7 @@
 340.179 +     { 
 340.180 +       // No error checking is done, assume the catalog exists and can
 340.181 +       // be used.
 340.182 +-      __textdomain(__s.c_str());
 340.183 ++      textdomain(__s.c_str());
 340.184 +       return 0;
 340.185 +     }
 340.186 + 
 340.187 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 340.188 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
 340.189 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
 340.190 +@@ -43,10 +43,6 @@
 340.191 + #warning tailor for stub locale support
 340.192 + #endif
 340.193 + 
 340.194 +-#ifndef __UCLIBC_HAS_XLOCALE__
 340.195 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 340.196 +-#endif
 340.197 +-
 340.198 + namespace std
 340.199 + {
 340.200 +   // Construct and return valid pattern consisting of some combination of:
 340.201 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 340.202 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
 340.203 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
 340.204 +@@ -41,9 +41,6 @@
 340.205 + #ifdef __UCLIBC_MJN3_ONLY__
 340.206 + #warning tailor for stub locale support
 340.207 + #endif
 340.208 +-#ifndef __UCLIBC_HAS_XLOCALE__
 340.209 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 340.210 +-#endif
 340.211 + 
 340.212 + namespace std
 340.213 + {
 340.214 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
 340.215 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
 340.216 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:53.000000000 +0200
 340.217 +@@ -40,9 +40,6 @@
 340.218 + #ifdef __UCLIBC_MJN3_ONLY__
 340.219 + #warning tailor for stub locale support
 340.220 + #endif
 340.221 +-#ifndef __UCLIBC_HAS_XLOCALE__
 340.222 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 340.223 +-#endif
 340.224 + 
 340.225 + namespace std
 340.226 + {
   341.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   341.2 +++ b/patches/gcc/4.2.4/140-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:32:33 2008 +0000
   341.3 @@ -0,0 +1,50 @@
   341.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   341.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
   341.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
   341.7 +@@ -401,7 +401,7 @@
   341.8 + # ifdef __UCLIBC_HAS_XLOCALE__
   341.9 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  341.10 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  341.11 +-# else
  341.12 ++# elif defined __UCLIBC_HAS_LOCALE__
  341.13 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  341.14 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  341.15 + # endif
  341.16 +@@ -556,7 +556,7 @@
  341.17 + # ifdef __UCLIBC_HAS_XLOCALE__
  341.18 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  341.19 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  341.20 +-# else
  341.21 ++# elif defined __UCLIBC_HAS_LOCALE__
  341.22 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  341.23 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  341.24 + # endif
  341.25 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  341.26 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
  341.27 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
  341.28 +@@ -127,12 +127,25 @@
  341.29 + 	{
  341.30 + 	  // Named locale.
  341.31 + 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  341.32 ++#ifdef __UCLIBC_MJN3_ONLY__
  341.33 ++#warning fix this... should be numeric
  341.34 ++#endif
  341.35 ++#ifdef __UCLIBC__
  341.36 ++# ifdef __UCLIBC_HAS_XLOCALE__
  341.37 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  341.38 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  341.39 ++# elif defined __UCLIBC_HAS_LOCALE__
  341.40 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  341.41 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  341.42 ++# endif
  341.43 ++#else
  341.44 + 	  union { char *__s; wchar_t __w; } __u;
  341.45 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  341.46 + 	  _M_data->_M_decimal_point = __u.__w;
  341.47 + 
  341.48 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  341.49 + 	  _M_data->_M_thousands_sep = __u.__w;
  341.50 ++#endif
  341.51 + 
  341.52 + 	  if (_M_data->_M_thousands_sep == L'\0')
  341.53 + 	    _M_data->_M_grouping = "";
   342.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   342.2 +++ b/patches/gcc/4.2.4/150-uclibc-locale-update.patch	Mon Jul 28 21:32:33 2008 +0000
   342.3 @@ -0,0 +1,354 @@
   342.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   342.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   342.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:31:54.000000000 +0200
   342.7 +@@ -46,16 +46,13 @@
   342.8 +     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   342.9 + 		   const __c_locale& __cloc)
  342.10 +     {
  342.11 +-      if (!(__err & ios_base::failbit))
  342.12 +-	{
  342.13 +-	  char* __sanity;
  342.14 +-	  errno = 0;
  342.15 +-	  float __f = __strtof_l(__s, &__sanity, __cloc);
  342.16 +-          if (__sanity != __s && errno != ERANGE)
  342.17 +-	    __v = __f;
  342.18 +-	  else
  342.19 +-	    __err |= ios_base::failbit;
  342.20 +-	}
  342.21 ++      char* __sanity;
  342.22 ++      errno = 0;
  342.23 ++      float __f = __strtof_l(__s, &__sanity, __cloc);
  342.24 ++      if (__sanity != __s && errno != ERANGE)
  342.25 ++	__v = __f;
  342.26 ++      else
  342.27 ++	__err |= ios_base::failbit;
  342.28 +     }
  342.29 + 
  342.30 +   template<>
  342.31 +@@ -63,16 +60,13 @@
  342.32 +     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  342.33 + 		   const __c_locale& __cloc)
  342.34 +     {
  342.35 +-      if (!(__err & ios_base::failbit))
  342.36 +-	{
  342.37 +-	  char* __sanity;
  342.38 +-	  errno = 0;
  342.39 +-	  double __d = __strtod_l(__s, &__sanity, __cloc);
  342.40 +-          if (__sanity != __s && errno != ERANGE)
  342.41 +-	    __v = __d;
  342.42 +-	  else
  342.43 +-	    __err |= ios_base::failbit;
  342.44 +-	}
  342.45 ++      char* __sanity;
  342.46 ++      errno = 0;
  342.47 ++      double __d = __strtod_l(__s, &__sanity, __cloc);
  342.48 ++      if (__sanity != __s && errno != ERANGE)
  342.49 ++	__v = __d;
  342.50 ++      else
  342.51 ++	__err |= ios_base::failbit;
  342.52 +     }
  342.53 + 
  342.54 +   template<>
  342.55 +@@ -80,16 +74,13 @@
  342.56 +     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  342.57 + 		   const __c_locale& __cloc)
  342.58 +     {
  342.59 +-      if (!(__err & ios_base::failbit))
  342.60 +-	{
  342.61 +-	  char* __sanity;
  342.62 +-	  errno = 0;
  342.63 +-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  342.64 +-          if (__sanity != __s && errno != ERANGE)
  342.65 +-	    __v = __ld;
  342.66 +-	  else
  342.67 +-	    __err |= ios_base::failbit;
  342.68 +-	}
  342.69 ++      char* __sanity;
  342.70 ++      errno = 0;
  342.71 ++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  342.72 ++      if (__sanity != __s && errno != ERANGE)
  342.73 ++	__v = __ld;
  342.74 ++      else
  342.75 ++	__err |= ios_base::failbit;
  342.76 +     }
  342.77 + 
  342.78 +   void
  342.79 +@@ -110,7 +101,7 @@
  342.80 +   void
  342.81 +   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  342.82 +   {
  342.83 +-    if (_S_get_c_locale() != __cloc)
  342.84 ++    if (__cloc && _S_get_c_locale() != __cloc)
  342.85 +       __freelocale(__cloc); 
  342.86 +   }
  342.87 + 
  342.88 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  342.89 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  342.90 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:31:54.000000000 +0200
  342.91 +@@ -39,21 +39,23 @@
  342.92 + #pragma GCC system_header
  342.93 + 
  342.94 + #include <cstring>              // get std::strlen
  342.95 +-#include <cstdio>               // get std::snprintf or std::sprintf
  342.96 ++#include <cstdio>               // get std::vsnprintf or std::vsprintf
  342.97 + #include <clocale>
  342.98 + #include <langinfo.h>		// For codecvt
  342.99 + #ifdef __UCLIBC_MJN3_ONLY__
 342.100 + #warning fix this
 342.101 + #endif
 342.102 +-#ifdef __UCLIBC_HAS_LOCALE__
 342.103 ++#ifdef _GLIBCXX_USE_ICONV
 342.104 + #include <iconv.h>		// For codecvt using iconv, iconv_t
 342.105 + #endif
 342.106 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 342.107 +-#include <libintl.h> 		// For messages
 342.108 ++#ifdef HAVE_LIBINTL_H
 342.109 ++#include <libintl.h>		// For messages
 342.110 + #endif
 342.111 ++#include <cstdarg>
 342.112 + 
 342.113 + #ifdef __UCLIBC_MJN3_ONLY__
 342.114 + #warning what is _GLIBCXX_C_LOCALE_GNU for
 342.115 ++// psm: used in os/gnu-linux/ctype_noninline.h
 342.116 + #endif
 342.117 + #define _GLIBCXX_C_LOCALE_GNU 1
 342.118 + 
 342.119 +@@ -62,7 +64,7 @@
 342.120 + #endif
 342.121 + // #define _GLIBCXX_NUM_CATEGORIES 6
 342.122 + #define _GLIBCXX_NUM_CATEGORIES 0
 342.123 +- 
 342.124 ++
 342.125 + #ifdef __UCLIBC_HAS_XLOCALE__
 342.126 + namespace __gnu_cxx
 342.127 + {
 342.128 +@@ -79,22 +81,24 @@
 342.129 +   typedef int*			__c_locale;
 342.130 + #endif
 342.131 + 
 342.132 +-  // Convert numeric value of type _Tv to string and return length of
 342.133 +-  // string.  If snprintf is available use it, otherwise fall back to
 342.134 +-  // the unsafe sprintf which, in general, can be dangerous and should
 342.135 ++  // Convert numeric value of type double to string and return length of
 342.136 ++  // string.  If vsnprintf is available use it, otherwise fall back to
 342.137 ++  // the unsafe vsprintf which, in general, can be dangerous and should
 342.138 +   // be avoided.
 342.139 +-  template<typename _Tv>
 342.140 +-    int
 342.141 +-    __convert_from_v(char* __out, 
 342.142 +-		     const int __size __attribute__ ((__unused__)),
 342.143 +-		     const char* __fmt,
 342.144 +-#ifdef __UCLIBC_HAS_XCLOCALE__
 342.145 +-		     _Tv __v, const __c_locale& __cloc, int __prec)
 342.146 ++    inline int
 342.147 ++    __convert_from_v(const __c_locale&
 342.148 ++#ifndef __UCLIBC_HAS_XCLOCALE__
 342.149 ++					__cloc __attribute__ ((__unused__))
 342.150 ++#endif
 342.151 ++		     ,
 342.152 ++		     char* __out,
 342.153 ++		     const int __size,
 342.154 ++		     const char* __fmt, ...)
 342.155 +     {
 342.156 ++      va_list __args;
 342.157 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 342.158 +       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 342.159 + #else
 342.160 +-		     _Tv __v, const __c_locale&, int __prec)
 342.161 +-    {
 342.162 + # ifdef __UCLIBC_HAS_LOCALE__
 342.163 +       char* __old = std::setlocale(LC_ALL, NULL);
 342.164 +       char* __sav = new char[std::strlen(__old) + 1];
 342.165 +@@ -103,7 +107,9 @@
 342.166 + # endif
 342.167 + #endif
 342.168 + 
 342.169 +-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 342.170 ++      va_start(__args, __fmt);
 342.171 ++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 342.172 ++      va_end(__args);
 342.173 + 
 342.174 + #ifdef __UCLIBC_HAS_XCLOCALE__
 342.175 +       __gnu_cxx::__uselocale(__old);
 342.176 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 342.177 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 342.178 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:31:54.000000000 +0200
 342.179 +@@ -33,9 +33,14 @@
 342.180 + 
 342.181 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 342.182 + 
 342.183 ++#include <features.h>
 342.184 ++#ifdef __UCLIBC_HAS_LOCALE__
 342.185 + #define _LIBC
 342.186 + #include <locale>
 342.187 + #undef _LIBC
 342.188 ++#else
 342.189 ++#include <locale>
 342.190 ++#endif
 342.191 + #include <bits/c++locale_internal.h>
 342.192 + 
 342.193 + namespace std
 342.194 +@@ -138,20 +143,34 @@
 342.195 +   ctype<wchar_t>::
 342.196 +   do_is(mask __m, wchar_t __c) const
 342.197 +   { 
 342.198 +-    // Highest bitmask in ctype_base == 10, but extra in "C"
 342.199 +-    // library for blank.
 342.200 ++    // The case of __m == ctype_base::space is particularly important,
 342.201 ++    // due to its use in many istream functions.  Therefore we deal with
 342.202 ++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 342.203 ++    // is the mask corresponding to ctype_base::space.  NB: an encoding
 342.204 ++    // change would not affect correctness!
 342.205 +     bool __ret = false;
 342.206 +-    const size_t __bitmasksize = 11; 
 342.207 +-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 342.208 +-      if (__m & _M_bit[__bitcur]
 342.209 +-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 342.210 +-	{
 342.211 +-	  __ret = true;
 342.212 +-	  break;
 342.213 +-	}
 342.214 ++    if (__m == _M_bit[5])
 342.215 ++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 342.216 ++    else
 342.217 ++      {
 342.218 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 342.219 ++	// library for blank.
 342.220 ++	const size_t __bitmasksize = 11;
 342.221 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 342.222 ++	  if (__m & _M_bit[__bitcur])
 342.223 ++	    {
 342.224 ++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 342.225 ++		{
 342.226 ++		  __ret = true;
 342.227 ++		  break;
 342.228 ++		}
 342.229 ++	      else if (__m == _M_bit[__bitcur])
 342.230 ++		break;
 342.231 ++	    }
 342.232 ++      }
 342.233 +     return __ret;    
 342.234 +   }
 342.235 +-  
 342.236 ++
 342.237 +   const wchar_t* 
 342.238 +   ctype<wchar_t>::
 342.239 +   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 342.240 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 342.241 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 342.242 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
 342.243 +@@ -47,18 +47,21 @@
 342.244 +   template<typename _CharT>
 342.245 +      messages<_CharT>::messages(size_t __refs)
 342.246 +      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 342.247 +-     _M_name_messages(_S_get_c_name())
 342.248 ++       _M_name_messages(_S_get_c_name())
 342.249 +      { }
 342.250 + 
 342.251 +   template<typename _CharT>
 342.252 +      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 342.253 + 				size_t __refs) 
 342.254 +-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 342.255 +-     _M_name_messages(__s)
 342.256 ++     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 342.257 +      {
 342.258 +-       char* __tmp = new char[std::strlen(__s) + 1];
 342.259 +-       std::strcpy(__tmp, __s);
 342.260 ++       const size_t __len = std::strlen(__s) + 1;
 342.261 ++       char* __tmp = new char[__len];
 342.262 ++       std::memcpy(__tmp, __s, __len);
 342.263 +        _M_name_messages = __tmp;
 342.264 ++
 342.265 ++       // Last to avoid leaking memory if new throws.
 342.266 ++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 342.267 +      }
 342.268 + 
 342.269 +   template<typename _CharT>
 342.270 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 342.271 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
 342.272 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:54.000000000 +0200
 342.273 +@@ -33,9 +33,14 @@
 342.274 + 
 342.275 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 342.276 + 
 342.277 ++#include <features.h>
 342.278 ++#ifdef __UCLIBC_HAS_LOCALE__
 342.279 + #define _LIBC
 342.280 + #include <locale>
 342.281 + #undef _LIBC
 342.282 ++#else
 342.283 ++#include <locale>
 342.284 ++#endif
 342.285 + #include <bits/c++locale_internal.h>
 342.286 + 
 342.287 + #ifdef __UCLIBC_MJN3_ONLY__
 342.288 +@@ -206,7 +211,7 @@
 342.289 + 	  }
 342.290 + 	break;
 342.291 +       default:
 342.292 +-	;
 342.293 ++	__ret = pattern();
 342.294 +       }
 342.295 +     return __ret;
 342.296 +   }
 342.297 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 342.298 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
 342.299 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:54.000000000 +0200
 342.300 +@@ -33,9 +33,14 @@
 342.301 + 
 342.302 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 342.303 + 
 342.304 ++#include <features.h>
 342.305 ++#ifdef __UCLIBC_HAS_LOCALE__
 342.306 + #define _LIBC
 342.307 + #include <locale>
 342.308 + #undef _LIBC
 342.309 ++#else
 342.310 ++#include <locale>
 342.311 ++#endif
 342.312 + #include <bits/c++locale_internal.h>
 342.313 + 
 342.314 + #ifdef __UCLIBC_MJN3_ONLY__
 342.315 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
 342.316 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
 342.317 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
 342.318 +@@ -37,25 +37,33 @@
 342.319 +   template<typename _CharT>
 342.320 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
 342.321 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 342.322 +-    _M_name_timepunct(_S_get_c_name())
 342.323 ++      _M_name_timepunct(_S_get_c_name())
 342.324 +     { _M_initialize_timepunct(); }
 342.325 + 
 342.326 +   template<typename _CharT>
 342.327 +     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 342.328 +     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 342.329 +-    _M_name_timepunct(_S_get_c_name())
 342.330 ++      _M_name_timepunct(_S_get_c_name())
 342.331 +     { _M_initialize_timepunct(); }
 342.332 + 
 342.333 +   template<typename _CharT>
 342.334 +     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 342.335 + 				     size_t __refs) 
 342.336 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 342.337 +-    _M_name_timepunct(__s)
 342.338 ++      _M_name_timepunct(NULL)
 342.339 +     { 
 342.340 +-      char* __tmp = new char[std::strlen(__s) + 1];
 342.341 +-      std::strcpy(__tmp, __s);
 342.342 ++      const size_t __len = std::strlen(__s) + 1;
 342.343 ++      char* __tmp = new char[__len];
 342.344 ++      std::memcpy(__tmp, __s, __len);
 342.345 +       _M_name_timepunct = __tmp;
 342.346 +-      _M_initialize_timepunct(__cloc); 
 342.347 ++
 342.348 ++      try
 342.349 ++	{ _M_initialize_timepunct(__cloc); }
 342.350 ++      catch(...)
 342.351 ++	{
 342.352 ++	  delete [] _M_name_timepunct;
 342.353 ++	  __throw_exception_again;
 342.354 ++	}
 342.355 +     }
 342.356 + 
 342.357 +   template<typename _CharT>
   343.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   343.2 +++ b/patches/gcc/4.2.4/160-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   343.3 @@ -0,0 +1,50 @@
   343.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am gcc-4.2.1/libstdc++-v3/src/Makefile.am
   343.5 +--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am	2006-07-28 06:57:34.000000000 +0200
   343.6 ++++ gcc-4.2.1/libstdc++-v3/src/Makefile.am	2007-08-03 20:32:27.000000000 +0200
   343.7 +@@ -257,6 +257,12 @@
   343.8 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
   343.9 + 
  343.10 + 
  343.11 ++install-exec-local:
  343.12 ++ifeq ($(enable_shared),yes)
  343.13 ++	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  343.14 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  343.15 ++endif
  343.16 ++
  343.17 + # Added bits to build debug library.
  343.18 + if GLIBCXX_BUILD_DEBUG
  343.19 + all-local: build_debug
  343.20 +diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in gcc-4.2.1/libstdc++-v3/src/Makefile.in
  343.21 +--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in	2006-10-16 21:08:22.000000000 +0200
  343.22 ++++ gcc-4.2.1/libstdc++-v3/src/Makefile.in	2007-08-03 20:32:27.000000000 +0200
  343.23 +@@ -657,7 +657,7 @@
  343.24 + 
  343.25 + install-data-am: install-data-local
  343.26 + 
  343.27 +-install-exec-am: install-toolexeclibLTLIBRARIES
  343.28 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  343.29 + 
  343.30 + install-info: install-info-am
  343.31 + 
  343.32 +@@ -690,6 +690,7 @@
  343.33 + 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  343.34 + 	html-am info info-am install install-am install-data \
  343.35 + 	install-data-am install-data-local install-exec \
  343.36 ++	install-exec-local \
  343.37 + 	install-exec-am install-info install-info-am install-man \
  343.38 + 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  343.39 + 	installcheck-am installdirs maintainer-clean \
  343.40 +@@ -799,6 +800,13 @@
  343.41 + install_debug:
  343.42 + 	(cd ${debugdir} && $(MAKE) \
  343.43 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  343.44 ++
  343.45 ++install-exec-local:
  343.46 ++ifeq ($(enable_shared),yes)
  343.47 ++	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  343.48 ++	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  343.49 ++endif
  343.50 ++
  343.51 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  343.52 + # Otherwise a system limit (for SysV at least) may be exceeded.
  343.53 + .NOEXPORT:
   344.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   344.2 +++ b/patches/gcc/4.2.4/170-missing-execinfo_h.patch	Mon Jul 28 21:32:33 2008 +0000
   344.3 @@ -0,0 +1,12 @@
   344.4 +diff -durN gcc-4.2.1.orig/boehm-gc/include/gc.h gcc-4.2.1/boehm-gc/include/gc.h
   344.5 +--- gcc-4.2.1.orig/boehm-gc/include/gc.h	2006-09-18 20:45:08.000000000 +0200
   344.6 ++++ gcc-4.2.1/boehm-gc/include/gc.h	2007-08-03 20:33:00.000000000 +0200
   344.7 +@@ -502,7 +502,7 @@
   344.8 + #if defined(__linux__) || defined(__GLIBC__)
   344.9 + # include <features.h>
  344.10 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  344.11 +-     && !defined(__ia64__)
  344.12 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  344.13 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  344.14 + #     define GC_HAVE_BUILTIN_BACKTRACE
  344.15 + #   endif
   345.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   345.2 +++ b/patches/gcc/4.2.4/180-c99-snprintf.patch	Mon Jul 28 21:32:33 2008 +0000
   345.3 @@ -0,0 +1,12 @@
   345.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h
   345.5 +--- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h	2006-12-07 10:33:51.000000000 +0100
   345.6 ++++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h	2007-08-03 20:33:24.000000000 +0200
   345.7 +@@ -144,7 +144,7 @@
   345.8 + 
   345.9 + _GLIBCXX_END_NAMESPACE
  345.10 + 
  345.11 +-#if _GLIBCXX_USE_C99
  345.12 ++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  345.13 + 
  345.14 + #undef snprintf
  345.15 + #undef vfscanf
   346.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   346.2 +++ b/patches/gcc/4.2.4/190-c99-complex-ugly-hack.patch	Mon Jul 28 21:32:33 2008 +0000
   346.3 @@ -0,0 +1,13 @@
   346.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
   346.5 +--- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
   346.6 ++++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:33:56.000000000 +0200
   346.7 +@@ -7514,6 +7514,9 @@
   346.8 + cat >>conftest.$ac_ext <<_ACEOF
   346.9 + /* end confdefs.h.  */
  346.10 + #include <complex.h>
  346.11 ++#ifdef __UCLIBC__
  346.12 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  346.13 ++#endif
  346.14 + int
  346.15 + main ()
  346.16 + {
   347.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   347.2 +++ b/patches/gcc/4.2.4/200-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
   347.3 @@ -0,0 +1,26 @@
   347.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/rope gcc-4.2.1/libstdc++-v3/include/ext/rope
   347.5 +--- gcc-4.2.1.orig/libstdc++-v3/include/ext/rope	2006-10-17 13:56:21.000000000 +0200
   347.6 ++++ gcc-4.2.1/libstdc++-v3/include/ext/rope	2007-08-03 20:34:23.000000000 +0200
   347.7 +@@ -58,6 +58,9 @@
   347.8 + #include <bits/allocator.h>
   347.9 + #include <ext/hash_fun.h>
  347.10 + 
  347.11 ++/* cope w/ index defined as macro, SuSv3 proposal */
  347.12 ++#undef index
  347.13 ++
  347.14 + # ifdef __GC
  347.15 + #   define __GC_CONST const
  347.16 + # else
  347.17 +diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h
  347.18 +--- gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2006-10-17 13:56:21.000000000 +0200
  347.19 ++++ gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h	2007-08-03 20:34:23.000000000 +0200
  347.20 +@@ -54,6 +54,9 @@
  347.21 + #include <ext/memory> // For uninitialized_copy_n
  347.22 + #include <ext/numeric> // For power
  347.23 + 
  347.24 ++/* cope w/ index defined as macro, SuSv3 proposal */
  347.25 ++#undef index
  347.26 ++
  347.27 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  347.28 + 
  347.29 +   using std::size_t;
   348.1 --- a/patches/gcc/4.2.4/200-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   348.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   348.3 @@ -1,2806 +0,0 @@
   348.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 gcc-4.2.1/libstdc++-v3/acinclude.m4
   348.5 ---- gcc-4.2.1.orig/libstdc++-v3/acinclude.m4	2007-06-29 01:02:05.000000000 +0200
   348.6 -+++ gcc-4.2.1/libstdc++-v3/acinclude.m4	2007-08-03 20:30:21.000000000 +0200
   348.7 -@@ -1334,7 +1334,7 @@
   348.8 - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   348.9 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  348.10 -     [use MODEL for target locale package],
  348.11 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  348.12 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  348.13 - 
  348.14 -   # Deal with gettext issues.  Default to not using it (=no) until we detect
  348.15 -   # support for it later.  Let the user turn it off via --e/d, but let that
  348.16 -@@ -1355,6 +1355,9 @@
  348.17 -   # Default to "generic".
  348.18 -   if test $enable_clocale_flag = auto; then
  348.19 -     case ${target_os} in
  348.20 -+      *-uclibc*)
  348.21 -+        enable_clocale_flag=uclibc
  348.22 -+        ;;
  348.23 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  348.24 -         enable_clocale_flag=gnu	
  348.25 -         ;;
  348.26 -@@ -1526,6 +1529,40 @@
  348.27 -       CTIME_CC=config/locale/generic/time_members.cc
  348.28 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  348.29 -       ;;
  348.30 -+    uclibc)
  348.31 -+      AC_MSG_RESULT(uclibc)
  348.32 -+
  348.33 -+      # Declare intention to use gettext, and add support for specific
  348.34 -+      # languages.
  348.35 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  348.36 -+      ALL_LINGUAS="de fr"
  348.37 -+
  348.38 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  348.39 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  348.40 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  348.41 -+        USE_NLS=yes
  348.42 -+      fi
  348.43 -+      # Export the build objects.
  348.44 -+      for ling in $ALL_LINGUAS; do \
  348.45 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  348.46 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  348.47 -+      done
  348.48 -+      AC_SUBST(glibcxx_MOFILES)
  348.49 -+      AC_SUBST(glibcxx_POFILES)
  348.50 -+
  348.51 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  348.52 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  348.53 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  348.54 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  348.55 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  348.56 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  348.57 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  348.58 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  348.59 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  348.60 -+      CTIME_H=config/locale/uclibc/time_members.h
  348.61 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  348.62 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  348.63 -+      ;;
  348.64 -   esac
  348.65 - 
  348.66 -   # This is where the testsuite looks for locale catalogs, using the
  348.67 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
  348.68 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  348.69 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
  348.70 -@@ -0,0 +1,160 @@
  348.71 -+// Wrapper for underlying C-language localization -*- C++ -*-
  348.72 -+
  348.73 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  348.74 -+//
  348.75 -+// This file is part of the GNU ISO C++ Library.  This library is free
  348.76 -+// software; you can redistribute it and/or modify it under the
  348.77 -+// terms of the GNU General Public License as published by the
  348.78 -+// Free Software Foundation; either version 2, or (at your option)
  348.79 -+// any later version.
  348.80 -+
  348.81 -+// This library is distributed in the hope that it will be useful,
  348.82 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  348.83 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  348.84 -+// GNU General Public License for more details.
  348.85 -+
  348.86 -+// You should have received a copy of the GNU General Public License along
  348.87 -+// with this library; see the file COPYING.  If not, write to the Free
  348.88 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  348.89 -+// USA.
  348.90 -+
  348.91 -+// As a special exception, you may use this file as part of a free software
  348.92 -+// library without restriction.  Specifically, if other files instantiate
  348.93 -+// templates or use macros or inline functions from this file, or you compile
  348.94 -+// this file and link it with other files to produce an executable, this
  348.95 -+// file does not by itself cause the resulting executable to be covered by
  348.96 -+// the GNU General Public License.  This exception does not however
  348.97 -+// invalidate any other reasons why the executable file might be covered by
  348.98 -+// the GNU General Public License.
  348.99 -+
 348.100 -+//
 348.101 -+// ISO C++ 14882: 22.8  Standard locale categories.
 348.102 -+//
 348.103 -+
 348.104 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 348.105 -+
 348.106 -+#include <cerrno>  // For errno
 348.107 -+#include <locale>
 348.108 -+#include <stdexcept>
 348.109 -+#include <langinfo.h>
 348.110 -+#include <bits/c++locale_internal.h>
 348.111 -+
 348.112 -+#ifndef __UCLIBC_HAS_XLOCALE__
 348.113 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 348.114 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 348.115 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 348.116 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 348.117 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 348.118 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 348.119 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 348.120 -+#warning should dummy __newlocale check for C|POSIX ?
 348.121 -+#define __newlocale(a, b, c)        NULL
 348.122 -+#define __freelocale(a)             ((void)0)
 348.123 -+#define __duplocale(a)              __c_locale()
 348.124 -+#endif
 348.125 -+
 348.126 -+namespace std 
 348.127 -+{
 348.128 -+  template<>
 348.129 -+    void
 348.130 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 348.131 -+		   const __c_locale& __cloc)
 348.132 -+    {
 348.133 -+      if (!(__err & ios_base::failbit))
 348.134 -+	{
 348.135 -+	  char* __sanity;
 348.136 -+	  errno = 0;
 348.137 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
 348.138 -+          if (__sanity != __s && errno != ERANGE)
 348.139 -+	    __v = __f;
 348.140 -+	  else
 348.141 -+	    __err |= ios_base::failbit;
 348.142 -+	}
 348.143 -+    }
 348.144 -+
 348.145 -+  template<>
 348.146 -+    void
 348.147 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 348.148 -+		   const __c_locale& __cloc)
 348.149 -+    {
 348.150 -+      if (!(__err & ios_base::failbit))
 348.151 -+	{
 348.152 -+	  char* __sanity;
 348.153 -+	  errno = 0;
 348.154 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
 348.155 -+          if (__sanity != __s && errno != ERANGE)
 348.156 -+	    __v = __d;
 348.157 -+	  else
 348.158 -+	    __err |= ios_base::failbit;
 348.159 -+	}
 348.160 -+    }
 348.161 -+
 348.162 -+  template<>
 348.163 -+    void
 348.164 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 348.165 -+		   const __c_locale& __cloc)
 348.166 -+    {
 348.167 -+      if (!(__err & ios_base::failbit))
 348.168 -+	{
 348.169 -+	  char* __sanity;
 348.170 -+	  errno = 0;
 348.171 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 348.172 -+          if (__sanity != __s && errno != ERANGE)
 348.173 -+	    __v = __ld;
 348.174 -+	  else
 348.175 -+	    __err |= ios_base::failbit;
 348.176 -+	}
 348.177 -+    }
 348.178 -+
 348.179 -+  void
 348.180 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 348.181 -+				    __c_locale __old)
 348.182 -+  {
 348.183 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 348.184 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.185 -+    if (!__cloc)
 348.186 -+      {
 348.187 -+	// This named locale is not supported by the underlying OS.
 348.188 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 348.189 -+			      "name not valid"));
 348.190 -+      }
 348.191 -+#endif
 348.192 -+  }
 348.193 -+  
 348.194 -+  void
 348.195 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 348.196 -+  {
 348.197 -+    if (_S_get_c_locale() != __cloc)
 348.198 -+      __freelocale(__cloc); 
 348.199 -+  }
 348.200 -+
 348.201 -+  __c_locale
 348.202 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 348.203 -+  { return __duplocale(__cloc); }
 348.204 -+} // namespace std
 348.205 -+
 348.206 -+namespace __gnu_cxx
 348.207 -+{
 348.208 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 348.209 -+    {
 348.210 -+      "LC_CTYPE", 
 348.211 -+      "LC_NUMERIC",
 348.212 -+      "LC_TIME", 
 348.213 -+      "LC_COLLATE", 
 348.214 -+      "LC_MONETARY",
 348.215 -+      "LC_MESSAGES", 
 348.216 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 348.217 -+      "LC_PAPER", 
 348.218 -+      "LC_NAME", 
 348.219 -+      "LC_ADDRESS",
 348.220 -+      "LC_TELEPHONE", 
 348.221 -+      "LC_MEASUREMENT", 
 348.222 -+      "LC_IDENTIFICATION" 
 348.223 -+#endif
 348.224 -+    };
 348.225 -+}
 348.226 -+
 348.227 -+namespace std
 348.228 -+{
 348.229 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 348.230 -+}  // namespace std
 348.231 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
 348.232 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 348.233 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
 348.234 -@@ -0,0 +1,117 @@
 348.235 -+// Wrapper for underlying C-language localization -*- C++ -*-
 348.236 -+
 348.237 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 348.238 -+//
 348.239 -+// This file is part of the GNU ISO C++ Library.  This library is free
 348.240 -+// software; you can redistribute it and/or modify it under the
 348.241 -+// terms of the GNU General Public License as published by the
 348.242 -+// Free Software Foundation; either version 2, or (at your option)
 348.243 -+// any later version.
 348.244 -+
 348.245 -+// This library is distributed in the hope that it will be useful,
 348.246 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 348.247 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 348.248 -+// GNU General Public License for more details.
 348.249 -+
 348.250 -+// You should have received a copy of the GNU General Public License along
 348.251 -+// with this library; see the file COPYING.  If not, write to the Free
 348.252 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 348.253 -+// USA.
 348.254 -+
 348.255 -+// As a special exception, you may use this file as part of a free software
 348.256 -+// library without restriction.  Specifically, if other files instantiate
 348.257 -+// templates or use macros or inline functions from this file, or you compile
 348.258 -+// this file and link it with other files to produce an executable, this
 348.259 -+// file does not by itself cause the resulting executable to be covered by
 348.260 -+// the GNU General Public License.  This exception does not however
 348.261 -+// invalidate any other reasons why the executable file might be covered by
 348.262 -+// the GNU General Public License.
 348.263 -+
 348.264 -+//
 348.265 -+// ISO C++ 14882: 22.8  Standard locale categories.
 348.266 -+//
 348.267 -+
 348.268 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 348.269 -+
 348.270 -+#ifndef _C_LOCALE_H
 348.271 -+#define _C_LOCALE_H 1
 348.272 -+
 348.273 -+#pragma GCC system_header
 348.274 -+
 348.275 -+#include <cstring>              // get std::strlen
 348.276 -+#include <cstdio>               // get std::snprintf or std::sprintf
 348.277 -+#include <clocale>
 348.278 -+#include <langinfo.h>		// For codecvt
 348.279 -+#ifdef __UCLIBC_MJN3_ONLY__
 348.280 -+#warning fix this
 348.281 -+#endif
 348.282 -+#ifdef __UCLIBC_HAS_LOCALE__
 348.283 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 348.284 -+#endif
 348.285 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 348.286 -+#include <libintl.h> 		// For messages
 348.287 -+#endif
 348.288 -+
 348.289 -+#ifdef __UCLIBC_MJN3_ONLY__
 348.290 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 348.291 -+#endif
 348.292 -+#define _GLIBCXX_C_LOCALE_GNU 1
 348.293 -+
 348.294 -+#ifdef __UCLIBC_MJN3_ONLY__
 348.295 -+#warning fix categories
 348.296 -+#endif
 348.297 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 348.298 -+#define _GLIBCXX_NUM_CATEGORIES 0
 348.299 -+ 
 348.300 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.301 -+namespace __gnu_cxx
 348.302 -+{
 348.303 -+  extern "C" __typeof(uselocale) __uselocale;
 348.304 -+}
 348.305 -+#endif
 348.306 -+
 348.307 -+namespace std
 348.308 -+{
 348.309 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.310 -+  typedef __locale_t		__c_locale;
 348.311 -+#else
 348.312 -+  typedef int*			__c_locale;
 348.313 -+#endif
 348.314 -+
 348.315 -+  // Convert numeric value of type _Tv to string and return length of
 348.316 -+  // string.  If snprintf is available use it, otherwise fall back to
 348.317 -+  // the unsafe sprintf which, in general, can be dangerous and should
 348.318 -+  // be avoided.
 348.319 -+  template<typename _Tv>
 348.320 -+    int
 348.321 -+    __convert_from_v(char* __out, 
 348.322 -+		     const int __size __attribute__ ((__unused__)),
 348.323 -+		     const char* __fmt,
 348.324 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 348.325 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 348.326 -+    {
 348.327 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 348.328 -+#else
 348.329 -+		     _Tv __v, const __c_locale&, int __prec)
 348.330 -+    {
 348.331 -+# ifdef __UCLIBC_HAS_LOCALE__
 348.332 -+      char* __old = std::setlocale(LC_ALL, NULL);
 348.333 -+      char* __sav = new char[std::strlen(__old) + 1];
 348.334 -+      std::strcpy(__sav, __old);
 348.335 -+      std::setlocale(LC_ALL, "C");
 348.336 -+# endif
 348.337 -+#endif
 348.338 -+
 348.339 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 348.340 -+
 348.341 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 348.342 -+      __gnu_cxx::__uselocale(__old);
 348.343 -+#elif defined __UCLIBC_HAS_LOCALE__
 348.344 -+      std::setlocale(LC_ALL, __sav);
 348.345 -+      delete [] __sav;
 348.346 -+#endif
 348.347 -+      return __ret;
 348.348 -+    }
 348.349 -+}
 348.350 -+
 348.351 -+#endif
 348.352 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
 348.353 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
 348.354 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
 348.355 -@@ -0,0 +1,63 @@
 348.356 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
 348.357 -+
 348.358 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
 348.359 -+//
 348.360 -+// This file is part of the GNU ISO C++ Library.  This library is free
 348.361 -+// software; you can redistribute it and/or modify it under the
 348.362 -+// terms of the GNU General Public License as published by the
 348.363 -+// Free Software Foundation; either version 2, or (at your option)
 348.364 -+// any later version.
 348.365 -+
 348.366 -+// This library is distributed in the hope that it will be useful,
 348.367 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 348.368 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 348.369 -+// GNU General Public License for more details.
 348.370 -+
 348.371 -+// You should have received a copy of the GNU General Public License along
 348.372 -+// with this library; see the file COPYING.  If not, write to the Free
 348.373 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 348.374 -+// USA.
 348.375 -+
 348.376 -+// As a special exception, you may use this file as part of a free software
 348.377 -+// library without restriction.  Specifically, if other files instantiate
 348.378 -+// templates or use macros or inline functions from this file, or you compile
 348.379 -+// this file and link it with other files to produce an executable, this
 348.380 -+// file does not by itself cause the resulting executable to be covered by
 348.381 -+// the GNU General Public License.  This exception does not however
 348.382 -+// invalidate any other reasons why the executable file might be covered by
 348.383 -+// the GNU General Public License.
 348.384 -+
 348.385 -+// Written by Jakub Jelinek <jakub@redhat.com>
 348.386 -+
 348.387 -+#include <bits/c++config.h>
 348.388 -+#include <clocale>
 348.389 -+
 348.390 -+#ifdef __UCLIBC_MJN3_ONLY__
 348.391 -+#warning clean this up
 348.392 -+#endif
 348.393 -+
 348.394 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.395 -+                                                  
 348.396 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 348.397 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 348.398 -+extern "C" __typeof(strftime_l) __strftime_l;
 348.399 -+extern "C" __typeof(strtod_l) __strtod_l;
 348.400 -+extern "C" __typeof(strtof_l) __strtof_l;
 348.401 -+extern "C" __typeof(strtold_l) __strtold_l;
 348.402 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 348.403 -+extern "C" __typeof(newlocale) __newlocale;
 348.404 -+extern "C" __typeof(freelocale) __freelocale;
 348.405 -+extern "C" __typeof(duplocale) __duplocale;
 348.406 -+extern "C" __typeof(uselocale) __uselocale;
 348.407 -+
 348.408 -+#ifdef _GLIBCXX_USE_WCHAR_T
 348.409 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 348.410 -+extern "C" __typeof(towlower_l) __towlower_l;
 348.411 -+extern "C" __typeof(towupper_l) __towupper_l;
 348.412 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 348.413 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 348.414 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 348.415 -+extern "C" __typeof(wctype_l) __wctype_l;
 348.416 -+#endif 
 348.417 -+
 348.418 -+#endif // GLIBC 2.3 and later
 348.419 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 348.420 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 348.421 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2007-08-03 20:30:21.000000000 +0200
 348.422 -@@ -0,0 +1,306 @@
 348.423 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 348.424 -+
 348.425 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 348.426 -+//
 348.427 -+// This file is part of the GNU ISO C++ Library.  This library is free
 348.428 -+// software; you can redistribute it and/or modify it under the
 348.429 -+// terms of the GNU General Public License as published by the
 348.430 -+// Free Software Foundation; either version 2, or (at your option)
 348.431 -+// any later version.
 348.432 -+
 348.433 -+// This library is distributed in the hope that it will be useful,
 348.434 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 348.435 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 348.436 -+// GNU General Public License for more details.
 348.437 -+
 348.438 -+// You should have received a copy of the GNU General Public License along
 348.439 -+// with this library; see the file COPYING.  If not, write to the Free
 348.440 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 348.441 -+// USA.
 348.442 -+
 348.443 -+// As a special exception, you may use this file as part of a free software
 348.444 -+// library without restriction.  Specifically, if other files instantiate
 348.445 -+// templates or use macros or inline functions from this file, or you compile
 348.446 -+// this file and link it with other files to produce an executable, this
 348.447 -+// file does not by itself cause the resulting executable to be covered by
 348.448 -+// the GNU General Public License.  This exception does not however
 348.449 -+// invalidate any other reasons why the executable file might be covered by
 348.450 -+// the GNU General Public License.
 348.451 -+
 348.452 -+//
 348.453 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 348.454 -+//
 348.455 -+
 348.456 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 348.457 -+
 348.458 -+#include <locale>
 348.459 -+#include <bits/c++locale_internal.h>
 348.460 -+
 348.461 -+namespace std
 348.462 -+{
 348.463 -+  // Specializations.
 348.464 -+#ifdef _GLIBCXX_USE_WCHAR_T
 348.465 -+  codecvt_base::result
 348.466 -+  codecvt<wchar_t, char, mbstate_t>::
 348.467 -+  do_out(state_type& __state, const intern_type* __from, 
 348.468 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 348.469 -+	 extern_type* __to, extern_type* __to_end,
 348.470 -+	 extern_type*& __to_next) const
 348.471 -+  {
 348.472 -+    result __ret = ok;
 348.473 -+    state_type __tmp_state(__state);
 348.474 -+
 348.475 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.476 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 348.477 -+#endif
 348.478 -+
 348.479 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 348.480 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 348.481 -+    // NB: wcsnrtombs is a GNU extension
 348.482 -+    for (__from_next = __from, __to_next = __to;
 348.483 -+	 __from_next < __from_end && __to_next < __to_end
 348.484 -+	 && __ret == ok;)
 348.485 -+      {
 348.486 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 348.487 -+						      __from_end - __from_next);
 348.488 -+	if (!__from_chunk_end)
 348.489 -+	  __from_chunk_end = __from_end;
 348.490 -+
 348.491 -+	__from = __from_next;
 348.492 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 348.493 -+					 __from_chunk_end - __from_next,
 348.494 -+					 __to_end - __to_next, &__state);
 348.495 -+	if (__conv == static_cast<size_t>(-1))
 348.496 -+	  {
 348.497 -+	    // In case of error, in order to stop at the exact place we
 348.498 -+	    // have to start again from the beginning with a series of
 348.499 -+	    // wcrtomb.
 348.500 -+	    for (; __from < __from_next; ++__from)
 348.501 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 348.502 -+	    __state = __tmp_state;
 348.503 -+	    __ret = error;
 348.504 -+	  }
 348.505 -+	else if (__from_next && __from_next < __from_chunk_end)
 348.506 -+	  {
 348.507 -+	    __to_next += __conv;
 348.508 -+	    __ret = partial;
 348.509 -+	  }
 348.510 -+	else
 348.511 -+	  {
 348.512 -+	    __from_next = __from_chunk_end;
 348.513 -+	    __to_next += __conv;
 348.514 -+	  }
 348.515 -+
 348.516 -+	if (__from_next < __from_end && __ret == ok)
 348.517 -+	  {
 348.518 -+	    extern_type __buf[MB_LEN_MAX];
 348.519 -+	    __tmp_state = __state;
 348.520 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 348.521 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 348.522 -+	      __ret = partial;
 348.523 -+	    else
 348.524 -+	      {
 348.525 -+		memcpy(__to_next, __buf, __conv);
 348.526 -+		__state = __tmp_state;
 348.527 -+		__to_next += __conv;
 348.528 -+		++__from_next;
 348.529 -+	      }
 348.530 -+	  }
 348.531 -+      }
 348.532 -+
 348.533 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.534 -+    __uselocale(__old);
 348.535 -+#endif
 348.536 -+
 348.537 -+    return __ret; 
 348.538 -+  }
 348.539 -+  
 348.540 -+  codecvt_base::result
 348.541 -+  codecvt<wchar_t, char, mbstate_t>::
 348.542 -+  do_in(state_type& __state, const extern_type* __from, 
 348.543 -+	const extern_type* __from_end, const extern_type*& __from_next,
 348.544 -+	intern_type* __to, intern_type* __to_end,
 348.545 -+	intern_type*& __to_next) const
 348.546 -+  {
 348.547 -+    result __ret = ok;
 348.548 -+    state_type __tmp_state(__state);
 348.549 -+
 348.550 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.551 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 348.552 -+#endif
 348.553 -+
 348.554 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 348.555 -+    // in case we store a L'\0' and then continue, in a loop.
 348.556 -+    // NB: mbsnrtowcs is a GNU extension
 348.557 -+    for (__from_next = __from, __to_next = __to;
 348.558 -+	 __from_next < __from_end && __to_next < __to_end
 348.559 -+	 && __ret == ok;)
 348.560 -+      {
 348.561 -+	const extern_type* __from_chunk_end;
 348.562 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 348.563 -+								  __from_end
 348.564 -+								  - __from_next));
 348.565 -+	if (!__from_chunk_end)
 348.566 -+	  __from_chunk_end = __from_end;
 348.567 -+
 348.568 -+	__from = __from_next;
 348.569 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 348.570 -+				   __from_chunk_end - __from_next,
 348.571 -+				   __to_end - __to_next, &__state);
 348.572 -+	if (__conv == static_cast<size_t>(-1))
 348.573 -+	  {
 348.574 -+	    // In case of error, in order to stop at the exact place we
 348.575 -+	    // have to start again from the beginning with a series of
 348.576 -+	    // mbrtowc.
 348.577 -+	    for (;; ++__to_next, __from += __conv)
 348.578 -+	      {
 348.579 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 348.580 -+				 &__tmp_state);
 348.581 -+		if (__conv == static_cast<size_t>(-1)
 348.582 -+		    || __conv == static_cast<size_t>(-2))
 348.583 -+		  break;
 348.584 -+	      }
 348.585 -+	    __from_next = __from;
 348.586 -+	    __state = __tmp_state;	    
 348.587 -+	    __ret = error;
 348.588 -+	  }
 348.589 -+	else if (__from_next && __from_next < __from_chunk_end)
 348.590 -+	  {
 348.591 -+	    // It is unclear what to return in this case (see DR 382). 
 348.592 -+	    __to_next += __conv;
 348.593 -+	    __ret = partial;
 348.594 -+	  }
 348.595 -+	else
 348.596 -+	  {
 348.597 -+	    __from_next = __from_chunk_end;
 348.598 -+	    __to_next += __conv;
 348.599 -+	  }
 348.600 -+
 348.601 -+	if (__from_next < __from_end && __ret == ok)
 348.602 -+	  {
 348.603 -+	    if (__to_next < __to_end)
 348.604 -+	      {
 348.605 -+		// XXX Probably wrong for stateful encodings
 348.606 -+		__tmp_state = __state;		
 348.607 -+		++__from_next;
 348.608 -+		*__to_next++ = L'\0';
 348.609 -+	      }
 348.610 -+	    else
 348.611 -+	      __ret = partial;
 348.612 -+	  }
 348.613 -+      }
 348.614 -+
 348.615 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.616 -+    __uselocale(__old);
 348.617 -+#endif
 348.618 -+
 348.619 -+    return __ret; 
 348.620 -+  }
 348.621 -+
 348.622 -+  int 
 348.623 -+  codecvt<wchar_t, char, mbstate_t>::
 348.624 -+  do_encoding() const throw()
 348.625 -+  {
 348.626 -+    // XXX This implementation assumes that the encoding is
 348.627 -+    // stateless and is either single-byte or variable-width.
 348.628 -+    int __ret = 0;
 348.629 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.630 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 348.631 -+#endif
 348.632 -+    if (MB_CUR_MAX == 1)
 348.633 -+      __ret = 1;
 348.634 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.635 -+    __uselocale(__old);
 348.636 -+#endif
 348.637 -+    return __ret;
 348.638 -+  }  
 348.639 -+
 348.640 -+  int 
 348.641 -+  codecvt<wchar_t, char, mbstate_t>::
 348.642 -+  do_max_length() const throw()
 348.643 -+  {
 348.644 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.645 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 348.646 -+#endif
 348.647 -+    // XXX Probably wrong for stateful encodings.
 348.648 -+    int __ret = MB_CUR_MAX;
 348.649 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.650 -+    __uselocale(__old);
 348.651 -+#endif
 348.652 -+    return __ret;
 348.653 -+  }
 348.654 -+  
 348.655 -+  int 
 348.656 -+  codecvt<wchar_t, char, mbstate_t>::
 348.657 -+  do_length(state_type& __state, const extern_type* __from,
 348.658 -+	    const extern_type* __end, size_t __max) const
 348.659 -+  {
 348.660 -+    int __ret = 0;
 348.661 -+    state_type __tmp_state(__state);
 348.662 -+
 348.663 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.664 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 348.665 -+#endif
 348.666 -+
 348.667 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 348.668 -+    // in case we advance past it and then continue, in a loop.
 348.669 -+    // NB: mbsnrtowcs is a GNU extension
 348.670 -+  
 348.671 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 348.672 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 348.673 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 348.674 -+							   * __max));
 348.675 -+    while (__from < __end && __max)
 348.676 -+      {
 348.677 -+	const extern_type* __from_chunk_end;
 348.678 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 348.679 -+								  __end
 348.680 -+								  - __from));
 348.681 -+	if (!__from_chunk_end)
 348.682 -+	  __from_chunk_end = __end;
 348.683 -+
 348.684 -+	const extern_type* __tmp_from = __from;
 348.685 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 348.686 -+				   __from_chunk_end - __from,
 348.687 -+				   __max, &__state);
 348.688 -+	if (__conv == static_cast<size_t>(-1))
 348.689 -+	  {
 348.690 -+	    // In case of error, in order to stop at the exact place we
 348.691 -+	    // have to start again from the beginning with a series of
 348.692 -+	    // mbrtowc.
 348.693 -+	    for (__from = __tmp_from;; __from += __conv)
 348.694 -+	      {
 348.695 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 348.696 -+				 &__tmp_state);
 348.697 -+		if (__conv == static_cast<size_t>(-1)
 348.698 -+		    || __conv == static_cast<size_t>(-2))
 348.699 -+		  break;
 348.700 -+	      }
 348.701 -+	    __state = __tmp_state;
 348.702 -+	    __ret += __from - __tmp_from;
 348.703 -+	    break;
 348.704 -+	  }
 348.705 -+	if (!__from)
 348.706 -+	  __from = __from_chunk_end;
 348.707 -+	
 348.708 -+	__ret += __from - __tmp_from;
 348.709 -+	__max -= __conv;
 348.710 -+
 348.711 -+	if (__from < __end && __max)
 348.712 -+	  {
 348.713 -+	    // XXX Probably wrong for stateful encodings
 348.714 -+	    __tmp_state = __state;
 348.715 -+	    ++__from;
 348.716 -+	    ++__ret;
 348.717 -+	    --__max;
 348.718 -+	  }
 348.719 -+      }
 348.720 -+
 348.721 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.722 -+    __uselocale(__old);
 348.723 -+#endif
 348.724 -+
 348.725 -+    return __ret; 
 348.726 -+  }
 348.727 -+#endif
 348.728 -+}
 348.729 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
 348.730 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 348.731 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
 348.732 -@@ -0,0 +1,80 @@
 348.733 -+// std::collate implementation details, GNU version -*- C++ -*-
 348.734 -+
 348.735 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 348.736 -+//
 348.737 -+// This file is part of the GNU ISO C++ Library.  This library is free
 348.738 -+// software; you can redistribute it and/or modify it under the
 348.739 -+// terms of the GNU General Public License as published by the
 348.740 -+// Free Software Foundation; either version 2, or (at your option)
 348.741 -+// any later version.
 348.742 -+
 348.743 -+// This library is distributed in the hope that it will be useful,
 348.744 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 348.745 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 348.746 -+// GNU General Public License for more details.
 348.747 -+
 348.748 -+// You should have received a copy of the GNU General Public License along
 348.749 -+// with this library; see the file COPYING.  If not, write to the Free
 348.750 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 348.751 -+// USA.
 348.752 -+
 348.753 -+// As a special exception, you may use this file as part of a free software
 348.754 -+// library without restriction.  Specifically, if other files instantiate
 348.755 -+// templates or use macros or inline functions from this file, or you compile
 348.756 -+// this file and link it with other files to produce an executable, this
 348.757 -+// file does not by itself cause the resulting executable to be covered by
 348.758 -+// the GNU General Public License.  This exception does not however
 348.759 -+// invalidate any other reasons why the executable file might be covered by
 348.760 -+// the GNU General Public License.
 348.761 -+
 348.762 -+//
 348.763 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 348.764 -+//
 348.765 -+
 348.766 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 348.767 -+
 348.768 -+#include <locale>
 348.769 -+#include <bits/c++locale_internal.h>
 348.770 -+
 348.771 -+#ifndef __UCLIBC_HAS_XLOCALE__
 348.772 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 348.773 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 348.774 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 348.775 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 348.776 -+#endif
 348.777 -+
 348.778 -+namespace std
 348.779 -+{
 348.780 -+  // These are basically extensions to char_traits, and perhaps should
 348.781 -+  // be put there instead of here.
 348.782 -+  template<>
 348.783 -+    int 
 348.784 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 348.785 -+    { 
 348.786 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 348.787 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 348.788 -+    }
 348.789 -+  
 348.790 -+  template<>
 348.791 -+    size_t
 348.792 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 348.793 -+				size_t __n) const 
 348.794 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 348.795 -+
 348.796 -+#ifdef _GLIBCXX_USE_WCHAR_T
 348.797 -+  template<>
 348.798 -+    int 
 348.799 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 348.800 -+				 const wchar_t* __two) const
 348.801 -+    {
 348.802 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 348.803 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 348.804 -+    }
 348.805 -+  
 348.806 -+  template<>
 348.807 -+    size_t
 348.808 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 348.809 -+				   size_t __n) const
 348.810 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 348.811 -+#endif
 348.812 -+}
 348.813 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 348.814 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 348.815 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 348.816 -@@ -0,0 +1,300 @@
 348.817 -+// std::ctype implementation details, GNU version -*- C++ -*-
 348.818 -+
 348.819 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 348.820 -+//
 348.821 -+// This file is part of the GNU ISO C++ Library.  This library is free
 348.822 -+// software; you can redistribute it and/or modify it under the
 348.823 -+// terms of the GNU General Public License as published by the
 348.824 -+// Free Software Foundation; either version 2, or (at your option)
 348.825 -+// any later version.
 348.826 -+
 348.827 -+// This library is distributed in the hope that it will be useful,
 348.828 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 348.829 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 348.830 -+// GNU General Public License for more details.
 348.831 -+
 348.832 -+// You should have received a copy of the GNU General Public License along
 348.833 -+// with this library; see the file COPYING.  If not, write to the Free
 348.834 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 348.835 -+// USA.
 348.836 -+
 348.837 -+// As a special exception, you may use this file as part of a free software
 348.838 -+// library without restriction.  Specifically, if other files instantiate
 348.839 -+// templates or use macros or inline functions from this file, or you compile
 348.840 -+// this file and link it with other files to produce an executable, this
 348.841 -+// file does not by itself cause the resulting executable to be covered by
 348.842 -+// the GNU General Public License.  This exception does not however
 348.843 -+// invalidate any other reasons why the executable file might be covered by
 348.844 -+// the GNU General Public License.
 348.845 -+
 348.846 -+//
 348.847 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 348.848 -+//
 348.849 -+
 348.850 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 348.851 -+
 348.852 -+#define _LIBC
 348.853 -+#include <locale>
 348.854 -+#undef _LIBC
 348.855 -+#include <bits/c++locale_internal.h>
 348.856 -+
 348.857 -+#ifndef __UCLIBC_HAS_XLOCALE__
 348.858 -+#define __wctype_l(S, L)           wctype((S))
 348.859 -+#define __towupper_l(C, L)         towupper((C))
 348.860 -+#define __towlower_l(C, L)         towlower((C))
 348.861 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 348.862 -+#endif
 348.863 -+
 348.864 -+namespace std
 348.865 -+{
 348.866 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 348.867 -+  // various /config/os/* files.
 348.868 -+  template<>
 348.869 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 348.870 -+    : ctype<char>(0, false, __refs) 
 348.871 -+    { 		
 348.872 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 348.873 -+	{
 348.874 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 348.875 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 348.876 -+#ifdef __UCLIBC_HAS_XLOCALE__
 348.877 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 348.878 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 348.879 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 348.880 -+#endif
 348.881 -+	}
 348.882 -+    }
 348.883 -+
 348.884 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 348.885 -+  ctype<wchar_t>::__wmask_type
 348.886 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 348.887 -+  {
 348.888 -+    __wmask_type __ret;
 348.889 -+    switch (__m)
 348.890 -+      {
 348.891 -+      case space:
 348.892 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 348.893 -+	break;
 348.894 -+      case print:
 348.895 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 348.896 -+	break;
 348.897 -+      case cntrl:
 348.898 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 348.899 -+	break;
 348.900 -+      case upper:
 348.901 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 348.902 -+	break;
 348.903 -+      case lower:
 348.904 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 348.905 -+	break;
 348.906 -+      case alpha:
 348.907 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 348.908 -+	break;
 348.909 -+      case digit:
 348.910 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 348.911 -+	break;
 348.912 -+      case punct:
 348.913 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 348.914 -+	break;
 348.915 -+      case xdigit:
 348.916 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 348.917 -+	break;
 348.918 -+      case alnum:
 348.919 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 348.920 -+	break;
 348.921 -+      case graph:
 348.922 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 348.923 -+	break;
 348.924 -+      default:
 348.925 -+	__ret = __wmask_type();
 348.926 -+      }
 348.927 -+    return __ret;
 348.928 -+  }
 348.929 -+  
 348.930 -+  wchar_t
 348.931 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 348.932 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 348.933 -+
 348.934 -+  const wchar_t*
 348.935 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 348.936 -+  {
 348.937 -+    while (__lo < __hi)
 348.938 -+      {
 348.939 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 348.940 -+        ++__lo;
 348.941 -+      }
 348.942 -+    return __hi;
 348.943 -+  }
 348.944 -+  
 348.945 -+  wchar_t
 348.946 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 348.947 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 348.948 -+  
 348.949 -+  const wchar_t*
 348.950 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 348.951 -+  {
 348.952 -+    while (__lo < __hi)
 348.953 -+      {
 348.954 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 348.955 -+        ++__lo;
 348.956 -+      }
 348.957 -+    return __hi;
 348.958 -+  }
 348.959 -+
 348.960 -+  bool
 348.961 -+  ctype<wchar_t>::
 348.962 -+  do_is(mask __m, wchar_t __c) const
 348.963 -+  { 
 348.964 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
 348.965 -+    // library for blank.
 348.966 -+    bool __ret = false;
 348.967 -+    const size_t __bitmasksize = 11; 
 348.968 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 348.969 -+      if (__m & _M_bit[__bitcur]
 348.970 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 348.971 -+	{
 348.972 -+	  __ret = true;
 348.973 -+	  break;
 348.974 -+	}
 348.975 -+    return __ret;    
 348.976 -+  }
 348.977 -+  
 348.978 -+  const wchar_t* 
 348.979 -+  ctype<wchar_t>::
 348.980 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 348.981 -+  {
 348.982 -+    for (; __lo < __hi; ++__vec, ++__lo)
 348.983 -+      {
 348.984 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 348.985 -+	// library for blank.
 348.986 -+	const size_t __bitmasksize = 11; 
 348.987 -+	mask __m = 0;
 348.988 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 348.989 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 348.990 -+	    __m |= _M_bit[__bitcur];
 348.991 -+	*__vec = __m;
 348.992 -+      }
 348.993 -+    return __hi;
 348.994 -+  }
 348.995 -+  
 348.996 -+  const wchar_t* 
 348.997 -+  ctype<wchar_t>::
 348.998 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 348.999 -+  {
348.1000 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
348.1001 -+      ++__lo;
348.1002 -+    return __lo;
348.1003 -+  }
348.1004 -+
348.1005 -+  const wchar_t*
348.1006 -+  ctype<wchar_t>::
348.1007 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
348.1008 -+  {
348.1009 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
348.1010 -+      ++__lo;
348.1011 -+    return __lo;
348.1012 -+  }
348.1013 -+
348.1014 -+  wchar_t
348.1015 -+  ctype<wchar_t>::
348.1016 -+  do_widen(char __c) const
348.1017 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
348.1018 -+
348.1019 -+  const char* 
348.1020 -+  ctype<wchar_t>::
348.1021 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
348.1022 -+  {
348.1023 -+    while (__lo < __hi)
348.1024 -+      {
348.1025 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
348.1026 -+	++__lo;
348.1027 -+	++__dest;
348.1028 -+      }
348.1029 -+    return __hi;
348.1030 -+  }
348.1031 -+
348.1032 -+  char
348.1033 -+  ctype<wchar_t>::
348.1034 -+  do_narrow(wchar_t __wc, char __dfault) const
348.1035 -+  {
348.1036 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
348.1037 -+      return _M_narrow[__wc];
348.1038 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1039 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
348.1040 -+#endif
348.1041 -+    const int __c = wctob(__wc);
348.1042 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1043 -+    __uselocale(__old);
348.1044 -+#endif
348.1045 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
348.1046 -+  }
348.1047 -+
348.1048 -+  const wchar_t*
348.1049 -+  ctype<wchar_t>::
348.1050 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
348.1051 -+	    char* __dest) const
348.1052 -+  {
348.1053 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1054 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
348.1055 -+#endif
348.1056 -+    if (_M_narrow_ok)
348.1057 -+      while (__lo < __hi)
348.1058 -+	{
348.1059 -+	  if (*__lo >= 0 && *__lo < 128)
348.1060 -+	    *__dest = _M_narrow[*__lo];
348.1061 -+	  else
348.1062 -+	    {
348.1063 -+	      const int __c = wctob(*__lo);
348.1064 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
348.1065 -+	    }
348.1066 -+	  ++__lo;
348.1067 -+	  ++__dest;
348.1068 -+	}
348.1069 -+    else
348.1070 -+      while (__lo < __hi)
348.1071 -+	{
348.1072 -+	  const int __c = wctob(*__lo);
348.1073 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
348.1074 -+	  ++__lo;
348.1075 -+	  ++__dest;
348.1076 -+	}
348.1077 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1078 -+    __uselocale(__old);
348.1079 -+#endif
348.1080 -+    return __hi;
348.1081 -+  }
348.1082 -+
348.1083 -+  void
348.1084 -+  ctype<wchar_t>::_M_initialize_ctype()
348.1085 -+  {
348.1086 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1087 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
348.1088 -+#endif
348.1089 -+    wint_t __i;
348.1090 -+    for (__i = 0; __i < 128; ++__i)
348.1091 -+      {
348.1092 -+	const int __c = wctob(__i);
348.1093 -+	if (__c == EOF)
348.1094 -+	  break;
348.1095 -+	else
348.1096 -+	  _M_narrow[__i] = static_cast<char>(__c);
348.1097 -+      }
348.1098 -+    if (__i == 128)
348.1099 -+      _M_narrow_ok = true;
348.1100 -+    else
348.1101 -+      _M_narrow_ok = false;
348.1102 -+    for (size_t __j = 0;
348.1103 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
348.1104 -+      _M_widen[__j] = btowc(__j);
348.1105 -+
348.1106 -+    for (size_t __k = 0; __k <= 11; ++__k)
348.1107 -+      { 
348.1108 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
348.1109 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
348.1110 -+      }
348.1111 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1112 -+    __uselocale(__old);
348.1113 -+#endif
348.1114 -+  }
348.1115 -+#endif //  _GLIBCXX_USE_WCHAR_T
348.1116 -+}
348.1117 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
348.1118 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
348.1119 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
348.1120 -@@ -0,0 +1,100 @@
348.1121 -+// std::messages implementation details, GNU version -*- C++ -*-
348.1122 -+
348.1123 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
348.1124 -+//
348.1125 -+// This file is part of the GNU ISO C++ Library.  This library is free
348.1126 -+// software; you can redistribute it and/or modify it under the
348.1127 -+// terms of the GNU General Public License as published by the
348.1128 -+// Free Software Foundation; either version 2, or (at your option)
348.1129 -+// any later version.
348.1130 -+
348.1131 -+// This library is distributed in the hope that it will be useful,
348.1132 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
348.1133 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
348.1134 -+// GNU General Public License for more details.
348.1135 -+
348.1136 -+// You should have received a copy of the GNU General Public License along
348.1137 -+// with this library; see the file COPYING.  If not, write to the Free
348.1138 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
348.1139 -+// USA.
348.1140 -+
348.1141 -+// As a special exception, you may use this file as part of a free software
348.1142 -+// library without restriction.  Specifically, if other files instantiate
348.1143 -+// templates or use macros or inline functions from this file, or you compile
348.1144 -+// this file and link it with other files to produce an executable, this
348.1145 -+// file does not by itself cause the resulting executable to be covered by
348.1146 -+// the GNU General Public License.  This exception does not however
348.1147 -+// invalidate any other reasons why the executable file might be covered by
348.1148 -+// the GNU General Public License.
348.1149 -+
348.1150 -+//
348.1151 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
348.1152 -+//
348.1153 -+
348.1154 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
348.1155 -+
348.1156 -+#include <locale>
348.1157 -+#include <bits/c++locale_internal.h>
348.1158 -+
348.1159 -+#ifdef __UCLIBC_MJN3_ONLY__
348.1160 -+#warning fix gettext stuff
348.1161 -+#endif
348.1162 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
348.1163 -+extern "C" char *__dcgettext(const char *domainname,
348.1164 -+			     const char *msgid, int category);
348.1165 -+#undef gettext
348.1166 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
348.1167 -+#else
348.1168 -+#undef gettext
348.1169 -+#define gettext(msgid) (msgid)
348.1170 -+#endif
348.1171 -+
348.1172 -+namespace std
348.1173 -+{
348.1174 -+  // Specializations.
348.1175 -+  template<>
348.1176 -+    string
348.1177 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
348.1178 -+    {
348.1179 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1180 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
348.1181 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
348.1182 -+      __uselocale(__old);
348.1183 -+      return string(__msg);
348.1184 -+#elif defined __UCLIBC_HAS_LOCALE__
348.1185 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
348.1186 -+      setlocale(LC_ALL, _M_name_messages);
348.1187 -+      const char* __msg = gettext(__dfault.c_str());
348.1188 -+      setlocale(LC_ALL, __old);
348.1189 -+      free(__old);
348.1190 -+      return string(__msg);
348.1191 -+#else
348.1192 -+      const char* __msg = gettext(__dfault.c_str());
348.1193 -+      return string(__msg);
348.1194 -+#endif
348.1195 -+    }
348.1196 -+
348.1197 -+#ifdef _GLIBCXX_USE_WCHAR_T
348.1198 -+  template<>
348.1199 -+    wstring
348.1200 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
348.1201 -+    {
348.1202 -+# ifdef __UCLIBC_HAS_XLOCALE__
348.1203 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
348.1204 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
348.1205 -+      __uselocale(__old);
348.1206 -+      return _M_convert_from_char(__msg);
348.1207 -+# elif defined __UCLIBC_HAS_LOCALE__
348.1208 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
348.1209 -+      setlocale(LC_ALL, _M_name_messages);
348.1210 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
348.1211 -+      setlocale(LC_ALL, __old);
348.1212 -+      free(__old);
348.1213 -+      return _M_convert_from_char(__msg);
348.1214 -+# else
348.1215 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
348.1216 -+      return _M_convert_from_char(__msg);
348.1217 -+# endif
348.1218 -+    }
348.1219 -+#endif
348.1220 -+}
348.1221 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
348.1222 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
348.1223 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
348.1224 -@@ -0,0 +1,118 @@
348.1225 -+// std::messages implementation details, GNU version -*- C++ -*-
348.1226 -+
348.1227 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
348.1228 -+//
348.1229 -+// This file is part of the GNU ISO C++ Library.  This library is free
348.1230 -+// software; you can redistribute it and/or modify it under the
348.1231 -+// terms of the GNU General Public License as published by the
348.1232 -+// Free Software Foundation; either version 2, or (at your option)
348.1233 -+// any later version.
348.1234 -+
348.1235 -+// This library is distributed in the hope that it will be useful,
348.1236 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
348.1237 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
348.1238 -+// GNU General Public License for more details.
348.1239 -+
348.1240 -+// You should have received a copy of the GNU General Public License along
348.1241 -+// with this library; see the file COPYING.  If not, write to the Free
348.1242 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
348.1243 -+// USA.
348.1244 -+
348.1245 -+// As a special exception, you may use this file as part of a free software
348.1246 -+// library without restriction.  Specifically, if other files instantiate
348.1247 -+// templates or use macros or inline functions from this file, or you compile
348.1248 -+// this file and link it with other files to produce an executable, this
348.1249 -+// file does not by itself cause the resulting executable to be covered by
348.1250 -+// the GNU General Public License.  This exception does not however
348.1251 -+// invalidate any other reasons why the executable file might be covered by
348.1252 -+// the GNU General Public License.
348.1253 -+
348.1254 -+//
348.1255 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
348.1256 -+//
348.1257 -+
348.1258 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
348.1259 -+
348.1260 -+#ifdef __UCLIBC_MJN3_ONLY__
348.1261 -+#warning fix prototypes for *textdomain funcs
348.1262 -+#endif
348.1263 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
348.1264 -+extern "C" char *__textdomain(const char *domainname);
348.1265 -+extern "C" char *__bindtextdomain(const char *domainname,
348.1266 -+				  const char *dirname);
348.1267 -+#else
348.1268 -+#undef __textdomain
348.1269 -+#undef __bindtextdomain
348.1270 -+#define __textdomain(D)           ((void)0)
348.1271 -+#define __bindtextdomain(D,P)     ((void)0)
348.1272 -+#endif
348.1273 -+
348.1274 -+  // Non-virtual member functions.
348.1275 -+  template<typename _CharT>
348.1276 -+     messages<_CharT>::messages(size_t __refs)
348.1277 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
348.1278 -+     _M_name_messages(_S_get_c_name())
348.1279 -+     { }
348.1280 -+
348.1281 -+  template<typename _CharT>
348.1282 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
348.1283 -+				size_t __refs) 
348.1284 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
348.1285 -+     _M_name_messages(__s)
348.1286 -+     {
348.1287 -+       char* __tmp = new char[std::strlen(__s) + 1];
348.1288 -+       std::strcpy(__tmp, __s);
348.1289 -+       _M_name_messages = __tmp;
348.1290 -+     }
348.1291 -+
348.1292 -+  template<typename _CharT>
348.1293 -+    typename messages<_CharT>::catalog 
348.1294 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
348.1295 -+			   const char* __dir) const
348.1296 -+    { 
348.1297 -+      __bindtextdomain(__s.c_str(), __dir);
348.1298 -+      return this->do_open(__s, __loc); 
348.1299 -+    }
348.1300 -+
348.1301 -+  // Virtual member functions.
348.1302 -+  template<typename _CharT>
348.1303 -+    messages<_CharT>::~messages()
348.1304 -+    { 
348.1305 -+      if (_M_name_messages != _S_get_c_name())
348.1306 -+	delete [] _M_name_messages;
348.1307 -+      _S_destroy_c_locale(_M_c_locale_messages); 
348.1308 -+    }
348.1309 -+
348.1310 -+  template<typename _CharT>
348.1311 -+    typename messages<_CharT>::catalog 
348.1312 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
348.1313 -+			      const locale&) const
348.1314 -+    { 
348.1315 -+      // No error checking is done, assume the catalog exists and can
348.1316 -+      // be used.
348.1317 -+      __textdomain(__s.c_str());
348.1318 -+      return 0;
348.1319 -+    }
348.1320 -+
348.1321 -+  template<typename _CharT>
348.1322 -+    void    
348.1323 -+    messages<_CharT>::do_close(catalog) const 
348.1324 -+    { }
348.1325 -+
348.1326 -+   // messages_byname
348.1327 -+   template<typename _CharT>
348.1328 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
348.1329 -+     : messages<_CharT>(__refs) 
348.1330 -+     { 
348.1331 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
348.1332 -+	 delete [] this->_M_name_messages;
348.1333 -+       char* __tmp = new char[std::strlen(__s) + 1];
348.1334 -+       std::strcpy(__tmp, __s);
348.1335 -+       this->_M_name_messages = __tmp;
348.1336 -+
348.1337 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
348.1338 -+	 {
348.1339 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
348.1340 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
348.1341 -+	 }
348.1342 -+     }
348.1343 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
348.1344 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
348.1345 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
348.1346 -@@ -0,0 +1,692 @@
348.1347 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
348.1348 -+
348.1349 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
348.1350 -+//
348.1351 -+// This file is part of the GNU ISO C++ Library.  This library is free
348.1352 -+// software; you can redistribute it and/or modify it under the
348.1353 -+// terms of the GNU General Public License as published by the
348.1354 -+// Free Software Foundation; either version 2, or (at your option)
348.1355 -+// any later version.
348.1356 -+
348.1357 -+// This library is distributed in the hope that it will be useful,
348.1358 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
348.1359 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
348.1360 -+// GNU General Public License for more details.
348.1361 -+
348.1362 -+// You should have received a copy of the GNU General Public License along
348.1363 -+// with this library; see the file COPYING.  If not, write to the Free
348.1364 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
348.1365 -+// USA.
348.1366 -+
348.1367 -+// As a special exception, you may use this file as part of a free software
348.1368 -+// library without restriction.  Specifically, if other files instantiate
348.1369 -+// templates or use macros or inline functions from this file, or you compile
348.1370 -+// this file and link it with other files to produce an executable, this
348.1371 -+// file does not by itself cause the resulting executable to be covered by
348.1372 -+// the GNU General Public License.  This exception does not however
348.1373 -+// invalidate any other reasons why the executable file might be covered by
348.1374 -+// the GNU General Public License.
348.1375 -+
348.1376 -+//
348.1377 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
348.1378 -+//
348.1379 -+
348.1380 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
348.1381 -+
348.1382 -+#define _LIBC
348.1383 -+#include <locale>
348.1384 -+#undef _LIBC
348.1385 -+#include <bits/c++locale_internal.h>
348.1386 -+
348.1387 -+#ifdef __UCLIBC_MJN3_ONLY__
348.1388 -+#warning optimize this for uclibc
348.1389 -+#warning tailor for stub locale support
348.1390 -+#endif
348.1391 -+
348.1392 -+#ifndef __UCLIBC_HAS_XLOCALE__
348.1393 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
348.1394 -+#endif
348.1395 -+
348.1396 -+namespace std
348.1397 -+{
348.1398 -+  // Construct and return valid pattern consisting of some combination of:
348.1399 -+  // space none symbol sign value
348.1400 -+  money_base::pattern
348.1401 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
348.1402 -+  { 
348.1403 -+    pattern __ret;
348.1404 -+
348.1405 -+    // This insanely complicated routine attempts to construct a valid
348.1406 -+    // pattern for use with monyepunct. A couple of invariants:
348.1407 -+
348.1408 -+    // if (__precedes) symbol -> value
348.1409 -+    // else value -> symbol
348.1410 -+    
348.1411 -+    // if (__space) space
348.1412 -+    // else none
348.1413 -+
348.1414 -+    // none == never first
348.1415 -+    // space never first or last
348.1416 -+
348.1417 -+    // Any elegant implementations of this are welcome.
348.1418 -+    switch (__posn)
348.1419 -+      {
348.1420 -+      case 0:
348.1421 -+      case 1:
348.1422 -+	// 1 The sign precedes the value and symbol.
348.1423 -+	__ret.field[0] = sign;
348.1424 -+	if (__space)
348.1425 -+	  {
348.1426 -+	    // Pattern starts with sign.
348.1427 -+	    if (__precedes)
348.1428 -+	      {
348.1429 -+		__ret.field[1] = symbol;
348.1430 -+		__ret.field[3] = value;
348.1431 -+	      }
348.1432 -+	    else
348.1433 -+	      {
348.1434 -+		__ret.field[1] = value;
348.1435 -+		__ret.field[3] = symbol;
348.1436 -+	      }
348.1437 -+	    __ret.field[2] = space;
348.1438 -+	  }
348.1439 -+	else
348.1440 -+	  {
348.1441 -+	    // Pattern starts with sign and ends with none.
348.1442 -+	    if (__precedes)
348.1443 -+	      {
348.1444 -+		__ret.field[1] = symbol;
348.1445 -+		__ret.field[2] = value;
348.1446 -+	      }
348.1447 -+	    else
348.1448 -+	      {
348.1449 -+		__ret.field[1] = value;
348.1450 -+		__ret.field[2] = symbol;
348.1451 -+	      }
348.1452 -+	    __ret.field[3] = none;
348.1453 -+	  }
348.1454 -+	break;
348.1455 -+      case 2:
348.1456 -+	// 2 The sign follows the value and symbol.
348.1457 -+	if (__space)
348.1458 -+	  {
348.1459 -+	    // Pattern either ends with sign.
348.1460 -+	    if (__precedes)
348.1461 -+	      {
348.1462 -+		__ret.field[0] = symbol;
348.1463 -+		__ret.field[2] = value;
348.1464 -+	      }
348.1465 -+	    else
348.1466 -+	      {
348.1467 -+		__ret.field[0] = value;
348.1468 -+		__ret.field[2] = symbol;
348.1469 -+	      }
348.1470 -+	    __ret.field[1] = space;
348.1471 -+	    __ret.field[3] = sign;
348.1472 -+	  }
348.1473 -+	else
348.1474 -+	  {
348.1475 -+	    // Pattern ends with sign then none.
348.1476 -+	    if (__precedes)
348.1477 -+	      {
348.1478 -+		__ret.field[0] = symbol;
348.1479 -+		__ret.field[1] = value;
348.1480 -+	      }
348.1481 -+	    else
348.1482 -+	      {
348.1483 -+		__ret.field[0] = value;
348.1484 -+		__ret.field[1] = symbol;
348.1485 -+	      }
348.1486 -+	    __ret.field[2] = sign;
348.1487 -+	    __ret.field[3] = none;
348.1488 -+	  }
348.1489 -+	break;
348.1490 -+      case 3:
348.1491 -+	// 3 The sign immediately precedes the symbol.
348.1492 -+	if (__precedes)
348.1493 -+	  {
348.1494 -+	    __ret.field[0] = sign;
348.1495 -+	    __ret.field[1] = symbol;	    
348.1496 -+	    if (__space)
348.1497 -+	      {
348.1498 -+		__ret.field[2] = space;
348.1499 -+		__ret.field[3] = value;
348.1500 -+	      }
348.1501 -+	    else
348.1502 -+	      {
348.1503 -+		__ret.field[2] = value;		
348.1504 -+		__ret.field[3] = none;
348.1505 -+	      }
348.1506 -+	  }
348.1507 -+	else
348.1508 -+	  {
348.1509 -+	    __ret.field[0] = value;
348.1510 -+	    if (__space)
348.1511 -+	      {
348.1512 -+		__ret.field[1] = space;
348.1513 -+		__ret.field[2] = sign;
348.1514 -+		__ret.field[3] = symbol;
348.1515 -+	      }
348.1516 -+	    else
348.1517 -+	      {
348.1518 -+		__ret.field[1] = sign;
348.1519 -+		__ret.field[2] = symbol;
348.1520 -+		__ret.field[3] = none;
348.1521 -+	      }
348.1522 -+	  }
348.1523 -+	break;
348.1524 -+      case 4:
348.1525 -+	// 4 The sign immediately follows the symbol.
348.1526 -+	if (__precedes)
348.1527 -+	  {
348.1528 -+	    __ret.field[0] = symbol;
348.1529 -+	    __ret.field[1] = sign;
348.1530 -+	    if (__space)
348.1531 -+	      {
348.1532 -+		__ret.field[2] = space;
348.1533 -+		__ret.field[3] = value;
348.1534 -+	      }
348.1535 -+	    else
348.1536 -+	      {
348.1537 -+		__ret.field[2] = value;
348.1538 -+		__ret.field[3] = none;
348.1539 -+	      }
348.1540 -+	  }
348.1541 -+	else
348.1542 -+	  {
348.1543 -+	    __ret.field[0] = value;
348.1544 -+	    if (__space)
348.1545 -+	      {
348.1546 -+		__ret.field[1] = space;
348.1547 -+		__ret.field[2] = symbol;
348.1548 -+		__ret.field[3] = sign;
348.1549 -+	      }
348.1550 -+	    else
348.1551 -+	      {
348.1552 -+		__ret.field[1] = symbol;
348.1553 -+		__ret.field[2] = sign;
348.1554 -+		__ret.field[3] = none;
348.1555 -+	      }
348.1556 -+	  }
348.1557 -+	break;
348.1558 -+      default:
348.1559 -+	;
348.1560 -+      }
348.1561 -+    return __ret;
348.1562 -+  }
348.1563 -+
348.1564 -+  template<> 
348.1565 -+    void
348.1566 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
348.1567 -+						     const char*)
348.1568 -+    {
348.1569 -+      if (!_M_data)
348.1570 -+	_M_data = new __moneypunct_cache<char, true>;
348.1571 -+
348.1572 -+      if (!__cloc)
348.1573 -+	{
348.1574 -+	  // "C" locale
348.1575 -+	  _M_data->_M_decimal_point = '.';
348.1576 -+	  _M_data->_M_thousands_sep = ',';
348.1577 -+	  _M_data->_M_grouping = "";
348.1578 -+	  _M_data->_M_grouping_size = 0;
348.1579 -+	  _M_data->_M_curr_symbol = "";
348.1580 -+	  _M_data->_M_curr_symbol_size = 0;
348.1581 -+	  _M_data->_M_positive_sign = "";
348.1582 -+	  _M_data->_M_positive_sign_size = 0;
348.1583 -+	  _M_data->_M_negative_sign = "";
348.1584 -+	  _M_data->_M_negative_sign_size = 0;
348.1585 -+	  _M_data->_M_frac_digits = 0;
348.1586 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
348.1587 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
348.1588 -+
348.1589 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
348.1590 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
348.1591 -+	}
348.1592 -+      else
348.1593 -+	{
348.1594 -+	  // Named locale.
348.1595 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
348.1596 -+							__cloc));
348.1597 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
348.1598 -+							__cloc));
348.1599 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
348.1600 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
348.1601 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
348.1602 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
348.1603 -+
348.1604 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
348.1605 -+	  if (!__nposn)
348.1606 -+	    _M_data->_M_negative_sign = "()";
348.1607 -+	  else
348.1608 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
348.1609 -+							__cloc);
348.1610 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
348.1611 -+
348.1612 -+	  // _Intl == true
348.1613 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
348.1614 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
348.1615 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
348.1616 -+						      __cloc));
348.1617 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
348.1618 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
348.1619 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
348.1620 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
348.1621 -+							__pposn);
348.1622 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
348.1623 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
348.1624 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
348.1625 -+							__nposn);
348.1626 -+	}
348.1627 -+    }
348.1628 -+
348.1629 -+  template<> 
348.1630 -+    void
348.1631 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
348.1632 -+						      const char*)
348.1633 -+    {
348.1634 -+      if (!_M_data)
348.1635 -+	_M_data = new __moneypunct_cache<char, false>;
348.1636 -+
348.1637 -+      if (!__cloc)
348.1638 -+	{
348.1639 -+	  // "C" locale
348.1640 -+	  _M_data->_M_decimal_point = '.';
348.1641 -+	  _M_data->_M_thousands_sep = ',';
348.1642 -+	  _M_data->_M_grouping = "";
348.1643 -+	  _M_data->_M_grouping_size = 0;
348.1644 -+	  _M_data->_M_curr_symbol = "";
348.1645 -+	  _M_data->_M_curr_symbol_size = 0;
348.1646 -+	  _M_data->_M_positive_sign = "";
348.1647 -+	  _M_data->_M_positive_sign_size = 0;
348.1648 -+	  _M_data->_M_negative_sign = "";
348.1649 -+	  _M_data->_M_negative_sign_size = 0;
348.1650 -+	  _M_data->_M_frac_digits = 0;
348.1651 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
348.1652 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
348.1653 -+
348.1654 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
348.1655 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
348.1656 -+	}
348.1657 -+      else
348.1658 -+	{
348.1659 -+	  // Named locale.
348.1660 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
348.1661 -+							__cloc));
348.1662 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
348.1663 -+							__cloc));
348.1664 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
348.1665 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
348.1666 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
348.1667 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
348.1668 -+
348.1669 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
348.1670 -+	  if (!__nposn)
348.1671 -+	    _M_data->_M_negative_sign = "()";
348.1672 -+	  else
348.1673 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
348.1674 -+							__cloc);
348.1675 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
348.1676 -+
348.1677 -+	  // _Intl == false
348.1678 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
348.1679 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
348.1680 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
348.1681 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
348.1682 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
348.1683 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
348.1684 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
348.1685 -+							__pposn);
348.1686 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
348.1687 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
348.1688 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
348.1689 -+							__nposn);
348.1690 -+	}
348.1691 -+    }
348.1692 -+
348.1693 -+  template<> 
348.1694 -+    moneypunct<char, true>::~moneypunct()
348.1695 -+    { delete _M_data; }
348.1696 -+
348.1697 -+  template<> 
348.1698 -+    moneypunct<char, false>::~moneypunct()
348.1699 -+    { delete _M_data; }
348.1700 -+
348.1701 -+#ifdef _GLIBCXX_USE_WCHAR_T
348.1702 -+  template<> 
348.1703 -+    void
348.1704 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
348.1705 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1706 -+							const char*)
348.1707 -+#else
348.1708 -+							const char* __name)
348.1709 -+#endif
348.1710 -+    {
348.1711 -+      if (!_M_data)
348.1712 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
348.1713 -+
348.1714 -+      if (!__cloc)
348.1715 -+	{
348.1716 -+	  // "C" locale
348.1717 -+	  _M_data->_M_decimal_point = L'.';
348.1718 -+	  _M_data->_M_thousands_sep = L',';
348.1719 -+	  _M_data->_M_grouping = "";
348.1720 -+	  _M_data->_M_grouping_size = 0;
348.1721 -+	  _M_data->_M_curr_symbol = L"";
348.1722 -+	  _M_data->_M_curr_symbol_size = 0;
348.1723 -+	  _M_data->_M_positive_sign = L"";
348.1724 -+	  _M_data->_M_positive_sign_size = 0;
348.1725 -+	  _M_data->_M_negative_sign = L"";
348.1726 -+	  _M_data->_M_negative_sign_size = 0;
348.1727 -+	  _M_data->_M_frac_digits = 0;
348.1728 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
348.1729 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
348.1730 -+
348.1731 -+	  // Use ctype::widen code without the facet...
348.1732 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
348.1733 -+	    _M_data->_M_atoms[__i] =
348.1734 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
348.1735 -+	}
348.1736 -+      else
348.1737 -+	{
348.1738 -+	  // Named locale.
348.1739 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1740 -+	  __c_locale __old = __uselocale(__cloc);
348.1741 -+#else
348.1742 -+	  // Switch to named locale so that mbsrtowcs will work.
348.1743 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
348.1744 -+	  setlocale(LC_ALL, __name);
348.1745 -+#endif
348.1746 -+
348.1747 -+#ifdef __UCLIBC_MJN3_ONLY__
348.1748 -+#warning fix this... should be monetary
348.1749 -+#endif
348.1750 -+#ifdef __UCLIBC__
348.1751 -+# ifdef __UCLIBC_HAS_XLOCALE__
348.1752 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
348.1753 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
348.1754 -+# else
348.1755 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
348.1756 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
348.1757 -+# endif
348.1758 -+#else
348.1759 -+	  union { char *__s; wchar_t __w; } __u;
348.1760 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
348.1761 -+	  _M_data->_M_decimal_point = __u.__w;
348.1762 -+
348.1763 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
348.1764 -+	  _M_data->_M_thousands_sep = __u.__w;
348.1765 -+#endif
348.1766 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
348.1767 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
348.1768 -+
348.1769 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
348.1770 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
348.1771 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
348.1772 -+
348.1773 -+	  wchar_t* __wcs_ps = 0;
348.1774 -+	  wchar_t* __wcs_ns = 0;
348.1775 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
348.1776 -+	  try
348.1777 -+	    {
348.1778 -+	      mbstate_t __state;
348.1779 -+	      size_t __len = strlen(__cpossign);
348.1780 -+	      if (__len)
348.1781 -+		{
348.1782 -+		  ++__len;
348.1783 -+		  memset(&__state, 0, sizeof(mbstate_t));
348.1784 -+		  __wcs_ps = new wchar_t[__len];
348.1785 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
348.1786 -+		  _M_data->_M_positive_sign = __wcs_ps;
348.1787 -+		}
348.1788 -+	      else
348.1789 -+		_M_data->_M_positive_sign = L"";
348.1790 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
348.1791 -+	      
348.1792 -+	      __len = strlen(__cnegsign);
348.1793 -+	      if (!__nposn)
348.1794 -+		_M_data->_M_negative_sign = L"()";
348.1795 -+	      else if (__len)
348.1796 -+		{ 
348.1797 -+		  ++__len;
348.1798 -+		  memset(&__state, 0, sizeof(mbstate_t));
348.1799 -+		  __wcs_ns = new wchar_t[__len];
348.1800 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
348.1801 -+		  _M_data->_M_negative_sign = __wcs_ns;
348.1802 -+		}
348.1803 -+	      else
348.1804 -+		_M_data->_M_negative_sign = L"";
348.1805 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
348.1806 -+	      
348.1807 -+	      // _Intl == true.
348.1808 -+	      __len = strlen(__ccurr);
348.1809 -+	      if (__len)
348.1810 -+		{
348.1811 -+		  ++__len;
348.1812 -+		  memset(&__state, 0, sizeof(mbstate_t));
348.1813 -+		  wchar_t* __wcs = new wchar_t[__len];
348.1814 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
348.1815 -+		  _M_data->_M_curr_symbol = __wcs;
348.1816 -+		}
348.1817 -+	      else
348.1818 -+		_M_data->_M_curr_symbol = L"";
348.1819 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
348.1820 -+	    }
348.1821 -+	  catch (...)
348.1822 -+	    {
348.1823 -+	      delete _M_data;
348.1824 -+	      _M_data = 0;
348.1825 -+	      delete __wcs_ps;
348.1826 -+	      delete __wcs_ns;	      
348.1827 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1828 -+	      __uselocale(__old);
348.1829 -+#else
348.1830 -+	      setlocale(LC_ALL, __old);
348.1831 -+	      free(__old);
348.1832 -+#endif
348.1833 -+	      __throw_exception_again;
348.1834 -+	    } 
348.1835 -+	  
348.1836 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
348.1837 -+						      __cloc));
348.1838 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
348.1839 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
348.1840 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
348.1841 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
348.1842 -+							__pposn);
348.1843 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
348.1844 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
348.1845 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
348.1846 -+							__nposn);
348.1847 -+
348.1848 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1849 -+	  __uselocale(__old);
348.1850 -+#else
348.1851 -+	  setlocale(LC_ALL, __old);
348.1852 -+	  free(__old);
348.1853 -+#endif
348.1854 -+	}
348.1855 -+    }
348.1856 -+
348.1857 -+  template<> 
348.1858 -+  void
348.1859 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
348.1860 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1861 -+						       const char*)
348.1862 -+#else
348.1863 -+                                                       const char* __name)
348.1864 -+#endif
348.1865 -+  {
348.1866 -+    if (!_M_data)
348.1867 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
348.1868 -+
348.1869 -+    if (!__cloc)
348.1870 -+	{
348.1871 -+	  // "C" locale
348.1872 -+	  _M_data->_M_decimal_point = L'.';
348.1873 -+	  _M_data->_M_thousands_sep = L',';
348.1874 -+	  _M_data->_M_grouping = "";
348.1875 -+          _M_data->_M_grouping_size = 0;
348.1876 -+	  _M_data->_M_curr_symbol = L"";
348.1877 -+	  _M_data->_M_curr_symbol_size = 0;
348.1878 -+	  _M_data->_M_positive_sign = L"";
348.1879 -+	  _M_data->_M_positive_sign_size = 0;
348.1880 -+	  _M_data->_M_negative_sign = L"";
348.1881 -+	  _M_data->_M_negative_sign_size = 0;
348.1882 -+	  _M_data->_M_frac_digits = 0;
348.1883 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
348.1884 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
348.1885 -+
348.1886 -+	  // Use ctype::widen code without the facet...
348.1887 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
348.1888 -+	    _M_data->_M_atoms[__i] =
348.1889 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
348.1890 -+	}
348.1891 -+      else
348.1892 -+	{
348.1893 -+	  // Named locale.
348.1894 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1895 -+	  __c_locale __old = __uselocale(__cloc);
348.1896 -+#else
348.1897 -+	  // Switch to named locale so that mbsrtowcs will work.
348.1898 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
348.1899 -+	  setlocale(LC_ALL, __name);
348.1900 -+#endif
348.1901 -+
348.1902 -+#ifdef __UCLIBC_MJN3_ONLY__
348.1903 -+#warning fix this... should be monetary
348.1904 -+#endif
348.1905 -+#ifdef __UCLIBC__
348.1906 -+# ifdef __UCLIBC_HAS_XLOCALE__
348.1907 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
348.1908 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
348.1909 -+# else
348.1910 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
348.1911 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
348.1912 -+# endif
348.1913 -+#else
348.1914 -+          union { char *__s; wchar_t __w; } __u;
348.1915 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
348.1916 -+	  _M_data->_M_decimal_point = __u.__w;
348.1917 -+
348.1918 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
348.1919 -+	  _M_data->_M_thousands_sep = __u.__w;
348.1920 -+#endif
348.1921 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
348.1922 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
348.1923 -+
348.1924 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
348.1925 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
348.1926 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
348.1927 -+
348.1928 -+	  wchar_t* __wcs_ps = 0;
348.1929 -+	  wchar_t* __wcs_ns = 0;
348.1930 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
348.1931 -+	  try
348.1932 -+            {
348.1933 -+              mbstate_t __state;
348.1934 -+              size_t __len;
348.1935 -+              __len = strlen(__cpossign);
348.1936 -+              if (__len)
348.1937 -+                {
348.1938 -+		  ++__len;
348.1939 -+		  memset(&__state, 0, sizeof(mbstate_t));
348.1940 -+		  __wcs_ps = new wchar_t[__len];
348.1941 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
348.1942 -+		  _M_data->_M_positive_sign = __wcs_ps;
348.1943 -+		}
348.1944 -+	      else
348.1945 -+		_M_data->_M_positive_sign = L"";
348.1946 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
348.1947 -+	      
348.1948 -+	      __len = strlen(__cnegsign);
348.1949 -+	      if (!__nposn)
348.1950 -+		_M_data->_M_negative_sign = L"()";
348.1951 -+	      else if (__len)
348.1952 -+		{ 
348.1953 -+		  ++__len;
348.1954 -+		  memset(&__state, 0, sizeof(mbstate_t));
348.1955 -+		  __wcs_ns = new wchar_t[__len];
348.1956 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
348.1957 -+		  _M_data->_M_negative_sign = __wcs_ns;
348.1958 -+		}
348.1959 -+	      else
348.1960 -+		_M_data->_M_negative_sign = L"";
348.1961 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
348.1962 -+
348.1963 -+	      // _Intl == true.
348.1964 -+	      __len = strlen(__ccurr);
348.1965 -+	      if (__len)
348.1966 -+		{
348.1967 -+		  ++__len;
348.1968 -+		  memset(&__state, 0, sizeof(mbstate_t));
348.1969 -+		  wchar_t* __wcs = new wchar_t[__len];
348.1970 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
348.1971 -+		  _M_data->_M_curr_symbol = __wcs;
348.1972 -+		}
348.1973 -+	      else
348.1974 -+		_M_data->_M_curr_symbol = L"";
348.1975 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
348.1976 -+	    }
348.1977 -+          catch (...)
348.1978 -+	    {
348.1979 -+	      delete _M_data;
348.1980 -+              _M_data = 0;
348.1981 -+	      delete __wcs_ps;
348.1982 -+	      delete __wcs_ns;	      
348.1983 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.1984 -+	      __uselocale(__old);
348.1985 -+#else
348.1986 -+	      setlocale(LC_ALL, __old);
348.1987 -+	      free(__old);
348.1988 -+#endif
348.1989 -+              __throw_exception_again;
348.1990 -+	    }
348.1991 -+
348.1992 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
348.1993 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
348.1994 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
348.1995 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
348.1996 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
348.1997 -+	                                                __pposn);
348.1998 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
348.1999 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
348.2000 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
348.2001 -+	                                                __nposn);
348.2002 -+
348.2003 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.2004 -+	  __uselocale(__old);
348.2005 -+#else
348.2006 -+	  setlocale(LC_ALL, __old);
348.2007 -+	  free(__old);
348.2008 -+#endif
348.2009 -+	}
348.2010 -+    }
348.2011 -+
348.2012 -+  template<> 
348.2013 -+    moneypunct<wchar_t, true>::~moneypunct()
348.2014 -+    {
348.2015 -+      if (_M_data->_M_positive_sign_size)
348.2016 -+	delete [] _M_data->_M_positive_sign;
348.2017 -+      if (_M_data->_M_negative_sign_size
348.2018 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
348.2019 -+	delete [] _M_data->_M_negative_sign;
348.2020 -+      if (_M_data->_M_curr_symbol_size)
348.2021 -+	delete [] _M_data->_M_curr_symbol;
348.2022 -+      delete _M_data;
348.2023 -+    }
348.2024 -+
348.2025 -+  template<> 
348.2026 -+    moneypunct<wchar_t, false>::~moneypunct()
348.2027 -+    {
348.2028 -+      if (_M_data->_M_positive_sign_size)
348.2029 -+	delete [] _M_data->_M_positive_sign;
348.2030 -+      if (_M_data->_M_negative_sign_size
348.2031 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
348.2032 -+	delete [] _M_data->_M_negative_sign;
348.2033 -+      if (_M_data->_M_curr_symbol_size)
348.2034 -+	delete [] _M_data->_M_curr_symbol;
348.2035 -+      delete _M_data;
348.2036 -+    }
348.2037 -+#endif
348.2038 -+}
348.2039 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
348.2040 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
348.2041 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
348.2042 -@@ -0,0 +1,160 @@
348.2043 -+// std::numpunct implementation details, GNU version -*- C++ -*-
348.2044 -+
348.2045 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
348.2046 -+//
348.2047 -+// This file is part of the GNU ISO C++ Library.  This library is free
348.2048 -+// software; you can redistribute it and/or modify it under the
348.2049 -+// terms of the GNU General Public License as published by the
348.2050 -+// Free Software Foundation; either version 2, or (at your option)
348.2051 -+// any later version.
348.2052 -+
348.2053 -+// This library is distributed in the hope that it will be useful,
348.2054 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
348.2055 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
348.2056 -+// GNU General Public License for more details.
348.2057 -+
348.2058 -+// You should have received a copy of the GNU General Public License along
348.2059 -+// with this library; see the file COPYING.  If not, write to the Free
348.2060 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
348.2061 -+// USA.
348.2062 -+
348.2063 -+// As a special exception, you may use this file as part of a free software
348.2064 -+// library without restriction.  Specifically, if other files instantiate
348.2065 -+// templates or use macros or inline functions from this file, or you compile
348.2066 -+// this file and link it with other files to produce an executable, this
348.2067 -+// file does not by itself cause the resulting executable to be covered by
348.2068 -+// the GNU General Public License.  This exception does not however
348.2069 -+// invalidate any other reasons why the executable file might be covered by
348.2070 -+// the GNU General Public License.
348.2071 -+
348.2072 -+//
348.2073 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
348.2074 -+//
348.2075 -+
348.2076 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
348.2077 -+
348.2078 -+#define _LIBC
348.2079 -+#include <locale>
348.2080 -+#undef _LIBC
348.2081 -+#include <bits/c++locale_internal.h>
348.2082 -+
348.2083 -+#ifdef __UCLIBC_MJN3_ONLY__
348.2084 -+#warning tailor for stub locale support
348.2085 -+#endif
348.2086 -+#ifndef __UCLIBC_HAS_XLOCALE__
348.2087 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
348.2088 -+#endif
348.2089 -+
348.2090 -+namespace std
348.2091 -+{
348.2092 -+  template<> 
348.2093 -+    void
348.2094 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
348.2095 -+    {
348.2096 -+      if (!_M_data)
348.2097 -+	_M_data = new __numpunct_cache<char>;
348.2098 -+
348.2099 -+      if (!__cloc)
348.2100 -+	{
348.2101 -+	  // "C" locale
348.2102 -+	  _M_data->_M_grouping = "";
348.2103 -+	  _M_data->_M_grouping_size = 0;
348.2104 -+	  _M_data->_M_use_grouping = false;
348.2105 -+
348.2106 -+	  _M_data->_M_decimal_point = '.';
348.2107 -+	  _M_data->_M_thousands_sep = ',';
348.2108 -+
348.2109 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
348.2110 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
348.2111 -+
348.2112 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
348.2113 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
348.2114 -+	}
348.2115 -+      else
348.2116 -+	{
348.2117 -+	  // Named locale.
348.2118 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
348.2119 -+							__cloc));
348.2120 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
348.2121 -+							__cloc));
348.2122 -+
348.2123 -+	  // Check for NULL, which implies no grouping.
348.2124 -+	  if (_M_data->_M_thousands_sep == '\0')
348.2125 -+	    _M_data->_M_grouping = "";
348.2126 -+	  else
348.2127 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
348.2128 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
348.2129 -+	}
348.2130 -+
348.2131 -+      // NB: There is no way to extact this info from posix locales.
348.2132 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
348.2133 -+      _M_data->_M_truename = "true";
348.2134 -+      _M_data->_M_truename_size = 4;
348.2135 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
348.2136 -+      _M_data->_M_falsename = "false";
348.2137 -+      _M_data->_M_falsename_size = 5;
348.2138 -+    }
348.2139 -+ 
348.2140 -+  template<> 
348.2141 -+    numpunct<char>::~numpunct()
348.2142 -+    { delete _M_data; }
348.2143 -+   
348.2144 -+#ifdef _GLIBCXX_USE_WCHAR_T
348.2145 -+  template<> 
348.2146 -+    void
348.2147 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
348.2148 -+    {
348.2149 -+      if (!_M_data)
348.2150 -+	_M_data = new __numpunct_cache<wchar_t>;
348.2151 -+
348.2152 -+      if (!__cloc)
348.2153 -+	{
348.2154 -+	  // "C" locale
348.2155 -+	  _M_data->_M_grouping = "";
348.2156 -+	  _M_data->_M_grouping_size = 0;
348.2157 -+	  _M_data->_M_use_grouping = false;
348.2158 -+
348.2159 -+	  _M_data->_M_decimal_point = L'.';
348.2160 -+	  _M_data->_M_thousands_sep = L',';
348.2161 -+
348.2162 -+	  // Use ctype::widen code without the facet...
348.2163 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
348.2164 -+	    _M_data->_M_atoms_out[__i] =
348.2165 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
348.2166 -+
348.2167 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
348.2168 -+	    _M_data->_M_atoms_in[__j] =
348.2169 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
348.2170 -+	}
348.2171 -+      else
348.2172 -+	{
348.2173 -+	  // Named locale.
348.2174 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
348.2175 -+	  union { char *__s; wchar_t __w; } __u;
348.2176 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
348.2177 -+	  _M_data->_M_decimal_point = __u.__w;
348.2178 -+
348.2179 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
348.2180 -+	  _M_data->_M_thousands_sep = __u.__w;
348.2181 -+
348.2182 -+	  if (_M_data->_M_thousands_sep == L'\0')
348.2183 -+	    _M_data->_M_grouping = "";
348.2184 -+	  else
348.2185 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
348.2186 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
348.2187 -+	}
348.2188 -+
348.2189 -+      // NB: There is no way to extact this info from posix locales.
348.2190 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
348.2191 -+      _M_data->_M_truename = L"true";
348.2192 -+      _M_data->_M_truename_size = 4;
348.2193 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
348.2194 -+      _M_data->_M_falsename = L"false";
348.2195 -+      _M_data->_M_falsename_size = 5;
348.2196 -+    }
348.2197 -+
348.2198 -+  template<> 
348.2199 -+    numpunct<wchar_t>::~numpunct()
348.2200 -+    { delete _M_data; }
348.2201 -+ #endif
348.2202 -+}
348.2203 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
348.2204 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
348.2205 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
348.2206 -@@ -0,0 +1,406 @@
348.2207 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
348.2208 -+
348.2209 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
348.2210 -+//
348.2211 -+// This file is part of the GNU ISO C++ Library.  This library is free
348.2212 -+// software; you can redistribute it and/or modify it under the
348.2213 -+// terms of the GNU General Public License as published by the
348.2214 -+// Free Software Foundation; either version 2, or (at your option)
348.2215 -+// any later version.
348.2216 -+
348.2217 -+// This library is distributed in the hope that it will be useful,
348.2218 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
348.2219 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
348.2220 -+// GNU General Public License for more details.
348.2221 -+
348.2222 -+// You should have received a copy of the GNU General Public License along
348.2223 -+// with this library; see the file COPYING.  If not, write to the Free
348.2224 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
348.2225 -+// USA.
348.2226 -+
348.2227 -+// As a special exception, you may use this file as part of a free software
348.2228 -+// library without restriction.  Specifically, if other files instantiate
348.2229 -+// templates or use macros or inline functions from this file, or you compile
348.2230 -+// this file and link it with other files to produce an executable, this
348.2231 -+// file does not by itself cause the resulting executable to be covered by
348.2232 -+// the GNU General Public License.  This exception does not however
348.2233 -+// invalidate any other reasons why the executable file might be covered by
348.2234 -+// the GNU General Public License.
348.2235 -+
348.2236 -+//
348.2237 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
348.2238 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
348.2239 -+//
348.2240 -+
348.2241 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
348.2242 -+
348.2243 -+#include <locale>
348.2244 -+#include <bits/c++locale_internal.h>
348.2245 -+
348.2246 -+#ifdef __UCLIBC_MJN3_ONLY__
348.2247 -+#warning tailor for stub locale support
348.2248 -+#endif
348.2249 -+#ifndef __UCLIBC_HAS_XLOCALE__
348.2250 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
348.2251 -+#endif
348.2252 -+
348.2253 -+namespace std
348.2254 -+{
348.2255 -+  template<>
348.2256 -+    void
348.2257 -+    __timepunct<char>::
348.2258 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
348.2259 -+	   const tm* __tm) const
348.2260 -+    {
348.2261 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.2262 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
348.2263 -+					_M_c_locale_timepunct);
348.2264 -+#else
348.2265 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
348.2266 -+      setlocale(LC_ALL, _M_name_timepunct);
348.2267 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
348.2268 -+      setlocale(LC_ALL, __old);
348.2269 -+      free(__old);
348.2270 -+#endif
348.2271 -+      // Make sure __s is null terminated.
348.2272 -+      if (__len == 0)
348.2273 -+	__s[0] = '\0';
348.2274 -+    }
348.2275 -+
348.2276 -+  template<> 
348.2277 -+    void
348.2278 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
348.2279 -+    {
348.2280 -+      if (!_M_data)
348.2281 -+	_M_data = new __timepunct_cache<char>;
348.2282 -+
348.2283 -+      if (!__cloc)
348.2284 -+	{
348.2285 -+	  // "C" locale
348.2286 -+	  _M_c_locale_timepunct = _S_get_c_locale();
348.2287 -+
348.2288 -+	  _M_data->_M_date_format = "%m/%d/%y";
348.2289 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
348.2290 -+	  _M_data->_M_time_format = "%H:%M:%S";
348.2291 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
348.2292 -+	  _M_data->_M_date_time_format = "";
348.2293 -+	  _M_data->_M_date_time_era_format = "";
348.2294 -+	  _M_data->_M_am = "AM";
348.2295 -+	  _M_data->_M_pm = "PM";
348.2296 -+	  _M_data->_M_am_pm_format = "";
348.2297 -+
348.2298 -+	  // Day names, starting with "C"'s Sunday.
348.2299 -+	  _M_data->_M_day1 = "Sunday";
348.2300 -+	  _M_data->_M_day2 = "Monday";
348.2301 -+	  _M_data->_M_day3 = "Tuesday";
348.2302 -+	  _M_data->_M_day4 = "Wednesday";
348.2303 -+	  _M_data->_M_day5 = "Thursday";
348.2304 -+	  _M_data->_M_day6 = "Friday";
348.2305 -+	  _M_data->_M_day7 = "Saturday";
348.2306 -+
348.2307 -+	  // Abbreviated day names, starting with "C"'s Sun.
348.2308 -+	  _M_data->_M_aday1 = "Sun";
348.2309 -+	  _M_data->_M_aday2 = "Mon";
348.2310 -+	  _M_data->_M_aday3 = "Tue";
348.2311 -+	  _M_data->_M_aday4 = "Wed";
348.2312 -+	  _M_data->_M_aday5 = "Thu";
348.2313 -+	  _M_data->_M_aday6 = "Fri";
348.2314 -+	  _M_data->_M_aday7 = "Sat";
348.2315 -+
348.2316 -+	  // Month names, starting with "C"'s January.
348.2317 -+	  _M_data->_M_month01 = "January";
348.2318 -+	  _M_data->_M_month02 = "February";
348.2319 -+	  _M_data->_M_month03 = "March";
348.2320 -+	  _M_data->_M_month04 = "April";
348.2321 -+	  _M_data->_M_month05 = "May";
348.2322 -+	  _M_data->_M_month06 = "June";
348.2323 -+	  _M_data->_M_month07 = "July";
348.2324 -+	  _M_data->_M_month08 = "August";
348.2325 -+	  _M_data->_M_month09 = "September";
348.2326 -+	  _M_data->_M_month10 = "October";
348.2327 -+	  _M_data->_M_month11 = "November";
348.2328 -+	  _M_data->_M_month12 = "December";
348.2329 -+
348.2330 -+	  // Abbreviated month names, starting with "C"'s Jan.
348.2331 -+	  _M_data->_M_amonth01 = "Jan";
348.2332 -+	  _M_data->_M_amonth02 = "Feb";
348.2333 -+	  _M_data->_M_amonth03 = "Mar";
348.2334 -+	  _M_data->_M_amonth04 = "Apr";
348.2335 -+	  _M_data->_M_amonth05 = "May";
348.2336 -+	  _M_data->_M_amonth06 = "Jun";
348.2337 -+	  _M_data->_M_amonth07 = "Jul";
348.2338 -+	  _M_data->_M_amonth08 = "Aug";
348.2339 -+	  _M_data->_M_amonth09 = "Sep";
348.2340 -+	  _M_data->_M_amonth10 = "Oct";
348.2341 -+	  _M_data->_M_amonth11 = "Nov";
348.2342 -+	  _M_data->_M_amonth12 = "Dec";
348.2343 -+	}
348.2344 -+      else
348.2345 -+	{
348.2346 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
348.2347 -+
348.2348 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
348.2349 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
348.2350 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
348.2351 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
348.2352 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
348.2353 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
348.2354 -+							     __cloc);
348.2355 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
348.2356 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
348.2357 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
348.2358 -+
348.2359 -+	  // Day names, starting with "C"'s Sunday.
348.2360 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
348.2361 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
348.2362 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
348.2363 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
348.2364 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
348.2365 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
348.2366 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
348.2367 -+
348.2368 -+	  // Abbreviated day names, starting with "C"'s Sun.
348.2369 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
348.2370 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
348.2371 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
348.2372 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
348.2373 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
348.2374 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
348.2375 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
348.2376 -+
348.2377 -+	  // Month names, starting with "C"'s January.
348.2378 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
348.2379 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
348.2380 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
348.2381 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
348.2382 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
348.2383 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
348.2384 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
348.2385 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
348.2386 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
348.2387 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
348.2388 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
348.2389 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
348.2390 -+
348.2391 -+	  // Abbreviated month names, starting with "C"'s Jan.
348.2392 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
348.2393 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
348.2394 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
348.2395 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
348.2396 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
348.2397 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
348.2398 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
348.2399 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
348.2400 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
348.2401 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
348.2402 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
348.2403 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
348.2404 -+	}
348.2405 -+    }
348.2406 -+
348.2407 -+#ifdef _GLIBCXX_USE_WCHAR_T
348.2408 -+  template<>
348.2409 -+    void
348.2410 -+    __timepunct<wchar_t>::
348.2411 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
348.2412 -+	   const tm* __tm) const
348.2413 -+    {
348.2414 -+#ifdef __UCLIBC_HAS_XLOCALE__
348.2415 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
348.2416 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
348.2417 -+					_M_c_locale_timepunct);
348.2418 -+#else
348.2419 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
348.2420 -+      setlocale(LC_ALL, _M_name_timepunct);
348.2421 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
348.2422 -+      setlocale(LC_ALL, __old);
348.2423 -+      free(__old);
348.2424 -+#endif
348.2425 -+      // Make sure __s is null terminated.
348.2426 -+      if (__len == 0)
348.2427 -+	__s[0] = L'\0';
348.2428 -+    }
348.2429 -+
348.2430 -+  template<> 
348.2431 -+    void
348.2432 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
348.2433 -+    {
348.2434 -+      if (!_M_data)
348.2435 -+	_M_data = new __timepunct_cache<wchar_t>;
348.2436 -+
348.2437 -+#warning wide time stuff
348.2438 -+//       if (!__cloc)
348.2439 -+	{
348.2440 -+	  // "C" locale
348.2441 -+	  _M_c_locale_timepunct = _S_get_c_locale();
348.2442 -+
348.2443 -+	  _M_data->_M_date_format = L"%m/%d/%y";
348.2444 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
348.2445 -+	  _M_data->_M_time_format = L"%H:%M:%S";
348.2446 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
348.2447 -+	  _M_data->_M_date_time_format = L"";
348.2448 -+	  _M_data->_M_date_time_era_format = L"";
348.2449 -+	  _M_data->_M_am = L"AM";
348.2450 -+	  _M_data->_M_pm = L"PM";
348.2451 -+	  _M_data->_M_am_pm_format = L"";
348.2452 -+
348.2453 -+	  // Day names, starting with "C"'s Sunday.
348.2454 -+	  _M_data->_M_day1 = L"Sunday";
348.2455 -+	  _M_data->_M_day2 = L"Monday";
348.2456 -+	  _M_data->_M_day3 = L"Tuesday";
348.2457 -+	  _M_data->_M_day4 = L"Wednesday";
348.2458 -+	  _M_data->_M_day5 = L"Thursday";
348.2459 -+	  _M_data->_M_day6 = L"Friday";
348.2460 -+	  _M_data->_M_day7 = L"Saturday";
348.2461 -+
348.2462 -+	  // Abbreviated day names, starting with "C"'s Sun.
348.2463 -+	  _M_data->_M_aday1 = L"Sun";
348.2464 -+	  _M_data->_M_aday2 = L"Mon";
348.2465 -+	  _M_data->_M_aday3 = L"Tue";
348.2466 -+	  _M_data->_M_aday4 = L"Wed";
348.2467 -+	  _M_data->_M_aday5 = L"Thu";
348.2468 -+	  _M_data->_M_aday6 = L"Fri";
348.2469 -+	  _M_data->_M_aday7 = L"Sat";
348.2470 -+
348.2471 -+	  // Month names, starting with "C"'s January.
348.2472 -+	  _M_data->_M_month01 = L"January";
348.2473 -+	  _M_data->_M_month02 = L"February";
348.2474 -+	  _M_data->_M_month03 = L"March";
348.2475 -+	  _M_data->_M_month04 = L"April";
348.2476 -+	  _M_data->_M_month05 = L"May";
348.2477 -+	  _M_data->_M_month06 = L"June";
348.2478 -+	  _M_data->_M_month07 = L"July";
348.2479 -+	  _M_data->_M_month08 = L"August";
348.2480 -+	  _M_data->_M_month09 = L"September";
348.2481 -+	  _M_data->_M_month10 = L"October";
348.2482 -+	  _M_data->_M_month11 = L"November";
348.2483 -+	  _M_data->_M_month12 = L"December";
348.2484 -+
348.2485 -+	  // Abbreviated month names, starting with "C"'s Jan.
348.2486 -+	  _M_data->_M_amonth01 = L"Jan";
348.2487 -+	  _M_data->_M_amonth02 = L"Feb";
348.2488 -+	  _M_data->_M_amonth03 = L"Mar";
348.2489 -+	  _M_data->_M_amonth04 = L"Apr";
348.2490 -+	  _M_data->_M_amonth05 = L"May";
348.2491 -+	  _M_data->_M_amonth06 = L"Jun";
348.2492 -+	  _M_data->_M_amonth07 = L"Jul";
348.2493 -+	  _M_data->_M_amonth08 = L"Aug";
348.2494 -+	  _M_data->_M_amonth09 = L"Sep";
348.2495 -+	  _M_data->_M_amonth10 = L"Oct";
348.2496 -+	  _M_data->_M_amonth11 = L"Nov";
348.2497 -+	  _M_data->_M_amonth12 = L"Dec";
348.2498 -+	}
348.2499 -+#if 0
348.2500 -+      else
348.2501 -+	{
348.2502 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
348.2503 -+
348.2504 -+	  union { char *__s; wchar_t *__w; } __u;
348.2505 -+
348.2506 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
348.2507 -+	  _M_data->_M_date_format = __u.__w;
348.2508 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
348.2509 -+	  _M_data->_M_date_era_format = __u.__w;
348.2510 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
348.2511 -+	  _M_data->_M_time_format = __u.__w;
348.2512 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
348.2513 -+	  _M_data->_M_time_era_format = __u.__w;
348.2514 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
348.2515 -+	  _M_data->_M_date_time_format = __u.__w;
348.2516 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
348.2517 -+	  _M_data->_M_date_time_era_format = __u.__w;
348.2518 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
348.2519 -+	  _M_data->_M_am = __u.__w;
348.2520 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
348.2521 -+	  _M_data->_M_pm = __u.__w;
348.2522 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
348.2523 -+	  _M_data->_M_am_pm_format = __u.__w;
348.2524 -+
348.2525 -+	  // Day names, starting with "C"'s Sunday.
348.2526 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
348.2527 -+	  _M_data->_M_day1 = __u.__w;
348.2528 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
348.2529 -+	  _M_data->_M_day2 = __u.__w;
348.2530 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
348.2531 -+	  _M_data->_M_day3 = __u.__w;
348.2532 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
348.2533 -+	  _M_data->_M_day4 = __u.__w;
348.2534 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
348.2535 -+	  _M_data->_M_day5 = __u.__w;
348.2536 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
348.2537 -+	  _M_data->_M_day6 = __u.__w;
348.2538 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
348.2539 -+	  _M_data->_M_day7 = __u.__w;
348.2540 -+
348.2541 -+	  // Abbreviated day names, starting with "C"'s Sun.
348.2542 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
348.2543 -+	  _M_data->_M_aday1 = __u.__w;
348.2544 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
348.2545 -+	  _M_data->_M_aday2 = __u.__w;
348.2546 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
348.2547 -+	  _M_data->_M_aday3 = __u.__w;
348.2548 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
348.2549 -+	  _M_data->_M_aday4 = __u.__w;
348.2550 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
348.2551 -+	  _M_data->_M_aday5 = __u.__w;
348.2552 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
348.2553 -+	  _M_data->_M_aday6 = __u.__w;
348.2554 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
348.2555 -+	  _M_data->_M_aday7 = __u.__w;
348.2556 -+
348.2557 -+	  // Month names, starting with "C"'s January.
348.2558 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
348.2559 -+	  _M_data->_M_month01 = __u.__w;
348.2560 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
348.2561 -+	  _M_data->_M_month02 = __u.__w;
348.2562 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
348.2563 -+	  _M_data->_M_month03 = __u.__w;
348.2564 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
348.2565 -+	  _M_data->_M_month04 = __u.__w;
348.2566 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
348.2567 -+	  _M_data->_M_month05 = __u.__w;
348.2568 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
348.2569 -+	  _M_data->_M_month06 = __u.__w;
348.2570 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
348.2571 -+	  _M_data->_M_month07 = __u.__w;
348.2572 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
348.2573 -+	  _M_data->_M_month08 = __u.__w;
348.2574 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
348.2575 -+	  _M_data->_M_month09 = __u.__w;
348.2576 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
348.2577 -+	  _M_data->_M_month10 = __u.__w;
348.2578 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
348.2579 -+	  _M_data->_M_month11 = __u.__w;
348.2580 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
348.2581 -+	  _M_data->_M_month12 = __u.__w;
348.2582 -+
348.2583 -+	  // Abbreviated month names, starting with "C"'s Jan.
348.2584 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
348.2585 -+	  _M_data->_M_amonth01 = __u.__w;
348.2586 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
348.2587 -+	  _M_data->_M_amonth02 = __u.__w;
348.2588 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
348.2589 -+	  _M_data->_M_amonth03 = __u.__w;
348.2590 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
348.2591 -+	  _M_data->_M_amonth04 = __u.__w;
348.2592 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
348.2593 -+	  _M_data->_M_amonth05 = __u.__w;
348.2594 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
348.2595 -+	  _M_data->_M_amonth06 = __u.__w;
348.2596 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
348.2597 -+	  _M_data->_M_amonth07 = __u.__w;
348.2598 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
348.2599 -+	  _M_data->_M_amonth08 = __u.__w;
348.2600 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
348.2601 -+	  _M_data->_M_amonth09 = __u.__w;
348.2602 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
348.2603 -+	  _M_data->_M_amonth10 = __u.__w;
348.2604 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
348.2605 -+	  _M_data->_M_amonth11 = __u.__w;
348.2606 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
348.2607 -+	  _M_data->_M_amonth12 = __u.__w;
348.2608 -+	}
348.2609 -+#endif // 0
348.2610 -+    }
348.2611 -+#endif
348.2612 -+}
348.2613 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
348.2614 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
348.2615 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
348.2616 -@@ -0,0 +1,68 @@
348.2617 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
348.2618 -+
348.2619 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
348.2620 -+//
348.2621 -+// This file is part of the GNU ISO C++ Library.  This library is free
348.2622 -+// software; you can redistribute it and/or modify it under the
348.2623 -+// terms of the GNU General Public License as published by the
348.2624 -+// Free Software Foundation; either version 2, or (at your option)
348.2625 -+// any later version.
348.2626 -+
348.2627 -+// This library is distributed in the hope that it will be useful,
348.2628 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
348.2629 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
348.2630 -+// GNU General Public License for more details.
348.2631 -+
348.2632 -+// You should have received a copy of the GNU General Public License along
348.2633 -+// with this library; see the file COPYING.  If not, write to the Free
348.2634 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
348.2635 -+// USA.
348.2636 -+
348.2637 -+// As a special exception, you may use this file as part of a free software
348.2638 -+// library without restriction.  Specifically, if other files instantiate
348.2639 -+// templates or use macros or inline functions from this file, or you compile
348.2640 -+// this file and link it with other files to produce an executable, this
348.2641 -+// file does not by itself cause the resulting executable to be covered by
348.2642 -+// the GNU General Public License.  This exception does not however
348.2643 -+// invalidate any other reasons why the executable file might be covered by
348.2644 -+// the GNU General Public License.
348.2645 -+
348.2646 -+//
348.2647 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
348.2648 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
348.2649 -+//
348.2650 -+
348.2651 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
348.2652 -+
348.2653 -+  template<typename _CharT>
348.2654 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
348.2655 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
348.2656 -+    _M_name_timepunct(_S_get_c_name())
348.2657 -+    { _M_initialize_timepunct(); }
348.2658 -+
348.2659 -+  template<typename _CharT>
348.2660 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
348.2661 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
348.2662 -+    _M_name_timepunct(_S_get_c_name())
348.2663 -+    { _M_initialize_timepunct(); }
348.2664 -+
348.2665 -+  template<typename _CharT>
348.2666 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
348.2667 -+				     size_t __refs) 
348.2668 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
348.2669 -+    _M_name_timepunct(__s)
348.2670 -+    { 
348.2671 -+      char* __tmp = new char[std::strlen(__s) + 1];
348.2672 -+      std::strcpy(__tmp, __s);
348.2673 -+      _M_name_timepunct = __tmp;
348.2674 -+      _M_initialize_timepunct(__cloc); 
348.2675 -+    }
348.2676 -+
348.2677 -+  template<typename _CharT>
348.2678 -+    __timepunct<_CharT>::~__timepunct()
348.2679 -+    { 
348.2680 -+      if (_M_name_timepunct != _S_get_c_name())
348.2681 -+	delete [] _M_name_timepunct;
348.2682 -+      delete _M_data; 
348.2683 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
348.2684 -+    }
348.2685 -diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
348.2686 ---- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:29:22.000000000 +0200
348.2687 -+++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
348.2688 -@@ -5769,7 +5769,7 @@
348.2689 -   enableval="$enable_clocale"
348.2690 - 
348.2691 -       case "$enableval" in
348.2692 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
348.2693 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
348.2694 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
348.2695 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
348.2696 -    { (exit 1); exit 1; }; } ;;
348.2697 -@@ -5802,6 +5802,9 @@
348.2698 -   # Default to "generic".
348.2699 -   if test $enable_clocale_flag = auto; then
348.2700 -     case ${target_os} in
348.2701 -+      linux-uclibc*)
348.2702 -+        enable_clocale_flag=uclibc
348.2703 -+	;;
348.2704 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
348.2705 -         enable_clocale_flag=gnu
348.2706 -         ;;
348.2707 -@@ -6190,6 +6193,76 @@
348.2708 -       CTIME_CC=config/locale/generic/time_members.cc
348.2709 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
348.2710 -       ;;
348.2711 -+    uclibc)
348.2712 -+      echo "$as_me:$LINENO: result: uclibc" >&5
348.2713 -+echo "${ECHO_T}uclibc" >&6
348.2714 -+
348.2715 -+      # Declare intention to use gettext, and add support for specific
348.2716 -+      # languages.
348.2717 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
348.2718 -+      ALL_LINGUAS="de fr"
348.2719 -+
348.2720 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
348.2721 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
348.2722 -+set dummy msgfmt; ac_word=$2
348.2723 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
348.2724 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
348.2725 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
348.2726 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
348.2727 -+else
348.2728 -+  if test -n "$check_msgfmt"; then
348.2729 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
348.2730 -+else
348.2731 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
348.2732 -+for as_dir in $PATH
348.2733 -+do
348.2734 -+  IFS=$as_save_IFS
348.2735 -+  test -z "$as_dir" && as_dir=.
348.2736 -+  for ac_exec_ext in '' $ac_executable_extensions; do
348.2737 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
348.2738 -+    ac_cv_prog_check_msgfmt="yes"
348.2739 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
348.2740 -+    break 2
348.2741 -+  fi
348.2742 -+done
348.2743 -+done
348.2744 -+
348.2745 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
348.2746 -+fi
348.2747 -+fi
348.2748 -+check_msgfmt=$ac_cv_prog_check_msgfmt
348.2749 -+if test -n "$check_msgfmt"; then
348.2750 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
348.2751 -+echo "${ECHO_T}$check_msgfmt" >&6
348.2752 -+else
348.2753 -+  echo "$as_me:$LINENO: result: no" >&5
348.2754 -+echo "${ECHO_T}no" >&6
348.2755 -+fi
348.2756 -+
348.2757 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
348.2758 -+        USE_NLS=yes
348.2759 -+      fi
348.2760 -+      # Export the build objects.
348.2761 -+      for ling in $ALL_LINGUAS; do \
348.2762 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
348.2763 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
348.2764 -+      done
348.2765 -+
348.2766 -+
348.2767 -+
348.2768 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
348.2769 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
348.2770 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
348.2771 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
348.2772 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
348.2773 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
348.2774 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
348.2775 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
348.2776 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
348.2777 -+      CTIME_H=config/locale/uclibc/time_members.h
348.2778 -+      CTIME_CC=config/locale/uclibc/time_members.cc
348.2779 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
348.2780 -+      ;;
348.2781 -   esac
348.2782 - 
348.2783 -   # This is where the testsuite looks for locale catalogs, using the
348.2784 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h
348.2785 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2005-08-17 04:28:44.000000000 +0200
348.2786 -+++ gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h	2007-08-03 20:30:21.000000000 +0200
348.2787 -@@ -101,7 +101,9 @@
348.2788 - using std::wmemcpy;
348.2789 - using std::wmemmove;
348.2790 - using std::wmemset;
348.2791 -+#if _GLIBCXX_HAVE_WCSFTIME
348.2792 - using std::wcsftime;
348.2793 -+#endif
348.2794 - 
348.2795 - #if _GLIBCXX_USE_C99
348.2796 - using std::wcstold;
348.2797 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h
348.2798 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h	2006-12-07 10:33:51.000000000 +0100
348.2799 -+++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h	2007-08-03 20:30:21.000000000 +0200
348.2800 -@@ -182,7 +182,9 @@
348.2801 -   using ::wcscoll;
348.2802 -   using ::wcscpy;
348.2803 -   using ::wcscspn;
348.2804 -+#if _GLIBCXX_HAVE_WCSFTIME
348.2805 -   using ::wcsftime;
348.2806 -+#endif
348.2807 -   using ::wcslen;
348.2808 -   using ::wcsncat;
348.2809 -   using ::wcsncmp;
   349.1 --- a/patches/gcc/4.2.4/203-uclibc-locale-no__x.patch	Mon Jul 28 21:08:01 2008 +0000
   349.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   349.3 @@ -1,223 +0,0 @@
   349.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   349.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:21.000000000 +0200
   349.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   349.7 -@@ -39,20 +39,6 @@
   349.8 - #include <langinfo.h>
   349.9 - #include <bits/c++locale_internal.h>
  349.10 - 
  349.11 --#ifndef __UCLIBC_HAS_XLOCALE__
  349.12 --#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  349.13 --#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  349.14 --#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  349.15 --#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  349.16 --#define __strtof_l(S, E, L)         strtof((S), (E))
  349.17 --#define __strtod_l(S, E, L)         strtod((S), (E))
  349.18 --#define __strtold_l(S, E, L)        strtold((S), (E))
  349.19 --#warning should dummy __newlocale check for C|POSIX ?
  349.20 --#define __newlocale(a, b, c)        NULL
  349.21 --#define __freelocale(a)             ((void)0)
  349.22 --#define __duplocale(a)              __c_locale()
  349.23 --#endif
  349.24 --
  349.25 - namespace std 
  349.26 - {
  349.27 -   template<>
  349.28 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  349.29 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:21.000000000 +0200
  349.30 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  349.31 -@@ -68,6 +68,7 @@
  349.32 - {
  349.33 -   extern "C" __typeof(uselocale) __uselocale;
  349.34 - }
  349.35 -+#define __uselocale uselocale
  349.36 - #endif
  349.37 - 
  349.38 - namespace std
  349.39 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  349.40 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:21.000000000 +0200
  349.41 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2007-08-03 20:30:53.000000000 +0200
  349.42 -@@ -60,4 +60,49 @@
  349.43 - extern "C" __typeof(wctype_l) __wctype_l;
  349.44 - #endif 
  349.45 - 
  349.46 -+# define __nl_langinfo_l nl_langinfo_l
  349.47 -+# define __strcoll_l strcoll_l
  349.48 -+# define __strftime_l strftime_l
  349.49 -+# define __strtod_l strtod_l
  349.50 -+# define __strtof_l strtof_l
  349.51 -+# define __strtold_l strtold_l
  349.52 -+# define __strxfrm_l strxfrm_l
  349.53 -+# define __newlocale newlocale
  349.54 -+# define __freelocale freelocale
  349.55 -+# define __duplocale duplocale
  349.56 -+# define __uselocale uselocale
  349.57 -+
  349.58 -+# ifdef _GLIBCXX_USE_WCHAR_T
  349.59 -+#  define __iswctype_l iswctype_l
  349.60 -+#  define __towlower_l towlower_l
  349.61 -+#  define __towupper_l towupper_l
  349.62 -+#  define __wcscoll_l wcscoll_l
  349.63 -+#  define __wcsftime_l wcsftime_l
  349.64 -+#  define __wcsxfrm_l wcsxfrm_l
  349.65 -+#  define __wctype_l wctype_l
  349.66 -+# endif
  349.67 -+
  349.68 -+#else
  349.69 -+# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  349.70 -+# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  349.71 -+# define __strtod_l(S, E, L)         strtod((S), (E))
  349.72 -+# define __strtof_l(S, E, L)         strtof((S), (E))
  349.73 -+# define __strtold_l(S, E, L)        strtold((S), (E))
  349.74 -+# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  349.75 -+# warning should dummy __newlocale check for C|POSIX ?
  349.76 -+# define __newlocale(a, b, c)        NULL
  349.77 -+# define __freelocale(a)             ((void)0)
  349.78 -+# define __duplocale(a)              __c_locale()
  349.79 -+//# define __uselocale ?
  349.80 -+//
  349.81 -+# ifdef _GLIBCXX_USE_WCHAR_T
  349.82 -+#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  349.83 -+#  define __towlower_l(C, L)          towlower((C))
  349.84 -+#  define __towupper_l(C, L)          towupper((C))
  349.85 -+#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  349.86 -+//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  349.87 -+#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  349.88 -+#  define __wctype_l(S, L)            wctype((S))
  349.89 -+# endif
  349.90 -+
  349.91 - #endif // GLIBC 2.3 and later
  349.92 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
  349.93 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:21.000000000 +0200
  349.94 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2007-08-03 20:30:53.000000000 +0200
  349.95 -@@ -36,13 +36,6 @@
  349.96 - #include <locale>
  349.97 - #include <bits/c++locale_internal.h>
  349.98 - 
  349.99 --#ifndef __UCLIBC_HAS_XLOCALE__
 349.100 --#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 349.101 --#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 349.102 --#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 349.103 --#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 349.104 --#endif
 349.105 --
 349.106 - namespace std
 349.107 - {
 349.108 -   // These are basically extensions to char_traits, and perhaps should
 349.109 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 349.110 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:21.000000000 +0200
 349.111 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 349.112 -@@ -38,13 +38,6 @@
 349.113 - #undef _LIBC
 349.114 - #include <bits/c++locale_internal.h>
 349.115 - 
 349.116 --#ifndef __UCLIBC_HAS_XLOCALE__
 349.117 --#define __wctype_l(S, L)           wctype((S))
 349.118 --#define __towupper_l(C, L)         towupper((C))
 349.119 --#define __towlower_l(C, L)         towlower((C))
 349.120 --#define __iswctype_l(C, M, L)      iswctype((C), (M))
 349.121 --#endif
 349.122 --
 349.123 - namespace std
 349.124 - {
 349.125 -   // NB: The other ctype<char> specializations are in src/locale.cc and
 349.126 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
 349.127 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:21.000000000 +0200
 349.128 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2007-08-03 20:30:53.000000000 +0200
 349.129 -@@ -39,13 +39,10 @@
 349.130 - #ifdef __UCLIBC_MJN3_ONLY__
 349.131 - #warning fix gettext stuff
 349.132 - #endif
 349.133 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 349.134 --extern "C" char *__dcgettext(const char *domainname,
 349.135 --			     const char *msgid, int category);
 349.136 - #undef gettext
 349.137 --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 349.138 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 349.139 -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 349.140 - #else
 349.141 --#undef gettext
 349.142 - #define gettext(msgid) (msgid)
 349.143 - #endif
 349.144 - 
 349.145 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 349.146 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:21.000000000 +0200
 349.147 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 349.148 -@@ -36,15 +36,11 @@
 349.149 - #ifdef __UCLIBC_MJN3_ONLY__
 349.150 - #warning fix prototypes for *textdomain funcs
 349.151 - #endif
 349.152 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 349.153 --extern "C" char *__textdomain(const char *domainname);
 349.154 --extern "C" char *__bindtextdomain(const char *domainname,
 349.155 --				  const char *dirname);
 349.156 --#else
 349.157 --#undef __textdomain
 349.158 --#undef __bindtextdomain
 349.159 --#define __textdomain(D)           ((void)0)
 349.160 --#define __bindtextdomain(D,P)     ((void)0)
 349.161 -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 349.162 -+#undef textdomain
 349.163 -+#undef bindtextdomain
 349.164 -+#define textdomain(D)           ((void)0)
 349.165 -+#define bindtextdomain(D,P)     ((void)0)
 349.166 - #endif
 349.167 - 
 349.168 -   // Non-virtual member functions.
 349.169 -@@ -70,7 +66,7 @@
 349.170 -     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 349.171 - 			   const char* __dir) const
 349.172 -     { 
 349.173 --      __bindtextdomain(__s.c_str(), __dir);
 349.174 -+      bindtextdomain(__s.c_str(), __dir);
 349.175 -       return this->do_open(__s, __loc); 
 349.176 -     }
 349.177 - 
 349.178 -@@ -90,7 +86,7 @@
 349.179 -     { 
 349.180 -       // No error checking is done, assume the catalog exists and can
 349.181 -       // be used.
 349.182 --      __textdomain(__s.c_str());
 349.183 -+      textdomain(__s.c_str());
 349.184 -       return 0;
 349.185 -     }
 349.186 - 
 349.187 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 349.188 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:21.000000000 +0200
 349.189 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
 349.190 -@@ -43,10 +43,6 @@
 349.191 - #warning tailor for stub locale support
 349.192 - #endif
 349.193 - 
 349.194 --#ifndef __UCLIBC_HAS_XLOCALE__
 349.195 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 349.196 --#endif
 349.197 --
 349.198 - namespace std
 349.199 - {
 349.200 -   // Construct and return valid pattern consisting of some combination of:
 349.201 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 349.202 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:21.000000000 +0200
 349.203 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
 349.204 -@@ -41,9 +41,6 @@
 349.205 - #ifdef __UCLIBC_MJN3_ONLY__
 349.206 - #warning tailor for stub locale support
 349.207 - #endif
 349.208 --#ifndef __UCLIBC_HAS_XLOCALE__
 349.209 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 349.210 --#endif
 349.211 - 
 349.212 - namespace std
 349.213 - {
 349.214 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
 349.215 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:21.000000000 +0200
 349.216 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2007-08-03 20:30:53.000000000 +0200
 349.217 -@@ -40,9 +40,6 @@
 349.218 - #ifdef __UCLIBC_MJN3_ONLY__
 349.219 - #warning tailor for stub locale support
 349.220 - #endif
 349.221 --#ifndef __UCLIBC_HAS_XLOCALE__
 349.222 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 349.223 --#endif
 349.224 - 
 349.225 - namespace std
 349.226 - {
   350.1 --- a/patches/gcc/4.2.4/204-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:08:01 2008 +0000
   350.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   350.3 @@ -1,50 +0,0 @@
   350.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   350.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:30:53.000000000 +0200
   350.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
   350.7 -@@ -401,7 +401,7 @@
   350.8 - # ifdef __UCLIBC_HAS_XLOCALE__
   350.9 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  350.10 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  350.11 --# else
  350.12 -+# elif defined __UCLIBC_HAS_LOCALE__
  350.13 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  350.14 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  350.15 - # endif
  350.16 -@@ -556,7 +556,7 @@
  350.17 - # ifdef __UCLIBC_HAS_XLOCALE__
  350.18 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  350.19 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  350.20 --# else
  350.21 -+# elif defined __UCLIBC_HAS_LOCALE__
  350.22 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  350.23 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  350.24 - # endif
  350.25 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  350.26 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:30:53.000000000 +0200
  350.27 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
  350.28 -@@ -127,12 +127,25 @@
  350.29 - 	{
  350.30 - 	  // Named locale.
  350.31 - 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  350.32 -+#ifdef __UCLIBC_MJN3_ONLY__
  350.33 -+#warning fix this... should be numeric
  350.34 -+#endif
  350.35 -+#ifdef __UCLIBC__
  350.36 -+# ifdef __UCLIBC_HAS_XLOCALE__
  350.37 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  350.38 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  350.39 -+# elif defined __UCLIBC_HAS_LOCALE__
  350.40 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  350.41 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  350.42 -+# endif
  350.43 -+#else
  350.44 - 	  union { char *__s; wchar_t __w; } __u;
  350.45 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  350.46 - 	  _M_data->_M_decimal_point = __u.__w;
  350.47 - 
  350.48 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  350.49 - 	  _M_data->_M_thousands_sep = __u.__w;
  350.50 -+#endif
  350.51 - 
  350.52 - 	  if (_M_data->_M_thousands_sep == L'\0')
  350.53 - 	    _M_data->_M_grouping = "";
   351.1 --- a/patches/gcc/4.2.4/205-uclibc-locale-update.patch	Mon Jul 28 21:08:01 2008 +0000
   351.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   351.3 @@ -1,354 +0,0 @@
   351.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   351.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:30:53.000000000 +0200
   351.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2007-08-03 20:31:54.000000000 +0200
   351.7 -@@ -46,16 +46,13 @@
   351.8 -     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   351.9 - 		   const __c_locale& __cloc)
  351.10 -     {
  351.11 --      if (!(__err & ios_base::failbit))
  351.12 --	{
  351.13 --	  char* __sanity;
  351.14 --	  errno = 0;
  351.15 --	  float __f = __strtof_l(__s, &__sanity, __cloc);
  351.16 --          if (__sanity != __s && errno != ERANGE)
  351.17 --	    __v = __f;
  351.18 --	  else
  351.19 --	    __err |= ios_base::failbit;
  351.20 --	}
  351.21 -+      char* __sanity;
  351.22 -+      errno = 0;
  351.23 -+      float __f = __strtof_l(__s, &__sanity, __cloc);
  351.24 -+      if (__sanity != __s && errno != ERANGE)
  351.25 -+	__v = __f;
  351.26 -+      else
  351.27 -+	__err |= ios_base::failbit;
  351.28 -     }
  351.29 - 
  351.30 -   template<>
  351.31 -@@ -63,16 +60,13 @@
  351.32 -     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  351.33 - 		   const __c_locale& __cloc)
  351.34 -     {
  351.35 --      if (!(__err & ios_base::failbit))
  351.36 --	{
  351.37 --	  char* __sanity;
  351.38 --	  errno = 0;
  351.39 --	  double __d = __strtod_l(__s, &__sanity, __cloc);
  351.40 --          if (__sanity != __s && errno != ERANGE)
  351.41 --	    __v = __d;
  351.42 --	  else
  351.43 --	    __err |= ios_base::failbit;
  351.44 --	}
  351.45 -+      char* __sanity;
  351.46 -+      errno = 0;
  351.47 -+      double __d = __strtod_l(__s, &__sanity, __cloc);
  351.48 -+      if (__sanity != __s && errno != ERANGE)
  351.49 -+	__v = __d;
  351.50 -+      else
  351.51 -+	__err |= ios_base::failbit;
  351.52 -     }
  351.53 - 
  351.54 -   template<>
  351.55 -@@ -80,16 +74,13 @@
  351.56 -     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  351.57 - 		   const __c_locale& __cloc)
  351.58 -     {
  351.59 --      if (!(__err & ios_base::failbit))
  351.60 --	{
  351.61 --	  char* __sanity;
  351.62 --	  errno = 0;
  351.63 --	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  351.64 --          if (__sanity != __s && errno != ERANGE)
  351.65 --	    __v = __ld;
  351.66 --	  else
  351.67 --	    __err |= ios_base::failbit;
  351.68 --	}
  351.69 -+      char* __sanity;
  351.70 -+      errno = 0;
  351.71 -+      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  351.72 -+      if (__sanity != __s && errno != ERANGE)
  351.73 -+	__v = __ld;
  351.74 -+      else
  351.75 -+	__err |= ios_base::failbit;
  351.76 -     }
  351.77 - 
  351.78 -   void
  351.79 -@@ -110,7 +101,7 @@
  351.80 -   void
  351.81 -   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  351.82 -   {
  351.83 --    if (_S_get_c_locale() != __cloc)
  351.84 -+    if (__cloc && _S_get_c_locale() != __cloc)
  351.85 -       __freelocale(__cloc); 
  351.86 -   }
  351.87 - 
  351.88 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  351.89 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:30:53.000000000 +0200
  351.90 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2007-08-03 20:31:54.000000000 +0200
  351.91 -@@ -39,21 +39,23 @@
  351.92 - #pragma GCC system_header
  351.93 - 
  351.94 - #include <cstring>              // get std::strlen
  351.95 --#include <cstdio>               // get std::snprintf or std::sprintf
  351.96 -+#include <cstdio>               // get std::vsnprintf or std::vsprintf
  351.97 - #include <clocale>
  351.98 - #include <langinfo.h>		// For codecvt
  351.99 - #ifdef __UCLIBC_MJN3_ONLY__
 351.100 - #warning fix this
 351.101 - #endif
 351.102 --#ifdef __UCLIBC_HAS_LOCALE__
 351.103 -+#ifdef _GLIBCXX_USE_ICONV
 351.104 - #include <iconv.h>		// For codecvt using iconv, iconv_t
 351.105 - #endif
 351.106 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 351.107 --#include <libintl.h> 		// For messages
 351.108 -+#ifdef HAVE_LIBINTL_H
 351.109 -+#include <libintl.h>		// For messages
 351.110 - #endif
 351.111 -+#include <cstdarg>
 351.112 - 
 351.113 - #ifdef __UCLIBC_MJN3_ONLY__
 351.114 - #warning what is _GLIBCXX_C_LOCALE_GNU for
 351.115 -+// psm: used in os/gnu-linux/ctype_noninline.h
 351.116 - #endif
 351.117 - #define _GLIBCXX_C_LOCALE_GNU 1
 351.118 - 
 351.119 -@@ -62,7 +64,7 @@
 351.120 - #endif
 351.121 - // #define _GLIBCXX_NUM_CATEGORIES 6
 351.122 - #define _GLIBCXX_NUM_CATEGORIES 0
 351.123 -- 
 351.124 -+
 351.125 - #ifdef __UCLIBC_HAS_XLOCALE__
 351.126 - namespace __gnu_cxx
 351.127 - {
 351.128 -@@ -79,22 +81,24 @@
 351.129 -   typedef int*			__c_locale;
 351.130 - #endif
 351.131 - 
 351.132 --  // Convert numeric value of type _Tv to string and return length of
 351.133 --  // string.  If snprintf is available use it, otherwise fall back to
 351.134 --  // the unsafe sprintf which, in general, can be dangerous and should
 351.135 -+  // Convert numeric value of type double to string and return length of
 351.136 -+  // string.  If vsnprintf is available use it, otherwise fall back to
 351.137 -+  // the unsafe vsprintf which, in general, can be dangerous and should
 351.138 -   // be avoided.
 351.139 --  template<typename _Tv>
 351.140 --    int
 351.141 --    __convert_from_v(char* __out, 
 351.142 --		     const int __size __attribute__ ((__unused__)),
 351.143 --		     const char* __fmt,
 351.144 --#ifdef __UCLIBC_HAS_XCLOCALE__
 351.145 --		     _Tv __v, const __c_locale& __cloc, int __prec)
 351.146 -+    inline int
 351.147 -+    __convert_from_v(const __c_locale&
 351.148 -+#ifndef __UCLIBC_HAS_XCLOCALE__
 351.149 -+					__cloc __attribute__ ((__unused__))
 351.150 -+#endif
 351.151 -+		     ,
 351.152 -+		     char* __out,
 351.153 -+		     const int __size,
 351.154 -+		     const char* __fmt, ...)
 351.155 -     {
 351.156 -+      va_list __args;
 351.157 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 351.158 -       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 351.159 - #else
 351.160 --		     _Tv __v, const __c_locale&, int __prec)
 351.161 --    {
 351.162 - # ifdef __UCLIBC_HAS_LOCALE__
 351.163 -       char* __old = std::setlocale(LC_ALL, NULL);
 351.164 -       char* __sav = new char[std::strlen(__old) + 1];
 351.165 -@@ -103,7 +107,9 @@
 351.166 - # endif
 351.167 - #endif
 351.168 - 
 351.169 --      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 351.170 -+      va_start(__args, __fmt);
 351.171 -+      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 351.172 -+      va_end(__args);
 351.173 - 
 351.174 - #ifdef __UCLIBC_HAS_XCLOCALE__
 351.175 -       __gnu_cxx::__uselocale(__old);
 351.176 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 351.177 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:30:53.000000000 +0200
 351.178 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2007-08-03 20:31:54.000000000 +0200
 351.179 -@@ -33,9 +33,14 @@
 351.180 - 
 351.181 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 351.182 - 
 351.183 -+#include <features.h>
 351.184 -+#ifdef __UCLIBC_HAS_LOCALE__
 351.185 - #define _LIBC
 351.186 - #include <locale>
 351.187 - #undef _LIBC
 351.188 -+#else
 351.189 -+#include <locale>
 351.190 -+#endif
 351.191 - #include <bits/c++locale_internal.h>
 351.192 - 
 351.193 - namespace std
 351.194 -@@ -138,20 +143,34 @@
 351.195 -   ctype<wchar_t>::
 351.196 -   do_is(mask __m, wchar_t __c) const
 351.197 -   { 
 351.198 --    // Highest bitmask in ctype_base == 10, but extra in "C"
 351.199 --    // library for blank.
 351.200 -+    // The case of __m == ctype_base::space is particularly important,
 351.201 -+    // due to its use in many istream functions.  Therefore we deal with
 351.202 -+    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 351.203 -+    // is the mask corresponding to ctype_base::space.  NB: an encoding
 351.204 -+    // change would not affect correctness!
 351.205 -     bool __ret = false;
 351.206 --    const size_t __bitmasksize = 11; 
 351.207 --    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 351.208 --      if (__m & _M_bit[__bitcur]
 351.209 --	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 351.210 --	{
 351.211 --	  __ret = true;
 351.212 --	  break;
 351.213 --	}
 351.214 -+    if (__m == _M_bit[5])
 351.215 -+      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 351.216 -+    else
 351.217 -+      {
 351.218 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 351.219 -+	// library for blank.
 351.220 -+	const size_t __bitmasksize = 11;
 351.221 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 351.222 -+	  if (__m & _M_bit[__bitcur])
 351.223 -+	    {
 351.224 -+	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 351.225 -+		{
 351.226 -+		  __ret = true;
 351.227 -+		  break;
 351.228 -+		}
 351.229 -+	      else if (__m == _M_bit[__bitcur])
 351.230 -+		break;
 351.231 -+	    }
 351.232 -+      }
 351.233 -     return __ret;    
 351.234 -   }
 351.235 --  
 351.236 -+
 351.237 -   const wchar_t* 
 351.238 -   ctype<wchar_t>::
 351.239 -   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 351.240 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 351.241 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:30:53.000000000 +0200
 351.242 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
 351.243 -@@ -47,18 +47,21 @@
 351.244 -   template<typename _CharT>
 351.245 -      messages<_CharT>::messages(size_t __refs)
 351.246 -      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 351.247 --     _M_name_messages(_S_get_c_name())
 351.248 -+       _M_name_messages(_S_get_c_name())
 351.249 -      { }
 351.250 - 
 351.251 -   template<typename _CharT>
 351.252 -      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 351.253 - 				size_t __refs) 
 351.254 --     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 351.255 --     _M_name_messages(__s)
 351.256 -+     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 351.257 -      {
 351.258 --       char* __tmp = new char[std::strlen(__s) + 1];
 351.259 --       std::strcpy(__tmp, __s);
 351.260 -+       const size_t __len = std::strlen(__s) + 1;
 351.261 -+       char* __tmp = new char[__len];
 351.262 -+       std::memcpy(__tmp, __s, __len);
 351.263 -        _M_name_messages = __tmp;
 351.264 -+
 351.265 -+       // Last to avoid leaking memory if new throws.
 351.266 -+       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 351.267 -      }
 351.268 - 
 351.269 -   template<typename _CharT>
 351.270 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 351.271 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:24.000000000 +0200
 351.272 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2007-08-03 20:31:54.000000000 +0200
 351.273 -@@ -33,9 +33,14 @@
 351.274 - 
 351.275 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 351.276 - 
 351.277 -+#include <features.h>
 351.278 -+#ifdef __UCLIBC_HAS_LOCALE__
 351.279 - #define _LIBC
 351.280 - #include <locale>
 351.281 - #undef _LIBC
 351.282 -+#else
 351.283 -+#include <locale>
 351.284 -+#endif
 351.285 - #include <bits/c++locale_internal.h>
 351.286 - 
 351.287 - #ifdef __UCLIBC_MJN3_ONLY__
 351.288 -@@ -206,7 +211,7 @@
 351.289 - 	  }
 351.290 - 	break;
 351.291 -       default:
 351.292 --	;
 351.293 -+	__ret = pattern();
 351.294 -       }
 351.295 -     return __ret;
 351.296 -   }
 351.297 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 351.298 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:24.000000000 +0200
 351.299 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2007-08-03 20:31:54.000000000 +0200
 351.300 -@@ -33,9 +33,14 @@
 351.301 - 
 351.302 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 351.303 - 
 351.304 -+#include <features.h>
 351.305 -+#ifdef __UCLIBC_HAS_LOCALE__
 351.306 - #define _LIBC
 351.307 - #include <locale>
 351.308 - #undef _LIBC
 351.309 -+#else
 351.310 -+#include <locale>
 351.311 -+#endif
 351.312 - #include <bits/c++locale_internal.h>
 351.313 - 
 351.314 - #ifdef __UCLIBC_MJN3_ONLY__
 351.315 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
 351.316 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:30:21.000000000 +0200
 351.317 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
 351.318 -@@ -37,25 +37,33 @@
 351.319 -   template<typename _CharT>
 351.320 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
 351.321 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 351.322 --    _M_name_timepunct(_S_get_c_name())
 351.323 -+      _M_name_timepunct(_S_get_c_name())
 351.324 -     { _M_initialize_timepunct(); }
 351.325 - 
 351.326 -   template<typename _CharT>
 351.327 -     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 351.328 -     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 351.329 --    _M_name_timepunct(_S_get_c_name())
 351.330 -+      _M_name_timepunct(_S_get_c_name())
 351.331 -     { _M_initialize_timepunct(); }
 351.332 - 
 351.333 -   template<typename _CharT>
 351.334 -     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 351.335 - 				     size_t __refs) 
 351.336 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 351.337 --    _M_name_timepunct(__s)
 351.338 -+      _M_name_timepunct(NULL)
 351.339 -     { 
 351.340 --      char* __tmp = new char[std::strlen(__s) + 1];
 351.341 --      std::strcpy(__tmp, __s);
 351.342 -+      const size_t __len = std::strlen(__s) + 1;
 351.343 -+      char* __tmp = new char[__len];
 351.344 -+      std::memcpy(__tmp, __s, __len);
 351.345 -       _M_name_timepunct = __tmp;
 351.346 --      _M_initialize_timepunct(__cloc); 
 351.347 -+
 351.348 -+      try
 351.349 -+	{ _M_initialize_timepunct(__cloc); }
 351.350 -+      catch(...)
 351.351 -+	{
 351.352 -+	  delete [] _M_name_timepunct;
 351.353 -+	  __throw_exception_again;
 351.354 -+	}
 351.355 -     }
 351.356 - 
 351.357 -   template<typename _CharT>
   352.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   352.2 +++ b/patches/gcc/4.2.4/210-libmudflap-susv3-legacy.patch	Mon Jul 28 21:32:33 2008 +0000
   352.3 @@ -0,0 +1,48 @@
   352.4 +diff -durN gcc-4.2.1.orig/libmudflap/mf-hooks2.c gcc-4.2.1/libmudflap/mf-hooks2.c
   352.5 +--- gcc-4.2.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   352.6 ++++ gcc-4.2.1/libmudflap/mf-hooks2.c	2007-08-03 20:35:09.000000000 +0200
   352.7 +@@ -427,7 +427,7 @@
   352.8 + {
   352.9 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  352.10 +   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  352.11 +-  bzero (s, n);
  352.12 ++  memset (s, 0, n);
  352.13 + }
  352.14 + 
  352.15 + 
  352.16 +@@ -437,7 +437,7 @@
  352.17 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  352.18 +   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  352.19 +   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  352.20 +-  bcopy (src, dest, n);
  352.21 ++  memmove (dest, src, n);
  352.22 + }
  352.23 + 
  352.24 + 
  352.25 +@@ -447,7 +447,7 @@
  352.26 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  352.27 +   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  352.28 +   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  352.29 +-  return bcmp (s1, s2, n);
  352.30 ++  return n == 0 ? 0 : memcmp (s1, s2, n);
  352.31 + }
  352.32 + 
  352.33 + 
  352.34 +@@ -456,7 +456,7 @@
  352.35 +   size_t n = strlen (s);
  352.36 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  352.37 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  352.38 +-  return index (s, c);
  352.39 ++  return strchr (s, c);
  352.40 + }
  352.41 + 
  352.42 + 
  352.43 +@@ -465,7 +465,7 @@
  352.44 +   size_t n = strlen (s);
  352.45 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  352.46 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  352.47 +-  return rindex (s, c);
  352.48 ++  return strrchr (s, c);
  352.49 + }
  352.50 + 
  352.51 + /* XXX:  stpcpy, memccpy */
   353.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   353.2 +++ b/patches/gcc/4.2.4/220-libstdc++-namespace.patch	Mon Jul 28 21:32:33 2008 +0000
   353.3 @@ -0,0 +1,36 @@
   353.4 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
   353.5 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
   353.6 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:35:40.000000000 +0200
   353.7 +@@ -32,7 +32,8 @@
   353.8 + //
   353.9 + 
  353.10 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  353.11 +-
  353.12 ++namespace std
  353.13 ++{
  353.14 + #ifdef __UCLIBC_MJN3_ONLY__
  353.15 + #warning fix prototypes for *textdomain funcs
  353.16 + #endif
  353.17 +@@ -115,3 +116,4 @@
  353.18 + 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  353.19 + 	 }
  353.20 +      }
  353.21 ++}
  353.22 +diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
  353.23 +--- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
  353.24 ++++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:35:40.000000000 +0200
  353.25 +@@ -33,7 +33,8 @@
  353.26 + //
  353.27 + 
  353.28 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  353.29 +-
  353.30 ++namespace std
  353.31 ++{
  353.32 +   template<typename _CharT>
  353.33 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
  353.34 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  353.35 +@@ -74,3 +75,4 @@
  353.36 +       delete _M_data; 
  353.37 +       _S_destroy_c_locale(_M_c_locale_timepunct); 
  353.38 +     }
  353.39 ++}
   354.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   354.2 +++ b/patches/gcc/4.2.4/230-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:32:33 2008 +0000
   354.3 @@ -0,0 +1,12 @@
   354.4 +diff -durN gcc-4.2.1.orig/gcc/Makefile.in gcc-4.2.1/gcc/Makefile.in
   354.5 +--- gcc-4.2.1.orig/gcc/Makefile.in	2007-05-31 17:37:38.000000000 +0200
   354.6 ++++ gcc-4.2.1/gcc/Makefile.in	2007-08-03 20:36:14.000000000 +0200
   354.7 +@@ -2660,7 +2660,7 @@
   354.8 + # FIXME: writing proper dependencies for this is a *LOT* of work.
   354.9 + libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
  354.10 +   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  354.11 +-  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  354.12 ++  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  354.13 + 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  354.14 + 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  354.15 + 	  -DLOCALEDIR=\"$(localedir)\" \
   355.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   355.2 +++ b/patches/gcc/4.2.4/240-arm-bigendian.patch	Mon Jul 28 21:32:33 2008 +0000
   355.3 @@ -0,0 +1,64 @@
   355.4 +diff -durN gcc-4.2.1.orig/gcc/config/arm/linux-elf.h gcc-4.2.1/gcc/config/arm/linux-elf.h
   355.5 +--- gcc-4.2.1.orig/gcc/config/arm/linux-elf.h	2006-02-17 00:29:10.000000000 +0100
   355.6 ++++ gcc-4.2.1/gcc/config/arm/linux-elf.h	2007-08-03 20:36:43.000000000 +0200
   355.7 +@@ -28,19 +28,33 @@
   355.8 + #undef  TARGET_VERSION
   355.9 + #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  355.10 + 
  355.11 ++/*
  355.12 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  355.13 ++ * (big endian) configurations.
  355.14 ++ */
  355.15 ++#if TARGET_BIG_ENDIAN_DEFAULT
  355.16 ++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  355.17 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
  355.18 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
  355.19 ++#else
  355.20 ++#define TARGET_ENDIAN_DEFAULT 0
  355.21 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
  355.22 ++#define TARGET_LINKER_EMULATION "armelf_linux"
  355.23 ++#endif
  355.24 ++
  355.25 + #undef  TARGET_DEFAULT_FLOAT_ABI
  355.26 + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  355.27 + 
  355.28 + #undef  TARGET_DEFAULT
  355.29 +-#define TARGET_DEFAULT (0)
  355.30 ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  355.31 + 
  355.32 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  355.33 + 
  355.34 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  355.35 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  355.36 + 
  355.37 + #undef  MULTILIB_DEFAULTS
  355.38 + #define MULTILIB_DEFAULTS \
  355.39 +-	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  355.40 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  355.41 + 
  355.42 + /* Now we define the strings used to build the spec file.  */
  355.43 + #undef  LIB_SPEC
  355.44 +@@ -61,7 +75,7 @@
  355.45 +    %{rdynamic:-export-dynamic} \
  355.46 +    %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
  355.47 +    -X \
  355.48 +-   %{mbig-endian:-EB}" \
  355.49 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  355.50 +    SUBTARGET_EXTRA_LINK_SPEC
  355.51 + 
  355.52 + #undef  LINK_SPEC
  355.53 +diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
  355.54 +--- gcc-4.2.1.orig/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
  355.55 ++++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:36:43.000000000 +0200
  355.56 +@@ -705,6 +705,11 @@
  355.57 + 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  355.58 + 	tmake_file="${tmake_file} t-linux arm/t-arm"
  355.59 + 	case ${target} in
  355.60 ++	arm*b-*)
  355.61 ++		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  355.62 ++		;;
  355.63 ++	esac
  355.64 ++	case ${target} in
  355.65 + 	arm*-*-linux-*eabi)
  355.66 + 	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
  355.67 + 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
   356.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   356.2 +++ b/patches/gcc/4.2.4/250-softfloat-fix.patch	Mon Jul 28 21:32:33 2008 +0000
   356.3 @@ -0,0 +1,58 @@
   356.4 +This patch (C) 2007 Yann E. MORIN
   356.5 +Licensed under GPL v2.
   356.6 +
   356.7 +First hunk of this patch solves compiling uClibc:
   356.8 +
   356.9 +make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  356.10 +  LD libuClibc-0.9.29.so
  356.11 +libc/libc_so.a(difftime.os): In function `difftime':
  356.12 +difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  356.13 +difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  356.14 +libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  356.15 +_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  356.16 +_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  356.17 +_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  356.18 +_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  356.19 +_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  356.20 +_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  356.21 +_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  356.22 +libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  356.23 +__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  356.24 +libc/libc_so.a(strtof.os): In function `strtof':
  356.25 +strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  356.26 +/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  356.27 +In function `__fixunsdfsi':
  356.28 +libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  356.29 +make[2]: *** [lib/libc.so] Error 1
  356.30 +make[1]: *** [lib/libc.so.0] Error 2
  356.31 +make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  356.32 +make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  356.33 +Error 2
  356.34 +
  356.35 +The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  356.36 +
  356.37 +
  356.38 +diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
  356.39 +--- gcc-4.2.0.orig/gcc/config.gcc	2007-07-15 11:24:18.000000000 +0200
  356.40 ++++ gcc-4.2.0/gcc/config.gcc	2007-07-15 11:26:02.000000000 +0200
  356.41 +@@ -721,7 +721,7 @@
  356.42 + 	    default_use_cxa_atexit=yes
  356.43 + 	    ;;
  356.44 + 	*)
  356.45 +-	    tmake_file="$tmake_file arm/t-linux"
  356.46 ++	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  356.47 + 	    ;;
  356.48 + 	esac
  356.49 + 	tm_file="$tm_file arm/aout.h arm/arm.h"
  356.50 +diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
  356.51 +--- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h	2007-07-15 11:24:18.000000000 +0200
  356.52 ++++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2007-07-15 11:26:02.000000000 +0200
  356.53 +@@ -63,7 +63,7 @@
  356.54 +    %{shared:-lc} \
  356.55 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  356.56 + 
  356.57 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  356.58 ++#define LIBGCC_SPEC "-lgcc"
  356.59 + 
  356.60 + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  356.61 + 
   357.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   357.2 +++ b/patches/gcc/4.2.4/260-flatten-switch-stmt-00.patch	Mon Jul 28 21:32:33 2008 +0000
   357.3 @@ -0,0 +1,24 @@
   357.4 +diff -durN gcc-4.2.1.orig/gcc/stmt.c gcc-4.2.1/gcc/stmt.c
   357.5 +--- gcc-4.2.1.orig/gcc/stmt.c	2007-07-19 05:25:32.000000000 +0200
   357.6 ++++ gcc-4.2.1/gcc/stmt.c	2007-08-03 20:37:19.000000000 +0200
   357.7 +@@ -2512,7 +2512,11 @@
   357.8 + 	  use_cost_table
   357.9 + 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  357.10 + 	       && estimate_case_costs (case_list));
  357.11 +-	  balance_case_nodes (&case_list, NULL);
  357.12 ++	  /* When optimizing for size, we want a straight list to avoid
  357.13 ++	     jumps as much as possible. This basically creates an if-else
  357.14 ++	     chain.  */
  357.15 ++	  if (!optimize_size)
  357.16 ++	    balance_case_nodes (&case_list, NULL);
  357.17 + 	  emit_case_nodes (index, case_list, default_label, index_type);
  357.18 + 	  emit_jump (default_label);
  357.19 + 	}
  357.20 +@@ -3070,6 +3074,7 @@
  357.21 + 	    {
  357.22 + 	      if (!node_has_low_bound (node, index_type))
  357.23 + 		{
  357.24 ++		  if (!optimize_size) /* don't jl to the .default_label. */
  357.25 + 		  emit_cmp_and_jump_insns (index,
  357.26 + 					   convert_modes
  357.27 + 					   (mode, imode,
   358.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   358.2 +++ b/patches/gcc/4.2.4/270-soft-float.patch	Mon Jul 28 21:32:33 2008 +0000
   358.3 @@ -0,0 +1,21 @@
   358.4 +diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
   358.5 +--- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c	2007-03-05 11:54:00.000000000 -0500
   358.6 ++++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c	2008-01-31 17:51:24.000000000 -0500
   358.7 +@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
   358.8 +    but GCC currently generates poor code when a union is used to turn
   358.9 +    a long double into a pair of doubles.  */
  358.10 + 
  358.11 ++#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  358.12 ++
  358.13 + long double __gcc_qadd (double, double, double, double);
  358.14 + long double __gcc_qsub (double, double, double, double);
  358.15 + long double __gcc_qmul (double, double, double, double);
  358.16 +@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
  358.17 +   return z.ldval;
  358.18 + }
  358.19 + 
  358.20 +-#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  358.21 +-
  358.22 + long double __gcc_qneg (double, double);
  358.23 + int __gcc_qeq (double, double, double, double);
  358.24 + int __gcc_qne (double, double, double, double);
   359.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   359.2 +++ b/patches/gcc/4.2.4/280-eabi_fixes.patch	Mon Jul 28 21:32:33 2008 +0000
   359.3 @@ -0,0 +1,13 @@
   359.4 +diff -durN gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h gcc-4.2.3/gcc/config/arm/linux-eabi.h
   359.5 +--- gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h	2007-09-01 17:28:30.000000000 +0200
   359.6 ++++ gcc-4.2.3/gcc/config/arm/linux-eabi.h	2008-05-25 23:47:36.000000000 +0200
   359.7 +@@ -47,7 +47,8 @@
   359.8 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
   359.9 + 
  359.10 + #undef SUBTARGET_EXTRA_LINK_SPEC
  359.11 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
  359.12 ++#define SUBTARGET_EXTRA_LINK_SPEC	\
  359.13 ++	" %{mlittle-endian:-m armelf_linux_eabi} %{mbig-endian:-m armelfb_linux_eabi}"
  359.14 + 
  359.15 + /* Use ld-linux.so.3 so that it will be possible to run "classic"
  359.16 +    GNU/Linux binaries on an EABI system.  */
   360.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   360.2 +++ b/patches/gcc/4.2.4/290-alpha-signal_h.patch	Mon Jul 28 21:32:33 2008 +0000
   360.3 @@ -0,0 +1,17 @@
   360.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   360.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   360.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   360.7 + /* Do code reading to identify a signal frame, and set the frame
   360.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
   360.9 + 
  360.10 ++/* Don't use this if inhibit_libc is set
  360.11 ++   The build for this target will fail trying to include missing headers */
  360.12 ++#ifndef inhibit_libc
  360.13 + #include <signal.h>
  360.14 + #include <sys/ucontext.h>
  360.15 + 
  360.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  360.17 +   fs->retaddr_column = 64;
  360.18 +   return _URC_NO_REASON;
  360.19 + }
  360.20 ++#endif /* inhibit_libc */
   361.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   361.2 +++ b/patches/gcc/4.2.4/300-fortran-signed-TImode.patch	Mon Jul 28 21:32:33 2008 +0000
   361.3 @@ -0,0 +1,43 @@
   361.4 +Fix building gfortran for ARM.
   361.5 +http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01010.html
   361.6 +----
   361.7 +
   361.8 +The patch below fixes a crash building libgfortran on arm-linux-gnueabi.
   361.9 +
  361.10 +This target doesn't really have a 128-bit integer type, however it does use 
  361.11 +TImode to represent the return value of certain special ABI defined library 
  361.12 +functions. This results in type_for_size(TImode) being called.
  361.13 +
  361.14 +Because TImode deosn't correspond to any gfortran integer kind 
  361.15 +gfc_type_for_size returns NULL and we segfault shortly after.
  361.16 +
  361.17 +The patch below fixes this by making gfc_type_for_size handle TImode in the 
  361.18 +same way as the C frontend.
  361.19 +
  361.20 +Tested on x86_64-linux and arm-linux-gnueabi.
  361.21 +Applied to trunk.
  361.22 +
  361.23 +Paul
  361.24 +
  361.25 +2007-05-15  Paul Brook  <paul@codesourcery.com>
  361.26 +
  361.27 +    gcc/fortran/
  361.28 +    * trans-types.c (gfc_type_for_size): Handle signed TImode.
  361.29 +
  361.30 +diff -durN gcc-4.2.3.old/gcc/fortran/trans-types.c gcc-4.2.3/gcc/fortran/trans-types.c
  361.31 +--- gcc-4.2.3.old/gcc/fortran/trans-types.c	2007-08-31 10:27:50.000000000 +0200
  361.32 ++++ gcc-4.2.3/gcc/fortran/trans-types.c	2008-07-17 09:54:20.000000000 +0200
  361.33 +@@ -1799,6 +1799,13 @@
  361.34 + 	  if (type && bits == TYPE_PRECISION (type))
  361.35 + 	    return type;
  361.36 + 	}
  361.37 ++
  361.38 ++	/* Handle TImode as a special case because it is used by some backends
  361.39 ++	   (eg. ARM) even though it is not available for normal use.  */
  361.40 ++#if HOST_BITS_PER_WIDE_INT >= 64
  361.41 ++	if (bits == TYPE_PRECISION (intTI_type_node))
  361.42 ++	  return intTI_type_node;
  361.43 ++#endif
  361.44 +     }
  361.45 +   else
  361.46 +     {
   362.1 --- a/patches/gcc/4.2.4/300-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   362.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   362.3 @@ -1,50 +0,0 @@
   362.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am gcc-4.2.1/libstdc++-v3/src/Makefile.am
   362.5 ---- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am	2006-07-28 06:57:34.000000000 +0200
   362.6 -+++ gcc-4.2.1/libstdc++-v3/src/Makefile.am	2007-08-03 20:32:27.000000000 +0200
   362.7 -@@ -257,6 +257,12 @@
   362.8 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
   362.9 - 
  362.10 - 
  362.11 -+install-exec-local:
  362.12 -+ifeq ($(enable_shared),yes)
  362.13 -+	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
  362.14 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  362.15 -+endif
  362.16 -+
  362.17 - # Added bits to build debug library.
  362.18 - if GLIBCXX_BUILD_DEBUG
  362.19 - all-local: build_debug
  362.20 -diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in gcc-4.2.1/libstdc++-v3/src/Makefile.in
  362.21 ---- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in	2006-10-16 21:08:22.000000000 +0200
  362.22 -+++ gcc-4.2.1/libstdc++-v3/src/Makefile.in	2007-08-03 20:32:27.000000000 +0200
  362.23 -@@ -657,7 +657,7 @@
  362.24 - 
  362.25 - install-data-am: install-data-local
  362.26 - 
  362.27 --install-exec-am: install-toolexeclibLTLIBRARIES
  362.28 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  362.29 - 
  362.30 - install-info: install-info-am
  362.31 - 
  362.32 -@@ -690,6 +690,7 @@
  362.33 - 	distclean-libtool distclean-tags distdir dvi dvi-am html \
  362.34 - 	html-am info info-am install install-am install-data \
  362.35 - 	install-data-am install-data-local install-exec \
  362.36 -+	install-exec-local \
  362.37 - 	install-exec-am install-info install-info-am install-man \
  362.38 - 	install-strip install-toolexeclibLTLIBRARIES installcheck \
  362.39 - 	installcheck-am installdirs maintainer-clean \
  362.40 -@@ -799,6 +800,13 @@
  362.41 - install_debug:
  362.42 - 	(cd ${debugdir} && $(MAKE) \
  362.43 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  362.44 -+
  362.45 -+install-exec-local:
  362.46 -+ifeq ($(enable_shared),yes)
  362.47 -+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
  362.48 -+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
  362.49 -+endif
  362.50 -+
  362.51 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  362.52 - # Otherwise a system limit (for SysV at least) may be exceeded.
  362.53 - .NOEXPORT:
   363.1 --- a/patches/gcc/4.2.4/301-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   363.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   363.3 @@ -1,12 +0,0 @@
   363.4 -diff -durN gcc-4.2.1.orig/boehm-gc/include/gc.h gcc-4.2.1/boehm-gc/include/gc.h
   363.5 ---- gcc-4.2.1.orig/boehm-gc/include/gc.h	2006-09-18 20:45:08.000000000 +0200
   363.6 -+++ gcc-4.2.1/boehm-gc/include/gc.h	2007-08-03 20:33:00.000000000 +0200
   363.7 -@@ -502,7 +502,7 @@
   363.8 - #if defined(__linux__) || defined(__GLIBC__)
   363.9 - # include <features.h>
  363.10 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  363.11 --     && !defined(__ia64__)
  363.12 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  363.13 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  363.14 - #     define GC_HAVE_BUILTIN_BACKTRACE
  363.15 - #   endif
   364.1 --- a/patches/gcc/4.2.4/302-c99-snprintf.patch	Mon Jul 28 21:08:01 2008 +0000
   364.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   364.3 @@ -1,12 +0,0 @@
   364.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h
   364.5 ---- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h	2006-12-07 10:33:51.000000000 +0100
   364.6 -+++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h	2007-08-03 20:33:24.000000000 +0200
   364.7 -@@ -144,7 +144,7 @@
   364.8 - 
   364.9 - _GLIBCXX_END_NAMESPACE
  364.10 - 
  364.11 --#if _GLIBCXX_USE_C99
  364.12 -+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
  364.13 - 
  364.14 - #undef snprintf
  364.15 - #undef vfscanf
   365.1 --- a/patches/gcc/4.2.4/303-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   365.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   365.3 @@ -1,13 +0,0 @@
   365.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
   365.5 ---- gcc-4.2.1.orig/libstdc++-v3/configure	2007-08-03 20:30:21.000000000 +0200
   365.6 -+++ gcc-4.2.1/libstdc++-v3/configure	2007-08-03 20:33:56.000000000 +0200
   365.7 -@@ -7514,6 +7514,9 @@
   365.8 - cat >>conftest.$ac_ext <<_ACEOF
   365.9 - /* end confdefs.h.  */
  365.10 - #include <complex.h>
  365.11 -+#ifdef __UCLIBC__
  365.12 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  365.13 -+#endif
  365.14 - int
  365.15 - main ()
  365.16 - {
   366.1 --- a/patches/gcc/4.2.4/304-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   366.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   366.3 @@ -1,26 +0,0 @@
   366.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/rope gcc-4.2.1/libstdc++-v3/include/ext/rope
   366.5 ---- gcc-4.2.1.orig/libstdc++-v3/include/ext/rope	2006-10-17 13:56:21.000000000 +0200
   366.6 -+++ gcc-4.2.1/libstdc++-v3/include/ext/rope	2007-08-03 20:34:23.000000000 +0200
   366.7 -@@ -58,6 +58,9 @@
   366.8 - #include <bits/allocator.h>
   366.9 - #include <ext/hash_fun.h>
  366.10 - 
  366.11 -+/* cope w/ index defined as macro, SuSv3 proposal */
  366.12 -+#undef index
  366.13 -+
  366.14 - # ifdef __GC
  366.15 - #   define __GC_CONST const
  366.16 - # else
  366.17 -diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h
  366.18 ---- gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2006-10-17 13:56:21.000000000 +0200
  366.19 -+++ gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h	2007-08-03 20:34:23.000000000 +0200
  366.20 -@@ -54,6 +54,9 @@
  366.21 - #include <ext/memory> // For uninitialized_copy_n
  366.22 - #include <ext/numeric> // For power
  366.23 - 
  366.24 -+/* cope w/ index defined as macro, SuSv3 proposal */
  366.25 -+#undef index
  366.26 -+
  366.27 - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  366.28 - 
  366.29 -   using std::size_t;
   367.1 --- a/patches/gcc/4.2.4/305-libmudflap-susv3-legacy.patch	Mon Jul 28 21:08:01 2008 +0000
   367.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   367.3 @@ -1,48 +0,0 @@
   367.4 -diff -durN gcc-4.2.1.orig/libmudflap/mf-hooks2.c gcc-4.2.1/libmudflap/mf-hooks2.c
   367.5 ---- gcc-4.2.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   367.6 -+++ gcc-4.2.1/libmudflap/mf-hooks2.c	2007-08-03 20:35:09.000000000 +0200
   367.7 -@@ -427,7 +427,7 @@
   367.8 - {
   367.9 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  367.10 -   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  367.11 --  bzero (s, n);
  367.12 -+  memset (s, 0, n);
  367.13 - }
  367.14 - 
  367.15 - 
  367.16 -@@ -437,7 +437,7 @@
  367.17 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  367.18 -   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  367.19 -   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  367.20 --  bcopy (src, dest, n);
  367.21 -+  memmove (dest, src, n);
  367.22 - }
  367.23 - 
  367.24 - 
  367.25 -@@ -447,7 +447,7 @@
  367.26 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  367.27 -   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  367.28 -   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  367.29 --  return bcmp (s1, s2, n);
  367.30 -+  return n == 0 ? 0 : memcmp (s1, s2, n);
  367.31 - }
  367.32 - 
  367.33 - 
  367.34 -@@ -456,7 +456,7 @@
  367.35 -   size_t n = strlen (s);
  367.36 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  367.37 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  367.38 --  return index (s, c);
  367.39 -+  return strchr (s, c);
  367.40 - }
  367.41 - 
  367.42 - 
  367.43 -@@ -465,7 +465,7 @@
  367.44 -   size_t n = strlen (s);
  367.45 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  367.46 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  367.47 --  return rindex (s, c);
  367.48 -+  return strrchr (s, c);
  367.49 - }
  367.50 - 
  367.51 - /* XXX:  stpcpy, memccpy */
   368.1 --- a/patches/gcc/4.2.4/306-libstdc++-namespace.patch	Mon Jul 28 21:08:01 2008 +0000
   368.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   368.3 @@ -1,36 +0,0 @@
   368.4 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
   368.5 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:31:54.000000000 +0200
   368.6 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2007-08-03 20:35:40.000000000 +0200
   368.7 -@@ -32,7 +32,8 @@
   368.8 - //
   368.9 - 
  368.10 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  368.11 --
  368.12 -+namespace std
  368.13 -+{
  368.14 - #ifdef __UCLIBC_MJN3_ONLY__
  368.15 - #warning fix prototypes for *textdomain funcs
  368.16 - #endif
  368.17 -@@ -115,3 +116,4 @@
  368.18 - 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  368.19 - 	 }
  368.20 -      }
  368.21 -+}
  368.22 -diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
  368.23 ---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:31:54.000000000 +0200
  368.24 -+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h	2007-08-03 20:35:40.000000000 +0200
  368.25 -@@ -33,7 +33,8 @@
  368.26 - //
  368.27 - 
  368.28 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  368.29 --
  368.30 -+namespace std
  368.31 -+{
  368.32 -   template<typename _CharT>
  368.33 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
  368.34 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  368.35 -@@ -74,3 +75,4 @@
  368.36 -       delete _M_data; 
  368.37 -       _S_destroy_c_locale(_M_c_locale_timepunct); 
  368.38 -     }
  368.39 -+}
   369.1 --- a/patches/gcc/4.2.4/402-libbackend_dep_gcov-iov.h.patch	Mon Jul 28 21:08:01 2008 +0000
   369.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   369.3 @@ -1,12 +0,0 @@
   369.4 -diff -durN gcc-4.2.1.orig/gcc/Makefile.in gcc-4.2.1/gcc/Makefile.in
   369.5 ---- gcc-4.2.1.orig/gcc/Makefile.in	2007-05-31 17:37:38.000000000 +0200
   369.6 -+++ gcc-4.2.1/gcc/Makefile.in	2007-08-03 20:36:14.000000000 +0200
   369.7 -@@ -2660,7 +2660,7 @@
   369.8 - # FIXME: writing proper dependencies for this is a *LOT* of work.
   369.9 - libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
  369.10 -   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
  369.11 --  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE)
  369.12 -+  insn-attr.h  $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
  369.13 - 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
  369.14 - 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
  369.15 - 	  -DLOCALEDIR=\"$(localedir)\" \
   370.1 --- a/patches/gcc/4.2.4/800-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
   370.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   370.3 @@ -1,64 +0,0 @@
   370.4 -diff -durN gcc-4.2.1.orig/gcc/config/arm/linux-elf.h gcc-4.2.1/gcc/config/arm/linux-elf.h
   370.5 ---- gcc-4.2.1.orig/gcc/config/arm/linux-elf.h	2006-02-17 00:29:10.000000000 +0100
   370.6 -+++ gcc-4.2.1/gcc/config/arm/linux-elf.h	2007-08-03 20:36:43.000000000 +0200
   370.7 -@@ -28,19 +28,33 @@
   370.8 - #undef  TARGET_VERSION
   370.9 - #define TARGET_VERSION  fputs (" (ARM GNU/Linux with ELF)", stderr);
  370.10 - 
  370.11 -+/*
  370.12 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
  370.13 -+ * (big endian) configurations.
  370.14 -+ */
  370.15 -+#if TARGET_BIG_ENDIAN_DEFAULT
  370.16 -+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
  370.17 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
  370.18 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
  370.19 -+#else
  370.20 -+#define TARGET_ENDIAN_DEFAULT 0
  370.21 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
  370.22 -+#define TARGET_LINKER_EMULATION "armelf_linux"
  370.23 -+#endif
  370.24 -+
  370.25 - #undef  TARGET_DEFAULT_FLOAT_ABI
  370.26 - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  370.27 - 
  370.28 - #undef  TARGET_DEFAULT
  370.29 --#define TARGET_DEFAULT (0)
  370.30 -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
  370.31 - 
  370.32 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
  370.33 - 
  370.34 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
  370.35 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
  370.36 - 
  370.37 - #undef  MULTILIB_DEFAULTS
  370.38 - #define MULTILIB_DEFAULTS \
  370.39 --	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
  370.40 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
  370.41 - 
  370.42 - /* Now we define the strings used to build the spec file.  */
  370.43 - #undef  LIB_SPEC
  370.44 -@@ -61,7 +75,7 @@
  370.45 -    %{rdynamic:-export-dynamic} \
  370.46 -    %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
  370.47 -    -X \
  370.48 --   %{mbig-endian:-EB}" \
  370.49 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
  370.50 -    SUBTARGET_EXTRA_LINK_SPEC
  370.51 - 
  370.52 - #undef  LINK_SPEC
  370.53 -diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
  370.54 ---- gcc-4.2.1.orig/gcc/config.gcc	2007-08-03 20:29:52.000000000 +0200
  370.55 -+++ gcc-4.2.1/gcc/config.gcc	2007-08-03 20:36:43.000000000 +0200
  370.56 -@@ -705,6 +705,11 @@
  370.57 - 	tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  370.58 - 	tmake_file="${tmake_file} t-linux arm/t-arm"
  370.59 - 	case ${target} in
  370.60 -+	arm*b-*)
  370.61 -+		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
  370.62 -+		;;
  370.63 -+	esac
  370.64 -+	case ${target} in
  370.65 - 	arm*-*-linux-*eabi)
  370.66 - 	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
  370.67 - 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
   371.1 --- a/patches/gcc/4.2.4/801-softfloat-fix.patch	Mon Jul 28 21:08:01 2008 +0000
   371.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   371.3 @@ -1,58 +0,0 @@
   371.4 -This patch (C) 2007 Yann E. MORIN
   371.5 -Licensed under GPL v2.
   371.6 -
   371.7 -First hunk of this patch solves compiling uClibc:
   371.8 -
   371.9 -make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  371.10 -  LD libuClibc-0.9.29.so
  371.11 -libc/libc_so.a(difftime.os): In function `difftime':
  371.12 -difftime.c:(.text+0x8): undefined reference to `__floatsidf'
  371.13 -difftime.c:(.text+0x2c): undefined reference to `__subdf3'
  371.14 -libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
  371.15 -_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
  371.16 -_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
  371.17 -_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
  371.18 -_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
  371.19 -_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
  371.20 -_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
  371.21 -_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
  371.22 -libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
  371.23 -__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
  371.24 -libc/libc_so.a(strtof.os): In function `strtof':
  371.25 -strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
  371.26 -/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
  371.27 -In function `__fixunsdfsi':
  371.28 -libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
  371.29 -make[2]: *** [lib/libc.so] Error 1
  371.30 -make[1]: *** [lib/libc.so.0] Error 2
  371.31 -make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
  371.32 -make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
  371.33 -Error 2
  371.34 -
  371.35 -The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
  371.36 -
  371.37 -
  371.38 -diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
  371.39 ---- gcc-4.2.0.orig/gcc/config.gcc	2007-07-15 11:24:18.000000000 +0200
  371.40 -+++ gcc-4.2.0/gcc/config.gcc	2007-07-15 11:26:02.000000000 +0200
  371.41 -@@ -721,7 +721,7 @@
  371.42 - 	    default_use_cxa_atexit=yes
  371.43 - 	    ;;
  371.44 - 	*)
  371.45 --	    tmake_file="$tmake_file arm/t-linux"
  371.46 -+	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
  371.47 - 	    ;;
  371.48 - 	esac
  371.49 - 	tm_file="$tm_file arm/aout.h arm/arm.h"
  371.50 -diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
  371.51 ---- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h	2007-07-15 11:24:18.000000000 +0200
  371.52 -+++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2007-07-15 11:26:02.000000000 +0200
  371.53 -@@ -63,7 +63,7 @@
  371.54 -    %{shared:-lc} \
  371.55 -    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  371.56 - 
  371.57 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  371.58 -+#define LIBGCC_SPEC "-lgcc"
  371.59 - 
  371.60 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  371.61 - 
   372.1 --- a/patches/gcc/4.2.4/904-flatten-switch-stmt-00.patch	Mon Jul 28 21:08:01 2008 +0000
   372.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   372.3 @@ -1,24 +0,0 @@
   372.4 -diff -durN gcc-4.2.1.orig/gcc/stmt.c gcc-4.2.1/gcc/stmt.c
   372.5 ---- gcc-4.2.1.orig/gcc/stmt.c	2007-07-19 05:25:32.000000000 +0200
   372.6 -+++ gcc-4.2.1/gcc/stmt.c	2007-08-03 20:37:19.000000000 +0200
   372.7 -@@ -2512,7 +2512,11 @@
   372.8 - 	  use_cost_table
   372.9 - 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  372.10 - 	       && estimate_case_costs (case_list));
  372.11 --	  balance_case_nodes (&case_list, NULL);
  372.12 -+	  /* When optimizing for size, we want a straight list to avoid
  372.13 -+	     jumps as much as possible. This basically creates an if-else
  372.14 -+	     chain.  */
  372.15 -+	  if (!optimize_size)
  372.16 -+	    balance_case_nodes (&case_list, NULL);
  372.17 - 	  emit_case_nodes (index, case_list, default_label, index_type);
  372.18 - 	  emit_jump (default_label);
  372.19 - 	}
  372.20 -@@ -3070,6 +3074,7 @@
  372.21 - 	    {
  372.22 - 	      if (!node_has_low_bound (node, index_type))
  372.23 - 		{
  372.24 -+		  if (!optimize_size) /* don't jl to the .default_label. */
  372.25 - 		  emit_cmp_and_jump_insns (index,
  372.26 - 					   convert_modes
  372.27 - 					   (mode, imode,
   373.1 --- a/patches/gcc/4.2.4/920-soft-float.patch	Mon Jul 28 21:08:01 2008 +0000
   373.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   373.3 @@ -1,21 +0,0 @@
   373.4 -diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
   373.5 ---- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c	2007-03-05 11:54:00.000000000 -0500
   373.6 -+++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c	2008-01-31 17:51:24.000000000 -0500
   373.7 -@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
   373.8 -    but GCC currently generates poor code when a union is used to turn
   373.9 -    a long double into a pair of doubles.  */
  373.10 - 
  373.11 -+#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  373.12 -+
  373.13 - long double __gcc_qadd (double, double, double, double);
  373.14 - long double __gcc_qsub (double, double, double, double);
  373.15 - long double __gcc_qmul (double, double, double, double);
  373.16 -@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
  373.17 -   return z.ldval;
  373.18 - }
  373.19 - 
  373.20 --#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
  373.21 --
  373.22 - long double __gcc_qneg (double, double);
  373.23 - int __gcc_qeq (double, double, double, double);
  373.24 - int __gcc_qne (double, double, double, double);
   374.1 --- a/patches/gcc/4.2.4/930-eabi_fixes.patch	Mon Jul 28 21:08:01 2008 +0000
   374.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   374.3 @@ -1,13 +0,0 @@
   374.4 -diff -durN gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h gcc-4.2.3/gcc/config/arm/linux-eabi.h
   374.5 ---- gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h	2007-09-01 17:28:30.000000000 +0200
   374.6 -+++ gcc-4.2.3/gcc/config/arm/linux-eabi.h	2008-05-25 23:47:36.000000000 +0200
   374.7 -@@ -47,7 +47,8 @@
   374.8 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
   374.9 - 
  374.10 - #undef SUBTARGET_EXTRA_LINK_SPEC
  374.11 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
  374.12 -+#define SUBTARGET_EXTRA_LINK_SPEC	\
  374.13 -+	" %{mlittle-endian:-m armelf_linux_eabi} %{mbig-endian:-m armelfb_linux_eabi}"
  374.14 - 
  374.15 - /* Use ld-linux.so.3 so that it will be possible to run "classic"
  374.16 -    GNU/Linux binaries on an EABI system.  */
   375.1 --- a/patches/gcc/4.2.4/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
   375.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   375.3 @@ -1,17 +0,0 @@
   375.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   375.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   375.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   375.7 - /* Do code reading to identify a signal frame, and set the frame
   375.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
   375.9 - 
  375.10 -+/* Don't use this if inhibit_libc is set
  375.11 -+   The build for this target will fail trying to include missing headers */
  375.12 -+#ifndef inhibit_libc
  375.13 - #include <signal.h>
  375.14 - #include <sys/ucontext.h>
  375.15 - 
  375.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  375.17 -   fs->retaddr_column = 64;
  375.18 -   return _URC_NO_REASON;
  375.19 - }
  375.20 -+#endif /* inhibit_libc */
   376.1 --- a/patches/gcc/4.2.4/950-fortran-signed-TImode.patch	Mon Jul 28 21:08:01 2008 +0000
   376.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   376.3 @@ -1,43 +0,0 @@
   376.4 -Fix building gfortran for ARM.
   376.5 -http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01010.html
   376.6 -----
   376.7 -
   376.8 -The patch below fixes a crash building libgfortran on arm-linux-gnueabi.
   376.9 -
  376.10 -This target doesn't really have a 128-bit integer type, however it does use 
  376.11 -TImode to represent the return value of certain special ABI defined library 
  376.12 -functions. This results in type_for_size(TImode) being called.
  376.13 -
  376.14 -Because TImode deosn't correspond to any gfortran integer kind 
  376.15 -gfc_type_for_size returns NULL and we segfault shortly after.
  376.16 -
  376.17 -The patch below fixes this by making gfc_type_for_size handle TImode in the 
  376.18 -same way as the C frontend.
  376.19 -
  376.20 -Tested on x86_64-linux and arm-linux-gnueabi.
  376.21 -Applied to trunk.
  376.22 -
  376.23 -Paul
  376.24 -
  376.25 -2007-05-15  Paul Brook  <paul@codesourcery.com>
  376.26 -
  376.27 -    gcc/fortran/
  376.28 -    * trans-types.c (gfc_type_for_size): Handle signed TImode.
  376.29 -
  376.30 -diff -durN gcc-4.2.3.old/gcc/fortran/trans-types.c gcc-4.2.3/gcc/fortran/trans-types.c
  376.31 ---- gcc-4.2.3.old/gcc/fortran/trans-types.c	2007-08-31 10:27:50.000000000 +0200
  376.32 -+++ gcc-4.2.3/gcc/fortran/trans-types.c	2008-07-17 09:54:20.000000000 +0200
  376.33 -@@ -1799,6 +1799,13 @@
  376.34 - 	  if (type && bits == TYPE_PRECISION (type))
  376.35 - 	    return type;
  376.36 - 	}
  376.37 -+
  376.38 -+	/* Handle TImode as a special case because it is used by some backends
  376.39 -+	   (eg. ARM) even though it is not available for normal use.  */
  376.40 -+#if HOST_BITS_PER_WIDE_INT >= 64
  376.41 -+	if (bits == TYPE_PRECISION (intTI_type_node))
  376.42 -+	  return intTI_type_node;
  376.43 -+#endif
  376.44 -     }
  376.45 -   else
  376.46 -     {
   377.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   377.2 +++ b/patches/gcc/4.3.0/110-trampolinewarn.patch	Mon Jul 28 21:32:33 2008 +0000
   377.3 @@ -0,0 +1,35 @@
   377.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-trampolinewarn.patch
   377.5 +	This trivial patch causes gcc to emit a warning whenever
   377.6 +	it generates a trampoline.  These are otherwise hard to
   377.7 +	locate.  It is rigged to default ON - to have it default
   377.8 +	to OFF remove the text 'Init(1)' from the common.opt
   377.9 +	patch, leaving just 'Common Var(warn_trampolines)'.
  377.10 +	Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
  377.11 +
  377.12 +diff -durN gcc-4.3.0.orig/gcc/builtins.c gcc-4.3.0/gcc/builtins.c
  377.13 +--- gcc-4.3.0.orig/gcc/builtins.c	2008-02-20 18:27:21.000000000 +0100
  377.14 ++++ gcc-4.3.0/gcc/builtins.c	2008-06-10 14:44:10.000000000 +0200
  377.15 +@@ -5659,6 +5659,9 @@
  377.16 +   trampolines_created = 1;
  377.17 +   INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
  377.18 + 
  377.19 ++  if (warn_trampolines)
  377.20 ++    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
  377.21 ++
  377.22 +   return const0_rtx;
  377.23 + }
  377.24 + 
  377.25 +diff -durN gcc-4.3.0.orig/gcc/common.opt gcc-4.3.0/gcc/common.opt
  377.26 +--- gcc-4.3.0.orig/gcc/common.opt	2008-01-22 15:11:44.000000000 +0100
  377.27 ++++ gcc-4.3.0/gcc/common.opt	2008-06-10 14:44:10.000000000 +0200
  377.28 +@@ -182,6 +182,10 @@
  377.29 + Common Var(warn_system_headers) Warning
  377.30 + Do not suppress warnings from system headers
  377.31 + 
  377.32 ++Wtrampolines
  377.33 ++Common Var(warn_trampolines) Init(1)
  377.34 ++Warn whenever a trampoline is generated
  377.35 ++
  377.36 + Wuninitialized
  377.37 + Common Var(warn_uninitialized) Warning
  377.38 + Warn about uninitialized automatic variables
   378.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   378.2 +++ b/patches/gcc/4.3.0/120-java-nomulti.patch	Mon Jul 28 21:32:33 2008 +0000
   378.3 @@ -0,0 +1,47 @@
   378.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/03_all_gcc43-java-nomulti.patch
   378.5 +diff -durN gcc-4.3.0.orig/libjava/configure gcc-4.3.0/libjava/configure
   378.6 +--- gcc-4.3.0.orig/libjava/configure	2008-03-05 19:44:25.000000000 +0100
   378.7 ++++ gcc-4.3.0/libjava/configure	2008-06-10 14:44:13.000000000 +0200
   378.8 +@@ -1018,6 +1018,8 @@
   378.9 +   --enable-gconf-peer     compile GConf native peers for util.preferences
  378.10 +   --enable-java-maintainer-mode
  378.11 +                           allow rebuilding of .class and .h files
  378.12 ++  --enable-libjava-multilib
  378.13 ++                          build libjava as multilib
  378.14 +   --disable-dependency-tracking  speeds up one-time build
  378.15 +   --enable-dependency-tracking   do not reject slow dependency extractors
  378.16 +   --enable-maintainer-mode  enable make rules and dependencies not useful
  378.17 +@@ -1850,6 +1852,16 @@
  378.18 + fi
  378.19 + 
  378.20 + 
  378.21 ++# Check whether --enable-libjava-multilib was given.
  378.22 ++if test "${enable_libjava_multilib+set}" = set; then
  378.23 ++  enableval=$enable_libjava_multilib;
  378.24 ++fi
  378.25 ++
  378.26 ++if test "$enable_libjava_multilib" = no; then
  378.27 ++  multilib=no
  378.28 ++  ac_configure_args="$ac_configure_args --disable-multilib"
  378.29 ++fi
  378.30 ++
  378.31 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  378.32 + 
  378.33 + 
  378.34 +diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac
  378.35 +--- gcc-4.3.0.orig/libjava/configure.ac	2007-12-22 16:48:46.000000000 +0100
  378.36 ++++ gcc-4.3.0/libjava/configure.ac	2008-06-10 14:44:13.000000000 +0200
  378.37 +@@ -82,6 +82,13 @@
  378.38 + 	[allow rebuilding of .class and .h files]))
  378.39 + AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
  378.40 + 
  378.41 ++AC_ARG_ENABLE(libjava-multilib,
  378.42 ++	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
  378.43 ++if test "$enable_libjava_multilib" = no; then
  378.44 ++  multilib=no
  378.45 ++  ac_configure_args="$ac_configure_args --disable-multilib"
  378.46 ++fi
  378.47 ++
  378.48 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  378.49 + GCC_NO_EXECUTABLES
  378.50 + 
   379.1 --- a/patches/gcc/4.3.0/125-trampolinewarn.patch	Mon Jul 28 21:08:01 2008 +0000
   379.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   379.3 @@ -1,35 +0,0 @@
   379.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-trampolinewarn.patch
   379.5 -	This trivial patch causes gcc to emit a warning whenever
   379.6 -	it generates a trampoline.  These are otherwise hard to
   379.7 -	locate.  It is rigged to default ON - to have it default
   379.8 -	to OFF remove the text 'Init(1)' from the common.opt
   379.9 -	patch, leaving just 'Common Var(warn_trampolines)'.
  379.10 -	Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
  379.11 -
  379.12 -diff -durN gcc-4.3.0.orig/gcc/builtins.c gcc-4.3.0/gcc/builtins.c
  379.13 ---- gcc-4.3.0.orig/gcc/builtins.c	2008-02-20 18:27:21.000000000 +0100
  379.14 -+++ gcc-4.3.0/gcc/builtins.c	2008-06-10 14:44:10.000000000 +0200
  379.15 -@@ -5659,6 +5659,9 @@
  379.16 -   trampolines_created = 1;
  379.17 -   INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
  379.18 - 
  379.19 -+  if (warn_trampolines)
  379.20 -+    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
  379.21 -+
  379.22 -   return const0_rtx;
  379.23 - }
  379.24 - 
  379.25 -diff -durN gcc-4.3.0.orig/gcc/common.opt gcc-4.3.0/gcc/common.opt
  379.26 ---- gcc-4.3.0.orig/gcc/common.opt	2008-01-22 15:11:44.000000000 +0100
  379.27 -+++ gcc-4.3.0/gcc/common.opt	2008-06-10 14:44:10.000000000 +0200
  379.28 -@@ -182,6 +182,10 @@
  379.29 - Common Var(warn_system_headers) Warning
  379.30 - Do not suppress warnings from system headers
  379.31 - 
  379.32 -+Wtrampolines
  379.33 -+Common Var(warn_trampolines) Init(1)
  379.34 -+Warn whenever a trampoline is generated
  379.35 -+
  379.36 - Wuninitialized
  379.37 - Common Var(warn_uninitialized) Warning
  379.38 - Warn about uninitialized automatic variables
   380.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   380.2 +++ b/patches/gcc/4.3.0/130-cross-compile.patch	Mon Jul 28 21:32:33 2008 +0000
   380.3 @@ -0,0 +1,44 @@
   380.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/08_all_gcc-4.1-cross-compile.patch
   380.5 +Some notes on the 'bootstrap with or without libc headers' debate:
   380.6 +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
   380.7 +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
   380.8 +
   380.9 +diff -durN gcc-4.3.0.orig/gcc/configure gcc-4.3.0/gcc/configure
  380.10 +--- gcc-4.3.0.orig/gcc/configure	2008-03-05 00:39:11.000000000 +0100
  380.11 ++++ gcc-4.3.0/gcc/configure	2008-06-10 14:44:17.000000000 +0200
  380.12 +@@ -13274,7 +13274,7 @@
  380.13 + 	    | powerpc*-*-*,powerpc64*-*-*)
  380.14 + 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  380.15 + 	esac
  380.16 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
  380.17 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  380.18 +         SYSTEM_HEADER_DIR=$build_system_header_dir
  380.19 + fi
  380.20 + 
  380.21 +diff -durN gcc-4.3.0.orig/gcc/configure.ac gcc-4.3.0/gcc/configure.ac
  380.22 +--- gcc-4.3.0.orig/gcc/configure.ac	2008-03-05 00:39:11.000000000 +0100
  380.23 ++++ gcc-4.3.0/gcc/configure.ac	2008-06-10 14:44:17.000000000 +0200
  380.24 +@@ -1745,7 +1745,7 @@
  380.25 + 	    | powerpc*-*-*,powerpc64*-*-*)
  380.26 + 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  380.27 + 	esac
  380.28 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
  380.29 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  380.30 +         SYSTEM_HEADER_DIR=$build_system_header_dir 
  380.31 + fi
  380.32 + 
  380.33 +diff -durN gcc-4.3.0.orig/gcc/unwind-dw2.c gcc-4.3.0/gcc/unwind-dw2.c
  380.34 +--- gcc-4.3.0.orig/gcc/unwind-dw2.c	2007-07-25 20:14:57.000000000 +0200
  380.35 ++++ gcc-4.3.0/gcc/unwind-dw2.c	2008-06-10 14:44:17.000000000 +0200
  380.36 +@@ -334,9 +334,11 @@
  380.37 + }
  380.38 + #endif
  380.39 + 
  380.40 ++#ifndef inhibit_libc
  380.41 + #ifdef MD_UNWIND_SUPPORT
  380.42 + #include MD_UNWIND_SUPPORT
  380.43 + #endif
  380.44 ++#endif
  380.45 + 
  380.46 + /* Extract any interesting information from the CIE for the translation
  380.47 +    unit F belongs to.  Return a pointer to the byte after the augmentation,
   381.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   381.2 +++ b/patches/gcc/4.3.0/140-netbsd-symbolic.patch	Mon Jul 28 21:32:33 2008 +0000
   381.3 @@ -0,0 +1,14 @@
   381.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/11_all_gcc-netbsd-symbolic.patch
   381.5 +http://bugs.gentoo.org/122698
   381.6 +
   381.7 +diff -durN gcc-4.3.0.orig/gcc/config/netbsd-elf.h gcc-4.3.0/gcc/config/netbsd-elf.h
   381.8 +--- gcc-4.3.0.orig/gcc/config/netbsd-elf.h	2007-09-03 18:14:04.000000000 +0200
   381.9 ++++ gcc-4.3.0/gcc/config/netbsd-elf.h	2008-06-10 14:44:21.000000000 +0200
  381.10 +@@ -82,6 +82,7 @@
  381.11 + #define NETBSD_LINK_SPEC_ELF \
  381.12 +   "%{assert*} %{R*} %{rpath*} \
  381.13 +    %{shared:-shared} \
  381.14 ++   %{symbolic:-Bsymbolic} \
  381.15 +    %{!shared: \
  381.16 +      -dc -dp \
  381.17 +      %{!nostdlib: \
   382.1 --- a/patches/gcc/4.3.0/150-java-nomulti.patch	Mon Jul 28 21:08:01 2008 +0000
   382.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   382.3 @@ -1,47 +0,0 @@
   382.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/03_all_gcc43-java-nomulti.patch
   382.5 -diff -durN gcc-4.3.0.orig/libjava/configure gcc-4.3.0/libjava/configure
   382.6 ---- gcc-4.3.0.orig/libjava/configure	2008-03-05 19:44:25.000000000 +0100
   382.7 -+++ gcc-4.3.0/libjava/configure	2008-06-10 14:44:13.000000000 +0200
   382.8 -@@ -1018,6 +1018,8 @@
   382.9 -   --enable-gconf-peer     compile GConf native peers for util.preferences
  382.10 -   --enable-java-maintainer-mode
  382.11 -                           allow rebuilding of .class and .h files
  382.12 -+  --enable-libjava-multilib
  382.13 -+                          build libjava as multilib
  382.14 -   --disable-dependency-tracking  speeds up one-time build
  382.15 -   --enable-dependency-tracking   do not reject slow dependency extractors
  382.16 -   --enable-maintainer-mode  enable make rules and dependencies not useful
  382.17 -@@ -1850,6 +1852,16 @@
  382.18 - fi
  382.19 - 
  382.20 - 
  382.21 -+# Check whether --enable-libjava-multilib was given.
  382.22 -+if test "${enable_libjava_multilib+set}" = set; then
  382.23 -+  enableval=$enable_libjava_multilib;
  382.24 -+fi
  382.25 -+
  382.26 -+if test "$enable_libjava_multilib" = no; then
  382.27 -+  multilib=no
  382.28 -+  ac_configure_args="$ac_configure_args --disable-multilib"
  382.29 -+fi
  382.30 -+
  382.31 - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  382.32 - 
  382.33 - 
  382.34 -diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac
  382.35 ---- gcc-4.3.0.orig/libjava/configure.ac	2007-12-22 16:48:46.000000000 +0100
  382.36 -+++ gcc-4.3.0/libjava/configure.ac	2008-06-10 14:44:13.000000000 +0200
  382.37 -@@ -82,6 +82,13 @@
  382.38 - 	[allow rebuilding of .class and .h files]))
  382.39 - AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
  382.40 - 
  382.41 -+AC_ARG_ENABLE(libjava-multilib,
  382.42 -+	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
  382.43 -+if test "$enable_libjava_multilib" = no; then
  382.44 -+  multilib=no
  382.45 -+  ac_configure_args="$ac_configure_args --disable-multilib"
  382.46 -+fi
  382.47 -+
  382.48 - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  382.49 - GCC_NO_EXECUTABLES
  382.50 - 
   383.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   383.2 +++ b/patches/gcc/4.3.0/150-sparc64-bsd.patch	Mon Jul 28 21:32:33 2008 +0000
   383.3 @@ -0,0 +1,30 @@
   383.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/14_all_gcc-sparc64-bsd.patch
   383.5 +diff -durN gcc-4.3.0.orig/gcc/config/sparc/freebsd.h gcc-4.3.0/gcc/config/sparc/freebsd.h
   383.6 +--- gcc-4.3.0.orig/gcc/config/sparc/freebsd.h	2007-08-02 12:49:31.000000000 +0200
   383.7 ++++ gcc-4.3.0/gcc/config/sparc/freebsd.h	2008-06-10 14:44:26.000000000 +0200
   383.8 +@@ -25,9 +25,22 @@
   383.9 + /* FreeBSD needs the platform name (sparc64) defined.
  383.10 +    Emacs needs to know if the arch is 64 or 32-bits.  */
  383.11 + 
  383.12 +-#undef  CPP_CPU64_DEFAULT_SPEC
  383.13 +-#define CPP_CPU64_DEFAULT_SPEC \
  383.14 +-  "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
  383.15 ++#undef  FBSD_TARGET_CPU_CPP_BUILTINS
  383.16 ++#define FBSD_TARGET_CPU_CPP_BUILTINS()                  \
  383.17 ++  do                                                    \
  383.18 ++    {                                                   \
  383.19 ++      if (TARGET_ARCH64)                                \
  383.20 ++        {                                               \
  383.21 ++          builtin_define ("__sparc64__");               \
  383.22 ++          builtin_define ("__sparc_v9__");              \
  383.23 ++          builtin_define ("__sparcv9");                 \
  383.24 ++        }                                               \
  383.25 ++      else                                              \
  383.26 ++        builtin_define ("__sparc");                     \
  383.27 ++      builtin_define ("__sparc__");                     \
  383.28 ++    }                                                   \
  383.29 ++  while (0)
  383.30 ++
  383.31 + 
  383.32 + #define LINK_SPEC "%(link_arch)						\
  383.33 +   %{!mno-relax:%{!r:-relax}}						\
   384.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   384.2 +++ b/patches/gcc/4.3.0/160-flatten-switch-stmt-00.patch	Mon Jul 28 21:32:33 2008 +0000
   384.3 @@ -0,0 +1,76 @@
   384.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/18_all_904-flatten-switch-stmt-00.patch
   384.5 +http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
   384.6 +
   384.7 +Hi,
   384.8 +
   384.9 +The attached patch makes sure that we create smaller object code for
  384.10 +simple switch statements. We just make sure to flatten the switch
  384.11 +statement into an if-else chain, basically.
  384.12 +
  384.13 +This fixes a size-regression as compared to gcc-3.4, as can be seen
  384.14 +below.
  384.15 +
  384.16 +2007-04-15  Bernhard Fischer  <..>
  384.17 +
  384.18 +	* stmt.c (expand_case): Do not create a complex binary tree when
  384.19 +	optimizing for size but rather use the simple ordered list.
  384.20 +	(emit_case_nodes): do not emit jumps to the default_label when
  384.21 +	optimizing for size.
  384.22 +
  384.23 +Not regtested so far.
  384.24 +Comments?
  384.25 +
  384.26 +Attached is the test switch.c mentioned below.
  384.27 +
  384.28 +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  384.29 +gcc-$i  -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
  384.30 +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  384.31 +gcc-$i  -UCHAIN -Os -o switch-$i.o -c switch.c ;done
  384.32 +
  384.33 +$ size switch-*.o
  384.34 +   text	   data	    bss	    dec	    hex	filename
  384.35 +    169	      0	      0	    169	     a9	switch-2.95.o
  384.36 +    115	      0	      0	    115	     73	switch-3.3.o
  384.37 +    103	      0	      0	    103	     67	switch-3.4.o
  384.38 +    124	      0	      0	    124	     7c	switch-4.0.o
  384.39 +    124	      0	      0	    124	     7c	switch-4.1.o
  384.40 +    124	      0	      0	    124	     7c	switch-4.2.orig-HEAD.o
  384.41 +     95	      0	      0	     95	     5f	switch-4.3-HEAD.o
  384.42 +    124	      0	      0	    124	     7c	switch-4.3.orig-HEAD.o
  384.43 +    166	      0	      0	    166	     a6	switch-CHAIN-2.95.o
  384.44 +    111	      0	      0	    111	     6f	switch-CHAIN-3.3.o
  384.45 +     95	      0	      0	     95	     5f	switch-CHAIN-3.4.o
  384.46 +     95	      0	      0	     95	     5f	switch-CHAIN-4.0.o
  384.47 +     95	      0	      0	     95	     5f	switch-CHAIN-4.1.o
  384.48 +     95	      0	      0	     95	     5f	switch-CHAIN-4.2.orig-HEAD.o
  384.49 +     95	      0	      0	     95	     5f	switch-CHAIN-4.3-HEAD.o
  384.50 +     95	      0	      0	     95	     5f	switch-CHAIN-4.3.orig-HEAD.o
  384.51 +
  384.52 +
  384.53 +Content-Type: text/x-diff; charset=us-ascii
  384.54 +Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
  384.55 +
  384.56 +diff -durN gcc-4.3.0.orig/gcc/stmt.c gcc-4.3.0/gcc/stmt.c
  384.57 +--- gcc-4.3.0.orig/gcc/stmt.c	2007-12-04 22:55:32.000000000 +0100
  384.58 ++++ gcc-4.3.0/gcc/stmt.c	2008-06-10 14:44:33.000000000 +0200
  384.59 +@@ -2508,7 +2508,11 @@
  384.60 + 	  use_cost_table
  384.61 + 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  384.62 + 	       && estimate_case_costs (case_list));
  384.63 +-	  balance_case_nodes (&case_list, NULL);
  384.64 ++	  /* When optimizing for size, we want a straight list to avoid
  384.65 ++	     jumps as much as possible. This basically creates an if-else
  384.66 ++	     chain.  */
  384.67 ++	  if (!optimize_size)
  384.68 ++	    balance_case_nodes (&case_list, NULL);
  384.69 + 	  emit_case_nodes (index, case_list, default_label, index_type);
  384.70 + 	  emit_jump (default_label);
  384.71 + 	}
  384.72 +@@ -3066,6 +3070,7 @@
  384.73 + 	    {
  384.74 + 	      if (!node_has_low_bound (node, index_type))
  384.75 + 		{
  384.76 ++		  if (!optimize_size) /* don't jl to the .default_label. */
  384.77 + 		  emit_cmp_and_jump_insns (index,
  384.78 + 					   convert_modes
  384.79 + 					   (mode, imode,
   385.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   385.2 +++ b/patches/gcc/4.3.0/170-x86-emit-cld.patch	Mon Jul 28 21:32:33 2008 +0000
   385.3 @@ -0,0 +1,156 @@
   385.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/20_all_gcc-x86-emit-cld.patch
   385.5 +bandaid for the cld issue.  to be dropped when gcc-4.3 goes stable.
   385.6 +
   385.7 +http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00417.html
   385.8 +
   385.9 +2008-03-06  Uros Bizjak  <ubizjak@gmail.com>
  385.10 +
  385.11 +	* config/i386/i386.h (TARGET_CLD): New define.
  385.12 +	(struct machine_function): Add needs_cld field.
  385.13 +	(ix86_current_function_needs_cld): New define.
  385.14 +	* config/i386/i386.md (UNSPEC_CLD): New unspec volatile constant.
  385.15 +	("cld"): New isns pattern.
  385.16 +	("strmov_singleop"): Set ix86_current_function_needs_cld flag.
  385.17 +	("rep_mov"): Ditto.
  385.18 +	("strset_singleop"): Ditto.
  385.19 +	("rep_stos"): Ditto.
  385.20 +	("cmpstrnqi_nz_1"): Ditto.
  385.21 +	("cmpstrnqi_1"): Ditto.
  385.22 +	("strlenqi_1"): Ditto.
  385.23 +	* config/i386/i386.c (ix86_expand_prologue): Emit cld insn for
  385.24 +	TARGET_CLD when ix86_current_function_needs_cld is set.
  385.25 +
  385.26 +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.c gcc-4.3.0/gcc/config/i386/i386.c
  385.27 +--- gcc-4.3.0.orig/gcc/config/i386/i386.c	2008-02-21 13:30:00.000000000 +0100
  385.28 ++++ gcc-4.3.0/gcc/config/i386/i386.c	2008-06-10 14:44:37.000000000 +0200
  385.29 +@@ -6448,6 +6448,10 @@
  385.30 + 	emit_insn (gen_prologue_use (pic_offset_table_rtx));
  385.31 +       emit_insn (gen_blockage ());
  385.32 +     }
  385.33 ++
  385.34 ++  /* Emit cld instruction if stringops are used in the function.  */
  385.35 ++  if (TARGET_CLD && ix86_current_function_needs_cld)
  385.36 ++    emit_insn (gen_cld ());
  385.37 + }
  385.38 + 
  385.39 + /* Emit code to restore saved registers using MOV insns.  First register
  385.40 +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.h gcc-4.3.0/gcc/config/i386/i386.h
  385.41 +--- gcc-4.3.0.orig/gcc/config/i386/i386.h	2008-02-15 09:12:02.000000000 +0100
  385.42 ++++ gcc-4.3.0/gcc/config/i386/i386.h	2008-06-10 14:44:37.000000000 +0200
  385.43 +@@ -388,6 +388,7 @@
  385.44 + 
  385.45 + extern int x86_prefetch_sse;
  385.46 + 
  385.47 ++#define TARGET_CLD		1
  385.48 + #define TARGET_ABM		x86_abm
  385.49 + #define TARGET_CMPXCHG16B	x86_cmpxchg16b
  385.50 + #define TARGET_POPCNT		x86_popcnt
  385.51 +@@ -2443,8 +2444,9 @@
  385.52 +   int save_varrargs_registers;
  385.53 +   int accesses_prev_frame;
  385.54 +   int optimize_mode_switching[MAX_386_ENTITIES];
  385.55 +-  /* Set by ix86_compute_frame_layout and used by prologue/epilogue expander to
  385.56 +-     determine the style used.  */
  385.57 ++  int needs_cld;
  385.58 ++  /* Set by ix86_compute_frame_layout and used by prologue/epilogue
  385.59 ++     expander to determine the style used.  */
  385.60 +   int use_fast_prologue_epilogue;
  385.61 +   /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE has been computed
  385.62 +      for.  */
  385.63 +@@ -2464,6 +2466,7 @@
  385.64 + #define ix86_stack_locals (cfun->machine->stack_locals)
  385.65 + #define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers)
  385.66 + #define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
  385.67 ++#define ix86_current_function_needs_cld (cfun->machine->needs_cld)
  385.68 + #define ix86_tls_descriptor_calls_expanded_in_cfun \
  385.69 +   (cfun->machine->tls_descriptor_call_expanded_p)
  385.70 + /* Since tls_descriptor_call_expanded is not cleared, even if all TLS
  385.71 +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.md gcc-4.3.0/gcc/config/i386/i386.md
  385.72 +--- gcc-4.3.0.orig/gcc/config/i386/i386.md	2008-02-06 12:34:00.000000000 +0100
  385.73 ++++ gcc-4.3.0/gcc/config/i386/i386.md	2008-06-10 14:44:37.000000000 +0200
  385.74 +@@ -205,6 +205,7 @@
  385.75 +    (UNSPECV_XCHG		12)
  385.76 +    (UNSPECV_LOCK		13)
  385.77 +    (UNSPECV_PROLOGUE_USE	14)
  385.78 ++   (UNSPECV_CLD			15)
  385.79 +   ])
  385.80 + 
  385.81 + ;; Constants to represent pcomtrue/pcomfalse variants
  385.82 +@@ -18529,6 +18530,14 @@
  385.83 + 
  385.84 + ;; Block operation instructions
  385.85 + 
  385.86 ++(define_insn "cld"
  385.87 ++  [(unspec_volatile [(const_int 0)] UNSPECV_CLD)]
  385.88 ++  ""
  385.89 ++  "cld"
  385.90 ++  [(set_attr "length" "1")
  385.91 ++   (set_attr "length_immediate" "0")
  385.92 ++   (set_attr "modrm" "0")])
  385.93 ++
  385.94 + (define_expand "movmemsi"
  385.95 +   [(use (match_operand:BLK 0 "memory_operand" ""))
  385.96 +    (use (match_operand:BLK 1 "memory_operand" ""))
  385.97 +@@ -18601,7 +18610,7 @@
  385.98 + 	      (set (match_operand 2 "register_operand" "")
  385.99 + 		   (match_operand 5 "" ""))])]
 385.100 +   "TARGET_SINGLE_STRINGOP || optimize_size"
 385.101 +-  "")
 385.102 ++  "ix86_current_function_needs_cld = 1;")
 385.103 + 
 385.104 + (define_insn "*strmovdi_rex_1"
 385.105 +   [(set (mem:DI (match_operand:DI 2 "register_operand" "0"))
 385.106 +@@ -18718,7 +18727,7 @@
 385.107 + 		   (match_operand 3 "memory_operand" ""))
 385.108 + 	      (use (match_dup 4))])]
 385.109 +   ""
 385.110 +-  "")
 385.111 ++  "ix86_current_function_needs_cld = 1;")
 385.112 + 
 385.113 + (define_insn "*rep_movdi_rex64"
 385.114 +   [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0))
 385.115 +@@ -18878,7 +18887,7 @@
 385.116 + 	      (set (match_operand 0 "register_operand" "")
 385.117 + 		   (match_operand 3 "" ""))])]
 385.118 +   "TARGET_SINGLE_STRINGOP || optimize_size"
 385.119 +-  "")
 385.120 ++  "ix86_current_function_needs_cld = 1;")
 385.121 + 
 385.122 + (define_insn "*strsetdi_rex_1"
 385.123 +   [(set (mem:DI (match_operand:DI 1 "register_operand" "0"))
 385.124 +@@ -18972,7 +18981,7 @@
 385.125 + 	      (use (match_operand 3 "register_operand" ""))
 385.126 + 	      (use (match_dup 1))])]
 385.127 +   ""
 385.128 +-  "")
 385.129 ++  "ix86_current_function_needs_cld = 1;")
 385.130 + 
 385.131 + (define_insn "*rep_stosdi_rex64"
 385.132 +   [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0))
 385.133 +@@ -19148,7 +19157,7 @@
 385.134 + 	      (clobber (match_operand 1 "register_operand" ""))
 385.135 + 	      (clobber (match_dup 2))])]
 385.136 +   ""
 385.137 +-  "")
 385.138 ++  "ix86_current_function_needs_cld = 1;")
 385.139 + 
 385.140 + (define_insn "*cmpstrnqi_nz_1"
 385.141 +   [(set (reg:CC FLAGS_REG)
 385.142 +@@ -19195,7 +19204,7 @@
 385.143 + 	      (clobber (match_operand 1 "register_operand" ""))
 385.144 + 	      (clobber (match_dup 2))])]
 385.145 +   ""
 385.146 +-  "")
 385.147 ++  "ix86_current_function_needs_cld = 1;")
 385.148 + 
 385.149 + (define_insn "*cmpstrnqi_1"
 385.150 +   [(set (reg:CC FLAGS_REG)
 385.151 +@@ -19264,7 +19273,7 @@
 385.152 + 	      (clobber (match_operand 1 "register_operand" ""))
 385.153 + 	      (clobber (reg:CC FLAGS_REG))])]
 385.154 +   ""
 385.155 +-  "")
 385.156 ++  "ix86_current_function_needs_cld = 1;")
 385.157 + 
 385.158 + (define_insn "*strlenqi_1"
 385.159 +   [(set (match_operand:SI 0 "register_operand" "=&c")
   386.1 --- a/patches/gcc/4.3.0/175-cross-compile.patch	Mon Jul 28 21:08:01 2008 +0000
   386.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   386.3 @@ -1,44 +0,0 @@
   386.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/08_all_gcc-4.1-cross-compile.patch
   386.5 -Some notes on the 'bootstrap with or without libc headers' debate:
   386.6 -http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
   386.7 -http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
   386.8 -
   386.9 -diff -durN gcc-4.3.0.orig/gcc/configure gcc-4.3.0/gcc/configure
  386.10 ---- gcc-4.3.0.orig/gcc/configure	2008-03-05 00:39:11.000000000 +0100
  386.11 -+++ gcc-4.3.0/gcc/configure	2008-06-10 14:44:17.000000000 +0200
  386.12 -@@ -13274,7 +13274,7 @@
  386.13 - 	    | powerpc*-*-*,powerpc64*-*-*)
  386.14 - 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  386.15 - 	esac
  386.16 --elif test "x$TARGET_SYSTEM_ROOT" != x; then
  386.17 -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  386.18 -         SYSTEM_HEADER_DIR=$build_system_header_dir
  386.19 - fi
  386.20 - 
  386.21 -diff -durN gcc-4.3.0.orig/gcc/configure.ac gcc-4.3.0/gcc/configure.ac
  386.22 ---- gcc-4.3.0.orig/gcc/configure.ac	2008-03-05 00:39:11.000000000 +0100
  386.23 -+++ gcc-4.3.0/gcc/configure.ac	2008-06-10 14:44:17.000000000 +0200
  386.24 -@@ -1745,7 +1745,7 @@
  386.25 - 	    | powerpc*-*-*,powerpc64*-*-*)
  386.26 - 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  386.27 - 	esac
  386.28 --elif test "x$TARGET_SYSTEM_ROOT" != x; then
  386.29 -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  386.30 -         SYSTEM_HEADER_DIR=$build_system_header_dir 
  386.31 - fi
  386.32 - 
  386.33 -diff -durN gcc-4.3.0.orig/gcc/unwind-dw2.c gcc-4.3.0/gcc/unwind-dw2.c
  386.34 ---- gcc-4.3.0.orig/gcc/unwind-dw2.c	2007-07-25 20:14:57.000000000 +0200
  386.35 -+++ gcc-4.3.0/gcc/unwind-dw2.c	2008-06-10 14:44:17.000000000 +0200
  386.36 -@@ -334,9 +334,11 @@
  386.37 - }
  386.38 - #endif
  386.39 - 
  386.40 -+#ifndef inhibit_libc
  386.41 - #ifdef MD_UNWIND_SUPPORT
  386.42 - #include MD_UNWIND_SUPPORT
  386.43 - #endif
  386.44 -+#endif
  386.45 - 
  386.46 - /* Extract any interesting information from the CIE for the translation
  386.47 -    unit F belongs to.  Return a pointer to the byte after the augmentation,
   387.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   387.2 +++ b/patches/gcc/4.3.0/180-libiberty-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   387.3 @@ -0,0 +1,12 @@
   387.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/51_all_gcc-3.4-libiberty-pic.patch
   387.5 +diff -durN gcc-4.3.0.orig/libiberty/Makefile.in gcc-4.3.0/libiberty/Makefile.in
   387.6 +--- gcc-4.3.0.orig/libiberty/Makefile.in	2007-07-25 08:26:45.000000000 +0200
   387.7 ++++ gcc-4.3.0/libiberty/Makefile.in	2008-06-10 14:44:43.000000000 +0200
   387.8 +@@ -225,6 +225,7 @@
   387.9 + 	  $(AR) $(AR_FLAGS) $(TARGETLIB) \
  387.10 + 	    $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
  387.11 + 	  $(RANLIB) $(TARGETLIB); \
  387.12 ++	  cp $(TARGETLIB) ../ ; \
  387.13 + 	  cd ..; \
  387.14 + 	else true; fi
  387.15 + 
   388.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   388.2 +++ b/patches/gcc/4.3.0/190-superh-default-multilib.patch	Mon Jul 28 21:32:33 2008 +0000
   388.3 @@ -0,0 +1,25 @@
   388.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/53_all_gcc4-superh-default-multilib.patch
   388.5 +The gcc-3.x toolchains would contain all the targets by default.  With gcc-4,
   388.6 +you have to actually list out the multilibs you want or you will end up with
   388.7 +just one when using targets like 'sh4-linux-gnu'.
   388.8 +
   388.9 +The resulting toolchain can't even build a kernel as the kernel needs to build
  388.10 +with the nofpu flag to be sure that no fpu ops are generated.
  388.11 +
  388.12 +Here we restore the gcc-3.x behavior; the additional overhead of building all
  388.13 +of these multilibs by default is negligible.
  388.14 +
  388.15 +http://bugs.gentoo.org/140205
  388.16 +
  388.17 +diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc
  388.18 +--- gcc-4.3.0.orig/gcc/config.gcc	2008-01-29 17:28:10.000000000 +0100
  388.19 ++++ gcc-4.3.0/gcc/config.gcc	2008-06-10 14:44:47.000000000 +0200
  388.20 +@@ -2271,7 +2271,7 @@
  388.21 + 	if test x${sh_multilibs} = x ; then
  388.22 + 		case ${target} in
  388.23 + 		sh64-superh-linux* | \
  388.24 +-		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
  388.25 ++		sh[1234]*)	sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
  388.26 + 		sh64* | sh5*)	sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
  388.27 + 		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
  388.28 + 		sh*-*-linux*)	sh_multilibs=m1,m3e,m4 ;;
   389.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   389.2 +++ b/patches/gcc/4.3.0/200-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   389.3 @@ -0,0 +1,56 @@
   389.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/54_all_300-libstdc++-pic.patch
   389.5 +install libstdc++_pic.a if we have pic objs
   389.6 +
   389.7 +diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am gcc-4.3.0/libstdc++-v3/src/Makefile.am
   389.8 +--- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am	2008-02-29 19:26:50.000000000 +0100
   389.9 ++++ gcc-4.3.0/libstdc++-v3/src/Makefile.am	2008-06-10 14:44:51.000000000 +0200
  389.10 +@@ -289,6 +289,13 @@
  389.11 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
  389.12 + 
  389.13 + 
  389.14 ++install-exec-local:
  389.15 ++	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  389.16 ++	if [ x"$$pic_objs" != x ]; then \
  389.17 ++		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  389.18 ++		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  389.19 ++	fi
  389.20 ++
  389.21 + # Added bits to build debug library.
  389.22 + if GLIBCXX_BUILD_DEBUG
  389.23 + all-local: build_debug
  389.24 +diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in gcc-4.3.0/libstdc++-v3/src/Makefile.in
  389.25 +--- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in	2008-02-29 19:26:50.000000000 +0100
  389.26 ++++ gcc-4.3.0/libstdc++-v3/src/Makefile.in	2008-06-10 14:44:51.000000000 +0200
  389.27 +@@ -693,7 +693,7 @@
  389.28 + 
  389.29 + install-data-am: install-data-local
  389.30 + 
  389.31 +-install-exec-am: install-toolexeclibLTLIBRARIES
  389.32 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  389.33 + 
  389.34 + install-info: install-info-am
  389.35 + 
  389.36 +@@ -732,7 +732,7 @@
  389.37 + 	maintainer-clean-generic mostlyclean mostlyclean-compile \
  389.38 + 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  389.39 + 	tags uninstall uninstall-am uninstall-info-am \
  389.40 +-	uninstall-toolexeclibLTLIBRARIES
  389.41 ++	uninstall-toolexeclibLTLIBRARIES install-exec-local
  389.42 + 
  389.43 + 
  389.44 + # Symbol versioning for shared libraries.
  389.45 +@@ -858,6 +858,14 @@
  389.46 + install_debug:
  389.47 + 	(cd ${debugdir} && $(MAKE) \
  389.48 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  389.49 ++
  389.50 ++install-exec-local:
  389.51 ++	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  389.52 ++	if [ x"$$pic_objs" != x ]; then \
  389.53 ++		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  389.54 ++		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  389.55 ++	fi
  389.56 ++
  389.57 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  389.58 + # Otherwise a system limit (for SysV at least) may be exceeded.
  389.59 + .NOEXPORT:
   390.1 --- a/patches/gcc/4.3.0/200-netbsd-symbolic.patch	Mon Jul 28 21:08:01 2008 +0000
   390.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   390.3 @@ -1,14 +0,0 @@
   390.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/11_all_gcc-netbsd-symbolic.patch
   390.5 -http://bugs.gentoo.org/122698
   390.6 -
   390.7 -diff -durN gcc-4.3.0.orig/gcc/config/netbsd-elf.h gcc-4.3.0/gcc/config/netbsd-elf.h
   390.8 ---- gcc-4.3.0.orig/gcc/config/netbsd-elf.h	2007-09-03 18:14:04.000000000 +0200
   390.9 -+++ gcc-4.3.0/gcc/config/netbsd-elf.h	2008-06-10 14:44:21.000000000 +0200
  390.10 -@@ -82,6 +82,7 @@
  390.11 - #define NETBSD_LINK_SPEC_ELF \
  390.12 -   "%{assert*} %{R*} %{rpath*} \
  390.13 -    %{shared:-shared} \
  390.14 -+   %{symbolic:-Bsymbolic} \
  390.15 -    %{!shared: \
  390.16 -      -dc -dp \
  390.17 -      %{!nostdlib: \
   391.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   391.2 +++ b/patches/gcc/4.3.0/210-pr35440.patch	Mon Jul 28 21:32:33 2008 +0000
   391.3 @@ -0,0 +1,59 @@
   391.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/60_all_gcc43-pr35440.patch
   391.5 +2008-03-19  Jakub Jelinek  <jakub@redhat.com>
   391.6 +
   391.7 +	PR c/35440
   391.8 +	* c-pretty-print.c (pp_c_initializer_list): Handle CONSTRUCTOR
   391.9 +	for all types.
  391.10 +
  391.11 +	* gcc.dg/pr35440.c: New test.
  391.12 +
  391.13 +diff -durN gcc-4.3.0.orig/gcc/c-pretty-print.c gcc-4.3.0/gcc/c-pretty-print.c
  391.14 +--- gcc-4.3.0.orig/gcc/c-pretty-print.c	2008-01-29 14:59:59.000000000 +0100
  391.15 ++++ gcc-4.3.0/gcc/c-pretty-print.c	2008-06-10 14:44:54.000000000 +0200
  391.16 +@@ -1173,6 +1173,12 @@
  391.17 +   tree type = TREE_TYPE (e);
  391.18 +   const enum tree_code code = TREE_CODE (type);
  391.19 + 
  391.20 ++  if (TREE_CODE (e) == CONSTRUCTOR)
  391.21 ++    {
  391.22 ++      pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
  391.23 ++      return;
  391.24 ++    }
  391.25 ++
  391.26 +   switch (code)
  391.27 +     {
  391.28 +     case RECORD_TYPE:
  391.29 +@@ -1207,16 +1213,12 @@
  391.30 +     case VECTOR_TYPE:
  391.31 +       if (TREE_CODE (e) == VECTOR_CST)
  391.32 + 	pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e));
  391.33 +-      else if (TREE_CODE (e) == CONSTRUCTOR)
  391.34 +-	pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
  391.35 +       else
  391.36 + 	break;
  391.37 +       return;
  391.38 + 
  391.39 +     case COMPLEX_TYPE:
  391.40 +-      if (TREE_CODE (e) == CONSTRUCTOR)
  391.41 +-	pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
  391.42 +-      else if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
  391.43 ++      if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
  391.44 + 	{
  391.45 + 	  const bool cst = TREE_CODE (e) == COMPLEX_CST;
  391.46 + 	  pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0));
  391.47 +diff -durN gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c
  391.48 +--- gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c	1970-01-01 01:00:00.000000000 +0100
  391.49 ++++ gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c	2008-06-10 14:44:54.000000000 +0200
  391.50 +@@ -0,0 +1,12 @@
  391.51 ++/* PR c/35440 */
  391.52 ++/* { dg-do compile } */
  391.53 ++/* { dg-options "-std=gnu99" } */
  391.54 ++
  391.55 ++struct A {};
  391.56 ++struct B { int i; char j[2]; };
  391.57 ++
  391.58 ++void foo (void)
  391.59 ++{
  391.60 ++  (struct A){}();			/* { dg-error "called object" } */
  391.61 ++  (struct B){ .i = 2, .j[1] = 1 }();	/* { dg-error "called object" } */
  391.62 ++}
   392.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   392.2 +++ b/patches/gcc/4.3.0/220-pr24170.patch	Mon Jul 28 21:32:33 2008 +0000
   392.3 @@ -0,0 +1,61 @@
   392.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc43-pr24170.patch
   392.5 +http://gcc.gnu.org/PR24170
   392.6 +
   392.7 +2008-02-20  Tom Tromey  <tromey@redhat.com>
   392.8 +
   392.9 +	PR libgcj/24170:
  392.10 +	* java/io/natFilePosix.cc (File::performList): Don't use
  392.11 +	readdir_r.
  392.12 +	* configure, include/config.h.in: Rebuilt.
  392.13 +	* configure.ac: Don't check for readdir_r.
  392.14 +
  392.15 +diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac
  392.16 +--- gcc-4.3.0.orig/libjava/configure.ac	2008-06-10 14:44:17.000000000 +0200
  392.17 ++++ gcc-4.3.0/libjava/configure.ac	2008-06-10 14:44:58.000000000 +0200
  392.18 +@@ -1030,7 +1030,7 @@
  392.19 +    PLATFORMNET=NoNet
  392.20 + else
  392.21 +    AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
  392.22 +-                   localtime_r readdir_r getpwuid_r getcwd \
  392.23 ++                   localtime_r getpwuid_r getcwd \
  392.24 + 		   access stat lstat mkdir rename rmdir unlink utime chmod readlink \
  392.25 + 		   nl_langinfo setlocale \
  392.26 + 		   inet_pton uname inet_ntoa \
  392.27 +diff -durN gcc-4.3.0.orig/libjava/include/config.h.in gcc-4.3.0/libjava/include/config.h.in
  392.28 +--- gcc-4.3.0.orig/libjava/include/config.h.in	2007-07-31 18:17:21.000000000 +0200
  392.29 ++++ gcc-4.3.0/libjava/include/config.h.in	2008-06-10 14:44:58.000000000 +0200
  392.30 +@@ -214,9 +214,6 @@
  392.31 + /* Define to 1 if you have the <pwd.h> header file. */
  392.32 + #undef HAVE_PWD_H
  392.33 + 
  392.34 +-/* Define to 1 if you have the `readdir_r' function. */
  392.35 +-#undef HAVE_READDIR_R
  392.36 +-
  392.37 + /* Define to 1 if you have the `readlink' function. */
  392.38 + #undef HAVE_READLINK
  392.39 + 
  392.40 +diff -durN gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc gcc-4.3.0/libjava/java/io/natFilePosix.cc
  392.41 +--- gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc	2007-08-04 23:50:01.000000000 +0200
  392.42 ++++ gcc-4.3.0/libjava/java/io/natFilePosix.cc	2008-06-10 14:44:58.000000000 +0200
  392.43 +@@ -1,6 +1,6 @@
  392.44 + // natFile.cc - Native part of File class for POSIX.
  392.45 + 
  392.46 +-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
  392.47 ++/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
  392.48 +    Free Software Foundation
  392.49 + 
  392.50 +    This file is part of libgcj.
  392.51 +@@ -292,13 +292,7 @@
  392.52 + 
  392.53 +   java::util::ArrayList *list = new java::util::ArrayList ();
  392.54 +   struct dirent *d;
  392.55 +-#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
  392.56 +-  int name_max = pathconf (buf, _PC_NAME_MAX);
  392.57 +-  char dbuf[sizeof (struct dirent) + name_max + 1];
  392.58 +-  while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
  392.59 +-#else /* HAVE_READDIR_R */
  392.60 +   while ((d = readdir (dir)) != NULL)
  392.61 +-#endif /* HAVE_READDIR_R */
  392.62 +     {
  392.63 +       // Omit "." and "..".
  392.64 +       if (d->d_name[0] == '.'
   393.1 --- a/patches/gcc/4.3.0/225-sparc64-bsd.patch	Mon Jul 28 21:08:01 2008 +0000
   393.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   393.3 @@ -1,30 +0,0 @@
   393.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/14_all_gcc-sparc64-bsd.patch
   393.5 -diff -durN gcc-4.3.0.orig/gcc/config/sparc/freebsd.h gcc-4.3.0/gcc/config/sparc/freebsd.h
   393.6 ---- gcc-4.3.0.orig/gcc/config/sparc/freebsd.h	2007-08-02 12:49:31.000000000 +0200
   393.7 -+++ gcc-4.3.0/gcc/config/sparc/freebsd.h	2008-06-10 14:44:26.000000000 +0200
   393.8 -@@ -25,9 +25,22 @@
   393.9 - /* FreeBSD needs the platform name (sparc64) defined.
  393.10 -    Emacs needs to know if the arch is 64 or 32-bits.  */
  393.11 - 
  393.12 --#undef  CPP_CPU64_DEFAULT_SPEC
  393.13 --#define CPP_CPU64_DEFAULT_SPEC \
  393.14 --  "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
  393.15 -+#undef  FBSD_TARGET_CPU_CPP_BUILTINS
  393.16 -+#define FBSD_TARGET_CPU_CPP_BUILTINS()                  \
  393.17 -+  do                                                    \
  393.18 -+    {                                                   \
  393.19 -+      if (TARGET_ARCH64)                                \
  393.20 -+        {                                               \
  393.21 -+          builtin_define ("__sparc64__");               \
  393.22 -+          builtin_define ("__sparc_v9__");              \
  393.23 -+          builtin_define ("__sparcv9");                 \
  393.24 -+        }                                               \
  393.25 -+      else                                              \
  393.26 -+        builtin_define ("__sparc");                     \
  393.27 -+      builtin_define ("__sparc__");                     \
  393.28 -+    }                                                   \
  393.29 -+  while (0)
  393.30 -+
  393.31 - 
  393.32 - #define LINK_SPEC "%(link_arch)						\
  393.33 -   %{!mno-relax:%{!r:-relax}}						\
   394.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   394.2 +++ b/patches/gcc/4.3.0/230-noteGNUstack-00.patch	Mon Jul 28 21:32:33 2008 +0000
   394.3 @@ -0,0 +1,96 @@
   394.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
   394.5 +2004-09-20  Jakub Jelinek  <jakub@redhat.com>
   394.6 +
   394.7 +	* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
   394.8 +	on ppc64-linux.
   394.9 +
  394.10 +	* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
  394.11 +	ia64-linux.
  394.12 +	* config/ia64/crtbegin.asm: Likewise.
  394.13 +	* config/ia64/crtend.asm: Likewise.
  394.14 +	* config/ia64/crti.asm: Likewise.
  394.15 +	* config/ia64/crtn.asm: Likewise.
  394.16 +
  394.17 +2004-05-14  Jakub Jelinek  <jakub@redhat.com>
  394.18 +
  394.19 +	* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
  394.20 +
  394.21 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.0/gcc/config/ia64/crtbegin.asm
  394.22 +--- gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm	2005-09-27 02:52:24.000000000 +0200
  394.23 ++++ gcc-4.3.0/gcc/config/ia64/crtbegin.asm	2008-06-10 14:45:02.000000000 +0200
  394.24 +@@ -255,3 +255,7 @@
  394.25 + .weak __cxa_finalize
  394.26 + #endif
  394.27 + .weak _Jv_RegisterClasses
  394.28 ++
  394.29 ++#ifdef __linux__
  394.30 ++.section .note.GNU-stack; .previous
  394.31 ++#endif
  394.32 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtend.asm gcc-4.3.0/gcc/config/ia64/crtend.asm
  394.33 +--- gcc-4.3.0.orig/gcc/config/ia64/crtend.asm	2005-09-27 02:52:24.000000000 +0200
  394.34 ++++ gcc-4.3.0/gcc/config/ia64/crtend.asm	2008-06-10 14:45:02.000000000 +0200
  394.35 +@@ -122,3 +122,7 @@
  394.36 + 
  394.37 + 	br.ret.sptk.many rp
  394.38 + 	.endp __do_global_ctors_aux
  394.39 ++
  394.40 ++#ifdef __linux__
  394.41 ++.section .note.GNU-stack; .previous
  394.42 ++#endif
  394.43 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crti.asm gcc-4.3.0/gcc/config/ia64/crti.asm
  394.44 +--- gcc-4.3.0.orig/gcc/config/ia64/crti.asm	2005-06-25 03:22:41.000000000 +0200
  394.45 ++++ gcc-4.3.0/gcc/config/ia64/crti.asm	2008-06-10 14:45:02.000000000 +0200
  394.46 +@@ -64,3 +64,7 @@
  394.47 + 	.body
  394.48 + 
  394.49 + # end of crti.asm
  394.50 ++
  394.51 ++#ifdef __linux__
  394.52 ++.section .note.GNU-stack; .previous
  394.53 ++#endif
  394.54 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtn.asm gcc-4.3.0/gcc/config/ia64/crtn.asm
  394.55 +--- gcc-4.3.0.orig/gcc/config/ia64/crtn.asm	2005-06-25 03:22:41.000000000 +0200
  394.56 ++++ gcc-4.3.0/gcc/config/ia64/crtn.asm	2008-06-10 14:45:02.000000000 +0200
  394.57 +@@ -54,3 +54,7 @@
  394.58 + 	br.ret.sptk.many b0
  394.59 + 
  394.60 + # end of crtn.asm
  394.61 ++
  394.62 ++#ifdef __linux__
  394.63 ++.section .note.GNU-stack; .previous
  394.64 ++#endif
  394.65 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.0/gcc/config/ia64/lib1funcs.asm
  394.66 +--- gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm	2005-09-27 02:52:24.000000000 +0200
  394.67 ++++ gcc-4.3.0/gcc/config/ia64/lib1funcs.asm	2008-06-10 14:45:02.000000000 +0200
  394.68 +@@ -792,3 +792,7 @@
  394.69 + 	}
  394.70 + 	.endp __floattitf
  394.71 + #endif
  394.72 ++
  394.73 ++#ifdef __linux__
  394.74 ++.section .note.GNU-stack; .previous
  394.75 ++#endif
  394.76 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/linux.h gcc-4.3.0/gcc/config/ia64/linux.h
  394.77 +--- gcc-4.3.0.orig/gcc/config/ia64/linux.h	2006-12-12 16:15:19.000000000 +0100
  394.78 ++++ gcc-4.3.0/gcc/config/ia64/linux.h	2008-06-10 14:45:02.000000000 +0200
  394.79 +@@ -5,6 +5,8 @@
  394.80 + 
  394.81 + #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
  394.82 + 
  394.83 ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
  394.84 ++
  394.85 + /* This is for -profile to use -lc_p instead of -lc.  */
  394.86 + #undef CC1_SPEC
  394.87 + #define CC1_SPEC "%{profile:-p} %{G*}"
  394.88 +diff -durN gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.0/gcc/config/rs6000/ppc-asm.h
  394.89 +--- gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h	2003-06-04 18:44:51.000000000 +0200
  394.90 ++++ gcc-4.3.0/gcc/config/rs6000/ppc-asm.h	2008-06-10 14:45:02.000000000 +0200
  394.91 +@@ -158,7 +158,7 @@
  394.92 + 	.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
  394.93 + #endif
  394.94 + 
  394.95 +-#if defined __linux__ && !defined __powerpc64__
  394.96 ++#if defined __linux__
  394.97 + 	.section .note.GNU-stack
  394.98 + 	.previous
  394.99 + #endif
   395.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   395.2 +++ b/patches/gcc/4.3.0/240-noteGNUstack-01.patch	Mon Jul 28 21:32:33 2008 +0000
   395.3 @@ -0,0 +1,198 @@
   395.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/62_all_gcc4-noteGNUstack.patch
   395.5 +2005-02-08  Jakub Jelinek  <jakub@redhat.com>
   395.6 +
   395.7 +	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
   395.8 +	* src/s390/sysv.S: Likewise.
   395.9 +	* src/powerpc/linux64.S: Likewise.
  395.10 +	* src/powerpc/linux64_closure.S: Likewise.
  395.11 +	* src/powerpc/ppc_closure.S: Likewise.
  395.12 +	* src/powerpc/sysv.S: Likewise.
  395.13 +	* src/x86/unix64.S: Likewise.
  395.14 +	* src/x86/sysv.S: Likewise.
  395.15 +	* src/sparc/v8.S: Likewise.
  395.16 +	* src/sparc/v9.S: Likewise.
  395.17 +	* src/m68k/sysv.S: Likewise.
  395.18 +	* src/ia64/unix.S: Likewise.
  395.19 +	* src/arm/sysv.S: Likewise.
  395.20 +
  395.21 +	* ia64_save_regs_in_stack.s: Moved to...
  395.22 +	* ia64_save_regs_in_stack.S: ... this.  Add .note.GNU-stack
  395.23 +	on Linux.
  395.24 +
  395.25 +diff -durN gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S
  395.26 +--- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S	1970-01-01 01:00:00.000000000 +0100
  395.27 ++++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S	2008-06-10 14:45:05.000000000 +0200
  395.28 +@@ -0,0 +1,15 @@
  395.29 ++        .text
  395.30 ++        .align 16
  395.31 ++        .global GC_save_regs_in_stack
  395.32 ++        .proc GC_save_regs_in_stack
  395.33 ++GC_save_regs_in_stack:
  395.34 ++        .bodyfoo.mpg
  395.35 ++        flushrs
  395.36 ++        ;;
  395.37 ++        mov r8=ar.bsp
  395.38 ++        br.ret.sptk.few rp
  395.39 ++        .endp GC_save_regs_in_stack
  395.40 ++
  395.41 ++#ifdef __linux__
  395.42 ++	.section .note.GNU-stack,"",@progbits
  395.43 ++#endif
  395.44 +diff -durN gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s
  395.45 +--- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s	2001-10-15 06:57:59.000000000 +0200
  395.46 ++++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s	2008-06-10 14:45:05.000000000 +0200
  395.47 +@@ -1,12 +0,0 @@
  395.48 +-        .text
  395.49 +-        .align 16
  395.50 +-        .global GC_save_regs_in_stack
  395.51 +-        .proc GC_save_regs_in_stack
  395.52 +-GC_save_regs_in_stack:
  395.53 +-        .body
  395.54 +-        flushrs
  395.55 +-        ;;
  395.56 +-        mov r8=ar.bsp
  395.57 +-        br.ret.sptk.few rp
  395.58 +-        .endp GC_save_regs_in_stack
  395.59 +-
  395.60 +diff -durN gcc-4.3.0.orig/libffi/src/alpha/osf.S gcc-4.3.0/libffi/src/alpha/osf.S
  395.61 +--- gcc-4.3.0.orig/libffi/src/alpha/osf.S	2007-04-06 18:24:16.000000000 +0200
  395.62 ++++ gcc-4.3.0/libffi/src/alpha/osf.S	2008-06-10 14:45:05.000000000 +0200
  395.63 +@@ -358,4 +358,8 @@
  395.64 + 	.byte	16		# uleb128 offset 16*-8
  395.65 + 	.align 3
  395.66 + $LEFDE3:
  395.67 ++
  395.68 ++#ifdef __linux__
  395.69 ++	.section	.note.GNU-stack,"",@progbits
  395.70 ++#endif
  395.71 + #endif
  395.72 +diff -durN gcc-4.3.0.orig/libffi/src/arm/sysv.S gcc-4.3.0/libffi/src/arm/sysv.S
  395.73 +--- gcc-4.3.0.orig/libffi/src/arm/sysv.S	2007-09-04 19:52:45.000000000 +0200
  395.74 ++++ gcc-4.3.0/libffi/src/arm/sysv.S	2008-06-10 14:45:05.000000000 +0200
  395.75 +@@ -293,3 +293,6 @@
  395.76 + 	UNWIND .fnend
  395.77 +         .size    CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
  395.78 + 
  395.79 ++#if defined __ELF__ && defined __linux__
  395.80 ++	.section	.note.GNU-stack,"",%progbits
  395.81 ++#endif
  395.82 +diff -durN gcc-4.3.0.orig/libffi/src/ia64/unix.S gcc-4.3.0/libffi/src/ia64/unix.S
  395.83 +--- gcc-4.3.0.orig/libffi/src/ia64/unix.S	2005-03-30 23:49:19.000000000 +0200
  395.84 ++++ gcc-4.3.0/libffi/src/ia64/unix.S	2008-06-10 14:45:05.000000000 +0200
  395.85 +@@ -553,3 +553,7 @@
  395.86 + 	data8	@pcrel(.Lld_hfa_float)		// FFI_IA64_TYPE_HFA_FLOAT
  395.87 + 	data8	@pcrel(.Lld_hfa_double)		// FFI_IA64_TYPE_HFA_DOUBLE
  395.88 + 	data8	@pcrel(.Lld_hfa_ldouble)	// FFI_IA64_TYPE_HFA_LDOUBLE
  395.89 ++
  395.90 ++#if defined __ELF__ && defined __linux__
  395.91 ++	.section	.note.GNU-stack,"",@progbits
  395.92 ++#endif
  395.93 +diff -durN gcc-4.3.0.orig/libffi/src/m68k/sysv.S gcc-4.3.0/libffi/src/m68k/sysv.S
  395.94 +--- gcc-4.3.0.orig/libffi/src/m68k/sysv.S	2007-05-10 23:29:04.000000000 +0200
  395.95 ++++ gcc-4.3.0/libffi/src/m68k/sysv.S	2008-06-10 14:45:05.000000000 +0200
  395.96 +@@ -207,3 +207,7 @@
  395.97 + 	rts
  395.98 + 	CFI_ENDPROC()
  395.99 + 	.size	ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
 395.100 ++
 395.101 ++#if defined __ELF__ && defined __linux__
 395.102 ++	.section	.note.GNU-stack,"",@progbits
 395.103 ++#endif
 395.104 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64.S gcc-4.3.0/libffi/src/powerpc/linux64.S
 395.105 +--- gcc-4.3.0.orig/libffi/src/powerpc/linux64.S	2007-11-17 00:24:53.000000000 +0100
 395.106 ++++ gcc-4.3.0/libffi/src/powerpc/linux64.S	2008-06-10 14:45:05.000000000 +0200
 395.107 +@@ -179,3 +179,7 @@
 395.108 + 	.align 3
 395.109 + .LEFDE1:
 395.110 + #endif
 395.111 ++
 395.112 ++#if defined __ELF__ && defined __linux__
 395.113 ++	.section	.note.GNU-stack,"",@progbits
 395.114 ++#endif
 395.115 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.0/libffi/src/powerpc/linux64_closure.S
 395.116 +--- gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S	2005-08-11 23:18:24.000000000 +0200
 395.117 ++++ gcc-4.3.0/libffi/src/powerpc/linux64_closure.S	2008-06-10 14:45:05.000000000 +0200
 395.118 +@@ -204,3 +204,7 @@
 395.119 + 	.align 3
 395.120 + .LEFDE1:
 395.121 + #endif
 395.122 ++
 395.123 ++#if defined __ELF__ && defined __linux__
 395.124 ++	.section	.note.GNU-stack,"",@progbits
 395.125 ++#endif
 395.126 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.0/libffi/src/powerpc/ppc_closure.S
 395.127 +--- gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S	2007-12-01 22:00:04.000000000 +0100
 395.128 ++++ gcc-4.3.0/libffi/src/powerpc/ppc_closure.S	2008-06-10 14:45:05.000000000 +0200
 395.129 +@@ -295,3 +295,7 @@
 395.130 + .LEFDE1:
 395.131 + 
 395.132 + #endif
 395.133 ++
 395.134 ++#if defined __ELF__ && defined __linux__
 395.135 ++	.section	.note.GNU-stack,"",@progbits
 395.136 ++#endif
 395.137 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/sysv.S gcc-4.3.0/libffi/src/powerpc/sysv.S
 395.138 +--- gcc-4.3.0.orig/libffi/src/powerpc/sysv.S	2007-12-01 22:00:04.000000000 +0100
 395.139 ++++ gcc-4.3.0/libffi/src/powerpc/sysv.S	2008-06-10 14:45:05.000000000 +0200
 395.140 +@@ -223,3 +223,7 @@
 395.141 +       .align 2
 395.142 + .LEFDE1:
 395.143 + #endif
 395.144 ++
 395.145 ++#if defined __ELF__ && defined __linux__
 395.146 ++	.section	.note.GNU-stack,"",@progbits
 395.147 ++#endif
 395.148 +diff -durN gcc-4.3.0.orig/libffi/src/s390/sysv.S gcc-4.3.0/libffi/src/s390/sysv.S
 395.149 +--- gcc-4.3.0.orig/libffi/src/s390/sysv.S	2003-10-21 21:01:58.000000000 +0200
 395.150 ++++ gcc-4.3.0/libffi/src/s390/sysv.S	2008-06-10 14:45:05.000000000 +0200
 395.151 +@@ -427,3 +427,6 @@
 395.152 + 
 395.153 + #endif
 395.154 + 
 395.155 ++#if defined __ELF__ && defined __linux__
 395.156 ++	.section	.note.GNU-stack,"",@progbits
 395.157 ++#endif
 395.158 +diff -durN gcc-4.3.0.orig/libffi/src/sparc/v8.S gcc-4.3.0/libffi/src/sparc/v8.S
 395.159 +--- gcc-4.3.0.orig/libffi/src/sparc/v8.S	2004-11-22 19:35:16.000000000 +0100
 395.160 ++++ gcc-4.3.0/libffi/src/sparc/v8.S	2008-06-10 14:45:05.000000000 +0200
 395.161 +@@ -265,3 +265,7 @@
 395.162 + 	.byte	0x1f	! uleb128 0x1f
 395.163 + 	.align	WS
 395.164 + .LLEFDE2:
 395.165 ++
 395.166 ++#if defined __ELF__ && defined __linux__
 395.167 ++	.section	.note.GNU-stack,"",@progbits
 395.168 ++#endif
 395.169 +diff -durN gcc-4.3.0.orig/libffi/src/sparc/v9.S gcc-4.3.0/libffi/src/sparc/v9.S
 395.170 +--- gcc-4.3.0.orig/libffi/src/sparc/v9.S	2004-01-25 07:58:33.000000000 +0100
 395.171 ++++ gcc-4.3.0/libffi/src/sparc/v9.S	2008-06-10 14:45:05.000000000 +0200
 395.172 +@@ -300,3 +300,7 @@
 395.173 + 	.align 8
 395.174 + .LLEFDE2:
 395.175 + #endif
 395.176 ++
 395.177 ++#ifdef __linux__
 395.178 ++	.section	.note.GNU-stack,"",@progbits
 395.179 ++#endif
 395.180 +diff -durN gcc-4.3.0.orig/libffi/src/x86/sysv.S gcc-4.3.0/libffi/src/x86/sysv.S
 395.181 +--- gcc-4.3.0.orig/libffi/src/x86/sysv.S	2008-01-30 15:36:58.000000000 +0100
 395.182 ++++ gcc-4.3.0/libffi/src/x86/sysv.S	2008-06-10 14:45:05.000000000 +0200
 395.183 +@@ -430,3 +430,7 @@
 395.184 + #endif
 395.185 + 
 395.186 + #endif /* ifndef __x86_64__ */
 395.187 ++
 395.188 ++#if defined __ELF__ && defined __linux__
 395.189 ++	.section	.note.GNU-stack,"",@progbits
 395.190 ++#endif
 395.191 +diff -durN gcc-4.3.0.orig/libffi/src/x86/unix64.S gcc-4.3.0/libffi/src/x86/unix64.S
 395.192 +--- gcc-4.3.0.orig/libffi/src/x86/unix64.S	2005-05-05 06:06:38.000000000 +0200
 395.193 ++++ gcc-4.3.0/libffi/src/x86/unix64.S	2008-06-10 14:45:05.000000000 +0200
 395.194 +@@ -410,3 +410,7 @@
 395.195 + .LEFDE3:
 395.196 + 
 395.197 + #endif /* __x86_64__ */
 395.198 ++
 395.199 ++#if defined __ELF__ && defined __linux__
 395.200 ++	.section	.note.GNU-stack,"",@progbits
 395.201 ++#endif
   396.1 --- a/patches/gcc/4.3.0/250-flatten-switch-stmt-00.patch	Mon Jul 28 21:08:01 2008 +0000
   396.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   396.3 @@ -1,76 +0,0 @@
   396.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/18_all_904-flatten-switch-stmt-00.patch
   396.5 -http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
   396.6 -
   396.7 -Hi,
   396.8 -
   396.9 -The attached patch makes sure that we create smaller object code for
  396.10 -simple switch statements. We just make sure to flatten the switch
  396.11 -statement into an if-else chain, basically.
  396.12 -
  396.13 -This fixes a size-regression as compared to gcc-3.4, as can be seen
  396.14 -below.
  396.15 -
  396.16 -2007-04-15  Bernhard Fischer  <..>
  396.17 -
  396.18 -	* stmt.c (expand_case): Do not create a complex binary tree when
  396.19 -	optimizing for size but rather use the simple ordered list.
  396.20 -	(emit_case_nodes): do not emit jumps to the default_label when
  396.21 -	optimizing for size.
  396.22 -
  396.23 -Not regtested so far.
  396.24 -Comments?
  396.25 -
  396.26 -Attached is the test switch.c mentioned below.
  396.27 -
  396.28 -$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  396.29 -gcc-$i  -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
  396.30 -$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  396.31 -gcc-$i  -UCHAIN -Os -o switch-$i.o -c switch.c ;done
  396.32 -
  396.33 -$ size switch-*.o
  396.34 -   text	   data	    bss	    dec	    hex	filename
  396.35 -    169	      0	      0	    169	     a9	switch-2.95.o
  396.36 -    115	      0	      0	    115	     73	switch-3.3.o
  396.37 -    103	      0	      0	    103	     67	switch-3.4.o
  396.38 -    124	      0	      0	    124	     7c	switch-4.0.o
  396.39 -    124	      0	      0	    124	     7c	switch-4.1.o
  396.40 -    124	      0	      0	    124	     7c	switch-4.2.orig-HEAD.o
  396.41 -     95	      0	      0	     95	     5f	switch-4.3-HEAD.o
  396.42 -    124	      0	      0	    124	     7c	switch-4.3.orig-HEAD.o
  396.43 -    166	      0	      0	    166	     a6	switch-CHAIN-2.95.o
  396.44 -    111	      0	      0	    111	     6f	switch-CHAIN-3.3.o
  396.45 -     95	      0	      0	     95	     5f	switch-CHAIN-3.4.o
  396.46 -     95	      0	      0	     95	     5f	switch-CHAIN-4.0.o
  396.47 -     95	      0	      0	     95	     5f	switch-CHAIN-4.1.o
  396.48 -     95	      0	      0	     95	     5f	switch-CHAIN-4.2.orig-HEAD.o
  396.49 -     95	      0	      0	     95	     5f	switch-CHAIN-4.3-HEAD.o
  396.50 -     95	      0	      0	     95	     5f	switch-CHAIN-4.3.orig-HEAD.o
  396.51 -
  396.52 -
  396.53 -Content-Type: text/x-diff; charset=us-ascii
  396.54 -Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
  396.55 -
  396.56 -diff -durN gcc-4.3.0.orig/gcc/stmt.c gcc-4.3.0/gcc/stmt.c
  396.57 ---- gcc-4.3.0.orig/gcc/stmt.c	2007-12-04 22:55:32.000000000 +0100
  396.58 -+++ gcc-4.3.0/gcc/stmt.c	2008-06-10 14:44:33.000000000 +0200
  396.59 -@@ -2508,7 +2508,11 @@
  396.60 - 	  use_cost_table
  396.61 - 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  396.62 - 	       && estimate_case_costs (case_list));
  396.63 --	  balance_case_nodes (&case_list, NULL);
  396.64 -+	  /* When optimizing for size, we want a straight list to avoid
  396.65 -+	     jumps as much as possible. This basically creates an if-else
  396.66 -+	     chain.  */
  396.67 -+	  if (!optimize_size)
  396.68 -+	    balance_case_nodes (&case_list, NULL);
  396.69 - 	  emit_case_nodes (index, case_list, default_label, index_type);
  396.70 - 	  emit_jump (default_label);
  396.71 - 	}
  396.72 -@@ -3066,6 +3070,7 @@
  396.73 - 	    {
  396.74 - 	      if (!node_has_low_bound (node, index_type))
  396.75 - 		{
  396.76 -+		  if (!optimize_size) /* don't jl to the .default_label. */
  396.77 - 		  emit_cmp_and_jump_insns (index,
  396.78 - 					   convert_modes
  396.79 - 					   (mode, imode,
   397.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   397.2 +++ b/patches/gcc/4.3.0/250-pr35705.patch	Mon Jul 28 21:32:33 2008 +0000
   397.3 @@ -0,0 +1,21 @@
   397.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/63_all_gcc43-pr35705.patch
   397.5 +http://gcc.gnu.org/PR35705
   397.6 +
   397.7 +2008-04-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
   397.8 +
   397.9 +	PR middle-end/35705
  397.10 +	* fold-const.c (get_pointer_modulus_and_residue): Return modulus 1 if
  397.11 +	the expression is a function address.
  397.12 +
  397.13 +diff -durN gcc-4.3.0.orig/gcc/fold-const.c gcc-4.3.0/gcc/fold-const.c
  397.14 +--- gcc-4.3.0.orig/gcc/fold-const.c	2008-02-27 15:12:33.000000000 +0100
  397.15 ++++ gcc-4.3.0/gcc/fold-const.c	2008-06-10 14:45:09.000000000 +0200
  397.16 +@@ -9357,7 +9357,7 @@
  397.17 + 	    }
  397.18 + 	}
  397.19 + 
  397.20 +-      if (DECL_P (expr))
  397.21 ++      if (DECL_P (expr) && TREE_CODE (expr) != FUNCTION_DECL)
  397.22 + 	return DECL_ALIGN_UNIT (expr);
  397.23 +     }
  397.24 +   else if (code == POINTER_PLUS_EXPR)
   398.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   398.2 +++ b/patches/gcc/4.3.0/260-pr34571.patch	Mon Jul 28 21:32:33 2008 +0000
   398.3 @@ -0,0 +1,35 @@
   398.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/64_all_gcc43-pr34571.patch
   398.5 +http://gcc.gnu.org/PR34571
   398.6 +
   398.7 +2007-12-26  Rask Ingemann Lambertsen  <rask@sygehus.dk>
   398.8 +
   398.9 +	PR target/34571
  398.10 +	* config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
  398.11 +	symbolic_operand.
  398.12 +	* varasm.c (output_constant_pool_1): Fix typo.
  398.13 +
  398.14 +diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.c gcc-4.3.0/gcc/config/alpha/alpha.c
  398.15 +--- gcc-4.3.0.orig/gcc/config/alpha/alpha.c	2008-02-07 18:45:24.000000000 +0100
  398.16 ++++ gcc-4.3.0/gcc/config/alpha/alpha.c	2008-06-10 14:45:13.000000000 +0200
  398.17 +@@ -1113,8 +1113,7 @@
  398.18 + static bool
  398.19 + alpha_cannot_force_const_mem (rtx x)
  398.20 + {
  398.21 +-  enum rtx_code code = GET_CODE (x);
  398.22 +-  return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
  398.23 ++  return symbolic_operand (x, GET_MODE (x));
  398.24 + }
  398.25 + 
  398.26 + /* We do not allow indirect calls to be optimized into sibling calls, nor
  398.27 +diff -durN gcc-4.3.0.orig/gcc/varasm.c gcc-4.3.0/gcc/varasm.c
  398.28 +--- gcc-4.3.0.orig/gcc/varasm.c	2007-12-05 22:55:10.000000000 +0100
  398.29 ++++ gcc-4.3.0/gcc/varasm.c	2008-06-10 14:45:13.000000000 +0200
  398.30 +@@ -3710,7 +3710,7 @@
  398.31 +       /* FALLTHRU  */
  398.32 + 
  398.33 +     case LABEL_REF:
  398.34 +-      tmp = XEXP (x, 0);
  398.35 ++      tmp = XEXP (tmp, 0);
  398.36 +       gcc_assert (!INSN_DELETED_P (tmp));
  398.37 +       gcc_assert (!NOTE_P (tmp)
  398.38 + 		  || NOTE_KIND (tmp) != NOTE_INSN_DELETED);
   399.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   399.2 +++ b/patches/gcc/4.3.0/270-pr35982.patch	Mon Jul 28 21:32:33 2008 +0000
   399.3 @@ -0,0 +1,23 @@
   399.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/65_all_gcc43-pr35982.patch
   399.5 +http://gcc.gnu.org/PR35982
   399.6 +
   399.7 +2008-04-23  Ira Rosen  <irar@il.ibm.com>
   399.8 +
   399.9 +	PR tree-optimization/35982
  399.10 +	* tree-vect-analyze.c (vect_check_interleaving): Check that the
  399.11 +	interleaved data-refs are of the same type.
  399.12 +
  399.13 +diff -durN gcc-4.3.0.orig/gcc/tree-vect-analyze.c gcc-4.3.0/gcc/tree-vect-analyze.c
  399.14 +--- gcc-4.3.0.orig/gcc/tree-vect-analyze.c	2007-12-06 17:18:55.000000000 +0100
  399.15 ++++ gcc-4.3.0/gcc/tree-vect-analyze.c	2008-06-10 14:45:17.000000000 +0200
  399.16 +@@ -1081,7 +1081,9 @@
  399.17 +   type_size_b = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drb))));
  399.18 + 
  399.19 +   if (type_size_a != type_size_b
  399.20 +-      || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb)))
  399.21 ++      || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb))
  399.22 ++      || !types_compatible_p (TREE_TYPE (DR_REF (dra)), 
  399.23 ++                              TREE_TYPE (DR_REF (drb))))
  399.24 +     return;
  399.25 + 
  399.26 +   init_a = TREE_INT_CST_LOW (DR_INIT (dra));
   400.1 --- a/patches/gcc/4.3.0/275-x86-emit-cld.patch	Mon Jul 28 21:08:01 2008 +0000
   400.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   400.3 @@ -1,156 +0,0 @@
   400.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/20_all_gcc-x86-emit-cld.patch
   400.5 -bandaid for the cld issue.  to be dropped when gcc-4.3 goes stable.
   400.6 -
   400.7 -http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00417.html
   400.8 -
   400.9 -2008-03-06  Uros Bizjak  <ubizjak@gmail.com>
  400.10 -
  400.11 -	* config/i386/i386.h (TARGET_CLD): New define.
  400.12 -	(struct machine_function): Add needs_cld field.
  400.13 -	(ix86_current_function_needs_cld): New define.
  400.14 -	* config/i386/i386.md (UNSPEC_CLD): New unspec volatile constant.
  400.15 -	("cld"): New isns pattern.
  400.16 -	("strmov_singleop"): Set ix86_current_function_needs_cld flag.
  400.17 -	("rep_mov"): Ditto.
  400.18 -	("strset_singleop"): Ditto.
  400.19 -	("rep_stos"): Ditto.
  400.20 -	("cmpstrnqi_nz_1"): Ditto.
  400.21 -	("cmpstrnqi_1"): Ditto.
  400.22 -	("strlenqi_1"): Ditto.
  400.23 -	* config/i386/i386.c (ix86_expand_prologue): Emit cld insn for
  400.24 -	TARGET_CLD when ix86_current_function_needs_cld is set.
  400.25 -
  400.26 -diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.c gcc-4.3.0/gcc/config/i386/i386.c
  400.27 ---- gcc-4.3.0.orig/gcc/config/i386/i386.c	2008-02-21 13:30:00.000000000 +0100
  400.28 -+++ gcc-4.3.0/gcc/config/i386/i386.c	2008-06-10 14:44:37.000000000 +0200
  400.29 -@@ -6448,6 +6448,10 @@
  400.30 - 	emit_insn (gen_prologue_use (pic_offset_table_rtx));
  400.31 -       emit_insn (gen_blockage ());
  400.32 -     }
  400.33 -+
  400.34 -+  /* Emit cld instruction if stringops are used in the function.  */
  400.35 -+  if (TARGET_CLD && ix86_current_function_needs_cld)
  400.36 -+    emit_insn (gen_cld ());
  400.37 - }
  400.38 - 
  400.39 - /* Emit code to restore saved registers using MOV insns.  First register
  400.40 -diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.h gcc-4.3.0/gcc/config/i386/i386.h
  400.41 ---- gcc-4.3.0.orig/gcc/config/i386/i386.h	2008-02-15 09:12:02.000000000 +0100
  400.42 -+++ gcc-4.3.0/gcc/config/i386/i386.h	2008-06-10 14:44:37.000000000 +0200
  400.43 -@@ -388,6 +388,7 @@
  400.44 - 
  400.45 - extern int x86_prefetch_sse;
  400.46 - 
  400.47 -+#define TARGET_CLD		1
  400.48 - #define TARGET_ABM		x86_abm
  400.49 - #define TARGET_CMPXCHG16B	x86_cmpxchg16b
  400.50 - #define TARGET_POPCNT		x86_popcnt
  400.51 -@@ -2443,8 +2444,9 @@
  400.52 -   int save_varrargs_registers;
  400.53 -   int accesses_prev_frame;
  400.54 -   int optimize_mode_switching[MAX_386_ENTITIES];
  400.55 --  /* Set by ix86_compute_frame_layout and used by prologue/epilogue expander to
  400.56 --     determine the style used.  */
  400.57 -+  int needs_cld;
  400.58 -+  /* Set by ix86_compute_frame_layout and used by prologue/epilogue
  400.59 -+     expander to determine the style used.  */
  400.60 -   int use_fast_prologue_epilogue;
  400.61 -   /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE has been computed
  400.62 -      for.  */
  400.63 -@@ -2464,6 +2466,7 @@
  400.64 - #define ix86_stack_locals (cfun->machine->stack_locals)
  400.65 - #define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers)
  400.66 - #define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
  400.67 -+#define ix86_current_function_needs_cld (cfun->machine->needs_cld)
  400.68 - #define ix86_tls_descriptor_calls_expanded_in_cfun \
  400.69 -   (cfun->machine->tls_descriptor_call_expanded_p)
  400.70 - /* Since tls_descriptor_call_expanded is not cleared, even if all TLS
  400.71 -diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.md gcc-4.3.0/gcc/config/i386/i386.md
  400.72 ---- gcc-4.3.0.orig/gcc/config/i386/i386.md	2008-02-06 12:34:00.000000000 +0100
  400.73 -+++ gcc-4.3.0/gcc/config/i386/i386.md	2008-06-10 14:44:37.000000000 +0200
  400.74 -@@ -205,6 +205,7 @@
  400.75 -    (UNSPECV_XCHG		12)
  400.76 -    (UNSPECV_LOCK		13)
  400.77 -    (UNSPECV_PROLOGUE_USE	14)
  400.78 -+   (UNSPECV_CLD			15)
  400.79 -   ])
  400.80 - 
  400.81 - ;; Constants to represent pcomtrue/pcomfalse variants
  400.82 -@@ -18529,6 +18530,14 @@
  400.83 - 
  400.84 - ;; Block operation instructions
  400.85 - 
  400.86 -+(define_insn "cld"
  400.87 -+  [(unspec_volatile [(const_int 0)] UNSPECV_CLD)]
  400.88 -+  ""
  400.89 -+  "cld"
  400.90 -+  [(set_attr "length" "1")
  400.91 -+   (set_attr "length_immediate" "0")
  400.92 -+   (set_attr "modrm" "0")])
  400.93 -+
  400.94 - (define_expand "movmemsi"
  400.95 -   [(use (match_operand:BLK 0 "memory_operand" ""))
  400.96 -    (use (match_operand:BLK 1 "memory_operand" ""))
  400.97 -@@ -18601,7 +18610,7 @@
  400.98 - 	      (set (match_operand 2 "register_operand" "")
  400.99 - 		   (match_operand 5 "" ""))])]
 400.100 -   "TARGET_SINGLE_STRINGOP || optimize_size"
 400.101 --  "")
 400.102 -+  "ix86_current_function_needs_cld = 1;")
 400.103 - 
 400.104 - (define_insn "*strmovdi_rex_1"
 400.105 -   [(set (mem:DI (match_operand:DI 2 "register_operand" "0"))
 400.106 -@@ -18718,7 +18727,7 @@
 400.107 - 		   (match_operand 3 "memory_operand" ""))
 400.108 - 	      (use (match_dup 4))])]
 400.109 -   ""
 400.110 --  "")
 400.111 -+  "ix86_current_function_needs_cld = 1;")
 400.112 - 
 400.113 - (define_insn "*rep_movdi_rex64"
 400.114 -   [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0))
 400.115 -@@ -18878,7 +18887,7 @@
 400.116 - 	      (set (match_operand 0 "register_operand" "")
 400.117 - 		   (match_operand 3 "" ""))])]
 400.118 -   "TARGET_SINGLE_STRINGOP || optimize_size"
 400.119 --  "")
 400.120 -+  "ix86_current_function_needs_cld = 1;")
 400.121 - 
 400.122 - (define_insn "*strsetdi_rex_1"
 400.123 -   [(set (mem:DI (match_operand:DI 1 "register_operand" "0"))
 400.124 -@@ -18972,7 +18981,7 @@
 400.125 - 	      (use (match_operand 3 "register_operand" ""))
 400.126 - 	      (use (match_dup 1))])]
 400.127 -   ""
 400.128 --  "")
 400.129 -+  "ix86_current_function_needs_cld = 1;")
 400.130 - 
 400.131 - (define_insn "*rep_stosdi_rex64"
 400.132 -   [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0))
 400.133 -@@ -19148,7 +19157,7 @@
 400.134 - 	      (clobber (match_operand 1 "register_operand" ""))
 400.135 - 	      (clobber (match_dup 2))])]
 400.136 -   ""
 400.137 --  "")
 400.138 -+  "ix86_current_function_needs_cld = 1;")
 400.139 - 
 400.140 - (define_insn "*cmpstrnqi_nz_1"
 400.141 -   [(set (reg:CC FLAGS_REG)
 400.142 -@@ -19195,7 +19204,7 @@
 400.143 - 	      (clobber (match_operand 1 "register_operand" ""))
 400.144 - 	      (clobber (match_dup 2))])]
 400.145 -   ""
 400.146 --  "")
 400.147 -+  "ix86_current_function_needs_cld = 1;")
 400.148 - 
 400.149 - (define_insn "*cmpstrnqi_1"
 400.150 -   [(set (reg:CC FLAGS_REG)
 400.151 -@@ -19264,7 +19273,7 @@
 400.152 - 	      (clobber (match_operand 1 "register_operand" ""))
 400.153 - 	      (clobber (reg:CC FLAGS_REG))])]
 400.154 -   ""
 400.155 --  "")
 400.156 -+  "ix86_current_function_needs_cld = 1;")
 400.157 - 
 400.158 - (define_insn "*strlenqi_1"
 400.159 -   [(set (match_operand:SI 0 "register_operand" "=&c")
   401.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   401.2 +++ b/patches/gcc/4.3.0/280-pr25343.patch	Mon Jul 28 21:32:33 2008 +0000
   401.3 @@ -0,0 +1,21 @@
   401.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/66_all_gcc43-pr25343.patch
   401.5 +http://gcc.gnu.org/PR25343
   401.6 +
   401.7 +sniped from Debian
   401.8 +
   401.9 +2008-04-27  Roman Zippel <zippel@linux-m68k.org>
  401.10 +
  401.11 +	* config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
  401.12 +
  401.13 +diff -durN gcc-4.3.0.orig/gcc/config/host-linux.c gcc-4.3.0/gcc/config/host-linux.c
  401.14 +--- gcc-4.3.0.orig/gcc/config/host-linux.c	2007-08-02 12:49:31.000000000 +0200
  401.15 ++++ gcc-4.3.0/gcc/config/host-linux.c	2008-06-10 14:45:20.000000000 +0200
  401.16 +@@ -84,6 +84,8 @@
  401.17 + # define TRY_EMPTY_VM_SPACE	0x8000000000
  401.18 + #elif defined(__sparc__)
  401.19 + # define TRY_EMPTY_VM_SPACE	0x60000000
  401.20 ++#elif defined(__mc68000__)
  401.21 ++# define TRY_EMPTY_VM_SPACE	0x40000000
  401.22 + #else
  401.23 + # define TRY_EMPTY_VM_SPACE	0
  401.24 + #endif
   402.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   402.2 +++ b/patches/gcc/4.3.0/290-sh-pr24836.patch	Mon Jul 28 21:32:33 2008 +0000
   402.3 @@ -0,0 +1,28 @@
   402.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/74_all_sh-pr24836.patch
   402.5 +http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
   402.6 +http://gcc.gnu.org/PR24836
   402.7 +
   402.8 +diff -durN gcc-4.3.0.orig/gcc/configure gcc-4.3.0/gcc/configure
   402.9 +--- gcc-4.3.0.orig/gcc/configure	2008-06-10 14:44:21.000000000 +0200
  402.10 ++++ gcc-4.3.0/gcc/configure	2008-06-10 14:45:24.000000000 +0200
  402.11 +@@ -14700,7 +14700,7 @@
  402.12 + 	tls_first_minor=14
  402.13 + 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  402.14 + 	;;
  402.15 +-  sh-*-* | sh[34]-*-*)
  402.16 ++  sh-*-* | sh[34]*-*-*)
  402.17 +     conftest_s='
  402.18 + 	.section ".tdata","awT",@progbits
  402.19 + foo:	.long	25
  402.20 +diff -durN gcc-4.3.0.orig/gcc/configure.ac gcc-4.3.0/gcc/configure.ac
  402.21 +--- gcc-4.3.0.orig/gcc/configure.ac	2008-06-10 14:44:21.000000000 +0200
  402.22 ++++ gcc-4.3.0/gcc/configure.ac	2008-06-10 14:45:24.000000000 +0200
  402.23 +@@ -2533,7 +2533,7 @@
  402.24 + 	tls_first_minor=14
  402.25 + 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  402.26 + 	;;
  402.27 +-  sh-*-* | sh[34]-*-*)
  402.28 ++  sh-*-* | sh[34]*-*-*)
  402.29 +     conftest_s='
  402.30 + 	.section ".tdata","awT",@progbits
  402.31 + foo:	.long	25
   403.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   403.2 +++ b/patches/gcc/4.3.0/300-ca-translation-typo.patch	Mon Jul 28 21:32:33 2008 +0000
   403.3 @@ -0,0 +1,19 @@
   403.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/85_all_gcc-ca-translation-typo.patch
   403.5 +http://bugs.gentoo.org/127190
   403.6 +
   403.7 +2006-03-28  Harald van Dijk  <truedfx@gentoo.org>
   403.8 +
   403.9 +	* ca.po: Fix printf flag typo in negative value translation.
  403.10 +
  403.11 +diff -durN gcc-4.3.0.orig/gcc/po/ca.po gcc-4.3.0/gcc/po/ca.po
  403.12 +--- gcc-4.3.0.orig/gcc/po/ca.po	2007-11-10 19:36:27.000000000 +0100
  403.13 ++++ gcc-4.3.0/gcc/po/ca.po	2008-06-10 14:45:27.000000000 +0200
  403.14 +@@ -36028,7 +36028,7 @@
  403.15 + #~ msgstr "passant el valor negatiu `%E' per a %s %P de \"%D\""
  403.16 + 
  403.17 + #~ msgid "%s of negative value `%E' to `%T'"
  403.18 +-#~ msgstr "%s de valor negatiu `%I' a \"%T\""
  403.19 ++#~ msgstr "%s de valor negatiu `%E' a \"%T\""
  403.20 + 
  403.21 + #~ msgid "initializing array with parameter list"
  403.22 + #~ msgstr "inicialitzant una matriu amb una llista de paràmetres"
   404.1 --- a/patches/gcc/4.3.0/300-libiberty-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   404.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   404.3 @@ -1,12 +0,0 @@
   404.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/51_all_gcc-3.4-libiberty-pic.patch
   404.5 -diff -durN gcc-4.3.0.orig/libiberty/Makefile.in gcc-4.3.0/libiberty/Makefile.in
   404.6 ---- gcc-4.3.0.orig/libiberty/Makefile.in	2007-07-25 08:26:45.000000000 +0200
   404.7 -+++ gcc-4.3.0/libiberty/Makefile.in	2008-06-10 14:44:43.000000000 +0200
   404.8 -@@ -225,6 +225,7 @@
   404.9 - 	  $(AR) $(AR_FLAGS) $(TARGETLIB) \
  404.10 - 	    $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
  404.11 - 	  $(RANLIB) $(TARGETLIB); \
  404.12 -+	  cp $(TARGETLIB) ../ ; \
  404.13 - 	  cd ..; \
  404.14 - 	else true; fi
  404.15 - 
   405.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   405.2 +++ b/patches/gcc/4.3.0/310-uclibc-conf-noupstream.patch	Mon Jul 28 21:32:33 2008 +0000
   405.3 @@ -0,0 +1,13 @@
   405.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_103-uclibc-conf-noupstream.patch
   405.5 +diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc
   405.6 +--- gcc-4.3.0.orig/gcc/config.gcc	2008-06-10 14:44:51.000000000 +0200
   405.7 ++++ gcc-4.3.0/gcc/config.gcc	2008-06-10 14:45:31.000000000 +0200
   405.8 +@@ -2142,7 +2142,7 @@
   405.9 +         ;;
  405.10 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  405.11 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  405.12 +-  sh-*-linux* | sh[346lbe]*-*-linux* | \
  405.13 ++  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  405.14 +   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  405.15 +    sh64-*-netbsd* | sh64l*-*-netbsd*)
  405.16 + 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   406.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   406.2 +++ b/patches/gcc/4.3.0/320-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   406.3 @@ -0,0 +1,2794 @@
   406.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_200-uclibc-locale.patch
   406.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 gcc-4.3.0/libstdc++-v3/acinclude.m4
   406.6 +--- gcc-4.3.0.orig/libstdc++-v3/acinclude.m4	2008-02-29 01:00:39.000000000 +0100
   406.7 ++++ gcc-4.3.0/libstdc++-v3/acinclude.m4	2008-06-10 14:45:35.000000000 +0200
   406.8 +@@ -1349,7 +1349,7 @@
   406.9 + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
  406.10 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  406.11 +     [use MODEL for target locale package],
  406.12 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  406.13 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  406.14 + 
  406.15 +   # Deal with gettext issues.  Default to not using it (=no) until we detect
  406.16 +   # support for it later.  Let the user turn it off via --e/d, but let that
  406.17 +@@ -1370,6 +1370,9 @@
  406.18 +   # Default to "generic".
  406.19 +   if test $enable_clocale_flag = auto; then
  406.20 +     case ${target_os} in
  406.21 ++      *-uclibc*)
  406.22 ++        enable_clocale_flag=uclibc
  406.23 ++        ;;
  406.24 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  406.25 +         enable_clocale_flag=gnu	
  406.26 +         ;;
  406.27 +@@ -1541,6 +1544,40 @@
  406.28 +       CTIME_CC=config/locale/generic/time_members.cc
  406.29 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  406.30 +       ;;
  406.31 ++    uclibc)
  406.32 ++      AC_MSG_RESULT(uclibc)
  406.33 ++
  406.34 ++      # Declare intention to use gettext, and add support for specific
  406.35 ++      # languages.
  406.36 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  406.37 ++      ALL_LINGUAS="de fr"
  406.38 ++
  406.39 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  406.40 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  406.41 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  406.42 ++        USE_NLS=yes
  406.43 ++      fi
  406.44 ++      # Export the build objects.
  406.45 ++      for ling in $ALL_LINGUAS; do \
  406.46 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  406.47 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  406.48 ++      done
  406.49 ++      AC_SUBST(glibcxx_MOFILES)
  406.50 ++      AC_SUBST(glibcxx_POFILES)
  406.51 ++
  406.52 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  406.53 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  406.54 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  406.55 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  406.56 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  406.57 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  406.58 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  406.59 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  406.60 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  406.61 ++      CTIME_H=config/locale/uclibc/time_members.h
  406.62 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  406.63 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  406.64 ++      ;;
  406.65 +   esac
  406.66 + 
  406.67 +   # This is where the testsuite looks for locale catalogs, using the
  406.68 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  406.69 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
  406.70 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:35.000000000 +0200
  406.71 +@@ -0,0 +1,63 @@
  406.72 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  406.73 ++
  406.74 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  406.75 ++//
  406.76 ++// This file is part of the GNU ISO C++ Library.  This library is free
  406.77 ++// software; you can redistribute it and/or modify it under the
  406.78 ++// terms of the GNU General Public License as published by the
  406.79 ++// Free Software Foundation; either version 2, or (at your option)
  406.80 ++// any later version.
  406.81 ++
  406.82 ++// This library is distributed in the hope that it will be useful,
  406.83 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  406.84 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  406.85 ++// GNU General Public License for more details.
  406.86 ++
  406.87 ++// You should have received a copy of the GNU General Public License along
  406.88 ++// with this library; see the file COPYING.  If not, write to the Free
  406.89 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  406.90 ++// USA.
  406.91 ++
  406.92 ++// As a special exception, you may use this file as part of a free software
  406.93 ++// library without restriction.  Specifically, if other files instantiate
  406.94 ++// templates or use macros or inline functions from this file, or you compile
  406.95 ++// this file and link it with other files to produce an executable, this
  406.96 ++// file does not by itself cause the resulting executable to be covered by
  406.97 ++// the GNU General Public License.  This exception does not however
  406.98 ++// invalidate any other reasons why the executable file might be covered by
  406.99 ++// the GNU General Public License.
 406.100 ++
 406.101 ++// Written by Jakub Jelinek <jakub@redhat.com>
 406.102 ++
 406.103 ++#include <bits/c++config.h>
 406.104 ++#include <clocale>
 406.105 ++
 406.106 ++#ifdef __UCLIBC_MJN3_ONLY__
 406.107 ++#warning clean this up
 406.108 ++#endif
 406.109 ++
 406.110 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.111 ++                                                  
 406.112 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 406.113 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 406.114 ++extern "C" __typeof(strftime_l) __strftime_l;
 406.115 ++extern "C" __typeof(strtod_l) __strtod_l;
 406.116 ++extern "C" __typeof(strtof_l) __strtof_l;
 406.117 ++extern "C" __typeof(strtold_l) __strtold_l;
 406.118 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 406.119 ++extern "C" __typeof(newlocale) __newlocale;
 406.120 ++extern "C" __typeof(freelocale) __freelocale;
 406.121 ++extern "C" __typeof(duplocale) __duplocale;
 406.122 ++extern "C" __typeof(uselocale) __uselocale;
 406.123 ++
 406.124 ++#ifdef _GLIBCXX_USE_WCHAR_T
 406.125 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 406.126 ++extern "C" __typeof(towlower_l) __towlower_l;
 406.127 ++extern "C" __typeof(towupper_l) __towupper_l;
 406.128 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 406.129 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 406.130 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 406.131 ++extern "C" __typeof(wctype_l) __wctype_l;
 406.132 ++#endif 
 406.133 ++
 406.134 ++#endif // GLIBC 2.3 and later
 406.135 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
 406.136 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
 406.137 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:35.000000000 +0200
 406.138 +@@ -0,0 +1,160 @@
 406.139 ++// Wrapper for underlying C-language localization -*- C++ -*-
 406.140 ++
 406.141 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 406.142 ++//
 406.143 ++// This file is part of the GNU ISO C++ Library.  This library is free
 406.144 ++// software; you can redistribute it and/or modify it under the
 406.145 ++// terms of the GNU General Public License as published by the
 406.146 ++// Free Software Foundation; either version 2, or (at your option)
 406.147 ++// any later version.
 406.148 ++
 406.149 ++// This library is distributed in the hope that it will be useful,
 406.150 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 406.151 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 406.152 ++// GNU General Public License for more details.
 406.153 ++
 406.154 ++// You should have received a copy of the GNU General Public License along
 406.155 ++// with this library; see the file COPYING.  If not, write to the Free
 406.156 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 406.157 ++// USA.
 406.158 ++
 406.159 ++// As a special exception, you may use this file as part of a free software
 406.160 ++// library without restriction.  Specifically, if other files instantiate
 406.161 ++// templates or use macros or inline functions from this file, or you compile
 406.162 ++// this file and link it with other files to produce an executable, this
 406.163 ++// file does not by itself cause the resulting executable to be covered by
 406.164 ++// the GNU General Public License.  This exception does not however
 406.165 ++// invalidate any other reasons why the executable file might be covered by
 406.166 ++// the GNU General Public License.
 406.167 ++
 406.168 ++//
 406.169 ++// ISO C++ 14882: 22.8  Standard locale categories.
 406.170 ++//
 406.171 ++
 406.172 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 406.173 ++
 406.174 ++#include <cerrno>  // For errno
 406.175 ++#include <locale>
 406.176 ++#include <stdexcept>
 406.177 ++#include <langinfo.h>
 406.178 ++#include <bits/c++locale_internal.h>
 406.179 ++
 406.180 ++#ifndef __UCLIBC_HAS_XLOCALE__
 406.181 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 406.182 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 406.183 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 406.184 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 406.185 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 406.186 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 406.187 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 406.188 ++#warning should dummy __newlocale check for C|POSIX ?
 406.189 ++#define __newlocale(a, b, c)        NULL
 406.190 ++#define __freelocale(a)             ((void)0)
 406.191 ++#define __duplocale(a)              __c_locale()
 406.192 ++#endif
 406.193 ++
 406.194 ++namespace std 
 406.195 ++{
 406.196 ++  template<>
 406.197 ++    void
 406.198 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 406.199 ++		   const __c_locale& __cloc)
 406.200 ++    {
 406.201 ++      if (!(__err & ios_base::failbit))
 406.202 ++	{
 406.203 ++	  char* __sanity;
 406.204 ++	  errno = 0;
 406.205 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
 406.206 ++          if (__sanity != __s && errno != ERANGE)
 406.207 ++	    __v = __f;
 406.208 ++	  else
 406.209 ++	    __err |= ios_base::failbit;
 406.210 ++	}
 406.211 ++    }
 406.212 ++
 406.213 ++  template<>
 406.214 ++    void
 406.215 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 406.216 ++		   const __c_locale& __cloc)
 406.217 ++    {
 406.218 ++      if (!(__err & ios_base::failbit))
 406.219 ++	{
 406.220 ++	  char* __sanity;
 406.221 ++	  errno = 0;
 406.222 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
 406.223 ++          if (__sanity != __s && errno != ERANGE)
 406.224 ++	    __v = __d;
 406.225 ++	  else
 406.226 ++	    __err |= ios_base::failbit;
 406.227 ++	}
 406.228 ++    }
 406.229 ++
 406.230 ++  template<>
 406.231 ++    void
 406.232 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 406.233 ++		   const __c_locale& __cloc)
 406.234 ++    {
 406.235 ++      if (!(__err & ios_base::failbit))
 406.236 ++	{
 406.237 ++	  char* __sanity;
 406.238 ++	  errno = 0;
 406.239 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 406.240 ++          if (__sanity != __s && errno != ERANGE)
 406.241 ++	    __v = __ld;
 406.242 ++	  else
 406.243 ++	    __err |= ios_base::failbit;
 406.244 ++	}
 406.245 ++    }
 406.246 ++
 406.247 ++  void
 406.248 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 406.249 ++				    __c_locale __old)
 406.250 ++  {
 406.251 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 406.252 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.253 ++    if (!__cloc)
 406.254 ++      {
 406.255 ++	// This named locale is not supported by the underlying OS.
 406.256 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 406.257 ++			      "name not valid"));
 406.258 ++      }
 406.259 ++#endif
 406.260 ++  }
 406.261 ++  
 406.262 ++  void
 406.263 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 406.264 ++  {
 406.265 ++    if (_S_get_c_locale() != __cloc)
 406.266 ++      __freelocale(__cloc); 
 406.267 ++  }
 406.268 ++
 406.269 ++  __c_locale
 406.270 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 406.271 ++  { return __duplocale(__cloc); }
 406.272 ++} // namespace std
 406.273 ++
 406.274 ++namespace __gnu_cxx
 406.275 ++{
 406.276 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 406.277 ++    {
 406.278 ++      "LC_CTYPE", 
 406.279 ++      "LC_NUMERIC",
 406.280 ++      "LC_TIME", 
 406.281 ++      "LC_COLLATE", 
 406.282 ++      "LC_MONETARY",
 406.283 ++      "LC_MESSAGES", 
 406.284 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 406.285 ++      "LC_PAPER", 
 406.286 ++      "LC_NAME", 
 406.287 ++      "LC_ADDRESS",
 406.288 ++      "LC_TELEPHONE", 
 406.289 ++      "LC_MEASUREMENT", 
 406.290 ++      "LC_IDENTIFICATION" 
 406.291 ++#endif
 406.292 ++    };
 406.293 ++}
 406.294 ++
 406.295 ++namespace std
 406.296 ++{
 406.297 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 406.298 ++}  // namespace std
 406.299 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
 406.300 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 406.301 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:35.000000000 +0200
 406.302 +@@ -0,0 +1,117 @@
 406.303 ++// Wrapper for underlying C-language localization -*- C++ -*-
 406.304 ++
 406.305 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 406.306 ++//
 406.307 ++// This file is part of the GNU ISO C++ Library.  This library is free
 406.308 ++// software; you can redistribute it and/or modify it under the
 406.309 ++// terms of the GNU General Public License as published by the
 406.310 ++// Free Software Foundation; either version 2, or (at your option)
 406.311 ++// any later version.
 406.312 ++
 406.313 ++// This library is distributed in the hope that it will be useful,
 406.314 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 406.315 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 406.316 ++// GNU General Public License for more details.
 406.317 ++
 406.318 ++// You should have received a copy of the GNU General Public License along
 406.319 ++// with this library; see the file COPYING.  If not, write to the Free
 406.320 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 406.321 ++// USA.
 406.322 ++
 406.323 ++// As a special exception, you may use this file as part of a free software
 406.324 ++// library without restriction.  Specifically, if other files instantiate
 406.325 ++// templates or use macros or inline functions from this file, or you compile
 406.326 ++// this file and link it with other files to produce an executable, this
 406.327 ++// file does not by itself cause the resulting executable to be covered by
 406.328 ++// the GNU General Public License.  This exception does not however
 406.329 ++// invalidate any other reasons why the executable file might be covered by
 406.330 ++// the GNU General Public License.
 406.331 ++
 406.332 ++//
 406.333 ++// ISO C++ 14882: 22.8  Standard locale categories.
 406.334 ++//
 406.335 ++
 406.336 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 406.337 ++
 406.338 ++#ifndef _C_LOCALE_H
 406.339 ++#define _C_LOCALE_H 1
 406.340 ++
 406.341 ++#pragma GCC system_header
 406.342 ++
 406.343 ++#include <cstring>              // get std::strlen
 406.344 ++#include <cstdio>               // get std::snprintf or std::sprintf
 406.345 ++#include <clocale>
 406.346 ++#include <langinfo.h>		// For codecvt
 406.347 ++#ifdef __UCLIBC_MJN3_ONLY__
 406.348 ++#warning fix this
 406.349 ++#endif
 406.350 ++#ifdef __UCLIBC_HAS_LOCALE__
 406.351 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 406.352 ++#endif
 406.353 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 406.354 ++#include <libintl.h> 		// For messages
 406.355 ++#endif
 406.356 ++
 406.357 ++#ifdef __UCLIBC_MJN3_ONLY__
 406.358 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 406.359 ++#endif
 406.360 ++#define _GLIBCXX_C_LOCALE_GNU 1
 406.361 ++
 406.362 ++#ifdef __UCLIBC_MJN3_ONLY__
 406.363 ++#warning fix categories
 406.364 ++#endif
 406.365 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 406.366 ++#define _GLIBCXX_NUM_CATEGORIES 0
 406.367 ++ 
 406.368 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.369 ++namespace __gnu_cxx
 406.370 ++{
 406.371 ++  extern "C" __typeof(uselocale) __uselocale;
 406.372 ++}
 406.373 ++#endif
 406.374 ++
 406.375 ++namespace std
 406.376 ++{
 406.377 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.378 ++  typedef __locale_t		__c_locale;
 406.379 ++#else
 406.380 ++  typedef int*			__c_locale;
 406.381 ++#endif
 406.382 ++
 406.383 ++  // Convert numeric value of type _Tv to string and return length of
 406.384 ++  // string.  If snprintf is available use it, otherwise fall back to
 406.385 ++  // the unsafe sprintf which, in general, can be dangerous and should
 406.386 ++  // be avoided.
 406.387 ++  template<typename _Tv>
 406.388 ++    int
 406.389 ++    __convert_from_v(char* __out, 
 406.390 ++		     const int __size __attribute__ ((__unused__)),
 406.391 ++		     const char* __fmt,
 406.392 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 406.393 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 406.394 ++    {
 406.395 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 406.396 ++#else
 406.397 ++		     _Tv __v, const __c_locale&, int __prec)
 406.398 ++    {
 406.399 ++# ifdef __UCLIBC_HAS_LOCALE__
 406.400 ++      char* __old = std::setlocale(LC_ALL, NULL);
 406.401 ++      char* __sav = new char[std::strlen(__old) + 1];
 406.402 ++      std::strcpy(__sav, __old);
 406.403 ++      std::setlocale(LC_ALL, "C");
 406.404 ++# endif
 406.405 ++#endif
 406.406 ++
 406.407 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 406.408 ++
 406.409 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 406.410 ++      __gnu_cxx::__uselocale(__old);
 406.411 ++#elif defined __UCLIBC_HAS_LOCALE__
 406.412 ++      std::setlocale(LC_ALL, __sav);
 406.413 ++      delete [] __sav;
 406.414 ++#endif
 406.415 ++      return __ret;
 406.416 ++    }
 406.417 ++}
 406.418 ++
 406.419 ++#endif
 406.420 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 406.421 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 406.422 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2008-06-10 14:45:35.000000000 +0200
 406.423 +@@ -0,0 +1,306 @@
 406.424 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 406.425 ++
 406.426 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 406.427 ++//
 406.428 ++// This file is part of the GNU ISO C++ Library.  This library is free
 406.429 ++// software; you can redistribute it and/or modify it under the
 406.430 ++// terms of the GNU General Public License as published by the
 406.431 ++// Free Software Foundation; either version 2, or (at your option)
 406.432 ++// any later version.
 406.433 ++
 406.434 ++// This library is distributed in the hope that it will be useful,
 406.435 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 406.436 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 406.437 ++// GNU General Public License for more details.
 406.438 ++
 406.439 ++// You should have received a copy of the GNU General Public License along
 406.440 ++// with this library; see the file COPYING.  If not, write to the Free
 406.441 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 406.442 ++// USA.
 406.443 ++
 406.444 ++// As a special exception, you may use this file as part of a free software
 406.445 ++// library without restriction.  Specifically, if other files instantiate
 406.446 ++// templates or use macros or inline functions from this file, or you compile
 406.447 ++// this file and link it with other files to produce an executable, this
 406.448 ++// file does not by itself cause the resulting executable to be covered by
 406.449 ++// the GNU General Public License.  This exception does not however
 406.450 ++// invalidate any other reasons why the executable file might be covered by
 406.451 ++// the GNU General Public License.
 406.452 ++
 406.453 ++//
 406.454 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 406.455 ++//
 406.456 ++
 406.457 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 406.458 ++
 406.459 ++#include <locale>
 406.460 ++#include <bits/c++locale_internal.h>
 406.461 ++
 406.462 ++namespace std
 406.463 ++{
 406.464 ++  // Specializations.
 406.465 ++#ifdef _GLIBCXX_USE_WCHAR_T
 406.466 ++  codecvt_base::result
 406.467 ++  codecvt<wchar_t, char, mbstate_t>::
 406.468 ++  do_out(state_type& __state, const intern_type* __from, 
 406.469 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 406.470 ++	 extern_type* __to, extern_type* __to_end,
 406.471 ++	 extern_type*& __to_next) const
 406.472 ++  {
 406.473 ++    result __ret = ok;
 406.474 ++    state_type __tmp_state(__state);
 406.475 ++
 406.476 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.477 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 406.478 ++#endif
 406.479 ++
 406.480 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 406.481 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 406.482 ++    // NB: wcsnrtombs is a GNU extension
 406.483 ++    for (__from_next = __from, __to_next = __to;
 406.484 ++	 __from_next < __from_end && __to_next < __to_end
 406.485 ++	 && __ret == ok;)
 406.486 ++      {
 406.487 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 406.488 ++						      __from_end - __from_next);
 406.489 ++	if (!__from_chunk_end)
 406.490 ++	  __from_chunk_end = __from_end;
 406.491 ++
 406.492 ++	__from = __from_next;
 406.493 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 406.494 ++					 __from_chunk_end - __from_next,
 406.495 ++					 __to_end - __to_next, &__state);
 406.496 ++	if (__conv == static_cast<size_t>(-1))
 406.497 ++	  {
 406.498 ++	    // In case of error, in order to stop at the exact place we
 406.499 ++	    // have to start again from the beginning with a series of
 406.500 ++	    // wcrtomb.
 406.501 ++	    for (; __from < __from_next; ++__from)
 406.502 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 406.503 ++	    __state = __tmp_state;
 406.504 ++	    __ret = error;
 406.505 ++	  }
 406.506 ++	else if (__from_next && __from_next < __from_chunk_end)
 406.507 ++	  {
 406.508 ++	    __to_next += __conv;
 406.509 ++	    __ret = partial;
 406.510 ++	  }
 406.511 ++	else
 406.512 ++	  {
 406.513 ++	    __from_next = __from_chunk_end;
 406.514 ++	    __to_next += __conv;
 406.515 ++	  }
 406.516 ++
 406.517 ++	if (__from_next < __from_end && __ret == ok)
 406.518 ++	  {
 406.519 ++	    extern_type __buf[MB_LEN_MAX];
 406.520 ++	    __tmp_state = __state;
 406.521 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 406.522 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 406.523 ++	      __ret = partial;
 406.524 ++	    else
 406.525 ++	      {
 406.526 ++		memcpy(__to_next, __buf, __conv);
 406.527 ++		__state = __tmp_state;
 406.528 ++		__to_next += __conv;
 406.529 ++		++__from_next;
 406.530 ++	      }
 406.531 ++	  }
 406.532 ++      }
 406.533 ++
 406.534 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.535 ++    __uselocale(__old);
 406.536 ++#endif
 406.537 ++
 406.538 ++    return __ret; 
 406.539 ++  }
 406.540 ++  
 406.541 ++  codecvt_base::result
 406.542 ++  codecvt<wchar_t, char, mbstate_t>::
 406.543 ++  do_in(state_type& __state, const extern_type* __from, 
 406.544 ++	const extern_type* __from_end, const extern_type*& __from_next,
 406.545 ++	intern_type* __to, intern_type* __to_end,
 406.546 ++	intern_type*& __to_next) const
 406.547 ++  {
 406.548 ++    result __ret = ok;
 406.549 ++    state_type __tmp_state(__state);
 406.550 ++
 406.551 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.552 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 406.553 ++#endif
 406.554 ++
 406.555 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 406.556 ++    // in case we store a L'\0' and then continue, in a loop.
 406.557 ++    // NB: mbsnrtowcs is a GNU extension
 406.558 ++    for (__from_next = __from, __to_next = __to;
 406.559 ++	 __from_next < __from_end && __to_next < __to_end
 406.560 ++	 && __ret == ok;)
 406.561 ++      {
 406.562 ++	const extern_type* __from_chunk_end;
 406.563 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 406.564 ++								  __from_end
 406.565 ++								  - __from_next));
 406.566 ++	if (!__from_chunk_end)
 406.567 ++	  __from_chunk_end = __from_end;
 406.568 ++
 406.569 ++	__from = __from_next;
 406.570 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 406.571 ++				   __from_chunk_end - __from_next,
 406.572 ++				   __to_end - __to_next, &__state);
 406.573 ++	if (__conv == static_cast<size_t>(-1))
 406.574 ++	  {
 406.575 ++	    // In case of error, in order to stop at the exact place we
 406.576 ++	    // have to start again from the beginning with a series of
 406.577 ++	    // mbrtowc.
 406.578 ++	    for (;; ++__to_next, __from += __conv)
 406.579 ++	      {
 406.580 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 406.581 ++				 &__tmp_state);
 406.582 ++		if (__conv == static_cast<size_t>(-1)
 406.583 ++		    || __conv == static_cast<size_t>(-2))
 406.584 ++		  break;
 406.585 ++	      }
 406.586 ++	    __from_next = __from;
 406.587 ++	    __state = __tmp_state;	    
 406.588 ++	    __ret = error;
 406.589 ++	  }
 406.590 ++	else if (__from_next && __from_next < __from_chunk_end)
 406.591 ++	  {
 406.592 ++	    // It is unclear what to return in this case (see DR 382). 
 406.593 ++	    __to_next += __conv;
 406.594 ++	    __ret = partial;
 406.595 ++	  }
 406.596 ++	else
 406.597 ++	  {
 406.598 ++	    __from_next = __from_chunk_end;
 406.599 ++	    __to_next += __conv;
 406.600 ++	  }
 406.601 ++
 406.602 ++	if (__from_next < __from_end && __ret == ok)
 406.603 ++	  {
 406.604 ++	    if (__to_next < __to_end)
 406.605 ++	      {
 406.606 ++		// XXX Probably wrong for stateful encodings
 406.607 ++		__tmp_state = __state;		
 406.608 ++		++__from_next;
 406.609 ++		*__to_next++ = L'\0';
 406.610 ++	      }
 406.611 ++	    else
 406.612 ++	      __ret = partial;
 406.613 ++	  }
 406.614 ++      }
 406.615 ++
 406.616 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.617 ++    __uselocale(__old);
 406.618 ++#endif
 406.619 ++
 406.620 ++    return __ret; 
 406.621 ++  }
 406.622 ++
 406.623 ++  int 
 406.624 ++  codecvt<wchar_t, char, mbstate_t>::
 406.625 ++  do_encoding() const throw()
 406.626 ++  {
 406.627 ++    // XXX This implementation assumes that the encoding is
 406.628 ++    // stateless and is either single-byte or variable-width.
 406.629 ++    int __ret = 0;
 406.630 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.631 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 406.632 ++#endif
 406.633 ++    if (MB_CUR_MAX == 1)
 406.634 ++      __ret = 1;
 406.635 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.636 ++    __uselocale(__old);
 406.637 ++#endif
 406.638 ++    return __ret;
 406.639 ++  }  
 406.640 ++
 406.641 ++  int 
 406.642 ++  codecvt<wchar_t, char, mbstate_t>::
 406.643 ++  do_max_length() const throw()
 406.644 ++  {
 406.645 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.646 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 406.647 ++#endif
 406.648 ++    // XXX Probably wrong for stateful encodings.
 406.649 ++    int __ret = MB_CUR_MAX;
 406.650 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.651 ++    __uselocale(__old);
 406.652 ++#endif
 406.653 ++    return __ret;
 406.654 ++  }
 406.655 ++  
 406.656 ++  int 
 406.657 ++  codecvt<wchar_t, char, mbstate_t>::
 406.658 ++  do_length(state_type& __state, const extern_type* __from,
 406.659 ++	    const extern_type* __end, size_t __max) const
 406.660 ++  {
 406.661 ++    int __ret = 0;
 406.662 ++    state_type __tmp_state(__state);
 406.663 ++
 406.664 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.665 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 406.666 ++#endif
 406.667 ++
 406.668 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 406.669 ++    // in case we advance past it and then continue, in a loop.
 406.670 ++    // NB: mbsnrtowcs is a GNU extension
 406.671 ++  
 406.672 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 406.673 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 406.674 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 406.675 ++							   * __max));
 406.676 ++    while (__from < __end && __max)
 406.677 ++      {
 406.678 ++	const extern_type* __from_chunk_end;
 406.679 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 406.680 ++								  __end
 406.681 ++								  - __from));
 406.682 ++	if (!__from_chunk_end)
 406.683 ++	  __from_chunk_end = __end;
 406.684 ++
 406.685 ++	const extern_type* __tmp_from = __from;
 406.686 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 406.687 ++				   __from_chunk_end - __from,
 406.688 ++				   __max, &__state);
 406.689 ++	if (__conv == static_cast<size_t>(-1))
 406.690 ++	  {
 406.691 ++	    // In case of error, in order to stop at the exact place we
 406.692 ++	    // have to start again from the beginning with a series of
 406.693 ++	    // mbrtowc.
 406.694 ++	    for (__from = __tmp_from;; __from += __conv)
 406.695 ++	      {
 406.696 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 406.697 ++				 &__tmp_state);
 406.698 ++		if (__conv == static_cast<size_t>(-1)
 406.699 ++		    || __conv == static_cast<size_t>(-2))
 406.700 ++		  break;
 406.701 ++	      }
 406.702 ++	    __state = __tmp_state;
 406.703 ++	    __ret += __from - __tmp_from;
 406.704 ++	    break;
 406.705 ++	  }
 406.706 ++	if (!__from)
 406.707 ++	  __from = __from_chunk_end;
 406.708 ++	
 406.709 ++	__ret += __from - __tmp_from;
 406.710 ++	__max -= __conv;
 406.711 ++
 406.712 ++	if (__from < __end && __max)
 406.713 ++	  {
 406.714 ++	    // XXX Probably wrong for stateful encodings
 406.715 ++	    __tmp_state = __state;
 406.716 ++	    ++__from;
 406.717 ++	    ++__ret;
 406.718 ++	    --__max;
 406.719 ++	  }
 406.720 ++      }
 406.721 ++
 406.722 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.723 ++    __uselocale(__old);
 406.724 ++#endif
 406.725 ++
 406.726 ++    return __ret; 
 406.727 ++  }
 406.728 ++#endif
 406.729 ++}
 406.730 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
 406.731 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 406.732 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:35.000000000 +0200
 406.733 +@@ -0,0 +1,80 @@
 406.734 ++// std::collate implementation details, GNU version -*- C++ -*-
 406.735 ++
 406.736 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 406.737 ++//
 406.738 ++// This file is part of the GNU ISO C++ Library.  This library is free
 406.739 ++// software; you can redistribute it and/or modify it under the
 406.740 ++// terms of the GNU General Public License as published by the
 406.741 ++// Free Software Foundation; either version 2, or (at your option)
 406.742 ++// any later version.
 406.743 ++
 406.744 ++// This library is distributed in the hope that it will be useful,
 406.745 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 406.746 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 406.747 ++// GNU General Public License for more details.
 406.748 ++
 406.749 ++// You should have received a copy of the GNU General Public License along
 406.750 ++// with this library; see the file COPYING.  If not, write to the Free
 406.751 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 406.752 ++// USA.
 406.753 ++
 406.754 ++// As a special exception, you may use this file as part of a free software
 406.755 ++// library without restriction.  Specifically, if other files instantiate
 406.756 ++// templates or use macros or inline functions from this file, or you compile
 406.757 ++// this file and link it with other files to produce an executable, this
 406.758 ++// file does not by itself cause the resulting executable to be covered by
 406.759 ++// the GNU General Public License.  This exception does not however
 406.760 ++// invalidate any other reasons why the executable file might be covered by
 406.761 ++// the GNU General Public License.
 406.762 ++
 406.763 ++//
 406.764 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 406.765 ++//
 406.766 ++
 406.767 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 406.768 ++
 406.769 ++#include <locale>
 406.770 ++#include <bits/c++locale_internal.h>
 406.771 ++
 406.772 ++#ifndef __UCLIBC_HAS_XLOCALE__
 406.773 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 406.774 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 406.775 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 406.776 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 406.777 ++#endif
 406.778 ++
 406.779 ++namespace std
 406.780 ++{
 406.781 ++  // These are basically extensions to char_traits, and perhaps should
 406.782 ++  // be put there instead of here.
 406.783 ++  template<>
 406.784 ++    int 
 406.785 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 406.786 ++    { 
 406.787 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 406.788 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 406.789 ++    }
 406.790 ++  
 406.791 ++  template<>
 406.792 ++    size_t
 406.793 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 406.794 ++				size_t __n) const 
 406.795 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 406.796 ++
 406.797 ++#ifdef _GLIBCXX_USE_WCHAR_T
 406.798 ++  template<>
 406.799 ++    int 
 406.800 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 406.801 ++				 const wchar_t* __two) const
 406.802 ++    {
 406.803 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 406.804 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 406.805 ++    }
 406.806 ++  
 406.807 ++  template<>
 406.808 ++    size_t
 406.809 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 406.810 ++				   size_t __n) const
 406.811 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 406.812 ++#endif
 406.813 ++}
 406.814 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 406.815 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 406.816 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:35.000000000 +0200
 406.817 +@@ -0,0 +1,300 @@
 406.818 ++// std::ctype implementation details, GNU version -*- C++ -*-
 406.819 ++
 406.820 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 406.821 ++//
 406.822 ++// This file is part of the GNU ISO C++ Library.  This library is free
 406.823 ++// software; you can redistribute it and/or modify it under the
 406.824 ++// terms of the GNU General Public License as published by the
 406.825 ++// Free Software Foundation; either version 2, or (at your option)
 406.826 ++// any later version.
 406.827 ++
 406.828 ++// This library is distributed in the hope that it will be useful,
 406.829 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 406.830 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 406.831 ++// GNU General Public License for more details.
 406.832 ++
 406.833 ++// You should have received a copy of the GNU General Public License along
 406.834 ++// with this library; see the file COPYING.  If not, write to the Free
 406.835 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 406.836 ++// USA.
 406.837 ++
 406.838 ++// As a special exception, you may use this file as part of a free software
 406.839 ++// library without restriction.  Specifically, if other files instantiate
 406.840 ++// templates or use macros or inline functions from this file, or you compile
 406.841 ++// this file and link it with other files to produce an executable, this
 406.842 ++// file does not by itself cause the resulting executable to be covered by
 406.843 ++// the GNU General Public License.  This exception does not however
 406.844 ++// invalidate any other reasons why the executable file might be covered by
 406.845 ++// the GNU General Public License.
 406.846 ++
 406.847 ++//
 406.848 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 406.849 ++//
 406.850 ++
 406.851 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 406.852 ++
 406.853 ++#define _LIBC
 406.854 ++#include <locale>
 406.855 ++#undef _LIBC
 406.856 ++#include <bits/c++locale_internal.h>
 406.857 ++
 406.858 ++#ifndef __UCLIBC_HAS_XLOCALE__
 406.859 ++#define __wctype_l(S, L)           wctype((S))
 406.860 ++#define __towupper_l(C, L)         towupper((C))
 406.861 ++#define __towlower_l(C, L)         towlower((C))
 406.862 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 406.863 ++#endif
 406.864 ++
 406.865 ++namespace std
 406.866 ++{
 406.867 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 406.868 ++  // various /config/os/* files.
 406.869 ++  template<>
 406.870 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 406.871 ++    : ctype<char>(0, false, __refs) 
 406.872 ++    { 		
 406.873 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 406.874 ++	{
 406.875 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 406.876 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 406.877 ++#ifdef __UCLIBC_HAS_XLOCALE__
 406.878 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 406.879 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 406.880 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 406.881 ++#endif
 406.882 ++	}
 406.883 ++    }
 406.884 ++
 406.885 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 406.886 ++  ctype<wchar_t>::__wmask_type
 406.887 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 406.888 ++  {
 406.889 ++    __wmask_type __ret;
 406.890 ++    switch (__m)
 406.891 ++      {
 406.892 ++      case space:
 406.893 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 406.894 ++	break;
 406.895 ++      case print:
 406.896 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 406.897 ++	break;
 406.898 ++      case cntrl:
 406.899 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 406.900 ++	break;
 406.901 ++      case upper:
 406.902 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 406.903 ++	break;
 406.904 ++      case lower:
 406.905 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 406.906 ++	break;
 406.907 ++      case alpha:
 406.908 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 406.909 ++	break;
 406.910 ++      case digit:
 406.911 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 406.912 ++	break;
 406.913 ++      case punct:
 406.914 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 406.915 ++	break;
 406.916 ++      case xdigit:
 406.917 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 406.918 ++	break;
 406.919 ++      case alnum:
 406.920 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 406.921 ++	break;
 406.922 ++      case graph:
 406.923 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 406.924 ++	break;
 406.925 ++      default:
 406.926 ++	__ret = __wmask_type();
 406.927 ++      }
 406.928 ++    return __ret;
 406.929 ++  }
 406.930 ++  
 406.931 ++  wchar_t
 406.932 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 406.933 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 406.934 ++
 406.935 ++  const wchar_t*
 406.936 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 406.937 ++  {
 406.938 ++    while (__lo < __hi)
 406.939 ++      {
 406.940 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 406.941 ++        ++__lo;
 406.942 ++      }
 406.943 ++    return __hi;
 406.944 ++  }
 406.945 ++  
 406.946 ++  wchar_t
 406.947 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 406.948 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 406.949 ++  
 406.950 ++  const wchar_t*
 406.951 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 406.952 ++  {
 406.953 ++    while (__lo < __hi)
 406.954 ++      {
 406.955 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 406.956 ++        ++__lo;
 406.957 ++      }
 406.958 ++    return __hi;
 406.959 ++  }
 406.960 ++
 406.961 ++  bool
 406.962 ++  ctype<wchar_t>::
 406.963 ++  do_is(mask __m, wchar_t __c) const
 406.964 ++  { 
 406.965 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
 406.966 ++    // library for blank.
 406.967 ++    bool __ret = false;
 406.968 ++    const size_t __bitmasksize = 11; 
 406.969 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 406.970 ++      if (__m & _M_bit[__bitcur]
 406.971 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 406.972 ++	{
 406.973 ++	  __ret = true;
 406.974 ++	  break;
 406.975 ++	}
 406.976 ++    return __ret;    
 406.977 ++  }
 406.978 ++  
 406.979 ++  const wchar_t* 
 406.980 ++  ctype<wchar_t>::
 406.981 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 406.982 ++  {
 406.983 ++    for (; __lo < __hi; ++__vec, ++__lo)
 406.984 ++      {
 406.985 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 406.986 ++	// library for blank.
 406.987 ++	const size_t __bitmasksize = 11; 
 406.988 ++	mask __m = 0;
 406.989 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 406.990 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 406.991 ++	    __m |= _M_bit[__bitcur];
 406.992 ++	*__vec = __m;
 406.993 ++      }
 406.994 ++    return __hi;
 406.995 ++  }
 406.996 ++  
 406.997 ++  const wchar_t* 
 406.998 ++  ctype<wchar_t>::
 406.999 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
406.1000 ++  {
406.1001 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
406.1002 ++      ++__lo;
406.1003 ++    return __lo;
406.1004 ++  }
406.1005 ++
406.1006 ++  const wchar_t*
406.1007 ++  ctype<wchar_t>::
406.1008 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
406.1009 ++  {
406.1010 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
406.1011 ++      ++__lo;
406.1012 ++    return __lo;
406.1013 ++  }
406.1014 ++
406.1015 ++  wchar_t
406.1016 ++  ctype<wchar_t>::
406.1017 ++  do_widen(char __c) const
406.1018 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
406.1019 ++
406.1020 ++  const char* 
406.1021 ++  ctype<wchar_t>::
406.1022 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
406.1023 ++  {
406.1024 ++    while (__lo < __hi)
406.1025 ++      {
406.1026 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
406.1027 ++	++__lo;
406.1028 ++	++__dest;
406.1029 ++      }
406.1030 ++    return __hi;
406.1031 ++  }
406.1032 ++
406.1033 ++  char
406.1034 ++  ctype<wchar_t>::
406.1035 ++  do_narrow(wchar_t __wc, char __dfault) const
406.1036 ++  {
406.1037 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
406.1038 ++      return _M_narrow[__wc];
406.1039 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1040 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
406.1041 ++#endif
406.1042 ++    const int __c = wctob(__wc);
406.1043 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1044 ++    __uselocale(__old);
406.1045 ++#endif
406.1046 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
406.1047 ++  }
406.1048 ++
406.1049 ++  const wchar_t*
406.1050 ++  ctype<wchar_t>::
406.1051 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
406.1052 ++	    char* __dest) const
406.1053 ++  {
406.1054 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1055 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
406.1056 ++#endif
406.1057 ++    if (_M_narrow_ok)
406.1058 ++      while (__lo < __hi)
406.1059 ++	{
406.1060 ++	  if (*__lo >= 0 && *__lo < 128)
406.1061 ++	    *__dest = _M_narrow[*__lo];
406.1062 ++	  else
406.1063 ++	    {
406.1064 ++	      const int __c = wctob(*__lo);
406.1065 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
406.1066 ++	    }
406.1067 ++	  ++__lo;
406.1068 ++	  ++__dest;
406.1069 ++	}
406.1070 ++    else
406.1071 ++      while (__lo < __hi)
406.1072 ++	{
406.1073 ++	  const int __c = wctob(*__lo);
406.1074 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
406.1075 ++	  ++__lo;
406.1076 ++	  ++__dest;
406.1077 ++	}
406.1078 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1079 ++    __uselocale(__old);
406.1080 ++#endif
406.1081 ++    return __hi;
406.1082 ++  }
406.1083 ++
406.1084 ++  void
406.1085 ++  ctype<wchar_t>::_M_initialize_ctype()
406.1086 ++  {
406.1087 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1088 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
406.1089 ++#endif
406.1090 ++    wint_t __i;
406.1091 ++    for (__i = 0; __i < 128; ++__i)
406.1092 ++      {
406.1093 ++	const int __c = wctob(__i);
406.1094 ++	if (__c == EOF)
406.1095 ++	  break;
406.1096 ++	else
406.1097 ++	  _M_narrow[__i] = static_cast<char>(__c);
406.1098 ++      }
406.1099 ++    if (__i == 128)
406.1100 ++      _M_narrow_ok = true;
406.1101 ++    else
406.1102 ++      _M_narrow_ok = false;
406.1103 ++    for (size_t __j = 0;
406.1104 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
406.1105 ++      _M_widen[__j] = btowc(__j);
406.1106 ++
406.1107 ++    for (size_t __k = 0; __k <= 11; ++__k)
406.1108 ++      { 
406.1109 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
406.1110 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
406.1111 ++      }
406.1112 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1113 ++    __uselocale(__old);
406.1114 ++#endif
406.1115 ++  }
406.1116 ++#endif //  _GLIBCXX_USE_WCHAR_T
406.1117 ++}
406.1118 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
406.1119 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
406.1120 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:35.000000000 +0200
406.1121 +@@ -0,0 +1,100 @@
406.1122 ++// std::messages implementation details, GNU version -*- C++ -*-
406.1123 ++
406.1124 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
406.1125 ++//
406.1126 ++// This file is part of the GNU ISO C++ Library.  This library is free
406.1127 ++// software; you can redistribute it and/or modify it under the
406.1128 ++// terms of the GNU General Public License as published by the
406.1129 ++// Free Software Foundation; either version 2, or (at your option)
406.1130 ++// any later version.
406.1131 ++
406.1132 ++// This library is distributed in the hope that it will be useful,
406.1133 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
406.1134 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
406.1135 ++// GNU General Public License for more details.
406.1136 ++
406.1137 ++// You should have received a copy of the GNU General Public License along
406.1138 ++// with this library; see the file COPYING.  If not, write to the Free
406.1139 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
406.1140 ++// USA.
406.1141 ++
406.1142 ++// As a special exception, you may use this file as part of a free software
406.1143 ++// library without restriction.  Specifically, if other files instantiate
406.1144 ++// templates or use macros or inline functions from this file, or you compile
406.1145 ++// this file and link it with other files to produce an executable, this
406.1146 ++// file does not by itself cause the resulting executable to be covered by
406.1147 ++// the GNU General Public License.  This exception does not however
406.1148 ++// invalidate any other reasons why the executable file might be covered by
406.1149 ++// the GNU General Public License.
406.1150 ++
406.1151 ++//
406.1152 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
406.1153 ++//
406.1154 ++
406.1155 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
406.1156 ++
406.1157 ++#include <locale>
406.1158 ++#include <bits/c++locale_internal.h>
406.1159 ++
406.1160 ++#ifdef __UCLIBC_MJN3_ONLY__
406.1161 ++#warning fix gettext stuff
406.1162 ++#endif
406.1163 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
406.1164 ++extern "C" char *__dcgettext(const char *domainname,
406.1165 ++			     const char *msgid, int category);
406.1166 ++#undef gettext
406.1167 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
406.1168 ++#else
406.1169 ++#undef gettext
406.1170 ++#define gettext(msgid) (msgid)
406.1171 ++#endif
406.1172 ++
406.1173 ++namespace std
406.1174 ++{
406.1175 ++  // Specializations.
406.1176 ++  template<>
406.1177 ++    string
406.1178 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
406.1179 ++    {
406.1180 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1181 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
406.1182 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
406.1183 ++      __uselocale(__old);
406.1184 ++      return string(__msg);
406.1185 ++#elif defined __UCLIBC_HAS_LOCALE__
406.1186 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
406.1187 ++      setlocale(LC_ALL, _M_name_messages);
406.1188 ++      const char* __msg = gettext(__dfault.c_str());
406.1189 ++      setlocale(LC_ALL, __old);
406.1190 ++      free(__old);
406.1191 ++      return string(__msg);
406.1192 ++#else
406.1193 ++      const char* __msg = gettext(__dfault.c_str());
406.1194 ++      return string(__msg);
406.1195 ++#endif
406.1196 ++    }
406.1197 ++
406.1198 ++#ifdef _GLIBCXX_USE_WCHAR_T
406.1199 ++  template<>
406.1200 ++    wstring
406.1201 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
406.1202 ++    {
406.1203 ++# ifdef __UCLIBC_HAS_XLOCALE__
406.1204 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
406.1205 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
406.1206 ++      __uselocale(__old);
406.1207 ++      return _M_convert_from_char(__msg);
406.1208 ++# elif defined __UCLIBC_HAS_LOCALE__
406.1209 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
406.1210 ++      setlocale(LC_ALL, _M_name_messages);
406.1211 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
406.1212 ++      setlocale(LC_ALL, __old);
406.1213 ++      free(__old);
406.1214 ++      return _M_convert_from_char(__msg);
406.1215 ++# else
406.1216 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
406.1217 ++      return _M_convert_from_char(__msg);
406.1218 ++# endif
406.1219 ++    }
406.1220 ++#endif
406.1221 ++}
406.1222 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
406.1223 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
406.1224 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:35.000000000 +0200
406.1225 +@@ -0,0 +1,118 @@
406.1226 ++// std::messages implementation details, GNU version -*- C++ -*-
406.1227 ++
406.1228 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
406.1229 ++//
406.1230 ++// This file is part of the GNU ISO C++ Library.  This library is free
406.1231 ++// software; you can redistribute it and/or modify it under the
406.1232 ++// terms of the GNU General Public License as published by the
406.1233 ++// Free Software Foundation; either version 2, or (at your option)
406.1234 ++// any later version.
406.1235 ++
406.1236 ++// This library is distributed in the hope that it will be useful,
406.1237 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
406.1238 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
406.1239 ++// GNU General Public License for more details.
406.1240 ++
406.1241 ++// You should have received a copy of the GNU General Public License along
406.1242 ++// with this library; see the file COPYING.  If not, write to the Free
406.1243 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
406.1244 ++// USA.
406.1245 ++
406.1246 ++// As a special exception, you may use this file as part of a free software
406.1247 ++// library without restriction.  Specifically, if other files instantiate
406.1248 ++// templates or use macros or inline functions from this file, or you compile
406.1249 ++// this file and link it with other files to produce an executable, this
406.1250 ++// file does not by itself cause the resulting executable to be covered by
406.1251 ++// the GNU General Public License.  This exception does not however
406.1252 ++// invalidate any other reasons why the executable file might be covered by
406.1253 ++// the GNU General Public License.
406.1254 ++
406.1255 ++//
406.1256 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
406.1257 ++//
406.1258 ++
406.1259 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
406.1260 ++
406.1261 ++#ifdef __UCLIBC_MJN3_ONLY__
406.1262 ++#warning fix prototypes for *textdomain funcs
406.1263 ++#endif
406.1264 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
406.1265 ++extern "C" char *__textdomain(const char *domainname);
406.1266 ++extern "C" char *__bindtextdomain(const char *domainname,
406.1267 ++				  const char *dirname);
406.1268 ++#else
406.1269 ++#undef __textdomain
406.1270 ++#undef __bindtextdomain
406.1271 ++#define __textdomain(D)           ((void)0)
406.1272 ++#define __bindtextdomain(D,P)     ((void)0)
406.1273 ++#endif
406.1274 ++
406.1275 ++  // Non-virtual member functions.
406.1276 ++  template<typename _CharT>
406.1277 ++     messages<_CharT>::messages(size_t __refs)
406.1278 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
406.1279 ++     _M_name_messages(_S_get_c_name())
406.1280 ++     { }
406.1281 ++
406.1282 ++  template<typename _CharT>
406.1283 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
406.1284 ++				size_t __refs) 
406.1285 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
406.1286 ++     _M_name_messages(__s)
406.1287 ++     {
406.1288 ++       char* __tmp = new char[std::strlen(__s) + 1];
406.1289 ++       std::strcpy(__tmp, __s);
406.1290 ++       _M_name_messages = __tmp;
406.1291 ++     }
406.1292 ++
406.1293 ++  template<typename _CharT>
406.1294 ++    typename messages<_CharT>::catalog 
406.1295 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
406.1296 ++			   const char* __dir) const
406.1297 ++    { 
406.1298 ++      __bindtextdomain(__s.c_str(), __dir);
406.1299 ++      return this->do_open(__s, __loc); 
406.1300 ++    }
406.1301 ++
406.1302 ++  // Virtual member functions.
406.1303 ++  template<typename _CharT>
406.1304 ++    messages<_CharT>::~messages()
406.1305 ++    { 
406.1306 ++      if (_M_name_messages != _S_get_c_name())
406.1307 ++	delete [] _M_name_messages;
406.1308 ++      _S_destroy_c_locale(_M_c_locale_messages); 
406.1309 ++    }
406.1310 ++
406.1311 ++  template<typename _CharT>
406.1312 ++    typename messages<_CharT>::catalog 
406.1313 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
406.1314 ++			      const locale&) const
406.1315 ++    { 
406.1316 ++      // No error checking is done, assume the catalog exists and can
406.1317 ++      // be used.
406.1318 ++      __textdomain(__s.c_str());
406.1319 ++      return 0;
406.1320 ++    }
406.1321 ++
406.1322 ++  template<typename _CharT>
406.1323 ++    void    
406.1324 ++    messages<_CharT>::do_close(catalog) const 
406.1325 ++    { }
406.1326 ++
406.1327 ++   // messages_byname
406.1328 ++   template<typename _CharT>
406.1329 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
406.1330 ++     : messages<_CharT>(__refs) 
406.1331 ++     { 
406.1332 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
406.1333 ++	 delete [] this->_M_name_messages;
406.1334 ++       char* __tmp = new char[std::strlen(__s) + 1];
406.1335 ++       std::strcpy(__tmp, __s);
406.1336 ++       this->_M_name_messages = __tmp;
406.1337 ++
406.1338 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
406.1339 ++	 {
406.1340 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
406.1341 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
406.1342 ++	 }
406.1343 ++     }
406.1344 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
406.1345 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
406.1346 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:35.000000000 +0200
406.1347 +@@ -0,0 +1,692 @@
406.1348 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
406.1349 ++
406.1350 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
406.1351 ++//
406.1352 ++// This file is part of the GNU ISO C++ Library.  This library is free
406.1353 ++// software; you can redistribute it and/or modify it under the
406.1354 ++// terms of the GNU General Public License as published by the
406.1355 ++// Free Software Foundation; either version 2, or (at your option)
406.1356 ++// any later version.
406.1357 ++
406.1358 ++// This library is distributed in the hope that it will be useful,
406.1359 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
406.1360 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
406.1361 ++// GNU General Public License for more details.
406.1362 ++
406.1363 ++// You should have received a copy of the GNU General Public License along
406.1364 ++// with this library; see the file COPYING.  If not, write to the Free
406.1365 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
406.1366 ++// USA.
406.1367 ++
406.1368 ++// As a special exception, you may use this file as part of a free software
406.1369 ++// library without restriction.  Specifically, if other files instantiate
406.1370 ++// templates or use macros or inline functions from this file, or you compile
406.1371 ++// this file and link it with other files to produce an executable, this
406.1372 ++// file does not by itself cause the resulting executable to be covered by
406.1373 ++// the GNU General Public License.  This exception does not however
406.1374 ++// invalidate any other reasons why the executable file might be covered by
406.1375 ++// the GNU General Public License.
406.1376 ++
406.1377 ++//
406.1378 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
406.1379 ++//
406.1380 ++
406.1381 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
406.1382 ++
406.1383 ++#define _LIBC
406.1384 ++#include <locale>
406.1385 ++#undef _LIBC
406.1386 ++#include <bits/c++locale_internal.h>
406.1387 ++
406.1388 ++#ifdef __UCLIBC_MJN3_ONLY__
406.1389 ++#warning optimize this for uclibc
406.1390 ++#warning tailor for stub locale support
406.1391 ++#endif
406.1392 ++
406.1393 ++#ifndef __UCLIBC_HAS_XLOCALE__
406.1394 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
406.1395 ++#endif
406.1396 ++
406.1397 ++namespace std
406.1398 ++{
406.1399 ++  // Construct and return valid pattern consisting of some combination of:
406.1400 ++  // space none symbol sign value
406.1401 ++  money_base::pattern
406.1402 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
406.1403 ++  { 
406.1404 ++    pattern __ret;
406.1405 ++
406.1406 ++    // This insanely complicated routine attempts to construct a valid
406.1407 ++    // pattern for use with monyepunct. A couple of invariants:
406.1408 ++
406.1409 ++    // if (__precedes) symbol -> value
406.1410 ++    // else value -> symbol
406.1411 ++    
406.1412 ++    // if (__space) space
406.1413 ++    // else none
406.1414 ++
406.1415 ++    // none == never first
406.1416 ++    // space never first or last
406.1417 ++
406.1418 ++    // Any elegant implementations of this are welcome.
406.1419 ++    switch (__posn)
406.1420 ++      {
406.1421 ++      case 0:
406.1422 ++      case 1:
406.1423 ++	// 1 The sign precedes the value and symbol.
406.1424 ++	__ret.field[0] = sign;
406.1425 ++	if (__space)
406.1426 ++	  {
406.1427 ++	    // Pattern starts with sign.
406.1428 ++	    if (__precedes)
406.1429 ++	      {
406.1430 ++		__ret.field[1] = symbol;
406.1431 ++		__ret.field[3] = value;
406.1432 ++	      }
406.1433 ++	    else
406.1434 ++	      {
406.1435 ++		__ret.field[1] = value;
406.1436 ++		__ret.field[3] = symbol;
406.1437 ++	      }
406.1438 ++	    __ret.field[2] = space;
406.1439 ++	  }
406.1440 ++	else
406.1441 ++	  {
406.1442 ++	    // Pattern starts with sign and ends with none.
406.1443 ++	    if (__precedes)
406.1444 ++	      {
406.1445 ++		__ret.field[1] = symbol;
406.1446 ++		__ret.field[2] = value;
406.1447 ++	      }
406.1448 ++	    else
406.1449 ++	      {
406.1450 ++		__ret.field[1] = value;
406.1451 ++		__ret.field[2] = symbol;
406.1452 ++	      }
406.1453 ++	    __ret.field[3] = none;
406.1454 ++	  }
406.1455 ++	break;
406.1456 ++      case 2:
406.1457 ++	// 2 The sign follows the value and symbol.
406.1458 ++	if (__space)
406.1459 ++	  {
406.1460 ++	    // Pattern either ends with sign.
406.1461 ++	    if (__precedes)
406.1462 ++	      {
406.1463 ++		__ret.field[0] = symbol;
406.1464 ++		__ret.field[2] = value;
406.1465 ++	      }
406.1466 ++	    else
406.1467 ++	      {
406.1468 ++		__ret.field[0] = value;
406.1469 ++		__ret.field[2] = symbol;
406.1470 ++	      }
406.1471 ++	    __ret.field[1] = space;
406.1472 ++	    __ret.field[3] = sign;
406.1473 ++	  }
406.1474 ++	else
406.1475 ++	  {
406.1476 ++	    // Pattern ends with sign then none.
406.1477 ++	    if (__precedes)
406.1478 ++	      {
406.1479 ++		__ret.field[0] = symbol;
406.1480 ++		__ret.field[1] = value;
406.1481 ++	      }
406.1482 ++	    else
406.1483 ++	      {
406.1484 ++		__ret.field[0] = value;
406.1485 ++		__ret.field[1] = symbol;
406.1486 ++	      }
406.1487 ++	    __ret.field[2] = sign;
406.1488 ++	    __ret.field[3] = none;
406.1489 ++	  }
406.1490 ++	break;
406.1491 ++      case 3:
406.1492 ++	// 3 The sign immediately precedes the symbol.
406.1493 ++	if (__precedes)
406.1494 ++	  {
406.1495 ++	    __ret.field[0] = sign;
406.1496 ++	    __ret.field[1] = symbol;	    
406.1497 ++	    if (__space)
406.1498 ++	      {
406.1499 ++		__ret.field[2] = space;
406.1500 ++		__ret.field[3] = value;
406.1501 ++	      }
406.1502 ++	    else
406.1503 ++	      {
406.1504 ++		__ret.field[2] = value;		
406.1505 ++		__ret.field[3] = none;
406.1506 ++	      }
406.1507 ++	  }
406.1508 ++	else
406.1509 ++	  {
406.1510 ++	    __ret.field[0] = value;
406.1511 ++	    if (__space)
406.1512 ++	      {
406.1513 ++		__ret.field[1] = space;
406.1514 ++		__ret.field[2] = sign;
406.1515 ++		__ret.field[3] = symbol;
406.1516 ++	      }
406.1517 ++	    else
406.1518 ++	      {
406.1519 ++		__ret.field[1] = sign;
406.1520 ++		__ret.field[2] = symbol;
406.1521 ++		__ret.field[3] = none;
406.1522 ++	      }
406.1523 ++	  }
406.1524 ++	break;
406.1525 ++      case 4:
406.1526 ++	// 4 The sign immediately follows the symbol.
406.1527 ++	if (__precedes)
406.1528 ++	  {
406.1529 ++	    __ret.field[0] = symbol;
406.1530 ++	    __ret.field[1] = sign;
406.1531 ++	    if (__space)
406.1532 ++	      {
406.1533 ++		__ret.field[2] = space;
406.1534 ++		__ret.field[3] = value;
406.1535 ++	      }
406.1536 ++	    else
406.1537 ++	      {
406.1538 ++		__ret.field[2] = value;
406.1539 ++		__ret.field[3] = none;
406.1540 ++	      }
406.1541 ++	  }
406.1542 ++	else
406.1543 ++	  {
406.1544 ++	    __ret.field[0] = value;
406.1545 ++	    if (__space)
406.1546 ++	      {
406.1547 ++		__ret.field[1] = space;
406.1548 ++		__ret.field[2] = symbol;
406.1549 ++		__ret.field[3] = sign;
406.1550 ++	      }
406.1551 ++	    else
406.1552 ++	      {
406.1553 ++		__ret.field[1] = symbol;
406.1554 ++		__ret.field[2] = sign;
406.1555 ++		__ret.field[3] = none;
406.1556 ++	      }
406.1557 ++	  }
406.1558 ++	break;
406.1559 ++      default:
406.1560 ++	;
406.1561 ++      }
406.1562 ++    return __ret;
406.1563 ++  }
406.1564 ++
406.1565 ++  template<> 
406.1566 ++    void
406.1567 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
406.1568 ++						     const char*)
406.1569 ++    {
406.1570 ++      if (!_M_data)
406.1571 ++	_M_data = new __moneypunct_cache<char, true>;
406.1572 ++
406.1573 ++      if (!__cloc)
406.1574 ++	{
406.1575 ++	  // "C" locale
406.1576 ++	  _M_data->_M_decimal_point = '.';
406.1577 ++	  _M_data->_M_thousands_sep = ',';
406.1578 ++	  _M_data->_M_grouping = "";
406.1579 ++	  _M_data->_M_grouping_size = 0;
406.1580 ++	  _M_data->_M_curr_symbol = "";
406.1581 ++	  _M_data->_M_curr_symbol_size = 0;
406.1582 ++	  _M_data->_M_positive_sign = "";
406.1583 ++	  _M_data->_M_positive_sign_size = 0;
406.1584 ++	  _M_data->_M_negative_sign = "";
406.1585 ++	  _M_data->_M_negative_sign_size = 0;
406.1586 ++	  _M_data->_M_frac_digits = 0;
406.1587 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
406.1588 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
406.1589 ++
406.1590 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
406.1591 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
406.1592 ++	}
406.1593 ++      else
406.1594 ++	{
406.1595 ++	  // Named locale.
406.1596 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
406.1597 ++							__cloc));
406.1598 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
406.1599 ++							__cloc));
406.1600 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
406.1601 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
406.1602 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
406.1603 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
406.1604 ++
406.1605 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
406.1606 ++	  if (!__nposn)
406.1607 ++	    _M_data->_M_negative_sign = "()";
406.1608 ++	  else
406.1609 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
406.1610 ++							__cloc);
406.1611 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
406.1612 ++
406.1613 ++	  // _Intl == true
406.1614 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
406.1615 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
406.1616 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
406.1617 ++						      __cloc));
406.1618 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
406.1619 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
406.1620 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
406.1621 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
406.1622 ++							__pposn);
406.1623 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
406.1624 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
406.1625 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
406.1626 ++							__nposn);
406.1627 ++	}
406.1628 ++    }
406.1629 ++
406.1630 ++  template<> 
406.1631 ++    void
406.1632 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
406.1633 ++						      const char*)
406.1634 ++    {
406.1635 ++      if (!_M_data)
406.1636 ++	_M_data = new __moneypunct_cache<char, false>;
406.1637 ++
406.1638 ++      if (!__cloc)
406.1639 ++	{
406.1640 ++	  // "C" locale
406.1641 ++	  _M_data->_M_decimal_point = '.';
406.1642 ++	  _M_data->_M_thousands_sep = ',';
406.1643 ++	  _M_data->_M_grouping = "";
406.1644 ++	  _M_data->_M_grouping_size = 0;
406.1645 ++	  _M_data->_M_curr_symbol = "";
406.1646 ++	  _M_data->_M_curr_symbol_size = 0;
406.1647 ++	  _M_data->_M_positive_sign = "";
406.1648 ++	  _M_data->_M_positive_sign_size = 0;
406.1649 ++	  _M_data->_M_negative_sign = "";
406.1650 ++	  _M_data->_M_negative_sign_size = 0;
406.1651 ++	  _M_data->_M_frac_digits = 0;
406.1652 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
406.1653 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
406.1654 ++
406.1655 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
406.1656 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
406.1657 ++	}
406.1658 ++      else
406.1659 ++	{
406.1660 ++	  // Named locale.
406.1661 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
406.1662 ++							__cloc));
406.1663 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
406.1664 ++							__cloc));
406.1665 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
406.1666 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
406.1667 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
406.1668 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
406.1669 ++
406.1670 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
406.1671 ++	  if (!__nposn)
406.1672 ++	    _M_data->_M_negative_sign = "()";
406.1673 ++	  else
406.1674 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
406.1675 ++							__cloc);
406.1676 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
406.1677 ++
406.1678 ++	  // _Intl == false
406.1679 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
406.1680 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
406.1681 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
406.1682 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
406.1683 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
406.1684 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
406.1685 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
406.1686 ++							__pposn);
406.1687 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
406.1688 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
406.1689 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
406.1690 ++							__nposn);
406.1691 ++	}
406.1692 ++    }
406.1693 ++
406.1694 ++  template<> 
406.1695 ++    moneypunct<char, true>::~moneypunct()
406.1696 ++    { delete _M_data; }
406.1697 ++
406.1698 ++  template<> 
406.1699 ++    moneypunct<char, false>::~moneypunct()
406.1700 ++    { delete _M_data; }
406.1701 ++
406.1702 ++#ifdef _GLIBCXX_USE_WCHAR_T
406.1703 ++  template<> 
406.1704 ++    void
406.1705 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
406.1706 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1707 ++							const char*)
406.1708 ++#else
406.1709 ++							const char* __name)
406.1710 ++#endif
406.1711 ++    {
406.1712 ++      if (!_M_data)
406.1713 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
406.1714 ++
406.1715 ++      if (!__cloc)
406.1716 ++	{
406.1717 ++	  // "C" locale
406.1718 ++	  _M_data->_M_decimal_point = L'.';
406.1719 ++	  _M_data->_M_thousands_sep = L',';
406.1720 ++	  _M_data->_M_grouping = "";
406.1721 ++	  _M_data->_M_grouping_size = 0;
406.1722 ++	  _M_data->_M_curr_symbol = L"";
406.1723 ++	  _M_data->_M_curr_symbol_size = 0;
406.1724 ++	  _M_data->_M_positive_sign = L"";
406.1725 ++	  _M_data->_M_positive_sign_size = 0;
406.1726 ++	  _M_data->_M_negative_sign = L"";
406.1727 ++	  _M_data->_M_negative_sign_size = 0;
406.1728 ++	  _M_data->_M_frac_digits = 0;
406.1729 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
406.1730 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
406.1731 ++
406.1732 ++	  // Use ctype::widen code without the facet...
406.1733 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
406.1734 ++	    _M_data->_M_atoms[__i] =
406.1735 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
406.1736 ++	}
406.1737 ++      else
406.1738 ++	{
406.1739 ++	  // Named locale.
406.1740 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1741 ++	  __c_locale __old = __uselocale(__cloc);
406.1742 ++#else
406.1743 ++	  // Switch to named locale so that mbsrtowcs will work.
406.1744 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
406.1745 ++	  setlocale(LC_ALL, __name);
406.1746 ++#endif
406.1747 ++
406.1748 ++#ifdef __UCLIBC_MJN3_ONLY__
406.1749 ++#warning fix this... should be monetary
406.1750 ++#endif
406.1751 ++#ifdef __UCLIBC__
406.1752 ++# ifdef __UCLIBC_HAS_XLOCALE__
406.1753 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
406.1754 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
406.1755 ++# else
406.1756 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
406.1757 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
406.1758 ++# endif
406.1759 ++#else
406.1760 ++	  union { char *__s; wchar_t __w; } __u;
406.1761 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
406.1762 ++	  _M_data->_M_decimal_point = __u.__w;
406.1763 ++
406.1764 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
406.1765 ++	  _M_data->_M_thousands_sep = __u.__w;
406.1766 ++#endif
406.1767 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
406.1768 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
406.1769 ++
406.1770 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
406.1771 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
406.1772 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
406.1773 ++
406.1774 ++	  wchar_t* __wcs_ps = 0;
406.1775 ++	  wchar_t* __wcs_ns = 0;
406.1776 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
406.1777 ++	  try
406.1778 ++	    {
406.1779 ++	      mbstate_t __state;
406.1780 ++	      size_t __len = strlen(__cpossign);
406.1781 ++	      if (__len)
406.1782 ++		{
406.1783 ++		  ++__len;
406.1784 ++		  memset(&__state, 0, sizeof(mbstate_t));
406.1785 ++		  __wcs_ps = new wchar_t[__len];
406.1786 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
406.1787 ++		  _M_data->_M_positive_sign = __wcs_ps;
406.1788 ++		}
406.1789 ++	      else
406.1790 ++		_M_data->_M_positive_sign = L"";
406.1791 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
406.1792 ++	      
406.1793 ++	      __len = strlen(__cnegsign);
406.1794 ++	      if (!__nposn)
406.1795 ++		_M_data->_M_negative_sign = L"()";
406.1796 ++	      else if (__len)
406.1797 ++		{ 
406.1798 ++		  ++__len;
406.1799 ++		  memset(&__state, 0, sizeof(mbstate_t));
406.1800 ++		  __wcs_ns = new wchar_t[__len];
406.1801 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
406.1802 ++		  _M_data->_M_negative_sign = __wcs_ns;
406.1803 ++		}
406.1804 ++	      else
406.1805 ++		_M_data->_M_negative_sign = L"";
406.1806 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
406.1807 ++	      
406.1808 ++	      // _Intl == true.
406.1809 ++	      __len = strlen(__ccurr);
406.1810 ++	      if (__len)
406.1811 ++		{
406.1812 ++		  ++__len;
406.1813 ++		  memset(&__state, 0, sizeof(mbstate_t));
406.1814 ++		  wchar_t* __wcs = new wchar_t[__len];
406.1815 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
406.1816 ++		  _M_data->_M_curr_symbol = __wcs;
406.1817 ++		}
406.1818 ++	      else
406.1819 ++		_M_data->_M_curr_symbol = L"";
406.1820 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
406.1821 ++	    }
406.1822 ++	  catch (...)
406.1823 ++	    {
406.1824 ++	      delete _M_data;
406.1825 ++	      _M_data = 0;
406.1826 ++	      delete __wcs_ps;
406.1827 ++	      delete __wcs_ns;	      
406.1828 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1829 ++	      __uselocale(__old);
406.1830 ++#else
406.1831 ++	      setlocale(LC_ALL, __old);
406.1832 ++	      free(__old);
406.1833 ++#endif
406.1834 ++	      __throw_exception_again;
406.1835 ++	    } 
406.1836 ++	  
406.1837 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
406.1838 ++						      __cloc));
406.1839 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
406.1840 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
406.1841 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
406.1842 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
406.1843 ++							__pposn);
406.1844 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
406.1845 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
406.1846 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
406.1847 ++							__nposn);
406.1848 ++
406.1849 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1850 ++	  __uselocale(__old);
406.1851 ++#else
406.1852 ++	  setlocale(LC_ALL, __old);
406.1853 ++	  free(__old);
406.1854 ++#endif
406.1855 ++	}
406.1856 ++    }
406.1857 ++
406.1858 ++  template<> 
406.1859 ++  void
406.1860 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
406.1861 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1862 ++						       const char*)
406.1863 ++#else
406.1864 ++                                                       const char* __name)
406.1865 ++#endif
406.1866 ++  {
406.1867 ++    if (!_M_data)
406.1868 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
406.1869 ++
406.1870 ++    if (!__cloc)
406.1871 ++	{
406.1872 ++	  // "C" locale
406.1873 ++	  _M_data->_M_decimal_point = L'.';
406.1874 ++	  _M_data->_M_thousands_sep = L',';
406.1875 ++	  _M_data->_M_grouping = "";
406.1876 ++          _M_data->_M_grouping_size = 0;
406.1877 ++	  _M_data->_M_curr_symbol = L"";
406.1878 ++	  _M_data->_M_curr_symbol_size = 0;
406.1879 ++	  _M_data->_M_positive_sign = L"";
406.1880 ++	  _M_data->_M_positive_sign_size = 0;
406.1881 ++	  _M_data->_M_negative_sign = L"";
406.1882 ++	  _M_data->_M_negative_sign_size = 0;
406.1883 ++	  _M_data->_M_frac_digits = 0;
406.1884 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
406.1885 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
406.1886 ++
406.1887 ++	  // Use ctype::widen code without the facet...
406.1888 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
406.1889 ++	    _M_data->_M_atoms[__i] =
406.1890 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
406.1891 ++	}
406.1892 ++      else
406.1893 ++	{
406.1894 ++	  // Named locale.
406.1895 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1896 ++	  __c_locale __old = __uselocale(__cloc);
406.1897 ++#else
406.1898 ++	  // Switch to named locale so that mbsrtowcs will work.
406.1899 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
406.1900 ++	  setlocale(LC_ALL, __name);
406.1901 ++#endif
406.1902 ++
406.1903 ++#ifdef __UCLIBC_MJN3_ONLY__
406.1904 ++#warning fix this... should be monetary
406.1905 ++#endif
406.1906 ++#ifdef __UCLIBC__
406.1907 ++# ifdef __UCLIBC_HAS_XLOCALE__
406.1908 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
406.1909 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
406.1910 ++# else
406.1911 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
406.1912 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
406.1913 ++# endif
406.1914 ++#else
406.1915 ++          union { char *__s; wchar_t __w; } __u;
406.1916 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
406.1917 ++	  _M_data->_M_decimal_point = __u.__w;
406.1918 ++
406.1919 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
406.1920 ++	  _M_data->_M_thousands_sep = __u.__w;
406.1921 ++#endif
406.1922 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
406.1923 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
406.1924 ++
406.1925 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
406.1926 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
406.1927 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
406.1928 ++
406.1929 ++	  wchar_t* __wcs_ps = 0;
406.1930 ++	  wchar_t* __wcs_ns = 0;
406.1931 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
406.1932 ++	  try
406.1933 ++            {
406.1934 ++              mbstate_t __state;
406.1935 ++              size_t __len;
406.1936 ++              __len = strlen(__cpossign);
406.1937 ++              if (__len)
406.1938 ++                {
406.1939 ++		  ++__len;
406.1940 ++		  memset(&__state, 0, sizeof(mbstate_t));
406.1941 ++		  __wcs_ps = new wchar_t[__len];
406.1942 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
406.1943 ++		  _M_data->_M_positive_sign = __wcs_ps;
406.1944 ++		}
406.1945 ++	      else
406.1946 ++		_M_data->_M_positive_sign = L"";
406.1947 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
406.1948 ++	      
406.1949 ++	      __len = strlen(__cnegsign);
406.1950 ++	      if (!__nposn)
406.1951 ++		_M_data->_M_negative_sign = L"()";
406.1952 ++	      else if (__len)
406.1953 ++		{ 
406.1954 ++		  ++__len;
406.1955 ++		  memset(&__state, 0, sizeof(mbstate_t));
406.1956 ++		  __wcs_ns = new wchar_t[__len];
406.1957 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
406.1958 ++		  _M_data->_M_negative_sign = __wcs_ns;
406.1959 ++		}
406.1960 ++	      else
406.1961 ++		_M_data->_M_negative_sign = L"";
406.1962 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
406.1963 ++
406.1964 ++	      // _Intl == true.
406.1965 ++	      __len = strlen(__ccurr);
406.1966 ++	      if (__len)
406.1967 ++		{
406.1968 ++		  ++__len;
406.1969 ++		  memset(&__state, 0, sizeof(mbstate_t));
406.1970 ++		  wchar_t* __wcs = new wchar_t[__len];
406.1971 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
406.1972 ++		  _M_data->_M_curr_symbol = __wcs;
406.1973 ++		}
406.1974 ++	      else
406.1975 ++		_M_data->_M_curr_symbol = L"";
406.1976 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
406.1977 ++	    }
406.1978 ++          catch (...)
406.1979 ++	    {
406.1980 ++	      delete _M_data;
406.1981 ++              _M_data = 0;
406.1982 ++	      delete __wcs_ps;
406.1983 ++	      delete __wcs_ns;	      
406.1984 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.1985 ++	      __uselocale(__old);
406.1986 ++#else
406.1987 ++	      setlocale(LC_ALL, __old);
406.1988 ++	      free(__old);
406.1989 ++#endif
406.1990 ++              __throw_exception_again;
406.1991 ++	    }
406.1992 ++
406.1993 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
406.1994 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
406.1995 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
406.1996 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
406.1997 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
406.1998 ++	                                                __pposn);
406.1999 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
406.2000 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
406.2001 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
406.2002 ++	                                                __nposn);
406.2003 ++
406.2004 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.2005 ++	  __uselocale(__old);
406.2006 ++#else
406.2007 ++	  setlocale(LC_ALL, __old);
406.2008 ++	  free(__old);
406.2009 ++#endif
406.2010 ++	}
406.2011 ++    }
406.2012 ++
406.2013 ++  template<> 
406.2014 ++    moneypunct<wchar_t, true>::~moneypunct()
406.2015 ++    {
406.2016 ++      if (_M_data->_M_positive_sign_size)
406.2017 ++	delete [] _M_data->_M_positive_sign;
406.2018 ++      if (_M_data->_M_negative_sign_size
406.2019 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
406.2020 ++	delete [] _M_data->_M_negative_sign;
406.2021 ++      if (_M_data->_M_curr_symbol_size)
406.2022 ++	delete [] _M_data->_M_curr_symbol;
406.2023 ++      delete _M_data;
406.2024 ++    }
406.2025 ++
406.2026 ++  template<> 
406.2027 ++    moneypunct<wchar_t, false>::~moneypunct()
406.2028 ++    {
406.2029 ++      if (_M_data->_M_positive_sign_size)
406.2030 ++	delete [] _M_data->_M_positive_sign;
406.2031 ++      if (_M_data->_M_negative_sign_size
406.2032 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
406.2033 ++	delete [] _M_data->_M_negative_sign;
406.2034 ++      if (_M_data->_M_curr_symbol_size)
406.2035 ++	delete [] _M_data->_M_curr_symbol;
406.2036 ++      delete _M_data;
406.2037 ++    }
406.2038 ++#endif
406.2039 ++}
406.2040 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
406.2041 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
406.2042 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:35.000000000 +0200
406.2043 +@@ -0,0 +1,160 @@
406.2044 ++// std::numpunct implementation details, GNU version -*- C++ -*-
406.2045 ++
406.2046 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
406.2047 ++//
406.2048 ++// This file is part of the GNU ISO C++ Library.  This library is free
406.2049 ++// software; you can redistribute it and/or modify it under the
406.2050 ++// terms of the GNU General Public License as published by the
406.2051 ++// Free Software Foundation; either version 2, or (at your option)
406.2052 ++// any later version.
406.2053 ++
406.2054 ++// This library is distributed in the hope that it will be useful,
406.2055 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
406.2056 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
406.2057 ++// GNU General Public License for more details.
406.2058 ++
406.2059 ++// You should have received a copy of the GNU General Public License along
406.2060 ++// with this library; see the file COPYING.  If not, write to the Free
406.2061 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
406.2062 ++// USA.
406.2063 ++
406.2064 ++// As a special exception, you may use this file as part of a free software
406.2065 ++// library without restriction.  Specifically, if other files instantiate
406.2066 ++// templates or use macros or inline functions from this file, or you compile
406.2067 ++// this file and link it with other files to produce an executable, this
406.2068 ++// file does not by itself cause the resulting executable to be covered by
406.2069 ++// the GNU General Public License.  This exception does not however
406.2070 ++// invalidate any other reasons why the executable file might be covered by
406.2071 ++// the GNU General Public License.
406.2072 ++
406.2073 ++//
406.2074 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
406.2075 ++//
406.2076 ++
406.2077 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
406.2078 ++
406.2079 ++#define _LIBC
406.2080 ++#include <locale>
406.2081 ++#undef _LIBC
406.2082 ++#include <bits/c++locale_internal.h>
406.2083 ++
406.2084 ++#ifdef __UCLIBC_MJN3_ONLY__
406.2085 ++#warning tailor for stub locale support
406.2086 ++#endif
406.2087 ++#ifndef __UCLIBC_HAS_XLOCALE__
406.2088 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
406.2089 ++#endif
406.2090 ++
406.2091 ++namespace std
406.2092 ++{
406.2093 ++  template<> 
406.2094 ++    void
406.2095 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
406.2096 ++    {
406.2097 ++      if (!_M_data)
406.2098 ++	_M_data = new __numpunct_cache<char>;
406.2099 ++
406.2100 ++      if (!__cloc)
406.2101 ++	{
406.2102 ++	  // "C" locale
406.2103 ++	  _M_data->_M_grouping = "";
406.2104 ++	  _M_data->_M_grouping_size = 0;
406.2105 ++	  _M_data->_M_use_grouping = false;
406.2106 ++
406.2107 ++	  _M_data->_M_decimal_point = '.';
406.2108 ++	  _M_data->_M_thousands_sep = ',';
406.2109 ++
406.2110 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
406.2111 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
406.2112 ++
406.2113 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
406.2114 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
406.2115 ++	}
406.2116 ++      else
406.2117 ++	{
406.2118 ++	  // Named locale.
406.2119 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
406.2120 ++							__cloc));
406.2121 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
406.2122 ++							__cloc));
406.2123 ++
406.2124 ++	  // Check for NULL, which implies no grouping.
406.2125 ++	  if (_M_data->_M_thousands_sep == '\0')
406.2126 ++	    _M_data->_M_grouping = "";
406.2127 ++	  else
406.2128 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
406.2129 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
406.2130 ++	}
406.2131 ++
406.2132 ++      // NB: There is no way to extact this info from posix locales.
406.2133 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
406.2134 ++      _M_data->_M_truename = "true";
406.2135 ++      _M_data->_M_truename_size = 4;
406.2136 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
406.2137 ++      _M_data->_M_falsename = "false";
406.2138 ++      _M_data->_M_falsename_size = 5;
406.2139 ++    }
406.2140 ++ 
406.2141 ++  template<> 
406.2142 ++    numpunct<char>::~numpunct()
406.2143 ++    { delete _M_data; }
406.2144 ++   
406.2145 ++#ifdef _GLIBCXX_USE_WCHAR_T
406.2146 ++  template<> 
406.2147 ++    void
406.2148 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
406.2149 ++    {
406.2150 ++      if (!_M_data)
406.2151 ++	_M_data = new __numpunct_cache<wchar_t>;
406.2152 ++
406.2153 ++      if (!__cloc)
406.2154 ++	{
406.2155 ++	  // "C" locale
406.2156 ++	  _M_data->_M_grouping = "";
406.2157 ++	  _M_data->_M_grouping_size = 0;
406.2158 ++	  _M_data->_M_use_grouping = false;
406.2159 ++
406.2160 ++	  _M_data->_M_decimal_point = L'.';
406.2161 ++	  _M_data->_M_thousands_sep = L',';
406.2162 ++
406.2163 ++	  // Use ctype::widen code without the facet...
406.2164 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
406.2165 ++	    _M_data->_M_atoms_out[__i] =
406.2166 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
406.2167 ++
406.2168 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
406.2169 ++	    _M_data->_M_atoms_in[__j] =
406.2170 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
406.2171 ++	}
406.2172 ++      else
406.2173 ++	{
406.2174 ++	  // Named locale.
406.2175 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
406.2176 ++	  union { char *__s; wchar_t __w; } __u;
406.2177 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
406.2178 ++	  _M_data->_M_decimal_point = __u.__w;
406.2179 ++
406.2180 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
406.2181 ++	  _M_data->_M_thousands_sep = __u.__w;
406.2182 ++
406.2183 ++	  if (_M_data->_M_thousands_sep == L'\0')
406.2184 ++	    _M_data->_M_grouping = "";
406.2185 ++	  else
406.2186 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
406.2187 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
406.2188 ++	}
406.2189 ++
406.2190 ++      // NB: There is no way to extact this info from posix locales.
406.2191 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
406.2192 ++      _M_data->_M_truename = L"true";
406.2193 ++      _M_data->_M_truename_size = 4;
406.2194 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
406.2195 ++      _M_data->_M_falsename = L"false";
406.2196 ++      _M_data->_M_falsename_size = 5;
406.2197 ++    }
406.2198 ++
406.2199 ++  template<> 
406.2200 ++    numpunct<wchar_t>::~numpunct()
406.2201 ++    { delete _M_data; }
406.2202 ++ #endif
406.2203 ++}
406.2204 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc
406.2205 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
406.2206 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:35.000000000 +0200
406.2207 +@@ -0,0 +1,406 @@
406.2208 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
406.2209 ++
406.2210 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
406.2211 ++//
406.2212 ++// This file is part of the GNU ISO C++ Library.  This library is free
406.2213 ++// software; you can redistribute it and/or modify it under the
406.2214 ++// terms of the GNU General Public License as published by the
406.2215 ++// Free Software Foundation; either version 2, or (at your option)
406.2216 ++// any later version.
406.2217 ++
406.2218 ++// This library is distributed in the hope that it will be useful,
406.2219 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
406.2220 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
406.2221 ++// GNU General Public License for more details.
406.2222 ++
406.2223 ++// You should have received a copy of the GNU General Public License along
406.2224 ++// with this library; see the file COPYING.  If not, write to the Free
406.2225 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
406.2226 ++// USA.
406.2227 ++
406.2228 ++// As a special exception, you may use this file as part of a free software
406.2229 ++// library without restriction.  Specifically, if other files instantiate
406.2230 ++// templates or use macros or inline functions from this file, or you compile
406.2231 ++// this file and link it with other files to produce an executable, this
406.2232 ++// file does not by itself cause the resulting executable to be covered by
406.2233 ++// the GNU General Public License.  This exception does not however
406.2234 ++// invalidate any other reasons why the executable file might be covered by
406.2235 ++// the GNU General Public License.
406.2236 ++
406.2237 ++//
406.2238 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
406.2239 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
406.2240 ++//
406.2241 ++
406.2242 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
406.2243 ++
406.2244 ++#include <locale>
406.2245 ++#include <bits/c++locale_internal.h>
406.2246 ++
406.2247 ++#ifdef __UCLIBC_MJN3_ONLY__
406.2248 ++#warning tailor for stub locale support
406.2249 ++#endif
406.2250 ++#ifndef __UCLIBC_HAS_XLOCALE__
406.2251 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
406.2252 ++#endif
406.2253 ++
406.2254 ++namespace std
406.2255 ++{
406.2256 ++  template<>
406.2257 ++    void
406.2258 ++    __timepunct<char>::
406.2259 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
406.2260 ++	   const tm* __tm) const
406.2261 ++    {
406.2262 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.2263 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
406.2264 ++					_M_c_locale_timepunct);
406.2265 ++#else
406.2266 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
406.2267 ++      setlocale(LC_ALL, _M_name_timepunct);
406.2268 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
406.2269 ++      setlocale(LC_ALL, __old);
406.2270 ++      free(__old);
406.2271 ++#endif
406.2272 ++      // Make sure __s is null terminated.
406.2273 ++      if (__len == 0)
406.2274 ++	__s[0] = '\0';
406.2275 ++    }
406.2276 ++
406.2277 ++  template<> 
406.2278 ++    void
406.2279 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
406.2280 ++    {
406.2281 ++      if (!_M_data)
406.2282 ++	_M_data = new __timepunct_cache<char>;
406.2283 ++
406.2284 ++      if (!__cloc)
406.2285 ++	{
406.2286 ++	  // "C" locale
406.2287 ++	  _M_c_locale_timepunct = _S_get_c_locale();
406.2288 ++
406.2289 ++	  _M_data->_M_date_format = "%m/%d/%y";
406.2290 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
406.2291 ++	  _M_data->_M_time_format = "%H:%M:%S";
406.2292 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
406.2293 ++	  _M_data->_M_date_time_format = "";
406.2294 ++	  _M_data->_M_date_time_era_format = "";
406.2295 ++	  _M_data->_M_am = "AM";
406.2296 ++	  _M_data->_M_pm = "PM";
406.2297 ++	  _M_data->_M_am_pm_format = "";
406.2298 ++
406.2299 ++	  // Day names, starting with "C"'s Sunday.
406.2300 ++	  _M_data->_M_day1 = "Sunday";
406.2301 ++	  _M_data->_M_day2 = "Monday";
406.2302 ++	  _M_data->_M_day3 = "Tuesday";
406.2303 ++	  _M_data->_M_day4 = "Wednesday";
406.2304 ++	  _M_data->_M_day5 = "Thursday";
406.2305 ++	  _M_data->_M_day6 = "Friday";
406.2306 ++	  _M_data->_M_day7 = "Saturday";
406.2307 ++
406.2308 ++	  // Abbreviated day names, starting with "C"'s Sun.
406.2309 ++	  _M_data->_M_aday1 = "Sun";
406.2310 ++	  _M_data->_M_aday2 = "Mon";
406.2311 ++	  _M_data->_M_aday3 = "Tue";
406.2312 ++	  _M_data->_M_aday4 = "Wed";
406.2313 ++	  _M_data->_M_aday5 = "Thu";
406.2314 ++	  _M_data->_M_aday6 = "Fri";
406.2315 ++	  _M_data->_M_aday7 = "Sat";
406.2316 ++
406.2317 ++	  // Month names, starting with "C"'s January.
406.2318 ++	  _M_data->_M_month01 = "January";
406.2319 ++	  _M_data->_M_month02 = "February";
406.2320 ++	  _M_data->_M_month03 = "March";
406.2321 ++	  _M_data->_M_month04 = "April";
406.2322 ++	  _M_data->_M_month05 = "May";
406.2323 ++	  _M_data->_M_month06 = "June";
406.2324 ++	  _M_data->_M_month07 = "July";
406.2325 ++	  _M_data->_M_month08 = "August";
406.2326 ++	  _M_data->_M_month09 = "September";
406.2327 ++	  _M_data->_M_month10 = "October";
406.2328 ++	  _M_data->_M_month11 = "November";
406.2329 ++	  _M_data->_M_month12 = "December";
406.2330 ++
406.2331 ++	  // Abbreviated month names, starting with "C"'s Jan.
406.2332 ++	  _M_data->_M_amonth01 = "Jan";
406.2333 ++	  _M_data->_M_amonth02 = "Feb";
406.2334 ++	  _M_data->_M_amonth03 = "Mar";
406.2335 ++	  _M_data->_M_amonth04 = "Apr";
406.2336 ++	  _M_data->_M_amonth05 = "May";
406.2337 ++	  _M_data->_M_amonth06 = "Jun";
406.2338 ++	  _M_data->_M_amonth07 = "Jul";
406.2339 ++	  _M_data->_M_amonth08 = "Aug";
406.2340 ++	  _M_data->_M_amonth09 = "Sep";
406.2341 ++	  _M_data->_M_amonth10 = "Oct";
406.2342 ++	  _M_data->_M_amonth11 = "Nov";
406.2343 ++	  _M_data->_M_amonth12 = "Dec";
406.2344 ++	}
406.2345 ++      else
406.2346 ++	{
406.2347 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
406.2348 ++
406.2349 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
406.2350 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
406.2351 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
406.2352 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
406.2353 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
406.2354 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
406.2355 ++							     __cloc);
406.2356 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
406.2357 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
406.2358 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
406.2359 ++
406.2360 ++	  // Day names, starting with "C"'s Sunday.
406.2361 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
406.2362 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
406.2363 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
406.2364 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
406.2365 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
406.2366 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
406.2367 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
406.2368 ++
406.2369 ++	  // Abbreviated day names, starting with "C"'s Sun.
406.2370 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
406.2371 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
406.2372 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
406.2373 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
406.2374 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
406.2375 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
406.2376 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
406.2377 ++
406.2378 ++	  // Month names, starting with "C"'s January.
406.2379 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
406.2380 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
406.2381 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
406.2382 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
406.2383 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
406.2384 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
406.2385 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
406.2386 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
406.2387 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
406.2388 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
406.2389 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
406.2390 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
406.2391 ++
406.2392 ++	  // Abbreviated month names, starting with "C"'s Jan.
406.2393 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
406.2394 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
406.2395 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
406.2396 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
406.2397 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
406.2398 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
406.2399 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
406.2400 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
406.2401 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
406.2402 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
406.2403 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
406.2404 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
406.2405 ++	}
406.2406 ++    }
406.2407 ++
406.2408 ++#ifdef _GLIBCXX_USE_WCHAR_T
406.2409 ++  template<>
406.2410 ++    void
406.2411 ++    __timepunct<wchar_t>::
406.2412 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
406.2413 ++	   const tm* __tm) const
406.2414 ++    {
406.2415 ++#ifdef __UCLIBC_HAS_XLOCALE__
406.2416 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
406.2417 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
406.2418 ++					_M_c_locale_timepunct);
406.2419 ++#else
406.2420 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
406.2421 ++      setlocale(LC_ALL, _M_name_timepunct);
406.2422 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
406.2423 ++      setlocale(LC_ALL, __old);
406.2424 ++      free(__old);
406.2425 ++#endif
406.2426 ++      // Make sure __s is null terminated.
406.2427 ++      if (__len == 0)
406.2428 ++	__s[0] = L'\0';
406.2429 ++    }
406.2430 ++
406.2431 ++  template<> 
406.2432 ++    void
406.2433 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
406.2434 ++    {
406.2435 ++      if (!_M_data)
406.2436 ++	_M_data = new __timepunct_cache<wchar_t>;
406.2437 ++
406.2438 ++#warning wide time stuff
406.2439 ++//       if (!__cloc)
406.2440 ++	{
406.2441 ++	  // "C" locale
406.2442 ++	  _M_c_locale_timepunct = _S_get_c_locale();
406.2443 ++
406.2444 ++	  _M_data->_M_date_format = L"%m/%d/%y";
406.2445 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
406.2446 ++	  _M_data->_M_time_format = L"%H:%M:%S";
406.2447 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
406.2448 ++	  _M_data->_M_date_time_format = L"";
406.2449 ++	  _M_data->_M_date_time_era_format = L"";
406.2450 ++	  _M_data->_M_am = L"AM";
406.2451 ++	  _M_data->_M_pm = L"PM";
406.2452 ++	  _M_data->_M_am_pm_format = L"";
406.2453 ++
406.2454 ++	  // Day names, starting with "C"'s Sunday.
406.2455 ++	  _M_data->_M_day1 = L"Sunday";
406.2456 ++	  _M_data->_M_day2 = L"Monday";
406.2457 ++	  _M_data->_M_day3 = L"Tuesday";
406.2458 ++	  _M_data->_M_day4 = L"Wednesday";
406.2459 ++	  _M_data->_M_day5 = L"Thursday";
406.2460 ++	  _M_data->_M_day6 = L"Friday";
406.2461 ++	  _M_data->_M_day7 = L"Saturday";
406.2462 ++
406.2463 ++	  // Abbreviated day names, starting with "C"'s Sun.
406.2464 ++	  _M_data->_M_aday1 = L"Sun";
406.2465 ++	  _M_data->_M_aday2 = L"Mon";
406.2466 ++	  _M_data->_M_aday3 = L"Tue";
406.2467 ++	  _M_data->_M_aday4 = L"Wed";
406.2468 ++	  _M_data->_M_aday5 = L"Thu";
406.2469 ++	  _M_data->_M_aday6 = L"Fri";
406.2470 ++	  _M_data->_M_aday7 = L"Sat";
406.2471 ++
406.2472 ++	  // Month names, starting with "C"'s January.
406.2473 ++	  _M_data->_M_month01 = L"January";
406.2474 ++	  _M_data->_M_month02 = L"February";
406.2475 ++	  _M_data->_M_month03 = L"March";
406.2476 ++	  _M_data->_M_month04 = L"April";
406.2477 ++	  _M_data->_M_month05 = L"May";
406.2478 ++	  _M_data->_M_month06 = L"June";
406.2479 ++	  _M_data->_M_month07 = L"July";
406.2480 ++	  _M_data->_M_month08 = L"August";
406.2481 ++	  _M_data->_M_month09 = L"September";
406.2482 ++	  _M_data->_M_month10 = L"October";
406.2483 ++	  _M_data->_M_month11 = L"November";
406.2484 ++	  _M_data->_M_month12 = L"December";
406.2485 ++
406.2486 ++	  // Abbreviated month names, starting with "C"'s Jan.
406.2487 ++	  _M_data->_M_amonth01 = L"Jan";
406.2488 ++	  _M_data->_M_amonth02 = L"Feb";
406.2489 ++	  _M_data->_M_amonth03 = L"Mar";
406.2490 ++	  _M_data->_M_amonth04 = L"Apr";
406.2491 ++	  _M_data->_M_amonth05 = L"May";
406.2492 ++	  _M_data->_M_amonth06 = L"Jun";
406.2493 ++	  _M_data->_M_amonth07 = L"Jul";
406.2494 ++	  _M_data->_M_amonth08 = L"Aug";
406.2495 ++	  _M_data->_M_amonth09 = L"Sep";
406.2496 ++	  _M_data->_M_amonth10 = L"Oct";
406.2497 ++	  _M_data->_M_amonth11 = L"Nov";
406.2498 ++	  _M_data->_M_amonth12 = L"Dec";
406.2499 ++	}
406.2500 ++#if 0
406.2501 ++      else
406.2502 ++	{
406.2503 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
406.2504 ++
406.2505 ++	  union { char *__s; wchar_t *__w; } __u;
406.2506 ++
406.2507 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
406.2508 ++	  _M_data->_M_date_format = __u.__w;
406.2509 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
406.2510 ++	  _M_data->_M_date_era_format = __u.__w;
406.2511 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
406.2512 ++	  _M_data->_M_time_format = __u.__w;
406.2513 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
406.2514 ++	  _M_data->_M_time_era_format = __u.__w;
406.2515 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
406.2516 ++	  _M_data->_M_date_time_format = __u.__w;
406.2517 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
406.2518 ++	  _M_data->_M_date_time_era_format = __u.__w;
406.2519 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
406.2520 ++	  _M_data->_M_am = __u.__w;
406.2521 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
406.2522 ++	  _M_data->_M_pm = __u.__w;
406.2523 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
406.2524 ++	  _M_data->_M_am_pm_format = __u.__w;
406.2525 ++
406.2526 ++	  // Day names, starting with "C"'s Sunday.
406.2527 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
406.2528 ++	  _M_data->_M_day1 = __u.__w;
406.2529 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
406.2530 ++	  _M_data->_M_day2 = __u.__w;
406.2531 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
406.2532 ++	  _M_data->_M_day3 = __u.__w;
406.2533 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
406.2534 ++	  _M_data->_M_day4 = __u.__w;
406.2535 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
406.2536 ++	  _M_data->_M_day5 = __u.__w;
406.2537 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
406.2538 ++	  _M_data->_M_day6 = __u.__w;
406.2539 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
406.2540 ++	  _M_data->_M_day7 = __u.__w;
406.2541 ++
406.2542 ++	  // Abbreviated day names, starting with "C"'s Sun.
406.2543 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
406.2544 ++	  _M_data->_M_aday1 = __u.__w;
406.2545 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
406.2546 ++	  _M_data->_M_aday2 = __u.__w;
406.2547 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
406.2548 ++	  _M_data->_M_aday3 = __u.__w;
406.2549 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
406.2550 ++	  _M_data->_M_aday4 = __u.__w;
406.2551 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
406.2552 ++	  _M_data->_M_aday5 = __u.__w;
406.2553 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
406.2554 ++	  _M_data->_M_aday6 = __u.__w;
406.2555 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
406.2556 ++	  _M_data->_M_aday7 = __u.__w;
406.2557 ++
406.2558 ++	  // Month names, starting with "C"'s January.
406.2559 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
406.2560 ++	  _M_data->_M_month01 = __u.__w;
406.2561 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
406.2562 ++	  _M_data->_M_month02 = __u.__w;
406.2563 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
406.2564 ++	  _M_data->_M_month03 = __u.__w;
406.2565 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
406.2566 ++	  _M_data->_M_month04 = __u.__w;
406.2567 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
406.2568 ++	  _M_data->_M_month05 = __u.__w;
406.2569 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
406.2570 ++	  _M_data->_M_month06 = __u.__w;
406.2571 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
406.2572 ++	  _M_data->_M_month07 = __u.__w;
406.2573 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
406.2574 ++	  _M_data->_M_month08 = __u.__w;
406.2575 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
406.2576 ++	  _M_data->_M_month09 = __u.__w;
406.2577 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
406.2578 ++	  _M_data->_M_month10 = __u.__w;
406.2579 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
406.2580 ++	  _M_data->_M_month11 = __u.__w;
406.2581 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
406.2582 ++	  _M_data->_M_month12 = __u.__w;
406.2583 ++
406.2584 ++	  // Abbreviated month names, starting with "C"'s Jan.
406.2585 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
406.2586 ++	  _M_data->_M_amonth01 = __u.__w;
406.2587 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
406.2588 ++	  _M_data->_M_amonth02 = __u.__w;
406.2589 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
406.2590 ++	  _M_data->_M_amonth03 = __u.__w;
406.2591 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
406.2592 ++	  _M_data->_M_amonth04 = __u.__w;
406.2593 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
406.2594 ++	  _M_data->_M_amonth05 = __u.__w;
406.2595 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
406.2596 ++	  _M_data->_M_amonth06 = __u.__w;
406.2597 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
406.2598 ++	  _M_data->_M_amonth07 = __u.__w;
406.2599 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
406.2600 ++	  _M_data->_M_amonth08 = __u.__w;
406.2601 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
406.2602 ++	  _M_data->_M_amonth09 = __u.__w;
406.2603 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
406.2604 ++	  _M_data->_M_amonth10 = __u.__w;
406.2605 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
406.2606 ++	  _M_data->_M_amonth11 = __u.__w;
406.2607 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
406.2608 ++	  _M_data->_M_amonth12 = __u.__w;
406.2609 ++	}
406.2610 ++#endif // 0
406.2611 ++    }
406.2612 ++#endif
406.2613 ++}
406.2614 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
406.2615 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
406.2616 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:35.000000000 +0200
406.2617 +@@ -0,0 +1,68 @@
406.2618 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
406.2619 ++
406.2620 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
406.2621 ++//
406.2622 ++// This file is part of the GNU ISO C++ Library.  This library is free
406.2623 ++// software; you can redistribute it and/or modify it under the
406.2624 ++// terms of the GNU General Public License as published by the
406.2625 ++// Free Software Foundation; either version 2, or (at your option)
406.2626 ++// any later version.
406.2627 ++
406.2628 ++// This library is distributed in the hope that it will be useful,
406.2629 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
406.2630 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
406.2631 ++// GNU General Public License for more details.
406.2632 ++
406.2633 ++// You should have received a copy of the GNU General Public License along
406.2634 ++// with this library; see the file COPYING.  If not, write to the Free
406.2635 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
406.2636 ++// USA.
406.2637 ++
406.2638 ++// As a special exception, you may use this file as part of a free software
406.2639 ++// library without restriction.  Specifically, if other files instantiate
406.2640 ++// templates or use macros or inline functions from this file, or you compile
406.2641 ++// this file and link it with other files to produce an executable, this
406.2642 ++// file does not by itself cause the resulting executable to be covered by
406.2643 ++// the GNU General Public License.  This exception does not however
406.2644 ++// invalidate any other reasons why the executable file might be covered by
406.2645 ++// the GNU General Public License.
406.2646 ++
406.2647 ++//
406.2648 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
406.2649 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
406.2650 ++//
406.2651 ++
406.2652 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
406.2653 ++
406.2654 ++  template<typename _CharT>
406.2655 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
406.2656 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
406.2657 ++    _M_name_timepunct(_S_get_c_name())
406.2658 ++    { _M_initialize_timepunct(); }
406.2659 ++
406.2660 ++  template<typename _CharT>
406.2661 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
406.2662 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
406.2663 ++    _M_name_timepunct(_S_get_c_name())
406.2664 ++    { _M_initialize_timepunct(); }
406.2665 ++
406.2666 ++  template<typename _CharT>
406.2667 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
406.2668 ++				     size_t __refs) 
406.2669 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
406.2670 ++    _M_name_timepunct(__s)
406.2671 ++    { 
406.2672 ++      char* __tmp = new char[std::strlen(__s) + 1];
406.2673 ++      std::strcpy(__tmp, __s);
406.2674 ++      _M_name_timepunct = __tmp;
406.2675 ++      _M_initialize_timepunct(__cloc); 
406.2676 ++    }
406.2677 ++
406.2678 ++  template<typename _CharT>
406.2679 ++    __timepunct<_CharT>::~__timepunct()
406.2680 ++    { 
406.2681 ++      if (_M_name_timepunct != _S_get_c_name())
406.2682 ++	delete [] _M_name_timepunct;
406.2683 ++      delete _M_data; 
406.2684 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
406.2685 ++    }
406.2686 +diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
406.2687 +--- gcc-4.3.0.orig/libstdc++-v3/configure	2008-02-29 01:00:39.000000000 +0100
406.2688 ++++ gcc-4.3.0/libstdc++-v3/configure	2008-06-10 14:45:35.000000000 +0200
406.2689 +@@ -14001,7 +14001,7 @@
406.2690 +   enableval="$enable_clocale"
406.2691 + 
406.2692 +       case "$enableval" in
406.2693 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
406.2694 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
406.2695 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
406.2696 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
406.2697 +    { (exit 1); exit 1; }; } ;;
406.2698 +@@ -14034,6 +14034,9 @@
406.2699 +   # Default to "generic".
406.2700 +   if test $enable_clocale_flag = auto; then
406.2701 +     case ${target_os} in
406.2702 ++      linux-uclibc*)
406.2703 ++        enable_clocale_flag=uclibc
406.2704 ++	;;
406.2705 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
406.2706 +         enable_clocale_flag=gnu
406.2707 +         ;;
406.2708 +@@ -14422,6 +14425,76 @@
406.2709 +       CTIME_CC=config/locale/generic/time_members.cc
406.2710 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
406.2711 +       ;;
406.2712 ++    uclibc)
406.2713 ++      echo "$as_me:$LINENO: result: uclibc" >&5
406.2714 ++echo "${ECHO_T}uclibc" >&6
406.2715 ++
406.2716 ++      # Declare intention to use gettext, and add support for specific
406.2717 ++      # languages.
406.2718 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
406.2719 ++      ALL_LINGUAS="de fr"
406.2720 ++
406.2721 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
406.2722 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
406.2723 ++set dummy msgfmt; ac_word=$2
406.2724 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
406.2725 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
406.2726 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
406.2727 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
406.2728 ++else
406.2729 ++  if test -n "$check_msgfmt"; then
406.2730 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
406.2731 ++else
406.2732 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
406.2733 ++for as_dir in $PATH
406.2734 ++do
406.2735 ++  IFS=$as_save_IFS
406.2736 ++  test -z "$as_dir" && as_dir=.
406.2737 ++  for ac_exec_ext in '' $ac_executable_extensions; do
406.2738 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
406.2739 ++    ac_cv_prog_check_msgfmt="yes"
406.2740 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
406.2741 ++    break 2
406.2742 ++  fi
406.2743 ++done
406.2744 ++done
406.2745 ++
406.2746 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
406.2747 ++fi
406.2748 ++fi
406.2749 ++check_msgfmt=$ac_cv_prog_check_msgfmt
406.2750 ++if test -n "$check_msgfmt"; then
406.2751 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
406.2752 ++echo "${ECHO_T}$check_msgfmt" >&6
406.2753 ++else
406.2754 ++  echo "$as_me:$LINENO: result: no" >&5
406.2755 ++echo "${ECHO_T}no" >&6
406.2756 ++fi
406.2757 ++
406.2758 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
406.2759 ++        USE_NLS=yes
406.2760 ++      fi
406.2761 ++      # Export the build objects.
406.2762 ++      for ling in $ALL_LINGUAS; do \
406.2763 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
406.2764 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
406.2765 ++      done
406.2766 ++
406.2767 ++
406.2768 ++
406.2769 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
406.2770 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
406.2771 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
406.2772 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
406.2773 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
406.2774 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
406.2775 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
406.2776 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
406.2777 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
406.2778 ++      CTIME_H=config/locale/uclibc/time_members.h
406.2779 ++      CTIME_CC=config/locale/uclibc/time_members.cc
406.2780 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
406.2781 ++      ;;
406.2782 +   esac
406.2783 + 
406.2784 +   # This is where the testsuite looks for locale catalogs, using the
406.2785 +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h
406.2786 +--- gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h	2007-03-04 23:59:49.000000000 +0100
406.2787 ++++ gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h	2008-06-10 14:45:35.000000000 +0200
406.2788 +@@ -106,7 +106,9 @@
406.2789 + using std::wmemcpy;
406.2790 + using std::wmemmove;
406.2791 + using std::wmemset;
406.2792 ++#if _GLIBCXX_HAVE_WCSFTIME
406.2793 + using std::wcsftime;
406.2794 ++#endif
406.2795 + 
406.2796 + #if _GLIBCXX_USE_C99
406.2797 + using std::wcstold;
   407.1 --- a/patches/gcc/4.3.0/325-superh-default-multilib.patch	Mon Jul 28 21:08:01 2008 +0000
   407.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   407.3 @@ -1,25 +0,0 @@
   407.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/53_all_gcc4-superh-default-multilib.patch
   407.5 -The gcc-3.x toolchains would contain all the targets by default.  With gcc-4,
   407.6 -you have to actually list out the multilibs you want or you will end up with
   407.7 -just one when using targets like 'sh4-linux-gnu'.
   407.8 -
   407.9 -The resulting toolchain can't even build a kernel as the kernel needs to build
  407.10 -with the nofpu flag to be sure that no fpu ops are generated.
  407.11 -
  407.12 -Here we restore the gcc-3.x behavior; the additional overhead of building all
  407.13 -of these multilibs by default is negligible.
  407.14 -
  407.15 -http://bugs.gentoo.org/140205
  407.16 -
  407.17 -diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc
  407.18 ---- gcc-4.3.0.orig/gcc/config.gcc	2008-01-29 17:28:10.000000000 +0100
  407.19 -+++ gcc-4.3.0/gcc/config.gcc	2008-06-10 14:44:47.000000000 +0200
  407.20 -@@ -2271,7 +2271,7 @@
  407.21 - 	if test x${sh_multilibs} = x ; then
  407.22 - 		case ${target} in
  407.23 - 		sh64-superh-linux* | \
  407.24 --		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
  407.25 -+		sh[1234]*)	sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
  407.26 - 		sh64* | sh5*)	sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
  407.27 - 		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
  407.28 - 		sh*-*-linux*)	sh_multilibs=m1,m3e,m4 ;;
   408.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   408.2 +++ b/patches/gcc/4.3.0/330-uclibc-locale-no__x.patch	Mon Jul 28 21:32:33 2008 +0000
   408.3 @@ -0,0 +1,224 @@
   408.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_203-uclibc-locale-no__x.patch
   408.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
   408.6 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:39.000000000 +0200
   408.7 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:39.000000000 +0200
   408.8 +@@ -60,4 +60,49 @@
   408.9 + extern "C" __typeof(wctype_l) __wctype_l;
  408.10 + #endif 
  408.11 + 
  408.12 ++# define __nl_langinfo_l nl_langinfo_l
  408.13 ++# define __strcoll_l strcoll_l
  408.14 ++# define __strftime_l strftime_l
  408.15 ++# define __strtod_l strtod_l
  408.16 ++# define __strtof_l strtof_l
  408.17 ++# define __strtold_l strtold_l
  408.18 ++# define __strxfrm_l strxfrm_l
  408.19 ++# define __newlocale newlocale
  408.20 ++# define __freelocale freelocale
  408.21 ++# define __duplocale duplocale
  408.22 ++# define __uselocale uselocale
  408.23 ++
  408.24 ++# ifdef _GLIBCXX_USE_WCHAR_T
  408.25 ++#  define __iswctype_l iswctype_l
  408.26 ++#  define __towlower_l towlower_l
  408.27 ++#  define __towupper_l towupper_l
  408.28 ++#  define __wcscoll_l wcscoll_l
  408.29 ++#  define __wcsftime_l wcsftime_l
  408.30 ++#  define __wcsxfrm_l wcsxfrm_l
  408.31 ++#  define __wctype_l wctype_l
  408.32 ++# endif
  408.33 ++
  408.34 ++#else
  408.35 ++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  408.36 ++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  408.37 ++# define __strtod_l(S, E, L)         strtod((S), (E))
  408.38 ++# define __strtof_l(S, E, L)         strtof((S), (E))
  408.39 ++# define __strtold_l(S, E, L)        strtold((S), (E))
  408.40 ++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  408.41 ++# warning should dummy __newlocale check for C|POSIX ?
  408.42 ++# define __newlocale(a, b, c)        NULL
  408.43 ++# define __freelocale(a)             ((void)0)
  408.44 ++# define __duplocale(a)              __c_locale()
  408.45 ++//# define __uselocale ?
  408.46 ++//
  408.47 ++# ifdef _GLIBCXX_USE_WCHAR_T
  408.48 ++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  408.49 ++#  define __towlower_l(C, L)          towlower((C))
  408.50 ++#  define __towupper_l(C, L)          towupper((C))
  408.51 ++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  408.52 ++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  408.53 ++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  408.54 ++#  define __wctype_l(S, L)            wctype((S))
  408.55 ++# endif
  408.56 ++
  408.57 + #endif // GLIBC 2.3 and later
  408.58 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
  408.59 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:39.000000000 +0200
  408.60 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:39.000000000 +0200
  408.61 +@@ -39,20 +39,6 @@
  408.62 + #include <langinfo.h>
  408.63 + #include <bits/c++locale_internal.h>
  408.64 + 
  408.65 +-#ifndef __UCLIBC_HAS_XLOCALE__
  408.66 +-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  408.67 +-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  408.68 +-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  408.69 +-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  408.70 +-#define __strtof_l(S, E, L)         strtof((S), (E))
  408.71 +-#define __strtod_l(S, E, L)         strtod((S), (E))
  408.72 +-#define __strtold_l(S, E, L)        strtold((S), (E))
  408.73 +-#warning should dummy __newlocale check for C|POSIX ?
  408.74 +-#define __newlocale(a, b, c)        NULL
  408.75 +-#define __freelocale(a)             ((void)0)
  408.76 +-#define __duplocale(a)              __c_locale()
  408.77 +-#endif
  408.78 +-
  408.79 + namespace std 
  408.80 + {
  408.81 +   template<>
  408.82 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
  408.83 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:39.000000000 +0200
  408.84 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:39.000000000 +0200
  408.85 +@@ -68,6 +68,7 @@
  408.86 + {
  408.87 +   extern "C" __typeof(uselocale) __uselocale;
  408.88 + }
  408.89 ++#define __uselocale uselocale
  408.90 + #endif
  408.91 + 
  408.92 + namespace std
  408.93 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
  408.94 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:39.000000000 +0200
  408.95 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:39.000000000 +0200
  408.96 +@@ -36,13 +36,6 @@
  408.97 + #include <locale>
  408.98 + #include <bits/c++locale_internal.h>
  408.99 + 
 408.100 +-#ifndef __UCLIBC_HAS_XLOCALE__
 408.101 +-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 408.102 +-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 408.103 +-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 408.104 +-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 408.105 +-#endif
 408.106 +-
 408.107 + namespace std
 408.108 + {
 408.109 +   // These are basically extensions to char_traits, and perhaps should
 408.110 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 408.111 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:39.000000000 +0200
 408.112 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:39.000000000 +0200
 408.113 +@@ -38,13 +38,6 @@
 408.114 + #undef _LIBC
 408.115 + #include <bits/c++locale_internal.h>
 408.116 + 
 408.117 +-#ifndef __UCLIBC_HAS_XLOCALE__
 408.118 +-#define __wctype_l(S, L)           wctype((S))
 408.119 +-#define __towupper_l(C, L)         towupper((C))
 408.120 +-#define __towlower_l(C, L)         towlower((C))
 408.121 +-#define __iswctype_l(C, M, L)      iswctype((C), (M))
 408.122 +-#endif
 408.123 +-
 408.124 + namespace std
 408.125 + {
 408.126 +   // NB: The other ctype<char> specializations are in src/locale.cc and
 408.127 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
 408.128 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:39.000000000 +0200
 408.129 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:39.000000000 +0200
 408.130 +@@ -39,13 +39,10 @@
 408.131 + #ifdef __UCLIBC_MJN3_ONLY__
 408.132 + #warning fix gettext stuff
 408.133 + #endif
 408.134 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 408.135 +-extern "C" char *__dcgettext(const char *domainname,
 408.136 +-			     const char *msgid, int category);
 408.137 + #undef gettext
 408.138 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 408.139 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 408.140 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 408.141 + #else
 408.142 +-#undef gettext
 408.143 + #define gettext(msgid) (msgid)
 408.144 + #endif
 408.145 + 
 408.146 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
 408.147 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:39.000000000 +0200
 408.148 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:39.000000000 +0200
 408.149 +@@ -36,15 +36,11 @@
 408.150 + #ifdef __UCLIBC_MJN3_ONLY__
 408.151 + #warning fix prototypes for *textdomain funcs
 408.152 + #endif
 408.153 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 408.154 +-extern "C" char *__textdomain(const char *domainname);
 408.155 +-extern "C" char *__bindtextdomain(const char *domainname,
 408.156 +-				  const char *dirname);
 408.157 +-#else
 408.158 +-#undef __textdomain
 408.159 +-#undef __bindtextdomain
 408.160 +-#define __textdomain(D)           ((void)0)
 408.161 +-#define __bindtextdomain(D,P)     ((void)0)
 408.162 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 408.163 ++#undef textdomain
 408.164 ++#undef bindtextdomain
 408.165 ++#define textdomain(D)           ((void)0)
 408.166 ++#define bindtextdomain(D,P)     ((void)0)
 408.167 + #endif
 408.168 + 
 408.169 +   // Non-virtual member functions.
 408.170 +@@ -70,7 +66,7 @@
 408.171 +     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 408.172 + 			   const char* __dir) const
 408.173 +     { 
 408.174 +-      __bindtextdomain(__s.c_str(), __dir);
 408.175 ++      bindtextdomain(__s.c_str(), __dir);
 408.176 +       return this->do_open(__s, __loc); 
 408.177 +     }
 408.178 + 
 408.179 +@@ -90,7 +86,7 @@
 408.180 +     { 
 408.181 +       // No error checking is done, assume the catalog exists and can
 408.182 +       // be used.
 408.183 +-      __textdomain(__s.c_str());
 408.184 ++      textdomain(__s.c_str());
 408.185 +       return 0;
 408.186 +     }
 408.187 + 
 408.188 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 408.189 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:39.000000000 +0200
 408.190 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:39.000000000 +0200
 408.191 +@@ -43,10 +43,6 @@
 408.192 + #warning tailor for stub locale support
 408.193 + #endif
 408.194 + 
 408.195 +-#ifndef __UCLIBC_HAS_XLOCALE__
 408.196 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 408.197 +-#endif
 408.198 +-
 408.199 + namespace std
 408.200 + {
 408.201 +   // Construct and return valid pattern consisting of some combination of:
 408.202 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 408.203 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:39.000000000 +0200
 408.204 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:39.000000000 +0200
 408.205 +@@ -41,9 +41,6 @@
 408.206 + #ifdef __UCLIBC_MJN3_ONLY__
 408.207 + #warning tailor for stub locale support
 408.208 + #endif
 408.209 +-#ifndef __UCLIBC_HAS_XLOCALE__
 408.210 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 408.211 +-#endif
 408.212 + 
 408.213 + namespace std
 408.214 + {
 408.215 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc
 408.216 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:39.000000000 +0200
 408.217 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:39.000000000 +0200
 408.218 +@@ -40,9 +40,6 @@
 408.219 + #ifdef __UCLIBC_MJN3_ONLY__
 408.220 + #warning tailor for stub locale support
 408.221 + #endif
 408.222 +-#ifndef __UCLIBC_HAS_XLOCALE__
 408.223 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 408.224 +-#endif
 408.225 + 
 408.226 + namespace std
 408.227 + {
   409.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   409.2 +++ b/patches/gcc/4.3.0/340-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:32:33 2008 +0000
   409.3 @@ -0,0 +1,51 @@
   409.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
   409.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   409.6 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:43.000000000 +0200
   409.7 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:43.000000000 +0200
   409.8 +@@ -401,7 +401,7 @@
   409.9 + # ifdef __UCLIBC_HAS_XLOCALE__
  409.10 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  409.11 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  409.12 +-# else
  409.13 ++# elif defined __UCLIBC_HAS_LOCALE__
  409.14 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  409.15 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  409.16 + # endif
  409.17 +@@ -556,7 +556,7 @@
  409.18 + # ifdef __UCLIBC_HAS_XLOCALE__
  409.19 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  409.20 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  409.21 +-# else
  409.22 ++# elif defined __UCLIBC_HAS_LOCALE__
  409.23 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  409.24 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  409.25 + # endif
  409.26 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  409.27 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:43.000000000 +0200
  409.28 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:43.000000000 +0200
  409.29 +@@ -127,12 +127,25 @@
  409.30 + 	{
  409.31 + 	  // Named locale.
  409.32 + 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  409.33 ++#ifdef __UCLIBC_MJN3_ONLY__
  409.34 ++#warning fix this... should be numeric
  409.35 ++#endif
  409.36 ++#ifdef __UCLIBC__
  409.37 ++# ifdef __UCLIBC_HAS_XLOCALE__
  409.38 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  409.39 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  409.40 ++# elif defined __UCLIBC_HAS_LOCALE__
  409.41 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  409.42 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  409.43 ++# endif
  409.44 ++#else
  409.45 + 	  union { char *__s; wchar_t __w; } __u;
  409.46 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  409.47 + 	  _M_data->_M_decimal_point = __u.__w;
  409.48 + 
  409.49 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  409.50 + 	  _M_data->_M_thousands_sep = __u.__w;
  409.51 ++#endif
  409.52 + 
  409.53 + 	  if (_M_data->_M_thousands_sep == L'\0')
  409.54 + 	    _M_data->_M_grouping = "";
   410.1 --- a/patches/gcc/4.3.0/350-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   410.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   410.3 @@ -1,56 +0,0 @@
   410.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/54_all_300-libstdc++-pic.patch
   410.5 -install libstdc++_pic.a if we have pic objs
   410.6 -
   410.7 -diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am gcc-4.3.0/libstdc++-v3/src/Makefile.am
   410.8 ---- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am	2008-02-29 19:26:50.000000000 +0100
   410.9 -+++ gcc-4.3.0/libstdc++-v3/src/Makefile.am	2008-06-10 14:44:51.000000000 +0200
  410.10 -@@ -289,6 +289,13 @@
  410.11 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
  410.12 - 
  410.13 - 
  410.14 -+install-exec-local:
  410.15 -+	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  410.16 -+	if [ x"$$pic_objs" != x ]; then \
  410.17 -+		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  410.18 -+		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  410.19 -+	fi
  410.20 -+
  410.21 - # Added bits to build debug library.
  410.22 - if GLIBCXX_BUILD_DEBUG
  410.23 - all-local: build_debug
  410.24 -diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in gcc-4.3.0/libstdc++-v3/src/Makefile.in
  410.25 ---- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in	2008-02-29 19:26:50.000000000 +0100
  410.26 -+++ gcc-4.3.0/libstdc++-v3/src/Makefile.in	2008-06-10 14:44:51.000000000 +0200
  410.27 -@@ -693,7 +693,7 @@
  410.28 - 
  410.29 - install-data-am: install-data-local
  410.30 - 
  410.31 --install-exec-am: install-toolexeclibLTLIBRARIES
  410.32 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  410.33 - 
  410.34 - install-info: install-info-am
  410.35 - 
  410.36 -@@ -732,7 +732,7 @@
  410.37 - 	maintainer-clean-generic mostlyclean mostlyclean-compile \
  410.38 - 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  410.39 - 	tags uninstall uninstall-am uninstall-info-am \
  410.40 --	uninstall-toolexeclibLTLIBRARIES
  410.41 -+	uninstall-toolexeclibLTLIBRARIES install-exec-local
  410.42 - 
  410.43 - 
  410.44 - # Symbol versioning for shared libraries.
  410.45 -@@ -858,6 +858,14 @@
  410.46 - install_debug:
  410.47 - 	(cd ${debugdir} && $(MAKE) \
  410.48 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  410.49 -+
  410.50 -+install-exec-local:
  410.51 -+	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  410.52 -+	if [ x"$$pic_objs" != x ]; then \
  410.53 -+		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  410.54 -+		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  410.55 -+	fi
  410.56 -+
  410.57 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  410.58 - # Otherwise a system limit (for SysV at least) may be exceeded.
  410.59 - .NOEXPORT:
   411.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   411.2 +++ b/patches/gcc/4.3.0/350-uclibc-locale-update.patch	Mon Jul 28 21:32:33 2008 +0000
   411.3 @@ -0,0 +1,355 @@
   411.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_205-uclibc-locale-update.patch
   411.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
   411.6 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:43.000000000 +0200
   411.7 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:46.000000000 +0200
   411.8 +@@ -46,16 +46,13 @@
   411.9 +     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
  411.10 + 		   const __c_locale& __cloc)
  411.11 +     {
  411.12 +-      if (!(__err & ios_base::failbit))
  411.13 +-	{
  411.14 +-	  char* __sanity;
  411.15 +-	  errno = 0;
  411.16 +-	  float __f = __strtof_l(__s, &__sanity, __cloc);
  411.17 +-          if (__sanity != __s && errno != ERANGE)
  411.18 +-	    __v = __f;
  411.19 +-	  else
  411.20 +-	    __err |= ios_base::failbit;
  411.21 +-	}
  411.22 ++      char* __sanity;
  411.23 ++      errno = 0;
  411.24 ++      float __f = __strtof_l(__s, &__sanity, __cloc);
  411.25 ++      if (__sanity != __s && errno != ERANGE)
  411.26 ++	__v = __f;
  411.27 ++      else
  411.28 ++	__err |= ios_base::failbit;
  411.29 +     }
  411.30 + 
  411.31 +   template<>
  411.32 +@@ -63,16 +60,13 @@
  411.33 +     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  411.34 + 		   const __c_locale& __cloc)
  411.35 +     {
  411.36 +-      if (!(__err & ios_base::failbit))
  411.37 +-	{
  411.38 +-	  char* __sanity;
  411.39 +-	  errno = 0;
  411.40 +-	  double __d = __strtod_l(__s, &__sanity, __cloc);
  411.41 +-          if (__sanity != __s && errno != ERANGE)
  411.42 +-	    __v = __d;
  411.43 +-	  else
  411.44 +-	    __err |= ios_base::failbit;
  411.45 +-	}
  411.46 ++      char* __sanity;
  411.47 ++      errno = 0;
  411.48 ++      double __d = __strtod_l(__s, &__sanity, __cloc);
  411.49 ++      if (__sanity != __s && errno != ERANGE)
  411.50 ++	__v = __d;
  411.51 ++      else
  411.52 ++	__err |= ios_base::failbit;
  411.53 +     }
  411.54 + 
  411.55 +   template<>
  411.56 +@@ -80,16 +74,13 @@
  411.57 +     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  411.58 + 		   const __c_locale& __cloc)
  411.59 +     {
  411.60 +-      if (!(__err & ios_base::failbit))
  411.61 +-	{
  411.62 +-	  char* __sanity;
  411.63 +-	  errno = 0;
  411.64 +-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  411.65 +-          if (__sanity != __s && errno != ERANGE)
  411.66 +-	    __v = __ld;
  411.67 +-	  else
  411.68 +-	    __err |= ios_base::failbit;
  411.69 +-	}
  411.70 ++      char* __sanity;
  411.71 ++      errno = 0;
  411.72 ++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  411.73 ++      if (__sanity != __s && errno != ERANGE)
  411.74 ++	__v = __ld;
  411.75 ++      else
  411.76 ++	__err |= ios_base::failbit;
  411.77 +     }
  411.78 + 
  411.79 +   void
  411.80 +@@ -110,7 +101,7 @@
  411.81 +   void
  411.82 +   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  411.83 +   {
  411.84 +-    if (_S_get_c_locale() != __cloc)
  411.85 ++    if (__cloc && _S_get_c_locale() != __cloc)
  411.86 +       __freelocale(__cloc); 
  411.87 +   }
  411.88 + 
  411.89 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
  411.90 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:43.000000000 +0200
  411.91 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:46.000000000 +0200
  411.92 +@@ -39,21 +39,23 @@
  411.93 + #pragma GCC system_header
  411.94 + 
  411.95 + #include <cstring>              // get std::strlen
  411.96 +-#include <cstdio>               // get std::snprintf or std::sprintf
  411.97 ++#include <cstdio>               // get std::vsnprintf or std::vsprintf
  411.98 + #include <clocale>
  411.99 + #include <langinfo.h>		// For codecvt
 411.100 + #ifdef __UCLIBC_MJN3_ONLY__
 411.101 + #warning fix this
 411.102 + #endif
 411.103 +-#ifdef __UCLIBC_HAS_LOCALE__
 411.104 ++#ifdef _GLIBCXX_USE_ICONV
 411.105 + #include <iconv.h>		// For codecvt using iconv, iconv_t
 411.106 + #endif
 411.107 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 411.108 +-#include <libintl.h> 		// For messages
 411.109 ++#ifdef HAVE_LIBINTL_H
 411.110 ++#include <libintl.h>		// For messages
 411.111 + #endif
 411.112 ++#include <cstdarg>
 411.113 + 
 411.114 + #ifdef __UCLIBC_MJN3_ONLY__
 411.115 + #warning what is _GLIBCXX_C_LOCALE_GNU for
 411.116 ++// psm: used in os/gnu-linux/ctype_noninline.h
 411.117 + #endif
 411.118 + #define _GLIBCXX_C_LOCALE_GNU 1
 411.119 + 
 411.120 +@@ -62,7 +64,7 @@
 411.121 + #endif
 411.122 + // #define _GLIBCXX_NUM_CATEGORIES 6
 411.123 + #define _GLIBCXX_NUM_CATEGORIES 0
 411.124 +- 
 411.125 ++
 411.126 + #ifdef __UCLIBC_HAS_XLOCALE__
 411.127 + namespace __gnu_cxx
 411.128 + {
 411.129 +@@ -79,22 +81,24 @@
 411.130 +   typedef int*			__c_locale;
 411.131 + #endif
 411.132 + 
 411.133 +-  // Convert numeric value of type _Tv to string and return length of
 411.134 +-  // string.  If snprintf is available use it, otherwise fall back to
 411.135 +-  // the unsafe sprintf which, in general, can be dangerous and should
 411.136 ++  // Convert numeric value of type double to string and return length of
 411.137 ++  // string.  If vsnprintf is available use it, otherwise fall back to
 411.138 ++  // the unsafe vsprintf which, in general, can be dangerous and should
 411.139 +   // be avoided.
 411.140 +-  template<typename _Tv>
 411.141 +-    int
 411.142 +-    __convert_from_v(char* __out, 
 411.143 +-		     const int __size __attribute__ ((__unused__)),
 411.144 +-		     const char* __fmt,
 411.145 +-#ifdef __UCLIBC_HAS_XCLOCALE__
 411.146 +-		     _Tv __v, const __c_locale& __cloc, int __prec)
 411.147 ++    inline int
 411.148 ++    __convert_from_v(const __c_locale&
 411.149 ++#ifndef __UCLIBC_HAS_XCLOCALE__
 411.150 ++					__cloc __attribute__ ((__unused__))
 411.151 ++#endif
 411.152 ++		     ,
 411.153 ++		     char* __out,
 411.154 ++		     const int __size,
 411.155 ++		     const char* __fmt, ...)
 411.156 +     {
 411.157 ++      va_list __args;
 411.158 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 411.159 +       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 411.160 + #else
 411.161 +-		     _Tv __v, const __c_locale&, int __prec)
 411.162 +-    {
 411.163 + # ifdef __UCLIBC_HAS_LOCALE__
 411.164 +       char* __old = std::setlocale(LC_ALL, NULL);
 411.165 +       char* __sav = new char[std::strlen(__old) + 1];
 411.166 +@@ -103,7 +107,9 @@
 411.167 + # endif
 411.168 + #endif
 411.169 + 
 411.170 +-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 411.171 ++      va_start(__args, __fmt);
 411.172 ++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 411.173 ++      va_end(__args);
 411.174 + 
 411.175 + #ifdef __UCLIBC_HAS_XCLOCALE__
 411.176 +       __gnu_cxx::__uselocale(__old);
 411.177 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 411.178 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:43.000000000 +0200
 411.179 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:46.000000000 +0200
 411.180 +@@ -33,9 +33,14 @@
 411.181 + 
 411.182 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 411.183 + 
 411.184 ++#include <features.h>
 411.185 ++#ifdef __UCLIBC_HAS_LOCALE__
 411.186 + #define _LIBC
 411.187 + #include <locale>
 411.188 + #undef _LIBC
 411.189 ++#else
 411.190 ++#include <locale>
 411.191 ++#endif
 411.192 + #include <bits/c++locale_internal.h>
 411.193 + 
 411.194 + namespace std
 411.195 +@@ -138,20 +143,34 @@
 411.196 +   ctype<wchar_t>::
 411.197 +   do_is(mask __m, wchar_t __c) const
 411.198 +   { 
 411.199 +-    // Highest bitmask in ctype_base == 10, but extra in "C"
 411.200 +-    // library for blank.
 411.201 ++    // The case of __m == ctype_base::space is particularly important,
 411.202 ++    // due to its use in many istream functions.  Therefore we deal with
 411.203 ++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 411.204 ++    // is the mask corresponding to ctype_base::space.  NB: an encoding
 411.205 ++    // change would not affect correctness!
 411.206 +     bool __ret = false;
 411.207 +-    const size_t __bitmasksize = 11; 
 411.208 +-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 411.209 +-      if (__m & _M_bit[__bitcur]
 411.210 +-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 411.211 +-	{
 411.212 +-	  __ret = true;
 411.213 +-	  break;
 411.214 +-	}
 411.215 ++    if (__m == _M_bit[5])
 411.216 ++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 411.217 ++    else
 411.218 ++      {
 411.219 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 411.220 ++	// library for blank.
 411.221 ++	const size_t __bitmasksize = 11;
 411.222 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 411.223 ++	  if (__m & _M_bit[__bitcur])
 411.224 ++	    {
 411.225 ++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 411.226 ++		{
 411.227 ++		  __ret = true;
 411.228 ++		  break;
 411.229 ++		}
 411.230 ++	      else if (__m == _M_bit[__bitcur])
 411.231 ++		break;
 411.232 ++	    }
 411.233 ++      }
 411.234 +     return __ret;    
 411.235 +   }
 411.236 +-  
 411.237 ++
 411.238 +   const wchar_t* 
 411.239 +   ctype<wchar_t>::
 411.240 +   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 411.241 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
 411.242 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:43.000000000 +0200
 411.243 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:46.000000000 +0200
 411.244 +@@ -47,18 +47,21 @@
 411.245 +   template<typename _CharT>
 411.246 +      messages<_CharT>::messages(size_t __refs)
 411.247 +      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 411.248 +-     _M_name_messages(_S_get_c_name())
 411.249 ++       _M_name_messages(_S_get_c_name())
 411.250 +      { }
 411.251 + 
 411.252 +   template<typename _CharT>
 411.253 +      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 411.254 + 				size_t __refs) 
 411.255 +-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 411.256 +-     _M_name_messages(__s)
 411.257 ++     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 411.258 +      {
 411.259 +-       char* __tmp = new char[std::strlen(__s) + 1];
 411.260 +-       std::strcpy(__tmp, __s);
 411.261 ++       const size_t __len = std::strlen(__s) + 1;
 411.262 ++       char* __tmp = new char[__len];
 411.263 ++       std::memcpy(__tmp, __s, __len);
 411.264 +        _M_name_messages = __tmp;
 411.265 ++
 411.266 ++       // Last to avoid leaking memory if new throws.
 411.267 ++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 411.268 +      }
 411.269 + 
 411.270 +   template<typename _CharT>
 411.271 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 411.272 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:46.000000000 +0200
 411.273 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:46.000000000 +0200
 411.274 +@@ -33,9 +33,14 @@
 411.275 + 
 411.276 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 411.277 + 
 411.278 ++#include <features.h>
 411.279 ++#ifdef __UCLIBC_HAS_LOCALE__
 411.280 + #define _LIBC
 411.281 + #include <locale>
 411.282 + #undef _LIBC
 411.283 ++#else
 411.284 ++#include <locale>
 411.285 ++#endif
 411.286 + #include <bits/c++locale_internal.h>
 411.287 + 
 411.288 + #ifdef __UCLIBC_MJN3_ONLY__
 411.289 +@@ -206,7 +211,7 @@
 411.290 + 	  }
 411.291 + 	break;
 411.292 +       default:
 411.293 +-	;
 411.294 ++	__ret = pattern();
 411.295 +       }
 411.296 +     return __ret;
 411.297 +   }
 411.298 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 411.299 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:46.000000000 +0200
 411.300 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:46.000000000 +0200
 411.301 +@@ -33,9 +33,14 @@
 411.302 + 
 411.303 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 411.304 + 
 411.305 ++#include <features.h>
 411.306 ++#ifdef __UCLIBC_HAS_LOCALE__
 411.307 + #define _LIBC
 411.308 + #include <locale>
 411.309 + #undef _LIBC
 411.310 ++#else
 411.311 ++#include <locale>
 411.312 ++#endif
 411.313 + #include <bits/c++locale_internal.h>
 411.314 + 
 411.315 + #ifdef __UCLIBC_MJN3_ONLY__
 411.316 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
 411.317 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:39.000000000 +0200
 411.318 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:46.000000000 +0200
 411.319 +@@ -37,25 +37,33 @@
 411.320 +   template<typename _CharT>
 411.321 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
 411.322 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 411.323 +-    _M_name_timepunct(_S_get_c_name())
 411.324 ++      _M_name_timepunct(_S_get_c_name())
 411.325 +     { _M_initialize_timepunct(); }
 411.326 + 
 411.327 +   template<typename _CharT>
 411.328 +     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 411.329 +     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 411.330 +-    _M_name_timepunct(_S_get_c_name())
 411.331 ++      _M_name_timepunct(_S_get_c_name())
 411.332 +     { _M_initialize_timepunct(); }
 411.333 + 
 411.334 +   template<typename _CharT>
 411.335 +     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 411.336 + 				     size_t __refs) 
 411.337 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 411.338 +-    _M_name_timepunct(__s)
 411.339 ++      _M_name_timepunct(NULL)
 411.340 +     { 
 411.341 +-      char* __tmp = new char[std::strlen(__s) + 1];
 411.342 +-      std::strcpy(__tmp, __s);
 411.343 ++      const size_t __len = std::strlen(__s) + 1;
 411.344 ++      char* __tmp = new char[__len];
 411.345 ++      std::memcpy(__tmp, __s, __len);
 411.346 +       _M_name_timepunct = __tmp;
 411.347 +-      _M_initialize_timepunct(__cloc); 
 411.348 ++
 411.349 ++      try
 411.350 ++	{ _M_initialize_timepunct(__cloc); }
 411.351 ++      catch(...)
 411.352 ++	{
 411.353 ++	  delete [] _M_name_timepunct;
 411.354 ++	  __throw_exception_again;
 411.355 ++	}
 411.356 +     }
 411.357 + 
 411.358 +   template<typename _CharT>
   412.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   412.2 +++ b/patches/gcc/4.3.0/360-missing-execinfo_h.patch	Mon Jul 28 21:32:33 2008 +0000
   412.3 @@ -0,0 +1,13 @@
   412.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_301-missing-execinfo_h.patch
   412.5 +diff -durN gcc-4.3.0.orig/boehm-gc/include/gc.h gcc-4.3.0/boehm-gc/include/gc.h
   412.6 +--- gcc-4.3.0.orig/boehm-gc/include/gc.h	2007-04-23 23:10:09.000000000 +0200
   412.7 ++++ gcc-4.3.0/boehm-gc/include/gc.h	2008-06-10 14:45:50.000000000 +0200
   412.8 +@@ -503,7 +503,7 @@
   412.9 + #if defined(__linux__) || defined(__GLIBC__)
  412.10 + # include <features.h>
  412.11 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  412.12 +-     && !defined(__ia64__)
  412.13 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  412.14 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  412.15 + #     define GC_HAVE_BUILTIN_BACKTRACE
  412.16 + #   endif
   413.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   413.2 +++ b/patches/gcc/4.3.0/370-c99-complex-ugly-hack.patch	Mon Jul 28 21:32:33 2008 +0000
   413.3 @@ -0,0 +1,14 @@
   413.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_303-c99-complex-ugly-hack.patch
   413.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
   413.6 +--- gcc-4.3.0.orig/libstdc++-v3/configure	2008-06-10 14:45:39.000000000 +0200
   413.7 ++++ gcc-4.3.0/libstdc++-v3/configure	2008-06-10 14:45:54.000000000 +0200
   413.8 +@@ -39006,6 +39006,9 @@
   413.9 + cat >>conftest.$ac_ext <<_ACEOF
  413.10 + /* end confdefs.h.  */
  413.11 + #include <complex.h>
  413.12 ++#ifdef __UCLIBC__
  413.13 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  413.14 ++#endif
  413.15 + int
  413.16 + main ()
  413.17 + {
   414.1 --- a/patches/gcc/4.3.0/375-pr35440.patch	Mon Jul 28 21:08:01 2008 +0000
   414.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   414.3 @@ -1,59 +0,0 @@
   414.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/60_all_gcc43-pr35440.patch
   414.5 -2008-03-19  Jakub Jelinek  <jakub@redhat.com>
   414.6 -
   414.7 -	PR c/35440
   414.8 -	* c-pretty-print.c (pp_c_initializer_list): Handle CONSTRUCTOR
   414.9 -	for all types.
  414.10 -
  414.11 -	* gcc.dg/pr35440.c: New test.
  414.12 -
  414.13 -diff -durN gcc-4.3.0.orig/gcc/c-pretty-print.c gcc-4.3.0/gcc/c-pretty-print.c
  414.14 ---- gcc-4.3.0.orig/gcc/c-pretty-print.c	2008-01-29 14:59:59.000000000 +0100
  414.15 -+++ gcc-4.3.0/gcc/c-pretty-print.c	2008-06-10 14:44:54.000000000 +0200
  414.16 -@@ -1173,6 +1173,12 @@
  414.17 -   tree type = TREE_TYPE (e);
  414.18 -   const enum tree_code code = TREE_CODE (type);
  414.19 - 
  414.20 -+  if (TREE_CODE (e) == CONSTRUCTOR)
  414.21 -+    {
  414.22 -+      pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
  414.23 -+      return;
  414.24 -+    }
  414.25 -+
  414.26 -   switch (code)
  414.27 -     {
  414.28 -     case RECORD_TYPE:
  414.29 -@@ -1207,16 +1213,12 @@
  414.30 -     case VECTOR_TYPE:
  414.31 -       if (TREE_CODE (e) == VECTOR_CST)
  414.32 - 	pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e));
  414.33 --      else if (TREE_CODE (e) == CONSTRUCTOR)
  414.34 --	pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
  414.35 -       else
  414.36 - 	break;
  414.37 -       return;
  414.38 - 
  414.39 -     case COMPLEX_TYPE:
  414.40 --      if (TREE_CODE (e) == CONSTRUCTOR)
  414.41 --	pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
  414.42 --      else if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
  414.43 -+      if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
  414.44 - 	{
  414.45 - 	  const bool cst = TREE_CODE (e) == COMPLEX_CST;
  414.46 - 	  pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0));
  414.47 -diff -durN gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c
  414.48 ---- gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c	1970-01-01 01:00:00.000000000 +0100
  414.49 -+++ gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c	2008-06-10 14:44:54.000000000 +0200
  414.50 -@@ -0,0 +1,12 @@
  414.51 -+/* PR c/35440 */
  414.52 -+/* { dg-do compile } */
  414.53 -+/* { dg-options "-std=gnu99" } */
  414.54 -+
  414.55 -+struct A {};
  414.56 -+struct B { int i; char j[2]; };
  414.57 -+
  414.58 -+void foo (void)
  414.59 -+{
  414.60 -+  (struct A){}();			/* { dg-error "called object" } */
  414.61 -+  (struct B){ .i = 2, .j[1] = 1 }();	/* { dg-error "called object" } */
  414.62 -+}
   415.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   415.2 +++ b/patches/gcc/4.3.0/380-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
   415.3 @@ -0,0 +1,27 @@
   415.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_304-index_macro.patch
   415.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/rope gcc-4.3.0/libstdc++-v3/include/ext/rope
   415.6 +--- gcc-4.3.0.orig/libstdc++-v3/include/ext/rope	2008-01-31 19:44:55.000000000 +0100
   415.7 ++++ gcc-4.3.0/libstdc++-v3/include/ext/rope	2008-06-10 14:45:58.000000000 +0200
   415.8 +@@ -59,6 +59,9 @@
   415.9 + #include <bits/gthr.h>
  415.10 + #include <tr1/functional>
  415.11 + 
  415.12 ++/* cope w/ index defined as macro, SuSv3 proposal */
  415.13 ++#undef index
  415.14 ++
  415.15 + # ifdef __GC
  415.16 + #   define __GC_CONST const
  415.17 + # else
  415.18 +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h
  415.19 +--- gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h	2007-05-04 17:06:46.000000000 +0200
  415.20 ++++ gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h	2008-06-10 14:45:58.000000000 +0200
  415.21 +@@ -54,6 +54,9 @@
  415.22 + #include <ext/memory> // For uninitialized_copy_n
  415.23 + #include <ext/numeric> // For power
  415.24 + 
  415.25 ++/* cope w/ index defined as macro, SuSv3 proposal */
  415.26 ++#undef index
  415.27 ++
  415.28 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  415.29 + 
  415.30 +   using std::size_t;
   416.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   416.2 +++ b/patches/gcc/4.3.0/390-libmudflap-susv3-legacy.patch	Mon Jul 28 21:32:33 2008 +0000
   416.3 @@ -0,0 +1,49 @@
   416.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_305-libmudflap-susv3-legacy.patch
   416.5 +diff -durN gcc-4.3.0.orig/libmudflap/mf-hooks2.c gcc-4.3.0/libmudflap/mf-hooks2.c
   416.6 +--- gcc-4.3.0.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   416.7 ++++ gcc-4.3.0/libmudflap/mf-hooks2.c	2008-06-10 14:46:02.000000000 +0200
   416.8 +@@ -427,7 +427,7 @@
   416.9 + {
  416.10 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  416.11 +   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  416.12 +-  bzero (s, n);
  416.13 ++  memset (s, 0, n);
  416.14 + }
  416.15 + 
  416.16 + 
  416.17 +@@ -437,7 +437,7 @@
  416.18 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  416.19 +   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  416.20 +   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  416.21 +-  bcopy (src, dest, n);
  416.22 ++  memmove (dest, src, n);
  416.23 + }
  416.24 + 
  416.25 + 
  416.26 +@@ -447,7 +447,7 @@
  416.27 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  416.28 +   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  416.29 +   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  416.30 +-  return bcmp (s1, s2, n);
  416.31 ++  return memcmp (s1, s2, n);
  416.32 + }
  416.33 + 
  416.34 + 
  416.35 +@@ -456,7 +456,7 @@
  416.36 +   size_t n = strlen (s);
  416.37 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  416.38 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  416.39 +-  return index (s, c);
  416.40 ++  return strchr (s, c);
  416.41 + }
  416.42 + 
  416.43 + 
  416.44 +@@ -465,7 +465,7 @@
  416.45 +   size_t n = strlen (s);
  416.46 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  416.47 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  416.48 +-  return rindex (s, c);
  416.49 ++  return strrchr (s, c);
  416.50 + }
  416.51 + 
  416.52 + /* XXX:  stpcpy, memccpy */
   417.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   417.2 +++ b/patches/gcc/4.3.0/400-libstdc++-namespace.patch	Mon Jul 28 21:32:33 2008 +0000
   417.3 @@ -0,0 +1,38 @@
   417.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_306-libstdc++-namespace.patch
   417.5 +diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
   417.6 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
   417.7 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:50.000000000 +0200
   417.8 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:46:05.000000000 +0200
   417.9 +@@ -32,7 +32,8 @@
  417.10 + //
  417.11 + 
  417.12 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  417.13 +-
  417.14 ++namespace std
  417.15 ++{
  417.16 + #ifdef __UCLIBC_MJN3_ONLY__
  417.17 + #warning fix prototypes for *textdomain funcs
  417.18 + #endif
  417.19 +@@ -115,3 +116,4 @@
  417.20 + 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  417.21 + 	 }
  417.22 +      }
  417.23 ++}
  417.24 +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
  417.25 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:50.000000000 +0200
  417.26 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:46:05.000000000 +0200
  417.27 +@@ -33,7 +33,8 @@
  417.28 + //
  417.29 + 
  417.30 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  417.31 +-
  417.32 ++namespace std
  417.33 ++{
  417.34 +   template<typename _CharT>
  417.35 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
  417.36 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  417.37 +@@ -74,3 +75,4 @@
  417.38 +       delete _M_data; 
  417.39 +       _S_destroy_c_locale(_M_c_locale_timepunct); 
  417.40 +     }
  417.41 ++}
   418.1 --- a/patches/gcc/4.3.0/400-pr24170.patch	Mon Jul 28 21:08:01 2008 +0000
   418.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   418.3 @@ -1,61 +0,0 @@
   418.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc43-pr24170.patch
   418.5 -http://gcc.gnu.org/PR24170
   418.6 -
   418.7 -2008-02-20  Tom Tromey  <tromey@redhat.com>
   418.8 -
   418.9 -	PR libgcj/24170:
  418.10 -	* java/io/natFilePosix.cc (File::performList): Don't use
  418.11 -	readdir_r.
  418.12 -	* configure, include/config.h.in: Rebuilt.
  418.13 -	* configure.ac: Don't check for readdir_r.
  418.14 -
  418.15 -diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac
  418.16 ---- gcc-4.3.0.orig/libjava/configure.ac	2008-06-10 14:44:17.000000000 +0200
  418.17 -+++ gcc-4.3.0/libjava/configure.ac	2008-06-10 14:44:58.000000000 +0200
  418.18 -@@ -1030,7 +1030,7 @@
  418.19 -    PLATFORMNET=NoNet
  418.20 - else
  418.21 -    AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
  418.22 --                   localtime_r readdir_r getpwuid_r getcwd \
  418.23 -+                   localtime_r getpwuid_r getcwd \
  418.24 - 		   access stat lstat mkdir rename rmdir unlink utime chmod readlink \
  418.25 - 		   nl_langinfo setlocale \
  418.26 - 		   inet_pton uname inet_ntoa \
  418.27 -diff -durN gcc-4.3.0.orig/libjava/include/config.h.in gcc-4.3.0/libjava/include/config.h.in
  418.28 ---- gcc-4.3.0.orig/libjava/include/config.h.in	2007-07-31 18:17:21.000000000 +0200
  418.29 -+++ gcc-4.3.0/libjava/include/config.h.in	2008-06-10 14:44:58.000000000 +0200
  418.30 -@@ -214,9 +214,6 @@
  418.31 - /* Define to 1 if you have the <pwd.h> header file. */
  418.32 - #undef HAVE_PWD_H
  418.33 - 
  418.34 --/* Define to 1 if you have the `readdir_r' function. */
  418.35 --#undef HAVE_READDIR_R
  418.36 --
  418.37 - /* Define to 1 if you have the `readlink' function. */
  418.38 - #undef HAVE_READLINK
  418.39 - 
  418.40 -diff -durN gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc gcc-4.3.0/libjava/java/io/natFilePosix.cc
  418.41 ---- gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc	2007-08-04 23:50:01.000000000 +0200
  418.42 -+++ gcc-4.3.0/libjava/java/io/natFilePosix.cc	2008-06-10 14:44:58.000000000 +0200
  418.43 -@@ -1,6 +1,6 @@
  418.44 - // natFile.cc - Native part of File class for POSIX.
  418.45 - 
  418.46 --/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
  418.47 -+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
  418.48 -    Free Software Foundation
  418.49 - 
  418.50 -    This file is part of libgcj.
  418.51 -@@ -292,13 +292,7 @@
  418.52 - 
  418.53 -   java::util::ArrayList *list = new java::util::ArrayList ();
  418.54 -   struct dirent *d;
  418.55 --#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
  418.56 --  int name_max = pathconf (buf, _PC_NAME_MAX);
  418.57 --  char dbuf[sizeof (struct dirent) + name_max + 1];
  418.58 --  while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
  418.59 --#else /* HAVE_READDIR_R */
  418.60 -   while ((d = readdir (dir)) != NULL)
  418.61 --#endif /* HAVE_READDIR_R */
  418.62 -     {
  418.63 -       // Omit "." and "..".
  418.64 -       if (d->d_name[0] == '.'
   419.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   419.2 +++ b/patches/gcc/4.3.0/410-arm-softfloat.patch	Mon Jul 28 21:32:33 2008 +0000
   419.3 @@ -0,0 +1,29 @@
   419.4 +diff -durN gcc-4.3.1.orig/gcc/config/arm/linux-elf.h gcc-4.3.1/gcc/config/arm/linux-elf.h
   419.5 +--- gcc-4.3.1.orig/gcc/config/arm/linux-elf.h	2007-11-08 14:44:09.000000000 +0100
   419.6 ++++ gcc-4.3.1/gcc/config/arm/linux-elf.h	2008-07-23 15:30:57.000000000 +0200
   419.7 +@@ -60,7 +60,7 @@
   419.8 +    %{shared:-lc} \
   419.9 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  419.10 + 
  419.11 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  419.12 ++#define LIBGCC_SPEC "-lgcc"
  419.13 + 
  419.14 + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  419.15 + 
  419.16 +diff -durN gcc-4.3.1.orig/gcc/config/arm/t-linux gcc-4.3.1/gcc/config/arm/t-linux
  419.17 +--- gcc-4.3.1.orig/gcc/config/arm/t-linux	2006-11-09 23:14:27.000000000 +0100
  419.18 ++++ gcc-4.3.1/gcc/config/arm/t-linux	2008-07-23 19:15:25.000000000 +0200
  419.19 +@@ -3,7 +3,12 @@
  419.20 + TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
  419.21 + 
  419.22 + LIB1ASMSRC = arm/lib1funcs.asm
  419.23 +-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
  419.24 ++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
  419.25 ++	_call_via_rX _interwork_call_via_rX \
  419.26 ++	_lshrdi3 _ashrdi3 _ashldi3 \
  419.27 ++	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
  419.28 ++	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
  419.29 ++	_fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf
  419.30 + 
  419.31 + # MULTILIB_OPTIONS = mhard-float/msoft-float
  419.32 + # MULTILIB_DIRNAMES = hard-float soft-float
   420.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   420.2 +++ b/patches/gcc/4.3.0/420-alpha-signal_h.patch	Mon Jul 28 21:32:33 2008 +0000
   420.3 @@ -0,0 +1,17 @@
   420.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   420.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   420.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   420.7 + /* Do code reading to identify a signal frame, and set the frame
   420.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
   420.9 + 
  420.10 ++/* Don't use this if inhibit_libc is set
  420.11 ++   The build for this target will fail trying to include missing headers */
  420.12 ++#ifndef inhibit_libc
  420.13 + #include <signal.h>
  420.14 + #include <sys/ucontext.h>
  420.15 + 
  420.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  420.17 +   fs->retaddr_column = 64;
  420.18 +   return _URC_NO_REASON;
  420.19 + }
  420.20 ++#endif /* inhibit_libc */
   421.1 --- a/patches/gcc/4.3.0/425-noteGNUstack-00.patch	Mon Jul 28 21:08:01 2008 +0000
   421.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   421.3 @@ -1,96 +0,0 @@
   421.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
   421.5 -2004-09-20  Jakub Jelinek  <jakub@redhat.com>
   421.6 -
   421.7 -	* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
   421.8 -	on ppc64-linux.
   421.9 -
  421.10 -	* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
  421.11 -	ia64-linux.
  421.12 -	* config/ia64/crtbegin.asm: Likewise.
  421.13 -	* config/ia64/crtend.asm: Likewise.
  421.14 -	* config/ia64/crti.asm: Likewise.
  421.15 -	* config/ia64/crtn.asm: Likewise.
  421.16 -
  421.17 -2004-05-14  Jakub Jelinek  <jakub@redhat.com>
  421.18 -
  421.19 -	* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
  421.20 -
  421.21 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.0/gcc/config/ia64/crtbegin.asm
  421.22 ---- gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm	2005-09-27 02:52:24.000000000 +0200
  421.23 -+++ gcc-4.3.0/gcc/config/ia64/crtbegin.asm	2008-06-10 14:45:02.000000000 +0200
  421.24 -@@ -255,3 +255,7 @@
  421.25 - .weak __cxa_finalize
  421.26 - #endif
  421.27 - .weak _Jv_RegisterClasses
  421.28 -+
  421.29 -+#ifdef __linux__
  421.30 -+.section .note.GNU-stack; .previous
  421.31 -+#endif
  421.32 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtend.asm gcc-4.3.0/gcc/config/ia64/crtend.asm
  421.33 ---- gcc-4.3.0.orig/gcc/config/ia64/crtend.asm	2005-09-27 02:52:24.000000000 +0200
  421.34 -+++ gcc-4.3.0/gcc/config/ia64/crtend.asm	2008-06-10 14:45:02.000000000 +0200
  421.35 -@@ -122,3 +122,7 @@
  421.36 - 
  421.37 - 	br.ret.sptk.many rp
  421.38 - 	.endp __do_global_ctors_aux
  421.39 -+
  421.40 -+#ifdef __linux__
  421.41 -+.section .note.GNU-stack; .previous
  421.42 -+#endif
  421.43 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crti.asm gcc-4.3.0/gcc/config/ia64/crti.asm
  421.44 ---- gcc-4.3.0.orig/gcc/config/ia64/crti.asm	2005-06-25 03:22:41.000000000 +0200
  421.45 -+++ gcc-4.3.0/gcc/config/ia64/crti.asm	2008-06-10 14:45:02.000000000 +0200
  421.46 -@@ -64,3 +64,7 @@
  421.47 - 	.body
  421.48 - 
  421.49 - # end of crti.asm
  421.50 -+
  421.51 -+#ifdef __linux__
  421.52 -+.section .note.GNU-stack; .previous
  421.53 -+#endif
  421.54 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtn.asm gcc-4.3.0/gcc/config/ia64/crtn.asm
  421.55 ---- gcc-4.3.0.orig/gcc/config/ia64/crtn.asm	2005-06-25 03:22:41.000000000 +0200
  421.56 -+++ gcc-4.3.0/gcc/config/ia64/crtn.asm	2008-06-10 14:45:02.000000000 +0200
  421.57 -@@ -54,3 +54,7 @@
  421.58 - 	br.ret.sptk.many b0
  421.59 - 
  421.60 - # end of crtn.asm
  421.61 -+
  421.62 -+#ifdef __linux__
  421.63 -+.section .note.GNU-stack; .previous
  421.64 -+#endif
  421.65 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.0/gcc/config/ia64/lib1funcs.asm
  421.66 ---- gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm	2005-09-27 02:52:24.000000000 +0200
  421.67 -+++ gcc-4.3.0/gcc/config/ia64/lib1funcs.asm	2008-06-10 14:45:02.000000000 +0200
  421.68 -@@ -792,3 +792,7 @@
  421.69 - 	}
  421.70 - 	.endp __floattitf
  421.71 - #endif
  421.72 -+
  421.73 -+#ifdef __linux__
  421.74 -+.section .note.GNU-stack; .previous
  421.75 -+#endif
  421.76 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/linux.h gcc-4.3.0/gcc/config/ia64/linux.h
  421.77 ---- gcc-4.3.0.orig/gcc/config/ia64/linux.h	2006-12-12 16:15:19.000000000 +0100
  421.78 -+++ gcc-4.3.0/gcc/config/ia64/linux.h	2008-06-10 14:45:02.000000000 +0200
  421.79 -@@ -5,6 +5,8 @@
  421.80 - 
  421.81 - #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
  421.82 - 
  421.83 -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
  421.84 -+
  421.85 - /* This is for -profile to use -lc_p instead of -lc.  */
  421.86 - #undef CC1_SPEC
  421.87 - #define CC1_SPEC "%{profile:-p} %{G*}"
  421.88 -diff -durN gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.0/gcc/config/rs6000/ppc-asm.h
  421.89 ---- gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h	2003-06-04 18:44:51.000000000 +0200
  421.90 -+++ gcc-4.3.0/gcc/config/rs6000/ppc-asm.h	2008-06-10 14:45:02.000000000 +0200
  421.91 -@@ -158,7 +158,7 @@
  421.92 - 	.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
  421.93 - #endif
  421.94 - 
  421.95 --#if defined __linux__ && !defined __powerpc64__
  421.96 -+#if defined __linux__
  421.97 - 	.section .note.GNU-stack
  421.98 - 	.previous
  421.99 - #endif
   422.1 --- a/patches/gcc/4.3.0/450-noteGNUstack-01.patch	Mon Jul 28 21:08:01 2008 +0000
   422.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   422.3 @@ -1,198 +0,0 @@
   422.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/62_all_gcc4-noteGNUstack.patch
   422.5 -2005-02-08  Jakub Jelinek  <jakub@redhat.com>
   422.6 -
   422.7 -	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
   422.8 -	* src/s390/sysv.S: Likewise.
   422.9 -	* src/powerpc/linux64.S: Likewise.
  422.10 -	* src/powerpc/linux64_closure.S: Likewise.
  422.11 -	* src/powerpc/ppc_closure.S: Likewise.
  422.12 -	* src/powerpc/sysv.S: Likewise.
  422.13 -	* src/x86/unix64.S: Likewise.
  422.14 -	* src/x86/sysv.S: Likewise.
  422.15 -	* src/sparc/v8.S: Likewise.
  422.16 -	* src/sparc/v9.S: Likewise.
  422.17 -	* src/m68k/sysv.S: Likewise.
  422.18 -	* src/ia64/unix.S: Likewise.
  422.19 -	* src/arm/sysv.S: Likewise.
  422.20 -
  422.21 -	* ia64_save_regs_in_stack.s: Moved to...
  422.22 -	* ia64_save_regs_in_stack.S: ... this.  Add .note.GNU-stack
  422.23 -	on Linux.
  422.24 -
  422.25 -diff -durN gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S
  422.26 ---- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S	1970-01-01 01:00:00.000000000 +0100
  422.27 -+++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S	2008-06-10 14:45:05.000000000 +0200
  422.28 -@@ -0,0 +1,15 @@
  422.29 -+        .text
  422.30 -+        .align 16
  422.31 -+        .global GC_save_regs_in_stack
  422.32 -+        .proc GC_save_regs_in_stack
  422.33 -+GC_save_regs_in_stack:
  422.34 -+        .bodyfoo.mpg
  422.35 -+        flushrs
  422.36 -+        ;;
  422.37 -+        mov r8=ar.bsp
  422.38 -+        br.ret.sptk.few rp
  422.39 -+        .endp GC_save_regs_in_stack
  422.40 -+
  422.41 -+#ifdef __linux__
  422.42 -+	.section .note.GNU-stack,"",@progbits
  422.43 -+#endif
  422.44 -diff -durN gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s
  422.45 ---- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s	2001-10-15 06:57:59.000000000 +0200
  422.46 -+++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s	2008-06-10 14:45:05.000000000 +0200
  422.47 -@@ -1,12 +0,0 @@
  422.48 --        .text
  422.49 --        .align 16
  422.50 --        .global GC_save_regs_in_stack
  422.51 --        .proc GC_save_regs_in_stack
  422.52 --GC_save_regs_in_stack:
  422.53 --        .body
  422.54 --        flushrs
  422.55 --        ;;
  422.56 --        mov r8=ar.bsp
  422.57 --        br.ret.sptk.few rp
  422.58 --        .endp GC_save_regs_in_stack
  422.59 --
  422.60 -diff -durN gcc-4.3.0.orig/libffi/src/alpha/osf.S gcc-4.3.0/libffi/src/alpha/osf.S
  422.61 ---- gcc-4.3.0.orig/libffi/src/alpha/osf.S	2007-04-06 18:24:16.000000000 +0200
  422.62 -+++ gcc-4.3.0/libffi/src/alpha/osf.S	2008-06-10 14:45:05.000000000 +0200
  422.63 -@@ -358,4 +358,8 @@
  422.64 - 	.byte	16		# uleb128 offset 16*-8
  422.65 - 	.align 3
  422.66 - $LEFDE3:
  422.67 -+
  422.68 -+#ifdef __linux__
  422.69 -+	.section	.note.GNU-stack,"",@progbits
  422.70 -+#endif
  422.71 - #endif
  422.72 -diff -durN gcc-4.3.0.orig/libffi/src/arm/sysv.S gcc-4.3.0/libffi/src/arm/sysv.S
  422.73 ---- gcc-4.3.0.orig/libffi/src/arm/sysv.S	2007-09-04 19:52:45.000000000 +0200
  422.74 -+++ gcc-4.3.0/libffi/src/arm/sysv.S	2008-06-10 14:45:05.000000000 +0200
  422.75 -@@ -293,3 +293,6 @@
  422.76 - 	UNWIND .fnend
  422.77 -         .size    CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
  422.78 - 
  422.79 -+#if defined __ELF__ && defined __linux__
  422.80 -+	.section	.note.GNU-stack,"",%progbits
  422.81 -+#endif
  422.82 -diff -durN gcc-4.3.0.orig/libffi/src/ia64/unix.S gcc-4.3.0/libffi/src/ia64/unix.S
  422.83 ---- gcc-4.3.0.orig/libffi/src/ia64/unix.S	2005-03-30 23:49:19.000000000 +0200
  422.84 -+++ gcc-4.3.0/libffi/src/ia64/unix.S	2008-06-10 14:45:05.000000000 +0200
  422.85 -@@ -553,3 +553,7 @@
  422.86 - 	data8	@pcrel(.Lld_hfa_float)		// FFI_IA64_TYPE_HFA_FLOAT
  422.87 - 	data8	@pcrel(.Lld_hfa_double)		// FFI_IA64_TYPE_HFA_DOUBLE
  422.88 - 	data8	@pcrel(.Lld_hfa_ldouble)	// FFI_IA64_TYPE_HFA_LDOUBLE
  422.89 -+
  422.90 -+#if defined __ELF__ && defined __linux__
  422.91 -+	.section	.note.GNU-stack,"",@progbits
  422.92 -+#endif
  422.93 -diff -durN gcc-4.3.0.orig/libffi/src/m68k/sysv.S gcc-4.3.0/libffi/src/m68k/sysv.S
  422.94 ---- gcc-4.3.0.orig/libffi/src/m68k/sysv.S	2007-05-10 23:29:04.000000000 +0200
  422.95 -+++ gcc-4.3.0/libffi/src/m68k/sysv.S	2008-06-10 14:45:05.000000000 +0200
  422.96 -@@ -207,3 +207,7 @@
  422.97 - 	rts
  422.98 - 	CFI_ENDPROC()
  422.99 - 	.size	ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
 422.100 -+
 422.101 -+#if defined __ELF__ && defined __linux__
 422.102 -+	.section	.note.GNU-stack,"",@progbits
 422.103 -+#endif
 422.104 -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64.S gcc-4.3.0/libffi/src/powerpc/linux64.S
 422.105 ---- gcc-4.3.0.orig/libffi/src/powerpc/linux64.S	2007-11-17 00:24:53.000000000 +0100
 422.106 -+++ gcc-4.3.0/libffi/src/powerpc/linux64.S	2008-06-10 14:45:05.000000000 +0200
 422.107 -@@ -179,3 +179,7 @@
 422.108 - 	.align 3
 422.109 - .LEFDE1:
 422.110 - #endif
 422.111 -+
 422.112 -+#if defined __ELF__ && defined __linux__
 422.113 -+	.section	.note.GNU-stack,"",@progbits
 422.114 -+#endif
 422.115 -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.0/libffi/src/powerpc/linux64_closure.S
 422.116 ---- gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S	2005-08-11 23:18:24.000000000 +0200
 422.117 -+++ gcc-4.3.0/libffi/src/powerpc/linux64_closure.S	2008-06-10 14:45:05.000000000 +0200
 422.118 -@@ -204,3 +204,7 @@
 422.119 - 	.align 3
 422.120 - .LEFDE1:
 422.121 - #endif
 422.122 -+
 422.123 -+#if defined __ELF__ && defined __linux__
 422.124 -+	.section	.note.GNU-stack,"",@progbits
 422.125 -+#endif
 422.126 -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.0/libffi/src/powerpc/ppc_closure.S
 422.127 ---- gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S	2007-12-01 22:00:04.000000000 +0100
 422.128 -+++ gcc-4.3.0/libffi/src/powerpc/ppc_closure.S	2008-06-10 14:45:05.000000000 +0200
 422.129 -@@ -295,3 +295,7 @@
 422.130 - .LEFDE1:
 422.131 - 
 422.132 - #endif
 422.133 -+
 422.134 -+#if defined __ELF__ && defined __linux__
 422.135 -+	.section	.note.GNU-stack,"",@progbits
 422.136 -+#endif
 422.137 -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/sysv.S gcc-4.3.0/libffi/src/powerpc/sysv.S
 422.138 ---- gcc-4.3.0.orig/libffi/src/powerpc/sysv.S	2007-12-01 22:00:04.000000000 +0100
 422.139 -+++ gcc-4.3.0/libffi/src/powerpc/sysv.S	2008-06-10 14:45:05.000000000 +0200
 422.140 -@@ -223,3 +223,7 @@
 422.141 -       .align 2
 422.142 - .LEFDE1:
 422.143 - #endif
 422.144 -+
 422.145 -+#if defined __ELF__ && defined __linux__
 422.146 -+	.section	.note.GNU-stack,"",@progbits
 422.147 -+#endif
 422.148 -diff -durN gcc-4.3.0.orig/libffi/src/s390/sysv.S gcc-4.3.0/libffi/src/s390/sysv.S
 422.149 ---- gcc-4.3.0.orig/libffi/src/s390/sysv.S	2003-10-21 21:01:58.000000000 +0200
 422.150 -+++ gcc-4.3.0/libffi/src/s390/sysv.S	2008-06-10 14:45:05.000000000 +0200
 422.151 -@@ -427,3 +427,6 @@
 422.152 - 
 422.153 - #endif
 422.154 - 
 422.155 -+#if defined __ELF__ && defined __linux__
 422.156 -+	.section	.note.GNU-stack,"",@progbits
 422.157 -+#endif
 422.158 -diff -durN gcc-4.3.0.orig/libffi/src/sparc/v8.S gcc-4.3.0/libffi/src/sparc/v8.S
 422.159 ---- gcc-4.3.0.orig/libffi/src/sparc/v8.S	2004-11-22 19:35:16.000000000 +0100
 422.160 -+++ gcc-4.3.0/libffi/src/sparc/v8.S	2008-06-10 14:45:05.000000000 +0200
 422.161 -@@ -265,3 +265,7 @@
 422.162 - 	.byte	0x1f	! uleb128 0x1f
 422.163 - 	.align	WS
 422.164 - .LLEFDE2:
 422.165 -+
 422.166 -+#if defined __ELF__ && defined __linux__
 422.167 -+	.section	.note.GNU-stack,"",@progbits
 422.168 -+#endif
 422.169 -diff -durN gcc-4.3.0.orig/libffi/src/sparc/v9.S gcc-4.3.0/libffi/src/sparc/v9.S
 422.170 ---- gcc-4.3.0.orig/libffi/src/sparc/v9.S	2004-01-25 07:58:33.000000000 +0100
 422.171 -+++ gcc-4.3.0/libffi/src/sparc/v9.S	2008-06-10 14:45:05.000000000 +0200
 422.172 -@@ -300,3 +300,7 @@
 422.173 - 	.align 8
 422.174 - .LLEFDE2:
 422.175 - #endif
 422.176 -+
 422.177 -+#ifdef __linux__
 422.178 -+	.section	.note.GNU-stack,"",@progbits
 422.179 -+#endif
 422.180 -diff -durN gcc-4.3.0.orig/libffi/src/x86/sysv.S gcc-4.3.0/libffi/src/x86/sysv.S
 422.181 ---- gcc-4.3.0.orig/libffi/src/x86/sysv.S	2008-01-30 15:36:58.000000000 +0100
 422.182 -+++ gcc-4.3.0/libffi/src/x86/sysv.S	2008-06-10 14:45:05.000000000 +0200
 422.183 -@@ -430,3 +430,7 @@
 422.184 - #endif
 422.185 - 
 422.186 - #endif /* ifndef __x86_64__ */
 422.187 -+
 422.188 -+#if defined __ELF__ && defined __linux__
 422.189 -+	.section	.note.GNU-stack,"",@progbits
 422.190 -+#endif
 422.191 -diff -durN gcc-4.3.0.orig/libffi/src/x86/unix64.S gcc-4.3.0/libffi/src/x86/unix64.S
 422.192 ---- gcc-4.3.0.orig/libffi/src/x86/unix64.S	2005-05-05 06:06:38.000000000 +0200
 422.193 -+++ gcc-4.3.0/libffi/src/x86/unix64.S	2008-06-10 14:45:05.000000000 +0200
 422.194 -@@ -410,3 +410,7 @@
 422.195 - .LEFDE3:
 422.196 - 
 422.197 - #endif /* __x86_64__ */
 422.198 -+
 422.199 -+#if defined __ELF__ && defined __linux__
 422.200 -+	.section	.note.GNU-stack,"",@progbits
 422.201 -+#endif
   423.1 --- a/patches/gcc/4.3.0/475-pr35705.patch	Mon Jul 28 21:08:01 2008 +0000
   423.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   423.3 @@ -1,21 +0,0 @@
   423.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/63_all_gcc43-pr35705.patch
   423.5 -http://gcc.gnu.org/PR35705
   423.6 -
   423.7 -2008-04-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
   423.8 -
   423.9 -	PR middle-end/35705
  423.10 -	* fold-const.c (get_pointer_modulus_and_residue): Return modulus 1 if
  423.11 -	the expression is a function address.
  423.12 -
  423.13 -diff -durN gcc-4.3.0.orig/gcc/fold-const.c gcc-4.3.0/gcc/fold-const.c
  423.14 ---- gcc-4.3.0.orig/gcc/fold-const.c	2008-02-27 15:12:33.000000000 +0100
  423.15 -+++ gcc-4.3.0/gcc/fold-const.c	2008-06-10 14:45:09.000000000 +0200
  423.16 -@@ -9357,7 +9357,7 @@
  423.17 - 	    }
  423.18 - 	}
  423.19 - 
  423.20 --      if (DECL_P (expr))
  423.21 -+      if (DECL_P (expr) && TREE_CODE (expr) != FUNCTION_DECL)
  423.22 - 	return DECL_ALIGN_UNIT (expr);
  423.23 -     }
  423.24 -   else if (code == POINTER_PLUS_EXPR)
   424.1 --- a/patches/gcc/4.3.0/500-pr34571.patch	Mon Jul 28 21:08:01 2008 +0000
   424.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   424.3 @@ -1,35 +0,0 @@
   424.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/64_all_gcc43-pr34571.patch
   424.5 -http://gcc.gnu.org/PR34571
   424.6 -
   424.7 -2007-12-26  Rask Ingemann Lambertsen  <rask@sygehus.dk>
   424.8 -
   424.9 -	PR target/34571
  424.10 -	* config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
  424.11 -	symbolic_operand.
  424.12 -	* varasm.c (output_constant_pool_1): Fix typo.
  424.13 -
  424.14 -diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.c gcc-4.3.0/gcc/config/alpha/alpha.c
  424.15 ---- gcc-4.3.0.orig/gcc/config/alpha/alpha.c	2008-02-07 18:45:24.000000000 +0100
  424.16 -+++ gcc-4.3.0/gcc/config/alpha/alpha.c	2008-06-10 14:45:13.000000000 +0200
  424.17 -@@ -1113,8 +1113,7 @@
  424.18 - static bool
  424.19 - alpha_cannot_force_const_mem (rtx x)
  424.20 - {
  424.21 --  enum rtx_code code = GET_CODE (x);
  424.22 --  return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
  424.23 -+  return symbolic_operand (x, GET_MODE (x));
  424.24 - }
  424.25 - 
  424.26 - /* We do not allow indirect calls to be optimized into sibling calls, nor
  424.27 -diff -durN gcc-4.3.0.orig/gcc/varasm.c gcc-4.3.0/gcc/varasm.c
  424.28 ---- gcc-4.3.0.orig/gcc/varasm.c	2007-12-05 22:55:10.000000000 +0100
  424.29 -+++ gcc-4.3.0/gcc/varasm.c	2008-06-10 14:45:13.000000000 +0200
  424.30 -@@ -3710,7 +3710,7 @@
  424.31 -       /* FALLTHRU  */
  424.32 - 
  424.33 -     case LABEL_REF:
  424.34 --      tmp = XEXP (x, 0);
  424.35 -+      tmp = XEXP (tmp, 0);
  424.36 -       gcc_assert (!INSN_DELETED_P (tmp));
  424.37 -       gcc_assert (!NOTE_P (tmp)
  424.38 - 		  || NOTE_KIND (tmp) != NOTE_INSN_DELETED);
   425.1 --- a/patches/gcc/4.3.0/525-pr35982.patch	Mon Jul 28 21:08:01 2008 +0000
   425.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   425.3 @@ -1,23 +0,0 @@
   425.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/65_all_gcc43-pr35982.patch
   425.5 -http://gcc.gnu.org/PR35982
   425.6 -
   425.7 -2008-04-23  Ira Rosen  <irar@il.ibm.com>
   425.8 -
   425.9 -	PR tree-optimization/35982
  425.10 -	* tree-vect-analyze.c (vect_check_interleaving): Check that the
  425.11 -	interleaved data-refs are of the same type.
  425.12 -
  425.13 -diff -durN gcc-4.3.0.orig/gcc/tree-vect-analyze.c gcc-4.3.0/gcc/tree-vect-analyze.c
  425.14 ---- gcc-4.3.0.orig/gcc/tree-vect-analyze.c	2007-12-06 17:18:55.000000000 +0100
  425.15 -+++ gcc-4.3.0/gcc/tree-vect-analyze.c	2008-06-10 14:45:17.000000000 +0200
  425.16 -@@ -1081,7 +1081,9 @@
  425.17 -   type_size_b = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drb))));
  425.18 - 
  425.19 -   if (type_size_a != type_size_b
  425.20 --      || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb)))
  425.21 -+      || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb))
  425.22 -+      || !types_compatible_p (TREE_TYPE (DR_REF (dra)), 
  425.23 -+                              TREE_TYPE (DR_REF (drb))))
  425.24 -     return;
  425.25 - 
  425.26 -   init_a = TREE_INT_CST_LOW (DR_INIT (dra));
   426.1 --- a/patches/gcc/4.3.0/550-pr25343.patch	Mon Jul 28 21:08:01 2008 +0000
   426.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   426.3 @@ -1,21 +0,0 @@
   426.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/66_all_gcc43-pr25343.patch
   426.5 -http://gcc.gnu.org/PR25343
   426.6 -
   426.7 -sniped from Debian
   426.8 -
   426.9 -2008-04-27  Roman Zippel <zippel@linux-m68k.org>
  426.10 -
  426.11 -	* config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
  426.12 -
  426.13 -diff -durN gcc-4.3.0.orig/gcc/config/host-linux.c gcc-4.3.0/gcc/config/host-linux.c
  426.14 ---- gcc-4.3.0.orig/gcc/config/host-linux.c	2007-08-02 12:49:31.000000000 +0200
  426.15 -+++ gcc-4.3.0/gcc/config/host-linux.c	2008-06-10 14:45:20.000000000 +0200
  426.16 -@@ -84,6 +84,8 @@
  426.17 - # define TRY_EMPTY_VM_SPACE	0x8000000000
  426.18 - #elif defined(__sparc__)
  426.19 - # define TRY_EMPTY_VM_SPACE	0x60000000
  426.20 -+#elif defined(__mc68000__)
  426.21 -+# define TRY_EMPTY_VM_SPACE	0x40000000
  426.22 - #else
  426.23 - # define TRY_EMPTY_VM_SPACE	0
  426.24 - #endif
   427.1 --- a/patches/gcc/4.3.0/575-sh-pr24836.patch	Mon Jul 28 21:08:01 2008 +0000
   427.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   427.3 @@ -1,28 +0,0 @@
   427.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/74_all_sh-pr24836.patch
   427.5 -http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
   427.6 -http://gcc.gnu.org/PR24836
   427.7 -
   427.8 -diff -durN gcc-4.3.0.orig/gcc/configure gcc-4.3.0/gcc/configure
   427.9 ---- gcc-4.3.0.orig/gcc/configure	2008-06-10 14:44:21.000000000 +0200
  427.10 -+++ gcc-4.3.0/gcc/configure	2008-06-10 14:45:24.000000000 +0200
  427.11 -@@ -14700,7 +14700,7 @@
  427.12 - 	tls_first_minor=14
  427.13 - 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  427.14 - 	;;
  427.15 --  sh-*-* | sh[34]-*-*)
  427.16 -+  sh-*-* | sh[34]*-*-*)
  427.17 -     conftest_s='
  427.18 - 	.section ".tdata","awT",@progbits
  427.19 - foo:	.long	25
  427.20 -diff -durN gcc-4.3.0.orig/gcc/configure.ac gcc-4.3.0/gcc/configure.ac
  427.21 ---- gcc-4.3.0.orig/gcc/configure.ac	2008-06-10 14:44:21.000000000 +0200
  427.22 -+++ gcc-4.3.0/gcc/configure.ac	2008-06-10 14:45:24.000000000 +0200
  427.23 -@@ -2533,7 +2533,7 @@
  427.24 - 	tls_first_minor=14
  427.25 - 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  427.26 - 	;;
  427.27 --  sh-*-* | sh[34]-*-*)
  427.28 -+  sh-*-* | sh[34]*-*-*)
  427.29 -     conftest_s='
  427.30 - 	.section ".tdata","awT",@progbits
  427.31 - foo:	.long	25
   428.1 --- a/patches/gcc/4.3.0/600-ca-translation-typo.patch	Mon Jul 28 21:08:01 2008 +0000
   428.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   428.3 @@ -1,19 +0,0 @@
   428.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/85_all_gcc-ca-translation-typo.patch
   428.5 -http://bugs.gentoo.org/127190
   428.6 -
   428.7 -2006-03-28  Harald van Dijk  <truedfx@gentoo.org>
   428.8 -
   428.9 -	* ca.po: Fix printf flag typo in negative value translation.
  428.10 -
  428.11 -diff -durN gcc-4.3.0.orig/gcc/po/ca.po gcc-4.3.0/gcc/po/ca.po
  428.12 ---- gcc-4.3.0.orig/gcc/po/ca.po	2007-11-10 19:36:27.000000000 +0100
  428.13 -+++ gcc-4.3.0/gcc/po/ca.po	2008-06-10 14:45:27.000000000 +0200
  428.14 -@@ -36028,7 +36028,7 @@
  428.15 - #~ msgstr "passant el valor negatiu `%E' per a %s %P de \"%D\""
  428.16 - 
  428.17 - #~ msgid "%s of negative value `%E' to `%T'"
  428.18 --#~ msgstr "%s de valor negatiu `%I' a \"%T\""
  428.19 -+#~ msgstr "%s de valor negatiu `%E' a \"%T\""
  428.20 - 
  428.21 - #~ msgid "initializing array with parameter list"
  428.22 - #~ msgstr "inicialitzant una matriu amb una llista de paràmetres"
   429.1 --- a/patches/gcc/4.3.0/625-uclibc-conf-noupstream.patch	Mon Jul 28 21:08:01 2008 +0000
   429.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   429.3 @@ -1,13 +0,0 @@
   429.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_103-uclibc-conf-noupstream.patch
   429.5 -diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc
   429.6 ---- gcc-4.3.0.orig/gcc/config.gcc	2008-06-10 14:44:51.000000000 +0200
   429.7 -+++ gcc-4.3.0/gcc/config.gcc	2008-06-10 14:45:31.000000000 +0200
   429.8 -@@ -2142,7 +2142,7 @@
   429.9 -         ;;
  429.10 - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  429.11 - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  429.12 --  sh-*-linux* | sh[346lbe]*-*-linux* | \
  429.13 -+  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  429.14 -   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  429.15 -    sh64-*-netbsd* | sh64l*-*-netbsd*)
  429.16 - 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   430.1 --- a/patches/gcc/4.3.0/650-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   430.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   430.3 @@ -1,2794 +0,0 @@
   430.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_200-uclibc-locale.patch
   430.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 gcc-4.3.0/libstdc++-v3/acinclude.m4
   430.6 ---- gcc-4.3.0.orig/libstdc++-v3/acinclude.m4	2008-02-29 01:00:39.000000000 +0100
   430.7 -+++ gcc-4.3.0/libstdc++-v3/acinclude.m4	2008-06-10 14:45:35.000000000 +0200
   430.8 -@@ -1349,7 +1349,7 @@
   430.9 - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
  430.10 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  430.11 -     [use MODEL for target locale package],
  430.12 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  430.13 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  430.14 - 
  430.15 -   # Deal with gettext issues.  Default to not using it (=no) until we detect
  430.16 -   # support for it later.  Let the user turn it off via --e/d, but let that
  430.17 -@@ -1370,6 +1370,9 @@
  430.18 -   # Default to "generic".
  430.19 -   if test $enable_clocale_flag = auto; then
  430.20 -     case ${target_os} in
  430.21 -+      *-uclibc*)
  430.22 -+        enable_clocale_flag=uclibc
  430.23 -+        ;;
  430.24 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  430.25 -         enable_clocale_flag=gnu	
  430.26 -         ;;
  430.27 -@@ -1541,6 +1544,40 @@
  430.28 -       CTIME_CC=config/locale/generic/time_members.cc
  430.29 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  430.30 -       ;;
  430.31 -+    uclibc)
  430.32 -+      AC_MSG_RESULT(uclibc)
  430.33 -+
  430.34 -+      # Declare intention to use gettext, and add support for specific
  430.35 -+      # languages.
  430.36 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  430.37 -+      ALL_LINGUAS="de fr"
  430.38 -+
  430.39 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  430.40 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  430.41 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  430.42 -+        USE_NLS=yes
  430.43 -+      fi
  430.44 -+      # Export the build objects.
  430.45 -+      for ling in $ALL_LINGUAS; do \
  430.46 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  430.47 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  430.48 -+      done
  430.49 -+      AC_SUBST(glibcxx_MOFILES)
  430.50 -+      AC_SUBST(glibcxx_POFILES)
  430.51 -+
  430.52 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  430.53 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  430.54 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  430.55 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  430.56 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  430.57 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  430.58 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  430.59 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  430.60 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  430.61 -+      CTIME_H=config/locale/uclibc/time_members.h
  430.62 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  430.63 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  430.64 -+      ;;
  430.65 -   esac
  430.66 - 
  430.67 -   # This is where the testsuite looks for locale catalogs, using the
  430.68 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  430.69 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
  430.70 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:35.000000000 +0200
  430.71 -@@ -0,0 +1,63 @@
  430.72 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  430.73 -+
  430.74 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  430.75 -+//
  430.76 -+// This file is part of the GNU ISO C++ Library.  This library is free
  430.77 -+// software; you can redistribute it and/or modify it under the
  430.78 -+// terms of the GNU General Public License as published by the
  430.79 -+// Free Software Foundation; either version 2, or (at your option)
  430.80 -+// any later version.
  430.81 -+
  430.82 -+// This library is distributed in the hope that it will be useful,
  430.83 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  430.84 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  430.85 -+// GNU General Public License for more details.
  430.86 -+
  430.87 -+// You should have received a copy of the GNU General Public License along
  430.88 -+// with this library; see the file COPYING.  If not, write to the Free
  430.89 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  430.90 -+// USA.
  430.91 -+
  430.92 -+// As a special exception, you may use this file as part of a free software
  430.93 -+// library without restriction.  Specifically, if other files instantiate
  430.94 -+// templates or use macros or inline functions from this file, or you compile
  430.95 -+// this file and link it with other files to produce an executable, this
  430.96 -+// file does not by itself cause the resulting executable to be covered by
  430.97 -+// the GNU General Public License.  This exception does not however
  430.98 -+// invalidate any other reasons why the executable file might be covered by
  430.99 -+// the GNU General Public License.
 430.100 -+
 430.101 -+// Written by Jakub Jelinek <jakub@redhat.com>
 430.102 -+
 430.103 -+#include <bits/c++config.h>
 430.104 -+#include <clocale>
 430.105 -+
 430.106 -+#ifdef __UCLIBC_MJN3_ONLY__
 430.107 -+#warning clean this up
 430.108 -+#endif
 430.109 -+
 430.110 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.111 -+                                                  
 430.112 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 430.113 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 430.114 -+extern "C" __typeof(strftime_l) __strftime_l;
 430.115 -+extern "C" __typeof(strtod_l) __strtod_l;
 430.116 -+extern "C" __typeof(strtof_l) __strtof_l;
 430.117 -+extern "C" __typeof(strtold_l) __strtold_l;
 430.118 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 430.119 -+extern "C" __typeof(newlocale) __newlocale;
 430.120 -+extern "C" __typeof(freelocale) __freelocale;
 430.121 -+extern "C" __typeof(duplocale) __duplocale;
 430.122 -+extern "C" __typeof(uselocale) __uselocale;
 430.123 -+
 430.124 -+#ifdef _GLIBCXX_USE_WCHAR_T
 430.125 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 430.126 -+extern "C" __typeof(towlower_l) __towlower_l;
 430.127 -+extern "C" __typeof(towupper_l) __towupper_l;
 430.128 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 430.129 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 430.130 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 430.131 -+extern "C" __typeof(wctype_l) __wctype_l;
 430.132 -+#endif 
 430.133 -+
 430.134 -+#endif // GLIBC 2.3 and later
 430.135 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
 430.136 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
 430.137 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:35.000000000 +0200
 430.138 -@@ -0,0 +1,160 @@
 430.139 -+// Wrapper for underlying C-language localization -*- C++ -*-
 430.140 -+
 430.141 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 430.142 -+//
 430.143 -+// This file is part of the GNU ISO C++ Library.  This library is free
 430.144 -+// software; you can redistribute it and/or modify it under the
 430.145 -+// terms of the GNU General Public License as published by the
 430.146 -+// Free Software Foundation; either version 2, or (at your option)
 430.147 -+// any later version.
 430.148 -+
 430.149 -+// This library is distributed in the hope that it will be useful,
 430.150 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 430.151 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 430.152 -+// GNU General Public License for more details.
 430.153 -+
 430.154 -+// You should have received a copy of the GNU General Public License along
 430.155 -+// with this library; see the file COPYING.  If not, write to the Free
 430.156 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 430.157 -+// USA.
 430.158 -+
 430.159 -+// As a special exception, you may use this file as part of a free software
 430.160 -+// library without restriction.  Specifically, if other files instantiate
 430.161 -+// templates or use macros or inline functions from this file, or you compile
 430.162 -+// this file and link it with other files to produce an executable, this
 430.163 -+// file does not by itself cause the resulting executable to be covered by
 430.164 -+// the GNU General Public License.  This exception does not however
 430.165 -+// invalidate any other reasons why the executable file might be covered by
 430.166 -+// the GNU General Public License.
 430.167 -+
 430.168 -+//
 430.169 -+// ISO C++ 14882: 22.8  Standard locale categories.
 430.170 -+//
 430.171 -+
 430.172 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 430.173 -+
 430.174 -+#include <cerrno>  // For errno
 430.175 -+#include <locale>
 430.176 -+#include <stdexcept>
 430.177 -+#include <langinfo.h>
 430.178 -+#include <bits/c++locale_internal.h>
 430.179 -+
 430.180 -+#ifndef __UCLIBC_HAS_XLOCALE__
 430.181 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 430.182 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 430.183 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 430.184 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 430.185 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 430.186 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 430.187 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 430.188 -+#warning should dummy __newlocale check for C|POSIX ?
 430.189 -+#define __newlocale(a, b, c)        NULL
 430.190 -+#define __freelocale(a)             ((void)0)
 430.191 -+#define __duplocale(a)              __c_locale()
 430.192 -+#endif
 430.193 -+
 430.194 -+namespace std 
 430.195 -+{
 430.196 -+  template<>
 430.197 -+    void
 430.198 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 430.199 -+		   const __c_locale& __cloc)
 430.200 -+    {
 430.201 -+      if (!(__err & ios_base::failbit))
 430.202 -+	{
 430.203 -+	  char* __sanity;
 430.204 -+	  errno = 0;
 430.205 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
 430.206 -+          if (__sanity != __s && errno != ERANGE)
 430.207 -+	    __v = __f;
 430.208 -+	  else
 430.209 -+	    __err |= ios_base::failbit;
 430.210 -+	}
 430.211 -+    }
 430.212 -+
 430.213 -+  template<>
 430.214 -+    void
 430.215 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 430.216 -+		   const __c_locale& __cloc)
 430.217 -+    {
 430.218 -+      if (!(__err & ios_base::failbit))
 430.219 -+	{
 430.220 -+	  char* __sanity;
 430.221 -+	  errno = 0;
 430.222 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
 430.223 -+          if (__sanity != __s && errno != ERANGE)
 430.224 -+	    __v = __d;
 430.225 -+	  else
 430.226 -+	    __err |= ios_base::failbit;
 430.227 -+	}
 430.228 -+    }
 430.229 -+
 430.230 -+  template<>
 430.231 -+    void
 430.232 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 430.233 -+		   const __c_locale& __cloc)
 430.234 -+    {
 430.235 -+      if (!(__err & ios_base::failbit))
 430.236 -+	{
 430.237 -+	  char* __sanity;
 430.238 -+	  errno = 0;
 430.239 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 430.240 -+          if (__sanity != __s && errno != ERANGE)
 430.241 -+	    __v = __ld;
 430.242 -+	  else
 430.243 -+	    __err |= ios_base::failbit;
 430.244 -+	}
 430.245 -+    }
 430.246 -+
 430.247 -+  void
 430.248 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 430.249 -+				    __c_locale __old)
 430.250 -+  {
 430.251 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 430.252 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.253 -+    if (!__cloc)
 430.254 -+      {
 430.255 -+	// This named locale is not supported by the underlying OS.
 430.256 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 430.257 -+			      "name not valid"));
 430.258 -+      }
 430.259 -+#endif
 430.260 -+  }
 430.261 -+  
 430.262 -+  void
 430.263 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 430.264 -+  {
 430.265 -+    if (_S_get_c_locale() != __cloc)
 430.266 -+      __freelocale(__cloc); 
 430.267 -+  }
 430.268 -+
 430.269 -+  __c_locale
 430.270 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 430.271 -+  { return __duplocale(__cloc); }
 430.272 -+} // namespace std
 430.273 -+
 430.274 -+namespace __gnu_cxx
 430.275 -+{
 430.276 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 430.277 -+    {
 430.278 -+      "LC_CTYPE", 
 430.279 -+      "LC_NUMERIC",
 430.280 -+      "LC_TIME", 
 430.281 -+      "LC_COLLATE", 
 430.282 -+      "LC_MONETARY",
 430.283 -+      "LC_MESSAGES", 
 430.284 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 430.285 -+      "LC_PAPER", 
 430.286 -+      "LC_NAME", 
 430.287 -+      "LC_ADDRESS",
 430.288 -+      "LC_TELEPHONE", 
 430.289 -+      "LC_MEASUREMENT", 
 430.290 -+      "LC_IDENTIFICATION" 
 430.291 -+#endif
 430.292 -+    };
 430.293 -+}
 430.294 -+
 430.295 -+namespace std
 430.296 -+{
 430.297 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 430.298 -+}  // namespace std
 430.299 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
 430.300 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 430.301 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:35.000000000 +0200
 430.302 -@@ -0,0 +1,117 @@
 430.303 -+// Wrapper for underlying C-language localization -*- C++ -*-
 430.304 -+
 430.305 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 430.306 -+//
 430.307 -+// This file is part of the GNU ISO C++ Library.  This library is free
 430.308 -+// software; you can redistribute it and/or modify it under the
 430.309 -+// terms of the GNU General Public License as published by the
 430.310 -+// Free Software Foundation; either version 2, or (at your option)
 430.311 -+// any later version.
 430.312 -+
 430.313 -+// This library is distributed in the hope that it will be useful,
 430.314 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 430.315 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 430.316 -+// GNU General Public License for more details.
 430.317 -+
 430.318 -+// You should have received a copy of the GNU General Public License along
 430.319 -+// with this library; see the file COPYING.  If not, write to the Free
 430.320 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 430.321 -+// USA.
 430.322 -+
 430.323 -+// As a special exception, you may use this file as part of a free software
 430.324 -+// library without restriction.  Specifically, if other files instantiate
 430.325 -+// templates or use macros or inline functions from this file, or you compile
 430.326 -+// this file and link it with other files to produce an executable, this
 430.327 -+// file does not by itself cause the resulting executable to be covered by
 430.328 -+// the GNU General Public License.  This exception does not however
 430.329 -+// invalidate any other reasons why the executable file might be covered by
 430.330 -+// the GNU General Public License.
 430.331 -+
 430.332 -+//
 430.333 -+// ISO C++ 14882: 22.8  Standard locale categories.
 430.334 -+//
 430.335 -+
 430.336 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 430.337 -+
 430.338 -+#ifndef _C_LOCALE_H
 430.339 -+#define _C_LOCALE_H 1
 430.340 -+
 430.341 -+#pragma GCC system_header
 430.342 -+
 430.343 -+#include <cstring>              // get std::strlen
 430.344 -+#include <cstdio>               // get std::snprintf or std::sprintf
 430.345 -+#include <clocale>
 430.346 -+#include <langinfo.h>		// For codecvt
 430.347 -+#ifdef __UCLIBC_MJN3_ONLY__
 430.348 -+#warning fix this
 430.349 -+#endif
 430.350 -+#ifdef __UCLIBC_HAS_LOCALE__
 430.351 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 430.352 -+#endif
 430.353 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 430.354 -+#include <libintl.h> 		// For messages
 430.355 -+#endif
 430.356 -+
 430.357 -+#ifdef __UCLIBC_MJN3_ONLY__
 430.358 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 430.359 -+#endif
 430.360 -+#define _GLIBCXX_C_LOCALE_GNU 1
 430.361 -+
 430.362 -+#ifdef __UCLIBC_MJN3_ONLY__
 430.363 -+#warning fix categories
 430.364 -+#endif
 430.365 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 430.366 -+#define _GLIBCXX_NUM_CATEGORIES 0
 430.367 -+ 
 430.368 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.369 -+namespace __gnu_cxx
 430.370 -+{
 430.371 -+  extern "C" __typeof(uselocale) __uselocale;
 430.372 -+}
 430.373 -+#endif
 430.374 -+
 430.375 -+namespace std
 430.376 -+{
 430.377 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.378 -+  typedef __locale_t		__c_locale;
 430.379 -+#else
 430.380 -+  typedef int*			__c_locale;
 430.381 -+#endif
 430.382 -+
 430.383 -+  // Convert numeric value of type _Tv to string and return length of
 430.384 -+  // string.  If snprintf is available use it, otherwise fall back to
 430.385 -+  // the unsafe sprintf which, in general, can be dangerous and should
 430.386 -+  // be avoided.
 430.387 -+  template<typename _Tv>
 430.388 -+    int
 430.389 -+    __convert_from_v(char* __out, 
 430.390 -+		     const int __size __attribute__ ((__unused__)),
 430.391 -+		     const char* __fmt,
 430.392 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 430.393 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 430.394 -+    {
 430.395 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 430.396 -+#else
 430.397 -+		     _Tv __v, const __c_locale&, int __prec)
 430.398 -+    {
 430.399 -+# ifdef __UCLIBC_HAS_LOCALE__
 430.400 -+      char* __old = std::setlocale(LC_ALL, NULL);
 430.401 -+      char* __sav = new char[std::strlen(__old) + 1];
 430.402 -+      std::strcpy(__sav, __old);
 430.403 -+      std::setlocale(LC_ALL, "C");
 430.404 -+# endif
 430.405 -+#endif
 430.406 -+
 430.407 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 430.408 -+
 430.409 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 430.410 -+      __gnu_cxx::__uselocale(__old);
 430.411 -+#elif defined __UCLIBC_HAS_LOCALE__
 430.412 -+      std::setlocale(LC_ALL, __sav);
 430.413 -+      delete [] __sav;
 430.414 -+#endif
 430.415 -+      return __ret;
 430.416 -+    }
 430.417 -+}
 430.418 -+
 430.419 -+#endif
 430.420 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 430.421 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 430.422 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2008-06-10 14:45:35.000000000 +0200
 430.423 -@@ -0,0 +1,306 @@
 430.424 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 430.425 -+
 430.426 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 430.427 -+//
 430.428 -+// This file is part of the GNU ISO C++ Library.  This library is free
 430.429 -+// software; you can redistribute it and/or modify it under the
 430.430 -+// terms of the GNU General Public License as published by the
 430.431 -+// Free Software Foundation; either version 2, or (at your option)
 430.432 -+// any later version.
 430.433 -+
 430.434 -+// This library is distributed in the hope that it will be useful,
 430.435 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 430.436 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 430.437 -+// GNU General Public License for more details.
 430.438 -+
 430.439 -+// You should have received a copy of the GNU General Public License along
 430.440 -+// with this library; see the file COPYING.  If not, write to the Free
 430.441 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 430.442 -+// USA.
 430.443 -+
 430.444 -+// As a special exception, you may use this file as part of a free software
 430.445 -+// library without restriction.  Specifically, if other files instantiate
 430.446 -+// templates or use macros or inline functions from this file, or you compile
 430.447 -+// this file and link it with other files to produce an executable, this
 430.448 -+// file does not by itself cause the resulting executable to be covered by
 430.449 -+// the GNU General Public License.  This exception does not however
 430.450 -+// invalidate any other reasons why the executable file might be covered by
 430.451 -+// the GNU General Public License.
 430.452 -+
 430.453 -+//
 430.454 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 430.455 -+//
 430.456 -+
 430.457 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 430.458 -+
 430.459 -+#include <locale>
 430.460 -+#include <bits/c++locale_internal.h>
 430.461 -+
 430.462 -+namespace std
 430.463 -+{
 430.464 -+  // Specializations.
 430.465 -+#ifdef _GLIBCXX_USE_WCHAR_T
 430.466 -+  codecvt_base::result
 430.467 -+  codecvt<wchar_t, char, mbstate_t>::
 430.468 -+  do_out(state_type& __state, const intern_type* __from, 
 430.469 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 430.470 -+	 extern_type* __to, extern_type* __to_end,
 430.471 -+	 extern_type*& __to_next) const
 430.472 -+  {
 430.473 -+    result __ret = ok;
 430.474 -+    state_type __tmp_state(__state);
 430.475 -+
 430.476 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.477 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 430.478 -+#endif
 430.479 -+
 430.480 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 430.481 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 430.482 -+    // NB: wcsnrtombs is a GNU extension
 430.483 -+    for (__from_next = __from, __to_next = __to;
 430.484 -+	 __from_next < __from_end && __to_next < __to_end
 430.485 -+	 && __ret == ok;)
 430.486 -+      {
 430.487 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 430.488 -+						      __from_end - __from_next);
 430.489 -+	if (!__from_chunk_end)
 430.490 -+	  __from_chunk_end = __from_end;
 430.491 -+
 430.492 -+	__from = __from_next;
 430.493 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 430.494 -+					 __from_chunk_end - __from_next,
 430.495 -+					 __to_end - __to_next, &__state);
 430.496 -+	if (__conv == static_cast<size_t>(-1))
 430.497 -+	  {
 430.498 -+	    // In case of error, in order to stop at the exact place we
 430.499 -+	    // have to start again from the beginning with a series of
 430.500 -+	    // wcrtomb.
 430.501 -+	    for (; __from < __from_next; ++__from)
 430.502 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 430.503 -+	    __state = __tmp_state;
 430.504 -+	    __ret = error;
 430.505 -+	  }
 430.506 -+	else if (__from_next && __from_next < __from_chunk_end)
 430.507 -+	  {
 430.508 -+	    __to_next += __conv;
 430.509 -+	    __ret = partial;
 430.510 -+	  }
 430.511 -+	else
 430.512 -+	  {
 430.513 -+	    __from_next = __from_chunk_end;
 430.514 -+	    __to_next += __conv;
 430.515 -+	  }
 430.516 -+
 430.517 -+	if (__from_next < __from_end && __ret == ok)
 430.518 -+	  {
 430.519 -+	    extern_type __buf[MB_LEN_MAX];
 430.520 -+	    __tmp_state = __state;
 430.521 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 430.522 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 430.523 -+	      __ret = partial;
 430.524 -+	    else
 430.525 -+	      {
 430.526 -+		memcpy(__to_next, __buf, __conv);
 430.527 -+		__state = __tmp_state;
 430.528 -+		__to_next += __conv;
 430.529 -+		++__from_next;
 430.530 -+	      }
 430.531 -+	  }
 430.532 -+      }
 430.533 -+
 430.534 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.535 -+    __uselocale(__old);
 430.536 -+#endif
 430.537 -+
 430.538 -+    return __ret; 
 430.539 -+  }
 430.540 -+  
 430.541 -+  codecvt_base::result
 430.542 -+  codecvt<wchar_t, char, mbstate_t>::
 430.543 -+  do_in(state_type& __state, const extern_type* __from, 
 430.544 -+	const extern_type* __from_end, const extern_type*& __from_next,
 430.545 -+	intern_type* __to, intern_type* __to_end,
 430.546 -+	intern_type*& __to_next) const
 430.547 -+  {
 430.548 -+    result __ret = ok;
 430.549 -+    state_type __tmp_state(__state);
 430.550 -+
 430.551 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.552 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 430.553 -+#endif
 430.554 -+
 430.555 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 430.556 -+    // in case we store a L'\0' and then continue, in a loop.
 430.557 -+    // NB: mbsnrtowcs is a GNU extension
 430.558 -+    for (__from_next = __from, __to_next = __to;
 430.559 -+	 __from_next < __from_end && __to_next < __to_end
 430.560 -+	 && __ret == ok;)
 430.561 -+      {
 430.562 -+	const extern_type* __from_chunk_end;
 430.563 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 430.564 -+								  __from_end
 430.565 -+								  - __from_next));
 430.566 -+	if (!__from_chunk_end)
 430.567 -+	  __from_chunk_end = __from_end;
 430.568 -+
 430.569 -+	__from = __from_next;
 430.570 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 430.571 -+				   __from_chunk_end - __from_next,
 430.572 -+				   __to_end - __to_next, &__state);
 430.573 -+	if (__conv == static_cast<size_t>(-1))
 430.574 -+	  {
 430.575 -+	    // In case of error, in order to stop at the exact place we
 430.576 -+	    // have to start again from the beginning with a series of
 430.577 -+	    // mbrtowc.
 430.578 -+	    for (;; ++__to_next, __from += __conv)
 430.579 -+	      {
 430.580 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 430.581 -+				 &__tmp_state);
 430.582 -+		if (__conv == static_cast<size_t>(-1)
 430.583 -+		    || __conv == static_cast<size_t>(-2))
 430.584 -+		  break;
 430.585 -+	      }
 430.586 -+	    __from_next = __from;
 430.587 -+	    __state = __tmp_state;	    
 430.588 -+	    __ret = error;
 430.589 -+	  }
 430.590 -+	else if (__from_next && __from_next < __from_chunk_end)
 430.591 -+	  {
 430.592 -+	    // It is unclear what to return in this case (see DR 382). 
 430.593 -+	    __to_next += __conv;
 430.594 -+	    __ret = partial;
 430.595 -+	  }
 430.596 -+	else
 430.597 -+	  {
 430.598 -+	    __from_next = __from_chunk_end;
 430.599 -+	    __to_next += __conv;
 430.600 -+	  }
 430.601 -+
 430.602 -+	if (__from_next < __from_end && __ret == ok)
 430.603 -+	  {
 430.604 -+	    if (__to_next < __to_end)
 430.605 -+	      {
 430.606 -+		// XXX Probably wrong for stateful encodings
 430.607 -+		__tmp_state = __state;		
 430.608 -+		++__from_next;
 430.609 -+		*__to_next++ = L'\0';
 430.610 -+	      }
 430.611 -+	    else
 430.612 -+	      __ret = partial;
 430.613 -+	  }
 430.614 -+      }
 430.615 -+
 430.616 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.617 -+    __uselocale(__old);
 430.618 -+#endif
 430.619 -+
 430.620 -+    return __ret; 
 430.621 -+  }
 430.622 -+
 430.623 -+  int 
 430.624 -+  codecvt<wchar_t, char, mbstate_t>::
 430.625 -+  do_encoding() const throw()
 430.626 -+  {
 430.627 -+    // XXX This implementation assumes that the encoding is
 430.628 -+    // stateless and is either single-byte or variable-width.
 430.629 -+    int __ret = 0;
 430.630 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.631 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 430.632 -+#endif
 430.633 -+    if (MB_CUR_MAX == 1)
 430.634 -+      __ret = 1;
 430.635 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.636 -+    __uselocale(__old);
 430.637 -+#endif
 430.638 -+    return __ret;
 430.639 -+  }  
 430.640 -+
 430.641 -+  int 
 430.642 -+  codecvt<wchar_t, char, mbstate_t>::
 430.643 -+  do_max_length() const throw()
 430.644 -+  {
 430.645 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.646 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 430.647 -+#endif
 430.648 -+    // XXX Probably wrong for stateful encodings.
 430.649 -+    int __ret = MB_CUR_MAX;
 430.650 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.651 -+    __uselocale(__old);
 430.652 -+#endif
 430.653 -+    return __ret;
 430.654 -+  }
 430.655 -+  
 430.656 -+  int 
 430.657 -+  codecvt<wchar_t, char, mbstate_t>::
 430.658 -+  do_length(state_type& __state, const extern_type* __from,
 430.659 -+	    const extern_type* __end, size_t __max) const
 430.660 -+  {
 430.661 -+    int __ret = 0;
 430.662 -+    state_type __tmp_state(__state);
 430.663 -+
 430.664 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.665 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 430.666 -+#endif
 430.667 -+
 430.668 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 430.669 -+    // in case we advance past it and then continue, in a loop.
 430.670 -+    // NB: mbsnrtowcs is a GNU extension
 430.671 -+  
 430.672 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 430.673 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 430.674 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 430.675 -+							   * __max));
 430.676 -+    while (__from < __end && __max)
 430.677 -+      {
 430.678 -+	const extern_type* __from_chunk_end;
 430.679 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 430.680 -+								  __end
 430.681 -+								  - __from));
 430.682 -+	if (!__from_chunk_end)
 430.683 -+	  __from_chunk_end = __end;
 430.684 -+
 430.685 -+	const extern_type* __tmp_from = __from;
 430.686 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 430.687 -+				   __from_chunk_end - __from,
 430.688 -+				   __max, &__state);
 430.689 -+	if (__conv == static_cast<size_t>(-1))
 430.690 -+	  {
 430.691 -+	    // In case of error, in order to stop at the exact place we
 430.692 -+	    // have to start again from the beginning with a series of
 430.693 -+	    // mbrtowc.
 430.694 -+	    for (__from = __tmp_from;; __from += __conv)
 430.695 -+	      {
 430.696 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 430.697 -+				 &__tmp_state);
 430.698 -+		if (__conv == static_cast<size_t>(-1)
 430.699 -+		    || __conv == static_cast<size_t>(-2))
 430.700 -+		  break;
 430.701 -+	      }
 430.702 -+	    __state = __tmp_state;
 430.703 -+	    __ret += __from - __tmp_from;
 430.704 -+	    break;
 430.705 -+	  }
 430.706 -+	if (!__from)
 430.707 -+	  __from = __from_chunk_end;
 430.708 -+	
 430.709 -+	__ret += __from - __tmp_from;
 430.710 -+	__max -= __conv;
 430.711 -+
 430.712 -+	if (__from < __end && __max)
 430.713 -+	  {
 430.714 -+	    // XXX Probably wrong for stateful encodings
 430.715 -+	    __tmp_state = __state;
 430.716 -+	    ++__from;
 430.717 -+	    ++__ret;
 430.718 -+	    --__max;
 430.719 -+	  }
 430.720 -+      }
 430.721 -+
 430.722 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.723 -+    __uselocale(__old);
 430.724 -+#endif
 430.725 -+
 430.726 -+    return __ret; 
 430.727 -+  }
 430.728 -+#endif
 430.729 -+}
 430.730 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
 430.731 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 430.732 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:35.000000000 +0200
 430.733 -@@ -0,0 +1,80 @@
 430.734 -+// std::collate implementation details, GNU version -*- C++ -*-
 430.735 -+
 430.736 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 430.737 -+//
 430.738 -+// This file is part of the GNU ISO C++ Library.  This library is free
 430.739 -+// software; you can redistribute it and/or modify it under the
 430.740 -+// terms of the GNU General Public License as published by the
 430.741 -+// Free Software Foundation; either version 2, or (at your option)
 430.742 -+// any later version.
 430.743 -+
 430.744 -+// This library is distributed in the hope that it will be useful,
 430.745 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 430.746 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 430.747 -+// GNU General Public License for more details.
 430.748 -+
 430.749 -+// You should have received a copy of the GNU General Public License along
 430.750 -+// with this library; see the file COPYING.  If not, write to the Free
 430.751 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 430.752 -+// USA.
 430.753 -+
 430.754 -+// As a special exception, you may use this file as part of a free software
 430.755 -+// library without restriction.  Specifically, if other files instantiate
 430.756 -+// templates or use macros or inline functions from this file, or you compile
 430.757 -+// this file and link it with other files to produce an executable, this
 430.758 -+// file does not by itself cause the resulting executable to be covered by
 430.759 -+// the GNU General Public License.  This exception does not however
 430.760 -+// invalidate any other reasons why the executable file might be covered by
 430.761 -+// the GNU General Public License.
 430.762 -+
 430.763 -+//
 430.764 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 430.765 -+//
 430.766 -+
 430.767 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 430.768 -+
 430.769 -+#include <locale>
 430.770 -+#include <bits/c++locale_internal.h>
 430.771 -+
 430.772 -+#ifndef __UCLIBC_HAS_XLOCALE__
 430.773 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 430.774 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 430.775 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 430.776 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 430.777 -+#endif
 430.778 -+
 430.779 -+namespace std
 430.780 -+{
 430.781 -+  // These are basically extensions to char_traits, and perhaps should
 430.782 -+  // be put there instead of here.
 430.783 -+  template<>
 430.784 -+    int 
 430.785 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 430.786 -+    { 
 430.787 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 430.788 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 430.789 -+    }
 430.790 -+  
 430.791 -+  template<>
 430.792 -+    size_t
 430.793 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 430.794 -+				size_t __n) const 
 430.795 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 430.796 -+
 430.797 -+#ifdef _GLIBCXX_USE_WCHAR_T
 430.798 -+  template<>
 430.799 -+    int 
 430.800 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 430.801 -+				 const wchar_t* __two) const
 430.802 -+    {
 430.803 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 430.804 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 430.805 -+    }
 430.806 -+  
 430.807 -+  template<>
 430.808 -+    size_t
 430.809 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 430.810 -+				   size_t __n) const
 430.811 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 430.812 -+#endif
 430.813 -+}
 430.814 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 430.815 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 430.816 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:35.000000000 +0200
 430.817 -@@ -0,0 +1,300 @@
 430.818 -+// std::ctype implementation details, GNU version -*- C++ -*-
 430.819 -+
 430.820 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 430.821 -+//
 430.822 -+// This file is part of the GNU ISO C++ Library.  This library is free
 430.823 -+// software; you can redistribute it and/or modify it under the
 430.824 -+// terms of the GNU General Public License as published by the
 430.825 -+// Free Software Foundation; either version 2, or (at your option)
 430.826 -+// any later version.
 430.827 -+
 430.828 -+// This library is distributed in the hope that it will be useful,
 430.829 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 430.830 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 430.831 -+// GNU General Public License for more details.
 430.832 -+
 430.833 -+// You should have received a copy of the GNU General Public License along
 430.834 -+// with this library; see the file COPYING.  If not, write to the Free
 430.835 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 430.836 -+// USA.
 430.837 -+
 430.838 -+// As a special exception, you may use this file as part of a free software
 430.839 -+// library without restriction.  Specifically, if other files instantiate
 430.840 -+// templates or use macros or inline functions from this file, or you compile
 430.841 -+// this file and link it with other files to produce an executable, this
 430.842 -+// file does not by itself cause the resulting executable to be covered by
 430.843 -+// the GNU General Public License.  This exception does not however
 430.844 -+// invalidate any other reasons why the executable file might be covered by
 430.845 -+// the GNU General Public License.
 430.846 -+
 430.847 -+//
 430.848 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 430.849 -+//
 430.850 -+
 430.851 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 430.852 -+
 430.853 -+#define _LIBC
 430.854 -+#include <locale>
 430.855 -+#undef _LIBC
 430.856 -+#include <bits/c++locale_internal.h>
 430.857 -+
 430.858 -+#ifndef __UCLIBC_HAS_XLOCALE__
 430.859 -+#define __wctype_l(S, L)           wctype((S))
 430.860 -+#define __towupper_l(C, L)         towupper((C))
 430.861 -+#define __towlower_l(C, L)         towlower((C))
 430.862 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 430.863 -+#endif
 430.864 -+
 430.865 -+namespace std
 430.866 -+{
 430.867 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 430.868 -+  // various /config/os/* files.
 430.869 -+  template<>
 430.870 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 430.871 -+    : ctype<char>(0, false, __refs) 
 430.872 -+    { 		
 430.873 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 430.874 -+	{
 430.875 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 430.876 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 430.877 -+#ifdef __UCLIBC_HAS_XLOCALE__
 430.878 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 430.879 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 430.880 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 430.881 -+#endif
 430.882 -+	}
 430.883 -+    }
 430.884 -+
 430.885 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 430.886 -+  ctype<wchar_t>::__wmask_type
 430.887 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 430.888 -+  {
 430.889 -+    __wmask_type __ret;
 430.890 -+    switch (__m)
 430.891 -+      {
 430.892 -+      case space:
 430.893 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 430.894 -+	break;
 430.895 -+      case print:
 430.896 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 430.897 -+	break;
 430.898 -+      case cntrl:
 430.899 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 430.900 -+	break;
 430.901 -+      case upper:
 430.902 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 430.903 -+	break;
 430.904 -+      case lower:
 430.905 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 430.906 -+	break;
 430.907 -+      case alpha:
 430.908 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 430.909 -+	break;
 430.910 -+      case digit:
 430.911 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 430.912 -+	break;
 430.913 -+      case punct:
 430.914 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 430.915 -+	break;
 430.916 -+      case xdigit:
 430.917 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 430.918 -+	break;
 430.919 -+      case alnum:
 430.920 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 430.921 -+	break;
 430.922 -+      case graph:
 430.923 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 430.924 -+	break;
 430.925 -+      default:
 430.926 -+	__ret = __wmask_type();
 430.927 -+      }
 430.928 -+    return __ret;
 430.929 -+  }
 430.930 -+  
 430.931 -+  wchar_t
 430.932 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 430.933 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 430.934 -+
 430.935 -+  const wchar_t*
 430.936 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 430.937 -+  {
 430.938 -+    while (__lo < __hi)
 430.939 -+      {
 430.940 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 430.941 -+        ++__lo;
 430.942 -+      }
 430.943 -+    return __hi;
 430.944 -+  }
 430.945 -+  
 430.946 -+  wchar_t
 430.947 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 430.948 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 430.949 -+  
 430.950 -+  const wchar_t*
 430.951 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 430.952 -+  {
 430.953 -+    while (__lo < __hi)
 430.954 -+      {
 430.955 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 430.956 -+        ++__lo;
 430.957 -+      }
 430.958 -+    return __hi;
 430.959 -+  }
 430.960 -+
 430.961 -+  bool
 430.962 -+  ctype<wchar_t>::
 430.963 -+  do_is(mask __m, wchar_t __c) const
 430.964 -+  { 
 430.965 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
 430.966 -+    // library for blank.
 430.967 -+    bool __ret = false;
 430.968 -+    const size_t __bitmasksize = 11; 
 430.969 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 430.970 -+      if (__m & _M_bit[__bitcur]
 430.971 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 430.972 -+	{
 430.973 -+	  __ret = true;
 430.974 -+	  break;
 430.975 -+	}
 430.976 -+    return __ret;    
 430.977 -+  }
 430.978 -+  
 430.979 -+  const wchar_t* 
 430.980 -+  ctype<wchar_t>::
 430.981 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 430.982 -+  {
 430.983 -+    for (; __lo < __hi; ++__vec, ++__lo)
 430.984 -+      {
 430.985 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 430.986 -+	// library for blank.
 430.987 -+	const size_t __bitmasksize = 11; 
 430.988 -+	mask __m = 0;
 430.989 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 430.990 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 430.991 -+	    __m |= _M_bit[__bitcur];
 430.992 -+	*__vec = __m;
 430.993 -+      }
 430.994 -+    return __hi;
 430.995 -+  }
 430.996 -+  
 430.997 -+  const wchar_t* 
 430.998 -+  ctype<wchar_t>::
 430.999 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
430.1000 -+  {
430.1001 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
430.1002 -+      ++__lo;
430.1003 -+    return __lo;
430.1004 -+  }
430.1005 -+
430.1006 -+  const wchar_t*
430.1007 -+  ctype<wchar_t>::
430.1008 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
430.1009 -+  {
430.1010 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
430.1011 -+      ++__lo;
430.1012 -+    return __lo;
430.1013 -+  }
430.1014 -+
430.1015 -+  wchar_t
430.1016 -+  ctype<wchar_t>::
430.1017 -+  do_widen(char __c) const
430.1018 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
430.1019 -+
430.1020 -+  const char* 
430.1021 -+  ctype<wchar_t>::
430.1022 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
430.1023 -+  {
430.1024 -+    while (__lo < __hi)
430.1025 -+      {
430.1026 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
430.1027 -+	++__lo;
430.1028 -+	++__dest;
430.1029 -+      }
430.1030 -+    return __hi;
430.1031 -+  }
430.1032 -+
430.1033 -+  char
430.1034 -+  ctype<wchar_t>::
430.1035 -+  do_narrow(wchar_t __wc, char __dfault) const
430.1036 -+  {
430.1037 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
430.1038 -+      return _M_narrow[__wc];
430.1039 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1040 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
430.1041 -+#endif
430.1042 -+    const int __c = wctob(__wc);
430.1043 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1044 -+    __uselocale(__old);
430.1045 -+#endif
430.1046 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
430.1047 -+  }
430.1048 -+
430.1049 -+  const wchar_t*
430.1050 -+  ctype<wchar_t>::
430.1051 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
430.1052 -+	    char* __dest) const
430.1053 -+  {
430.1054 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1055 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
430.1056 -+#endif
430.1057 -+    if (_M_narrow_ok)
430.1058 -+      while (__lo < __hi)
430.1059 -+	{
430.1060 -+	  if (*__lo >= 0 && *__lo < 128)
430.1061 -+	    *__dest = _M_narrow[*__lo];
430.1062 -+	  else
430.1063 -+	    {
430.1064 -+	      const int __c = wctob(*__lo);
430.1065 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
430.1066 -+	    }
430.1067 -+	  ++__lo;
430.1068 -+	  ++__dest;
430.1069 -+	}
430.1070 -+    else
430.1071 -+      while (__lo < __hi)
430.1072 -+	{
430.1073 -+	  const int __c = wctob(*__lo);
430.1074 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
430.1075 -+	  ++__lo;
430.1076 -+	  ++__dest;
430.1077 -+	}
430.1078 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1079 -+    __uselocale(__old);
430.1080 -+#endif
430.1081 -+    return __hi;
430.1082 -+  }
430.1083 -+
430.1084 -+  void
430.1085 -+  ctype<wchar_t>::_M_initialize_ctype()
430.1086 -+  {
430.1087 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1088 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
430.1089 -+#endif
430.1090 -+    wint_t __i;
430.1091 -+    for (__i = 0; __i < 128; ++__i)
430.1092 -+      {
430.1093 -+	const int __c = wctob(__i);
430.1094 -+	if (__c == EOF)
430.1095 -+	  break;
430.1096 -+	else
430.1097 -+	  _M_narrow[__i] = static_cast<char>(__c);
430.1098 -+      }
430.1099 -+    if (__i == 128)
430.1100 -+      _M_narrow_ok = true;
430.1101 -+    else
430.1102 -+      _M_narrow_ok = false;
430.1103 -+    for (size_t __j = 0;
430.1104 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
430.1105 -+      _M_widen[__j] = btowc(__j);
430.1106 -+
430.1107 -+    for (size_t __k = 0; __k <= 11; ++__k)
430.1108 -+      { 
430.1109 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
430.1110 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
430.1111 -+      }
430.1112 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1113 -+    __uselocale(__old);
430.1114 -+#endif
430.1115 -+  }
430.1116 -+#endif //  _GLIBCXX_USE_WCHAR_T
430.1117 -+}
430.1118 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
430.1119 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
430.1120 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:35.000000000 +0200
430.1121 -@@ -0,0 +1,100 @@
430.1122 -+// std::messages implementation details, GNU version -*- C++ -*-
430.1123 -+
430.1124 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
430.1125 -+//
430.1126 -+// This file is part of the GNU ISO C++ Library.  This library is free
430.1127 -+// software; you can redistribute it and/or modify it under the
430.1128 -+// terms of the GNU General Public License as published by the
430.1129 -+// Free Software Foundation; either version 2, or (at your option)
430.1130 -+// any later version.
430.1131 -+
430.1132 -+// This library is distributed in the hope that it will be useful,
430.1133 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
430.1134 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
430.1135 -+// GNU General Public License for more details.
430.1136 -+
430.1137 -+// You should have received a copy of the GNU General Public License along
430.1138 -+// with this library; see the file COPYING.  If not, write to the Free
430.1139 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
430.1140 -+// USA.
430.1141 -+
430.1142 -+// As a special exception, you may use this file as part of a free software
430.1143 -+// library without restriction.  Specifically, if other files instantiate
430.1144 -+// templates or use macros or inline functions from this file, or you compile
430.1145 -+// this file and link it with other files to produce an executable, this
430.1146 -+// file does not by itself cause the resulting executable to be covered by
430.1147 -+// the GNU General Public License.  This exception does not however
430.1148 -+// invalidate any other reasons why the executable file might be covered by
430.1149 -+// the GNU General Public License.
430.1150 -+
430.1151 -+//
430.1152 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
430.1153 -+//
430.1154 -+
430.1155 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
430.1156 -+
430.1157 -+#include <locale>
430.1158 -+#include <bits/c++locale_internal.h>
430.1159 -+
430.1160 -+#ifdef __UCLIBC_MJN3_ONLY__
430.1161 -+#warning fix gettext stuff
430.1162 -+#endif
430.1163 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
430.1164 -+extern "C" char *__dcgettext(const char *domainname,
430.1165 -+			     const char *msgid, int category);
430.1166 -+#undef gettext
430.1167 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
430.1168 -+#else
430.1169 -+#undef gettext
430.1170 -+#define gettext(msgid) (msgid)
430.1171 -+#endif
430.1172 -+
430.1173 -+namespace std
430.1174 -+{
430.1175 -+  // Specializations.
430.1176 -+  template<>
430.1177 -+    string
430.1178 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
430.1179 -+    {
430.1180 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1181 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
430.1182 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
430.1183 -+      __uselocale(__old);
430.1184 -+      return string(__msg);
430.1185 -+#elif defined __UCLIBC_HAS_LOCALE__
430.1186 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
430.1187 -+      setlocale(LC_ALL, _M_name_messages);
430.1188 -+      const char* __msg = gettext(__dfault.c_str());
430.1189 -+      setlocale(LC_ALL, __old);
430.1190 -+      free(__old);
430.1191 -+      return string(__msg);
430.1192 -+#else
430.1193 -+      const char* __msg = gettext(__dfault.c_str());
430.1194 -+      return string(__msg);
430.1195 -+#endif
430.1196 -+    }
430.1197 -+
430.1198 -+#ifdef _GLIBCXX_USE_WCHAR_T
430.1199 -+  template<>
430.1200 -+    wstring
430.1201 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
430.1202 -+    {
430.1203 -+# ifdef __UCLIBC_HAS_XLOCALE__
430.1204 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
430.1205 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
430.1206 -+      __uselocale(__old);
430.1207 -+      return _M_convert_from_char(__msg);
430.1208 -+# elif defined __UCLIBC_HAS_LOCALE__
430.1209 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
430.1210 -+      setlocale(LC_ALL, _M_name_messages);
430.1211 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
430.1212 -+      setlocale(LC_ALL, __old);
430.1213 -+      free(__old);
430.1214 -+      return _M_convert_from_char(__msg);
430.1215 -+# else
430.1216 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
430.1217 -+      return _M_convert_from_char(__msg);
430.1218 -+# endif
430.1219 -+    }
430.1220 -+#endif
430.1221 -+}
430.1222 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
430.1223 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
430.1224 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:35.000000000 +0200
430.1225 -@@ -0,0 +1,118 @@
430.1226 -+// std::messages implementation details, GNU version -*- C++ -*-
430.1227 -+
430.1228 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
430.1229 -+//
430.1230 -+// This file is part of the GNU ISO C++ Library.  This library is free
430.1231 -+// software; you can redistribute it and/or modify it under the
430.1232 -+// terms of the GNU General Public License as published by the
430.1233 -+// Free Software Foundation; either version 2, or (at your option)
430.1234 -+// any later version.
430.1235 -+
430.1236 -+// This library is distributed in the hope that it will be useful,
430.1237 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
430.1238 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
430.1239 -+// GNU General Public License for more details.
430.1240 -+
430.1241 -+// You should have received a copy of the GNU General Public License along
430.1242 -+// with this library; see the file COPYING.  If not, write to the Free
430.1243 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
430.1244 -+// USA.
430.1245 -+
430.1246 -+// As a special exception, you may use this file as part of a free software
430.1247 -+// library without restriction.  Specifically, if other files instantiate
430.1248 -+// templates or use macros or inline functions from this file, or you compile
430.1249 -+// this file and link it with other files to produce an executable, this
430.1250 -+// file does not by itself cause the resulting executable to be covered by
430.1251 -+// the GNU General Public License.  This exception does not however
430.1252 -+// invalidate any other reasons why the executable file might be covered by
430.1253 -+// the GNU General Public License.
430.1254 -+
430.1255 -+//
430.1256 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
430.1257 -+//
430.1258 -+
430.1259 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
430.1260 -+
430.1261 -+#ifdef __UCLIBC_MJN3_ONLY__
430.1262 -+#warning fix prototypes for *textdomain funcs
430.1263 -+#endif
430.1264 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
430.1265 -+extern "C" char *__textdomain(const char *domainname);
430.1266 -+extern "C" char *__bindtextdomain(const char *domainname,
430.1267 -+				  const char *dirname);
430.1268 -+#else
430.1269 -+#undef __textdomain
430.1270 -+#undef __bindtextdomain
430.1271 -+#define __textdomain(D)           ((void)0)
430.1272 -+#define __bindtextdomain(D,P)     ((void)0)
430.1273 -+#endif
430.1274 -+
430.1275 -+  // Non-virtual member functions.
430.1276 -+  template<typename _CharT>
430.1277 -+     messages<_CharT>::messages(size_t __refs)
430.1278 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
430.1279 -+     _M_name_messages(_S_get_c_name())
430.1280 -+     { }
430.1281 -+
430.1282 -+  template<typename _CharT>
430.1283 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
430.1284 -+				size_t __refs) 
430.1285 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
430.1286 -+     _M_name_messages(__s)
430.1287 -+     {
430.1288 -+       char* __tmp = new char[std::strlen(__s) + 1];
430.1289 -+       std::strcpy(__tmp, __s);
430.1290 -+       _M_name_messages = __tmp;
430.1291 -+     }
430.1292 -+
430.1293 -+  template<typename _CharT>
430.1294 -+    typename messages<_CharT>::catalog 
430.1295 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
430.1296 -+			   const char* __dir) const
430.1297 -+    { 
430.1298 -+      __bindtextdomain(__s.c_str(), __dir);
430.1299 -+      return this->do_open(__s, __loc); 
430.1300 -+    }
430.1301 -+
430.1302 -+  // Virtual member functions.
430.1303 -+  template<typename _CharT>
430.1304 -+    messages<_CharT>::~messages()
430.1305 -+    { 
430.1306 -+      if (_M_name_messages != _S_get_c_name())
430.1307 -+	delete [] _M_name_messages;
430.1308 -+      _S_destroy_c_locale(_M_c_locale_messages); 
430.1309 -+    }
430.1310 -+
430.1311 -+  template<typename _CharT>
430.1312 -+    typename messages<_CharT>::catalog 
430.1313 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
430.1314 -+			      const locale&) const
430.1315 -+    { 
430.1316 -+      // No error checking is done, assume the catalog exists and can
430.1317 -+      // be used.
430.1318 -+      __textdomain(__s.c_str());
430.1319 -+      return 0;
430.1320 -+    }
430.1321 -+
430.1322 -+  template<typename _CharT>
430.1323 -+    void    
430.1324 -+    messages<_CharT>::do_close(catalog) const 
430.1325 -+    { }
430.1326 -+
430.1327 -+   // messages_byname
430.1328 -+   template<typename _CharT>
430.1329 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
430.1330 -+     : messages<_CharT>(__refs) 
430.1331 -+     { 
430.1332 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
430.1333 -+	 delete [] this->_M_name_messages;
430.1334 -+       char* __tmp = new char[std::strlen(__s) + 1];
430.1335 -+       std::strcpy(__tmp, __s);
430.1336 -+       this->_M_name_messages = __tmp;
430.1337 -+
430.1338 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
430.1339 -+	 {
430.1340 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
430.1341 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
430.1342 -+	 }
430.1343 -+     }
430.1344 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
430.1345 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
430.1346 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:35.000000000 +0200
430.1347 -@@ -0,0 +1,692 @@
430.1348 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
430.1349 -+
430.1350 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
430.1351 -+//
430.1352 -+// This file is part of the GNU ISO C++ Library.  This library is free
430.1353 -+// software; you can redistribute it and/or modify it under the
430.1354 -+// terms of the GNU General Public License as published by the
430.1355 -+// Free Software Foundation; either version 2, or (at your option)
430.1356 -+// any later version.
430.1357 -+
430.1358 -+// This library is distributed in the hope that it will be useful,
430.1359 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
430.1360 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
430.1361 -+// GNU General Public License for more details.
430.1362 -+
430.1363 -+// You should have received a copy of the GNU General Public License along
430.1364 -+// with this library; see the file COPYING.  If not, write to the Free
430.1365 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
430.1366 -+// USA.
430.1367 -+
430.1368 -+// As a special exception, you may use this file as part of a free software
430.1369 -+// library without restriction.  Specifically, if other files instantiate
430.1370 -+// templates or use macros or inline functions from this file, or you compile
430.1371 -+// this file and link it with other files to produce an executable, this
430.1372 -+// file does not by itself cause the resulting executable to be covered by
430.1373 -+// the GNU General Public License.  This exception does not however
430.1374 -+// invalidate any other reasons why the executable file might be covered by
430.1375 -+// the GNU General Public License.
430.1376 -+
430.1377 -+//
430.1378 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
430.1379 -+//
430.1380 -+
430.1381 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
430.1382 -+
430.1383 -+#define _LIBC
430.1384 -+#include <locale>
430.1385 -+#undef _LIBC
430.1386 -+#include <bits/c++locale_internal.h>
430.1387 -+
430.1388 -+#ifdef __UCLIBC_MJN3_ONLY__
430.1389 -+#warning optimize this for uclibc
430.1390 -+#warning tailor for stub locale support
430.1391 -+#endif
430.1392 -+
430.1393 -+#ifndef __UCLIBC_HAS_XLOCALE__
430.1394 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
430.1395 -+#endif
430.1396 -+
430.1397 -+namespace std
430.1398 -+{
430.1399 -+  // Construct and return valid pattern consisting of some combination of:
430.1400 -+  // space none symbol sign value
430.1401 -+  money_base::pattern
430.1402 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
430.1403 -+  { 
430.1404 -+    pattern __ret;
430.1405 -+
430.1406 -+    // This insanely complicated routine attempts to construct a valid
430.1407 -+    // pattern for use with monyepunct. A couple of invariants:
430.1408 -+
430.1409 -+    // if (__precedes) symbol -> value
430.1410 -+    // else value -> symbol
430.1411 -+    
430.1412 -+    // if (__space) space
430.1413 -+    // else none
430.1414 -+
430.1415 -+    // none == never first
430.1416 -+    // space never first or last
430.1417 -+
430.1418 -+    // Any elegant implementations of this are welcome.
430.1419 -+    switch (__posn)
430.1420 -+      {
430.1421 -+      case 0:
430.1422 -+      case 1:
430.1423 -+	// 1 The sign precedes the value and symbol.
430.1424 -+	__ret.field[0] = sign;
430.1425 -+	if (__space)
430.1426 -+	  {
430.1427 -+	    // Pattern starts with sign.
430.1428 -+	    if (__precedes)
430.1429 -+	      {
430.1430 -+		__ret.field[1] = symbol;
430.1431 -+		__ret.field[3] = value;
430.1432 -+	      }
430.1433 -+	    else
430.1434 -+	      {
430.1435 -+		__ret.field[1] = value;
430.1436 -+		__ret.field[3] = symbol;
430.1437 -+	      }
430.1438 -+	    __ret.field[2] = space;
430.1439 -+	  }
430.1440 -+	else
430.1441 -+	  {
430.1442 -+	    // Pattern starts with sign and ends with none.
430.1443 -+	    if (__precedes)
430.1444 -+	      {
430.1445 -+		__ret.field[1] = symbol;
430.1446 -+		__ret.field[2] = value;
430.1447 -+	      }
430.1448 -+	    else
430.1449 -+	      {
430.1450 -+		__ret.field[1] = value;
430.1451 -+		__ret.field[2] = symbol;
430.1452 -+	      }
430.1453 -+	    __ret.field[3] = none;
430.1454 -+	  }
430.1455 -+	break;
430.1456 -+      case 2:
430.1457 -+	// 2 The sign follows the value and symbol.
430.1458 -+	if (__space)
430.1459 -+	  {
430.1460 -+	    // Pattern either ends with sign.
430.1461 -+	    if (__precedes)
430.1462 -+	      {
430.1463 -+		__ret.field[0] = symbol;
430.1464 -+		__ret.field[2] = value;
430.1465 -+	      }
430.1466 -+	    else
430.1467 -+	      {
430.1468 -+		__ret.field[0] = value;
430.1469 -+		__ret.field[2] = symbol;
430.1470 -+	      }
430.1471 -+	    __ret.field[1] = space;
430.1472 -+	    __ret.field[3] = sign;
430.1473 -+	  }
430.1474 -+	else
430.1475 -+	  {
430.1476 -+	    // Pattern ends with sign then none.
430.1477 -+	    if (__precedes)
430.1478 -+	      {
430.1479 -+		__ret.field[0] = symbol;
430.1480 -+		__ret.field[1] = value;
430.1481 -+	      }
430.1482 -+	    else
430.1483 -+	      {
430.1484 -+		__ret.field[0] = value;
430.1485 -+		__ret.field[1] = symbol;
430.1486 -+	      }
430.1487 -+	    __ret.field[2] = sign;
430.1488 -+	    __ret.field[3] = none;
430.1489 -+	  }
430.1490 -+	break;
430.1491 -+      case 3:
430.1492 -+	// 3 The sign immediately precedes the symbol.
430.1493 -+	if (__precedes)
430.1494 -+	  {
430.1495 -+	    __ret.field[0] = sign;
430.1496 -+	    __ret.field[1] = symbol;	    
430.1497 -+	    if (__space)
430.1498 -+	      {
430.1499 -+		__ret.field[2] = space;
430.1500 -+		__ret.field[3] = value;
430.1501 -+	      }
430.1502 -+	    else
430.1503 -+	      {
430.1504 -+		__ret.field[2] = value;		
430.1505 -+		__ret.field[3] = none;
430.1506 -+	      }
430.1507 -+	  }
430.1508 -+	else
430.1509 -+	  {
430.1510 -+	    __ret.field[0] = value;
430.1511 -+	    if (__space)
430.1512 -+	      {
430.1513 -+		__ret.field[1] = space;
430.1514 -+		__ret.field[2] = sign;
430.1515 -+		__ret.field[3] = symbol;
430.1516 -+	      }
430.1517 -+	    else
430.1518 -+	      {
430.1519 -+		__ret.field[1] = sign;
430.1520 -+		__ret.field[2] = symbol;
430.1521 -+		__ret.field[3] = none;
430.1522 -+	      }
430.1523 -+	  }
430.1524 -+	break;
430.1525 -+      case 4:
430.1526 -+	// 4 The sign immediately follows the symbol.
430.1527 -+	if (__precedes)
430.1528 -+	  {
430.1529 -+	    __ret.field[0] = symbol;
430.1530 -+	    __ret.field[1] = sign;
430.1531 -+	    if (__space)
430.1532 -+	      {
430.1533 -+		__ret.field[2] = space;
430.1534 -+		__ret.field[3] = value;
430.1535 -+	      }
430.1536 -+	    else
430.1537 -+	      {
430.1538 -+		__ret.field[2] = value;
430.1539 -+		__ret.field[3] = none;
430.1540 -+	      }
430.1541 -+	  }
430.1542 -+	else
430.1543 -+	  {
430.1544 -+	    __ret.field[0] = value;
430.1545 -+	    if (__space)
430.1546 -+	      {
430.1547 -+		__ret.field[1] = space;
430.1548 -+		__ret.field[2] = symbol;
430.1549 -+		__ret.field[3] = sign;
430.1550 -+	      }
430.1551 -+	    else
430.1552 -+	      {
430.1553 -+		__ret.field[1] = symbol;
430.1554 -+		__ret.field[2] = sign;
430.1555 -+		__ret.field[3] = none;
430.1556 -+	      }
430.1557 -+	  }
430.1558 -+	break;
430.1559 -+      default:
430.1560 -+	;
430.1561 -+      }
430.1562 -+    return __ret;
430.1563 -+  }
430.1564 -+
430.1565 -+  template<> 
430.1566 -+    void
430.1567 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
430.1568 -+						     const char*)
430.1569 -+    {
430.1570 -+      if (!_M_data)
430.1571 -+	_M_data = new __moneypunct_cache<char, true>;
430.1572 -+
430.1573 -+      if (!__cloc)
430.1574 -+	{
430.1575 -+	  // "C" locale
430.1576 -+	  _M_data->_M_decimal_point = '.';
430.1577 -+	  _M_data->_M_thousands_sep = ',';
430.1578 -+	  _M_data->_M_grouping = "";
430.1579 -+	  _M_data->_M_grouping_size = 0;
430.1580 -+	  _M_data->_M_curr_symbol = "";
430.1581 -+	  _M_data->_M_curr_symbol_size = 0;
430.1582 -+	  _M_data->_M_positive_sign = "";
430.1583 -+	  _M_data->_M_positive_sign_size = 0;
430.1584 -+	  _M_data->_M_negative_sign = "";
430.1585 -+	  _M_data->_M_negative_sign_size = 0;
430.1586 -+	  _M_data->_M_frac_digits = 0;
430.1587 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
430.1588 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
430.1589 -+
430.1590 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
430.1591 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
430.1592 -+	}
430.1593 -+      else
430.1594 -+	{
430.1595 -+	  // Named locale.
430.1596 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
430.1597 -+							__cloc));
430.1598 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
430.1599 -+							__cloc));
430.1600 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
430.1601 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
430.1602 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
430.1603 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
430.1604 -+
430.1605 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
430.1606 -+	  if (!__nposn)
430.1607 -+	    _M_data->_M_negative_sign = "()";
430.1608 -+	  else
430.1609 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
430.1610 -+							__cloc);
430.1611 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
430.1612 -+
430.1613 -+	  // _Intl == true
430.1614 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
430.1615 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
430.1616 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
430.1617 -+						      __cloc));
430.1618 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
430.1619 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
430.1620 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
430.1621 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
430.1622 -+							__pposn);
430.1623 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
430.1624 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
430.1625 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
430.1626 -+							__nposn);
430.1627 -+	}
430.1628 -+    }
430.1629 -+
430.1630 -+  template<> 
430.1631 -+    void
430.1632 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
430.1633 -+						      const char*)
430.1634 -+    {
430.1635 -+      if (!_M_data)
430.1636 -+	_M_data = new __moneypunct_cache<char, false>;
430.1637 -+
430.1638 -+      if (!__cloc)
430.1639 -+	{
430.1640 -+	  // "C" locale
430.1641 -+	  _M_data->_M_decimal_point = '.';
430.1642 -+	  _M_data->_M_thousands_sep = ',';
430.1643 -+	  _M_data->_M_grouping = "";
430.1644 -+	  _M_data->_M_grouping_size = 0;
430.1645 -+	  _M_data->_M_curr_symbol = "";
430.1646 -+	  _M_data->_M_curr_symbol_size = 0;
430.1647 -+	  _M_data->_M_positive_sign = "";
430.1648 -+	  _M_data->_M_positive_sign_size = 0;
430.1649 -+	  _M_data->_M_negative_sign = "";
430.1650 -+	  _M_data->_M_negative_sign_size = 0;
430.1651 -+	  _M_data->_M_frac_digits = 0;
430.1652 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
430.1653 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
430.1654 -+
430.1655 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
430.1656 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
430.1657 -+	}
430.1658 -+      else
430.1659 -+	{
430.1660 -+	  // Named locale.
430.1661 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
430.1662 -+							__cloc));
430.1663 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
430.1664 -+							__cloc));
430.1665 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
430.1666 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
430.1667 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
430.1668 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
430.1669 -+
430.1670 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
430.1671 -+	  if (!__nposn)
430.1672 -+	    _M_data->_M_negative_sign = "()";
430.1673 -+	  else
430.1674 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
430.1675 -+							__cloc);
430.1676 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
430.1677 -+
430.1678 -+	  // _Intl == false
430.1679 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
430.1680 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
430.1681 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
430.1682 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
430.1683 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
430.1684 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
430.1685 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
430.1686 -+							__pposn);
430.1687 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
430.1688 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
430.1689 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
430.1690 -+							__nposn);
430.1691 -+	}
430.1692 -+    }
430.1693 -+
430.1694 -+  template<> 
430.1695 -+    moneypunct<char, true>::~moneypunct()
430.1696 -+    { delete _M_data; }
430.1697 -+
430.1698 -+  template<> 
430.1699 -+    moneypunct<char, false>::~moneypunct()
430.1700 -+    { delete _M_data; }
430.1701 -+
430.1702 -+#ifdef _GLIBCXX_USE_WCHAR_T
430.1703 -+  template<> 
430.1704 -+    void
430.1705 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
430.1706 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1707 -+							const char*)
430.1708 -+#else
430.1709 -+							const char* __name)
430.1710 -+#endif
430.1711 -+    {
430.1712 -+      if (!_M_data)
430.1713 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
430.1714 -+
430.1715 -+      if (!__cloc)
430.1716 -+	{
430.1717 -+	  // "C" locale
430.1718 -+	  _M_data->_M_decimal_point = L'.';
430.1719 -+	  _M_data->_M_thousands_sep = L',';
430.1720 -+	  _M_data->_M_grouping = "";
430.1721 -+	  _M_data->_M_grouping_size = 0;
430.1722 -+	  _M_data->_M_curr_symbol = L"";
430.1723 -+	  _M_data->_M_curr_symbol_size = 0;
430.1724 -+	  _M_data->_M_positive_sign = L"";
430.1725 -+	  _M_data->_M_positive_sign_size = 0;
430.1726 -+	  _M_data->_M_negative_sign = L"";
430.1727 -+	  _M_data->_M_negative_sign_size = 0;
430.1728 -+	  _M_data->_M_frac_digits = 0;
430.1729 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
430.1730 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
430.1731 -+
430.1732 -+	  // Use ctype::widen code without the facet...
430.1733 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
430.1734 -+	    _M_data->_M_atoms[__i] =
430.1735 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
430.1736 -+	}
430.1737 -+      else
430.1738 -+	{
430.1739 -+	  // Named locale.
430.1740 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1741 -+	  __c_locale __old = __uselocale(__cloc);
430.1742 -+#else
430.1743 -+	  // Switch to named locale so that mbsrtowcs will work.
430.1744 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
430.1745 -+	  setlocale(LC_ALL, __name);
430.1746 -+#endif
430.1747 -+
430.1748 -+#ifdef __UCLIBC_MJN3_ONLY__
430.1749 -+#warning fix this... should be monetary
430.1750 -+#endif
430.1751 -+#ifdef __UCLIBC__
430.1752 -+# ifdef __UCLIBC_HAS_XLOCALE__
430.1753 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
430.1754 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
430.1755 -+# else
430.1756 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
430.1757 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
430.1758 -+# endif
430.1759 -+#else
430.1760 -+	  union { char *__s; wchar_t __w; } __u;
430.1761 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
430.1762 -+	  _M_data->_M_decimal_point = __u.__w;
430.1763 -+
430.1764 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
430.1765 -+	  _M_data->_M_thousands_sep = __u.__w;
430.1766 -+#endif
430.1767 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
430.1768 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
430.1769 -+
430.1770 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
430.1771 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
430.1772 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
430.1773 -+
430.1774 -+	  wchar_t* __wcs_ps = 0;
430.1775 -+	  wchar_t* __wcs_ns = 0;
430.1776 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
430.1777 -+	  try
430.1778 -+	    {
430.1779 -+	      mbstate_t __state;
430.1780 -+	      size_t __len = strlen(__cpossign);
430.1781 -+	      if (__len)
430.1782 -+		{
430.1783 -+		  ++__len;
430.1784 -+		  memset(&__state, 0, sizeof(mbstate_t));
430.1785 -+		  __wcs_ps = new wchar_t[__len];
430.1786 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
430.1787 -+		  _M_data->_M_positive_sign = __wcs_ps;
430.1788 -+		}
430.1789 -+	      else
430.1790 -+		_M_data->_M_positive_sign = L"";
430.1791 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
430.1792 -+	      
430.1793 -+	      __len = strlen(__cnegsign);
430.1794 -+	      if (!__nposn)
430.1795 -+		_M_data->_M_negative_sign = L"()";
430.1796 -+	      else if (__len)
430.1797 -+		{ 
430.1798 -+		  ++__len;
430.1799 -+		  memset(&__state, 0, sizeof(mbstate_t));
430.1800 -+		  __wcs_ns = new wchar_t[__len];
430.1801 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
430.1802 -+		  _M_data->_M_negative_sign = __wcs_ns;
430.1803 -+		}
430.1804 -+	      else
430.1805 -+		_M_data->_M_negative_sign = L"";
430.1806 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
430.1807 -+	      
430.1808 -+	      // _Intl == true.
430.1809 -+	      __len = strlen(__ccurr);
430.1810 -+	      if (__len)
430.1811 -+		{
430.1812 -+		  ++__len;
430.1813 -+		  memset(&__state, 0, sizeof(mbstate_t));
430.1814 -+		  wchar_t* __wcs = new wchar_t[__len];
430.1815 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
430.1816 -+		  _M_data->_M_curr_symbol = __wcs;
430.1817 -+		}
430.1818 -+	      else
430.1819 -+		_M_data->_M_curr_symbol = L"";
430.1820 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
430.1821 -+	    }
430.1822 -+	  catch (...)
430.1823 -+	    {
430.1824 -+	      delete _M_data;
430.1825 -+	      _M_data = 0;
430.1826 -+	      delete __wcs_ps;
430.1827 -+	      delete __wcs_ns;	      
430.1828 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1829 -+	      __uselocale(__old);
430.1830 -+#else
430.1831 -+	      setlocale(LC_ALL, __old);
430.1832 -+	      free(__old);
430.1833 -+#endif
430.1834 -+	      __throw_exception_again;
430.1835 -+	    } 
430.1836 -+	  
430.1837 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
430.1838 -+						      __cloc));
430.1839 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
430.1840 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
430.1841 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
430.1842 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
430.1843 -+							__pposn);
430.1844 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
430.1845 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
430.1846 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
430.1847 -+							__nposn);
430.1848 -+
430.1849 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1850 -+	  __uselocale(__old);
430.1851 -+#else
430.1852 -+	  setlocale(LC_ALL, __old);
430.1853 -+	  free(__old);
430.1854 -+#endif
430.1855 -+	}
430.1856 -+    }
430.1857 -+
430.1858 -+  template<> 
430.1859 -+  void
430.1860 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
430.1861 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1862 -+						       const char*)
430.1863 -+#else
430.1864 -+                                                       const char* __name)
430.1865 -+#endif
430.1866 -+  {
430.1867 -+    if (!_M_data)
430.1868 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
430.1869 -+
430.1870 -+    if (!__cloc)
430.1871 -+	{
430.1872 -+	  // "C" locale
430.1873 -+	  _M_data->_M_decimal_point = L'.';
430.1874 -+	  _M_data->_M_thousands_sep = L',';
430.1875 -+	  _M_data->_M_grouping = "";
430.1876 -+          _M_data->_M_grouping_size = 0;
430.1877 -+	  _M_data->_M_curr_symbol = L"";
430.1878 -+	  _M_data->_M_curr_symbol_size = 0;
430.1879 -+	  _M_data->_M_positive_sign = L"";
430.1880 -+	  _M_data->_M_positive_sign_size = 0;
430.1881 -+	  _M_data->_M_negative_sign = L"";
430.1882 -+	  _M_data->_M_negative_sign_size = 0;
430.1883 -+	  _M_data->_M_frac_digits = 0;
430.1884 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
430.1885 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
430.1886 -+
430.1887 -+	  // Use ctype::widen code without the facet...
430.1888 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
430.1889 -+	    _M_data->_M_atoms[__i] =
430.1890 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
430.1891 -+	}
430.1892 -+      else
430.1893 -+	{
430.1894 -+	  // Named locale.
430.1895 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1896 -+	  __c_locale __old = __uselocale(__cloc);
430.1897 -+#else
430.1898 -+	  // Switch to named locale so that mbsrtowcs will work.
430.1899 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
430.1900 -+	  setlocale(LC_ALL, __name);
430.1901 -+#endif
430.1902 -+
430.1903 -+#ifdef __UCLIBC_MJN3_ONLY__
430.1904 -+#warning fix this... should be monetary
430.1905 -+#endif
430.1906 -+#ifdef __UCLIBC__
430.1907 -+# ifdef __UCLIBC_HAS_XLOCALE__
430.1908 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
430.1909 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
430.1910 -+# else
430.1911 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
430.1912 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
430.1913 -+# endif
430.1914 -+#else
430.1915 -+          union { char *__s; wchar_t __w; } __u;
430.1916 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
430.1917 -+	  _M_data->_M_decimal_point = __u.__w;
430.1918 -+
430.1919 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
430.1920 -+	  _M_data->_M_thousands_sep = __u.__w;
430.1921 -+#endif
430.1922 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
430.1923 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
430.1924 -+
430.1925 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
430.1926 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
430.1927 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
430.1928 -+
430.1929 -+	  wchar_t* __wcs_ps = 0;
430.1930 -+	  wchar_t* __wcs_ns = 0;
430.1931 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
430.1932 -+	  try
430.1933 -+            {
430.1934 -+              mbstate_t __state;
430.1935 -+              size_t __len;
430.1936 -+              __len = strlen(__cpossign);
430.1937 -+              if (__len)
430.1938 -+                {
430.1939 -+		  ++__len;
430.1940 -+		  memset(&__state, 0, sizeof(mbstate_t));
430.1941 -+		  __wcs_ps = new wchar_t[__len];
430.1942 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
430.1943 -+		  _M_data->_M_positive_sign = __wcs_ps;
430.1944 -+		}
430.1945 -+	      else
430.1946 -+		_M_data->_M_positive_sign = L"";
430.1947 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
430.1948 -+	      
430.1949 -+	      __len = strlen(__cnegsign);
430.1950 -+	      if (!__nposn)
430.1951 -+		_M_data->_M_negative_sign = L"()";
430.1952 -+	      else if (__len)
430.1953 -+		{ 
430.1954 -+		  ++__len;
430.1955 -+		  memset(&__state, 0, sizeof(mbstate_t));
430.1956 -+		  __wcs_ns = new wchar_t[__len];
430.1957 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
430.1958 -+		  _M_data->_M_negative_sign = __wcs_ns;
430.1959 -+		}
430.1960 -+	      else
430.1961 -+		_M_data->_M_negative_sign = L"";
430.1962 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
430.1963 -+
430.1964 -+	      // _Intl == true.
430.1965 -+	      __len = strlen(__ccurr);
430.1966 -+	      if (__len)
430.1967 -+		{
430.1968 -+		  ++__len;
430.1969 -+		  memset(&__state, 0, sizeof(mbstate_t));
430.1970 -+		  wchar_t* __wcs = new wchar_t[__len];
430.1971 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
430.1972 -+		  _M_data->_M_curr_symbol = __wcs;
430.1973 -+		}
430.1974 -+	      else
430.1975 -+		_M_data->_M_curr_symbol = L"";
430.1976 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
430.1977 -+	    }
430.1978 -+          catch (...)
430.1979 -+	    {
430.1980 -+	      delete _M_data;
430.1981 -+              _M_data = 0;
430.1982 -+	      delete __wcs_ps;
430.1983 -+	      delete __wcs_ns;	      
430.1984 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.1985 -+	      __uselocale(__old);
430.1986 -+#else
430.1987 -+	      setlocale(LC_ALL, __old);
430.1988 -+	      free(__old);
430.1989 -+#endif
430.1990 -+              __throw_exception_again;
430.1991 -+	    }
430.1992 -+
430.1993 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
430.1994 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
430.1995 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
430.1996 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
430.1997 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
430.1998 -+	                                                __pposn);
430.1999 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
430.2000 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
430.2001 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
430.2002 -+	                                                __nposn);
430.2003 -+
430.2004 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.2005 -+	  __uselocale(__old);
430.2006 -+#else
430.2007 -+	  setlocale(LC_ALL, __old);
430.2008 -+	  free(__old);
430.2009 -+#endif
430.2010 -+	}
430.2011 -+    }
430.2012 -+
430.2013 -+  template<> 
430.2014 -+    moneypunct<wchar_t, true>::~moneypunct()
430.2015 -+    {
430.2016 -+      if (_M_data->_M_positive_sign_size)
430.2017 -+	delete [] _M_data->_M_positive_sign;
430.2018 -+      if (_M_data->_M_negative_sign_size
430.2019 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
430.2020 -+	delete [] _M_data->_M_negative_sign;
430.2021 -+      if (_M_data->_M_curr_symbol_size)
430.2022 -+	delete [] _M_data->_M_curr_symbol;
430.2023 -+      delete _M_data;
430.2024 -+    }
430.2025 -+
430.2026 -+  template<> 
430.2027 -+    moneypunct<wchar_t, false>::~moneypunct()
430.2028 -+    {
430.2029 -+      if (_M_data->_M_positive_sign_size)
430.2030 -+	delete [] _M_data->_M_positive_sign;
430.2031 -+      if (_M_data->_M_negative_sign_size
430.2032 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
430.2033 -+	delete [] _M_data->_M_negative_sign;
430.2034 -+      if (_M_data->_M_curr_symbol_size)
430.2035 -+	delete [] _M_data->_M_curr_symbol;
430.2036 -+      delete _M_data;
430.2037 -+    }
430.2038 -+#endif
430.2039 -+}
430.2040 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
430.2041 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
430.2042 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:35.000000000 +0200
430.2043 -@@ -0,0 +1,160 @@
430.2044 -+// std::numpunct implementation details, GNU version -*- C++ -*-
430.2045 -+
430.2046 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
430.2047 -+//
430.2048 -+// This file is part of the GNU ISO C++ Library.  This library is free
430.2049 -+// software; you can redistribute it and/or modify it under the
430.2050 -+// terms of the GNU General Public License as published by the
430.2051 -+// Free Software Foundation; either version 2, or (at your option)
430.2052 -+// any later version.
430.2053 -+
430.2054 -+// This library is distributed in the hope that it will be useful,
430.2055 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
430.2056 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
430.2057 -+// GNU General Public License for more details.
430.2058 -+
430.2059 -+// You should have received a copy of the GNU General Public License along
430.2060 -+// with this library; see the file COPYING.  If not, write to the Free
430.2061 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
430.2062 -+// USA.
430.2063 -+
430.2064 -+// As a special exception, you may use this file as part of a free software
430.2065 -+// library without restriction.  Specifically, if other files instantiate
430.2066 -+// templates or use macros or inline functions from this file, or you compile
430.2067 -+// this file and link it with other files to produce an executable, this
430.2068 -+// file does not by itself cause the resulting executable to be covered by
430.2069 -+// the GNU General Public License.  This exception does not however
430.2070 -+// invalidate any other reasons why the executable file might be covered by
430.2071 -+// the GNU General Public License.
430.2072 -+
430.2073 -+//
430.2074 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
430.2075 -+//
430.2076 -+
430.2077 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
430.2078 -+
430.2079 -+#define _LIBC
430.2080 -+#include <locale>
430.2081 -+#undef _LIBC
430.2082 -+#include <bits/c++locale_internal.h>
430.2083 -+
430.2084 -+#ifdef __UCLIBC_MJN3_ONLY__
430.2085 -+#warning tailor for stub locale support
430.2086 -+#endif
430.2087 -+#ifndef __UCLIBC_HAS_XLOCALE__
430.2088 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
430.2089 -+#endif
430.2090 -+
430.2091 -+namespace std
430.2092 -+{
430.2093 -+  template<> 
430.2094 -+    void
430.2095 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
430.2096 -+    {
430.2097 -+      if (!_M_data)
430.2098 -+	_M_data = new __numpunct_cache<char>;
430.2099 -+
430.2100 -+      if (!__cloc)
430.2101 -+	{
430.2102 -+	  // "C" locale
430.2103 -+	  _M_data->_M_grouping = "";
430.2104 -+	  _M_data->_M_grouping_size = 0;
430.2105 -+	  _M_data->_M_use_grouping = false;
430.2106 -+
430.2107 -+	  _M_data->_M_decimal_point = '.';
430.2108 -+	  _M_data->_M_thousands_sep = ',';
430.2109 -+
430.2110 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
430.2111 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
430.2112 -+
430.2113 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
430.2114 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
430.2115 -+	}
430.2116 -+      else
430.2117 -+	{
430.2118 -+	  // Named locale.
430.2119 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
430.2120 -+							__cloc));
430.2121 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
430.2122 -+							__cloc));
430.2123 -+
430.2124 -+	  // Check for NULL, which implies no grouping.
430.2125 -+	  if (_M_data->_M_thousands_sep == '\0')
430.2126 -+	    _M_data->_M_grouping = "";
430.2127 -+	  else
430.2128 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
430.2129 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
430.2130 -+	}
430.2131 -+
430.2132 -+      // NB: There is no way to extact this info from posix locales.
430.2133 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
430.2134 -+      _M_data->_M_truename = "true";
430.2135 -+      _M_data->_M_truename_size = 4;
430.2136 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
430.2137 -+      _M_data->_M_falsename = "false";
430.2138 -+      _M_data->_M_falsename_size = 5;
430.2139 -+    }
430.2140 -+ 
430.2141 -+  template<> 
430.2142 -+    numpunct<char>::~numpunct()
430.2143 -+    { delete _M_data; }
430.2144 -+   
430.2145 -+#ifdef _GLIBCXX_USE_WCHAR_T
430.2146 -+  template<> 
430.2147 -+    void
430.2148 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
430.2149 -+    {
430.2150 -+      if (!_M_data)
430.2151 -+	_M_data = new __numpunct_cache<wchar_t>;
430.2152 -+
430.2153 -+      if (!__cloc)
430.2154 -+	{
430.2155 -+	  // "C" locale
430.2156 -+	  _M_data->_M_grouping = "";
430.2157 -+	  _M_data->_M_grouping_size = 0;
430.2158 -+	  _M_data->_M_use_grouping = false;
430.2159 -+
430.2160 -+	  _M_data->_M_decimal_point = L'.';
430.2161 -+	  _M_data->_M_thousands_sep = L',';
430.2162 -+
430.2163 -+	  // Use ctype::widen code without the facet...
430.2164 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
430.2165 -+	    _M_data->_M_atoms_out[__i] =
430.2166 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
430.2167 -+
430.2168 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
430.2169 -+	    _M_data->_M_atoms_in[__j] =
430.2170 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
430.2171 -+	}
430.2172 -+      else
430.2173 -+	{
430.2174 -+	  // Named locale.
430.2175 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
430.2176 -+	  union { char *__s; wchar_t __w; } __u;
430.2177 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
430.2178 -+	  _M_data->_M_decimal_point = __u.__w;
430.2179 -+
430.2180 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
430.2181 -+	  _M_data->_M_thousands_sep = __u.__w;
430.2182 -+
430.2183 -+	  if (_M_data->_M_thousands_sep == L'\0')
430.2184 -+	    _M_data->_M_grouping = "";
430.2185 -+	  else
430.2186 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
430.2187 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
430.2188 -+	}
430.2189 -+
430.2190 -+      // NB: There is no way to extact this info from posix locales.
430.2191 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
430.2192 -+      _M_data->_M_truename = L"true";
430.2193 -+      _M_data->_M_truename_size = 4;
430.2194 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
430.2195 -+      _M_data->_M_falsename = L"false";
430.2196 -+      _M_data->_M_falsename_size = 5;
430.2197 -+    }
430.2198 -+
430.2199 -+  template<> 
430.2200 -+    numpunct<wchar_t>::~numpunct()
430.2201 -+    { delete _M_data; }
430.2202 -+ #endif
430.2203 -+}
430.2204 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc
430.2205 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
430.2206 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:35.000000000 +0200
430.2207 -@@ -0,0 +1,406 @@
430.2208 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
430.2209 -+
430.2210 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
430.2211 -+//
430.2212 -+// This file is part of the GNU ISO C++ Library.  This library is free
430.2213 -+// software; you can redistribute it and/or modify it under the
430.2214 -+// terms of the GNU General Public License as published by the
430.2215 -+// Free Software Foundation; either version 2, or (at your option)
430.2216 -+// any later version.
430.2217 -+
430.2218 -+// This library is distributed in the hope that it will be useful,
430.2219 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
430.2220 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
430.2221 -+// GNU General Public License for more details.
430.2222 -+
430.2223 -+// You should have received a copy of the GNU General Public License along
430.2224 -+// with this library; see the file COPYING.  If not, write to the Free
430.2225 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
430.2226 -+// USA.
430.2227 -+
430.2228 -+// As a special exception, you may use this file as part of a free software
430.2229 -+// library without restriction.  Specifically, if other files instantiate
430.2230 -+// templates or use macros or inline functions from this file, or you compile
430.2231 -+// this file and link it with other files to produce an executable, this
430.2232 -+// file does not by itself cause the resulting executable to be covered by
430.2233 -+// the GNU General Public License.  This exception does not however
430.2234 -+// invalidate any other reasons why the executable file might be covered by
430.2235 -+// the GNU General Public License.
430.2236 -+
430.2237 -+//
430.2238 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
430.2239 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
430.2240 -+//
430.2241 -+
430.2242 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
430.2243 -+
430.2244 -+#include <locale>
430.2245 -+#include <bits/c++locale_internal.h>
430.2246 -+
430.2247 -+#ifdef __UCLIBC_MJN3_ONLY__
430.2248 -+#warning tailor for stub locale support
430.2249 -+#endif
430.2250 -+#ifndef __UCLIBC_HAS_XLOCALE__
430.2251 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
430.2252 -+#endif
430.2253 -+
430.2254 -+namespace std
430.2255 -+{
430.2256 -+  template<>
430.2257 -+    void
430.2258 -+    __timepunct<char>::
430.2259 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
430.2260 -+	   const tm* __tm) const
430.2261 -+    {
430.2262 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.2263 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
430.2264 -+					_M_c_locale_timepunct);
430.2265 -+#else
430.2266 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
430.2267 -+      setlocale(LC_ALL, _M_name_timepunct);
430.2268 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
430.2269 -+      setlocale(LC_ALL, __old);
430.2270 -+      free(__old);
430.2271 -+#endif
430.2272 -+      // Make sure __s is null terminated.
430.2273 -+      if (__len == 0)
430.2274 -+	__s[0] = '\0';
430.2275 -+    }
430.2276 -+
430.2277 -+  template<> 
430.2278 -+    void
430.2279 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
430.2280 -+    {
430.2281 -+      if (!_M_data)
430.2282 -+	_M_data = new __timepunct_cache<char>;
430.2283 -+
430.2284 -+      if (!__cloc)
430.2285 -+	{
430.2286 -+	  // "C" locale
430.2287 -+	  _M_c_locale_timepunct = _S_get_c_locale();
430.2288 -+
430.2289 -+	  _M_data->_M_date_format = "%m/%d/%y";
430.2290 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
430.2291 -+	  _M_data->_M_time_format = "%H:%M:%S";
430.2292 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
430.2293 -+	  _M_data->_M_date_time_format = "";
430.2294 -+	  _M_data->_M_date_time_era_format = "";
430.2295 -+	  _M_data->_M_am = "AM";
430.2296 -+	  _M_data->_M_pm = "PM";
430.2297 -+	  _M_data->_M_am_pm_format = "";
430.2298 -+
430.2299 -+	  // Day names, starting with "C"'s Sunday.
430.2300 -+	  _M_data->_M_day1 = "Sunday";
430.2301 -+	  _M_data->_M_day2 = "Monday";
430.2302 -+	  _M_data->_M_day3 = "Tuesday";
430.2303 -+	  _M_data->_M_day4 = "Wednesday";
430.2304 -+	  _M_data->_M_day5 = "Thursday";
430.2305 -+	  _M_data->_M_day6 = "Friday";
430.2306 -+	  _M_data->_M_day7 = "Saturday";
430.2307 -+
430.2308 -+	  // Abbreviated day names, starting with "C"'s Sun.
430.2309 -+	  _M_data->_M_aday1 = "Sun";
430.2310 -+	  _M_data->_M_aday2 = "Mon";
430.2311 -+	  _M_data->_M_aday3 = "Tue";
430.2312 -+	  _M_data->_M_aday4 = "Wed";
430.2313 -+	  _M_data->_M_aday5 = "Thu";
430.2314 -+	  _M_data->_M_aday6 = "Fri";
430.2315 -+	  _M_data->_M_aday7 = "Sat";
430.2316 -+
430.2317 -+	  // Month names, starting with "C"'s January.
430.2318 -+	  _M_data->_M_month01 = "January";
430.2319 -+	  _M_data->_M_month02 = "February";
430.2320 -+	  _M_data->_M_month03 = "March";
430.2321 -+	  _M_data->_M_month04 = "April";
430.2322 -+	  _M_data->_M_month05 = "May";
430.2323 -+	  _M_data->_M_month06 = "June";
430.2324 -+	  _M_data->_M_month07 = "July";
430.2325 -+	  _M_data->_M_month08 = "August";
430.2326 -+	  _M_data->_M_month09 = "September";
430.2327 -+	  _M_data->_M_month10 = "October";
430.2328 -+	  _M_data->_M_month11 = "November";
430.2329 -+	  _M_data->_M_month12 = "December";
430.2330 -+
430.2331 -+	  // Abbreviated month names, starting with "C"'s Jan.
430.2332 -+	  _M_data->_M_amonth01 = "Jan";
430.2333 -+	  _M_data->_M_amonth02 = "Feb";
430.2334 -+	  _M_data->_M_amonth03 = "Mar";
430.2335 -+	  _M_data->_M_amonth04 = "Apr";
430.2336 -+	  _M_data->_M_amonth05 = "May";
430.2337 -+	  _M_data->_M_amonth06 = "Jun";
430.2338 -+	  _M_data->_M_amonth07 = "Jul";
430.2339 -+	  _M_data->_M_amonth08 = "Aug";
430.2340 -+	  _M_data->_M_amonth09 = "Sep";
430.2341 -+	  _M_data->_M_amonth10 = "Oct";
430.2342 -+	  _M_data->_M_amonth11 = "Nov";
430.2343 -+	  _M_data->_M_amonth12 = "Dec";
430.2344 -+	}
430.2345 -+      else
430.2346 -+	{
430.2347 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
430.2348 -+
430.2349 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
430.2350 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
430.2351 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
430.2352 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
430.2353 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
430.2354 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
430.2355 -+							     __cloc);
430.2356 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
430.2357 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
430.2358 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
430.2359 -+
430.2360 -+	  // Day names, starting with "C"'s Sunday.
430.2361 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
430.2362 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
430.2363 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
430.2364 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
430.2365 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
430.2366 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
430.2367 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
430.2368 -+
430.2369 -+	  // Abbreviated day names, starting with "C"'s Sun.
430.2370 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
430.2371 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
430.2372 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
430.2373 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
430.2374 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
430.2375 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
430.2376 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
430.2377 -+
430.2378 -+	  // Month names, starting with "C"'s January.
430.2379 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
430.2380 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
430.2381 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
430.2382 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
430.2383 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
430.2384 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
430.2385 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
430.2386 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
430.2387 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
430.2388 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
430.2389 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
430.2390 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
430.2391 -+
430.2392 -+	  // Abbreviated month names, starting with "C"'s Jan.
430.2393 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
430.2394 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
430.2395 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
430.2396 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
430.2397 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
430.2398 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
430.2399 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
430.2400 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
430.2401 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
430.2402 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
430.2403 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
430.2404 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
430.2405 -+	}
430.2406 -+    }
430.2407 -+
430.2408 -+#ifdef _GLIBCXX_USE_WCHAR_T
430.2409 -+  template<>
430.2410 -+    void
430.2411 -+    __timepunct<wchar_t>::
430.2412 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
430.2413 -+	   const tm* __tm) const
430.2414 -+    {
430.2415 -+#ifdef __UCLIBC_HAS_XLOCALE__
430.2416 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
430.2417 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
430.2418 -+					_M_c_locale_timepunct);
430.2419 -+#else
430.2420 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
430.2421 -+      setlocale(LC_ALL, _M_name_timepunct);
430.2422 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
430.2423 -+      setlocale(LC_ALL, __old);
430.2424 -+      free(__old);
430.2425 -+#endif
430.2426 -+      // Make sure __s is null terminated.
430.2427 -+      if (__len == 0)
430.2428 -+	__s[0] = L'\0';
430.2429 -+    }
430.2430 -+
430.2431 -+  template<> 
430.2432 -+    void
430.2433 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
430.2434 -+    {
430.2435 -+      if (!_M_data)
430.2436 -+	_M_data = new __timepunct_cache<wchar_t>;
430.2437 -+
430.2438 -+#warning wide time stuff
430.2439 -+//       if (!__cloc)
430.2440 -+	{
430.2441 -+	  // "C" locale
430.2442 -+	  _M_c_locale_timepunct = _S_get_c_locale();
430.2443 -+
430.2444 -+	  _M_data->_M_date_format = L"%m/%d/%y";
430.2445 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
430.2446 -+	  _M_data->_M_time_format = L"%H:%M:%S";
430.2447 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
430.2448 -+	  _M_data->_M_date_time_format = L"";
430.2449 -+	  _M_data->_M_date_time_era_format = L"";
430.2450 -+	  _M_data->_M_am = L"AM";
430.2451 -+	  _M_data->_M_pm = L"PM";
430.2452 -+	  _M_data->_M_am_pm_format = L"";
430.2453 -+
430.2454 -+	  // Day names, starting with "C"'s Sunday.
430.2455 -+	  _M_data->_M_day1 = L"Sunday";
430.2456 -+	  _M_data->_M_day2 = L"Monday";
430.2457 -+	  _M_data->_M_day3 = L"Tuesday";
430.2458 -+	  _M_data->_M_day4 = L"Wednesday";
430.2459 -+	  _M_data->_M_day5 = L"Thursday";
430.2460 -+	  _M_data->_M_day6 = L"Friday";
430.2461 -+	  _M_data->_M_day7 = L"Saturday";
430.2462 -+
430.2463 -+	  // Abbreviated day names, starting with "C"'s Sun.
430.2464 -+	  _M_data->_M_aday1 = L"Sun";
430.2465 -+	  _M_data->_M_aday2 = L"Mon";
430.2466 -+	  _M_data->_M_aday3 = L"Tue";
430.2467 -+	  _M_data->_M_aday4 = L"Wed";
430.2468 -+	  _M_data->_M_aday5 = L"Thu";
430.2469 -+	  _M_data->_M_aday6 = L"Fri";
430.2470 -+	  _M_data->_M_aday7 = L"Sat";
430.2471 -+
430.2472 -+	  // Month names, starting with "C"'s January.
430.2473 -+	  _M_data->_M_month01 = L"January";
430.2474 -+	  _M_data->_M_month02 = L"February";
430.2475 -+	  _M_data->_M_month03 = L"March";
430.2476 -+	  _M_data->_M_month04 = L"April";
430.2477 -+	  _M_data->_M_month05 = L"May";
430.2478 -+	  _M_data->_M_month06 = L"June";
430.2479 -+	  _M_data->_M_month07 = L"July";
430.2480 -+	  _M_data->_M_month08 = L"August";
430.2481 -+	  _M_data->_M_month09 = L"September";
430.2482 -+	  _M_data->_M_month10 = L"October";
430.2483 -+	  _M_data->_M_month11 = L"November";
430.2484 -+	  _M_data->_M_month12 = L"December";
430.2485 -+
430.2486 -+	  // Abbreviated month names, starting with "C"'s Jan.
430.2487 -+	  _M_data->_M_amonth01 = L"Jan";
430.2488 -+	  _M_data->_M_amonth02 = L"Feb";
430.2489 -+	  _M_data->_M_amonth03 = L"Mar";
430.2490 -+	  _M_data->_M_amonth04 = L"Apr";
430.2491 -+	  _M_data->_M_amonth05 = L"May";
430.2492 -+	  _M_data->_M_amonth06 = L"Jun";
430.2493 -+	  _M_data->_M_amonth07 = L"Jul";
430.2494 -+	  _M_data->_M_amonth08 = L"Aug";
430.2495 -+	  _M_data->_M_amonth09 = L"Sep";
430.2496 -+	  _M_data->_M_amonth10 = L"Oct";
430.2497 -+	  _M_data->_M_amonth11 = L"Nov";
430.2498 -+	  _M_data->_M_amonth12 = L"Dec";
430.2499 -+	}
430.2500 -+#if 0
430.2501 -+      else
430.2502 -+	{
430.2503 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
430.2504 -+
430.2505 -+	  union { char *__s; wchar_t *__w; } __u;
430.2506 -+
430.2507 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
430.2508 -+	  _M_data->_M_date_format = __u.__w;
430.2509 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
430.2510 -+	  _M_data->_M_date_era_format = __u.__w;
430.2511 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
430.2512 -+	  _M_data->_M_time_format = __u.__w;
430.2513 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
430.2514 -+	  _M_data->_M_time_era_format = __u.__w;
430.2515 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
430.2516 -+	  _M_data->_M_date_time_format = __u.__w;
430.2517 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
430.2518 -+	  _M_data->_M_date_time_era_format = __u.__w;
430.2519 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
430.2520 -+	  _M_data->_M_am = __u.__w;
430.2521 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
430.2522 -+	  _M_data->_M_pm = __u.__w;
430.2523 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
430.2524 -+	  _M_data->_M_am_pm_format = __u.__w;
430.2525 -+
430.2526 -+	  // Day names, starting with "C"'s Sunday.
430.2527 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
430.2528 -+	  _M_data->_M_day1 = __u.__w;
430.2529 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
430.2530 -+	  _M_data->_M_day2 = __u.__w;
430.2531 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
430.2532 -+	  _M_data->_M_day3 = __u.__w;
430.2533 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
430.2534 -+	  _M_data->_M_day4 = __u.__w;
430.2535 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
430.2536 -+	  _M_data->_M_day5 = __u.__w;
430.2537 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
430.2538 -+	  _M_data->_M_day6 = __u.__w;
430.2539 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
430.2540 -+	  _M_data->_M_day7 = __u.__w;
430.2541 -+
430.2542 -+	  // Abbreviated day names, starting with "C"'s Sun.
430.2543 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
430.2544 -+	  _M_data->_M_aday1 = __u.__w;
430.2545 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
430.2546 -+	  _M_data->_M_aday2 = __u.__w;
430.2547 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
430.2548 -+	  _M_data->_M_aday3 = __u.__w;
430.2549 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
430.2550 -+	  _M_data->_M_aday4 = __u.__w;
430.2551 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
430.2552 -+	  _M_data->_M_aday5 = __u.__w;
430.2553 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
430.2554 -+	  _M_data->_M_aday6 = __u.__w;
430.2555 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
430.2556 -+	  _M_data->_M_aday7 = __u.__w;
430.2557 -+
430.2558 -+	  // Month names, starting with "C"'s January.
430.2559 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
430.2560 -+	  _M_data->_M_month01 = __u.__w;
430.2561 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
430.2562 -+	  _M_data->_M_month02 = __u.__w;
430.2563 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
430.2564 -+	  _M_data->_M_month03 = __u.__w;
430.2565 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
430.2566 -+	  _M_data->_M_month04 = __u.__w;
430.2567 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
430.2568 -+	  _M_data->_M_month05 = __u.__w;
430.2569 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
430.2570 -+	  _M_data->_M_month06 = __u.__w;
430.2571 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
430.2572 -+	  _M_data->_M_month07 = __u.__w;
430.2573 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
430.2574 -+	  _M_data->_M_month08 = __u.__w;
430.2575 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
430.2576 -+	  _M_data->_M_month09 = __u.__w;
430.2577 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
430.2578 -+	  _M_data->_M_month10 = __u.__w;
430.2579 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
430.2580 -+	  _M_data->_M_month11 = __u.__w;
430.2581 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
430.2582 -+	  _M_data->_M_month12 = __u.__w;
430.2583 -+
430.2584 -+	  // Abbreviated month names, starting with "C"'s Jan.
430.2585 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
430.2586 -+	  _M_data->_M_amonth01 = __u.__w;
430.2587 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
430.2588 -+	  _M_data->_M_amonth02 = __u.__w;
430.2589 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
430.2590 -+	  _M_data->_M_amonth03 = __u.__w;
430.2591 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
430.2592 -+	  _M_data->_M_amonth04 = __u.__w;
430.2593 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
430.2594 -+	  _M_data->_M_amonth05 = __u.__w;
430.2595 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
430.2596 -+	  _M_data->_M_amonth06 = __u.__w;
430.2597 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
430.2598 -+	  _M_data->_M_amonth07 = __u.__w;
430.2599 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
430.2600 -+	  _M_data->_M_amonth08 = __u.__w;
430.2601 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
430.2602 -+	  _M_data->_M_amonth09 = __u.__w;
430.2603 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
430.2604 -+	  _M_data->_M_amonth10 = __u.__w;
430.2605 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
430.2606 -+	  _M_data->_M_amonth11 = __u.__w;
430.2607 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
430.2608 -+	  _M_data->_M_amonth12 = __u.__w;
430.2609 -+	}
430.2610 -+#endif // 0
430.2611 -+    }
430.2612 -+#endif
430.2613 -+}
430.2614 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
430.2615 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
430.2616 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:35.000000000 +0200
430.2617 -@@ -0,0 +1,68 @@
430.2618 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
430.2619 -+
430.2620 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
430.2621 -+//
430.2622 -+// This file is part of the GNU ISO C++ Library.  This library is free
430.2623 -+// software; you can redistribute it and/or modify it under the
430.2624 -+// terms of the GNU General Public License as published by the
430.2625 -+// Free Software Foundation; either version 2, or (at your option)
430.2626 -+// any later version.
430.2627 -+
430.2628 -+// This library is distributed in the hope that it will be useful,
430.2629 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
430.2630 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
430.2631 -+// GNU General Public License for more details.
430.2632 -+
430.2633 -+// You should have received a copy of the GNU General Public License along
430.2634 -+// with this library; see the file COPYING.  If not, write to the Free
430.2635 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
430.2636 -+// USA.
430.2637 -+
430.2638 -+// As a special exception, you may use this file as part of a free software
430.2639 -+// library without restriction.  Specifically, if other files instantiate
430.2640 -+// templates or use macros or inline functions from this file, or you compile
430.2641 -+// this file and link it with other files to produce an executable, this
430.2642 -+// file does not by itself cause the resulting executable to be covered by
430.2643 -+// the GNU General Public License.  This exception does not however
430.2644 -+// invalidate any other reasons why the executable file might be covered by
430.2645 -+// the GNU General Public License.
430.2646 -+
430.2647 -+//
430.2648 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
430.2649 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
430.2650 -+//
430.2651 -+
430.2652 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
430.2653 -+
430.2654 -+  template<typename _CharT>
430.2655 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
430.2656 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
430.2657 -+    _M_name_timepunct(_S_get_c_name())
430.2658 -+    { _M_initialize_timepunct(); }
430.2659 -+
430.2660 -+  template<typename _CharT>
430.2661 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
430.2662 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
430.2663 -+    _M_name_timepunct(_S_get_c_name())
430.2664 -+    { _M_initialize_timepunct(); }
430.2665 -+
430.2666 -+  template<typename _CharT>
430.2667 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
430.2668 -+				     size_t __refs) 
430.2669 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
430.2670 -+    _M_name_timepunct(__s)
430.2671 -+    { 
430.2672 -+      char* __tmp = new char[std::strlen(__s) + 1];
430.2673 -+      std::strcpy(__tmp, __s);
430.2674 -+      _M_name_timepunct = __tmp;
430.2675 -+      _M_initialize_timepunct(__cloc); 
430.2676 -+    }
430.2677 -+
430.2678 -+  template<typename _CharT>
430.2679 -+    __timepunct<_CharT>::~__timepunct()
430.2680 -+    { 
430.2681 -+      if (_M_name_timepunct != _S_get_c_name())
430.2682 -+	delete [] _M_name_timepunct;
430.2683 -+      delete _M_data; 
430.2684 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
430.2685 -+    }
430.2686 -diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
430.2687 ---- gcc-4.3.0.orig/libstdc++-v3/configure	2008-02-29 01:00:39.000000000 +0100
430.2688 -+++ gcc-4.3.0/libstdc++-v3/configure	2008-06-10 14:45:35.000000000 +0200
430.2689 -@@ -14001,7 +14001,7 @@
430.2690 -   enableval="$enable_clocale"
430.2691 - 
430.2692 -       case "$enableval" in
430.2693 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
430.2694 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
430.2695 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
430.2696 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
430.2697 -    { (exit 1); exit 1; }; } ;;
430.2698 -@@ -14034,6 +14034,9 @@
430.2699 -   # Default to "generic".
430.2700 -   if test $enable_clocale_flag = auto; then
430.2701 -     case ${target_os} in
430.2702 -+      linux-uclibc*)
430.2703 -+        enable_clocale_flag=uclibc
430.2704 -+	;;
430.2705 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
430.2706 -         enable_clocale_flag=gnu
430.2707 -         ;;
430.2708 -@@ -14422,6 +14425,76 @@
430.2709 -       CTIME_CC=config/locale/generic/time_members.cc
430.2710 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
430.2711 -       ;;
430.2712 -+    uclibc)
430.2713 -+      echo "$as_me:$LINENO: result: uclibc" >&5
430.2714 -+echo "${ECHO_T}uclibc" >&6
430.2715 -+
430.2716 -+      # Declare intention to use gettext, and add support for specific
430.2717 -+      # languages.
430.2718 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
430.2719 -+      ALL_LINGUAS="de fr"
430.2720 -+
430.2721 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
430.2722 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
430.2723 -+set dummy msgfmt; ac_word=$2
430.2724 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
430.2725 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
430.2726 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
430.2727 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
430.2728 -+else
430.2729 -+  if test -n "$check_msgfmt"; then
430.2730 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
430.2731 -+else
430.2732 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
430.2733 -+for as_dir in $PATH
430.2734 -+do
430.2735 -+  IFS=$as_save_IFS
430.2736 -+  test -z "$as_dir" && as_dir=.
430.2737 -+  for ac_exec_ext in '' $ac_executable_extensions; do
430.2738 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
430.2739 -+    ac_cv_prog_check_msgfmt="yes"
430.2740 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
430.2741 -+    break 2
430.2742 -+  fi
430.2743 -+done
430.2744 -+done
430.2745 -+
430.2746 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
430.2747 -+fi
430.2748 -+fi
430.2749 -+check_msgfmt=$ac_cv_prog_check_msgfmt
430.2750 -+if test -n "$check_msgfmt"; then
430.2751 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
430.2752 -+echo "${ECHO_T}$check_msgfmt" >&6
430.2753 -+else
430.2754 -+  echo "$as_me:$LINENO: result: no" >&5
430.2755 -+echo "${ECHO_T}no" >&6
430.2756 -+fi
430.2757 -+
430.2758 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
430.2759 -+        USE_NLS=yes
430.2760 -+      fi
430.2761 -+      # Export the build objects.
430.2762 -+      for ling in $ALL_LINGUAS; do \
430.2763 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
430.2764 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
430.2765 -+      done
430.2766 -+
430.2767 -+
430.2768 -+
430.2769 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
430.2770 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
430.2771 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
430.2772 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
430.2773 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
430.2774 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
430.2775 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
430.2776 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
430.2777 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
430.2778 -+      CTIME_H=config/locale/uclibc/time_members.h
430.2779 -+      CTIME_CC=config/locale/uclibc/time_members.cc
430.2780 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
430.2781 -+      ;;
430.2782 -   esac
430.2783 - 
430.2784 -   # This is where the testsuite looks for locale catalogs, using the
430.2785 -diff -durN gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h
430.2786 ---- gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h	2007-03-04 23:59:49.000000000 +0100
430.2787 -+++ gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h	2008-06-10 14:45:35.000000000 +0200
430.2788 -@@ -106,7 +106,9 @@
430.2789 - using std::wmemcpy;
430.2790 - using std::wmemmove;
430.2791 - using std::wmemset;
430.2792 -+#if _GLIBCXX_HAVE_WCSFTIME
430.2793 - using std::wcsftime;
430.2794 -+#endif
430.2795 - 
430.2796 - #if _GLIBCXX_USE_C99
430.2797 - using std::wcstold;
   431.1 --- a/patches/gcc/4.3.0/675-uclibc-locale-no__x.patch	Mon Jul 28 21:08:01 2008 +0000
   431.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   431.3 @@ -1,224 +0,0 @@
   431.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_203-uclibc-locale-no__x.patch
   431.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
   431.6 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:39.000000000 +0200
   431.7 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:39.000000000 +0200
   431.8 -@@ -60,4 +60,49 @@
   431.9 - extern "C" __typeof(wctype_l) __wctype_l;
  431.10 - #endif 
  431.11 - 
  431.12 -+# define __nl_langinfo_l nl_langinfo_l
  431.13 -+# define __strcoll_l strcoll_l
  431.14 -+# define __strftime_l strftime_l
  431.15 -+# define __strtod_l strtod_l
  431.16 -+# define __strtof_l strtof_l
  431.17 -+# define __strtold_l strtold_l
  431.18 -+# define __strxfrm_l strxfrm_l
  431.19 -+# define __newlocale newlocale
  431.20 -+# define __freelocale freelocale
  431.21 -+# define __duplocale duplocale
  431.22 -+# define __uselocale uselocale
  431.23 -+
  431.24 -+# ifdef _GLIBCXX_USE_WCHAR_T
  431.25 -+#  define __iswctype_l iswctype_l
  431.26 -+#  define __towlower_l towlower_l
  431.27 -+#  define __towupper_l towupper_l
  431.28 -+#  define __wcscoll_l wcscoll_l
  431.29 -+#  define __wcsftime_l wcsftime_l
  431.30 -+#  define __wcsxfrm_l wcsxfrm_l
  431.31 -+#  define __wctype_l wctype_l
  431.32 -+# endif
  431.33 -+
  431.34 -+#else
  431.35 -+# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  431.36 -+# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  431.37 -+# define __strtod_l(S, E, L)         strtod((S), (E))
  431.38 -+# define __strtof_l(S, E, L)         strtof((S), (E))
  431.39 -+# define __strtold_l(S, E, L)        strtold((S), (E))
  431.40 -+# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  431.41 -+# warning should dummy __newlocale check for C|POSIX ?
  431.42 -+# define __newlocale(a, b, c)        NULL
  431.43 -+# define __freelocale(a)             ((void)0)
  431.44 -+# define __duplocale(a)              __c_locale()
  431.45 -+//# define __uselocale ?
  431.46 -+//
  431.47 -+# ifdef _GLIBCXX_USE_WCHAR_T
  431.48 -+#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  431.49 -+#  define __towlower_l(C, L)          towlower((C))
  431.50 -+#  define __towupper_l(C, L)          towupper((C))
  431.51 -+#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  431.52 -+//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  431.53 -+#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  431.54 -+#  define __wctype_l(S, L)            wctype((S))
  431.55 -+# endif
  431.56 -+
  431.57 - #endif // GLIBC 2.3 and later
  431.58 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
  431.59 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:39.000000000 +0200
  431.60 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:39.000000000 +0200
  431.61 -@@ -39,20 +39,6 @@
  431.62 - #include <langinfo.h>
  431.63 - #include <bits/c++locale_internal.h>
  431.64 - 
  431.65 --#ifndef __UCLIBC_HAS_XLOCALE__
  431.66 --#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  431.67 --#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  431.68 --#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  431.69 --#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  431.70 --#define __strtof_l(S, E, L)         strtof((S), (E))
  431.71 --#define __strtod_l(S, E, L)         strtod((S), (E))
  431.72 --#define __strtold_l(S, E, L)        strtold((S), (E))
  431.73 --#warning should dummy __newlocale check for C|POSIX ?
  431.74 --#define __newlocale(a, b, c)        NULL
  431.75 --#define __freelocale(a)             ((void)0)
  431.76 --#define __duplocale(a)              __c_locale()
  431.77 --#endif
  431.78 --
  431.79 - namespace std 
  431.80 - {
  431.81 -   template<>
  431.82 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
  431.83 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:39.000000000 +0200
  431.84 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:39.000000000 +0200
  431.85 -@@ -68,6 +68,7 @@
  431.86 - {
  431.87 -   extern "C" __typeof(uselocale) __uselocale;
  431.88 - }
  431.89 -+#define __uselocale uselocale
  431.90 - #endif
  431.91 - 
  431.92 - namespace std
  431.93 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
  431.94 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:39.000000000 +0200
  431.95 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:39.000000000 +0200
  431.96 -@@ -36,13 +36,6 @@
  431.97 - #include <locale>
  431.98 - #include <bits/c++locale_internal.h>
  431.99 - 
 431.100 --#ifndef __UCLIBC_HAS_XLOCALE__
 431.101 --#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 431.102 --#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 431.103 --#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 431.104 --#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 431.105 --#endif
 431.106 --
 431.107 - namespace std
 431.108 - {
 431.109 -   // These are basically extensions to char_traits, and perhaps should
 431.110 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 431.111 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:39.000000000 +0200
 431.112 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:39.000000000 +0200
 431.113 -@@ -38,13 +38,6 @@
 431.114 - #undef _LIBC
 431.115 - #include <bits/c++locale_internal.h>
 431.116 - 
 431.117 --#ifndef __UCLIBC_HAS_XLOCALE__
 431.118 --#define __wctype_l(S, L)           wctype((S))
 431.119 --#define __towupper_l(C, L)         towupper((C))
 431.120 --#define __towlower_l(C, L)         towlower((C))
 431.121 --#define __iswctype_l(C, M, L)      iswctype((C), (M))
 431.122 --#endif
 431.123 --
 431.124 - namespace std
 431.125 - {
 431.126 -   // NB: The other ctype<char> specializations are in src/locale.cc and
 431.127 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
 431.128 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:39.000000000 +0200
 431.129 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:39.000000000 +0200
 431.130 -@@ -39,13 +39,10 @@
 431.131 - #ifdef __UCLIBC_MJN3_ONLY__
 431.132 - #warning fix gettext stuff
 431.133 - #endif
 431.134 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 431.135 --extern "C" char *__dcgettext(const char *domainname,
 431.136 --			     const char *msgid, int category);
 431.137 - #undef gettext
 431.138 --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 431.139 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 431.140 -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 431.141 - #else
 431.142 --#undef gettext
 431.143 - #define gettext(msgid) (msgid)
 431.144 - #endif
 431.145 - 
 431.146 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
 431.147 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:39.000000000 +0200
 431.148 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:39.000000000 +0200
 431.149 -@@ -36,15 +36,11 @@
 431.150 - #ifdef __UCLIBC_MJN3_ONLY__
 431.151 - #warning fix prototypes for *textdomain funcs
 431.152 - #endif
 431.153 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 431.154 --extern "C" char *__textdomain(const char *domainname);
 431.155 --extern "C" char *__bindtextdomain(const char *domainname,
 431.156 --				  const char *dirname);
 431.157 --#else
 431.158 --#undef __textdomain
 431.159 --#undef __bindtextdomain
 431.160 --#define __textdomain(D)           ((void)0)
 431.161 --#define __bindtextdomain(D,P)     ((void)0)
 431.162 -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 431.163 -+#undef textdomain
 431.164 -+#undef bindtextdomain
 431.165 -+#define textdomain(D)           ((void)0)
 431.166 -+#define bindtextdomain(D,P)     ((void)0)
 431.167 - #endif
 431.168 - 
 431.169 -   // Non-virtual member functions.
 431.170 -@@ -70,7 +66,7 @@
 431.171 -     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 431.172 - 			   const char* __dir) const
 431.173 -     { 
 431.174 --      __bindtextdomain(__s.c_str(), __dir);
 431.175 -+      bindtextdomain(__s.c_str(), __dir);
 431.176 -       return this->do_open(__s, __loc); 
 431.177 -     }
 431.178 - 
 431.179 -@@ -90,7 +86,7 @@
 431.180 -     { 
 431.181 -       // No error checking is done, assume the catalog exists and can
 431.182 -       // be used.
 431.183 --      __textdomain(__s.c_str());
 431.184 -+      textdomain(__s.c_str());
 431.185 -       return 0;
 431.186 -     }
 431.187 - 
 431.188 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 431.189 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:39.000000000 +0200
 431.190 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:39.000000000 +0200
 431.191 -@@ -43,10 +43,6 @@
 431.192 - #warning tailor for stub locale support
 431.193 - #endif
 431.194 - 
 431.195 --#ifndef __UCLIBC_HAS_XLOCALE__
 431.196 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 431.197 --#endif
 431.198 --
 431.199 - namespace std
 431.200 - {
 431.201 -   // Construct and return valid pattern consisting of some combination of:
 431.202 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 431.203 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:39.000000000 +0200
 431.204 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:39.000000000 +0200
 431.205 -@@ -41,9 +41,6 @@
 431.206 - #ifdef __UCLIBC_MJN3_ONLY__
 431.207 - #warning tailor for stub locale support
 431.208 - #endif
 431.209 --#ifndef __UCLIBC_HAS_XLOCALE__
 431.210 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 431.211 --#endif
 431.212 - 
 431.213 - namespace std
 431.214 - {
 431.215 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc
 431.216 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:39.000000000 +0200
 431.217 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:39.000000000 +0200
 431.218 -@@ -40,9 +40,6 @@
 431.219 - #ifdef __UCLIBC_MJN3_ONLY__
 431.220 - #warning tailor for stub locale support
 431.221 - #endif
 431.222 --#ifndef __UCLIBC_HAS_XLOCALE__
 431.223 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 431.224 --#endif
 431.225 - 
 431.226 - namespace std
 431.227 - {
   432.1 --- a/patches/gcc/4.3.0/700-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:08:01 2008 +0000
   432.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   432.3 @@ -1,51 +0,0 @@
   432.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
   432.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   432.6 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:43.000000000 +0200
   432.7 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:43.000000000 +0200
   432.8 -@@ -401,7 +401,7 @@
   432.9 - # ifdef __UCLIBC_HAS_XLOCALE__
  432.10 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  432.11 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  432.12 --# else
  432.13 -+# elif defined __UCLIBC_HAS_LOCALE__
  432.14 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  432.15 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  432.16 - # endif
  432.17 -@@ -556,7 +556,7 @@
  432.18 - # ifdef __UCLIBC_HAS_XLOCALE__
  432.19 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  432.20 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  432.21 --# else
  432.22 -+# elif defined __UCLIBC_HAS_LOCALE__
  432.23 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  432.24 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  432.25 - # endif
  432.26 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  432.27 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:43.000000000 +0200
  432.28 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:43.000000000 +0200
  432.29 -@@ -127,12 +127,25 @@
  432.30 - 	{
  432.31 - 	  // Named locale.
  432.32 - 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  432.33 -+#ifdef __UCLIBC_MJN3_ONLY__
  432.34 -+#warning fix this... should be numeric
  432.35 -+#endif
  432.36 -+#ifdef __UCLIBC__
  432.37 -+# ifdef __UCLIBC_HAS_XLOCALE__
  432.38 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  432.39 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  432.40 -+# elif defined __UCLIBC_HAS_LOCALE__
  432.41 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  432.42 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  432.43 -+# endif
  432.44 -+#else
  432.45 - 	  union { char *__s; wchar_t __w; } __u;
  432.46 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  432.47 - 	  _M_data->_M_decimal_point = __u.__w;
  432.48 - 
  432.49 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  432.50 - 	  _M_data->_M_thousands_sep = __u.__w;
  432.51 -+#endif
  432.52 - 
  432.53 - 	  if (_M_data->_M_thousands_sep == L'\0')
  432.54 - 	    _M_data->_M_grouping = "";
   433.1 --- a/patches/gcc/4.3.0/725-uclibc-locale-update.patch	Mon Jul 28 21:08:01 2008 +0000
   433.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   433.3 @@ -1,355 +0,0 @@
   433.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_205-uclibc-locale-update.patch
   433.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
   433.6 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:43.000000000 +0200
   433.7 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:46.000000000 +0200
   433.8 -@@ -46,16 +46,13 @@
   433.9 -     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
  433.10 - 		   const __c_locale& __cloc)
  433.11 -     {
  433.12 --      if (!(__err & ios_base::failbit))
  433.13 --	{
  433.14 --	  char* __sanity;
  433.15 --	  errno = 0;
  433.16 --	  float __f = __strtof_l(__s, &__sanity, __cloc);
  433.17 --          if (__sanity != __s && errno != ERANGE)
  433.18 --	    __v = __f;
  433.19 --	  else
  433.20 --	    __err |= ios_base::failbit;
  433.21 --	}
  433.22 -+      char* __sanity;
  433.23 -+      errno = 0;
  433.24 -+      float __f = __strtof_l(__s, &__sanity, __cloc);
  433.25 -+      if (__sanity != __s && errno != ERANGE)
  433.26 -+	__v = __f;
  433.27 -+      else
  433.28 -+	__err |= ios_base::failbit;
  433.29 -     }
  433.30 - 
  433.31 -   template<>
  433.32 -@@ -63,16 +60,13 @@
  433.33 -     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  433.34 - 		   const __c_locale& __cloc)
  433.35 -     {
  433.36 --      if (!(__err & ios_base::failbit))
  433.37 --	{
  433.38 --	  char* __sanity;
  433.39 --	  errno = 0;
  433.40 --	  double __d = __strtod_l(__s, &__sanity, __cloc);
  433.41 --          if (__sanity != __s && errno != ERANGE)
  433.42 --	    __v = __d;
  433.43 --	  else
  433.44 --	    __err |= ios_base::failbit;
  433.45 --	}
  433.46 -+      char* __sanity;
  433.47 -+      errno = 0;
  433.48 -+      double __d = __strtod_l(__s, &__sanity, __cloc);
  433.49 -+      if (__sanity != __s && errno != ERANGE)
  433.50 -+	__v = __d;
  433.51 -+      else
  433.52 -+	__err |= ios_base::failbit;
  433.53 -     }
  433.54 - 
  433.55 -   template<>
  433.56 -@@ -80,16 +74,13 @@
  433.57 -     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  433.58 - 		   const __c_locale& __cloc)
  433.59 -     {
  433.60 --      if (!(__err & ios_base::failbit))
  433.61 --	{
  433.62 --	  char* __sanity;
  433.63 --	  errno = 0;
  433.64 --	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  433.65 --          if (__sanity != __s && errno != ERANGE)
  433.66 --	    __v = __ld;
  433.67 --	  else
  433.68 --	    __err |= ios_base::failbit;
  433.69 --	}
  433.70 -+      char* __sanity;
  433.71 -+      errno = 0;
  433.72 -+      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  433.73 -+      if (__sanity != __s && errno != ERANGE)
  433.74 -+	__v = __ld;
  433.75 -+      else
  433.76 -+	__err |= ios_base::failbit;
  433.77 -     }
  433.78 - 
  433.79 -   void
  433.80 -@@ -110,7 +101,7 @@
  433.81 -   void
  433.82 -   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  433.83 -   {
  433.84 --    if (_S_get_c_locale() != __cloc)
  433.85 -+    if (__cloc && _S_get_c_locale() != __cloc)
  433.86 -       __freelocale(__cloc); 
  433.87 -   }
  433.88 - 
  433.89 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
  433.90 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:43.000000000 +0200
  433.91 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:46.000000000 +0200
  433.92 -@@ -39,21 +39,23 @@
  433.93 - #pragma GCC system_header
  433.94 - 
  433.95 - #include <cstring>              // get std::strlen
  433.96 --#include <cstdio>               // get std::snprintf or std::sprintf
  433.97 -+#include <cstdio>               // get std::vsnprintf or std::vsprintf
  433.98 - #include <clocale>
  433.99 - #include <langinfo.h>		// For codecvt
 433.100 - #ifdef __UCLIBC_MJN3_ONLY__
 433.101 - #warning fix this
 433.102 - #endif
 433.103 --#ifdef __UCLIBC_HAS_LOCALE__
 433.104 -+#ifdef _GLIBCXX_USE_ICONV
 433.105 - #include <iconv.h>		// For codecvt using iconv, iconv_t
 433.106 - #endif
 433.107 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 433.108 --#include <libintl.h> 		// For messages
 433.109 -+#ifdef HAVE_LIBINTL_H
 433.110 -+#include <libintl.h>		// For messages
 433.111 - #endif
 433.112 -+#include <cstdarg>
 433.113 - 
 433.114 - #ifdef __UCLIBC_MJN3_ONLY__
 433.115 - #warning what is _GLIBCXX_C_LOCALE_GNU for
 433.116 -+// psm: used in os/gnu-linux/ctype_noninline.h
 433.117 - #endif
 433.118 - #define _GLIBCXX_C_LOCALE_GNU 1
 433.119 - 
 433.120 -@@ -62,7 +64,7 @@
 433.121 - #endif
 433.122 - // #define _GLIBCXX_NUM_CATEGORIES 6
 433.123 - #define _GLIBCXX_NUM_CATEGORIES 0
 433.124 -- 
 433.125 -+
 433.126 - #ifdef __UCLIBC_HAS_XLOCALE__
 433.127 - namespace __gnu_cxx
 433.128 - {
 433.129 -@@ -79,22 +81,24 @@
 433.130 -   typedef int*			__c_locale;
 433.131 - #endif
 433.132 - 
 433.133 --  // Convert numeric value of type _Tv to string and return length of
 433.134 --  // string.  If snprintf is available use it, otherwise fall back to
 433.135 --  // the unsafe sprintf which, in general, can be dangerous and should
 433.136 -+  // Convert numeric value of type double to string and return length of
 433.137 -+  // string.  If vsnprintf is available use it, otherwise fall back to
 433.138 -+  // the unsafe vsprintf which, in general, can be dangerous and should
 433.139 -   // be avoided.
 433.140 --  template<typename _Tv>
 433.141 --    int
 433.142 --    __convert_from_v(char* __out, 
 433.143 --		     const int __size __attribute__ ((__unused__)),
 433.144 --		     const char* __fmt,
 433.145 --#ifdef __UCLIBC_HAS_XCLOCALE__
 433.146 --		     _Tv __v, const __c_locale& __cloc, int __prec)
 433.147 -+    inline int
 433.148 -+    __convert_from_v(const __c_locale&
 433.149 -+#ifndef __UCLIBC_HAS_XCLOCALE__
 433.150 -+					__cloc __attribute__ ((__unused__))
 433.151 -+#endif
 433.152 -+		     ,
 433.153 -+		     char* __out,
 433.154 -+		     const int __size,
 433.155 -+		     const char* __fmt, ...)
 433.156 -     {
 433.157 -+      va_list __args;
 433.158 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 433.159 -       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 433.160 - #else
 433.161 --		     _Tv __v, const __c_locale&, int __prec)
 433.162 --    {
 433.163 - # ifdef __UCLIBC_HAS_LOCALE__
 433.164 -       char* __old = std::setlocale(LC_ALL, NULL);
 433.165 -       char* __sav = new char[std::strlen(__old) + 1];
 433.166 -@@ -103,7 +107,9 @@
 433.167 - # endif
 433.168 - #endif
 433.169 - 
 433.170 --      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 433.171 -+      va_start(__args, __fmt);
 433.172 -+      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 433.173 -+      va_end(__args);
 433.174 - 
 433.175 - #ifdef __UCLIBC_HAS_XCLOCALE__
 433.176 -       __gnu_cxx::__uselocale(__old);
 433.177 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 433.178 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:43.000000000 +0200
 433.179 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:46.000000000 +0200
 433.180 -@@ -33,9 +33,14 @@
 433.181 - 
 433.182 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 433.183 - 
 433.184 -+#include <features.h>
 433.185 -+#ifdef __UCLIBC_HAS_LOCALE__
 433.186 - #define _LIBC
 433.187 - #include <locale>
 433.188 - #undef _LIBC
 433.189 -+#else
 433.190 -+#include <locale>
 433.191 -+#endif
 433.192 - #include <bits/c++locale_internal.h>
 433.193 - 
 433.194 - namespace std
 433.195 -@@ -138,20 +143,34 @@
 433.196 -   ctype<wchar_t>::
 433.197 -   do_is(mask __m, wchar_t __c) const
 433.198 -   { 
 433.199 --    // Highest bitmask in ctype_base == 10, but extra in "C"
 433.200 --    // library for blank.
 433.201 -+    // The case of __m == ctype_base::space is particularly important,
 433.202 -+    // due to its use in many istream functions.  Therefore we deal with
 433.203 -+    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 433.204 -+    // is the mask corresponding to ctype_base::space.  NB: an encoding
 433.205 -+    // change would not affect correctness!
 433.206 -     bool __ret = false;
 433.207 --    const size_t __bitmasksize = 11; 
 433.208 --    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 433.209 --      if (__m & _M_bit[__bitcur]
 433.210 --	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 433.211 --	{
 433.212 --	  __ret = true;
 433.213 --	  break;
 433.214 --	}
 433.215 -+    if (__m == _M_bit[5])
 433.216 -+      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 433.217 -+    else
 433.218 -+      {
 433.219 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 433.220 -+	// library for blank.
 433.221 -+	const size_t __bitmasksize = 11;
 433.222 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 433.223 -+	  if (__m & _M_bit[__bitcur])
 433.224 -+	    {
 433.225 -+	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 433.226 -+		{
 433.227 -+		  __ret = true;
 433.228 -+		  break;
 433.229 -+		}
 433.230 -+	      else if (__m == _M_bit[__bitcur])
 433.231 -+		break;
 433.232 -+	    }
 433.233 -+      }
 433.234 -     return __ret;    
 433.235 -   }
 433.236 --  
 433.237 -+
 433.238 -   const wchar_t* 
 433.239 -   ctype<wchar_t>::
 433.240 -   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 433.241 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
 433.242 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:43.000000000 +0200
 433.243 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:46.000000000 +0200
 433.244 -@@ -47,18 +47,21 @@
 433.245 -   template<typename _CharT>
 433.246 -      messages<_CharT>::messages(size_t __refs)
 433.247 -      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 433.248 --     _M_name_messages(_S_get_c_name())
 433.249 -+       _M_name_messages(_S_get_c_name())
 433.250 -      { }
 433.251 - 
 433.252 -   template<typename _CharT>
 433.253 -      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 433.254 - 				size_t __refs) 
 433.255 --     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 433.256 --     _M_name_messages(__s)
 433.257 -+     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 433.258 -      {
 433.259 --       char* __tmp = new char[std::strlen(__s) + 1];
 433.260 --       std::strcpy(__tmp, __s);
 433.261 -+       const size_t __len = std::strlen(__s) + 1;
 433.262 -+       char* __tmp = new char[__len];
 433.263 -+       std::memcpy(__tmp, __s, __len);
 433.264 -        _M_name_messages = __tmp;
 433.265 -+
 433.266 -+       // Last to avoid leaking memory if new throws.
 433.267 -+       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 433.268 -      }
 433.269 - 
 433.270 -   template<typename _CharT>
 433.271 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 433.272 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:46.000000000 +0200
 433.273 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:46.000000000 +0200
 433.274 -@@ -33,9 +33,14 @@
 433.275 - 
 433.276 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 433.277 - 
 433.278 -+#include <features.h>
 433.279 -+#ifdef __UCLIBC_HAS_LOCALE__
 433.280 - #define _LIBC
 433.281 - #include <locale>
 433.282 - #undef _LIBC
 433.283 -+#else
 433.284 -+#include <locale>
 433.285 -+#endif
 433.286 - #include <bits/c++locale_internal.h>
 433.287 - 
 433.288 - #ifdef __UCLIBC_MJN3_ONLY__
 433.289 -@@ -206,7 +211,7 @@
 433.290 - 	  }
 433.291 - 	break;
 433.292 -       default:
 433.293 --	;
 433.294 -+	__ret = pattern();
 433.295 -       }
 433.296 -     return __ret;
 433.297 -   }
 433.298 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 433.299 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:46.000000000 +0200
 433.300 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:46.000000000 +0200
 433.301 -@@ -33,9 +33,14 @@
 433.302 - 
 433.303 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 433.304 - 
 433.305 -+#include <features.h>
 433.306 -+#ifdef __UCLIBC_HAS_LOCALE__
 433.307 - #define _LIBC
 433.308 - #include <locale>
 433.309 - #undef _LIBC
 433.310 -+#else
 433.311 -+#include <locale>
 433.312 -+#endif
 433.313 - #include <bits/c++locale_internal.h>
 433.314 - 
 433.315 - #ifdef __UCLIBC_MJN3_ONLY__
 433.316 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
 433.317 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:39.000000000 +0200
 433.318 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:46.000000000 +0200
 433.319 -@@ -37,25 +37,33 @@
 433.320 -   template<typename _CharT>
 433.321 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
 433.322 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 433.323 --    _M_name_timepunct(_S_get_c_name())
 433.324 -+      _M_name_timepunct(_S_get_c_name())
 433.325 -     { _M_initialize_timepunct(); }
 433.326 - 
 433.327 -   template<typename _CharT>
 433.328 -     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 433.329 -     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 433.330 --    _M_name_timepunct(_S_get_c_name())
 433.331 -+      _M_name_timepunct(_S_get_c_name())
 433.332 -     { _M_initialize_timepunct(); }
 433.333 - 
 433.334 -   template<typename _CharT>
 433.335 -     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 433.336 - 				     size_t __refs) 
 433.337 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 433.338 --    _M_name_timepunct(__s)
 433.339 -+      _M_name_timepunct(NULL)
 433.340 -     { 
 433.341 --      char* __tmp = new char[std::strlen(__s) + 1];
 433.342 --      std::strcpy(__tmp, __s);
 433.343 -+      const size_t __len = std::strlen(__s) + 1;
 433.344 -+      char* __tmp = new char[__len];
 433.345 -+      std::memcpy(__tmp, __s, __len);
 433.346 -       _M_name_timepunct = __tmp;
 433.347 --      _M_initialize_timepunct(__cloc); 
 433.348 -+
 433.349 -+      try
 433.350 -+	{ _M_initialize_timepunct(__cloc); }
 433.351 -+      catch(...)
 433.352 -+	{
 433.353 -+	  delete [] _M_name_timepunct;
 433.354 -+	  __throw_exception_again;
 433.355 -+	}
 433.356 -     }
 433.357 - 
 433.358 -   template<typename _CharT>
   434.1 --- a/patches/gcc/4.3.0/750-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   434.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   434.3 @@ -1,13 +0,0 @@
   434.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_301-missing-execinfo_h.patch
   434.5 -diff -durN gcc-4.3.0.orig/boehm-gc/include/gc.h gcc-4.3.0/boehm-gc/include/gc.h
   434.6 ---- gcc-4.3.0.orig/boehm-gc/include/gc.h	2007-04-23 23:10:09.000000000 +0200
   434.7 -+++ gcc-4.3.0/boehm-gc/include/gc.h	2008-06-10 14:45:50.000000000 +0200
   434.8 -@@ -503,7 +503,7 @@
   434.9 - #if defined(__linux__) || defined(__GLIBC__)
  434.10 - # include <features.h>
  434.11 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  434.12 --     && !defined(__ia64__)
  434.13 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  434.14 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  434.15 - #     define GC_HAVE_BUILTIN_BACKTRACE
  434.16 - #   endif
   435.1 --- a/patches/gcc/4.3.0/775-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   435.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   435.3 @@ -1,14 +0,0 @@
   435.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_303-c99-complex-ugly-hack.patch
   435.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
   435.6 ---- gcc-4.3.0.orig/libstdc++-v3/configure	2008-06-10 14:45:39.000000000 +0200
   435.7 -+++ gcc-4.3.0/libstdc++-v3/configure	2008-06-10 14:45:54.000000000 +0200
   435.8 -@@ -39006,6 +39006,9 @@
   435.9 - cat >>conftest.$ac_ext <<_ACEOF
  435.10 - /* end confdefs.h.  */
  435.11 - #include <complex.h>
  435.12 -+#ifdef __UCLIBC__
  435.13 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  435.14 -+#endif
  435.15 - int
  435.16 - main ()
  435.17 - {
   436.1 --- a/patches/gcc/4.3.0/800-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   436.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   436.3 @@ -1,27 +0,0 @@
   436.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_304-index_macro.patch
   436.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/rope gcc-4.3.0/libstdc++-v3/include/ext/rope
   436.6 ---- gcc-4.3.0.orig/libstdc++-v3/include/ext/rope	2008-01-31 19:44:55.000000000 +0100
   436.7 -+++ gcc-4.3.0/libstdc++-v3/include/ext/rope	2008-06-10 14:45:58.000000000 +0200
   436.8 -@@ -59,6 +59,9 @@
   436.9 - #include <bits/gthr.h>
  436.10 - #include <tr1/functional>
  436.11 - 
  436.12 -+/* cope w/ index defined as macro, SuSv3 proposal */
  436.13 -+#undef index
  436.14 -+
  436.15 - # ifdef __GC
  436.16 - #   define __GC_CONST const
  436.17 - # else
  436.18 -diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h
  436.19 ---- gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h	2007-05-04 17:06:46.000000000 +0200
  436.20 -+++ gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h	2008-06-10 14:45:58.000000000 +0200
  436.21 -@@ -54,6 +54,9 @@
  436.22 - #include <ext/memory> // For uninitialized_copy_n
  436.23 - #include <ext/numeric> // For power
  436.24 - 
  436.25 -+/* cope w/ index defined as macro, SuSv3 proposal */
  436.26 -+#undef index
  436.27 -+
  436.28 - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  436.29 - 
  436.30 -   using std::size_t;
   437.1 --- a/patches/gcc/4.3.0/825-libmudflap-susv3-legacy.patch	Mon Jul 28 21:08:01 2008 +0000
   437.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   437.3 @@ -1,49 +0,0 @@
   437.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_305-libmudflap-susv3-legacy.patch
   437.5 -diff -durN gcc-4.3.0.orig/libmudflap/mf-hooks2.c gcc-4.3.0/libmudflap/mf-hooks2.c
   437.6 ---- gcc-4.3.0.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   437.7 -+++ gcc-4.3.0/libmudflap/mf-hooks2.c	2008-06-10 14:46:02.000000000 +0200
   437.8 -@@ -427,7 +427,7 @@
   437.9 - {
  437.10 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  437.11 -   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  437.12 --  bzero (s, n);
  437.13 -+  memset (s, 0, n);
  437.14 - }
  437.15 - 
  437.16 - 
  437.17 -@@ -437,7 +437,7 @@
  437.18 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  437.19 -   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  437.20 -   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  437.21 --  bcopy (src, dest, n);
  437.22 -+  memmove (dest, src, n);
  437.23 - }
  437.24 - 
  437.25 - 
  437.26 -@@ -447,7 +447,7 @@
  437.27 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  437.28 -   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  437.29 -   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  437.30 --  return bcmp (s1, s2, n);
  437.31 -+  return memcmp (s1, s2, n);
  437.32 - }
  437.33 - 
  437.34 - 
  437.35 -@@ -456,7 +456,7 @@
  437.36 -   size_t n = strlen (s);
  437.37 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  437.38 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  437.39 --  return index (s, c);
  437.40 -+  return strchr (s, c);
  437.41 - }
  437.42 - 
  437.43 - 
  437.44 -@@ -465,7 +465,7 @@
  437.45 -   size_t n = strlen (s);
  437.46 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  437.47 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  437.48 --  return rindex (s, c);
  437.49 -+  return strrchr (s, c);
  437.50 - }
  437.51 - 
  437.52 - /* XXX:  stpcpy, memccpy */
   438.1 --- a/patches/gcc/4.3.0/850-libstdc++-namespace.patch	Mon Jul 28 21:08:01 2008 +0000
   438.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   438.3 @@ -1,38 +0,0 @@
   438.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_306-libstdc++-namespace.patch
   438.5 -diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
   438.6 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
   438.7 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:50.000000000 +0200
   438.8 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:46:05.000000000 +0200
   438.9 -@@ -32,7 +32,8 @@
  438.10 - //
  438.11 - 
  438.12 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  438.13 --
  438.14 -+namespace std
  438.15 -+{
  438.16 - #ifdef __UCLIBC_MJN3_ONLY__
  438.17 - #warning fix prototypes for *textdomain funcs
  438.18 - #endif
  438.19 -@@ -115,3 +116,4 @@
  438.20 - 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  438.21 - 	 }
  438.22 -      }
  438.23 -+}
  438.24 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
  438.25 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:50.000000000 +0200
  438.26 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:46:05.000000000 +0200
  438.27 -@@ -33,7 +33,8 @@
  438.28 - //
  438.29 - 
  438.30 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  438.31 --
  438.32 -+namespace std
  438.33 -+{
  438.34 -   template<typename _CharT>
  438.35 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
  438.36 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  438.37 -@@ -74,3 +75,4 @@
  438.38 -       delete _M_data; 
  438.39 -       _S_destroy_c_locale(_M_c_locale_timepunct); 
  438.40 -     }
  438.41 -+}
   439.1 --- a/patches/gcc/4.3.0/875-arm-softfloat.patch	Mon Jul 28 21:08:01 2008 +0000
   439.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   439.3 @@ -1,29 +0,0 @@
   439.4 -diff -durN gcc-4.3.1.orig/gcc/config/arm/linux-elf.h gcc-4.3.1/gcc/config/arm/linux-elf.h
   439.5 ---- gcc-4.3.1.orig/gcc/config/arm/linux-elf.h	2007-11-08 14:44:09.000000000 +0100
   439.6 -+++ gcc-4.3.1/gcc/config/arm/linux-elf.h	2008-07-23 15:30:57.000000000 +0200
   439.7 -@@ -60,7 +60,7 @@
   439.8 -    %{shared:-lc} \
   439.9 -    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  439.10 - 
  439.11 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  439.12 -+#define LIBGCC_SPEC "-lgcc"
  439.13 - 
  439.14 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  439.15 - 
  439.16 -diff -durN gcc-4.3.1.orig/gcc/config/arm/t-linux gcc-4.3.1/gcc/config/arm/t-linux
  439.17 ---- gcc-4.3.1.orig/gcc/config/arm/t-linux	2006-11-09 23:14:27.000000000 +0100
  439.18 -+++ gcc-4.3.1/gcc/config/arm/t-linux	2008-07-23 19:15:25.000000000 +0200
  439.19 -@@ -3,7 +3,12 @@
  439.20 - TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
  439.21 - 
  439.22 - LIB1ASMSRC = arm/lib1funcs.asm
  439.23 --LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
  439.24 -+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
  439.25 -+	_call_via_rX _interwork_call_via_rX \
  439.26 -+	_lshrdi3 _ashrdi3 _ashldi3 \
  439.27 -+	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
  439.28 -+	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
  439.29 -+	_fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf
  439.30 - 
  439.31 - # MULTILIB_OPTIONS = mhard-float/msoft-float
  439.32 - # MULTILIB_DIRNAMES = hard-float soft-float
   440.1 --- a/patches/gcc/4.3.0/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
   440.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   440.3 @@ -1,17 +0,0 @@
   440.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   440.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   440.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   440.7 - /* Do code reading to identify a signal frame, and set the frame
   440.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
   440.9 - 
  440.10 -+/* Don't use this if inhibit_libc is set
  440.11 -+   The build for this target will fail trying to include missing headers */
  440.12 -+#ifndef inhibit_libc
  440.13 - #include <signal.h>
  440.14 - #include <sys/ucontext.h>
  440.15 - 
  440.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  440.17 -   fs->retaddr_column = 64;
  440.18 -   return _URC_NO_REASON;
  440.19 - }
  440.20 -+#endif /* inhibit_libc */
   441.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   441.2 +++ b/patches/gcc/4.3.1/110-trampolinewarn.patch	Mon Jul 28 21:32:33 2008 +0000
   441.3 @@ -0,0 +1,35 @@
   441.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-trampolinewarn.patch
   441.5 +	This trivial patch causes gcc to emit a warning whenever
   441.6 +	it generates a trampoline.  These are otherwise hard to
   441.7 +	locate.  It is rigged to default ON - to have it default
   441.8 +	to OFF remove the text 'Init(1)' from the common.opt
   441.9 +	patch, leaving just 'Common Var(warn_trampolines)'.
  441.10 +	Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
  441.11 +
  441.12 +diff -durN gcc-4.3.1.orig/gcc/builtins.c gcc-4.3.1/gcc/builtins.c
  441.13 +--- gcc-4.3.1.orig/gcc/builtins.c	2008-04-23 00:36:27.000000000 +0200
  441.14 ++++ gcc-4.3.1/gcc/builtins.c	2008-06-10 14:56:54.000000000 +0200
  441.15 +@@ -5662,6 +5662,9 @@
  441.16 +   trampolines_created = 1;
  441.17 +   INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
  441.18 + 
  441.19 ++  if (warn_trampolines)
  441.20 ++    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
  441.21 ++
  441.22 +   return const0_rtx;
  441.23 + }
  441.24 + 
  441.25 +diff -durN gcc-4.3.1.orig/gcc/common.opt gcc-4.3.1/gcc/common.opt
  441.26 +--- gcc-4.3.1.orig/gcc/common.opt	2008-01-22 15:11:44.000000000 +0100
  441.27 ++++ gcc-4.3.1/gcc/common.opt	2008-06-10 14:56:54.000000000 +0200
  441.28 +@@ -182,6 +182,10 @@
  441.29 + Common Var(warn_system_headers) Warning
  441.30 + Do not suppress warnings from system headers
  441.31 + 
  441.32 ++Wtrampolines
  441.33 ++Common Var(warn_trampolines) Init(1)
  441.34 ++Warn whenever a trampoline is generated
  441.35 ++
  441.36 + Wuninitialized
  441.37 + Common Var(warn_uninitialized) Warning
  441.38 + Warn about uninitialized automatic variables
   442.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   442.2 +++ b/patches/gcc/4.3.1/120-java-nomulti.patch	Mon Jul 28 21:32:33 2008 +0000
   442.3 @@ -0,0 +1,47 @@
   442.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/03_all_gcc43-java-nomulti.patch
   442.5 +diff -durN gcc-4.3.1.orig/libjava/configure gcc-4.3.1/libjava/configure
   442.6 +--- gcc-4.3.1.orig/libjava/configure	2008-06-06 16:49:11.000000000 +0200
   442.7 ++++ gcc-4.3.1/libjava/configure	2008-06-10 14:57:38.000000000 +0200
   442.8 +@@ -1018,6 +1018,8 @@
   442.9 +   --enable-gconf-peer     compile GConf native peers for util.preferences
  442.10 +   --enable-java-maintainer-mode
  442.11 +                           allow rebuilding of .class and .h files
  442.12 ++  --enable-libjava-multilib
  442.13 ++                          build libjava as multilib
  442.14 +   --disable-dependency-tracking  speeds up one-time build
  442.15 +   --enable-dependency-tracking   do not reject slow dependency extractors
  442.16 +   --enable-maintainer-mode  enable make rules and dependencies not useful
  442.17 +@@ -1850,6 +1852,16 @@
  442.18 + fi
  442.19 + 
  442.20 + 
  442.21 ++# Check whether --enable-libjava-multilib was given.
  442.22 ++if test "${enable_libjava_multilib+set}" = set; then
  442.23 ++  enableval=$enable_libjava_multilib;
  442.24 ++fi
  442.25 ++
  442.26 ++if test "$enable_libjava_multilib" = no; then
  442.27 ++  multilib=no
  442.28 ++  ac_configure_args="$ac_configure_args --disable-multilib"
  442.29 ++fi
  442.30 ++
  442.31 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  442.32 + 
  442.33 + 
  442.34 +diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac
  442.35 +--- gcc-4.3.1.orig/libjava/configure.ac	2007-12-22 16:48:46.000000000 +0100
  442.36 ++++ gcc-4.3.1/libjava/configure.ac	2008-06-10 14:57:38.000000000 +0200
  442.37 +@@ -82,6 +82,13 @@
  442.38 + 	[allow rebuilding of .class and .h files]))
  442.39 + AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
  442.40 + 
  442.41 ++AC_ARG_ENABLE(libjava-multilib,
  442.42 ++	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
  442.43 ++if test "$enable_libjava_multilib" = no; then
  442.44 ++  multilib=no
  442.45 ++  ac_configure_args="$ac_configure_args --disable-multilib"
  442.46 ++fi
  442.47 ++
  442.48 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  442.49 + GCC_NO_EXECUTABLES
  442.50 + 
   443.1 --- a/patches/gcc/4.3.1/125-trampolinewarn.patch	Mon Jul 28 21:08:01 2008 +0000
   443.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   443.3 @@ -1,35 +0,0 @@
   443.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-trampolinewarn.patch
   443.5 -	This trivial patch causes gcc to emit a warning whenever
   443.6 -	it generates a trampoline.  These are otherwise hard to
   443.7 -	locate.  It is rigged to default ON - to have it default
   443.8 -	to OFF remove the text 'Init(1)' from the common.opt
   443.9 -	patch, leaving just 'Common Var(warn_trampolines)'.
  443.10 -	Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
  443.11 -
  443.12 -diff -durN gcc-4.3.1.orig/gcc/builtins.c gcc-4.3.1/gcc/builtins.c
  443.13 ---- gcc-4.3.1.orig/gcc/builtins.c	2008-04-23 00:36:27.000000000 +0200
  443.14 -+++ gcc-4.3.1/gcc/builtins.c	2008-06-10 14:56:54.000000000 +0200
  443.15 -@@ -5662,6 +5662,9 @@
  443.16 -   trampolines_created = 1;
  443.17 -   INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
  443.18 - 
  443.19 -+  if (warn_trampolines)
  443.20 -+    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
  443.21 -+
  443.22 -   return const0_rtx;
  443.23 - }
  443.24 - 
  443.25 -diff -durN gcc-4.3.1.orig/gcc/common.opt gcc-4.3.1/gcc/common.opt
  443.26 ---- gcc-4.3.1.orig/gcc/common.opt	2008-01-22 15:11:44.000000000 +0100
  443.27 -+++ gcc-4.3.1/gcc/common.opt	2008-06-10 14:56:54.000000000 +0200
  443.28 -@@ -182,6 +182,10 @@
  443.29 - Common Var(warn_system_headers) Warning
  443.30 - Do not suppress warnings from system headers
  443.31 - 
  443.32 -+Wtrampolines
  443.33 -+Common Var(warn_trampolines) Init(1)
  443.34 -+Warn whenever a trampoline is generated
  443.35 -+
  443.36 - Wuninitialized
  443.37 - Common Var(warn_uninitialized) Warning
  443.38 - Warn about uninitialized automatic variables
   444.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   444.2 +++ b/patches/gcc/4.3.1/130-cross-compile.patch	Mon Jul 28 21:32:33 2008 +0000
   444.3 @@ -0,0 +1,44 @@
   444.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/08_all_gcc-4.1-cross-compile.patch
   444.5 +Some notes on the 'bootstrap with or without libc headers' debate:
   444.6 +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
   444.7 +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
   444.8 +
   444.9 +diff -durN gcc-4.3.1.orig/gcc/configure gcc-4.3.1/gcc/configure
  444.10 +--- gcc-4.3.1.orig/gcc/configure	2008-05-21 10:54:15.000000000 +0200
  444.11 ++++ gcc-4.3.1/gcc/configure	2008-06-10 14:57:42.000000000 +0200
  444.12 +@@ -13283,7 +13283,7 @@
  444.13 + 	    | powerpc*-*-*,powerpc64*-*-*)
  444.14 + 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  444.15 + 	esac
  444.16 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
  444.17 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  444.18 +         SYSTEM_HEADER_DIR=$build_system_header_dir
  444.19 + fi
  444.20 + 
  444.21 +diff -durN gcc-4.3.1.orig/gcc/configure.ac gcc-4.3.1/gcc/configure.ac
  444.22 +--- gcc-4.3.1.orig/gcc/configure.ac	2008-05-21 10:54:15.000000000 +0200
  444.23 ++++ gcc-4.3.1/gcc/configure.ac	2008-06-10 14:57:42.000000000 +0200
  444.24 +@@ -1749,7 +1749,7 @@
  444.25 + 	    | powerpc*-*-*,powerpc64*-*-*)
  444.26 + 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  444.27 + 	esac
  444.28 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
  444.29 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  444.30 +         SYSTEM_HEADER_DIR=$build_system_header_dir 
  444.31 + fi
  444.32 + 
  444.33 +diff -durN gcc-4.3.1.orig/gcc/unwind-dw2.c gcc-4.3.1/gcc/unwind-dw2.c
  444.34 +--- gcc-4.3.1.orig/gcc/unwind-dw2.c	2007-07-25 20:14:57.000000000 +0200
  444.35 ++++ gcc-4.3.1/gcc/unwind-dw2.c	2008-06-10 14:57:42.000000000 +0200
  444.36 +@@ -334,9 +334,11 @@
  444.37 + }
  444.38 + #endif
  444.39 + 
  444.40 ++#ifndef inhibit_libc
  444.41 + #ifdef MD_UNWIND_SUPPORT
  444.42 + #include MD_UNWIND_SUPPORT
  444.43 + #endif
  444.44 ++#endif
  444.45 + 
  444.46 + /* Extract any interesting information from the CIE for the translation
  444.47 +    unit F belongs to.  Return a pointer to the byte after the augmentation,
   445.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   445.2 +++ b/patches/gcc/4.3.1/140-netbsd-symbolic.patch	Mon Jul 28 21:32:33 2008 +0000
   445.3 @@ -0,0 +1,14 @@
   445.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/11_all_gcc-netbsd-symbolic.patch
   445.5 +http://bugs.gentoo.org/122698
   445.6 +
   445.7 +diff -durN gcc-4.3.1.orig/gcc/config/netbsd-elf.h gcc-4.3.1/gcc/config/netbsd-elf.h
   445.8 +--- gcc-4.3.1.orig/gcc/config/netbsd-elf.h	2007-09-03 18:14:04.000000000 +0200
   445.9 ++++ gcc-4.3.1/gcc/config/netbsd-elf.h	2008-06-10 14:57:48.000000000 +0200
  445.10 +@@ -82,6 +82,7 @@
  445.11 + #define NETBSD_LINK_SPEC_ELF \
  445.12 +   "%{assert*} %{R*} %{rpath*} \
  445.13 +    %{shared:-shared} \
  445.14 ++   %{symbolic:-Bsymbolic} \
  445.15 +    %{!shared: \
  445.16 +      -dc -dp \
  445.17 +      %{!nostdlib: \
   446.1 --- a/patches/gcc/4.3.1/150-java-nomulti.patch	Mon Jul 28 21:08:01 2008 +0000
   446.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   446.3 @@ -1,47 +0,0 @@
   446.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/03_all_gcc43-java-nomulti.patch
   446.5 -diff -durN gcc-4.3.1.orig/libjava/configure gcc-4.3.1/libjava/configure
   446.6 ---- gcc-4.3.1.orig/libjava/configure	2008-06-06 16:49:11.000000000 +0200
   446.7 -+++ gcc-4.3.1/libjava/configure	2008-06-10 14:57:38.000000000 +0200
   446.8 -@@ -1018,6 +1018,8 @@
   446.9 -   --enable-gconf-peer     compile GConf native peers for util.preferences
  446.10 -   --enable-java-maintainer-mode
  446.11 -                           allow rebuilding of .class and .h files
  446.12 -+  --enable-libjava-multilib
  446.13 -+                          build libjava as multilib
  446.14 -   --disable-dependency-tracking  speeds up one-time build
  446.15 -   --enable-dependency-tracking   do not reject slow dependency extractors
  446.16 -   --enable-maintainer-mode  enable make rules and dependencies not useful
  446.17 -@@ -1850,6 +1852,16 @@
  446.18 - fi
  446.19 - 
  446.20 - 
  446.21 -+# Check whether --enable-libjava-multilib was given.
  446.22 -+if test "${enable_libjava_multilib+set}" = set; then
  446.23 -+  enableval=$enable_libjava_multilib;
  446.24 -+fi
  446.25 -+
  446.26 -+if test "$enable_libjava_multilib" = no; then
  446.27 -+  multilib=no
  446.28 -+  ac_configure_args="$ac_configure_args --disable-multilib"
  446.29 -+fi
  446.30 -+
  446.31 - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  446.32 - 
  446.33 - 
  446.34 -diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac
  446.35 ---- gcc-4.3.1.orig/libjava/configure.ac	2007-12-22 16:48:46.000000000 +0100
  446.36 -+++ gcc-4.3.1/libjava/configure.ac	2008-06-10 14:57:38.000000000 +0200
  446.37 -@@ -82,6 +82,13 @@
  446.38 - 	[allow rebuilding of .class and .h files]))
  446.39 - AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
  446.40 - 
  446.41 -+AC_ARG_ENABLE(libjava-multilib,
  446.42 -+	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
  446.43 -+if test "$enable_libjava_multilib" = no; then
  446.44 -+  multilib=no
  446.45 -+  ac_configure_args="$ac_configure_args --disable-multilib"
  446.46 -+fi
  446.47 -+
  446.48 - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  446.49 - GCC_NO_EXECUTABLES
  446.50 - 
   447.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   447.2 +++ b/patches/gcc/4.3.1/150-sparc64-bsd.patch	Mon Jul 28 21:32:33 2008 +0000
   447.3 @@ -0,0 +1,30 @@
   447.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/14_all_gcc-sparc64-bsd.patch
   447.5 +diff -durN gcc-4.3.1.orig/gcc/config/sparc/freebsd.h gcc-4.3.1/gcc/config/sparc/freebsd.h
   447.6 +--- gcc-4.3.1.orig/gcc/config/sparc/freebsd.h	2007-08-02 12:49:31.000000000 +0200
   447.7 ++++ gcc-4.3.1/gcc/config/sparc/freebsd.h	2008-06-10 14:57:54.000000000 +0200
   447.8 +@@ -25,9 +25,22 @@
   447.9 + /* FreeBSD needs the platform name (sparc64) defined.
  447.10 +    Emacs needs to know if the arch is 64 or 32-bits.  */
  447.11 + 
  447.12 +-#undef  CPP_CPU64_DEFAULT_SPEC
  447.13 +-#define CPP_CPU64_DEFAULT_SPEC \
  447.14 +-  "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
  447.15 ++#undef  FBSD_TARGET_CPU_CPP_BUILTINS
  447.16 ++#define FBSD_TARGET_CPU_CPP_BUILTINS()                  \
  447.17 ++  do                                                    \
  447.18 ++    {                                                   \
  447.19 ++      if (TARGET_ARCH64)                                \
  447.20 ++        {                                               \
  447.21 ++          builtin_define ("__sparc64__");               \
  447.22 ++          builtin_define ("__sparc_v9__");              \
  447.23 ++          builtin_define ("__sparcv9");                 \
  447.24 ++        }                                               \
  447.25 ++      else                                              \
  447.26 ++        builtin_define ("__sparc");                     \
  447.27 ++      builtin_define ("__sparc__");                     \
  447.28 ++    }                                                   \
  447.29 ++  while (0)
  447.30 ++
  447.31 + 
  447.32 + #define LINK_SPEC "%(link_arch)						\
  447.33 +   %{!mno-relax:%{!r:-relax}}						\
   448.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   448.2 +++ b/patches/gcc/4.3.1/160-flatten-switch-stmt-00.patch	Mon Jul 28 21:32:33 2008 +0000
   448.3 @@ -0,0 +1,76 @@
   448.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/18_all_904-flatten-switch-stmt-00.patch
   448.5 +http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
   448.6 +
   448.7 +Hi,
   448.8 +
   448.9 +The attached patch makes sure that we create smaller object code for
  448.10 +simple switch statements. We just make sure to flatten the switch
  448.11 +statement into an if-else chain, basically.
  448.12 +
  448.13 +This fixes a size-regression as compared to gcc-3.4, as can be seen
  448.14 +below.
  448.15 +
  448.16 +2007-04-15  Bernhard Fischer  <..>
  448.17 +
  448.18 +	* stmt.c (expand_case): Do not create a complex binary tree when
  448.19 +	optimizing for size but rather use the simple ordered list.
  448.20 +	(emit_case_nodes): do not emit jumps to the default_label when
  448.21 +	optimizing for size.
  448.22 +
  448.23 +Not regtested so far.
  448.24 +Comments?
  448.25 +
  448.26 +Attached is the test switch.c mentioned below.
  448.27 +
  448.28 +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  448.29 +gcc-$i  -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
  448.30 +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  448.31 +gcc-$i  -UCHAIN -Os -o switch-$i.o -c switch.c ;done
  448.32 +
  448.33 +$ size switch-*.o
  448.34 +   text	   data	    bss	    dec	    hex	filename
  448.35 +    169	      0	      0	    169	     a9	switch-2.95.o
  448.36 +    115	      0	      0	    115	     73	switch-3.3.o
  448.37 +    103	      0	      0	    103	     67	switch-3.4.o
  448.38 +    124	      0	      0	    124	     7c	switch-4.0.o
  448.39 +    124	      0	      0	    124	     7c	switch-4.1.o
  448.40 +    124	      0	      0	    124	     7c	switch-4.2.orig-HEAD.o
  448.41 +     95	      0	      0	     95	     5f	switch-4.3-HEAD.o
  448.42 +    124	      0	      0	    124	     7c	switch-4.3.orig-HEAD.o
  448.43 +    166	      0	      0	    166	     a6	switch-CHAIN-2.95.o
  448.44 +    111	      0	      0	    111	     6f	switch-CHAIN-3.3.o
  448.45 +     95	      0	      0	     95	     5f	switch-CHAIN-3.4.o
  448.46 +     95	      0	      0	     95	     5f	switch-CHAIN-4.0.o
  448.47 +     95	      0	      0	     95	     5f	switch-CHAIN-4.1.o
  448.48 +     95	      0	      0	     95	     5f	switch-CHAIN-4.2.orig-HEAD.o
  448.49 +     95	      0	      0	     95	     5f	switch-CHAIN-4.3-HEAD.o
  448.50 +     95	      0	      0	     95	     5f	switch-CHAIN-4.3.orig-HEAD.o
  448.51 +
  448.52 +
  448.53 +Content-Type: text/x-diff; charset=us-ascii
  448.54 +Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
  448.55 +
  448.56 +diff -durN gcc-4.3.1.orig/gcc/stmt.c gcc-4.3.1/gcc/stmt.c
  448.57 +--- gcc-4.3.1.orig/gcc/stmt.c	2008-05-09 20:12:13.000000000 +0200
  448.58 ++++ gcc-4.3.1/gcc/stmt.c	2008-06-10 14:57:58.000000000 +0200
  448.59 +@@ -2509,7 +2509,11 @@
  448.60 + 	  use_cost_table
  448.61 + 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  448.62 + 	       && estimate_case_costs (case_list));
  448.63 +-	  balance_case_nodes (&case_list, NULL);
  448.64 ++	  /* When optimizing for size, we want a straight list to avoid
  448.65 ++	     jumps as much as possible. This basically creates an if-else
  448.66 ++	     chain.  */
  448.67 ++	  if (!optimize_size)
  448.68 ++	    balance_case_nodes (&case_list, NULL);
  448.69 + 	  emit_case_nodes (index, case_list, default_label, index_type);
  448.70 + 	  emit_jump (default_label);
  448.71 + 	}
  448.72 +@@ -3067,6 +3071,7 @@
  448.73 + 	    {
  448.74 + 	      if (!node_has_low_bound (node, index_type))
  448.75 + 		{
  448.76 ++		  if (!optimize_size) /* don't jl to the .default_label. */
  448.77 + 		  emit_cmp_and_jump_insns (index,
  448.78 + 					   convert_modes
  448.79 + 					   (mode, imode,
   449.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   449.2 +++ b/patches/gcc/4.3.1/170-libiberty-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   449.3 @@ -0,0 +1,12 @@
   449.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/51_all_gcc-3.4-libiberty-pic.patch
   449.5 +diff -durN gcc-4.3.1.orig/libiberty/Makefile.in gcc-4.3.1/libiberty/Makefile.in
   449.6 +--- gcc-4.3.1.orig/libiberty/Makefile.in	2007-07-25 08:26:45.000000000 +0200
   449.7 ++++ gcc-4.3.1/libiberty/Makefile.in	2008-06-10 14:58:02.000000000 +0200
   449.8 +@@ -225,6 +225,7 @@
   449.9 + 	  $(AR) $(AR_FLAGS) $(TARGETLIB) \
  449.10 + 	    $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
  449.11 + 	  $(RANLIB) $(TARGETLIB); \
  449.12 ++	  cp $(TARGETLIB) ../ ; \
  449.13 + 	  cd ..; \
  449.14 + 	else true; fi
  449.15 + 
   450.1 --- a/patches/gcc/4.3.1/175-cross-compile.patch	Mon Jul 28 21:08:01 2008 +0000
   450.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   450.3 @@ -1,44 +0,0 @@
   450.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/08_all_gcc-4.1-cross-compile.patch
   450.5 -Some notes on the 'bootstrap with or without libc headers' debate:
   450.6 -http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
   450.7 -http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
   450.8 -
   450.9 -diff -durN gcc-4.3.1.orig/gcc/configure gcc-4.3.1/gcc/configure
  450.10 ---- gcc-4.3.1.orig/gcc/configure	2008-05-21 10:54:15.000000000 +0200
  450.11 -+++ gcc-4.3.1/gcc/configure	2008-06-10 14:57:42.000000000 +0200
  450.12 -@@ -13283,7 +13283,7 @@
  450.13 - 	    | powerpc*-*-*,powerpc64*-*-*)
  450.14 - 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  450.15 - 	esac
  450.16 --elif test "x$TARGET_SYSTEM_ROOT" != x; then
  450.17 -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  450.18 -         SYSTEM_HEADER_DIR=$build_system_header_dir
  450.19 - fi
  450.20 - 
  450.21 -diff -durN gcc-4.3.1.orig/gcc/configure.ac gcc-4.3.1/gcc/configure.ac
  450.22 ---- gcc-4.3.1.orig/gcc/configure.ac	2008-05-21 10:54:15.000000000 +0200
  450.23 -+++ gcc-4.3.1/gcc/configure.ac	2008-06-10 14:57:42.000000000 +0200
  450.24 -@@ -1749,7 +1749,7 @@
  450.25 - 	    | powerpc*-*-*,powerpc64*-*-*)
  450.26 - 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  450.27 - 	esac
  450.28 --elif test "x$TARGET_SYSTEM_ROOT" != x; then
  450.29 -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  450.30 -         SYSTEM_HEADER_DIR=$build_system_header_dir 
  450.31 - fi
  450.32 - 
  450.33 -diff -durN gcc-4.3.1.orig/gcc/unwind-dw2.c gcc-4.3.1/gcc/unwind-dw2.c
  450.34 ---- gcc-4.3.1.orig/gcc/unwind-dw2.c	2007-07-25 20:14:57.000000000 +0200
  450.35 -+++ gcc-4.3.1/gcc/unwind-dw2.c	2008-06-10 14:57:42.000000000 +0200
  450.36 -@@ -334,9 +334,11 @@
  450.37 - }
  450.38 - #endif
  450.39 - 
  450.40 -+#ifndef inhibit_libc
  450.41 - #ifdef MD_UNWIND_SUPPORT
  450.42 - #include MD_UNWIND_SUPPORT
  450.43 - #endif
  450.44 -+#endif
  450.45 - 
  450.46 - /* Extract any interesting information from the CIE for the translation
  450.47 -    unit F belongs to.  Return a pointer to the byte after the augmentation,
   451.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   451.2 +++ b/patches/gcc/4.3.1/180-superh-default-multilib.patch	Mon Jul 28 21:32:33 2008 +0000
   451.3 @@ -0,0 +1,25 @@
   451.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/53_all_gcc4-superh-default-multilib.patch
   451.5 +The gcc-3.x toolchains would contain all the targets by default.  With gcc-4,
   451.6 +you have to actually list out the multilibs you want or you will end up with
   451.7 +just one when using targets like 'sh4-linux-gnu'.
   451.8 +
   451.9 +The resulting toolchain can't even build a kernel as the kernel needs to build
  451.10 +with the nofpu flag to be sure that no fpu ops are generated.
  451.11 +
  451.12 +Here we restore the gcc-3.x behavior; the additional overhead of building all
  451.13 +of these multilibs by default is negligible.
  451.14 +
  451.15 +http://bugs.gentoo.org/140205
  451.16 +
  451.17 +diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc
  451.18 +--- gcc-4.3.1.orig/gcc/config.gcc	2008-05-21 10:54:15.000000000 +0200
  451.19 ++++ gcc-4.3.1/gcc/config.gcc	2008-06-10 14:58:06.000000000 +0200
  451.20 +@@ -2278,7 +2278,7 @@
  451.21 + 	if test x${sh_multilibs} = x ; then
  451.22 + 		case ${target} in
  451.23 + 		sh64-superh-linux* | \
  451.24 +-		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
  451.25 ++		sh[1234]*)	sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
  451.26 + 		sh64* | sh5*)	sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
  451.27 + 		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
  451.28 + 		sh*-*-linux*)	sh_multilibs=m1,m3e,m4 ;;
   452.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   452.2 +++ b/patches/gcc/4.3.1/190-libstdc++-pic.patch	Mon Jul 28 21:32:33 2008 +0000
   452.3 @@ -0,0 +1,56 @@
   452.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/54_all_300-libstdc++-pic.patch
   452.5 +install libstdc++_pic.a if we have pic objs
   452.6 +
   452.7 +diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am gcc-4.3.1/libstdc++-v3/src/Makefile.am
   452.8 +--- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am	2008-02-29 19:26:50.000000000 +0100
   452.9 ++++ gcc-4.3.1/libstdc++-v3/src/Makefile.am	2008-06-10 14:58:09.000000000 +0200
  452.10 +@@ -289,6 +289,13 @@
  452.11 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
  452.12 + 
  452.13 + 
  452.14 ++install-exec-local:
  452.15 ++	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  452.16 ++	if [ x"$$pic_objs" != x ]; then \
  452.17 ++		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  452.18 ++		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  452.19 ++	fi
  452.20 ++
  452.21 + # Added bits to build debug library.
  452.22 + if GLIBCXX_BUILD_DEBUG
  452.23 + all-local: build_debug
  452.24 +diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in gcc-4.3.1/libstdc++-v3/src/Makefile.in
  452.25 +--- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in	2008-02-29 19:26:50.000000000 +0100
  452.26 ++++ gcc-4.3.1/libstdc++-v3/src/Makefile.in	2008-06-10 14:58:09.000000000 +0200
  452.27 +@@ -693,7 +693,7 @@
  452.28 + 
  452.29 + install-data-am: install-data-local
  452.30 + 
  452.31 +-install-exec-am: install-toolexeclibLTLIBRARIES
  452.32 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  452.33 + 
  452.34 + install-info: install-info-am
  452.35 + 
  452.36 +@@ -732,7 +732,7 @@
  452.37 + 	maintainer-clean-generic mostlyclean mostlyclean-compile \
  452.38 + 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  452.39 + 	tags uninstall uninstall-am uninstall-info-am \
  452.40 +-	uninstall-toolexeclibLTLIBRARIES
  452.41 ++	uninstall-toolexeclibLTLIBRARIES install-exec-local
  452.42 + 
  452.43 + 
  452.44 + # Symbol versioning for shared libraries.
  452.45 +@@ -858,6 +858,14 @@
  452.46 + install_debug:
  452.47 + 	(cd ${debugdir} && $(MAKE) \
  452.48 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  452.49 ++
  452.50 ++install-exec-local:
  452.51 ++	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  452.52 ++	if [ x"$$pic_objs" != x ]; then \
  452.53 ++		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  452.54 ++		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  452.55 ++	fi
  452.56 ++
  452.57 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  452.58 + # Otherwise a system limit (for SysV at least) may be exceeded.
  452.59 + .NOEXPORT:
   453.1 --- a/patches/gcc/4.3.1/200-netbsd-symbolic.patch	Mon Jul 28 21:08:01 2008 +0000
   453.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   453.3 @@ -1,14 +0,0 @@
   453.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/11_all_gcc-netbsd-symbolic.patch
   453.5 -http://bugs.gentoo.org/122698
   453.6 -
   453.7 -diff -durN gcc-4.3.1.orig/gcc/config/netbsd-elf.h gcc-4.3.1/gcc/config/netbsd-elf.h
   453.8 ---- gcc-4.3.1.orig/gcc/config/netbsd-elf.h	2007-09-03 18:14:04.000000000 +0200
   453.9 -+++ gcc-4.3.1/gcc/config/netbsd-elf.h	2008-06-10 14:57:48.000000000 +0200
  453.10 -@@ -82,6 +82,7 @@
  453.11 - #define NETBSD_LINK_SPEC_ELF \
  453.12 -   "%{assert*} %{R*} %{rpath*} \
  453.13 -    %{shared:-shared} \
  453.14 -+   %{symbolic:-Bsymbolic} \
  453.15 -    %{!shared: \
  453.16 -      -dc -dp \
  453.17 -      %{!nostdlib: \
   454.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   454.2 +++ b/patches/gcc/4.3.1/200-pr24170.patch	Mon Jul 28 21:32:33 2008 +0000
   454.3 @@ -0,0 +1,61 @@
   454.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc43-pr24170.patch
   454.5 +http://gcc.gnu.org/PR24170
   454.6 +
   454.7 +2008-02-20  Tom Tromey  <tromey@redhat.com>
   454.8 +
   454.9 +	PR libgcj/24170:
  454.10 +	* java/io/natFilePosix.cc (File::performList): Don't use
  454.11 +	readdir_r.
  454.12 +	* configure, include/config.h.in: Rebuilt.
  454.13 +	* configure.ac: Don't check for readdir_r.
  454.14 +
  454.15 +diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac
  454.16 +--- gcc-4.3.1.orig/libjava/configure.ac	2008-06-10 14:57:42.000000000 +0200
  454.17 ++++ gcc-4.3.1/libjava/configure.ac	2008-06-10 14:58:13.000000000 +0200
  454.18 +@@ -1030,7 +1030,7 @@
  454.19 +    PLATFORMNET=NoNet
  454.20 + else
  454.21 +    AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
  454.22 +-                   localtime_r readdir_r getpwuid_r getcwd \
  454.23 ++                   localtime_r getpwuid_r getcwd \
  454.24 + 		   access stat lstat mkdir rename rmdir unlink utime chmod readlink \
  454.25 + 		   nl_langinfo setlocale \
  454.26 + 		   inet_pton uname inet_ntoa \
  454.27 +diff -durN gcc-4.3.1.orig/libjava/include/config.h.in gcc-4.3.1/libjava/include/config.h.in
  454.28 +--- gcc-4.3.1.orig/libjava/include/config.h.in	2007-07-31 18:17:21.000000000 +0200
  454.29 ++++ gcc-4.3.1/libjava/include/config.h.in	2008-06-10 14:58:13.000000000 +0200
  454.30 +@@ -214,9 +214,6 @@
  454.31 + /* Define to 1 if you have the <pwd.h> header file. */
  454.32 + #undef HAVE_PWD_H
  454.33 + 
  454.34 +-/* Define to 1 if you have the `readdir_r' function. */
  454.35 +-#undef HAVE_READDIR_R
  454.36 +-
  454.37 + /* Define to 1 if you have the `readlink' function. */
  454.38 + #undef HAVE_READLINK
  454.39 + 
  454.40 +diff -durN gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc gcc-4.3.1/libjava/java/io/natFilePosix.cc
  454.41 +--- gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc	2007-08-04 23:50:01.000000000 +0200
  454.42 ++++ gcc-4.3.1/libjava/java/io/natFilePosix.cc	2008-06-10 14:58:13.000000000 +0200
  454.43 +@@ -1,6 +1,6 @@
  454.44 + // natFile.cc - Native part of File class for POSIX.
  454.45 + 
  454.46 +-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
  454.47 ++/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
  454.48 +    Free Software Foundation
  454.49 + 
  454.50 +    This file is part of libgcj.
  454.51 +@@ -292,13 +292,7 @@
  454.52 + 
  454.53 +   java::util::ArrayList *list = new java::util::ArrayList ();
  454.54 +   struct dirent *d;
  454.55 +-#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
  454.56 +-  int name_max = pathconf (buf, _PC_NAME_MAX);
  454.57 +-  char dbuf[sizeof (struct dirent) + name_max + 1];
  454.58 +-  while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
  454.59 +-#else /* HAVE_READDIR_R */
  454.60 +   while ((d = readdir (dir)) != NULL)
  454.61 +-#endif /* HAVE_READDIR_R */
  454.62 +     {
  454.63 +       // Omit "." and "..".
  454.64 +       if (d->d_name[0] == '.'
   455.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   455.2 +++ b/patches/gcc/4.3.1/210-noteGNUstack-00.patch	Mon Jul 28 21:32:33 2008 +0000
   455.3 @@ -0,0 +1,96 @@
   455.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
   455.5 +2004-09-20  Jakub Jelinek  <jakub@redhat.com>
   455.6 +
   455.7 +	* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
   455.8 +	on ppc64-linux.
   455.9 +
  455.10 +	* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
  455.11 +	ia64-linux.
  455.12 +	* config/ia64/crtbegin.asm: Likewise.
  455.13 +	* config/ia64/crtend.asm: Likewise.
  455.14 +	* config/ia64/crti.asm: Likewise.
  455.15 +	* config/ia64/crtn.asm: Likewise.
  455.16 +
  455.17 +2004-05-14  Jakub Jelinek  <jakub@redhat.com>
  455.18 +
  455.19 +	* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
  455.20 +
  455.21 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.1/gcc/config/ia64/crtbegin.asm
  455.22 +--- gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm	2005-09-27 02:52:24.000000000 +0200
  455.23 ++++ gcc-4.3.1/gcc/config/ia64/crtbegin.asm	2008-06-10 14:58:17.000000000 +0200
  455.24 +@@ -255,3 +255,7 @@
  455.25 + .weak __cxa_finalize
  455.26 + #endif
  455.27 + .weak _Jv_RegisterClasses
  455.28 ++
  455.29 ++#ifdef __linux__
  455.30 ++.section .note.GNU-stack; .previous
  455.31 ++#endif
  455.32 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtend.asm gcc-4.3.1/gcc/config/ia64/crtend.asm
  455.33 +--- gcc-4.3.1.orig/gcc/config/ia64/crtend.asm	2005-09-27 02:52:24.000000000 +0200
  455.34 ++++ gcc-4.3.1/gcc/config/ia64/crtend.asm	2008-06-10 14:58:17.000000000 +0200
  455.35 +@@ -122,3 +122,7 @@
  455.36 + 
  455.37 + 	br.ret.sptk.many rp
  455.38 + 	.endp __do_global_ctors_aux
  455.39 ++
  455.40 ++#ifdef __linux__
  455.41 ++.section .note.GNU-stack; .previous
  455.42 ++#endif
  455.43 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crti.asm gcc-4.3.1/gcc/config/ia64/crti.asm
  455.44 +--- gcc-4.3.1.orig/gcc/config/ia64/crti.asm	2005-06-25 03:22:41.000000000 +0200
  455.45 ++++ gcc-4.3.1/gcc/config/ia64/crti.asm	2008-06-10 14:58:17.000000000 +0200
  455.46 +@@ -64,3 +64,7 @@
  455.47 + 	.body
  455.48 + 
  455.49 + # end of crti.asm
  455.50 ++
  455.51 ++#ifdef __linux__
  455.52 ++.section .note.GNU-stack; .previous
  455.53 ++#endif
  455.54 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtn.asm gcc-4.3.1/gcc/config/ia64/crtn.asm
  455.55 +--- gcc-4.3.1.orig/gcc/config/ia64/crtn.asm	2005-06-25 03:22:41.000000000 +0200
  455.56 ++++ gcc-4.3.1/gcc/config/ia64/crtn.asm	2008-06-10 14:58:17.000000000 +0200
  455.57 +@@ -54,3 +54,7 @@
  455.58 + 	br.ret.sptk.many b0
  455.59 + 
  455.60 + # end of crtn.asm
  455.61 ++
  455.62 ++#ifdef __linux__
  455.63 ++.section .note.GNU-stack; .previous
  455.64 ++#endif
  455.65 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.1/gcc/config/ia64/lib1funcs.asm
  455.66 +--- gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm	2005-09-27 02:52:24.000000000 +0200
  455.67 ++++ gcc-4.3.1/gcc/config/ia64/lib1funcs.asm	2008-06-10 14:58:17.000000000 +0200
  455.68 +@@ -792,3 +792,7 @@
  455.69 + 	}
  455.70 + 	.endp __floattitf
  455.71 + #endif
  455.72 ++
  455.73 ++#ifdef __linux__
  455.74 ++.section .note.GNU-stack; .previous
  455.75 ++#endif
  455.76 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/linux.h gcc-4.3.1/gcc/config/ia64/linux.h
  455.77 +--- gcc-4.3.1.orig/gcc/config/ia64/linux.h	2006-12-12 16:15:19.000000000 +0100
  455.78 ++++ gcc-4.3.1/gcc/config/ia64/linux.h	2008-06-10 14:58:17.000000000 +0200
  455.79 +@@ -5,6 +5,8 @@
  455.80 + 
  455.81 + #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
  455.82 + 
  455.83 ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
  455.84 ++
  455.85 + /* This is for -profile to use -lc_p instead of -lc.  */
  455.86 + #undef CC1_SPEC
  455.87 + #define CC1_SPEC "%{profile:-p} %{G*}"
  455.88 +diff -durN gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.1/gcc/config/rs6000/ppc-asm.h
  455.89 +--- gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h	2003-06-04 18:44:51.000000000 +0200
  455.90 ++++ gcc-4.3.1/gcc/config/rs6000/ppc-asm.h	2008-06-10 14:58:17.000000000 +0200
  455.91 +@@ -158,7 +158,7 @@
  455.92 + 	.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
  455.93 + #endif
  455.94 + 
  455.95 +-#if defined __linux__ && !defined __powerpc64__
  455.96 ++#if defined __linux__
  455.97 + 	.section .note.GNU-stack
  455.98 + 	.previous
  455.99 + #endif
   456.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   456.2 +++ b/patches/gcc/4.3.1/220-noteGNUstack-01.patch	Mon Jul 28 21:32:33 2008 +0000
   456.3 @@ -0,0 +1,198 @@
   456.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/62_all_gcc4-noteGNUstack.patch
   456.5 +2005-02-08  Jakub Jelinek  <jakub@redhat.com>
   456.6 +
   456.7 +	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
   456.8 +	* src/s390/sysv.S: Likewise.
   456.9 +	* src/powerpc/linux64.S: Likewise.
  456.10 +	* src/powerpc/linux64_closure.S: Likewise.
  456.11 +	* src/powerpc/ppc_closure.S: Likewise.
  456.12 +	* src/powerpc/sysv.S: Likewise.
  456.13 +	* src/x86/unix64.S: Likewise.
  456.14 +	* src/x86/sysv.S: Likewise.
  456.15 +	* src/sparc/v8.S: Likewise.
  456.16 +	* src/sparc/v9.S: Likewise.
  456.17 +	* src/m68k/sysv.S: Likewise.
  456.18 +	* src/ia64/unix.S: Likewise.
  456.19 +	* src/arm/sysv.S: Likewise.
  456.20 +
  456.21 +	* ia64_save_regs_in_stack.s: Moved to...
  456.22 +	* ia64_save_regs_in_stack.S: ... this.  Add .note.GNU-stack
  456.23 +	on Linux.
  456.24 +
  456.25 +diff -durN gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S
  456.26 +--- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S	1970-01-01 01:00:00.000000000 +0100
  456.27 ++++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S	2008-06-10 14:58:21.000000000 +0200
  456.28 +@@ -0,0 +1,15 @@
  456.29 ++        .text
  456.30 ++        .align 16
  456.31 ++        .global GC_save_regs_in_stack
  456.32 ++        .proc GC_save_regs_in_stack
  456.33 ++GC_save_regs_in_stack:
  456.34 ++        .bodyfoo.mpg
  456.35 ++        flushrs
  456.36 ++        ;;
  456.37 ++        mov r8=ar.bsp
  456.38 ++        br.ret.sptk.few rp
  456.39 ++        .endp GC_save_regs_in_stack
  456.40 ++
  456.41 ++#ifdef __linux__
  456.42 ++	.section .note.GNU-stack,"",@progbits
  456.43 ++#endif
  456.44 +diff -durN gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s
  456.45 +--- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s	2001-10-15 06:57:59.000000000 +0200
  456.46 ++++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s	2008-06-10 14:58:21.000000000 +0200
  456.47 +@@ -1,12 +0,0 @@
  456.48 +-        .text
  456.49 +-        .align 16
  456.50 +-        .global GC_save_regs_in_stack
  456.51 +-        .proc GC_save_regs_in_stack
  456.52 +-GC_save_regs_in_stack:
  456.53 +-        .body
  456.54 +-        flushrs
  456.55 +-        ;;
  456.56 +-        mov r8=ar.bsp
  456.57 +-        br.ret.sptk.few rp
  456.58 +-        .endp GC_save_regs_in_stack
  456.59 +-
  456.60 +diff -durN gcc-4.3.1.orig/libffi/src/alpha/osf.S gcc-4.3.1/libffi/src/alpha/osf.S
  456.61 +--- gcc-4.3.1.orig/libffi/src/alpha/osf.S	2007-04-06 18:24:16.000000000 +0200
  456.62 ++++ gcc-4.3.1/libffi/src/alpha/osf.S	2008-06-10 14:58:21.000000000 +0200
  456.63 +@@ -358,4 +358,8 @@
  456.64 + 	.byte	16		# uleb128 offset 16*-8
  456.65 + 	.align 3
  456.66 + $LEFDE3:
  456.67 ++
  456.68 ++#ifdef __linux__
  456.69 ++	.section	.note.GNU-stack,"",@progbits
  456.70 ++#endif
  456.71 + #endif
  456.72 +diff -durN gcc-4.3.1.orig/libffi/src/arm/sysv.S gcc-4.3.1/libffi/src/arm/sysv.S
  456.73 +--- gcc-4.3.1.orig/libffi/src/arm/sysv.S	2007-09-04 19:52:45.000000000 +0200
  456.74 ++++ gcc-4.3.1/libffi/src/arm/sysv.S	2008-06-10 14:58:21.000000000 +0200
  456.75 +@@ -293,3 +293,6 @@
  456.76 + 	UNWIND .fnend
  456.77 +         .size    CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
  456.78 + 
  456.79 ++#if defined __ELF__ && defined __linux__
  456.80 ++	.section	.note.GNU-stack,"",%progbits
  456.81 ++#endif
  456.82 +diff -durN gcc-4.3.1.orig/libffi/src/ia64/unix.S gcc-4.3.1/libffi/src/ia64/unix.S
  456.83 +--- gcc-4.3.1.orig/libffi/src/ia64/unix.S	2005-03-30 23:49:19.000000000 +0200
  456.84 ++++ gcc-4.3.1/libffi/src/ia64/unix.S	2008-06-10 14:58:21.000000000 +0200
  456.85 +@@ -553,3 +553,7 @@
  456.86 + 	data8	@pcrel(.Lld_hfa_float)		// FFI_IA64_TYPE_HFA_FLOAT
  456.87 + 	data8	@pcrel(.Lld_hfa_double)		// FFI_IA64_TYPE_HFA_DOUBLE
  456.88 + 	data8	@pcrel(.Lld_hfa_ldouble)	// FFI_IA64_TYPE_HFA_LDOUBLE
  456.89 ++
  456.90 ++#if defined __ELF__ && defined __linux__
  456.91 ++	.section	.note.GNU-stack,"",@progbits
  456.92 ++#endif
  456.93 +diff -durN gcc-4.3.1.orig/libffi/src/m68k/sysv.S gcc-4.3.1/libffi/src/m68k/sysv.S
  456.94 +--- gcc-4.3.1.orig/libffi/src/m68k/sysv.S	2007-05-10 23:29:04.000000000 +0200
  456.95 ++++ gcc-4.3.1/libffi/src/m68k/sysv.S	2008-06-10 14:58:21.000000000 +0200
  456.96 +@@ -207,3 +207,7 @@
  456.97 + 	rts
  456.98 + 	CFI_ENDPROC()
  456.99 + 	.size	ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
 456.100 ++
 456.101 ++#if defined __ELF__ && defined __linux__
 456.102 ++	.section	.note.GNU-stack,"",@progbits
 456.103 ++#endif
 456.104 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64.S gcc-4.3.1/libffi/src/powerpc/linux64.S
 456.105 +--- gcc-4.3.1.orig/libffi/src/powerpc/linux64.S	2007-11-17 00:24:53.000000000 +0100
 456.106 ++++ gcc-4.3.1/libffi/src/powerpc/linux64.S	2008-06-10 14:58:21.000000000 +0200
 456.107 +@@ -179,3 +179,7 @@
 456.108 + 	.align 3
 456.109 + .LEFDE1:
 456.110 + #endif
 456.111 ++
 456.112 ++#if defined __ELF__ && defined __linux__
 456.113 ++	.section	.note.GNU-stack,"",@progbits
 456.114 ++#endif
 456.115 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.1/libffi/src/powerpc/linux64_closure.S
 456.116 +--- gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S	2005-08-11 23:18:24.000000000 +0200
 456.117 ++++ gcc-4.3.1/libffi/src/powerpc/linux64_closure.S	2008-06-10 14:58:21.000000000 +0200
 456.118 +@@ -204,3 +204,7 @@
 456.119 + 	.align 3
 456.120 + .LEFDE1:
 456.121 + #endif
 456.122 ++
 456.123 ++#if defined __ELF__ && defined __linux__
 456.124 ++	.section	.note.GNU-stack,"",@progbits
 456.125 ++#endif
 456.126 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.1/libffi/src/powerpc/ppc_closure.S
 456.127 +--- gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S	2007-12-01 22:00:04.000000000 +0100
 456.128 ++++ gcc-4.3.1/libffi/src/powerpc/ppc_closure.S	2008-06-10 14:58:21.000000000 +0200
 456.129 +@@ -295,3 +295,7 @@
 456.130 + .LEFDE1:
 456.131 + 
 456.132 + #endif
 456.133 ++
 456.134 ++#if defined __ELF__ && defined __linux__
 456.135 ++	.section	.note.GNU-stack,"",@progbits
 456.136 ++#endif
 456.137 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/sysv.S gcc-4.3.1/libffi/src/powerpc/sysv.S
 456.138 +--- gcc-4.3.1.orig/libffi/src/powerpc/sysv.S	2007-12-01 22:00:04.000000000 +0100
 456.139 ++++ gcc-4.3.1/libffi/src/powerpc/sysv.S	2008-06-10 14:58:21.000000000 +0200
 456.140 +@@ -223,3 +223,7 @@
 456.141 +       .align 2
 456.142 + .LEFDE1:
 456.143 + #endif
 456.144 ++
 456.145 ++#if defined __ELF__ && defined __linux__
 456.146 ++	.section	.note.GNU-stack,"",@progbits
 456.147 ++#endif
 456.148 +diff -durN gcc-4.3.1.orig/libffi/src/s390/sysv.S gcc-4.3.1/libffi/src/s390/sysv.S
 456.149 +--- gcc-4.3.1.orig/libffi/src/s390/sysv.S	2003-10-21 21:01:58.000000000 +0200
 456.150 ++++ gcc-4.3.1/libffi/src/s390/sysv.S	2008-06-10 14:58:21.000000000 +0200
 456.151 +@@ -427,3 +427,6 @@
 456.152 + 
 456.153 + #endif
 456.154 + 
 456.155 ++#if defined __ELF__ && defined __linux__
 456.156 ++	.section	.note.GNU-stack,"",@progbits
 456.157 ++#endif
 456.158 +diff -durN gcc-4.3.1.orig/libffi/src/sparc/v8.S gcc-4.3.1/libffi/src/sparc/v8.S
 456.159 +--- gcc-4.3.1.orig/libffi/src/sparc/v8.S	2004-11-22 19:35:16.000000000 +0100
 456.160 ++++ gcc-4.3.1/libffi/src/sparc/v8.S	2008-06-10 14:58:21.000000000 +0200
 456.161 +@@ -265,3 +265,7 @@
 456.162 + 	.byte	0x1f	! uleb128 0x1f
 456.163 + 	.align	WS
 456.164 + .LLEFDE2:
 456.165 ++
 456.166 ++#if defined __ELF__ && defined __linux__
 456.167 ++	.section	.note.GNU-stack,"",@progbits
 456.168 ++#endif
 456.169 +diff -durN gcc-4.3.1.orig/libffi/src/sparc/v9.S gcc-4.3.1/libffi/src/sparc/v9.S
 456.170 +--- gcc-4.3.1.orig/libffi/src/sparc/v9.S	2004-01-25 07:58:33.000000000 +0100
 456.171 ++++ gcc-4.3.1/libffi/src/sparc/v9.S	2008-06-10 14:58:21.000000000 +0200
 456.172 +@@ -300,3 +300,7 @@
 456.173 + 	.align 8
 456.174 + .LLEFDE2:
 456.175 + #endif
 456.176 ++
 456.177 ++#ifdef __linux__
 456.178 ++	.section	.note.GNU-stack,"",@progbits
 456.179 ++#endif
 456.180 +diff -durN gcc-4.3.1.orig/libffi/src/x86/sysv.S gcc-4.3.1/libffi/src/x86/sysv.S
 456.181 +--- gcc-4.3.1.orig/libffi/src/x86/sysv.S	2008-01-30 15:36:58.000000000 +0100
 456.182 ++++ gcc-4.3.1/libffi/src/x86/sysv.S	2008-06-10 14:58:21.000000000 +0200
 456.183 +@@ -430,3 +430,7 @@
 456.184 + #endif
 456.185 + 
 456.186 + #endif /* ifndef __x86_64__ */
 456.187 ++
 456.188 ++#if defined __ELF__ && defined __linux__
 456.189 ++	.section	.note.GNU-stack,"",@progbits
 456.190 ++#endif
 456.191 +diff -durN gcc-4.3.1.orig/libffi/src/x86/unix64.S gcc-4.3.1/libffi/src/x86/unix64.S
 456.192 +--- gcc-4.3.1.orig/libffi/src/x86/unix64.S	2005-05-05 06:06:38.000000000 +0200
 456.193 ++++ gcc-4.3.1/libffi/src/x86/unix64.S	2008-06-10 14:58:21.000000000 +0200
 456.194 +@@ -410,3 +410,7 @@
 456.195 + .LEFDE3:
 456.196 + 
 456.197 + #endif /* __x86_64__ */
 456.198 ++
 456.199 ++#if defined __ELF__ && defined __linux__
 456.200 ++	.section	.note.GNU-stack,"",@progbits
 456.201 ++#endif
   457.1 --- a/patches/gcc/4.3.1/225-sparc64-bsd.patch	Mon Jul 28 21:08:01 2008 +0000
   457.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   457.3 @@ -1,30 +0,0 @@
   457.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/14_all_gcc-sparc64-bsd.patch
   457.5 -diff -durN gcc-4.3.1.orig/gcc/config/sparc/freebsd.h gcc-4.3.1/gcc/config/sparc/freebsd.h
   457.6 ---- gcc-4.3.1.orig/gcc/config/sparc/freebsd.h	2007-08-02 12:49:31.000000000 +0200
   457.7 -+++ gcc-4.3.1/gcc/config/sparc/freebsd.h	2008-06-10 14:57:54.000000000 +0200
   457.8 -@@ -25,9 +25,22 @@
   457.9 - /* FreeBSD needs the platform name (sparc64) defined.
  457.10 -    Emacs needs to know if the arch is 64 or 32-bits.  */
  457.11 - 
  457.12 --#undef  CPP_CPU64_DEFAULT_SPEC
  457.13 --#define CPP_CPU64_DEFAULT_SPEC \
  457.14 --  "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
  457.15 -+#undef  FBSD_TARGET_CPU_CPP_BUILTINS
  457.16 -+#define FBSD_TARGET_CPU_CPP_BUILTINS()                  \
  457.17 -+  do                                                    \
  457.18 -+    {                                                   \
  457.19 -+      if (TARGET_ARCH64)                                \
  457.20 -+        {                                               \
  457.21 -+          builtin_define ("__sparc64__");               \
  457.22 -+          builtin_define ("__sparc_v9__");              \
  457.23 -+          builtin_define ("__sparcv9");                 \
  457.24 -+        }                                               \
  457.25 -+      else                                              \
  457.26 -+        builtin_define ("__sparc");                     \
  457.27 -+      builtin_define ("__sparc__");                     \
  457.28 -+    }                                                   \
  457.29 -+  while (0)
  457.30 -+
  457.31 - 
  457.32 - #define LINK_SPEC "%(link_arch)						\
  457.33 -   %{!mno-relax:%{!r:-relax}}						\
   458.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   458.2 +++ b/patches/gcc/4.3.1/230-pr34571.patch	Mon Jul 28 21:32:33 2008 +0000
   458.3 @@ -0,0 +1,35 @@
   458.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/64_all_gcc43-pr34571.patch
   458.5 +http://gcc.gnu.org/PR34571
   458.6 +
   458.7 +2007-12-26  Rask Ingemann Lambertsen  <rask@sygehus.dk>
   458.8 +
   458.9 +	PR target/34571
  458.10 +	* config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
  458.11 +	symbolic_operand.
  458.12 +	* varasm.c (output_constant_pool_1): Fix typo.
  458.13 +
  458.14 +diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.c gcc-4.3.1/gcc/config/alpha/alpha.c
  458.15 +--- gcc-4.3.1.orig/gcc/config/alpha/alpha.c	2008-02-07 18:45:24.000000000 +0100
  458.16 ++++ gcc-4.3.1/gcc/config/alpha/alpha.c	2008-06-10 14:58:24.000000000 +0200
  458.17 +@@ -1113,8 +1113,7 @@
  458.18 + static bool
  458.19 + alpha_cannot_force_const_mem (rtx x)
  458.20 + {
  458.21 +-  enum rtx_code code = GET_CODE (x);
  458.22 +-  return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
  458.23 ++  return symbolic_operand (x, GET_MODE (x));
  458.24 + }
  458.25 + 
  458.26 + /* We do not allow indirect calls to be optimized into sibling calls, nor
  458.27 +diff -durN gcc-4.3.1.orig/gcc/varasm.c gcc-4.3.1/gcc/varasm.c
  458.28 +--- gcc-4.3.1.orig/gcc/varasm.c	2007-12-05 22:55:10.000000000 +0100
  458.29 ++++ gcc-4.3.1/gcc/varasm.c	2008-06-10 14:58:24.000000000 +0200
  458.30 +@@ -3710,7 +3710,7 @@
  458.31 +       /* FALLTHRU  */
  458.32 + 
  458.33 +     case LABEL_REF:
  458.34 +-      tmp = XEXP (x, 0);
  458.35 ++      tmp = XEXP (tmp, 0);
  458.36 +       gcc_assert (!INSN_DELETED_P (tmp));
  458.37 +       gcc_assert (!NOTE_P (tmp)
  458.38 + 		  || NOTE_KIND (tmp) != NOTE_INSN_DELETED);
   459.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   459.2 +++ b/patches/gcc/4.3.1/240-pr25343.patch	Mon Jul 28 21:32:33 2008 +0000
   459.3 @@ -0,0 +1,21 @@
   459.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/66_all_gcc43-pr25343.patch
   459.5 +http://gcc.gnu.org/PR25343
   459.6 +
   459.7 +sniped from Debian
   459.8 +
   459.9 +2008-04-27  Roman Zippel <zippel@linux-m68k.org>
  459.10 +
  459.11 +	* config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
  459.12 +
  459.13 +diff -durN gcc-4.3.1.orig/gcc/config/host-linux.c gcc-4.3.1/gcc/config/host-linux.c
  459.14 +--- gcc-4.3.1.orig/gcc/config/host-linux.c	2007-08-02 12:49:31.000000000 +0200
  459.15 ++++ gcc-4.3.1/gcc/config/host-linux.c	2008-06-10 14:58:28.000000000 +0200
  459.16 +@@ -84,6 +84,8 @@
  459.17 + # define TRY_EMPTY_VM_SPACE	0x8000000000
  459.18 + #elif defined(__sparc__)
  459.19 + # define TRY_EMPTY_VM_SPACE	0x60000000
  459.20 ++#elif defined(__mc68000__)
  459.21 ++# define TRY_EMPTY_VM_SPACE	0x40000000
  459.22 + #else
  459.23 + # define TRY_EMPTY_VM_SPACE	0
  459.24 + #endif
   460.1 --- a/patches/gcc/4.3.1/250-flatten-switch-stmt-00.patch	Mon Jul 28 21:08:01 2008 +0000
   460.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   460.3 @@ -1,76 +0,0 @@
   460.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/18_all_904-flatten-switch-stmt-00.patch
   460.5 -http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
   460.6 -
   460.7 -Hi,
   460.8 -
   460.9 -The attached patch makes sure that we create smaller object code for
  460.10 -simple switch statements. We just make sure to flatten the switch
  460.11 -statement into an if-else chain, basically.
  460.12 -
  460.13 -This fixes a size-regression as compared to gcc-3.4, as can be seen
  460.14 -below.
  460.15 -
  460.16 -2007-04-15  Bernhard Fischer  <..>
  460.17 -
  460.18 -	* stmt.c (expand_case): Do not create a complex binary tree when
  460.19 -	optimizing for size but rather use the simple ordered list.
  460.20 -	(emit_case_nodes): do not emit jumps to the default_label when
  460.21 -	optimizing for size.
  460.22 -
  460.23 -Not regtested so far.
  460.24 -Comments?
  460.25 -
  460.26 -Attached is the test switch.c mentioned below.
  460.27 -
  460.28 -$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  460.29 -gcc-$i  -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
  460.30 -$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
  460.31 -gcc-$i  -UCHAIN -Os -o switch-$i.o -c switch.c ;done
  460.32 -
  460.33 -$ size switch-*.o
  460.34 -   text	   data	    bss	    dec	    hex	filename
  460.35 -    169	      0	      0	    169	     a9	switch-2.95.o
  460.36 -    115	      0	      0	    115	     73	switch-3.3.o
  460.37 -    103	      0	      0	    103	     67	switch-3.4.o
  460.38 -    124	      0	      0	    124	     7c	switch-4.0.o
  460.39 -    124	      0	      0	    124	     7c	switch-4.1.o
  460.40 -    124	      0	      0	    124	     7c	switch-4.2.orig-HEAD.o
  460.41 -     95	      0	      0	     95	     5f	switch-4.3-HEAD.o
  460.42 -    124	      0	      0	    124	     7c	switch-4.3.orig-HEAD.o
  460.43 -    166	      0	      0	    166	     a6	switch-CHAIN-2.95.o
  460.44 -    111	      0	      0	    111	     6f	switch-CHAIN-3.3.o
  460.45 -     95	      0	      0	     95	     5f	switch-CHAIN-3.4.o
  460.46 -     95	      0	      0	     95	     5f	switch-CHAIN-4.0.o
  460.47 -     95	      0	      0	     95	     5f	switch-CHAIN-4.1.o
  460.48 -     95	      0	      0	     95	     5f	switch-CHAIN-4.2.orig-HEAD.o
  460.49 -     95	      0	      0	     95	     5f	switch-CHAIN-4.3-HEAD.o
  460.50 -     95	      0	      0	     95	     5f	switch-CHAIN-4.3.orig-HEAD.o
  460.51 -
  460.52 -
  460.53 -Content-Type: text/x-diff; charset=us-ascii
  460.54 -Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
  460.55 -
  460.56 -diff -durN gcc-4.3.1.orig/gcc/stmt.c gcc-4.3.1/gcc/stmt.c
  460.57 ---- gcc-4.3.1.orig/gcc/stmt.c	2008-05-09 20:12:13.000000000 +0200
  460.58 -+++ gcc-4.3.1/gcc/stmt.c	2008-06-10 14:57:58.000000000 +0200
  460.59 -@@ -2509,7 +2509,11 @@
  460.60 - 	  use_cost_table
  460.61 - 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  460.62 - 	       && estimate_case_costs (case_list));
  460.63 --	  balance_case_nodes (&case_list, NULL);
  460.64 -+	  /* When optimizing for size, we want a straight list to avoid
  460.65 -+	     jumps as much as possible. This basically creates an if-else
  460.66 -+	     chain.  */
  460.67 -+	  if (!optimize_size)
  460.68 -+	    balance_case_nodes (&case_list, NULL);
  460.69 - 	  emit_case_nodes (index, case_list, default_label, index_type);
  460.70 - 	  emit_jump (default_label);
  460.71 - 	}
  460.72 -@@ -3067,6 +3071,7 @@
  460.73 - 	    {
  460.74 - 	      if (!node_has_low_bound (node, index_type))
  460.75 - 		{
  460.76 -+		  if (!optimize_size) /* don't jl to the .default_label. */
  460.77 - 		  emit_cmp_and_jump_insns (index,
  460.78 - 					   convert_modes
  460.79 - 					   (mode, imode,
   461.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   461.2 +++ b/patches/gcc/4.3.1/250-sh-pr24836.patch	Mon Jul 28 21:32:33 2008 +0000
   461.3 @@ -0,0 +1,28 @@
   461.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/74_all_sh-pr24836.patch
   461.5 +http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
   461.6 +http://gcc.gnu.org/PR24836
   461.7 +
   461.8 +diff -durN gcc-4.3.1.orig/gcc/configure gcc-4.3.1/gcc/configure
   461.9 +--- gcc-4.3.1.orig/gcc/configure	2008-06-10 14:57:48.000000000 +0200
  461.10 ++++ gcc-4.3.1/gcc/configure	2008-06-10 14:58:32.000000000 +0200
  461.11 +@@ -14709,7 +14709,7 @@
  461.12 + 	tls_first_minor=14
  461.13 + 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  461.14 + 	;;
  461.15 +-  sh-*-* | sh[34]-*-*)
  461.16 ++  sh-*-* | sh[34]*-*-*)
  461.17 +     conftest_s='
  461.18 + 	.section ".tdata","awT",@progbits
  461.19 + foo:	.long	25
  461.20 +diff -durN gcc-4.3.1.orig/gcc/configure.ac gcc-4.3.1/gcc/configure.ac
  461.21 +--- gcc-4.3.1.orig/gcc/configure.ac	2008-06-10 14:57:48.000000000 +0200
  461.22 ++++ gcc-4.3.1/gcc/configure.ac	2008-06-10 14:58:32.000000000 +0200
  461.23 +@@ -2537,7 +2537,7 @@
  461.24 + 	tls_first_minor=14
  461.25 + 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  461.26 + 	;;
  461.27 +-  sh-*-* | sh[34]-*-*)
  461.28 ++  sh-*-* | sh[34]*-*-*)
  461.29 +     conftest_s='
  461.30 + 	.section ".tdata","awT",@progbits
  461.31 + foo:	.long	25
   462.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   462.2 +++ b/patches/gcc/4.3.1/260-uclibc-conf-noupstream.patch	Mon Jul 28 21:32:33 2008 +0000
   462.3 @@ -0,0 +1,13 @@
   462.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_103-uclibc-conf-noupstream.patch
   462.5 +diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc
   462.6 +--- gcc-4.3.1.orig/gcc/config.gcc	2008-06-10 14:58:09.000000000 +0200
   462.7 ++++ gcc-4.3.1/gcc/config.gcc	2008-06-10 14:58:36.000000000 +0200
   462.8 +@@ -2149,7 +2149,7 @@
   462.9 +         ;;
  462.10 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  462.11 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  462.12 +-  sh-*-linux* | sh[346lbe]*-*-linux* | \
  462.13 ++  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  462.14 +   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  462.15 +    sh64-*-netbsd* | sh64l*-*-netbsd*)
  462.16 + 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   463.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   463.2 +++ b/patches/gcc/4.3.1/270-uclibc-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   463.3 @@ -0,0 +1,2794 @@
   463.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_200-uclibc-locale.patch
   463.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 gcc-4.3.1/libstdc++-v3/acinclude.m4
   463.6 +--- gcc-4.3.1.orig/libstdc++-v3/acinclude.m4	2008-04-25 18:52:57.000000000 +0200
   463.7 ++++ gcc-4.3.1/libstdc++-v3/acinclude.m4	2008-06-10 14:58:39.000000000 +0200
   463.8 +@@ -1349,7 +1349,7 @@
   463.9 + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
  463.10 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  463.11 +     [use MODEL for target locale package],
  463.12 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  463.13 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  463.14 + 
  463.15 +   # Deal with gettext issues.  Default to not using it (=no) until we detect
  463.16 +   # support for it later.  Let the user turn it off via --e/d, but let that
  463.17 +@@ -1370,6 +1370,9 @@
  463.18 +   # Default to "generic".
  463.19 +   if test $enable_clocale_flag = auto; then
  463.20 +     case ${target_os} in
  463.21 ++      *-uclibc*)
  463.22 ++        enable_clocale_flag=uclibc
  463.23 ++        ;;
  463.24 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  463.25 +         enable_clocale_flag=gnu	
  463.26 +         ;;
  463.27 +@@ -1541,6 +1544,40 @@
  463.28 +       CTIME_CC=config/locale/generic/time_members.cc
  463.29 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  463.30 +       ;;
  463.31 ++    uclibc)
  463.32 ++      AC_MSG_RESULT(uclibc)
  463.33 ++
  463.34 ++      # Declare intention to use gettext, and add support for specific
  463.35 ++      # languages.
  463.36 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  463.37 ++      ALL_LINGUAS="de fr"
  463.38 ++
  463.39 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  463.40 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  463.41 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  463.42 ++        USE_NLS=yes
  463.43 ++      fi
  463.44 ++      # Export the build objects.
  463.45 ++      for ling in $ALL_LINGUAS; do \
  463.46 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  463.47 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  463.48 ++      done
  463.49 ++      AC_SUBST(glibcxx_MOFILES)
  463.50 ++      AC_SUBST(glibcxx_POFILES)
  463.51 ++
  463.52 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  463.53 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  463.54 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  463.55 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  463.56 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  463.57 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  463.58 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  463.59 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  463.60 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  463.61 ++      CTIME_H=config/locale/uclibc/time_members.h
  463.62 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  463.63 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  463.64 ++      ;;
  463.65 +   esac
  463.66 + 
  463.67 +   # This is where the testsuite looks for locale catalogs, using the
  463.68 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  463.69 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
  463.70 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:39.000000000 +0200
  463.71 +@@ -0,0 +1,63 @@
  463.72 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  463.73 ++
  463.74 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  463.75 ++//
  463.76 ++// This file is part of the GNU ISO C++ Library.  This library is free
  463.77 ++// software; you can redistribute it and/or modify it under the
  463.78 ++// terms of the GNU General Public License as published by the
  463.79 ++// Free Software Foundation; either version 2, or (at your option)
  463.80 ++// any later version.
  463.81 ++
  463.82 ++// This library is distributed in the hope that it will be useful,
  463.83 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  463.84 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  463.85 ++// GNU General Public License for more details.
  463.86 ++
  463.87 ++// You should have received a copy of the GNU General Public License along
  463.88 ++// with this library; see the file COPYING.  If not, write to the Free
  463.89 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  463.90 ++// USA.
  463.91 ++
  463.92 ++// As a special exception, you may use this file as part of a free software
  463.93 ++// library without restriction.  Specifically, if other files instantiate
  463.94 ++// templates or use macros or inline functions from this file, or you compile
  463.95 ++// this file and link it with other files to produce an executable, this
  463.96 ++// file does not by itself cause the resulting executable to be covered by
  463.97 ++// the GNU General Public License.  This exception does not however
  463.98 ++// invalidate any other reasons why the executable file might be covered by
  463.99 ++// the GNU General Public License.
 463.100 ++
 463.101 ++// Written by Jakub Jelinek <jakub@redhat.com>
 463.102 ++
 463.103 ++#include <bits/c++config.h>
 463.104 ++#include <clocale>
 463.105 ++
 463.106 ++#ifdef __UCLIBC_MJN3_ONLY__
 463.107 ++#warning clean this up
 463.108 ++#endif
 463.109 ++
 463.110 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.111 ++                                                  
 463.112 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 463.113 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 463.114 ++extern "C" __typeof(strftime_l) __strftime_l;
 463.115 ++extern "C" __typeof(strtod_l) __strtod_l;
 463.116 ++extern "C" __typeof(strtof_l) __strtof_l;
 463.117 ++extern "C" __typeof(strtold_l) __strtold_l;
 463.118 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 463.119 ++extern "C" __typeof(newlocale) __newlocale;
 463.120 ++extern "C" __typeof(freelocale) __freelocale;
 463.121 ++extern "C" __typeof(duplocale) __duplocale;
 463.122 ++extern "C" __typeof(uselocale) __uselocale;
 463.123 ++
 463.124 ++#ifdef _GLIBCXX_USE_WCHAR_T
 463.125 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 463.126 ++extern "C" __typeof(towlower_l) __towlower_l;
 463.127 ++extern "C" __typeof(towupper_l) __towupper_l;
 463.128 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 463.129 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 463.130 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 463.131 ++extern "C" __typeof(wctype_l) __wctype_l;
 463.132 ++#endif 
 463.133 ++
 463.134 ++#endif // GLIBC 2.3 and later
 463.135 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
 463.136 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
 463.137 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:39.000000000 +0200
 463.138 +@@ -0,0 +1,160 @@
 463.139 ++// Wrapper for underlying C-language localization -*- C++ -*-
 463.140 ++
 463.141 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 463.142 ++//
 463.143 ++// This file is part of the GNU ISO C++ Library.  This library is free
 463.144 ++// software; you can redistribute it and/or modify it under the
 463.145 ++// terms of the GNU General Public License as published by the
 463.146 ++// Free Software Foundation; either version 2, or (at your option)
 463.147 ++// any later version.
 463.148 ++
 463.149 ++// This library is distributed in the hope that it will be useful,
 463.150 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 463.151 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 463.152 ++// GNU General Public License for more details.
 463.153 ++
 463.154 ++// You should have received a copy of the GNU General Public License along
 463.155 ++// with this library; see the file COPYING.  If not, write to the Free
 463.156 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 463.157 ++// USA.
 463.158 ++
 463.159 ++// As a special exception, you may use this file as part of a free software
 463.160 ++// library without restriction.  Specifically, if other files instantiate
 463.161 ++// templates or use macros or inline functions from this file, or you compile
 463.162 ++// this file and link it with other files to produce an executable, this
 463.163 ++// file does not by itself cause the resulting executable to be covered by
 463.164 ++// the GNU General Public License.  This exception does not however
 463.165 ++// invalidate any other reasons why the executable file might be covered by
 463.166 ++// the GNU General Public License.
 463.167 ++
 463.168 ++//
 463.169 ++// ISO C++ 14882: 22.8  Standard locale categories.
 463.170 ++//
 463.171 ++
 463.172 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 463.173 ++
 463.174 ++#include <cerrno>  // For errno
 463.175 ++#include <locale>
 463.176 ++#include <stdexcept>
 463.177 ++#include <langinfo.h>
 463.178 ++#include <bits/c++locale_internal.h>
 463.179 ++
 463.180 ++#ifndef __UCLIBC_HAS_XLOCALE__
 463.181 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 463.182 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 463.183 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 463.184 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 463.185 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 463.186 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 463.187 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 463.188 ++#warning should dummy __newlocale check for C|POSIX ?
 463.189 ++#define __newlocale(a, b, c)        NULL
 463.190 ++#define __freelocale(a)             ((void)0)
 463.191 ++#define __duplocale(a)              __c_locale()
 463.192 ++#endif
 463.193 ++
 463.194 ++namespace std 
 463.195 ++{
 463.196 ++  template<>
 463.197 ++    void
 463.198 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 463.199 ++		   const __c_locale& __cloc)
 463.200 ++    {
 463.201 ++      if (!(__err & ios_base::failbit))
 463.202 ++	{
 463.203 ++	  char* __sanity;
 463.204 ++	  errno = 0;
 463.205 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
 463.206 ++          if (__sanity != __s && errno != ERANGE)
 463.207 ++	    __v = __f;
 463.208 ++	  else
 463.209 ++	    __err |= ios_base::failbit;
 463.210 ++	}
 463.211 ++    }
 463.212 ++
 463.213 ++  template<>
 463.214 ++    void
 463.215 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 463.216 ++		   const __c_locale& __cloc)
 463.217 ++    {
 463.218 ++      if (!(__err & ios_base::failbit))
 463.219 ++	{
 463.220 ++	  char* __sanity;
 463.221 ++	  errno = 0;
 463.222 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
 463.223 ++          if (__sanity != __s && errno != ERANGE)
 463.224 ++	    __v = __d;
 463.225 ++	  else
 463.226 ++	    __err |= ios_base::failbit;
 463.227 ++	}
 463.228 ++    }
 463.229 ++
 463.230 ++  template<>
 463.231 ++    void
 463.232 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 463.233 ++		   const __c_locale& __cloc)
 463.234 ++    {
 463.235 ++      if (!(__err & ios_base::failbit))
 463.236 ++	{
 463.237 ++	  char* __sanity;
 463.238 ++	  errno = 0;
 463.239 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 463.240 ++          if (__sanity != __s && errno != ERANGE)
 463.241 ++	    __v = __ld;
 463.242 ++	  else
 463.243 ++	    __err |= ios_base::failbit;
 463.244 ++	}
 463.245 ++    }
 463.246 ++
 463.247 ++  void
 463.248 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 463.249 ++				    __c_locale __old)
 463.250 ++  {
 463.251 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 463.252 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.253 ++    if (!__cloc)
 463.254 ++      {
 463.255 ++	// This named locale is not supported by the underlying OS.
 463.256 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 463.257 ++			      "name not valid"));
 463.258 ++      }
 463.259 ++#endif
 463.260 ++  }
 463.261 ++  
 463.262 ++  void
 463.263 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 463.264 ++  {
 463.265 ++    if (_S_get_c_locale() != __cloc)
 463.266 ++      __freelocale(__cloc); 
 463.267 ++  }
 463.268 ++
 463.269 ++  __c_locale
 463.270 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 463.271 ++  { return __duplocale(__cloc); }
 463.272 ++} // namespace std
 463.273 ++
 463.274 ++namespace __gnu_cxx
 463.275 ++{
 463.276 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 463.277 ++    {
 463.278 ++      "LC_CTYPE", 
 463.279 ++      "LC_NUMERIC",
 463.280 ++      "LC_TIME", 
 463.281 ++      "LC_COLLATE", 
 463.282 ++      "LC_MONETARY",
 463.283 ++      "LC_MESSAGES", 
 463.284 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 463.285 ++      "LC_PAPER", 
 463.286 ++      "LC_NAME", 
 463.287 ++      "LC_ADDRESS",
 463.288 ++      "LC_TELEPHONE", 
 463.289 ++      "LC_MEASUREMENT", 
 463.290 ++      "LC_IDENTIFICATION" 
 463.291 ++#endif
 463.292 ++    };
 463.293 ++}
 463.294 ++
 463.295 ++namespace std
 463.296 ++{
 463.297 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 463.298 ++}  // namespace std
 463.299 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
 463.300 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 463.301 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:39.000000000 +0200
 463.302 +@@ -0,0 +1,117 @@
 463.303 ++// Wrapper for underlying C-language localization -*- C++ -*-
 463.304 ++
 463.305 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 463.306 ++//
 463.307 ++// This file is part of the GNU ISO C++ Library.  This library is free
 463.308 ++// software; you can redistribute it and/or modify it under the
 463.309 ++// terms of the GNU General Public License as published by the
 463.310 ++// Free Software Foundation; either version 2, or (at your option)
 463.311 ++// any later version.
 463.312 ++
 463.313 ++// This library is distributed in the hope that it will be useful,
 463.314 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 463.315 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 463.316 ++// GNU General Public License for more details.
 463.317 ++
 463.318 ++// You should have received a copy of the GNU General Public License along
 463.319 ++// with this library; see the file COPYING.  If not, write to the Free
 463.320 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 463.321 ++// USA.
 463.322 ++
 463.323 ++// As a special exception, you may use this file as part of a free software
 463.324 ++// library without restriction.  Specifically, if other files instantiate
 463.325 ++// templates or use macros or inline functions from this file, or you compile
 463.326 ++// this file and link it with other files to produce an executable, this
 463.327 ++// file does not by itself cause the resulting executable to be covered by
 463.328 ++// the GNU General Public License.  This exception does not however
 463.329 ++// invalidate any other reasons why the executable file might be covered by
 463.330 ++// the GNU General Public License.
 463.331 ++
 463.332 ++//
 463.333 ++// ISO C++ 14882: 22.8  Standard locale categories.
 463.334 ++//
 463.335 ++
 463.336 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 463.337 ++
 463.338 ++#ifndef _C_LOCALE_H
 463.339 ++#define _C_LOCALE_H 1
 463.340 ++
 463.341 ++#pragma GCC system_header
 463.342 ++
 463.343 ++#include <cstring>              // get std::strlen
 463.344 ++#include <cstdio>               // get std::snprintf or std::sprintf
 463.345 ++#include <clocale>
 463.346 ++#include <langinfo.h>		// For codecvt
 463.347 ++#ifdef __UCLIBC_MJN3_ONLY__
 463.348 ++#warning fix this
 463.349 ++#endif
 463.350 ++#ifdef __UCLIBC_HAS_LOCALE__
 463.351 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 463.352 ++#endif
 463.353 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 463.354 ++#include <libintl.h> 		// For messages
 463.355 ++#endif
 463.356 ++
 463.357 ++#ifdef __UCLIBC_MJN3_ONLY__
 463.358 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 463.359 ++#endif
 463.360 ++#define _GLIBCXX_C_LOCALE_GNU 1
 463.361 ++
 463.362 ++#ifdef __UCLIBC_MJN3_ONLY__
 463.363 ++#warning fix categories
 463.364 ++#endif
 463.365 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 463.366 ++#define _GLIBCXX_NUM_CATEGORIES 0
 463.367 ++ 
 463.368 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.369 ++namespace __gnu_cxx
 463.370 ++{
 463.371 ++  extern "C" __typeof(uselocale) __uselocale;
 463.372 ++}
 463.373 ++#endif
 463.374 ++
 463.375 ++namespace std
 463.376 ++{
 463.377 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.378 ++  typedef __locale_t		__c_locale;
 463.379 ++#else
 463.380 ++  typedef int*			__c_locale;
 463.381 ++#endif
 463.382 ++
 463.383 ++  // Convert numeric value of type _Tv to string and return length of
 463.384 ++  // string.  If snprintf is available use it, otherwise fall back to
 463.385 ++  // the unsafe sprintf which, in general, can be dangerous and should
 463.386 ++  // be avoided.
 463.387 ++  template<typename _Tv>
 463.388 ++    int
 463.389 ++    __convert_from_v(char* __out, 
 463.390 ++		     const int __size __attribute__ ((__unused__)),
 463.391 ++		     const char* __fmt,
 463.392 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 463.393 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 463.394 ++    {
 463.395 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 463.396 ++#else
 463.397 ++		     _Tv __v, const __c_locale&, int __prec)
 463.398 ++    {
 463.399 ++# ifdef __UCLIBC_HAS_LOCALE__
 463.400 ++      char* __old = std::setlocale(LC_ALL, NULL);
 463.401 ++      char* __sav = new char[std::strlen(__old) + 1];
 463.402 ++      std::strcpy(__sav, __old);
 463.403 ++      std::setlocale(LC_ALL, "C");
 463.404 ++# endif
 463.405 ++#endif
 463.406 ++
 463.407 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 463.408 ++
 463.409 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 463.410 ++      __gnu_cxx::__uselocale(__old);
 463.411 ++#elif defined __UCLIBC_HAS_LOCALE__
 463.412 ++      std::setlocale(LC_ALL, __sav);
 463.413 ++      delete [] __sav;
 463.414 ++#endif
 463.415 ++      return __ret;
 463.416 ++    }
 463.417 ++}
 463.418 ++
 463.419 ++#endif
 463.420 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 463.421 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 463.422 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2008-06-10 14:58:39.000000000 +0200
 463.423 +@@ -0,0 +1,306 @@
 463.424 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 463.425 ++
 463.426 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 463.427 ++//
 463.428 ++// This file is part of the GNU ISO C++ Library.  This library is free
 463.429 ++// software; you can redistribute it and/or modify it under the
 463.430 ++// terms of the GNU General Public License as published by the
 463.431 ++// Free Software Foundation; either version 2, or (at your option)
 463.432 ++// any later version.
 463.433 ++
 463.434 ++// This library is distributed in the hope that it will be useful,
 463.435 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 463.436 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 463.437 ++// GNU General Public License for more details.
 463.438 ++
 463.439 ++// You should have received a copy of the GNU General Public License along
 463.440 ++// with this library; see the file COPYING.  If not, write to the Free
 463.441 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 463.442 ++// USA.
 463.443 ++
 463.444 ++// As a special exception, you may use this file as part of a free software
 463.445 ++// library without restriction.  Specifically, if other files instantiate
 463.446 ++// templates or use macros or inline functions from this file, or you compile
 463.447 ++// this file and link it with other files to produce an executable, this
 463.448 ++// file does not by itself cause the resulting executable to be covered by
 463.449 ++// the GNU General Public License.  This exception does not however
 463.450 ++// invalidate any other reasons why the executable file might be covered by
 463.451 ++// the GNU General Public License.
 463.452 ++
 463.453 ++//
 463.454 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 463.455 ++//
 463.456 ++
 463.457 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 463.458 ++
 463.459 ++#include <locale>
 463.460 ++#include <bits/c++locale_internal.h>
 463.461 ++
 463.462 ++namespace std
 463.463 ++{
 463.464 ++  // Specializations.
 463.465 ++#ifdef _GLIBCXX_USE_WCHAR_T
 463.466 ++  codecvt_base::result
 463.467 ++  codecvt<wchar_t, char, mbstate_t>::
 463.468 ++  do_out(state_type& __state, const intern_type* __from, 
 463.469 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 463.470 ++	 extern_type* __to, extern_type* __to_end,
 463.471 ++	 extern_type*& __to_next) const
 463.472 ++  {
 463.473 ++    result __ret = ok;
 463.474 ++    state_type __tmp_state(__state);
 463.475 ++
 463.476 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.477 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 463.478 ++#endif
 463.479 ++
 463.480 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 463.481 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 463.482 ++    // NB: wcsnrtombs is a GNU extension
 463.483 ++    for (__from_next = __from, __to_next = __to;
 463.484 ++	 __from_next < __from_end && __to_next < __to_end
 463.485 ++	 && __ret == ok;)
 463.486 ++      {
 463.487 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 463.488 ++						      __from_end - __from_next);
 463.489 ++	if (!__from_chunk_end)
 463.490 ++	  __from_chunk_end = __from_end;
 463.491 ++
 463.492 ++	__from = __from_next;
 463.493 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 463.494 ++					 __from_chunk_end - __from_next,
 463.495 ++					 __to_end - __to_next, &__state);
 463.496 ++	if (__conv == static_cast<size_t>(-1))
 463.497 ++	  {
 463.498 ++	    // In case of error, in order to stop at the exact place we
 463.499 ++	    // have to start again from the beginning with a series of
 463.500 ++	    // wcrtomb.
 463.501 ++	    for (; __from < __from_next; ++__from)
 463.502 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 463.503 ++	    __state = __tmp_state;
 463.504 ++	    __ret = error;
 463.505 ++	  }
 463.506 ++	else if (__from_next && __from_next < __from_chunk_end)
 463.507 ++	  {
 463.508 ++	    __to_next += __conv;
 463.509 ++	    __ret = partial;
 463.510 ++	  }
 463.511 ++	else
 463.512 ++	  {
 463.513 ++	    __from_next = __from_chunk_end;
 463.514 ++	    __to_next += __conv;
 463.515 ++	  }
 463.516 ++
 463.517 ++	if (__from_next < __from_end && __ret == ok)
 463.518 ++	  {
 463.519 ++	    extern_type __buf[MB_LEN_MAX];
 463.520 ++	    __tmp_state = __state;
 463.521 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 463.522 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 463.523 ++	      __ret = partial;
 463.524 ++	    else
 463.525 ++	      {
 463.526 ++		memcpy(__to_next, __buf, __conv);
 463.527 ++		__state = __tmp_state;
 463.528 ++		__to_next += __conv;
 463.529 ++		++__from_next;
 463.530 ++	      }
 463.531 ++	  }
 463.532 ++      }
 463.533 ++
 463.534 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.535 ++    __uselocale(__old);
 463.536 ++#endif
 463.537 ++
 463.538 ++    return __ret; 
 463.539 ++  }
 463.540 ++  
 463.541 ++  codecvt_base::result
 463.542 ++  codecvt<wchar_t, char, mbstate_t>::
 463.543 ++  do_in(state_type& __state, const extern_type* __from, 
 463.544 ++	const extern_type* __from_end, const extern_type*& __from_next,
 463.545 ++	intern_type* __to, intern_type* __to_end,
 463.546 ++	intern_type*& __to_next) const
 463.547 ++  {
 463.548 ++    result __ret = ok;
 463.549 ++    state_type __tmp_state(__state);
 463.550 ++
 463.551 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.552 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 463.553 ++#endif
 463.554 ++
 463.555 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 463.556 ++    // in case we store a L'\0' and then continue, in a loop.
 463.557 ++    // NB: mbsnrtowcs is a GNU extension
 463.558 ++    for (__from_next = __from, __to_next = __to;
 463.559 ++	 __from_next < __from_end && __to_next < __to_end
 463.560 ++	 && __ret == ok;)
 463.561 ++      {
 463.562 ++	const extern_type* __from_chunk_end;
 463.563 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 463.564 ++								  __from_end
 463.565 ++								  - __from_next));
 463.566 ++	if (!__from_chunk_end)
 463.567 ++	  __from_chunk_end = __from_end;
 463.568 ++
 463.569 ++	__from = __from_next;
 463.570 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 463.571 ++				   __from_chunk_end - __from_next,
 463.572 ++				   __to_end - __to_next, &__state);
 463.573 ++	if (__conv == static_cast<size_t>(-1))
 463.574 ++	  {
 463.575 ++	    // In case of error, in order to stop at the exact place we
 463.576 ++	    // have to start again from the beginning with a series of
 463.577 ++	    // mbrtowc.
 463.578 ++	    for (;; ++__to_next, __from += __conv)
 463.579 ++	      {
 463.580 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 463.581 ++				 &__tmp_state);
 463.582 ++		if (__conv == static_cast<size_t>(-1)
 463.583 ++		    || __conv == static_cast<size_t>(-2))
 463.584 ++		  break;
 463.585 ++	      }
 463.586 ++	    __from_next = __from;
 463.587 ++	    __state = __tmp_state;	    
 463.588 ++	    __ret = error;
 463.589 ++	  }
 463.590 ++	else if (__from_next && __from_next < __from_chunk_end)
 463.591 ++	  {
 463.592 ++	    // It is unclear what to return in this case (see DR 382). 
 463.593 ++	    __to_next += __conv;
 463.594 ++	    __ret = partial;
 463.595 ++	  }
 463.596 ++	else
 463.597 ++	  {
 463.598 ++	    __from_next = __from_chunk_end;
 463.599 ++	    __to_next += __conv;
 463.600 ++	  }
 463.601 ++
 463.602 ++	if (__from_next < __from_end && __ret == ok)
 463.603 ++	  {
 463.604 ++	    if (__to_next < __to_end)
 463.605 ++	      {
 463.606 ++		// XXX Probably wrong for stateful encodings
 463.607 ++		__tmp_state = __state;		
 463.608 ++		++__from_next;
 463.609 ++		*__to_next++ = L'\0';
 463.610 ++	      }
 463.611 ++	    else
 463.612 ++	      __ret = partial;
 463.613 ++	  }
 463.614 ++      }
 463.615 ++
 463.616 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.617 ++    __uselocale(__old);
 463.618 ++#endif
 463.619 ++
 463.620 ++    return __ret; 
 463.621 ++  }
 463.622 ++
 463.623 ++  int 
 463.624 ++  codecvt<wchar_t, char, mbstate_t>::
 463.625 ++  do_encoding() const throw()
 463.626 ++  {
 463.627 ++    // XXX This implementation assumes that the encoding is
 463.628 ++    // stateless and is either single-byte or variable-width.
 463.629 ++    int __ret = 0;
 463.630 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.631 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 463.632 ++#endif
 463.633 ++    if (MB_CUR_MAX == 1)
 463.634 ++      __ret = 1;
 463.635 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.636 ++    __uselocale(__old);
 463.637 ++#endif
 463.638 ++    return __ret;
 463.639 ++  }  
 463.640 ++
 463.641 ++  int 
 463.642 ++  codecvt<wchar_t, char, mbstate_t>::
 463.643 ++  do_max_length() const throw()
 463.644 ++  {
 463.645 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.646 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 463.647 ++#endif
 463.648 ++    // XXX Probably wrong for stateful encodings.
 463.649 ++    int __ret = MB_CUR_MAX;
 463.650 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.651 ++    __uselocale(__old);
 463.652 ++#endif
 463.653 ++    return __ret;
 463.654 ++  }
 463.655 ++  
 463.656 ++  int 
 463.657 ++  codecvt<wchar_t, char, mbstate_t>::
 463.658 ++  do_length(state_type& __state, const extern_type* __from,
 463.659 ++	    const extern_type* __end, size_t __max) const
 463.660 ++  {
 463.661 ++    int __ret = 0;
 463.662 ++    state_type __tmp_state(__state);
 463.663 ++
 463.664 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.665 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 463.666 ++#endif
 463.667 ++
 463.668 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 463.669 ++    // in case we advance past it and then continue, in a loop.
 463.670 ++    // NB: mbsnrtowcs is a GNU extension
 463.671 ++  
 463.672 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 463.673 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 463.674 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 463.675 ++							   * __max));
 463.676 ++    while (__from < __end && __max)
 463.677 ++      {
 463.678 ++	const extern_type* __from_chunk_end;
 463.679 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 463.680 ++								  __end
 463.681 ++								  - __from));
 463.682 ++	if (!__from_chunk_end)
 463.683 ++	  __from_chunk_end = __end;
 463.684 ++
 463.685 ++	const extern_type* __tmp_from = __from;
 463.686 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 463.687 ++				   __from_chunk_end - __from,
 463.688 ++				   __max, &__state);
 463.689 ++	if (__conv == static_cast<size_t>(-1))
 463.690 ++	  {
 463.691 ++	    // In case of error, in order to stop at the exact place we
 463.692 ++	    // have to start again from the beginning with a series of
 463.693 ++	    // mbrtowc.
 463.694 ++	    for (__from = __tmp_from;; __from += __conv)
 463.695 ++	      {
 463.696 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 463.697 ++				 &__tmp_state);
 463.698 ++		if (__conv == static_cast<size_t>(-1)
 463.699 ++		    || __conv == static_cast<size_t>(-2))
 463.700 ++		  break;
 463.701 ++	      }
 463.702 ++	    __state = __tmp_state;
 463.703 ++	    __ret += __from - __tmp_from;
 463.704 ++	    break;
 463.705 ++	  }
 463.706 ++	if (!__from)
 463.707 ++	  __from = __from_chunk_end;
 463.708 ++	
 463.709 ++	__ret += __from - __tmp_from;
 463.710 ++	__max -= __conv;
 463.711 ++
 463.712 ++	if (__from < __end && __max)
 463.713 ++	  {
 463.714 ++	    // XXX Probably wrong for stateful encodings
 463.715 ++	    __tmp_state = __state;
 463.716 ++	    ++__from;
 463.717 ++	    ++__ret;
 463.718 ++	    --__max;
 463.719 ++	  }
 463.720 ++      }
 463.721 ++
 463.722 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.723 ++    __uselocale(__old);
 463.724 ++#endif
 463.725 ++
 463.726 ++    return __ret; 
 463.727 ++  }
 463.728 ++#endif
 463.729 ++}
 463.730 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
 463.731 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 463.732 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:39.000000000 +0200
 463.733 +@@ -0,0 +1,80 @@
 463.734 ++// std::collate implementation details, GNU version -*- C++ -*-
 463.735 ++
 463.736 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 463.737 ++//
 463.738 ++// This file is part of the GNU ISO C++ Library.  This library is free
 463.739 ++// software; you can redistribute it and/or modify it under the
 463.740 ++// terms of the GNU General Public License as published by the
 463.741 ++// Free Software Foundation; either version 2, or (at your option)
 463.742 ++// any later version.
 463.743 ++
 463.744 ++// This library is distributed in the hope that it will be useful,
 463.745 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 463.746 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 463.747 ++// GNU General Public License for more details.
 463.748 ++
 463.749 ++// You should have received a copy of the GNU General Public License along
 463.750 ++// with this library; see the file COPYING.  If not, write to the Free
 463.751 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 463.752 ++// USA.
 463.753 ++
 463.754 ++// As a special exception, you may use this file as part of a free software
 463.755 ++// library without restriction.  Specifically, if other files instantiate
 463.756 ++// templates or use macros or inline functions from this file, or you compile
 463.757 ++// this file and link it with other files to produce an executable, this
 463.758 ++// file does not by itself cause the resulting executable to be covered by
 463.759 ++// the GNU General Public License.  This exception does not however
 463.760 ++// invalidate any other reasons why the executable file might be covered by
 463.761 ++// the GNU General Public License.
 463.762 ++
 463.763 ++//
 463.764 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 463.765 ++//
 463.766 ++
 463.767 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 463.768 ++
 463.769 ++#include <locale>
 463.770 ++#include <bits/c++locale_internal.h>
 463.771 ++
 463.772 ++#ifndef __UCLIBC_HAS_XLOCALE__
 463.773 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 463.774 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 463.775 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 463.776 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 463.777 ++#endif
 463.778 ++
 463.779 ++namespace std
 463.780 ++{
 463.781 ++  // These are basically extensions to char_traits, and perhaps should
 463.782 ++  // be put there instead of here.
 463.783 ++  template<>
 463.784 ++    int 
 463.785 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 463.786 ++    { 
 463.787 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 463.788 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 463.789 ++    }
 463.790 ++  
 463.791 ++  template<>
 463.792 ++    size_t
 463.793 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 463.794 ++				size_t __n) const 
 463.795 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 463.796 ++
 463.797 ++#ifdef _GLIBCXX_USE_WCHAR_T
 463.798 ++  template<>
 463.799 ++    int 
 463.800 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 463.801 ++				 const wchar_t* __two) const
 463.802 ++    {
 463.803 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 463.804 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 463.805 ++    }
 463.806 ++  
 463.807 ++  template<>
 463.808 ++    size_t
 463.809 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 463.810 ++				   size_t __n) const
 463.811 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 463.812 ++#endif
 463.813 ++}
 463.814 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 463.815 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 463.816 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:39.000000000 +0200
 463.817 +@@ -0,0 +1,300 @@
 463.818 ++// std::ctype implementation details, GNU version -*- C++ -*-
 463.819 ++
 463.820 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 463.821 ++//
 463.822 ++// This file is part of the GNU ISO C++ Library.  This library is free
 463.823 ++// software; you can redistribute it and/or modify it under the
 463.824 ++// terms of the GNU General Public License as published by the
 463.825 ++// Free Software Foundation; either version 2, or (at your option)
 463.826 ++// any later version.
 463.827 ++
 463.828 ++// This library is distributed in the hope that it will be useful,
 463.829 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 463.830 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 463.831 ++// GNU General Public License for more details.
 463.832 ++
 463.833 ++// You should have received a copy of the GNU General Public License along
 463.834 ++// with this library; see the file COPYING.  If not, write to the Free
 463.835 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 463.836 ++// USA.
 463.837 ++
 463.838 ++// As a special exception, you may use this file as part of a free software
 463.839 ++// library without restriction.  Specifically, if other files instantiate
 463.840 ++// templates or use macros or inline functions from this file, or you compile
 463.841 ++// this file and link it with other files to produce an executable, this
 463.842 ++// file does not by itself cause the resulting executable to be covered by
 463.843 ++// the GNU General Public License.  This exception does not however
 463.844 ++// invalidate any other reasons why the executable file might be covered by
 463.845 ++// the GNU General Public License.
 463.846 ++
 463.847 ++//
 463.848 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 463.849 ++//
 463.850 ++
 463.851 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 463.852 ++
 463.853 ++#define _LIBC
 463.854 ++#include <locale>
 463.855 ++#undef _LIBC
 463.856 ++#include <bits/c++locale_internal.h>
 463.857 ++
 463.858 ++#ifndef __UCLIBC_HAS_XLOCALE__
 463.859 ++#define __wctype_l(S, L)           wctype((S))
 463.860 ++#define __towupper_l(C, L)         towupper((C))
 463.861 ++#define __towlower_l(C, L)         towlower((C))
 463.862 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 463.863 ++#endif
 463.864 ++
 463.865 ++namespace std
 463.866 ++{
 463.867 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 463.868 ++  // various /config/os/* files.
 463.869 ++  template<>
 463.870 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 463.871 ++    : ctype<char>(0, false, __refs) 
 463.872 ++    { 		
 463.873 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 463.874 ++	{
 463.875 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 463.876 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 463.877 ++#ifdef __UCLIBC_HAS_XLOCALE__
 463.878 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 463.879 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 463.880 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 463.881 ++#endif
 463.882 ++	}
 463.883 ++    }
 463.884 ++
 463.885 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 463.886 ++  ctype<wchar_t>::__wmask_type
 463.887 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 463.888 ++  {
 463.889 ++    __wmask_type __ret;
 463.890 ++    switch (__m)
 463.891 ++      {
 463.892 ++      case space:
 463.893 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 463.894 ++	break;
 463.895 ++      case print:
 463.896 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 463.897 ++	break;
 463.898 ++      case cntrl:
 463.899 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 463.900 ++	break;
 463.901 ++      case upper:
 463.902 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 463.903 ++	break;
 463.904 ++      case lower:
 463.905 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 463.906 ++	break;
 463.907 ++      case alpha:
 463.908 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 463.909 ++	break;
 463.910 ++      case digit:
 463.911 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 463.912 ++	break;
 463.913 ++      case punct:
 463.914 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 463.915 ++	break;
 463.916 ++      case xdigit:
 463.917 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 463.918 ++	break;
 463.919 ++      case alnum:
 463.920 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 463.921 ++	break;
 463.922 ++      case graph:
 463.923 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 463.924 ++	break;
 463.925 ++      default:
 463.926 ++	__ret = __wmask_type();
 463.927 ++      }
 463.928 ++    return __ret;
 463.929 ++  }
 463.930 ++  
 463.931 ++  wchar_t
 463.932 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 463.933 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 463.934 ++
 463.935 ++  const wchar_t*
 463.936 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 463.937 ++  {
 463.938 ++    while (__lo < __hi)
 463.939 ++      {
 463.940 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 463.941 ++        ++__lo;
 463.942 ++      }
 463.943 ++    return __hi;
 463.944 ++  }
 463.945 ++  
 463.946 ++  wchar_t
 463.947 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 463.948 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 463.949 ++  
 463.950 ++  const wchar_t*
 463.951 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 463.952 ++  {
 463.953 ++    while (__lo < __hi)
 463.954 ++      {
 463.955 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 463.956 ++        ++__lo;
 463.957 ++      }
 463.958 ++    return __hi;
 463.959 ++  }
 463.960 ++
 463.961 ++  bool
 463.962 ++  ctype<wchar_t>::
 463.963 ++  do_is(mask __m, wchar_t __c) const
 463.964 ++  { 
 463.965 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
 463.966 ++    // library for blank.
 463.967 ++    bool __ret = false;
 463.968 ++    const size_t __bitmasksize = 11; 
 463.969 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 463.970 ++      if (__m & _M_bit[__bitcur]
 463.971 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 463.972 ++	{
 463.973 ++	  __ret = true;
 463.974 ++	  break;
 463.975 ++	}
 463.976 ++    return __ret;    
 463.977 ++  }
 463.978 ++  
 463.979 ++  const wchar_t* 
 463.980 ++  ctype<wchar_t>::
 463.981 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 463.982 ++  {
 463.983 ++    for (; __lo < __hi; ++__vec, ++__lo)
 463.984 ++      {
 463.985 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 463.986 ++	// library for blank.
 463.987 ++	const size_t __bitmasksize = 11; 
 463.988 ++	mask __m = 0;
 463.989 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 463.990 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 463.991 ++	    __m |= _M_bit[__bitcur];
 463.992 ++	*__vec = __m;
 463.993 ++      }
 463.994 ++    return __hi;
 463.995 ++  }
 463.996 ++  
 463.997 ++  const wchar_t* 
 463.998 ++  ctype<wchar_t>::
 463.999 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
463.1000 ++  {
463.1001 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
463.1002 ++      ++__lo;
463.1003 ++    return __lo;
463.1004 ++  }
463.1005 ++
463.1006 ++  const wchar_t*
463.1007 ++  ctype<wchar_t>::
463.1008 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
463.1009 ++  {
463.1010 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
463.1011 ++      ++__lo;
463.1012 ++    return __lo;
463.1013 ++  }
463.1014 ++
463.1015 ++  wchar_t
463.1016 ++  ctype<wchar_t>::
463.1017 ++  do_widen(char __c) const
463.1018 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
463.1019 ++
463.1020 ++  const char* 
463.1021 ++  ctype<wchar_t>::
463.1022 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
463.1023 ++  {
463.1024 ++    while (__lo < __hi)
463.1025 ++      {
463.1026 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
463.1027 ++	++__lo;
463.1028 ++	++__dest;
463.1029 ++      }
463.1030 ++    return __hi;
463.1031 ++  }
463.1032 ++
463.1033 ++  char
463.1034 ++  ctype<wchar_t>::
463.1035 ++  do_narrow(wchar_t __wc, char __dfault) const
463.1036 ++  {
463.1037 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
463.1038 ++      return _M_narrow[__wc];
463.1039 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1040 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
463.1041 ++#endif
463.1042 ++    const int __c = wctob(__wc);
463.1043 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1044 ++    __uselocale(__old);
463.1045 ++#endif
463.1046 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
463.1047 ++  }
463.1048 ++
463.1049 ++  const wchar_t*
463.1050 ++  ctype<wchar_t>::
463.1051 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
463.1052 ++	    char* __dest) const
463.1053 ++  {
463.1054 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1055 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
463.1056 ++#endif
463.1057 ++    if (_M_narrow_ok)
463.1058 ++      while (__lo < __hi)
463.1059 ++	{
463.1060 ++	  if (*__lo >= 0 && *__lo < 128)
463.1061 ++	    *__dest = _M_narrow[*__lo];
463.1062 ++	  else
463.1063 ++	    {
463.1064 ++	      const int __c = wctob(*__lo);
463.1065 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
463.1066 ++	    }
463.1067 ++	  ++__lo;
463.1068 ++	  ++__dest;
463.1069 ++	}
463.1070 ++    else
463.1071 ++      while (__lo < __hi)
463.1072 ++	{
463.1073 ++	  const int __c = wctob(*__lo);
463.1074 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
463.1075 ++	  ++__lo;
463.1076 ++	  ++__dest;
463.1077 ++	}
463.1078 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1079 ++    __uselocale(__old);
463.1080 ++#endif
463.1081 ++    return __hi;
463.1082 ++  }
463.1083 ++
463.1084 ++  void
463.1085 ++  ctype<wchar_t>::_M_initialize_ctype()
463.1086 ++  {
463.1087 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1088 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
463.1089 ++#endif
463.1090 ++    wint_t __i;
463.1091 ++    for (__i = 0; __i < 128; ++__i)
463.1092 ++      {
463.1093 ++	const int __c = wctob(__i);
463.1094 ++	if (__c == EOF)
463.1095 ++	  break;
463.1096 ++	else
463.1097 ++	  _M_narrow[__i] = static_cast<char>(__c);
463.1098 ++      }
463.1099 ++    if (__i == 128)
463.1100 ++      _M_narrow_ok = true;
463.1101 ++    else
463.1102 ++      _M_narrow_ok = false;
463.1103 ++    for (size_t __j = 0;
463.1104 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
463.1105 ++      _M_widen[__j] = btowc(__j);
463.1106 ++
463.1107 ++    for (size_t __k = 0; __k <= 11; ++__k)
463.1108 ++      { 
463.1109 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
463.1110 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
463.1111 ++      }
463.1112 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1113 ++    __uselocale(__old);
463.1114 ++#endif
463.1115 ++  }
463.1116 ++#endif //  _GLIBCXX_USE_WCHAR_T
463.1117 ++}
463.1118 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
463.1119 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
463.1120 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:39.000000000 +0200
463.1121 +@@ -0,0 +1,100 @@
463.1122 ++// std::messages implementation details, GNU version -*- C++ -*-
463.1123 ++
463.1124 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
463.1125 ++//
463.1126 ++// This file is part of the GNU ISO C++ Library.  This library is free
463.1127 ++// software; you can redistribute it and/or modify it under the
463.1128 ++// terms of the GNU General Public License as published by the
463.1129 ++// Free Software Foundation; either version 2, or (at your option)
463.1130 ++// any later version.
463.1131 ++
463.1132 ++// This library is distributed in the hope that it will be useful,
463.1133 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
463.1134 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
463.1135 ++// GNU General Public License for more details.
463.1136 ++
463.1137 ++// You should have received a copy of the GNU General Public License along
463.1138 ++// with this library; see the file COPYING.  If not, write to the Free
463.1139 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
463.1140 ++// USA.
463.1141 ++
463.1142 ++// As a special exception, you may use this file as part of a free software
463.1143 ++// library without restriction.  Specifically, if other files instantiate
463.1144 ++// templates or use macros or inline functions from this file, or you compile
463.1145 ++// this file and link it with other files to produce an executable, this
463.1146 ++// file does not by itself cause the resulting executable to be covered by
463.1147 ++// the GNU General Public License.  This exception does not however
463.1148 ++// invalidate any other reasons why the executable file might be covered by
463.1149 ++// the GNU General Public License.
463.1150 ++
463.1151 ++//
463.1152 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
463.1153 ++//
463.1154 ++
463.1155 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
463.1156 ++
463.1157 ++#include <locale>
463.1158 ++#include <bits/c++locale_internal.h>
463.1159 ++
463.1160 ++#ifdef __UCLIBC_MJN3_ONLY__
463.1161 ++#warning fix gettext stuff
463.1162 ++#endif
463.1163 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
463.1164 ++extern "C" char *__dcgettext(const char *domainname,
463.1165 ++			     const char *msgid, int category);
463.1166 ++#undef gettext
463.1167 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
463.1168 ++#else
463.1169 ++#undef gettext
463.1170 ++#define gettext(msgid) (msgid)
463.1171 ++#endif
463.1172 ++
463.1173 ++namespace std
463.1174 ++{
463.1175 ++  // Specializations.
463.1176 ++  template<>
463.1177 ++    string
463.1178 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
463.1179 ++    {
463.1180 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1181 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
463.1182 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
463.1183 ++      __uselocale(__old);
463.1184 ++      return string(__msg);
463.1185 ++#elif defined __UCLIBC_HAS_LOCALE__
463.1186 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
463.1187 ++      setlocale(LC_ALL, _M_name_messages);
463.1188 ++      const char* __msg = gettext(__dfault.c_str());
463.1189 ++      setlocale(LC_ALL, __old);
463.1190 ++      free(__old);
463.1191 ++      return string(__msg);
463.1192 ++#else
463.1193 ++      const char* __msg = gettext(__dfault.c_str());
463.1194 ++      return string(__msg);
463.1195 ++#endif
463.1196 ++    }
463.1197 ++
463.1198 ++#ifdef _GLIBCXX_USE_WCHAR_T
463.1199 ++  template<>
463.1200 ++    wstring
463.1201 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
463.1202 ++    {
463.1203 ++# ifdef __UCLIBC_HAS_XLOCALE__
463.1204 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
463.1205 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
463.1206 ++      __uselocale(__old);
463.1207 ++      return _M_convert_from_char(__msg);
463.1208 ++# elif defined __UCLIBC_HAS_LOCALE__
463.1209 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
463.1210 ++      setlocale(LC_ALL, _M_name_messages);
463.1211 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
463.1212 ++      setlocale(LC_ALL, __old);
463.1213 ++      free(__old);
463.1214 ++      return _M_convert_from_char(__msg);
463.1215 ++# else
463.1216 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
463.1217 ++      return _M_convert_from_char(__msg);
463.1218 ++# endif
463.1219 ++    }
463.1220 ++#endif
463.1221 ++}
463.1222 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
463.1223 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
463.1224 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:39.000000000 +0200
463.1225 +@@ -0,0 +1,118 @@
463.1226 ++// std::messages implementation details, GNU version -*- C++ -*-
463.1227 ++
463.1228 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
463.1229 ++//
463.1230 ++// This file is part of the GNU ISO C++ Library.  This library is free
463.1231 ++// software; you can redistribute it and/or modify it under the
463.1232 ++// terms of the GNU General Public License as published by the
463.1233 ++// Free Software Foundation; either version 2, or (at your option)
463.1234 ++// any later version.
463.1235 ++
463.1236 ++// This library is distributed in the hope that it will be useful,
463.1237 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
463.1238 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
463.1239 ++// GNU General Public License for more details.
463.1240 ++
463.1241 ++// You should have received a copy of the GNU General Public License along
463.1242 ++// with this library; see the file COPYING.  If not, write to the Free
463.1243 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
463.1244 ++// USA.
463.1245 ++
463.1246 ++// As a special exception, you may use this file as part of a free software
463.1247 ++// library without restriction.  Specifically, if other files instantiate
463.1248 ++// templates or use macros or inline functions from this file, or you compile
463.1249 ++// this file and link it with other files to produce an executable, this
463.1250 ++// file does not by itself cause the resulting executable to be covered by
463.1251 ++// the GNU General Public License.  This exception does not however
463.1252 ++// invalidate any other reasons why the executable file might be covered by
463.1253 ++// the GNU General Public License.
463.1254 ++
463.1255 ++//
463.1256 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
463.1257 ++//
463.1258 ++
463.1259 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
463.1260 ++
463.1261 ++#ifdef __UCLIBC_MJN3_ONLY__
463.1262 ++#warning fix prototypes for *textdomain funcs
463.1263 ++#endif
463.1264 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
463.1265 ++extern "C" char *__textdomain(const char *domainname);
463.1266 ++extern "C" char *__bindtextdomain(const char *domainname,
463.1267 ++				  const char *dirname);
463.1268 ++#else
463.1269 ++#undef __textdomain
463.1270 ++#undef __bindtextdomain
463.1271 ++#define __textdomain(D)           ((void)0)
463.1272 ++#define __bindtextdomain(D,P)     ((void)0)
463.1273 ++#endif
463.1274 ++
463.1275 ++  // Non-virtual member functions.
463.1276 ++  template<typename _CharT>
463.1277 ++     messages<_CharT>::messages(size_t __refs)
463.1278 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
463.1279 ++     _M_name_messages(_S_get_c_name())
463.1280 ++     { }
463.1281 ++
463.1282 ++  template<typename _CharT>
463.1283 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
463.1284 ++				size_t __refs) 
463.1285 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
463.1286 ++     _M_name_messages(__s)
463.1287 ++     {
463.1288 ++       char* __tmp = new char[std::strlen(__s) + 1];
463.1289 ++       std::strcpy(__tmp, __s);
463.1290 ++       _M_name_messages = __tmp;
463.1291 ++     }
463.1292 ++
463.1293 ++  template<typename _CharT>
463.1294 ++    typename messages<_CharT>::catalog 
463.1295 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
463.1296 ++			   const char* __dir) const
463.1297 ++    { 
463.1298 ++      __bindtextdomain(__s.c_str(), __dir);
463.1299 ++      return this->do_open(__s, __loc); 
463.1300 ++    }
463.1301 ++
463.1302 ++  // Virtual member functions.
463.1303 ++  template<typename _CharT>
463.1304 ++    messages<_CharT>::~messages()
463.1305 ++    { 
463.1306 ++      if (_M_name_messages != _S_get_c_name())
463.1307 ++	delete [] _M_name_messages;
463.1308 ++      _S_destroy_c_locale(_M_c_locale_messages); 
463.1309 ++    }
463.1310 ++
463.1311 ++  template<typename _CharT>
463.1312 ++    typename messages<_CharT>::catalog 
463.1313 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
463.1314 ++			      const locale&) const
463.1315 ++    { 
463.1316 ++      // No error checking is done, assume the catalog exists and can
463.1317 ++      // be used.
463.1318 ++      __textdomain(__s.c_str());
463.1319 ++      return 0;
463.1320 ++    }
463.1321 ++
463.1322 ++  template<typename _CharT>
463.1323 ++    void    
463.1324 ++    messages<_CharT>::do_close(catalog) const 
463.1325 ++    { }
463.1326 ++
463.1327 ++   // messages_byname
463.1328 ++   template<typename _CharT>
463.1329 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
463.1330 ++     : messages<_CharT>(__refs) 
463.1331 ++     { 
463.1332 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
463.1333 ++	 delete [] this->_M_name_messages;
463.1334 ++       char* __tmp = new char[std::strlen(__s) + 1];
463.1335 ++       std::strcpy(__tmp, __s);
463.1336 ++       this->_M_name_messages = __tmp;
463.1337 ++
463.1338 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
463.1339 ++	 {
463.1340 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
463.1341 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
463.1342 ++	 }
463.1343 ++     }
463.1344 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
463.1345 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
463.1346 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:39.000000000 +0200
463.1347 +@@ -0,0 +1,692 @@
463.1348 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
463.1349 ++
463.1350 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
463.1351 ++//
463.1352 ++// This file is part of the GNU ISO C++ Library.  This library is free
463.1353 ++// software; you can redistribute it and/or modify it under the
463.1354 ++// terms of the GNU General Public License as published by the
463.1355 ++// Free Software Foundation; either version 2, or (at your option)
463.1356 ++// any later version.
463.1357 ++
463.1358 ++// This library is distributed in the hope that it will be useful,
463.1359 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
463.1360 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
463.1361 ++// GNU General Public License for more details.
463.1362 ++
463.1363 ++// You should have received a copy of the GNU General Public License along
463.1364 ++// with this library; see the file COPYING.  If not, write to the Free
463.1365 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
463.1366 ++// USA.
463.1367 ++
463.1368 ++// As a special exception, you may use this file as part of a free software
463.1369 ++// library without restriction.  Specifically, if other files instantiate
463.1370 ++// templates or use macros or inline functions from this file, or you compile
463.1371 ++// this file and link it with other files to produce an executable, this
463.1372 ++// file does not by itself cause the resulting executable to be covered by
463.1373 ++// the GNU General Public License.  This exception does not however
463.1374 ++// invalidate any other reasons why the executable file might be covered by
463.1375 ++// the GNU General Public License.
463.1376 ++
463.1377 ++//
463.1378 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
463.1379 ++//
463.1380 ++
463.1381 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
463.1382 ++
463.1383 ++#define _LIBC
463.1384 ++#include <locale>
463.1385 ++#undef _LIBC
463.1386 ++#include <bits/c++locale_internal.h>
463.1387 ++
463.1388 ++#ifdef __UCLIBC_MJN3_ONLY__
463.1389 ++#warning optimize this for uclibc
463.1390 ++#warning tailor for stub locale support
463.1391 ++#endif
463.1392 ++
463.1393 ++#ifndef __UCLIBC_HAS_XLOCALE__
463.1394 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
463.1395 ++#endif
463.1396 ++
463.1397 ++namespace std
463.1398 ++{
463.1399 ++  // Construct and return valid pattern consisting of some combination of:
463.1400 ++  // space none symbol sign value
463.1401 ++  money_base::pattern
463.1402 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
463.1403 ++  { 
463.1404 ++    pattern __ret;
463.1405 ++
463.1406 ++    // This insanely complicated routine attempts to construct a valid
463.1407 ++    // pattern for use with monyepunct. A couple of invariants:
463.1408 ++
463.1409 ++    // if (__precedes) symbol -> value
463.1410 ++    // else value -> symbol
463.1411 ++    
463.1412 ++    // if (__space) space
463.1413 ++    // else none
463.1414 ++
463.1415 ++    // none == never first
463.1416 ++    // space never first or last
463.1417 ++
463.1418 ++    // Any elegant implementations of this are welcome.
463.1419 ++    switch (__posn)
463.1420 ++      {
463.1421 ++      case 0:
463.1422 ++      case 1:
463.1423 ++	// 1 The sign precedes the value and symbol.
463.1424 ++	__ret.field[0] = sign;
463.1425 ++	if (__space)
463.1426 ++	  {
463.1427 ++	    // Pattern starts with sign.
463.1428 ++	    if (__precedes)
463.1429 ++	      {
463.1430 ++		__ret.field[1] = symbol;
463.1431 ++		__ret.field[3] = value;
463.1432 ++	      }
463.1433 ++	    else
463.1434 ++	      {
463.1435 ++		__ret.field[1] = value;
463.1436 ++		__ret.field[3] = symbol;
463.1437 ++	      }
463.1438 ++	    __ret.field[2] = space;
463.1439 ++	  }
463.1440 ++	else
463.1441 ++	  {
463.1442 ++	    // Pattern starts with sign and ends with none.
463.1443 ++	    if (__precedes)
463.1444 ++	      {
463.1445 ++		__ret.field[1] = symbol;
463.1446 ++		__ret.field[2] = value;
463.1447 ++	      }
463.1448 ++	    else
463.1449 ++	      {
463.1450 ++		__ret.field[1] = value;
463.1451 ++		__ret.field[2] = symbol;
463.1452 ++	      }
463.1453 ++	    __ret.field[3] = none;
463.1454 ++	  }
463.1455 ++	break;
463.1456 ++      case 2:
463.1457 ++	// 2 The sign follows the value and symbol.
463.1458 ++	if (__space)
463.1459 ++	  {
463.1460 ++	    // Pattern either ends with sign.
463.1461 ++	    if (__precedes)
463.1462 ++	      {
463.1463 ++		__ret.field[0] = symbol;
463.1464 ++		__ret.field[2] = value;
463.1465 ++	      }
463.1466 ++	    else
463.1467 ++	      {
463.1468 ++		__ret.field[0] = value;
463.1469 ++		__ret.field[2] = symbol;
463.1470 ++	      }
463.1471 ++	    __ret.field[1] = space;
463.1472 ++	    __ret.field[3] = sign;
463.1473 ++	  }
463.1474 ++	else
463.1475 ++	  {
463.1476 ++	    // Pattern ends with sign then none.
463.1477 ++	    if (__precedes)
463.1478 ++	      {
463.1479 ++		__ret.field[0] = symbol;
463.1480 ++		__ret.field[1] = value;
463.1481 ++	      }
463.1482 ++	    else
463.1483 ++	      {
463.1484 ++		__ret.field[0] = value;
463.1485 ++		__ret.field[1] = symbol;
463.1486 ++	      }
463.1487 ++	    __ret.field[2] = sign;
463.1488 ++	    __ret.field[3] = none;
463.1489 ++	  }
463.1490 ++	break;
463.1491 ++      case 3:
463.1492 ++	// 3 The sign immediately precedes the symbol.
463.1493 ++	if (__precedes)
463.1494 ++	  {
463.1495 ++	    __ret.field[0] = sign;
463.1496 ++	    __ret.field[1] = symbol;	    
463.1497 ++	    if (__space)
463.1498 ++	      {
463.1499 ++		__ret.field[2] = space;
463.1500 ++		__ret.field[3] = value;
463.1501 ++	      }
463.1502 ++	    else
463.1503 ++	      {
463.1504 ++		__ret.field[2] = value;		
463.1505 ++		__ret.field[3] = none;
463.1506 ++	      }
463.1507 ++	  }
463.1508 ++	else
463.1509 ++	  {
463.1510 ++	    __ret.field[0] = value;
463.1511 ++	    if (__space)
463.1512 ++	      {
463.1513 ++		__ret.field[1] = space;
463.1514 ++		__ret.field[2] = sign;
463.1515 ++		__ret.field[3] = symbol;
463.1516 ++	      }
463.1517 ++	    else
463.1518 ++	      {
463.1519 ++		__ret.field[1] = sign;
463.1520 ++		__ret.field[2] = symbol;
463.1521 ++		__ret.field[3] = none;
463.1522 ++	      }
463.1523 ++	  }
463.1524 ++	break;
463.1525 ++      case 4:
463.1526 ++	// 4 The sign immediately follows the symbol.
463.1527 ++	if (__precedes)
463.1528 ++	  {
463.1529 ++	    __ret.field[0] = symbol;
463.1530 ++	    __ret.field[1] = sign;
463.1531 ++	    if (__space)
463.1532 ++	      {
463.1533 ++		__ret.field[2] = space;
463.1534 ++		__ret.field[3] = value;
463.1535 ++	      }
463.1536 ++	    else
463.1537 ++	      {
463.1538 ++		__ret.field[2] = value;
463.1539 ++		__ret.field[3] = none;
463.1540 ++	      }
463.1541 ++	  }
463.1542 ++	else
463.1543 ++	  {
463.1544 ++	    __ret.field[0] = value;
463.1545 ++	    if (__space)
463.1546 ++	      {
463.1547 ++		__ret.field[1] = space;
463.1548 ++		__ret.field[2] = symbol;
463.1549 ++		__ret.field[3] = sign;
463.1550 ++	      }
463.1551 ++	    else
463.1552 ++	      {
463.1553 ++		__ret.field[1] = symbol;
463.1554 ++		__ret.field[2] = sign;
463.1555 ++		__ret.field[3] = none;
463.1556 ++	      }
463.1557 ++	  }
463.1558 ++	break;
463.1559 ++      default:
463.1560 ++	;
463.1561 ++      }
463.1562 ++    return __ret;
463.1563 ++  }
463.1564 ++
463.1565 ++  template<> 
463.1566 ++    void
463.1567 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
463.1568 ++						     const char*)
463.1569 ++    {
463.1570 ++      if (!_M_data)
463.1571 ++	_M_data = new __moneypunct_cache<char, true>;
463.1572 ++
463.1573 ++      if (!__cloc)
463.1574 ++	{
463.1575 ++	  // "C" locale
463.1576 ++	  _M_data->_M_decimal_point = '.';
463.1577 ++	  _M_data->_M_thousands_sep = ',';
463.1578 ++	  _M_data->_M_grouping = "";
463.1579 ++	  _M_data->_M_grouping_size = 0;
463.1580 ++	  _M_data->_M_curr_symbol = "";
463.1581 ++	  _M_data->_M_curr_symbol_size = 0;
463.1582 ++	  _M_data->_M_positive_sign = "";
463.1583 ++	  _M_data->_M_positive_sign_size = 0;
463.1584 ++	  _M_data->_M_negative_sign = "";
463.1585 ++	  _M_data->_M_negative_sign_size = 0;
463.1586 ++	  _M_data->_M_frac_digits = 0;
463.1587 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
463.1588 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
463.1589 ++
463.1590 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
463.1591 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
463.1592 ++	}
463.1593 ++      else
463.1594 ++	{
463.1595 ++	  // Named locale.
463.1596 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
463.1597 ++							__cloc));
463.1598 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
463.1599 ++							__cloc));
463.1600 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
463.1601 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
463.1602 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
463.1603 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
463.1604 ++
463.1605 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
463.1606 ++	  if (!__nposn)
463.1607 ++	    _M_data->_M_negative_sign = "()";
463.1608 ++	  else
463.1609 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
463.1610 ++							__cloc);
463.1611 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
463.1612 ++
463.1613 ++	  // _Intl == true
463.1614 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
463.1615 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
463.1616 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
463.1617 ++						      __cloc));
463.1618 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
463.1619 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
463.1620 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
463.1621 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
463.1622 ++							__pposn);
463.1623 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
463.1624 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
463.1625 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
463.1626 ++							__nposn);
463.1627 ++	}
463.1628 ++    }
463.1629 ++
463.1630 ++  template<> 
463.1631 ++    void
463.1632 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
463.1633 ++						      const char*)
463.1634 ++    {
463.1635 ++      if (!_M_data)
463.1636 ++	_M_data = new __moneypunct_cache<char, false>;
463.1637 ++
463.1638 ++      if (!__cloc)
463.1639 ++	{
463.1640 ++	  // "C" locale
463.1641 ++	  _M_data->_M_decimal_point = '.';
463.1642 ++	  _M_data->_M_thousands_sep = ',';
463.1643 ++	  _M_data->_M_grouping = "";
463.1644 ++	  _M_data->_M_grouping_size = 0;
463.1645 ++	  _M_data->_M_curr_symbol = "";
463.1646 ++	  _M_data->_M_curr_symbol_size = 0;
463.1647 ++	  _M_data->_M_positive_sign = "";
463.1648 ++	  _M_data->_M_positive_sign_size = 0;
463.1649 ++	  _M_data->_M_negative_sign = "";
463.1650 ++	  _M_data->_M_negative_sign_size = 0;
463.1651 ++	  _M_data->_M_frac_digits = 0;
463.1652 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
463.1653 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
463.1654 ++
463.1655 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
463.1656 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
463.1657 ++	}
463.1658 ++      else
463.1659 ++	{
463.1660 ++	  // Named locale.
463.1661 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
463.1662 ++							__cloc));
463.1663 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
463.1664 ++							__cloc));
463.1665 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
463.1666 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
463.1667 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
463.1668 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
463.1669 ++
463.1670 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
463.1671 ++	  if (!__nposn)
463.1672 ++	    _M_data->_M_negative_sign = "()";
463.1673 ++	  else
463.1674 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
463.1675 ++							__cloc);
463.1676 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
463.1677 ++
463.1678 ++	  // _Intl == false
463.1679 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
463.1680 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
463.1681 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
463.1682 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
463.1683 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
463.1684 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
463.1685 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
463.1686 ++							__pposn);
463.1687 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
463.1688 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
463.1689 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
463.1690 ++							__nposn);
463.1691 ++	}
463.1692 ++    }
463.1693 ++
463.1694 ++  template<> 
463.1695 ++    moneypunct<char, true>::~moneypunct()
463.1696 ++    { delete _M_data; }
463.1697 ++
463.1698 ++  template<> 
463.1699 ++    moneypunct<char, false>::~moneypunct()
463.1700 ++    { delete _M_data; }
463.1701 ++
463.1702 ++#ifdef _GLIBCXX_USE_WCHAR_T
463.1703 ++  template<> 
463.1704 ++    void
463.1705 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
463.1706 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1707 ++							const char*)
463.1708 ++#else
463.1709 ++							const char* __name)
463.1710 ++#endif
463.1711 ++    {
463.1712 ++      if (!_M_data)
463.1713 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
463.1714 ++
463.1715 ++      if (!__cloc)
463.1716 ++	{
463.1717 ++	  // "C" locale
463.1718 ++	  _M_data->_M_decimal_point = L'.';
463.1719 ++	  _M_data->_M_thousands_sep = L',';
463.1720 ++	  _M_data->_M_grouping = "";
463.1721 ++	  _M_data->_M_grouping_size = 0;
463.1722 ++	  _M_data->_M_curr_symbol = L"";
463.1723 ++	  _M_data->_M_curr_symbol_size = 0;
463.1724 ++	  _M_data->_M_positive_sign = L"";
463.1725 ++	  _M_data->_M_positive_sign_size = 0;
463.1726 ++	  _M_data->_M_negative_sign = L"";
463.1727 ++	  _M_data->_M_negative_sign_size = 0;
463.1728 ++	  _M_data->_M_frac_digits = 0;
463.1729 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
463.1730 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
463.1731 ++
463.1732 ++	  // Use ctype::widen code without the facet...
463.1733 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
463.1734 ++	    _M_data->_M_atoms[__i] =
463.1735 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
463.1736 ++	}
463.1737 ++      else
463.1738 ++	{
463.1739 ++	  // Named locale.
463.1740 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1741 ++	  __c_locale __old = __uselocale(__cloc);
463.1742 ++#else
463.1743 ++	  // Switch to named locale so that mbsrtowcs will work.
463.1744 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
463.1745 ++	  setlocale(LC_ALL, __name);
463.1746 ++#endif
463.1747 ++
463.1748 ++#ifdef __UCLIBC_MJN3_ONLY__
463.1749 ++#warning fix this... should be monetary
463.1750 ++#endif
463.1751 ++#ifdef __UCLIBC__
463.1752 ++# ifdef __UCLIBC_HAS_XLOCALE__
463.1753 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
463.1754 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
463.1755 ++# else
463.1756 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
463.1757 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
463.1758 ++# endif
463.1759 ++#else
463.1760 ++	  union { char *__s; wchar_t __w; } __u;
463.1761 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
463.1762 ++	  _M_data->_M_decimal_point = __u.__w;
463.1763 ++
463.1764 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
463.1765 ++	  _M_data->_M_thousands_sep = __u.__w;
463.1766 ++#endif
463.1767 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
463.1768 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
463.1769 ++
463.1770 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
463.1771 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
463.1772 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
463.1773 ++
463.1774 ++	  wchar_t* __wcs_ps = 0;
463.1775 ++	  wchar_t* __wcs_ns = 0;
463.1776 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
463.1777 ++	  try
463.1778 ++	    {
463.1779 ++	      mbstate_t __state;
463.1780 ++	      size_t __len = strlen(__cpossign);
463.1781 ++	      if (__len)
463.1782 ++		{
463.1783 ++		  ++__len;
463.1784 ++		  memset(&__state, 0, sizeof(mbstate_t));
463.1785 ++		  __wcs_ps = new wchar_t[__len];
463.1786 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
463.1787 ++		  _M_data->_M_positive_sign = __wcs_ps;
463.1788 ++		}
463.1789 ++	      else
463.1790 ++		_M_data->_M_positive_sign = L"";
463.1791 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
463.1792 ++	      
463.1793 ++	      __len = strlen(__cnegsign);
463.1794 ++	      if (!__nposn)
463.1795 ++		_M_data->_M_negative_sign = L"()";
463.1796 ++	      else if (__len)
463.1797 ++		{ 
463.1798 ++		  ++__len;
463.1799 ++		  memset(&__state, 0, sizeof(mbstate_t));
463.1800 ++		  __wcs_ns = new wchar_t[__len];
463.1801 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
463.1802 ++		  _M_data->_M_negative_sign = __wcs_ns;
463.1803 ++		}
463.1804 ++	      else
463.1805 ++		_M_data->_M_negative_sign = L"";
463.1806 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
463.1807 ++	      
463.1808 ++	      // _Intl == true.
463.1809 ++	      __len = strlen(__ccurr);
463.1810 ++	      if (__len)
463.1811 ++		{
463.1812 ++		  ++__len;
463.1813 ++		  memset(&__state, 0, sizeof(mbstate_t));
463.1814 ++		  wchar_t* __wcs = new wchar_t[__len];
463.1815 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
463.1816 ++		  _M_data->_M_curr_symbol = __wcs;
463.1817 ++		}
463.1818 ++	      else
463.1819 ++		_M_data->_M_curr_symbol = L"";
463.1820 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
463.1821 ++	    }
463.1822 ++	  catch (...)
463.1823 ++	    {
463.1824 ++	      delete _M_data;
463.1825 ++	      _M_data = 0;
463.1826 ++	      delete __wcs_ps;
463.1827 ++	      delete __wcs_ns;	      
463.1828 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1829 ++	      __uselocale(__old);
463.1830 ++#else
463.1831 ++	      setlocale(LC_ALL, __old);
463.1832 ++	      free(__old);
463.1833 ++#endif
463.1834 ++	      __throw_exception_again;
463.1835 ++	    } 
463.1836 ++	  
463.1837 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
463.1838 ++						      __cloc));
463.1839 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
463.1840 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
463.1841 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
463.1842 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
463.1843 ++							__pposn);
463.1844 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
463.1845 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
463.1846 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
463.1847 ++							__nposn);
463.1848 ++
463.1849 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1850 ++	  __uselocale(__old);
463.1851 ++#else
463.1852 ++	  setlocale(LC_ALL, __old);
463.1853 ++	  free(__old);
463.1854 ++#endif
463.1855 ++	}
463.1856 ++    }
463.1857 ++
463.1858 ++  template<> 
463.1859 ++  void
463.1860 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
463.1861 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1862 ++						       const char*)
463.1863 ++#else
463.1864 ++                                                       const char* __name)
463.1865 ++#endif
463.1866 ++  {
463.1867 ++    if (!_M_data)
463.1868 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
463.1869 ++
463.1870 ++    if (!__cloc)
463.1871 ++	{
463.1872 ++	  // "C" locale
463.1873 ++	  _M_data->_M_decimal_point = L'.';
463.1874 ++	  _M_data->_M_thousands_sep = L',';
463.1875 ++	  _M_data->_M_grouping = "";
463.1876 ++          _M_data->_M_grouping_size = 0;
463.1877 ++	  _M_data->_M_curr_symbol = L"";
463.1878 ++	  _M_data->_M_curr_symbol_size = 0;
463.1879 ++	  _M_data->_M_positive_sign = L"";
463.1880 ++	  _M_data->_M_positive_sign_size = 0;
463.1881 ++	  _M_data->_M_negative_sign = L"";
463.1882 ++	  _M_data->_M_negative_sign_size = 0;
463.1883 ++	  _M_data->_M_frac_digits = 0;
463.1884 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
463.1885 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
463.1886 ++
463.1887 ++	  // Use ctype::widen code without the facet...
463.1888 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
463.1889 ++	    _M_data->_M_atoms[__i] =
463.1890 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
463.1891 ++	}
463.1892 ++      else
463.1893 ++	{
463.1894 ++	  // Named locale.
463.1895 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1896 ++	  __c_locale __old = __uselocale(__cloc);
463.1897 ++#else
463.1898 ++	  // Switch to named locale so that mbsrtowcs will work.
463.1899 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
463.1900 ++	  setlocale(LC_ALL, __name);
463.1901 ++#endif
463.1902 ++
463.1903 ++#ifdef __UCLIBC_MJN3_ONLY__
463.1904 ++#warning fix this... should be monetary
463.1905 ++#endif
463.1906 ++#ifdef __UCLIBC__
463.1907 ++# ifdef __UCLIBC_HAS_XLOCALE__
463.1908 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
463.1909 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
463.1910 ++# else
463.1911 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
463.1912 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
463.1913 ++# endif
463.1914 ++#else
463.1915 ++          union { char *__s; wchar_t __w; } __u;
463.1916 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
463.1917 ++	  _M_data->_M_decimal_point = __u.__w;
463.1918 ++
463.1919 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
463.1920 ++	  _M_data->_M_thousands_sep = __u.__w;
463.1921 ++#endif
463.1922 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
463.1923 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
463.1924 ++
463.1925 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
463.1926 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
463.1927 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
463.1928 ++
463.1929 ++	  wchar_t* __wcs_ps = 0;
463.1930 ++	  wchar_t* __wcs_ns = 0;
463.1931 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
463.1932 ++	  try
463.1933 ++            {
463.1934 ++              mbstate_t __state;
463.1935 ++              size_t __len;
463.1936 ++              __len = strlen(__cpossign);
463.1937 ++              if (__len)
463.1938 ++                {
463.1939 ++		  ++__len;
463.1940 ++		  memset(&__state, 0, sizeof(mbstate_t));
463.1941 ++		  __wcs_ps = new wchar_t[__len];
463.1942 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
463.1943 ++		  _M_data->_M_positive_sign = __wcs_ps;
463.1944 ++		}
463.1945 ++	      else
463.1946 ++		_M_data->_M_positive_sign = L"";
463.1947 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
463.1948 ++	      
463.1949 ++	      __len = strlen(__cnegsign);
463.1950 ++	      if (!__nposn)
463.1951 ++		_M_data->_M_negative_sign = L"()";
463.1952 ++	      else if (__len)
463.1953 ++		{ 
463.1954 ++		  ++__len;
463.1955 ++		  memset(&__state, 0, sizeof(mbstate_t));
463.1956 ++		  __wcs_ns = new wchar_t[__len];
463.1957 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
463.1958 ++		  _M_data->_M_negative_sign = __wcs_ns;
463.1959 ++		}
463.1960 ++	      else
463.1961 ++		_M_data->_M_negative_sign = L"";
463.1962 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
463.1963 ++
463.1964 ++	      // _Intl == true.
463.1965 ++	      __len = strlen(__ccurr);
463.1966 ++	      if (__len)
463.1967 ++		{
463.1968 ++		  ++__len;
463.1969 ++		  memset(&__state, 0, sizeof(mbstate_t));
463.1970 ++		  wchar_t* __wcs = new wchar_t[__len];
463.1971 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
463.1972 ++		  _M_data->_M_curr_symbol = __wcs;
463.1973 ++		}
463.1974 ++	      else
463.1975 ++		_M_data->_M_curr_symbol = L"";
463.1976 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
463.1977 ++	    }
463.1978 ++          catch (...)
463.1979 ++	    {
463.1980 ++	      delete _M_data;
463.1981 ++              _M_data = 0;
463.1982 ++	      delete __wcs_ps;
463.1983 ++	      delete __wcs_ns;	      
463.1984 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.1985 ++	      __uselocale(__old);
463.1986 ++#else
463.1987 ++	      setlocale(LC_ALL, __old);
463.1988 ++	      free(__old);
463.1989 ++#endif
463.1990 ++              __throw_exception_again;
463.1991 ++	    }
463.1992 ++
463.1993 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
463.1994 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
463.1995 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
463.1996 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
463.1997 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
463.1998 ++	                                                __pposn);
463.1999 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
463.2000 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
463.2001 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
463.2002 ++	                                                __nposn);
463.2003 ++
463.2004 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.2005 ++	  __uselocale(__old);
463.2006 ++#else
463.2007 ++	  setlocale(LC_ALL, __old);
463.2008 ++	  free(__old);
463.2009 ++#endif
463.2010 ++	}
463.2011 ++    }
463.2012 ++
463.2013 ++  template<> 
463.2014 ++    moneypunct<wchar_t, true>::~moneypunct()
463.2015 ++    {
463.2016 ++      if (_M_data->_M_positive_sign_size)
463.2017 ++	delete [] _M_data->_M_positive_sign;
463.2018 ++      if (_M_data->_M_negative_sign_size
463.2019 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
463.2020 ++	delete [] _M_data->_M_negative_sign;
463.2021 ++      if (_M_data->_M_curr_symbol_size)
463.2022 ++	delete [] _M_data->_M_curr_symbol;
463.2023 ++      delete _M_data;
463.2024 ++    }
463.2025 ++
463.2026 ++  template<> 
463.2027 ++    moneypunct<wchar_t, false>::~moneypunct()
463.2028 ++    {
463.2029 ++      if (_M_data->_M_positive_sign_size)
463.2030 ++	delete [] _M_data->_M_positive_sign;
463.2031 ++      if (_M_data->_M_negative_sign_size
463.2032 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
463.2033 ++	delete [] _M_data->_M_negative_sign;
463.2034 ++      if (_M_data->_M_curr_symbol_size)
463.2035 ++	delete [] _M_data->_M_curr_symbol;
463.2036 ++      delete _M_data;
463.2037 ++    }
463.2038 ++#endif
463.2039 ++}
463.2040 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
463.2041 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
463.2042 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:39.000000000 +0200
463.2043 +@@ -0,0 +1,160 @@
463.2044 ++// std::numpunct implementation details, GNU version -*- C++ -*-
463.2045 ++
463.2046 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
463.2047 ++//
463.2048 ++// This file is part of the GNU ISO C++ Library.  This library is free
463.2049 ++// software; you can redistribute it and/or modify it under the
463.2050 ++// terms of the GNU General Public License as published by the
463.2051 ++// Free Software Foundation; either version 2, or (at your option)
463.2052 ++// any later version.
463.2053 ++
463.2054 ++// This library is distributed in the hope that it will be useful,
463.2055 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
463.2056 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
463.2057 ++// GNU General Public License for more details.
463.2058 ++
463.2059 ++// You should have received a copy of the GNU General Public License along
463.2060 ++// with this library; see the file COPYING.  If not, write to the Free
463.2061 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
463.2062 ++// USA.
463.2063 ++
463.2064 ++// As a special exception, you may use this file as part of a free software
463.2065 ++// library without restriction.  Specifically, if other files instantiate
463.2066 ++// templates or use macros or inline functions from this file, or you compile
463.2067 ++// this file and link it with other files to produce an executable, this
463.2068 ++// file does not by itself cause the resulting executable to be covered by
463.2069 ++// the GNU General Public License.  This exception does not however
463.2070 ++// invalidate any other reasons why the executable file might be covered by
463.2071 ++// the GNU General Public License.
463.2072 ++
463.2073 ++//
463.2074 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
463.2075 ++//
463.2076 ++
463.2077 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
463.2078 ++
463.2079 ++#define _LIBC
463.2080 ++#include <locale>
463.2081 ++#undef _LIBC
463.2082 ++#include <bits/c++locale_internal.h>
463.2083 ++
463.2084 ++#ifdef __UCLIBC_MJN3_ONLY__
463.2085 ++#warning tailor for stub locale support
463.2086 ++#endif
463.2087 ++#ifndef __UCLIBC_HAS_XLOCALE__
463.2088 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
463.2089 ++#endif
463.2090 ++
463.2091 ++namespace std
463.2092 ++{
463.2093 ++  template<> 
463.2094 ++    void
463.2095 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
463.2096 ++    {
463.2097 ++      if (!_M_data)
463.2098 ++	_M_data = new __numpunct_cache<char>;
463.2099 ++
463.2100 ++      if (!__cloc)
463.2101 ++	{
463.2102 ++	  // "C" locale
463.2103 ++	  _M_data->_M_grouping = "";
463.2104 ++	  _M_data->_M_grouping_size = 0;
463.2105 ++	  _M_data->_M_use_grouping = false;
463.2106 ++
463.2107 ++	  _M_data->_M_decimal_point = '.';
463.2108 ++	  _M_data->_M_thousands_sep = ',';
463.2109 ++
463.2110 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
463.2111 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
463.2112 ++
463.2113 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
463.2114 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
463.2115 ++	}
463.2116 ++      else
463.2117 ++	{
463.2118 ++	  // Named locale.
463.2119 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
463.2120 ++							__cloc));
463.2121 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
463.2122 ++							__cloc));
463.2123 ++
463.2124 ++	  // Check for NULL, which implies no grouping.
463.2125 ++	  if (_M_data->_M_thousands_sep == '\0')
463.2126 ++	    _M_data->_M_grouping = "";
463.2127 ++	  else
463.2128 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
463.2129 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
463.2130 ++	}
463.2131 ++
463.2132 ++      // NB: There is no way to extact this info from posix locales.
463.2133 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
463.2134 ++      _M_data->_M_truename = "true";
463.2135 ++      _M_data->_M_truename_size = 4;
463.2136 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
463.2137 ++      _M_data->_M_falsename = "false";
463.2138 ++      _M_data->_M_falsename_size = 5;
463.2139 ++    }
463.2140 ++ 
463.2141 ++  template<> 
463.2142 ++    numpunct<char>::~numpunct()
463.2143 ++    { delete _M_data; }
463.2144 ++   
463.2145 ++#ifdef _GLIBCXX_USE_WCHAR_T
463.2146 ++  template<> 
463.2147 ++    void
463.2148 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
463.2149 ++    {
463.2150 ++      if (!_M_data)
463.2151 ++	_M_data = new __numpunct_cache<wchar_t>;
463.2152 ++
463.2153 ++      if (!__cloc)
463.2154 ++	{
463.2155 ++	  // "C" locale
463.2156 ++	  _M_data->_M_grouping = "";
463.2157 ++	  _M_data->_M_grouping_size = 0;
463.2158 ++	  _M_data->_M_use_grouping = false;
463.2159 ++
463.2160 ++	  _M_data->_M_decimal_point = L'.';
463.2161 ++	  _M_data->_M_thousands_sep = L',';
463.2162 ++
463.2163 ++	  // Use ctype::widen code without the facet...
463.2164 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
463.2165 ++	    _M_data->_M_atoms_out[__i] =
463.2166 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
463.2167 ++
463.2168 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
463.2169 ++	    _M_data->_M_atoms_in[__j] =
463.2170 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
463.2171 ++	}
463.2172 ++      else
463.2173 ++	{
463.2174 ++	  // Named locale.
463.2175 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
463.2176 ++	  union { char *__s; wchar_t __w; } __u;
463.2177 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
463.2178 ++	  _M_data->_M_decimal_point = __u.__w;
463.2179 ++
463.2180 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
463.2181 ++	  _M_data->_M_thousands_sep = __u.__w;
463.2182 ++
463.2183 ++	  if (_M_data->_M_thousands_sep == L'\0')
463.2184 ++	    _M_data->_M_grouping = "";
463.2185 ++	  else
463.2186 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
463.2187 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
463.2188 ++	}
463.2189 ++
463.2190 ++      // NB: There is no way to extact this info from posix locales.
463.2191 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
463.2192 ++      _M_data->_M_truename = L"true";
463.2193 ++      _M_data->_M_truename_size = 4;
463.2194 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
463.2195 ++      _M_data->_M_falsename = L"false";
463.2196 ++      _M_data->_M_falsename_size = 5;
463.2197 ++    }
463.2198 ++
463.2199 ++  template<> 
463.2200 ++    numpunct<wchar_t>::~numpunct()
463.2201 ++    { delete _M_data; }
463.2202 ++ #endif
463.2203 ++}
463.2204 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc
463.2205 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
463.2206 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:39.000000000 +0200
463.2207 +@@ -0,0 +1,406 @@
463.2208 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
463.2209 ++
463.2210 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
463.2211 ++//
463.2212 ++// This file is part of the GNU ISO C++ Library.  This library is free
463.2213 ++// software; you can redistribute it and/or modify it under the
463.2214 ++// terms of the GNU General Public License as published by the
463.2215 ++// Free Software Foundation; either version 2, or (at your option)
463.2216 ++// any later version.
463.2217 ++
463.2218 ++// This library is distributed in the hope that it will be useful,
463.2219 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
463.2220 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
463.2221 ++// GNU General Public License for more details.
463.2222 ++
463.2223 ++// You should have received a copy of the GNU General Public License along
463.2224 ++// with this library; see the file COPYING.  If not, write to the Free
463.2225 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
463.2226 ++// USA.
463.2227 ++
463.2228 ++// As a special exception, you may use this file as part of a free software
463.2229 ++// library without restriction.  Specifically, if other files instantiate
463.2230 ++// templates or use macros or inline functions from this file, or you compile
463.2231 ++// this file and link it with other files to produce an executable, this
463.2232 ++// file does not by itself cause the resulting executable to be covered by
463.2233 ++// the GNU General Public License.  This exception does not however
463.2234 ++// invalidate any other reasons why the executable file might be covered by
463.2235 ++// the GNU General Public License.
463.2236 ++
463.2237 ++//
463.2238 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
463.2239 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
463.2240 ++//
463.2241 ++
463.2242 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
463.2243 ++
463.2244 ++#include <locale>
463.2245 ++#include <bits/c++locale_internal.h>
463.2246 ++
463.2247 ++#ifdef __UCLIBC_MJN3_ONLY__
463.2248 ++#warning tailor for stub locale support
463.2249 ++#endif
463.2250 ++#ifndef __UCLIBC_HAS_XLOCALE__
463.2251 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
463.2252 ++#endif
463.2253 ++
463.2254 ++namespace std
463.2255 ++{
463.2256 ++  template<>
463.2257 ++    void
463.2258 ++    __timepunct<char>::
463.2259 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
463.2260 ++	   const tm* __tm) const
463.2261 ++    {
463.2262 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.2263 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
463.2264 ++					_M_c_locale_timepunct);
463.2265 ++#else
463.2266 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
463.2267 ++      setlocale(LC_ALL, _M_name_timepunct);
463.2268 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
463.2269 ++      setlocale(LC_ALL, __old);
463.2270 ++      free(__old);
463.2271 ++#endif
463.2272 ++      // Make sure __s is null terminated.
463.2273 ++      if (__len == 0)
463.2274 ++	__s[0] = '\0';
463.2275 ++    }
463.2276 ++
463.2277 ++  template<> 
463.2278 ++    void
463.2279 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
463.2280 ++    {
463.2281 ++      if (!_M_data)
463.2282 ++	_M_data = new __timepunct_cache<char>;
463.2283 ++
463.2284 ++      if (!__cloc)
463.2285 ++	{
463.2286 ++	  // "C" locale
463.2287 ++	  _M_c_locale_timepunct = _S_get_c_locale();
463.2288 ++
463.2289 ++	  _M_data->_M_date_format = "%m/%d/%y";
463.2290 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
463.2291 ++	  _M_data->_M_time_format = "%H:%M:%S";
463.2292 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
463.2293 ++	  _M_data->_M_date_time_format = "";
463.2294 ++	  _M_data->_M_date_time_era_format = "";
463.2295 ++	  _M_data->_M_am = "AM";
463.2296 ++	  _M_data->_M_pm = "PM";
463.2297 ++	  _M_data->_M_am_pm_format = "";
463.2298 ++
463.2299 ++	  // Day names, starting with "C"'s Sunday.
463.2300 ++	  _M_data->_M_day1 = "Sunday";
463.2301 ++	  _M_data->_M_day2 = "Monday";
463.2302 ++	  _M_data->_M_day3 = "Tuesday";
463.2303 ++	  _M_data->_M_day4 = "Wednesday";
463.2304 ++	  _M_data->_M_day5 = "Thursday";
463.2305 ++	  _M_data->_M_day6 = "Friday";
463.2306 ++	  _M_data->_M_day7 = "Saturday";
463.2307 ++
463.2308 ++	  // Abbreviated day names, starting with "C"'s Sun.
463.2309 ++	  _M_data->_M_aday1 = "Sun";
463.2310 ++	  _M_data->_M_aday2 = "Mon";
463.2311 ++	  _M_data->_M_aday3 = "Tue";
463.2312 ++	  _M_data->_M_aday4 = "Wed";
463.2313 ++	  _M_data->_M_aday5 = "Thu";
463.2314 ++	  _M_data->_M_aday6 = "Fri";
463.2315 ++	  _M_data->_M_aday7 = "Sat";
463.2316 ++
463.2317 ++	  // Month names, starting with "C"'s January.
463.2318 ++	  _M_data->_M_month01 = "January";
463.2319 ++	  _M_data->_M_month02 = "February";
463.2320 ++	  _M_data->_M_month03 = "March";
463.2321 ++	  _M_data->_M_month04 = "April";
463.2322 ++	  _M_data->_M_month05 = "May";
463.2323 ++	  _M_data->_M_month06 = "June";
463.2324 ++	  _M_data->_M_month07 = "July";
463.2325 ++	  _M_data->_M_month08 = "August";
463.2326 ++	  _M_data->_M_month09 = "September";
463.2327 ++	  _M_data->_M_month10 = "October";
463.2328 ++	  _M_data->_M_month11 = "November";
463.2329 ++	  _M_data->_M_month12 = "December";
463.2330 ++
463.2331 ++	  // Abbreviated month names, starting with "C"'s Jan.
463.2332 ++	  _M_data->_M_amonth01 = "Jan";
463.2333 ++	  _M_data->_M_amonth02 = "Feb";
463.2334 ++	  _M_data->_M_amonth03 = "Mar";
463.2335 ++	  _M_data->_M_amonth04 = "Apr";
463.2336 ++	  _M_data->_M_amonth05 = "May";
463.2337 ++	  _M_data->_M_amonth06 = "Jun";
463.2338 ++	  _M_data->_M_amonth07 = "Jul";
463.2339 ++	  _M_data->_M_amonth08 = "Aug";
463.2340 ++	  _M_data->_M_amonth09 = "Sep";
463.2341 ++	  _M_data->_M_amonth10 = "Oct";
463.2342 ++	  _M_data->_M_amonth11 = "Nov";
463.2343 ++	  _M_data->_M_amonth12 = "Dec";
463.2344 ++	}
463.2345 ++      else
463.2346 ++	{
463.2347 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
463.2348 ++
463.2349 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
463.2350 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
463.2351 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
463.2352 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
463.2353 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
463.2354 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
463.2355 ++							     __cloc);
463.2356 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
463.2357 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
463.2358 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
463.2359 ++
463.2360 ++	  // Day names, starting with "C"'s Sunday.
463.2361 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
463.2362 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
463.2363 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
463.2364 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
463.2365 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
463.2366 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
463.2367 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
463.2368 ++
463.2369 ++	  // Abbreviated day names, starting with "C"'s Sun.
463.2370 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
463.2371 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
463.2372 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
463.2373 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
463.2374 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
463.2375 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
463.2376 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
463.2377 ++
463.2378 ++	  // Month names, starting with "C"'s January.
463.2379 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
463.2380 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
463.2381 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
463.2382 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
463.2383 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
463.2384 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
463.2385 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
463.2386 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
463.2387 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
463.2388 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
463.2389 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
463.2390 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
463.2391 ++
463.2392 ++	  // Abbreviated month names, starting with "C"'s Jan.
463.2393 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
463.2394 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
463.2395 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
463.2396 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
463.2397 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
463.2398 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
463.2399 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
463.2400 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
463.2401 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
463.2402 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
463.2403 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
463.2404 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
463.2405 ++	}
463.2406 ++    }
463.2407 ++
463.2408 ++#ifdef _GLIBCXX_USE_WCHAR_T
463.2409 ++  template<>
463.2410 ++    void
463.2411 ++    __timepunct<wchar_t>::
463.2412 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
463.2413 ++	   const tm* __tm) const
463.2414 ++    {
463.2415 ++#ifdef __UCLIBC_HAS_XLOCALE__
463.2416 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
463.2417 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
463.2418 ++					_M_c_locale_timepunct);
463.2419 ++#else
463.2420 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
463.2421 ++      setlocale(LC_ALL, _M_name_timepunct);
463.2422 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
463.2423 ++      setlocale(LC_ALL, __old);
463.2424 ++      free(__old);
463.2425 ++#endif
463.2426 ++      // Make sure __s is null terminated.
463.2427 ++      if (__len == 0)
463.2428 ++	__s[0] = L'\0';
463.2429 ++    }
463.2430 ++
463.2431 ++  template<> 
463.2432 ++    void
463.2433 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
463.2434 ++    {
463.2435 ++      if (!_M_data)
463.2436 ++	_M_data = new __timepunct_cache<wchar_t>;
463.2437 ++
463.2438 ++#warning wide time stuff
463.2439 ++//       if (!__cloc)
463.2440 ++	{
463.2441 ++	  // "C" locale
463.2442 ++	  _M_c_locale_timepunct = _S_get_c_locale();
463.2443 ++
463.2444 ++	  _M_data->_M_date_format = L"%m/%d/%y";
463.2445 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
463.2446 ++	  _M_data->_M_time_format = L"%H:%M:%S";
463.2447 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
463.2448 ++	  _M_data->_M_date_time_format = L"";
463.2449 ++	  _M_data->_M_date_time_era_format = L"";
463.2450 ++	  _M_data->_M_am = L"AM";
463.2451 ++	  _M_data->_M_pm = L"PM";
463.2452 ++	  _M_data->_M_am_pm_format = L"";
463.2453 ++
463.2454 ++	  // Day names, starting with "C"'s Sunday.
463.2455 ++	  _M_data->_M_day1 = L"Sunday";
463.2456 ++	  _M_data->_M_day2 = L"Monday";
463.2457 ++	  _M_data->_M_day3 = L"Tuesday";
463.2458 ++	  _M_data->_M_day4 = L"Wednesday";
463.2459 ++	  _M_data->_M_day5 = L"Thursday";
463.2460 ++	  _M_data->_M_day6 = L"Friday";
463.2461 ++	  _M_data->_M_day7 = L"Saturday";
463.2462 ++
463.2463 ++	  // Abbreviated day names, starting with "C"'s Sun.
463.2464 ++	  _M_data->_M_aday1 = L"Sun";
463.2465 ++	  _M_data->_M_aday2 = L"Mon";
463.2466 ++	  _M_data->_M_aday3 = L"Tue";
463.2467 ++	  _M_data->_M_aday4 = L"Wed";
463.2468 ++	  _M_data->_M_aday5 = L"Thu";
463.2469 ++	  _M_data->_M_aday6 = L"Fri";
463.2470 ++	  _M_data->_M_aday7 = L"Sat";
463.2471 ++
463.2472 ++	  // Month names, starting with "C"'s January.
463.2473 ++	  _M_data->_M_month01 = L"January";
463.2474 ++	  _M_data->_M_month02 = L"February";
463.2475 ++	  _M_data->_M_month03 = L"March";
463.2476 ++	  _M_data->_M_month04 = L"April";
463.2477 ++	  _M_data->_M_month05 = L"May";
463.2478 ++	  _M_data->_M_month06 = L"June";
463.2479 ++	  _M_data->_M_month07 = L"July";
463.2480 ++	  _M_data->_M_month08 = L"August";
463.2481 ++	  _M_data->_M_month09 = L"September";
463.2482 ++	  _M_data->_M_month10 = L"October";
463.2483 ++	  _M_data->_M_month11 = L"November";
463.2484 ++	  _M_data->_M_month12 = L"December";
463.2485 ++
463.2486 ++	  // Abbreviated month names, starting with "C"'s Jan.
463.2487 ++	  _M_data->_M_amonth01 = L"Jan";
463.2488 ++	  _M_data->_M_amonth02 = L"Feb";
463.2489 ++	  _M_data->_M_amonth03 = L"Mar";
463.2490 ++	  _M_data->_M_amonth04 = L"Apr";
463.2491 ++	  _M_data->_M_amonth05 = L"May";
463.2492 ++	  _M_data->_M_amonth06 = L"Jun";
463.2493 ++	  _M_data->_M_amonth07 = L"Jul";
463.2494 ++	  _M_data->_M_amonth08 = L"Aug";
463.2495 ++	  _M_data->_M_amonth09 = L"Sep";
463.2496 ++	  _M_data->_M_amonth10 = L"Oct";
463.2497 ++	  _M_data->_M_amonth11 = L"Nov";
463.2498 ++	  _M_data->_M_amonth12 = L"Dec";
463.2499 ++	}
463.2500 ++#if 0
463.2501 ++      else
463.2502 ++	{
463.2503 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
463.2504 ++
463.2505 ++	  union { char *__s; wchar_t *__w; } __u;
463.2506 ++
463.2507 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
463.2508 ++	  _M_data->_M_date_format = __u.__w;
463.2509 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
463.2510 ++	  _M_data->_M_date_era_format = __u.__w;
463.2511 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
463.2512 ++	  _M_data->_M_time_format = __u.__w;
463.2513 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
463.2514 ++	  _M_data->_M_time_era_format = __u.__w;
463.2515 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
463.2516 ++	  _M_data->_M_date_time_format = __u.__w;
463.2517 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
463.2518 ++	  _M_data->_M_date_time_era_format = __u.__w;
463.2519 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
463.2520 ++	  _M_data->_M_am = __u.__w;
463.2521 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
463.2522 ++	  _M_data->_M_pm = __u.__w;
463.2523 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
463.2524 ++	  _M_data->_M_am_pm_format = __u.__w;
463.2525 ++
463.2526 ++	  // Day names, starting with "C"'s Sunday.
463.2527 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
463.2528 ++	  _M_data->_M_day1 = __u.__w;
463.2529 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
463.2530 ++	  _M_data->_M_day2 = __u.__w;
463.2531 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
463.2532 ++	  _M_data->_M_day3 = __u.__w;
463.2533 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
463.2534 ++	  _M_data->_M_day4 = __u.__w;
463.2535 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
463.2536 ++	  _M_data->_M_day5 = __u.__w;
463.2537 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
463.2538 ++	  _M_data->_M_day6 = __u.__w;
463.2539 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
463.2540 ++	  _M_data->_M_day7 = __u.__w;
463.2541 ++
463.2542 ++	  // Abbreviated day names, starting with "C"'s Sun.
463.2543 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
463.2544 ++	  _M_data->_M_aday1 = __u.__w;
463.2545 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
463.2546 ++	  _M_data->_M_aday2 = __u.__w;
463.2547 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
463.2548 ++	  _M_data->_M_aday3 = __u.__w;
463.2549 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
463.2550 ++	  _M_data->_M_aday4 = __u.__w;
463.2551 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
463.2552 ++	  _M_data->_M_aday5 = __u.__w;
463.2553 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
463.2554 ++	  _M_data->_M_aday6 = __u.__w;
463.2555 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
463.2556 ++	  _M_data->_M_aday7 = __u.__w;
463.2557 ++
463.2558 ++	  // Month names, starting with "C"'s January.
463.2559 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
463.2560 ++	  _M_data->_M_month01 = __u.__w;
463.2561 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
463.2562 ++	  _M_data->_M_month02 = __u.__w;
463.2563 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
463.2564 ++	  _M_data->_M_month03 = __u.__w;
463.2565 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
463.2566 ++	  _M_data->_M_month04 = __u.__w;
463.2567 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
463.2568 ++	  _M_data->_M_month05 = __u.__w;
463.2569 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
463.2570 ++	  _M_data->_M_month06 = __u.__w;
463.2571 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
463.2572 ++	  _M_data->_M_month07 = __u.__w;
463.2573 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
463.2574 ++	  _M_data->_M_month08 = __u.__w;
463.2575 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
463.2576 ++	  _M_data->_M_month09 = __u.__w;
463.2577 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
463.2578 ++	  _M_data->_M_month10 = __u.__w;
463.2579 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
463.2580 ++	  _M_data->_M_month11 = __u.__w;
463.2581 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
463.2582 ++	  _M_data->_M_month12 = __u.__w;
463.2583 ++
463.2584 ++	  // Abbreviated month names, starting with "C"'s Jan.
463.2585 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
463.2586 ++	  _M_data->_M_amonth01 = __u.__w;
463.2587 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
463.2588 ++	  _M_data->_M_amonth02 = __u.__w;
463.2589 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
463.2590 ++	  _M_data->_M_amonth03 = __u.__w;
463.2591 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
463.2592 ++	  _M_data->_M_amonth04 = __u.__w;
463.2593 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
463.2594 ++	  _M_data->_M_amonth05 = __u.__w;
463.2595 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
463.2596 ++	  _M_data->_M_amonth06 = __u.__w;
463.2597 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
463.2598 ++	  _M_data->_M_amonth07 = __u.__w;
463.2599 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
463.2600 ++	  _M_data->_M_amonth08 = __u.__w;
463.2601 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
463.2602 ++	  _M_data->_M_amonth09 = __u.__w;
463.2603 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
463.2604 ++	  _M_data->_M_amonth10 = __u.__w;
463.2605 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
463.2606 ++	  _M_data->_M_amonth11 = __u.__w;
463.2607 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
463.2608 ++	  _M_data->_M_amonth12 = __u.__w;
463.2609 ++	}
463.2610 ++#endif // 0
463.2611 ++    }
463.2612 ++#endif
463.2613 ++}
463.2614 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
463.2615 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
463.2616 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:39.000000000 +0200
463.2617 +@@ -0,0 +1,68 @@
463.2618 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
463.2619 ++
463.2620 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
463.2621 ++//
463.2622 ++// This file is part of the GNU ISO C++ Library.  This library is free
463.2623 ++// software; you can redistribute it and/or modify it under the
463.2624 ++// terms of the GNU General Public License as published by the
463.2625 ++// Free Software Foundation; either version 2, or (at your option)
463.2626 ++// any later version.
463.2627 ++
463.2628 ++// This library is distributed in the hope that it will be useful,
463.2629 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
463.2630 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
463.2631 ++// GNU General Public License for more details.
463.2632 ++
463.2633 ++// You should have received a copy of the GNU General Public License along
463.2634 ++// with this library; see the file COPYING.  If not, write to the Free
463.2635 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
463.2636 ++// USA.
463.2637 ++
463.2638 ++// As a special exception, you may use this file as part of a free software
463.2639 ++// library without restriction.  Specifically, if other files instantiate
463.2640 ++// templates or use macros or inline functions from this file, or you compile
463.2641 ++// this file and link it with other files to produce an executable, this
463.2642 ++// file does not by itself cause the resulting executable to be covered by
463.2643 ++// the GNU General Public License.  This exception does not however
463.2644 ++// invalidate any other reasons why the executable file might be covered by
463.2645 ++// the GNU General Public License.
463.2646 ++
463.2647 ++//
463.2648 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
463.2649 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
463.2650 ++//
463.2651 ++
463.2652 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
463.2653 ++
463.2654 ++  template<typename _CharT>
463.2655 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
463.2656 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
463.2657 ++    _M_name_timepunct(_S_get_c_name())
463.2658 ++    { _M_initialize_timepunct(); }
463.2659 ++
463.2660 ++  template<typename _CharT>
463.2661 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
463.2662 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
463.2663 ++    _M_name_timepunct(_S_get_c_name())
463.2664 ++    { _M_initialize_timepunct(); }
463.2665 ++
463.2666 ++  template<typename _CharT>
463.2667 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
463.2668 ++				     size_t __refs) 
463.2669 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
463.2670 ++    _M_name_timepunct(__s)
463.2671 ++    { 
463.2672 ++      char* __tmp = new char[std::strlen(__s) + 1];
463.2673 ++      std::strcpy(__tmp, __s);
463.2674 ++      _M_name_timepunct = __tmp;
463.2675 ++      _M_initialize_timepunct(__cloc); 
463.2676 ++    }
463.2677 ++
463.2678 ++  template<typename _CharT>
463.2679 ++    __timepunct<_CharT>::~__timepunct()
463.2680 ++    { 
463.2681 ++      if (_M_name_timepunct != _S_get_c_name())
463.2682 ++	delete [] _M_name_timepunct;
463.2683 ++      delete _M_data; 
463.2684 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
463.2685 ++    }
463.2686 +diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
463.2687 +--- gcc-4.3.1.orig/libstdc++-v3/configure	2008-04-25 18:52:57.000000000 +0200
463.2688 ++++ gcc-4.3.1/libstdc++-v3/configure	2008-06-10 14:58:39.000000000 +0200
463.2689 +@@ -14001,7 +14001,7 @@
463.2690 +   enableval="$enable_clocale"
463.2691 + 
463.2692 +       case "$enableval" in
463.2693 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
463.2694 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
463.2695 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
463.2696 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
463.2697 +    { (exit 1); exit 1; }; } ;;
463.2698 +@@ -14034,6 +14034,9 @@
463.2699 +   # Default to "generic".
463.2700 +   if test $enable_clocale_flag = auto; then
463.2701 +     case ${target_os} in
463.2702 ++      linux-uclibc*)
463.2703 ++        enable_clocale_flag=uclibc
463.2704 ++	;;
463.2705 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
463.2706 +         enable_clocale_flag=gnu
463.2707 +         ;;
463.2708 +@@ -14422,6 +14425,76 @@
463.2709 +       CTIME_CC=config/locale/generic/time_members.cc
463.2710 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
463.2711 +       ;;
463.2712 ++    uclibc)
463.2713 ++      echo "$as_me:$LINENO: result: uclibc" >&5
463.2714 ++echo "${ECHO_T}uclibc" >&6
463.2715 ++
463.2716 ++      # Declare intention to use gettext, and add support for specific
463.2717 ++      # languages.
463.2718 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
463.2719 ++      ALL_LINGUAS="de fr"
463.2720 ++
463.2721 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
463.2722 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
463.2723 ++set dummy msgfmt; ac_word=$2
463.2724 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
463.2725 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
463.2726 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
463.2727 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
463.2728 ++else
463.2729 ++  if test -n "$check_msgfmt"; then
463.2730 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
463.2731 ++else
463.2732 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
463.2733 ++for as_dir in $PATH
463.2734 ++do
463.2735 ++  IFS=$as_save_IFS
463.2736 ++  test -z "$as_dir" && as_dir=.
463.2737 ++  for ac_exec_ext in '' $ac_executable_extensions; do
463.2738 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
463.2739 ++    ac_cv_prog_check_msgfmt="yes"
463.2740 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
463.2741 ++    break 2
463.2742 ++  fi
463.2743 ++done
463.2744 ++done
463.2745 ++
463.2746 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
463.2747 ++fi
463.2748 ++fi
463.2749 ++check_msgfmt=$ac_cv_prog_check_msgfmt
463.2750 ++if test -n "$check_msgfmt"; then
463.2751 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
463.2752 ++echo "${ECHO_T}$check_msgfmt" >&6
463.2753 ++else
463.2754 ++  echo "$as_me:$LINENO: result: no" >&5
463.2755 ++echo "${ECHO_T}no" >&6
463.2756 ++fi
463.2757 ++
463.2758 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
463.2759 ++        USE_NLS=yes
463.2760 ++      fi
463.2761 ++      # Export the build objects.
463.2762 ++      for ling in $ALL_LINGUAS; do \
463.2763 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
463.2764 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
463.2765 ++      done
463.2766 ++
463.2767 ++
463.2768 ++
463.2769 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
463.2770 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
463.2771 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
463.2772 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
463.2773 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
463.2774 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
463.2775 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
463.2776 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
463.2777 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
463.2778 ++      CTIME_H=config/locale/uclibc/time_members.h
463.2779 ++      CTIME_CC=config/locale/uclibc/time_members.cc
463.2780 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
463.2781 ++      ;;
463.2782 +   esac
463.2783 + 
463.2784 +   # This is where the testsuite looks for locale catalogs, using the
463.2785 +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h
463.2786 +--- gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2007-03-04 23:59:49.000000000 +0100
463.2787 ++++ gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h	2008-06-10 14:58:39.000000000 +0200
463.2788 +@@ -106,7 +106,9 @@
463.2789 + using std::wmemcpy;
463.2790 + using std::wmemmove;
463.2791 + using std::wmemset;
463.2792 ++#if _GLIBCXX_HAVE_WCSFTIME
463.2793 + using std::wcsftime;
463.2794 ++#endif
463.2795 + 
463.2796 + #if _GLIBCXX_USE_C99
463.2797 + using std::wcstold;
   464.1 --- a/patches/gcc/4.3.1/275-libiberty-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   464.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   464.3 @@ -1,12 +0,0 @@
   464.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/51_all_gcc-3.4-libiberty-pic.patch
   464.5 -diff -durN gcc-4.3.1.orig/libiberty/Makefile.in gcc-4.3.1/libiberty/Makefile.in
   464.6 ---- gcc-4.3.1.orig/libiberty/Makefile.in	2007-07-25 08:26:45.000000000 +0200
   464.7 -+++ gcc-4.3.1/libiberty/Makefile.in	2008-06-10 14:58:02.000000000 +0200
   464.8 -@@ -225,6 +225,7 @@
   464.9 - 	  $(AR) $(AR_FLAGS) $(TARGETLIB) \
  464.10 - 	    $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
  464.11 - 	  $(RANLIB) $(TARGETLIB); \
  464.12 -+	  cp $(TARGETLIB) ../ ; \
  464.13 - 	  cd ..; \
  464.14 - 	else true; fi
  464.15 - 
   465.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   465.2 +++ b/patches/gcc/4.3.1/280-uclibc-locale-no__x.patch	Mon Jul 28 21:32:33 2008 +0000
   465.3 @@ -0,0 +1,224 @@
   465.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_203-uclibc-locale-no__x.patch
   465.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
   465.6 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:43.000000000 +0200
   465.7 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:43.000000000 +0200
   465.8 +@@ -60,4 +60,49 @@
   465.9 + extern "C" __typeof(wctype_l) __wctype_l;
  465.10 + #endif 
  465.11 + 
  465.12 ++# define __nl_langinfo_l nl_langinfo_l
  465.13 ++# define __strcoll_l strcoll_l
  465.14 ++# define __strftime_l strftime_l
  465.15 ++# define __strtod_l strtod_l
  465.16 ++# define __strtof_l strtof_l
  465.17 ++# define __strtold_l strtold_l
  465.18 ++# define __strxfrm_l strxfrm_l
  465.19 ++# define __newlocale newlocale
  465.20 ++# define __freelocale freelocale
  465.21 ++# define __duplocale duplocale
  465.22 ++# define __uselocale uselocale
  465.23 ++
  465.24 ++# ifdef _GLIBCXX_USE_WCHAR_T
  465.25 ++#  define __iswctype_l iswctype_l
  465.26 ++#  define __towlower_l towlower_l
  465.27 ++#  define __towupper_l towupper_l
  465.28 ++#  define __wcscoll_l wcscoll_l
  465.29 ++#  define __wcsftime_l wcsftime_l
  465.30 ++#  define __wcsxfrm_l wcsxfrm_l
  465.31 ++#  define __wctype_l wctype_l
  465.32 ++# endif
  465.33 ++
  465.34 ++#else
  465.35 ++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  465.36 ++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  465.37 ++# define __strtod_l(S, E, L)         strtod((S), (E))
  465.38 ++# define __strtof_l(S, E, L)         strtof((S), (E))
  465.39 ++# define __strtold_l(S, E, L)        strtold((S), (E))
  465.40 ++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  465.41 ++# warning should dummy __newlocale check for C|POSIX ?
  465.42 ++# define __newlocale(a, b, c)        NULL
  465.43 ++# define __freelocale(a)             ((void)0)
  465.44 ++# define __duplocale(a)              __c_locale()
  465.45 ++//# define __uselocale ?
  465.46 ++//
  465.47 ++# ifdef _GLIBCXX_USE_WCHAR_T
  465.48 ++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  465.49 ++#  define __towlower_l(C, L)          towlower((C))
  465.50 ++#  define __towupper_l(C, L)          towupper((C))
  465.51 ++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  465.52 ++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  465.53 ++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  465.54 ++#  define __wctype_l(S, L)            wctype((S))
  465.55 ++# endif
  465.56 ++
  465.57 + #endif // GLIBC 2.3 and later
  465.58 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
  465.59 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:43.000000000 +0200
  465.60 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:43.000000000 +0200
  465.61 +@@ -39,20 +39,6 @@
  465.62 + #include <langinfo.h>
  465.63 + #include <bits/c++locale_internal.h>
  465.64 + 
  465.65 +-#ifndef __UCLIBC_HAS_XLOCALE__
  465.66 +-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  465.67 +-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  465.68 +-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  465.69 +-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  465.70 +-#define __strtof_l(S, E, L)         strtof((S), (E))
  465.71 +-#define __strtod_l(S, E, L)         strtod((S), (E))
  465.72 +-#define __strtold_l(S, E, L)        strtold((S), (E))
  465.73 +-#warning should dummy __newlocale check for C|POSIX ?
  465.74 +-#define __newlocale(a, b, c)        NULL
  465.75 +-#define __freelocale(a)             ((void)0)
  465.76 +-#define __duplocale(a)              __c_locale()
  465.77 +-#endif
  465.78 +-
  465.79 + namespace std 
  465.80 + {
  465.81 +   template<>
  465.82 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  465.83 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:43.000000000 +0200
  465.84 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:43.000000000 +0200
  465.85 +@@ -68,6 +68,7 @@
  465.86 + {
  465.87 +   extern "C" __typeof(uselocale) __uselocale;
  465.88 + }
  465.89 ++#define __uselocale uselocale
  465.90 + #endif
  465.91 + 
  465.92 + namespace std
  465.93 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
  465.94 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:43.000000000 +0200
  465.95 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:43.000000000 +0200
  465.96 +@@ -36,13 +36,6 @@
  465.97 + #include <locale>
  465.98 + #include <bits/c++locale_internal.h>
  465.99 + 
 465.100 +-#ifndef __UCLIBC_HAS_XLOCALE__
 465.101 +-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 465.102 +-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 465.103 +-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 465.104 +-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 465.105 +-#endif
 465.106 +-
 465.107 + namespace std
 465.108 + {
 465.109 +   // These are basically extensions to char_traits, and perhaps should
 465.110 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 465.111 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:43.000000000 +0200
 465.112 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:43.000000000 +0200
 465.113 +@@ -38,13 +38,6 @@
 465.114 + #undef _LIBC
 465.115 + #include <bits/c++locale_internal.h>
 465.116 + 
 465.117 +-#ifndef __UCLIBC_HAS_XLOCALE__
 465.118 +-#define __wctype_l(S, L)           wctype((S))
 465.119 +-#define __towupper_l(C, L)         towupper((C))
 465.120 +-#define __towlower_l(C, L)         towlower((C))
 465.121 +-#define __iswctype_l(C, M, L)      iswctype((C), (M))
 465.122 +-#endif
 465.123 +-
 465.124 + namespace std
 465.125 + {
 465.126 +   // NB: The other ctype<char> specializations are in src/locale.cc and
 465.127 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
 465.128 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:43.000000000 +0200
 465.129 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:43.000000000 +0200
 465.130 +@@ -39,13 +39,10 @@
 465.131 + #ifdef __UCLIBC_MJN3_ONLY__
 465.132 + #warning fix gettext stuff
 465.133 + #endif
 465.134 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 465.135 +-extern "C" char *__dcgettext(const char *domainname,
 465.136 +-			     const char *msgid, int category);
 465.137 + #undef gettext
 465.138 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 465.139 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 465.140 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 465.141 + #else
 465.142 +-#undef gettext
 465.143 + #define gettext(msgid) (msgid)
 465.144 + #endif
 465.145 + 
 465.146 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 465.147 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:43.000000000 +0200
 465.148 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:43.000000000 +0200
 465.149 +@@ -36,15 +36,11 @@
 465.150 + #ifdef __UCLIBC_MJN3_ONLY__
 465.151 + #warning fix prototypes for *textdomain funcs
 465.152 + #endif
 465.153 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 465.154 +-extern "C" char *__textdomain(const char *domainname);
 465.155 +-extern "C" char *__bindtextdomain(const char *domainname,
 465.156 +-				  const char *dirname);
 465.157 +-#else
 465.158 +-#undef __textdomain
 465.159 +-#undef __bindtextdomain
 465.160 +-#define __textdomain(D)           ((void)0)
 465.161 +-#define __bindtextdomain(D,P)     ((void)0)
 465.162 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 465.163 ++#undef textdomain
 465.164 ++#undef bindtextdomain
 465.165 ++#define textdomain(D)           ((void)0)
 465.166 ++#define bindtextdomain(D,P)     ((void)0)
 465.167 + #endif
 465.168 + 
 465.169 +   // Non-virtual member functions.
 465.170 +@@ -70,7 +66,7 @@
 465.171 +     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 465.172 + 			   const char* __dir) const
 465.173 +     { 
 465.174 +-      __bindtextdomain(__s.c_str(), __dir);
 465.175 ++      bindtextdomain(__s.c_str(), __dir);
 465.176 +       return this->do_open(__s, __loc); 
 465.177 +     }
 465.178 + 
 465.179 +@@ -90,7 +86,7 @@
 465.180 +     { 
 465.181 +       // No error checking is done, assume the catalog exists and can
 465.182 +       // be used.
 465.183 +-      __textdomain(__s.c_str());
 465.184 ++      textdomain(__s.c_str());
 465.185 +       return 0;
 465.186 +     }
 465.187 + 
 465.188 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 465.189 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:43.000000000 +0200
 465.190 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:43.000000000 +0200
 465.191 +@@ -43,10 +43,6 @@
 465.192 + #warning tailor for stub locale support
 465.193 + #endif
 465.194 + 
 465.195 +-#ifndef __UCLIBC_HAS_XLOCALE__
 465.196 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 465.197 +-#endif
 465.198 +-
 465.199 + namespace std
 465.200 + {
 465.201 +   // Construct and return valid pattern consisting of some combination of:
 465.202 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 465.203 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:43.000000000 +0200
 465.204 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:43.000000000 +0200
 465.205 +@@ -41,9 +41,6 @@
 465.206 + #ifdef __UCLIBC_MJN3_ONLY__
 465.207 + #warning tailor for stub locale support
 465.208 + #endif
 465.209 +-#ifndef __UCLIBC_HAS_XLOCALE__
 465.210 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 465.211 +-#endif
 465.212 + 
 465.213 + namespace std
 465.214 + {
 465.215 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc
 465.216 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:43.000000000 +0200
 465.217 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:43.000000000 +0200
 465.218 +@@ -40,9 +40,6 @@
 465.219 + #ifdef __UCLIBC_MJN3_ONLY__
 465.220 + #warning tailor for stub locale support
 465.221 + #endif
 465.222 +-#ifndef __UCLIBC_HAS_XLOCALE__
 465.223 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 465.224 +-#endif
 465.225 + 
 465.226 + namespace std
 465.227 + {
   466.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   466.2 +++ b/patches/gcc/4.3.1/290-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:32:33 2008 +0000
   466.3 @@ -0,0 +1,51 @@
   466.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
   466.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   466.6 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:47.000000000 +0200
   466.7 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:47.000000000 +0200
   466.8 +@@ -401,7 +401,7 @@
   466.9 + # ifdef __UCLIBC_HAS_XLOCALE__
  466.10 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  466.11 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  466.12 +-# else
  466.13 ++# elif defined __UCLIBC_HAS_LOCALE__
  466.14 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  466.15 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  466.16 + # endif
  466.17 +@@ -556,7 +556,7 @@
  466.18 + # ifdef __UCLIBC_HAS_XLOCALE__
  466.19 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  466.20 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  466.21 +-# else
  466.22 ++# elif defined __UCLIBC_HAS_LOCALE__
  466.23 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  466.24 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  466.25 + # endif
  466.26 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  466.27 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:47.000000000 +0200
  466.28 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:47.000000000 +0200
  466.29 +@@ -127,12 +127,25 @@
  466.30 + 	{
  466.31 + 	  // Named locale.
  466.32 + 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  466.33 ++#ifdef __UCLIBC_MJN3_ONLY__
  466.34 ++#warning fix this... should be numeric
  466.35 ++#endif
  466.36 ++#ifdef __UCLIBC__
  466.37 ++# ifdef __UCLIBC_HAS_XLOCALE__
  466.38 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  466.39 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  466.40 ++# elif defined __UCLIBC_HAS_LOCALE__
  466.41 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  466.42 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  466.43 ++# endif
  466.44 ++#else
  466.45 + 	  union { char *__s; wchar_t __w; } __u;
  466.46 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  466.47 + 	  _M_data->_M_decimal_point = __u.__w;
  466.48 + 
  466.49 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  466.50 + 	  _M_data->_M_thousands_sep = __u.__w;
  466.51 ++#endif
  466.52 + 
  466.53 + 	  if (_M_data->_M_thousands_sep == L'\0')
  466.54 + 	    _M_data->_M_grouping = "";
   467.1 --- a/patches/gcc/4.3.1/300-superh-default-multilib.patch	Mon Jul 28 21:08:01 2008 +0000
   467.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   467.3 @@ -1,25 +0,0 @@
   467.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/53_all_gcc4-superh-default-multilib.patch
   467.5 -The gcc-3.x toolchains would contain all the targets by default.  With gcc-4,
   467.6 -you have to actually list out the multilibs you want or you will end up with
   467.7 -just one when using targets like 'sh4-linux-gnu'.
   467.8 -
   467.9 -The resulting toolchain can't even build a kernel as the kernel needs to build
  467.10 -with the nofpu flag to be sure that no fpu ops are generated.
  467.11 -
  467.12 -Here we restore the gcc-3.x behavior; the additional overhead of building all
  467.13 -of these multilibs by default is negligible.
  467.14 -
  467.15 -http://bugs.gentoo.org/140205
  467.16 -
  467.17 -diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc
  467.18 ---- gcc-4.3.1.orig/gcc/config.gcc	2008-05-21 10:54:15.000000000 +0200
  467.19 -+++ gcc-4.3.1/gcc/config.gcc	2008-06-10 14:58:06.000000000 +0200
  467.20 -@@ -2278,7 +2278,7 @@
  467.21 - 	if test x${sh_multilibs} = x ; then
  467.22 - 		case ${target} in
  467.23 - 		sh64-superh-linux* | \
  467.24 --		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
  467.25 -+		sh[1234]*)	sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
  467.26 - 		sh64* | sh5*)	sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
  467.27 - 		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
  467.28 - 		sh*-*-linux*)	sh_multilibs=m1,m3e,m4 ;;
   468.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   468.2 +++ b/patches/gcc/4.3.1/300-uclibc-locale-update.patch	Mon Jul 28 21:32:33 2008 +0000
   468.3 @@ -0,0 +1,355 @@
   468.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_205-uclibc-locale-update.patch
   468.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   468.6 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:47.000000000 +0200
   468.7 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:51.000000000 +0200
   468.8 +@@ -46,16 +46,13 @@
   468.9 +     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
  468.10 + 		   const __c_locale& __cloc)
  468.11 +     {
  468.12 +-      if (!(__err & ios_base::failbit))
  468.13 +-	{
  468.14 +-	  char* __sanity;
  468.15 +-	  errno = 0;
  468.16 +-	  float __f = __strtof_l(__s, &__sanity, __cloc);
  468.17 +-          if (__sanity != __s && errno != ERANGE)
  468.18 +-	    __v = __f;
  468.19 +-	  else
  468.20 +-	    __err |= ios_base::failbit;
  468.21 +-	}
  468.22 ++      char* __sanity;
  468.23 ++      errno = 0;
  468.24 ++      float __f = __strtof_l(__s, &__sanity, __cloc);
  468.25 ++      if (__sanity != __s && errno != ERANGE)
  468.26 ++	__v = __f;
  468.27 ++      else
  468.28 ++	__err |= ios_base::failbit;
  468.29 +     }
  468.30 + 
  468.31 +   template<>
  468.32 +@@ -63,16 +60,13 @@
  468.33 +     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  468.34 + 		   const __c_locale& __cloc)
  468.35 +     {
  468.36 +-      if (!(__err & ios_base::failbit))
  468.37 +-	{
  468.38 +-	  char* __sanity;
  468.39 +-	  errno = 0;
  468.40 +-	  double __d = __strtod_l(__s, &__sanity, __cloc);
  468.41 +-          if (__sanity != __s && errno != ERANGE)
  468.42 +-	    __v = __d;
  468.43 +-	  else
  468.44 +-	    __err |= ios_base::failbit;
  468.45 +-	}
  468.46 ++      char* __sanity;
  468.47 ++      errno = 0;
  468.48 ++      double __d = __strtod_l(__s, &__sanity, __cloc);
  468.49 ++      if (__sanity != __s && errno != ERANGE)
  468.50 ++	__v = __d;
  468.51 ++      else
  468.52 ++	__err |= ios_base::failbit;
  468.53 +     }
  468.54 + 
  468.55 +   template<>
  468.56 +@@ -80,16 +74,13 @@
  468.57 +     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  468.58 + 		   const __c_locale& __cloc)
  468.59 +     {
  468.60 +-      if (!(__err & ios_base::failbit))
  468.61 +-	{
  468.62 +-	  char* __sanity;
  468.63 +-	  errno = 0;
  468.64 +-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  468.65 +-          if (__sanity != __s && errno != ERANGE)
  468.66 +-	    __v = __ld;
  468.67 +-	  else
  468.68 +-	    __err |= ios_base::failbit;
  468.69 +-	}
  468.70 ++      char* __sanity;
  468.71 ++      errno = 0;
  468.72 ++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  468.73 ++      if (__sanity != __s && errno != ERANGE)
  468.74 ++	__v = __ld;
  468.75 ++      else
  468.76 ++	__err |= ios_base::failbit;
  468.77 +     }
  468.78 + 
  468.79 +   void
  468.80 +@@ -110,7 +101,7 @@
  468.81 +   void
  468.82 +   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  468.83 +   {
  468.84 +-    if (_S_get_c_locale() != __cloc)
  468.85 ++    if (__cloc && _S_get_c_locale() != __cloc)
  468.86 +       __freelocale(__cloc); 
  468.87 +   }
  468.88 + 
  468.89 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  468.90 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:47.000000000 +0200
  468.91 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:51.000000000 +0200
  468.92 +@@ -39,21 +39,23 @@
  468.93 + #pragma GCC system_header
  468.94 + 
  468.95 + #include <cstring>              // get std::strlen
  468.96 +-#include <cstdio>               // get std::snprintf or std::sprintf
  468.97 ++#include <cstdio>               // get std::vsnprintf or std::vsprintf
  468.98 + #include <clocale>
  468.99 + #include <langinfo.h>		// For codecvt
 468.100 + #ifdef __UCLIBC_MJN3_ONLY__
 468.101 + #warning fix this
 468.102 + #endif
 468.103 +-#ifdef __UCLIBC_HAS_LOCALE__
 468.104 ++#ifdef _GLIBCXX_USE_ICONV
 468.105 + #include <iconv.h>		// For codecvt using iconv, iconv_t
 468.106 + #endif
 468.107 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 468.108 +-#include <libintl.h> 		// For messages
 468.109 ++#ifdef HAVE_LIBINTL_H
 468.110 ++#include <libintl.h>		// For messages
 468.111 + #endif
 468.112 ++#include <cstdarg>
 468.113 + 
 468.114 + #ifdef __UCLIBC_MJN3_ONLY__
 468.115 + #warning what is _GLIBCXX_C_LOCALE_GNU for
 468.116 ++// psm: used in os/gnu-linux/ctype_noninline.h
 468.117 + #endif
 468.118 + #define _GLIBCXX_C_LOCALE_GNU 1
 468.119 + 
 468.120 +@@ -62,7 +64,7 @@
 468.121 + #endif
 468.122 + // #define _GLIBCXX_NUM_CATEGORIES 6
 468.123 + #define _GLIBCXX_NUM_CATEGORIES 0
 468.124 +- 
 468.125 ++
 468.126 + #ifdef __UCLIBC_HAS_XLOCALE__
 468.127 + namespace __gnu_cxx
 468.128 + {
 468.129 +@@ -79,22 +81,24 @@
 468.130 +   typedef int*			__c_locale;
 468.131 + #endif
 468.132 + 
 468.133 +-  // Convert numeric value of type _Tv to string and return length of
 468.134 +-  // string.  If snprintf is available use it, otherwise fall back to
 468.135 +-  // the unsafe sprintf which, in general, can be dangerous and should
 468.136 ++  // Convert numeric value of type double to string and return length of
 468.137 ++  // string.  If vsnprintf is available use it, otherwise fall back to
 468.138 ++  // the unsafe vsprintf which, in general, can be dangerous and should
 468.139 +   // be avoided.
 468.140 +-  template<typename _Tv>
 468.141 +-    int
 468.142 +-    __convert_from_v(char* __out, 
 468.143 +-		     const int __size __attribute__ ((__unused__)),
 468.144 +-		     const char* __fmt,
 468.145 +-#ifdef __UCLIBC_HAS_XCLOCALE__
 468.146 +-		     _Tv __v, const __c_locale& __cloc, int __prec)
 468.147 ++    inline int
 468.148 ++    __convert_from_v(const __c_locale&
 468.149 ++#ifndef __UCLIBC_HAS_XCLOCALE__
 468.150 ++					__cloc __attribute__ ((__unused__))
 468.151 ++#endif
 468.152 ++		     ,
 468.153 ++		     char* __out,
 468.154 ++		     const int __size,
 468.155 ++		     const char* __fmt, ...)
 468.156 +     {
 468.157 ++      va_list __args;
 468.158 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 468.159 +       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 468.160 + #else
 468.161 +-		     _Tv __v, const __c_locale&, int __prec)
 468.162 +-    {
 468.163 + # ifdef __UCLIBC_HAS_LOCALE__
 468.164 +       char* __old = std::setlocale(LC_ALL, NULL);
 468.165 +       char* __sav = new char[std::strlen(__old) + 1];
 468.166 +@@ -103,7 +107,9 @@
 468.167 + # endif
 468.168 + #endif
 468.169 + 
 468.170 +-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 468.171 ++      va_start(__args, __fmt);
 468.172 ++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 468.173 ++      va_end(__args);
 468.174 + 
 468.175 + #ifdef __UCLIBC_HAS_XCLOCALE__
 468.176 +       __gnu_cxx::__uselocale(__old);
 468.177 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 468.178 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:47.000000000 +0200
 468.179 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:51.000000000 +0200
 468.180 +@@ -33,9 +33,14 @@
 468.181 + 
 468.182 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 468.183 + 
 468.184 ++#include <features.h>
 468.185 ++#ifdef __UCLIBC_HAS_LOCALE__
 468.186 + #define _LIBC
 468.187 + #include <locale>
 468.188 + #undef _LIBC
 468.189 ++#else
 468.190 ++#include <locale>
 468.191 ++#endif
 468.192 + #include <bits/c++locale_internal.h>
 468.193 + 
 468.194 + namespace std
 468.195 +@@ -138,20 +143,34 @@
 468.196 +   ctype<wchar_t>::
 468.197 +   do_is(mask __m, wchar_t __c) const
 468.198 +   { 
 468.199 +-    // Highest bitmask in ctype_base == 10, but extra in "C"
 468.200 +-    // library for blank.
 468.201 ++    // The case of __m == ctype_base::space is particularly important,
 468.202 ++    // due to its use in many istream functions.  Therefore we deal with
 468.203 ++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 468.204 ++    // is the mask corresponding to ctype_base::space.  NB: an encoding
 468.205 ++    // change would not affect correctness!
 468.206 +     bool __ret = false;
 468.207 +-    const size_t __bitmasksize = 11; 
 468.208 +-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 468.209 +-      if (__m & _M_bit[__bitcur]
 468.210 +-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 468.211 +-	{
 468.212 +-	  __ret = true;
 468.213 +-	  break;
 468.214 +-	}
 468.215 ++    if (__m == _M_bit[5])
 468.216 ++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 468.217 ++    else
 468.218 ++      {
 468.219 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 468.220 ++	// library for blank.
 468.221 ++	const size_t __bitmasksize = 11;
 468.222 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 468.223 ++	  if (__m & _M_bit[__bitcur])
 468.224 ++	    {
 468.225 ++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 468.226 ++		{
 468.227 ++		  __ret = true;
 468.228 ++		  break;
 468.229 ++		}
 468.230 ++	      else if (__m == _M_bit[__bitcur])
 468.231 ++		break;
 468.232 ++	    }
 468.233 ++      }
 468.234 +     return __ret;    
 468.235 +   }
 468.236 +-  
 468.237 ++
 468.238 +   const wchar_t* 
 468.239 +   ctype<wchar_t>::
 468.240 +   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 468.241 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 468.242 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:47.000000000 +0200
 468.243 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:51.000000000 +0200
 468.244 +@@ -47,18 +47,21 @@
 468.245 +   template<typename _CharT>
 468.246 +      messages<_CharT>::messages(size_t __refs)
 468.247 +      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 468.248 +-     _M_name_messages(_S_get_c_name())
 468.249 ++       _M_name_messages(_S_get_c_name())
 468.250 +      { }
 468.251 + 
 468.252 +   template<typename _CharT>
 468.253 +      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 468.254 + 				size_t __refs) 
 468.255 +-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 468.256 +-     _M_name_messages(__s)
 468.257 ++     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 468.258 +      {
 468.259 +-       char* __tmp = new char[std::strlen(__s) + 1];
 468.260 +-       std::strcpy(__tmp, __s);
 468.261 ++       const size_t __len = std::strlen(__s) + 1;
 468.262 ++       char* __tmp = new char[__len];
 468.263 ++       std::memcpy(__tmp, __s, __len);
 468.264 +        _M_name_messages = __tmp;
 468.265 ++
 468.266 ++       // Last to avoid leaking memory if new throws.
 468.267 ++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 468.268 +      }
 468.269 + 
 468.270 +   template<typename _CharT>
 468.271 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 468.272 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:51.000000000 +0200
 468.273 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:51.000000000 +0200
 468.274 +@@ -33,9 +33,14 @@
 468.275 + 
 468.276 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 468.277 + 
 468.278 ++#include <features.h>
 468.279 ++#ifdef __UCLIBC_HAS_LOCALE__
 468.280 + #define _LIBC
 468.281 + #include <locale>
 468.282 + #undef _LIBC
 468.283 ++#else
 468.284 ++#include <locale>
 468.285 ++#endif
 468.286 + #include <bits/c++locale_internal.h>
 468.287 + 
 468.288 + #ifdef __UCLIBC_MJN3_ONLY__
 468.289 +@@ -206,7 +211,7 @@
 468.290 + 	  }
 468.291 + 	break;
 468.292 +       default:
 468.293 +-	;
 468.294 ++	__ret = pattern();
 468.295 +       }
 468.296 +     return __ret;
 468.297 +   }
 468.298 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 468.299 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:51.000000000 +0200
 468.300 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:51.000000000 +0200
 468.301 +@@ -33,9 +33,14 @@
 468.302 + 
 468.303 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 468.304 + 
 468.305 ++#include <features.h>
 468.306 ++#ifdef __UCLIBC_HAS_LOCALE__
 468.307 + #define _LIBC
 468.308 + #include <locale>
 468.309 + #undef _LIBC
 468.310 ++#else
 468.311 ++#include <locale>
 468.312 ++#endif
 468.313 + #include <bits/c++locale_internal.h>
 468.314 + 
 468.315 + #ifdef __UCLIBC_MJN3_ONLY__
 468.316 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
 468.317 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:43.000000000 +0200
 468.318 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:51.000000000 +0200
 468.319 +@@ -37,25 +37,33 @@
 468.320 +   template<typename _CharT>
 468.321 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
 468.322 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 468.323 +-    _M_name_timepunct(_S_get_c_name())
 468.324 ++      _M_name_timepunct(_S_get_c_name())
 468.325 +     { _M_initialize_timepunct(); }
 468.326 + 
 468.327 +   template<typename _CharT>
 468.328 +     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 468.329 +     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 468.330 +-    _M_name_timepunct(_S_get_c_name())
 468.331 ++      _M_name_timepunct(_S_get_c_name())
 468.332 +     { _M_initialize_timepunct(); }
 468.333 + 
 468.334 +   template<typename _CharT>
 468.335 +     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 468.336 + 				     size_t __refs) 
 468.337 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 468.338 +-    _M_name_timepunct(__s)
 468.339 ++      _M_name_timepunct(NULL)
 468.340 +     { 
 468.341 +-      char* __tmp = new char[std::strlen(__s) + 1];
 468.342 +-      std::strcpy(__tmp, __s);
 468.343 ++      const size_t __len = std::strlen(__s) + 1;
 468.344 ++      char* __tmp = new char[__len];
 468.345 ++      std::memcpy(__tmp, __s, __len);
 468.346 +       _M_name_timepunct = __tmp;
 468.347 +-      _M_initialize_timepunct(__cloc); 
 468.348 ++
 468.349 ++      try
 468.350 ++	{ _M_initialize_timepunct(__cloc); }
 468.351 ++      catch(...)
 468.352 ++	{
 468.353 ++	  delete [] _M_name_timepunct;
 468.354 ++	  __throw_exception_again;
 468.355 ++	}
 468.356 +     }
 468.357 + 
 468.358 +   template<typename _CharT>
   469.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   469.2 +++ b/patches/gcc/4.3.1/310-missing-execinfo_h.patch	Mon Jul 28 21:32:33 2008 +0000
   469.3 @@ -0,0 +1,13 @@
   469.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_301-missing-execinfo_h.patch
   469.5 +diff -durN gcc-4.3.1.orig/boehm-gc/include/gc.h gcc-4.3.1/boehm-gc/include/gc.h
   469.6 +--- gcc-4.3.1.orig/boehm-gc/include/gc.h	2007-04-23 23:10:09.000000000 +0200
   469.7 ++++ gcc-4.3.1/boehm-gc/include/gc.h	2008-06-10 14:58:54.000000000 +0200
   469.8 +@@ -503,7 +503,7 @@
   469.9 + #if defined(__linux__) || defined(__GLIBC__)
  469.10 + # include <features.h>
  469.11 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  469.12 +-     && !defined(__ia64__)
  469.13 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  469.14 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  469.15 + #     define GC_HAVE_BUILTIN_BACKTRACE
  469.16 + #   endif
   470.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   470.2 +++ b/patches/gcc/4.3.1/320-c99-complex-ugly-hack.patch	Mon Jul 28 21:32:33 2008 +0000
   470.3 @@ -0,0 +1,14 @@
   470.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_303-c99-complex-ugly-hack.patch
   470.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
   470.6 +--- gcc-4.3.1.orig/libstdc++-v3/configure	2008-06-10 14:58:43.000000000 +0200
   470.7 ++++ gcc-4.3.1/libstdc++-v3/configure	2008-06-10 14:58:58.000000000 +0200
   470.8 +@@ -39006,6 +39006,9 @@
   470.9 + cat >>conftest.$ac_ext <<_ACEOF
  470.10 + /* end confdefs.h.  */
  470.11 + #include <complex.h>
  470.12 ++#ifdef __UCLIBC__
  470.13 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  470.14 ++#endif
  470.15 + int
  470.16 + main ()
  470.17 + {
   471.1 --- a/patches/gcc/4.3.1/325-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   471.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   471.3 @@ -1,56 +0,0 @@
   471.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/54_all_300-libstdc++-pic.patch
   471.5 -install libstdc++_pic.a if we have pic objs
   471.6 -
   471.7 -diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am gcc-4.3.1/libstdc++-v3/src/Makefile.am
   471.8 ---- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am	2008-02-29 19:26:50.000000000 +0100
   471.9 -+++ gcc-4.3.1/libstdc++-v3/src/Makefile.am	2008-06-10 14:58:09.000000000 +0200
  471.10 -@@ -289,6 +289,13 @@
  471.11 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
  471.12 - 
  471.13 - 
  471.14 -+install-exec-local:
  471.15 -+	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  471.16 -+	if [ x"$$pic_objs" != x ]; then \
  471.17 -+		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  471.18 -+		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  471.19 -+	fi
  471.20 -+
  471.21 - # Added bits to build debug library.
  471.22 - if GLIBCXX_BUILD_DEBUG
  471.23 - all-local: build_debug
  471.24 -diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in gcc-4.3.1/libstdc++-v3/src/Makefile.in
  471.25 ---- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in	2008-02-29 19:26:50.000000000 +0100
  471.26 -+++ gcc-4.3.1/libstdc++-v3/src/Makefile.in	2008-06-10 14:58:09.000000000 +0200
  471.27 -@@ -693,7 +693,7 @@
  471.28 - 
  471.29 - install-data-am: install-data-local
  471.30 - 
  471.31 --install-exec-am: install-toolexeclibLTLIBRARIES
  471.32 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  471.33 - 
  471.34 - install-info: install-info-am
  471.35 - 
  471.36 -@@ -732,7 +732,7 @@
  471.37 - 	maintainer-clean-generic mostlyclean mostlyclean-compile \
  471.38 - 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  471.39 - 	tags uninstall uninstall-am uninstall-info-am \
  471.40 --	uninstall-toolexeclibLTLIBRARIES
  471.41 -+	uninstall-toolexeclibLTLIBRARIES install-exec-local
  471.42 - 
  471.43 - 
  471.44 - # Symbol versioning for shared libraries.
  471.45 -@@ -858,6 +858,14 @@
  471.46 - install_debug:
  471.47 - 	(cd ${debugdir} && $(MAKE) \
  471.48 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  471.49 -+
  471.50 -+install-exec-local:
  471.51 -+	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  471.52 -+	if [ x"$$pic_objs" != x ]; then \
  471.53 -+		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  471.54 -+		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  471.55 -+	fi
  471.56 -+
  471.57 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  471.58 - # Otherwise a system limit (for SysV at least) may be exceeded.
  471.59 - .NOEXPORT:
   472.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   472.2 +++ b/patches/gcc/4.3.1/330-index_macro.patch	Mon Jul 28 21:32:33 2008 +0000
   472.3 @@ -0,0 +1,27 @@
   472.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch
   472.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/rope gcc-4.3.1/libstdc++-v3/include/ext/rope
   472.6 +--- gcc-4.3.1.orig/libstdc++-v3/include/ext/rope	2008-01-31 19:44:55.000000000 +0100
   472.7 ++++ gcc-4.3.1/libstdc++-v3/include/ext/rope	2008-06-10 14:59:02.000000000 +0200
   472.8 +@@ -59,6 +59,9 @@
   472.9 + #include <bits/gthr.h>
  472.10 + #include <tr1/functional>
  472.11 + 
  472.12 ++/* cope w/ index defined as macro, SuSv3 proposal */
  472.13 ++#undef index
  472.14 ++
  472.15 + # ifdef __GC
  472.16 + #   define __GC_CONST const
  472.17 + # else
  472.18 +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h
  472.19 +--- gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2007-05-04 17:06:46.000000000 +0200
  472.20 ++++ gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h	2008-06-10 14:59:02.000000000 +0200
  472.21 +@@ -54,6 +54,9 @@
  472.22 + #include <ext/memory> // For uninitialized_copy_n
  472.23 + #include <ext/numeric> // For power
  472.24 + 
  472.25 ++/* cope w/ index defined as macro, SuSv3 proposal */
  472.26 ++#undef index
  472.27 ++
  472.28 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  472.29 + 
  472.30 +   using std::size_t;
   473.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   473.2 +++ b/patches/gcc/4.3.1/340-libmudflap-susv3-legacy.patch	Mon Jul 28 21:32:33 2008 +0000
   473.3 @@ -0,0 +1,49 @@
   473.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch
   473.5 +diff -durN gcc-4.3.1.orig/libmudflap/mf-hooks2.c gcc-4.3.1/libmudflap/mf-hooks2.c
   473.6 +--- gcc-4.3.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   473.7 ++++ gcc-4.3.1/libmudflap/mf-hooks2.c	2008-06-10 14:59:05.000000000 +0200
   473.8 +@@ -427,7 +427,7 @@
   473.9 + {
  473.10 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  473.11 +   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  473.12 +-  bzero (s, n);
  473.13 ++  memset (s, 0, n);
  473.14 + }
  473.15 + 
  473.16 + 
  473.17 +@@ -437,7 +437,7 @@
  473.18 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  473.19 +   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  473.20 +   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  473.21 +-  bcopy (src, dest, n);
  473.22 ++  memmove (dest, src, n);
  473.23 + }
  473.24 + 
  473.25 + 
  473.26 +@@ -447,7 +447,7 @@
  473.27 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  473.28 +   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  473.29 +   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  473.30 +-  return bcmp (s1, s2, n);
  473.31 ++  return memcmp (s1, s2, n);
  473.32 + }
  473.33 + 
  473.34 + 
  473.35 +@@ -456,7 +456,7 @@
  473.36 +   size_t n = strlen (s);
  473.37 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  473.38 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  473.39 +-  return index (s, c);
  473.40 ++  return strchr (s, c);
  473.41 + }
  473.42 + 
  473.43 + 
  473.44 +@@ -465,7 +465,7 @@
  473.45 +   size_t n = strlen (s);
  473.46 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  473.47 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  473.48 +-  return rindex (s, c);
  473.49 ++  return strrchr (s, c);
  473.50 + }
  473.51 + 
  473.52 + /* XXX:  stpcpy, memccpy */
   474.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   474.2 +++ b/patches/gcc/4.3.1/350-libstdc++-namespace.patch	Mon Jul 28 21:32:33 2008 +0000
   474.3 @@ -0,0 +1,38 @@
   474.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_306-libstdc++-namespace.patch
   474.5 +diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
   474.6 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
   474.7 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:54.000000000 +0200
   474.8 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:59:09.000000000 +0200
   474.9 +@@ -32,7 +32,8 @@
  474.10 + //
  474.11 + 
  474.12 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  474.13 +-
  474.14 ++namespace std
  474.15 ++{
  474.16 + #ifdef __UCLIBC_MJN3_ONLY__
  474.17 + #warning fix prototypes for *textdomain funcs
  474.18 + #endif
  474.19 +@@ -115,3 +116,4 @@
  474.20 + 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  474.21 + 	 }
  474.22 +      }
  474.23 ++}
  474.24 +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
  474.25 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:54.000000000 +0200
  474.26 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:59:09.000000000 +0200
  474.27 +@@ -33,7 +33,8 @@
  474.28 + //
  474.29 + 
  474.30 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  474.31 +-
  474.32 ++namespace std
  474.33 ++{
  474.34 +   template<typename _CharT>
  474.35 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
  474.36 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  474.37 +@@ -74,3 +75,4 @@
  474.38 +       delete _M_data; 
  474.39 +       _S_destroy_c_locale(_M_c_locale_timepunct); 
  474.40 +     }
  474.41 ++}
   475.1 --- a/patches/gcc/4.3.1/350-pr24170.patch	Mon Jul 28 21:08:01 2008 +0000
   475.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   475.3 @@ -1,61 +0,0 @@
   475.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc43-pr24170.patch
   475.5 -http://gcc.gnu.org/PR24170
   475.6 -
   475.7 -2008-02-20  Tom Tromey  <tromey@redhat.com>
   475.8 -
   475.9 -	PR libgcj/24170:
  475.10 -	* java/io/natFilePosix.cc (File::performList): Don't use
  475.11 -	readdir_r.
  475.12 -	* configure, include/config.h.in: Rebuilt.
  475.13 -	* configure.ac: Don't check for readdir_r.
  475.14 -
  475.15 -diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac
  475.16 ---- gcc-4.3.1.orig/libjava/configure.ac	2008-06-10 14:57:42.000000000 +0200
  475.17 -+++ gcc-4.3.1/libjava/configure.ac	2008-06-10 14:58:13.000000000 +0200
  475.18 -@@ -1030,7 +1030,7 @@
  475.19 -    PLATFORMNET=NoNet
  475.20 - else
  475.21 -    AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
  475.22 --                   localtime_r readdir_r getpwuid_r getcwd \
  475.23 -+                   localtime_r getpwuid_r getcwd \
  475.24 - 		   access stat lstat mkdir rename rmdir unlink utime chmod readlink \
  475.25 - 		   nl_langinfo setlocale \
  475.26 - 		   inet_pton uname inet_ntoa \
  475.27 -diff -durN gcc-4.3.1.orig/libjava/include/config.h.in gcc-4.3.1/libjava/include/config.h.in
  475.28 ---- gcc-4.3.1.orig/libjava/include/config.h.in	2007-07-31 18:17:21.000000000 +0200
  475.29 -+++ gcc-4.3.1/libjava/include/config.h.in	2008-06-10 14:58:13.000000000 +0200
  475.30 -@@ -214,9 +214,6 @@
  475.31 - /* Define to 1 if you have the <pwd.h> header file. */
  475.32 - #undef HAVE_PWD_H
  475.33 - 
  475.34 --/* Define to 1 if you have the `readdir_r' function. */
  475.35 --#undef HAVE_READDIR_R
  475.36 --
  475.37 - /* Define to 1 if you have the `readlink' function. */
  475.38 - #undef HAVE_READLINK
  475.39 - 
  475.40 -diff -durN gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc gcc-4.3.1/libjava/java/io/natFilePosix.cc
  475.41 ---- gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc	2007-08-04 23:50:01.000000000 +0200
  475.42 -+++ gcc-4.3.1/libjava/java/io/natFilePosix.cc	2008-06-10 14:58:13.000000000 +0200
  475.43 -@@ -1,6 +1,6 @@
  475.44 - // natFile.cc - Native part of File class for POSIX.
  475.45 - 
  475.46 --/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
  475.47 -+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
  475.48 -    Free Software Foundation
  475.49 - 
  475.50 -    This file is part of libgcj.
  475.51 -@@ -292,13 +292,7 @@
  475.52 - 
  475.53 -   java::util::ArrayList *list = new java::util::ArrayList ();
  475.54 -   struct dirent *d;
  475.55 --#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
  475.56 --  int name_max = pathconf (buf, _PC_NAME_MAX);
  475.57 --  char dbuf[sizeof (struct dirent) + name_max + 1];
  475.58 --  while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
  475.59 --#else /* HAVE_READDIR_R */
  475.60 -   while ((d = readdir (dir)) != NULL)
  475.61 --#endif /* HAVE_READDIR_R */
  475.62 -     {
  475.63 -       // Omit "." and "..".
  475.64 -       if (d->d_name[0] == '.'
   476.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   476.2 +++ b/patches/gcc/4.3.1/360-arm-softfloat.patch	Mon Jul 28 21:32:33 2008 +0000
   476.3 @@ -0,0 +1,29 @@
   476.4 +diff -durN gcc-4.3.1.orig/gcc/config/arm/linux-elf.h gcc-4.3.1/gcc/config/arm/linux-elf.h
   476.5 +--- gcc-4.3.1.orig/gcc/config/arm/linux-elf.h	2007-11-08 14:44:09.000000000 +0100
   476.6 ++++ gcc-4.3.1/gcc/config/arm/linux-elf.h	2008-07-23 15:30:57.000000000 +0200
   476.7 +@@ -60,7 +60,7 @@
   476.8 +    %{shared:-lc} \
   476.9 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  476.10 + 
  476.11 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  476.12 ++#define LIBGCC_SPEC "-lgcc"
  476.13 + 
  476.14 + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  476.15 + 
  476.16 +diff -durN gcc-4.3.1.orig/gcc/config/arm/t-linux gcc-4.3.1/gcc/config/arm/t-linux
  476.17 +--- gcc-4.3.1.orig/gcc/config/arm/t-linux	2006-11-09 23:14:27.000000000 +0100
  476.18 ++++ gcc-4.3.1/gcc/config/arm/t-linux	2008-07-23 19:15:25.000000000 +0200
  476.19 +@@ -3,7 +3,12 @@
  476.20 + TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
  476.21 + 
  476.22 + LIB1ASMSRC = arm/lib1funcs.asm
  476.23 +-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
  476.24 ++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
  476.25 ++	_call_via_rX _interwork_call_via_rX \
  476.26 ++	_lshrdi3 _ashrdi3 _ashldi3 \
  476.27 ++	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
  476.28 ++	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
  476.29 ++	_fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf
  476.30 + 
  476.31 + # MULTILIB_OPTIONS = mhard-float/msoft-float
  476.32 + # MULTILIB_DIRNAMES = hard-float soft-float
   477.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   477.2 +++ b/patches/gcc/4.3.1/370-alpha-signal_h.patch	Mon Jul 28 21:32:33 2008 +0000
   477.3 @@ -0,0 +1,17 @@
   477.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   477.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   477.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   477.7 + /* Do code reading to identify a signal frame, and set the frame
   477.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
   477.9 + 
  477.10 ++/* Don't use this if inhibit_libc is set
  477.11 ++   The build for this target will fail trying to include missing headers */
  477.12 ++#ifndef inhibit_libc
  477.13 + #include <signal.h>
  477.14 + #include <sys/ucontext.h>
  477.15 + 
  477.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  477.17 +   fs->retaddr_column = 64;
  477.18 +   return _URC_NO_REASON;
  477.19 + }
  477.20 ++#endif /* inhibit_libc */
   478.1 --- a/patches/gcc/4.3.1/375-noteGNUstack-00.patch	Mon Jul 28 21:08:01 2008 +0000
   478.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   478.3 @@ -1,96 +0,0 @@
   478.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
   478.5 -2004-09-20  Jakub Jelinek  <jakub@redhat.com>
   478.6 -
   478.7 -	* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
   478.8 -	on ppc64-linux.
   478.9 -
  478.10 -	* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
  478.11 -	ia64-linux.
  478.12 -	* config/ia64/crtbegin.asm: Likewise.
  478.13 -	* config/ia64/crtend.asm: Likewise.
  478.14 -	* config/ia64/crti.asm: Likewise.
  478.15 -	* config/ia64/crtn.asm: Likewise.
  478.16 -
  478.17 -2004-05-14  Jakub Jelinek  <jakub@redhat.com>
  478.18 -
  478.19 -	* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
  478.20 -
  478.21 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.1/gcc/config/ia64/crtbegin.asm
  478.22 ---- gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm	2005-09-27 02:52:24.000000000 +0200
  478.23 -+++ gcc-4.3.1/gcc/config/ia64/crtbegin.asm	2008-06-10 14:58:17.000000000 +0200
  478.24 -@@ -255,3 +255,7 @@
  478.25 - .weak __cxa_finalize
  478.26 - #endif
  478.27 - .weak _Jv_RegisterClasses
  478.28 -+
  478.29 -+#ifdef __linux__
  478.30 -+.section .note.GNU-stack; .previous
  478.31 -+#endif
  478.32 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtend.asm gcc-4.3.1/gcc/config/ia64/crtend.asm
  478.33 ---- gcc-4.3.1.orig/gcc/config/ia64/crtend.asm	2005-09-27 02:52:24.000000000 +0200
  478.34 -+++ gcc-4.3.1/gcc/config/ia64/crtend.asm	2008-06-10 14:58:17.000000000 +0200
  478.35 -@@ -122,3 +122,7 @@
  478.36 - 
  478.37 - 	br.ret.sptk.many rp
  478.38 - 	.endp __do_global_ctors_aux
  478.39 -+
  478.40 -+#ifdef __linux__
  478.41 -+.section .note.GNU-stack; .previous
  478.42 -+#endif
  478.43 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crti.asm gcc-4.3.1/gcc/config/ia64/crti.asm
  478.44 ---- gcc-4.3.1.orig/gcc/config/ia64/crti.asm	2005-06-25 03:22:41.000000000 +0200
  478.45 -+++ gcc-4.3.1/gcc/config/ia64/crti.asm	2008-06-10 14:58:17.000000000 +0200
  478.46 -@@ -64,3 +64,7 @@
  478.47 - 	.body
  478.48 - 
  478.49 - # end of crti.asm
  478.50 -+
  478.51 -+#ifdef __linux__
  478.52 -+.section .note.GNU-stack; .previous
  478.53 -+#endif
  478.54 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtn.asm gcc-4.3.1/gcc/config/ia64/crtn.asm
  478.55 ---- gcc-4.3.1.orig/gcc/config/ia64/crtn.asm	2005-06-25 03:22:41.000000000 +0200
  478.56 -+++ gcc-4.3.1/gcc/config/ia64/crtn.asm	2008-06-10 14:58:17.000000000 +0200
  478.57 -@@ -54,3 +54,7 @@
  478.58 - 	br.ret.sptk.many b0
  478.59 - 
  478.60 - # end of crtn.asm
  478.61 -+
  478.62 -+#ifdef __linux__
  478.63 -+.section .note.GNU-stack; .previous
  478.64 -+#endif
  478.65 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.1/gcc/config/ia64/lib1funcs.asm
  478.66 ---- gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm	2005-09-27 02:52:24.000000000 +0200
  478.67 -+++ gcc-4.3.1/gcc/config/ia64/lib1funcs.asm	2008-06-10 14:58:17.000000000 +0200
  478.68 -@@ -792,3 +792,7 @@
  478.69 - 	}
  478.70 - 	.endp __floattitf
  478.71 - #endif
  478.72 -+
  478.73 -+#ifdef __linux__
  478.74 -+.section .note.GNU-stack; .previous
  478.75 -+#endif
  478.76 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/linux.h gcc-4.3.1/gcc/config/ia64/linux.h
  478.77 ---- gcc-4.3.1.orig/gcc/config/ia64/linux.h	2006-12-12 16:15:19.000000000 +0100
  478.78 -+++ gcc-4.3.1/gcc/config/ia64/linux.h	2008-06-10 14:58:17.000000000 +0200
  478.79 -@@ -5,6 +5,8 @@
  478.80 - 
  478.81 - #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
  478.82 - 
  478.83 -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
  478.84 -+
  478.85 - /* This is for -profile to use -lc_p instead of -lc.  */
  478.86 - #undef CC1_SPEC
  478.87 - #define CC1_SPEC "%{profile:-p} %{G*}"
  478.88 -diff -durN gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.1/gcc/config/rs6000/ppc-asm.h
  478.89 ---- gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h	2003-06-04 18:44:51.000000000 +0200
  478.90 -+++ gcc-4.3.1/gcc/config/rs6000/ppc-asm.h	2008-06-10 14:58:17.000000000 +0200
  478.91 -@@ -158,7 +158,7 @@
  478.92 - 	.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
  478.93 - #endif
  478.94 - 
  478.95 --#if defined __linux__ && !defined __powerpc64__
  478.96 -+#if defined __linux__
  478.97 - 	.section .note.GNU-stack
  478.98 - 	.previous
  478.99 - #endif
   479.1 --- a/patches/gcc/4.3.1/400-noteGNUstack-01.patch	Mon Jul 28 21:08:01 2008 +0000
   479.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   479.3 @@ -1,198 +0,0 @@
   479.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/62_all_gcc4-noteGNUstack.patch
   479.5 -2005-02-08  Jakub Jelinek  <jakub@redhat.com>
   479.6 -
   479.7 -	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
   479.8 -	* src/s390/sysv.S: Likewise.
   479.9 -	* src/powerpc/linux64.S: Likewise.
  479.10 -	* src/powerpc/linux64_closure.S: Likewise.
  479.11 -	* src/powerpc/ppc_closure.S: Likewise.
  479.12 -	* src/powerpc/sysv.S: Likewise.
  479.13 -	* src/x86/unix64.S: Likewise.
  479.14 -	* src/x86/sysv.S: Likewise.
  479.15 -	* src/sparc/v8.S: Likewise.
  479.16 -	* src/sparc/v9.S: Likewise.
  479.17 -	* src/m68k/sysv.S: Likewise.
  479.18 -	* src/ia64/unix.S: Likewise.
  479.19 -	* src/arm/sysv.S: Likewise.
  479.20 -
  479.21 -	* ia64_save_regs_in_stack.s: Moved to...
  479.22 -	* ia64_save_regs_in_stack.S: ... this.  Add .note.GNU-stack
  479.23 -	on Linux.
  479.24 -
  479.25 -diff -durN gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S
  479.26 ---- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S	1970-01-01 01:00:00.000000000 +0100
  479.27 -+++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S	2008-06-10 14:58:21.000000000 +0200
  479.28 -@@ -0,0 +1,15 @@
  479.29 -+        .text
  479.30 -+        .align 16
  479.31 -+        .global GC_save_regs_in_stack
  479.32 -+        .proc GC_save_regs_in_stack
  479.33 -+GC_save_regs_in_stack:
  479.34 -+        .bodyfoo.mpg
  479.35 -+        flushrs
  479.36 -+        ;;
  479.37 -+        mov r8=ar.bsp
  479.38 -+        br.ret.sptk.few rp
  479.39 -+        .endp GC_save_regs_in_stack
  479.40 -+
  479.41 -+#ifdef __linux__
  479.42 -+	.section .note.GNU-stack,"",@progbits
  479.43 -+#endif
  479.44 -diff -durN gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s
  479.45 ---- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s	2001-10-15 06:57:59.000000000 +0200
  479.46 -+++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s	2008-06-10 14:58:21.000000000 +0200
  479.47 -@@ -1,12 +0,0 @@
  479.48 --        .text
  479.49 --        .align 16
  479.50 --        .global GC_save_regs_in_stack
  479.51 --        .proc GC_save_regs_in_stack
  479.52 --GC_save_regs_in_stack:
  479.53 --        .body
  479.54 --        flushrs
  479.55 --        ;;
  479.56 --        mov r8=ar.bsp
  479.57 --        br.ret.sptk.few rp
  479.58 --        .endp GC_save_regs_in_stack
  479.59 --
  479.60 -diff -durN gcc-4.3.1.orig/libffi/src/alpha/osf.S gcc-4.3.1/libffi/src/alpha/osf.S
  479.61 ---- gcc-4.3.1.orig/libffi/src/alpha/osf.S	2007-04-06 18:24:16.000000000 +0200
  479.62 -+++ gcc-4.3.1/libffi/src/alpha/osf.S	2008-06-10 14:58:21.000000000 +0200
  479.63 -@@ -358,4 +358,8 @@
  479.64 - 	.byte	16		# uleb128 offset 16*-8
  479.65 - 	.align 3
  479.66 - $LEFDE3:
  479.67 -+
  479.68 -+#ifdef __linux__
  479.69 -+	.section	.note.GNU-stack,"",@progbits
  479.70 -+#endif
  479.71 - #endif
  479.72 -diff -durN gcc-4.3.1.orig/libffi/src/arm/sysv.S gcc-4.3.1/libffi/src/arm/sysv.S
  479.73 ---- gcc-4.3.1.orig/libffi/src/arm/sysv.S	2007-09-04 19:52:45.000000000 +0200
  479.74 -+++ gcc-4.3.1/libffi/src/arm/sysv.S	2008-06-10 14:58:21.000000000 +0200
  479.75 -@@ -293,3 +293,6 @@
  479.76 - 	UNWIND .fnend
  479.77 -         .size    CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
  479.78 - 
  479.79 -+#if defined __ELF__ && defined __linux__
  479.80 -+	.section	.note.GNU-stack,"",%progbits
  479.81 -+#endif
  479.82 -diff -durN gcc-4.3.1.orig/libffi/src/ia64/unix.S gcc-4.3.1/libffi/src/ia64/unix.S
  479.83 ---- gcc-4.3.1.orig/libffi/src/ia64/unix.S	2005-03-30 23:49:19.000000000 +0200
  479.84 -+++ gcc-4.3.1/libffi/src/ia64/unix.S	2008-06-10 14:58:21.000000000 +0200
  479.85 -@@ -553,3 +553,7 @@
  479.86 - 	data8	@pcrel(.Lld_hfa_float)		// FFI_IA64_TYPE_HFA_FLOAT
  479.87 - 	data8	@pcrel(.Lld_hfa_double)		// FFI_IA64_TYPE_HFA_DOUBLE
  479.88 - 	data8	@pcrel(.Lld_hfa_ldouble)	// FFI_IA64_TYPE_HFA_LDOUBLE
  479.89 -+
  479.90 -+#if defined __ELF__ && defined __linux__
  479.91 -+	.section	.note.GNU-stack,"",@progbits
  479.92 -+#endif
  479.93 -diff -durN gcc-4.3.1.orig/libffi/src/m68k/sysv.S gcc-4.3.1/libffi/src/m68k/sysv.S
  479.94 ---- gcc-4.3.1.orig/libffi/src/m68k/sysv.S	2007-05-10 23:29:04.000000000 +0200
  479.95 -+++ gcc-4.3.1/libffi/src/m68k/sysv.S	2008-06-10 14:58:21.000000000 +0200
  479.96 -@@ -207,3 +207,7 @@
  479.97 - 	rts
  479.98 - 	CFI_ENDPROC()
  479.99 - 	.size	ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
 479.100 -+
 479.101 -+#if defined __ELF__ && defined __linux__
 479.102 -+	.section	.note.GNU-stack,"",@progbits
 479.103 -+#endif
 479.104 -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64.S gcc-4.3.1/libffi/src/powerpc/linux64.S
 479.105 ---- gcc-4.3.1.orig/libffi/src/powerpc/linux64.S	2007-11-17 00:24:53.000000000 +0100
 479.106 -+++ gcc-4.3.1/libffi/src/powerpc/linux64.S	2008-06-10 14:58:21.000000000 +0200
 479.107 -@@ -179,3 +179,7 @@
 479.108 - 	.align 3
 479.109 - .LEFDE1:
 479.110 - #endif
 479.111 -+
 479.112 -+#if defined __ELF__ && defined __linux__
 479.113 -+	.section	.note.GNU-stack,"",@progbits
 479.114 -+#endif
 479.115 -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.1/libffi/src/powerpc/linux64_closure.S
 479.116 ---- gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S	2005-08-11 23:18:24.000000000 +0200
 479.117 -+++ gcc-4.3.1/libffi/src/powerpc/linux64_closure.S	2008-06-10 14:58:21.000000000 +0200
 479.118 -@@ -204,3 +204,7 @@
 479.119 - 	.align 3
 479.120 - .LEFDE1:
 479.121 - #endif
 479.122 -+
 479.123 -+#if defined __ELF__ && defined __linux__
 479.124 -+	.section	.note.GNU-stack,"",@progbits
 479.125 -+#endif
 479.126 -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.1/libffi/src/powerpc/ppc_closure.S
 479.127 ---- gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S	2007-12-01 22:00:04.000000000 +0100
 479.128 -+++ gcc-4.3.1/libffi/src/powerpc/ppc_closure.S	2008-06-10 14:58:21.000000000 +0200
 479.129 -@@ -295,3 +295,7 @@
 479.130 - .LEFDE1:
 479.131 - 
 479.132 - #endif
 479.133 -+
 479.134 -+#if defined __ELF__ && defined __linux__
 479.135 -+	.section	.note.GNU-stack,"",@progbits
 479.136 -+#endif
 479.137 -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/sysv.S gcc-4.3.1/libffi/src/powerpc/sysv.S
 479.138 ---- gcc-4.3.1.orig/libffi/src/powerpc/sysv.S	2007-12-01 22:00:04.000000000 +0100
 479.139 -+++ gcc-4.3.1/libffi/src/powerpc/sysv.S	2008-06-10 14:58:21.000000000 +0200
 479.140 -@@ -223,3 +223,7 @@
 479.141 -       .align 2
 479.142 - .LEFDE1:
 479.143 - #endif
 479.144 -+
 479.145 -+#if defined __ELF__ && defined __linux__
 479.146 -+	.section	.note.GNU-stack,"",@progbits
 479.147 -+#endif
 479.148 -diff -durN gcc-4.3.1.orig/libffi/src/s390/sysv.S gcc-4.3.1/libffi/src/s390/sysv.S
 479.149 ---- gcc-4.3.1.orig/libffi/src/s390/sysv.S	2003-10-21 21:01:58.000000000 +0200
 479.150 -+++ gcc-4.3.1/libffi/src/s390/sysv.S	2008-06-10 14:58:21.000000000 +0200
 479.151 -@@ -427,3 +427,6 @@
 479.152 - 
 479.153 - #endif
 479.154 - 
 479.155 -+#if defined __ELF__ && defined __linux__
 479.156 -+	.section	.note.GNU-stack,"",@progbits
 479.157 -+#endif
 479.158 -diff -durN gcc-4.3.1.orig/libffi/src/sparc/v8.S gcc-4.3.1/libffi/src/sparc/v8.S
 479.159 ---- gcc-4.3.1.orig/libffi/src/sparc/v8.S	2004-11-22 19:35:16.000000000 +0100
 479.160 -+++ gcc-4.3.1/libffi/src/sparc/v8.S	2008-06-10 14:58:21.000000000 +0200
 479.161 -@@ -265,3 +265,7 @@
 479.162 - 	.byte	0x1f	! uleb128 0x1f
 479.163 - 	.align	WS
 479.164 - .LLEFDE2:
 479.165 -+
 479.166 -+#if defined __ELF__ && defined __linux__
 479.167 -+	.section	.note.GNU-stack,"",@progbits
 479.168 -+#endif
 479.169 -diff -durN gcc-4.3.1.orig/libffi/src/sparc/v9.S gcc-4.3.1/libffi/src/sparc/v9.S
 479.170 ---- gcc-4.3.1.orig/libffi/src/sparc/v9.S	2004-01-25 07:58:33.000000000 +0100
 479.171 -+++ gcc-4.3.1/libffi/src/sparc/v9.S	2008-06-10 14:58:21.000000000 +0200
 479.172 -@@ -300,3 +300,7 @@
 479.173 - 	.align 8
 479.174 - .LLEFDE2:
 479.175 - #endif
 479.176 -+
 479.177 -+#ifdef __linux__
 479.178 -+	.section	.note.GNU-stack,"",@progbits
 479.179 -+#endif
 479.180 -diff -durN gcc-4.3.1.orig/libffi/src/x86/sysv.S gcc-4.3.1/libffi/src/x86/sysv.S
 479.181 ---- gcc-4.3.1.orig/libffi/src/x86/sysv.S	2008-01-30 15:36:58.000000000 +0100
 479.182 -+++ gcc-4.3.1/libffi/src/x86/sysv.S	2008-06-10 14:58:21.000000000 +0200
 479.183 -@@ -430,3 +430,7 @@
 479.184 - #endif
 479.185 - 
 479.186 - #endif /* ifndef __x86_64__ */
 479.187 -+
 479.188 -+#if defined __ELF__ && defined __linux__
 479.189 -+	.section	.note.GNU-stack,"",@progbits
 479.190 -+#endif
 479.191 -diff -durN gcc-4.3.1.orig/libffi/src/x86/unix64.S gcc-4.3.1/libffi/src/x86/unix64.S
 479.192 ---- gcc-4.3.1.orig/libffi/src/x86/unix64.S	2005-05-05 06:06:38.000000000 +0200
 479.193 -+++ gcc-4.3.1/libffi/src/x86/unix64.S	2008-06-10 14:58:21.000000000 +0200
 479.194 -@@ -410,3 +410,7 @@
 479.195 - .LEFDE3:
 479.196 - 
 479.197 - #endif /* __x86_64__ */
 479.198 -+
 479.199 -+#if defined __ELF__ && defined __linux__
 479.200 -+	.section	.note.GNU-stack,"",@progbits
 479.201 -+#endif
   480.1 --- a/patches/gcc/4.3.1/425-pr34571.patch	Mon Jul 28 21:08:01 2008 +0000
   480.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   480.3 @@ -1,35 +0,0 @@
   480.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/64_all_gcc43-pr34571.patch
   480.5 -http://gcc.gnu.org/PR34571
   480.6 -
   480.7 -2007-12-26  Rask Ingemann Lambertsen  <rask@sygehus.dk>
   480.8 -
   480.9 -	PR target/34571
  480.10 -	* config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
  480.11 -	symbolic_operand.
  480.12 -	* varasm.c (output_constant_pool_1): Fix typo.
  480.13 -
  480.14 -diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.c gcc-4.3.1/gcc/config/alpha/alpha.c
  480.15 ---- gcc-4.3.1.orig/gcc/config/alpha/alpha.c	2008-02-07 18:45:24.000000000 +0100
  480.16 -+++ gcc-4.3.1/gcc/config/alpha/alpha.c	2008-06-10 14:58:24.000000000 +0200
  480.17 -@@ -1113,8 +1113,7 @@
  480.18 - static bool
  480.19 - alpha_cannot_force_const_mem (rtx x)
  480.20 - {
  480.21 --  enum rtx_code code = GET_CODE (x);
  480.22 --  return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
  480.23 -+  return symbolic_operand (x, GET_MODE (x));
  480.24 - }
  480.25 - 
  480.26 - /* We do not allow indirect calls to be optimized into sibling calls, nor
  480.27 -diff -durN gcc-4.3.1.orig/gcc/varasm.c gcc-4.3.1/gcc/varasm.c
  480.28 ---- gcc-4.3.1.orig/gcc/varasm.c	2007-12-05 22:55:10.000000000 +0100
  480.29 -+++ gcc-4.3.1/gcc/varasm.c	2008-06-10 14:58:24.000000000 +0200
  480.30 -@@ -3710,7 +3710,7 @@
  480.31 -       /* FALLTHRU  */
  480.32 - 
  480.33 -     case LABEL_REF:
  480.34 --      tmp = XEXP (x, 0);
  480.35 -+      tmp = XEXP (tmp, 0);
  480.36 -       gcc_assert (!INSN_DELETED_P (tmp));
  480.37 -       gcc_assert (!NOTE_P (tmp)
  480.38 - 		  || NOTE_KIND (tmp) != NOTE_INSN_DELETED);
   481.1 --- a/patches/gcc/4.3.1/450-pr25343.patch	Mon Jul 28 21:08:01 2008 +0000
   481.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   481.3 @@ -1,21 +0,0 @@
   481.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/66_all_gcc43-pr25343.patch
   481.5 -http://gcc.gnu.org/PR25343
   481.6 -
   481.7 -sniped from Debian
   481.8 -
   481.9 -2008-04-27  Roman Zippel <zippel@linux-m68k.org>
  481.10 -
  481.11 -	* config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
  481.12 -
  481.13 -diff -durN gcc-4.3.1.orig/gcc/config/host-linux.c gcc-4.3.1/gcc/config/host-linux.c
  481.14 ---- gcc-4.3.1.orig/gcc/config/host-linux.c	2007-08-02 12:49:31.000000000 +0200
  481.15 -+++ gcc-4.3.1/gcc/config/host-linux.c	2008-06-10 14:58:28.000000000 +0200
  481.16 -@@ -84,6 +84,8 @@
  481.17 - # define TRY_EMPTY_VM_SPACE	0x8000000000
  481.18 - #elif defined(__sparc__)
  481.19 - # define TRY_EMPTY_VM_SPACE	0x60000000
  481.20 -+#elif defined(__mc68000__)
  481.21 -+# define TRY_EMPTY_VM_SPACE	0x40000000
  481.22 - #else
  481.23 - # define TRY_EMPTY_VM_SPACE	0
  481.24 - #endif
   482.1 --- a/patches/gcc/4.3.1/475-sh-pr24836.patch	Mon Jul 28 21:08:01 2008 +0000
   482.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   482.3 @@ -1,28 +0,0 @@
   482.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/74_all_sh-pr24836.patch
   482.5 -http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
   482.6 -http://gcc.gnu.org/PR24836
   482.7 -
   482.8 -diff -durN gcc-4.3.1.orig/gcc/configure gcc-4.3.1/gcc/configure
   482.9 ---- gcc-4.3.1.orig/gcc/configure	2008-06-10 14:57:48.000000000 +0200
  482.10 -+++ gcc-4.3.1/gcc/configure	2008-06-10 14:58:32.000000000 +0200
  482.11 -@@ -14709,7 +14709,7 @@
  482.12 - 	tls_first_minor=14
  482.13 - 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  482.14 - 	;;
  482.15 --  sh-*-* | sh[34]-*-*)
  482.16 -+  sh-*-* | sh[34]*-*-*)
  482.17 -     conftest_s='
  482.18 - 	.section ".tdata","awT",@progbits
  482.19 - foo:	.long	25
  482.20 -diff -durN gcc-4.3.1.orig/gcc/configure.ac gcc-4.3.1/gcc/configure.ac
  482.21 ---- gcc-4.3.1.orig/gcc/configure.ac	2008-06-10 14:57:48.000000000 +0200
  482.22 -+++ gcc-4.3.1/gcc/configure.ac	2008-06-10 14:58:32.000000000 +0200
  482.23 -@@ -2537,7 +2537,7 @@
  482.24 - 	tls_first_minor=14
  482.25 - 	tls_as_opt="-m64 -Aesame --fatal-warnings"
  482.26 - 	;;
  482.27 --  sh-*-* | sh[34]-*-*)
  482.28 -+  sh-*-* | sh[34]*-*-*)
  482.29 -     conftest_s='
  482.30 - 	.section ".tdata","awT",@progbits
  482.31 - foo:	.long	25
   483.1 --- a/patches/gcc/4.3.1/500-uclibc-conf-noupstream.patch	Mon Jul 28 21:08:01 2008 +0000
   483.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   483.3 @@ -1,13 +0,0 @@
   483.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_103-uclibc-conf-noupstream.patch
   483.5 -diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc
   483.6 ---- gcc-4.3.1.orig/gcc/config.gcc	2008-06-10 14:58:09.000000000 +0200
   483.7 -+++ gcc-4.3.1/gcc/config.gcc	2008-06-10 14:58:36.000000000 +0200
   483.8 -@@ -2149,7 +2149,7 @@
   483.9 -         ;;
  483.10 - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  483.11 - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  483.12 --  sh-*-linux* | sh[346lbe]*-*-linux* | \
  483.13 -+  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  483.14 -   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  483.15 -    sh64-*-netbsd* | sh64l*-*-netbsd*)
  483.16 - 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   484.1 --- a/patches/gcc/4.3.1/525-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   484.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   484.3 @@ -1,2794 +0,0 @@
   484.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_200-uclibc-locale.patch
   484.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 gcc-4.3.1/libstdc++-v3/acinclude.m4
   484.6 ---- gcc-4.3.1.orig/libstdc++-v3/acinclude.m4	2008-04-25 18:52:57.000000000 +0200
   484.7 -+++ gcc-4.3.1/libstdc++-v3/acinclude.m4	2008-06-10 14:58:39.000000000 +0200
   484.8 -@@ -1349,7 +1349,7 @@
   484.9 - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
  484.10 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  484.11 -     [use MODEL for target locale package],
  484.12 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  484.13 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  484.14 - 
  484.15 -   # Deal with gettext issues.  Default to not using it (=no) until we detect
  484.16 -   # support for it later.  Let the user turn it off via --e/d, but let that
  484.17 -@@ -1370,6 +1370,9 @@
  484.18 -   # Default to "generic".
  484.19 -   if test $enable_clocale_flag = auto; then
  484.20 -     case ${target_os} in
  484.21 -+      *-uclibc*)
  484.22 -+        enable_clocale_flag=uclibc
  484.23 -+        ;;
  484.24 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  484.25 -         enable_clocale_flag=gnu	
  484.26 -         ;;
  484.27 -@@ -1541,6 +1544,40 @@
  484.28 -       CTIME_CC=config/locale/generic/time_members.cc
  484.29 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  484.30 -       ;;
  484.31 -+    uclibc)
  484.32 -+      AC_MSG_RESULT(uclibc)
  484.33 -+
  484.34 -+      # Declare intention to use gettext, and add support for specific
  484.35 -+      # languages.
  484.36 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  484.37 -+      ALL_LINGUAS="de fr"
  484.38 -+
  484.39 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  484.40 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  484.41 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  484.42 -+        USE_NLS=yes
  484.43 -+      fi
  484.44 -+      # Export the build objects.
  484.45 -+      for ling in $ALL_LINGUAS; do \
  484.46 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  484.47 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  484.48 -+      done
  484.49 -+      AC_SUBST(glibcxx_MOFILES)
  484.50 -+      AC_SUBST(glibcxx_POFILES)
  484.51 -+
  484.52 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  484.53 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  484.54 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  484.55 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  484.56 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  484.57 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  484.58 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  484.59 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  484.60 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  484.61 -+      CTIME_H=config/locale/uclibc/time_members.h
  484.62 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  484.63 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  484.64 -+      ;;
  484.65 -   esac
  484.66 - 
  484.67 -   # This is where the testsuite looks for locale catalogs, using the
  484.68 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  484.69 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
  484.70 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:39.000000000 +0200
  484.71 -@@ -0,0 +1,63 @@
  484.72 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  484.73 -+
  484.74 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  484.75 -+//
  484.76 -+// This file is part of the GNU ISO C++ Library.  This library is free
  484.77 -+// software; you can redistribute it and/or modify it under the
  484.78 -+// terms of the GNU General Public License as published by the
  484.79 -+// Free Software Foundation; either version 2, or (at your option)
  484.80 -+// any later version.
  484.81 -+
  484.82 -+// This library is distributed in the hope that it will be useful,
  484.83 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  484.84 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  484.85 -+// GNU General Public License for more details.
  484.86 -+
  484.87 -+// You should have received a copy of the GNU General Public License along
  484.88 -+// with this library; see the file COPYING.  If not, write to the Free
  484.89 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  484.90 -+// USA.
  484.91 -+
  484.92 -+// As a special exception, you may use this file as part of a free software
  484.93 -+// library without restriction.  Specifically, if other files instantiate
  484.94 -+// templates or use macros or inline functions from this file, or you compile
  484.95 -+// this file and link it with other files to produce an executable, this
  484.96 -+// file does not by itself cause the resulting executable to be covered by
  484.97 -+// the GNU General Public License.  This exception does not however
  484.98 -+// invalidate any other reasons why the executable file might be covered by
  484.99 -+// the GNU General Public License.
 484.100 -+
 484.101 -+// Written by Jakub Jelinek <jakub@redhat.com>
 484.102 -+
 484.103 -+#include <bits/c++config.h>
 484.104 -+#include <clocale>
 484.105 -+
 484.106 -+#ifdef __UCLIBC_MJN3_ONLY__
 484.107 -+#warning clean this up
 484.108 -+#endif
 484.109 -+
 484.110 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.111 -+                                                  
 484.112 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 484.113 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 484.114 -+extern "C" __typeof(strftime_l) __strftime_l;
 484.115 -+extern "C" __typeof(strtod_l) __strtod_l;
 484.116 -+extern "C" __typeof(strtof_l) __strtof_l;
 484.117 -+extern "C" __typeof(strtold_l) __strtold_l;
 484.118 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 484.119 -+extern "C" __typeof(newlocale) __newlocale;
 484.120 -+extern "C" __typeof(freelocale) __freelocale;
 484.121 -+extern "C" __typeof(duplocale) __duplocale;
 484.122 -+extern "C" __typeof(uselocale) __uselocale;
 484.123 -+
 484.124 -+#ifdef _GLIBCXX_USE_WCHAR_T
 484.125 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 484.126 -+extern "C" __typeof(towlower_l) __towlower_l;
 484.127 -+extern "C" __typeof(towupper_l) __towupper_l;
 484.128 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 484.129 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 484.130 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 484.131 -+extern "C" __typeof(wctype_l) __wctype_l;
 484.132 -+#endif 
 484.133 -+
 484.134 -+#endif // GLIBC 2.3 and later
 484.135 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
 484.136 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
 484.137 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:39.000000000 +0200
 484.138 -@@ -0,0 +1,160 @@
 484.139 -+// Wrapper for underlying C-language localization -*- C++ -*-
 484.140 -+
 484.141 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 484.142 -+//
 484.143 -+// This file is part of the GNU ISO C++ Library.  This library is free
 484.144 -+// software; you can redistribute it and/or modify it under the
 484.145 -+// terms of the GNU General Public License as published by the
 484.146 -+// Free Software Foundation; either version 2, or (at your option)
 484.147 -+// any later version.
 484.148 -+
 484.149 -+// This library is distributed in the hope that it will be useful,
 484.150 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 484.151 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 484.152 -+// GNU General Public License for more details.
 484.153 -+
 484.154 -+// You should have received a copy of the GNU General Public License along
 484.155 -+// with this library; see the file COPYING.  If not, write to the Free
 484.156 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 484.157 -+// USA.
 484.158 -+
 484.159 -+// As a special exception, you may use this file as part of a free software
 484.160 -+// library without restriction.  Specifically, if other files instantiate
 484.161 -+// templates or use macros or inline functions from this file, or you compile
 484.162 -+// this file and link it with other files to produce an executable, this
 484.163 -+// file does not by itself cause the resulting executable to be covered by
 484.164 -+// the GNU General Public License.  This exception does not however
 484.165 -+// invalidate any other reasons why the executable file might be covered by
 484.166 -+// the GNU General Public License.
 484.167 -+
 484.168 -+//
 484.169 -+// ISO C++ 14882: 22.8  Standard locale categories.
 484.170 -+//
 484.171 -+
 484.172 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 484.173 -+
 484.174 -+#include <cerrno>  // For errno
 484.175 -+#include <locale>
 484.176 -+#include <stdexcept>
 484.177 -+#include <langinfo.h>
 484.178 -+#include <bits/c++locale_internal.h>
 484.179 -+
 484.180 -+#ifndef __UCLIBC_HAS_XLOCALE__
 484.181 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 484.182 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 484.183 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 484.184 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 484.185 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 484.186 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 484.187 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 484.188 -+#warning should dummy __newlocale check for C|POSIX ?
 484.189 -+#define __newlocale(a, b, c)        NULL
 484.190 -+#define __freelocale(a)             ((void)0)
 484.191 -+#define __duplocale(a)              __c_locale()
 484.192 -+#endif
 484.193 -+
 484.194 -+namespace std 
 484.195 -+{
 484.196 -+  template<>
 484.197 -+    void
 484.198 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 484.199 -+		   const __c_locale& __cloc)
 484.200 -+    {
 484.201 -+      if (!(__err & ios_base::failbit))
 484.202 -+	{
 484.203 -+	  char* __sanity;
 484.204 -+	  errno = 0;
 484.205 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
 484.206 -+          if (__sanity != __s && errno != ERANGE)
 484.207 -+	    __v = __f;
 484.208 -+	  else
 484.209 -+	    __err |= ios_base::failbit;
 484.210 -+	}
 484.211 -+    }
 484.212 -+
 484.213 -+  template<>
 484.214 -+    void
 484.215 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 484.216 -+		   const __c_locale& __cloc)
 484.217 -+    {
 484.218 -+      if (!(__err & ios_base::failbit))
 484.219 -+	{
 484.220 -+	  char* __sanity;
 484.221 -+	  errno = 0;
 484.222 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
 484.223 -+          if (__sanity != __s && errno != ERANGE)
 484.224 -+	    __v = __d;
 484.225 -+	  else
 484.226 -+	    __err |= ios_base::failbit;
 484.227 -+	}
 484.228 -+    }
 484.229 -+
 484.230 -+  template<>
 484.231 -+    void
 484.232 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 484.233 -+		   const __c_locale& __cloc)
 484.234 -+    {
 484.235 -+      if (!(__err & ios_base::failbit))
 484.236 -+	{
 484.237 -+	  char* __sanity;
 484.238 -+	  errno = 0;
 484.239 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 484.240 -+          if (__sanity != __s && errno != ERANGE)
 484.241 -+	    __v = __ld;
 484.242 -+	  else
 484.243 -+	    __err |= ios_base::failbit;
 484.244 -+	}
 484.245 -+    }
 484.246 -+
 484.247 -+  void
 484.248 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 484.249 -+				    __c_locale __old)
 484.250 -+  {
 484.251 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 484.252 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.253 -+    if (!__cloc)
 484.254 -+      {
 484.255 -+	// This named locale is not supported by the underlying OS.
 484.256 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 484.257 -+			      "name not valid"));
 484.258 -+      }
 484.259 -+#endif
 484.260 -+  }
 484.261 -+  
 484.262 -+  void
 484.263 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 484.264 -+  {
 484.265 -+    if (_S_get_c_locale() != __cloc)
 484.266 -+      __freelocale(__cloc); 
 484.267 -+  }
 484.268 -+
 484.269 -+  __c_locale
 484.270 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 484.271 -+  { return __duplocale(__cloc); }
 484.272 -+} // namespace std
 484.273 -+
 484.274 -+namespace __gnu_cxx
 484.275 -+{
 484.276 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 484.277 -+    {
 484.278 -+      "LC_CTYPE", 
 484.279 -+      "LC_NUMERIC",
 484.280 -+      "LC_TIME", 
 484.281 -+      "LC_COLLATE", 
 484.282 -+      "LC_MONETARY",
 484.283 -+      "LC_MESSAGES", 
 484.284 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 484.285 -+      "LC_PAPER", 
 484.286 -+      "LC_NAME", 
 484.287 -+      "LC_ADDRESS",
 484.288 -+      "LC_TELEPHONE", 
 484.289 -+      "LC_MEASUREMENT", 
 484.290 -+      "LC_IDENTIFICATION" 
 484.291 -+#endif
 484.292 -+    };
 484.293 -+}
 484.294 -+
 484.295 -+namespace std
 484.296 -+{
 484.297 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 484.298 -+}  // namespace std
 484.299 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
 484.300 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 484.301 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:39.000000000 +0200
 484.302 -@@ -0,0 +1,117 @@
 484.303 -+// Wrapper for underlying C-language localization -*- C++ -*-
 484.304 -+
 484.305 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 484.306 -+//
 484.307 -+// This file is part of the GNU ISO C++ Library.  This library is free
 484.308 -+// software; you can redistribute it and/or modify it under the
 484.309 -+// terms of the GNU General Public License as published by the
 484.310 -+// Free Software Foundation; either version 2, or (at your option)
 484.311 -+// any later version.
 484.312 -+
 484.313 -+// This library is distributed in the hope that it will be useful,
 484.314 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 484.315 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 484.316 -+// GNU General Public License for more details.
 484.317 -+
 484.318 -+// You should have received a copy of the GNU General Public License along
 484.319 -+// with this library; see the file COPYING.  If not, write to the Free
 484.320 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 484.321 -+// USA.
 484.322 -+
 484.323 -+// As a special exception, you may use this file as part of a free software
 484.324 -+// library without restriction.  Specifically, if other files instantiate
 484.325 -+// templates or use macros or inline functions from this file, or you compile
 484.326 -+// this file and link it with other files to produce an executable, this
 484.327 -+// file does not by itself cause the resulting executable to be covered by
 484.328 -+// the GNU General Public License.  This exception does not however
 484.329 -+// invalidate any other reasons why the executable file might be covered by
 484.330 -+// the GNU General Public License.
 484.331 -+
 484.332 -+//
 484.333 -+// ISO C++ 14882: 22.8  Standard locale categories.
 484.334 -+//
 484.335 -+
 484.336 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 484.337 -+
 484.338 -+#ifndef _C_LOCALE_H
 484.339 -+#define _C_LOCALE_H 1
 484.340 -+
 484.341 -+#pragma GCC system_header
 484.342 -+
 484.343 -+#include <cstring>              // get std::strlen
 484.344 -+#include <cstdio>               // get std::snprintf or std::sprintf
 484.345 -+#include <clocale>
 484.346 -+#include <langinfo.h>		// For codecvt
 484.347 -+#ifdef __UCLIBC_MJN3_ONLY__
 484.348 -+#warning fix this
 484.349 -+#endif
 484.350 -+#ifdef __UCLIBC_HAS_LOCALE__
 484.351 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 484.352 -+#endif
 484.353 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 484.354 -+#include <libintl.h> 		// For messages
 484.355 -+#endif
 484.356 -+
 484.357 -+#ifdef __UCLIBC_MJN3_ONLY__
 484.358 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 484.359 -+#endif
 484.360 -+#define _GLIBCXX_C_LOCALE_GNU 1
 484.361 -+
 484.362 -+#ifdef __UCLIBC_MJN3_ONLY__
 484.363 -+#warning fix categories
 484.364 -+#endif
 484.365 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 484.366 -+#define _GLIBCXX_NUM_CATEGORIES 0
 484.367 -+ 
 484.368 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.369 -+namespace __gnu_cxx
 484.370 -+{
 484.371 -+  extern "C" __typeof(uselocale) __uselocale;
 484.372 -+}
 484.373 -+#endif
 484.374 -+
 484.375 -+namespace std
 484.376 -+{
 484.377 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.378 -+  typedef __locale_t		__c_locale;
 484.379 -+#else
 484.380 -+  typedef int*			__c_locale;
 484.381 -+#endif
 484.382 -+
 484.383 -+  // Convert numeric value of type _Tv to string and return length of
 484.384 -+  // string.  If snprintf is available use it, otherwise fall back to
 484.385 -+  // the unsafe sprintf which, in general, can be dangerous and should
 484.386 -+  // be avoided.
 484.387 -+  template<typename _Tv>
 484.388 -+    int
 484.389 -+    __convert_from_v(char* __out, 
 484.390 -+		     const int __size __attribute__ ((__unused__)),
 484.391 -+		     const char* __fmt,
 484.392 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 484.393 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 484.394 -+    {
 484.395 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 484.396 -+#else
 484.397 -+		     _Tv __v, const __c_locale&, int __prec)
 484.398 -+    {
 484.399 -+# ifdef __UCLIBC_HAS_LOCALE__
 484.400 -+      char* __old = std::setlocale(LC_ALL, NULL);
 484.401 -+      char* __sav = new char[std::strlen(__old) + 1];
 484.402 -+      std::strcpy(__sav, __old);
 484.403 -+      std::setlocale(LC_ALL, "C");
 484.404 -+# endif
 484.405 -+#endif
 484.406 -+
 484.407 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 484.408 -+
 484.409 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 484.410 -+      __gnu_cxx::__uselocale(__old);
 484.411 -+#elif defined __UCLIBC_HAS_LOCALE__
 484.412 -+      std::setlocale(LC_ALL, __sav);
 484.413 -+      delete [] __sav;
 484.414 -+#endif
 484.415 -+      return __ret;
 484.416 -+    }
 484.417 -+}
 484.418 -+
 484.419 -+#endif
 484.420 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
 484.421 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 484.422 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2008-06-10 14:58:39.000000000 +0200
 484.423 -@@ -0,0 +1,306 @@
 484.424 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 484.425 -+
 484.426 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 484.427 -+//
 484.428 -+// This file is part of the GNU ISO C++ Library.  This library is free
 484.429 -+// software; you can redistribute it and/or modify it under the
 484.430 -+// terms of the GNU General Public License as published by the
 484.431 -+// Free Software Foundation; either version 2, or (at your option)
 484.432 -+// any later version.
 484.433 -+
 484.434 -+// This library is distributed in the hope that it will be useful,
 484.435 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 484.436 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 484.437 -+// GNU General Public License for more details.
 484.438 -+
 484.439 -+// You should have received a copy of the GNU General Public License along
 484.440 -+// with this library; see the file COPYING.  If not, write to the Free
 484.441 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 484.442 -+// USA.
 484.443 -+
 484.444 -+// As a special exception, you may use this file as part of a free software
 484.445 -+// library without restriction.  Specifically, if other files instantiate
 484.446 -+// templates or use macros or inline functions from this file, or you compile
 484.447 -+// this file and link it with other files to produce an executable, this
 484.448 -+// file does not by itself cause the resulting executable to be covered by
 484.449 -+// the GNU General Public License.  This exception does not however
 484.450 -+// invalidate any other reasons why the executable file might be covered by
 484.451 -+// the GNU General Public License.
 484.452 -+
 484.453 -+//
 484.454 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 484.455 -+//
 484.456 -+
 484.457 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 484.458 -+
 484.459 -+#include <locale>
 484.460 -+#include <bits/c++locale_internal.h>
 484.461 -+
 484.462 -+namespace std
 484.463 -+{
 484.464 -+  // Specializations.
 484.465 -+#ifdef _GLIBCXX_USE_WCHAR_T
 484.466 -+  codecvt_base::result
 484.467 -+  codecvt<wchar_t, char, mbstate_t>::
 484.468 -+  do_out(state_type& __state, const intern_type* __from, 
 484.469 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 484.470 -+	 extern_type* __to, extern_type* __to_end,
 484.471 -+	 extern_type*& __to_next) const
 484.472 -+  {
 484.473 -+    result __ret = ok;
 484.474 -+    state_type __tmp_state(__state);
 484.475 -+
 484.476 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.477 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 484.478 -+#endif
 484.479 -+
 484.480 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 484.481 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 484.482 -+    // NB: wcsnrtombs is a GNU extension
 484.483 -+    for (__from_next = __from, __to_next = __to;
 484.484 -+	 __from_next < __from_end && __to_next < __to_end
 484.485 -+	 && __ret == ok;)
 484.486 -+      {
 484.487 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 484.488 -+						      __from_end - __from_next);
 484.489 -+	if (!__from_chunk_end)
 484.490 -+	  __from_chunk_end = __from_end;
 484.491 -+
 484.492 -+	__from = __from_next;
 484.493 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 484.494 -+					 __from_chunk_end - __from_next,
 484.495 -+					 __to_end - __to_next, &__state);
 484.496 -+	if (__conv == static_cast<size_t>(-1))
 484.497 -+	  {
 484.498 -+	    // In case of error, in order to stop at the exact place we
 484.499 -+	    // have to start again from the beginning with a series of
 484.500 -+	    // wcrtomb.
 484.501 -+	    for (; __from < __from_next; ++__from)
 484.502 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 484.503 -+	    __state = __tmp_state;
 484.504 -+	    __ret = error;
 484.505 -+	  }
 484.506 -+	else if (__from_next && __from_next < __from_chunk_end)
 484.507 -+	  {
 484.508 -+	    __to_next += __conv;
 484.509 -+	    __ret = partial;
 484.510 -+	  }
 484.511 -+	else
 484.512 -+	  {
 484.513 -+	    __from_next = __from_chunk_end;
 484.514 -+	    __to_next += __conv;
 484.515 -+	  }
 484.516 -+
 484.517 -+	if (__from_next < __from_end && __ret == ok)
 484.518 -+	  {
 484.519 -+	    extern_type __buf[MB_LEN_MAX];
 484.520 -+	    __tmp_state = __state;
 484.521 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 484.522 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 484.523 -+	      __ret = partial;
 484.524 -+	    else
 484.525 -+	      {
 484.526 -+		memcpy(__to_next, __buf, __conv);
 484.527 -+		__state = __tmp_state;
 484.528 -+		__to_next += __conv;
 484.529 -+		++__from_next;
 484.530 -+	      }
 484.531 -+	  }
 484.532 -+      }
 484.533 -+
 484.534 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.535 -+    __uselocale(__old);
 484.536 -+#endif
 484.537 -+
 484.538 -+    return __ret; 
 484.539 -+  }
 484.540 -+  
 484.541 -+  codecvt_base::result
 484.542 -+  codecvt<wchar_t, char, mbstate_t>::
 484.543 -+  do_in(state_type& __state, const extern_type* __from, 
 484.544 -+	const extern_type* __from_end, const extern_type*& __from_next,
 484.545 -+	intern_type* __to, intern_type* __to_end,
 484.546 -+	intern_type*& __to_next) const
 484.547 -+  {
 484.548 -+    result __ret = ok;
 484.549 -+    state_type __tmp_state(__state);
 484.550 -+
 484.551 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.552 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 484.553 -+#endif
 484.554 -+
 484.555 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 484.556 -+    // in case we store a L'\0' and then continue, in a loop.
 484.557 -+    // NB: mbsnrtowcs is a GNU extension
 484.558 -+    for (__from_next = __from, __to_next = __to;
 484.559 -+	 __from_next < __from_end && __to_next < __to_end
 484.560 -+	 && __ret == ok;)
 484.561 -+      {
 484.562 -+	const extern_type* __from_chunk_end;
 484.563 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 484.564 -+								  __from_end
 484.565 -+								  - __from_next));
 484.566 -+	if (!__from_chunk_end)
 484.567 -+	  __from_chunk_end = __from_end;
 484.568 -+
 484.569 -+	__from = __from_next;
 484.570 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 484.571 -+				   __from_chunk_end - __from_next,
 484.572 -+				   __to_end - __to_next, &__state);
 484.573 -+	if (__conv == static_cast<size_t>(-1))
 484.574 -+	  {
 484.575 -+	    // In case of error, in order to stop at the exact place we
 484.576 -+	    // have to start again from the beginning with a series of
 484.577 -+	    // mbrtowc.
 484.578 -+	    for (;; ++__to_next, __from += __conv)
 484.579 -+	      {
 484.580 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 484.581 -+				 &__tmp_state);
 484.582 -+		if (__conv == static_cast<size_t>(-1)
 484.583 -+		    || __conv == static_cast<size_t>(-2))
 484.584 -+		  break;
 484.585 -+	      }
 484.586 -+	    __from_next = __from;
 484.587 -+	    __state = __tmp_state;	    
 484.588 -+	    __ret = error;
 484.589 -+	  }
 484.590 -+	else if (__from_next && __from_next < __from_chunk_end)
 484.591 -+	  {
 484.592 -+	    // It is unclear what to return in this case (see DR 382). 
 484.593 -+	    __to_next += __conv;
 484.594 -+	    __ret = partial;
 484.595 -+	  }
 484.596 -+	else
 484.597 -+	  {
 484.598 -+	    __from_next = __from_chunk_end;
 484.599 -+	    __to_next += __conv;
 484.600 -+	  }
 484.601 -+
 484.602 -+	if (__from_next < __from_end && __ret == ok)
 484.603 -+	  {
 484.604 -+	    if (__to_next < __to_end)
 484.605 -+	      {
 484.606 -+		// XXX Probably wrong for stateful encodings
 484.607 -+		__tmp_state = __state;		
 484.608 -+		++__from_next;
 484.609 -+		*__to_next++ = L'\0';
 484.610 -+	      }
 484.611 -+	    else
 484.612 -+	      __ret = partial;
 484.613 -+	  }
 484.614 -+      }
 484.615 -+
 484.616 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.617 -+    __uselocale(__old);
 484.618 -+#endif
 484.619 -+
 484.620 -+    return __ret; 
 484.621 -+  }
 484.622 -+
 484.623 -+  int 
 484.624 -+  codecvt<wchar_t, char, mbstate_t>::
 484.625 -+  do_encoding() const throw()
 484.626 -+  {
 484.627 -+    // XXX This implementation assumes that the encoding is
 484.628 -+    // stateless and is either single-byte or variable-width.
 484.629 -+    int __ret = 0;
 484.630 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.631 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 484.632 -+#endif
 484.633 -+    if (MB_CUR_MAX == 1)
 484.634 -+      __ret = 1;
 484.635 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.636 -+    __uselocale(__old);
 484.637 -+#endif
 484.638 -+    return __ret;
 484.639 -+  }  
 484.640 -+
 484.641 -+  int 
 484.642 -+  codecvt<wchar_t, char, mbstate_t>::
 484.643 -+  do_max_length() const throw()
 484.644 -+  {
 484.645 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.646 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 484.647 -+#endif
 484.648 -+    // XXX Probably wrong for stateful encodings.
 484.649 -+    int __ret = MB_CUR_MAX;
 484.650 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.651 -+    __uselocale(__old);
 484.652 -+#endif
 484.653 -+    return __ret;
 484.654 -+  }
 484.655 -+  
 484.656 -+  int 
 484.657 -+  codecvt<wchar_t, char, mbstate_t>::
 484.658 -+  do_length(state_type& __state, const extern_type* __from,
 484.659 -+	    const extern_type* __end, size_t __max) const
 484.660 -+  {
 484.661 -+    int __ret = 0;
 484.662 -+    state_type __tmp_state(__state);
 484.663 -+
 484.664 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.665 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 484.666 -+#endif
 484.667 -+
 484.668 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 484.669 -+    // in case we advance past it and then continue, in a loop.
 484.670 -+    // NB: mbsnrtowcs is a GNU extension
 484.671 -+  
 484.672 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 484.673 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 484.674 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 484.675 -+							   * __max));
 484.676 -+    while (__from < __end && __max)
 484.677 -+      {
 484.678 -+	const extern_type* __from_chunk_end;
 484.679 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 484.680 -+								  __end
 484.681 -+								  - __from));
 484.682 -+	if (!__from_chunk_end)
 484.683 -+	  __from_chunk_end = __end;
 484.684 -+
 484.685 -+	const extern_type* __tmp_from = __from;
 484.686 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 484.687 -+				   __from_chunk_end - __from,
 484.688 -+				   __max, &__state);
 484.689 -+	if (__conv == static_cast<size_t>(-1))
 484.690 -+	  {
 484.691 -+	    // In case of error, in order to stop at the exact place we
 484.692 -+	    // have to start again from the beginning with a series of
 484.693 -+	    // mbrtowc.
 484.694 -+	    for (__from = __tmp_from;; __from += __conv)
 484.695 -+	      {
 484.696 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 484.697 -+				 &__tmp_state);
 484.698 -+		if (__conv == static_cast<size_t>(-1)
 484.699 -+		    || __conv == static_cast<size_t>(-2))
 484.700 -+		  break;
 484.701 -+	      }
 484.702 -+	    __state = __tmp_state;
 484.703 -+	    __ret += __from - __tmp_from;
 484.704 -+	    break;
 484.705 -+	  }
 484.706 -+	if (!__from)
 484.707 -+	  __from = __from_chunk_end;
 484.708 -+	
 484.709 -+	__ret += __from - __tmp_from;
 484.710 -+	__max -= __conv;
 484.711 -+
 484.712 -+	if (__from < __end && __max)
 484.713 -+	  {
 484.714 -+	    // XXX Probably wrong for stateful encodings
 484.715 -+	    __tmp_state = __state;
 484.716 -+	    ++__from;
 484.717 -+	    ++__ret;
 484.718 -+	    --__max;
 484.719 -+	  }
 484.720 -+      }
 484.721 -+
 484.722 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.723 -+    __uselocale(__old);
 484.724 -+#endif
 484.725 -+
 484.726 -+    return __ret; 
 484.727 -+  }
 484.728 -+#endif
 484.729 -+}
 484.730 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
 484.731 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 484.732 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:39.000000000 +0200
 484.733 -@@ -0,0 +1,80 @@
 484.734 -+// std::collate implementation details, GNU version -*- C++ -*-
 484.735 -+
 484.736 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 484.737 -+//
 484.738 -+// This file is part of the GNU ISO C++ Library.  This library is free
 484.739 -+// software; you can redistribute it and/or modify it under the
 484.740 -+// terms of the GNU General Public License as published by the
 484.741 -+// Free Software Foundation; either version 2, or (at your option)
 484.742 -+// any later version.
 484.743 -+
 484.744 -+// This library is distributed in the hope that it will be useful,
 484.745 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 484.746 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 484.747 -+// GNU General Public License for more details.
 484.748 -+
 484.749 -+// You should have received a copy of the GNU General Public License along
 484.750 -+// with this library; see the file COPYING.  If not, write to the Free
 484.751 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 484.752 -+// USA.
 484.753 -+
 484.754 -+// As a special exception, you may use this file as part of a free software
 484.755 -+// library without restriction.  Specifically, if other files instantiate
 484.756 -+// templates or use macros or inline functions from this file, or you compile
 484.757 -+// this file and link it with other files to produce an executable, this
 484.758 -+// file does not by itself cause the resulting executable to be covered by
 484.759 -+// the GNU General Public License.  This exception does not however
 484.760 -+// invalidate any other reasons why the executable file might be covered by
 484.761 -+// the GNU General Public License.
 484.762 -+
 484.763 -+//
 484.764 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 484.765 -+//
 484.766 -+
 484.767 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 484.768 -+
 484.769 -+#include <locale>
 484.770 -+#include <bits/c++locale_internal.h>
 484.771 -+
 484.772 -+#ifndef __UCLIBC_HAS_XLOCALE__
 484.773 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 484.774 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 484.775 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 484.776 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 484.777 -+#endif
 484.778 -+
 484.779 -+namespace std
 484.780 -+{
 484.781 -+  // These are basically extensions to char_traits, and perhaps should
 484.782 -+  // be put there instead of here.
 484.783 -+  template<>
 484.784 -+    int 
 484.785 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 484.786 -+    { 
 484.787 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 484.788 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 484.789 -+    }
 484.790 -+  
 484.791 -+  template<>
 484.792 -+    size_t
 484.793 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 484.794 -+				size_t __n) const 
 484.795 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 484.796 -+
 484.797 -+#ifdef _GLIBCXX_USE_WCHAR_T
 484.798 -+  template<>
 484.799 -+    int 
 484.800 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 484.801 -+				 const wchar_t* __two) const
 484.802 -+    {
 484.803 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 484.804 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 484.805 -+    }
 484.806 -+  
 484.807 -+  template<>
 484.808 -+    size_t
 484.809 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 484.810 -+				   size_t __n) const
 484.811 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 484.812 -+#endif
 484.813 -+}
 484.814 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 484.815 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 484.816 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:39.000000000 +0200
 484.817 -@@ -0,0 +1,300 @@
 484.818 -+// std::ctype implementation details, GNU version -*- C++ -*-
 484.819 -+
 484.820 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 484.821 -+//
 484.822 -+// This file is part of the GNU ISO C++ Library.  This library is free
 484.823 -+// software; you can redistribute it and/or modify it under the
 484.824 -+// terms of the GNU General Public License as published by the
 484.825 -+// Free Software Foundation; either version 2, or (at your option)
 484.826 -+// any later version.
 484.827 -+
 484.828 -+// This library is distributed in the hope that it will be useful,
 484.829 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 484.830 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 484.831 -+// GNU General Public License for more details.
 484.832 -+
 484.833 -+// You should have received a copy of the GNU General Public License along
 484.834 -+// with this library; see the file COPYING.  If not, write to the Free
 484.835 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 484.836 -+// USA.
 484.837 -+
 484.838 -+// As a special exception, you may use this file as part of a free software
 484.839 -+// library without restriction.  Specifically, if other files instantiate
 484.840 -+// templates or use macros or inline functions from this file, or you compile
 484.841 -+// this file and link it with other files to produce an executable, this
 484.842 -+// file does not by itself cause the resulting executable to be covered by
 484.843 -+// the GNU General Public License.  This exception does not however
 484.844 -+// invalidate any other reasons why the executable file might be covered by
 484.845 -+// the GNU General Public License.
 484.846 -+
 484.847 -+//
 484.848 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 484.849 -+//
 484.850 -+
 484.851 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 484.852 -+
 484.853 -+#define _LIBC
 484.854 -+#include <locale>
 484.855 -+#undef _LIBC
 484.856 -+#include <bits/c++locale_internal.h>
 484.857 -+
 484.858 -+#ifndef __UCLIBC_HAS_XLOCALE__
 484.859 -+#define __wctype_l(S, L)           wctype((S))
 484.860 -+#define __towupper_l(C, L)         towupper((C))
 484.861 -+#define __towlower_l(C, L)         towlower((C))
 484.862 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 484.863 -+#endif
 484.864 -+
 484.865 -+namespace std
 484.866 -+{
 484.867 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 484.868 -+  // various /config/os/* files.
 484.869 -+  template<>
 484.870 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 484.871 -+    : ctype<char>(0, false, __refs) 
 484.872 -+    { 		
 484.873 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 484.874 -+	{
 484.875 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 484.876 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 484.877 -+#ifdef __UCLIBC_HAS_XLOCALE__
 484.878 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 484.879 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 484.880 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 484.881 -+#endif
 484.882 -+	}
 484.883 -+    }
 484.884 -+
 484.885 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 484.886 -+  ctype<wchar_t>::__wmask_type
 484.887 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 484.888 -+  {
 484.889 -+    __wmask_type __ret;
 484.890 -+    switch (__m)
 484.891 -+      {
 484.892 -+      case space:
 484.893 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 484.894 -+	break;
 484.895 -+      case print:
 484.896 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 484.897 -+	break;
 484.898 -+      case cntrl:
 484.899 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 484.900 -+	break;
 484.901 -+      case upper:
 484.902 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 484.903 -+	break;
 484.904 -+      case lower:
 484.905 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 484.906 -+	break;
 484.907 -+      case alpha:
 484.908 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 484.909 -+	break;
 484.910 -+      case digit:
 484.911 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 484.912 -+	break;
 484.913 -+      case punct:
 484.914 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 484.915 -+	break;
 484.916 -+      case xdigit:
 484.917 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 484.918 -+	break;
 484.919 -+      case alnum:
 484.920 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 484.921 -+	break;
 484.922 -+      case graph:
 484.923 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 484.924 -+	break;
 484.925 -+      default:
 484.926 -+	__ret = __wmask_type();
 484.927 -+      }
 484.928 -+    return __ret;
 484.929 -+  }
 484.930 -+  
 484.931 -+  wchar_t
 484.932 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 484.933 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 484.934 -+
 484.935 -+  const wchar_t*
 484.936 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 484.937 -+  {
 484.938 -+    while (__lo < __hi)
 484.939 -+      {
 484.940 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 484.941 -+        ++__lo;
 484.942 -+      }
 484.943 -+    return __hi;
 484.944 -+  }
 484.945 -+  
 484.946 -+  wchar_t
 484.947 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 484.948 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 484.949 -+  
 484.950 -+  const wchar_t*
 484.951 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 484.952 -+  {
 484.953 -+    while (__lo < __hi)
 484.954 -+      {
 484.955 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 484.956 -+        ++__lo;
 484.957 -+      }
 484.958 -+    return __hi;
 484.959 -+  }
 484.960 -+
 484.961 -+  bool
 484.962 -+  ctype<wchar_t>::
 484.963 -+  do_is(mask __m, wchar_t __c) const
 484.964 -+  { 
 484.965 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
 484.966 -+    // library for blank.
 484.967 -+    bool __ret = false;
 484.968 -+    const size_t __bitmasksize = 11; 
 484.969 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 484.970 -+      if (__m & _M_bit[__bitcur]
 484.971 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 484.972 -+	{
 484.973 -+	  __ret = true;
 484.974 -+	  break;
 484.975 -+	}
 484.976 -+    return __ret;    
 484.977 -+  }
 484.978 -+  
 484.979 -+  const wchar_t* 
 484.980 -+  ctype<wchar_t>::
 484.981 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 484.982 -+  {
 484.983 -+    for (; __lo < __hi; ++__vec, ++__lo)
 484.984 -+      {
 484.985 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 484.986 -+	// library for blank.
 484.987 -+	const size_t __bitmasksize = 11; 
 484.988 -+	mask __m = 0;
 484.989 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 484.990 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 484.991 -+	    __m |= _M_bit[__bitcur];
 484.992 -+	*__vec = __m;
 484.993 -+      }
 484.994 -+    return __hi;
 484.995 -+  }
 484.996 -+  
 484.997 -+  const wchar_t* 
 484.998 -+  ctype<wchar_t>::
 484.999 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
484.1000 -+  {
484.1001 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
484.1002 -+      ++__lo;
484.1003 -+    return __lo;
484.1004 -+  }
484.1005 -+
484.1006 -+  const wchar_t*
484.1007 -+  ctype<wchar_t>::
484.1008 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
484.1009 -+  {
484.1010 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
484.1011 -+      ++__lo;
484.1012 -+    return __lo;
484.1013 -+  }
484.1014 -+
484.1015 -+  wchar_t
484.1016 -+  ctype<wchar_t>::
484.1017 -+  do_widen(char __c) const
484.1018 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
484.1019 -+
484.1020 -+  const char* 
484.1021 -+  ctype<wchar_t>::
484.1022 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
484.1023 -+  {
484.1024 -+    while (__lo < __hi)
484.1025 -+      {
484.1026 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
484.1027 -+	++__lo;
484.1028 -+	++__dest;
484.1029 -+      }
484.1030 -+    return __hi;
484.1031 -+  }
484.1032 -+
484.1033 -+  char
484.1034 -+  ctype<wchar_t>::
484.1035 -+  do_narrow(wchar_t __wc, char __dfault) const
484.1036 -+  {
484.1037 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
484.1038 -+      return _M_narrow[__wc];
484.1039 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1040 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
484.1041 -+#endif
484.1042 -+    const int __c = wctob(__wc);
484.1043 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1044 -+    __uselocale(__old);
484.1045 -+#endif
484.1046 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
484.1047 -+  }
484.1048 -+
484.1049 -+  const wchar_t*
484.1050 -+  ctype<wchar_t>::
484.1051 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
484.1052 -+	    char* __dest) const
484.1053 -+  {
484.1054 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1055 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
484.1056 -+#endif
484.1057 -+    if (_M_narrow_ok)
484.1058 -+      while (__lo < __hi)
484.1059 -+	{
484.1060 -+	  if (*__lo >= 0 && *__lo < 128)
484.1061 -+	    *__dest = _M_narrow[*__lo];
484.1062 -+	  else
484.1063 -+	    {
484.1064 -+	      const int __c = wctob(*__lo);
484.1065 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
484.1066 -+	    }
484.1067 -+	  ++__lo;
484.1068 -+	  ++__dest;
484.1069 -+	}
484.1070 -+    else
484.1071 -+      while (__lo < __hi)
484.1072 -+	{
484.1073 -+	  const int __c = wctob(*__lo);
484.1074 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
484.1075 -+	  ++__lo;
484.1076 -+	  ++__dest;
484.1077 -+	}
484.1078 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1079 -+    __uselocale(__old);
484.1080 -+#endif
484.1081 -+    return __hi;
484.1082 -+  }
484.1083 -+
484.1084 -+  void
484.1085 -+  ctype<wchar_t>::_M_initialize_ctype()
484.1086 -+  {
484.1087 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1088 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
484.1089 -+#endif
484.1090 -+    wint_t __i;
484.1091 -+    for (__i = 0; __i < 128; ++__i)
484.1092 -+      {
484.1093 -+	const int __c = wctob(__i);
484.1094 -+	if (__c == EOF)
484.1095 -+	  break;
484.1096 -+	else
484.1097 -+	  _M_narrow[__i] = static_cast<char>(__c);
484.1098 -+      }
484.1099 -+    if (__i == 128)
484.1100 -+      _M_narrow_ok = true;
484.1101 -+    else
484.1102 -+      _M_narrow_ok = false;
484.1103 -+    for (size_t __j = 0;
484.1104 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
484.1105 -+      _M_widen[__j] = btowc(__j);
484.1106 -+
484.1107 -+    for (size_t __k = 0; __k <= 11; ++__k)
484.1108 -+      { 
484.1109 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
484.1110 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
484.1111 -+      }
484.1112 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1113 -+    __uselocale(__old);
484.1114 -+#endif
484.1115 -+  }
484.1116 -+#endif //  _GLIBCXX_USE_WCHAR_T
484.1117 -+}
484.1118 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
484.1119 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
484.1120 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:39.000000000 +0200
484.1121 -@@ -0,0 +1,100 @@
484.1122 -+// std::messages implementation details, GNU version -*- C++ -*-
484.1123 -+
484.1124 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
484.1125 -+//
484.1126 -+// This file is part of the GNU ISO C++ Library.  This library is free
484.1127 -+// software; you can redistribute it and/or modify it under the
484.1128 -+// terms of the GNU General Public License as published by the
484.1129 -+// Free Software Foundation; either version 2, or (at your option)
484.1130 -+// any later version.
484.1131 -+
484.1132 -+// This library is distributed in the hope that it will be useful,
484.1133 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
484.1134 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
484.1135 -+// GNU General Public License for more details.
484.1136 -+
484.1137 -+// You should have received a copy of the GNU General Public License along
484.1138 -+// with this library; see the file COPYING.  If not, write to the Free
484.1139 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
484.1140 -+// USA.
484.1141 -+
484.1142 -+// As a special exception, you may use this file as part of a free software
484.1143 -+// library without restriction.  Specifically, if other files instantiate
484.1144 -+// templates or use macros or inline functions from this file, or you compile
484.1145 -+// this file and link it with other files to produce an executable, this
484.1146 -+// file does not by itself cause the resulting executable to be covered by
484.1147 -+// the GNU General Public License.  This exception does not however
484.1148 -+// invalidate any other reasons why the executable file might be covered by
484.1149 -+// the GNU General Public License.
484.1150 -+
484.1151 -+//
484.1152 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
484.1153 -+//
484.1154 -+
484.1155 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
484.1156 -+
484.1157 -+#include <locale>
484.1158 -+#include <bits/c++locale_internal.h>
484.1159 -+
484.1160 -+#ifdef __UCLIBC_MJN3_ONLY__
484.1161 -+#warning fix gettext stuff
484.1162 -+#endif
484.1163 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
484.1164 -+extern "C" char *__dcgettext(const char *domainname,
484.1165 -+			     const char *msgid, int category);
484.1166 -+#undef gettext
484.1167 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
484.1168 -+#else
484.1169 -+#undef gettext
484.1170 -+#define gettext(msgid) (msgid)
484.1171 -+#endif
484.1172 -+
484.1173 -+namespace std
484.1174 -+{
484.1175 -+  // Specializations.
484.1176 -+  template<>
484.1177 -+    string
484.1178 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
484.1179 -+    {
484.1180 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1181 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
484.1182 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
484.1183 -+      __uselocale(__old);
484.1184 -+      return string(__msg);
484.1185 -+#elif defined __UCLIBC_HAS_LOCALE__
484.1186 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
484.1187 -+      setlocale(LC_ALL, _M_name_messages);
484.1188 -+      const char* __msg = gettext(__dfault.c_str());
484.1189 -+      setlocale(LC_ALL, __old);
484.1190 -+      free(__old);
484.1191 -+      return string(__msg);
484.1192 -+#else
484.1193 -+      const char* __msg = gettext(__dfault.c_str());
484.1194 -+      return string(__msg);
484.1195 -+#endif
484.1196 -+    }
484.1197 -+
484.1198 -+#ifdef _GLIBCXX_USE_WCHAR_T
484.1199 -+  template<>
484.1200 -+    wstring
484.1201 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
484.1202 -+    {
484.1203 -+# ifdef __UCLIBC_HAS_XLOCALE__
484.1204 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
484.1205 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
484.1206 -+      __uselocale(__old);
484.1207 -+      return _M_convert_from_char(__msg);
484.1208 -+# elif defined __UCLIBC_HAS_LOCALE__
484.1209 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
484.1210 -+      setlocale(LC_ALL, _M_name_messages);
484.1211 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
484.1212 -+      setlocale(LC_ALL, __old);
484.1213 -+      free(__old);
484.1214 -+      return _M_convert_from_char(__msg);
484.1215 -+# else
484.1216 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
484.1217 -+      return _M_convert_from_char(__msg);
484.1218 -+# endif
484.1219 -+    }
484.1220 -+#endif
484.1221 -+}
484.1222 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
484.1223 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
484.1224 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:39.000000000 +0200
484.1225 -@@ -0,0 +1,118 @@
484.1226 -+// std::messages implementation details, GNU version -*- C++ -*-
484.1227 -+
484.1228 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
484.1229 -+//
484.1230 -+// This file is part of the GNU ISO C++ Library.  This library is free
484.1231 -+// software; you can redistribute it and/or modify it under the
484.1232 -+// terms of the GNU General Public License as published by the
484.1233 -+// Free Software Foundation; either version 2, or (at your option)
484.1234 -+// any later version.
484.1235 -+
484.1236 -+// This library is distributed in the hope that it will be useful,
484.1237 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
484.1238 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
484.1239 -+// GNU General Public License for more details.
484.1240 -+
484.1241 -+// You should have received a copy of the GNU General Public License along
484.1242 -+// with this library; see the file COPYING.  If not, write to the Free
484.1243 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
484.1244 -+// USA.
484.1245 -+
484.1246 -+// As a special exception, you may use this file as part of a free software
484.1247 -+// library without restriction.  Specifically, if other files instantiate
484.1248 -+// templates or use macros or inline functions from this file, or you compile
484.1249 -+// this file and link it with other files to produce an executable, this
484.1250 -+// file does not by itself cause the resulting executable to be covered by
484.1251 -+// the GNU General Public License.  This exception does not however
484.1252 -+// invalidate any other reasons why the executable file might be covered by
484.1253 -+// the GNU General Public License.
484.1254 -+
484.1255 -+//
484.1256 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
484.1257 -+//
484.1258 -+
484.1259 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
484.1260 -+
484.1261 -+#ifdef __UCLIBC_MJN3_ONLY__
484.1262 -+#warning fix prototypes for *textdomain funcs
484.1263 -+#endif
484.1264 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
484.1265 -+extern "C" char *__textdomain(const char *domainname);
484.1266 -+extern "C" char *__bindtextdomain(const char *domainname,
484.1267 -+				  const char *dirname);
484.1268 -+#else
484.1269 -+#undef __textdomain
484.1270 -+#undef __bindtextdomain
484.1271 -+#define __textdomain(D)           ((void)0)
484.1272 -+#define __bindtextdomain(D,P)     ((void)0)
484.1273 -+#endif
484.1274 -+
484.1275 -+  // Non-virtual member functions.
484.1276 -+  template<typename _CharT>
484.1277 -+     messages<_CharT>::messages(size_t __refs)
484.1278 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
484.1279 -+     _M_name_messages(_S_get_c_name())
484.1280 -+     { }
484.1281 -+
484.1282 -+  template<typename _CharT>
484.1283 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
484.1284 -+				size_t __refs) 
484.1285 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
484.1286 -+     _M_name_messages(__s)
484.1287 -+     {
484.1288 -+       char* __tmp = new char[std::strlen(__s) + 1];
484.1289 -+       std::strcpy(__tmp, __s);
484.1290 -+       _M_name_messages = __tmp;
484.1291 -+     }
484.1292 -+
484.1293 -+  template<typename _CharT>
484.1294 -+    typename messages<_CharT>::catalog 
484.1295 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
484.1296 -+			   const char* __dir) const
484.1297 -+    { 
484.1298 -+      __bindtextdomain(__s.c_str(), __dir);
484.1299 -+      return this->do_open(__s, __loc); 
484.1300 -+    }
484.1301 -+
484.1302 -+  // Virtual member functions.
484.1303 -+  template<typename _CharT>
484.1304 -+    messages<_CharT>::~messages()
484.1305 -+    { 
484.1306 -+      if (_M_name_messages != _S_get_c_name())
484.1307 -+	delete [] _M_name_messages;
484.1308 -+      _S_destroy_c_locale(_M_c_locale_messages); 
484.1309 -+    }
484.1310 -+
484.1311 -+  template<typename _CharT>
484.1312 -+    typename messages<_CharT>::catalog 
484.1313 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
484.1314 -+			      const locale&) const
484.1315 -+    { 
484.1316 -+      // No error checking is done, assume the catalog exists and can
484.1317 -+      // be used.
484.1318 -+      __textdomain(__s.c_str());
484.1319 -+      return 0;
484.1320 -+    }
484.1321 -+
484.1322 -+  template<typename _CharT>
484.1323 -+    void    
484.1324 -+    messages<_CharT>::do_close(catalog) const 
484.1325 -+    { }
484.1326 -+
484.1327 -+   // messages_byname
484.1328 -+   template<typename _CharT>
484.1329 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
484.1330 -+     : messages<_CharT>(__refs) 
484.1331 -+     { 
484.1332 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
484.1333 -+	 delete [] this->_M_name_messages;
484.1334 -+       char* __tmp = new char[std::strlen(__s) + 1];
484.1335 -+       std::strcpy(__tmp, __s);
484.1336 -+       this->_M_name_messages = __tmp;
484.1337 -+
484.1338 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
484.1339 -+	 {
484.1340 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
484.1341 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
484.1342 -+	 }
484.1343 -+     }
484.1344 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
484.1345 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
484.1346 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:39.000000000 +0200
484.1347 -@@ -0,0 +1,692 @@
484.1348 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
484.1349 -+
484.1350 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
484.1351 -+//
484.1352 -+// This file is part of the GNU ISO C++ Library.  This library is free
484.1353 -+// software; you can redistribute it and/or modify it under the
484.1354 -+// terms of the GNU General Public License as published by the
484.1355 -+// Free Software Foundation; either version 2, or (at your option)
484.1356 -+// any later version.
484.1357 -+
484.1358 -+// This library is distributed in the hope that it will be useful,
484.1359 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
484.1360 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
484.1361 -+// GNU General Public License for more details.
484.1362 -+
484.1363 -+// You should have received a copy of the GNU General Public License along
484.1364 -+// with this library; see the file COPYING.  If not, write to the Free
484.1365 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
484.1366 -+// USA.
484.1367 -+
484.1368 -+// As a special exception, you may use this file as part of a free software
484.1369 -+// library without restriction.  Specifically, if other files instantiate
484.1370 -+// templates or use macros or inline functions from this file, or you compile
484.1371 -+// this file and link it with other files to produce an executable, this
484.1372 -+// file does not by itself cause the resulting executable to be covered by
484.1373 -+// the GNU General Public License.  This exception does not however
484.1374 -+// invalidate any other reasons why the executable file might be covered by
484.1375 -+// the GNU General Public License.
484.1376 -+
484.1377 -+//
484.1378 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
484.1379 -+//
484.1380 -+
484.1381 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
484.1382 -+
484.1383 -+#define _LIBC
484.1384 -+#include <locale>
484.1385 -+#undef _LIBC
484.1386 -+#include <bits/c++locale_internal.h>
484.1387 -+
484.1388 -+#ifdef __UCLIBC_MJN3_ONLY__
484.1389 -+#warning optimize this for uclibc
484.1390 -+#warning tailor for stub locale support
484.1391 -+#endif
484.1392 -+
484.1393 -+#ifndef __UCLIBC_HAS_XLOCALE__
484.1394 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
484.1395 -+#endif
484.1396 -+
484.1397 -+namespace std
484.1398 -+{
484.1399 -+  // Construct and return valid pattern consisting of some combination of:
484.1400 -+  // space none symbol sign value
484.1401 -+  money_base::pattern
484.1402 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
484.1403 -+  { 
484.1404 -+    pattern __ret;
484.1405 -+
484.1406 -+    // This insanely complicated routine attempts to construct a valid
484.1407 -+    // pattern for use with monyepunct. A couple of invariants:
484.1408 -+
484.1409 -+    // if (__precedes) symbol -> value
484.1410 -+    // else value -> symbol
484.1411 -+    
484.1412 -+    // if (__space) space
484.1413 -+    // else none
484.1414 -+
484.1415 -+    // none == never first
484.1416 -+    // space never first or last
484.1417 -+
484.1418 -+    // Any elegant implementations of this are welcome.
484.1419 -+    switch (__posn)
484.1420 -+      {
484.1421 -+      case 0:
484.1422 -+      case 1:
484.1423 -+	// 1 The sign precedes the value and symbol.
484.1424 -+	__ret.field[0] = sign;
484.1425 -+	if (__space)
484.1426 -+	  {
484.1427 -+	    // Pattern starts with sign.
484.1428 -+	    if (__precedes)
484.1429 -+	      {
484.1430 -+		__ret.field[1] = symbol;
484.1431 -+		__ret.field[3] = value;
484.1432 -+	      }
484.1433 -+	    else
484.1434 -+	      {
484.1435 -+		__ret.field[1] = value;
484.1436 -+		__ret.field[3] = symbol;
484.1437 -+	      }
484.1438 -+	    __ret.field[2] = space;
484.1439 -+	  }
484.1440 -+	else
484.1441 -+	  {
484.1442 -+	    // Pattern starts with sign and ends with none.
484.1443 -+	    if (__precedes)
484.1444 -+	      {
484.1445 -+		__ret.field[1] = symbol;
484.1446 -+		__ret.field[2] = value;
484.1447 -+	      }
484.1448 -+	    else
484.1449 -+	      {
484.1450 -+		__ret.field[1] = value;
484.1451 -+		__ret.field[2] = symbol;
484.1452 -+	      }
484.1453 -+	    __ret.field[3] = none;
484.1454 -+	  }
484.1455 -+	break;
484.1456 -+      case 2:
484.1457 -+	// 2 The sign follows the value and symbol.
484.1458 -+	if (__space)
484.1459 -+	  {
484.1460 -+	    // Pattern either ends with sign.
484.1461 -+	    if (__precedes)
484.1462 -+	      {
484.1463 -+		__ret.field[0] = symbol;
484.1464 -+		__ret.field[2] = value;
484.1465 -+	      }
484.1466 -+	    else
484.1467 -+	      {
484.1468 -+		__ret.field[0] = value;
484.1469 -+		__ret.field[2] = symbol;
484.1470 -+	      }
484.1471 -+	    __ret.field[1] = space;
484.1472 -+	    __ret.field[3] = sign;
484.1473 -+	  }
484.1474 -+	else
484.1475 -+	  {
484.1476 -+	    // Pattern ends with sign then none.
484.1477 -+	    if (__precedes)
484.1478 -+	      {
484.1479 -+		__ret.field[0] = symbol;
484.1480 -+		__ret.field[1] = value;
484.1481 -+	      }
484.1482 -+	    else
484.1483 -+	      {
484.1484 -+		__ret.field[0] = value;
484.1485 -+		__ret.field[1] = symbol;
484.1486 -+	      }
484.1487 -+	    __ret.field[2] = sign;
484.1488 -+	    __ret.field[3] = none;
484.1489 -+	  }
484.1490 -+	break;
484.1491 -+      case 3:
484.1492 -+	// 3 The sign immediately precedes the symbol.
484.1493 -+	if (__precedes)
484.1494 -+	  {
484.1495 -+	    __ret.field[0] = sign;
484.1496 -+	    __ret.field[1] = symbol;	    
484.1497 -+	    if (__space)
484.1498 -+	      {
484.1499 -+		__ret.field[2] = space;
484.1500 -+		__ret.field[3] = value;
484.1501 -+	      }
484.1502 -+	    else
484.1503 -+	      {
484.1504 -+		__ret.field[2] = value;		
484.1505 -+		__ret.field[3] = none;
484.1506 -+	      }
484.1507 -+	  }
484.1508 -+	else
484.1509 -+	  {
484.1510 -+	    __ret.field[0] = value;
484.1511 -+	    if (__space)
484.1512 -+	      {
484.1513 -+		__ret.field[1] = space;
484.1514 -+		__ret.field[2] = sign;
484.1515 -+		__ret.field[3] = symbol;
484.1516 -+	      }
484.1517 -+	    else
484.1518 -+	      {
484.1519 -+		__ret.field[1] = sign;
484.1520 -+		__ret.field[2] = symbol;
484.1521 -+		__ret.field[3] = none;
484.1522 -+	      }
484.1523 -+	  }
484.1524 -+	break;
484.1525 -+      case 4:
484.1526 -+	// 4 The sign immediately follows the symbol.
484.1527 -+	if (__precedes)
484.1528 -+	  {
484.1529 -+	    __ret.field[0] = symbol;
484.1530 -+	    __ret.field[1] = sign;
484.1531 -+	    if (__space)
484.1532 -+	      {
484.1533 -+		__ret.field[2] = space;
484.1534 -+		__ret.field[3] = value;
484.1535 -+	      }
484.1536 -+	    else
484.1537 -+	      {
484.1538 -+		__ret.field[2] = value;
484.1539 -+		__ret.field[3] = none;
484.1540 -+	      }
484.1541 -+	  }
484.1542 -+	else
484.1543 -+	  {
484.1544 -+	    __ret.field[0] = value;
484.1545 -+	    if (__space)
484.1546 -+	      {
484.1547 -+		__ret.field[1] = space;
484.1548 -+		__ret.field[2] = symbol;
484.1549 -+		__ret.field[3] = sign;
484.1550 -+	      }
484.1551 -+	    else
484.1552 -+	      {
484.1553 -+		__ret.field[1] = symbol;
484.1554 -+		__ret.field[2] = sign;
484.1555 -+		__ret.field[3] = none;
484.1556 -+	      }
484.1557 -+	  }
484.1558 -+	break;
484.1559 -+      default:
484.1560 -+	;
484.1561 -+      }
484.1562 -+    return __ret;
484.1563 -+  }
484.1564 -+
484.1565 -+  template<> 
484.1566 -+    void
484.1567 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
484.1568 -+						     const char*)
484.1569 -+    {
484.1570 -+      if (!_M_data)
484.1571 -+	_M_data = new __moneypunct_cache<char, true>;
484.1572 -+
484.1573 -+      if (!__cloc)
484.1574 -+	{
484.1575 -+	  // "C" locale
484.1576 -+	  _M_data->_M_decimal_point = '.';
484.1577 -+	  _M_data->_M_thousands_sep = ',';
484.1578 -+	  _M_data->_M_grouping = "";
484.1579 -+	  _M_data->_M_grouping_size = 0;
484.1580 -+	  _M_data->_M_curr_symbol = "";
484.1581 -+	  _M_data->_M_curr_symbol_size = 0;
484.1582 -+	  _M_data->_M_positive_sign = "";
484.1583 -+	  _M_data->_M_positive_sign_size = 0;
484.1584 -+	  _M_data->_M_negative_sign = "";
484.1585 -+	  _M_data->_M_negative_sign_size = 0;
484.1586 -+	  _M_data->_M_frac_digits = 0;
484.1587 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
484.1588 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
484.1589 -+
484.1590 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
484.1591 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
484.1592 -+	}
484.1593 -+      else
484.1594 -+	{
484.1595 -+	  // Named locale.
484.1596 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
484.1597 -+							__cloc));
484.1598 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
484.1599 -+							__cloc));
484.1600 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
484.1601 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
484.1602 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
484.1603 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
484.1604 -+
484.1605 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
484.1606 -+	  if (!__nposn)
484.1607 -+	    _M_data->_M_negative_sign = "()";
484.1608 -+	  else
484.1609 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
484.1610 -+							__cloc);
484.1611 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
484.1612 -+
484.1613 -+	  // _Intl == true
484.1614 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
484.1615 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
484.1616 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
484.1617 -+						      __cloc));
484.1618 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
484.1619 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
484.1620 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
484.1621 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
484.1622 -+							__pposn);
484.1623 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
484.1624 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
484.1625 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
484.1626 -+							__nposn);
484.1627 -+	}
484.1628 -+    }
484.1629 -+
484.1630 -+  template<> 
484.1631 -+    void
484.1632 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
484.1633 -+						      const char*)
484.1634 -+    {
484.1635 -+      if (!_M_data)
484.1636 -+	_M_data = new __moneypunct_cache<char, false>;
484.1637 -+
484.1638 -+      if (!__cloc)
484.1639 -+	{
484.1640 -+	  // "C" locale
484.1641 -+	  _M_data->_M_decimal_point = '.';
484.1642 -+	  _M_data->_M_thousands_sep = ',';
484.1643 -+	  _M_data->_M_grouping = "";
484.1644 -+	  _M_data->_M_grouping_size = 0;
484.1645 -+	  _M_data->_M_curr_symbol = "";
484.1646 -+	  _M_data->_M_curr_symbol_size = 0;
484.1647 -+	  _M_data->_M_positive_sign = "";
484.1648 -+	  _M_data->_M_positive_sign_size = 0;
484.1649 -+	  _M_data->_M_negative_sign = "";
484.1650 -+	  _M_data->_M_negative_sign_size = 0;
484.1651 -+	  _M_data->_M_frac_digits = 0;
484.1652 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
484.1653 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
484.1654 -+
484.1655 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
484.1656 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
484.1657 -+	}
484.1658 -+      else
484.1659 -+	{
484.1660 -+	  // Named locale.
484.1661 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
484.1662 -+							__cloc));
484.1663 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
484.1664 -+							__cloc));
484.1665 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
484.1666 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
484.1667 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
484.1668 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
484.1669 -+
484.1670 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
484.1671 -+	  if (!__nposn)
484.1672 -+	    _M_data->_M_negative_sign = "()";
484.1673 -+	  else
484.1674 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
484.1675 -+							__cloc);
484.1676 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
484.1677 -+
484.1678 -+	  // _Intl == false
484.1679 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
484.1680 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
484.1681 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
484.1682 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
484.1683 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
484.1684 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
484.1685 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
484.1686 -+							__pposn);
484.1687 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
484.1688 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
484.1689 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
484.1690 -+							__nposn);
484.1691 -+	}
484.1692 -+    }
484.1693 -+
484.1694 -+  template<> 
484.1695 -+    moneypunct<char, true>::~moneypunct()
484.1696 -+    { delete _M_data; }
484.1697 -+
484.1698 -+  template<> 
484.1699 -+    moneypunct<char, false>::~moneypunct()
484.1700 -+    { delete _M_data; }
484.1701 -+
484.1702 -+#ifdef _GLIBCXX_USE_WCHAR_T
484.1703 -+  template<> 
484.1704 -+    void
484.1705 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
484.1706 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1707 -+							const char*)
484.1708 -+#else
484.1709 -+							const char* __name)
484.1710 -+#endif
484.1711 -+    {
484.1712 -+      if (!_M_data)
484.1713 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
484.1714 -+
484.1715 -+      if (!__cloc)
484.1716 -+	{
484.1717 -+	  // "C" locale
484.1718 -+	  _M_data->_M_decimal_point = L'.';
484.1719 -+	  _M_data->_M_thousands_sep = L',';
484.1720 -+	  _M_data->_M_grouping = "";
484.1721 -+	  _M_data->_M_grouping_size = 0;
484.1722 -+	  _M_data->_M_curr_symbol = L"";
484.1723 -+	  _M_data->_M_curr_symbol_size = 0;
484.1724 -+	  _M_data->_M_positive_sign = L"";
484.1725 -+	  _M_data->_M_positive_sign_size = 0;
484.1726 -+	  _M_data->_M_negative_sign = L"";
484.1727 -+	  _M_data->_M_negative_sign_size = 0;
484.1728 -+	  _M_data->_M_frac_digits = 0;
484.1729 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
484.1730 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
484.1731 -+
484.1732 -+	  // Use ctype::widen code without the facet...
484.1733 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
484.1734 -+	    _M_data->_M_atoms[__i] =
484.1735 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
484.1736 -+	}
484.1737 -+      else
484.1738 -+	{
484.1739 -+	  // Named locale.
484.1740 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1741 -+	  __c_locale __old = __uselocale(__cloc);
484.1742 -+#else
484.1743 -+	  // Switch to named locale so that mbsrtowcs will work.
484.1744 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
484.1745 -+	  setlocale(LC_ALL, __name);
484.1746 -+#endif
484.1747 -+
484.1748 -+#ifdef __UCLIBC_MJN3_ONLY__
484.1749 -+#warning fix this... should be monetary
484.1750 -+#endif
484.1751 -+#ifdef __UCLIBC__
484.1752 -+# ifdef __UCLIBC_HAS_XLOCALE__
484.1753 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
484.1754 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
484.1755 -+# else
484.1756 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
484.1757 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
484.1758 -+# endif
484.1759 -+#else
484.1760 -+	  union { char *__s; wchar_t __w; } __u;
484.1761 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
484.1762 -+	  _M_data->_M_decimal_point = __u.__w;
484.1763 -+
484.1764 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
484.1765 -+	  _M_data->_M_thousands_sep = __u.__w;
484.1766 -+#endif
484.1767 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
484.1768 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
484.1769 -+
484.1770 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
484.1771 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
484.1772 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
484.1773 -+
484.1774 -+	  wchar_t* __wcs_ps = 0;
484.1775 -+	  wchar_t* __wcs_ns = 0;
484.1776 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
484.1777 -+	  try
484.1778 -+	    {
484.1779 -+	      mbstate_t __state;
484.1780 -+	      size_t __len = strlen(__cpossign);
484.1781 -+	      if (__len)
484.1782 -+		{
484.1783 -+		  ++__len;
484.1784 -+		  memset(&__state, 0, sizeof(mbstate_t));
484.1785 -+		  __wcs_ps = new wchar_t[__len];
484.1786 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
484.1787 -+		  _M_data->_M_positive_sign = __wcs_ps;
484.1788 -+		}
484.1789 -+	      else
484.1790 -+		_M_data->_M_positive_sign = L"";
484.1791 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
484.1792 -+	      
484.1793 -+	      __len = strlen(__cnegsign);
484.1794 -+	      if (!__nposn)
484.1795 -+		_M_data->_M_negative_sign = L"()";
484.1796 -+	      else if (__len)
484.1797 -+		{ 
484.1798 -+		  ++__len;
484.1799 -+		  memset(&__state, 0, sizeof(mbstate_t));
484.1800 -+		  __wcs_ns = new wchar_t[__len];
484.1801 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
484.1802 -+		  _M_data->_M_negative_sign = __wcs_ns;
484.1803 -+		}
484.1804 -+	      else
484.1805 -+		_M_data->_M_negative_sign = L"";
484.1806 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
484.1807 -+	      
484.1808 -+	      // _Intl == true.
484.1809 -+	      __len = strlen(__ccurr);
484.1810 -+	      if (__len)
484.1811 -+		{
484.1812 -+		  ++__len;
484.1813 -+		  memset(&__state, 0, sizeof(mbstate_t));
484.1814 -+		  wchar_t* __wcs = new wchar_t[__len];
484.1815 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
484.1816 -+		  _M_data->_M_curr_symbol = __wcs;
484.1817 -+		}
484.1818 -+	      else
484.1819 -+		_M_data->_M_curr_symbol = L"";
484.1820 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
484.1821 -+	    }
484.1822 -+	  catch (...)
484.1823 -+	    {
484.1824 -+	      delete _M_data;
484.1825 -+	      _M_data = 0;
484.1826 -+	      delete __wcs_ps;
484.1827 -+	      delete __wcs_ns;	      
484.1828 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1829 -+	      __uselocale(__old);
484.1830 -+#else
484.1831 -+	      setlocale(LC_ALL, __old);
484.1832 -+	      free(__old);
484.1833 -+#endif
484.1834 -+	      __throw_exception_again;
484.1835 -+	    } 
484.1836 -+	  
484.1837 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
484.1838 -+						      __cloc));
484.1839 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
484.1840 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
484.1841 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
484.1842 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
484.1843 -+							__pposn);
484.1844 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
484.1845 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
484.1846 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
484.1847 -+							__nposn);
484.1848 -+
484.1849 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1850 -+	  __uselocale(__old);
484.1851 -+#else
484.1852 -+	  setlocale(LC_ALL, __old);
484.1853 -+	  free(__old);
484.1854 -+#endif
484.1855 -+	}
484.1856 -+    }
484.1857 -+
484.1858 -+  template<> 
484.1859 -+  void
484.1860 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
484.1861 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1862 -+						       const char*)
484.1863 -+#else
484.1864 -+                                                       const char* __name)
484.1865 -+#endif
484.1866 -+  {
484.1867 -+    if (!_M_data)
484.1868 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
484.1869 -+
484.1870 -+    if (!__cloc)
484.1871 -+	{
484.1872 -+	  // "C" locale
484.1873 -+	  _M_data->_M_decimal_point = L'.';
484.1874 -+	  _M_data->_M_thousands_sep = L',';
484.1875 -+	  _M_data->_M_grouping = "";
484.1876 -+          _M_data->_M_grouping_size = 0;
484.1877 -+	  _M_data->_M_curr_symbol = L"";
484.1878 -+	  _M_data->_M_curr_symbol_size = 0;
484.1879 -+	  _M_data->_M_positive_sign = L"";
484.1880 -+	  _M_data->_M_positive_sign_size = 0;
484.1881 -+	  _M_data->_M_negative_sign = L"";
484.1882 -+	  _M_data->_M_negative_sign_size = 0;
484.1883 -+	  _M_data->_M_frac_digits = 0;
484.1884 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
484.1885 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
484.1886 -+
484.1887 -+	  // Use ctype::widen code without the facet...
484.1888 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
484.1889 -+	    _M_data->_M_atoms[__i] =
484.1890 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
484.1891 -+	}
484.1892 -+      else
484.1893 -+	{
484.1894 -+	  // Named locale.
484.1895 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1896 -+	  __c_locale __old = __uselocale(__cloc);
484.1897 -+#else
484.1898 -+	  // Switch to named locale so that mbsrtowcs will work.
484.1899 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
484.1900 -+	  setlocale(LC_ALL, __name);
484.1901 -+#endif
484.1902 -+
484.1903 -+#ifdef __UCLIBC_MJN3_ONLY__
484.1904 -+#warning fix this... should be monetary
484.1905 -+#endif
484.1906 -+#ifdef __UCLIBC__
484.1907 -+# ifdef __UCLIBC_HAS_XLOCALE__
484.1908 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
484.1909 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
484.1910 -+# else
484.1911 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
484.1912 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
484.1913 -+# endif
484.1914 -+#else
484.1915 -+          union { char *__s; wchar_t __w; } __u;
484.1916 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
484.1917 -+	  _M_data->_M_decimal_point = __u.__w;
484.1918 -+
484.1919 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
484.1920 -+	  _M_data->_M_thousands_sep = __u.__w;
484.1921 -+#endif
484.1922 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
484.1923 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
484.1924 -+
484.1925 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
484.1926 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
484.1927 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
484.1928 -+
484.1929 -+	  wchar_t* __wcs_ps = 0;
484.1930 -+	  wchar_t* __wcs_ns = 0;
484.1931 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
484.1932 -+	  try
484.1933 -+            {
484.1934 -+              mbstate_t __state;
484.1935 -+              size_t __len;
484.1936 -+              __len = strlen(__cpossign);
484.1937 -+              if (__len)
484.1938 -+                {
484.1939 -+		  ++__len;
484.1940 -+		  memset(&__state, 0, sizeof(mbstate_t));
484.1941 -+		  __wcs_ps = new wchar_t[__len];
484.1942 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
484.1943 -+		  _M_data->_M_positive_sign = __wcs_ps;
484.1944 -+		}
484.1945 -+	      else
484.1946 -+		_M_data->_M_positive_sign = L"";
484.1947 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
484.1948 -+	      
484.1949 -+	      __len = strlen(__cnegsign);
484.1950 -+	      if (!__nposn)
484.1951 -+		_M_data->_M_negative_sign = L"()";
484.1952 -+	      else if (__len)
484.1953 -+		{ 
484.1954 -+		  ++__len;
484.1955 -+		  memset(&__state, 0, sizeof(mbstate_t));
484.1956 -+		  __wcs_ns = new wchar_t[__len];
484.1957 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
484.1958 -+		  _M_data->_M_negative_sign = __wcs_ns;
484.1959 -+		}
484.1960 -+	      else
484.1961 -+		_M_data->_M_negative_sign = L"";
484.1962 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
484.1963 -+
484.1964 -+	      // _Intl == true.
484.1965 -+	      __len = strlen(__ccurr);
484.1966 -+	      if (__len)
484.1967 -+		{
484.1968 -+		  ++__len;
484.1969 -+		  memset(&__state, 0, sizeof(mbstate_t));
484.1970 -+		  wchar_t* __wcs = new wchar_t[__len];
484.1971 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
484.1972 -+		  _M_data->_M_curr_symbol = __wcs;
484.1973 -+		}
484.1974 -+	      else
484.1975 -+		_M_data->_M_curr_symbol = L"";
484.1976 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
484.1977 -+	    }
484.1978 -+          catch (...)
484.1979 -+	    {
484.1980 -+	      delete _M_data;
484.1981 -+              _M_data = 0;
484.1982 -+	      delete __wcs_ps;
484.1983 -+	      delete __wcs_ns;	      
484.1984 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.1985 -+	      __uselocale(__old);
484.1986 -+#else
484.1987 -+	      setlocale(LC_ALL, __old);
484.1988 -+	      free(__old);
484.1989 -+#endif
484.1990 -+              __throw_exception_again;
484.1991 -+	    }
484.1992 -+
484.1993 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
484.1994 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
484.1995 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
484.1996 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
484.1997 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
484.1998 -+	                                                __pposn);
484.1999 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
484.2000 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
484.2001 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
484.2002 -+	                                                __nposn);
484.2003 -+
484.2004 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.2005 -+	  __uselocale(__old);
484.2006 -+#else
484.2007 -+	  setlocale(LC_ALL, __old);
484.2008 -+	  free(__old);
484.2009 -+#endif
484.2010 -+	}
484.2011 -+    }
484.2012 -+
484.2013 -+  template<> 
484.2014 -+    moneypunct<wchar_t, true>::~moneypunct()
484.2015 -+    {
484.2016 -+      if (_M_data->_M_positive_sign_size)
484.2017 -+	delete [] _M_data->_M_positive_sign;
484.2018 -+      if (_M_data->_M_negative_sign_size
484.2019 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
484.2020 -+	delete [] _M_data->_M_negative_sign;
484.2021 -+      if (_M_data->_M_curr_symbol_size)
484.2022 -+	delete [] _M_data->_M_curr_symbol;
484.2023 -+      delete _M_data;
484.2024 -+    }
484.2025 -+
484.2026 -+  template<> 
484.2027 -+    moneypunct<wchar_t, false>::~moneypunct()
484.2028 -+    {
484.2029 -+      if (_M_data->_M_positive_sign_size)
484.2030 -+	delete [] _M_data->_M_positive_sign;
484.2031 -+      if (_M_data->_M_negative_sign_size
484.2032 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
484.2033 -+	delete [] _M_data->_M_negative_sign;
484.2034 -+      if (_M_data->_M_curr_symbol_size)
484.2035 -+	delete [] _M_data->_M_curr_symbol;
484.2036 -+      delete _M_data;
484.2037 -+    }
484.2038 -+#endif
484.2039 -+}
484.2040 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
484.2041 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
484.2042 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:39.000000000 +0200
484.2043 -@@ -0,0 +1,160 @@
484.2044 -+// std::numpunct implementation details, GNU version -*- C++ -*-
484.2045 -+
484.2046 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
484.2047 -+//
484.2048 -+// This file is part of the GNU ISO C++ Library.  This library is free
484.2049 -+// software; you can redistribute it and/or modify it under the
484.2050 -+// terms of the GNU General Public License as published by the
484.2051 -+// Free Software Foundation; either version 2, or (at your option)
484.2052 -+// any later version.
484.2053 -+
484.2054 -+// This library is distributed in the hope that it will be useful,
484.2055 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
484.2056 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
484.2057 -+// GNU General Public License for more details.
484.2058 -+
484.2059 -+// You should have received a copy of the GNU General Public License along
484.2060 -+// with this library; see the file COPYING.  If not, write to the Free
484.2061 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
484.2062 -+// USA.
484.2063 -+
484.2064 -+// As a special exception, you may use this file as part of a free software
484.2065 -+// library without restriction.  Specifically, if other files instantiate
484.2066 -+// templates or use macros or inline functions from this file, or you compile
484.2067 -+// this file and link it with other files to produce an executable, this
484.2068 -+// file does not by itself cause the resulting executable to be covered by
484.2069 -+// the GNU General Public License.  This exception does not however
484.2070 -+// invalidate any other reasons why the executable file might be covered by
484.2071 -+// the GNU General Public License.
484.2072 -+
484.2073 -+//
484.2074 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
484.2075 -+//
484.2076 -+
484.2077 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
484.2078 -+
484.2079 -+#define _LIBC
484.2080 -+#include <locale>
484.2081 -+#undef _LIBC
484.2082 -+#include <bits/c++locale_internal.h>
484.2083 -+
484.2084 -+#ifdef __UCLIBC_MJN3_ONLY__
484.2085 -+#warning tailor for stub locale support
484.2086 -+#endif
484.2087 -+#ifndef __UCLIBC_HAS_XLOCALE__
484.2088 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
484.2089 -+#endif
484.2090 -+
484.2091 -+namespace std
484.2092 -+{
484.2093 -+  template<> 
484.2094 -+    void
484.2095 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
484.2096 -+    {
484.2097 -+      if (!_M_data)
484.2098 -+	_M_data = new __numpunct_cache<char>;
484.2099 -+
484.2100 -+      if (!__cloc)
484.2101 -+	{
484.2102 -+	  // "C" locale
484.2103 -+	  _M_data->_M_grouping = "";
484.2104 -+	  _M_data->_M_grouping_size = 0;
484.2105 -+	  _M_data->_M_use_grouping = false;
484.2106 -+
484.2107 -+	  _M_data->_M_decimal_point = '.';
484.2108 -+	  _M_data->_M_thousands_sep = ',';
484.2109 -+
484.2110 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
484.2111 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
484.2112 -+
484.2113 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
484.2114 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
484.2115 -+	}
484.2116 -+      else
484.2117 -+	{
484.2118 -+	  // Named locale.
484.2119 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
484.2120 -+							__cloc));
484.2121 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
484.2122 -+							__cloc));
484.2123 -+
484.2124 -+	  // Check for NULL, which implies no grouping.
484.2125 -+	  if (_M_data->_M_thousands_sep == '\0')
484.2126 -+	    _M_data->_M_grouping = "";
484.2127 -+	  else
484.2128 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
484.2129 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
484.2130 -+	}
484.2131 -+
484.2132 -+      // NB: There is no way to extact this info from posix locales.
484.2133 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
484.2134 -+      _M_data->_M_truename = "true";
484.2135 -+      _M_data->_M_truename_size = 4;
484.2136 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
484.2137 -+      _M_data->_M_falsename = "false";
484.2138 -+      _M_data->_M_falsename_size = 5;
484.2139 -+    }
484.2140 -+ 
484.2141 -+  template<> 
484.2142 -+    numpunct<char>::~numpunct()
484.2143 -+    { delete _M_data; }
484.2144 -+   
484.2145 -+#ifdef _GLIBCXX_USE_WCHAR_T
484.2146 -+  template<> 
484.2147 -+    void
484.2148 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
484.2149 -+    {
484.2150 -+      if (!_M_data)
484.2151 -+	_M_data = new __numpunct_cache<wchar_t>;
484.2152 -+
484.2153 -+      if (!__cloc)
484.2154 -+	{
484.2155 -+	  // "C" locale
484.2156 -+	  _M_data->_M_grouping = "";
484.2157 -+	  _M_data->_M_grouping_size = 0;
484.2158 -+	  _M_data->_M_use_grouping = false;
484.2159 -+
484.2160 -+	  _M_data->_M_decimal_point = L'.';
484.2161 -+	  _M_data->_M_thousands_sep = L',';
484.2162 -+
484.2163 -+	  // Use ctype::widen code without the facet...
484.2164 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
484.2165 -+	    _M_data->_M_atoms_out[__i] =
484.2166 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
484.2167 -+
484.2168 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
484.2169 -+	    _M_data->_M_atoms_in[__j] =
484.2170 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
484.2171 -+	}
484.2172 -+      else
484.2173 -+	{
484.2174 -+	  // Named locale.
484.2175 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
484.2176 -+	  union { char *__s; wchar_t __w; } __u;
484.2177 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
484.2178 -+	  _M_data->_M_decimal_point = __u.__w;
484.2179 -+
484.2180 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
484.2181 -+	  _M_data->_M_thousands_sep = __u.__w;
484.2182 -+
484.2183 -+	  if (_M_data->_M_thousands_sep == L'\0')
484.2184 -+	    _M_data->_M_grouping = "";
484.2185 -+	  else
484.2186 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
484.2187 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
484.2188 -+	}
484.2189 -+
484.2190 -+      // NB: There is no way to extact this info from posix locales.
484.2191 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
484.2192 -+      _M_data->_M_truename = L"true";
484.2193 -+      _M_data->_M_truename_size = 4;
484.2194 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
484.2195 -+      _M_data->_M_falsename = L"false";
484.2196 -+      _M_data->_M_falsename_size = 5;
484.2197 -+    }
484.2198 -+
484.2199 -+  template<> 
484.2200 -+    numpunct<wchar_t>::~numpunct()
484.2201 -+    { delete _M_data; }
484.2202 -+ #endif
484.2203 -+}
484.2204 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc
484.2205 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
484.2206 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:39.000000000 +0200
484.2207 -@@ -0,0 +1,406 @@
484.2208 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
484.2209 -+
484.2210 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
484.2211 -+//
484.2212 -+// This file is part of the GNU ISO C++ Library.  This library is free
484.2213 -+// software; you can redistribute it and/or modify it under the
484.2214 -+// terms of the GNU General Public License as published by the
484.2215 -+// Free Software Foundation; either version 2, or (at your option)
484.2216 -+// any later version.
484.2217 -+
484.2218 -+// This library is distributed in the hope that it will be useful,
484.2219 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
484.2220 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
484.2221 -+// GNU General Public License for more details.
484.2222 -+
484.2223 -+// You should have received a copy of the GNU General Public License along
484.2224 -+// with this library; see the file COPYING.  If not, write to the Free
484.2225 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
484.2226 -+// USA.
484.2227 -+
484.2228 -+// As a special exception, you may use this file as part of a free software
484.2229 -+// library without restriction.  Specifically, if other files instantiate
484.2230 -+// templates or use macros or inline functions from this file, or you compile
484.2231 -+// this file and link it with other files to produce an executable, this
484.2232 -+// file does not by itself cause the resulting executable to be covered by
484.2233 -+// the GNU General Public License.  This exception does not however
484.2234 -+// invalidate any other reasons why the executable file might be covered by
484.2235 -+// the GNU General Public License.
484.2236 -+
484.2237 -+//
484.2238 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
484.2239 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
484.2240 -+//
484.2241 -+
484.2242 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
484.2243 -+
484.2244 -+#include <locale>
484.2245 -+#include <bits/c++locale_internal.h>
484.2246 -+
484.2247 -+#ifdef __UCLIBC_MJN3_ONLY__
484.2248 -+#warning tailor for stub locale support
484.2249 -+#endif
484.2250 -+#ifndef __UCLIBC_HAS_XLOCALE__
484.2251 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
484.2252 -+#endif
484.2253 -+
484.2254 -+namespace std
484.2255 -+{
484.2256 -+  template<>
484.2257 -+    void
484.2258 -+    __timepunct<char>::
484.2259 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
484.2260 -+	   const tm* __tm) const
484.2261 -+    {
484.2262 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.2263 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
484.2264 -+					_M_c_locale_timepunct);
484.2265 -+#else
484.2266 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
484.2267 -+      setlocale(LC_ALL, _M_name_timepunct);
484.2268 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
484.2269 -+      setlocale(LC_ALL, __old);
484.2270 -+      free(__old);
484.2271 -+#endif
484.2272 -+      // Make sure __s is null terminated.
484.2273 -+      if (__len == 0)
484.2274 -+	__s[0] = '\0';
484.2275 -+    }
484.2276 -+
484.2277 -+  template<> 
484.2278 -+    void
484.2279 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
484.2280 -+    {
484.2281 -+      if (!_M_data)
484.2282 -+	_M_data = new __timepunct_cache<char>;
484.2283 -+
484.2284 -+      if (!__cloc)
484.2285 -+	{
484.2286 -+	  // "C" locale
484.2287 -+	  _M_c_locale_timepunct = _S_get_c_locale();
484.2288 -+
484.2289 -+	  _M_data->_M_date_format = "%m/%d/%y";
484.2290 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
484.2291 -+	  _M_data->_M_time_format = "%H:%M:%S";
484.2292 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
484.2293 -+	  _M_data->_M_date_time_format = "";
484.2294 -+	  _M_data->_M_date_time_era_format = "";
484.2295 -+	  _M_data->_M_am = "AM";
484.2296 -+	  _M_data->_M_pm = "PM";
484.2297 -+	  _M_data->_M_am_pm_format = "";
484.2298 -+
484.2299 -+	  // Day names, starting with "C"'s Sunday.
484.2300 -+	  _M_data->_M_day1 = "Sunday";
484.2301 -+	  _M_data->_M_day2 = "Monday";
484.2302 -+	  _M_data->_M_day3 = "Tuesday";
484.2303 -+	  _M_data->_M_day4 = "Wednesday";
484.2304 -+	  _M_data->_M_day5 = "Thursday";
484.2305 -+	  _M_data->_M_day6 = "Friday";
484.2306 -+	  _M_data->_M_day7 = "Saturday";
484.2307 -+
484.2308 -+	  // Abbreviated day names, starting with "C"'s Sun.
484.2309 -+	  _M_data->_M_aday1 = "Sun";
484.2310 -+	  _M_data->_M_aday2 = "Mon";
484.2311 -+	  _M_data->_M_aday3 = "Tue";
484.2312 -+	  _M_data->_M_aday4 = "Wed";
484.2313 -+	  _M_data->_M_aday5 = "Thu";
484.2314 -+	  _M_data->_M_aday6 = "Fri";
484.2315 -+	  _M_data->_M_aday7 = "Sat";
484.2316 -+
484.2317 -+	  // Month names, starting with "C"'s January.
484.2318 -+	  _M_data->_M_month01 = "January";
484.2319 -+	  _M_data->_M_month02 = "February";
484.2320 -+	  _M_data->_M_month03 = "March";
484.2321 -+	  _M_data->_M_month04 = "April";
484.2322 -+	  _M_data->_M_month05 = "May";
484.2323 -+	  _M_data->_M_month06 = "June";
484.2324 -+	  _M_data->_M_month07 = "July";
484.2325 -+	  _M_data->_M_month08 = "August";
484.2326 -+	  _M_data->_M_month09 = "September";
484.2327 -+	  _M_data->_M_month10 = "October";
484.2328 -+	  _M_data->_M_month11 = "November";
484.2329 -+	  _M_data->_M_month12 = "December";
484.2330 -+
484.2331 -+	  // Abbreviated month names, starting with "C"'s Jan.
484.2332 -+	  _M_data->_M_amonth01 = "Jan";
484.2333 -+	  _M_data->_M_amonth02 = "Feb";
484.2334 -+	  _M_data->_M_amonth03 = "Mar";
484.2335 -+	  _M_data->_M_amonth04 = "Apr";
484.2336 -+	  _M_data->_M_amonth05 = "May";
484.2337 -+	  _M_data->_M_amonth06 = "Jun";
484.2338 -+	  _M_data->_M_amonth07 = "Jul";
484.2339 -+	  _M_data->_M_amonth08 = "Aug";
484.2340 -+	  _M_data->_M_amonth09 = "Sep";
484.2341 -+	  _M_data->_M_amonth10 = "Oct";
484.2342 -+	  _M_data->_M_amonth11 = "Nov";
484.2343 -+	  _M_data->_M_amonth12 = "Dec";
484.2344 -+	}
484.2345 -+      else
484.2346 -+	{
484.2347 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
484.2348 -+
484.2349 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
484.2350 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
484.2351 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
484.2352 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
484.2353 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
484.2354 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
484.2355 -+							     __cloc);
484.2356 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
484.2357 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
484.2358 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
484.2359 -+
484.2360 -+	  // Day names, starting with "C"'s Sunday.
484.2361 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
484.2362 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
484.2363 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
484.2364 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
484.2365 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
484.2366 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
484.2367 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
484.2368 -+
484.2369 -+	  // Abbreviated day names, starting with "C"'s Sun.
484.2370 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
484.2371 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
484.2372 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
484.2373 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
484.2374 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
484.2375 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
484.2376 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
484.2377 -+
484.2378 -+	  // Month names, starting with "C"'s January.
484.2379 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
484.2380 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
484.2381 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
484.2382 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
484.2383 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
484.2384 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
484.2385 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
484.2386 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
484.2387 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
484.2388 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
484.2389 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
484.2390 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
484.2391 -+
484.2392 -+	  // Abbreviated month names, starting with "C"'s Jan.
484.2393 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
484.2394 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
484.2395 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
484.2396 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
484.2397 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
484.2398 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
484.2399 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
484.2400 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
484.2401 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
484.2402 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
484.2403 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
484.2404 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
484.2405 -+	}
484.2406 -+    }
484.2407 -+
484.2408 -+#ifdef _GLIBCXX_USE_WCHAR_T
484.2409 -+  template<>
484.2410 -+    void
484.2411 -+    __timepunct<wchar_t>::
484.2412 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
484.2413 -+	   const tm* __tm) const
484.2414 -+    {
484.2415 -+#ifdef __UCLIBC_HAS_XLOCALE__
484.2416 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
484.2417 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
484.2418 -+					_M_c_locale_timepunct);
484.2419 -+#else
484.2420 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
484.2421 -+      setlocale(LC_ALL, _M_name_timepunct);
484.2422 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
484.2423 -+      setlocale(LC_ALL, __old);
484.2424 -+      free(__old);
484.2425 -+#endif
484.2426 -+      // Make sure __s is null terminated.
484.2427 -+      if (__len == 0)
484.2428 -+	__s[0] = L'\0';
484.2429 -+    }
484.2430 -+
484.2431 -+  template<> 
484.2432 -+    void
484.2433 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
484.2434 -+    {
484.2435 -+      if (!_M_data)
484.2436 -+	_M_data = new __timepunct_cache<wchar_t>;
484.2437 -+
484.2438 -+#warning wide time stuff
484.2439 -+//       if (!__cloc)
484.2440 -+	{
484.2441 -+	  // "C" locale
484.2442 -+	  _M_c_locale_timepunct = _S_get_c_locale();
484.2443 -+
484.2444 -+	  _M_data->_M_date_format = L"%m/%d/%y";
484.2445 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
484.2446 -+	  _M_data->_M_time_format = L"%H:%M:%S";
484.2447 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
484.2448 -+	  _M_data->_M_date_time_format = L"";
484.2449 -+	  _M_data->_M_date_time_era_format = L"";
484.2450 -+	  _M_data->_M_am = L"AM";
484.2451 -+	  _M_data->_M_pm = L"PM";
484.2452 -+	  _M_data->_M_am_pm_format = L"";
484.2453 -+
484.2454 -+	  // Day names, starting with "C"'s Sunday.
484.2455 -+	  _M_data->_M_day1 = L"Sunday";
484.2456 -+	  _M_data->_M_day2 = L"Monday";
484.2457 -+	  _M_data->_M_day3 = L"Tuesday";
484.2458 -+	  _M_data->_M_day4 = L"Wednesday";
484.2459 -+	  _M_data->_M_day5 = L"Thursday";
484.2460 -+	  _M_data->_M_day6 = L"Friday";
484.2461 -+	  _M_data->_M_day7 = L"Saturday";
484.2462 -+
484.2463 -+	  // Abbreviated day names, starting with "C"'s Sun.
484.2464 -+	  _M_data->_M_aday1 = L"Sun";
484.2465 -+	  _M_data->_M_aday2 = L"Mon";
484.2466 -+	  _M_data->_M_aday3 = L"Tue";
484.2467 -+	  _M_data->_M_aday4 = L"Wed";
484.2468 -+	  _M_data->_M_aday5 = L"Thu";
484.2469 -+	  _M_data->_M_aday6 = L"Fri";
484.2470 -+	  _M_data->_M_aday7 = L"Sat";
484.2471 -+
484.2472 -+	  // Month names, starting with "C"'s January.
484.2473 -+	  _M_data->_M_month01 = L"January";
484.2474 -+	  _M_data->_M_month02 = L"February";
484.2475 -+	  _M_data->_M_month03 = L"March";
484.2476 -+	  _M_data->_M_month04 = L"April";
484.2477 -+	  _M_data->_M_month05 = L"May";
484.2478 -+	  _M_data->_M_month06 = L"June";
484.2479 -+	  _M_data->_M_month07 = L"July";
484.2480 -+	  _M_data->_M_month08 = L"August";
484.2481 -+	  _M_data->_M_month09 = L"September";
484.2482 -+	  _M_data->_M_month10 = L"October";
484.2483 -+	  _M_data->_M_month11 = L"November";
484.2484 -+	  _M_data->_M_month12 = L"December";
484.2485 -+
484.2486 -+	  // Abbreviated month names, starting with "C"'s Jan.
484.2487 -+	  _M_data->_M_amonth01 = L"Jan";
484.2488 -+	  _M_data->_M_amonth02 = L"Feb";
484.2489 -+	  _M_data->_M_amonth03 = L"Mar";
484.2490 -+	  _M_data->_M_amonth04 = L"Apr";
484.2491 -+	  _M_data->_M_amonth05 = L"May";
484.2492 -+	  _M_data->_M_amonth06 = L"Jun";
484.2493 -+	  _M_data->_M_amonth07 = L"Jul";
484.2494 -+	  _M_data->_M_amonth08 = L"Aug";
484.2495 -+	  _M_data->_M_amonth09 = L"Sep";
484.2496 -+	  _M_data->_M_amonth10 = L"Oct";
484.2497 -+	  _M_data->_M_amonth11 = L"Nov";
484.2498 -+	  _M_data->_M_amonth12 = L"Dec";
484.2499 -+	}
484.2500 -+#if 0
484.2501 -+      else
484.2502 -+	{
484.2503 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
484.2504 -+
484.2505 -+	  union { char *__s; wchar_t *__w; } __u;
484.2506 -+
484.2507 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
484.2508 -+	  _M_data->_M_date_format = __u.__w;
484.2509 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
484.2510 -+	  _M_data->_M_date_era_format = __u.__w;
484.2511 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
484.2512 -+	  _M_data->_M_time_format = __u.__w;
484.2513 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
484.2514 -+	  _M_data->_M_time_era_format = __u.__w;
484.2515 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
484.2516 -+	  _M_data->_M_date_time_format = __u.__w;
484.2517 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
484.2518 -+	  _M_data->_M_date_time_era_format = __u.__w;
484.2519 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
484.2520 -+	  _M_data->_M_am = __u.__w;
484.2521 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
484.2522 -+	  _M_data->_M_pm = __u.__w;
484.2523 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
484.2524 -+	  _M_data->_M_am_pm_format = __u.__w;
484.2525 -+
484.2526 -+	  // Day names, starting with "C"'s Sunday.
484.2527 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
484.2528 -+	  _M_data->_M_day1 = __u.__w;
484.2529 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
484.2530 -+	  _M_data->_M_day2 = __u.__w;
484.2531 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
484.2532 -+	  _M_data->_M_day3 = __u.__w;
484.2533 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
484.2534 -+	  _M_data->_M_day4 = __u.__w;
484.2535 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
484.2536 -+	  _M_data->_M_day5 = __u.__w;
484.2537 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
484.2538 -+	  _M_data->_M_day6 = __u.__w;
484.2539 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
484.2540 -+	  _M_data->_M_day7 = __u.__w;
484.2541 -+
484.2542 -+	  // Abbreviated day names, starting with "C"'s Sun.
484.2543 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
484.2544 -+	  _M_data->_M_aday1 = __u.__w;
484.2545 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
484.2546 -+	  _M_data->_M_aday2 = __u.__w;
484.2547 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
484.2548 -+	  _M_data->_M_aday3 = __u.__w;
484.2549 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
484.2550 -+	  _M_data->_M_aday4 = __u.__w;
484.2551 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
484.2552 -+	  _M_data->_M_aday5 = __u.__w;
484.2553 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
484.2554 -+	  _M_data->_M_aday6 = __u.__w;
484.2555 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
484.2556 -+	  _M_data->_M_aday7 = __u.__w;
484.2557 -+
484.2558 -+	  // Month names, starting with "C"'s January.
484.2559 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
484.2560 -+	  _M_data->_M_month01 = __u.__w;
484.2561 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
484.2562 -+	  _M_data->_M_month02 = __u.__w;
484.2563 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
484.2564 -+	  _M_data->_M_month03 = __u.__w;
484.2565 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
484.2566 -+	  _M_data->_M_month04 = __u.__w;
484.2567 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
484.2568 -+	  _M_data->_M_month05 = __u.__w;
484.2569 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
484.2570 -+	  _M_data->_M_month06 = __u.__w;
484.2571 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
484.2572 -+	  _M_data->_M_month07 = __u.__w;
484.2573 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
484.2574 -+	  _M_data->_M_month08 = __u.__w;
484.2575 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
484.2576 -+	  _M_data->_M_month09 = __u.__w;
484.2577 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
484.2578 -+	  _M_data->_M_month10 = __u.__w;
484.2579 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
484.2580 -+	  _M_data->_M_month11 = __u.__w;
484.2581 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
484.2582 -+	  _M_data->_M_month12 = __u.__w;
484.2583 -+
484.2584 -+	  // Abbreviated month names, starting with "C"'s Jan.
484.2585 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
484.2586 -+	  _M_data->_M_amonth01 = __u.__w;
484.2587 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
484.2588 -+	  _M_data->_M_amonth02 = __u.__w;
484.2589 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
484.2590 -+	  _M_data->_M_amonth03 = __u.__w;
484.2591 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
484.2592 -+	  _M_data->_M_amonth04 = __u.__w;
484.2593 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
484.2594 -+	  _M_data->_M_amonth05 = __u.__w;
484.2595 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
484.2596 -+	  _M_data->_M_amonth06 = __u.__w;
484.2597 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
484.2598 -+	  _M_data->_M_amonth07 = __u.__w;
484.2599 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
484.2600 -+	  _M_data->_M_amonth08 = __u.__w;
484.2601 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
484.2602 -+	  _M_data->_M_amonth09 = __u.__w;
484.2603 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
484.2604 -+	  _M_data->_M_amonth10 = __u.__w;
484.2605 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
484.2606 -+	  _M_data->_M_amonth11 = __u.__w;
484.2607 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
484.2608 -+	  _M_data->_M_amonth12 = __u.__w;
484.2609 -+	}
484.2610 -+#endif // 0
484.2611 -+    }
484.2612 -+#endif
484.2613 -+}
484.2614 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
484.2615 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
484.2616 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:39.000000000 +0200
484.2617 -@@ -0,0 +1,68 @@
484.2618 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
484.2619 -+
484.2620 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
484.2621 -+//
484.2622 -+// This file is part of the GNU ISO C++ Library.  This library is free
484.2623 -+// software; you can redistribute it and/or modify it under the
484.2624 -+// terms of the GNU General Public License as published by the
484.2625 -+// Free Software Foundation; either version 2, or (at your option)
484.2626 -+// any later version.
484.2627 -+
484.2628 -+// This library is distributed in the hope that it will be useful,
484.2629 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
484.2630 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
484.2631 -+// GNU General Public License for more details.
484.2632 -+
484.2633 -+// You should have received a copy of the GNU General Public License along
484.2634 -+// with this library; see the file COPYING.  If not, write to the Free
484.2635 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
484.2636 -+// USA.
484.2637 -+
484.2638 -+// As a special exception, you may use this file as part of a free software
484.2639 -+// library without restriction.  Specifically, if other files instantiate
484.2640 -+// templates or use macros or inline functions from this file, or you compile
484.2641 -+// this file and link it with other files to produce an executable, this
484.2642 -+// file does not by itself cause the resulting executable to be covered by
484.2643 -+// the GNU General Public License.  This exception does not however
484.2644 -+// invalidate any other reasons why the executable file might be covered by
484.2645 -+// the GNU General Public License.
484.2646 -+
484.2647 -+//
484.2648 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
484.2649 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
484.2650 -+//
484.2651 -+
484.2652 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
484.2653 -+
484.2654 -+  template<typename _CharT>
484.2655 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
484.2656 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
484.2657 -+    _M_name_timepunct(_S_get_c_name())
484.2658 -+    { _M_initialize_timepunct(); }
484.2659 -+
484.2660 -+  template<typename _CharT>
484.2661 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
484.2662 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
484.2663 -+    _M_name_timepunct(_S_get_c_name())
484.2664 -+    { _M_initialize_timepunct(); }
484.2665 -+
484.2666 -+  template<typename _CharT>
484.2667 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
484.2668 -+				     size_t __refs) 
484.2669 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
484.2670 -+    _M_name_timepunct(__s)
484.2671 -+    { 
484.2672 -+      char* __tmp = new char[std::strlen(__s) + 1];
484.2673 -+      std::strcpy(__tmp, __s);
484.2674 -+      _M_name_timepunct = __tmp;
484.2675 -+      _M_initialize_timepunct(__cloc); 
484.2676 -+    }
484.2677 -+
484.2678 -+  template<typename _CharT>
484.2679 -+    __timepunct<_CharT>::~__timepunct()
484.2680 -+    { 
484.2681 -+      if (_M_name_timepunct != _S_get_c_name())
484.2682 -+	delete [] _M_name_timepunct;
484.2683 -+      delete _M_data; 
484.2684 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
484.2685 -+    }
484.2686 -diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
484.2687 ---- gcc-4.3.1.orig/libstdc++-v3/configure	2008-04-25 18:52:57.000000000 +0200
484.2688 -+++ gcc-4.3.1/libstdc++-v3/configure	2008-06-10 14:58:39.000000000 +0200
484.2689 -@@ -14001,7 +14001,7 @@
484.2690 -   enableval="$enable_clocale"
484.2691 - 
484.2692 -       case "$enableval" in
484.2693 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
484.2694 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
484.2695 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
484.2696 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
484.2697 -    { (exit 1); exit 1; }; } ;;
484.2698 -@@ -14034,6 +14034,9 @@
484.2699 -   # Default to "generic".
484.2700 -   if test $enable_clocale_flag = auto; then
484.2701 -     case ${target_os} in
484.2702 -+      linux-uclibc*)
484.2703 -+        enable_clocale_flag=uclibc
484.2704 -+	;;
484.2705 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
484.2706 -         enable_clocale_flag=gnu
484.2707 -         ;;
484.2708 -@@ -14422,6 +14425,76 @@
484.2709 -       CTIME_CC=config/locale/generic/time_members.cc
484.2710 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
484.2711 -       ;;
484.2712 -+    uclibc)
484.2713 -+      echo "$as_me:$LINENO: result: uclibc" >&5
484.2714 -+echo "${ECHO_T}uclibc" >&6
484.2715 -+
484.2716 -+      # Declare intention to use gettext, and add support for specific
484.2717 -+      # languages.
484.2718 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
484.2719 -+      ALL_LINGUAS="de fr"
484.2720 -+
484.2721 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
484.2722 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
484.2723 -+set dummy msgfmt; ac_word=$2
484.2724 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
484.2725 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
484.2726 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
484.2727 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
484.2728 -+else
484.2729 -+  if test -n "$check_msgfmt"; then
484.2730 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
484.2731 -+else
484.2732 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
484.2733 -+for as_dir in $PATH
484.2734 -+do
484.2735 -+  IFS=$as_save_IFS
484.2736 -+  test -z "$as_dir" && as_dir=.
484.2737 -+  for ac_exec_ext in '' $ac_executable_extensions; do
484.2738 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
484.2739 -+    ac_cv_prog_check_msgfmt="yes"
484.2740 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
484.2741 -+    break 2
484.2742 -+  fi
484.2743 -+done
484.2744 -+done
484.2745 -+
484.2746 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
484.2747 -+fi
484.2748 -+fi
484.2749 -+check_msgfmt=$ac_cv_prog_check_msgfmt
484.2750 -+if test -n "$check_msgfmt"; then
484.2751 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
484.2752 -+echo "${ECHO_T}$check_msgfmt" >&6
484.2753 -+else
484.2754 -+  echo "$as_me:$LINENO: result: no" >&5
484.2755 -+echo "${ECHO_T}no" >&6
484.2756 -+fi
484.2757 -+
484.2758 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
484.2759 -+        USE_NLS=yes
484.2760 -+      fi
484.2761 -+      # Export the build objects.
484.2762 -+      for ling in $ALL_LINGUAS; do \
484.2763 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
484.2764 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
484.2765 -+      done
484.2766 -+
484.2767 -+
484.2768 -+
484.2769 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
484.2770 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
484.2771 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
484.2772 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
484.2773 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
484.2774 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
484.2775 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
484.2776 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
484.2777 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
484.2778 -+      CTIME_H=config/locale/uclibc/time_members.h
484.2779 -+      CTIME_CC=config/locale/uclibc/time_members.cc
484.2780 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
484.2781 -+      ;;
484.2782 -   esac
484.2783 - 
484.2784 -   # This is where the testsuite looks for locale catalogs, using the
484.2785 -diff -durN gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h
484.2786 ---- gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2007-03-04 23:59:49.000000000 +0100
484.2787 -+++ gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h	2008-06-10 14:58:39.000000000 +0200
484.2788 -@@ -106,7 +106,9 @@
484.2789 - using std::wmemcpy;
484.2790 - using std::wmemmove;
484.2791 - using std::wmemset;
484.2792 -+#if _GLIBCXX_HAVE_WCSFTIME
484.2793 - using std::wcsftime;
484.2794 -+#endif
484.2795 - 
484.2796 - #if _GLIBCXX_USE_C99
484.2797 - using std::wcstold;
   485.1 --- a/patches/gcc/4.3.1/550-uclibc-locale-no__x.patch	Mon Jul 28 21:08:01 2008 +0000
   485.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   485.3 @@ -1,224 +0,0 @@
   485.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_203-uclibc-locale-no__x.patch
   485.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
   485.6 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:43.000000000 +0200
   485.7 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:43.000000000 +0200
   485.8 -@@ -60,4 +60,49 @@
   485.9 - extern "C" __typeof(wctype_l) __wctype_l;
  485.10 - #endif 
  485.11 - 
  485.12 -+# define __nl_langinfo_l nl_langinfo_l
  485.13 -+# define __strcoll_l strcoll_l
  485.14 -+# define __strftime_l strftime_l
  485.15 -+# define __strtod_l strtod_l
  485.16 -+# define __strtof_l strtof_l
  485.17 -+# define __strtold_l strtold_l
  485.18 -+# define __strxfrm_l strxfrm_l
  485.19 -+# define __newlocale newlocale
  485.20 -+# define __freelocale freelocale
  485.21 -+# define __duplocale duplocale
  485.22 -+# define __uselocale uselocale
  485.23 -+
  485.24 -+# ifdef _GLIBCXX_USE_WCHAR_T
  485.25 -+#  define __iswctype_l iswctype_l
  485.26 -+#  define __towlower_l towlower_l
  485.27 -+#  define __towupper_l towupper_l
  485.28 -+#  define __wcscoll_l wcscoll_l
  485.29 -+#  define __wcsftime_l wcsftime_l
  485.30 -+#  define __wcsxfrm_l wcsxfrm_l
  485.31 -+#  define __wctype_l wctype_l
  485.32 -+# endif
  485.33 -+
  485.34 -+#else
  485.35 -+# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  485.36 -+# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  485.37 -+# define __strtod_l(S, E, L)         strtod((S), (E))
  485.38 -+# define __strtof_l(S, E, L)         strtof((S), (E))
  485.39 -+# define __strtold_l(S, E, L)        strtold((S), (E))
  485.40 -+# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  485.41 -+# warning should dummy __newlocale check for C|POSIX ?
  485.42 -+# define __newlocale(a, b, c)        NULL
  485.43 -+# define __freelocale(a)             ((void)0)
  485.44 -+# define __duplocale(a)              __c_locale()
  485.45 -+//# define __uselocale ?
  485.46 -+//
  485.47 -+# ifdef _GLIBCXX_USE_WCHAR_T
  485.48 -+#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  485.49 -+#  define __towlower_l(C, L)          towlower((C))
  485.50 -+#  define __towupper_l(C, L)          towupper((C))
  485.51 -+#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  485.52 -+//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  485.53 -+#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  485.54 -+#  define __wctype_l(S, L)            wctype((S))
  485.55 -+# endif
  485.56 -+
  485.57 - #endif // GLIBC 2.3 and later
  485.58 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
  485.59 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:43.000000000 +0200
  485.60 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:43.000000000 +0200
  485.61 -@@ -39,20 +39,6 @@
  485.62 - #include <langinfo.h>
  485.63 - #include <bits/c++locale_internal.h>
  485.64 - 
  485.65 --#ifndef __UCLIBC_HAS_XLOCALE__
  485.66 --#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  485.67 --#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  485.68 --#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  485.69 --#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  485.70 --#define __strtof_l(S, E, L)         strtof((S), (E))
  485.71 --#define __strtod_l(S, E, L)         strtod((S), (E))
  485.72 --#define __strtold_l(S, E, L)        strtold((S), (E))
  485.73 --#warning should dummy __newlocale check for C|POSIX ?
  485.74 --#define __newlocale(a, b, c)        NULL
  485.75 --#define __freelocale(a)             ((void)0)
  485.76 --#define __duplocale(a)              __c_locale()
  485.77 --#endif
  485.78 --
  485.79 - namespace std 
  485.80 - {
  485.81 -   template<>
  485.82 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  485.83 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:43.000000000 +0200
  485.84 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:43.000000000 +0200
  485.85 -@@ -68,6 +68,7 @@
  485.86 - {
  485.87 -   extern "C" __typeof(uselocale) __uselocale;
  485.88 - }
  485.89 -+#define __uselocale uselocale
  485.90 - #endif
  485.91 - 
  485.92 - namespace std
  485.93 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
  485.94 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:43.000000000 +0200
  485.95 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:43.000000000 +0200
  485.96 -@@ -36,13 +36,6 @@
  485.97 - #include <locale>
  485.98 - #include <bits/c++locale_internal.h>
  485.99 - 
 485.100 --#ifndef __UCLIBC_HAS_XLOCALE__
 485.101 --#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 485.102 --#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 485.103 --#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 485.104 --#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 485.105 --#endif
 485.106 --
 485.107 - namespace std
 485.108 - {
 485.109 -   // These are basically extensions to char_traits, and perhaps should
 485.110 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 485.111 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:43.000000000 +0200
 485.112 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:43.000000000 +0200
 485.113 -@@ -38,13 +38,6 @@
 485.114 - #undef _LIBC
 485.115 - #include <bits/c++locale_internal.h>
 485.116 - 
 485.117 --#ifndef __UCLIBC_HAS_XLOCALE__
 485.118 --#define __wctype_l(S, L)           wctype((S))
 485.119 --#define __towupper_l(C, L)         towupper((C))
 485.120 --#define __towlower_l(C, L)         towlower((C))
 485.121 --#define __iswctype_l(C, M, L)      iswctype((C), (M))
 485.122 --#endif
 485.123 --
 485.124 - namespace std
 485.125 - {
 485.126 -   // NB: The other ctype<char> specializations are in src/locale.cc and
 485.127 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
 485.128 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:43.000000000 +0200
 485.129 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:43.000000000 +0200
 485.130 -@@ -39,13 +39,10 @@
 485.131 - #ifdef __UCLIBC_MJN3_ONLY__
 485.132 - #warning fix gettext stuff
 485.133 - #endif
 485.134 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 485.135 --extern "C" char *__dcgettext(const char *domainname,
 485.136 --			     const char *msgid, int category);
 485.137 - #undef gettext
 485.138 --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 485.139 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 485.140 -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 485.141 - #else
 485.142 --#undef gettext
 485.143 - #define gettext(msgid) (msgid)
 485.144 - #endif
 485.145 - 
 485.146 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 485.147 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:43.000000000 +0200
 485.148 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:43.000000000 +0200
 485.149 -@@ -36,15 +36,11 @@
 485.150 - #ifdef __UCLIBC_MJN3_ONLY__
 485.151 - #warning fix prototypes for *textdomain funcs
 485.152 - #endif
 485.153 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 485.154 --extern "C" char *__textdomain(const char *domainname);
 485.155 --extern "C" char *__bindtextdomain(const char *domainname,
 485.156 --				  const char *dirname);
 485.157 --#else
 485.158 --#undef __textdomain
 485.159 --#undef __bindtextdomain
 485.160 --#define __textdomain(D)           ((void)0)
 485.161 --#define __bindtextdomain(D,P)     ((void)0)
 485.162 -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 485.163 -+#undef textdomain
 485.164 -+#undef bindtextdomain
 485.165 -+#define textdomain(D)           ((void)0)
 485.166 -+#define bindtextdomain(D,P)     ((void)0)
 485.167 - #endif
 485.168 - 
 485.169 -   // Non-virtual member functions.
 485.170 -@@ -70,7 +66,7 @@
 485.171 -     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 485.172 - 			   const char* __dir) const
 485.173 -     { 
 485.174 --      __bindtextdomain(__s.c_str(), __dir);
 485.175 -+      bindtextdomain(__s.c_str(), __dir);
 485.176 -       return this->do_open(__s, __loc); 
 485.177 -     }
 485.178 - 
 485.179 -@@ -90,7 +86,7 @@
 485.180 -     { 
 485.181 -       // No error checking is done, assume the catalog exists and can
 485.182 -       // be used.
 485.183 --      __textdomain(__s.c_str());
 485.184 -+      textdomain(__s.c_str());
 485.185 -       return 0;
 485.186 -     }
 485.187 - 
 485.188 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 485.189 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:43.000000000 +0200
 485.190 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:43.000000000 +0200
 485.191 -@@ -43,10 +43,6 @@
 485.192 - #warning tailor for stub locale support
 485.193 - #endif
 485.194 - 
 485.195 --#ifndef __UCLIBC_HAS_XLOCALE__
 485.196 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 485.197 --#endif
 485.198 --
 485.199 - namespace std
 485.200 - {
 485.201 -   // Construct and return valid pattern consisting of some combination of:
 485.202 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 485.203 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:43.000000000 +0200
 485.204 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:43.000000000 +0200
 485.205 -@@ -41,9 +41,6 @@
 485.206 - #ifdef __UCLIBC_MJN3_ONLY__
 485.207 - #warning tailor for stub locale support
 485.208 - #endif
 485.209 --#ifndef __UCLIBC_HAS_XLOCALE__
 485.210 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 485.211 --#endif
 485.212 - 
 485.213 - namespace std
 485.214 - {
 485.215 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc
 485.216 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:43.000000000 +0200
 485.217 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:43.000000000 +0200
 485.218 -@@ -40,9 +40,6 @@
 485.219 - #ifdef __UCLIBC_MJN3_ONLY__
 485.220 - #warning tailor for stub locale support
 485.221 - #endif
 485.222 --#ifndef __UCLIBC_HAS_XLOCALE__
 485.223 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 485.224 --#endif
 485.225 - 
 485.226 - namespace std
 485.227 - {
   486.1 --- a/patches/gcc/4.3.1/575-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:08:01 2008 +0000
   486.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   486.3 @@ -1,51 +0,0 @@
   486.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
   486.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
   486.6 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:47.000000000 +0200
   486.7 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:47.000000000 +0200
   486.8 -@@ -401,7 +401,7 @@
   486.9 - # ifdef __UCLIBC_HAS_XLOCALE__
  486.10 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  486.11 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  486.12 --# else
  486.13 -+# elif defined __UCLIBC_HAS_LOCALE__
  486.14 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  486.15 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  486.16 - # endif
  486.17 -@@ -556,7 +556,7 @@
  486.18 - # ifdef __UCLIBC_HAS_XLOCALE__
  486.19 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  486.20 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  486.21 --# else
  486.22 -+# elif defined __UCLIBC_HAS_LOCALE__
  486.23 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  486.24 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  486.25 - # endif
  486.26 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  486.27 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:47.000000000 +0200
  486.28 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:47.000000000 +0200
  486.29 -@@ -127,12 +127,25 @@
  486.30 - 	{
  486.31 - 	  // Named locale.
  486.32 - 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  486.33 -+#ifdef __UCLIBC_MJN3_ONLY__
  486.34 -+#warning fix this... should be numeric
  486.35 -+#endif
  486.36 -+#ifdef __UCLIBC__
  486.37 -+# ifdef __UCLIBC_HAS_XLOCALE__
  486.38 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  486.39 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  486.40 -+# elif defined __UCLIBC_HAS_LOCALE__
  486.41 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  486.42 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  486.43 -+# endif
  486.44 -+#else
  486.45 - 	  union { char *__s; wchar_t __w; } __u;
  486.46 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  486.47 - 	  _M_data->_M_decimal_point = __u.__w;
  486.48 - 
  486.49 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  486.50 - 	  _M_data->_M_thousands_sep = __u.__w;
  486.51 -+#endif
  486.52 - 
  486.53 - 	  if (_M_data->_M_thousands_sep == L'\0')
  486.54 - 	    _M_data->_M_grouping = "";
   487.1 --- a/patches/gcc/4.3.1/600-uclibc-locale-update.patch	Mon Jul 28 21:08:01 2008 +0000
   487.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   487.3 @@ -1,355 +0,0 @@
   487.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_205-uclibc-locale-update.patch
   487.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
   487.6 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:47.000000000 +0200
   487.7 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:51.000000000 +0200
   487.8 -@@ -46,16 +46,13 @@
   487.9 -     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
  487.10 - 		   const __c_locale& __cloc)
  487.11 -     {
  487.12 --      if (!(__err & ios_base::failbit))
  487.13 --	{
  487.14 --	  char* __sanity;
  487.15 --	  errno = 0;
  487.16 --	  float __f = __strtof_l(__s, &__sanity, __cloc);
  487.17 --          if (__sanity != __s && errno != ERANGE)
  487.18 --	    __v = __f;
  487.19 --	  else
  487.20 --	    __err |= ios_base::failbit;
  487.21 --	}
  487.22 -+      char* __sanity;
  487.23 -+      errno = 0;
  487.24 -+      float __f = __strtof_l(__s, &__sanity, __cloc);
  487.25 -+      if (__sanity != __s && errno != ERANGE)
  487.26 -+	__v = __f;
  487.27 -+      else
  487.28 -+	__err |= ios_base::failbit;
  487.29 -     }
  487.30 - 
  487.31 -   template<>
  487.32 -@@ -63,16 +60,13 @@
  487.33 -     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  487.34 - 		   const __c_locale& __cloc)
  487.35 -     {
  487.36 --      if (!(__err & ios_base::failbit))
  487.37 --	{
  487.38 --	  char* __sanity;
  487.39 --	  errno = 0;
  487.40 --	  double __d = __strtod_l(__s, &__sanity, __cloc);
  487.41 --          if (__sanity != __s && errno != ERANGE)
  487.42 --	    __v = __d;
  487.43 --	  else
  487.44 --	    __err |= ios_base::failbit;
  487.45 --	}
  487.46 -+      char* __sanity;
  487.47 -+      errno = 0;
  487.48 -+      double __d = __strtod_l(__s, &__sanity, __cloc);
  487.49 -+      if (__sanity != __s && errno != ERANGE)
  487.50 -+	__v = __d;
  487.51 -+      else
  487.52 -+	__err |= ios_base::failbit;
  487.53 -     }
  487.54 - 
  487.55 -   template<>
  487.56 -@@ -80,16 +74,13 @@
  487.57 -     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  487.58 - 		   const __c_locale& __cloc)
  487.59 -     {
  487.60 --      if (!(__err & ios_base::failbit))
  487.61 --	{
  487.62 --	  char* __sanity;
  487.63 --	  errno = 0;
  487.64 --	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  487.65 --          if (__sanity != __s && errno != ERANGE)
  487.66 --	    __v = __ld;
  487.67 --	  else
  487.68 --	    __err |= ios_base::failbit;
  487.69 --	}
  487.70 -+      char* __sanity;
  487.71 -+      errno = 0;
  487.72 -+      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  487.73 -+      if (__sanity != __s && errno != ERANGE)
  487.74 -+	__v = __ld;
  487.75 -+      else
  487.76 -+	__err |= ios_base::failbit;
  487.77 -     }
  487.78 - 
  487.79 -   void
  487.80 -@@ -110,7 +101,7 @@
  487.81 -   void
  487.82 -   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  487.83 -   {
  487.84 --    if (_S_get_c_locale() != __cloc)
  487.85 -+    if (__cloc && _S_get_c_locale() != __cloc)
  487.86 -       __freelocale(__cloc); 
  487.87 -   }
  487.88 - 
  487.89 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  487.90 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:47.000000000 +0200
  487.91 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:51.000000000 +0200
  487.92 -@@ -39,21 +39,23 @@
  487.93 - #pragma GCC system_header
  487.94 - 
  487.95 - #include <cstring>              // get std::strlen
  487.96 --#include <cstdio>               // get std::snprintf or std::sprintf
  487.97 -+#include <cstdio>               // get std::vsnprintf or std::vsprintf
  487.98 - #include <clocale>
  487.99 - #include <langinfo.h>		// For codecvt
 487.100 - #ifdef __UCLIBC_MJN3_ONLY__
 487.101 - #warning fix this
 487.102 - #endif
 487.103 --#ifdef __UCLIBC_HAS_LOCALE__
 487.104 -+#ifdef _GLIBCXX_USE_ICONV
 487.105 - #include <iconv.h>		// For codecvt using iconv, iconv_t
 487.106 - #endif
 487.107 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 487.108 --#include <libintl.h> 		// For messages
 487.109 -+#ifdef HAVE_LIBINTL_H
 487.110 -+#include <libintl.h>		// For messages
 487.111 - #endif
 487.112 -+#include <cstdarg>
 487.113 - 
 487.114 - #ifdef __UCLIBC_MJN3_ONLY__
 487.115 - #warning what is _GLIBCXX_C_LOCALE_GNU for
 487.116 -+// psm: used in os/gnu-linux/ctype_noninline.h
 487.117 - #endif
 487.118 - #define _GLIBCXX_C_LOCALE_GNU 1
 487.119 - 
 487.120 -@@ -62,7 +64,7 @@
 487.121 - #endif
 487.122 - // #define _GLIBCXX_NUM_CATEGORIES 6
 487.123 - #define _GLIBCXX_NUM_CATEGORIES 0
 487.124 -- 
 487.125 -+
 487.126 - #ifdef __UCLIBC_HAS_XLOCALE__
 487.127 - namespace __gnu_cxx
 487.128 - {
 487.129 -@@ -79,22 +81,24 @@
 487.130 -   typedef int*			__c_locale;
 487.131 - #endif
 487.132 - 
 487.133 --  // Convert numeric value of type _Tv to string and return length of
 487.134 --  // string.  If snprintf is available use it, otherwise fall back to
 487.135 --  // the unsafe sprintf which, in general, can be dangerous and should
 487.136 -+  // Convert numeric value of type double to string and return length of
 487.137 -+  // string.  If vsnprintf is available use it, otherwise fall back to
 487.138 -+  // the unsafe vsprintf which, in general, can be dangerous and should
 487.139 -   // be avoided.
 487.140 --  template<typename _Tv>
 487.141 --    int
 487.142 --    __convert_from_v(char* __out, 
 487.143 --		     const int __size __attribute__ ((__unused__)),
 487.144 --		     const char* __fmt,
 487.145 --#ifdef __UCLIBC_HAS_XCLOCALE__
 487.146 --		     _Tv __v, const __c_locale& __cloc, int __prec)
 487.147 -+    inline int
 487.148 -+    __convert_from_v(const __c_locale&
 487.149 -+#ifndef __UCLIBC_HAS_XCLOCALE__
 487.150 -+					__cloc __attribute__ ((__unused__))
 487.151 -+#endif
 487.152 -+		     ,
 487.153 -+		     char* __out,
 487.154 -+		     const int __size,
 487.155 -+		     const char* __fmt, ...)
 487.156 -     {
 487.157 -+      va_list __args;
 487.158 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 487.159 -       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 487.160 - #else
 487.161 --		     _Tv __v, const __c_locale&, int __prec)
 487.162 --    {
 487.163 - # ifdef __UCLIBC_HAS_LOCALE__
 487.164 -       char* __old = std::setlocale(LC_ALL, NULL);
 487.165 -       char* __sav = new char[std::strlen(__old) + 1];
 487.166 -@@ -103,7 +107,9 @@
 487.167 - # endif
 487.168 - #endif
 487.169 - 
 487.170 --      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 487.171 -+      va_start(__args, __fmt);
 487.172 -+      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 487.173 -+      va_end(__args);
 487.174 - 
 487.175 - #ifdef __UCLIBC_HAS_XCLOCALE__
 487.176 -       __gnu_cxx::__uselocale(__old);
 487.177 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
 487.178 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:47.000000000 +0200
 487.179 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:51.000000000 +0200
 487.180 -@@ -33,9 +33,14 @@
 487.181 - 
 487.182 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 487.183 - 
 487.184 -+#include <features.h>
 487.185 -+#ifdef __UCLIBC_HAS_LOCALE__
 487.186 - #define _LIBC
 487.187 - #include <locale>
 487.188 - #undef _LIBC
 487.189 -+#else
 487.190 -+#include <locale>
 487.191 -+#endif
 487.192 - #include <bits/c++locale_internal.h>
 487.193 - 
 487.194 - namespace std
 487.195 -@@ -138,20 +143,34 @@
 487.196 -   ctype<wchar_t>::
 487.197 -   do_is(mask __m, wchar_t __c) const
 487.198 -   { 
 487.199 --    // Highest bitmask in ctype_base == 10, but extra in "C"
 487.200 --    // library for blank.
 487.201 -+    // The case of __m == ctype_base::space is particularly important,
 487.202 -+    // due to its use in many istream functions.  Therefore we deal with
 487.203 -+    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 487.204 -+    // is the mask corresponding to ctype_base::space.  NB: an encoding
 487.205 -+    // change would not affect correctness!
 487.206 -     bool __ret = false;
 487.207 --    const size_t __bitmasksize = 11; 
 487.208 --    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 487.209 --      if (__m & _M_bit[__bitcur]
 487.210 --	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 487.211 --	{
 487.212 --	  __ret = true;
 487.213 --	  break;
 487.214 --	}
 487.215 -+    if (__m == _M_bit[5])
 487.216 -+      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 487.217 -+    else
 487.218 -+      {
 487.219 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 487.220 -+	// library for blank.
 487.221 -+	const size_t __bitmasksize = 11;
 487.222 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 487.223 -+	  if (__m & _M_bit[__bitcur])
 487.224 -+	    {
 487.225 -+	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 487.226 -+		{
 487.227 -+		  __ret = true;
 487.228 -+		  break;
 487.229 -+		}
 487.230 -+	      else if (__m == _M_bit[__bitcur])
 487.231 -+		break;
 487.232 -+	    }
 487.233 -+      }
 487.234 -     return __ret;    
 487.235 -   }
 487.236 --  
 487.237 -+
 487.238 -   const wchar_t* 
 487.239 -   ctype<wchar_t>::
 487.240 -   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 487.241 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
 487.242 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:47.000000000 +0200
 487.243 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:51.000000000 +0200
 487.244 -@@ -47,18 +47,21 @@
 487.245 -   template<typename _CharT>
 487.246 -      messages<_CharT>::messages(size_t __refs)
 487.247 -      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 487.248 --     _M_name_messages(_S_get_c_name())
 487.249 -+       _M_name_messages(_S_get_c_name())
 487.250 -      { }
 487.251 - 
 487.252 -   template<typename _CharT>
 487.253 -      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 487.254 - 				size_t __refs) 
 487.255 --     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 487.256 --     _M_name_messages(__s)
 487.257 -+     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 487.258 -      {
 487.259 --       char* __tmp = new char[std::strlen(__s) + 1];
 487.260 --       std::strcpy(__tmp, __s);
 487.261 -+       const size_t __len = std::strlen(__s) + 1;
 487.262 -+       char* __tmp = new char[__len];
 487.263 -+       std::memcpy(__tmp, __s, __len);
 487.264 -        _M_name_messages = __tmp;
 487.265 -+
 487.266 -+       // Last to avoid leaking memory if new throws.
 487.267 -+       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 487.268 -      }
 487.269 - 
 487.270 -   template<typename _CharT>
 487.271 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
 487.272 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:51.000000000 +0200
 487.273 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:51.000000000 +0200
 487.274 -@@ -33,9 +33,14 @@
 487.275 - 
 487.276 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 487.277 - 
 487.278 -+#include <features.h>
 487.279 -+#ifdef __UCLIBC_HAS_LOCALE__
 487.280 - #define _LIBC
 487.281 - #include <locale>
 487.282 - #undef _LIBC
 487.283 -+#else
 487.284 -+#include <locale>
 487.285 -+#endif
 487.286 - #include <bits/c++locale_internal.h>
 487.287 - 
 487.288 - #ifdef __UCLIBC_MJN3_ONLY__
 487.289 -@@ -206,7 +211,7 @@
 487.290 - 	  }
 487.291 - 	break;
 487.292 -       default:
 487.293 --	;
 487.294 -+	__ret = pattern();
 487.295 -       }
 487.296 -     return __ret;
 487.297 -   }
 487.298 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
 487.299 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:51.000000000 +0200
 487.300 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:51.000000000 +0200
 487.301 -@@ -33,9 +33,14 @@
 487.302 - 
 487.303 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 487.304 - 
 487.305 -+#include <features.h>
 487.306 -+#ifdef __UCLIBC_HAS_LOCALE__
 487.307 - #define _LIBC
 487.308 - #include <locale>
 487.309 - #undef _LIBC
 487.310 -+#else
 487.311 -+#include <locale>
 487.312 -+#endif
 487.313 - #include <bits/c++locale_internal.h>
 487.314 - 
 487.315 - #ifdef __UCLIBC_MJN3_ONLY__
 487.316 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
 487.317 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:43.000000000 +0200
 487.318 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:51.000000000 +0200
 487.319 -@@ -37,25 +37,33 @@
 487.320 -   template<typename _CharT>
 487.321 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
 487.322 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 487.323 --    _M_name_timepunct(_S_get_c_name())
 487.324 -+      _M_name_timepunct(_S_get_c_name())
 487.325 -     { _M_initialize_timepunct(); }
 487.326 - 
 487.327 -   template<typename _CharT>
 487.328 -     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 487.329 -     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 487.330 --    _M_name_timepunct(_S_get_c_name())
 487.331 -+      _M_name_timepunct(_S_get_c_name())
 487.332 -     { _M_initialize_timepunct(); }
 487.333 - 
 487.334 -   template<typename _CharT>
 487.335 -     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 487.336 - 				     size_t __refs) 
 487.337 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 487.338 --    _M_name_timepunct(__s)
 487.339 -+      _M_name_timepunct(NULL)
 487.340 -     { 
 487.341 --      char* __tmp = new char[std::strlen(__s) + 1];
 487.342 --      std::strcpy(__tmp, __s);
 487.343 -+      const size_t __len = std::strlen(__s) + 1;
 487.344 -+      char* __tmp = new char[__len];
 487.345 -+      std::memcpy(__tmp, __s, __len);
 487.346 -       _M_name_timepunct = __tmp;
 487.347 --      _M_initialize_timepunct(__cloc); 
 487.348 -+
 487.349 -+      try
 487.350 -+	{ _M_initialize_timepunct(__cloc); }
 487.351 -+      catch(...)
 487.352 -+	{
 487.353 -+	  delete [] _M_name_timepunct;
 487.354 -+	  __throw_exception_again;
 487.355 -+	}
 487.356 -     }
 487.357 - 
 487.358 -   template<typename _CharT>
   488.1 --- a/patches/gcc/4.3.1/625-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   488.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   488.3 @@ -1,13 +0,0 @@
   488.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_301-missing-execinfo_h.patch
   488.5 -diff -durN gcc-4.3.1.orig/boehm-gc/include/gc.h gcc-4.3.1/boehm-gc/include/gc.h
   488.6 ---- gcc-4.3.1.orig/boehm-gc/include/gc.h	2007-04-23 23:10:09.000000000 +0200
   488.7 -+++ gcc-4.3.1/boehm-gc/include/gc.h	2008-06-10 14:58:54.000000000 +0200
   488.8 -@@ -503,7 +503,7 @@
   488.9 - #if defined(__linux__) || defined(__GLIBC__)
  488.10 - # include <features.h>
  488.11 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  488.12 --     && !defined(__ia64__)
  488.13 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  488.14 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  488.15 - #     define GC_HAVE_BUILTIN_BACKTRACE
  488.16 - #   endif
   489.1 --- a/patches/gcc/4.3.1/650-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   489.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   489.3 @@ -1,14 +0,0 @@
   489.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_303-c99-complex-ugly-hack.patch
   489.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
   489.6 ---- gcc-4.3.1.orig/libstdc++-v3/configure	2008-06-10 14:58:43.000000000 +0200
   489.7 -+++ gcc-4.3.1/libstdc++-v3/configure	2008-06-10 14:58:58.000000000 +0200
   489.8 -@@ -39006,6 +39006,9 @@
   489.9 - cat >>conftest.$ac_ext <<_ACEOF
  489.10 - /* end confdefs.h.  */
  489.11 - #include <complex.h>
  489.12 -+#ifdef __UCLIBC__
  489.13 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  489.14 -+#endif
  489.15 - int
  489.16 - main ()
  489.17 - {
   490.1 --- a/patches/gcc/4.3.1/675-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   490.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   490.3 @@ -1,27 +0,0 @@
   490.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch
   490.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/rope gcc-4.3.1/libstdc++-v3/include/ext/rope
   490.6 ---- gcc-4.3.1.orig/libstdc++-v3/include/ext/rope	2008-01-31 19:44:55.000000000 +0100
   490.7 -+++ gcc-4.3.1/libstdc++-v3/include/ext/rope	2008-06-10 14:59:02.000000000 +0200
   490.8 -@@ -59,6 +59,9 @@
   490.9 - #include <bits/gthr.h>
  490.10 - #include <tr1/functional>
  490.11 - 
  490.12 -+/* cope w/ index defined as macro, SuSv3 proposal */
  490.13 -+#undef index
  490.14 -+
  490.15 - # ifdef __GC
  490.16 - #   define __GC_CONST const
  490.17 - # else
  490.18 -diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h
  490.19 ---- gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2007-05-04 17:06:46.000000000 +0200
  490.20 -+++ gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h	2008-06-10 14:59:02.000000000 +0200
  490.21 -@@ -54,6 +54,9 @@
  490.22 - #include <ext/memory> // For uninitialized_copy_n
  490.23 - #include <ext/numeric> // For power
  490.24 - 
  490.25 -+/* cope w/ index defined as macro, SuSv3 proposal */
  490.26 -+#undef index
  490.27 -+
  490.28 - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  490.29 - 
  490.30 -   using std::size_t;
   491.1 --- a/patches/gcc/4.3.1/700-libmudflap-susv3-legacy.patch	Mon Jul 28 21:08:01 2008 +0000
   491.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   491.3 @@ -1,49 +0,0 @@
   491.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch
   491.5 -diff -durN gcc-4.3.1.orig/libmudflap/mf-hooks2.c gcc-4.3.1/libmudflap/mf-hooks2.c
   491.6 ---- gcc-4.3.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   491.7 -+++ gcc-4.3.1/libmudflap/mf-hooks2.c	2008-06-10 14:59:05.000000000 +0200
   491.8 -@@ -427,7 +427,7 @@
   491.9 - {
  491.10 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  491.11 -   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  491.12 --  bzero (s, n);
  491.13 -+  memset (s, 0, n);
  491.14 - }
  491.15 - 
  491.16 - 
  491.17 -@@ -437,7 +437,7 @@
  491.18 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  491.19 -   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  491.20 -   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  491.21 --  bcopy (src, dest, n);
  491.22 -+  memmove (dest, src, n);
  491.23 - }
  491.24 - 
  491.25 - 
  491.26 -@@ -447,7 +447,7 @@
  491.27 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  491.28 -   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  491.29 -   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  491.30 --  return bcmp (s1, s2, n);
  491.31 -+  return memcmp (s1, s2, n);
  491.32 - }
  491.33 - 
  491.34 - 
  491.35 -@@ -456,7 +456,7 @@
  491.36 -   size_t n = strlen (s);
  491.37 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  491.38 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  491.39 --  return index (s, c);
  491.40 -+  return strchr (s, c);
  491.41 - }
  491.42 - 
  491.43 - 
  491.44 -@@ -465,7 +465,7 @@
  491.45 -   size_t n = strlen (s);
  491.46 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  491.47 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  491.48 --  return rindex (s, c);
  491.49 -+  return strrchr (s, c);
  491.50 - }
  491.51 - 
  491.52 - /* XXX:  stpcpy, memccpy */
   492.1 --- a/patches/gcc/4.3.1/725-libstdc++-namespace.patch	Mon Jul 28 21:08:01 2008 +0000
   492.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   492.3 @@ -1,38 +0,0 @@
   492.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_306-libstdc++-namespace.patch
   492.5 -diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
   492.6 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
   492.7 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:54.000000000 +0200
   492.8 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:59:09.000000000 +0200
   492.9 -@@ -32,7 +32,8 @@
  492.10 - //
  492.11 - 
  492.12 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  492.13 --
  492.14 -+namespace std
  492.15 -+{
  492.16 - #ifdef __UCLIBC_MJN3_ONLY__
  492.17 - #warning fix prototypes for *textdomain funcs
  492.18 - #endif
  492.19 -@@ -115,3 +116,4 @@
  492.20 - 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  492.21 - 	 }
  492.22 -      }
  492.23 -+}
  492.24 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
  492.25 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:54.000000000 +0200
  492.26 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:59:09.000000000 +0200
  492.27 -@@ -33,7 +33,8 @@
  492.28 - //
  492.29 - 
  492.30 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  492.31 --
  492.32 -+namespace std
  492.33 -+{
  492.34 -   template<typename _CharT>
  492.35 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
  492.36 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  492.37 -@@ -74,3 +75,4 @@
  492.38 -       delete _M_data; 
  492.39 -       _S_destroy_c_locale(_M_c_locale_timepunct); 
  492.40 -     }
  492.41 -+}
   493.1 --- a/patches/gcc/4.3.1/750-arm-softfloat.patch	Mon Jul 28 21:08:01 2008 +0000
   493.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   493.3 @@ -1,29 +0,0 @@
   493.4 -diff -durN gcc-4.3.1.orig/gcc/config/arm/linux-elf.h gcc-4.3.1/gcc/config/arm/linux-elf.h
   493.5 ---- gcc-4.3.1.orig/gcc/config/arm/linux-elf.h	2007-11-08 14:44:09.000000000 +0100
   493.6 -+++ gcc-4.3.1/gcc/config/arm/linux-elf.h	2008-07-23 15:30:57.000000000 +0200
   493.7 -@@ -60,7 +60,7 @@
   493.8 -    %{shared:-lc} \
   493.9 -    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
  493.10 - 
  493.11 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
  493.12 -+#define LIBGCC_SPEC "-lgcc"
  493.13 - 
  493.14 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
  493.15 - 
  493.16 -diff -durN gcc-4.3.1.orig/gcc/config/arm/t-linux gcc-4.3.1/gcc/config/arm/t-linux
  493.17 ---- gcc-4.3.1.orig/gcc/config/arm/t-linux	2006-11-09 23:14:27.000000000 +0100
  493.18 -+++ gcc-4.3.1/gcc/config/arm/t-linux	2008-07-23 19:15:25.000000000 +0200
  493.19 -@@ -3,7 +3,12 @@
  493.20 - TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
  493.21 - 
  493.22 - LIB1ASMSRC = arm/lib1funcs.asm
  493.23 --LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
  493.24 -+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
  493.25 -+	_call_via_rX _interwork_call_via_rX \
  493.26 -+	_lshrdi3 _ashrdi3 _ashldi3 \
  493.27 -+	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
  493.28 -+	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
  493.29 -+	_fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf
  493.30 - 
  493.31 - # MULTILIB_OPTIONS = mhard-float/msoft-float
  493.32 - # MULTILIB_DIRNAMES = hard-float soft-float
   494.1 --- a/patches/gcc/4.3.1/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
   494.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   494.3 @@ -1,17 +0,0 @@
   494.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   494.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   494.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   494.7 - /* Do code reading to identify a signal frame, and set the frame
   494.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
   494.9 - 
  494.10 -+/* Don't use this if inhibit_libc is set
  494.11 -+   The build for this target will fail trying to include missing headers */
  494.12 -+#ifndef inhibit_libc
  494.13 - #include <signal.h>
  494.14 - #include <sys/ucontext.h>
  494.15 - 
  494.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  494.17 -   fs->retaddr_column = 64;
  494.18 -   return _URC_NO_REASON;
  494.19 - }
  494.20 -+#endif /* inhibit_libc */
   495.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   495.2 +++ b/patches/gdb/6.4/110-uclibc-readline-conf.patch	Mon Jul 28 21:32:33 2008 +0000
   495.3 @@ -0,0 +1,15 @@
   495.4 +--- gdb-6.1.1-dist/readline/configure	2003-05-27 18:29:47.000000000 -0500
   495.5 ++++ gdb-6.1.1/readline/configure	2004-08-09 14:20:23.000000000 -0500
   495.6 +@@ -6249,7 +6249,12 @@
   495.7 + 
   495.8 + 
   495.9 + echo "$as_me:$LINENO: checking for mbstate_t" >&5
  495.10 ++echo $ECHO_N "bash_cv_have_mbstate_t=$bash_cv_have_mbstate_t" >&6
  495.11 + echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
  495.12 ++if test "${bash_cv_have_mbstate_t+set}" != set; then
  495.13 ++  bash_cv_have_mbstate_t=yes
  495.14 ++  echo $ECHO_N "WARNING!! forcing to yes!!! $ECHO_C" >&6
  495.15 ++fi
  495.16 + if test "${bash_cv_have_mbstate_t+set}" = set; then
  495.17 +   echo $ECHO_N "(cached) $ECHO_C" >&6
  495.18 + else
   496.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   496.2 +++ b/patches/gdb/6.4/120-thread-timeout.patch	Mon Jul 28 21:32:33 2008 +0000
   496.3 @@ -0,0 +1,34 @@
   496.4 +--- gdb-6.3.org/gdb/gdbserver/thread-db.c	2004-10-17 02:42:00.000000000 +0900
   496.5 ++++ gdb-6.3/gdb/gdbserver/thread-db.c	2005-01-27 12:19:29.000000000 +0900
   496.6 +@@ -21,6 +21,7 @@
   496.7 +    Foundation, Inc., 59 Temple Place - Suite 330,
   496.8 +    Boston, MA 02111-1307, USA.  */
   496.9 + 
  496.10 ++#include <unistd.h>
  496.11 + #include "server.h"
  496.12 + 
  496.13 + #include "linux-low.h"
  496.14 +@@ -142,6 +143,7 @@
  496.15 +   td_event_msg_t msg;
  496.16 +   td_err_e err;
  496.17 +   struct inferior_linux_data *tdata;
  496.18 ++  int timeout;
  496.19 + 
  496.20 +   if (debug_threads)
  496.21 +     fprintf (stderr, "Thread creation event.\n");
  496.22 +@@ -152,7 +154,13 @@
  496.23 +      In the LinuxThreads implementation, this is safe,
  496.24 +      because all events come from the manager thread
  496.25 +      (except for its own creation, of course).  */
  496.26 +-  err = td_ta_event_getmsg (thread_agent, &msg);
  496.27 ++  for (timeout = 0; timeout < 50000; timeout++)
  496.28 ++    {
  496.29 ++      err = td_ta_event_getmsg (thread_agent, &msg);
  496.30 ++      if (err != TD_NOMSG)
  496.31 ++	break;
  496.32 ++      usleep(1000);
  496.33 ++    }
  496.34 +   if (err != TD_OK)
  496.35 +     fprintf (stderr, "thread getmsg err: %s\n",
  496.36 + 	     thread_db_err_str (err));
  496.37 +
   497.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   497.2 +++ b/patches/gdb/6.4/130-fix-compile-flag-mismatch.patch	Mon Jul 28 21:32:33 2008 +0000
   497.3 @@ -0,0 +1,87 @@
   497.4 +diff -ur gdb-6.4/gdb/configure gdb-6.4-patched/gdb/configure
   497.5 +--- gdb-6.4/gdb/configure	2005-07-25 10:08:40.000000000 -0500
   497.6 ++++ gdb-6.4-patched/gdb/configure	2007-02-05 13:22:36.000000000 -0600
   497.7 +@@ -309,7 +309,7 @@
   497.8 + # include <unistd.h>
   497.9 + #endif"
  497.10 + 
  497.11 +-ac_subdirs_all="$ac_subdirs_all doc testsuite"
  497.12 ++ac_subdirs_all="$ac_subdirs_all doc"
  497.13 + ac_subdirs_all="$ac_subdirs_all gdbtk"
  497.14 + ac_subdirs_all="$ac_subdirs_all multi-ice"
  497.15 + ac_subdirs_all="$ac_subdirs_all gdbserver"
  497.16 +@@ -5940,7 +5940,7 @@
  497.17 + 
  497.18 + 
  497.19 + 
  497.20 +-subdirs="$subdirs doc testsuite"
  497.21 ++subdirs="$subdirs doc"
  497.22 + 
  497.23 + 
  497.24 + . $srcdir/configure.host
  497.25 +diff -ur gdb-6.4/gdb/gdbserver/configure gdb-6.4-patched/gdb/gdbserver/configure
  497.26 +--- gdb-6.4/gdb/gdbserver/configure	2005-09-17 18:14:37.000000000 -0500
  497.27 ++++ gdb-6.4-patched/gdb/gdbserver/configure	2007-02-05 13:22:58.000000000 -0600
  497.28 +@@ -1239,7 +1239,7 @@
  497.29 +       ac_cache_corrupted=: ;;
  497.30 +     ,);;
  497.31 +     *)
  497.32 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
  497.33 ++      if test "`echo $ac_old_val`" != "`echo $ac_new_val`"; then
  497.34 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  497.35 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  497.36 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  497.37 +diff -ur gdb-6.4/gdb/testsuite/configure gdb-6.4-patched/gdb/testsuite/configure
  497.38 +--- gdb-6.4/gdb/testsuite/configure	2005-04-11 09:13:12.000000000 -0500
  497.39 ++++ gdb-6.4-patched/gdb/testsuite/configure	2007-02-05 13:22:36.000000000 -0600
  497.40 +@@ -1248,7 +1248,7 @@
  497.41 +       ac_cache_corrupted=: ;;
  497.42 +     ,);;
  497.43 +     *)
  497.44 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
  497.45 ++      if test "`echo $ac_old_val" != "`echo $ac_new_val"; then
  497.46 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  497.47 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  497.48 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  497.49 +diff -ur gdb-6.4/Makefile.in gdb-6.4-patched/Makefile.in
  497.50 +--- gdb-6.4/Makefile.in	2005-12-01 23:29:54.000000000 -0600
  497.51 ++++ gdb-6.4-patched/Makefile.in	2007-02-05 13:22:36.000000000 -0600
  497.52 +@@ -383,7 +383,7 @@
  497.53 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
  497.54 + # (which we know are built with gcc) are built with optimizations so
  497.55 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
  497.56 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  497.57 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  497.58 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  497.59 + 
  497.60 + # If GCC_FOR_TARGET is not overriden on the command line, then this
  497.61 +@@ -423,7 +423,7 @@
  497.62 +     fi; \
  497.63 +   fi`
  497.64 + 
  497.65 +-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  497.66 ++CXXFLAGS_FOR_TARGET = $(strip $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  497.67 + LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
  497.68 + 
  497.69 + GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
  497.70 +diff -ur gdb-6.4/Makefile.tpl gdb-6.4-patched/Makefile.tpl
  497.71 +--- gdb-6.4/Makefile.tpl	2005-10-22 05:37:55.000000000 -0500
  497.72 ++++ gdb-6.4-patched/Makefile.tpl	2007-02-05 13:22:36.000000000 -0600
  497.73 +@@ -386,7 +386,7 @@
  497.74 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
  497.75 + # (which we know are built with gcc) are built with optimizations so
  497.76 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
  497.77 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  497.78 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  497.79 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  497.80 + 
  497.81 + # If GCC_FOR_TARGET is not overriden on the command line, then this
  497.82 +@@ -426,7 +426,7 @@
  497.83 +     fi; \
  497.84 +   fi`
  497.85 + 
  497.86 +-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  497.87 ++CXXFLAGS_FOR_TARGET = $(strip $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  497.88 + LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
  497.89 + 
  497.90 + GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
   498.1 --- a/patches/gdb/6.4/200-uclibc-readline-conf.patch	Mon Jul 28 21:08:01 2008 +0000
   498.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   498.3 @@ -1,15 +0,0 @@
   498.4 ---- gdb-6.1.1-dist/readline/configure	2003-05-27 18:29:47.000000000 -0500
   498.5 -+++ gdb-6.1.1/readline/configure	2004-08-09 14:20:23.000000000 -0500
   498.6 -@@ -6249,7 +6249,12 @@
   498.7 - 
   498.8 - 
   498.9 - echo "$as_me:$LINENO: checking for mbstate_t" >&5
  498.10 -+echo $ECHO_N "bash_cv_have_mbstate_t=$bash_cv_have_mbstate_t" >&6
  498.11 - echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
  498.12 -+if test "${bash_cv_have_mbstate_t+set}" != set; then
  498.13 -+  bash_cv_have_mbstate_t=yes
  498.14 -+  echo $ECHO_N "WARNING!! forcing to yes!!! $ECHO_C" >&6
  498.15 -+fi
  498.16 - if test "${bash_cv_have_mbstate_t+set}" = set; then
  498.17 -   echo $ECHO_N "(cached) $ECHO_C" >&6
  498.18 - else
   499.1 --- a/patches/gdb/6.4/500-thread-timeout.patch	Mon Jul 28 21:08:01 2008 +0000
   499.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   499.3 @@ -1,34 +0,0 @@
   499.4 ---- gdb-6.3.org/gdb/gdbserver/thread-db.c	2004-10-17 02:42:00.000000000 +0900
   499.5 -+++ gdb-6.3/gdb/gdbserver/thread-db.c	2005-01-27 12:19:29.000000000 +0900
   499.6 -@@ -21,6 +21,7 @@
   499.7 -    Foundation, Inc., 59 Temple Place - Suite 330,
   499.8 -    Boston, MA 02111-1307, USA.  */
   499.9 - 
  499.10 -+#include <unistd.h>
  499.11 - #include "server.h"
  499.12 - 
  499.13 - #include "linux-low.h"
  499.14 -@@ -142,6 +143,7 @@
  499.15 -   td_event_msg_t msg;
  499.16 -   td_err_e err;
  499.17 -   struct inferior_linux_data *tdata;
  499.18 -+  int timeout;
  499.19 - 
  499.20 -   if (debug_threads)
  499.21 -     fprintf (stderr, "Thread creation event.\n");
  499.22 -@@ -152,7 +154,13 @@
  499.23 -      In the LinuxThreads implementation, this is safe,
  499.24 -      because all events come from the manager thread
  499.25 -      (except for its own creation, of course).  */
  499.26 --  err = td_ta_event_getmsg (thread_agent, &msg);
  499.27 -+  for (timeout = 0; timeout < 50000; timeout++)
  499.28 -+    {
  499.29 -+      err = td_ta_event_getmsg (thread_agent, &msg);
  499.30 -+      if (err != TD_NOMSG)
  499.31 -+	break;
  499.32 -+      usleep(1000);
  499.33 -+    }
  499.34 -   if (err != TD_OK)
  499.35 -     fprintf (stderr, "thread getmsg err: %s\n",
  499.36 - 	     thread_db_err_str (err));
  499.37 -
   500.1 --- a/patches/gdb/6.4/600-fix-compile-flag-mismatch.patch	Mon Jul 28 21:08:01 2008 +0000
   500.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   500.3 @@ -1,87 +0,0 @@
   500.4 -diff -ur gdb-6.4/gdb/configure gdb-6.4-patched/gdb/configure
   500.5 ---- gdb-6.4/gdb/configure	2005-07-25 10:08:40.000000000 -0500
   500.6 -+++ gdb-6.4-patched/gdb/configure	2007-02-05 13:22:36.000000000 -0600
   500.7 -@@ -309,7 +309,7 @@
   500.8 - # include <unistd.h>
   500.9 - #endif"
  500.10 - 
  500.11 --ac_subdirs_all="$ac_subdirs_all doc testsuite"
  500.12 -+ac_subdirs_all="$ac_subdirs_all doc"
  500.13 - ac_subdirs_all="$ac_subdirs_all gdbtk"
  500.14 - ac_subdirs_all="$ac_subdirs_all multi-ice"
  500.15 - ac_subdirs_all="$ac_subdirs_all gdbserver"
  500.16 -@@ -5940,7 +5940,7 @@
  500.17 - 
  500.18 - 
  500.19 - 
  500.20 --subdirs="$subdirs doc testsuite"
  500.21 -+subdirs="$subdirs doc"
  500.22 - 
  500.23 - 
  500.24 - . $srcdir/configure.host
  500.25 -diff -ur gdb-6.4/gdb/gdbserver/configure gdb-6.4-patched/gdb/gdbserver/configure
  500.26 ---- gdb-6.4/gdb/gdbserver/configure	2005-09-17 18:14:37.000000000 -0500
  500.27 -+++ gdb-6.4-patched/gdb/gdbserver/configure	2007-02-05 13:22:58.000000000 -0600
  500.28 -@@ -1239,7 +1239,7 @@
  500.29 -       ac_cache_corrupted=: ;;
  500.30 -     ,);;
  500.31 -     *)
  500.32 --      if test "x$ac_old_val" != "x$ac_new_val"; then
  500.33 -+      if test "`echo $ac_old_val`" != "`echo $ac_new_val`"; then
  500.34 - 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  500.35 - echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  500.36 - 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  500.37 -diff -ur gdb-6.4/gdb/testsuite/configure gdb-6.4-patched/gdb/testsuite/configure
  500.38 ---- gdb-6.4/gdb/testsuite/configure	2005-04-11 09:13:12.000000000 -0500
  500.39 -+++ gdb-6.4-patched/gdb/testsuite/configure	2007-02-05 13:22:36.000000000 -0600
  500.40 -@@ -1248,7 +1248,7 @@
  500.41 -       ac_cache_corrupted=: ;;
  500.42 -     ,);;
  500.43 -     *)
  500.44 --      if test "x$ac_old_val" != "x$ac_new_val"; then
  500.45 -+      if test "`echo $ac_old_val" != "`echo $ac_new_val"; then
  500.46 - 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  500.47 - echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  500.48 - 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  500.49 -diff -ur gdb-6.4/Makefile.in gdb-6.4-patched/Makefile.in
  500.50 ---- gdb-6.4/Makefile.in	2005-12-01 23:29:54.000000000 -0600
  500.51 -+++ gdb-6.4-patched/Makefile.in	2007-02-05 13:22:36.000000000 -0600
  500.52 -@@ -383,7 +383,7 @@
  500.53 - # CFLAGS will be just -g.  We want to ensure that TARGET libraries
  500.54 - # (which we know are built with gcc) are built with optimizations so
  500.55 - # prepend -O2 when setting CFLAGS_FOR_TARGET.
  500.56 --CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  500.57 -+CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  500.58 - SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  500.59 - 
  500.60 - # If GCC_FOR_TARGET is not overriden on the command line, then this
  500.61 -@@ -423,7 +423,7 @@
  500.62 -     fi; \
  500.63 -   fi`
  500.64 - 
  500.65 --CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  500.66 -+CXXFLAGS_FOR_TARGET = $(strip $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  500.67 - LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
  500.68 - 
  500.69 - GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
  500.70 -diff -ur gdb-6.4/Makefile.tpl gdb-6.4-patched/Makefile.tpl
  500.71 ---- gdb-6.4/Makefile.tpl	2005-10-22 05:37:55.000000000 -0500
  500.72 -+++ gdb-6.4-patched/Makefile.tpl	2007-02-05 13:22:36.000000000 -0600
  500.73 -@@ -386,7 +386,7 @@
  500.74 - # CFLAGS will be just -g.  We want to ensure that TARGET libraries
  500.75 - # (which we know are built with gcc) are built with optimizations so
  500.76 - # prepend -O2 when setting CFLAGS_FOR_TARGET.
  500.77 --CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  500.78 -+CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  500.79 - SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  500.80 - 
  500.81 - # If GCC_FOR_TARGET is not overriden on the command line, then this
  500.82 -@@ -426,7 +426,7 @@
  500.83 -     fi; \
  500.84 -   fi`
  500.85 - 
  500.86 --CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  500.87 -+CXXFLAGS_FOR_TARGET = $(strip $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  500.88 - LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
  500.89 - 
  500.90 - GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
   501.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   501.2 +++ b/patches/gdb/6.5/110-uclibc-readline-conf.patch	Mon Jul 28 21:32:33 2008 +0000
   501.3 @@ -0,0 +1,15 @@
   501.4 +--- gdb-6.1.1-dist/readline/configure	2003-05-27 18:29:47.000000000 -0500
   501.5 ++++ gdb-6.1.1/readline/configure	2004-08-09 14:20:23.000000000 -0500
   501.6 +@@ -6249,7 +6249,12 @@
   501.7 + 
   501.8 + 
   501.9 + echo "$as_me:$LINENO: checking for mbstate_t" >&5
  501.10 ++echo $ECHO_N "bash_cv_have_mbstate_t=$bash_cv_have_mbstate_t" >&6
  501.11 + echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
  501.12 ++if test "${bash_cv_have_mbstate_t+set}" != set; then
  501.13 ++  bash_cv_have_mbstate_t=yes
  501.14 ++  echo $ECHO_N "WARNING!! forcing to yes!!! $ECHO_C" >&6
  501.15 ++fi
  501.16 + if test "${bash_cv_have_mbstate_t+set}" = set; then
  501.17 +   echo $ECHO_N "(cached) $ECHO_C" >&6
  501.18 + else
   502.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   502.2 +++ b/patches/gdb/6.5/120-thread-timeout.patch	Mon Jul 28 21:32:33 2008 +0000
   502.3 @@ -0,0 +1,33 @@
   502.4 +--- gdb-6.5/./gdb/gdbserver/thread-db.c.orig	2006-03-15 08:13:29.000000000 -0800
   502.5 ++++ gdb-6.5/./gdb/gdbserver/thread-db.c	2008-04-01 21:21:23.000000000 -0700
   502.6 +@@ -21,6 +21,7 @@
   502.7 +    Foundation, Inc., 51 Franklin Street, Fifth Floor,
   502.8 +    Boston, MA 02110-1301, USA.  */
   502.9 + 
  502.10 ++#include <unistd.h>
  502.11 + #include "server.h"
  502.12 + 
  502.13 + #include "linux-low.h"
  502.14 +@@ -134,6 +135,7 @@ thread_db_create_event (CORE_ADDR where)
  502.15 +   td_event_msg_t msg;
  502.16 +   td_err_e err;
  502.17 +   struct inferior_linux_data *tdata;
  502.18 ++  int timeout;
  502.19 + 
  502.20 +   if (debug_threads)
  502.21 +     fprintf (stderr, "Thread creation event.\n");
  502.22 +@@ -144,7 +146,13 @@ thread_db_create_event (CORE_ADDR where)
  502.23 +      In the LinuxThreads implementation, this is safe,
  502.24 +      because all events come from the manager thread
  502.25 +      (except for its own creation, of course).  */
  502.26 +-  err = td_ta_event_getmsg (thread_agent, &msg);
  502.27 ++  for (timeout = 0; timeout < 50000; timeout++)
  502.28 ++    {
  502.29 ++      err = td_ta_event_getmsg (thread_agent, &msg);
  502.30 ++      if (err != TD_NOMSG)
  502.31 ++	break;
  502.32 ++      usleep(1000);
  502.33 ++    }
  502.34 +   if (err != TD_OK)
  502.35 +     fprintf (stderr, "thread getmsg err: %s\n",
  502.36 + 	     thread_db_err_str (err));
   503.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   503.2 +++ b/patches/gdb/6.5/130-fix-compile-flag-mismatch.patch	Mon Jul 28 21:32:33 2008 +0000
   503.3 @@ -0,0 +1,69 @@
   503.4 +diff -ur gdb-6.4/gdb/configure gdb-6.4-patched/gdb/configure
   503.5 +--- gdb-6.4/gdb/configure	2005-07-25 10:08:40.000000000 -0500
   503.6 ++++ gdb-6.4-patched/gdb/configure	2007-02-05 13:22:36.000000000 -0600
   503.7 +@@ -309,7 +309,7 @@
   503.8 + # include <unistd.h>
   503.9 + #endif"
  503.10 + 
  503.11 +-ac_subdirs_all="$ac_subdirs_all doc testsuite"
  503.12 ++ac_subdirs_all="$ac_subdirs_all doc"
  503.13 + ac_subdirs_all="$ac_subdirs_all gdbtk"
  503.14 + ac_subdirs_all="$ac_subdirs_all multi-ice"
  503.15 + ac_subdirs_all="$ac_subdirs_all gdbserver"
  503.16 +@@ -5940,7 +5940,7 @@
  503.17 + 
  503.18 + 
  503.19 + 
  503.20 +-subdirs="$subdirs doc testsuite"
  503.21 ++subdirs="$subdirs doc"
  503.22 + 
  503.23 + 
  503.24 + . $srcdir/configure.host
  503.25 +diff -ur gdb-6.4/gdb/gdbserver/configure gdb-6.4-patched/gdb/gdbserver/configure
  503.26 +--- gdb-6.4/gdb/gdbserver/configure	2005-09-17 18:14:37.000000000 -0500
  503.27 ++++ gdb-6.4-patched/gdb/gdbserver/configure	2007-02-05 13:22:58.000000000 -0600
  503.28 +@@ -1239,7 +1239,7 @@
  503.29 +       ac_cache_corrupted=: ;;
  503.30 +     ,);;
  503.31 +     *)
  503.32 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
  503.33 ++      if test "`echo $ac_old_val`" != "`echo $ac_new_val`"; then
  503.34 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  503.35 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  503.36 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  503.37 +diff -ur gdb-6.4/gdb/testsuite/configure gdb-6.4-patched/gdb/testsuite/configure
  503.38 +--- gdb-6.4/gdb/testsuite/configure	2005-04-11 09:13:12.000000000 -0500
  503.39 ++++ gdb-6.4-patched/gdb/testsuite/configure	2007-02-05 13:22:36.000000000 -0600
  503.40 +@@ -1248,7 +1248,7 @@
  503.41 +       ac_cache_corrupted=: ;;
  503.42 +     ,);;
  503.43 +     *)
  503.44 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
  503.45 ++      if test "`echo $ac_old_val" != "`echo $ac_new_val"; then
  503.46 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  503.47 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  503.48 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  503.49 +diff -ur gdb-6.4/Makefile.in gdb-6.4-patched/Makefile.in
  503.50 +--- gdb-6.4/Makefile.in	2005-12-01 23:29:54.000000000 -0600
  503.51 ++++ gdb-6.4-patched/Makefile.in	2007-02-05 13:22:36.000000000 -0600
  503.52 +@@ -383,7 +383,7 @@
  503.53 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
  503.54 + # (which we know are built with gcc) are built with optimizations so
  503.55 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
  503.56 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  503.57 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  503.58 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  503.59 + 
  503.60 + # If GCC_FOR_TARGET is not overriden on the command line, then this
  503.61 +diff -ur gdb-6.4/Makefile.tpl gdb-6.4-patched/Makefile.tpl
  503.62 +--- gdb-6.4/Makefile.tpl	2005-10-22 05:37:55.000000000 -0500
  503.63 ++++ gdb-6.4-patched/Makefile.tpl	2007-02-05 13:22:36.000000000 -0600
  503.64 +@@ -386,7 +386,7 @@
  503.65 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
  503.66 + # (which we know are built with gcc) are built with optimizations so
  503.67 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
  503.68 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  503.69 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  503.70 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  503.71 + 
  503.72 + # If GCC_FOR_TARGET is not overriden on the command line, then this
   504.1 --- a/patches/gdb/6.5/200-uclibc-readline-conf.patch	Mon Jul 28 21:08:01 2008 +0000
   504.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   504.3 @@ -1,15 +0,0 @@
   504.4 ---- gdb-6.1.1-dist/readline/configure	2003-05-27 18:29:47.000000000 -0500
   504.5 -+++ gdb-6.1.1/readline/configure	2004-08-09 14:20:23.000000000 -0500
   504.6 -@@ -6249,7 +6249,12 @@
   504.7 - 
   504.8 - 
   504.9 - echo "$as_me:$LINENO: checking for mbstate_t" >&5
  504.10 -+echo $ECHO_N "bash_cv_have_mbstate_t=$bash_cv_have_mbstate_t" >&6
  504.11 - echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
  504.12 -+if test "${bash_cv_have_mbstate_t+set}" != set; then
  504.13 -+  bash_cv_have_mbstate_t=yes
  504.14 -+  echo $ECHO_N "WARNING!! forcing to yes!!! $ECHO_C" >&6
  504.15 -+fi
  504.16 - if test "${bash_cv_have_mbstate_t+set}" = set; then
  504.17 -   echo $ECHO_N "(cached) $ECHO_C" >&6
  504.18 - else
   505.1 --- a/patches/gdb/6.5/500-thread-timeout.patch	Mon Jul 28 21:08:01 2008 +0000
   505.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   505.3 @@ -1,33 +0,0 @@
   505.4 ---- gdb-6.5/./gdb/gdbserver/thread-db.c.orig	2006-03-15 08:13:29.000000000 -0800
   505.5 -+++ gdb-6.5/./gdb/gdbserver/thread-db.c	2008-04-01 21:21:23.000000000 -0700
   505.6 -@@ -21,6 +21,7 @@
   505.7 -    Foundation, Inc., 51 Franklin Street, Fifth Floor,
   505.8 -    Boston, MA 02110-1301, USA.  */
   505.9 - 
  505.10 -+#include <unistd.h>
  505.11 - #include "server.h"
  505.12 - 
  505.13 - #include "linux-low.h"
  505.14 -@@ -134,6 +135,7 @@ thread_db_create_event (CORE_ADDR where)
  505.15 -   td_event_msg_t msg;
  505.16 -   td_err_e err;
  505.17 -   struct inferior_linux_data *tdata;
  505.18 -+  int timeout;
  505.19 - 
  505.20 -   if (debug_threads)
  505.21 -     fprintf (stderr, "Thread creation event.\n");
  505.22 -@@ -144,7 +146,13 @@ thread_db_create_event (CORE_ADDR where)
  505.23 -      In the LinuxThreads implementation, this is safe,
  505.24 -      because all events come from the manager thread
  505.25 -      (except for its own creation, of course).  */
  505.26 --  err = td_ta_event_getmsg (thread_agent, &msg);
  505.27 -+  for (timeout = 0; timeout < 50000; timeout++)
  505.28 -+    {
  505.29 -+      err = td_ta_event_getmsg (thread_agent, &msg);
  505.30 -+      if (err != TD_NOMSG)
  505.31 -+	break;
  505.32 -+      usleep(1000);
  505.33 -+    }
  505.34 -   if (err != TD_OK)
  505.35 -     fprintf (stderr, "thread getmsg err: %s\n",
  505.36 - 	     thread_db_err_str (err));
   506.1 --- a/patches/gdb/6.5/600-fix-compile-flag-mismatch.patch	Mon Jul 28 21:08:01 2008 +0000
   506.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   506.3 @@ -1,69 +0,0 @@
   506.4 -diff -ur gdb-6.4/gdb/configure gdb-6.4-patched/gdb/configure
   506.5 ---- gdb-6.4/gdb/configure	2005-07-25 10:08:40.000000000 -0500
   506.6 -+++ gdb-6.4-patched/gdb/configure	2007-02-05 13:22:36.000000000 -0600
   506.7 -@@ -309,7 +309,7 @@
   506.8 - # include <unistd.h>
   506.9 - #endif"
  506.10 - 
  506.11 --ac_subdirs_all="$ac_subdirs_all doc testsuite"
  506.12 -+ac_subdirs_all="$ac_subdirs_all doc"
  506.13 - ac_subdirs_all="$ac_subdirs_all gdbtk"
  506.14 - ac_subdirs_all="$ac_subdirs_all multi-ice"
  506.15 - ac_subdirs_all="$ac_subdirs_all gdbserver"
  506.16 -@@ -5940,7 +5940,7 @@
  506.17 - 
  506.18 - 
  506.19 - 
  506.20 --subdirs="$subdirs doc testsuite"
  506.21 -+subdirs="$subdirs doc"
  506.22 - 
  506.23 - 
  506.24 - . $srcdir/configure.host
  506.25 -diff -ur gdb-6.4/gdb/gdbserver/configure gdb-6.4-patched/gdb/gdbserver/configure
  506.26 ---- gdb-6.4/gdb/gdbserver/configure	2005-09-17 18:14:37.000000000 -0500
  506.27 -+++ gdb-6.4-patched/gdb/gdbserver/configure	2007-02-05 13:22:58.000000000 -0600
  506.28 -@@ -1239,7 +1239,7 @@
  506.29 -       ac_cache_corrupted=: ;;
  506.30 -     ,);;
  506.31 -     *)
  506.32 --      if test "x$ac_old_val" != "x$ac_new_val"; then
  506.33 -+      if test "`echo $ac_old_val`" != "`echo $ac_new_val`"; then
  506.34 - 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  506.35 - echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  506.36 - 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  506.37 -diff -ur gdb-6.4/gdb/testsuite/configure gdb-6.4-patched/gdb/testsuite/configure
  506.38 ---- gdb-6.4/gdb/testsuite/configure	2005-04-11 09:13:12.000000000 -0500
  506.39 -+++ gdb-6.4-patched/gdb/testsuite/configure	2007-02-05 13:22:36.000000000 -0600
  506.40 -@@ -1248,7 +1248,7 @@
  506.41 -       ac_cache_corrupted=: ;;
  506.42 -     ,);;
  506.43 -     *)
  506.44 --      if test "x$ac_old_val" != "x$ac_new_val"; then
  506.45 -+      if test "`echo $ac_old_val" != "`echo $ac_new_val"; then
  506.46 - 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  506.47 - echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  506.48 - 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  506.49 -diff -ur gdb-6.4/Makefile.in gdb-6.4-patched/Makefile.in
  506.50 ---- gdb-6.4/Makefile.in	2005-12-01 23:29:54.000000000 -0600
  506.51 -+++ gdb-6.4-patched/Makefile.in	2007-02-05 13:22:36.000000000 -0600
  506.52 -@@ -383,7 +383,7 @@
  506.53 - # CFLAGS will be just -g.  We want to ensure that TARGET libraries
  506.54 - # (which we know are built with gcc) are built with optimizations so
  506.55 - # prepend -O2 when setting CFLAGS_FOR_TARGET.
  506.56 --CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  506.57 -+CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  506.58 - SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  506.59 - 
  506.60 - # If GCC_FOR_TARGET is not overriden on the command line, then this
  506.61 -diff -ur gdb-6.4/Makefile.tpl gdb-6.4-patched/Makefile.tpl
  506.62 ---- gdb-6.4/Makefile.tpl	2005-10-22 05:37:55.000000000 -0500
  506.63 -+++ gdb-6.4-patched/Makefile.tpl	2007-02-05 13:22:36.000000000 -0600
  506.64 -@@ -386,7 +386,7 @@
  506.65 - # CFLAGS will be just -g.  We want to ensure that TARGET libraries
  506.66 - # (which we know are built with gcc) are built with optimizations so
  506.67 - # prepend -O2 when setting CFLAGS_FOR_TARGET.
  506.68 --CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  506.69 -+CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  506.70 - SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  506.71 - 
  506.72 - # If GCC_FOR_TARGET is not overriden on the command line, then this
   507.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   507.2 +++ b/patches/gdb/6.6/110-fix-compile-flag-mismatch.patch	Mon Jul 28 21:32:33 2008 +0000
   507.3 @@ -0,0 +1,69 @@
   507.4 +diff -rduNp gdb-6.6-100/Makefile.in gdb-6.6/Makefile.in
   507.5 +--- gdb-6.6-100/Makefile.in	2006-12-18 08:21:19.000000000 +0100
   507.6 ++++ gdb-6.6/Makefile.in	2007-05-14 10:54:29.000000000 +0200
   507.7 +@@ -331,7 +331,7 @@ COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_
   507.8 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
   507.9 + # (which we know are built with gcc) are built with optimizations so
  507.10 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
  507.11 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  507.12 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  507.13 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  507.14 + CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  507.15 + LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
  507.16 +diff -rduNp gdb-6.6-100/Makefile.tpl gdb-6.6/Makefile.tpl
  507.17 +--- gdb-6.6-100/Makefile.tpl	2006-11-15 00:26:39.000000000 +0100
  507.18 ++++ gdb-6.6/Makefile.tpl	2007-05-14 10:54:29.000000000 +0200
  507.19 +@@ -334,7 +334,7 @@ COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_
  507.20 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
  507.21 + # (which we know are built with gcc) are built with optimizations so
  507.22 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
  507.23 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  507.24 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  507.25 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  507.26 + CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  507.27 + LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
  507.28 +diff -rduNp gdb-6.6-100/gdb/configure gdb-6.6/gdb/configure
  507.29 +--- gdb-6.6-100/gdb/configure	2006-12-17 16:38:59.000000000 +0100
  507.30 ++++ gdb-6.6/gdb/configure	2007-05-14 10:55:41.000000000 +0200
  507.31 +@@ -272,7 +272,7 @@ PACKAGE_STRING=
  507.32 + PACKAGE_BUGREPORT=
  507.33 + 
  507.34 + ac_unique_file="main.c"
  507.35 +-ac_subdirs_all="$ac_subdirs_all doc testsuite"
  507.36 ++ac_subdirs_all="$ac_subdirs_all doc"
  507.37 + # Factoring default headers for most tests.
  507.38 + ac_includes_default="\
  507.39 + #include <stdio.h>
  507.40 +@@ -3055,7 +3055,7 @@ _ACEOF
  507.41 + 
  507.42 + 
  507.43 + 
  507.44 +-subdirs="$subdirs doc testsuite"
  507.45 ++subdirs="$subdirs doc"
  507.46 + 
  507.47 + 
  507.48 + # Provide defaults for some variables set by the per-host and per-target
  507.49 +diff -rduNp gdb-6.6-100/gdb/gdbserver/configure gdb-6.6/gdb/gdbserver/configure
  507.50 +--- gdb-6.6-100/gdb/gdbserver/configure	2006-11-22 01:10:19.000000000 +0100
  507.51 ++++ gdb-6.6/gdb/gdbserver/configure	2007-05-14 10:54:29.000000000 +0200
  507.52 +@@ -1239,7 +1239,7 @@ echo "$as_me: error: \`$ac_var' was not 
  507.53 +       ac_cache_corrupted=: ;;
  507.54 +     ,);;
  507.55 +     *)
  507.56 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
  507.57 ++      if test "`echo $ac_old_val`" != "`echo $ac_new_val`"; then
  507.58 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  507.59 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  507.60 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  507.61 +diff -rduNp gdb-6.6-100/gdb/testsuite/configure gdb-6.6/gdb/testsuite/configure
  507.62 +--- gdb-6.6-100/gdb/testsuite/configure	2006-06-21 15:57:21.000000000 +0200
  507.63 ++++ gdb-6.6/gdb/testsuite/configure	2007-05-14 10:54:29.000000000 +0200
  507.64 +@@ -1248,7 +1248,7 @@ echo "$as_me: error: \`$ac_var' was not 
  507.65 +       ac_cache_corrupted=: ;;
  507.66 +     ,);;
  507.67 +     *)
  507.68 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
  507.69 ++      if test "`echo $ac_old_val" != "`echo $ac_new_val"; then
  507.70 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  507.71 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  507.72 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
   508.1 --- a/patches/gdb/6.6/600-fix-compile-flag-mismatch.patch	Mon Jul 28 21:08:01 2008 +0000
   508.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   508.3 @@ -1,69 +0,0 @@
   508.4 -diff -rduNp gdb-6.6-100/Makefile.in gdb-6.6/Makefile.in
   508.5 ---- gdb-6.6-100/Makefile.in	2006-12-18 08:21:19.000000000 +0100
   508.6 -+++ gdb-6.6/Makefile.in	2007-05-14 10:54:29.000000000 +0200
   508.7 -@@ -331,7 +331,7 @@ COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_
   508.8 - # CFLAGS will be just -g.  We want to ensure that TARGET libraries
   508.9 - # (which we know are built with gcc) are built with optimizations so
  508.10 - # prepend -O2 when setting CFLAGS_FOR_TARGET.
  508.11 --CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  508.12 -+CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  508.13 - SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  508.14 - CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  508.15 - LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
  508.16 -diff -rduNp gdb-6.6-100/Makefile.tpl gdb-6.6/Makefile.tpl
  508.17 ---- gdb-6.6-100/Makefile.tpl	2006-11-15 00:26:39.000000000 +0100
  508.18 -+++ gdb-6.6/Makefile.tpl	2007-05-14 10:54:29.000000000 +0200
  508.19 -@@ -334,7 +334,7 @@ COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_
  508.20 - # CFLAGS will be just -g.  We want to ensure that TARGET libraries
  508.21 - # (which we know are built with gcc) are built with optimizations so
  508.22 - # prepend -O2 when setting CFLAGS_FOR_TARGET.
  508.23 --CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  508.24 -+CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
  508.25 - SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  508.26 - CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
  508.27 - LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
  508.28 -diff -rduNp gdb-6.6-100/gdb/configure gdb-6.6/gdb/configure
  508.29 ---- gdb-6.6-100/gdb/configure	2006-12-17 16:38:59.000000000 +0100
  508.30 -+++ gdb-6.6/gdb/configure	2007-05-14 10:55:41.000000000 +0200
  508.31 -@@ -272,7 +272,7 @@ PACKAGE_STRING=
  508.32 - PACKAGE_BUGREPORT=
  508.33 - 
  508.34 - ac_unique_file="main.c"
  508.35 --ac_subdirs_all="$ac_subdirs_all doc testsuite"
  508.36 -+ac_subdirs_all="$ac_subdirs_all doc"
  508.37 - # Factoring default headers for most tests.
  508.38 - ac_includes_default="\
  508.39 - #include <stdio.h>
  508.40 -@@ -3055,7 +3055,7 @@ _ACEOF
  508.41 - 
  508.42 - 
  508.43 - 
  508.44 --subdirs="$subdirs doc testsuite"
  508.45 -+subdirs="$subdirs doc"
  508.46 - 
  508.47 - 
  508.48 - # Provide defaults for some variables set by the per-host and per-target
  508.49 -diff -rduNp gdb-6.6-100/gdb/gdbserver/configure gdb-6.6/gdb/gdbserver/configure
  508.50 ---- gdb-6.6-100/gdb/gdbserver/configure	2006-11-22 01:10:19.000000000 +0100
  508.51 -+++ gdb-6.6/gdb/gdbserver/configure	2007-05-14 10:54:29.000000000 +0200
  508.52 -@@ -1239,7 +1239,7 @@ echo "$as_me: error: \`$ac_var' was not 
  508.53 -       ac_cache_corrupted=: ;;
  508.54 -     ,);;
  508.55 -     *)
  508.56 --      if test "x$ac_old_val" != "x$ac_new_val"; then
  508.57 -+      if test "`echo $ac_old_val`" != "`echo $ac_new_val`"; then
  508.58 - 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  508.59 - echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  508.60 - 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  508.61 -diff -rduNp gdb-6.6-100/gdb/testsuite/configure gdb-6.6/gdb/testsuite/configure
  508.62 ---- gdb-6.6-100/gdb/testsuite/configure	2006-06-21 15:57:21.000000000 +0200
  508.63 -+++ gdb-6.6/gdb/testsuite/configure	2007-05-14 10:54:29.000000000 +0200
  508.64 -@@ -1248,7 +1248,7 @@ echo "$as_me: error: \`$ac_var' was not 
  508.65 -       ac_cache_corrupted=: ;;
  508.66 -     ,);;
  508.67 -     *)
  508.68 --      if test "x$ac_old_val" != "x$ac_new_val"; then
  508.69 -+      if test "`echo $ac_old_val" != "`echo $ac_new_val"; then
  508.70 - 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  508.71 - echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  508.72 - 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
   509.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   509.2 +++ b/patches/gdb/6.7.1/100-security-errata-20050610.patch	Mon Jul 28 21:32:33 2008 +0000
   509.3 @@ -0,0 +1,205 @@
   509.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/35_all_gdb-6.3-security-errata-20050610.patch
   509.5 +-= BEGIN original header =-
   509.6 +2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
   509.7 +
   509.8 +        * gdb.base/gdbinit.exp: New testcase.
   509.9 +        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
  509.10 +
  509.11 +2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
  509.12 +            Jeff Johnston  <jjohnstn@redhat.com>
  509.13 +
  509.14 +        * Makefile.in (cli-cmds.o): Update.
  509.15 +        * configure.in: Add check for getuid.
  509.16 +        * configure: Regenerated.
  509.17 +        * config.in: Ditto.
  509.18 +        * main.c (captured_main): Pass -1 to source_command when loading
  509.19 +        gdbinit files.
  509.20 +        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
  509.21 +        (source_command): Update documentation.  Check permissions if
  509.22 +        FROM_TTY is -1.
  509.23 +
  509.24 +-= END original header =-
  509.25 +diff -durN gdb-6.7.1.orig/gdb/cli/cli-cmds.c gdb-6.7.1/gdb/cli/cli-cmds.c
  509.26 +--- gdb-6.7.1.orig/gdb/cli/cli-cmds.c	2007-08-23 20:08:47.000000000 +0200
  509.27 ++++ gdb-6.7.1/gdb/cli/cli-cmds.c	2008-06-17 23:27:44.000000000 +0200
  509.28 +@@ -36,6 +36,7 @@
  509.29 + #include "objfiles.h"
  509.30 + #include "source.h"
  509.31 + #include "disasm.h"
  509.32 ++#include "gdb_stat.h"
  509.33 + 
  509.34 + #include "ui-out.h"
  509.35 + 
  509.36 +@@ -459,12 +460,31 @@
  509.37 + 
  509.38 +   if (fd == -1)
  509.39 +     {
  509.40 +-      if (from_tty)
  509.41 ++      if (from_tty > 0)
  509.42 + 	perror_with_name (file);
  509.43 +       else
  509.44 + 	return;
  509.45 +     }
  509.46 + 
  509.47 ++#ifdef HAVE_GETUID
  509.48 ++  if (from_tty == -1)
  509.49 ++    {
  509.50 ++      struct stat statbuf;
  509.51 ++      if (fstat (fd, &statbuf) < 0)
  509.52 ++	{
  509.53 ++	  perror_with_name (file);
  509.54 ++	  close (fd);
  509.55 ++	  return;
  509.56 ++	}
  509.57 ++      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
  509.58 ++	{
  509.59 ++          warning (_("not using untrusted file \"%s\""), file);
  509.60 ++	  close (fd);
  509.61 ++	  return;
  509.62 ++	}
  509.63 ++    }
  509.64 ++#endif
  509.65 ++
  509.66 +   stream = fdopen (fd, FOPEN_RT);
  509.67 +   script_from_file (stream, file);
  509.68 + 
  509.69 +diff -durN gdb-6.7.1.orig/gdb/main.c gdb-6.7.1/gdb/main.c
  509.70 +--- gdb-6.7.1.orig/gdb/main.c	2007-08-23 20:08:36.000000000 +0200
  509.71 ++++ gdb-6.7.1/gdb/main.c	2008-06-17 23:27:44.000000000 +0200
  509.72 +@@ -688,7 +688,7 @@
  509.73 + 
  509.74 +       if (!inhibit_gdbinit)
  509.75 + 	{
  509.76 +-	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
  509.77 ++	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
  509.78 + 	}
  509.79 + 
  509.80 +       /* Do stats; no need to do them elsewhere since we'll only
  509.81 +@@ -766,7 +766,7 @@
  509.82 +       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
  509.83 +     if (!inhibit_gdbinit)
  509.84 +       {
  509.85 +-	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
  509.86 ++	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
  509.87 +       }
  509.88 + 
  509.89 +   for (i = 0; i < ncmd; i++)
  509.90 +diff -durN gdb-6.7.1.orig/gdb/Makefile.in gdb-6.7.1/gdb/Makefile.in
  509.91 +--- gdb-6.7.1.orig/gdb/Makefile.in	2008-06-17 23:27:44.000000000 +0200
  509.92 ++++ gdb-6.7.1/gdb/Makefile.in	2008-06-17 23:27:44.000000000 +0200
  509.93 +@@ -2885,7 +2885,7 @@
  509.94 + 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
  509.95 + 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
  509.96 + 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
  509.97 +-	$(tui_h)
  509.98 ++	$(tui_h) $(gdb_stat_h)
  509.99 + 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
 509.100 + cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
 509.101 + 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
 509.102 +diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp
 509.103 +--- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
 509.104 ++++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 23:27:44.000000000 +0200
 509.105 +@@ -0,0 +1,98 @@
 509.106 ++#   Copyright 2005
 509.107 ++#   Free Software Foundation, Inc.
 509.108 ++
 509.109 ++# This program is free software; you can redistribute it and/or modify
 509.110 ++# it under the terms of the GNU General Public License as published by
 509.111 ++# the Free Software Foundation; either version 2 of the License, or
 509.112 ++# (at your option) any later version.
 509.113 ++# 
 509.114 ++# This program is distributed in the hope that it will be useful,
 509.115 ++# but WITHOUT ANY WARRANTY; without even the implied warranty of
 509.116 ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 509.117 ++# GNU General Public License for more details.
 509.118 ++# 
 509.119 ++# You should have received a copy of the GNU General Public License
 509.120 ++# along with this program; if not, write to the Free Software
 509.121 ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 509.122 ++
 509.123 ++# Please email any bugs, comments, and/or additions to this file to:
 509.124 ++# bug-gdb@prep.ai.mit.edu
 509.125 ++
 509.126 ++# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
 509.127 ++
 509.128 ++if $tracelevel then {
 509.129 ++    strace $tracelevel
 509.130 ++}
 509.131 ++
 509.132 ++set prms_id 0
 509.133 ++set bug_id 0
 509.134 ++
 509.135 ++# are we on a target board
 509.136 ++if [is_remote target] {
 509.137 ++    return
 509.138 ++}
 509.139 ++
 509.140 ++
 509.141 ++global verbose
 509.142 ++global GDB
 509.143 ++global GDBFLAGS
 509.144 ++global gdb_prompt
 509.145 ++global timeout
 509.146 ++global gdb_spawn_id;
 509.147 ++                                                                                
 509.148 ++gdb_stop_suppressing_tests;
 509.149 ++                                                                                
 509.150 ++verbose "Spawning $GDB -nw"
 509.151 ++                                                                                
 509.152 ++if [info exists gdb_spawn_id] {
 509.153 ++    return 0;
 509.154 ++}
 509.155 ++                                                                                
 509.156 ++if ![is_remote host] {
 509.157 ++   if { [which $GDB] == 0 } then {
 509.158 ++        perror "$GDB does not exist."
 509.159 ++        exit 1
 509.160 ++    }
 509.161 ++}
 509.162 ++
 509.163 ++set env(HOME) [pwd]
 509.164 ++remote_exec build "rm .gdbinit"
 509.165 ++remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
 509.166 ++remote_exec build "chmod 646 .gdbinit"
 509.167 ++
 509.168 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 509.169 ++if { $res < 0 || $res == "" } {
 509.170 ++    perror "Spawning $GDB failed."
 509.171 ++    return 1;
 509.172 ++}
 509.173 ++gdb_expect 360 {
 509.174 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 509.175 ++        pass "untrusted .gdbinit caught."
 509.176 ++    }
 509.177 ++    -re "$gdb_prompt $"     {
 509.178 ++        fail "untrusted .gdbinit caught."
 509.179 ++    }
 509.180 ++    timeout {
 509.181 ++        fail "(timeout) untrusted .gdbinit caught."
 509.182 ++    }
 509.183 ++}
 509.184 ++
 509.185 ++remote_exec build "chmod 644 .gdbinit"
 509.186 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 509.187 ++if { $res < 0 || $res == "" } {
 509.188 ++    perror "Spawning $GDB failed."
 509.189 ++    return 1;
 509.190 ++}
 509.191 ++gdb_expect 360 {
 509.192 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 509.193 ++        fail "trusted .gdbinit allowed."
 509.194 ++    }
 509.195 ++    -re "in gdbinit.*$gdb_prompt $"     {
 509.196 ++        pass "trusted .gdbinit allowed."
 509.197 ++    }
 509.198 ++    timeout {
 509.199 ++        fail "(timeout) trusted .gdbinit allowed."
 509.200 ++    }
 509.201 ++}
 509.202 ++
 509.203 ++remote_exec build "rm .gdbinit"
 509.204 +diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample
 509.205 +--- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
 509.206 ++++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 23:27:44.000000000 +0200
 509.207 +@@ -0,0 +1 @@
 509.208 ++echo "\nin gdbinit"
   510.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   510.2 +++ b/patches/gdb/6.7.1/110-hppa-offsets.patch	Mon Jul 28 21:32:33 2008 +0000
   510.3 @@ -0,0 +1,272 @@
   510.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/45_all_gdb-hppa-offsets.patch
   510.5 +-= BEGIN original header =-
   510.6 +sanitized headers dont include asm/offsets.h, so cache a local copy 
   510.7 +
   510.8 +http://bugs.gentoo.org/180476
   510.9 +http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html
  510.10 +
  510.11 +-= END original header =-
  510.12 +diff -durN gdb-6.7.1.orig/gdb/hppa-linux-nat.c gdb-6.7.1/gdb/hppa-linux-nat.c
  510.13 +--- gdb-6.7.1.orig/gdb/hppa-linux-nat.c	2007-08-23 20:08:33.000000000 +0200
  510.14 ++++ gdb-6.7.1/gdb/hppa-linux-nat.c	2008-06-17 23:27:45.000000000 +0200
  510.15 +@@ -32,7 +32,7 @@
  510.16 + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43)
  510.17 + #include <asm/offset.h>
  510.18 + #else
  510.19 +-#include <asm/offsets.h>
  510.20 ++#include <hppa-offsets.h>
  510.21 + #endif
  510.22 + 
  510.23 + #include "hppa-tdep.h"
  510.24 +diff -durN gdb-6.7.1.orig/gdb/hppa-offsets.h gdb-6.7.1/gdb/hppa-offsets.h
  510.25 +--- gdb-6.7.1.orig/gdb/hppa-offsets.h	1970-01-01 01:00:00.000000000 +0100
  510.26 ++++ gdb-6.7.1/gdb/hppa-offsets.h	2008-06-17 23:27:45.000000000 +0200
  510.27 +@@ -0,0 +1,248 @@
  510.28 ++#ifndef __ASM_OFFSETS_H__
  510.29 ++#define __ASM_OFFSETS_H__
  510.30 ++/*
  510.31 ++ * DO NOT MODIFY.
  510.32 ++ *
  510.33 ++ * This file was generated by arch/parisc/Makefile
  510.34 ++ *
  510.35 ++ */
  510.36 ++
  510.37 ++#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
  510.38 ++#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
  510.39 ++#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
  510.40 ++#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */
  510.41 ++#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
  510.42 ++#define TASK_MM 108 /* offsetof(struct task_struct, mm) */
  510.43 ++#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */
  510.44 ++#define TASK_PID 140 /* offsetof(struct task_struct, pid) */
  510.45 ++
  510.46 ++#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */
  510.47 ++#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */
  510.48 ++#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */
  510.49 ++#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */
  510.50 ++#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */
  510.51 ++#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */
  510.52 ++#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */
  510.53 ++#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */
  510.54 ++#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */
  510.55 ++#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */
  510.56 ++#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */
  510.57 ++#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */
  510.58 ++#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */
  510.59 ++#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */
  510.60 ++#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */
  510.61 ++#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */
  510.62 ++#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */
  510.63 ++#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */
  510.64 ++#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */
  510.65 ++#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */
  510.66 ++#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */
  510.67 ++#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */
  510.68 ++#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */
  510.69 ++#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */
  510.70 ++#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */
  510.71 ++#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */
  510.72 ++#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */
  510.73 ++#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */
  510.74 ++#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */
  510.75 ++#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */
  510.76 ++#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */
  510.77 ++#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */
  510.78 ++#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */
  510.79 ++#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */
  510.80 ++#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */
  510.81 ++#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */
  510.82 ++#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */
  510.83 ++#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */
  510.84 ++#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */
  510.85 ++#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */
  510.86 ++#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */
  510.87 ++#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */
  510.88 ++#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */
  510.89 ++#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */
  510.90 ++#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */
  510.91 ++#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */
  510.92 ++#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */
  510.93 ++#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */
  510.94 ++#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */
  510.95 ++#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */
  510.96 ++#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */
  510.97 ++#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */
  510.98 ++#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */
  510.99 ++#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */
 510.100 ++#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */
 510.101 ++#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */
 510.102 ++#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */
 510.103 ++#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */
 510.104 ++#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */
 510.105 ++#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */
 510.106 ++#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */
 510.107 ++#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */
 510.108 ++#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */
 510.109 ++#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */
 510.110 ++#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */
 510.111 ++#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */
 510.112 ++#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */
 510.113 ++#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */
 510.114 ++#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */
 510.115 ++#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */
 510.116 ++#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */
 510.117 ++#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */
 510.118 ++#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */
 510.119 ++#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */
 510.120 ++#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */
 510.121 ++#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */
 510.122 ++#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */
 510.123 ++#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */
 510.124 ++#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */
 510.125 ++#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */
 510.126 ++#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */
 510.127 ++#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */
 510.128 ++#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */
 510.129 ++#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */
 510.130 ++#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */
 510.131 ++
 510.132 ++#define TASK_SZ 1272 /* sizeof(struct task_struct) */
 510.133 ++#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */
 510.134 ++
 510.135 ++#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */
 510.136 ++#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */
 510.137 ++#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */
 510.138 ++#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */
 510.139 ++#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */
 510.140 ++#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */
 510.141 ++#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */
 510.142 ++#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */
 510.143 ++#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */
 510.144 ++#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */
 510.145 ++#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */
 510.146 ++#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */
 510.147 ++#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */
 510.148 ++#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */
 510.149 ++#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */
 510.150 ++#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */
 510.151 ++#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */
 510.152 ++#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */
 510.153 ++#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */
 510.154 ++#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */
 510.155 ++#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */
 510.156 ++#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */
 510.157 ++#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */
 510.158 ++#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */
 510.159 ++#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */
 510.160 ++#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */
 510.161 ++#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */
 510.162 ++#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */
 510.163 ++#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */
 510.164 ++#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */
 510.165 ++#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */
 510.166 ++#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */
 510.167 ++#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */
 510.168 ++#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */
 510.169 ++#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */
 510.170 ++#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */
 510.171 ++#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */
 510.172 ++#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */
 510.173 ++#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */
 510.174 ++#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */
 510.175 ++#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */
 510.176 ++#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */
 510.177 ++#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */
 510.178 ++#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */
 510.179 ++#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */
 510.180 ++#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */
 510.181 ++#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */
 510.182 ++#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */
 510.183 ++#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */
 510.184 ++#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */
 510.185 ++#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */
 510.186 ++#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */
 510.187 ++#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */
 510.188 ++#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */
 510.189 ++#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */
 510.190 ++#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */
 510.191 ++#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */
 510.192 ++#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */
 510.193 ++#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */
 510.194 ++#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */
 510.195 ++#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */
 510.196 ++#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */
 510.197 ++#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */
 510.198 ++#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */
 510.199 ++#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */
 510.200 ++#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */
 510.201 ++#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */
 510.202 ++#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */
 510.203 ++#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */
 510.204 ++#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */
 510.205 ++#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */
 510.206 ++#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */
 510.207 ++#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */
 510.208 ++#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */
 510.209 ++#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */
 510.210 ++#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */
 510.211 ++#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */
 510.212 ++#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */
 510.213 ++#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */
 510.214 ++#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */
 510.215 ++#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */
 510.216 ++#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */
 510.217 ++#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */
 510.218 ++#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */
 510.219 ++#define PT_SIZE 472 /* sizeof(struct pt_regs) */
 510.220 ++#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */
 510.221 ++
 510.222 ++#define TI_TASK 0 /* offsetof(struct thread_info, task) */
 510.223 ++#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */
 510.224 ++#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */
 510.225 ++#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */
 510.226 ++#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */
 510.227 ++#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */
 510.228 ++#define THREAD_SZ 44 /* sizeof(struct thread_info) */
 510.229 ++#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */
 510.230 ++
 510.231 ++#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
 510.232 ++#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */
 510.233 ++
 510.234 ++#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */
 510.235 ++#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */
 510.236 ++#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */
 510.237 ++#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */
 510.238 ++#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */
 510.239 ++#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */
 510.240 ++#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */
 510.241 ++#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */
 510.242 ++#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */
 510.243 ++#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */
 510.244 ++#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */
 510.245 ++#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */
 510.246 ++#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */
 510.247 ++#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */
 510.248 ++#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */
 510.249 ++#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */
 510.250 ++#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */
 510.251 ++#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */
 510.252 ++#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */
 510.253 ++#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */
 510.254 ++#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */
 510.255 ++#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */
 510.256 ++
 510.257 ++#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */
 510.258 ++#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */
 510.259 ++
 510.260 ++#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */
 510.261 ++#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */
 510.262 ++#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */
 510.263 ++#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */
 510.264 ++#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */
 510.265 ++#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */
 510.266 ++#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */
 510.267 ++#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */
 510.268 ++#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */
 510.269 ++#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */
 510.270 ++#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */
 510.271 ++#define ASM_PT_INITIAL 4 /* PT_INITIAL */
 510.272 ++#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */
 510.273 ++
 510.274 ++
 510.275 ++#endif
   511.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   511.2 +++ b/patches/gdb/6.7.1/120-deleted-children.patch	Mon Jul 28 21:32:33 2008 +0000
   511.3 @@ -0,0 +1,26 @@
   511.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/50_all_gdb-deleted-children.patch
   511.5 +-= BEGIN original header =-
   511.6 +http://bugs.gentoo.org/210636
   511.7 +http://sourceware.org/ml/gdb-patches/2007-11/msg00136.html
   511.8 +
   511.9 +2007-11-07  Vladimir Prus  <vladimir@codesourcery.com>
  511.10 +
  511.11 +	Fix crash when a variable object being deleted
  511.12 +	has any of its children deleted previously.
  511.13 +	
  511.14 +	* varobj.c (delete_variable_1): Don't recurse
  511.15 +	into deleted children.
  511.16 +
  511.17 +-= END original header =-
  511.18 +diff -durN gdb-6.7.1.orig/gdb/varobj.c gdb-6.7.1/gdb/varobj.c
  511.19 +--- gdb-6.7.1.orig/gdb/varobj.c	2007-08-31 21:01:17.000000000 +0200
  511.20 ++++ gdb-6.7.1/gdb/varobj.c	2008-06-17 23:27:45.000000000 +0200
  511.21 +@@ -1295,6 +1295,8 @@
  511.22 +   for (i = 0; i < VEC_length (varobj_p, var->children); ++i)
  511.23 +     {   
  511.24 +       varobj_p child = VEC_index (varobj_p, var->children, i);
  511.25 ++      if (!child)
  511.26 ++	continue;
  511.27 +       if (!remove_from_parent_p)
  511.28 + 	child->parent = NULL;
  511.29 +       delete_variable_1 (resultp, delcountp, child, 0, only_children_p);
   512.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   512.2 +++ b/patches/gdb/6.7.1/130-dwarf-stack-overflow.patch	Mon Jul 28 21:32:33 2008 +0000
   512.3 @@ -0,0 +1,52 @@
   512.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/80_all_gdb-6.5-dwarf-stack-overflow.patch
   512.5 +-= BEGIN original header =-
   512.6 +http://bugs.gentoo.org/144833
   512.7 +
   512.8 +for gdb/ChangeLog:
   512.9 +2006-08-22  Will Drewry <wad@google.com>
  512.10 +	    Tavis Ormandy <taviso@google.com>
  512.11 +
  512.12 +	* dwarf2read.c (decode_locdesc): Enforce location description stack
  512.13 +	boundaries.
  512.14 +	* dwarfread.c (locval): Likewise.
  512.15 +
  512.16 +-= END original header =-
  512.17 +diff -durN gdb-6.7.1.orig/gdb/dwarf2read.c gdb-6.7.1/gdb/dwarf2read.c
  512.18 +--- gdb-6.7.1.orig/gdb/dwarf2read.c	2007-09-05 02:51:48.000000000 +0200
  512.19 ++++ gdb-6.7.1/gdb/dwarf2read.c	2008-06-17 23:27:46.000000000 +0200
  512.20 +@@ -9061,8 +9061,7 @@
  512.21 +    callers will only want a very basic result and this can become a
  512.22 +    complaint.
  512.23 + 
  512.24 +-   Note that stack[0] is unused except as a default error return.
  512.25 +-   Note that stack overflow is not yet handled.  */
  512.26 ++   Note that stack[0] is unused except as a default error return. */
  512.27 + 
  512.28 + static CORE_ADDR
  512.29 + decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
  512.30 +@@ -9079,7 +9078,7 @@
  512.31 + 
  512.32 +   i = 0;
  512.33 +   stacki = 0;
  512.34 +-  stack[stacki] = 0;
  512.35 ++  stack[++stacki] = 0;
  512.36 + 
  512.37 +   while (i < size)
  512.38 +     {
  512.39 +@@ -9261,6 +9260,16 @@
  512.40 + 		     dwarf_stack_op_name (op));
  512.41 + 	  return (stack[stacki]);
  512.42 + 	}
  512.43 ++      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
  512.44 ++         outside of the allocated space. Also enforce minimum > 0.
  512.45 ++         -- wad@google.com 14 Aug 2006 */
  512.46 ++      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
  512.47 ++	internal_error (__FILE__, __LINE__,
  512.48 ++	                _("location description stack too deep: %d"),
  512.49 ++	                stacki);
  512.50 ++      if (stacki <= 0)
  512.51 ++	internal_error (__FILE__, __LINE__,
  512.52 ++	                _("location description stack too shallow"));
  512.53 +     }
  512.54 +   return (stack[stacki]);
  512.55 + }
   513.1 --- a/patches/gdb/6.7.1/150-security-errata-20050610.patch	Mon Jul 28 21:08:01 2008 +0000
   513.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   513.3 @@ -1,205 +0,0 @@
   513.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/35_all_gdb-6.3-security-errata-20050610.patch
   513.5 --= BEGIN original header =-
   513.6 -2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
   513.7 -
   513.8 -        * gdb.base/gdbinit.exp: New testcase.
   513.9 -        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
  513.10 -
  513.11 -2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
  513.12 -            Jeff Johnston  <jjohnstn@redhat.com>
  513.13 -
  513.14 -        * Makefile.in (cli-cmds.o): Update.
  513.15 -        * configure.in: Add check for getuid.
  513.16 -        * configure: Regenerated.
  513.17 -        * config.in: Ditto.
  513.18 -        * main.c (captured_main): Pass -1 to source_command when loading
  513.19 -        gdbinit files.
  513.20 -        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
  513.21 -        (source_command): Update documentation.  Check permissions if
  513.22 -        FROM_TTY is -1.
  513.23 -
  513.24 --= END original header =-
  513.25 -diff -durN gdb-6.7.1.orig/gdb/cli/cli-cmds.c gdb-6.7.1/gdb/cli/cli-cmds.c
  513.26 ---- gdb-6.7.1.orig/gdb/cli/cli-cmds.c	2007-08-23 20:08:47.000000000 +0200
  513.27 -+++ gdb-6.7.1/gdb/cli/cli-cmds.c	2008-06-17 23:27:44.000000000 +0200
  513.28 -@@ -36,6 +36,7 @@
  513.29 - #include "objfiles.h"
  513.30 - #include "source.h"
  513.31 - #include "disasm.h"
  513.32 -+#include "gdb_stat.h"
  513.33 - 
  513.34 - #include "ui-out.h"
  513.35 - 
  513.36 -@@ -459,12 +460,31 @@
  513.37 - 
  513.38 -   if (fd == -1)
  513.39 -     {
  513.40 --      if (from_tty)
  513.41 -+      if (from_tty > 0)
  513.42 - 	perror_with_name (file);
  513.43 -       else
  513.44 - 	return;
  513.45 -     }
  513.46 - 
  513.47 -+#ifdef HAVE_GETUID
  513.48 -+  if (from_tty == -1)
  513.49 -+    {
  513.50 -+      struct stat statbuf;
  513.51 -+      if (fstat (fd, &statbuf) < 0)
  513.52 -+	{
  513.53 -+	  perror_with_name (file);
  513.54 -+	  close (fd);
  513.55 -+	  return;
  513.56 -+	}
  513.57 -+      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
  513.58 -+	{
  513.59 -+          warning (_("not using untrusted file \"%s\""), file);
  513.60 -+	  close (fd);
  513.61 -+	  return;
  513.62 -+	}
  513.63 -+    }
  513.64 -+#endif
  513.65 -+
  513.66 -   stream = fdopen (fd, FOPEN_RT);
  513.67 -   script_from_file (stream, file);
  513.68 - 
  513.69 -diff -durN gdb-6.7.1.orig/gdb/main.c gdb-6.7.1/gdb/main.c
  513.70 ---- gdb-6.7.1.orig/gdb/main.c	2007-08-23 20:08:36.000000000 +0200
  513.71 -+++ gdb-6.7.1/gdb/main.c	2008-06-17 23:27:44.000000000 +0200
  513.72 -@@ -688,7 +688,7 @@
  513.73 - 
  513.74 -       if (!inhibit_gdbinit)
  513.75 - 	{
  513.76 --	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
  513.77 -+	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
  513.78 - 	}
  513.79 - 
  513.80 -       /* Do stats; no need to do them elsewhere since we'll only
  513.81 -@@ -766,7 +766,7 @@
  513.82 -       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
  513.83 -     if (!inhibit_gdbinit)
  513.84 -       {
  513.85 --	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
  513.86 -+	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
  513.87 -       }
  513.88 - 
  513.89 -   for (i = 0; i < ncmd; i++)
  513.90 -diff -durN gdb-6.7.1.orig/gdb/Makefile.in gdb-6.7.1/gdb/Makefile.in
  513.91 ---- gdb-6.7.1.orig/gdb/Makefile.in	2008-06-17 23:27:44.000000000 +0200
  513.92 -+++ gdb-6.7.1/gdb/Makefile.in	2008-06-17 23:27:44.000000000 +0200
  513.93 -@@ -2885,7 +2885,7 @@
  513.94 - 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
  513.95 - 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
  513.96 - 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
  513.97 --	$(tui_h)
  513.98 -+	$(tui_h) $(gdb_stat_h)
  513.99 - 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
 513.100 - cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
 513.101 - 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
 513.102 -diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp
 513.103 ---- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
 513.104 -+++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 23:27:44.000000000 +0200
 513.105 -@@ -0,0 +1,98 @@
 513.106 -+#   Copyright 2005
 513.107 -+#   Free Software Foundation, Inc.
 513.108 -+
 513.109 -+# This program is free software; you can redistribute it and/or modify
 513.110 -+# it under the terms of the GNU General Public License as published by
 513.111 -+# the Free Software Foundation; either version 2 of the License, or
 513.112 -+# (at your option) any later version.
 513.113 -+# 
 513.114 -+# This program is distributed in the hope that it will be useful,
 513.115 -+# but WITHOUT ANY WARRANTY; without even the implied warranty of
 513.116 -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 513.117 -+# GNU General Public License for more details.
 513.118 -+# 
 513.119 -+# You should have received a copy of the GNU General Public License
 513.120 -+# along with this program; if not, write to the Free Software
 513.121 -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 513.122 -+
 513.123 -+# Please email any bugs, comments, and/or additions to this file to:
 513.124 -+# bug-gdb@prep.ai.mit.edu
 513.125 -+
 513.126 -+# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
 513.127 -+
 513.128 -+if $tracelevel then {
 513.129 -+    strace $tracelevel
 513.130 -+}
 513.131 -+
 513.132 -+set prms_id 0
 513.133 -+set bug_id 0
 513.134 -+
 513.135 -+# are we on a target board
 513.136 -+if [is_remote target] {
 513.137 -+    return
 513.138 -+}
 513.139 -+
 513.140 -+
 513.141 -+global verbose
 513.142 -+global GDB
 513.143 -+global GDBFLAGS
 513.144 -+global gdb_prompt
 513.145 -+global timeout
 513.146 -+global gdb_spawn_id;
 513.147 -+                                                                                
 513.148 -+gdb_stop_suppressing_tests;
 513.149 -+                                                                                
 513.150 -+verbose "Spawning $GDB -nw"
 513.151 -+                                                                                
 513.152 -+if [info exists gdb_spawn_id] {
 513.153 -+    return 0;
 513.154 -+}
 513.155 -+                                                                                
 513.156 -+if ![is_remote host] {
 513.157 -+   if { [which $GDB] == 0 } then {
 513.158 -+        perror "$GDB does not exist."
 513.159 -+        exit 1
 513.160 -+    }
 513.161 -+}
 513.162 -+
 513.163 -+set env(HOME) [pwd]
 513.164 -+remote_exec build "rm .gdbinit"
 513.165 -+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
 513.166 -+remote_exec build "chmod 646 .gdbinit"
 513.167 -+
 513.168 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 513.169 -+if { $res < 0 || $res == "" } {
 513.170 -+    perror "Spawning $GDB failed."
 513.171 -+    return 1;
 513.172 -+}
 513.173 -+gdb_expect 360 {
 513.174 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 513.175 -+        pass "untrusted .gdbinit caught."
 513.176 -+    }
 513.177 -+    -re "$gdb_prompt $"     {
 513.178 -+        fail "untrusted .gdbinit caught."
 513.179 -+    }
 513.180 -+    timeout {
 513.181 -+        fail "(timeout) untrusted .gdbinit caught."
 513.182 -+    }
 513.183 -+}
 513.184 -+
 513.185 -+remote_exec build "chmod 644 .gdbinit"
 513.186 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 513.187 -+if { $res < 0 || $res == "" } {
 513.188 -+    perror "Spawning $GDB failed."
 513.189 -+    return 1;
 513.190 -+}
 513.191 -+gdb_expect 360 {
 513.192 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 513.193 -+        fail "trusted .gdbinit allowed."
 513.194 -+    }
 513.195 -+    -re "in gdbinit.*$gdb_prompt $"     {
 513.196 -+        pass "trusted .gdbinit allowed."
 513.197 -+    }
 513.198 -+    timeout {
 513.199 -+        fail "(timeout) trusted .gdbinit allowed."
 513.200 -+    }
 513.201 -+}
 513.202 -+
 513.203 -+remote_exec build "rm .gdbinit"
 513.204 -diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample
 513.205 ---- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
 513.206 -+++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 23:27:44.000000000 +0200
 513.207 -@@ -0,0 +1 @@
 513.208 -+echo "\nin gdbinit"
   514.1 --- a/patches/gdb/6.7.1/175-hppa-offsets.patch	Mon Jul 28 21:08:01 2008 +0000
   514.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   514.3 @@ -1,272 +0,0 @@
   514.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/45_all_gdb-hppa-offsets.patch
   514.5 --= BEGIN original header =-
   514.6 -sanitized headers dont include asm/offsets.h, so cache a local copy 
   514.7 -
   514.8 -http://bugs.gentoo.org/180476
   514.9 -http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html
  514.10 -
  514.11 --= END original header =-
  514.12 -diff -durN gdb-6.7.1.orig/gdb/hppa-linux-nat.c gdb-6.7.1/gdb/hppa-linux-nat.c
  514.13 ---- gdb-6.7.1.orig/gdb/hppa-linux-nat.c	2007-08-23 20:08:33.000000000 +0200
  514.14 -+++ gdb-6.7.1/gdb/hppa-linux-nat.c	2008-06-17 23:27:45.000000000 +0200
  514.15 -@@ -32,7 +32,7 @@
  514.16 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43)
  514.17 - #include <asm/offset.h>
  514.18 - #else
  514.19 --#include <asm/offsets.h>
  514.20 -+#include <hppa-offsets.h>
  514.21 - #endif
  514.22 - 
  514.23 - #include "hppa-tdep.h"
  514.24 -diff -durN gdb-6.7.1.orig/gdb/hppa-offsets.h gdb-6.7.1/gdb/hppa-offsets.h
  514.25 ---- gdb-6.7.1.orig/gdb/hppa-offsets.h	1970-01-01 01:00:00.000000000 +0100
  514.26 -+++ gdb-6.7.1/gdb/hppa-offsets.h	2008-06-17 23:27:45.000000000 +0200
  514.27 -@@ -0,0 +1,248 @@
  514.28 -+#ifndef __ASM_OFFSETS_H__
  514.29 -+#define __ASM_OFFSETS_H__
  514.30 -+/*
  514.31 -+ * DO NOT MODIFY.
  514.32 -+ *
  514.33 -+ * This file was generated by arch/parisc/Makefile
  514.34 -+ *
  514.35 -+ */
  514.36 -+
  514.37 -+#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
  514.38 -+#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
  514.39 -+#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
  514.40 -+#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */
  514.41 -+#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
  514.42 -+#define TASK_MM 108 /* offsetof(struct task_struct, mm) */
  514.43 -+#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */
  514.44 -+#define TASK_PID 140 /* offsetof(struct task_struct, pid) */
  514.45 -+
  514.46 -+#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */
  514.47 -+#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */
  514.48 -+#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */
  514.49 -+#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */
  514.50 -+#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */
  514.51 -+#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */
  514.52 -+#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */
  514.53 -+#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */
  514.54 -+#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */
  514.55 -+#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */
  514.56 -+#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */
  514.57 -+#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */
  514.58 -+#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */
  514.59 -+#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */
  514.60 -+#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */
  514.61 -+#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */
  514.62 -+#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */
  514.63 -+#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */
  514.64 -+#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */
  514.65 -+#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */
  514.66 -+#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */
  514.67 -+#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */
  514.68 -+#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */
  514.69 -+#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */
  514.70 -+#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */
  514.71 -+#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */
  514.72 -+#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */
  514.73 -+#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */
  514.74 -+#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */
  514.75 -+#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */
  514.76 -+#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */
  514.77 -+#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */
  514.78 -+#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */
  514.79 -+#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */
  514.80 -+#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */
  514.81 -+#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */
  514.82 -+#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */
  514.83 -+#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */
  514.84 -+#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */
  514.85 -+#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */
  514.86 -+#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */
  514.87 -+#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */
  514.88 -+#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */
  514.89 -+#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */
  514.90 -+#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */
  514.91 -+#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */
  514.92 -+#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */
  514.93 -+#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */
  514.94 -+#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */
  514.95 -+#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */
  514.96 -+#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */
  514.97 -+#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */
  514.98 -+#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */
  514.99 -+#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */
 514.100 -+#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */
 514.101 -+#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */
 514.102 -+#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */
 514.103 -+#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */
 514.104 -+#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */
 514.105 -+#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */
 514.106 -+#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */
 514.107 -+#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */
 514.108 -+#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */
 514.109 -+#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */
 514.110 -+#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */
 514.111 -+#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */
 514.112 -+#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */
 514.113 -+#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */
 514.114 -+#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */
 514.115 -+#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */
 514.116 -+#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */
 514.117 -+#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */
 514.118 -+#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */
 514.119 -+#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */
 514.120 -+#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */
 514.121 -+#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */
 514.122 -+#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */
 514.123 -+#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */
 514.124 -+#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */
 514.125 -+#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */
 514.126 -+#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */
 514.127 -+#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */
 514.128 -+#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */
 514.129 -+#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */
 514.130 -+#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */
 514.131 -+
 514.132 -+#define TASK_SZ 1272 /* sizeof(struct task_struct) */
 514.133 -+#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */
 514.134 -+
 514.135 -+#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */
 514.136 -+#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */
 514.137 -+#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */
 514.138 -+#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */
 514.139 -+#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */
 514.140 -+#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */
 514.141 -+#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */
 514.142 -+#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */
 514.143 -+#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */
 514.144 -+#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */
 514.145 -+#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */
 514.146 -+#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */
 514.147 -+#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */
 514.148 -+#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */
 514.149 -+#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */
 514.150 -+#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */
 514.151 -+#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */
 514.152 -+#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */
 514.153 -+#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */
 514.154 -+#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */
 514.155 -+#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */
 514.156 -+#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */
 514.157 -+#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */
 514.158 -+#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */
 514.159 -+#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */
 514.160 -+#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */
 514.161 -+#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */
 514.162 -+#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */
 514.163 -+#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */
 514.164 -+#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */
 514.165 -+#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */
 514.166 -+#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */
 514.167 -+#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */
 514.168 -+#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */
 514.169 -+#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */
 514.170 -+#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */
 514.171 -+#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */
 514.172 -+#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */
 514.173 -+#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */
 514.174 -+#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */
 514.175 -+#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */
 514.176 -+#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */
 514.177 -+#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */
 514.178 -+#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */
 514.179 -+#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */
 514.180 -+#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */
 514.181 -+#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */
 514.182 -+#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */
 514.183 -+#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */
 514.184 -+#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */
 514.185 -+#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */
 514.186 -+#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */
 514.187 -+#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */
 514.188 -+#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */
 514.189 -+#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */
 514.190 -+#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */
 514.191 -+#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */
 514.192 -+#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */
 514.193 -+#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */
 514.194 -+#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */
 514.195 -+#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */
 514.196 -+#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */
 514.197 -+#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */
 514.198 -+#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */
 514.199 -+#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */
 514.200 -+#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */
 514.201 -+#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */
 514.202 -+#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */
 514.203 -+#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */
 514.204 -+#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */
 514.205 -+#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */
 514.206 -+#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */
 514.207 -+#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */
 514.208 -+#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */
 514.209 -+#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */
 514.210 -+#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */
 514.211 -+#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */
 514.212 -+#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */
 514.213 -+#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */
 514.214 -+#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */
 514.215 -+#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */
 514.216 -+#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */
 514.217 -+#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */
 514.218 -+#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */
 514.219 -+#define PT_SIZE 472 /* sizeof(struct pt_regs) */
 514.220 -+#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */
 514.221 -+
 514.222 -+#define TI_TASK 0 /* offsetof(struct thread_info, task) */
 514.223 -+#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */
 514.224 -+#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */
 514.225 -+#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */
 514.226 -+#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */
 514.227 -+#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */
 514.228 -+#define THREAD_SZ 44 /* sizeof(struct thread_info) */
 514.229 -+#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */
 514.230 -+
 514.231 -+#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
 514.232 -+#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */
 514.233 -+
 514.234 -+#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */
 514.235 -+#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */
 514.236 -+#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */
 514.237 -+#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */
 514.238 -+#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */
 514.239 -+#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */
 514.240 -+#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */
 514.241 -+#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */
 514.242 -+#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */
 514.243 -+#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */
 514.244 -+#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */
 514.245 -+#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */
 514.246 -+#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */
 514.247 -+#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */
 514.248 -+#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */
 514.249 -+#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */
 514.250 -+#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */
 514.251 -+#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */
 514.252 -+#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */
 514.253 -+#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */
 514.254 -+#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */
 514.255 -+#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */
 514.256 -+
 514.257 -+#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */
 514.258 -+#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */
 514.259 -+
 514.260 -+#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */
 514.261 -+#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */
 514.262 -+#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */
 514.263 -+#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */
 514.264 -+#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */
 514.265 -+#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */
 514.266 -+#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */
 514.267 -+#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */
 514.268 -+#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */
 514.269 -+#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */
 514.270 -+#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */
 514.271 -+#define ASM_PT_INITIAL 4 /* PT_INITIAL */
 514.272 -+#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */
 514.273 -+
 514.274 -+
 514.275 -+#endif
   515.1 --- a/patches/gdb/6.7.1/200-deleted-children.patch	Mon Jul 28 21:08:01 2008 +0000
   515.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   515.3 @@ -1,26 +0,0 @@
   515.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/50_all_gdb-deleted-children.patch
   515.5 --= BEGIN original header =-
   515.6 -http://bugs.gentoo.org/210636
   515.7 -http://sourceware.org/ml/gdb-patches/2007-11/msg00136.html
   515.8 -
   515.9 -2007-11-07  Vladimir Prus  <vladimir@codesourcery.com>
  515.10 -
  515.11 -	Fix crash when a variable object being deleted
  515.12 -	has any of its children deleted previously.
  515.13 -	
  515.14 -	* varobj.c (delete_variable_1): Don't recurse
  515.15 -	into deleted children.
  515.16 -
  515.17 --= END original header =-
  515.18 -diff -durN gdb-6.7.1.orig/gdb/varobj.c gdb-6.7.1/gdb/varobj.c
  515.19 ---- gdb-6.7.1.orig/gdb/varobj.c	2007-08-31 21:01:17.000000000 +0200
  515.20 -+++ gdb-6.7.1/gdb/varobj.c	2008-06-17 23:27:45.000000000 +0200
  515.21 -@@ -1295,6 +1295,8 @@
  515.22 -   for (i = 0; i < VEC_length (varobj_p, var->children); ++i)
  515.23 -     {   
  515.24 -       varobj_p child = VEC_index (varobj_p, var->children, i);
  515.25 -+      if (!child)
  515.26 -+	continue;
  515.27 -       if (!remove_from_parent_p)
  515.28 - 	child->parent = NULL;
  515.29 -       delete_variable_1 (resultp, delcountp, child, 0, only_children_p);
   516.1 --- a/patches/gdb/6.7.1/225-dwarf-stack-overflow.patch	Mon Jul 28 21:08:01 2008 +0000
   516.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   516.3 @@ -1,52 +0,0 @@
   516.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/80_all_gdb-6.5-dwarf-stack-overflow.patch
   516.5 --= BEGIN original header =-
   516.6 -http://bugs.gentoo.org/144833
   516.7 -
   516.8 -for gdb/ChangeLog:
   516.9 -2006-08-22  Will Drewry <wad@google.com>
  516.10 -	    Tavis Ormandy <taviso@google.com>
  516.11 -
  516.12 -	* dwarf2read.c (decode_locdesc): Enforce location description stack
  516.13 -	boundaries.
  516.14 -	* dwarfread.c (locval): Likewise.
  516.15 -
  516.16 --= END original header =-
  516.17 -diff -durN gdb-6.7.1.orig/gdb/dwarf2read.c gdb-6.7.1/gdb/dwarf2read.c
  516.18 ---- gdb-6.7.1.orig/gdb/dwarf2read.c	2007-09-05 02:51:48.000000000 +0200
  516.19 -+++ gdb-6.7.1/gdb/dwarf2read.c	2008-06-17 23:27:46.000000000 +0200
  516.20 -@@ -9061,8 +9061,7 @@
  516.21 -    callers will only want a very basic result and this can become a
  516.22 -    complaint.
  516.23 - 
  516.24 --   Note that stack[0] is unused except as a default error return.
  516.25 --   Note that stack overflow is not yet handled.  */
  516.26 -+   Note that stack[0] is unused except as a default error return. */
  516.27 - 
  516.28 - static CORE_ADDR
  516.29 - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
  516.30 -@@ -9079,7 +9078,7 @@
  516.31 - 
  516.32 -   i = 0;
  516.33 -   stacki = 0;
  516.34 --  stack[stacki] = 0;
  516.35 -+  stack[++stacki] = 0;
  516.36 - 
  516.37 -   while (i < size)
  516.38 -     {
  516.39 -@@ -9261,6 +9260,16 @@
  516.40 - 		     dwarf_stack_op_name (op));
  516.41 - 	  return (stack[stacki]);
  516.42 - 	}
  516.43 -+      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
  516.44 -+         outside of the allocated space. Also enforce minimum > 0.
  516.45 -+         -- wad@google.com 14 Aug 2006 */
  516.46 -+      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
  516.47 -+	internal_error (__FILE__, __LINE__,
  516.48 -+	                _("location description stack too deep: %d"),
  516.49 -+	                stacki);
  516.50 -+      if (stacki <= 0)
  516.51 -+	internal_error (__FILE__, __LINE__,
  516.52 -+	                _("location description stack too shallow"));
  516.53 -     }
  516.54 -   return (stack[stacki]);
  516.55 - }
   517.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   517.2 +++ b/patches/gdb/6.7/110-hppa-offsets.patch	Mon Jul 28 21:32:33 2008 +0000
   517.3 @@ -0,0 +1,272 @@
   517.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/45_all_gdb-hppa-offsets.patch
   517.5 +-= BEGIN original header =-
   517.6 +sanitized headers dont include asm/offsets.h, so cache a local copy 
   517.7 +
   517.8 +http://bugs.gentoo.org/180476
   517.9 +http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html
  517.10 +
  517.11 +-= END original header =-
  517.12 +diff -durN gdb-6.7.orig/gdb/hppa-linux-nat.c gdb-6.7/gdb/hppa-linux-nat.c
  517.13 +--- gdb-6.7.orig/gdb/hppa-linux-nat.c	2007-08-23 20:08:33.000000000 +0200
  517.14 ++++ gdb-6.7/gdb/hppa-linux-nat.c	2008-06-17 23:25:28.000000000 +0200
  517.15 +@@ -32,7 +32,7 @@
  517.16 + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43)
  517.17 + #include <asm/offset.h>
  517.18 + #else
  517.19 +-#include <asm/offsets.h>
  517.20 ++#include <hppa-offsets.h>
  517.21 + #endif
  517.22 + 
  517.23 + #include "hppa-tdep.h"
  517.24 +diff -durN gdb-6.7.orig/gdb/hppa-offsets.h gdb-6.7/gdb/hppa-offsets.h
  517.25 +--- gdb-6.7.orig/gdb/hppa-offsets.h	1970-01-01 01:00:00.000000000 +0100
  517.26 ++++ gdb-6.7/gdb/hppa-offsets.h	2008-06-17 23:25:28.000000000 +0200
  517.27 +@@ -0,0 +1,248 @@
  517.28 ++#ifndef __ASM_OFFSETS_H__
  517.29 ++#define __ASM_OFFSETS_H__
  517.30 ++/*
  517.31 ++ * DO NOT MODIFY.
  517.32 ++ *
  517.33 ++ * This file was generated by arch/parisc/Makefile
  517.34 ++ *
  517.35 ++ */
  517.36 ++
  517.37 ++#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
  517.38 ++#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
  517.39 ++#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
  517.40 ++#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */
  517.41 ++#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
  517.42 ++#define TASK_MM 108 /* offsetof(struct task_struct, mm) */
  517.43 ++#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */
  517.44 ++#define TASK_PID 140 /* offsetof(struct task_struct, pid) */
  517.45 ++
  517.46 ++#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */
  517.47 ++#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */
  517.48 ++#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */
  517.49 ++#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */
  517.50 ++#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */
  517.51 ++#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */
  517.52 ++#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */
  517.53 ++#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */
  517.54 ++#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */
  517.55 ++#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */
  517.56 ++#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */
  517.57 ++#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */
  517.58 ++#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */
  517.59 ++#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */
  517.60 ++#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */
  517.61 ++#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */
  517.62 ++#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */
  517.63 ++#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */
  517.64 ++#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */
  517.65 ++#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */
  517.66 ++#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */
  517.67 ++#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */
  517.68 ++#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */
  517.69 ++#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */
  517.70 ++#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */
  517.71 ++#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */
  517.72 ++#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */
  517.73 ++#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */
  517.74 ++#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */
  517.75 ++#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */
  517.76 ++#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */
  517.77 ++#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */
  517.78 ++#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */
  517.79 ++#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */
  517.80 ++#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */
  517.81 ++#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */
  517.82 ++#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */
  517.83 ++#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */
  517.84 ++#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */
  517.85 ++#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */
  517.86 ++#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */
  517.87 ++#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */
  517.88 ++#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */
  517.89 ++#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */
  517.90 ++#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */
  517.91 ++#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */
  517.92 ++#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */
  517.93 ++#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */
  517.94 ++#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */
  517.95 ++#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */
  517.96 ++#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */
  517.97 ++#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */
  517.98 ++#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */
  517.99 ++#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */
 517.100 ++#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */
 517.101 ++#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */
 517.102 ++#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */
 517.103 ++#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */
 517.104 ++#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */
 517.105 ++#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */
 517.106 ++#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */
 517.107 ++#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */
 517.108 ++#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */
 517.109 ++#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */
 517.110 ++#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */
 517.111 ++#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */
 517.112 ++#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */
 517.113 ++#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */
 517.114 ++#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */
 517.115 ++#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */
 517.116 ++#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */
 517.117 ++#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */
 517.118 ++#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */
 517.119 ++#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */
 517.120 ++#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */
 517.121 ++#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */
 517.122 ++#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */
 517.123 ++#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */
 517.124 ++#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */
 517.125 ++#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */
 517.126 ++#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */
 517.127 ++#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */
 517.128 ++#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */
 517.129 ++#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */
 517.130 ++#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */
 517.131 ++
 517.132 ++#define TASK_SZ 1272 /* sizeof(struct task_struct) */
 517.133 ++#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */
 517.134 ++
 517.135 ++#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */
 517.136 ++#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */
 517.137 ++#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */
 517.138 ++#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */
 517.139 ++#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */
 517.140 ++#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */
 517.141 ++#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */
 517.142 ++#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */
 517.143 ++#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */
 517.144 ++#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */
 517.145 ++#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */
 517.146 ++#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */
 517.147 ++#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */
 517.148 ++#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */
 517.149 ++#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */
 517.150 ++#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */
 517.151 ++#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */
 517.152 ++#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */
 517.153 ++#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */
 517.154 ++#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */
 517.155 ++#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */
 517.156 ++#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */
 517.157 ++#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */
 517.158 ++#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */
 517.159 ++#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */
 517.160 ++#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */
 517.161 ++#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */
 517.162 ++#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */
 517.163 ++#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */
 517.164 ++#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */
 517.165 ++#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */
 517.166 ++#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */
 517.167 ++#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */
 517.168 ++#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */
 517.169 ++#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */
 517.170 ++#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */
 517.171 ++#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */
 517.172 ++#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */
 517.173 ++#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */
 517.174 ++#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */
 517.175 ++#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */
 517.176 ++#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */
 517.177 ++#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */
 517.178 ++#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */
 517.179 ++#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */
 517.180 ++#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */
 517.181 ++#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */
 517.182 ++#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */
 517.183 ++#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */
 517.184 ++#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */
 517.185 ++#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */
 517.186 ++#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */
 517.187 ++#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */
 517.188 ++#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */
 517.189 ++#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */
 517.190 ++#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */
 517.191 ++#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */
 517.192 ++#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */
 517.193 ++#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */
 517.194 ++#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */
 517.195 ++#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */
 517.196 ++#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */
 517.197 ++#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */
 517.198 ++#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */
 517.199 ++#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */
 517.200 ++#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */
 517.201 ++#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */
 517.202 ++#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */
 517.203 ++#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */
 517.204 ++#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */
 517.205 ++#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */
 517.206 ++#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */
 517.207 ++#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */
 517.208 ++#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */
 517.209 ++#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */
 517.210 ++#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */
 517.211 ++#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */
 517.212 ++#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */
 517.213 ++#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */
 517.214 ++#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */
 517.215 ++#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */
 517.216 ++#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */
 517.217 ++#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */
 517.218 ++#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */
 517.219 ++#define PT_SIZE 472 /* sizeof(struct pt_regs) */
 517.220 ++#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */
 517.221 ++
 517.222 ++#define TI_TASK 0 /* offsetof(struct thread_info, task) */
 517.223 ++#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */
 517.224 ++#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */
 517.225 ++#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */
 517.226 ++#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */
 517.227 ++#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */
 517.228 ++#define THREAD_SZ 44 /* sizeof(struct thread_info) */
 517.229 ++#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */
 517.230 ++
 517.231 ++#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
 517.232 ++#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */
 517.233 ++
 517.234 ++#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */
 517.235 ++#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */
 517.236 ++#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */
 517.237 ++#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */
 517.238 ++#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */
 517.239 ++#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */
 517.240 ++#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */
 517.241 ++#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */
 517.242 ++#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */
 517.243 ++#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */
 517.244 ++#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */
 517.245 ++#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */
 517.246 ++#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */
 517.247 ++#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */
 517.248 ++#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */
 517.249 ++#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */
 517.250 ++#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */
 517.251 ++#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */
 517.252 ++#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */
 517.253 ++#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */
 517.254 ++#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */
 517.255 ++#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */
 517.256 ++
 517.257 ++#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */
 517.258 ++#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */
 517.259 ++
 517.260 ++#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */
 517.261 ++#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */
 517.262 ++#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */
 517.263 ++#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */
 517.264 ++#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */
 517.265 ++#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */
 517.266 ++#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */
 517.267 ++#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */
 517.268 ++#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */
 517.269 ++#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */
 517.270 ++#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */
 517.271 ++#define ASM_PT_INITIAL 4 /* PT_INITIAL */
 517.272 ++#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */
 517.273 ++
 517.274 ++
 517.275 ++#endif
   518.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   518.2 +++ b/patches/gdb/6.7/120-dwarf-stack-overflow.patch	Mon Jul 28 21:32:33 2008 +0000
   518.3 @@ -0,0 +1,52 @@
   518.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/80_all_gdb-6.5-dwarf-stack-overflow.patch
   518.5 +-= BEGIN original header =-
   518.6 +http://bugs.gentoo.org/144833
   518.7 +
   518.8 +for gdb/ChangeLog:
   518.9 +2006-08-22  Will Drewry <wad@google.com>
  518.10 +	    Tavis Ormandy <taviso@google.com>
  518.11 +
  518.12 +	* dwarf2read.c (decode_locdesc): Enforce location description stack
  518.13 +	boundaries.
  518.14 +	* dwarfread.c (locval): Likewise.
  518.15 +
  518.16 +-= END original header =-
  518.17 +diff -durN gdb-6.7.orig/gdb/dwarf2read.c gdb-6.7/gdb/dwarf2read.c
  518.18 +--- gdb-6.7.orig/gdb/dwarf2read.c	2007-09-05 02:51:48.000000000 +0200
  518.19 ++++ gdb-6.7/gdb/dwarf2read.c	2008-06-17 23:25:38.000000000 +0200
  518.20 +@@ -9061,8 +9061,7 @@
  518.21 +    callers will only want a very basic result and this can become a
  518.22 +    complaint.
  518.23 + 
  518.24 +-   Note that stack[0] is unused except as a default error return.
  518.25 +-   Note that stack overflow is not yet handled.  */
  518.26 ++   Note that stack[0] is unused except as a default error return. */
  518.27 + 
  518.28 + static CORE_ADDR
  518.29 + decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
  518.30 +@@ -9079,7 +9078,7 @@
  518.31 + 
  518.32 +   i = 0;
  518.33 +   stacki = 0;
  518.34 +-  stack[stacki] = 0;
  518.35 ++  stack[++stacki] = 0;
  518.36 + 
  518.37 +   while (i < size)
  518.38 +     {
  518.39 +@@ -9261,6 +9260,16 @@
  518.40 + 		     dwarf_stack_op_name (op));
  518.41 + 	  return (stack[stacki]);
  518.42 + 	}
  518.43 ++      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
  518.44 ++         outside of the allocated space. Also enforce minimum > 0.
  518.45 ++         -- wad@google.com 14 Aug 2006 */
  518.46 ++      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
  518.47 ++	internal_error (__FILE__, __LINE__,
  518.48 ++	                _("location description stack too deep: %d"),
  518.49 ++	                stacki);
  518.50 ++      if (stacki <= 0)
  518.51 ++	internal_error (__FILE__, __LINE__,
  518.52 ++	                _("location description stack too shallow"));
  518.53 +     }
  518.54 +   return (stack[stacki]);
  518.55 + }
   519.1 --- a/patches/gdb/6.7/125-hppa-offsets.patch	Mon Jul 28 21:08:01 2008 +0000
   519.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   519.3 @@ -1,272 +0,0 @@
   519.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/45_all_gdb-hppa-offsets.patch
   519.5 --= BEGIN original header =-
   519.6 -sanitized headers dont include asm/offsets.h, so cache a local copy 
   519.7 -
   519.8 -http://bugs.gentoo.org/180476
   519.9 -http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html
  519.10 -
  519.11 --= END original header =-
  519.12 -diff -durN gdb-6.7.orig/gdb/hppa-linux-nat.c gdb-6.7/gdb/hppa-linux-nat.c
  519.13 ---- gdb-6.7.orig/gdb/hppa-linux-nat.c	2007-08-23 20:08:33.000000000 +0200
  519.14 -+++ gdb-6.7/gdb/hppa-linux-nat.c	2008-06-17 23:25:28.000000000 +0200
  519.15 -@@ -32,7 +32,7 @@
  519.16 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43)
  519.17 - #include <asm/offset.h>
  519.18 - #else
  519.19 --#include <asm/offsets.h>
  519.20 -+#include <hppa-offsets.h>
  519.21 - #endif
  519.22 - 
  519.23 - #include "hppa-tdep.h"
  519.24 -diff -durN gdb-6.7.orig/gdb/hppa-offsets.h gdb-6.7/gdb/hppa-offsets.h
  519.25 ---- gdb-6.7.orig/gdb/hppa-offsets.h	1970-01-01 01:00:00.000000000 +0100
  519.26 -+++ gdb-6.7/gdb/hppa-offsets.h	2008-06-17 23:25:28.000000000 +0200
  519.27 -@@ -0,0 +1,248 @@
  519.28 -+#ifndef __ASM_OFFSETS_H__
  519.29 -+#define __ASM_OFFSETS_H__
  519.30 -+/*
  519.31 -+ * DO NOT MODIFY.
  519.32 -+ *
  519.33 -+ * This file was generated by arch/parisc/Makefile
  519.34 -+ *
  519.35 -+ */
  519.36 -+
  519.37 -+#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
  519.38 -+#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
  519.39 -+#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
  519.40 -+#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */
  519.41 -+#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
  519.42 -+#define TASK_MM 108 /* offsetof(struct task_struct, mm) */
  519.43 -+#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */
  519.44 -+#define TASK_PID 140 /* offsetof(struct task_struct, pid) */
  519.45 -+
  519.46 -+#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */
  519.47 -+#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */
  519.48 -+#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */
  519.49 -+#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */
  519.50 -+#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */
  519.51 -+#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */
  519.52 -+#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */
  519.53 -+#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */
  519.54 -+#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */
  519.55 -+#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */
  519.56 -+#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */
  519.57 -+#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */
  519.58 -+#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */
  519.59 -+#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */
  519.60 -+#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */
  519.61 -+#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */
  519.62 -+#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */
  519.63 -+#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */
  519.64 -+#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */
  519.65 -+#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */
  519.66 -+#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */
  519.67 -+#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */
  519.68 -+#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */
  519.69 -+#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */
  519.70 -+#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */
  519.71 -+#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */
  519.72 -+#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */
  519.73 -+#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */
  519.74 -+#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */
  519.75 -+#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */
  519.76 -+#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */
  519.77 -+#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */
  519.78 -+#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */
  519.79 -+#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */
  519.80 -+#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */
  519.81 -+#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */
  519.82 -+#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */
  519.83 -+#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */
  519.84 -+#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */
  519.85 -+#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */
  519.86 -+#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */
  519.87 -+#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */
  519.88 -+#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */
  519.89 -+#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */
  519.90 -+#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */
  519.91 -+#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */
  519.92 -+#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */
  519.93 -+#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */
  519.94 -+#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */
  519.95 -+#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */
  519.96 -+#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */
  519.97 -+#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */
  519.98 -+#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */
  519.99 -+#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */
 519.100 -+#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */
 519.101 -+#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */
 519.102 -+#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */
 519.103 -+#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */
 519.104 -+#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */
 519.105 -+#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */
 519.106 -+#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */
 519.107 -+#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */
 519.108 -+#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */
 519.109 -+#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */
 519.110 -+#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */
 519.111 -+#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */
 519.112 -+#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */
 519.113 -+#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */
 519.114 -+#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */
 519.115 -+#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */
 519.116 -+#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */
 519.117 -+#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */
 519.118 -+#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */
 519.119 -+#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */
 519.120 -+#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */
 519.121 -+#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */
 519.122 -+#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */
 519.123 -+#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */
 519.124 -+#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */
 519.125 -+#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */
 519.126 -+#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */
 519.127 -+#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */
 519.128 -+#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */
 519.129 -+#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */
 519.130 -+#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */
 519.131 -+
 519.132 -+#define TASK_SZ 1272 /* sizeof(struct task_struct) */
 519.133 -+#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */
 519.134 -+
 519.135 -+#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */
 519.136 -+#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */
 519.137 -+#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */
 519.138 -+#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */
 519.139 -+#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */
 519.140 -+#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */
 519.141 -+#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */
 519.142 -+#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */
 519.143 -+#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */
 519.144 -+#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */
 519.145 -+#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */
 519.146 -+#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */
 519.147 -+#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */
 519.148 -+#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */
 519.149 -+#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */
 519.150 -+#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */
 519.151 -+#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */
 519.152 -+#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */
 519.153 -+#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */
 519.154 -+#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */
 519.155 -+#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */
 519.156 -+#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */
 519.157 -+#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */
 519.158 -+#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */
 519.159 -+#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */
 519.160 -+#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */
 519.161 -+#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */
 519.162 -+#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */
 519.163 -+#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */
 519.164 -+#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */
 519.165 -+#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */
 519.166 -+#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */
 519.167 -+#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */
 519.168 -+#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */
 519.169 -+#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */
 519.170 -+#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */
 519.171 -+#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */
 519.172 -+#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */
 519.173 -+#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */
 519.174 -+#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */
 519.175 -+#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */
 519.176 -+#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */
 519.177 -+#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */
 519.178 -+#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */
 519.179 -+#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */
 519.180 -+#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */
 519.181 -+#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */
 519.182 -+#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */
 519.183 -+#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */
 519.184 -+#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */
 519.185 -+#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */
 519.186 -+#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */
 519.187 -+#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */
 519.188 -+#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */
 519.189 -+#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */
 519.190 -+#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */
 519.191 -+#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */
 519.192 -+#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */
 519.193 -+#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */
 519.194 -+#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */
 519.195 -+#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */
 519.196 -+#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */
 519.197 -+#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */
 519.198 -+#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */
 519.199 -+#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */
 519.200 -+#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */
 519.201 -+#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */
 519.202 -+#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */
 519.203 -+#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */
 519.204 -+#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */
 519.205 -+#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */
 519.206 -+#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */
 519.207 -+#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */
 519.208 -+#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */
 519.209 -+#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */
 519.210 -+#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */
 519.211 -+#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */
 519.212 -+#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */
 519.213 -+#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */
 519.214 -+#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */
 519.215 -+#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */
 519.216 -+#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */
 519.217 -+#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */
 519.218 -+#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */
 519.219 -+#define PT_SIZE 472 /* sizeof(struct pt_regs) */
 519.220 -+#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */
 519.221 -+
 519.222 -+#define TI_TASK 0 /* offsetof(struct thread_info, task) */
 519.223 -+#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */
 519.224 -+#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */
 519.225 -+#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */
 519.226 -+#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */
 519.227 -+#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */
 519.228 -+#define THREAD_SZ 44 /* sizeof(struct thread_info) */
 519.229 -+#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */
 519.230 -+
 519.231 -+#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
 519.232 -+#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */
 519.233 -+
 519.234 -+#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */
 519.235 -+#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */
 519.236 -+#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */
 519.237 -+#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */
 519.238 -+#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */
 519.239 -+#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */
 519.240 -+#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */
 519.241 -+#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */
 519.242 -+#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */
 519.243 -+#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */
 519.244 -+#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */
 519.245 -+#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */
 519.246 -+#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */
 519.247 -+#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */
 519.248 -+#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */
 519.249 -+#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */
 519.250 -+#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */
 519.251 -+#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */
 519.252 -+#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */
 519.253 -+#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */
 519.254 -+#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */
 519.255 -+#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */
 519.256 -+
 519.257 -+#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */
 519.258 -+#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */
 519.259 -+
 519.260 -+#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */
 519.261 -+#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */
 519.262 -+#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */
 519.263 -+#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */
 519.264 -+#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */
 519.265 -+#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */
 519.266 -+#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */
 519.267 -+#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */
 519.268 -+#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */
 519.269 -+#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */
 519.270 -+#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */
 519.271 -+#define ASM_PT_INITIAL 4 /* PT_INITIAL */
 519.272 -+#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */
 519.273 -+
 519.274 -+
 519.275 -+#endif
   520.1 --- a/patches/gdb/6.7/150-dwarf-stack-overflow.patch	Mon Jul 28 21:08:01 2008 +0000
   520.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   520.3 @@ -1,52 +0,0 @@
   520.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/80_all_gdb-6.5-dwarf-stack-overflow.patch
   520.5 --= BEGIN original header =-
   520.6 -http://bugs.gentoo.org/144833
   520.7 -
   520.8 -for gdb/ChangeLog:
   520.9 -2006-08-22  Will Drewry <wad@google.com>
  520.10 -	    Tavis Ormandy <taviso@google.com>
  520.11 -
  520.12 -	* dwarf2read.c (decode_locdesc): Enforce location description stack
  520.13 -	boundaries.
  520.14 -	* dwarfread.c (locval): Likewise.
  520.15 -
  520.16 --= END original header =-
  520.17 -diff -durN gdb-6.7.orig/gdb/dwarf2read.c gdb-6.7/gdb/dwarf2read.c
  520.18 ---- gdb-6.7.orig/gdb/dwarf2read.c	2007-09-05 02:51:48.000000000 +0200
  520.19 -+++ gdb-6.7/gdb/dwarf2read.c	2008-06-17 23:25:38.000000000 +0200
  520.20 -@@ -9061,8 +9061,7 @@
  520.21 -    callers will only want a very basic result and this can become a
  520.22 -    complaint.
  520.23 - 
  520.24 --   Note that stack[0] is unused except as a default error return.
  520.25 --   Note that stack overflow is not yet handled.  */
  520.26 -+   Note that stack[0] is unused except as a default error return. */
  520.27 - 
  520.28 - static CORE_ADDR
  520.29 - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
  520.30 -@@ -9079,7 +9078,7 @@
  520.31 - 
  520.32 -   i = 0;
  520.33 -   stacki = 0;
  520.34 --  stack[stacki] = 0;
  520.35 -+  stack[++stacki] = 0;
  520.36 - 
  520.37 -   while (i < size)
  520.38 -     {
  520.39 -@@ -9261,6 +9260,16 @@
  520.40 - 		     dwarf_stack_op_name (op));
  520.41 - 	  return (stack[stacki]);
  520.42 - 	}
  520.43 -+      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
  520.44 -+         outside of the allocated space. Also enforce minimum > 0.
  520.45 -+         -- wad@google.com 14 Aug 2006 */
  520.46 -+      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
  520.47 -+	internal_error (__FILE__, __LINE__,
  520.48 -+	                _("location description stack too deep: %d"),
  520.49 -+	                stacki);
  520.50 -+      if (stacki <= 0)
  520.51 -+	internal_error (__FILE__, __LINE__,
  520.52 -+	                _("location description stack too shallow"));
  520.53 -     }
  520.54 -   return (stack[stacki]);
  520.55 - }
   521.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   521.2 +++ b/patches/gdb/6.8/110-security-errata-20050610.patch	Mon Jul 28 21:32:33 2008 +0000
   521.3 @@ -0,0 +1,205 @@
   521.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/35_all_gdb-6.3-security-errata-20050610.patch
   521.5 +-= BEGIN original header =-
   521.6 +2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
   521.7 +
   521.8 +        * gdb.base/gdbinit.exp: New testcase.
   521.9 +        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
  521.10 +
  521.11 +2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
  521.12 +            Jeff Johnston  <jjohnstn@redhat.com>
  521.13 +
  521.14 +        * Makefile.in (cli-cmds.o): Update.
  521.15 +        * configure.in: Add check for getuid.
  521.16 +        * configure: Regenerated.
  521.17 +        * config.in: Ditto.
  521.18 +        * main.c (captured_main): Pass -1 to source_command when loading
  521.19 +        gdbinit files.
  521.20 +        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
  521.21 +        (source_command): Update documentation.  Check permissions if
  521.22 +        FROM_TTY is -1.
  521.23 +
  521.24 +-= END original header =-
  521.25 +diff -durN gdb-6.8.orig/gdb/Makefile.in gdb-6.8/gdb/Makefile.in
  521.26 +--- gdb-6.8.orig/gdb/Makefile.in	2008-03-17 13:15:08.000000000 +0100
  521.27 ++++ gdb-6.8/gdb/Makefile.in	2008-06-17 16:07:33.000000000 +0200
  521.28 +@@ -3004,7 +3004,7 @@
  521.29 + 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
  521.30 + 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
  521.31 + 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
  521.32 +-	$(tui_h)
  521.33 ++	$(tui_h) $(gdb_stat_h)
  521.34 + 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
  521.35 + cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
  521.36 + 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
  521.37 +diff -durN gdb-6.8.orig/gdb/cli/cli-cmds.c gdb-6.8/gdb/cli/cli-cmds.c
  521.38 +--- gdb-6.8.orig/gdb/cli/cli-cmds.c	2008-01-01 23:53:14.000000000 +0100
  521.39 ++++ gdb-6.8/gdb/cli/cli-cmds.c	2008-06-17 16:07:33.000000000 +0200
  521.40 +@@ -36,6 +36,7 @@
  521.41 + #include "objfiles.h"
  521.42 + #include "source.h"
  521.43 + #include "disasm.h"
  521.44 ++#include "gdb_stat.h"
  521.45 + 
  521.46 + #include "ui-out.h"
  521.47 + 
  521.48 +@@ -459,12 +460,31 @@
  521.49 + 
  521.50 +   if (fd == -1)
  521.51 +     {
  521.52 +-      if (from_tty)
  521.53 ++      if (from_tty > 0)
  521.54 + 	perror_with_name (file);
  521.55 +       else
  521.56 + 	return;
  521.57 +     }
  521.58 + 
  521.59 ++#ifdef HAVE_GETUID
  521.60 ++  if (from_tty == -1)
  521.61 ++    {
  521.62 ++      struct stat statbuf;
  521.63 ++      if (fstat (fd, &statbuf) < 0)
  521.64 ++	{
  521.65 ++	  perror_with_name (file);
  521.66 ++	  close (fd);
  521.67 ++	  return;
  521.68 ++	}
  521.69 ++      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
  521.70 ++	{
  521.71 ++          warning (_("not using untrusted file \"%s\""), file);
  521.72 ++	  close (fd);
  521.73 ++	  return;
  521.74 ++	}
  521.75 ++    }
  521.76 ++#endif
  521.77 ++
  521.78 +   stream = fdopen (fd, FOPEN_RT);
  521.79 +   script_from_file (stream, file);
  521.80 + 
  521.81 +diff -durN gdb-6.8.orig/gdb/main.c gdb-6.8/gdb/main.c
  521.82 +--- gdb-6.8.orig/gdb/main.c	2008-01-05 17:49:53.000000000 +0100
  521.83 ++++ gdb-6.8/gdb/main.c	2008-06-17 16:07:33.000000000 +0200
  521.84 +@@ -690,7 +690,7 @@
  521.85 + 
  521.86 +       if (!inhibit_gdbinit)
  521.87 + 	{
  521.88 +-	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
  521.89 ++	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
  521.90 + 	}
  521.91 + 
  521.92 +       /* Do stats; no need to do them elsewhere since we'll only
  521.93 +@@ -778,7 +778,7 @@
  521.94 +       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
  521.95 +     if (!inhibit_gdbinit)
  521.96 +       {
  521.97 +-	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
  521.98 ++	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
  521.99 +       }
 521.100 + 
 521.101 +   for (i = 0; i < ncmd; i++)
 521.102 +diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp
 521.103 +--- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
 521.104 ++++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 16:07:33.000000000 +0200
 521.105 +@@ -0,0 +1,98 @@
 521.106 ++#   Copyright 2005
 521.107 ++#   Free Software Foundation, Inc.
 521.108 ++
 521.109 ++# This program is free software; you can redistribute it and/or modify
 521.110 ++# it under the terms of the GNU General Public License as published by
 521.111 ++# the Free Software Foundation; either version 2 of the License, or
 521.112 ++# (at your option) any later version.
 521.113 ++# 
 521.114 ++# This program is distributed in the hope that it will be useful,
 521.115 ++# but WITHOUT ANY WARRANTY; without even the implied warranty of
 521.116 ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 521.117 ++# GNU General Public License for more details.
 521.118 ++# 
 521.119 ++# You should have received a copy of the GNU General Public License
 521.120 ++# along with this program; if not, write to the Free Software
 521.121 ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 521.122 ++
 521.123 ++# Please email any bugs, comments, and/or additions to this file to:
 521.124 ++# bug-gdb@prep.ai.mit.edu
 521.125 ++
 521.126 ++# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
 521.127 ++
 521.128 ++if $tracelevel then {
 521.129 ++    strace $tracelevel
 521.130 ++}
 521.131 ++
 521.132 ++set prms_id 0
 521.133 ++set bug_id 0
 521.134 ++
 521.135 ++# are we on a target board
 521.136 ++if [is_remote target] {
 521.137 ++    return
 521.138 ++}
 521.139 ++
 521.140 ++
 521.141 ++global verbose
 521.142 ++global GDB
 521.143 ++global GDBFLAGS
 521.144 ++global gdb_prompt
 521.145 ++global timeout
 521.146 ++global gdb_spawn_id;
 521.147 ++                                                                                
 521.148 ++gdb_stop_suppressing_tests;
 521.149 ++                                                                                
 521.150 ++verbose "Spawning $GDB -nw"
 521.151 ++                                                                                
 521.152 ++if [info exists gdb_spawn_id] {
 521.153 ++    return 0;
 521.154 ++}
 521.155 ++                                                                                
 521.156 ++if ![is_remote host] {
 521.157 ++   if { [which $GDB] == 0 } then {
 521.158 ++        perror "$GDB does not exist."
 521.159 ++        exit 1
 521.160 ++    }
 521.161 ++}
 521.162 ++
 521.163 ++set env(HOME) [pwd]
 521.164 ++remote_exec build "rm .gdbinit"
 521.165 ++remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
 521.166 ++remote_exec build "chmod 646 .gdbinit"
 521.167 ++
 521.168 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 521.169 ++if { $res < 0 || $res == "" } {
 521.170 ++    perror "Spawning $GDB failed."
 521.171 ++    return 1;
 521.172 ++}
 521.173 ++gdb_expect 360 {
 521.174 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 521.175 ++        pass "untrusted .gdbinit caught."
 521.176 ++    }
 521.177 ++    -re "$gdb_prompt $"     {
 521.178 ++        fail "untrusted .gdbinit caught."
 521.179 ++    }
 521.180 ++    timeout {
 521.181 ++        fail "(timeout) untrusted .gdbinit caught."
 521.182 ++    }
 521.183 ++}
 521.184 ++
 521.185 ++remote_exec build "chmod 644 .gdbinit"
 521.186 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 521.187 ++if { $res < 0 || $res == "" } {
 521.188 ++    perror "Spawning $GDB failed."
 521.189 ++    return 1;
 521.190 ++}
 521.191 ++gdb_expect 360 {
 521.192 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 521.193 ++        fail "trusted .gdbinit allowed."
 521.194 ++    }
 521.195 ++    -re "in gdbinit.*$gdb_prompt $"     {
 521.196 ++        pass "trusted .gdbinit allowed."
 521.197 ++    }
 521.198 ++    timeout {
 521.199 ++        fail "(timeout) trusted .gdbinit allowed."
 521.200 ++    }
 521.201 ++}
 521.202 ++
 521.203 ++remote_exec build "rm .gdbinit"
 521.204 +diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample
 521.205 +--- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
 521.206 ++++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 16:07:33.000000000 +0200
 521.207 +@@ -0,0 +1 @@
 521.208 ++echo "\nin gdbinit"
   522.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   522.2 +++ b/patches/gdb/6.8/120-tdep-opcode-include-workaround.patch	Mon Jul 28 21:32:33 2008 +0000
   522.3 @@ -0,0 +1,33 @@
   522.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/20_all_gdb-tdep-opcode-include-workaround.patch
   522.5 +-= BEGIN original header =-
   522.6 +workaround build failure
   522.7 +
   522.8 +http://bugs.gentoo.org/216368
   522.9 +
  522.10 +-= END original header =-
  522.11 +diff -durN gdb-6.8.orig/gdb/frv-tdep.c gdb-6.8/gdb/frv-tdep.c
  522.12 +--- gdb-6.8.orig/gdb/frv-tdep.c	2008-01-11 14:19:59.000000000 +0100
  522.13 ++++ gdb-6.8/gdb/frv-tdep.c	2008-06-17 16:07:34.000000000 +0200
  522.14 +@@ -32,7 +32,7 @@
  522.15 + #include "gdb_assert.h"
  522.16 + #include "sim-regno.h"
  522.17 + #include "gdb/sim-frv.h"
  522.18 +-#include "opcodes/frv-desc.h"	/* for the H_SPR_... enums */
  522.19 ++#include "../opcodes/frv-desc.h"	/* for the H_SPR_... enums */
  522.20 + #include "symtab.h"
  522.21 + #include "elf-bfd.h"
  522.22 + #include "elf/frv.h"
  522.23 +diff -durN gdb-6.8.orig/gdb/mep-tdep.c gdb-6.8/gdb/mep-tdep.c
  522.24 +--- gdb-6.8.orig/gdb/mep-tdep.c	2008-01-11 14:20:02.000000000 +0100
  522.25 ++++ gdb-6.8/gdb/mep-tdep.c	2008-06-17 16:07:34.000000000 +0200
  522.26 +@@ -53,8 +53,8 @@
  522.27 + 
  522.28 + /* Get the user's customized MeP coprocessor register names from
  522.29 +    libopcodes.  */
  522.30 +-#include "opcodes/mep-desc.h"
  522.31 +-#include "opcodes/mep-opc.h"
  522.32 ++#include "../opcodes/mep-desc.h"
  522.33 ++#include "../opcodes/mep-opc.h"
  522.34 + 
  522.35 + 
  522.36 + /* The gdbarch_tdep structure.  */
   523.1 --- a/patches/gdb/6.8/150-security-errata-20050610.patch	Mon Jul 28 21:08:01 2008 +0000
   523.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   523.3 @@ -1,205 +0,0 @@
   523.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/35_all_gdb-6.3-security-errata-20050610.patch
   523.5 --= BEGIN original header =-
   523.6 -2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
   523.7 -
   523.8 -        * gdb.base/gdbinit.exp: New testcase.
   523.9 -        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
  523.10 -
  523.11 -2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
  523.12 -            Jeff Johnston  <jjohnstn@redhat.com>
  523.13 -
  523.14 -        * Makefile.in (cli-cmds.o): Update.
  523.15 -        * configure.in: Add check for getuid.
  523.16 -        * configure: Regenerated.
  523.17 -        * config.in: Ditto.
  523.18 -        * main.c (captured_main): Pass -1 to source_command when loading
  523.19 -        gdbinit files.
  523.20 -        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
  523.21 -        (source_command): Update documentation.  Check permissions if
  523.22 -        FROM_TTY is -1.
  523.23 -
  523.24 --= END original header =-
  523.25 -diff -durN gdb-6.8.orig/gdb/Makefile.in gdb-6.8/gdb/Makefile.in
  523.26 ---- gdb-6.8.orig/gdb/Makefile.in	2008-03-17 13:15:08.000000000 +0100
  523.27 -+++ gdb-6.8/gdb/Makefile.in	2008-06-17 16:07:33.000000000 +0200
  523.28 -@@ -3004,7 +3004,7 @@
  523.29 - 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
  523.30 - 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
  523.31 - 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
  523.32 --	$(tui_h)
  523.33 -+	$(tui_h) $(gdb_stat_h)
  523.34 - 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
  523.35 - cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
  523.36 - 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
  523.37 -diff -durN gdb-6.8.orig/gdb/cli/cli-cmds.c gdb-6.8/gdb/cli/cli-cmds.c
  523.38 ---- gdb-6.8.orig/gdb/cli/cli-cmds.c	2008-01-01 23:53:14.000000000 +0100
  523.39 -+++ gdb-6.8/gdb/cli/cli-cmds.c	2008-06-17 16:07:33.000000000 +0200
  523.40 -@@ -36,6 +36,7 @@
  523.41 - #include "objfiles.h"
  523.42 - #include "source.h"
  523.43 - #include "disasm.h"
  523.44 -+#include "gdb_stat.h"
  523.45 - 
  523.46 - #include "ui-out.h"
  523.47 - 
  523.48 -@@ -459,12 +460,31 @@
  523.49 - 
  523.50 -   if (fd == -1)
  523.51 -     {
  523.52 --      if (from_tty)
  523.53 -+      if (from_tty > 0)
  523.54 - 	perror_with_name (file);
  523.55 -       else
  523.56 - 	return;
  523.57 -     }
  523.58 - 
  523.59 -+#ifdef HAVE_GETUID
  523.60 -+  if (from_tty == -1)
  523.61 -+    {
  523.62 -+      struct stat statbuf;
  523.63 -+      if (fstat (fd, &statbuf) < 0)
  523.64 -+	{
  523.65 -+	  perror_with_name (file);
  523.66 -+	  close (fd);
  523.67 -+	  return;
  523.68 -+	}
  523.69 -+      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
  523.70 -+	{
  523.71 -+          warning (_("not using untrusted file \"%s\""), file);
  523.72 -+	  close (fd);
  523.73 -+	  return;
  523.74 -+	}
  523.75 -+    }
  523.76 -+#endif
  523.77 -+
  523.78 -   stream = fdopen (fd, FOPEN_RT);
  523.79 -   script_from_file (stream, file);
  523.80 - 
  523.81 -diff -durN gdb-6.8.orig/gdb/main.c gdb-6.8/gdb/main.c
  523.82 ---- gdb-6.8.orig/gdb/main.c	2008-01-05 17:49:53.000000000 +0100
  523.83 -+++ gdb-6.8/gdb/main.c	2008-06-17 16:07:33.000000000 +0200
  523.84 -@@ -690,7 +690,7 @@
  523.85 - 
  523.86 -       if (!inhibit_gdbinit)
  523.87 - 	{
  523.88 --	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
  523.89 -+	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
  523.90 - 	}
  523.91 - 
  523.92 -       /* Do stats; no need to do them elsewhere since we'll only
  523.93 -@@ -778,7 +778,7 @@
  523.94 -       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
  523.95 -     if (!inhibit_gdbinit)
  523.96 -       {
  523.97 --	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
  523.98 -+	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
  523.99 -       }
 523.100 - 
 523.101 -   for (i = 0; i < ncmd; i++)
 523.102 -diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp
 523.103 ---- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
 523.104 -+++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 16:07:33.000000000 +0200
 523.105 -@@ -0,0 +1,98 @@
 523.106 -+#   Copyright 2005
 523.107 -+#   Free Software Foundation, Inc.
 523.108 -+
 523.109 -+# This program is free software; you can redistribute it and/or modify
 523.110 -+# it under the terms of the GNU General Public License as published by
 523.111 -+# the Free Software Foundation; either version 2 of the License, or
 523.112 -+# (at your option) any later version.
 523.113 -+# 
 523.114 -+# This program is distributed in the hope that it will be useful,
 523.115 -+# but WITHOUT ANY WARRANTY; without even the implied warranty of
 523.116 -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 523.117 -+# GNU General Public License for more details.
 523.118 -+# 
 523.119 -+# You should have received a copy of the GNU General Public License
 523.120 -+# along with this program; if not, write to the Free Software
 523.121 -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 523.122 -+
 523.123 -+# Please email any bugs, comments, and/or additions to this file to:
 523.124 -+# bug-gdb@prep.ai.mit.edu
 523.125 -+
 523.126 -+# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
 523.127 -+
 523.128 -+if $tracelevel then {
 523.129 -+    strace $tracelevel
 523.130 -+}
 523.131 -+
 523.132 -+set prms_id 0
 523.133 -+set bug_id 0
 523.134 -+
 523.135 -+# are we on a target board
 523.136 -+if [is_remote target] {
 523.137 -+    return
 523.138 -+}
 523.139 -+
 523.140 -+
 523.141 -+global verbose
 523.142 -+global GDB
 523.143 -+global GDBFLAGS
 523.144 -+global gdb_prompt
 523.145 -+global timeout
 523.146 -+global gdb_spawn_id;
 523.147 -+                                                                                
 523.148 -+gdb_stop_suppressing_tests;
 523.149 -+                                                                                
 523.150 -+verbose "Spawning $GDB -nw"
 523.151 -+                                                                                
 523.152 -+if [info exists gdb_spawn_id] {
 523.153 -+    return 0;
 523.154 -+}
 523.155 -+                                                                                
 523.156 -+if ![is_remote host] {
 523.157 -+   if { [which $GDB] == 0 } then {
 523.158 -+        perror "$GDB does not exist."
 523.159 -+        exit 1
 523.160 -+    }
 523.161 -+}
 523.162 -+
 523.163 -+set env(HOME) [pwd]
 523.164 -+remote_exec build "rm .gdbinit"
 523.165 -+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
 523.166 -+remote_exec build "chmod 646 .gdbinit"
 523.167 -+
 523.168 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 523.169 -+if { $res < 0 || $res == "" } {
 523.170 -+    perror "Spawning $GDB failed."
 523.171 -+    return 1;
 523.172 -+}
 523.173 -+gdb_expect 360 {
 523.174 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 523.175 -+        pass "untrusted .gdbinit caught."
 523.176 -+    }
 523.177 -+    -re "$gdb_prompt $"     {
 523.178 -+        fail "untrusted .gdbinit caught."
 523.179 -+    }
 523.180 -+    timeout {
 523.181 -+        fail "(timeout) untrusted .gdbinit caught."
 523.182 -+    }
 523.183 -+}
 523.184 -+
 523.185 -+remote_exec build "chmod 644 .gdbinit"
 523.186 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 523.187 -+if { $res < 0 || $res == "" } {
 523.188 -+    perror "Spawning $GDB failed."
 523.189 -+    return 1;
 523.190 -+}
 523.191 -+gdb_expect 360 {
 523.192 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 523.193 -+        fail "trusted .gdbinit allowed."
 523.194 -+    }
 523.195 -+    -re "in gdbinit.*$gdb_prompt $"     {
 523.196 -+        pass "trusted .gdbinit allowed."
 523.197 -+    }
 523.198 -+    timeout {
 523.199 -+        fail "(timeout) trusted .gdbinit allowed."
 523.200 -+    }
 523.201 -+}
 523.202 -+
 523.203 -+remote_exec build "rm .gdbinit"
 523.204 -diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample
 523.205 ---- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
 523.206 -+++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 16:07:33.000000000 +0200
 523.207 -@@ -0,0 +1 @@
 523.208 -+echo "\nin gdbinit"
   524.1 --- a/patches/gdb/6.8/200-tdep-opcode-include-workaround.patch	Mon Jul 28 21:08:01 2008 +0000
   524.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   524.3 @@ -1,33 +0,0 @@
   524.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/20_all_gdb-tdep-opcode-include-workaround.patch
   524.5 --= BEGIN original header =-
   524.6 -workaround build failure
   524.7 -
   524.8 -http://bugs.gentoo.org/216368
   524.9 -
  524.10 --= END original header =-
  524.11 -diff -durN gdb-6.8.orig/gdb/frv-tdep.c gdb-6.8/gdb/frv-tdep.c
  524.12 ---- gdb-6.8.orig/gdb/frv-tdep.c	2008-01-11 14:19:59.000000000 +0100
  524.13 -+++ gdb-6.8/gdb/frv-tdep.c	2008-06-17 16:07:34.000000000 +0200
  524.14 -@@ -32,7 +32,7 @@
  524.15 - #include "gdb_assert.h"
  524.16 - #include "sim-regno.h"
  524.17 - #include "gdb/sim-frv.h"
  524.18 --#include "opcodes/frv-desc.h"	/* for the H_SPR_... enums */
  524.19 -+#include "../opcodes/frv-desc.h"	/* for the H_SPR_... enums */
  524.20 - #include "symtab.h"
  524.21 - #include "elf-bfd.h"
  524.22 - #include "elf/frv.h"
  524.23 -diff -durN gdb-6.8.orig/gdb/mep-tdep.c gdb-6.8/gdb/mep-tdep.c
  524.24 ---- gdb-6.8.orig/gdb/mep-tdep.c	2008-01-11 14:20:02.000000000 +0100
  524.25 -+++ gdb-6.8/gdb/mep-tdep.c	2008-06-17 16:07:34.000000000 +0200
  524.26 -@@ -53,8 +53,8 @@
  524.27 - 
  524.28 - /* Get the user's customized MeP coprocessor register names from
  524.29 -    libopcodes.  */
  524.30 --#include "opcodes/mep-desc.h"
  524.31 --#include "opcodes/mep-opc.h"
  524.32 -+#include "../opcodes/mep-desc.h"
  524.33 -+#include "../opcodes/mep-opc.h"
  524.34 - 
  524.35 - 
  524.36 - /* The gdbarch_tdep structure.  */
   525.1 --- a/patches/glibc/2.3.6/195-use_short_for_fnstsw.patch	Mon Jul 28 21:08:01 2008 +0000
   525.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   525.3 @@ -1,18 +0,0 @@
   525.4 -Original patch from H.J. Lu, as reported there:
   525.5 -http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   525.6 -
   525.7 -fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   525.8 -The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   525.9 -
  525.10 -diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
  525.11 ---- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  525.12 -+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:56:14.000000000 +0200
  525.13 -@@ -26,7 +26,7 @@
  525.14 - int
  525.15 - fetestexcept (int excepts)
  525.16 - {
  525.17 --  int temp;
  525.18 -+  short temp;
  525.19 -   int xtemp = 0;
  525.20 - 
  525.21 -   /* Get current exceptions.  */
   526.1 --- a/patches/glibc/2.3.6/200-fix-pr631.patch	Mon Jul 28 21:08:01 2008 +0000
   526.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   526.3 @@ -1,45 +0,0 @@
   526.4 -From dank@kegel.com
   526.5 -Wed Jun 15 09:12:43 PDT 2005
   526.6 -
   526.7 -Fixes
   526.8 -
   526.9 -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  526.10 -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  526.11 -... 53 lines deleted ...
  526.12 -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  526.13 -collect2: ld returned 1 exit status
  526.14 -make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  526.15 -
  526.16 -when building glibc with --enable-static-nss.
  526.17 -
  526.18 -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  526.19 -
  526.20 ---- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  526.21 -+++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  526.22 -@@ -487,7 +487,7 @@
  526.23 - 
  526.24 - # The static libraries.
  526.25 - ifeq (yes,$(build-static))
  526.26 --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  526.27 -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  526.28 - else
  526.29 - ifeq (yes,$(build-shared))
  526.30 - # We can try to link the programs with lib*_pic.a...
  526.31 ---- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  526.32 -+++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  526.33 -@@ -115,6 +115,13 @@
  526.34 - install-bin-script = ldd
  526.35 - endif
  526.36 - 
  526.37 -+ifeq (yes,$(build-static-nss))
  526.38 -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  526.39 -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  526.40 -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  526.41 -+	     $(resolvobjdir)/libresolv.a
  526.42 -+endif
  526.43 -+
  526.44 - others		= sprof sln
  526.45 - install-bin	= sprof
  526.46 - others-static   = sln
  526.47 -
  526.48 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   527.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   527.2 +++ b/patches/glibc/2.3.6/200-use_short_for_fnstsw.patch	Mon Jul 28 21:32:33 2008 +0000
   527.3 @@ -0,0 +1,18 @@
   527.4 +Original patch from H.J. Lu, as reported there:
   527.5 +http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   527.6 +
   527.7 +fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   527.8 +The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   527.9 +
  527.10 +diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
  527.11 +--- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  527.12 ++++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:56:14.000000000 +0200
  527.13 +@@ -26,7 +26,7 @@
  527.14 + int
  527.15 + fetestexcept (int excepts)
  527.16 + {
  527.17 +-  int temp;
  527.18 ++  short temp;
  527.19 +   int xtemp = 0;
  527.20 + 
  527.21 +   /* Get current exceptions.  */
   528.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   528.2 +++ b/patches/glibc/2.3.6/210-fix-pr631.patch	Mon Jul 28 21:32:33 2008 +0000
   528.3 @@ -0,0 +1,45 @@
   528.4 +From dank@kegel.com
   528.5 +Wed Jun 15 09:12:43 PDT 2005
   528.6 +
   528.7 +Fixes
   528.8 +
   528.9 +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  528.10 +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  528.11 +... 53 lines deleted ...
  528.12 +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  528.13 +collect2: ld returned 1 exit status
  528.14 +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  528.15 +
  528.16 +when building glibc with --enable-static-nss.
  528.17 +
  528.18 +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  528.19 +
  528.20 +--- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  528.21 ++++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  528.22 +@@ -487,7 +487,7 @@
  528.23 + 
  528.24 + # The static libraries.
  528.25 + ifeq (yes,$(build-static))
  528.26 +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  528.27 ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  528.28 + else
  528.29 + ifeq (yes,$(build-shared))
  528.30 + # We can try to link the programs with lib*_pic.a...
  528.31 +--- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  528.32 ++++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  528.33 +@@ -115,6 +115,13 @@
  528.34 + install-bin-script = ldd
  528.35 + endif
  528.36 + 
  528.37 ++ifeq (yes,$(build-static-nss))
  528.38 ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  528.39 ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  528.40 ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  528.41 ++	     $(resolvobjdir)/libresolv.a
  528.42 ++endif
  528.43 ++
  528.44 + others		= sprof sln
  528.45 + install-bin	= sprof
  528.46 + others-static   = sln
  528.47 +
  528.48 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   529.1 --- a/patches/glibc/2.3.6/210-fp-byteorder.patch	Mon Jul 28 21:08:01 2008 +0000
   529.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   529.3 @@ -1,205 +0,0 @@
   529.4 -Taken from http://sources.redhat.com/ml/crossgcc/2004-02/msg00104.html
   529.5 -Author: addsub@eyou.com
   529.6 -Target: ARM
   529.7 -
   529.8 -Fixes http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/920501-8.c
   529.9 -and makes printf("%f", 1.0) work.
  529.10 -
  529.11 -Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00115.html :
  529.12 - It ... fixes the 'printf("%f\n", 0.5); prints 0.000000' and general 'floating point
  529.13 - is broken' on my big-endian hardfloat FPA ARM platform. ...
  529.14 - It's definitely needed for hardfloat.  So I'd think it's needed for
  529.15 - big-endian systems in any case, and for VFP on little-endian systems
  529.16 - too.  Someone would have to verify that though.
  529.17 -
  529.18 -Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00123.html
  529.19 - I just had a look at glibc-20040830, and [this patch] is still needed and useful
  529.20 - for this version.  glibc-20040830 out-of-the-box still contains the
  529.21 - following wrong assumptions:
  529.22 - - sysdeps/arm/bits/endian.h: float word order is big endian (which it is
  529.23 -   not on vfp systems)
  529.24 - - sysdeps/arm/gmp-mparam.h: IEEE doubles are mixed endian (which they
  529.25 -   are not on big endian systems, neither on vfp systems)
  529.26 - - sysdeps/arm/ieee754.h: IEEE doubles are in little endian byte order
  529.27 -   (which they are not on big endian systems)
  529.28 - [This patch] seems the right solution for all of these issues.
  529.29 -
  529.30 -Dimitry Andric wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00132.html :
  529.31 - It's even needed for glibc CVS, AFAICS.
  529.32 - The patch hunk which modifies glibc.new/sysdeps/arm/bits/endian.h
  529.33 - (currently at version 1.4) is only needed for proper VFP operation.
  529.34 - But the hunk which modifies sysdeps/arm/gmp-mparam.h, and the hunk
  529.35 - that deletes sysdeps/arm/ieee754.h (yes, this IS correct), are needed
  529.36 - for proper operation of *any* FP model on big endian ARM.
  529.37 -
  529.38 -See also discussion in followups to
  529.39 -http://sources.redhat.com/ml/crossgcc/2004-05/msg00245.html)
  529.40 -
  529.41 -Message-ID: <276985760.37584@eyou.com>
  529.42 -Received: from unknown (HELO eyou.com) (172.16.2.2)
  529.43 - by 0.0.0.0 with SMTP; Tue, 17 Feb 2004 10:42:40 +0800
  529.44 -Received: (qmail 8238 invoked by uid 65534); 17 Feb 2004 10:42:38 +0800
  529.45 -Date: 17 Feb 2004 10:42:38 +0800
  529.46 -Message-ID: <20040217104238.8237.qmail@eyou.com>
  529.47 -From: "add" <addsub@eyou.com>
  529.48 -To: dank@kegel.com
  529.49 -Reply-To: "add" <addsub@eyou.com>
  529.50 -Subject: Re:&nbsp;&nbsp;&nbsp;problem&nbsp;while&nbsp;building&nbsp;arm&nbsp;vfp&nbsp;softfloat&nbsp;gcc&nbsp;`
  529.51 -
  529.52 -Hi, Dan, This is a patch I applied to my glibc-2.3.2, then my softfloat
  529.53 -toolchain can printf("%f\n",1.0). So you may have a try of this
  529.54 -
  529.55 -
  529.56 -diff -uNrp glibc.old/sysdeps/arm/bits/endian.h glibc.new/sysdeps/arm/bits/endian.h
  529.57 ---- glibc.old/sysdeps/arm/bits/endian.h	1999-04-12 11:59:13.000000000 -0400
  529.58 -+++ glibc.new/sysdeps/arm/bits/endian.h	2004-02-12 09:15:13.000000000 -0500
  529.59 -@@ -9,4 +9,9 @@
  529.60 - #else
  529.61 - #define __BYTE_ORDER __LITTLE_ENDIAN
  529.62 - #endif
  529.63 -+
  529.64 -+#ifdef __VFP_FP__
  529.65 -+#define __FLOAT_WORD_ORDER __BYTE_ORDER
  529.66 -+#else
  529.67 - #define __FLOAT_WORD_ORDER __BIG_ENDIAN
  529.68 -+#endif
  529.69 -diff -uNrp glibc.old/sysdeps/arm/gmp-mparam.h glibc.new/sysdeps/arm/gmp-mparam.h
  529.70 ---- glibc.old/sysdeps/arm/gmp-mparam.h	2001-07-07 15:21:19.000000000 -0400
  529.71 -+++ glibc.new/sysdeps/arm/gmp-mparam.h	2004-02-12 09:15:13.000000000 -0500
  529.72 -@@ -26,5 +26,13 @@ MA 02111-1307, USA. */
  529.73 - #define BITS_PER_SHORTINT 16
  529.74 - #define BITS_PER_CHAR 8
  529.75 - 
  529.76 --#define IEEE_DOUBLE_BIG_ENDIAN 0
  529.77 --#define IEEE_DOUBLE_MIXED_ENDIAN 1
  529.78 -+#if defined(__ARMEB__)
  529.79 -+# define IEEE_DOUBLE_MIXED_ENDIAN 0
  529.80 -+# define IEEE_DOUBLE_BIG_ENDIAN 1
  529.81 -+#elif defined(__VFP_FP__)
  529.82 -+# define IEEE_DOUBLE_MIXED_ENDIAN 0
  529.83 -+# define IEEE_DOUBLE_BIG_ENDIAN 0
  529.84 -+#else
  529.85 -+# define IEEE_DOUBLE_BIG_ENDIAN 0
  529.86 -+# define IEEE_DOUBLE_MIXED_ENDIAN 1
  529.87 -+#endif
  529.88 -diff -uNrp glibc.old/sysdeps/arm/ieee754.h glibc.new/sysdeps/arm/ieee754.h
  529.89 ---- glibc.old/sysdeps/arm/ieee754.h	2001-07-07 15:21:19.000000000 -0400
  529.90 -+++ glibc.new/sysdeps/arm/ieee754.h	1969-12-31 19:00:00.000000000 -0500
  529.91 -@@ -1,115 +0,0 @@
  529.92 --/* Copyright (C) 1992, 1995, 1996, 1998 Free Software Foundation, Inc.
  529.93 --   This file is part of the GNU C Library.
  529.94 --
  529.95 --   The GNU C Library is free software; you can redistribute it and/or
  529.96 --   modify it under the terms of the GNU Lesser General Public
  529.97 --   License as published by the Free Software Foundation; either
  529.98 --   version 2.1 of the License, or (at your option) any later version.
  529.99 --
 529.100 --   The GNU C Library is distributed in the hope that it will be useful,
 529.101 --   but WITHOUT ANY WARRANTY; without even the implied warranty of
 529.102 --   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 529.103 --   Lesser General Public License for more details.
 529.104 --
 529.105 --   You should have received a copy of the GNU Lesser General Public
 529.106 --   License along with the GNU C Library; if not, write to the Free
 529.107 --   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 529.108 --   02111-1307 USA.  */
 529.109 --
 529.110 --#ifndef _IEEE754_H
 529.111 --
 529.112 --#define _IEEE754_H 1
 529.113 --#include <features.h>
 529.114 --
 529.115 --#include <endian.h>
 529.116 --
 529.117 --__BEGIN_DECLS
 529.118 --
 529.119 --union ieee754_float
 529.120 --  {
 529.121 --    float f;
 529.122 --
 529.123 --    /* This is the IEEE 754 single-precision format.  */
 529.124 --    struct
 529.125 --      {
 529.126 --	unsigned int mantissa:23;
 529.127 --	unsigned int exponent:8;
 529.128 --	unsigned int negative:1;
 529.129 --      } ieee;
 529.130 --
 529.131 --    /* This format makes it easier to see if a NaN is a signalling NaN.  */
 529.132 --    struct
 529.133 --      {
 529.134 --	unsigned int mantissa:22;
 529.135 --	unsigned int quiet_nan:1;
 529.136 --	unsigned int exponent:8;
 529.137 --	unsigned int negative:1;
 529.138 --      } ieee_nan;
 529.139 --  };
 529.140 --
 529.141 --#define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent.  */
 529.142 --
 529.143 --
 529.144 --union ieee754_double
 529.145 --  {
 529.146 --    double d;
 529.147 --
 529.148 --    /* This is the IEEE 754 double-precision format.  */
 529.149 --    struct
 529.150 --      {
 529.151 --	unsigned int mantissa0:20;
 529.152 --	unsigned int exponent:11;
 529.153 --	unsigned int negative:1;
 529.154 --	unsigned int mantissa1:32;
 529.155 --      } ieee;
 529.156 --
 529.157 --    /* This format makes it easier to see if a NaN is a signalling NaN.  */
 529.158 --    struct
 529.159 --      {
 529.160 --	unsigned int mantissa0:19;
 529.161 --	unsigned int quiet_nan:1;
 529.162 --	unsigned int exponent:11;
 529.163 --	unsigned int negative:1;
 529.164 --	unsigned int mantissa1:32;
 529.165 --      } ieee_nan;
 529.166 --  };
 529.167 --
 529.168 --#define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent.  */
 529.169 --
 529.170 --
 529.171 --/* The following two structures are correct for `new' floating point systems but
 529.172 --   wrong for the old FPPC.  The only solution seems to be to avoid their use on
 529.173 --   old hardware.  */
 529.174 --
 529.175 --union ieee854_long_double
 529.176 --  {
 529.177 --    long double d;
 529.178 --
 529.179 --    /* This is the IEEE 854 double-extended-precision format.  */
 529.180 --    struct
 529.181 --      {
 529.182 --	unsigned int exponent:15;
 529.183 --	unsigned int empty:16;
 529.184 --	unsigned int negative:1;
 529.185 --	unsigned int mantissa1:32;
 529.186 --	unsigned int mantissa0:32;
 529.187 --      } ieee;
 529.188 --
 529.189 --    /* This is for NaNs in the IEEE 854 double-extended-precision format.  */
 529.190 --    struct
 529.191 --      {
 529.192 --	unsigned int exponent:15;
 529.193 --	unsigned int empty:16;
 529.194 --	unsigned int negative:1;
 529.195 --	unsigned int mantissa1:32;
 529.196 --	unsigned int mantissa0:30;
 529.197 --	unsigned int quiet_nan:1;
 529.198 --	unsigned int one:1;
 529.199 --      } ieee_nan;
 529.200 --  };
 529.201 --
 529.202 --#define IEEE854_LONG_DOUBLE_BIAS 0x3fff
 529.203 --
 529.204 --__END_DECLS
 529.205 --
 529.206 --#endif /* ieee754.h */
 529.207 -
 529.208 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   530.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   530.2 +++ b/patches/glibc/2.3.6/220-fp-byteorder.patch	Mon Jul 28 21:32:33 2008 +0000
   530.3 @@ -0,0 +1,205 @@
   530.4 +Taken from http://sources.redhat.com/ml/crossgcc/2004-02/msg00104.html
   530.5 +Author: addsub@eyou.com
   530.6 +Target: ARM
   530.7 +
   530.8 +Fixes http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/920501-8.c
   530.9 +and makes printf("%f", 1.0) work.
  530.10 +
  530.11 +Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00115.html :
  530.12 + It ... fixes the 'printf("%f\n", 0.5); prints 0.000000' and general 'floating point
  530.13 + is broken' on my big-endian hardfloat FPA ARM platform. ...
  530.14 + It's definitely needed for hardfloat.  So I'd think it's needed for
  530.15 + big-endian systems in any case, and for VFP on little-endian systems
  530.16 + too.  Someone would have to verify that though.
  530.17 +
  530.18 +Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00123.html
  530.19 + I just had a look at glibc-20040830, and [this patch] is still needed and useful
  530.20 + for this version.  glibc-20040830 out-of-the-box still contains the
  530.21 + following wrong assumptions:
  530.22 + - sysdeps/arm/bits/endian.h: float word order is big endian (which it is
  530.23 +   not on vfp systems)
  530.24 + - sysdeps/arm/gmp-mparam.h: IEEE doubles are mixed endian (which they
  530.25 +   are not on big endian systems, neither on vfp systems)
  530.26 + - sysdeps/arm/ieee754.h: IEEE doubles are in little endian byte order
  530.27 +   (which they are not on big endian systems)
  530.28 + [This patch] seems the right solution for all of these issues.
  530.29 +
  530.30 +Dimitry Andric wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00132.html :
  530.31 + It's even needed for glibc CVS, AFAICS.
  530.32 + The patch hunk which modifies glibc.new/sysdeps/arm/bits/endian.h
  530.33 + (currently at version 1.4) is only needed for proper VFP operation.
  530.34 + But the hunk which modifies sysdeps/arm/gmp-mparam.h, and the hunk
  530.35 + that deletes sysdeps/arm/ieee754.h (yes, this IS correct), are needed
  530.36 + for proper operation of *any* FP model on big endian ARM.
  530.37 +
  530.38 +See also discussion in followups to
  530.39 +http://sources.redhat.com/ml/crossgcc/2004-05/msg00245.html)
  530.40 +
  530.41 +Message-ID: <276985760.37584@eyou.com>
  530.42 +Received: from unknown (HELO eyou.com) (172.16.2.2)
  530.43 + by 0.0.0.0 with SMTP; Tue, 17 Feb 2004 10:42:40 +0800
  530.44 +Received: (qmail 8238 invoked by uid 65534); 17 Feb 2004 10:42:38 +0800
  530.45 +Date: 17 Feb 2004 10:42:38 +0800
  530.46 +Message-ID: <20040217104238.8237.qmail@eyou.com>
  530.47 +From: "add" <addsub@eyou.com>
  530.48 +To: dank@kegel.com
  530.49 +Reply-To: "add" <addsub@eyou.com>
  530.50 +Subject: Re:&nbsp;&nbsp;&nbsp;problem&nbsp;while&nbsp;building&nbsp;arm&nbsp;vfp&nbsp;softfloat&nbsp;gcc&nbsp;`
  530.51 +
  530.52 +Hi, Dan, This is a patch I applied to my glibc-2.3.2, then my softfloat
  530.53 +toolchain can printf("%f\n",1.0). So you may have a try of this
  530.54 +
  530.55 +
  530.56 +diff -uNrp glibc.old/sysdeps/arm/bits/endian.h glibc.new/sysdeps/arm/bits/endian.h
  530.57 +--- glibc.old/sysdeps/arm/bits/endian.h	1999-04-12 11:59:13.000000000 -0400
  530.58 ++++ glibc.new/sysdeps/arm/bits/endian.h	2004-02-12 09:15:13.000000000 -0500
  530.59 +@@ -9,4 +9,9 @@
  530.60 + #else
  530.61 + #define __BYTE_ORDER __LITTLE_ENDIAN
  530.62 + #endif
  530.63 ++
  530.64 ++#ifdef __VFP_FP__
  530.65 ++#define __FLOAT_WORD_ORDER __BYTE_ORDER
  530.66 ++#else
  530.67 + #define __FLOAT_WORD_ORDER __BIG_ENDIAN
  530.68 ++#endif
  530.69 +diff -uNrp glibc.old/sysdeps/arm/gmp-mparam.h glibc.new/sysdeps/arm/gmp-mparam.h
  530.70 +--- glibc.old/sysdeps/arm/gmp-mparam.h	2001-07-07 15:21:19.000000000 -0400
  530.71 ++++ glibc.new/sysdeps/arm/gmp-mparam.h	2004-02-12 09:15:13.000000000 -0500
  530.72 +@@ -26,5 +26,13 @@ MA 02111-1307, USA. */
  530.73 + #define BITS_PER_SHORTINT 16
  530.74 + #define BITS_PER_CHAR 8
  530.75 + 
  530.76 +-#define IEEE_DOUBLE_BIG_ENDIAN 0
  530.77 +-#define IEEE_DOUBLE_MIXED_ENDIAN 1
  530.78 ++#if defined(__ARMEB__)
  530.79 ++# define IEEE_DOUBLE_MIXED_ENDIAN 0
  530.80 ++# define IEEE_DOUBLE_BIG_ENDIAN 1
  530.81 ++#elif defined(__VFP_FP__)
  530.82 ++# define IEEE_DOUBLE_MIXED_ENDIAN 0
  530.83 ++# define IEEE_DOUBLE_BIG_ENDIAN 0
  530.84 ++#else
  530.85 ++# define IEEE_DOUBLE_BIG_ENDIAN 0
  530.86 ++# define IEEE_DOUBLE_MIXED_ENDIAN 1
  530.87 ++#endif
  530.88 +diff -uNrp glibc.old/sysdeps/arm/ieee754.h glibc.new/sysdeps/arm/ieee754.h
  530.89 +--- glibc.old/sysdeps/arm/ieee754.h	2001-07-07 15:21:19.000000000 -0400
  530.90 ++++ glibc.new/sysdeps/arm/ieee754.h	1969-12-31 19:00:00.000000000 -0500
  530.91 +@@ -1,115 +0,0 @@
  530.92 +-/* Copyright (C) 1992, 1995, 1996, 1998 Free Software Foundation, Inc.
  530.93 +-   This file is part of the GNU C Library.
  530.94 +-
  530.95 +-   The GNU C Library is free software; you can redistribute it and/or
  530.96 +-   modify it under the terms of the GNU Lesser General Public
  530.97 +-   License as published by the Free Software Foundation; either
  530.98 +-   version 2.1 of the License, or (at your option) any later version.
  530.99 +-
 530.100 +-   The GNU C Library is distributed in the hope that it will be useful,
 530.101 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
 530.102 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 530.103 +-   Lesser General Public License for more details.
 530.104 +-
 530.105 +-   You should have received a copy of the GNU Lesser General Public
 530.106 +-   License along with the GNU C Library; if not, write to the Free
 530.107 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 530.108 +-   02111-1307 USA.  */
 530.109 +-
 530.110 +-#ifndef _IEEE754_H
 530.111 +-
 530.112 +-#define _IEEE754_H 1
 530.113 +-#include <features.h>
 530.114 +-
 530.115 +-#include <endian.h>
 530.116 +-
 530.117 +-__BEGIN_DECLS
 530.118 +-
 530.119 +-union ieee754_float
 530.120 +-  {
 530.121 +-    float f;
 530.122 +-
 530.123 +-    /* This is the IEEE 754 single-precision format.  */
 530.124 +-    struct
 530.125 +-      {
 530.126 +-	unsigned int mantissa:23;
 530.127 +-	unsigned int exponent:8;
 530.128 +-	unsigned int negative:1;
 530.129 +-      } ieee;
 530.130 +-
 530.131 +-    /* This format makes it easier to see if a NaN is a signalling NaN.  */
 530.132 +-    struct
 530.133 +-      {
 530.134 +-	unsigned int mantissa:22;
 530.135 +-	unsigned int quiet_nan:1;
 530.136 +-	unsigned int exponent:8;
 530.137 +-	unsigned int negative:1;
 530.138 +-      } ieee_nan;
 530.139 +-  };
 530.140 +-
 530.141 +-#define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent.  */
 530.142 +-
 530.143 +-
 530.144 +-union ieee754_double
 530.145 +-  {
 530.146 +-    double d;
 530.147 +-
 530.148 +-    /* This is the IEEE 754 double-precision format.  */
 530.149 +-    struct
 530.150 +-      {
 530.151 +-	unsigned int mantissa0:20;
 530.152 +-	unsigned int exponent:11;
 530.153 +-	unsigned int negative:1;
 530.154 +-	unsigned int mantissa1:32;
 530.155 +-      } ieee;
 530.156 +-
 530.157 +-    /* This format makes it easier to see if a NaN is a signalling NaN.  */
 530.158 +-    struct
 530.159 +-      {
 530.160 +-	unsigned int mantissa0:19;
 530.161 +-	unsigned int quiet_nan:1;
 530.162 +-	unsigned int exponent:11;
 530.163 +-	unsigned int negative:1;
 530.164 +-	unsigned int mantissa1:32;
 530.165 +-      } ieee_nan;
 530.166 +-  };
 530.167 +-
 530.168 +-#define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent.  */
 530.169 +-
 530.170 +-
 530.171 +-/* The following two structures are correct for `new' floating point systems but
 530.172 +-   wrong for the old FPPC.  The only solution seems to be to avoid their use on
 530.173 +-   old hardware.  */
 530.174 +-
 530.175 +-union ieee854_long_double
 530.176 +-  {
 530.177 +-    long double d;
 530.178 +-
 530.179 +-    /* This is the IEEE 854 double-extended-precision format.  */
 530.180 +-    struct
 530.181 +-      {
 530.182 +-	unsigned int exponent:15;
 530.183 +-	unsigned int empty:16;
 530.184 +-	unsigned int negative:1;
 530.185 +-	unsigned int mantissa1:32;
 530.186 +-	unsigned int mantissa0:32;
 530.187 +-      } ieee;
 530.188 +-
 530.189 +-    /* This is for NaNs in the IEEE 854 double-extended-precision format.  */
 530.190 +-    struct
 530.191 +-      {
 530.192 +-	unsigned int exponent:15;
 530.193 +-	unsigned int empty:16;
 530.194 +-	unsigned int negative:1;
 530.195 +-	unsigned int mantissa1:32;
 530.196 +-	unsigned int mantissa0:30;
 530.197 +-	unsigned int quiet_nan:1;
 530.198 +-	unsigned int one:1;
 530.199 +-      } ieee_nan;
 530.200 +-  };
 530.201 +-
 530.202 +-#define IEEE854_LONG_DOUBLE_BIAS 0x3fff
 530.203 +-
 530.204 +-__END_DECLS
 530.205 +-
 530.206 +-#endif /* ieee754.h */
 530.207 +
 530.208 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   531.1 --- a/patches/glibc/2.3.6/220-mips-bootstrap-gcc-header-install.patch	Mon Jul 28 21:08:01 2008 +0000
   531.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   531.3 @@ -1,37 +0,0 @@
   531.4 -http://sourceware.org/ml/crossgcc/2005-05/msg00165.html
   531.5 -Fixes a MIPS build problem (unrelated to NPTL)
   531.6 -
   531.7 -Message-ID: <428E8B24.1000201@realitydiluted.com>
   531.8 -Date: Fri, 20 May 2005 20:13:08 -0500
   531.9 -From: "Steven J dot  Hill" <sjhill at realitydiluted dot com>
  531.10 -To:  crossgcc at sources dot redhat dot com,  toolchain at gentoo dot org, 
  531.11 - Shay_Gal-On at pmc-sierra dot com,  TheNop at gmx dot net
  531.12 -Subject: New NPTL patches for crosstools and MIPS NPTL patches....
  531.13 -
  531.14 -Greetings.
  531.15 -
  531.16 -I have uploaded the latest NPTL patch for crosstool-0.34. I have also
  531.17 -uploaded a tarball of the patches necessary to build a MIPS NPTL
  531.18 -cross toolchain. To build a MIPS NPTL toolchain you will need the
  531.19 -released version of binutils-2.16 and the absolute latest GCC and
  531.20 -glibc code from the HEAD of cvs. Use the 'demo-mips-nptl.sh' script
  531.21 -to build the toolchain. Please report bugs or issues to the crossgcc
  531.22 -mailing list. Here is the link off of my FTP site:
  531.23 -
  531.24 -    ftp://ftp.realitydiluted.com/crosstools/crosstool-0.34/
  531.25 -
  531.26 -[Note: BOOTSTRAP_GCC is set by crosstool.sh when invoking make install-headers]
  531.27 -
  531.28 -diff -ur glibc-2.4.0-20050406/sysdeps/mips/mips32/Makefile glibc-2.4.0-20050406-patched/sysdeps/mips/mips32/Makefile
  531.29 ---- glibc-2.4.0-20050406/sysdeps/mips/mips32/Makefile	2003-03-29 02:15:28.000000000 -0600
  531.30 -+++ glibc-2.4.0-20050406-patched/sysdeps/mips/mips32/Makefile	2005-04-12 21:36:51.318837655 -0500
  531.31 -@@ -1,3 +1,7 @@
  531.32 -+ifeq ($(filter -DBOOTSTRAP_GCC,$(CFLAGS)),)
  531.33 - ifeq ($(filter -mabi=32,$(CC)),)
  531.34 - CC += -mabi=32
  531.35 - endif
  531.36 -+else
  531.37 -+CC += -D"_MIPS_SZPTR=32"
  531.38 -+endif
  531.39 -
  531.40 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   532.1 --- a/patches/glibc/2.3.6/230-make-install-lib-all.patch	Mon Jul 28 21:08:01 2008 +0000
   532.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   532.3 @@ -1,26 +0,0 @@
   532.4 -From http://svn.exactcode.de/t2/trunk/package/base/glibc32/make-install-lib-all.patch
   532.5 -Rule to install all needed libraries, not just the ones installed by install-lib,
   532.6 -yet not install programs.  
   532.7 -Needed because we can't use the main install target, as we can't build programs before
   532.8 -we have the final gcc installed; linking fails because libeh.a is not present,
   532.9 -and glibc insists on linking programs with that library.
  532.10 -
  532.11 -diff -Naur glibc-2.3.4.orig/Makerules glibc-2.3.4/Makerules
  532.12 ---- glibc-2.3.4.orig/Makerules	2004-12-15 20:52:39.000000000 +0200
  532.13 -+++ glibc-2.3.4/Makerules	2005-02-19 15:16:31.415125176 +0200
  532.14 -@@ -844,6 +844,13 @@
  532.15 - installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
  532.16 - 			     $(inst_libdir)/$(patsubst %,$(libtype$o),\
  532.17 - 						     $(libprefix)$(libc-name)))
  532.18 -+
  532.19 -+install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \
  532.20 -+		$(inst_slibdir)/libc-$(version).so \
  532.21 -+		$(inst_libdir)/libc.so \
  532.22 -+		$(inst_libdir)/libc.a \
  532.23 -+		install-lib
  532.24 -+
  532.25 - install: $(installed-libcs)
  532.26 - $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
  532.27 - 	$(make-target-directory)
  532.28 -
  532.29 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   533.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   533.2 +++ b/patches/glibc/2.3.6/230-mips-bootstrap-gcc-header-install.patch	Mon Jul 28 21:32:33 2008 +0000
   533.3 @@ -0,0 +1,37 @@
   533.4 +http://sourceware.org/ml/crossgcc/2005-05/msg00165.html
   533.5 +Fixes a MIPS build problem (unrelated to NPTL)
   533.6 +
   533.7 +Message-ID: <428E8B24.1000201@realitydiluted.com>
   533.8 +Date: Fri, 20 May 2005 20:13:08 -0500
   533.9 +From: "Steven J dot  Hill" <sjhill at realitydiluted dot com>
  533.10 +To:  crossgcc at sources dot redhat dot com,  toolchain at gentoo dot org, 
  533.11 + Shay_Gal-On at pmc-sierra dot com,  TheNop at gmx dot net
  533.12 +Subject: New NPTL patches for crosstools and MIPS NPTL patches....
  533.13 +
  533.14 +Greetings.
  533.15 +
  533.16 +I have uploaded the latest NPTL patch for crosstool-0.34. I have also
  533.17 +uploaded a tarball of the patches necessary to build a MIPS NPTL
  533.18 +cross toolchain. To build a MIPS NPTL toolchain you will need the
  533.19 +released version of binutils-2.16 and the absolute latest GCC and
  533.20 +glibc code from the HEAD of cvs. Use the 'demo-mips-nptl.sh' script
  533.21 +to build the toolchain. Please report bugs or issues to the crossgcc
  533.22 +mailing list. Here is the link off of my FTP site:
  533.23 +
  533.24 +    ftp://ftp.realitydiluted.com/crosstools/crosstool-0.34/
  533.25 +
  533.26 +[Note: BOOTSTRAP_GCC is set by crosstool.sh when invoking make install-headers]
  533.27 +
  533.28 +diff -ur glibc-2.4.0-20050406/sysdeps/mips/mips32/Makefile glibc-2.4.0-20050406-patched/sysdeps/mips/mips32/Makefile
  533.29 +--- glibc-2.4.0-20050406/sysdeps/mips/mips32/Makefile	2003-03-29 02:15:28.000000000 -0600
  533.30 ++++ glibc-2.4.0-20050406-patched/sysdeps/mips/mips32/Makefile	2005-04-12 21:36:51.318837655 -0500
  533.31 +@@ -1,3 +1,7 @@
  533.32 ++ifeq ($(filter -DBOOTSTRAP_GCC,$(CFLAGS)),)
  533.33 + ifeq ($(filter -mabi=32,$(CC)),)
  533.34 + CC += -mabi=32
  533.35 + endif
  533.36 ++else
  533.37 ++CC += -D"_MIPS_SZPTR=32"
  533.38 ++endif
  533.39 +
  533.40 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   534.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   534.2 +++ b/patches/glibc/2.3.6/240-make-install-lib-all.patch	Mon Jul 28 21:32:33 2008 +0000
   534.3 @@ -0,0 +1,26 @@
   534.4 +From http://svn.exactcode.de/t2/trunk/package/base/glibc32/make-install-lib-all.patch
   534.5 +Rule to install all needed libraries, not just the ones installed by install-lib,
   534.6 +yet not install programs.  
   534.7 +Needed because we can't use the main install target, as we can't build programs before
   534.8 +we have the final gcc installed; linking fails because libeh.a is not present,
   534.9 +and glibc insists on linking programs with that library.
  534.10 +
  534.11 +diff -Naur glibc-2.3.4.orig/Makerules glibc-2.3.4/Makerules
  534.12 +--- glibc-2.3.4.orig/Makerules	2004-12-15 20:52:39.000000000 +0200
  534.13 ++++ glibc-2.3.4/Makerules	2005-02-19 15:16:31.415125176 +0200
  534.14 +@@ -844,6 +844,13 @@
  534.15 + installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
  534.16 + 			     $(inst_libdir)/$(patsubst %,$(libtype$o),\
  534.17 + 						     $(libprefix)$(libc-name)))
  534.18 ++
  534.19 ++install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \
  534.20 ++		$(inst_slibdir)/libc-$(version).so \
  534.21 ++		$(inst_libdir)/libc.so \
  534.22 ++		$(inst_libdir)/libc.a \
  534.23 ++		install-lib
  534.24 ++
  534.25 + install: $(installed-libcs)
  534.26 + $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
  534.27 + 	$(make-target-directory)
  534.28 +
  534.29 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   535.1 --- a/patches/glibc/2.3.6/240-weakalias.patch	Mon Jul 28 21:08:01 2008 +0000
   535.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   535.3 @@ -1,45 +0,0 @@
   535.4 -This one was taken from debian.
   535.5 -
   535.6 -# DP: Description: Fix __bind redefinition problem
   535.7 -# DP: Related bugs: 
   535.8 -# DP: Dpatch author: Phil Blundell
   535.9 -# DP: Patch author: Daniel Jacobowitz
  535.10 -# DP: Upstream status: In CVS
  535.11 -# DP: Status Details:
  535.12 -# DP: Date: 2005-12-25
  535.13 -
  535.14 -Index: sysdeps/unix/sysv/linux/arm/socket.S
  535.15 -===================================================================
  535.16 -RCS file: /cvs/glibc/ports/sysdeps/unix/sysv/linux/arm/socket.S,v
  535.17 -retrieving revision 1.12
  535.18 -retrieving revision 1.13
  535.19 -diff -u -r1.12 -r1.13
  535.20 ---- glibc-2.3.6.ds1.orig/sysdeps/unix/sysv/linux/arm/socket.S	4 Dec 2004 21:20:16 -0000	1.12
  535.21 -+++ glibc-2.3.6.ds1/sysdeps/unix/sysv/linux/arm/socket.S	27 Oct 2005 18:50:12 -0000	1.13
  535.22 -@@ -1,4 +1,6 @@
  535.23 --/* Copyright (C) 1995, 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
  535.24 -+/* Copyright (C) 1995, 1996, 1997, 1998, 2003, 2004, 2005
  535.25 -+   Free Software Foundation, Inc.
  535.26 -+
  535.27 -    This file is part of the GNU C Library.
  535.28 - 
  535.29 -    The GNU C Library is free software; you can redistribute it and/or
  535.30 -@@ -32,7 +34,11 @@
  535.31 -    The .S files for the other calls just #define socket and #include this.  */
  535.32 - 
  535.33 - #ifndef __socket
  535.34 -+#ifndef NO_WEAK_ALIAS
  535.35 - #define __socket P(__,socket)
  535.36 -+#else
  535.37 -+#define __socket socket
  535.38 -+#endif
  535.39 - #endif
  535.40 - 
  535.41 - #define PUSHARGS_1	str a1, [sp, $-4]!
  535.42 -@@ -120,4 +126,6 @@
  535.43 - 
  535.44 - PSEUDO_END (__socket)
  535.45 - 
  535.46 -+#ifndef NO_WEAK_ALIAS
  535.47 - weak_alias (__socket, socket)
  535.48 -+#endif
   536.1 --- a/patches/glibc/2.3.6/250-csu-Makefile.patch	Mon Jul 28 21:08:01 2008 +0000
   536.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   536.3 @@ -1,39 +0,0 @@
   536.4 -Use printf instead of echo for some shells.
   536.5 -
   536.6 -http://www.cygwin.com/ml/libc-alpha/2005-02/msg00123.html
   536.7 -
   536.8 -This patch does not generate invalid csu/version-info.h which has
   536.9 -unterminating " line because some /bin/sh cannot parse correctly.  The
  536.10 -previous discussion was:
  536.11 -
  536.12 -	http://sources.redhat.com/ml/libc-alpha/2004-08/msg00129.html
  536.13 -	http://sources.redhat.com/ml/libc-alpha/2004-08/msg00145.html
  536.14 -
  536.15 -This patch gets rid of all this issue because the conclusion of the
  536.16 -discussion was to use printf instead of echo.  Roland, could you look
  536.17 -at it again?
  536.18 -
  536.19 -Regards,
  536.20 --- gotom
  536.21 -
  536.22 -2005-02-26  GOTO Masanori  <gotom@debian.or.jp>
  536.23 -
  536.24 -	* csu/Makefile: Use printf instead of echo for some shells.
  536.25 -
  536.26 -Index: csu/Makefile
  536.27 -===================================================================
  536.28 -RCS file: /cvs/glibc/libc/csu/Makefile,v
  536.29 -retrieving revision 1.75
  536.30 -diff -u -p -r1.75 Makefile
  536.31 ---- glibc/csu/Makefile	3 Jan 2005 17:57:14 -0000	1.75
  536.32 -+++ glibc.new/csu/Makefile	27 Feb 2005 01:17:49 -0000
  536.33 -@@ -241,7 +241,7 @@ $(objpfx)version-info.h: $(common-objpfx
  536.34 - 	 esac; \
  536.35 - 	 files="$(all-Banner-files)";				\
  536.36 - 	 if test -n "$$files"; then				\
  536.37 --	   echo "\"Available extensions:\\n\"";			\
  536.38 -+	   printf '"Available extensions:\\n"\n';		\
  536.39 - 	   sed -e '/^#/d' -e 's/^[[:space:]]*/	/'		\
  536.40 - 	       -e 's/^\(.*\)$$/\"\1\\n\"/' $$files;		\
  536.41 - 	 fi) > $@T
  536.42 -
   537.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   537.2 +++ b/patches/glibc/2.3.6/250-weakalias.patch	Mon Jul 28 21:32:33 2008 +0000
   537.3 @@ -0,0 +1,45 @@
   537.4 +This one was taken from debian.
   537.5 +
   537.6 +# DP: Description: Fix __bind redefinition problem
   537.7 +# DP: Related bugs: 
   537.8 +# DP: Dpatch author: Phil Blundell
   537.9 +# DP: Patch author: Daniel Jacobowitz
  537.10 +# DP: Upstream status: In CVS
  537.11 +# DP: Status Details:
  537.12 +# DP: Date: 2005-12-25
  537.13 +
  537.14 +Index: sysdeps/unix/sysv/linux/arm/socket.S
  537.15 +===================================================================
  537.16 +RCS file: /cvs/glibc/ports/sysdeps/unix/sysv/linux/arm/socket.S,v
  537.17 +retrieving revision 1.12
  537.18 +retrieving revision 1.13
  537.19 +diff -u -r1.12 -r1.13
  537.20 +--- glibc-2.3.6.ds1.orig/sysdeps/unix/sysv/linux/arm/socket.S	4 Dec 2004 21:20:16 -0000	1.12
  537.21 ++++ glibc-2.3.6.ds1/sysdeps/unix/sysv/linux/arm/socket.S	27 Oct 2005 18:50:12 -0000	1.13
  537.22 +@@ -1,4 +1,6 @@
  537.23 +-/* Copyright (C) 1995, 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
  537.24 ++/* Copyright (C) 1995, 1996, 1997, 1998, 2003, 2004, 2005
  537.25 ++   Free Software Foundation, Inc.
  537.26 ++
  537.27 +    This file is part of the GNU C Library.
  537.28 + 
  537.29 +    The GNU C Library is free software; you can redistribute it and/or
  537.30 +@@ -32,7 +34,11 @@
  537.31 +    The .S files for the other calls just #define socket and #include this.  */
  537.32 + 
  537.33 + #ifndef __socket
  537.34 ++#ifndef NO_WEAK_ALIAS
  537.35 + #define __socket P(__,socket)
  537.36 ++#else
  537.37 ++#define __socket socket
  537.38 ++#endif
  537.39 + #endif
  537.40 + 
  537.41 + #define PUSHARGS_1	str a1, [sp, $-4]!
  537.42 +@@ -120,4 +126,6 @@
  537.43 + 
  537.44 + PSEUDO_END (__socket)
  537.45 + 
  537.46 ++#ifndef NO_WEAK_ALIAS
  537.47 + weak_alias (__socket, socket)
  537.48 ++#endif
   538.1 --- a/patches/glibc/2.3.6/260-alpha-asm_page.patch	Mon Jul 28 21:08:01 2008 +0000
   538.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   538.3 @@ -1,26 +0,0 @@
   538.4 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   538.5 -
   538.6 -	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   538.7 -	from the kernel header to sys/user.h and remove the #include of
   538.8 -	sys/user.h.
   538.9 -
  538.10 ---- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  538.11 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  538.12 -@@ -23,7 +23,6 @@
  538.13 -    only. Don't read too much into it. Don't use it for anything other
  538.14 -    than gdb/strace unless you know what you are doing. */
  538.15 - 
  538.16 --#include <asm/page.h>
  538.17 - #include <asm/reg.h>
  538.18 - 
  538.19 - struct user
  538.20 -@@ -41,6 +40,9 @@ struct user
  538.21 -   char u_comm[32];				/* user command name */
  538.22 - };
  538.23 - 
  538.24 -+#define PAGE_SHIFT		13
  538.25 -+#define PAGE_SIZE		(1 << PAGE_SHIFT)
  538.26 -+#define PAGE_MASK		(~(PAGE_SIZE-1))
  538.27 - #define NBPG			PAGE_SIZE
  538.28 - #define UPAGES			1
  538.29 - #define HOST_TEXT_START_ADDR	(u.start_code)
   539.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   539.2 +++ b/patches/glibc/2.3.6/260-csu-Makefile.patch	Mon Jul 28 21:32:33 2008 +0000
   539.3 @@ -0,0 +1,39 @@
   539.4 +Use printf instead of echo for some shells.
   539.5 +
   539.6 +http://www.cygwin.com/ml/libc-alpha/2005-02/msg00123.html
   539.7 +
   539.8 +This patch does not generate invalid csu/version-info.h which has
   539.9 +unterminating " line because some /bin/sh cannot parse correctly.  The
  539.10 +previous discussion was:
  539.11 +
  539.12 +	http://sources.redhat.com/ml/libc-alpha/2004-08/msg00129.html
  539.13 +	http://sources.redhat.com/ml/libc-alpha/2004-08/msg00145.html
  539.14 +
  539.15 +This patch gets rid of all this issue because the conclusion of the
  539.16 +discussion was to use printf instead of echo.  Roland, could you look
  539.17 +at it again?
  539.18 +
  539.19 +Regards,
  539.20 +-- gotom
  539.21 +
  539.22 +2005-02-26  GOTO Masanori  <gotom@debian.or.jp>
  539.23 +
  539.24 +	* csu/Makefile: Use printf instead of echo for some shells.
  539.25 +
  539.26 +Index: csu/Makefile
  539.27 +===================================================================
  539.28 +RCS file: /cvs/glibc/libc/csu/Makefile,v
  539.29 +retrieving revision 1.75
  539.30 +diff -u -p -r1.75 Makefile
  539.31 +--- glibc/csu/Makefile	3 Jan 2005 17:57:14 -0000	1.75
  539.32 ++++ glibc.new/csu/Makefile	27 Feb 2005 01:17:49 -0000
  539.33 +@@ -241,7 +241,7 @@ $(objpfx)version-info.h: $(common-objpfx
  539.34 + 	 esac; \
  539.35 + 	 files="$(all-Banner-files)";				\
  539.36 + 	 if test -n "$$files"; then				\
  539.37 +-	   echo "\"Available extensions:\\n\"";			\
  539.38 ++	   printf '"Available extensions:\\n"\n';		\
  539.39 + 	   sed -e '/^#/d' -e 's/^[[:space:]]*/	/'		\
  539.40 + 	       -e 's/^\(.*\)$$/\"\1\\n\"/' $$files;		\
  539.41 + 	 fi) > $@T
  539.42 +
   540.1 --- a/patches/glibc/2.3.6/270-alpha-asm_elf.patch	Mon Jul 28 21:08:01 2008 +0000
   540.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   540.3 @@ -1,194 +0,0 @@
   540.4 -since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   540.5 -common code, alpha, and sh fail when used.  this should things up.
   540.6 --mike
   540.7 -
   540.8 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   540.9 -
  540.10 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  540.11 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  540.12 -	definitions from the kernel header to sys/procfs.h and remove the
  540.13 -	#include of asm/elf.h.
  540.14 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  540.15 -
  540.16 -*Attachment: signature.asc <msg00012/signature.asc>*
  540.17 -/Description:/ This is a digitally signed message part.
  540.18 -
  540.19 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  540.20 -
  540.21 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  540.22 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  540.23 -	definitions from the kernel header to sys/procfs.h and remove the
  540.24 -	#include of asm/elf.h.
  540.25 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  540.26 -
  540.27 ---- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  540.28 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  540.29 -@@ -29,10 +29,23 @@
  540.30 - #include <sys/types.h>
  540.31 - #include <sys/ucontext.h>
  540.32 - #include <sys/user.h>
  540.33 --#include <asm/elf.h>
  540.34 - 
  540.35 - __BEGIN_DECLS
  540.36 - 
  540.37 -+/*
  540.38 -+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  540.39 -+ * I have no idea why that is so.  For now, we just leave it at 33
  540.40 -+ * (32 general regs + processor status word).
  540.41 -+ */
  540.42 -+#define ELF_NGREG  33
  540.43 -+#define ELF_NFPREG 32
  540.44 -+
  540.45 -+typedef unsigned long elf_greg_t;
  540.46 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  540.47 -+
  540.48 -+typedef double elf_fpreg_t;
  540.49 -+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  540.50 -+
  540.51 - struct elf_siginfo
  540.52 -   {
  540.53 -     int si_signo;			/* Signal number.  */
  540.54 ---- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  540.55 -+++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  540.56 -@@ -29,10 +29,19 @@
  540.57 - #include <sys/types.h>
  540.58 - #include <sys/ucontext.h>
  540.59 - #include <sys/user.h>
  540.60 --#include <asm/elf.h>
  540.61 - 
  540.62 - __BEGIN_DECLS
  540.63 - 
  540.64 -+/*
  540.65 -+ * ELF register definitions...
  540.66 -+ */
  540.67 -+typedef unsigned long elf_greg_t;
  540.68 -+
  540.69 -+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  540.70 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  540.71 -+
  540.72 -+typedef struct user_fpu_struct elf_fpregset_t;
  540.73 -+
  540.74 - struct elf_siginfo
  540.75 -   {
  540.76 -     int si_signo;			/* Signal number.  */
  540.77 ---- a/sysdeps/unix/sysv/linux/sys/procfs.h
  540.78 -+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  540.79 -@@ -1,115 +1,2 @@
  540.80 --/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  540.81 --   This file is part of the GNU C Library.
  540.82 --
  540.83 --   The GNU C Library is free software; you can redistribute it and/or
  540.84 --   modify it under the terms of the GNU Lesser General Public
  540.85 --   License as published by the Free Software Foundation; either
  540.86 --   version 2.1 of the License, or (at your option) any later version.
  540.87 --
  540.88 --   The GNU C Library is distributed in the hope that it will be useful,
  540.89 --   but WITHOUT ANY WARRANTY; without even the implied warranty of
  540.90 --   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  540.91 --   Lesser General Public License for more details.
  540.92 --
  540.93 --   You should have received a copy of the GNU Lesser General Public
  540.94 --   License along with the GNU C Library; if not, write to the Free
  540.95 --   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  540.96 --   02111-1307 USA.  */
  540.97 --
  540.98 --#ifndef _SYS_PROCFS_H
  540.99 --#define _SYS_PROCFS_H	1
 540.100 --
 540.101 --/* This is somehow modelled after the file of the same name on SysVr4
 540.102 --   systems.  It provides a definition of the core file format for ELF
 540.103 --   used on Linux.  */
 540.104 --
 540.105 --#include <features.h>
 540.106 --#include <signal.h>
 540.107 --#include <sys/time.h>
 540.108 --#include <sys/types.h>
 540.109 --#include <sys/ucontext.h>
 540.110 --#include <sys/user.h>
 540.111 --#include <asm/elf.h>
 540.112 --
 540.113 --__BEGIN_DECLS
 540.114 --
 540.115 --struct elf_siginfo
 540.116 --  {
 540.117 --    int si_signo;			/* Signal number.  */
 540.118 --    int si_code;			/* Extra code.  */
 540.119 --    int si_errno;			/* Errno.  */
 540.120 --  };
 540.121 --
 540.122 --/* Definitions to generate Intel SVR4-like core files.  These mostly
 540.123 --   have the same names as the SVR4 types with "elf_" tacked on the
 540.124 --   front to prevent clashes with linux definitions, and the typedef
 540.125 --   forms have been avoided.  This is mostly like the SVR4 structure,
 540.126 --   but more Linuxy, with things that Linux does not support and which
 540.127 --   gdb doesn't really use excluded.  Fields present but not used are
 540.128 --   marked with "XXX".  */
 540.129 --struct elf_prstatus
 540.130 --  {
 540.131 --#if 0
 540.132 --    long int pr_flags;			/* XXX Process flags.  */
 540.133 --    short int pr_why;			/* XXX Reason for process halt.  */
 540.134 --    short int pr_what;			/* XXX More detailed reason.  */
 540.135 --#endif
 540.136 --    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 540.137 --    short int pr_cursig;		/* Current signal.  */
 540.138 --    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 540.139 --    unsigned long int pr_sighold;	/* Set of held signals.  */
 540.140 --#if 0
 540.141 --    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 540.142 --    struct sigaction pr_action;		/* Signal action for current sig.  */
 540.143 --#endif
 540.144 --    __pid_t pr_pid;
 540.145 --    __pid_t pr_ppid;
 540.146 --    __pid_t pr_pgrp;
 540.147 --    __pid_t pr_sid;
 540.148 --    struct timeval pr_utime;		/* User time.  */
 540.149 --    struct timeval pr_stime;		/* System time.  */
 540.150 --    struct timeval pr_cutime;		/* Cumulative user time.  */
 540.151 --    struct timeval pr_cstime;		/* Cumulative system time.  */
 540.152 --#if 0
 540.153 --    long int pr_instr;			/* Current instruction.  */
 540.154 --#endif
 540.155 --    elf_gregset_t pr_reg;		/* GP registers.  */
 540.156 --    int pr_fpvalid;			/* True if math copro being used.  */
 540.157 --  };
 540.158 --
 540.159 --
 540.160 --#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 540.161 --
 540.162 --struct elf_prpsinfo
 540.163 --  {
 540.164 --    char pr_state;			/* Numeric process state.  */
 540.165 --    char pr_sname;			/* Char for pr_state.  */
 540.166 --    char pr_zomb;			/* Zombie.  */
 540.167 --    char pr_nice;			/* Nice val.  */
 540.168 --    unsigned long int pr_flag;		/* Flags.  */
 540.169 --    unsigned short int pr_uid;
 540.170 --    unsigned short int pr_gid;
 540.171 --    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 540.172 --    /* Lots missing */
 540.173 --    char pr_fname[16];			/* Filename of executable.  */
 540.174 --    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 540.175 --  };
 540.176 --
 540.177 --/* Addresses.  */
 540.178 --typedef void *psaddr_t;
 540.179 --
 540.180 --/* Register sets.  Linux has different names.  */
 540.181 --typedef gregset_t prgregset_t;
 540.182 --typedef fpregset_t prfpregset_t;
 540.183 --
 540.184 --/* We don't have any differences between processes and threads,
 540.185 --   therefore habe only ine PID type.  */
 540.186 --typedef __pid_t lwpid_t;
 540.187 --
 540.188 --
 540.189 --typedef struct elf_prstatus prstatus_t;
 540.190 --typedef struct elf_prpsinfo prpsinfo_t;
 540.191 --
 540.192 --__END_DECLS
 540.193 --
 540.194 --#endif	/* sys/procfs.h */
 540.195 -+/* sys/procfs.h is architecture specific.  */
 540.196 -+#error "This file must be supplied by every Linux architecture."
 540.197 -
   541.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   541.2 +++ b/patches/glibc/2.3.6/270-alpha-asm_page.patch	Mon Jul 28 21:32:33 2008 +0000
   541.3 @@ -0,0 +1,26 @@
   541.4 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   541.5 +
   541.6 +	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   541.7 +	from the kernel header to sys/user.h and remove the #include of
   541.8 +	sys/user.h.
   541.9 +
  541.10 +--- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  541.11 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  541.12 +@@ -23,7 +23,6 @@
  541.13 +    only. Don't read too much into it. Don't use it for anything other
  541.14 +    than gdb/strace unless you know what you are doing. */
  541.15 + 
  541.16 +-#include <asm/page.h>
  541.17 + #include <asm/reg.h>
  541.18 + 
  541.19 + struct user
  541.20 +@@ -41,6 +40,9 @@ struct user
  541.21 +   char u_comm[32];				/* user command name */
  541.22 + };
  541.23 + 
  541.24 ++#define PAGE_SHIFT		13
  541.25 ++#define PAGE_SIZE		(1 << PAGE_SHIFT)
  541.26 ++#define PAGE_MASK		(~(PAGE_SIZE-1))
  541.27 + #define NBPG			PAGE_SIZE
  541.28 + #define UPAGES			1
  541.29 + #define HOST_TEXT_START_ADDR	(u.start_code)
   542.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   542.2 +++ b/patches/glibc/2.3.6/280-alpha-asm_elf.patch	Mon Jul 28 21:32:33 2008 +0000
   542.3 @@ -0,0 +1,194 @@
   542.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   542.5 +common code, alpha, and sh fail when used.  this should things up.
   542.6 +-mike
   542.7 +
   542.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   542.9 +
  542.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  542.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  542.12 +	definitions from the kernel header to sys/procfs.h and remove the
  542.13 +	#include of asm/elf.h.
  542.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  542.15 +
  542.16 +*Attachment: signature.asc <msg00012/signature.asc>*
  542.17 +/Description:/ This is a digitally signed message part.
  542.18 +
  542.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  542.20 +
  542.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  542.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  542.23 +	definitions from the kernel header to sys/procfs.h and remove the
  542.24 +	#include of asm/elf.h.
  542.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  542.26 +
  542.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  542.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  542.29 +@@ -29,10 +29,23 @@
  542.30 + #include <sys/types.h>
  542.31 + #include <sys/ucontext.h>
  542.32 + #include <sys/user.h>
  542.33 +-#include <asm/elf.h>
  542.34 + 
  542.35 + __BEGIN_DECLS
  542.36 + 
  542.37 ++/*
  542.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  542.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
  542.40 ++ * (32 general regs + processor status word).
  542.41 ++ */
  542.42 ++#define ELF_NGREG  33
  542.43 ++#define ELF_NFPREG 32
  542.44 ++
  542.45 ++typedef unsigned long elf_greg_t;
  542.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  542.47 ++
  542.48 ++typedef double elf_fpreg_t;
  542.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  542.50 ++
  542.51 + struct elf_siginfo
  542.52 +   {
  542.53 +     int si_signo;			/* Signal number.  */
  542.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  542.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  542.56 +@@ -29,10 +29,19 @@
  542.57 + #include <sys/types.h>
  542.58 + #include <sys/ucontext.h>
  542.59 + #include <sys/user.h>
  542.60 +-#include <asm/elf.h>
  542.61 + 
  542.62 + __BEGIN_DECLS
  542.63 + 
  542.64 ++/*
  542.65 ++ * ELF register definitions...
  542.66 ++ */
  542.67 ++typedef unsigned long elf_greg_t;
  542.68 ++
  542.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  542.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  542.71 ++
  542.72 ++typedef struct user_fpu_struct elf_fpregset_t;
  542.73 ++
  542.74 + struct elf_siginfo
  542.75 +   {
  542.76 +     int si_signo;			/* Signal number.  */
  542.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
  542.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  542.79 +@@ -1,115 +1,2 @@
  542.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  542.81 +-   This file is part of the GNU C Library.
  542.82 +-
  542.83 +-   The GNU C Library is free software; you can redistribute it and/or
  542.84 +-   modify it under the terms of the GNU Lesser General Public
  542.85 +-   License as published by the Free Software Foundation; either
  542.86 +-   version 2.1 of the License, or (at your option) any later version.
  542.87 +-
  542.88 +-   The GNU C Library is distributed in the hope that it will be useful,
  542.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
  542.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  542.91 +-   Lesser General Public License for more details.
  542.92 +-
  542.93 +-   You should have received a copy of the GNU Lesser General Public
  542.94 +-   License along with the GNU C Library; if not, write to the Free
  542.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  542.96 +-   02111-1307 USA.  */
  542.97 +-
  542.98 +-#ifndef _SYS_PROCFS_H
  542.99 +-#define _SYS_PROCFS_H	1
 542.100 +-
 542.101 +-/* This is somehow modelled after the file of the same name on SysVr4
 542.102 +-   systems.  It provides a definition of the core file format for ELF
 542.103 +-   used on Linux.  */
 542.104 +-
 542.105 +-#include <features.h>
 542.106 +-#include <signal.h>
 542.107 +-#include <sys/time.h>
 542.108 +-#include <sys/types.h>
 542.109 +-#include <sys/ucontext.h>
 542.110 +-#include <sys/user.h>
 542.111 +-#include <asm/elf.h>
 542.112 +-
 542.113 +-__BEGIN_DECLS
 542.114 +-
 542.115 +-struct elf_siginfo
 542.116 +-  {
 542.117 +-    int si_signo;			/* Signal number.  */
 542.118 +-    int si_code;			/* Extra code.  */
 542.119 +-    int si_errno;			/* Errno.  */
 542.120 +-  };
 542.121 +-
 542.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
 542.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
 542.124 +-   front to prevent clashes with linux definitions, and the typedef
 542.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
 542.126 +-   but more Linuxy, with things that Linux does not support and which
 542.127 +-   gdb doesn't really use excluded.  Fields present but not used are
 542.128 +-   marked with "XXX".  */
 542.129 +-struct elf_prstatus
 542.130 +-  {
 542.131 +-#if 0
 542.132 +-    long int pr_flags;			/* XXX Process flags.  */
 542.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
 542.134 +-    short int pr_what;			/* XXX More detailed reason.  */
 542.135 +-#endif
 542.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 542.137 +-    short int pr_cursig;		/* Current signal.  */
 542.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 542.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
 542.140 +-#if 0
 542.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 542.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
 542.143 +-#endif
 542.144 +-    __pid_t pr_pid;
 542.145 +-    __pid_t pr_ppid;
 542.146 +-    __pid_t pr_pgrp;
 542.147 +-    __pid_t pr_sid;
 542.148 +-    struct timeval pr_utime;		/* User time.  */
 542.149 +-    struct timeval pr_stime;		/* System time.  */
 542.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
 542.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
 542.152 +-#if 0
 542.153 +-    long int pr_instr;			/* Current instruction.  */
 542.154 +-#endif
 542.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
 542.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
 542.157 +-  };
 542.158 +-
 542.159 +-
 542.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 542.161 +-
 542.162 +-struct elf_prpsinfo
 542.163 +-  {
 542.164 +-    char pr_state;			/* Numeric process state.  */
 542.165 +-    char pr_sname;			/* Char for pr_state.  */
 542.166 +-    char pr_zomb;			/* Zombie.  */
 542.167 +-    char pr_nice;			/* Nice val.  */
 542.168 +-    unsigned long int pr_flag;		/* Flags.  */
 542.169 +-    unsigned short int pr_uid;
 542.170 +-    unsigned short int pr_gid;
 542.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 542.172 +-    /* Lots missing */
 542.173 +-    char pr_fname[16];			/* Filename of executable.  */
 542.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 542.175 +-  };
 542.176 +-
 542.177 +-/* Addresses.  */
 542.178 +-typedef void *psaddr_t;
 542.179 +-
 542.180 +-/* Register sets.  Linux has different names.  */
 542.181 +-typedef gregset_t prgregset_t;
 542.182 +-typedef fpregset_t prfpregset_t;
 542.183 +-
 542.184 +-/* We don't have any differences between processes and threads,
 542.185 +-   therefore habe only ine PID type.  */
 542.186 +-typedef __pid_t lwpid_t;
 542.187 +-
 542.188 +-
 542.189 +-typedef struct elf_prstatus prstatus_t;
 542.190 +-typedef struct elf_prpsinfo prpsinfo_t;
 542.191 +-
 542.192 +-__END_DECLS
 542.193 +-
 542.194 +-#endif	/* sys/procfs.h */
 542.195 ++/* sys/procfs.h is architecture specific.  */
 542.196 ++#error "This file must be supplied by every Linux architecture."
 542.197 +
   543.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   543.2 +++ b/patches/glibc/2.5.1/100-cygwin.patch	Mon Jul 28 21:32:33 2008 +0000
   543.3 @@ -0,0 +1,187 @@
   543.4 +Fixes
   543.5 +elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
   543.6 +...
   543.7 +when building glibc-2.3.x on cygwin
   543.8 +
   543.9 +Idea from
  543.10 +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
  543.11 +Basically, make glibc use .oST as suffix for 'object static'
  543.12 +instead of .oS, since cygwin has trouble distinguishing .os from .oS
  543.13 +(Original patch had .on, but .oST is more mnemonic for 'object static')
  543.14 +
  543.15 +glibc-linuxthreads-2.3.5 also requires a patch, see 
  543.16 +../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
  543.17 +
  543.18 +[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
  543.19 +
  543.20 +Message-ID: <4282FCBA.3040000@unicontrols.cz>
  543.21 +Date: Thu, 12 May 2005 08:50:34 +0200
  543.22 +From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
  543.23 +To: Dan Kegel <dank@kegel.com>
  543.24 +CC:  crossgcc@sources.redhat.com
  543.25 +Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
  543.26 +
  543.27 +Hi Dan,
  543.28 +following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
  543.29 +on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
  543.30 +
  543.31 +-- 
  543.32 +                     Petr Cvachoucek
  543.33 +                     Unicontrols a.s.
  543.34 +                     http://www.unicontrols.cz
  543.35 +]
  543.36 +
  543.37 +diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
  543.38 +--- glibc-2.3.5/Makeconfig	2005-02-16 11:50:19.000000000 +0100
  543.39 ++++ glibc-2.3.5-cygwin/Makeconfig	2005-05-11 08:24:51.046875000 +0200
  543.40 +@@ -472,7 +472,7 @@
  543.41 + # run the linked programs.
  543.42 + link-libc = -Wl,-rpath-link=$(rpath-link) \
  543.43 + 	    $(common-objpfx)libc.so$(libc.so-version) \
  543.44 +-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
  543.45 ++	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
  543.46 + # This is how to find at build-time things that will be installed there.
  543.47 + rpath-dirs = math elf dlfcn nss nis rt resolv crypt
  543.48 + endif
  543.49 +@@ -693,7 +693,7 @@
  543.50 + # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
  543.51 + # to pass different flags for each flavor.
  543.52 + libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
  543.53 +-all-object-suffixes := .o .os .op .og .ob .oS
  543.54 ++all-object-suffixes := .o .os .op .og .ob .oST
  543.55 + object-suffixes :=
  543.56 + CPPFLAGS-.o = $(pic-default)
  543.57 + CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
  543.58 +@@ -749,14 +749,14 @@
  543.59 + 
  543.60 + ifeq (yes,$(build-shared))
  543.61 + # Build special library that contains the static-only routines for libc.
  543.62 +-object-suffixes-for-libc += .oS
  543.63 ++object-suffixes-for-libc += .oST
  543.64 + 
  543.65 + # Must build the routines as PIC, though, because they can end up in (users')
  543.66 + # shared objects.  We don't want to use CFLAGS-os because users may, for
  543.67 + # example, make that processor-specific.
  543.68 +-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
  543.69 +-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  543.70 +-libtype.oS = lib%_nonshared.a
  543.71 ++CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
  543.72 ++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  543.73 ++libtype.oST = lib%_nonshared.a
  543.74 + endif
  543.75 + 
  543.76 + # The assembler can generate debug information too.
  543.77 +diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
  543.78 +--- glibc-2.3.5/Makerules	2004-12-15 19:52:39.000000000 +0100
  543.79 ++++ glibc-2.3.5-cygwin/Makerules	2005-05-11 08:25:33.578125000 +0200
  543.80 +@@ -417,7 +417,7 @@
  543.81 + # Bounded pointer thunks are only built for *.ob
  543.82 + elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
  543.83 + 
  543.84 +-elide-routines.oS += $(filter-out $(static-only-routines),\
  543.85 ++elide-routines.oST += $(filter-out $(static-only-routines),\
  543.86 + 				  $(routines) $(aux) $(sysdep_routines)) \
  543.87 + 		     $(elide-bp-thunks)
  543.88 + elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
  543.89 +@@ -981,7 +981,7 @@
  543.90 + install: $(inst_libdir)/libc.so
  543.91 + $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
  543.92 + 			$(common-objpfx)libc.so$(libc.so-version) \
  543.93 +-			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
  543.94 ++			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
  543.95 + 						  $(libprefix)$(libc-name)) \
  543.96 + 			$(+force)
  543.97 + 	(echo '/* GNU ld script';\
  543.98 +@@ -989,7 +989,7 @@
  543.99 + 	 echo '   the static library, so try that secondarily.  */';\
 543.100 + 	 cat $<; \
 543.101 + 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
 543.102 +-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
 543.103 ++	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
 543.104 +	      ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
 543.105 + 	) > $@.new
 543.106 +	mv -f $@.new $@
 543.107 +diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
 543.108 +--- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
 543.109 ++++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
 543.110 +@@ -13,7 +13,7 @@
 543.111 + 
 543.112 + ifneq (,$($(lib)-static-only-routines))
 543.113 + ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
 543.114 +-object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
 543.115 ++object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
 543.116 + endif
 543.117 + endif
 543.118 + 
 543.119 +@@ -29,7 +29,7 @@
 543.120 + 
 543.121 + # Add each flavor of library to the lists of things to build and install.
 543.122 + install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
 543.123 +-extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
 543.124 ++extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
 543.125 + 			$(patsubst %,%$o,$(filter-out \
 543.126 + 					   $($(lib)-shared-only-routines),\
 543.127 + 					   $(all-$(lib)-routines))))
 543.128 +@@ -57,7 +57,7 @@
 543.129 + 
 543.130 + 
 543.131 + # Use o-iterator.mk to generate a rule for each flavor of library.
 543.132 +-ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
 543.133 ++ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
 543.134 + define o-iterator-doit
 543.135 + $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
 543.136 +   $(patsubst %,$(objpfx)%$o,\
 543.137 +@@ -65,7 +65,7 @@
 543.138 + 			  $(all-$(lib)-routines))); \
 543.139 + 	$$(build-extra-lib)
 543.140 + endef
 543.141 +-object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
 543.142 ++object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
 543.143 + include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
 543.144 + endif
 543.145 + 
 543.146 +@@ -77,9 +77,9 @@
 543.147 + 	$(build-extra-lib)
 543.148 + endif
 543.149 + 
 543.150 +-ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
 543.151 +-$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
 543.152 +-  $(patsubst %,$(objpfx)%.oS,\
 543.153 ++ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
 543.154 ++$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
 543.155 ++  $(patsubst %,$(objpfx)%.oST,\
 543.156 + 	     $(filter $($(lib)-static-only-routines),\
 543.157 + 		      $(all-$(lib)-routines)))
 543.158 + 	$(build-extra-lib)
 543.159 +diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
 543.160 +--- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
 543.161 ++++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
 543.162 +@@ -375,7 +375,7 @@
 543.163 + 
 543.164 + $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
 543.165 + 			      $(objpfx)libpthread.so$(libpthread.so-version) \
 543.166 +-			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
 543.167 ++			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
 543.168 + 							$(libprefix)pthread) \
 543.169 + 			      $(+force)
 543.170 + 	(echo '/* GNU ld script';\
 543.171 +@@ -383,7 +383,7 @@
 543.172 + 	 echo '   the static library, so try that secondarily.  */';\
 543.173 + 	 cat $<; \
 543.174 + 	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
 543.175 +-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
 543.176 ++	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
 543.177 + 	      ')' \
 543.178 + 	) > $@.new
 543.179 + 	mv -f $@.new $@
 543.180 +diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
 543.181 +--- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
 543.182 ++++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
 543.183 +@@ -10,4 +10,4 @@
 543.184 + ASFLAGS-.op += -Wa,-Av9a
 543.185 + ASFLAGS-.og += -Wa,-Av9a
 543.186 + ASFLAGS-.ob += -Wa,-Av9a
 543.187 +-ASFLAGS-.oS += -Wa,-Av9a
 543.188 ++ASFLAGS-.oST += -Wa,-Av9a
 543.189 +
 543.190 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   544.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   544.2 +++ b/patches/glibc/2.5.1/110-configure-apple-as.patch	Mon Jul 28 21:32:33 2008 +0000
   544.3 @@ -0,0 +1,25 @@
   544.4 +http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
   544.5 +http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
   544.6 +
   544.7 +The following makes it possible to configure glibc-2.3.2 on Mac OS X,
   544.8 +where the assembler but doesn't understand the --version flag.
   544.9 +
  544.10 +Fixes the symptom
  544.11 +checking whether ld is GNU ld... no
  544.12 +checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
  544.13 +checking version of /usr/libexec/gcc/darwin/ppc/as... 
  544.14 +<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
  544.15 +
  544.16 +--- glibc-2.3.2/configure~	Wed Feb 26 09:20:48 2003
  544.17 ++++ glibc-2.3.2/configure	Fri Feb 27 13:12:53 2004
  544.18 +@@ -4039,7 +4039,7 @@
  544.19 +   # Found it, now check the version.
  544.20 +   echo "$as_me:$LINENO: checking version of $AS" >&5
  544.21 + echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
  544.22 +-  ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  544.23 ++  ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  544.24 +   case $ac_prog_version in
  544.25 +     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  544.26 +     2.1[3-9]*)
  544.27 +
  544.28 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   545.1 --- a/patches/glibc/2.5.1/120-cygwin.patch	Mon Jul 28 21:08:01 2008 +0000
   545.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   545.3 @@ -1,187 +0,0 @@
   545.4 -Fixes
   545.5 -elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
   545.6 -...
   545.7 -when building glibc-2.3.x on cygwin
   545.8 -
   545.9 -Idea from
  545.10 -http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
  545.11 -Basically, make glibc use .oST as suffix for 'object static'
  545.12 -instead of .oS, since cygwin has trouble distinguishing .os from .oS
  545.13 -(Original patch had .on, but .oST is more mnemonic for 'object static')
  545.14 -
  545.15 -glibc-linuxthreads-2.3.5 also requires a patch, see 
  545.16 -../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
  545.17 -
  545.18 -[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
  545.19 -
  545.20 -Message-ID: <4282FCBA.3040000@unicontrols.cz>
  545.21 -Date: Thu, 12 May 2005 08:50:34 +0200
  545.22 -From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
  545.23 -To: Dan Kegel <dank@kegel.com>
  545.24 -CC:  crossgcc@sources.redhat.com
  545.25 -Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
  545.26 -
  545.27 -Hi Dan,
  545.28 -following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
  545.29 -on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
  545.30 -
  545.31 --- 
  545.32 -                     Petr Cvachoucek
  545.33 -                     Unicontrols a.s.
  545.34 -                     http://www.unicontrols.cz
  545.35 -]
  545.36 -
  545.37 -diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
  545.38 ---- glibc-2.3.5/Makeconfig	2005-02-16 11:50:19.000000000 +0100
  545.39 -+++ glibc-2.3.5-cygwin/Makeconfig	2005-05-11 08:24:51.046875000 +0200
  545.40 -@@ -472,7 +472,7 @@
  545.41 - # run the linked programs.
  545.42 - link-libc = -Wl,-rpath-link=$(rpath-link) \
  545.43 - 	    $(common-objpfx)libc.so$(libc.so-version) \
  545.44 --	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
  545.45 -+	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
  545.46 - # This is how to find at build-time things that will be installed there.
  545.47 - rpath-dirs = math elf dlfcn nss nis rt resolv crypt
  545.48 - endif
  545.49 -@@ -693,7 +693,7 @@
  545.50 - # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
  545.51 - # to pass different flags for each flavor.
  545.52 - libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
  545.53 --all-object-suffixes := .o .os .op .og .ob .oS
  545.54 -+all-object-suffixes := .o .os .op .og .ob .oST
  545.55 - object-suffixes :=
  545.56 - CPPFLAGS-.o = $(pic-default)
  545.57 - CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
  545.58 -@@ -749,14 +749,14 @@
  545.59 - 
  545.60 - ifeq (yes,$(build-shared))
  545.61 - # Build special library that contains the static-only routines for libc.
  545.62 --object-suffixes-for-libc += .oS
  545.63 -+object-suffixes-for-libc += .oST
  545.64 - 
  545.65 - # Must build the routines as PIC, though, because they can end up in (users')
  545.66 - # shared objects.  We don't want to use CFLAGS-os because users may, for
  545.67 - # example, make that processor-specific.
  545.68 --CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
  545.69 --CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  545.70 --libtype.oS = lib%_nonshared.a
  545.71 -+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
  545.72 -+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  545.73 -+libtype.oST = lib%_nonshared.a
  545.74 - endif
  545.75 - 
  545.76 - # The assembler can generate debug information too.
  545.77 -diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
  545.78 ---- glibc-2.3.5/Makerules	2004-12-15 19:52:39.000000000 +0100
  545.79 -+++ glibc-2.3.5-cygwin/Makerules	2005-05-11 08:25:33.578125000 +0200
  545.80 -@@ -417,7 +417,7 @@
  545.81 - # Bounded pointer thunks are only built for *.ob
  545.82 - elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
  545.83 - 
  545.84 --elide-routines.oS += $(filter-out $(static-only-routines),\
  545.85 -+elide-routines.oST += $(filter-out $(static-only-routines),\
  545.86 - 				  $(routines) $(aux) $(sysdep_routines)) \
  545.87 - 		     $(elide-bp-thunks)
  545.88 - elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
  545.89 -@@ -981,7 +981,7 @@
  545.90 - install: $(inst_libdir)/libc.so
  545.91 - $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
  545.92 - 			$(common-objpfx)libc.so$(libc.so-version) \
  545.93 --			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
  545.94 -+			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
  545.95 - 						  $(libprefix)$(libc-name)) \
  545.96 - 			$(+force)
  545.97 - 	(echo '/* GNU ld script';\
  545.98 -@@ -989,7 +989,7 @@
  545.99 - 	 echo '   the static library, so try that secondarily.  */';\
 545.100 - 	 cat $<; \
 545.101 - 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
 545.102 --	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
 545.103 -+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
 545.104 -	      ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
 545.105 - 	) > $@.new
 545.106 -	mv -f $@.new $@
 545.107 -diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
 545.108 ---- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
 545.109 -+++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
 545.110 -@@ -13,7 +13,7 @@
 545.111 - 
 545.112 - ifneq (,$($(lib)-static-only-routines))
 545.113 - ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
 545.114 --object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
 545.115 -+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
 545.116 - endif
 545.117 - endif
 545.118 - 
 545.119 -@@ -29,7 +29,7 @@
 545.120 - 
 545.121 - # Add each flavor of library to the lists of things to build and install.
 545.122 - install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
 545.123 --extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
 545.124 -+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
 545.125 - 			$(patsubst %,%$o,$(filter-out \
 545.126 - 					   $($(lib)-shared-only-routines),\
 545.127 - 					   $(all-$(lib)-routines))))
 545.128 -@@ -57,7 +57,7 @@
 545.129 - 
 545.130 - 
 545.131 - # Use o-iterator.mk to generate a rule for each flavor of library.
 545.132 --ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
 545.133 -+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
 545.134 - define o-iterator-doit
 545.135 - $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
 545.136 -   $(patsubst %,$(objpfx)%$o,\
 545.137 -@@ -65,7 +65,7 @@
 545.138 - 			  $(all-$(lib)-routines))); \
 545.139 - 	$$(build-extra-lib)
 545.140 - endef
 545.141 --object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
 545.142 -+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
 545.143 - include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
 545.144 - endif
 545.145 - 
 545.146 -@@ -77,9 +77,9 @@
 545.147 - 	$(build-extra-lib)
 545.148 - endif
 545.149 - 
 545.150 --ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
 545.151 --$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
 545.152 --  $(patsubst %,$(objpfx)%.oS,\
 545.153 -+ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
 545.154 -+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
 545.155 -+  $(patsubst %,$(objpfx)%.oST,\
 545.156 - 	     $(filter $($(lib)-static-only-routines),\
 545.157 - 		      $(all-$(lib)-routines)))
 545.158 - 	$(build-extra-lib)
 545.159 -diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
 545.160 ---- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
 545.161 -+++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
 545.162 -@@ -375,7 +375,7 @@
 545.163 - 
 545.164 - $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
 545.165 - 			      $(objpfx)libpthread.so$(libpthread.so-version) \
 545.166 --			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
 545.167 -+			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
 545.168 - 							$(libprefix)pthread) \
 545.169 - 			      $(+force)
 545.170 - 	(echo '/* GNU ld script';\
 545.171 -@@ -383,7 +383,7 @@
 545.172 - 	 echo '   the static library, so try that secondarily.  */';\
 545.173 - 	 cat $<; \
 545.174 - 	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
 545.175 --	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
 545.176 -+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
 545.177 - 	      ')' \
 545.178 - 	) > $@.new
 545.179 - 	mv -f $@.new $@
 545.180 -diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
 545.181 ---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
 545.182 -+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
 545.183 -@@ -10,4 +10,4 @@
 545.184 - ASFLAGS-.op += -Wa,-Av9a
 545.185 - ASFLAGS-.og += -Wa,-Av9a
 545.186 - ASFLAGS-.ob += -Wa,-Av9a
 545.187 --ASFLAGS-.oS += -Wa,-Av9a
 545.188 -+ASFLAGS-.oST += -Wa,-Av9a
 545.189 -
 545.190 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   546.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   546.2 +++ b/patches/glibc/2.5.1/120-fix-pr631.patch	Mon Jul 28 21:32:33 2008 +0000
   546.3 @@ -0,0 +1,45 @@
   546.4 +From dank@kegel.com
   546.5 +Wed Jun 15 09:12:43 PDT 2005
   546.6 +
   546.7 +Fixes
   546.8 +
   546.9 +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  546.10 +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  546.11 +... 53 lines deleted ...
  546.12 +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  546.13 +collect2: ld returned 1 exit status
  546.14 +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  546.15 +
  546.16 +when building glibc with --enable-static-nss.
  546.17 +
  546.18 +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  546.19 +
  546.20 +--- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  546.21 ++++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  546.22 +@@ -510,7 +510,7 @@
  546.23 + 
  546.24 + # The static libraries.
  546.25 + ifeq (yes,$(build-static))
  546.26 +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  546.27 ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  546.28 + else
  546.29 + ifeq (yes,$(build-shared))
  546.30 + # We can try to link the programs with lib*_pic.a...
  546.31 +--- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  546.32 ++++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  546.33 +@@ -120,6 +120,13 @@
  546.34 + install-bin-script = ldd
  546.35 + endif
  546.36 + 
  546.37 ++ifeq (yes,$(build-static-nss))
  546.38 ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  546.39 ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  546.40 ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  546.41 ++	     $(resolvobjdir)/libresolv.a
  546.42 ++endif
  546.43 ++
  546.44 + others		= sprof sln
  546.45 + install-bin	= sprof
  546.46 + others-static   = sln
  546.47 +
  546.48 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   547.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   547.2 +++ b/patches/glibc/2.5.1/130-i686-assembler.patch	Mon Jul 28 21:32:33 2008 +0000
   547.3 @@ -0,0 +1,38 @@
   547.4 +2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
   547.5 +
   547.6 +       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
   547.7 +       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
   547.8 +
   547.9 +
  547.10 +
  547.11 +Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
  547.12 +===================================================================
  547.13 +--- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(revision 1469)
  547.14 ++++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(working copy)
  547.15 +@@ -29,6 +29,10 @@
  547.16 + #include <dl-sysdep.h>
  547.17 + #include <tls.h>
  547.18 + 
  547.19 ++#if defined __i686 && defined __ASSEMBLER__
  547.20 ++#undef __i686
  547.21 ++#define __i686 __i686
  547.22 ++#endif
  547.23 + 
  547.24 + /* For Linux we can use the system call table in the header file
  547.25 + 	/usr/include/asm/unistd.h
  547.26 +Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
  547.27 +===================================================================
  547.28 +--- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(revision 1469)
  547.29 ++++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(working copy)
  547.30 +@@ -45,6 +45,11 @@
  547.31 + /* Embed an #include to pull in the alignment and .end directives. */
  547.32 + asm ("\n#include \"defs.h\"");
  547.33 + 
  547.34 ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
  547.35 ++asm ("\n#undef __i686");
  547.36 ++asm ("\n#define __i686 __i686");
  547.37 ++asm ("\n#endif");
  547.38 ++
  547.39 + /* The initial common code ends here. */
  547.40 + asm ("\n/*@HEADER_ENDS*/");
  547.41 + 
   548.1 --- a/patches/glibc/2.5.1/140-configure-apple-as.patch	Mon Jul 28 21:08:01 2008 +0000
   548.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   548.3 @@ -1,25 +0,0 @@
   548.4 -http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
   548.5 -http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
   548.6 -
   548.7 -The following makes it possible to configure glibc-2.3.2 on Mac OS X,
   548.8 -where the assembler but doesn't understand the --version flag.
   548.9 -
  548.10 -Fixes the symptom
  548.11 -checking whether ld is GNU ld... no
  548.12 -checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
  548.13 -checking version of /usr/libexec/gcc/darwin/ppc/as... 
  548.14 -<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
  548.15 -
  548.16 ---- glibc-2.3.2/configure~	Wed Feb 26 09:20:48 2003
  548.17 -+++ glibc-2.3.2/configure	Fri Feb 27 13:12:53 2004
  548.18 -@@ -4039,7 +4039,7 @@
  548.19 -   # Found it, now check the version.
  548.20 -   echo "$as_me:$LINENO: checking version of $AS" >&5
  548.21 - echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
  548.22 --  ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  548.23 -+  ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  548.24 -   case $ac_prog_version in
  548.25 -     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  548.26 -     2.1[3-9]*)
  548.27 -
  548.28 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   549.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   549.2 +++ b/patches/glibc/2.5.1/140-i386-preferred-stack-boundary.patch	Mon Jul 28 21:32:33 2008 +0000
   549.3 @@ -0,0 +1,18 @@
   549.4 +(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
   549.5 +License: LGPL v2.1
   549.6 +
   549.7 +Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
   549.8 +and 2 is not.
   549.9 +
  549.10 +diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
  549.11 +--- glibc-2.5.orig/sysdeps/i386/Makefile	2005-03-06 01:18:16.000000000 +0100
  549.12 ++++ glibc-2.5/sysdeps/i386/Makefile	2007-05-27 17:49:37.000000000 +0200
  549.13 +@@ -36,7 +36,7 @@
  549.14 + ifeq ($(subdir),csu)
  549.15 + sysdep-CFLAGS += -mpreferred-stack-boundary=4
  549.16 + else
  549.17 +-sysdep-CFLAGS += -mpreferred-stack-boundary=2
  549.18 ++sysdep-CFLAGS += -mpreferred-stack-boundary=4
  549.19 + # Likewise, any function which calls user callbacks
  549.20 + uses-callbacks += -mpreferred-stack-boundary=4
  549.21 + # Likewise, any stack alignment tests
   550.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   550.2 +++ b/patches/glibc/2.5.1/150-alpha-asm_page.patch	Mon Jul 28 21:32:33 2008 +0000
   550.3 @@ -0,0 +1,26 @@
   550.4 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   550.5 +
   550.6 +	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   550.7 +	from the kernel header to sys/user.h and remove the #include of
   550.8 +	sys/user.h.
   550.9 +
  550.10 +--- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  550.11 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  550.12 +@@ -23,7 +23,6 @@
  550.13 +    only. Don't read too much into it. Don't use it for anything other
  550.14 +    than gdb/strace unless you know what you are doing. */
  550.15 + 
  550.16 +-#include <asm/page.h>
  550.17 + #include <asm/reg.h>
  550.18 + 
  550.19 + struct user
  550.20 +@@ -41,6 +40,9 @@ struct user
  550.21 +   char u_comm[32];				/* user command name */
  550.22 + };
  550.23 + 
  550.24 ++#define PAGE_SHIFT		13
  550.25 ++#define PAGE_SIZE		(1 << PAGE_SHIFT)
  550.26 ++#define PAGE_MASK		(~(PAGE_SIZE-1))
  550.27 + #define NBPG			PAGE_SIZE
  550.28 + #define UPAGES			1
  550.29 + #define HOST_TEXT_START_ADDR	(u.start_code)
   551.1 --- a/patches/glibc/2.5.1/150-fix-pr631.patch	Mon Jul 28 21:08:01 2008 +0000
   551.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   551.3 @@ -1,45 +0,0 @@
   551.4 -From dank@kegel.com
   551.5 -Wed Jun 15 09:12:43 PDT 2005
   551.6 -
   551.7 -Fixes
   551.8 -
   551.9 -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  551.10 -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  551.11 -... 53 lines deleted ...
  551.12 -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  551.13 -collect2: ld returned 1 exit status
  551.14 -make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  551.15 -
  551.16 -when building glibc with --enable-static-nss.
  551.17 -
  551.18 -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  551.19 -
  551.20 ---- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  551.21 -+++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  551.22 -@@ -510,7 +510,7 @@
  551.23 - 
  551.24 - # The static libraries.
  551.25 - ifeq (yes,$(build-static))
  551.26 --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  551.27 -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  551.28 - else
  551.29 - ifeq (yes,$(build-shared))
  551.30 - # We can try to link the programs with lib*_pic.a...
  551.31 ---- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  551.32 -+++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  551.33 -@@ -120,6 +120,13 @@
  551.34 - install-bin-script = ldd
  551.35 - endif
  551.36 - 
  551.37 -+ifeq (yes,$(build-static-nss))
  551.38 -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  551.39 -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  551.40 -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  551.41 -+	     $(resolvobjdir)/libresolv.a
  551.42 -+endif
  551.43 -+
  551.44 - others		= sprof sln
  551.45 - install-bin	= sprof
  551.46 - others-static   = sln
  551.47 -
  551.48 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   552.1 --- a/patches/glibc/2.5.1/160-i686-assembler.patch	Mon Jul 28 21:08:01 2008 +0000
   552.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   552.3 @@ -1,38 +0,0 @@
   552.4 -2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
   552.5 -
   552.6 -       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
   552.7 -       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
   552.8 -
   552.9 -
  552.10 -
  552.11 -Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
  552.12 -===================================================================
  552.13 ---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(revision 1469)
  552.14 -+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(working copy)
  552.15 -@@ -29,6 +29,10 @@
  552.16 - #include <dl-sysdep.h>
  552.17 - #include <tls.h>
  552.18 - 
  552.19 -+#if defined __i686 && defined __ASSEMBLER__
  552.20 -+#undef __i686
  552.21 -+#define __i686 __i686
  552.22 -+#endif
  552.23 - 
  552.24 - /* For Linux we can use the system call table in the header file
  552.25 - 	/usr/include/asm/unistd.h
  552.26 -Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
  552.27 -===================================================================
  552.28 ---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(revision 1469)
  552.29 -+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(working copy)
  552.30 -@@ -45,6 +45,11 @@
  552.31 - /* Embed an #include to pull in the alignment and .end directives. */
  552.32 - asm ("\n#include \"defs.h\"");
  552.33 - 
  552.34 -+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
  552.35 -+asm ("\n#undef __i686");
  552.36 -+asm ("\n#define __i686 __i686");
  552.37 -+asm ("\n#endif");
  552.38 -+
  552.39 - /* The initial common code ends here. */
  552.40 - asm ("\n/*@HEADER_ENDS*/");
  552.41 - 
   553.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   553.2 +++ b/patches/glibc/2.5.1/160-use_short_for_fnstsw.patch	Mon Jul 28 21:32:33 2008 +0000
   553.3 @@ -0,0 +1,18 @@
   553.4 +Original patch from H.J. Lu, as reported there:
   553.5 +http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   553.6 +
   553.7 +fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   553.8 +The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   553.9 +
  553.10 +diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
  553.11 +--- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  553.12 ++++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:56:14.000000000 +0200
  553.13 +@@ -26,7 +26,7 @@
  553.14 + int
  553.15 + fetestexcept (int excepts)
  553.16 + {
  553.17 +-  int temp;
  553.18 ++  short temp;
  553.19 +   int xtemp = 0;
  553.20 + 
  553.21 +   /* Get current exceptions.  */
   554.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   554.2 +++ b/patches/glibc/2.5.1/170-alpha-asm_elf.patch	Mon Jul 28 21:32:33 2008 +0000
   554.3 @@ -0,0 +1,194 @@
   554.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   554.5 +common code, alpha, and sh fail when used.  this should things up.
   554.6 +-mike
   554.7 +
   554.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   554.9 +
  554.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  554.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  554.12 +	definitions from the kernel header to sys/procfs.h and remove the
  554.13 +	#include of asm/elf.h.
  554.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  554.15 +
  554.16 +*Attachment: signature.asc <msg00012/signature.asc>*
  554.17 +/Description:/ This is a digitally signed message part.
  554.18 +
  554.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  554.20 +
  554.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  554.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  554.23 +	definitions from the kernel header to sys/procfs.h and remove the
  554.24 +	#include of asm/elf.h.
  554.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  554.26 +
  554.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  554.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  554.29 +@@ -29,10 +29,23 @@
  554.30 + #include <sys/types.h>
  554.31 + #include <sys/ucontext.h>
  554.32 + #include <sys/user.h>
  554.33 +-#include <asm/elf.h>
  554.34 + 
  554.35 + __BEGIN_DECLS
  554.36 + 
  554.37 ++/*
  554.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  554.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
  554.40 ++ * (32 general regs + processor status word).
  554.41 ++ */
  554.42 ++#define ELF_NGREG  33
  554.43 ++#define ELF_NFPREG 32
  554.44 ++
  554.45 ++typedef unsigned long elf_greg_t;
  554.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  554.47 ++
  554.48 ++typedef double elf_fpreg_t;
  554.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  554.50 ++
  554.51 + struct elf_siginfo
  554.52 +   {
  554.53 +     int si_signo;			/* Signal number.  */
  554.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  554.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  554.56 +@@ -29,10 +29,19 @@
  554.57 + #include <sys/types.h>
  554.58 + #include <sys/ucontext.h>
  554.59 + #include <sys/user.h>
  554.60 +-#include <asm/elf.h>
  554.61 + 
  554.62 + __BEGIN_DECLS
  554.63 + 
  554.64 ++/*
  554.65 ++ * ELF register definitions...
  554.66 ++ */
  554.67 ++typedef unsigned long elf_greg_t;
  554.68 ++
  554.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  554.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  554.71 ++
  554.72 ++typedef struct user_fpu_struct elf_fpregset_t;
  554.73 ++
  554.74 + struct elf_siginfo
  554.75 +   {
  554.76 +     int si_signo;			/* Signal number.  */
  554.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
  554.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  554.79 +@@ -1,115 +1,2 @@
  554.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  554.81 +-   This file is part of the GNU C Library.
  554.82 +-
  554.83 +-   The GNU C Library is free software; you can redistribute it and/or
  554.84 +-   modify it under the terms of the GNU Lesser General Public
  554.85 +-   License as published by the Free Software Foundation; either
  554.86 +-   version 2.1 of the License, or (at your option) any later version.
  554.87 +-
  554.88 +-   The GNU C Library is distributed in the hope that it will be useful,
  554.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
  554.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  554.91 +-   Lesser General Public License for more details.
  554.92 +-
  554.93 +-   You should have received a copy of the GNU Lesser General Public
  554.94 +-   License along with the GNU C Library; if not, write to the Free
  554.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  554.96 +-   02111-1307 USA.  */
  554.97 +-
  554.98 +-#ifndef _SYS_PROCFS_H
  554.99 +-#define _SYS_PROCFS_H	1
 554.100 +-
 554.101 +-/* This is somehow modelled after the file of the same name on SysVr4
 554.102 +-   systems.  It provides a definition of the core file format for ELF
 554.103 +-   used on Linux.  */
 554.104 +-
 554.105 +-#include <features.h>
 554.106 +-#include <signal.h>
 554.107 +-#include <sys/time.h>
 554.108 +-#include <sys/types.h>
 554.109 +-#include <sys/ucontext.h>
 554.110 +-#include <sys/user.h>
 554.111 +-#include <asm/elf.h>
 554.112 +-
 554.113 +-__BEGIN_DECLS
 554.114 +-
 554.115 +-struct elf_siginfo
 554.116 +-  {
 554.117 +-    int si_signo;			/* Signal number.  */
 554.118 +-    int si_code;			/* Extra code.  */
 554.119 +-    int si_errno;			/* Errno.  */
 554.120 +-  };
 554.121 +-
 554.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
 554.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
 554.124 +-   front to prevent clashes with linux definitions, and the typedef
 554.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
 554.126 +-   but more Linuxy, with things that Linux does not support and which
 554.127 +-   gdb doesn't really use excluded.  Fields present but not used are
 554.128 +-   marked with "XXX".  */
 554.129 +-struct elf_prstatus
 554.130 +-  {
 554.131 +-#if 0
 554.132 +-    long int pr_flags;			/* XXX Process flags.  */
 554.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
 554.134 +-    short int pr_what;			/* XXX More detailed reason.  */
 554.135 +-#endif
 554.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 554.137 +-    short int pr_cursig;		/* Current signal.  */
 554.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 554.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
 554.140 +-#if 0
 554.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 554.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
 554.143 +-#endif
 554.144 +-    __pid_t pr_pid;
 554.145 +-    __pid_t pr_ppid;
 554.146 +-    __pid_t pr_pgrp;
 554.147 +-    __pid_t pr_sid;
 554.148 +-    struct timeval pr_utime;		/* User time.  */
 554.149 +-    struct timeval pr_stime;		/* System time.  */
 554.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
 554.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
 554.152 +-#if 0
 554.153 +-    long int pr_instr;			/* Current instruction.  */
 554.154 +-#endif
 554.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
 554.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
 554.157 +-  };
 554.158 +-
 554.159 +-
 554.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 554.161 +-
 554.162 +-struct elf_prpsinfo
 554.163 +-  {
 554.164 +-    char pr_state;			/* Numeric process state.  */
 554.165 +-    char pr_sname;			/* Char for pr_state.  */
 554.166 +-    char pr_zomb;			/* Zombie.  */
 554.167 +-    char pr_nice;			/* Nice val.  */
 554.168 +-    unsigned long int pr_flag;		/* Flags.  */
 554.169 +-    unsigned short int pr_uid;
 554.170 +-    unsigned short int pr_gid;
 554.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 554.172 +-    /* Lots missing */
 554.173 +-    char pr_fname[16];			/* Filename of executable.  */
 554.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 554.175 +-  };
 554.176 +-
 554.177 +-/* Addresses.  */
 554.178 +-typedef void *psaddr_t;
 554.179 +-
 554.180 +-/* Register sets.  Linux has different names.  */
 554.181 +-typedef gregset_t prgregset_t;
 554.182 +-typedef fpregset_t prfpregset_t;
 554.183 +-
 554.184 +-/* We don't have any differences between processes and threads,
 554.185 +-   therefore habe only ine PID type.  */
 554.186 +-typedef __pid_t lwpid_t;
 554.187 +-
 554.188 +-
 554.189 +-typedef struct elf_prstatus prstatus_t;
 554.190 +-typedef struct elf_prpsinfo prpsinfo_t;
 554.191 +-
 554.192 +-__END_DECLS
 554.193 +-
 554.194 +-#endif	/* sys/procfs.h */
 554.195 ++/* sys/procfs.h is architecture specific.  */
 554.196 ++#error "This file must be supplied by every Linux architecture."
 554.197 +
   555.1 --- a/patches/glibc/2.5.1/170-i386-preferred-stack-boundary.patch	Mon Jul 28 21:08:01 2008 +0000
   555.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   555.3 @@ -1,18 +0,0 @@
   555.4 -(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
   555.5 -License: LGPL v2.1
   555.6 -
   555.7 -Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
   555.8 -and 2 is not.
   555.9 -
  555.10 -diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
  555.11 ---- glibc-2.5.orig/sysdeps/i386/Makefile	2005-03-06 01:18:16.000000000 +0100
  555.12 -+++ glibc-2.5/sysdeps/i386/Makefile	2007-05-27 17:49:37.000000000 +0200
  555.13 -@@ -36,7 +36,7 @@
  555.14 - ifeq ($(subdir),csu)
  555.15 - sysdep-CFLAGS += -mpreferred-stack-boundary=4
  555.16 - else
  555.17 --sysdep-CFLAGS += -mpreferred-stack-boundary=2
  555.18 -+sysdep-CFLAGS += -mpreferred-stack-boundary=4
  555.19 - # Likewise, any function which calls user callbacks
  555.20 - uses-callbacks += -mpreferred-stack-boundary=4
  555.21 - # Likewise, any stack alignment tests
   556.1 --- a/patches/glibc/2.5.1/180-alpha-asm_page.patch	Mon Jul 28 21:08:01 2008 +0000
   556.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   556.3 @@ -1,26 +0,0 @@
   556.4 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   556.5 -
   556.6 -	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   556.7 -	from the kernel header to sys/user.h and remove the #include of
   556.8 -	sys/user.h.
   556.9 -
  556.10 ---- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  556.11 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  556.12 -@@ -23,7 +23,6 @@
  556.13 -    only. Don't read too much into it. Don't use it for anything other
  556.14 -    than gdb/strace unless you know what you are doing. */
  556.15 - 
  556.16 --#include <asm/page.h>
  556.17 - #include <asm/reg.h>
  556.18 - 
  556.19 - struct user
  556.20 -@@ -41,6 +40,9 @@ struct user
  556.21 -   char u_comm[32];				/* user command name */
  556.22 - };
  556.23 - 
  556.24 -+#define PAGE_SHIFT		13
  556.25 -+#define PAGE_SIZE		(1 << PAGE_SHIFT)
  556.26 -+#define PAGE_MASK		(~(PAGE_SIZE-1))
  556.27 - #define NBPG			PAGE_SIZE
  556.28 - #define UPAGES			1
  556.29 - #define HOST_TEXT_START_ADDR	(u.start_code)
   557.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   557.2 +++ b/patches/glibc/2.5.1/180-alpha-cfi.patch	Mon Jul 28 21:32:33 2008 +0000
   557.3 @@ -0,0 +1,25 @@
   557.4 +--- libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h    2006/10/29 21:48:06     1.6
   557.5 ++++ libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h    2007/03/13 21:28:03     1.7
   557.6 +@@ -55,6 +55,7 @@
   557.7 + 	bne	a3, SYSCALL_ERROR_LABEL;			\
   557.8 + __LABEL($pseudo_ret)						\
   557.9 + 	.subsection 2;						\
  557.10 ++	cfi_startproc;						\
  557.11 + __LABEL($pseudo_cancel)						\
  557.12 + 	subq	sp, 64, sp;					\
  557.13 + 	cfi_def_cfa_offset(64);					\
  557.14 +@@ -90,12 +91,13 @@
  557.15 + 	cfi_def_cfa_offset(0);					\
  557.16 + __LABEL($syscall_error)						\
  557.17 + 	SYSCALL_ERROR_HANDLER;					\
  557.18 ++	cfi_endproc;						\
  557.19 + 	.previous
  557.20 + 
  557.21 + # undef PSEUDO_END
  557.22 + # define PSEUDO_END(sym)					\
  557.23 +-	.subsection 2;						\
  557.24 + 	cfi_endproc;						\
  557.25 ++	.subsection 2;						\
  557.26 + 	.size sym, .-sym
  557.27 + 
  557.28 + # define SAVE_ARGS_0	/* Nothing.  */
   558.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   558.2 +++ b/patches/glibc/2.5.1/190-alpha-sigsuspend.patch	Mon Jul 28 21:32:33 2008 +0000
   558.3 @@ -0,0 +1,24 @@
   558.4 +--- glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S.orig	2006-10-22 22:17:01.000000000 +0200
   558.5 ++++ glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S	2006-10-22 22:18:05.000000000 +0200
   558.6 +@@ -31,3 +31,21 @@
   558.7 + libc_hidden_def (__sigsuspend)
   558.8 + weak_alias (__sigsuspend, sigsuspend)
   558.9 + strong_alias (__sigsuspend, __libc_sigsuspend)
  558.10 ++
  558.11 ++#ifndef NO_CANCELLATION
  558.12 ++	.globl __sigsuspend_nocancel;
  558.13 ++	.align 4;
  558.14 ++	.type __sigsuspend_nocancel, @function;
  558.15 ++	.usepv __sigsuspend_nocancel, std;
  558.16 ++	cfi_startproc;
  558.17 ++__LABEL(__sigsuspend_nocancel)
  558.18 ++	ldgp    gp, 0(pv);
  558.19 ++	PSEUDO_PROF;
  558.20 ++	PSEUDO_PREPARE_ARGS
  558.21 ++	lda     v0, SYS_ify(sigsuspend);
  558.22 ++	call_pal PAL_callsys;
  558.23 ++	bne     a3, SYSCALL_ERROR_LABEL;
  558.24 ++	ret;
  558.25 ++	cfi_endproc;
  558.26 ++	.size __sigsuspend_nocancel, .-__sigsuspend_nocancel
  558.27 ++#endif
   559.1 --- a/patches/glibc/2.5.1/190-use_short_for_fnstsw.patch	Mon Jul 28 21:08:01 2008 +0000
   559.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   559.3 @@ -1,18 +0,0 @@
   559.4 -Original patch from H.J. Lu, as reported there:
   559.5 -http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   559.6 -
   559.7 -fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   559.8 -The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   559.9 -
  559.10 -diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
  559.11 ---- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  559.12 -+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:56:14.000000000 +0200
  559.13 -@@ -26,7 +26,7 @@
  559.14 - int
  559.15 - fetestexcept (int excepts)
  559.16 - {
  559.17 --  int temp;
  559.18 -+  short temp;
  559.19 -   int xtemp = 0;
  559.20 - 
  559.21 -   /* Get current exceptions.  */
   560.1 --- a/patches/glibc/2.5.1/260-alpha-asm_elf.patch	Mon Jul 28 21:08:01 2008 +0000
   560.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   560.3 @@ -1,194 +0,0 @@
   560.4 -since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   560.5 -common code, alpha, and sh fail when used.  this should things up.
   560.6 --mike
   560.7 -
   560.8 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   560.9 -
  560.10 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  560.11 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  560.12 -	definitions from the kernel header to sys/procfs.h and remove the
  560.13 -	#include of asm/elf.h.
  560.14 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  560.15 -
  560.16 -*Attachment: signature.asc <msg00012/signature.asc>*
  560.17 -/Description:/ This is a digitally signed message part.
  560.18 -
  560.19 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  560.20 -
  560.21 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  560.22 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  560.23 -	definitions from the kernel header to sys/procfs.h and remove the
  560.24 -	#include of asm/elf.h.
  560.25 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  560.26 -
  560.27 ---- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  560.28 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  560.29 -@@ -29,10 +29,23 @@
  560.30 - #include <sys/types.h>
  560.31 - #include <sys/ucontext.h>
  560.32 - #include <sys/user.h>
  560.33 --#include <asm/elf.h>
  560.34 - 
  560.35 - __BEGIN_DECLS
  560.36 - 
  560.37 -+/*
  560.38 -+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  560.39 -+ * I have no idea why that is so.  For now, we just leave it at 33
  560.40 -+ * (32 general regs + processor status word).
  560.41 -+ */
  560.42 -+#define ELF_NGREG  33
  560.43 -+#define ELF_NFPREG 32
  560.44 -+
  560.45 -+typedef unsigned long elf_greg_t;
  560.46 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  560.47 -+
  560.48 -+typedef double elf_fpreg_t;
  560.49 -+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  560.50 -+
  560.51 - struct elf_siginfo
  560.52 -   {
  560.53 -     int si_signo;			/* Signal number.  */
  560.54 ---- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  560.55 -+++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  560.56 -@@ -29,10 +29,19 @@
  560.57 - #include <sys/types.h>
  560.58 - #include <sys/ucontext.h>
  560.59 - #include <sys/user.h>
  560.60 --#include <asm/elf.h>
  560.61 - 
  560.62 - __BEGIN_DECLS
  560.63 - 
  560.64 -+/*
  560.65 -+ * ELF register definitions...
  560.66 -+ */
  560.67 -+typedef unsigned long elf_greg_t;
  560.68 -+
  560.69 -+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  560.70 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  560.71 -+
  560.72 -+typedef struct user_fpu_struct elf_fpregset_t;
  560.73 -+
  560.74 - struct elf_siginfo
  560.75 -   {
  560.76 -     int si_signo;			/* Signal number.  */
  560.77 ---- a/sysdeps/unix/sysv/linux/sys/procfs.h
  560.78 -+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  560.79 -@@ -1,115 +1,2 @@
  560.80 --/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  560.81 --   This file is part of the GNU C Library.
  560.82 --
  560.83 --   The GNU C Library is free software; you can redistribute it and/or
  560.84 --   modify it under the terms of the GNU Lesser General Public
  560.85 --   License as published by the Free Software Foundation; either
  560.86 --   version 2.1 of the License, or (at your option) any later version.
  560.87 --
  560.88 --   The GNU C Library is distributed in the hope that it will be useful,
  560.89 --   but WITHOUT ANY WARRANTY; without even the implied warranty of
  560.90 --   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  560.91 --   Lesser General Public License for more details.
  560.92 --
  560.93 --   You should have received a copy of the GNU Lesser General Public
  560.94 --   License along with the GNU C Library; if not, write to the Free
  560.95 --   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  560.96 --   02111-1307 USA.  */
  560.97 --
  560.98 --#ifndef _SYS_PROCFS_H
  560.99 --#define _SYS_PROCFS_H	1
 560.100 --
 560.101 --/* This is somehow modelled after the file of the same name on SysVr4
 560.102 --   systems.  It provides a definition of the core file format for ELF
 560.103 --   used on Linux.  */
 560.104 --
 560.105 --#include <features.h>
 560.106 --#include <signal.h>
 560.107 --#include <sys/time.h>
 560.108 --#include <sys/types.h>
 560.109 --#include <sys/ucontext.h>
 560.110 --#include <sys/user.h>
 560.111 --#include <asm/elf.h>
 560.112 --
 560.113 --__BEGIN_DECLS
 560.114 --
 560.115 --struct elf_siginfo
 560.116 --  {
 560.117 --    int si_signo;			/* Signal number.  */
 560.118 --    int si_code;			/* Extra code.  */
 560.119 --    int si_errno;			/* Errno.  */
 560.120 --  };
 560.121 --
 560.122 --/* Definitions to generate Intel SVR4-like core files.  These mostly
 560.123 --   have the same names as the SVR4 types with "elf_" tacked on the
 560.124 --   front to prevent clashes with linux definitions, and the typedef
 560.125 --   forms have been avoided.  This is mostly like the SVR4 structure,
 560.126 --   but more Linuxy, with things that Linux does not support and which
 560.127 --   gdb doesn't really use excluded.  Fields present but not used are
 560.128 --   marked with "XXX".  */
 560.129 --struct elf_prstatus
 560.130 --  {
 560.131 --#if 0
 560.132 --    long int pr_flags;			/* XXX Process flags.  */
 560.133 --    short int pr_why;			/* XXX Reason for process halt.  */
 560.134 --    short int pr_what;			/* XXX More detailed reason.  */
 560.135 --#endif
 560.136 --    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 560.137 --    short int pr_cursig;		/* Current signal.  */
 560.138 --    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 560.139 --    unsigned long int pr_sighold;	/* Set of held signals.  */
 560.140 --#if 0
 560.141 --    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 560.142 --    struct sigaction pr_action;		/* Signal action for current sig.  */
 560.143 --#endif
 560.144 --    __pid_t pr_pid;
 560.145 --    __pid_t pr_ppid;
 560.146 --    __pid_t pr_pgrp;
 560.147 --    __pid_t pr_sid;
 560.148 --    struct timeval pr_utime;		/* User time.  */
 560.149 --    struct timeval pr_stime;		/* System time.  */
 560.150 --    struct timeval pr_cutime;		/* Cumulative user time.  */
 560.151 --    struct timeval pr_cstime;		/* Cumulative system time.  */
 560.152 --#if 0
 560.153 --    long int pr_instr;			/* Current instruction.  */
 560.154 --#endif
 560.155 --    elf_gregset_t pr_reg;		/* GP registers.  */
 560.156 --    int pr_fpvalid;			/* True if math copro being used.  */
 560.157 --  };
 560.158 --
 560.159 --
 560.160 --#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 560.161 --
 560.162 --struct elf_prpsinfo
 560.163 --  {
 560.164 --    char pr_state;			/* Numeric process state.  */
 560.165 --    char pr_sname;			/* Char for pr_state.  */
 560.166 --    char pr_zomb;			/* Zombie.  */
 560.167 --    char pr_nice;			/* Nice val.  */
 560.168 --    unsigned long int pr_flag;		/* Flags.  */
 560.169 --    unsigned short int pr_uid;
 560.170 --    unsigned short int pr_gid;
 560.171 --    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 560.172 --    /* Lots missing */
 560.173 --    char pr_fname[16];			/* Filename of executable.  */
 560.174 --    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 560.175 --  };
 560.176 --
 560.177 --/* Addresses.  */
 560.178 --typedef void *psaddr_t;
 560.179 --
 560.180 --/* Register sets.  Linux has different names.  */
 560.181 --typedef gregset_t prgregset_t;
 560.182 --typedef fpregset_t prfpregset_t;
 560.183 --
 560.184 --/* We don't have any differences between processes and threads,
 560.185 --   therefore habe only ine PID type.  */
 560.186 --typedef __pid_t lwpid_t;
 560.187 --
 560.188 --
 560.189 --typedef struct elf_prstatus prstatus_t;
 560.190 --typedef struct elf_prpsinfo prpsinfo_t;
 560.191 --
 560.192 --__END_DECLS
 560.193 --
 560.194 --#endif	/* sys/procfs.h */
 560.195 -+/* sys/procfs.h is architecture specific.  */
 560.196 -+#error "This file must be supplied by every Linux architecture."
 560.197 -
   561.1 --- a/patches/glibc/2.5.1/270-alpha-cfi.patch	Mon Jul 28 21:08:01 2008 +0000
   561.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   561.3 @@ -1,25 +0,0 @@
   561.4 ---- libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h    2006/10/29 21:48:06     1.6
   561.5 -+++ libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h    2007/03/13 21:28:03     1.7
   561.6 -@@ -55,6 +55,7 @@
   561.7 - 	bne	a3, SYSCALL_ERROR_LABEL;			\
   561.8 - __LABEL($pseudo_ret)						\
   561.9 - 	.subsection 2;						\
  561.10 -+	cfi_startproc;						\
  561.11 - __LABEL($pseudo_cancel)						\
  561.12 - 	subq	sp, 64, sp;					\
  561.13 - 	cfi_def_cfa_offset(64);					\
  561.14 -@@ -90,12 +91,13 @@
  561.15 - 	cfi_def_cfa_offset(0);					\
  561.16 - __LABEL($syscall_error)						\
  561.17 - 	SYSCALL_ERROR_HANDLER;					\
  561.18 -+	cfi_endproc;						\
  561.19 - 	.previous
  561.20 - 
  561.21 - # undef PSEUDO_END
  561.22 - # define PSEUDO_END(sym)					\
  561.23 --	.subsection 2;						\
  561.24 - 	cfi_endproc;						\
  561.25 -+	.subsection 2;						\
  561.26 - 	.size sym, .-sym
  561.27 - 
  561.28 - # define SAVE_ARGS_0	/* Nothing.  */
   562.1 --- a/patches/glibc/2.5.1/280-alpha-sigsuspend.patch	Mon Jul 28 21:08:01 2008 +0000
   562.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   562.3 @@ -1,24 +0,0 @@
   562.4 ---- glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S.orig	2006-10-22 22:17:01.000000000 +0200
   562.5 -+++ glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S	2006-10-22 22:18:05.000000000 +0200
   562.6 -@@ -31,3 +31,21 @@
   562.7 - libc_hidden_def (__sigsuspend)
   562.8 - weak_alias (__sigsuspend, sigsuspend)
   562.9 - strong_alias (__sigsuspend, __libc_sigsuspend)
  562.10 -+
  562.11 -+#ifndef NO_CANCELLATION
  562.12 -+	.globl __sigsuspend_nocancel;
  562.13 -+	.align 4;
  562.14 -+	.type __sigsuspend_nocancel, @function;
  562.15 -+	.usepv __sigsuspend_nocancel, std;
  562.16 -+	cfi_startproc;
  562.17 -+__LABEL(__sigsuspend_nocancel)
  562.18 -+	ldgp    gp, 0(pv);
  562.19 -+	PSEUDO_PROF;
  562.20 -+	PSEUDO_PREPARE_ARGS
  562.21 -+	lda     v0, SYS_ify(sigsuspend);
  562.22 -+	call_pal PAL_callsys;
  562.23 -+	bne     a3, SYSCALL_ERROR_LABEL;
  562.24 -+	ret;
  562.25 -+	cfi_endproc;
  562.26 -+	.size __sigsuspend_nocancel, .-__sigsuspend_nocancel
  562.27 -+#endif
   563.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   563.2 +++ b/patches/glibc/2.5/100-cygwin.patch	Mon Jul 28 21:32:33 2008 +0000
   563.3 @@ -0,0 +1,187 @@
   563.4 +Fixes
   563.5 +elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
   563.6 +...
   563.7 +when building glibc-2.3.x on cygwin
   563.8 +
   563.9 +Idea from
  563.10 +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
  563.11 +Basically, make glibc use .oST as suffix for 'object static'
  563.12 +instead of .oS, since cygwin has trouble distinguishing .os from .oS
  563.13 +(Original patch had .on, but .oST is more mnemonic for 'object static')
  563.14 +
  563.15 +glibc-linuxthreads-2.3.5 also requires a patch, see 
  563.16 +../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
  563.17 +
  563.18 +[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
  563.19 +
  563.20 +Message-ID: <4282FCBA.3040000@unicontrols.cz>
  563.21 +Date: Thu, 12 May 2005 08:50:34 +0200
  563.22 +From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
  563.23 +To: Dan Kegel <dank@kegel.com>
  563.24 +CC:  crossgcc@sources.redhat.com
  563.25 +Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
  563.26 +
  563.27 +Hi Dan,
  563.28 +following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
  563.29 +on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
  563.30 +
  563.31 +-- 
  563.32 +                     Petr Cvachoucek
  563.33 +                     Unicontrols a.s.
  563.34 +                     http://www.unicontrols.cz
  563.35 +]
  563.36 +
  563.37 +diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
  563.38 +--- glibc-2.3.5/Makeconfig	2005-02-16 11:50:19.000000000 +0100
  563.39 ++++ glibc-2.3.5-cygwin/Makeconfig	2005-05-11 08:24:51.046875000 +0200
  563.40 +@@ -472,7 +472,7 @@
  563.41 + # run the linked programs.
  563.42 + link-libc = -Wl,-rpath-link=$(rpath-link) \
  563.43 + 	    $(common-objpfx)libc.so$(libc.so-version) \
  563.44 +-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
  563.45 ++	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
  563.46 + # This is how to find at build-time things that will be installed there.
  563.47 + rpath-dirs = math elf dlfcn nss nis rt resolv crypt
  563.48 + endif
  563.49 +@@ -693,7 +693,7 @@
  563.50 + # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
  563.51 + # to pass different flags for each flavor.
  563.52 + libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
  563.53 +-all-object-suffixes := .o .os .op .og .ob .oS
  563.54 ++all-object-suffixes := .o .os .op .og .ob .oST
  563.55 + object-suffixes :=
  563.56 + CPPFLAGS-.o = $(pic-default)
  563.57 + CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
  563.58 +@@ -749,14 +749,14 @@
  563.59 + 
  563.60 + ifeq (yes,$(build-shared))
  563.61 + # Build special library that contains the static-only routines for libc.
  563.62 +-object-suffixes-for-libc += .oS
  563.63 ++object-suffixes-for-libc += .oST
  563.64 + 
  563.65 + # Must build the routines as PIC, though, because they can end up in (users')
  563.66 + # shared objects.  We don't want to use CFLAGS-os because users may, for
  563.67 + # example, make that processor-specific.
  563.68 +-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
  563.69 +-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  563.70 +-libtype.oS = lib%_nonshared.a
  563.71 ++CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
  563.72 ++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  563.73 ++libtype.oST = lib%_nonshared.a
  563.74 + endif
  563.75 + 
  563.76 + # The assembler can generate debug information too.
  563.77 +diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
  563.78 +--- glibc-2.3.5/Makerules	2004-12-15 19:52:39.000000000 +0100
  563.79 ++++ glibc-2.3.5-cygwin/Makerules	2005-05-11 08:25:33.578125000 +0200
  563.80 +@@ -417,7 +417,7 @@
  563.81 + # Bounded pointer thunks are only built for *.ob
  563.82 + elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
  563.83 + 
  563.84 +-elide-routines.oS += $(filter-out $(static-only-routines),\
  563.85 ++elide-routines.oST += $(filter-out $(static-only-routines),\
  563.86 + 				  $(routines) $(aux) $(sysdep_routines)) \
  563.87 + 		     $(elide-bp-thunks)
  563.88 + elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
  563.89 +@@ -981,7 +981,7 @@
  563.90 + install: $(inst_libdir)/libc.so
  563.91 + $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
  563.92 + 			$(common-objpfx)libc.so$(libc.so-version) \
  563.93 +-			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
  563.94 ++			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
  563.95 + 						  $(libprefix)$(libc-name)) \
  563.96 + 			$(+force)
  563.97 + 	(echo '/* GNU ld script';\
  563.98 +@@ -989,7 +989,7 @@
  563.99 + 	 echo '   the static library, so try that secondarily.  */';\
 563.100 + 	 cat $<; \
 563.101 + 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
 563.102 +-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
 563.103 ++	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
 563.104 +	      ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
 563.105 + 	) > $@.new
 563.106 +	mv -f $@.new $@
 563.107 +diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
 563.108 +--- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
 563.109 ++++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
 563.110 +@@ -13,7 +13,7 @@
 563.111 + 
 563.112 + ifneq (,$($(lib)-static-only-routines))
 563.113 + ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
 563.114 +-object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
 563.115 ++object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
 563.116 + endif
 563.117 + endif
 563.118 + 
 563.119 +@@ -29,7 +29,7 @@
 563.120 + 
 563.121 + # Add each flavor of library to the lists of things to build and install.
 563.122 + install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
 563.123 +-extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
 563.124 ++extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
 563.125 + 			$(patsubst %,%$o,$(filter-out \
 563.126 + 					   $($(lib)-shared-only-routines),\
 563.127 + 					   $(all-$(lib)-routines))))
 563.128 +@@ -57,7 +57,7 @@
 563.129 + 
 563.130 + 
 563.131 + # Use o-iterator.mk to generate a rule for each flavor of library.
 563.132 +-ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
 563.133 ++ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
 563.134 + define o-iterator-doit
 563.135 + $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
 563.136 +   $(patsubst %,$(objpfx)%$o,\
 563.137 +@@ -65,7 +65,7 @@
 563.138 + 			  $(all-$(lib)-routines))); \
 563.139 + 	$$(build-extra-lib)
 563.140 + endef
 563.141 +-object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
 563.142 ++object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
 563.143 + include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
 563.144 + endif
 563.145 + 
 563.146 +@@ -77,9 +77,9 @@
 563.147 + 	$(build-extra-lib)
 563.148 + endif
 563.149 + 
 563.150 +-ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
 563.151 +-$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
 563.152 +-  $(patsubst %,$(objpfx)%.oS,\
 563.153 ++ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
 563.154 ++$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
 563.155 ++  $(patsubst %,$(objpfx)%.oST,\
 563.156 + 	     $(filter $($(lib)-static-only-routines),\
 563.157 + 		      $(all-$(lib)-routines)))
 563.158 + 	$(build-extra-lib)
 563.159 +diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
 563.160 +--- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
 563.161 ++++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
 563.162 +@@ -375,7 +375,7 @@
 563.163 + 
 563.164 + $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
 563.165 + 			      $(objpfx)libpthread.so$(libpthread.so-version) \
 563.166 +-			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
 563.167 ++			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
 563.168 + 							$(libprefix)pthread) \
 563.169 + 			      $(+force)
 563.170 + 	(echo '/* GNU ld script';\
 563.171 +@@ -383,7 +383,7 @@
 563.172 + 	 echo '   the static library, so try that secondarily.  */';\
 563.173 + 	 cat $<; \
 563.174 + 	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
 563.175 +-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
 563.176 ++	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
 563.177 + 	      ')' \
 563.178 + 	) > $@.new
 563.179 + 	mv -f $@.new $@
 563.180 +diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
 563.181 +--- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
 563.182 ++++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
 563.183 +@@ -10,4 +10,4 @@
 563.184 + ASFLAGS-.op += -Wa,-Av9a
 563.185 + ASFLAGS-.og += -Wa,-Av9a
 563.186 + ASFLAGS-.ob += -Wa,-Av9a
 563.187 +-ASFLAGS-.oS += -Wa,-Av9a
 563.188 ++ASFLAGS-.oST += -Wa,-Av9a
 563.189 +
 563.190 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   564.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   564.2 +++ b/patches/glibc/2.5/110-configure-apple-as.patch	Mon Jul 28 21:32:33 2008 +0000
   564.3 @@ -0,0 +1,25 @@
   564.4 +http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
   564.5 +http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
   564.6 +
   564.7 +The following makes it possible to configure glibc-2.3.2 on Mac OS X,
   564.8 +where the assembler but doesn't understand the --version flag.
   564.9 +
  564.10 +Fixes the symptom
  564.11 +checking whether ld is GNU ld... no
  564.12 +checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
  564.13 +checking version of /usr/libexec/gcc/darwin/ppc/as... 
  564.14 +<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
  564.15 +
  564.16 +--- glibc-2.3.2/configure~	Wed Feb 26 09:20:48 2003
  564.17 ++++ glibc-2.3.2/configure	Fri Feb 27 13:12:53 2004
  564.18 +@@ -4039,7 +4039,7 @@
  564.19 +   # Found it, now check the version.
  564.20 +   echo "$as_me:$LINENO: checking version of $AS" >&5
  564.21 + echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
  564.22 +-  ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  564.23 ++  ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  564.24 +   case $ac_prog_version in
  564.25 +     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  564.26 +     2.1[3-9]*)
  564.27 +
  564.28 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   565.1 --- a/patches/glibc/2.5/120-cygwin.patch	Mon Jul 28 21:08:01 2008 +0000
   565.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   565.3 @@ -1,187 +0,0 @@
   565.4 -Fixes
   565.5 -elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
   565.6 -...
   565.7 -when building glibc-2.3.x on cygwin
   565.8 -
   565.9 -Idea from
  565.10 -http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
  565.11 -Basically, make glibc use .oST as suffix for 'object static'
  565.12 -instead of .oS, since cygwin has trouble distinguishing .os from .oS
  565.13 -(Original patch had .on, but .oST is more mnemonic for 'object static')
  565.14 -
  565.15 -glibc-linuxthreads-2.3.5 also requires a patch, see 
  565.16 -../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
  565.17 -
  565.18 -[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
  565.19 -
  565.20 -Message-ID: <4282FCBA.3040000@unicontrols.cz>
  565.21 -Date: Thu, 12 May 2005 08:50:34 +0200
  565.22 -From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
  565.23 -To: Dan Kegel <dank@kegel.com>
  565.24 -CC:  crossgcc@sources.redhat.com
  565.25 -Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
  565.26 -
  565.27 -Hi Dan,
  565.28 -following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
  565.29 -on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
  565.30 -
  565.31 --- 
  565.32 -                     Petr Cvachoucek
  565.33 -                     Unicontrols a.s.
  565.34 -                     http://www.unicontrols.cz
  565.35 -]
  565.36 -
  565.37 -diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
  565.38 ---- glibc-2.3.5/Makeconfig	2005-02-16 11:50:19.000000000 +0100
  565.39 -+++ glibc-2.3.5-cygwin/Makeconfig	2005-05-11 08:24:51.046875000 +0200
  565.40 -@@ -472,7 +472,7 @@
  565.41 - # run the linked programs.
  565.42 - link-libc = -Wl,-rpath-link=$(rpath-link) \
  565.43 - 	    $(common-objpfx)libc.so$(libc.so-version) \
  565.44 --	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
  565.45 -+	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
  565.46 - # This is how to find at build-time things that will be installed there.
  565.47 - rpath-dirs = math elf dlfcn nss nis rt resolv crypt
  565.48 - endif
  565.49 -@@ -693,7 +693,7 @@
  565.50 - # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
  565.51 - # to pass different flags for each flavor.
  565.52 - libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
  565.53 --all-object-suffixes := .o .os .op .og .ob .oS
  565.54 -+all-object-suffixes := .o .os .op .og .ob .oST
  565.55 - object-suffixes :=
  565.56 - CPPFLAGS-.o = $(pic-default)
  565.57 - CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
  565.58 -@@ -749,14 +749,14 @@
  565.59 - 
  565.60 - ifeq (yes,$(build-shared))
  565.61 - # Build special library that contains the static-only routines for libc.
  565.62 --object-suffixes-for-libc += .oS
  565.63 -+object-suffixes-for-libc += .oST
  565.64 - 
  565.65 - # Must build the routines as PIC, though, because they can end up in (users')
  565.66 - # shared objects.  We don't want to use CFLAGS-os because users may, for
  565.67 - # example, make that processor-specific.
  565.68 --CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
  565.69 --CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  565.70 --libtype.oS = lib%_nonshared.a
  565.71 -+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
  565.72 -+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  565.73 -+libtype.oST = lib%_nonshared.a
  565.74 - endif
  565.75 - 
  565.76 - # The assembler can generate debug information too.
  565.77 -diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
  565.78 ---- glibc-2.3.5/Makerules	2004-12-15 19:52:39.000000000 +0100
  565.79 -+++ glibc-2.3.5-cygwin/Makerules	2005-05-11 08:25:33.578125000 +0200
  565.80 -@@ -417,7 +417,7 @@
  565.81 - # Bounded pointer thunks are only built for *.ob
  565.82 - elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
  565.83 - 
  565.84 --elide-routines.oS += $(filter-out $(static-only-routines),\
  565.85 -+elide-routines.oST += $(filter-out $(static-only-routines),\
  565.86 - 				  $(routines) $(aux) $(sysdep_routines)) \
  565.87 - 		     $(elide-bp-thunks)
  565.88 - elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
  565.89 -@@ -981,7 +981,7 @@
  565.90 - install: $(inst_libdir)/libc.so
  565.91 - $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
  565.92 - 			$(common-objpfx)libc.so$(libc.so-version) \
  565.93 --			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
  565.94 -+			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
  565.95 - 						  $(libprefix)$(libc-name)) \
  565.96 - 			$(+force)
  565.97 - 	(echo '/* GNU ld script';\
  565.98 -@@ -989,7 +989,7 @@
  565.99 - 	 echo '   the static library, so try that secondarily.  */';\
 565.100 - 	 cat $<; \
 565.101 - 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
 565.102 --	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
 565.103 -+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
 565.104 -	      ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
 565.105 - 	) > $@.new
 565.106 -	mv -f $@.new $@
 565.107 -diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
 565.108 ---- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
 565.109 -+++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
 565.110 -@@ -13,7 +13,7 @@
 565.111 - 
 565.112 - ifneq (,$($(lib)-static-only-routines))
 565.113 - ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
 565.114 --object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
 565.115 -+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
 565.116 - endif
 565.117 - endif
 565.118 - 
 565.119 -@@ -29,7 +29,7 @@
 565.120 - 
 565.121 - # Add each flavor of library to the lists of things to build and install.
 565.122 - install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
 565.123 --extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
 565.124 -+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
 565.125 - 			$(patsubst %,%$o,$(filter-out \
 565.126 - 					   $($(lib)-shared-only-routines),\
 565.127 - 					   $(all-$(lib)-routines))))
 565.128 -@@ -57,7 +57,7 @@
 565.129 - 
 565.130 - 
 565.131 - # Use o-iterator.mk to generate a rule for each flavor of library.
 565.132 --ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
 565.133 -+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
 565.134 - define o-iterator-doit
 565.135 - $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
 565.136 -   $(patsubst %,$(objpfx)%$o,\
 565.137 -@@ -65,7 +65,7 @@
 565.138 - 			  $(all-$(lib)-routines))); \
 565.139 - 	$$(build-extra-lib)
 565.140 - endef
 565.141 --object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
 565.142 -+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
 565.143 - include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
 565.144 - endif
 565.145 - 
 565.146 -@@ -77,9 +77,9 @@
 565.147 - 	$(build-extra-lib)
 565.148 - endif
 565.149 - 
 565.150 --ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
 565.151 --$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
 565.152 --  $(patsubst %,$(objpfx)%.oS,\
 565.153 -+ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
 565.154 -+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
 565.155 -+  $(patsubst %,$(objpfx)%.oST,\
 565.156 - 	     $(filter $($(lib)-static-only-routines),\
 565.157 - 		      $(all-$(lib)-routines)))
 565.158 - 	$(build-extra-lib)
 565.159 -diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
 565.160 ---- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
 565.161 -+++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
 565.162 -@@ -375,7 +375,7 @@
 565.163 - 
 565.164 - $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
 565.165 - 			      $(objpfx)libpthread.so$(libpthread.so-version) \
 565.166 --			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
 565.167 -+			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
 565.168 - 							$(libprefix)pthread) \
 565.169 - 			      $(+force)
 565.170 - 	(echo '/* GNU ld script';\
 565.171 -@@ -383,7 +383,7 @@
 565.172 - 	 echo '   the static library, so try that secondarily.  */';\
 565.173 - 	 cat $<; \
 565.174 - 	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
 565.175 --	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
 565.176 -+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
 565.177 - 	      ')' \
 565.178 - 	) > $@.new
 565.179 - 	mv -f $@.new $@
 565.180 -diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
 565.181 ---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
 565.182 -+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
 565.183 -@@ -10,4 +10,4 @@
 565.184 - ASFLAGS-.op += -Wa,-Av9a
 565.185 - ASFLAGS-.og += -Wa,-Av9a
 565.186 - ASFLAGS-.ob += -Wa,-Av9a
 565.187 --ASFLAGS-.oS += -Wa,-Av9a
 565.188 -+ASFLAGS-.oST += -Wa,-Av9a
 565.189 -
 565.190 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   566.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   566.2 +++ b/patches/glibc/2.5/120-fix-pr631.patch	Mon Jul 28 21:32:33 2008 +0000
   566.3 @@ -0,0 +1,45 @@
   566.4 +From dank@kegel.com
   566.5 +Wed Jun 15 09:12:43 PDT 2005
   566.6 +
   566.7 +Fixes
   566.8 +
   566.9 +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  566.10 +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  566.11 +... 53 lines deleted ...
  566.12 +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  566.13 +collect2: ld returned 1 exit status
  566.14 +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  566.15 +
  566.16 +when building glibc with --enable-static-nss.
  566.17 +
  566.18 +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  566.19 +
  566.20 +--- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  566.21 ++++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  566.22 +@@ -510,7 +510,7 @@
  566.23 + 
  566.24 + # The static libraries.
  566.25 + ifeq (yes,$(build-static))
  566.26 +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  566.27 ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  566.28 + else
  566.29 + ifeq (yes,$(build-shared))
  566.30 + # We can try to link the programs with lib*_pic.a...
  566.31 +--- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  566.32 ++++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  566.33 +@@ -120,6 +120,13 @@
  566.34 + install-bin-script = ldd
  566.35 + endif
  566.36 + 
  566.37 ++ifeq (yes,$(build-static-nss))
  566.38 ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  566.39 ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  566.40 ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  566.41 ++	     $(resolvobjdir)/libresolv.a
  566.42 ++endif
  566.43 ++
  566.44 + others		= sprof sln
  566.45 + install-bin	= sprof
  566.46 + others-static   = sln
  566.47 +
  566.48 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   567.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   567.2 +++ b/patches/glibc/2.5/130-i686-assembler.patch	Mon Jul 28 21:32:33 2008 +0000
   567.3 @@ -0,0 +1,38 @@
   567.4 +2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
   567.5 +
   567.6 +       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
   567.7 +       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
   567.8 +
   567.9 +
  567.10 +
  567.11 +Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
  567.12 +===================================================================
  567.13 +--- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(revision 1469)
  567.14 ++++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(working copy)
  567.15 +@@ -29,6 +29,10 @@
  567.16 + #include <dl-sysdep.h>
  567.17 + #include <tls.h>
  567.18 + 
  567.19 ++#if defined __i686 && defined __ASSEMBLER__
  567.20 ++#undef __i686
  567.21 ++#define __i686 __i686
  567.22 ++#endif
  567.23 + 
  567.24 + /* For Linux we can use the system call table in the header file
  567.25 + 	/usr/include/asm/unistd.h
  567.26 +Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
  567.27 +===================================================================
  567.28 +--- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(revision 1469)
  567.29 ++++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(working copy)
  567.30 +@@ -45,6 +45,11 @@
  567.31 + /* Embed an #include to pull in the alignment and .end directives. */
  567.32 + asm ("\n#include \"defs.h\"");
  567.33 + 
  567.34 ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
  567.35 ++asm ("\n#undef __i686");
  567.36 ++asm ("\n#define __i686 __i686");
  567.37 ++asm ("\n#endif");
  567.38 ++
  567.39 + /* The initial common code ends here. */
  567.40 + asm ("\n/*@HEADER_ENDS*/");
  567.41 + 
   568.1 --- a/patches/glibc/2.5/140-configure-apple-as.patch	Mon Jul 28 21:08:01 2008 +0000
   568.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   568.3 @@ -1,25 +0,0 @@
   568.4 -http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
   568.5 -http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
   568.6 -
   568.7 -The following makes it possible to configure glibc-2.3.2 on Mac OS X,
   568.8 -where the assembler but doesn't understand the --version flag.
   568.9 -
  568.10 -Fixes the symptom
  568.11 -checking whether ld is GNU ld... no
  568.12 -checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
  568.13 -checking version of /usr/libexec/gcc/darwin/ppc/as... 
  568.14 -<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
  568.15 -
  568.16 ---- glibc-2.3.2/configure~	Wed Feb 26 09:20:48 2003
  568.17 -+++ glibc-2.3.2/configure	Fri Feb 27 13:12:53 2004
  568.18 -@@ -4039,7 +4039,7 @@
  568.19 -   # Found it, now check the version.
  568.20 -   echo "$as_me:$LINENO: checking version of $AS" >&5
  568.21 - echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
  568.22 --  ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  568.23 -+  ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  568.24 -   case $ac_prog_version in
  568.25 -     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  568.26 -     2.1[3-9]*)
  568.27 -
  568.28 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   569.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   569.2 +++ b/patches/glibc/2.5/140-i386-preferred-stack-boundary.patch	Mon Jul 28 21:32:33 2008 +0000
   569.3 @@ -0,0 +1,18 @@
   569.4 +(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
   569.5 +License: LGPL v2.1
   569.6 +
   569.7 +Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
   569.8 +and 2 is not.
   569.9 +
  569.10 +diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
  569.11 +--- glibc-2.5.orig/sysdeps/i386/Makefile	2005-03-06 01:18:16.000000000 +0100
  569.12 ++++ glibc-2.5/sysdeps/i386/Makefile	2007-05-27 17:49:37.000000000 +0200
  569.13 +@@ -36,7 +36,7 @@
  569.14 + ifeq ($(subdir),csu)
  569.15 + sysdep-CFLAGS += -mpreferred-stack-boundary=4
  569.16 + else
  569.17 +-sysdep-CFLAGS += -mpreferred-stack-boundary=2
  569.18 ++sysdep-CFLAGS += -mpreferred-stack-boundary=4
  569.19 + # Likewise, any function which calls user callbacks
  569.20 + uses-callbacks += -mpreferred-stack-boundary=4
  569.21 + # Likewise, any stack alignment tests
   570.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   570.2 +++ b/patches/glibc/2.5/150-alpha-asm_page.patch	Mon Jul 28 21:32:33 2008 +0000
   570.3 @@ -0,0 +1,26 @@
   570.4 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   570.5 +
   570.6 +	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   570.7 +	from the kernel header to sys/user.h and remove the #include of
   570.8 +	sys/user.h.
   570.9 +
  570.10 +--- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  570.11 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  570.12 +@@ -23,7 +23,6 @@
  570.13 +    only. Don't read too much into it. Don't use it for anything other
  570.14 +    than gdb/strace unless you know what you are doing. */
  570.15 + 
  570.16 +-#include <asm/page.h>
  570.17 + #include <asm/reg.h>
  570.18 + 
  570.19 + struct user
  570.20 +@@ -41,6 +40,9 @@ struct user
  570.21 +   char u_comm[32];				/* user command name */
  570.22 + };
  570.23 + 
  570.24 ++#define PAGE_SHIFT		13
  570.25 ++#define PAGE_SIZE		(1 << PAGE_SHIFT)
  570.26 ++#define PAGE_MASK		(~(PAGE_SIZE-1))
  570.27 + #define NBPG			PAGE_SIZE
  570.28 + #define UPAGES			1
  570.29 + #define HOST_TEXT_START_ADDR	(u.start_code)
   571.1 --- a/patches/glibc/2.5/150-fix-pr631.patch	Mon Jul 28 21:08:01 2008 +0000
   571.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   571.3 @@ -1,45 +0,0 @@
   571.4 -From dank@kegel.com
   571.5 -Wed Jun 15 09:12:43 PDT 2005
   571.6 -
   571.7 -Fixes
   571.8 -
   571.9 -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  571.10 -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  571.11 -... 53 lines deleted ...
  571.12 -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  571.13 -collect2: ld returned 1 exit status
  571.14 -make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  571.15 -
  571.16 -when building glibc with --enable-static-nss.
  571.17 -
  571.18 -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  571.19 -
  571.20 ---- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  571.21 -+++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  571.22 -@@ -510,7 +510,7 @@
  571.23 - 
  571.24 - # The static libraries.
  571.25 - ifeq (yes,$(build-static))
  571.26 --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  571.27 -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  571.28 - else
  571.29 - ifeq (yes,$(build-shared))
  571.30 - # We can try to link the programs with lib*_pic.a...
  571.31 ---- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  571.32 -+++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  571.33 -@@ -120,6 +120,13 @@
  571.34 - install-bin-script = ldd
  571.35 - endif
  571.36 - 
  571.37 -+ifeq (yes,$(build-static-nss))
  571.38 -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  571.39 -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  571.40 -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  571.41 -+	     $(resolvobjdir)/libresolv.a
  571.42 -+endif
  571.43 -+
  571.44 - others		= sprof sln
  571.45 - install-bin	= sprof
  571.46 - others-static   = sln
  571.47 -
  571.48 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   572.1 --- a/patches/glibc/2.5/160-i686-assembler.patch	Mon Jul 28 21:08:01 2008 +0000
   572.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   572.3 @@ -1,38 +0,0 @@
   572.4 -2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
   572.5 -
   572.6 -       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
   572.7 -       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
   572.8 -
   572.9 -
  572.10 -
  572.11 -Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
  572.12 -===================================================================
  572.13 ---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(revision 1469)
  572.14 -+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(working copy)
  572.15 -@@ -29,6 +29,10 @@
  572.16 - #include <dl-sysdep.h>
  572.17 - #include <tls.h>
  572.18 - 
  572.19 -+#if defined __i686 && defined __ASSEMBLER__
  572.20 -+#undef __i686
  572.21 -+#define __i686 __i686
  572.22 -+#endif
  572.23 - 
  572.24 - /* For Linux we can use the system call table in the header file
  572.25 - 	/usr/include/asm/unistd.h
  572.26 -Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
  572.27 -===================================================================
  572.28 ---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(revision 1469)
  572.29 -+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(working copy)
  572.30 -@@ -45,6 +45,11 @@
  572.31 - /* Embed an #include to pull in the alignment and .end directives. */
  572.32 - asm ("\n#include \"defs.h\"");
  572.33 - 
  572.34 -+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
  572.35 -+asm ("\n#undef __i686");
  572.36 -+asm ("\n#define __i686 __i686");
  572.37 -+asm ("\n#endif");
  572.38 -+
  572.39 - /* The initial common code ends here. */
  572.40 - asm ("\n/*@HEADER_ENDS*/");
  572.41 - 
   573.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   573.2 +++ b/patches/glibc/2.5/160-use_short_for_fnstsw.patch	Mon Jul 28 21:32:33 2008 +0000
   573.3 @@ -0,0 +1,18 @@
   573.4 +Original patch from H.J. Lu, as reported there:
   573.5 +http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   573.6 +
   573.7 +fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   573.8 +The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   573.9 +
  573.10 +diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
  573.11 +--- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  573.12 ++++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:56:14.000000000 +0200
  573.13 +@@ -26,7 +26,7 @@
  573.14 + int
  573.15 + fetestexcept (int excepts)
  573.16 + {
  573.17 +-  int temp;
  573.18 ++  short temp;
  573.19 +   int xtemp = 0;
  573.20 + 
  573.21 +   /* Get current exceptions.  */
   574.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   574.2 +++ b/patches/glibc/2.5/170-alpha-asm_elf.patch	Mon Jul 28 21:32:33 2008 +0000
   574.3 @@ -0,0 +1,194 @@
   574.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   574.5 +common code, alpha, and sh fail when used.  this should things up.
   574.6 +-mike
   574.7 +
   574.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   574.9 +
  574.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  574.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  574.12 +	definitions from the kernel header to sys/procfs.h and remove the
  574.13 +	#include of asm/elf.h.
  574.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  574.15 +
  574.16 +*Attachment: signature.asc <msg00012/signature.asc>*
  574.17 +/Description:/ This is a digitally signed message part.
  574.18 +
  574.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  574.20 +
  574.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  574.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  574.23 +	definitions from the kernel header to sys/procfs.h and remove the
  574.24 +	#include of asm/elf.h.
  574.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  574.26 +
  574.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  574.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  574.29 +@@ -29,10 +29,23 @@
  574.30 + #include <sys/types.h>
  574.31 + #include <sys/ucontext.h>
  574.32 + #include <sys/user.h>
  574.33 +-#include <asm/elf.h>
  574.34 + 
  574.35 + __BEGIN_DECLS
  574.36 + 
  574.37 ++/*
  574.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  574.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
  574.40 ++ * (32 general regs + processor status word).
  574.41 ++ */
  574.42 ++#define ELF_NGREG  33
  574.43 ++#define ELF_NFPREG 32
  574.44 ++
  574.45 ++typedef unsigned long elf_greg_t;
  574.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  574.47 ++
  574.48 ++typedef double elf_fpreg_t;
  574.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  574.50 ++
  574.51 + struct elf_siginfo
  574.52 +   {
  574.53 +     int si_signo;			/* Signal number.  */
  574.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  574.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  574.56 +@@ -29,10 +29,19 @@
  574.57 + #include <sys/types.h>
  574.58 + #include <sys/ucontext.h>
  574.59 + #include <sys/user.h>
  574.60 +-#include <asm/elf.h>
  574.61 + 
  574.62 + __BEGIN_DECLS
  574.63 + 
  574.64 ++/*
  574.65 ++ * ELF register definitions...
  574.66 ++ */
  574.67 ++typedef unsigned long elf_greg_t;
  574.68 ++
  574.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  574.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  574.71 ++
  574.72 ++typedef struct user_fpu_struct elf_fpregset_t;
  574.73 ++
  574.74 + struct elf_siginfo
  574.75 +   {
  574.76 +     int si_signo;			/* Signal number.  */
  574.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
  574.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  574.79 +@@ -1,115 +1,2 @@
  574.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  574.81 +-   This file is part of the GNU C Library.
  574.82 +-
  574.83 +-   The GNU C Library is free software; you can redistribute it and/or
  574.84 +-   modify it under the terms of the GNU Lesser General Public
  574.85 +-   License as published by the Free Software Foundation; either
  574.86 +-   version 2.1 of the License, or (at your option) any later version.
  574.87 +-
  574.88 +-   The GNU C Library is distributed in the hope that it will be useful,
  574.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
  574.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  574.91 +-   Lesser General Public License for more details.
  574.92 +-
  574.93 +-   You should have received a copy of the GNU Lesser General Public
  574.94 +-   License along with the GNU C Library; if not, write to the Free
  574.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  574.96 +-   02111-1307 USA.  */
  574.97 +-
  574.98 +-#ifndef _SYS_PROCFS_H
  574.99 +-#define _SYS_PROCFS_H	1
 574.100 +-
 574.101 +-/* This is somehow modelled after the file of the same name on SysVr4
 574.102 +-   systems.  It provides a definition of the core file format for ELF
 574.103 +-   used on Linux.  */
 574.104 +-
 574.105 +-#include <features.h>
 574.106 +-#include <signal.h>
 574.107 +-#include <sys/time.h>
 574.108 +-#include <sys/types.h>
 574.109 +-#include <sys/ucontext.h>
 574.110 +-#include <sys/user.h>
 574.111 +-#include <asm/elf.h>
 574.112 +-
 574.113 +-__BEGIN_DECLS
 574.114 +-
 574.115 +-struct elf_siginfo
 574.116 +-  {
 574.117 +-    int si_signo;			/* Signal number.  */
 574.118 +-    int si_code;			/* Extra code.  */
 574.119 +-    int si_errno;			/* Errno.  */
 574.120 +-  };
 574.121 +-
 574.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
 574.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
 574.124 +-   front to prevent clashes with linux definitions, and the typedef
 574.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
 574.126 +-   but more Linuxy, with things that Linux does not support and which
 574.127 +-   gdb doesn't really use excluded.  Fields present but not used are
 574.128 +-   marked with "XXX".  */
 574.129 +-struct elf_prstatus
 574.130 +-  {
 574.131 +-#if 0
 574.132 +-    long int pr_flags;			/* XXX Process flags.  */
 574.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
 574.134 +-    short int pr_what;			/* XXX More detailed reason.  */
 574.135 +-#endif
 574.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 574.137 +-    short int pr_cursig;		/* Current signal.  */
 574.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 574.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
 574.140 +-#if 0
 574.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 574.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
 574.143 +-#endif
 574.144 +-    __pid_t pr_pid;
 574.145 +-    __pid_t pr_ppid;
 574.146 +-    __pid_t pr_pgrp;
 574.147 +-    __pid_t pr_sid;
 574.148 +-    struct timeval pr_utime;		/* User time.  */
 574.149 +-    struct timeval pr_stime;		/* System time.  */
 574.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
 574.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
 574.152 +-#if 0
 574.153 +-    long int pr_instr;			/* Current instruction.  */
 574.154 +-#endif
 574.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
 574.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
 574.157 +-  };
 574.158 +-
 574.159 +-
 574.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 574.161 +-
 574.162 +-struct elf_prpsinfo
 574.163 +-  {
 574.164 +-    char pr_state;			/* Numeric process state.  */
 574.165 +-    char pr_sname;			/* Char for pr_state.  */
 574.166 +-    char pr_zomb;			/* Zombie.  */
 574.167 +-    char pr_nice;			/* Nice val.  */
 574.168 +-    unsigned long int pr_flag;		/* Flags.  */
 574.169 +-    unsigned short int pr_uid;
 574.170 +-    unsigned short int pr_gid;
 574.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 574.172 +-    /* Lots missing */
 574.173 +-    char pr_fname[16];			/* Filename of executable.  */
 574.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 574.175 +-  };
 574.176 +-
 574.177 +-/* Addresses.  */
 574.178 +-typedef void *psaddr_t;
 574.179 +-
 574.180 +-/* Register sets.  Linux has different names.  */
 574.181 +-typedef gregset_t prgregset_t;
 574.182 +-typedef fpregset_t prfpregset_t;
 574.183 +-
 574.184 +-/* We don't have any differences between processes and threads,
 574.185 +-   therefore habe only ine PID type.  */
 574.186 +-typedef __pid_t lwpid_t;
 574.187 +-
 574.188 +-
 574.189 +-typedef struct elf_prstatus prstatus_t;
 574.190 +-typedef struct elf_prpsinfo prpsinfo_t;
 574.191 +-
 574.192 +-__END_DECLS
 574.193 +-
 574.194 +-#endif	/* sys/procfs.h */
 574.195 ++/* sys/procfs.h is architecture specific.  */
 574.196 ++#error "This file must be supplied by every Linux architecture."
 574.197 +
   575.1 --- a/patches/glibc/2.5/170-i386-preferred-stack-boundary.patch	Mon Jul 28 21:08:01 2008 +0000
   575.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   575.3 @@ -1,18 +0,0 @@
   575.4 -(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
   575.5 -License: LGPL v2.1
   575.6 -
   575.7 -Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
   575.8 -and 2 is not.
   575.9 -
  575.10 -diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
  575.11 ---- glibc-2.5.orig/sysdeps/i386/Makefile	2005-03-06 01:18:16.000000000 +0100
  575.12 -+++ glibc-2.5/sysdeps/i386/Makefile	2007-05-27 17:49:37.000000000 +0200
  575.13 -@@ -36,7 +36,7 @@
  575.14 - ifeq ($(subdir),csu)
  575.15 - sysdep-CFLAGS += -mpreferred-stack-boundary=4
  575.16 - else
  575.17 --sysdep-CFLAGS += -mpreferred-stack-boundary=2
  575.18 -+sysdep-CFLAGS += -mpreferred-stack-boundary=4
  575.19 - # Likewise, any function which calls user callbacks
  575.20 - uses-callbacks += -mpreferred-stack-boundary=4
  575.21 - # Likewise, any stack alignment tests
   576.1 --- a/patches/glibc/2.5/180-alpha-asm_page.patch	Mon Jul 28 21:08:01 2008 +0000
   576.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   576.3 @@ -1,26 +0,0 @@
   576.4 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   576.5 -
   576.6 -	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   576.7 -	from the kernel header to sys/user.h and remove the #include of
   576.8 -	sys/user.h.
   576.9 -
  576.10 ---- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  576.11 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  576.12 -@@ -23,7 +23,6 @@
  576.13 -    only. Don't read too much into it. Don't use it for anything other
  576.14 -    than gdb/strace unless you know what you are doing. */
  576.15 - 
  576.16 --#include <asm/page.h>
  576.17 - #include <asm/reg.h>
  576.18 - 
  576.19 - struct user
  576.20 -@@ -41,6 +40,9 @@ struct user
  576.21 -   char u_comm[32];				/* user command name */
  576.22 - };
  576.23 - 
  576.24 -+#define PAGE_SHIFT		13
  576.25 -+#define PAGE_SIZE		(1 << PAGE_SHIFT)
  576.26 -+#define PAGE_MASK		(~(PAGE_SIZE-1))
  576.27 - #define NBPG			PAGE_SIZE
  576.28 - #define UPAGES			1
  576.29 - #define HOST_TEXT_START_ADDR	(u.start_code)
   577.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   577.2 +++ b/patches/glibc/2.5/180-alpha-cfi.patch	Mon Jul 28 21:32:33 2008 +0000
   577.3 @@ -0,0 +1,25 @@
   577.4 +--- libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h    2006/10/29 21:48:06     1.6
   577.5 ++++ libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h    2007/03/13 21:28:03     1.7
   577.6 +@@ -55,6 +55,7 @@
   577.7 + 	bne	a3, SYSCALL_ERROR_LABEL;			\
   577.8 + __LABEL($pseudo_ret)						\
   577.9 + 	.subsection 2;						\
  577.10 ++	cfi_startproc;						\
  577.11 + __LABEL($pseudo_cancel)						\
  577.12 + 	subq	sp, 64, sp;					\
  577.13 + 	cfi_def_cfa_offset(64);					\
  577.14 +@@ -90,12 +91,13 @@
  577.15 + 	cfi_def_cfa_offset(0);					\
  577.16 + __LABEL($syscall_error)						\
  577.17 + 	SYSCALL_ERROR_HANDLER;					\
  577.18 ++	cfi_endproc;						\
  577.19 + 	.previous
  577.20 + 
  577.21 + # undef PSEUDO_END
  577.22 + # define PSEUDO_END(sym)					\
  577.23 +-	.subsection 2;						\
  577.24 + 	cfi_endproc;						\
  577.25 ++	.subsection 2;						\
  577.26 + 	.size sym, .-sym
  577.27 + 
  577.28 + # define SAVE_ARGS_0	/* Nothing.  */
   578.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   578.2 +++ b/patches/glibc/2.5/190-alpha-sigsuspend.patch	Mon Jul 28 21:32:33 2008 +0000
   578.3 @@ -0,0 +1,24 @@
   578.4 +--- glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S.orig	2006-10-22 22:17:01.000000000 +0200
   578.5 ++++ glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S	2006-10-22 22:18:05.000000000 +0200
   578.6 +@@ -31,3 +31,21 @@
   578.7 + libc_hidden_def (__sigsuspend)
   578.8 + weak_alias (__sigsuspend, sigsuspend)
   578.9 + strong_alias (__sigsuspend, __libc_sigsuspend)
  578.10 ++
  578.11 ++#ifndef NO_CANCELLATION
  578.12 ++	.globl __sigsuspend_nocancel;
  578.13 ++	.align 4;
  578.14 ++	.type __sigsuspend_nocancel, @function;
  578.15 ++	.usepv __sigsuspend_nocancel, std;
  578.16 ++	cfi_startproc;
  578.17 ++__LABEL(__sigsuspend_nocancel)
  578.18 ++	ldgp    gp, 0(pv);
  578.19 ++	PSEUDO_PROF;
  578.20 ++	PSEUDO_PREPARE_ARGS
  578.21 ++	lda     v0, SYS_ify(sigsuspend);
  578.22 ++	call_pal PAL_callsys;
  578.23 ++	bne     a3, SYSCALL_ERROR_LABEL;
  578.24 ++	ret;
  578.25 ++	cfi_endproc;
  578.26 ++	.size __sigsuspend_nocancel, .-__sigsuspend_nocancel
  578.27 ++#endif
   579.1 --- a/patches/glibc/2.5/190-use_short_for_fnstsw.patch	Mon Jul 28 21:08:01 2008 +0000
   579.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   579.3 @@ -1,18 +0,0 @@
   579.4 -Original patch from H.J. Lu, as reported there:
   579.5 -http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   579.6 -
   579.7 -fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   579.8 -The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   579.9 -
  579.10 -diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
  579.11 ---- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  579.12 -+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:56:14.000000000 +0200
  579.13 -@@ -26,7 +26,7 @@
  579.14 - int
  579.15 - fetestexcept (int excepts)
  579.16 - {
  579.17 --  int temp;
  579.18 -+  short temp;
  579.19 -   int xtemp = 0;
  579.20 - 
  579.21 -   /* Get current exceptions.  */
   580.1 --- a/patches/glibc/2.5/260-alpha-asm_elf.patch	Mon Jul 28 21:08:01 2008 +0000
   580.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   580.3 @@ -1,194 +0,0 @@
   580.4 -since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   580.5 -common code, alpha, and sh fail when used.  this should things up.
   580.6 --mike
   580.7 -
   580.8 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   580.9 -
  580.10 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  580.11 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  580.12 -	definitions from the kernel header to sys/procfs.h and remove the
  580.13 -	#include of asm/elf.h.
  580.14 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  580.15 -
  580.16 -*Attachment: signature.asc <msg00012/signature.asc>*
  580.17 -/Description:/ This is a digitally signed message part.
  580.18 -
  580.19 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  580.20 -
  580.21 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  580.22 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  580.23 -	definitions from the kernel header to sys/procfs.h and remove the
  580.24 -	#include of asm/elf.h.
  580.25 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  580.26 -
  580.27 ---- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  580.28 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  580.29 -@@ -29,10 +29,23 @@
  580.30 - #include <sys/types.h>
  580.31 - #include <sys/ucontext.h>
  580.32 - #include <sys/user.h>
  580.33 --#include <asm/elf.h>
  580.34 - 
  580.35 - __BEGIN_DECLS
  580.36 - 
  580.37 -+/*
  580.38 -+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  580.39 -+ * I have no idea why that is so.  For now, we just leave it at 33
  580.40 -+ * (32 general regs + processor status word).
  580.41 -+ */
  580.42 -+#define ELF_NGREG  33
  580.43 -+#define ELF_NFPREG 32
  580.44 -+
  580.45 -+typedef unsigned long elf_greg_t;
  580.46 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  580.47 -+
  580.48 -+typedef double elf_fpreg_t;
  580.49 -+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  580.50 -+
  580.51 - struct elf_siginfo
  580.52 -   {
  580.53 -     int si_signo;			/* Signal number.  */
  580.54 ---- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  580.55 -+++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  580.56 -@@ -29,10 +29,19 @@
  580.57 - #include <sys/types.h>
  580.58 - #include <sys/ucontext.h>
  580.59 - #include <sys/user.h>
  580.60 --#include <asm/elf.h>
  580.61 - 
  580.62 - __BEGIN_DECLS
  580.63 - 
  580.64 -+/*
  580.65 -+ * ELF register definitions...
  580.66 -+ */
  580.67 -+typedef unsigned long elf_greg_t;
  580.68 -+
  580.69 -+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  580.70 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  580.71 -+
  580.72 -+typedef struct user_fpu_struct elf_fpregset_t;
  580.73 -+
  580.74 - struct elf_siginfo
  580.75 -   {
  580.76 -     int si_signo;			/* Signal number.  */
  580.77 ---- a/sysdeps/unix/sysv/linux/sys/procfs.h
  580.78 -+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  580.79 -@@ -1,115 +1,2 @@
  580.80 --/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  580.81 --   This file is part of the GNU C Library.
  580.82 --
  580.83 --   The GNU C Library is free software; you can redistribute it and/or
  580.84 --   modify it under the terms of the GNU Lesser General Public
  580.85 --   License as published by the Free Software Foundation; either
  580.86 --   version 2.1 of the License, or (at your option) any later version.
  580.87 --
  580.88 --   The GNU C Library is distributed in the hope that it will be useful,
  580.89 --   but WITHOUT ANY WARRANTY; without even the implied warranty of
  580.90 --   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  580.91 --   Lesser General Public License for more details.
  580.92 --
  580.93 --   You should have received a copy of the GNU Lesser General Public
  580.94 --   License along with the GNU C Library; if not, write to the Free
  580.95 --   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  580.96 --   02111-1307 USA.  */
  580.97 --
  580.98 --#ifndef _SYS_PROCFS_H
  580.99 --#define _SYS_PROCFS_H	1
 580.100 --
 580.101 --/* This is somehow modelled after the file of the same name on SysVr4
 580.102 --   systems.  It provides a definition of the core file format for ELF
 580.103 --   used on Linux.  */
 580.104 --
 580.105 --#include <features.h>
 580.106 --#include <signal.h>
 580.107 --#include <sys/time.h>
 580.108 --#include <sys/types.h>
 580.109 --#include <sys/ucontext.h>
 580.110 --#include <sys/user.h>
 580.111 --#include <asm/elf.h>
 580.112 --
 580.113 --__BEGIN_DECLS
 580.114 --
 580.115 --struct elf_siginfo
 580.116 --  {
 580.117 --    int si_signo;			/* Signal number.  */
 580.118 --    int si_code;			/* Extra code.  */
 580.119 --    int si_errno;			/* Errno.  */
 580.120 --  };
 580.121 --
 580.122 --/* Definitions to generate Intel SVR4-like core files.  These mostly
 580.123 --   have the same names as the SVR4 types with "elf_" tacked on the
 580.124 --   front to prevent clashes with linux definitions, and the typedef
 580.125 --   forms have been avoided.  This is mostly like the SVR4 structure,
 580.126 --   but more Linuxy, with things that Linux does not support and which
 580.127 --   gdb doesn't really use excluded.  Fields present but not used are
 580.128 --   marked with "XXX".  */
 580.129 --struct elf_prstatus
 580.130 --  {
 580.131 --#if 0
 580.132 --    long int pr_flags;			/* XXX Process flags.  */
 580.133 --    short int pr_why;			/* XXX Reason for process halt.  */
 580.134 --    short int pr_what;			/* XXX More detailed reason.  */
 580.135 --#endif
 580.136 --    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 580.137 --    short int pr_cursig;		/* Current signal.  */
 580.138 --    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 580.139 --    unsigned long int pr_sighold;	/* Set of held signals.  */
 580.140 --#if 0
 580.141 --    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 580.142 --    struct sigaction pr_action;		/* Signal action for current sig.  */
 580.143 --#endif
 580.144 --    __pid_t pr_pid;
 580.145 --    __pid_t pr_ppid;
 580.146 --    __pid_t pr_pgrp;
 580.147 --    __pid_t pr_sid;
 580.148 --    struct timeval pr_utime;		/* User time.  */
 580.149 --    struct timeval pr_stime;		/* System time.  */
 580.150 --    struct timeval pr_cutime;		/* Cumulative user time.  */
 580.151 --    struct timeval pr_cstime;		/* Cumulative system time.  */
 580.152 --#if 0
 580.153 --    long int pr_instr;			/* Current instruction.  */
 580.154 --#endif
 580.155 --    elf_gregset_t pr_reg;		/* GP registers.  */
 580.156 --    int pr_fpvalid;			/* True if math copro being used.  */
 580.157 --  };
 580.158 --
 580.159 --
 580.160 --#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 580.161 --
 580.162 --struct elf_prpsinfo
 580.163 --  {
 580.164 --    char pr_state;			/* Numeric process state.  */
 580.165 --    char pr_sname;			/* Char for pr_state.  */
 580.166 --    char pr_zomb;			/* Zombie.  */
 580.167 --    char pr_nice;			/* Nice val.  */
 580.168 --    unsigned long int pr_flag;		/* Flags.  */
 580.169 --    unsigned short int pr_uid;
 580.170 --    unsigned short int pr_gid;
 580.171 --    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 580.172 --    /* Lots missing */
 580.173 --    char pr_fname[16];			/* Filename of executable.  */
 580.174 --    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 580.175 --  };
 580.176 --
 580.177 --/* Addresses.  */
 580.178 --typedef void *psaddr_t;
 580.179 --
 580.180 --/* Register sets.  Linux has different names.  */
 580.181 --typedef gregset_t prgregset_t;
 580.182 --typedef fpregset_t prfpregset_t;
 580.183 --
 580.184 --/* We don't have any differences between processes and threads,
 580.185 --   therefore habe only ine PID type.  */
 580.186 --typedef __pid_t lwpid_t;
 580.187 --
 580.188 --
 580.189 --typedef struct elf_prstatus prstatus_t;
 580.190 --typedef struct elf_prpsinfo prpsinfo_t;
 580.191 --
 580.192 --__END_DECLS
 580.193 --
 580.194 --#endif	/* sys/procfs.h */
 580.195 -+/* sys/procfs.h is architecture specific.  */
 580.196 -+#error "This file must be supplied by every Linux architecture."
 580.197 -
   581.1 --- a/patches/glibc/2.5/270-alpha-cfi.patch	Mon Jul 28 21:08:01 2008 +0000
   581.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   581.3 @@ -1,25 +0,0 @@
   581.4 ---- libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h    2006/10/29 21:48:06     1.6
   581.5 -+++ libc/nptl/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h    2007/03/13 21:28:03     1.7
   581.6 -@@ -55,6 +55,7 @@
   581.7 - 	bne	a3, SYSCALL_ERROR_LABEL;			\
   581.8 - __LABEL($pseudo_ret)						\
   581.9 - 	.subsection 2;						\
  581.10 -+	cfi_startproc;						\
  581.11 - __LABEL($pseudo_cancel)						\
  581.12 - 	subq	sp, 64, sp;					\
  581.13 - 	cfi_def_cfa_offset(64);					\
  581.14 -@@ -90,12 +91,13 @@
  581.15 - 	cfi_def_cfa_offset(0);					\
  581.16 - __LABEL($syscall_error)						\
  581.17 - 	SYSCALL_ERROR_HANDLER;					\
  581.18 -+	cfi_endproc;						\
  581.19 - 	.previous
  581.20 - 
  581.21 - # undef PSEUDO_END
  581.22 - # define PSEUDO_END(sym)					\
  581.23 --	.subsection 2;						\
  581.24 - 	cfi_endproc;						\
  581.25 -+	.subsection 2;						\
  581.26 - 	.size sym, .-sym
  581.27 - 
  581.28 - # define SAVE_ARGS_0	/* Nothing.  */
   582.1 --- a/patches/glibc/2.5/280-alpha-sigsuspend.patch	Mon Jul 28 21:08:01 2008 +0000
   582.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   582.3 @@ -1,24 +0,0 @@
   582.4 ---- glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S.orig	2006-10-22 22:17:01.000000000 +0200
   582.5 -+++ glibc-2.5/sysdeps/unix/sysv/linux/alpha/sigsuspend.S	2006-10-22 22:18:05.000000000 +0200
   582.6 -@@ -31,3 +31,21 @@
   582.7 - libc_hidden_def (__sigsuspend)
   582.8 - weak_alias (__sigsuspend, sigsuspend)
   582.9 - strong_alias (__sigsuspend, __libc_sigsuspend)
  582.10 -+
  582.11 -+#ifndef NO_CANCELLATION
  582.12 -+	.globl __sigsuspend_nocancel;
  582.13 -+	.align 4;
  582.14 -+	.type __sigsuspend_nocancel, @function;
  582.15 -+	.usepv __sigsuspend_nocancel, std;
  582.16 -+	cfi_startproc;
  582.17 -+__LABEL(__sigsuspend_nocancel)
  582.18 -+	ldgp    gp, 0(pv);
  582.19 -+	PSEUDO_PROF;
  582.20 -+	PSEUDO_PREPARE_ARGS
  582.21 -+	lda     v0, SYS_ify(sigsuspend);
  582.22 -+	call_pal PAL_callsys;
  582.23 -+	bne     a3, SYSCALL_ERROR_LABEL;
  582.24 -+	ret;
  582.25 -+	cfi_endproc;
  582.26 -+	.size __sigsuspend_nocancel, .-__sigsuspend_nocancel
  582.27 -+#endif
   583.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   583.2 +++ b/patches/glibc/2.6.1/100-cygwin.patch	Mon Jul 28 21:32:33 2008 +0000
   583.3 @@ -0,0 +1,187 @@
   583.4 +Fixes
   583.5 +elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
   583.6 +...
   583.7 +when building glibc-2.3.x on cygwin
   583.8 +
   583.9 +Idea from
  583.10 +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
  583.11 +Basically, make glibc use .oST as suffix for 'object static'
  583.12 +instead of .oS, since cygwin has trouble distinguishing .os from .oS
  583.13 +(Original patch had .on, but .oST is more mnemonic for 'object static')
  583.14 +
  583.15 +glibc-linuxthreads-2.3.5 also requires a patch, see 
  583.16 +../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
  583.17 +
  583.18 +[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
  583.19 +
  583.20 +Message-ID: <4282FCBA.3040000@unicontrols.cz>
  583.21 +Date: Thu, 12 May 2005 08:50:34 +0200
  583.22 +From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
  583.23 +To: Dan Kegel <dank@kegel.com>
  583.24 +CC:  crossgcc@sources.redhat.com
  583.25 +Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
  583.26 +
  583.27 +Hi Dan,
  583.28 +following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
  583.29 +on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
  583.30 +
  583.31 +-- 
  583.32 +                     Petr Cvachoucek
  583.33 +                     Unicontrols a.s.
  583.34 +                     http://www.unicontrols.cz
  583.35 +]
  583.36 +
  583.37 +diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
  583.38 +--- glibc-2.3.5/Makeconfig	2005-02-16 11:50:19.000000000 +0100
  583.39 ++++ glibc-2.3.5-cygwin/Makeconfig	2005-05-11 08:24:51.046875000 +0200
  583.40 +@@ -472,7 +472,7 @@
  583.41 + # run the linked programs.
  583.42 + link-libc = -Wl,-rpath-link=$(rpath-link) \
  583.43 + 	    $(common-objpfx)libc.so$(libc.so-version) \
  583.44 +-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
  583.45 ++	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
  583.46 + # This is how to find at build-time things that will be installed there.
  583.47 + rpath-dirs = math elf dlfcn nss nis rt resolv crypt
  583.48 + endif
  583.49 +@@ -693,7 +693,7 @@
  583.50 + # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
  583.51 + # to pass different flags for each flavor.
  583.52 + libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
  583.53 +-all-object-suffixes := .o .os .op .og .ob .oS
  583.54 ++all-object-suffixes := .o .os .op .og .ob .oST
  583.55 + object-suffixes :=
  583.56 + CPPFLAGS-.o = $(pic-default)
  583.57 + CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
  583.58 +@@ -749,14 +749,14 @@
  583.59 + 
  583.60 + ifeq (yes,$(build-shared))
  583.61 + # Build special library that contains the static-only routines for libc.
  583.62 +-object-suffixes-for-libc += .oS
  583.63 ++object-suffixes-for-libc += .oST
  583.64 + 
  583.65 + # Must build the routines as PIC, though, because they can end up in (users')
  583.66 + # shared objects.  We don't want to use CFLAGS-os because users may, for
  583.67 + # example, make that processor-specific.
  583.68 +-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
  583.69 +-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  583.70 +-libtype.oS = lib%_nonshared.a
  583.71 ++CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
  583.72 ++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  583.73 ++libtype.oST = lib%_nonshared.a
  583.74 + endif
  583.75 + 
  583.76 + # The assembler can generate debug information too.
  583.77 +diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
  583.78 +--- glibc-2.3.5/Makerules	2004-12-15 19:52:39.000000000 +0100
  583.79 ++++ glibc-2.3.5-cygwin/Makerules	2005-05-11 08:25:33.578125000 +0200
  583.80 +@@ -417,7 +417,7 @@
  583.81 + # Bounded pointer thunks are only built for *.ob
  583.82 + elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
  583.83 + 
  583.84 +-elide-routines.oS += $(filter-out $(static-only-routines),\
  583.85 ++elide-routines.oST += $(filter-out $(static-only-routines),\
  583.86 + 				  $(routines) $(aux) $(sysdep_routines)) \
  583.87 + 		     $(elide-bp-thunks)
  583.88 + elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
  583.89 +@@ -981,7 +981,7 @@
  583.90 + install: $(inst_libdir)/libc.so
  583.91 + $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
  583.92 + 			$(common-objpfx)libc.so$(libc.so-version) \
  583.93 +-			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
  583.94 ++			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
  583.95 + 						  $(libprefix)$(libc-name)) \
  583.96 + 			$(+force)
  583.97 + 	(echo '/* GNU ld script';\
  583.98 +@@ -989,7 +989,7 @@
  583.99 + 	 echo '   the static library, so try that secondarily.  */';\
 583.100 + 	 cat $<; \
 583.101 + 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
 583.102 +-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
 583.103 ++	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
 583.104 +	      ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
 583.105 + 	) > $@.new
 583.106 +	mv -f $@.new $@
 583.107 +diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
 583.108 +--- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
 583.109 ++++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
 583.110 +@@ -13,7 +13,7 @@
 583.111 + 
 583.112 + ifneq (,$($(lib)-static-only-routines))
 583.113 + ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
 583.114 +-object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
 583.115 ++object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
 583.116 + endif
 583.117 + endif
 583.118 + 
 583.119 +@@ -29,7 +29,7 @@
 583.120 + 
 583.121 + # Add each flavor of library to the lists of things to build and install.
 583.122 + install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
 583.123 +-extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
 583.124 ++extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
 583.125 + 			$(patsubst %,%$o,$(filter-out \
 583.126 + 					   $($(lib)-shared-only-routines),\
 583.127 + 					   $(all-$(lib)-routines))))
 583.128 +@@ -57,7 +57,7 @@
 583.129 + 
 583.130 + 
 583.131 + # Use o-iterator.mk to generate a rule for each flavor of library.
 583.132 +-ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
 583.133 ++ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
 583.134 + define o-iterator-doit
 583.135 + $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
 583.136 +   $(patsubst %,$(objpfx)%$o,\
 583.137 +@@ -65,7 +65,7 @@
 583.138 + 			  $(all-$(lib)-routines))); \
 583.139 + 	$$(build-extra-lib)
 583.140 + endef
 583.141 +-object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
 583.142 ++object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
 583.143 + include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
 583.144 + endif
 583.145 + 
 583.146 +@@ -77,9 +77,9 @@
 583.147 + 	$(build-extra-lib)
 583.148 + endif
 583.149 + 
 583.150 +-ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
 583.151 +-$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
 583.152 +-  $(patsubst %,$(objpfx)%.oS,\
 583.153 ++ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
 583.154 ++$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
 583.155 ++  $(patsubst %,$(objpfx)%.oST,\
 583.156 + 	     $(filter $($(lib)-static-only-routines),\
 583.157 + 		      $(all-$(lib)-routines)))
 583.158 + 	$(build-extra-lib)
 583.159 +diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
 583.160 +--- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
 583.161 ++++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
 583.162 +@@ -375,7 +375,7 @@
 583.163 + 
 583.164 + $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
 583.165 + 			      $(objpfx)libpthread.so$(libpthread.so-version) \
 583.166 +-			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
 583.167 ++			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
 583.168 + 							$(libprefix)pthread) \
 583.169 + 			      $(+force)
 583.170 + 	(echo '/* GNU ld script';\
 583.171 +@@ -383,7 +383,7 @@
 583.172 + 	 echo '   the static library, so try that secondarily.  */';\
 583.173 + 	 cat $<; \
 583.174 + 	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
 583.175 +-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
 583.176 ++	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
 583.177 + 	      ')' \
 583.178 + 	) > $@.new
 583.179 + 	mv -f $@.new $@
 583.180 +diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
 583.181 +--- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
 583.182 ++++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
 583.183 +@@ -10,4 +10,4 @@
 583.184 + ASFLAGS-.op += -Wa,-Av9a
 583.185 + ASFLAGS-.og += -Wa,-Av9a
 583.186 + ASFLAGS-.ob += -Wa,-Av9a
 583.187 +-ASFLAGS-.oS += -Wa,-Av9a
 583.188 ++ASFLAGS-.oST += -Wa,-Av9a
 583.189 +
 583.190 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   584.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   584.2 +++ b/patches/glibc/2.6.1/110-configure-apple-as.patch	Mon Jul 28 21:32:33 2008 +0000
   584.3 @@ -0,0 +1,25 @@
   584.4 +http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
   584.5 +http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
   584.6 +
   584.7 +The following makes it possible to configure glibc-2.3.2 on Mac OS X,
   584.8 +where the assembler but doesn't understand the --version flag.
   584.9 +
  584.10 +Fixes the symptom
  584.11 +checking whether ld is GNU ld... no
  584.12 +checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
  584.13 +checking version of /usr/libexec/gcc/darwin/ppc/as... 
  584.14 +<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
  584.15 +
  584.16 +--- glibc-2.3.2/configure~	Wed Feb 26 09:20:48 2003
  584.17 ++++ glibc-2.3.2/configure	Fri Feb 27 13:12:53 2004
  584.18 +@@ -4039,7 +4039,7 @@
  584.19 +   # Found it, now check the version.
  584.20 +   echo "$as_me:$LINENO: checking version of $AS" >&5
  584.21 + echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
  584.22 +-  ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  584.23 ++  ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  584.24 +   case $ac_prog_version in
  584.25 +     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  584.26 +     2.1[3-9]*)
  584.27 +
  584.28 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   585.1 --- a/patches/glibc/2.6.1/120-cygwin.patch	Mon Jul 28 21:08:01 2008 +0000
   585.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   585.3 @@ -1,187 +0,0 @@
   585.4 -Fixes
   585.5 -elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
   585.6 -...
   585.7 -when building glibc-2.3.x on cygwin
   585.8 -
   585.9 -Idea from
  585.10 -http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
  585.11 -Basically, make glibc use .oST as suffix for 'object static'
  585.12 -instead of .oS, since cygwin has trouble distinguishing .os from .oS
  585.13 -(Original patch had .on, but .oST is more mnemonic for 'object static')
  585.14 -
  585.15 -glibc-linuxthreads-2.3.5 also requires a patch, see 
  585.16 -../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
  585.17 -
  585.18 -[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
  585.19 -
  585.20 -Message-ID: <4282FCBA.3040000@unicontrols.cz>
  585.21 -Date: Thu, 12 May 2005 08:50:34 +0200
  585.22 -From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
  585.23 -To: Dan Kegel <dank@kegel.com>
  585.24 -CC:  crossgcc@sources.redhat.com
  585.25 -Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
  585.26 -
  585.27 -Hi Dan,
  585.28 -following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
  585.29 -on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
  585.30 -
  585.31 --- 
  585.32 -                     Petr Cvachoucek
  585.33 -                     Unicontrols a.s.
  585.34 -                     http://www.unicontrols.cz
  585.35 -]
  585.36 -
  585.37 -diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
  585.38 ---- glibc-2.3.5/Makeconfig	2005-02-16 11:50:19.000000000 +0100
  585.39 -+++ glibc-2.3.5-cygwin/Makeconfig	2005-05-11 08:24:51.046875000 +0200
  585.40 -@@ -472,7 +472,7 @@
  585.41 - # run the linked programs.
  585.42 - link-libc = -Wl,-rpath-link=$(rpath-link) \
  585.43 - 	    $(common-objpfx)libc.so$(libc.so-version) \
  585.44 --	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
  585.45 -+	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
  585.46 - # This is how to find at build-time things that will be installed there.
  585.47 - rpath-dirs = math elf dlfcn nss nis rt resolv crypt
  585.48 - endif
  585.49 -@@ -693,7 +693,7 @@
  585.50 - # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
  585.51 - # to pass different flags for each flavor.
  585.52 - libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
  585.53 --all-object-suffixes := .o .os .op .og .ob .oS
  585.54 -+all-object-suffixes := .o .os .op .og .ob .oST
  585.55 - object-suffixes :=
  585.56 - CPPFLAGS-.o = $(pic-default)
  585.57 - CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
  585.58 -@@ -749,14 +749,14 @@
  585.59 - 
  585.60 - ifeq (yes,$(build-shared))
  585.61 - # Build special library that contains the static-only routines for libc.
  585.62 --object-suffixes-for-libc += .oS
  585.63 -+object-suffixes-for-libc += .oST
  585.64 - 
  585.65 - # Must build the routines as PIC, though, because they can end up in (users')
  585.66 - # shared objects.  We don't want to use CFLAGS-os because users may, for
  585.67 - # example, make that processor-specific.
  585.68 --CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
  585.69 --CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  585.70 --libtype.oS = lib%_nonshared.a
  585.71 -+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
  585.72 -+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  585.73 -+libtype.oST = lib%_nonshared.a
  585.74 - endif
  585.75 - 
  585.76 - # The assembler can generate debug information too.
  585.77 -diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
  585.78 ---- glibc-2.3.5/Makerules	2004-12-15 19:52:39.000000000 +0100
  585.79 -+++ glibc-2.3.5-cygwin/Makerules	2005-05-11 08:25:33.578125000 +0200
  585.80 -@@ -417,7 +417,7 @@
  585.81 - # Bounded pointer thunks are only built for *.ob
  585.82 - elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
  585.83 - 
  585.84 --elide-routines.oS += $(filter-out $(static-only-routines),\
  585.85 -+elide-routines.oST += $(filter-out $(static-only-routines),\
  585.86 - 				  $(routines) $(aux) $(sysdep_routines)) \
  585.87 - 		     $(elide-bp-thunks)
  585.88 - elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
  585.89 -@@ -981,7 +981,7 @@
  585.90 - install: $(inst_libdir)/libc.so
  585.91 - $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
  585.92 - 			$(common-objpfx)libc.so$(libc.so-version) \
  585.93 --			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
  585.94 -+			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
  585.95 - 						  $(libprefix)$(libc-name)) \
  585.96 - 			$(+force)
  585.97 - 	(echo '/* GNU ld script';\
  585.98 -@@ -989,7 +989,7 @@
  585.99 - 	 echo '   the static library, so try that secondarily.  */';\
 585.100 - 	 cat $<; \
 585.101 - 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
 585.102 --	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
 585.103 -+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
 585.104 -	      ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
 585.105 - 	) > $@.new
 585.106 -	mv -f $@.new $@
 585.107 -diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
 585.108 ---- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
 585.109 -+++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
 585.110 -@@ -13,7 +13,7 @@
 585.111 - 
 585.112 - ifneq (,$($(lib)-static-only-routines))
 585.113 - ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
 585.114 --object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
 585.115 -+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
 585.116 - endif
 585.117 - endif
 585.118 - 
 585.119 -@@ -29,7 +29,7 @@
 585.120 - 
 585.121 - # Add each flavor of library to the lists of things to build and install.
 585.122 - install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
 585.123 --extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
 585.124 -+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
 585.125 - 			$(patsubst %,%$o,$(filter-out \
 585.126 - 					   $($(lib)-shared-only-routines),\
 585.127 - 					   $(all-$(lib)-routines))))
 585.128 -@@ -57,7 +57,7 @@
 585.129 - 
 585.130 - 
 585.131 - # Use o-iterator.mk to generate a rule for each flavor of library.
 585.132 --ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
 585.133 -+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
 585.134 - define o-iterator-doit
 585.135 - $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
 585.136 -   $(patsubst %,$(objpfx)%$o,\
 585.137 -@@ -65,7 +65,7 @@
 585.138 - 			  $(all-$(lib)-routines))); \
 585.139 - 	$$(build-extra-lib)
 585.140 - endef
 585.141 --object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
 585.142 -+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
 585.143 - include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
 585.144 - endif
 585.145 - 
 585.146 -@@ -77,9 +77,9 @@
 585.147 - 	$(build-extra-lib)
 585.148 - endif
 585.149 - 
 585.150 --ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
 585.151 --$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
 585.152 --  $(patsubst %,$(objpfx)%.oS,\
 585.153 -+ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
 585.154 -+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
 585.155 -+  $(patsubst %,$(objpfx)%.oST,\
 585.156 - 	     $(filter $($(lib)-static-only-routines),\
 585.157 - 		      $(all-$(lib)-routines)))
 585.158 - 	$(build-extra-lib)
 585.159 -diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
 585.160 ---- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
 585.161 -+++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
 585.162 -@@ -375,7 +375,7 @@
 585.163 - 
 585.164 - $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
 585.165 - 			      $(objpfx)libpthread.so$(libpthread.so-version) \
 585.166 --			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
 585.167 -+			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
 585.168 - 							$(libprefix)pthread) \
 585.169 - 			      $(+force)
 585.170 - 	(echo '/* GNU ld script';\
 585.171 -@@ -383,7 +383,7 @@
 585.172 - 	 echo '   the static library, so try that secondarily.  */';\
 585.173 - 	 cat $<; \
 585.174 - 	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
 585.175 --	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
 585.176 -+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
 585.177 - 	      ')' \
 585.178 - 	) > $@.new
 585.179 - 	mv -f $@.new $@
 585.180 -diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
 585.181 ---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
 585.182 -+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
 585.183 -@@ -10,4 +10,4 @@
 585.184 - ASFLAGS-.op += -Wa,-Av9a
 585.185 - ASFLAGS-.og += -Wa,-Av9a
 585.186 - ASFLAGS-.ob += -Wa,-Av9a
 585.187 --ASFLAGS-.oS += -Wa,-Av9a
 585.188 -+ASFLAGS-.oST += -Wa,-Av9a
 585.189 -
 585.190 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   586.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   586.2 +++ b/patches/glibc/2.6.1/120-fix-pr631.patch	Mon Jul 28 21:32:33 2008 +0000
   586.3 @@ -0,0 +1,45 @@
   586.4 +From dank@kegel.com
   586.5 +Wed Jun 15 09:12:43 PDT 2005
   586.6 +
   586.7 +Fixes
   586.8 +
   586.9 +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  586.10 +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  586.11 +... 53 lines deleted ...
  586.12 +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  586.13 +collect2: ld returned 1 exit status
  586.14 +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  586.15 +
  586.16 +when building glibc with --enable-static-nss.
  586.17 +
  586.18 +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  586.19 +
  586.20 +--- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  586.21 ++++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  586.22 +@@ -510,7 +510,7 @@
  586.23 + 
  586.24 + # The static libraries.
  586.25 + ifeq (yes,$(build-static))
  586.26 +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  586.27 ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  586.28 + else
  586.29 + ifeq (yes,$(build-shared))
  586.30 + # We can try to link the programs with lib*_pic.a...
  586.31 +--- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  586.32 ++++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  586.33 +@@ -120,6 +120,13 @@
  586.34 + install-bin-script = ldd
  586.35 + endif
  586.36 + 
  586.37 ++ifeq (yes,$(build-static-nss))
  586.38 ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  586.39 ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  586.40 ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  586.41 ++	     $(resolvobjdir)/libresolv.a
  586.42 ++endif
  586.43 ++
  586.44 + others		= sprof sln
  586.45 + install-bin	= sprof
  586.46 + others-static   = sln
  586.47 +
  586.48 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   587.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   587.2 +++ b/patches/glibc/2.6.1/130-i686-assembler.patch	Mon Jul 28 21:32:33 2008 +0000
   587.3 @@ -0,0 +1,38 @@
   587.4 +2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
   587.5 +
   587.6 +       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
   587.7 +       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
   587.8 +
   587.9 +
  587.10 +
  587.11 +Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
  587.12 +===================================================================
  587.13 +--- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(revision 1469)
  587.14 ++++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(working copy)
  587.15 +@@ -29,6 +29,10 @@
  587.16 + #include <dl-sysdep.h>
  587.17 + #include <tls.h>
  587.18 + 
  587.19 ++#if defined __i686 && defined __ASSEMBLER__
  587.20 ++#undef __i686
  587.21 ++#define __i686 __i686
  587.22 ++#endif
  587.23 + 
  587.24 + /* For Linux we can use the system call table in the header file
  587.25 + 	/usr/include/asm/unistd.h
  587.26 +Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
  587.27 +===================================================================
  587.28 +--- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(revision 1469)
  587.29 ++++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(working copy)
  587.30 +@@ -45,6 +45,11 @@
  587.31 + /* Embed an #include to pull in the alignment and .end directives. */
  587.32 + asm ("\n#include \"defs.h\"");
  587.33 + 
  587.34 ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
  587.35 ++asm ("\n#undef __i686");
  587.36 ++asm ("\n#define __i686 __i686");
  587.37 ++asm ("\n#endif");
  587.38 ++
  587.39 + /* The initial common code ends here. */
  587.40 + asm ("\n/*@HEADER_ENDS*/");
  587.41 + 
   588.1 --- a/patches/glibc/2.6.1/140-configure-apple-as.patch	Mon Jul 28 21:08:01 2008 +0000
   588.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   588.3 @@ -1,25 +0,0 @@
   588.4 -http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
   588.5 -http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
   588.6 -
   588.7 -The following makes it possible to configure glibc-2.3.2 on Mac OS X,
   588.8 -where the assembler but doesn't understand the --version flag.
   588.9 -
  588.10 -Fixes the symptom
  588.11 -checking whether ld is GNU ld... no
  588.12 -checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
  588.13 -checking version of /usr/libexec/gcc/darwin/ppc/as... 
  588.14 -<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
  588.15 -
  588.16 ---- glibc-2.3.2/configure~	Wed Feb 26 09:20:48 2003
  588.17 -+++ glibc-2.3.2/configure	Fri Feb 27 13:12:53 2004
  588.18 -@@ -4039,7 +4039,7 @@
  588.19 -   # Found it, now check the version.
  588.20 -   echo "$as_me:$LINENO: checking version of $AS" >&5
  588.21 - echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
  588.22 --  ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  588.23 -+  ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  588.24 -   case $ac_prog_version in
  588.25 -     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  588.26 -     2.1[3-9]*)
  588.27 -
  588.28 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   589.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   589.2 +++ b/patches/glibc/2.6.1/140-i386-preferred-stack-boundary.patch	Mon Jul 28 21:32:33 2008 +0000
   589.3 @@ -0,0 +1,18 @@
   589.4 +(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
   589.5 +License: LGPL v2.1
   589.6 +
   589.7 +Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
   589.8 +and 2 is not.
   589.9 +
  589.10 +diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
  589.11 +--- glibc-2.5.orig/sysdeps/i386/Makefile	2005-03-06 01:18:16.000000000 +0100
  589.12 ++++ glibc-2.5/sysdeps/i386/Makefile	2007-05-27 17:49:37.000000000 +0200
  589.13 +@@ -36,7 +36,7 @@
  589.14 + ifeq ($(subdir),csu)
  589.15 + sysdep-CFLAGS += -mpreferred-stack-boundary=4
  589.16 + else
  589.17 +-sysdep-CFLAGS += -mpreferred-stack-boundary=2
  589.18 ++sysdep-CFLAGS += -mpreferred-stack-boundary=4
  589.19 + # Likewise, any function which calls user callbacks
  589.20 + uses-callbacks += -mpreferred-stack-boundary=4
  589.21 + # Likewise, any stack alignment tests
   590.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   590.2 +++ b/patches/glibc/2.6.1/150-alpha-asm_page.patch	Mon Jul 28 21:32:33 2008 +0000
   590.3 @@ -0,0 +1,26 @@
   590.4 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   590.5 +
   590.6 +	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   590.7 +	from the kernel header to sys/user.h and remove the #include of
   590.8 +	sys/user.h.
   590.9 +
  590.10 +--- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  590.11 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  590.12 +@@ -23,7 +23,6 @@
  590.13 +    only. Don't read too much into it. Don't use it for anything other
  590.14 +    than gdb/strace unless you know what you are doing. */
  590.15 + 
  590.16 +-#include <asm/page.h>
  590.17 + #include <asm/reg.h>
  590.18 + 
  590.19 + struct user
  590.20 +@@ -41,6 +40,9 @@ struct user
  590.21 +   char u_comm[32];				/* user command name */
  590.22 + };
  590.23 + 
  590.24 ++#define PAGE_SHIFT		13
  590.25 ++#define PAGE_SIZE		(1 << PAGE_SHIFT)
  590.26 ++#define PAGE_MASK		(~(PAGE_SIZE-1))
  590.27 + #define NBPG			PAGE_SIZE
  590.28 + #define UPAGES			1
  590.29 + #define HOST_TEXT_START_ADDR	(u.start_code)
   591.1 --- a/patches/glibc/2.6.1/150-fix-pr631.patch	Mon Jul 28 21:08:01 2008 +0000
   591.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   591.3 @@ -1,45 +0,0 @@
   591.4 -From dank@kegel.com
   591.5 -Wed Jun 15 09:12:43 PDT 2005
   591.6 -
   591.7 -Fixes
   591.8 -
   591.9 -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  591.10 -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  591.11 -... 53 lines deleted ...
  591.12 -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  591.13 -collect2: ld returned 1 exit status
  591.14 -make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  591.15 -
  591.16 -when building glibc with --enable-static-nss.
  591.17 -
  591.18 -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  591.19 -
  591.20 ---- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  591.21 -+++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  591.22 -@@ -510,7 +510,7 @@
  591.23 - 
  591.24 - # The static libraries.
  591.25 - ifeq (yes,$(build-static))
  591.26 --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  591.27 -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  591.28 - else
  591.29 - ifeq (yes,$(build-shared))
  591.30 - # We can try to link the programs with lib*_pic.a...
  591.31 ---- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  591.32 -+++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  591.33 -@@ -120,6 +120,13 @@
  591.34 - install-bin-script = ldd
  591.35 - endif
  591.36 - 
  591.37 -+ifeq (yes,$(build-static-nss))
  591.38 -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  591.39 -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  591.40 -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  591.41 -+	     $(resolvobjdir)/libresolv.a
  591.42 -+endif
  591.43 -+
  591.44 - others		= sprof sln
  591.45 - install-bin	= sprof
  591.46 - others-static   = sln
  591.47 -
  591.48 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   592.1 --- a/patches/glibc/2.6.1/160-i686-assembler.patch	Mon Jul 28 21:08:01 2008 +0000
   592.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   592.3 @@ -1,38 +0,0 @@
   592.4 -2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
   592.5 -
   592.6 -       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
   592.7 -       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
   592.8 -
   592.9 -
  592.10 -
  592.11 -Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
  592.12 -===================================================================
  592.13 ---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(revision 1469)
  592.14 -+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(working copy)
  592.15 -@@ -29,6 +29,10 @@
  592.16 - #include <dl-sysdep.h>
  592.17 - #include <tls.h>
  592.18 - 
  592.19 -+#if defined __i686 && defined __ASSEMBLER__
  592.20 -+#undef __i686
  592.21 -+#define __i686 __i686
  592.22 -+#endif
  592.23 - 
  592.24 - /* For Linux we can use the system call table in the header file
  592.25 - 	/usr/include/asm/unistd.h
  592.26 -Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
  592.27 -===================================================================
  592.28 ---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(revision 1469)
  592.29 -+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(working copy)
  592.30 -@@ -45,6 +45,11 @@
  592.31 - /* Embed an #include to pull in the alignment and .end directives. */
  592.32 - asm ("\n#include \"defs.h\"");
  592.33 - 
  592.34 -+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
  592.35 -+asm ("\n#undef __i686");
  592.36 -+asm ("\n#define __i686 __i686");
  592.37 -+asm ("\n#endif");
  592.38 -+
  592.39 - /* The initial common code ends here. */
  592.40 - asm ("\n/*@HEADER_ENDS*/");
  592.41 - 
   593.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   593.2 +++ b/patches/glibc/2.6.1/160-use_short_for_fnstsw.patch	Mon Jul 28 21:32:33 2008 +0000
   593.3 @@ -0,0 +1,18 @@
   593.4 +Original patch from H.J. Lu, as reported there:
   593.5 +http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   593.6 +
   593.7 +fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   593.8 +The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   593.9 +
  593.10 +diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
  593.11 +--- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  593.12 ++++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:56:14.000000000 +0200
  593.13 +@@ -26,7 +26,7 @@
  593.14 + int
  593.15 + fetestexcept (int excepts)
  593.16 + {
  593.17 +-  int temp;
  593.18 ++  short temp;
  593.19 +   int xtemp = 0;
  593.20 + 
  593.21 +   /* Get current exceptions.  */
   594.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   594.2 +++ b/patches/glibc/2.6.1/170-alpha-asm_elf.patch	Mon Jul 28 21:32:33 2008 +0000
   594.3 @@ -0,0 +1,194 @@
   594.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   594.5 +common code, alpha, and sh fail when used.  this should things up.
   594.6 +-mike
   594.7 +
   594.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   594.9 +
  594.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  594.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  594.12 +	definitions from the kernel header to sys/procfs.h and remove the
  594.13 +	#include of asm/elf.h.
  594.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  594.15 +
  594.16 +*Attachment: signature.asc <msg00012/signature.asc>*
  594.17 +/Description:/ This is a digitally signed message part.
  594.18 +
  594.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  594.20 +
  594.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  594.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  594.23 +	definitions from the kernel header to sys/procfs.h and remove the
  594.24 +	#include of asm/elf.h.
  594.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  594.26 +
  594.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  594.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  594.29 +@@ -29,10 +29,23 @@
  594.30 + #include <sys/types.h>
  594.31 + #include <sys/ucontext.h>
  594.32 + #include <sys/user.h>
  594.33 +-#include <asm/elf.h>
  594.34 + 
  594.35 + __BEGIN_DECLS
  594.36 + 
  594.37 ++/*
  594.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  594.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
  594.40 ++ * (32 general regs + processor status word).
  594.41 ++ */
  594.42 ++#define ELF_NGREG  33
  594.43 ++#define ELF_NFPREG 32
  594.44 ++
  594.45 ++typedef unsigned long elf_greg_t;
  594.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  594.47 ++
  594.48 ++typedef double elf_fpreg_t;
  594.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  594.50 ++
  594.51 + struct elf_siginfo
  594.52 +   {
  594.53 +     int si_signo;			/* Signal number.  */
  594.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  594.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  594.56 +@@ -29,10 +29,19 @@
  594.57 + #include <sys/types.h>
  594.58 + #include <sys/ucontext.h>
  594.59 + #include <sys/user.h>
  594.60 +-#include <asm/elf.h>
  594.61 + 
  594.62 + __BEGIN_DECLS
  594.63 + 
  594.64 ++/*
  594.65 ++ * ELF register definitions...
  594.66 ++ */
  594.67 ++typedef unsigned long elf_greg_t;
  594.68 ++
  594.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  594.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  594.71 ++
  594.72 ++typedef struct user_fpu_struct elf_fpregset_t;
  594.73 ++
  594.74 + struct elf_siginfo
  594.75 +   {
  594.76 +     int si_signo;			/* Signal number.  */
  594.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
  594.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  594.79 +@@ -1,115 +1,2 @@
  594.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  594.81 +-   This file is part of the GNU C Library.
  594.82 +-
  594.83 +-   The GNU C Library is free software; you can redistribute it and/or
  594.84 +-   modify it under the terms of the GNU Lesser General Public
  594.85 +-   License as published by the Free Software Foundation; either
  594.86 +-   version 2.1 of the License, or (at your option) any later version.
  594.87 +-
  594.88 +-   The GNU C Library is distributed in the hope that it will be useful,
  594.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
  594.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  594.91 +-   Lesser General Public License for more details.
  594.92 +-
  594.93 +-   You should have received a copy of the GNU Lesser General Public
  594.94 +-   License along with the GNU C Library; if not, write to the Free
  594.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  594.96 +-   02111-1307 USA.  */
  594.97 +-
  594.98 +-#ifndef _SYS_PROCFS_H
  594.99 +-#define _SYS_PROCFS_H	1
 594.100 +-
 594.101 +-/* This is somehow modelled after the file of the same name on SysVr4
 594.102 +-   systems.  It provides a definition of the core file format for ELF
 594.103 +-   used on Linux.  */
 594.104 +-
 594.105 +-#include <features.h>
 594.106 +-#include <signal.h>
 594.107 +-#include <sys/time.h>
 594.108 +-#include <sys/types.h>
 594.109 +-#include <sys/ucontext.h>
 594.110 +-#include <sys/user.h>
 594.111 +-#include <asm/elf.h>
 594.112 +-
 594.113 +-__BEGIN_DECLS
 594.114 +-
 594.115 +-struct elf_siginfo
 594.116 +-  {
 594.117 +-    int si_signo;			/* Signal number.  */
 594.118 +-    int si_code;			/* Extra code.  */
 594.119 +-    int si_errno;			/* Errno.  */
 594.120 +-  };
 594.121 +-
 594.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
 594.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
 594.124 +-   front to prevent clashes with linux definitions, and the typedef
 594.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
 594.126 +-   but more Linuxy, with things that Linux does not support and which
 594.127 +-   gdb doesn't really use excluded.  Fields present but not used are
 594.128 +-   marked with "XXX".  */
 594.129 +-struct elf_prstatus
 594.130 +-  {
 594.131 +-#if 0
 594.132 +-    long int pr_flags;			/* XXX Process flags.  */
 594.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
 594.134 +-    short int pr_what;			/* XXX More detailed reason.  */
 594.135 +-#endif
 594.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 594.137 +-    short int pr_cursig;		/* Current signal.  */
 594.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 594.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
 594.140 +-#if 0
 594.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 594.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
 594.143 +-#endif
 594.144 +-    __pid_t pr_pid;
 594.145 +-    __pid_t pr_ppid;
 594.146 +-    __pid_t pr_pgrp;
 594.147 +-    __pid_t pr_sid;
 594.148 +-    struct timeval pr_utime;		/* User time.  */
 594.149 +-    struct timeval pr_stime;		/* System time.  */
 594.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
 594.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
 594.152 +-#if 0
 594.153 +-    long int pr_instr;			/* Current instruction.  */
 594.154 +-#endif
 594.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
 594.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
 594.157 +-  };
 594.158 +-
 594.159 +-
 594.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 594.161 +-
 594.162 +-struct elf_prpsinfo
 594.163 +-  {
 594.164 +-    char pr_state;			/* Numeric process state.  */
 594.165 +-    char pr_sname;			/* Char for pr_state.  */
 594.166 +-    char pr_zomb;			/* Zombie.  */
 594.167 +-    char pr_nice;			/* Nice val.  */
 594.168 +-    unsigned long int pr_flag;		/* Flags.  */
 594.169 +-    unsigned short int pr_uid;
 594.170 +-    unsigned short int pr_gid;
 594.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 594.172 +-    /* Lots missing */
 594.173 +-    char pr_fname[16];			/* Filename of executable.  */
 594.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 594.175 +-  };
 594.176 +-
 594.177 +-/* Addresses.  */
 594.178 +-typedef void *psaddr_t;
 594.179 +-
 594.180 +-/* Register sets.  Linux has different names.  */
 594.181 +-typedef gregset_t prgregset_t;
 594.182 +-typedef fpregset_t prfpregset_t;
 594.183 +-
 594.184 +-/* We don't have any differences between processes and threads,
 594.185 +-   therefore habe only ine PID type.  */
 594.186 +-typedef __pid_t lwpid_t;
 594.187 +-
 594.188 +-
 594.189 +-typedef struct elf_prstatus prstatus_t;
 594.190 +-typedef struct elf_prpsinfo prpsinfo_t;
 594.191 +-
 594.192 +-__END_DECLS
 594.193 +-
 594.194 +-#endif	/* sys/procfs.h */
 594.195 ++/* sys/procfs.h is architecture specific.  */
 594.196 ++#error "This file must be supplied by every Linux architecture."
 594.197 +
   595.1 --- a/patches/glibc/2.6.1/170-i386-preferred-stack-boundary.patch	Mon Jul 28 21:08:01 2008 +0000
   595.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   595.3 @@ -1,18 +0,0 @@
   595.4 -(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
   595.5 -License: LGPL v2.1
   595.6 -
   595.7 -Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
   595.8 -and 2 is not.
   595.9 -
  595.10 -diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
  595.11 ---- glibc-2.5.orig/sysdeps/i386/Makefile	2005-03-06 01:18:16.000000000 +0100
  595.12 -+++ glibc-2.5/sysdeps/i386/Makefile	2007-05-27 17:49:37.000000000 +0200
  595.13 -@@ -36,7 +36,7 @@
  595.14 - ifeq ($(subdir),csu)
  595.15 - sysdep-CFLAGS += -mpreferred-stack-boundary=4
  595.16 - else
  595.17 --sysdep-CFLAGS += -mpreferred-stack-boundary=2
  595.18 -+sysdep-CFLAGS += -mpreferred-stack-boundary=4
  595.19 - # Likewise, any function which calls user callbacks
  595.20 - uses-callbacks += -mpreferred-stack-boundary=4
  595.21 - # Likewise, any stack alignment tests
   596.1 --- a/patches/glibc/2.6.1/180-alpha-asm_page.patch	Mon Jul 28 21:08:01 2008 +0000
   596.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   596.3 @@ -1,26 +0,0 @@
   596.4 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   596.5 -
   596.6 -	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   596.7 -	from the kernel header to sys/user.h and remove the #include of
   596.8 -	sys/user.h.
   596.9 -
  596.10 ---- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  596.11 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  596.12 -@@ -23,7 +23,6 @@
  596.13 -    only. Don't read too much into it. Don't use it for anything other
  596.14 -    than gdb/strace unless you know what you are doing. */
  596.15 - 
  596.16 --#include <asm/page.h>
  596.17 - #include <asm/reg.h>
  596.18 - 
  596.19 - struct user
  596.20 -@@ -41,6 +40,9 @@ struct user
  596.21 -   char u_comm[32];				/* user command name */
  596.22 - };
  596.23 - 
  596.24 -+#define PAGE_SHIFT		13
  596.25 -+#define PAGE_SIZE		(1 << PAGE_SHIFT)
  596.26 -+#define PAGE_MASK		(~(PAGE_SIZE-1))
  596.27 - #define NBPG			PAGE_SIZE
  596.28 - #define UPAGES			1
  596.29 - #define HOST_TEXT_START_ADDR	(u.start_code)
   597.1 --- a/patches/glibc/2.6.1/190-use_short_for_fnstsw.patch	Mon Jul 28 21:08:01 2008 +0000
   597.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   597.3 @@ -1,18 +0,0 @@
   597.4 -Original patch from H.J. Lu, as reported there:
   597.5 -http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   597.6 -
   597.7 -fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   597.8 -The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   597.9 -
  597.10 -diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
  597.11 ---- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  597.12 -+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:56:14.000000000 +0200
  597.13 -@@ -26,7 +26,7 @@
  597.14 - int
  597.15 - fetestexcept (int excepts)
  597.16 - {
  597.17 --  int temp;
  597.18 -+  short temp;
  597.19 -   int xtemp = 0;
  597.20 - 
  597.21 -   /* Get current exceptions.  */
   598.1 --- a/patches/glibc/2.6.1/200-alpha-asm_elf.patch	Mon Jul 28 21:08:01 2008 +0000
   598.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   598.3 @@ -1,194 +0,0 @@
   598.4 -since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   598.5 -common code, alpha, and sh fail when used.  this should things up.
   598.6 --mike
   598.7 -
   598.8 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   598.9 -
  598.10 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  598.11 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  598.12 -	definitions from the kernel header to sys/procfs.h and remove the
  598.13 -	#include of asm/elf.h.
  598.14 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  598.15 -
  598.16 -*Attachment: signature.asc <msg00012/signature.asc>*
  598.17 -/Description:/ This is a digitally signed message part.
  598.18 -
  598.19 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  598.20 -
  598.21 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  598.22 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  598.23 -	definitions from the kernel header to sys/procfs.h and remove the
  598.24 -	#include of asm/elf.h.
  598.25 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  598.26 -
  598.27 ---- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  598.28 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  598.29 -@@ -29,10 +29,23 @@
  598.30 - #include <sys/types.h>
  598.31 - #include <sys/ucontext.h>
  598.32 - #include <sys/user.h>
  598.33 --#include <asm/elf.h>
  598.34 - 
  598.35 - __BEGIN_DECLS
  598.36 - 
  598.37 -+/*
  598.38 -+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  598.39 -+ * I have no idea why that is so.  For now, we just leave it at 33
  598.40 -+ * (32 general regs + processor status word).
  598.41 -+ */
  598.42 -+#define ELF_NGREG  33
  598.43 -+#define ELF_NFPREG 32
  598.44 -+
  598.45 -+typedef unsigned long elf_greg_t;
  598.46 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  598.47 -+
  598.48 -+typedef double elf_fpreg_t;
  598.49 -+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  598.50 -+
  598.51 - struct elf_siginfo
  598.52 -   {
  598.53 -     int si_signo;			/* Signal number.  */
  598.54 ---- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  598.55 -+++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  598.56 -@@ -29,10 +29,19 @@
  598.57 - #include <sys/types.h>
  598.58 - #include <sys/ucontext.h>
  598.59 - #include <sys/user.h>
  598.60 --#include <asm/elf.h>
  598.61 - 
  598.62 - __BEGIN_DECLS
  598.63 - 
  598.64 -+/*
  598.65 -+ * ELF register definitions...
  598.66 -+ */
  598.67 -+typedef unsigned long elf_greg_t;
  598.68 -+
  598.69 -+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  598.70 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  598.71 -+
  598.72 -+typedef struct user_fpu_struct elf_fpregset_t;
  598.73 -+
  598.74 - struct elf_siginfo
  598.75 -   {
  598.76 -     int si_signo;			/* Signal number.  */
  598.77 ---- a/sysdeps/unix/sysv/linux/sys/procfs.h
  598.78 -+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  598.79 -@@ -1,115 +1,2 @@
  598.80 --/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  598.81 --   This file is part of the GNU C Library.
  598.82 --
  598.83 --   The GNU C Library is free software; you can redistribute it and/or
  598.84 --   modify it under the terms of the GNU Lesser General Public
  598.85 --   License as published by the Free Software Foundation; either
  598.86 --   version 2.1 of the License, or (at your option) any later version.
  598.87 --
  598.88 --   The GNU C Library is distributed in the hope that it will be useful,
  598.89 --   but WITHOUT ANY WARRANTY; without even the implied warranty of
  598.90 --   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  598.91 --   Lesser General Public License for more details.
  598.92 --
  598.93 --   You should have received a copy of the GNU Lesser General Public
  598.94 --   License along with the GNU C Library; if not, write to the Free
  598.95 --   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  598.96 --   02111-1307 USA.  */
  598.97 --
  598.98 --#ifndef _SYS_PROCFS_H
  598.99 --#define _SYS_PROCFS_H	1
 598.100 --
 598.101 --/* This is somehow modelled after the file of the same name on SysVr4
 598.102 --   systems.  It provides a definition of the core file format for ELF
 598.103 --   used on Linux.  */
 598.104 --
 598.105 --#include <features.h>
 598.106 --#include <signal.h>
 598.107 --#include <sys/time.h>
 598.108 --#include <sys/types.h>
 598.109 --#include <sys/ucontext.h>
 598.110 --#include <sys/user.h>
 598.111 --#include <asm/elf.h>
 598.112 --
 598.113 --__BEGIN_DECLS
 598.114 --
 598.115 --struct elf_siginfo
 598.116 --  {
 598.117 --    int si_signo;			/* Signal number.  */
 598.118 --    int si_code;			/* Extra code.  */
 598.119 --    int si_errno;			/* Errno.  */
 598.120 --  };
 598.121 --
 598.122 --/* Definitions to generate Intel SVR4-like core files.  These mostly
 598.123 --   have the same names as the SVR4 types with "elf_" tacked on the
 598.124 --   front to prevent clashes with linux definitions, and the typedef
 598.125 --   forms have been avoided.  This is mostly like the SVR4 structure,
 598.126 --   but more Linuxy, with things that Linux does not support and which
 598.127 --   gdb doesn't really use excluded.  Fields present but not used are
 598.128 --   marked with "XXX".  */
 598.129 --struct elf_prstatus
 598.130 --  {
 598.131 --#if 0
 598.132 --    long int pr_flags;			/* XXX Process flags.  */
 598.133 --    short int pr_why;			/* XXX Reason for process halt.  */
 598.134 --    short int pr_what;			/* XXX More detailed reason.  */
 598.135 --#endif
 598.136 --    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 598.137 --    short int pr_cursig;		/* Current signal.  */
 598.138 --    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 598.139 --    unsigned long int pr_sighold;	/* Set of held signals.  */
 598.140 --#if 0
 598.141 --    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 598.142 --    struct sigaction pr_action;		/* Signal action for current sig.  */
 598.143 --#endif
 598.144 --    __pid_t pr_pid;
 598.145 --    __pid_t pr_ppid;
 598.146 --    __pid_t pr_pgrp;
 598.147 --    __pid_t pr_sid;
 598.148 --    struct timeval pr_utime;		/* User time.  */
 598.149 --    struct timeval pr_stime;		/* System time.  */
 598.150 --    struct timeval pr_cutime;		/* Cumulative user time.  */
 598.151 --    struct timeval pr_cstime;		/* Cumulative system time.  */
 598.152 --#if 0
 598.153 --    long int pr_instr;			/* Current instruction.  */
 598.154 --#endif
 598.155 --    elf_gregset_t pr_reg;		/* GP registers.  */
 598.156 --    int pr_fpvalid;			/* True if math copro being used.  */
 598.157 --  };
 598.158 --
 598.159 --
 598.160 --#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 598.161 --
 598.162 --struct elf_prpsinfo
 598.163 --  {
 598.164 --    char pr_state;			/* Numeric process state.  */
 598.165 --    char pr_sname;			/* Char for pr_state.  */
 598.166 --    char pr_zomb;			/* Zombie.  */
 598.167 --    char pr_nice;			/* Nice val.  */
 598.168 --    unsigned long int pr_flag;		/* Flags.  */
 598.169 --    unsigned short int pr_uid;
 598.170 --    unsigned short int pr_gid;
 598.171 --    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 598.172 --    /* Lots missing */
 598.173 --    char pr_fname[16];			/* Filename of executable.  */
 598.174 --    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 598.175 --  };
 598.176 --
 598.177 --/* Addresses.  */
 598.178 --typedef void *psaddr_t;
 598.179 --
 598.180 --/* Register sets.  Linux has different names.  */
 598.181 --typedef gregset_t prgregset_t;
 598.182 --typedef fpregset_t prfpregset_t;
 598.183 --
 598.184 --/* We don't have any differences between processes and threads,
 598.185 --   therefore habe only ine PID type.  */
 598.186 --typedef __pid_t lwpid_t;
 598.187 --
 598.188 --
 598.189 --typedef struct elf_prstatus prstatus_t;
 598.190 --typedef struct elf_prpsinfo prpsinfo_t;
 598.191 --
 598.192 --__END_DECLS
 598.193 --
 598.194 --#endif	/* sys/procfs.h */
 598.195 -+/* sys/procfs.h is architecture specific.  */
 598.196 -+#error "This file must be supplied by every Linux architecture."
 598.197 -
   599.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   599.2 +++ b/patches/glibc/2.6/100-cygwin.patch	Mon Jul 28 21:32:33 2008 +0000
   599.3 @@ -0,0 +1,187 @@
   599.4 +Fixes
   599.5 +elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
   599.6 +...
   599.7 +when building glibc-2.3.x on cygwin
   599.8 +
   599.9 +Idea from
  599.10 +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
  599.11 +Basically, make glibc use .oST as suffix for 'object static'
  599.12 +instead of .oS, since cygwin has trouble distinguishing .os from .oS
  599.13 +(Original patch had .on, but .oST is more mnemonic for 'object static')
  599.14 +
  599.15 +glibc-linuxthreads-2.3.5 also requires a patch, see 
  599.16 +../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
  599.17 +
  599.18 +[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
  599.19 +
  599.20 +Message-ID: <4282FCBA.3040000@unicontrols.cz>
  599.21 +Date: Thu, 12 May 2005 08:50:34 +0200
  599.22 +From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
  599.23 +To: Dan Kegel <dank@kegel.com>
  599.24 +CC:  crossgcc@sources.redhat.com
  599.25 +Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
  599.26 +
  599.27 +Hi Dan,
  599.28 +following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
  599.29 +on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
  599.30 +
  599.31 +-- 
  599.32 +                     Petr Cvachoucek
  599.33 +                     Unicontrols a.s.
  599.34 +                     http://www.unicontrols.cz
  599.35 +]
  599.36 +
  599.37 +diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
  599.38 +--- glibc-2.3.5/Makeconfig	2005-02-16 11:50:19.000000000 +0100
  599.39 ++++ glibc-2.3.5-cygwin/Makeconfig	2005-05-11 08:24:51.046875000 +0200
  599.40 +@@ -472,7 +472,7 @@
  599.41 + # run the linked programs.
  599.42 + link-libc = -Wl,-rpath-link=$(rpath-link) \
  599.43 + 	    $(common-objpfx)libc.so$(libc.so-version) \
  599.44 +-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
  599.45 ++	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
  599.46 + # This is how to find at build-time things that will be installed there.
  599.47 + rpath-dirs = math elf dlfcn nss nis rt resolv crypt
  599.48 + endif
  599.49 +@@ -693,7 +693,7 @@
  599.50 + # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
  599.51 + # to pass different flags for each flavor.
  599.52 + libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
  599.53 +-all-object-suffixes := .o .os .op .og .ob .oS
  599.54 ++all-object-suffixes := .o .os .op .og .ob .oST
  599.55 + object-suffixes :=
  599.56 + CPPFLAGS-.o = $(pic-default)
  599.57 + CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
  599.58 +@@ -749,14 +749,14 @@
  599.59 + 
  599.60 + ifeq (yes,$(build-shared))
  599.61 + # Build special library that contains the static-only routines for libc.
  599.62 +-object-suffixes-for-libc += .oS
  599.63 ++object-suffixes-for-libc += .oST
  599.64 + 
  599.65 + # Must build the routines as PIC, though, because they can end up in (users')
  599.66 + # shared objects.  We don't want to use CFLAGS-os because users may, for
  599.67 + # example, make that processor-specific.
  599.68 +-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
  599.69 +-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  599.70 +-libtype.oS = lib%_nonshared.a
  599.71 ++CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
  599.72 ++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  599.73 ++libtype.oST = lib%_nonshared.a
  599.74 + endif
  599.75 + 
  599.76 + # The assembler can generate debug information too.
  599.77 +diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
  599.78 +--- glibc-2.3.5/Makerules	2004-12-15 19:52:39.000000000 +0100
  599.79 ++++ glibc-2.3.5-cygwin/Makerules	2005-05-11 08:25:33.578125000 +0200
  599.80 +@@ -417,7 +417,7 @@
  599.81 + # Bounded pointer thunks are only built for *.ob
  599.82 + elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
  599.83 + 
  599.84 +-elide-routines.oS += $(filter-out $(static-only-routines),\
  599.85 ++elide-routines.oST += $(filter-out $(static-only-routines),\
  599.86 + 				  $(routines) $(aux) $(sysdep_routines)) \
  599.87 + 		     $(elide-bp-thunks)
  599.88 + elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
  599.89 +@@ -981,7 +981,7 @@
  599.90 + install: $(inst_libdir)/libc.so
  599.91 + $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
  599.92 + 			$(common-objpfx)libc.so$(libc.so-version) \
  599.93 +-			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
  599.94 ++			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
  599.95 + 						  $(libprefix)$(libc-name)) \
  599.96 + 			$(+force)
  599.97 + 	(echo '/* GNU ld script';\
  599.98 +@@ -989,7 +989,7 @@
  599.99 + 	 echo '   the static library, so try that secondarily.  */';\
 599.100 + 	 cat $<; \
 599.101 + 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
 599.102 +-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
 599.103 ++	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
 599.104 +	      ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
 599.105 + 	) > $@.new
 599.106 +	mv -f $@.new $@
 599.107 +diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
 599.108 +--- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
 599.109 ++++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
 599.110 +@@ -13,7 +13,7 @@
 599.111 + 
 599.112 + ifneq (,$($(lib)-static-only-routines))
 599.113 + ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
 599.114 +-object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
 599.115 ++object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
 599.116 + endif
 599.117 + endif
 599.118 + 
 599.119 +@@ -29,7 +29,7 @@
 599.120 + 
 599.121 + # Add each flavor of library to the lists of things to build and install.
 599.122 + install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
 599.123 +-extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
 599.124 ++extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
 599.125 + 			$(patsubst %,%$o,$(filter-out \
 599.126 + 					   $($(lib)-shared-only-routines),\
 599.127 + 					   $(all-$(lib)-routines))))
 599.128 +@@ -57,7 +57,7 @@
 599.129 + 
 599.130 + 
 599.131 + # Use o-iterator.mk to generate a rule for each flavor of library.
 599.132 +-ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
 599.133 ++ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
 599.134 + define o-iterator-doit
 599.135 + $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
 599.136 +   $(patsubst %,$(objpfx)%$o,\
 599.137 +@@ -65,7 +65,7 @@
 599.138 + 			  $(all-$(lib)-routines))); \
 599.139 + 	$$(build-extra-lib)
 599.140 + endef
 599.141 +-object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
 599.142 ++object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
 599.143 + include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
 599.144 + endif
 599.145 + 
 599.146 +@@ -77,9 +77,9 @@
 599.147 + 	$(build-extra-lib)
 599.148 + endif
 599.149 + 
 599.150 +-ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
 599.151 +-$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
 599.152 +-  $(patsubst %,$(objpfx)%.oS,\
 599.153 ++ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
 599.154 ++$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
 599.155 ++  $(patsubst %,$(objpfx)%.oST,\
 599.156 + 	     $(filter $($(lib)-static-only-routines),\
 599.157 + 		      $(all-$(lib)-routines)))
 599.158 + 	$(build-extra-lib)
 599.159 +diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
 599.160 +--- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
 599.161 ++++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
 599.162 +@@ -375,7 +375,7 @@
 599.163 + 
 599.164 + $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
 599.165 + 			      $(objpfx)libpthread.so$(libpthread.so-version) \
 599.166 +-			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
 599.167 ++			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
 599.168 + 							$(libprefix)pthread) \
 599.169 + 			      $(+force)
 599.170 + 	(echo '/* GNU ld script';\
 599.171 +@@ -383,7 +383,7 @@
 599.172 + 	 echo '   the static library, so try that secondarily.  */';\
 599.173 + 	 cat $<; \
 599.174 + 	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
 599.175 +-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
 599.176 ++	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
 599.177 + 	      ')' \
 599.178 + 	) > $@.new
 599.179 + 	mv -f $@.new $@
 599.180 +diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
 599.181 +--- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
 599.182 ++++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
 599.183 +@@ -10,4 +10,4 @@
 599.184 + ASFLAGS-.op += -Wa,-Av9a
 599.185 + ASFLAGS-.og += -Wa,-Av9a
 599.186 + ASFLAGS-.ob += -Wa,-Av9a
 599.187 +-ASFLAGS-.oS += -Wa,-Av9a
 599.188 ++ASFLAGS-.oST += -Wa,-Av9a
 599.189 +
 599.190 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   600.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   600.2 +++ b/patches/glibc/2.6/110-configure-apple-as.patch	Mon Jul 28 21:32:33 2008 +0000
   600.3 @@ -0,0 +1,25 @@
   600.4 +http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
   600.5 +http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
   600.6 +
   600.7 +The following makes it possible to configure glibc-2.3.2 on Mac OS X,
   600.8 +where the assembler but doesn't understand the --version flag.
   600.9 +
  600.10 +Fixes the symptom
  600.11 +checking whether ld is GNU ld... no
  600.12 +checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
  600.13 +checking version of /usr/libexec/gcc/darwin/ppc/as... 
  600.14 +<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
  600.15 +
  600.16 +--- glibc-2.3.2/configure~	Wed Feb 26 09:20:48 2003
  600.17 ++++ glibc-2.3.2/configure	Fri Feb 27 13:12:53 2004
  600.18 +@@ -4039,7 +4039,7 @@
  600.19 +   # Found it, now check the version.
  600.20 +   echo "$as_me:$LINENO: checking version of $AS" >&5
  600.21 + echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
  600.22 +-  ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  600.23 ++  ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  600.24 +   case $ac_prog_version in
  600.25 +     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  600.26 +     2.1[3-9]*)
  600.27 +
  600.28 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   601.1 --- a/patches/glibc/2.6/120-cygwin.patch	Mon Jul 28 21:08:01 2008 +0000
   601.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   601.3 @@ -1,187 +0,0 @@
   601.4 -Fixes
   601.5 -elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
   601.6 -...
   601.7 -when building glibc-2.3.x on cygwin
   601.8 -
   601.9 -Idea from
  601.10 -http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
  601.11 -Basically, make glibc use .oST as suffix for 'object static'
  601.12 -instead of .oS, since cygwin has trouble distinguishing .os from .oS
  601.13 -(Original patch had .on, but .oST is more mnemonic for 'object static')
  601.14 -
  601.15 -glibc-linuxthreads-2.3.5 also requires a patch, see 
  601.16 -../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
  601.17 -
  601.18 -[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
  601.19 -
  601.20 -Message-ID: <4282FCBA.3040000@unicontrols.cz>
  601.21 -Date: Thu, 12 May 2005 08:50:34 +0200
  601.22 -From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
  601.23 -To: Dan Kegel <dank@kegel.com>
  601.24 -CC:  crossgcc@sources.redhat.com
  601.25 -Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
  601.26 -
  601.27 -Hi Dan,
  601.28 -following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
  601.29 -on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
  601.30 -
  601.31 --- 
  601.32 -                     Petr Cvachoucek
  601.33 -                     Unicontrols a.s.
  601.34 -                     http://www.unicontrols.cz
  601.35 -]
  601.36 -
  601.37 -diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
  601.38 ---- glibc-2.3.5/Makeconfig	2005-02-16 11:50:19.000000000 +0100
  601.39 -+++ glibc-2.3.5-cygwin/Makeconfig	2005-05-11 08:24:51.046875000 +0200
  601.40 -@@ -472,7 +472,7 @@
  601.41 - # run the linked programs.
  601.42 - link-libc = -Wl,-rpath-link=$(rpath-link) \
  601.43 - 	    $(common-objpfx)libc.so$(libc.so-version) \
  601.44 --	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
  601.45 -+	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
  601.46 - # This is how to find at build-time things that will be installed there.
  601.47 - rpath-dirs = math elf dlfcn nss nis rt resolv crypt
  601.48 - endif
  601.49 -@@ -693,7 +693,7 @@
  601.50 - # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
  601.51 - # to pass different flags for each flavor.
  601.52 - libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
  601.53 --all-object-suffixes := .o .os .op .og .ob .oS
  601.54 -+all-object-suffixes := .o .os .op .og .ob .oST
  601.55 - object-suffixes :=
  601.56 - CPPFLAGS-.o = $(pic-default)
  601.57 - CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
  601.58 -@@ -749,14 +749,14 @@
  601.59 - 
  601.60 - ifeq (yes,$(build-shared))
  601.61 - # Build special library that contains the static-only routines for libc.
  601.62 --object-suffixes-for-libc += .oS
  601.63 -+object-suffixes-for-libc += .oST
  601.64 - 
  601.65 - # Must build the routines as PIC, though, because they can end up in (users')
  601.66 - # shared objects.  We don't want to use CFLAGS-os because users may, for
  601.67 - # example, make that processor-specific.
  601.68 --CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
  601.69 --CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  601.70 --libtype.oS = lib%_nonshared.a
  601.71 -+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
  601.72 -+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  601.73 -+libtype.oST = lib%_nonshared.a
  601.74 - endif
  601.75 - 
  601.76 - # The assembler can generate debug information too.
  601.77 -diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
  601.78 ---- glibc-2.3.5/Makerules	2004-12-15 19:52:39.000000000 +0100
  601.79 -+++ glibc-2.3.5-cygwin/Makerules	2005-05-11 08:25:33.578125000 +0200
  601.80 -@@ -417,7 +417,7 @@
  601.81 - # Bounded pointer thunks are only built for *.ob
  601.82 - elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
  601.83 - 
  601.84 --elide-routines.oS += $(filter-out $(static-only-routines),\
  601.85 -+elide-routines.oST += $(filter-out $(static-only-routines),\
  601.86 - 				  $(routines) $(aux) $(sysdep_routines)) \
  601.87 - 		     $(elide-bp-thunks)
  601.88 - elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
  601.89 -@@ -981,7 +981,7 @@
  601.90 - install: $(inst_libdir)/libc.so
  601.91 - $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
  601.92 - 			$(common-objpfx)libc.so$(libc.so-version) \
  601.93 --			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
  601.94 -+			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
  601.95 - 						  $(libprefix)$(libc-name)) \
  601.96 - 			$(+force)
  601.97 - 	(echo '/* GNU ld script';\
  601.98 -@@ -989,7 +989,7 @@
  601.99 - 	 echo '   the static library, so try that secondarily.  */';\
 601.100 - 	 cat $<; \
 601.101 - 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
 601.102 --	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
 601.103 -+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
 601.104 -	      ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
 601.105 - 	) > $@.new
 601.106 -	mv -f $@.new $@
 601.107 -diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
 601.108 ---- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
 601.109 -+++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
 601.110 -@@ -13,7 +13,7 @@
 601.111 - 
 601.112 - ifneq (,$($(lib)-static-only-routines))
 601.113 - ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
 601.114 --object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
 601.115 -+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
 601.116 - endif
 601.117 - endif
 601.118 - 
 601.119 -@@ -29,7 +29,7 @@
 601.120 - 
 601.121 - # Add each flavor of library to the lists of things to build and install.
 601.122 - install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
 601.123 --extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
 601.124 -+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
 601.125 - 			$(patsubst %,%$o,$(filter-out \
 601.126 - 					   $($(lib)-shared-only-routines),\
 601.127 - 					   $(all-$(lib)-routines))))
 601.128 -@@ -57,7 +57,7 @@
 601.129 - 
 601.130 - 
 601.131 - # Use o-iterator.mk to generate a rule for each flavor of library.
 601.132 --ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
 601.133 -+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
 601.134 - define o-iterator-doit
 601.135 - $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
 601.136 -   $(patsubst %,$(objpfx)%$o,\
 601.137 -@@ -65,7 +65,7 @@
 601.138 - 			  $(all-$(lib)-routines))); \
 601.139 - 	$$(build-extra-lib)
 601.140 - endef
 601.141 --object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
 601.142 -+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
 601.143 - include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
 601.144 - endif
 601.145 - 
 601.146 -@@ -77,9 +77,9 @@
 601.147 - 	$(build-extra-lib)
 601.148 - endif
 601.149 - 
 601.150 --ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
 601.151 --$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
 601.152 --  $(patsubst %,$(objpfx)%.oS,\
 601.153 -+ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
 601.154 -+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
 601.155 -+  $(patsubst %,$(objpfx)%.oST,\
 601.156 - 	     $(filter $($(lib)-static-only-routines),\
 601.157 - 		      $(all-$(lib)-routines)))
 601.158 - 	$(build-extra-lib)
 601.159 -diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
 601.160 ---- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
 601.161 -+++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
 601.162 -@@ -375,7 +375,7 @@
 601.163 - 
 601.164 - $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
 601.165 - 			      $(objpfx)libpthread.so$(libpthread.so-version) \
 601.166 --			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
 601.167 -+			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
 601.168 - 							$(libprefix)pthread) \
 601.169 - 			      $(+force)
 601.170 - 	(echo '/* GNU ld script';\
 601.171 -@@ -383,7 +383,7 @@
 601.172 - 	 echo '   the static library, so try that secondarily.  */';\
 601.173 - 	 cat $<; \
 601.174 - 	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
 601.175 --	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
 601.176 -+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
 601.177 - 	      ')' \
 601.178 - 	) > $@.new
 601.179 - 	mv -f $@.new $@
 601.180 -diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
 601.181 ---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
 601.182 -+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
 601.183 -@@ -10,4 +10,4 @@
 601.184 - ASFLAGS-.op += -Wa,-Av9a
 601.185 - ASFLAGS-.og += -Wa,-Av9a
 601.186 - ASFLAGS-.ob += -Wa,-Av9a
 601.187 --ASFLAGS-.oS += -Wa,-Av9a
 601.188 -+ASFLAGS-.oST += -Wa,-Av9a
 601.189 -
 601.190 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   602.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   602.2 +++ b/patches/glibc/2.6/120-fix-pr631.patch	Mon Jul 28 21:32:33 2008 +0000
   602.3 @@ -0,0 +1,45 @@
   602.4 +From dank@kegel.com
   602.5 +Wed Jun 15 09:12:43 PDT 2005
   602.6 +
   602.7 +Fixes
   602.8 +
   602.9 +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  602.10 +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  602.11 +... 53 lines deleted ...
  602.12 +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  602.13 +collect2: ld returned 1 exit status
  602.14 +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  602.15 +
  602.16 +when building glibc with --enable-static-nss.
  602.17 +
  602.18 +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  602.19 +
  602.20 +--- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  602.21 ++++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  602.22 +@@ -510,7 +510,7 @@
  602.23 + 
  602.24 + # The static libraries.
  602.25 + ifeq (yes,$(build-static))
  602.26 +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  602.27 ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  602.28 + else
  602.29 + ifeq (yes,$(build-shared))
  602.30 + # We can try to link the programs with lib*_pic.a...
  602.31 +--- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  602.32 ++++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  602.33 +@@ -120,6 +120,13 @@
  602.34 + install-bin-script = ldd
  602.35 + endif
  602.36 + 
  602.37 ++ifeq (yes,$(build-static-nss))
  602.38 ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  602.39 ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  602.40 ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  602.41 ++	     $(resolvobjdir)/libresolv.a
  602.42 ++endif
  602.43 ++
  602.44 + others		= sprof sln
  602.45 + install-bin	= sprof
  602.46 + others-static   = sln
  602.47 +
  602.48 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   603.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   603.2 +++ b/patches/glibc/2.6/130-i686-assembler.patch	Mon Jul 28 21:32:33 2008 +0000
   603.3 @@ -0,0 +1,38 @@
   603.4 +2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
   603.5 +
   603.6 +       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
   603.7 +       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
   603.8 +
   603.9 +
  603.10 +
  603.11 +Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
  603.12 +===================================================================
  603.13 +--- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(revision 1469)
  603.14 ++++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(working copy)
  603.15 +@@ -29,6 +29,10 @@
  603.16 + #include <dl-sysdep.h>
  603.17 + #include <tls.h>
  603.18 + 
  603.19 ++#if defined __i686 && defined __ASSEMBLER__
  603.20 ++#undef __i686
  603.21 ++#define __i686 __i686
  603.22 ++#endif
  603.23 + 
  603.24 + /* For Linux we can use the system call table in the header file
  603.25 + 	/usr/include/asm/unistd.h
  603.26 +Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
  603.27 +===================================================================
  603.28 +--- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(revision 1469)
  603.29 ++++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(working copy)
  603.30 +@@ -45,6 +45,11 @@
  603.31 + /* Embed an #include to pull in the alignment and .end directives. */
  603.32 + asm ("\n#include \"defs.h\"");
  603.33 + 
  603.34 ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
  603.35 ++asm ("\n#undef __i686");
  603.36 ++asm ("\n#define __i686 __i686");
  603.37 ++asm ("\n#endif");
  603.38 ++
  603.39 + /* The initial common code ends here. */
  603.40 + asm ("\n/*@HEADER_ENDS*/");
  603.41 + 
   604.1 --- a/patches/glibc/2.6/140-configure-apple-as.patch	Mon Jul 28 21:08:01 2008 +0000
   604.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   604.3 @@ -1,25 +0,0 @@
   604.4 -http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
   604.5 -http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
   604.6 -
   604.7 -The following makes it possible to configure glibc-2.3.2 on Mac OS X,
   604.8 -where the assembler but doesn't understand the --version flag.
   604.9 -
  604.10 -Fixes the symptom
  604.11 -checking whether ld is GNU ld... no
  604.12 -checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
  604.13 -checking version of /usr/libexec/gcc/darwin/ppc/as... 
  604.14 -<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
  604.15 -
  604.16 ---- glibc-2.3.2/configure~	Wed Feb 26 09:20:48 2003
  604.17 -+++ glibc-2.3.2/configure	Fri Feb 27 13:12:53 2004
  604.18 -@@ -4039,7 +4039,7 @@
  604.19 -   # Found it, now check the version.
  604.20 -   echo "$as_me:$LINENO: checking version of $AS" >&5
  604.21 - echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
  604.22 --  ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  604.23 -+  ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  604.24 -   case $ac_prog_version in
  604.25 -     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  604.26 -     2.1[3-9]*)
  604.27 -
  604.28 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   605.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   605.2 +++ b/patches/glibc/2.6/140-i386-preferred-stack-boundary.patch	Mon Jul 28 21:32:33 2008 +0000
   605.3 @@ -0,0 +1,18 @@
   605.4 +(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
   605.5 +License: LGPL v2.1
   605.6 +
   605.7 +Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
   605.8 +and 2 is not.
   605.9 +
  605.10 +diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
  605.11 +--- glibc-2.5.orig/sysdeps/i386/Makefile	2005-03-06 01:18:16.000000000 +0100
  605.12 ++++ glibc-2.5/sysdeps/i386/Makefile	2007-05-27 17:49:37.000000000 +0200
  605.13 +@@ -36,7 +36,7 @@
  605.14 + ifeq ($(subdir),csu)
  605.15 + sysdep-CFLAGS += -mpreferred-stack-boundary=4
  605.16 + else
  605.17 +-sysdep-CFLAGS += -mpreferred-stack-boundary=2
  605.18 ++sysdep-CFLAGS += -mpreferred-stack-boundary=4
  605.19 + # Likewise, any function which calls user callbacks
  605.20 + uses-callbacks += -mpreferred-stack-boundary=4
  605.21 + # Likewise, any stack alignment tests
   606.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   606.2 +++ b/patches/glibc/2.6/150-alpha-asm_page.patch	Mon Jul 28 21:32:33 2008 +0000
   606.3 @@ -0,0 +1,26 @@
   606.4 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   606.5 +
   606.6 +	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   606.7 +	from the kernel header to sys/user.h and remove the #include of
   606.8 +	sys/user.h.
   606.9 +
  606.10 +--- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  606.11 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  606.12 +@@ -23,7 +23,6 @@
  606.13 +    only. Don't read too much into it. Don't use it for anything other
  606.14 +    than gdb/strace unless you know what you are doing. */
  606.15 + 
  606.16 +-#include <asm/page.h>
  606.17 + #include <asm/reg.h>
  606.18 + 
  606.19 + struct user
  606.20 +@@ -41,6 +40,9 @@ struct user
  606.21 +   char u_comm[32];				/* user command name */
  606.22 + };
  606.23 + 
  606.24 ++#define PAGE_SHIFT		13
  606.25 ++#define PAGE_SIZE		(1 << PAGE_SHIFT)
  606.26 ++#define PAGE_MASK		(~(PAGE_SIZE-1))
  606.27 + #define NBPG			PAGE_SIZE
  606.28 + #define UPAGES			1
  606.29 + #define HOST_TEXT_START_ADDR	(u.start_code)
   607.1 --- a/patches/glibc/2.6/150-fix-pr631.patch	Mon Jul 28 21:08:01 2008 +0000
   607.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   607.3 @@ -1,45 +0,0 @@
   607.4 -From dank@kegel.com
   607.5 -Wed Jun 15 09:12:43 PDT 2005
   607.6 -
   607.7 -Fixes
   607.8 -
   607.9 -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  607.10 -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  607.11 -... 53 lines deleted ...
  607.12 -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  607.13 -collect2: ld returned 1 exit status
  607.14 -make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  607.15 -
  607.16 -when building glibc with --enable-static-nss.
  607.17 -
  607.18 -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  607.19 -
  607.20 ---- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  607.21 -+++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  607.22 -@@ -510,7 +510,7 @@
  607.23 - 
  607.24 - # The static libraries.
  607.25 - ifeq (yes,$(build-static))
  607.26 --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  607.27 -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  607.28 - else
  607.29 - ifeq (yes,$(build-shared))
  607.30 - # We can try to link the programs with lib*_pic.a...
  607.31 ---- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  607.32 -+++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  607.33 -@@ -120,6 +120,13 @@
  607.34 - install-bin-script = ldd
  607.35 - endif
  607.36 - 
  607.37 -+ifeq (yes,$(build-static-nss))
  607.38 -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  607.39 -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  607.40 -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  607.41 -+	     $(resolvobjdir)/libresolv.a
  607.42 -+endif
  607.43 -+
  607.44 - others		= sprof sln
  607.45 - install-bin	= sprof
  607.46 - others-static   = sln
  607.47 -
  607.48 -Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
   608.1 --- a/patches/glibc/2.6/160-i686-assembler.patch	Mon Jul 28 21:08:01 2008 +0000
   608.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   608.3 @@ -1,38 +0,0 @@
   608.4 -2007-02-15  Khem Raj  <kraj@xxxxxxxxxx>
   608.5 -
   608.6 -       * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
   608.7 -       * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
   608.8 -
   608.9 -
  608.10 -
  608.11 -Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
  608.12 -===================================================================
  608.13 ---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(revision 1469)
  608.14 -+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(working copy)
  608.15 -@@ -29,6 +29,10 @@
  608.16 - #include <dl-sysdep.h>
  608.17 - #include <tls.h>
  608.18 - 
  608.19 -+#if defined __i686 && defined __ASSEMBLER__
  608.20 -+#undef __i686
  608.21 -+#define __i686 __i686
  608.22 -+#endif
  608.23 - 
  608.24 - /* For Linux we can use the system call table in the header file
  608.25 - 	/usr/include/asm/unistd.h
  608.26 -Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
  608.27 -===================================================================
  608.28 ---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(revision 1469)
  608.29 -+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(working copy)
  608.30 -@@ -45,6 +45,11 @@
  608.31 - /* Embed an #include to pull in the alignment and .end directives. */
  608.32 - asm ("\n#include \"defs.h\"");
  608.33 - 
  608.34 -+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
  608.35 -+asm ("\n#undef __i686");
  608.36 -+asm ("\n#define __i686 __i686");
  608.37 -+asm ("\n#endif");
  608.38 -+
  608.39 - /* The initial common code ends here. */
  608.40 - asm ("\n/*@HEADER_ENDS*/");
  608.41 - 
   609.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   609.2 +++ b/patches/glibc/2.6/160-use_short_for_fnstsw.patch	Mon Jul 28 21:32:33 2008 +0000
   609.3 @@ -0,0 +1,18 @@
   609.4 +Original patch from H.J. Lu, as reported there:
   609.5 +http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   609.6 +
   609.7 +fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   609.8 +The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   609.9 +
  609.10 +diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
  609.11 +--- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  609.12 ++++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:56:14.000000000 +0200
  609.13 +@@ -26,7 +26,7 @@
  609.14 + int
  609.15 + fetestexcept (int excepts)
  609.16 + {
  609.17 +-  int temp;
  609.18 ++  short temp;
  609.19 +   int xtemp = 0;
  609.20 + 
  609.21 +   /* Get current exceptions.  */
   610.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   610.2 +++ b/patches/glibc/2.6/170-alpha-asm_elf.patch	Mon Jul 28 21:32:33 2008 +0000
   610.3 @@ -0,0 +1,194 @@
   610.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   610.5 +common code, alpha, and sh fail when used.  this should things up.
   610.6 +-mike
   610.7 +
   610.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   610.9 +
  610.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  610.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  610.12 +	definitions from the kernel header to sys/procfs.h and remove the
  610.13 +	#include of asm/elf.h.
  610.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  610.15 +
  610.16 +*Attachment: signature.asc <msg00012/signature.asc>*
  610.17 +/Description:/ This is a digitally signed message part.
  610.18 +
  610.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  610.20 +
  610.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  610.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  610.23 +	definitions from the kernel header to sys/procfs.h and remove the
  610.24 +	#include of asm/elf.h.
  610.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  610.26 +
  610.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  610.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  610.29 +@@ -29,10 +29,23 @@
  610.30 + #include <sys/types.h>
  610.31 + #include <sys/ucontext.h>
  610.32 + #include <sys/user.h>
  610.33 +-#include <asm/elf.h>
  610.34 + 
  610.35 + __BEGIN_DECLS
  610.36 + 
  610.37 ++/*
  610.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  610.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
  610.40 ++ * (32 general regs + processor status word).
  610.41 ++ */
  610.42 ++#define ELF_NGREG  33
  610.43 ++#define ELF_NFPREG 32
  610.44 ++
  610.45 ++typedef unsigned long elf_greg_t;
  610.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  610.47 ++
  610.48 ++typedef double elf_fpreg_t;
  610.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  610.50 ++
  610.51 + struct elf_siginfo
  610.52 +   {
  610.53 +     int si_signo;			/* Signal number.  */
  610.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  610.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  610.56 +@@ -29,10 +29,19 @@
  610.57 + #include <sys/types.h>
  610.58 + #include <sys/ucontext.h>
  610.59 + #include <sys/user.h>
  610.60 +-#include <asm/elf.h>
  610.61 + 
  610.62 + __BEGIN_DECLS
  610.63 + 
  610.64 ++/*
  610.65 ++ * ELF register definitions...
  610.66 ++ */
  610.67 ++typedef unsigned long elf_greg_t;
  610.68 ++
  610.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  610.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  610.71 ++
  610.72 ++typedef struct user_fpu_struct elf_fpregset_t;
  610.73 ++
  610.74 + struct elf_siginfo
  610.75 +   {
  610.76 +     int si_signo;			/* Signal number.  */
  610.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
  610.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  610.79 +@@ -1,115 +1,2 @@
  610.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  610.81 +-   This file is part of the GNU C Library.
  610.82 +-
  610.83 +-   The GNU C Library is free software; you can redistribute it and/or
  610.84 +-   modify it under the terms of the GNU Lesser General Public
  610.85 +-   License as published by the Free Software Foundation; either
  610.86 +-   version 2.1 of the License, or (at your option) any later version.
  610.87 +-
  610.88 +-   The GNU C Library is distributed in the hope that it will be useful,
  610.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
  610.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  610.91 +-   Lesser General Public License for more details.
  610.92 +-
  610.93 +-   You should have received a copy of the GNU Lesser General Public
  610.94 +-   License along with the GNU C Library; if not, write to the Free
  610.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  610.96 +-   02111-1307 USA.  */
  610.97 +-
  610.98 +-#ifndef _SYS_PROCFS_H
  610.99 +-#define _SYS_PROCFS_H	1
 610.100 +-
 610.101 +-/* This is somehow modelled after the file of the same name on SysVr4
 610.102 +-   systems.  It provides a definition of the core file format for ELF
 610.103 +-   used on Linux.  */
 610.104 +-
 610.105 +-#include <features.h>
 610.106 +-#include <signal.h>
 610.107 +-#include <sys/time.h>
 610.108 +-#include <sys/types.h>
 610.109 +-#include <sys/ucontext.h>
 610.110 +-#include <sys/user.h>
 610.111 +-#include <asm/elf.h>
 610.112 +-
 610.113 +-__BEGIN_DECLS
 610.114 +-
 610.115 +-struct elf_siginfo
 610.116 +-  {
 610.117 +-    int si_signo;			/* Signal number.  */
 610.118 +-    int si_code;			/* Extra code.  */
 610.119 +-    int si_errno;			/* Errno.  */
 610.120 +-  };
 610.121 +-
 610.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
 610.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
 610.124 +-   front to prevent clashes with linux definitions, and the typedef
 610.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
 610.126 +-   but more Linuxy, with things that Linux does not support and which
 610.127 +-   gdb doesn't really use excluded.  Fields present but not used are
 610.128 +-   marked with "XXX".  */
 610.129 +-struct elf_prstatus
 610.130 +-  {
 610.131 +-#if 0
 610.132 +-    long int pr_flags;			/* XXX Process flags.  */
 610.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
 610.134 +-    short int pr_what;			/* XXX More detailed reason.  */
 610.135 +-#endif
 610.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 610.137 +-    short int pr_cursig;		/* Current signal.  */
 610.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 610.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
 610.140 +-#if 0
 610.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 610.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
 610.143 +-#endif
 610.144 +-    __pid_t pr_pid;
 610.145 +-    __pid_t pr_ppid;
 610.146 +-    __pid_t pr_pgrp;
 610.147 +-    __pid_t pr_sid;
 610.148 +-    struct timeval pr_utime;		/* User time.  */
 610.149 +-    struct timeval pr_stime;		/* System time.  */
 610.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
 610.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
 610.152 +-#if 0
 610.153 +-    long int pr_instr;			/* Current instruction.  */
 610.154 +-#endif
 610.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
 610.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
 610.157 +-  };
 610.158 +-
 610.159 +-
 610.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 610.161 +-
 610.162 +-struct elf_prpsinfo
 610.163 +-  {
 610.164 +-    char pr_state;			/* Numeric process state.  */
 610.165 +-    char pr_sname;			/* Char for pr_state.  */
 610.166 +-    char pr_zomb;			/* Zombie.  */
 610.167 +-    char pr_nice;			/* Nice val.  */
 610.168 +-    unsigned long int pr_flag;		/* Flags.  */
 610.169 +-    unsigned short int pr_uid;
 610.170 +-    unsigned short int pr_gid;
 610.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 610.172 +-    /* Lots missing */
 610.173 +-    char pr_fname[16];			/* Filename of executable.  */
 610.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 610.175 +-  };
 610.176 +-
 610.177 +-/* Addresses.  */
 610.178 +-typedef void *psaddr_t;
 610.179 +-
 610.180 +-/* Register sets.  Linux has different names.  */
 610.181 +-typedef gregset_t prgregset_t;
 610.182 +-typedef fpregset_t prfpregset_t;
 610.183 +-
 610.184 +-/* We don't have any differences between processes and threads,
 610.185 +-   therefore habe only ine PID type.  */
 610.186 +-typedef __pid_t lwpid_t;
 610.187 +-
 610.188 +-
 610.189 +-typedef struct elf_prstatus prstatus_t;
 610.190 +-typedef struct elf_prpsinfo prpsinfo_t;
 610.191 +-
 610.192 +-__END_DECLS
 610.193 +-
 610.194 +-#endif	/* sys/procfs.h */
 610.195 ++/* sys/procfs.h is architecture specific.  */
 610.196 ++#error "This file must be supplied by every Linux architecture."
 610.197 +
   611.1 --- a/patches/glibc/2.6/170-i386-preferred-stack-boundary.patch	Mon Jul 28 21:08:01 2008 +0000
   611.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   611.3 @@ -1,18 +0,0 @@
   611.4 -(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
   611.5 -License: LGPL v2.1
   611.6 -
   611.7 -Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
   611.8 -and 2 is not.
   611.9 -
  611.10 -diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
  611.11 ---- glibc-2.5.orig/sysdeps/i386/Makefile	2005-03-06 01:18:16.000000000 +0100
  611.12 -+++ glibc-2.5/sysdeps/i386/Makefile	2007-05-27 17:49:37.000000000 +0200
  611.13 -@@ -36,7 +36,7 @@
  611.14 - ifeq ($(subdir),csu)
  611.15 - sysdep-CFLAGS += -mpreferred-stack-boundary=4
  611.16 - else
  611.17 --sysdep-CFLAGS += -mpreferred-stack-boundary=2
  611.18 -+sysdep-CFLAGS += -mpreferred-stack-boundary=4
  611.19 - # Likewise, any function which calls user callbacks
  611.20 - uses-callbacks += -mpreferred-stack-boundary=4
  611.21 - # Likewise, any stack alignment tests
   612.1 --- a/patches/glibc/2.6/180-alpha-asm_page.patch	Mon Jul 28 21:08:01 2008 +0000
   612.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   612.3 @@ -1,26 +0,0 @@
   612.4 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   612.5 -
   612.6 -	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   612.7 -	from the kernel header to sys/user.h and remove the #include of
   612.8 -	sys/user.h.
   612.9 -
  612.10 ---- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  612.11 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  612.12 -@@ -23,7 +23,6 @@
  612.13 -    only. Don't read too much into it. Don't use it for anything other
  612.14 -    than gdb/strace unless you know what you are doing. */
  612.15 - 
  612.16 --#include <asm/page.h>
  612.17 - #include <asm/reg.h>
  612.18 - 
  612.19 - struct user
  612.20 -@@ -41,6 +40,9 @@ struct user
  612.21 -   char u_comm[32];				/* user command name */
  612.22 - };
  612.23 - 
  612.24 -+#define PAGE_SHIFT		13
  612.25 -+#define PAGE_SIZE		(1 << PAGE_SHIFT)
  612.26 -+#define PAGE_MASK		(~(PAGE_SIZE-1))
  612.27 - #define NBPG			PAGE_SIZE
  612.28 - #define UPAGES			1
  612.29 - #define HOST_TEXT_START_ADDR	(u.start_code)
   613.1 --- a/patches/glibc/2.6/190-use_short_for_fnstsw.patch	Mon Jul 28 21:08:01 2008 +0000
   613.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   613.3 @@ -1,18 +0,0 @@
   613.4 -Original patch from H.J. Lu, as reported there:
   613.5 -http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   613.6 -
   613.7 -fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   613.8 -The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   613.9 -
  613.10 -diff -dur glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
  613.11 ---- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  613.12 -+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:56:14.000000000 +0200
  613.13 -@@ -26,7 +26,7 @@
  613.14 - int
  613.15 - fetestexcept (int excepts)
  613.16 - {
  613.17 --  int temp;
  613.18 -+  short temp;
  613.19 -   int xtemp = 0;
  613.20 - 
  613.21 -   /* Get current exceptions.  */
   614.1 --- a/patches/glibc/2.6/200-alpha-asm_elf.patch	Mon Jul 28 21:08:01 2008 +0000
   614.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   614.3 @@ -1,194 +0,0 @@
   614.4 -since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   614.5 -common code, alpha, and sh fail when used.  this should things up.
   614.6 --mike
   614.7 -
   614.8 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   614.9 -
  614.10 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  614.11 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  614.12 -	definitions from the kernel header to sys/procfs.h and remove the
  614.13 -	#include of asm/elf.h.
  614.14 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  614.15 -
  614.16 -*Attachment: signature.asc <msg00012/signature.asc>*
  614.17 -/Description:/ This is a digitally signed message part.
  614.18 -
  614.19 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  614.20 -
  614.21 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  614.22 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  614.23 -	definitions from the kernel header to sys/procfs.h and remove the
  614.24 -	#include of asm/elf.h.
  614.25 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  614.26 -
  614.27 ---- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  614.28 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  614.29 -@@ -29,10 +29,23 @@
  614.30 - #include <sys/types.h>
  614.31 - #include <sys/ucontext.h>
  614.32 - #include <sys/user.h>
  614.33 --#include <asm/elf.h>
  614.34 - 
  614.35 - __BEGIN_DECLS
  614.36 - 
  614.37 -+/*
  614.38 -+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  614.39 -+ * I have no idea why that is so.  For now, we just leave it at 33
  614.40 -+ * (32 general regs + processor status word).
  614.41 -+ */
  614.42 -+#define ELF_NGREG  33
  614.43 -+#define ELF_NFPREG 32
  614.44 -+
  614.45 -+typedef unsigned long elf_greg_t;
  614.46 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  614.47 -+
  614.48 -+typedef double elf_fpreg_t;
  614.49 -+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  614.50 -+
  614.51 - struct elf_siginfo
  614.52 -   {
  614.53 -     int si_signo;			/* Signal number.  */
  614.54 ---- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  614.55 -+++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  614.56 -@@ -29,10 +29,19 @@
  614.57 - #include <sys/types.h>
  614.58 - #include <sys/ucontext.h>
  614.59 - #include <sys/user.h>
  614.60 --#include <asm/elf.h>
  614.61 - 
  614.62 - __BEGIN_DECLS
  614.63 - 
  614.64 -+/*
  614.65 -+ * ELF register definitions...
  614.66 -+ */
  614.67 -+typedef unsigned long elf_greg_t;
  614.68 -+
  614.69 -+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  614.70 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  614.71 -+
  614.72 -+typedef struct user_fpu_struct elf_fpregset_t;
  614.73 -+
  614.74 - struct elf_siginfo
  614.75 -   {
  614.76 -     int si_signo;			/* Signal number.  */
  614.77 ---- a/sysdeps/unix/sysv/linux/sys/procfs.h
  614.78 -+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  614.79 -@@ -1,115 +1,2 @@
  614.80 --/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  614.81 --   This file is part of the GNU C Library.
  614.82 --
  614.83 --   The GNU C Library is free software; you can redistribute it and/or
  614.84 --   modify it under the terms of the GNU Lesser General Public
  614.85 --   License as published by the Free Software Foundation; either
  614.86 --   version 2.1 of the License, or (at your option) any later version.
  614.87 --
  614.88 --   The GNU C Library is distributed in the hope that it will be useful,
  614.89 --   but WITHOUT ANY WARRANTY; without even the implied warranty of
  614.90 --   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  614.91 --   Lesser General Public License for more details.
  614.92 --
  614.93 --   You should have received a copy of the GNU Lesser General Public
  614.94 --   License along with the GNU C Library; if not, write to the Free
  614.95 --   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  614.96 --   02111-1307 USA.  */
  614.97 --
  614.98 --#ifndef _SYS_PROCFS_H
  614.99 --#define _SYS_PROCFS_H	1
 614.100 --
 614.101 --/* This is somehow modelled after the file of the same name on SysVr4
 614.102 --   systems.  It provides a definition of the core file format for ELF
 614.103 --   used on Linux.  */
 614.104 --
 614.105 --#include <features.h>
 614.106 --#include <signal.h>
 614.107 --#include <sys/time.h>
 614.108 --#include <sys/types.h>
 614.109 --#include <sys/ucontext.h>
 614.110 --#include <sys/user.h>
 614.111 --#include <asm/elf.h>
 614.112 --
 614.113 --__BEGIN_DECLS
 614.114 --
 614.115 --struct elf_siginfo
 614.116 --  {
 614.117 --    int si_signo;			/* Signal number.  */
 614.118 --    int si_code;			/* Extra code.  */
 614.119 --    int si_errno;			/* Errno.  */
 614.120 --  };
 614.121 --
 614.122 --/* Definitions to generate Intel SVR4-like core files.  These mostly
 614.123 --   have the same names as the SVR4 types with "elf_" tacked on the
 614.124 --   front to prevent clashes with linux definitions, and the typedef
 614.125 --   forms have been avoided.  This is mostly like the SVR4 structure,
 614.126 --   but more Linuxy, with things that Linux does not support and which
 614.127 --   gdb doesn't really use excluded.  Fields present but not used are
 614.128 --   marked with "XXX".  */
 614.129 --struct elf_prstatus
 614.130 --  {
 614.131 --#if 0
 614.132 --    long int pr_flags;			/* XXX Process flags.  */
 614.133 --    short int pr_why;			/* XXX Reason for process halt.  */
 614.134 --    short int pr_what;			/* XXX More detailed reason.  */
 614.135 --#endif
 614.136 --    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 614.137 --    short int pr_cursig;		/* Current signal.  */
 614.138 --    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 614.139 --    unsigned long int pr_sighold;	/* Set of held signals.  */
 614.140 --#if 0
 614.141 --    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 614.142 --    struct sigaction pr_action;		/* Signal action for current sig.  */
 614.143 --#endif
 614.144 --    __pid_t pr_pid;
 614.145 --    __pid_t pr_ppid;
 614.146 --    __pid_t pr_pgrp;
 614.147 --    __pid_t pr_sid;
 614.148 --    struct timeval pr_utime;		/* User time.  */
 614.149 --    struct timeval pr_stime;		/* System time.  */
 614.150 --    struct timeval pr_cutime;		/* Cumulative user time.  */
 614.151 --    struct timeval pr_cstime;		/* Cumulative system time.  */
 614.152 --#if 0
 614.153 --    long int pr_instr;			/* Current instruction.  */
 614.154 --#endif
 614.155 --    elf_gregset_t pr_reg;		/* GP registers.  */
 614.156 --    int pr_fpvalid;			/* True if math copro being used.  */
 614.157 --  };
 614.158 --
 614.159 --
 614.160 --#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 614.161 --
 614.162 --struct elf_prpsinfo
 614.163 --  {
 614.164 --    char pr_state;			/* Numeric process state.  */
 614.165 --    char pr_sname;			/* Char for pr_state.  */
 614.166 --    char pr_zomb;			/* Zombie.  */
 614.167 --    char pr_nice;			/* Nice val.  */
 614.168 --    unsigned long int pr_flag;		/* Flags.  */
 614.169 --    unsigned short int pr_uid;
 614.170 --    unsigned short int pr_gid;
 614.171 --    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 614.172 --    /* Lots missing */
 614.173 --    char pr_fname[16];			/* Filename of executable.  */
 614.174 --    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 614.175 --  };
 614.176 --
 614.177 --/* Addresses.  */
 614.178 --typedef void *psaddr_t;
 614.179 --
 614.180 --/* Register sets.  Linux has different names.  */
 614.181 --typedef gregset_t prgregset_t;
 614.182 --typedef fpregset_t prfpregset_t;
 614.183 --
 614.184 --/* We don't have any differences between processes and threads,
 614.185 --   therefore habe only ine PID type.  */
 614.186 --typedef __pid_t lwpid_t;
 614.187 --
 614.188 --
 614.189 --typedef struct elf_prstatus prstatus_t;
 614.190 --typedef struct elf_prpsinfo prpsinfo_t;
 614.191 --
 614.192 --__END_DECLS
 614.193 --
 614.194 --#endif	/* sys/procfs.h */
 614.195 -+/* sys/procfs.h is architecture specific.  */
 614.196 -+#error "This file must be supplied by every Linux architecture."
 614.197 -
   615.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   615.2 +++ b/patches/glibc/2.7/100-cygwin.patch	Mon Jul 28 21:32:33 2008 +0000
   615.3 @@ -0,0 +1,185 @@
   615.4 +Fixes
   615.5 +elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
   615.6 +...
   615.7 +when building glibc-2.3.x on cygwin
   615.8 +
   615.9 +Idea from
  615.10 +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
  615.11 +Basically, make glibc use .oST as suffix for 'object static'
  615.12 +instead of .oS, since cygwin has trouble distinguishing .os from .oS
  615.13 +(Original patch had .on, but .oST is more mnemonic for 'object static')
  615.14 +
  615.15 +glibc-linuxthreads-2.3.5 also requires a patch, see
  615.16 +../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
  615.17 +
  615.18 +[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
  615.19 +
  615.20 +Message-ID: <4282FCBA.3040000@unicontrols.cz>
  615.21 +Date: Thu, 12 May 2005 08:50:34 +0200
  615.22 +From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
  615.23 +To: Dan Kegel <dank@kegel.com>
  615.24 +CC:  crossgcc@sources.redhat.com
  615.25 +Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
  615.26 +
  615.27 +Hi Dan,
  615.28 +following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
  615.29 +on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
  615.30 +
  615.31 +--
  615.32 +                     Petr Cvachoucek
  615.33 +                     Unicontrols a.s.
  615.34 +                     http://www.unicontrols.cz
  615.35 +]
  615.36 +
  615.37 +diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
  615.38 +--- glibc-2.3.5/Makeconfig	2005-02-16 11:50:19.000000000 +0100
  615.39 ++++ glibc-2.3.5-cygwin/Makeconfig	2005-05-11 08:24:51.046875000 +0200
  615.40 +@@ -470,7 +470,7 @@
  615.41 + # run the linked programs.
  615.42 + link-libc = -Wl,-rpath-link=$(rpath-link) \
  615.43 + 	    $(common-objpfx)libc.so$(libc.so-version) \
  615.44 +-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
  615.45 ++	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
  615.46 + # This is how to find at build-time things that will be installed there.
  615.47 + rpath-dirs = math elf dlfcn nss nis rt resolv crypt
  615.48 + endif
  615.49 +@@ -691,7 +691,7 @@
  615.50 + # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
  615.51 + # to pass different flags for each flavor.
  615.52 + libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
  615.53 +-all-object-suffixes := .o .os .op .og .ob .oS
  615.54 ++all-object-suffixes := .o .os .op .og .ob .oST
  615.55 + object-suffixes :=
  615.56 + CPPFLAGS-.o = $(pic-default)
  615.57 + CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
  615.58 +@@ -747,14 +747,14 @@
  615.59 +
  615.60 + ifeq (yes,$(build-shared))
  615.61 + # Build special library that contains the static-only routines for libc.
  615.62 +-object-suffixes-for-libc += .oS
  615.63 ++object-suffixes-for-libc += .oST
  615.64 +
  615.65 + # Must build the routines as PIC, though, because they can end up in (users')
  615.66 + # shared objects.  We don't want to use CFLAGS-os because users may, for
  615.67 + # example, make that processor-specific.
  615.68 +-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
  615.69 +-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  615.70 +-libtype.oS = lib%_nonshared.a
  615.71 ++CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
  615.72 ++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  615.73 ++libtype.oST = lib%_nonshared.a
  615.74 + endif
  615.75 +
  615.76 + # The assembler can generate debug information too.
  615.77 +diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
  615.78 +--- glibc-2.3.5/Makerules	2004-12-15 19:52:39.000000000 +0100
  615.79 ++++ glibc-2.3.5-cygwin/Makerules	2005-05-11 08:25:33.578125000 +0200
  615.80 +@@ -417,7 +417,7 @@
  615.81 + # Bounded pointer thunks are only built for *.ob
  615.82 + elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
  615.83 +
  615.84 +-elide-routines.oS += $(filter-out $(static-only-routines),\
  615.85 ++elide-routines.oST += $(filter-out $(static-only-routines),\
  615.86 + 				  $(routines) $(aux) $(sysdep_routines)) \
  615.87 + 		     $(elide-bp-thunks)
  615.88 + elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
  615.89 +@@ -984,7 +984,7 @@
  615.90 + install: $(inst_libdir)/libc.so
  615.91 + $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
  615.92 + 			$(common-objpfx)libc.so$(libc.so-version) \
  615.93 +-			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
  615.94 ++			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
  615.95 + 						  $(libprefix)$(libc-name)) \
  615.96 + 			$(+force)
  615.97 + 	(echo '/* GNU ld script';\
  615.98 +@@ -992,7 +992,7 @@
  615.99 + 	 echo '   the static library, so try that secondarily.  */';\
 615.100 + 	 cat $<; \
 615.101 + 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
 615.102 +-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
 615.103 ++	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
 615.104 +	      ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
 615.105 + 	) > $@.new
 615.106 +	mv -f $@.new $@
 615.107 +diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
 615.108 +--- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
 615.109 ++++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
 615.110 +@@ -13,7 +13,7 @@
 615.111 +
 615.112 + ifneq (,$($(lib)-static-only-routines))
 615.113 + ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
 615.114 +-object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
 615.115 ++object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
 615.116 + endif
 615.117 + endif
 615.118 +
 615.119 +@@ -29,7 +29,7 @@
 615.120 +
 615.121 + # Add each flavor of library to the lists of things to build and install.
 615.122 + install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
 615.123 +-extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
 615.124 ++extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
 615.125 + 			$(patsubst %,%$o,$(filter-out \
 615.126 + 					   $($(lib)-shared-only-routines),\
 615.127 + 					   $(all-$(lib)-routines))))
 615.128 +@@ -57,7 +57,7 @@
 615.129 +
 615.130 +
 615.131 + # Use o-iterator.mk to generate a rule for each flavor of library.
 615.132 +-ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
 615.133 ++ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
 615.134 + define o-iterator-doit
 615.135 + $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
 615.136 +   $(patsubst %,$(objpfx)%$o,\
 615.137 +@@ -65,7 +65,7 @@
 615.138 + 			  $(all-$(lib)-routines))); \
 615.139 + 	$$(build-extra-lib)
 615.140 + endef
 615.141 +-object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
 615.142 ++object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
 615.143 + include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
 615.144 + endif
 615.145 +
 615.146 +@@ -77,9 +77,9 @@
 615.147 + 	$(build-extra-lib)
 615.148 + endif
 615.149 +
 615.150 +-ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
 615.151 +-$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
 615.152 +-  $(patsubst %,$(objpfx)%.oS,\
 615.153 ++ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
 615.154 ++$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
 615.155 ++  $(patsubst %,$(objpfx)%.oST,\
 615.156 + 	     $(filter $($(lib)-static-only-routines),\
 615.157 + 		      $(all-$(lib)-routines)))
 615.158 + 	$(build-extra-lib)
 615.159 +diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
 615.160 +--- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
 615.161 ++++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
 615.162 +@@ -375,7 +375,7 @@
 615.163 +
 615.164 + $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
 615.165 + 			      $(objpfx)libpthread.so$(libpthread.so-version) \
 615.166 +-			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
 615.167 ++			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
 615.168 + 							$(libprefix)pthread) \
 615.169 + 			      $(+force)
 615.170 + 	(echo '/* GNU ld script';\
 615.171 +@@ -383,7 +383,7 @@
 615.172 + 	 echo '   the static library, so try that secondarily.  */';\
 615.173 + 	 cat $<; \
 615.174 + 	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
 615.175 +-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
 615.176 ++	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
 615.177 + 	      ')' \
 615.178 + 	) > $@.new
 615.179 + 	mv -f $@.new $@
 615.180 +diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
 615.181 +--- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
 615.182 ++++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
 615.183 +@@ -10,4 +10,4 @@
 615.184 + ASFLAGS-.op += -Wa,-Av9a
 615.185 + ASFLAGS-.og += -Wa,-Av9a
 615.186 + ASFLAGS-.ob += -Wa,-Av9a
 615.187 +-ASFLAGS-.oS += -Wa,-Av9a
 615.188 ++ASFLAGS-.oST += -Wa,-Av9a
   616.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   616.2 +++ b/patches/glibc/2.7/110-configure-apple-as.patch	Mon Jul 28 21:32:33 2008 +0000
   616.3 @@ -0,0 +1,26 @@
   616.4 +http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
   616.5 +http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
   616.6 +
   616.7 +The following makes it possible to configure glibc-2.3.2 on Mac OS X,
   616.8 +where the assembler but doesn't understand the --version flag.
   616.9 +
  616.10 +Fixes the symptom
  616.11 +checking whether ld is GNU ld... no
  616.12 +checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
  616.13 +checking version of /usr/libexec/gcc/darwin/ppc/as...
  616.14 +<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
  616.15 +
  616.16 +NOTE:  This patch should apparently be pushed upstream so we don't need to
  616.17 +keep adding it here.
  616.18 +
  616.19 +--- glibc-2.3.2/configure~	Wed Feb 26 09:20:48 2003
  616.20 ++++ glibc-2.3.2/configure	Fri Feb 27 13:12:53 2004
  616.21 +@@ -4524,7 +4524,7 @@
  616.22 +   # Found it, now check the version.
  616.23 +   { echo "$as_me:$LINENO: checking version of $AS" >&5
  616.24 + echo $ECHO_N "checking version of $AS... $ECHO_C" >&6; }
  616.25 +-  ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  616.26 ++  ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  616.27 +   case $ac_prog_version in
  616.28 +     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  616.29 +     2.1[3-9]*)
   617.1 --- a/patches/glibc/2.7/120-cygwin.patch	Mon Jul 28 21:08:01 2008 +0000
   617.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   617.3 @@ -1,185 +0,0 @@
   617.4 -Fixes
   617.5 -elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
   617.6 -...
   617.7 -when building glibc-2.3.x on cygwin
   617.8 -
   617.9 -Idea from
  617.10 -http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
  617.11 -Basically, make glibc use .oST as suffix for 'object static'
  617.12 -instead of .oS, since cygwin has trouble distinguishing .os from .oS
  617.13 -(Original patch had .on, but .oST is more mnemonic for 'object static')
  617.14 -
  617.15 -glibc-linuxthreads-2.3.5 also requires a patch, see
  617.16 -../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch
  617.17 -
  617.18 -[ forward ported to glibc-2.3.5 by Petr Cvachoucek:
  617.19 -
  617.20 -Message-ID: <4282FCBA.3040000@unicontrols.cz>
  617.21 -Date: Thu, 12 May 2005 08:50:34 +0200
  617.22 -From: Petr Cvachoucek <cvachoucek@unicontrols.cz>
  617.23 -To: Dan Kegel <dank@kegel.com>
  617.24 -CC:  crossgcc@sources.redhat.com
  617.25 -Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin
  617.26 -
  617.27 -Hi Dan,
  617.28 -following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain
  617.29 -on cygwin. Tested to build toolchains for powerpc 604 and 750 targets.
  617.30 -
  617.31 ---
  617.32 -                     Petr Cvachoucek
  617.33 -                     Unicontrols a.s.
  617.34 -                     http://www.unicontrols.cz
  617.35 -]
  617.36 -
  617.37 -diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig
  617.38 ---- glibc-2.3.5/Makeconfig	2005-02-16 11:50:19.000000000 +0100
  617.39 -+++ glibc-2.3.5-cygwin/Makeconfig	2005-05-11 08:24:51.046875000 +0200
  617.40 -@@ -470,7 +470,7 @@
  617.41 - # run the linked programs.
  617.42 - link-libc = -Wl,-rpath-link=$(rpath-link) \
  617.43 - 	    $(common-objpfx)libc.so$(libc.so-version) \
  617.44 --	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
  617.45 -+	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
  617.46 - # This is how to find at build-time things that will be installed there.
  617.47 - rpath-dirs = math elf dlfcn nss nis rt resolv crypt
  617.48 - endif
  617.49 -@@ -691,7 +691,7 @@
  617.50 - # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
  617.51 - # to pass different flags for each flavor.
  617.52 - libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
  617.53 --all-object-suffixes := .o .os .op .og .ob .oS
  617.54 -+all-object-suffixes := .o .os .op .og .ob .oST
  617.55 - object-suffixes :=
  617.56 - CPPFLAGS-.o = $(pic-default)
  617.57 - CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
  617.58 -@@ -747,14 +747,14 @@
  617.59 -
  617.60 - ifeq (yes,$(build-shared))
  617.61 - # Build special library that contains the static-only routines for libc.
  617.62 --object-suffixes-for-libc += .oS
  617.63 -+object-suffixes-for-libc += .oST
  617.64 -
  617.65 - # Must build the routines as PIC, though, because they can end up in (users')
  617.66 - # shared objects.  We don't want to use CFLAGS-os because users may, for
  617.67 - # example, make that processor-specific.
  617.68 --CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
  617.69 --CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  617.70 --libtype.oS = lib%_nonshared.a
  617.71 -+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag)
  617.72 -+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
  617.73 -+libtype.oST = lib%_nonshared.a
  617.74 - endif
  617.75 -
  617.76 - # The assembler can generate debug information too.
  617.77 -diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules
  617.78 ---- glibc-2.3.5/Makerules	2004-12-15 19:52:39.000000000 +0100
  617.79 -+++ glibc-2.3.5-cygwin/Makerules	2005-05-11 08:25:33.578125000 +0200
  617.80 -@@ -417,7 +417,7 @@
  617.81 - # Bounded pointer thunks are only built for *.ob
  617.82 - elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
  617.83 -
  617.84 --elide-routines.oS += $(filter-out $(static-only-routines),\
  617.85 -+elide-routines.oST += $(filter-out $(static-only-routines),\
  617.86 - 				  $(routines) $(aux) $(sysdep_routines)) \
  617.87 - 		     $(elide-bp-thunks)
  617.88 - elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
  617.89 -@@ -984,7 +984,7 @@
  617.90 - install: $(inst_libdir)/libc.so
  617.91 - $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
  617.92 - 			$(common-objpfx)libc.so$(libc.so-version) \
  617.93 --			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
  617.94 -+			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
  617.95 - 						  $(libprefix)$(libc-name)) \
  617.96 - 			$(+force)
  617.97 - 	(echo '/* GNU ld script';\
  617.98 -@@ -992,7 +992,7 @@
  617.99 - 	 echo '   the static library, so try that secondarily.  */';\
 617.100 - 	 cat $<; \
 617.101 - 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
 617.102 --	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
 617.103 -+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
 617.104 -	      ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
 617.105 - 	) > $@.new
 617.106 -	mv -f $@.new $@
 617.107 -diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
 617.108 ---- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
 617.109 -+++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
 617.110 -@@ -13,7 +13,7 @@
 617.111 -
 617.112 - ifneq (,$($(lib)-static-only-routines))
 617.113 - ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
 617.114 --object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
 617.115 -+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
 617.116 - endif
 617.117 - endif
 617.118 -
 617.119 -@@ -29,7 +29,7 @@
 617.120 -
 617.121 - # Add each flavor of library to the lists of things to build and install.
 617.122 - install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
 617.123 --extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
 617.124 -+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
 617.125 - 			$(patsubst %,%$o,$(filter-out \
 617.126 - 					   $($(lib)-shared-only-routines),\
 617.127 - 					   $(all-$(lib)-routines))))
 617.128 -@@ -57,7 +57,7 @@
 617.129 -
 617.130 -
 617.131 - # Use o-iterator.mk to generate a rule for each flavor of library.
 617.132 --ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
 617.133 -+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
 617.134 - define o-iterator-doit
 617.135 - $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
 617.136 -   $(patsubst %,$(objpfx)%$o,\
 617.137 -@@ -65,7 +65,7 @@
 617.138 - 			  $(all-$(lib)-routines))); \
 617.139 - 	$$(build-extra-lib)
 617.140 - endef
 617.141 --object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
 617.142 -+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
 617.143 - include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
 617.144 - endif
 617.145 -
 617.146 -@@ -77,9 +77,9 @@
 617.147 - 	$(build-extra-lib)
 617.148 - endif
 617.149 -
 617.150 --ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
 617.151 --$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
 617.152 --  $(patsubst %,$(objpfx)%.oS,\
 617.153 -+ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
 617.154 -+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
 617.155 -+  $(patsubst %,$(objpfx)%.oST,\
 617.156 - 	     $(filter $($(lib)-static-only-routines),\
 617.157 - 		      $(all-$(lib)-routines)))
 617.158 - 	$(build-extra-lib)
 617.159 -diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
 617.160 ---- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
 617.161 -+++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
 617.162 -@@ -375,7 +375,7 @@
 617.163 -
 617.164 - $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
 617.165 - 			      $(objpfx)libpthread.so$(libpthread.so-version) \
 617.166 --			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
 617.167 -+			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
 617.168 - 							$(libprefix)pthread) \
 617.169 - 			      $(+force)
 617.170 - 	(echo '/* GNU ld script';\
 617.171 -@@ -383,7 +383,7 @@
 617.172 - 	 echo '   the static library, so try that secondarily.  */';\
 617.173 - 	 cat $<; \
 617.174 - 	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
 617.175 --	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
 617.176 -+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
 617.177 - 	      ')' \
 617.178 - 	) > $@.new
 617.179 - 	mv -f $@.new $@
 617.180 -diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
 617.181 ---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
 617.182 -+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
 617.183 -@@ -10,4 +10,4 @@
 617.184 - ASFLAGS-.op += -Wa,-Av9a
 617.185 - ASFLAGS-.og += -Wa,-Av9a
 617.186 - ASFLAGS-.ob += -Wa,-Av9a
 617.187 --ASFLAGS-.oS += -Wa,-Av9a
 617.188 -+ASFLAGS-.oST += -Wa,-Av9a
   618.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   618.2 +++ b/patches/glibc/2.7/120-fix-pr631.patch	Mon Jul 28 21:32:33 2008 +0000
   618.3 @@ -0,0 +1,43 @@
   618.4 +From dank@kegel.com
   618.5 +Wed Jun 15 09:12:43 PDT 2005
   618.6 +
   618.7 +Fixes
   618.8 +
   618.9 +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  618.10 +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  618.11 +... 53 lines deleted ...
  618.12 +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  618.13 +collect2: ld returned 1 exit status
  618.14 +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  618.15 +
  618.16 +when building glibc with --enable-static-nss.
  618.17 +
  618.18 +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  618.19 +
  618.20 +--- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  618.21 ++++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  618.22 +@@ -508,7 +508,7 @@
  618.23 +
  618.24 + # The static libraries.
  618.25 + ifeq (yes,$(build-static))
  618.26 +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  618.27 ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  618.28 + else
  618.29 + ifeq (yes,$(build-shared))
  618.30 + # We can try to link the programs with lib*_pic.a...
  618.31 +--- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  618.32 ++++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  618.33 +@@ -120,6 +120,13 @@
  618.34 + install-bin-script = ldd
  618.35 + endif
  618.36 +
  618.37 ++ifeq (yes,$(build-static-nss))
  618.38 ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  618.39 ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  618.40 ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  618.41 ++	     $(resolvobjdir)/libresolv.a
  618.42 ++endif
  618.43 ++
  618.44 + others		= sprof sln
  618.45 + install-bin	= sprof
  618.46 + others-static   = sln
   619.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   619.2 +++ b/patches/glibc/2.7/130-i686-assembler.patch	Mon Jul 28 21:32:33 2008 +0000
   619.3 @@ -0,0 +1,43 @@
   619.4 +If gcc is configured to generate i686 code or better by default (like
   619.5 +when using the --with-arch=pentium3 configure option), then the __i686
   619.6 +macro will always be defined automatically and thus screw up the
   619.7 +compilation of some .S files.
   619.8 +
   619.9 +http://bugs.gentoo.org/131108
  619.10 +http://sourceware.org/ml/libc-alpha/2006-04/msg00090.html
  619.11 +
  619.12 +2006-04-25  Mike Frysinger  <vapier@gentoo.org>
  619.13 +
  619.14 +	* sysdeps/i386/sysdep.h (__i686): Undefine.
  619.15 +
  619.16 +Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
  619.17 +===================================================================
  619.18 +--- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(revision 1469)
  619.19 ++++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(working copy)
  619.20 +@@ -29,6 +29,10 @@
  619.21 + #include <dl-sysdep.h>
  619.22 + #include <tls.h>
  619.23 +
  619.24 ++#if defined __i686 && defined __ASSEMBLER__
  619.25 ++#undef __i686
  619.26 ++#define __i686 __i686
  619.27 ++#endif
  619.28 +
  619.29 + /* For Linux we can use the system call table in the header file
  619.30 + 	/usr/include/asm/unistd.h
  619.31 +Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
  619.32 +===================================================================
  619.33 +--- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(revision 1469)
  619.34 ++++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(working copy)
  619.35 +@@ -45,6 +45,11 @@
  619.36 + /* Embed an #include to pull in the alignment and .end directives. */
  619.37 + asm ("\n#include \"defs.h\"");
  619.38 +
  619.39 ++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
  619.40 ++asm ("\n#undef __i686");
  619.41 ++asm ("\n#define __i686 __i686");
  619.42 ++asm ("\n#endif");
  619.43 ++
  619.44 + /* The initial common code ends here. */
  619.45 + asm ("\n/*@HEADER_ENDS*/");
  619.46 +
   620.1 --- a/patches/glibc/2.7/140-configure-apple-as.patch	Mon Jul 28 21:08:01 2008 +0000
   620.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   620.3 @@ -1,26 +0,0 @@
   620.4 -http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
   620.5 -http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
   620.6 -
   620.7 -The following makes it possible to configure glibc-2.3.2 on Mac OS X,
   620.8 -where the assembler but doesn't understand the --version flag.
   620.9 -
  620.10 -Fixes the symptom
  620.11 -checking whether ld is GNU ld... no
  620.12 -checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
  620.13 -checking version of /usr/libexec/gcc/darwin/ppc/as...
  620.14 -<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
  620.15 -
  620.16 -NOTE:  This patch should apparently be pushed upstream so we don't need to
  620.17 -keep adding it here.
  620.18 -
  620.19 ---- glibc-2.3.2/configure~	Wed Feb 26 09:20:48 2003
  620.20 -+++ glibc-2.3.2/configure	Fri Feb 27 13:12:53 2004
  620.21 -@@ -4524,7 +4524,7 @@
  620.22 -   # Found it, now check the version.
  620.23 -   { echo "$as_me:$LINENO: checking version of $AS" >&5
  620.24 - echo $ECHO_N "checking version of $AS... $ECHO_C" >&6; }
  620.25 --  ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  620.26 -+  ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  620.27 -   case $ac_prog_version in
  620.28 -     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  620.29 -     2.1[3-9]*)
   621.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   621.2 +++ b/patches/glibc/2.7/140-i386-preferred-stack-boundary.patch	Mon Jul 28 21:32:33 2008 +0000
   621.3 @@ -0,0 +1,18 @@
   621.4 +(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
   621.5 +License: LGPL v2.1
   621.6 +
   621.7 +Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
   621.8 +and 2 is not.
   621.9 +
  621.10 +diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
  621.11 +--- glibc-2.5.orig/sysdeps/i386/Makefile	2005-03-06 01:18:16.000000000 +0100
  621.12 ++++ glibc-2.5/sysdeps/i386/Makefile	2007-05-27 17:49:37.000000000 +0200
  621.13 +@@ -36,7 +36,7 @@
  621.14 + ifeq ($(subdir),csu)
  621.15 + sysdep-CFLAGS += -mpreferred-stack-boundary=4
  621.16 + else
  621.17 +-sysdep-CFLAGS += -mpreferred-stack-boundary=2
  621.18 ++sysdep-CFLAGS += -mpreferred-stack-boundary=4
  621.19 + # Likewise, any function which calls user callbacks
  621.20 + uses-callbacks += -mpreferred-stack-boundary=4
  621.21 + # Likewise, any stack alignment tests
   622.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   622.2 +++ b/patches/glibc/2.7/150-alpha-asm_page.patch	Mon Jul 28 21:32:33 2008 +0000
   622.3 @@ -0,0 +1,26 @@
   622.4 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   622.5 +
   622.6 +	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   622.7 +	from the kernel header to sys/user.h and remove the #include of
   622.8 +	sys/user.h.
   622.9 +
  622.10 +--- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  622.11 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  622.12 +@@ -23,7 +23,6 @@
  622.13 +    only. Don't read too much into it. Don't use it for anything other
  622.14 +    than gdb/strace unless you know what you are doing. */
  622.15 + 
  622.16 +-#include <asm/page.h>
  622.17 + #include <asm/reg.h>
  622.18 + 
  622.19 + struct user
  622.20 +@@ -41,6 +40,9 @@ struct user
  622.21 +   char u_comm[32];				/* user command name */
  622.22 + };
  622.23 + 
  622.24 ++#define PAGE_SHIFT		13
  622.25 ++#define PAGE_SIZE		(1 << PAGE_SHIFT)
  622.26 ++#define PAGE_MASK		(~(PAGE_SIZE-1))
  622.27 + #define NBPG			PAGE_SIZE
  622.28 + #define UPAGES			1
  622.29 + #define HOST_TEXT_START_ADDR	(u.start_code)
   623.1 --- a/patches/glibc/2.7/150-fix-pr631.patch	Mon Jul 28 21:08:01 2008 +0000
   623.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   623.3 @@ -1,43 +0,0 @@
   623.4 -From dank@kegel.com
   623.5 -Wed Jun 15 09:12:43 PDT 2005
   623.6 -
   623.7 -Fixes
   623.8 -
   623.9 -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
  623.10 -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
  623.11 -... 53 lines deleted ...
  623.12 -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
  623.13 -collect2: ld returned 1 exit status
  623.14 -make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1
  623.15 -
  623.16 -when building glibc with --enable-static-nss.
  623.17 -
  623.18 -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631
  623.19 -
  623.20 ---- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
  623.21 -+++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
  623.22 -@@ -508,7 +508,7 @@
  623.23 -
  623.24 - # The static libraries.
  623.25 - ifeq (yes,$(build-static))
  623.26 --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
  623.27 -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
  623.28 - else
  623.29 - ifeq (yes,$(build-shared))
  623.30 - # We can try to link the programs with lib*_pic.a...
  623.31 ---- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
  623.32 -+++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
  623.33 -@@ -120,6 +120,13 @@
  623.34 - install-bin-script = ldd
  623.35 - endif
  623.36 -
  623.37 -+ifeq (yes,$(build-static-nss))
  623.38 -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
  623.39 -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
  623.40 -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
  623.41 -+	     $(resolvobjdir)/libresolv.a
  623.42 -+endif
  623.43 -+
  623.44 - others		= sprof sln
  623.45 - install-bin	= sprof
  623.46 - others-static   = sln
   624.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   624.2 +++ b/patches/glibc/2.7/160-build_wcs_upper_buffer.patch	Mon Jul 28 21:32:33 2008 +0000
   624.3 @@ -0,0 +1,22 @@
   624.4 +Matthias Kaehlcke <matthias at kaehlcke dot net> writes:
   624.5 +
   624.6 +A compilation of an ARM toolchain with glibc 2.7 using crosstool-ng
   624.7 +failed with a gcc error in glibc-2.7/posix/regex_internal.c, more
   624.8 +concretly in the function build_wcs_upper_buffer(). The return type of
   624.9 +the function prototype in regex_internal.h doesn't correspond with the
  624.10 +return type of this function in regex_internal.c.
  624.11 +
  624.12 +The attached patch corrects the return type of the function prototype
  624.13 +in regex_internal.h
  624.14 +
  624.15 +--- glibc-2.7/posix/regex_internal.h.org	2008-05-30 11:16:01.000000000 +0200
  624.16 ++++ glibc-2.7/posix/regex_internal.h	2008-05-30 11:16:35.000000000 +0200
  624.17 +@@ -391,7 +391,7 @@
  624.18 +      internal_function;
  624.19 + # ifdef RE_ENABLE_I18N
  624.20 + static void build_wcs_buffer (re_string_t *pstr) internal_function;
  624.21 +-static int build_wcs_upper_buffer (re_string_t *pstr) internal_function;
  624.22 ++static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr) internal_function;
  624.23 + # endif /* RE_ENABLE_I18N */
  624.24 + static void build_upper_buffer (re_string_t *pstr) internal_function;
  624.25 + static void re_string_translate_buffer (re_string_t *pstr) internal_function;
   625.1 --- a/patches/glibc/2.7/160-i686-assembler.patch	Mon Jul 28 21:08:01 2008 +0000
   625.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   625.3 @@ -1,43 +0,0 @@
   625.4 -If gcc is configured to generate i686 code or better by default (like
   625.5 -when using the --with-arch=pentium3 configure option), then the __i686
   625.6 -macro will always be defined automatically and thus screw up the
   625.7 -compilation of some .S files.
   625.8 -
   625.9 -http://bugs.gentoo.org/131108
  625.10 -http://sourceware.org/ml/libc-alpha/2006-04/msg00090.html
  625.11 -
  625.12 -2006-04-25  Mike Frysinger  <vapier@gentoo.org>
  625.13 -
  625.14 -	* sysdeps/i386/sysdep.h (__i686): Undefine.
  625.15 -
  625.16 -Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h
  625.17 -===================================================================
  625.18 ---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(revision 1469)
  625.19 -+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h	(working copy)
  625.20 -@@ -29,6 +29,10 @@
  625.21 - #include <dl-sysdep.h>
  625.22 - #include <tls.h>
  625.23 -
  625.24 -+#if defined __i686 && defined __ASSEMBLER__
  625.25 -+#undef __i686
  625.26 -+#define __i686 __i686
  625.27 -+#endif
  625.28 -
  625.29 - /* For Linux we can use the system call table in the header file
  625.30 - 	/usr/include/asm/unistd.h
  625.31 -Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c
  625.32 -===================================================================
  625.33 ---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(revision 1469)
  625.34 -+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c	(working copy)
  625.35 -@@ -45,6 +45,11 @@
  625.36 - /* Embed an #include to pull in the alignment and .end directives. */
  625.37 - asm ("\n#include \"defs.h\"");
  625.38 -
  625.39 -+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
  625.40 -+asm ("\n#undef __i686");
  625.41 -+asm ("\n#define __i686 __i686");
  625.42 -+asm ("\n#endif");
  625.43 -+
  625.44 - /* The initial common code ends here. */
  625.45 - asm ("\n/*@HEADER_ENDS*/");
  625.46 -
   626.1 --- a/patches/glibc/2.7/170-i386-preferred-stack-boundary.patch	Mon Jul 28 21:08:01 2008 +0000
   626.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   626.3 @@ -1,18 +0,0 @@
   626.4 -(C) 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
   626.5 -License: LGPL v2.1
   626.6 -
   626.7 -Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12,
   626.8 -and 2 is not.
   626.9 -
  626.10 -diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile
  626.11 ---- glibc-2.5.orig/sysdeps/i386/Makefile	2005-03-06 01:18:16.000000000 +0100
  626.12 -+++ glibc-2.5/sysdeps/i386/Makefile	2007-05-27 17:49:37.000000000 +0200
  626.13 -@@ -36,7 +36,7 @@
  626.14 - ifeq ($(subdir),csu)
  626.15 - sysdep-CFLAGS += -mpreferred-stack-boundary=4
  626.16 - else
  626.17 --sysdep-CFLAGS += -mpreferred-stack-boundary=2
  626.18 -+sysdep-CFLAGS += -mpreferred-stack-boundary=4
  626.19 - # Likewise, any function which calls user callbacks
  626.20 - uses-callbacks += -mpreferred-stack-boundary=4
  626.21 - # Likewise, any stack alignment tests
   627.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   627.2 +++ b/patches/glibc/2.7/170-use_short_for_fnstsw.patch	Mon Jul 28 21:32:33 2008 +0000
   627.3 @@ -0,0 +1,18 @@
   627.4 +Original patch from H.J. Lu, as reported there:
   627.5 +http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   627.6 +
   627.7 +fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   627.8 +The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   627.9 +
  627.10 +diff -dur glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.7/sysdeps/i386/fpu/ftestexcept.c
  627.11 +--- glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  627.12 ++++ glibc-2.7/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:54:43.000000000 +0200
  627.13 +@@ -26,7 +26,7 @@
  627.14 + int
  627.15 + fetestexcept (int excepts)
  627.16 + {
  627.17 +-  int temp;
  627.18 ++  short temp;
  627.19 +   int xtemp = 0;
  627.20 + 
  627.21 +   /* Get current exceptions.  */
   628.1 --- a/patches/glibc/2.7/180-alpha-asm_page.patch	Mon Jul 28 21:08:01 2008 +0000
   628.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   628.3 @@ -1,26 +0,0 @@
   628.4 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   628.5 -
   628.6 -	* sysdeps/unix/sysv/linux/alpha/sys/user.h: Copy page.h definitions
   628.7 -	from the kernel header to sys/user.h and remove the #include of
   628.8 -	sys/user.h.
   628.9 -
  628.10 ---- a/sysdeps/unix/sysv/linux/alpha/sys/user.h
  628.11 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/user.h
  628.12 -@@ -23,7 +23,6 @@
  628.13 -    only. Don't read too much into it. Don't use it for anything other
  628.14 -    than gdb/strace unless you know what you are doing. */
  628.15 - 
  628.16 --#include <asm/page.h>
  628.17 - #include <asm/reg.h>
  628.18 - 
  628.19 - struct user
  628.20 -@@ -41,6 +40,9 @@ struct user
  628.21 -   char u_comm[32];				/* user command name */
  628.22 - };
  628.23 - 
  628.24 -+#define PAGE_SHIFT		13
  628.25 -+#define PAGE_SIZE		(1 << PAGE_SHIFT)
  628.26 -+#define PAGE_MASK		(~(PAGE_SIZE-1))
  628.27 - #define NBPG			PAGE_SIZE
  628.28 - #define UPAGES			1
  628.29 - #define HOST_TEXT_START_ADDR	(u.start_code)
   629.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   629.2 +++ b/patches/glibc/2.7/180-gcc-4.3_sysinclude_path.patch	Mon Jul 28 21:32:33 2008 +0000
   629.3 @@ -0,0 +1,50 @@
   629.4 +Patch pointed to by Ryan ARNOLD on the libc-help ML.
   629.5 +See: http://sourceware.org/ml/libc-help/2008-06/msg00063.html
   629.6 +
   629.7 +Forwarded to crosstool-NG by Ioannis E. VENETIS:
   629.8 +See: http://sourceware.org/ml/libc-help/2008-06/msg00063.html
   629.9 +
  629.10 +GCC 4.3 changed the location of some of the header files.  I don't
  629.11 +understand why you'd be getting these errors while building GCC since
  629.12 +it provides them.
  629.13 +
  629.14 +With regard to GLIBC, Roland checked in some changes so that the GLIBC
  629.15 +build system could find the new locations of the GCC provided header
  629.16 +files.
  629.17 +
  629.18 +diff -durN glibc-2.7.orig/configure.in glibc-2.7/configure.in
  629.19 +--- glibc-2.7.orig/configure.in	2007-06-08 05:16:36.000000000 +0200
  629.20 ++++ glibc-2.7/configure.in	2008-06-24 18:38:46.000000000 +0200
  629.21 +@@ -911,8 +911,12 @@
  629.22 + # header directory and add that to the list.  NOTE: Only does the right
  629.23 + # thing on a system that doesn't need fixincludes.  (Not presently a problem.)
  629.24 + if test -n "$sysheaders"; then
  629.25 +-  ccheaders=`$CC -print-file-name=include`
  629.26 +-  SYSINCLUDES="-nostdinc -isystem $ccheaders \
  629.27 ++  SYSINCLUDES=-nostdinc
  629.28 ++  for d in include include-fixed; do
  629.29 ++    i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
  629.30 ++    SYSINCLUDES="$SYSINCLUDES -isystem $i"
  629.31 ++  done
  629.32 ++  SYSINCLUDES="$SYSINCLUDES \
  629.33 + -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
  629.34 +   if test -n "$CXX"; then
  629.35 +     cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
  629.36 +diff -durN glibc-2.7.orig/configure glibc-2.7/configure
  629.37 +--- glibc-2.7.orig/configure	2008-06-24 18:35:34.000000000 +0200
  629.38 ++++ glibc-2.7/configure	2008-06-24 18:38:46.000000000 +0200
  629.39 +@@ -5062,8 +5062,12 @@
  629.40 + # header directory and add that to the list.  NOTE: Only does the right
  629.41 + # thing on a system that doesn't need fixincludes.  (Not presently a problem.)
  629.42 + if test -n "$sysheaders"; then
  629.43 +-  ccheaders=`$CC -print-file-name=include`
  629.44 +-  SYSINCLUDES="-nostdinc -isystem $ccheaders \
  629.45 ++  SYSINCLUDES=-nostdinc
  629.46 ++  for d in include include-fixed; do
  629.47 ++    i=`$CC -print-file-name="$d"` && test "x$i" != "x$d" &&
  629.48 ++    SYSINCLUDES="$SYSINCLUDES -isystem $i"
  629.49 ++  done
  629.50 ++  SYSINCLUDES="$SYSINCLUDES \
  629.51 + -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
  629.52 +   if test -n "$CXX"; then
  629.53 +     cxxversion=`$CXX -dumpversion 2>&5` &&
   630.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   630.2 +++ b/patches/glibc/2.7/190-alpha-asm_elf.patch	Mon Jul 28 21:32:33 2008 +0000
   630.3 @@ -0,0 +1,194 @@
   630.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   630.5 +common code, alpha, and sh fail when used.  this should things up.
   630.6 +-mike
   630.7 +
   630.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   630.9 +
  630.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  630.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  630.12 +	definitions from the kernel header to sys/procfs.h and remove the
  630.13 +	#include of asm/elf.h.
  630.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  630.15 +
  630.16 +*Attachment: signature.asc <msg00012/signature.asc>*
  630.17 +/Description:/ This is a digitally signed message part.
  630.18 +
  630.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  630.20 +
  630.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  630.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  630.23 +	definitions from the kernel header to sys/procfs.h and remove the
  630.24 +	#include of asm/elf.h.
  630.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  630.26 +
  630.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  630.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  630.29 +@@ -29,10 +29,23 @@
  630.30 + #include <sys/types.h>
  630.31 + #include <sys/ucontext.h>
  630.32 + #include <sys/user.h>
  630.33 +-#include <asm/elf.h>
  630.34 + 
  630.35 + __BEGIN_DECLS
  630.36 + 
  630.37 ++/*
  630.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  630.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
  630.40 ++ * (32 general regs + processor status word).
  630.41 ++ */
  630.42 ++#define ELF_NGREG  33
  630.43 ++#define ELF_NFPREG 32
  630.44 ++
  630.45 ++typedef unsigned long elf_greg_t;
  630.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  630.47 ++
  630.48 ++typedef double elf_fpreg_t;
  630.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  630.50 ++
  630.51 + struct elf_siginfo
  630.52 +   {
  630.53 +     int si_signo;			/* Signal number.  */
  630.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  630.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  630.56 +@@ -29,10 +29,19 @@
  630.57 + #include <sys/types.h>
  630.58 + #include <sys/ucontext.h>
  630.59 + #include <sys/user.h>
  630.60 +-#include <asm/elf.h>
  630.61 + 
  630.62 + __BEGIN_DECLS
  630.63 + 
  630.64 ++/*
  630.65 ++ * ELF register definitions...
  630.66 ++ */
  630.67 ++typedef unsigned long elf_greg_t;
  630.68 ++
  630.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  630.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  630.71 ++
  630.72 ++typedef struct user_fpu_struct elf_fpregset_t;
  630.73 ++
  630.74 + struct elf_siginfo
  630.75 +   {
  630.76 +     int si_signo;			/* Signal number.  */
  630.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
  630.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  630.79 +@@ -1,115 +1,2 @@
  630.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  630.81 +-   This file is part of the GNU C Library.
  630.82 +-
  630.83 +-   The GNU C Library is free software; you can redistribute it and/or
  630.84 +-   modify it under the terms of the GNU Lesser General Public
  630.85 +-   License as published by the Free Software Foundation; either
  630.86 +-   version 2.1 of the License, or (at your option) any later version.
  630.87 +-
  630.88 +-   The GNU C Library is distributed in the hope that it will be useful,
  630.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
  630.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  630.91 +-   Lesser General Public License for more details.
  630.92 +-
  630.93 +-   You should have received a copy of the GNU Lesser General Public
  630.94 +-   License along with the GNU C Library; if not, write to the Free
  630.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  630.96 +-   02111-1307 USA.  */
  630.97 +-
  630.98 +-#ifndef _SYS_PROCFS_H
  630.99 +-#define _SYS_PROCFS_H	1
 630.100 +-
 630.101 +-/* This is somehow modelled after the file of the same name on SysVr4
 630.102 +-   systems.  It provides a definition of the core file format for ELF
 630.103 +-   used on Linux.  */
 630.104 +-
 630.105 +-#include <features.h>
 630.106 +-#include <signal.h>
 630.107 +-#include <sys/time.h>
 630.108 +-#include <sys/types.h>
 630.109 +-#include <sys/ucontext.h>
 630.110 +-#include <sys/user.h>
 630.111 +-#include <asm/elf.h>
 630.112 +-
 630.113 +-__BEGIN_DECLS
 630.114 +-
 630.115 +-struct elf_siginfo
 630.116 +-  {
 630.117 +-    int si_signo;			/* Signal number.  */
 630.118 +-    int si_code;			/* Extra code.  */
 630.119 +-    int si_errno;			/* Errno.  */
 630.120 +-  };
 630.121 +-
 630.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
 630.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
 630.124 +-   front to prevent clashes with linux definitions, and the typedef
 630.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
 630.126 +-   but more Linuxy, with things that Linux does not support and which
 630.127 +-   gdb doesn't really use excluded.  Fields present but not used are
 630.128 +-   marked with "XXX".  */
 630.129 +-struct elf_prstatus
 630.130 +-  {
 630.131 +-#if 0
 630.132 +-    long int pr_flags;			/* XXX Process flags.  */
 630.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
 630.134 +-    short int pr_what;			/* XXX More detailed reason.  */
 630.135 +-#endif
 630.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 630.137 +-    short int pr_cursig;		/* Current signal.  */
 630.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 630.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
 630.140 +-#if 0
 630.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 630.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
 630.143 +-#endif
 630.144 +-    __pid_t pr_pid;
 630.145 +-    __pid_t pr_ppid;
 630.146 +-    __pid_t pr_pgrp;
 630.147 +-    __pid_t pr_sid;
 630.148 +-    struct timeval pr_utime;		/* User time.  */
 630.149 +-    struct timeval pr_stime;		/* System time.  */
 630.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
 630.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
 630.152 +-#if 0
 630.153 +-    long int pr_instr;			/* Current instruction.  */
 630.154 +-#endif
 630.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
 630.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
 630.157 +-  };
 630.158 +-
 630.159 +-
 630.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 630.161 +-
 630.162 +-struct elf_prpsinfo
 630.163 +-  {
 630.164 +-    char pr_state;			/* Numeric process state.  */
 630.165 +-    char pr_sname;			/* Char for pr_state.  */
 630.166 +-    char pr_zomb;			/* Zombie.  */
 630.167 +-    char pr_nice;			/* Nice val.  */
 630.168 +-    unsigned long int pr_flag;		/* Flags.  */
 630.169 +-    unsigned short int pr_uid;
 630.170 +-    unsigned short int pr_gid;
 630.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 630.172 +-    /* Lots missing */
 630.173 +-    char pr_fname[16];			/* Filename of executable.  */
 630.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 630.175 +-  };
 630.176 +-
 630.177 +-/* Addresses.  */
 630.178 +-typedef void *psaddr_t;
 630.179 +-
 630.180 +-/* Register sets.  Linux has different names.  */
 630.181 +-typedef gregset_t prgregset_t;
 630.182 +-typedef fpregset_t prfpregset_t;
 630.183 +-
 630.184 +-/* We don't have any differences between processes and threads,
 630.185 +-   therefore habe only ine PID type.  */
 630.186 +-typedef __pid_t lwpid_t;
 630.187 +-
 630.188 +-
 630.189 +-typedef struct elf_prstatus prstatus_t;
 630.190 +-typedef struct elf_prpsinfo prpsinfo_t;
 630.191 +-
 630.192 +-__END_DECLS
 630.193 +-
 630.194 +-#endif	/* sys/procfs.h */
 630.195 ++/* sys/procfs.h is architecture specific.  */
 630.196 ++#error "This file must be supplied by every Linux architecture."
 630.197 +
   631.1 --- a/patches/glibc/2.7/190-build_wcs_upper_buffer.patch	Mon Jul 28 21:08:01 2008 +0000
   631.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   631.3 @@ -1,22 +0,0 @@
   631.4 -Matthias Kaehlcke <matthias at kaehlcke dot net> writes:
   631.5 -
   631.6 -A compilation of an ARM toolchain with glibc 2.7 using crosstool-ng
   631.7 -failed with a gcc error in glibc-2.7/posix/regex_internal.c, more
   631.8 -concretly in the function build_wcs_upper_buffer(). The return type of
   631.9 -the function prototype in regex_internal.h doesn't correspond with the
  631.10 -return type of this function in regex_internal.c.
  631.11 -
  631.12 -The attached patch corrects the return type of the function prototype
  631.13 -in regex_internal.h
  631.14 -
  631.15 ---- glibc-2.7/posix/regex_internal.h.org	2008-05-30 11:16:01.000000000 +0200
  631.16 -+++ glibc-2.7/posix/regex_internal.h	2008-05-30 11:16:35.000000000 +0200
  631.17 -@@ -391,7 +391,7 @@
  631.18 -      internal_function;
  631.19 - # ifdef RE_ENABLE_I18N
  631.20 - static void build_wcs_buffer (re_string_t *pstr) internal_function;
  631.21 --static int build_wcs_upper_buffer (re_string_t *pstr) internal_function;
  631.22 -+static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr) internal_function;
  631.23 - # endif /* RE_ENABLE_I18N */
  631.24 - static void build_upper_buffer (re_string_t *pstr) internal_function;
  631.25 - static void re_string_translate_buffer (re_string_t *pstr) internal_function;
   632.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   632.2 +++ b/patches/glibc/2.7/200-alpha-atfcts.patch	Mon Jul 28 21:32:33 2008 +0000
   632.3 @@ -0,0 +1,12 @@
   632.4 +--- glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h	2007-08-14 06:21:09.000000000 +0300
   632.5 ++++ glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h.new	2008-07-23 07:05:20.000000000 +0300
   632.6 +@@ -449,8 +449,7 @@
   632.7 +    and on Alpha just after 2.6.22-rc1.  */
   632.8 + #if __LINUX_KERNEL_VERSION >= 0x020611 \
   632.9 +     && ((!defined __sh__ && !defined __alpha__) \
  632.10 +-	|| (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__) \
  632.11 +-	|| (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
  632.12 ++	|| (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__))
  632.13 + # define __ASSUME_ATFCTS	1
  632.14 + #endif
  632.15 + 
   633.1 --- a/patches/glibc/2.7/200-use_short_for_fnstsw.patch	Mon Jul 28 21:08:01 2008 +0000
   633.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   633.3 @@ -1,18 +0,0 @@
   633.4 -Original patch from H.J. Lu, as reported there:
   633.5 -http://www.nabble.com/PATCH:-Use-short-for-fnstsw-td14775171.html
   633.6 -
   633.7 -fnstsw stores 16bit into %ax. The upper 16bit of %eax is unchanged.
   633.8 -The new assembler (binutils-2.18.50.0.4 and up) will disallow "fnstsw %eax".
   633.9 -
  633.10 -diff -dur glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.7/sysdeps/i386/fpu/ftestexcept.c
  633.11 ---- glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c	2004-03-05 11:14:48.000000000 +0100
  633.12 -+++ glibc-2.7/sysdeps/i386/fpu/ftestexcept.c	2008-06-24 10:54:43.000000000 +0200
  633.13 -@@ -26,7 +26,7 @@
  633.14 - int
  633.15 - fetestexcept (int excepts)
  633.16 - {
  633.17 --  int temp;
  633.18 -+  short temp;
  633.19 -   int xtemp = 0;
  633.20 - 
  633.21 -   /* Get current exceptions.  */
   634.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   634.2 +++ b/patches/glibc/2.7/210-alpha-ptr_mangle.patch	Mon Jul 28 21:32:33 2008 +0000
   634.3 @@ -0,0 +1,94 @@
   634.4 +--- glibc-2.7.orig/sysdeps/unix/alpha/sysdep.h
   634.5 ++++ glibc-2.7/sysdeps/unix/alpha/sysdep.h
   634.6 +@@ -397,42 +397,4 @@
   634.7 + 	_sc_ret = _sc_0, _sc_err = _sc_19;			\
   634.8 + }
   634.9 + 
  634.10 +-/* Pointer mangling support.  Note that tls access is slow enough that
  634.11 +-   we don't deoptimize things by placing the pointer check value there.  */
  634.12 +-
  634.13 +-#include <stdint.h>
  634.14 +-
  634.15 +-#if defined NOT_IN_libc && defined IS_IN_rtld
  634.16 +-# ifdef __ASSEMBLER__
  634.17 +-#  define PTR_MANGLE(dst, src, tmp)				\
  634.18 +-	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\
  634.19 +-	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\
  634.20 +-	xor	src, tmp, dst
  634.21 +-#  define PTR_MANGLE2(dst, src, tmp)				\
  634.22 +-	xor	src, tmp, dst
  634.23 +-#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
  634.24 +-#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
  634.25 +-# else
  634.26 +-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
  634.27 +-#  define PTR_MANGLE(var)	\
  634.28 +-  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
  634.29 +-#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
  634.30 +-# endif
  634.31 +-#elif defined PIC
  634.32 +-# ifdef __ASSEMBLER__
  634.33 +-#  define PTR_MANGLE(dst, src, tmp)		\
  634.34 +-	ldq	tmp, __pointer_chk_guard;	\
  634.35 +-	xor	src, tmp, dst
  634.36 +-#  define PTR_MANGLE2(dst, src, tmp)		\
  634.37 +-	xor	src, tmp, dst
  634.38 +-#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
  634.39 +-#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
  634.40 +-# else
  634.41 +-extern uintptr_t __pointer_chk_guard attribute_relro;
  634.42 +-#  define PTR_MANGLE(var)	\
  634.43 +-	(var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
  634.44 +-#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
  634.45 +-# endif
  634.46 +-#endif
  634.47 +-
  634.48 + #endif /* ASSEMBLER */
  634.49 +--- glibc-2.7.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h
  634.50 ++++ glibc-2.7/sysdeps/unix/sysv/linux/alpha/sysdep.h
  634.51 +@@ -98,4 +98,46 @@
  634.52 + 	INTERNAL_SYSCALL1(name, err_out, nr, args);			\
  634.53 + })
  634.54 + 
  634.55 ++/* Pointer mangling support.  Note that tls access is slow enough that
  634.56 ++   we don't deoptimize things by placing the pointer check value there.  */
  634.57 ++
  634.58 ++#if defined NOT_IN_libc && defined IS_IN_rtld
  634.59 ++# ifdef __ASSEMBLER__
  634.60 ++#  define PTR_MANGLE(dst, src, tmp)				\
  634.61 ++	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\
  634.62 ++	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\
  634.63 ++	xor	src, tmp, dst
  634.64 ++#  define PTR_MANGLE2(dst, src, tmp)				\
  634.65 ++	xor	src, tmp, dst
  634.66 ++#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
  634.67 ++#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
  634.68 ++# else
  634.69 ++extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
  634.70 ++#  define PTR_MANGLE(var)	\
  634.71 ++  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
  634.72 ++#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
  634.73 ++# endif
  634.74 ++#elif defined PIC
  634.75 ++# ifdef __ASSEMBLER__
  634.76 ++#  define PTR_MANGLE(dst, src, tmp)		\
  634.77 ++	ldq	tmp, __pointer_chk_guard;	\
  634.78 ++	xor	src, tmp, dst
  634.79 ++#  define PTR_MANGLE2(dst, src, tmp)		\
  634.80 ++	xor	src, tmp, dst
  634.81 ++#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
  634.82 ++#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
  634.83 ++# else
  634.84 ++extern uintptr_t __pointer_chk_guard attribute_relro;
  634.85 ++#  define PTR_MANGLE(var)	\
  634.86 ++	(var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
  634.87 ++#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
  634.88 ++# endif
  634.89 ++#else
  634.90 ++/* Pointer mangling is not yet supported for static libc on alpha.  */
  634.91 ++# ifndef __ASSEMBLER__
  634.92 ++#  define PTR_MANGLE(var)   (void) (var)
  634.93 ++#  define PTR_DEMANGLE(var) (void) (var)
  634.94 ++# endif
  634.95 ++#endif
  634.96 ++
  634.97 + #endif /* _LINUX_ALPHA_SYSDEP_H */
   635.1 --- a/patches/glibc/2.7/210-gcc-4.3_sysinclude_path.patch	Mon Jul 28 21:08:01 2008 +0000
   635.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   635.3 @@ -1,50 +0,0 @@
   635.4 -Patch pointed to by Ryan ARNOLD on the libc-help ML.
   635.5 -See: http://sourceware.org/ml/libc-help/2008-06/msg00063.html
   635.6 -
   635.7 -Forwarded to crosstool-NG by Ioannis E. VENETIS:
   635.8 -See: http://sourceware.org/ml/libc-help/2008-06/msg00063.html
   635.9 -
  635.10 -GCC 4.3 changed the location of some of the header files.  I don't
  635.11 -understand why you'd be getting these errors while building GCC since
  635.12 -it provides them.
  635.13 -
  635.14 -With regard to GLIBC, Roland checked in some changes so that the GLIBC
  635.15 -build system could find the new locations of the GCC provided header
  635.16 -files.
  635.17 -
  635.18 -diff -durN glibc-2.7.orig/configure.in glibc-2.7/configure.in
  635.19 ---- glibc-2.7.orig/configure.in	2007-06-08 05:16:36.000000000 +0200
  635.20 -+++ glibc-2.7/configure.in	2008-06-24 18:38:46.000000000 +0200
  635.21 -@@ -911,8 +911,12 @@
  635.22 - # header directory and add that to the list.  NOTE: Only does the right
  635.23 - # thing on a system that doesn't need fixincludes.  (Not presently a problem.)
  635.24 - if test -n "$sysheaders"; then
  635.25 --  ccheaders=`$CC -print-file-name=include`
  635.26 --  SYSINCLUDES="-nostdinc -isystem $ccheaders \
  635.27 -+  SYSINCLUDES=-nostdinc
  635.28 -+  for d in include include-fixed; do
  635.29 -+    i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
  635.30 -+    SYSINCLUDES="$SYSINCLUDES -isystem $i"
  635.31 -+  done
  635.32 -+  SYSINCLUDES="$SYSINCLUDES \
  635.33 - -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
  635.34 -   if test -n "$CXX"; then
  635.35 -     cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
  635.36 -diff -durN glibc-2.7.orig/configure glibc-2.7/configure
  635.37 ---- glibc-2.7.orig/configure	2008-06-24 18:35:34.000000000 +0200
  635.38 -+++ glibc-2.7/configure	2008-06-24 18:38:46.000000000 +0200
  635.39 -@@ -5062,8 +5062,12 @@
  635.40 - # header directory and add that to the list.  NOTE: Only does the right
  635.41 - # thing on a system that doesn't need fixincludes.  (Not presently a problem.)
  635.42 - if test -n "$sysheaders"; then
  635.43 --  ccheaders=`$CC -print-file-name=include`
  635.44 --  SYSINCLUDES="-nostdinc -isystem $ccheaders \
  635.45 -+  SYSINCLUDES=-nostdinc
  635.46 -+  for d in include include-fixed; do
  635.47 -+    i=`$CC -print-file-name="$d"` && test "x$i" != "x$d" &&
  635.48 -+    SYSINCLUDES="$SYSINCLUDES -isystem $i"
  635.49 -+  done
  635.50 -+  SYSINCLUDES="$SYSINCLUDES \
  635.51 - -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
  635.52 -   if test -n "$CXX"; then
  635.53 -     cxxversion=`$CXX -dumpversion 2>&5` &&
   636.1 --- a/patches/glibc/2.7/220-alpha-asm_elf.patch	Mon Jul 28 21:08:01 2008 +0000
   636.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   636.3 @@ -1,194 +0,0 @@
   636.4 -since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
   636.5 -common code, alpha, and sh fail when used.  this should things up.
   636.6 --mike
   636.7 -
   636.8 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
   636.9 -
  636.10 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  636.11 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  636.12 -	definitions from the kernel header to sys/procfs.h and remove the
  636.13 -	#include of asm/elf.h.
  636.14 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  636.15 -
  636.16 -*Attachment: signature.asc <msg00012/signature.asc>*
  636.17 -/Description:/ This is a digitally signed message part.
  636.18 -
  636.19 -2008-06-07  Mike Frysinger  <vapier@gentoo.org>
  636.20 -
  636.21 -	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
  636.22 -	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
  636.23 -	definitions from the kernel header to sys/procfs.h and remove the
  636.24 -	#include of asm/elf.h.
  636.25 -	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
  636.26 -
  636.27 ---- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  636.28 -+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
  636.29 -@@ -29,10 +29,23 @@
  636.30 - #include <sys/types.h>
  636.31 - #include <sys/ucontext.h>
  636.32 - #include <sys/user.h>
  636.33 --#include <asm/elf.h>
  636.34 - 
  636.35 - __BEGIN_DECLS
  636.36 - 
  636.37 -+/*
  636.38 -+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
  636.39 -+ * I have no idea why that is so.  For now, we just leave it at 33
  636.40 -+ * (32 general regs + processor status word).
  636.41 -+ */
  636.42 -+#define ELF_NGREG  33
  636.43 -+#define ELF_NFPREG 32
  636.44 -+
  636.45 -+typedef unsigned long elf_greg_t;
  636.46 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  636.47 -+
  636.48 -+typedef double elf_fpreg_t;
  636.49 -+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  636.50 -+
  636.51 - struct elf_siginfo
  636.52 -   {
  636.53 -     int si_signo;			/* Signal number.  */
  636.54 ---- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  636.55 -+++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
  636.56 -@@ -29,10 +29,19 @@
  636.57 - #include <sys/types.h>
  636.58 - #include <sys/ucontext.h>
  636.59 - #include <sys/user.h>
  636.60 --#include <asm/elf.h>
  636.61 - 
  636.62 - __BEGIN_DECLS
  636.63 - 
  636.64 -+/*
  636.65 -+ * ELF register definitions...
  636.66 -+ */
  636.67 -+typedef unsigned long elf_greg_t;
  636.68 -+
  636.69 -+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  636.70 -+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  636.71 -+
  636.72 -+typedef struct user_fpu_struct elf_fpregset_t;
  636.73 -+
  636.74 - struct elf_siginfo
  636.75 -   {
  636.76 -     int si_signo;			/* Signal number.  */
  636.77 ---- a/sysdeps/unix/sysv/linux/sys/procfs.h
  636.78 -+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
  636.79 -@@ -1,115 +1,2 @@
  636.80 --/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  636.81 --   This file is part of the GNU C Library.
  636.82 --
  636.83 --   The GNU C Library is free software; you can redistribute it and/or
  636.84 --   modify it under the terms of the GNU Lesser General Public
  636.85 --   License as published by the Free Software Foundation; either
  636.86 --   version 2.1 of the License, or (at your option) any later version.
  636.87 --
  636.88 --   The GNU C Library is distributed in the hope that it will be useful,
  636.89 --   but WITHOUT ANY WARRANTY; without even the implied warranty of
  636.90 --   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  636.91 --   Lesser General Public License for more details.
  636.92 --
  636.93 --   You should have received a copy of the GNU Lesser General Public
  636.94 --   License along with the GNU C Library; if not, write to the Free
  636.95 --   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  636.96 --   02111-1307 USA.  */
  636.97 --
  636.98 --#ifndef _SYS_PROCFS_H
  636.99 --#define _SYS_PROCFS_H	1
 636.100 --
 636.101 --/* This is somehow modelled after the file of the same name on SysVr4
 636.102 --   systems.  It provides a definition of the core file format for ELF
 636.103 --   used on Linux.  */
 636.104 --
 636.105 --#include <features.h>
 636.106 --#include <signal.h>
 636.107 --#include <sys/time.h>
 636.108 --#include <sys/types.h>
 636.109 --#include <sys/ucontext.h>
 636.110 --#include <sys/user.h>
 636.111 --#include <asm/elf.h>
 636.112 --
 636.113 --__BEGIN_DECLS
 636.114 --
 636.115 --struct elf_siginfo
 636.116 --  {
 636.117 --    int si_signo;			/* Signal number.  */
 636.118 --    int si_code;			/* Extra code.  */
 636.119 --    int si_errno;			/* Errno.  */
 636.120 --  };
 636.121 --
 636.122 --/* Definitions to generate Intel SVR4-like core files.  These mostly
 636.123 --   have the same names as the SVR4 types with "elf_" tacked on the
 636.124 --   front to prevent clashes with linux definitions, and the typedef
 636.125 --   forms have been avoided.  This is mostly like the SVR4 structure,
 636.126 --   but more Linuxy, with things that Linux does not support and which
 636.127 --   gdb doesn't really use excluded.  Fields present but not used are
 636.128 --   marked with "XXX".  */
 636.129 --struct elf_prstatus
 636.130 --  {
 636.131 --#if 0
 636.132 --    long int pr_flags;			/* XXX Process flags.  */
 636.133 --    short int pr_why;			/* XXX Reason for process halt.  */
 636.134 --    short int pr_what;			/* XXX More detailed reason.  */
 636.135 --#endif
 636.136 --    struct elf_siginfo pr_info;		/* Info associated with signal.  */
 636.137 --    short int pr_cursig;		/* Current signal.  */
 636.138 --    unsigned long int pr_sigpend;	/* Set of pending signals.  */
 636.139 --    unsigned long int pr_sighold;	/* Set of held signals.  */
 636.140 --#if 0
 636.141 --    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
 636.142 --    struct sigaction pr_action;		/* Signal action for current sig.  */
 636.143 --#endif
 636.144 --    __pid_t pr_pid;
 636.145 --    __pid_t pr_ppid;
 636.146 --    __pid_t pr_pgrp;
 636.147 --    __pid_t pr_sid;
 636.148 --    struct timeval pr_utime;		/* User time.  */
 636.149 --    struct timeval pr_stime;		/* System time.  */
 636.150 --    struct timeval pr_cutime;		/* Cumulative user time.  */
 636.151 --    struct timeval pr_cstime;		/* Cumulative system time.  */
 636.152 --#if 0
 636.153 --    long int pr_instr;			/* Current instruction.  */
 636.154 --#endif
 636.155 --    elf_gregset_t pr_reg;		/* GP registers.  */
 636.156 --    int pr_fpvalid;			/* True if math copro being used.  */
 636.157 --  };
 636.158 --
 636.159 --
 636.160 --#define ELF_PRARGSZ     (80)    /* Number of chars for args */
 636.161 --
 636.162 --struct elf_prpsinfo
 636.163 --  {
 636.164 --    char pr_state;			/* Numeric process state.  */
 636.165 --    char pr_sname;			/* Char for pr_state.  */
 636.166 --    char pr_zomb;			/* Zombie.  */
 636.167 --    char pr_nice;			/* Nice val.  */
 636.168 --    unsigned long int pr_flag;		/* Flags.  */
 636.169 --    unsigned short int pr_uid;
 636.170 --    unsigned short int pr_gid;
 636.171 --    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
 636.172 --    /* Lots missing */
 636.173 --    char pr_fname[16];			/* Filename of executable.  */
 636.174 --    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
 636.175 --  };
 636.176 --
 636.177 --/* Addresses.  */
 636.178 --typedef void *psaddr_t;
 636.179 --
 636.180 --/* Register sets.  Linux has different names.  */
 636.181 --typedef gregset_t prgregset_t;
 636.182 --typedef fpregset_t prfpregset_t;
 636.183 --
 636.184 --/* We don't have any differences between processes and threads,
 636.185 --   therefore habe only ine PID type.  */
 636.186 --typedef __pid_t lwpid_t;
 636.187 --
 636.188 --
 636.189 --typedef struct elf_prstatus prstatus_t;
 636.190 --typedef struct elf_prpsinfo prpsinfo_t;
 636.191 --
 636.192 --__END_DECLS
 636.193 --
 636.194 --#endif	/* sys/procfs.h */
 636.195 -+/* sys/procfs.h is architecture specific.  */
 636.196 -+#error "This file must be supplied by every Linux architecture."
 636.197 -
   637.1 --- a/patches/glibc/2.7/230-alpha-atfcts.patch	Mon Jul 28 21:08:01 2008 +0000
   637.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   637.3 @@ -1,12 +0,0 @@
   637.4 ---- glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h	2007-08-14 06:21:09.000000000 +0300
   637.5 -+++ glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h.new	2008-07-23 07:05:20.000000000 +0300
   637.6 -@@ -449,8 +449,7 @@
   637.7 -    and on Alpha just after 2.6.22-rc1.  */
   637.8 - #if __LINUX_KERNEL_VERSION >= 0x020611 \
   637.9 -     && ((!defined __sh__ && !defined __alpha__) \
  637.10 --	|| (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__) \
  637.11 --	|| (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
  637.12 -+	|| (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__))
  637.13 - # define __ASSUME_ATFCTS	1
  637.14 - #endif
  637.15 - 
   638.1 --- a/patches/glibc/2.7/240-alpha-ptr_mangle.patch	Mon Jul 28 21:08:01 2008 +0000
   638.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   638.3 @@ -1,94 +0,0 @@
   638.4 ---- glibc-2.7.orig/sysdeps/unix/alpha/sysdep.h
   638.5 -+++ glibc-2.7/sysdeps/unix/alpha/sysdep.h
   638.6 -@@ -397,42 +397,4 @@
   638.7 - 	_sc_ret = _sc_0, _sc_err = _sc_19;			\
   638.8 - }
   638.9 - 
  638.10 --/* Pointer mangling support.  Note that tls access is slow enough that
  638.11 --   we don't deoptimize things by placing the pointer check value there.  */
  638.12 --
  638.13 --#include <stdint.h>
  638.14 --
  638.15 --#if defined NOT_IN_libc && defined IS_IN_rtld
  638.16 --# ifdef __ASSEMBLER__
  638.17 --#  define PTR_MANGLE(dst, src, tmp)				\
  638.18 --	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\
  638.19 --	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\
  638.20 --	xor	src, tmp, dst
  638.21 --#  define PTR_MANGLE2(dst, src, tmp)				\
  638.22 --	xor	src, tmp, dst
  638.23 --#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
  638.24 --#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
  638.25 --# else
  638.26 --extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
  638.27 --#  define PTR_MANGLE(var)	\
  638.28 --  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
  638.29 --#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
  638.30 --# endif
  638.31 --#elif defined PIC
  638.32 --# ifdef __ASSEMBLER__
  638.33 --#  define PTR_MANGLE(dst, src, tmp)		\
  638.34 --	ldq	tmp, __pointer_chk_guard;	\
  638.35 --	xor	src, tmp, dst
  638.36 --#  define PTR_MANGLE2(dst, src, tmp)		\
  638.37 --	xor	src, tmp, dst
  638.38 --#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
  638.39 --#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
  638.40 --# else
  638.41 --extern uintptr_t __pointer_chk_guard attribute_relro;
  638.42 --#  define PTR_MANGLE(var)	\
  638.43 --	(var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
  638.44 --#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
  638.45 --# endif
  638.46 --#endif
  638.47 --
  638.48 - #endif /* ASSEMBLER */
  638.49 ---- glibc-2.7.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h
  638.50 -+++ glibc-2.7/sysdeps/unix/sysv/linux/alpha/sysdep.h
  638.51 -@@ -98,4 +98,46 @@
  638.52 - 	INTERNAL_SYSCALL1(name, err_out, nr, args);			\
  638.53 - })
  638.54 - 
  638.55 -+/* Pointer mangling support.  Note that tls access is slow enough that
  638.56 -+   we don't deoptimize things by placing the pointer check value there.  */
  638.57 -+
  638.58 -+#if defined NOT_IN_libc && defined IS_IN_rtld
  638.59 -+# ifdef __ASSEMBLER__
  638.60 -+#  define PTR_MANGLE(dst, src, tmp)				\
  638.61 -+	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\
  638.62 -+	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\
  638.63 -+	xor	src, tmp, dst
  638.64 -+#  define PTR_MANGLE2(dst, src, tmp)				\
  638.65 -+	xor	src, tmp, dst
  638.66 -+#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
  638.67 -+#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
  638.68 -+# else
  638.69 -+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
  638.70 -+#  define PTR_MANGLE(var)	\
  638.71 -+  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
  638.72 -+#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
  638.73 -+# endif
  638.74 -+#elif defined PIC
  638.75 -+# ifdef __ASSEMBLER__
  638.76 -+#  define PTR_MANGLE(dst, src, tmp)		\
  638.77 -+	ldq	tmp, __pointer_chk_guard;	\
  638.78 -+	xor	src, tmp, dst
  638.79 -+#  define PTR_MANGLE2(dst, src, tmp)		\
  638.80 -+	xor	src, tmp, dst
  638.81 -+#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
  638.82 -+#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
  638.83 -+# else
  638.84 -+extern uintptr_t __pointer_chk_guard attribute_relro;
  638.85 -+#  define PTR_MANGLE(var)	\
  638.86 -+	(var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
  638.87 -+#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
  638.88 -+# endif
  638.89 -+#else
  638.90 -+/* Pointer mangling is not yet supported for static libc on alpha.  */
  638.91 -+# ifndef __ASSEMBLER__
  638.92 -+#  define PTR_MANGLE(var)   (void) (var)
  638.93 -+#  define PTR_DEMANGLE(var) (void) (var)
  638.94 -+# endif
  638.95 -+#endif
  638.96 -+
  638.97 - #endif /* _LINUX_ALPHA_SYSDEP_H */
   639.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   639.2 +++ b/patches/glibc/linuxthreads-2.3.6/110-alpha-cfi.patch	Mon Jul 28 21:32:33 2008 +0000
   639.3 @@ -0,0 +1,25 @@
   639.4 +--- glibc-2.3.6/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h.orig	2008-06-19 15:31:45.000000000 +0300
   639.5 ++++ glibc-2.3.6/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h	2008-06-19 15:36:10.000000000 +0300
   639.6 +@@ -54,6 +54,7 @@
   639.7 + 	bne	a3, SYSCALL_ERROR_LABEL;			\
   639.8 + __LABEL($pseudo_ret)						\
   639.9 + 	.subsection 2;						\
  639.10 ++	cfi_startproc;						\
  639.11 + __LABEL($pseudo_cancel)						\
  639.12 + 	subq	sp, 64, sp;					\
  639.13 + 	cfi_def_cfa_offset(64);					\
  639.14 +@@ -84,12 +85,13 @@
  639.15 + 	cfi_def_cfa_offset(0);					\
  639.16 + __LABEL($syscall_error)						\
  639.17 + 	SYSCALL_ERROR_HANDLER;					\
  639.18 ++	cfi_endproc;						\
  639.19 + 	.previous
  639.20 + 
  639.21 + # undef PSEUDO_END
  639.22 + # define PSEUDO_END(sym)					\
  639.23 +-	.subsection 2;						\
  639.24 + 	cfi_endproc;						\
  639.25 ++	.subsection 2;						\
  639.26 + 	.size sym, .-sym
  639.27 + 
  639.28 + # define SAVE_ARGS_0	/* Nothing.  */
   640.1 --- a/patches/glibc/linuxthreads-2.3.6/270-alpha-cfi.patch	Mon Jul 28 21:08:01 2008 +0000
   640.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   640.3 @@ -1,25 +0,0 @@
   640.4 ---- glibc-2.3.6/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h.orig	2008-06-19 15:31:45.000000000 +0300
   640.5 -+++ glibc-2.3.6/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h	2008-06-19 15:36:10.000000000 +0300
   640.6 -@@ -54,6 +54,7 @@
   640.7 - 	bne	a3, SYSCALL_ERROR_LABEL;			\
   640.8 - __LABEL($pseudo_ret)						\
   640.9 - 	.subsection 2;						\
  640.10 -+	cfi_startproc;						\
  640.11 - __LABEL($pseudo_cancel)						\
  640.12 - 	subq	sp, 64, sp;					\
  640.13 - 	cfi_def_cfa_offset(64);					\
  640.14 -@@ -84,12 +85,13 @@
  640.15 - 	cfi_def_cfa_offset(0);					\
  640.16 - __LABEL($syscall_error)						\
  640.17 - 	SYSCALL_ERROR_HANDLER;					\
  640.18 -+	cfi_endproc;						\
  640.19 - 	.previous
  640.20 - 
  640.21 - # undef PSEUDO_END
  640.22 - # define PSEUDO_END(sym)					\
  640.23 --	.subsection 2;						\
  640.24 - 	cfi_endproc;						\
  640.25 -+	.subsection 2;						\
  640.26 - 	.size sym, .-sym
  640.27 - 
  640.28 - # define SAVE_ARGS_0	/* Nothing.  */
   641.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   641.2 +++ b/patches/glibc/ports-2.6.1/110-ARM-asm_page_h.patch	Mon Jul 28 21:32:33 2008 +0000
   641.3 @@ -0,0 +1,11 @@
   641.4 +diff -durN glibc-ports-2.7.orig/sysdeps/unix/sysv/linux/arm/ioperm.c glibc-ports-2.7/sysdeps/unix/sysv/linux/arm/ioperm.c
   641.5 +--- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/ioperm.c	2005-06-10 13:12:09.000000000 +0200
   641.6 ++++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/ioperm.c	2008-05-18 16:19:45.000000000 +0200
   641.7 +@@ -45,7 +45,6 @@
   641.8 + #include <sys/mman.h>
   641.9 + 
  641.10 + #include <linux/version.h>
  641.11 +-#include <asm/page.h>
  641.12 + #include <sys/sysctl.h>
  641.13 + 
  641.14 + #define PATH_ARM_SYSTYPE	"/etc/arm_systype"
   642.1 --- a/patches/glibc/ports-2.6.1/200-ARM-asm_page_h.patch	Mon Jul 28 21:08:01 2008 +0000
   642.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   642.3 @@ -1,11 +0,0 @@
   642.4 -diff -durN glibc-ports-2.7.orig/sysdeps/unix/sysv/linux/arm/ioperm.c glibc-ports-2.7/sysdeps/unix/sysv/linux/arm/ioperm.c
   642.5 ---- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/ioperm.c	2005-06-10 13:12:09.000000000 +0200
   642.6 -+++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/ioperm.c	2008-05-18 16:19:45.000000000 +0200
   642.7 -@@ -45,7 +45,6 @@
   642.8 - #include <sys/mman.h>
   642.9 - 
  642.10 - #include <linux/version.h>
  642.11 --#include <asm/page.h>
  642.12 - #include <sys/sysctl.h>
  642.13 - 
  642.14 - #define PATH_ARM_SYSTYPE	"/etc/arm_systype"
   643.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   643.2 +++ b/patches/strace/4.5.15/110-dont-use-REG_SYSCALL-for-sh.patch	Mon Jul 28 21:32:33 2008 +0000
   643.3 @@ -0,0 +1,11 @@
   643.4 +diff -dur strace-4.5.15.orig/process.c strace-4.5.15/process.c
   643.5 +--- strace-4.5.15.orig/process.c	2007-01-11 23:08:38.000000000 +0100
   643.6 ++++ strace-4.5.15/process.c	2007-07-14 19:19:58.000000000 +0200
   643.7 +@@ -2679,7 +2679,6 @@
   643.8 +        { 4*REG_GBR,            "4*REG_GBR"                             },
   643.9 +        { 4*REG_MACH,           "4*REG_MACH"                            },
  643.10 +        { 4*REG_MACL,           "4*REG_MACL"                            },
  643.11 +-       { 4*REG_SYSCALL,        "4*REG_SYSCALL"                         },
  643.12 +        { 4*REG_FPUL,           "4*REG_FPUL"                            },
  643.13 +        { 4*REG_FPREG0,         "4*REG_FPREG0"                          },
  643.14 +        { 4*(REG_FPREG0+1),     "4*REG_FPREG1"                          },
   644.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   644.2 +++ b/patches/strace/4.5.15/120-fix-arm-bad-syscall.patch	Mon Jul 28 21:32:33 2008 +0000
   644.3 @@ -0,0 +1,19 @@
   644.4 +diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
   644.5 +--- strace-4.5.15.orig/syscall.c	2006-12-21 23:13:33.000000000 +0100
   644.6 ++++ strace-4.5.15/syscall.c	2007-07-14 19:21:44.000000000 +0200
   644.7 +@@ -1045,6 +1045,15 @@
   644.8 + 		/*
   644.9 + 		 * Note: we only deal with only 32-bit CPUs here.
  644.10 + 		 */
  644.11 ++
  644.12 ++		if (!(tcp->flags & TCB_INSYSCALL) &&
  644.13 ++		    (tcp->flags & TCB_WAITEXECVE)) {
  644.14 ++			/* caught a fake syscall from the execve's exit */
  644.15 ++			tcp->flags &= ~TCB_WAITEXECVE;
  644.16 ++			return 0;
  644.17 ++		}
  644.18 ++ 
  644.19 ++
  644.20 + 		if (regs.ARM_cpsr & 0x20) {
  644.21 + 			/*
  644.22 + 			 * Get the Thumb-mode system call number
   645.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   645.2 +++ b/patches/strace/4.5.15/130-fix-disabled-largefile-syscalls.patch	Mon Jul 28 21:32:33 2008 +0000
   645.3 @@ -0,0 +1,22 @@
   645.4 +diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
   645.5 +--- strace-4.5.15.orig/syscall.c	2007-07-14 19:21:44.000000000 +0200
   645.6 ++++ strace-4.5.15/syscall.c	2007-07-14 19:22:49.000000000 +0200
   645.7 +@@ -125,6 +125,18 @@
   645.8 + #define TP TRACE_PROCESS
   645.9 + #define TS TRACE_SIGNAL
  645.10 + 
  645.11 ++#ifndef HAVE_STATFS64
  645.12 ++/*
  645.13 ++ * Ugly hacks for systems that do not have LFS
  645.14 ++ */
  645.15 ++
  645.16 ++#define sys_truncate64  sys_truncate
  645.17 ++#define sys_ftruncate64 sys_ftruncate
  645.18 ++#define sys_getdents64  sys_getdents
  645.19 ++#define sys_statfs64    sys_statfs
  645.20 ++#define sys_fstatfs64   sys_fstatfs
  645.21 ++#endif
  645.22 ++
  645.23 + static const struct sysent sysent0[] = {
  645.24 + #include "syscallent.h"
  645.25 + };
   646.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   646.2 +++ b/patches/strace/4.5.15/140-mips-sprintsigmask-fix.patch	Mon Jul 28 21:32:33 2008 +0000
   646.3 @@ -0,0 +1,12 @@
   646.4 +diff -dur strace-4.5.15.orig/signal.c strace-4.5.15/signal.c
   646.5 +--- strace-4.5.15.orig/signal.c	2007-01-11 23:08:38.000000000 +0100
   646.6 ++++ strace-4.5.15/signal.c	2007-07-14 19:24:43.000000000 +0200
   646.7 +@@ -1440,7 +1440,7 @@
   646.8 + 	  	tcp->u_rval = tcp->u_error = 0;
   646.9 + 		if(tcp->u_arg[0] == 0)
  646.10 + 		  	return 0;
  646.11 +-		tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1]);
  646.12 ++		tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1], 0);
  646.13 + 		return RVAL_NONE | RVAL_STR;
  646.14 + 	}
  646.15 + 	return 0;
   647.1 --- a/patches/strace/4.5.15/150-dont-use-REG_SYSCALL-for-sh.patch	Mon Jul 28 21:08:01 2008 +0000
   647.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   647.3 @@ -1,11 +0,0 @@
   647.4 -diff -dur strace-4.5.15.orig/process.c strace-4.5.15/process.c
   647.5 ---- strace-4.5.15.orig/process.c	2007-01-11 23:08:38.000000000 +0100
   647.6 -+++ strace-4.5.15/process.c	2007-07-14 19:19:58.000000000 +0200
   647.7 -@@ -2679,7 +2679,6 @@
   647.8 -        { 4*REG_GBR,            "4*REG_GBR"                             },
   647.9 -        { 4*REG_MACH,           "4*REG_MACH"                            },
  647.10 -        { 4*REG_MACL,           "4*REG_MACL"                            },
  647.11 --       { 4*REG_SYSCALL,        "4*REG_SYSCALL"                         },
  647.12 -        { 4*REG_FPUL,           "4*REG_FPUL"                            },
  647.13 -        { 4*REG_FPREG0,         "4*REG_FPREG0"                          },
  647.14 -        { 4*(REG_FPREG0+1),     "4*REG_FPREG1"                          },
   648.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   648.2 +++ b/patches/strace/4.5.15/150-statfs64-check.patch	Mon Jul 28 21:32:33 2008 +0000
   648.3 @@ -0,0 +1,53 @@
   648.4 +diff -dur strace-4.5.15.orig/acinclude.m4 strace-4.5.15/acinclude.m4
   648.5 +--- strace-4.5.15.orig/acinclude.m4	2004-04-14 04:21:01.000000000 +0200
   648.6 ++++ strace-4.5.15/acinclude.m4	2007-07-14 19:25:25.000000000 +0200
   648.7 +@@ -210,6 +210,26 @@
   648.8 + fi
   648.9 + ])
  648.10 + 
  648.11 ++dnl ### A macro to determine whether statfs64 is defined.
  648.12 ++AC_DEFUN([AC_STATFS64],
  648.13 ++[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
  648.14 ++AC_CACHE_VAL(ac_cv_type_statfs64,
  648.15 ++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
  648.16 ++#include <linux/types.h>
  648.17 ++#include <sys/statfs.h>
  648.18 ++#else
  648.19 ++#include <sys/vfs.h>
  648.20 ++#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
  648.21 ++AC_MSG_RESULT($ac_cv_type_statfs64)
  648.22 ++if test "$ac_cv_type_statfs64" = yes
  648.23 ++then
  648.24 ++	AC_DEFINE([HAVE_STATFS64], 1,
  648.25 ++[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
  648.26 ++fi
  648.27 ++])
  648.28 ++
  648.29 ++
  648.30 ++
  648.31 + dnl ### A macro to determine if off_t is a long long
  648.32 + AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
  648.33 + [AC_MSG_CHECKING(for long long off_t)
  648.34 +diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac
  648.35 +--- strace-4.5.15.orig/configure.ac	2007-01-11 12:37:55.000000000 +0100
  648.36 ++++ strace-4.5.15/configure.ac	2007-07-14 19:25:25.000000000 +0200
  648.37 +@@ -169,6 +169,7 @@
  648.38 + 		  struct stat.st_level,
  648.39 + 		  struct stat.st_rdev])
  648.40 + AC_STAT64
  648.41 ++AC_STATFS64
  648.42 + 
  648.43 + AC_TYPE_SIGNAL
  648.44 + AC_TYPE_UID_T
  648.45 +diff -dur strace-4.5.15.orig/file.c strace-4.5.15/file.c
  648.46 +--- strace-4.5.15.orig/file.c	2007-01-15 21:25:52.000000000 +0100
  648.47 ++++ strace-4.5.15/file.c	2007-07-14 19:25:25.000000000 +0200
  648.48 +@@ -1635,7 +1635,7 @@
  648.49 + 	return 0;
  648.50 + }
  648.51 + 
  648.52 +-#ifdef LINUX
  648.53 ++#ifdef HAVE_STATFS64
  648.54 + static void
  648.55 + printstatfs64(tcp, addr)
  648.56 + struct tcb *tcp;
   649.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   649.2 +++ b/patches/strace/4.5.15/160-superh-update.ac.patch	Mon Jul 28 21:32:33 2008 +0000
   649.3 @@ -0,0 +1,22 @@
   649.4 +diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac
   649.5 +--- strace-4.5.15.orig/configure.ac	2007-07-14 19:25:25.000000000 +0200
   649.6 ++++ strace-4.5.15/configure.ac	2007-07-14 19:27:35.000000000 +0200
   649.7 +@@ -91,14 +91,14 @@
   649.8 + 	arch=hppa
   649.9 + 	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
  649.10 + 	;;
  649.11 +-sh)
  649.12 +-	arch=sh
  649.13 +-	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  649.14 +-	;;
  649.15 + sh64)
  649.16 + 	arch=sh64
  649.17 + 	AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
  649.18 + 	;;
  649.19 ++sh*)
  649.20 ++	arch=sh
  649.21 ++	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  649.22 ++	;;
  649.23 + x86?64*)
  649.24 + 	arch=x86_64
  649.25 + 	AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
   650.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   650.2 +++ b/patches/strace/4.5.15/170-undef-CTL_PROC.patch	Mon Jul 28 21:32:33 2008 +0000
   650.3 @@ -0,0 +1,13 @@
   650.4 +diff -dur strace-4.5.15.orig/system.c strace-4.5.15/system.c
   650.5 +--- strace-4.5.15.orig/system.c	2007-01-17 00:22:36.000000000 +0100
   650.6 ++++ strace-4.5.15/system.c	2007-07-14 19:28:41.000000000 +0200
   650.7 +@@ -1612,7 +1612,9 @@
   650.8 + 	{ CTL_KERN, "CTL_KERN" },
   650.9 + 	{ CTL_VM, "CTL_VM" },
  650.10 + 	{ CTL_NET, "CTL_NET" },
  650.11 ++#ifdef CTL_PROC
  650.12 + 	{ CTL_PROC, "CTL_PROC" },
  650.13 ++#endif
  650.14 + 	{ CTL_FS, "CTL_FS" },
  650.15 + 	{ CTL_DEBUG, "CTL_DEBUG" },
  650.16 + 	{ CTL_DEV, "CTL_DEV" },
   651.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   651.2 +++ b/patches/strace/4.5.15/180-undef-PACKET_MEMBERSHIP.patch	Mon Jul 28 21:32:33 2008 +0000
   651.3 @@ -0,0 +1,16 @@
   651.4 +diff -dur strace-4.5.15.orig/net.c strace-4.5.15/net.c
   651.5 +--- strace-4.5.15.orig/net.c	2006-12-13 20:57:23.000000000 +0100
   651.6 ++++ strace-4.5.15/net.c	2007-07-14 19:29:36.000000000 +0200
   651.7 +@@ -800,8 +800,12 @@
   651.8 + 
   651.9 + #ifdef SOL_PACKET
  651.10 + static const struct xlat sockpacketoptions[] = {
  651.11 ++#if defined(PACKET_ADD_MEMBERSHIP)
  651.12 + 	{ PACKET_ADD_MEMBERSHIP,	"PACKET_ADD_MEMBERSHIP"	},
  651.13 ++#endif
  651.14 ++#if defined(PACKET_DROP_MEMBERSHIP)
  651.15 + 	{ PACKET_DROP_MEMBERSHIP,	"PACKET_DROP_MEMBERSHIP"},
  651.16 ++#endif
  651.17 + #if defined(PACKET_RECV_OUTPUT)
  651.18 + 	{ PACKET_RECV_OUTPUT,		"PACKET_RECV_OUTPUT"	},
  651.19 + #endif
   652.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   652.2 +++ b/patches/strace/4.5.15/190-undef-syscall.patch	Mon Jul 28 21:32:33 2008 +0000
   652.3 @@ -0,0 +1,64 @@
   652.4 +diff -dur strace-4.5.15.orig/linux/syscallent.h strace-4.5.15/linux/syscallent.h
   652.5 +--- strace-4.5.15.orig/linux/syscallent.h	2006-10-16 03:17:52.000000000 +0200
   652.6 ++++ strace-4.5.15/linux/syscallent.h	2007-07-14 19:30:16.000000000 +0200
   652.7 +@@ -130,7 +130,11 @@
   652.8 + 	{ 2,	TF,	sys_statfs,		"statfs"	}, /* 99 */
   652.9 + 	{ 2,	TD,	sys_fstatfs,		"fstatfs"	}, /* 100 */
  652.10 + 	{ 3,	0,	sys_ioperm,		"ioperm"	}, /* 101 */
  652.11 +-	{ 2,	TD,	sys_socketcall,		"socketcall", SYS_socketcall }, /* 102 */
  652.12 ++	{ 2,	TD,	sys_socketcall,		"socketcall"
  652.13 ++#ifdef __NR_socketcall
  652.14 ++	    , SYS_socketcall
  652.15 ++#endif
  652.16 ++								}, /* 102 */
  652.17 + 	{ 3,	0,	sys_syslog,		"syslog"	}, /* 103 */
  652.18 + 	{ 3,	0,	sys_setitimer,		"setitimer"	}, /* 104 */
  652.19 + 	{ 2,	0,	sys_getitimer,		"getitimer"	}, /* 105 */
  652.20 +@@ -145,7 +149,11 @@
  652.21 + 	{ 4,	TP,	sys_wait4,		"wait4", SYS_wait4 }, /* 114 */
  652.22 + 	{ 1,	0,	sys_swapoff,		"swapoff"	}, /* 115 */
  652.23 + 	{ 1,	0,	sys_sysinfo,		"sysinfo"	}, /* 116 */
  652.24 +-	{ 6,	0,	sys_ipc,		"ipc", SYS_ipc }, /* 117 */
  652.25 ++	{ 6,	0,	sys_ipc,		"ipc"
  652.26 ++#ifdef __NR_ipc
  652.27 ++	    , SYS_ipc
  652.28 ++#endif
  652.29 ++								}, /* 117 */
  652.30 + 	{ 1,	TD,	sys_fsync,		"fsync"		}, /* 118 */
  652.31 + 	{ 1,	TS,	sys_sigreturn,		"sigreturn"	}, /* 119 */
  652.32 + 	{ 5,	TP,	sys_clone,		"clone", SYS_clone }, /* 120 */
  652.33 +@@ -282,7 +290,11 @@
  652.34 + 	{ 3,	0,	sys_io_cancel,		"io_cancel"	}, /* 249 */
  652.35 + 	{ 5,	0,	sys_fadvise64,		"fadvise64"	}, /* 250 */
  652.36 + 	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
  652.37 +-	{ 1,	TP,	sys_exit,		"exit_group", __NR_exit_group }, /* 252 */
  652.38 ++	{ 1,	TP,	sys_exit,		"exit_group"
  652.39 ++#ifdef __NR_exit_group
  652.40 ++	    , __NR_exit_group
  652.41 ++#endif
  652.42 ++								}, /* 252 */
  652.43 + 	{ 4,	0,	printargs,		"lookup_dcookie"}, /* 253 */
  652.44 + 	{ 1,	0,	sys_epoll_create,	"epoll_create"	}, /* 254 */
  652.45 + 	{ 4,	TD,	sys_epoll_ctl,		"epoll_ctl"	}, /* 255 */
  652.46 +diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
  652.47 +--- strace-4.5.15.orig/syscall.c	2007-07-14 19:22:49.000000000 +0200
  652.48 ++++ strace-4.5.15/syscall.c	2007-07-14 19:30:16.000000000 +0200
  652.49 +@@ -2404,14 +2404,18 @@
  652.50 + 	switch (known_scno(tcp)) {
  652.51 + #ifdef LINUX
  652.52 + #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
  652.53 ++#ifdef __NR_socketcall
  652.54 + 	case SYS_socketcall:
  652.55 + 		decode_subcall(tcp, SYS_socket_subcall,
  652.56 + 			SYS_socket_nsubcalls, deref_style);
  652.57 + 		break;
  652.58 ++#endif
  652.59 ++#ifdef __NR_ipc
  652.60 + 	case SYS_ipc:
  652.61 + 		decode_subcall(tcp, SYS_ipc_subcall,
  652.62 + 			SYS_ipc_nsubcalls, shift_style);
  652.63 + 		break;
  652.64 ++#endif
  652.65 + #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
  652.66 + #if defined (SPARC) || defined (SPARC64)
  652.67 + 	case SYS_socketcall:
   653.1 --- a/patches/strace/4.5.15/200-fix-arm-bad-syscall.patch	Mon Jul 28 21:08:01 2008 +0000
   653.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   653.3 @@ -1,19 +0,0 @@
   653.4 -diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
   653.5 ---- strace-4.5.15.orig/syscall.c	2006-12-21 23:13:33.000000000 +0100
   653.6 -+++ strace-4.5.15/syscall.c	2007-07-14 19:21:44.000000000 +0200
   653.7 -@@ -1045,6 +1045,15 @@
   653.8 - 		/*
   653.9 - 		 * Note: we only deal with only 32-bit CPUs here.
  653.10 - 		 */
  653.11 -+
  653.12 -+		if (!(tcp->flags & TCB_INSYSCALL) &&
  653.13 -+		    (tcp->flags & TCB_WAITEXECVE)) {
  653.14 -+			/* caught a fake syscall from the execve's exit */
  653.15 -+			tcp->flags &= ~TCB_WAITEXECVE;
  653.16 -+			return 0;
  653.17 -+		}
  653.18 -+ 
  653.19 -+
  653.20 - 		if (regs.ARM_cpsr & 0x20) {
  653.21 - 			/*
  653.22 - 			 * Get the Thumb-mode system call number
   654.1 --- a/patches/strace/4.5.15/250-fix-disabled-largefile-syscalls.patch	Mon Jul 28 21:08:01 2008 +0000
   654.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   654.3 @@ -1,22 +0,0 @@
   654.4 -diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
   654.5 ---- strace-4.5.15.orig/syscall.c	2007-07-14 19:21:44.000000000 +0200
   654.6 -+++ strace-4.5.15/syscall.c	2007-07-14 19:22:49.000000000 +0200
   654.7 -@@ -125,6 +125,18 @@
   654.8 - #define TP TRACE_PROCESS
   654.9 - #define TS TRACE_SIGNAL
  654.10 - 
  654.11 -+#ifndef HAVE_STATFS64
  654.12 -+/*
  654.13 -+ * Ugly hacks for systems that do not have LFS
  654.14 -+ */
  654.15 -+
  654.16 -+#define sys_truncate64  sys_truncate
  654.17 -+#define sys_ftruncate64 sys_ftruncate
  654.18 -+#define sys_getdents64  sys_getdents
  654.19 -+#define sys_statfs64    sys_statfs
  654.20 -+#define sys_fstatfs64   sys_fstatfs
  654.21 -+#endif
  654.22 -+
  654.23 - static const struct sysent sysent0[] = {
  654.24 - #include "syscallent.h"
  654.25 - };
   655.1 --- a/patches/strace/4.5.15/300-mips-sprintsigmask-fix.patch	Mon Jul 28 21:08:01 2008 +0000
   655.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   655.3 @@ -1,12 +0,0 @@
   655.4 -diff -dur strace-4.5.15.orig/signal.c strace-4.5.15/signal.c
   655.5 ---- strace-4.5.15.orig/signal.c	2007-01-11 23:08:38.000000000 +0100
   655.6 -+++ strace-4.5.15/signal.c	2007-07-14 19:24:43.000000000 +0200
   655.7 -@@ -1440,7 +1440,7 @@
   655.8 - 	  	tcp->u_rval = tcp->u_error = 0;
   655.9 - 		if(tcp->u_arg[0] == 0)
  655.10 - 		  	return 0;
  655.11 --		tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1]);
  655.12 -+		tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1], 0);
  655.13 - 		return RVAL_NONE | RVAL_STR;
  655.14 - 	}
  655.15 - 	return 0;
   656.1 --- a/patches/strace/4.5.15/350-statfs64-check.patch	Mon Jul 28 21:08:01 2008 +0000
   656.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   656.3 @@ -1,53 +0,0 @@
   656.4 -diff -dur strace-4.5.15.orig/acinclude.m4 strace-4.5.15/acinclude.m4
   656.5 ---- strace-4.5.15.orig/acinclude.m4	2004-04-14 04:21:01.000000000 +0200
   656.6 -+++ strace-4.5.15/acinclude.m4	2007-07-14 19:25:25.000000000 +0200
   656.7 -@@ -210,6 +210,26 @@
   656.8 - fi
   656.9 - ])
  656.10 - 
  656.11 -+dnl ### A macro to determine whether statfs64 is defined.
  656.12 -+AC_DEFUN([AC_STATFS64],
  656.13 -+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
  656.14 -+AC_CACHE_VAL(ac_cv_type_statfs64,
  656.15 -+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
  656.16 -+#include <linux/types.h>
  656.17 -+#include <sys/statfs.h>
  656.18 -+#else
  656.19 -+#include <sys/vfs.h>
  656.20 -+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
  656.21 -+AC_MSG_RESULT($ac_cv_type_statfs64)
  656.22 -+if test "$ac_cv_type_statfs64" = yes
  656.23 -+then
  656.24 -+	AC_DEFINE([HAVE_STATFS64], 1,
  656.25 -+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
  656.26 -+fi
  656.27 -+])
  656.28 -+
  656.29 -+
  656.30 -+
  656.31 - dnl ### A macro to determine if off_t is a long long
  656.32 - AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
  656.33 - [AC_MSG_CHECKING(for long long off_t)
  656.34 -diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac
  656.35 ---- strace-4.5.15.orig/configure.ac	2007-01-11 12:37:55.000000000 +0100
  656.36 -+++ strace-4.5.15/configure.ac	2007-07-14 19:25:25.000000000 +0200
  656.37 -@@ -169,6 +169,7 @@
  656.38 - 		  struct stat.st_level,
  656.39 - 		  struct stat.st_rdev])
  656.40 - AC_STAT64
  656.41 -+AC_STATFS64
  656.42 - 
  656.43 - AC_TYPE_SIGNAL
  656.44 - AC_TYPE_UID_T
  656.45 -diff -dur strace-4.5.15.orig/file.c strace-4.5.15/file.c
  656.46 ---- strace-4.5.15.orig/file.c	2007-01-15 21:25:52.000000000 +0100
  656.47 -+++ strace-4.5.15/file.c	2007-07-14 19:25:25.000000000 +0200
  656.48 -@@ -1635,7 +1635,7 @@
  656.49 - 	return 0;
  656.50 - }
  656.51 - 
  656.52 --#ifdef LINUX
  656.53 -+#ifdef HAVE_STATFS64
  656.54 - static void
  656.55 - printstatfs64(tcp, addr)
  656.56 - struct tcb *tcp;
   657.1 --- a/patches/strace/4.5.15/400-superh-update.ac.patch	Mon Jul 28 21:08:01 2008 +0000
   657.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   657.3 @@ -1,22 +0,0 @@
   657.4 -diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac
   657.5 ---- strace-4.5.15.orig/configure.ac	2007-07-14 19:25:25.000000000 +0200
   657.6 -+++ strace-4.5.15/configure.ac	2007-07-14 19:27:35.000000000 +0200
   657.7 -@@ -91,14 +91,14 @@
   657.8 - 	arch=hppa
   657.9 - 	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
  657.10 - 	;;
  657.11 --sh)
  657.12 --	arch=sh
  657.13 --	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  657.14 --	;;
  657.15 - sh64)
  657.16 - 	arch=sh64
  657.17 - 	AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
  657.18 - 	;;
  657.19 -+sh*)
  657.20 -+	arch=sh
  657.21 -+	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  657.22 -+	;;
  657.23 - x86?64*)
  657.24 - 	arch=x86_64
  657.25 - 	AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
   658.1 --- a/patches/strace/4.5.15/450-undef-CTL_PROC.patch	Mon Jul 28 21:08:01 2008 +0000
   658.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   658.3 @@ -1,13 +0,0 @@
   658.4 -diff -dur strace-4.5.15.orig/system.c strace-4.5.15/system.c
   658.5 ---- strace-4.5.15.orig/system.c	2007-01-17 00:22:36.000000000 +0100
   658.6 -+++ strace-4.5.15/system.c	2007-07-14 19:28:41.000000000 +0200
   658.7 -@@ -1612,7 +1612,9 @@
   658.8 - 	{ CTL_KERN, "CTL_KERN" },
   658.9 - 	{ CTL_VM, "CTL_VM" },
  658.10 - 	{ CTL_NET, "CTL_NET" },
  658.11 -+#ifdef CTL_PROC
  658.12 - 	{ CTL_PROC, "CTL_PROC" },
  658.13 -+#endif
  658.14 - 	{ CTL_FS, "CTL_FS" },
  658.15 - 	{ CTL_DEBUG, "CTL_DEBUG" },
  658.16 - 	{ CTL_DEV, "CTL_DEV" },
   659.1 --- a/patches/strace/4.5.15/500-undef-PACKET_MEMBERSHIP.patch	Mon Jul 28 21:08:01 2008 +0000
   659.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   659.3 @@ -1,16 +0,0 @@
   659.4 -diff -dur strace-4.5.15.orig/net.c strace-4.5.15/net.c
   659.5 ---- strace-4.5.15.orig/net.c	2006-12-13 20:57:23.000000000 +0100
   659.6 -+++ strace-4.5.15/net.c	2007-07-14 19:29:36.000000000 +0200
   659.7 -@@ -800,8 +800,12 @@
   659.8 - 
   659.9 - #ifdef SOL_PACKET
  659.10 - static const struct xlat sockpacketoptions[] = {
  659.11 -+#if defined(PACKET_ADD_MEMBERSHIP)
  659.12 - 	{ PACKET_ADD_MEMBERSHIP,	"PACKET_ADD_MEMBERSHIP"	},
  659.13 -+#endif
  659.14 -+#if defined(PACKET_DROP_MEMBERSHIP)
  659.15 - 	{ PACKET_DROP_MEMBERSHIP,	"PACKET_DROP_MEMBERSHIP"},
  659.16 -+#endif
  659.17 - #if defined(PACKET_RECV_OUTPUT)
  659.18 - 	{ PACKET_RECV_OUTPUT,		"PACKET_RECV_OUTPUT"	},
  659.19 - #endif
   660.1 --- a/patches/strace/4.5.15/550-undef-syscall.patch	Mon Jul 28 21:08:01 2008 +0000
   660.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   660.3 @@ -1,64 +0,0 @@
   660.4 -diff -dur strace-4.5.15.orig/linux/syscallent.h strace-4.5.15/linux/syscallent.h
   660.5 ---- strace-4.5.15.orig/linux/syscallent.h	2006-10-16 03:17:52.000000000 +0200
   660.6 -+++ strace-4.5.15/linux/syscallent.h	2007-07-14 19:30:16.000000000 +0200
   660.7 -@@ -130,7 +130,11 @@
   660.8 - 	{ 2,	TF,	sys_statfs,		"statfs"	}, /* 99 */
   660.9 - 	{ 2,	TD,	sys_fstatfs,		"fstatfs"	}, /* 100 */
  660.10 - 	{ 3,	0,	sys_ioperm,		"ioperm"	}, /* 101 */
  660.11 --	{ 2,	TD,	sys_socketcall,		"socketcall", SYS_socketcall }, /* 102 */
  660.12 -+	{ 2,	TD,	sys_socketcall,		"socketcall"
  660.13 -+#ifdef __NR_socketcall
  660.14 -+	    , SYS_socketcall
  660.15 -+#endif
  660.16 -+								}, /* 102 */
  660.17 - 	{ 3,	0,	sys_syslog,		"syslog"	}, /* 103 */
  660.18 - 	{ 3,	0,	sys_setitimer,		"setitimer"	}, /* 104 */
  660.19 - 	{ 2,	0,	sys_getitimer,		"getitimer"	}, /* 105 */
  660.20 -@@ -145,7 +149,11 @@
  660.21 - 	{ 4,	TP,	sys_wait4,		"wait4", SYS_wait4 }, /* 114 */
  660.22 - 	{ 1,	0,	sys_swapoff,		"swapoff"	}, /* 115 */
  660.23 - 	{ 1,	0,	sys_sysinfo,		"sysinfo"	}, /* 116 */
  660.24 --	{ 6,	0,	sys_ipc,		"ipc", SYS_ipc }, /* 117 */
  660.25 -+	{ 6,	0,	sys_ipc,		"ipc"
  660.26 -+#ifdef __NR_ipc
  660.27 -+	    , SYS_ipc
  660.28 -+#endif
  660.29 -+								}, /* 117 */
  660.30 - 	{ 1,	TD,	sys_fsync,		"fsync"		}, /* 118 */
  660.31 - 	{ 1,	TS,	sys_sigreturn,		"sigreturn"	}, /* 119 */
  660.32 - 	{ 5,	TP,	sys_clone,		"clone", SYS_clone }, /* 120 */
  660.33 -@@ -282,7 +290,11 @@
  660.34 - 	{ 3,	0,	sys_io_cancel,		"io_cancel"	}, /* 249 */
  660.35 - 	{ 5,	0,	sys_fadvise64,		"fadvise64"	}, /* 250 */
  660.36 - 	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
  660.37 --	{ 1,	TP,	sys_exit,		"exit_group", __NR_exit_group }, /* 252 */
  660.38 -+	{ 1,	TP,	sys_exit,		"exit_group"
  660.39 -+#ifdef __NR_exit_group
  660.40 -+	    , __NR_exit_group
  660.41 -+#endif
  660.42 -+								}, /* 252 */
  660.43 - 	{ 4,	0,	printargs,		"lookup_dcookie"}, /* 253 */
  660.44 - 	{ 1,	0,	sys_epoll_create,	"epoll_create"	}, /* 254 */
  660.45 - 	{ 4,	TD,	sys_epoll_ctl,		"epoll_ctl"	}, /* 255 */
  660.46 -diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
  660.47 ---- strace-4.5.15.orig/syscall.c	2007-07-14 19:22:49.000000000 +0200
  660.48 -+++ strace-4.5.15/syscall.c	2007-07-14 19:30:16.000000000 +0200
  660.49 -@@ -2404,14 +2404,18 @@
  660.50 - 	switch (known_scno(tcp)) {
  660.51 - #ifdef LINUX
  660.52 - #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
  660.53 -+#ifdef __NR_socketcall
  660.54 - 	case SYS_socketcall:
  660.55 - 		decode_subcall(tcp, SYS_socket_subcall,
  660.56 - 			SYS_socket_nsubcalls, deref_style);
  660.57 - 		break;
  660.58 -+#endif
  660.59 -+#ifdef __NR_ipc
  660.60 - 	case SYS_ipc:
  660.61 - 		decode_subcall(tcp, SYS_ipc_subcall,
  660.62 - 			SYS_ipc_nsubcalls, shift_style);
  660.63 - 		break;
  660.64 -+#endif
  660.65 - #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
  660.66 - #if defined (SPARC) || defined (SPARC64)
  660.67 - 	case SYS_socketcall:
   661.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   661.2 +++ b/patches/strace/4.5.16/110-dont-use-REG_SYSCALL-for-sh.patch	Mon Jul 28 21:32:33 2008 +0000
   661.3 @@ -0,0 +1,11 @@
   661.4 +diff -dur strace-4.5.16.orig/process.c strace-4.5.16/process.c
   661.5 +--- strace-4.5.16.orig/process.c	2007-01-11 23:08:38.000000000 +0100
   661.6 ++++ strace-4.5.16/process.c	2007-07-14 19:19:58.000000000 +0200
   661.7 +@@ -2685,7 +2685,6 @@
   661.8 +        { 4*REG_GBR,            "4*REG_GBR"                             },
   661.9 +        { 4*REG_MACH,           "4*REG_MACH"                            },
  661.10 +        { 4*REG_MACL,           "4*REG_MACL"                            },
  661.11 +-       { 4*REG_SYSCALL,        "4*REG_SYSCALL"                         },
  661.12 +        { 4*REG_FPUL,           "4*REG_FPUL"                            },
  661.13 +        { 4*REG_FPREG0,         "4*REG_FPREG0"                          },
  661.14 +        { 4*(REG_FPREG0+1),     "4*REG_FPREG1"                          },
   662.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   662.2 +++ b/patches/strace/4.5.16/120-fix-arm-bad-syscall.patch	Mon Jul 28 21:32:33 2008 +0000
   662.3 @@ -0,0 +1,19 @@
   662.4 +diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
   662.5 +--- strace-4.5.16.orig/syscall.c	2006-12-21 23:13:33.000000000 +0100
   662.6 ++++ strace-4.5.16/syscall.c	2007-07-14 19:21:44.000000000 +0200
   662.7 +@@ -1045,6 +1045,15 @@
   662.8 + 		/*
   662.9 + 		 * Note: we only deal with only 32-bit CPUs here.
  662.10 + 		 */
  662.11 ++
  662.12 ++		if (!(tcp->flags & TCB_INSYSCALL) &&
  662.13 ++		    (tcp->flags & TCB_WAITEXECVE)) {
  662.14 ++			/* caught a fake syscall from the execve's exit */
  662.15 ++			tcp->flags &= ~TCB_WAITEXECVE;
  662.16 ++			return 0;
  662.17 ++		}
  662.18 ++
  662.19 ++
  662.20 + 		if (regs.ARM_cpsr & 0x20) {
  662.21 + 			/*
  662.22 + 			 * Get the Thumb-mode system call number
   663.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   663.2 +++ b/patches/strace/4.5.16/130-fix-disabled-largefile-syscalls.patch	Mon Jul 28 21:32:33 2008 +0000
   663.3 @@ -0,0 +1,22 @@
   663.4 +diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
   663.5 +--- strace-4.5.16.orig/syscall.c	2007-07-14 19:21:44.000000000 +0200
   663.6 ++++ strace-4.5.16/syscall.c	2007-07-14 19:22:49.000000000 +0200
   663.7 +@@ -125,6 +125,18 @@
   663.8 + #define TP TRACE_PROCESS
   663.9 + #define TS TRACE_SIGNAL
  663.10 +
  663.11 ++#ifndef HAVE_STATFS64
  663.12 ++/*
  663.13 ++ * Ugly hacks for systems that do not have LFS
  663.14 ++ */
  663.15 ++
  663.16 ++#define sys_truncate64  sys_truncate
  663.17 ++#define sys_ftruncate64 sys_ftruncate
  663.18 ++#define sys_getdents64  sys_getdents
  663.19 ++#define sys_statfs64    sys_statfs
  663.20 ++#define sys_fstatfs64   sys_fstatfs
  663.21 ++#endif
  663.22 ++
  663.23 + static const struct sysent sysent0[] = {
  663.24 + #include "syscallent.h"
  663.25 + };
   664.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   664.2 +++ b/patches/strace/4.5.16/140-statfs64-check.patch	Mon Jul 28 21:32:33 2008 +0000
   664.3 @@ -0,0 +1,53 @@
   664.4 +diff -dur strace-4.5.16.orig/acinclude.m4 strace-4.5.16/acinclude.m4
   664.5 +--- strace-4.5.16.orig/acinclude.m4	2004-04-14 04:21:01.000000000 +0200
   664.6 ++++ strace-4.5.16/acinclude.m4	2007-07-14 19:25:25.000000000 +0200
   664.7 +@@ -210,6 +210,26 @@
   664.8 + fi
   664.9 + ])
  664.10 +
  664.11 ++dnl ### A macro to determine whether statfs64 is defined.
  664.12 ++AC_DEFUN([AC_STATFS64],
  664.13 ++[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
  664.14 ++AC_CACHE_VAL(ac_cv_type_statfs64,
  664.15 ++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
  664.16 ++#include <linux/types.h>
  664.17 ++#include <sys/statfs.h>
  664.18 ++#else
  664.19 ++#include <sys/vfs.h>
  664.20 ++#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
  664.21 ++AC_MSG_RESULT($ac_cv_type_statfs64)
  664.22 ++if test "$ac_cv_type_statfs64" = yes
  664.23 ++then
  664.24 ++	AC_DEFINE([HAVE_STATFS64], 1,
  664.25 ++[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
  664.26 ++fi
  664.27 ++])
  664.28 ++
  664.29 ++
  664.30 ++
  664.31 + dnl ### A macro to determine if off_t is a long long
  664.32 + AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
  664.33 + [AC_MSG_CHECKING(for long long off_t)
  664.34 +diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac
  664.35 +--- strace-4.5.16.orig/configure.ac	2007-01-11 12:37:55.000000000 +0100
  664.36 ++++ strace-4.5.16/configure.ac	2007-07-14 19:25:25.000000000 +0200
  664.37 +@@ -169,6 +169,7 @@
  664.38 + 		  struct stat.st_level,
  664.39 + 		  struct stat.st_rdev])
  664.40 + AC_STAT64
  664.41 ++AC_STATFS64
  664.42 +
  664.43 + AC_TYPE_SIGNAL
  664.44 + AC_TYPE_UID_T
  664.45 +diff -dur strace-4.5.16.orig/file.c strace-4.5.16/file.c
  664.46 +--- strace-4.5.16.orig/file.c	2007-01-15 21:25:52.000000000 +0100
  664.47 ++++ strace-4.5.16/file.c	2007-07-14 19:25:25.000000000 +0200
  664.48 +@@ -1636,7 +1636,7 @@
  664.49 + 	return 0;
  664.50 + }
  664.51 +
  664.52 +-#ifdef LINUX
  664.53 ++#ifdef HAVE_STATFS64
  664.54 + static void
  664.55 + printstatfs64(tcp, addr)
  664.56 + struct tcb *tcp;
   665.1 --- a/patches/strace/4.5.16/150-dont-use-REG_SYSCALL-for-sh.patch	Mon Jul 28 21:08:01 2008 +0000
   665.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   665.3 @@ -1,11 +0,0 @@
   665.4 -diff -dur strace-4.5.16.orig/process.c strace-4.5.16/process.c
   665.5 ---- strace-4.5.16.orig/process.c	2007-01-11 23:08:38.000000000 +0100
   665.6 -+++ strace-4.5.16/process.c	2007-07-14 19:19:58.000000000 +0200
   665.7 -@@ -2685,7 +2685,6 @@
   665.8 -        { 4*REG_GBR,            "4*REG_GBR"                             },
   665.9 -        { 4*REG_MACH,           "4*REG_MACH"                            },
  665.10 -        { 4*REG_MACL,           "4*REG_MACL"                            },
  665.11 --       { 4*REG_SYSCALL,        "4*REG_SYSCALL"                         },
  665.12 -        { 4*REG_FPUL,           "4*REG_FPUL"                            },
  665.13 -        { 4*REG_FPREG0,         "4*REG_FPREG0"                          },
  665.14 -        { 4*(REG_FPREG0+1),     "4*REG_FPREG1"                          },
   666.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   666.2 +++ b/patches/strace/4.5.16/150-superh-update.ac.patch	Mon Jul 28 21:32:33 2008 +0000
   666.3 @@ -0,0 +1,22 @@
   666.4 +diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac
   666.5 +--- strace-4.5.16.orig/configure.ac	2007-07-14 19:25:25.000000000 +0200
   666.6 ++++ strace-4.5.16/configure.ac	2007-07-14 19:27:35.000000000 +0200
   666.7 +@@ -91,14 +91,14 @@
   666.8 + 	arch=hppa
   666.9 + 	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
  666.10 + 	;;
  666.11 +-sh)
  666.12 +-	arch=sh
  666.13 +-	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  666.14 +-	;;
  666.15 + sh64)
  666.16 + 	arch=sh64
  666.17 + 	AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
  666.18 + 	;;
  666.19 ++sh*)
  666.20 ++	arch=sh
  666.21 ++	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  666.22 ++	;;
  666.23 + x86?64*)
  666.24 + 	arch=x86_64
  666.25 + 	AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
   667.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   667.2 +++ b/patches/strace/4.5.16/160-undef-CTL_PROC.patch	Mon Jul 28 21:32:33 2008 +0000
   667.3 @@ -0,0 +1,13 @@
   667.4 +diff -dur strace-4.5.16.orig/system.c strace-4.5.16/system.c
   667.5 +--- strace-4.5.16.orig/system.c	2007-01-17 00:22:36.000000000 +0100
   667.6 ++++ strace-4.5.16/system.c	2007-07-14 19:28:41.000000000 +0200
   667.7 +@@ -1612,7 +1612,9 @@
   667.8 + 	{ CTL_KERN, "CTL_KERN" },
   667.9 + 	{ CTL_VM, "CTL_VM" },
  667.10 + 	{ CTL_NET, "CTL_NET" },
  667.11 ++#ifdef CTL_PROC
  667.12 + 	{ CTL_PROC, "CTL_PROC" },
  667.13 ++#endif
  667.14 + 	{ CTL_FS, "CTL_FS" },
  667.15 + 	{ CTL_DEBUG, "CTL_DEBUG" },
  667.16 + 	{ CTL_DEV, "CTL_DEV" },
   668.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   668.2 +++ b/patches/strace/4.5.16/170-undef-PACKET_MEMBERSHIP.patch	Mon Jul 28 21:32:33 2008 +0000
   668.3 @@ -0,0 +1,16 @@
   668.4 +diff -dur strace-4.5.16.orig/net.c strace-4.5.16/net.c
   668.5 +--- strace-4.5.16.orig/net.c	2006-12-13 20:57:23.000000000 +0100
   668.6 ++++ strace-4.5.16/net.c	2007-07-14 19:29:36.000000000 +0200
   668.7 +@@ -800,8 +800,12 @@
   668.8 +
   668.9 + #ifdef SOL_PACKET
  668.10 + static const struct xlat sockpacketoptions[] = {
  668.11 ++#if defined(PACKET_ADD_MEMBERSHIP)
  668.12 + 	{ PACKET_ADD_MEMBERSHIP,	"PACKET_ADD_MEMBERSHIP"	},
  668.13 ++#endif
  668.14 ++#if defined(PACKET_DROP_MEMBERSHIP)
  668.15 + 	{ PACKET_DROP_MEMBERSHIP,	"PACKET_DROP_MEMBERSHIP"},
  668.16 ++#endif
  668.17 + #if defined(PACKET_RECV_OUTPUT)
  668.18 + 	{ PACKET_RECV_OUTPUT,		"PACKET_RECV_OUTPUT"	},
  668.19 + #endif
   669.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   669.2 +++ b/patches/strace/4.5.16/180-undef-syscall.patch	Mon Jul 28 21:32:33 2008 +0000
   669.3 @@ -0,0 +1,64 @@
   669.4 +diff -dur strace-4.5.16.orig/linux/syscallent.h strace-4.5.16/linux/syscallent.h
   669.5 +--- strace-4.5.16.orig/linux/syscallent.h	2006-10-16 03:17:52.000000000 +0200
   669.6 ++++ strace-4.5.16/linux/syscallent.h	2007-07-14 19:30:16.000000000 +0200
   669.7 +@@ -130,7 +130,11 @@
   669.8 + 	{ 2,	TF,	sys_statfs,		"statfs"	}, /* 99 */
   669.9 + 	{ 2,	TD,	sys_fstatfs,		"fstatfs"	}, /* 100 */
  669.10 + 	{ 3,	0,	sys_ioperm,		"ioperm"	}, /* 101 */
  669.11 +-	{ 2,	TD,	sys_socketcall,		"socketcall", SYS_socketcall }, /* 102 */
  669.12 ++	{ 2,	TD,	sys_socketcall,		"socketcall"
  669.13 ++#ifdef __NR_socketcall
  669.14 ++	    , SYS_socketcall
  669.15 ++#endif
  669.16 ++								}, /* 102 */
  669.17 + 	{ 3,	0,	sys_syslog,		"syslog"	}, /* 103 */
  669.18 + 	{ 3,	0,	sys_setitimer,		"setitimer"	}, /* 104 */
  669.19 + 	{ 2,	0,	sys_getitimer,		"getitimer"	}, /* 105 */
  669.20 +@@ -145,7 +149,11 @@
  669.21 + 	{ 4,	TP,	sys_wait4,		"wait4", SYS_wait4 }, /* 114 */
  669.22 + 	{ 1,	0,	sys_swapoff,		"swapoff"	}, /* 115 */
  669.23 + 	{ 1,	0,	sys_sysinfo,		"sysinfo"	}, /* 116 */
  669.24 +-	{ 6,	0,	sys_ipc,		"ipc", SYS_ipc }, /* 117 */
  669.25 ++	{ 6,	0,	sys_ipc,		"ipc"
  669.26 ++#ifdef __NR_ipc
  669.27 ++	    , SYS_ipc
  669.28 ++#endif
  669.29 ++								}, /* 117 */
  669.30 + 	{ 1,	TD,	sys_fsync,		"fsync"		}, /* 118 */
  669.31 + 	{ 1,	TS,	sys_sigreturn,		"sigreturn"	}, /* 119 */
  669.32 + 	{ 5,	TP,	sys_clone,		"clone", SYS_clone }, /* 120 */
  669.33 +@@ -282,7 +290,11 @@
  669.34 + 	{ 3,	0,	sys_io_cancel,		"io_cancel"	}, /* 249 */
  669.35 + 	{ 5,	0,	sys_fadvise64,		"fadvise64"	}, /* 250 */
  669.36 + 	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
  669.37 +-	{ 1,	TP,	sys_exit,		"exit_group", __NR_exit_group }, /* 252 */
  669.38 ++	{ 1,	TP,	sys_exit,		"exit_group"
  669.39 ++#ifdef __NR_exit_group
  669.40 ++	    , __NR_exit_group
  669.41 ++#endif
  669.42 ++								}, /* 252 */
  669.43 + 	{ 4,	0,	printargs,		"lookup_dcookie"}, /* 253 */
  669.44 + 	{ 1,	0,	sys_epoll_create,	"epoll_create"	}, /* 254 */
  669.45 + 	{ 4,	TD,	sys_epoll_ctl,		"epoll_ctl"	}, /* 255 */
  669.46 +diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
  669.47 +--- strace-4.5.16.orig/syscall.c	2007-07-14 19:22:49.000000000 +0200
  669.48 ++++ strace-4.5.16/syscall.c	2007-07-14 19:30:16.000000000 +0200
  669.49 +@@ -2383,14 +2383,18 @@
  669.50 + 	switch (known_scno(tcp)) {
  669.51 + #ifdef LINUX
  669.52 + #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
  669.53 ++#ifdef __NR_socketcall
  669.54 + 	case SYS_socketcall:
  669.55 + 		decode_subcall(tcp, SYS_socket_subcall,
  669.56 + 			SYS_socket_nsubcalls, deref_style);
  669.57 + 		break;
  669.58 ++#endif
  669.59 ++#ifdef __NR_ipc
  669.60 + 	case SYS_ipc:
  669.61 + 		decode_subcall(tcp, SYS_ipc_subcall,
  669.62 + 			SYS_ipc_nsubcalls, shift_style);
  669.63 + 		break;
  669.64 ++#endif
  669.65 + #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
  669.66 + #if defined (SPARC) || defined (SPARC64)
  669.67 + 	case SYS_socketcall:
   670.1 --- a/patches/strace/4.5.16/200-fix-arm-bad-syscall.patch	Mon Jul 28 21:08:01 2008 +0000
   670.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   670.3 @@ -1,19 +0,0 @@
   670.4 -diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
   670.5 ---- strace-4.5.16.orig/syscall.c	2006-12-21 23:13:33.000000000 +0100
   670.6 -+++ strace-4.5.16/syscall.c	2007-07-14 19:21:44.000000000 +0200
   670.7 -@@ -1045,6 +1045,15 @@
   670.8 - 		/*
   670.9 - 		 * Note: we only deal with only 32-bit CPUs here.
  670.10 - 		 */
  670.11 -+
  670.12 -+		if (!(tcp->flags & TCB_INSYSCALL) &&
  670.13 -+		    (tcp->flags & TCB_WAITEXECVE)) {
  670.14 -+			/* caught a fake syscall from the execve's exit */
  670.15 -+			tcp->flags &= ~TCB_WAITEXECVE;
  670.16 -+			return 0;
  670.17 -+		}
  670.18 -+
  670.19 -+
  670.20 - 		if (regs.ARM_cpsr & 0x20) {
  670.21 - 			/*
  670.22 - 			 * Get the Thumb-mode system call number
   671.1 --- a/patches/strace/4.5.16/250-fix-disabled-largefile-syscalls.patch	Mon Jul 28 21:08:01 2008 +0000
   671.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   671.3 @@ -1,22 +0,0 @@
   671.4 -diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
   671.5 ---- strace-4.5.16.orig/syscall.c	2007-07-14 19:21:44.000000000 +0200
   671.6 -+++ strace-4.5.16/syscall.c	2007-07-14 19:22:49.000000000 +0200
   671.7 -@@ -125,6 +125,18 @@
   671.8 - #define TP TRACE_PROCESS
   671.9 - #define TS TRACE_SIGNAL
  671.10 -
  671.11 -+#ifndef HAVE_STATFS64
  671.12 -+/*
  671.13 -+ * Ugly hacks for systems that do not have LFS
  671.14 -+ */
  671.15 -+
  671.16 -+#define sys_truncate64  sys_truncate
  671.17 -+#define sys_ftruncate64 sys_ftruncate
  671.18 -+#define sys_getdents64  sys_getdents
  671.19 -+#define sys_statfs64    sys_statfs
  671.20 -+#define sys_fstatfs64   sys_fstatfs
  671.21 -+#endif
  671.22 -+
  671.23 - static const struct sysent sysent0[] = {
  671.24 - #include "syscallent.h"
  671.25 - };
   672.1 --- a/patches/strace/4.5.16/350-statfs64-check.patch	Mon Jul 28 21:08:01 2008 +0000
   672.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   672.3 @@ -1,53 +0,0 @@
   672.4 -diff -dur strace-4.5.16.orig/acinclude.m4 strace-4.5.16/acinclude.m4
   672.5 ---- strace-4.5.16.orig/acinclude.m4	2004-04-14 04:21:01.000000000 +0200
   672.6 -+++ strace-4.5.16/acinclude.m4	2007-07-14 19:25:25.000000000 +0200
   672.7 -@@ -210,6 +210,26 @@
   672.8 - fi
   672.9 - ])
  672.10 -
  672.11 -+dnl ### A macro to determine whether statfs64 is defined.
  672.12 -+AC_DEFUN([AC_STATFS64],
  672.13 -+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
  672.14 -+AC_CACHE_VAL(ac_cv_type_statfs64,
  672.15 -+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
  672.16 -+#include <linux/types.h>
  672.17 -+#include <sys/statfs.h>
  672.18 -+#else
  672.19 -+#include <sys/vfs.h>
  672.20 -+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
  672.21 -+AC_MSG_RESULT($ac_cv_type_statfs64)
  672.22 -+if test "$ac_cv_type_statfs64" = yes
  672.23 -+then
  672.24 -+	AC_DEFINE([HAVE_STATFS64], 1,
  672.25 -+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
  672.26 -+fi
  672.27 -+])
  672.28 -+
  672.29 -+
  672.30 -+
  672.31 - dnl ### A macro to determine if off_t is a long long
  672.32 - AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
  672.33 - [AC_MSG_CHECKING(for long long off_t)
  672.34 -diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac
  672.35 ---- strace-4.5.16.orig/configure.ac	2007-01-11 12:37:55.000000000 +0100
  672.36 -+++ strace-4.5.16/configure.ac	2007-07-14 19:25:25.000000000 +0200
  672.37 -@@ -169,6 +169,7 @@
  672.38 - 		  struct stat.st_level,
  672.39 - 		  struct stat.st_rdev])
  672.40 - AC_STAT64
  672.41 -+AC_STATFS64
  672.42 -
  672.43 - AC_TYPE_SIGNAL
  672.44 - AC_TYPE_UID_T
  672.45 -diff -dur strace-4.5.16.orig/file.c strace-4.5.16/file.c
  672.46 ---- strace-4.5.16.orig/file.c	2007-01-15 21:25:52.000000000 +0100
  672.47 -+++ strace-4.5.16/file.c	2007-07-14 19:25:25.000000000 +0200
  672.48 -@@ -1636,7 +1636,7 @@
  672.49 - 	return 0;
  672.50 - }
  672.51 -
  672.52 --#ifdef LINUX
  672.53 -+#ifdef HAVE_STATFS64
  672.54 - static void
  672.55 - printstatfs64(tcp, addr)
  672.56 - struct tcb *tcp;
   673.1 --- a/patches/strace/4.5.16/400-superh-update.ac.patch	Mon Jul 28 21:08:01 2008 +0000
   673.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   673.3 @@ -1,22 +0,0 @@
   673.4 -diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac
   673.5 ---- strace-4.5.16.orig/configure.ac	2007-07-14 19:25:25.000000000 +0200
   673.6 -+++ strace-4.5.16/configure.ac	2007-07-14 19:27:35.000000000 +0200
   673.7 -@@ -91,14 +91,14 @@
   673.8 - 	arch=hppa
   673.9 - 	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
  673.10 - 	;;
  673.11 --sh)
  673.12 --	arch=sh
  673.13 --	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  673.14 --	;;
  673.15 - sh64)
  673.16 - 	arch=sh64
  673.17 - 	AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
  673.18 - 	;;
  673.19 -+sh*)
  673.20 -+	arch=sh
  673.21 -+	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  673.22 -+	;;
  673.23 - x86?64*)
  673.24 - 	arch=x86_64
  673.25 - 	AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
   674.1 --- a/patches/strace/4.5.16/450-undef-CTL_PROC.patch	Mon Jul 28 21:08:01 2008 +0000
   674.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   674.3 @@ -1,13 +0,0 @@
   674.4 -diff -dur strace-4.5.16.orig/system.c strace-4.5.16/system.c
   674.5 ---- strace-4.5.16.orig/system.c	2007-01-17 00:22:36.000000000 +0100
   674.6 -+++ strace-4.5.16/system.c	2007-07-14 19:28:41.000000000 +0200
   674.7 -@@ -1612,7 +1612,9 @@
   674.8 - 	{ CTL_KERN, "CTL_KERN" },
   674.9 - 	{ CTL_VM, "CTL_VM" },
  674.10 - 	{ CTL_NET, "CTL_NET" },
  674.11 -+#ifdef CTL_PROC
  674.12 - 	{ CTL_PROC, "CTL_PROC" },
  674.13 -+#endif
  674.14 - 	{ CTL_FS, "CTL_FS" },
  674.15 - 	{ CTL_DEBUG, "CTL_DEBUG" },
  674.16 - 	{ CTL_DEV, "CTL_DEV" },
   675.1 --- a/patches/strace/4.5.16/500-undef-PACKET_MEMBERSHIP.patch	Mon Jul 28 21:08:01 2008 +0000
   675.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   675.3 @@ -1,16 +0,0 @@
   675.4 -diff -dur strace-4.5.16.orig/net.c strace-4.5.16/net.c
   675.5 ---- strace-4.5.16.orig/net.c	2006-12-13 20:57:23.000000000 +0100
   675.6 -+++ strace-4.5.16/net.c	2007-07-14 19:29:36.000000000 +0200
   675.7 -@@ -800,8 +800,12 @@
   675.8 -
   675.9 - #ifdef SOL_PACKET
  675.10 - static const struct xlat sockpacketoptions[] = {
  675.11 -+#if defined(PACKET_ADD_MEMBERSHIP)
  675.12 - 	{ PACKET_ADD_MEMBERSHIP,	"PACKET_ADD_MEMBERSHIP"	},
  675.13 -+#endif
  675.14 -+#if defined(PACKET_DROP_MEMBERSHIP)
  675.15 - 	{ PACKET_DROP_MEMBERSHIP,	"PACKET_DROP_MEMBERSHIP"},
  675.16 -+#endif
  675.17 - #if defined(PACKET_RECV_OUTPUT)
  675.18 - 	{ PACKET_RECV_OUTPUT,		"PACKET_RECV_OUTPUT"	},
  675.19 - #endif
   676.1 --- a/patches/strace/4.5.16/550-undef-syscall.patch	Mon Jul 28 21:08:01 2008 +0000
   676.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   676.3 @@ -1,64 +0,0 @@
   676.4 -diff -dur strace-4.5.16.orig/linux/syscallent.h strace-4.5.16/linux/syscallent.h
   676.5 ---- strace-4.5.16.orig/linux/syscallent.h	2006-10-16 03:17:52.000000000 +0200
   676.6 -+++ strace-4.5.16/linux/syscallent.h	2007-07-14 19:30:16.000000000 +0200
   676.7 -@@ -130,7 +130,11 @@
   676.8 - 	{ 2,	TF,	sys_statfs,		"statfs"	}, /* 99 */
   676.9 - 	{ 2,	TD,	sys_fstatfs,		"fstatfs"	}, /* 100 */
  676.10 - 	{ 3,	0,	sys_ioperm,		"ioperm"	}, /* 101 */
  676.11 --	{ 2,	TD,	sys_socketcall,		"socketcall", SYS_socketcall }, /* 102 */
  676.12 -+	{ 2,	TD,	sys_socketcall,		"socketcall"
  676.13 -+#ifdef __NR_socketcall
  676.14 -+	    , SYS_socketcall
  676.15 -+#endif
  676.16 -+								}, /* 102 */
  676.17 - 	{ 3,	0,	sys_syslog,		"syslog"	}, /* 103 */
  676.18 - 	{ 3,	0,	sys_setitimer,		"setitimer"	}, /* 104 */
  676.19 - 	{ 2,	0,	sys_getitimer,		"getitimer"	}, /* 105 */
  676.20 -@@ -145,7 +149,11 @@
  676.21 - 	{ 4,	TP,	sys_wait4,		"wait4", SYS_wait4 }, /* 114 */
  676.22 - 	{ 1,	0,	sys_swapoff,		"swapoff"	}, /* 115 */
  676.23 - 	{ 1,	0,	sys_sysinfo,		"sysinfo"	}, /* 116 */
  676.24 --	{ 6,	0,	sys_ipc,		"ipc", SYS_ipc }, /* 117 */
  676.25 -+	{ 6,	0,	sys_ipc,		"ipc"
  676.26 -+#ifdef __NR_ipc
  676.27 -+	    , SYS_ipc
  676.28 -+#endif
  676.29 -+								}, /* 117 */
  676.30 - 	{ 1,	TD,	sys_fsync,		"fsync"		}, /* 118 */
  676.31 - 	{ 1,	TS,	sys_sigreturn,		"sigreturn"	}, /* 119 */
  676.32 - 	{ 5,	TP,	sys_clone,		"clone", SYS_clone }, /* 120 */
  676.33 -@@ -282,7 +290,11 @@
  676.34 - 	{ 3,	0,	sys_io_cancel,		"io_cancel"	}, /* 249 */
  676.35 - 	{ 5,	0,	sys_fadvise64,		"fadvise64"	}, /* 250 */
  676.36 - 	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
  676.37 --	{ 1,	TP,	sys_exit,		"exit_group", __NR_exit_group }, /* 252 */
  676.38 -+	{ 1,	TP,	sys_exit,		"exit_group"
  676.39 -+#ifdef __NR_exit_group
  676.40 -+	    , __NR_exit_group
  676.41 -+#endif
  676.42 -+								}, /* 252 */
  676.43 - 	{ 4,	0,	printargs,		"lookup_dcookie"}, /* 253 */
  676.44 - 	{ 1,	0,	sys_epoll_create,	"epoll_create"	}, /* 254 */
  676.45 - 	{ 4,	TD,	sys_epoll_ctl,		"epoll_ctl"	}, /* 255 */
  676.46 -diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
  676.47 ---- strace-4.5.16.orig/syscall.c	2007-07-14 19:22:49.000000000 +0200
  676.48 -+++ strace-4.5.16/syscall.c	2007-07-14 19:30:16.000000000 +0200
  676.49 -@@ -2383,14 +2383,18 @@
  676.50 - 	switch (known_scno(tcp)) {
  676.51 - #ifdef LINUX
  676.52 - #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
  676.53 -+#ifdef __NR_socketcall
  676.54 - 	case SYS_socketcall:
  676.55 - 		decode_subcall(tcp, SYS_socket_subcall,
  676.56 - 			SYS_socket_nsubcalls, deref_style);
  676.57 - 		break;
  676.58 -+#endif
  676.59 -+#ifdef __NR_ipc
  676.60 - 	case SYS_ipc:
  676.61 - 		decode_subcall(tcp, SYS_ipc_subcall,
  676.62 - 			SYS_ipc_nsubcalls, shift_style);
  676.63 - 		break;
  676.64 -+#endif
  676.65 - #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
  676.66 - #if defined (SPARC) || defined (SPARC64)
  676.67 - 	case SYS_socketcall:
   677.1 --- a/patches/uClibc/0.9.28.1/000-string-functions.patch	Mon Jul 28 21:08:01 2008 +0000
   677.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   677.3 @@ -1,14 +0,0 @@
   677.4 -Give preference to target-optimised functions over glibc's ones,
   677.5 -which in turn ahave precedence over generic ones.
   677.6 -
   677.7 ---- uClibc.orig/libc/Makefile	2005-07-20 08:10:44.000000000 +0200
   677.8 -+++ uclibc/libc/Makefile	2005-07-28 13:33:40.000000000 +0200
   677.9 -@@ -59,7 +59,7 @@
  677.10 - 	$(AR) dN 2 $(LIBNAME) $$objs && \
  677.11 - 	$(AR) dN 2 $(LIBNAME) $$objs
  677.12 - 	@for objfile in obj.signal \
  677.13 --	                obj.string.generic obj.string.$(TARGET_ARCH) obj.string \
  677.14 -+	                obj.string obj.string.generic obj.string.$(TARGET_ARCH) \
  677.15 - 	                obj.sysdeps.common obj.sysdeps.$(TARGET_ARCH) ; do \
  677.16 - 		if [ -e $$objfile ] ; then \
  677.17 - 			echo $(AR) $(ARFLAGS) $(LIBNAME) $$objfile ; \
   678.1 --- a/patches/uClibc/0.9.28.1/001-install_dev.patch	Mon Jul 28 21:08:01 2008 +0000
   678.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   678.3 @@ -1,22 +0,0 @@
   678.4 -We know that the kernel headers are in place. Don't try to install them.
   678.5 -
   678.6 -diff -dur uClibc-0.9.28.1.orig/Makefile uClibc-0.9.28.1/Makefile
   678.7 ---- uClibc-0.9.28.1.orig/Makefile	2007-01-28 06:38:00.000000000 +0100
   678.8 -+++ uClibc-0.9.28.1/Makefile	2007-01-28 18:55:46.000000000 +0100
   678.9 -@@ -158,12 +158,10 @@
  678.10 - 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
  678.11 - 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
  678.12 - 	-$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
  678.13 --	if [ "$(KERNEL_SOURCE)" = "$(DEVEL_PREFIX)" ] ; then \
  678.14 --		extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  678.15 --	else \
  678.16 --		extra_exclude="" ; \
  678.17 --	fi ; \
  678.18 --	tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
  678.19 -+	extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  678.20 -+	tar -chf - include --exclude .svn --exclude CVS \
  678.21 -+	                   --exclude include/linux      \
  678.22 -+	                   --exclude include/asm'*'     \
  678.23 - 		| tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
  678.24 - ifneq ($(strip $(UCLIBC_HAS_FLOATS)),y)
  678.25 - 	# Remove floating point related headers since float support is disabled.
   679.1 --- a/patches/uClibc/0.9.28.1/002-no_LFS-no_readahead.patch	Mon Jul 28 21:08:01 2008 +0000
   679.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   679.3 @@ -1,14 +0,0 @@
   679.4 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile
   679.5 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile	2007-01-26 00:54:19.000000000 +0100
   679.6 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile	2007-02-01 08:44:37.000000000 +0100
   679.7 -@@ -25,6 +25,10 @@
   679.8 - SRCS := $(filter-out sbrk.c,$(SRCS))
   679.9 - endif
  679.10 - 
  679.11 -+ifneq ($(strip $(UCLIBC_HAS_LFS)),y)
  679.12 -+SRCS := $(filter-out readahead.c,$(SRCS))
  679.13 -+endif
  679.14 -+
  679.15 - ifneq ($(strip $(UCLIBC_HAS_SSP)),y)
  679.16 - SRCS := $(filter-out ssp.c,$(SRCS))
  679.17 - endif
   680.1 --- a/patches/uClibc/0.9.28.1/003-time-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   680.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   680.3 @@ -1,15 +0,0 @@
   680.4 -Index: libc/misc/time/time.c
   680.5 -===================================================================
   680.6 ---- a/libc/misc/time/time.c	(revision 17534)
   680.7 -+++ b/libc/misc/time/time.c	(revision 17647)
   680.8 -@@ -158,7 +158,9 @@
   680.9 - #endif
  680.10 - 
  680.11 - #if defined (L_tzset) || defined (L_localtime_r) || defined(L_strftime) || \
  680.12 --    defined(L__time_mktime) || defined(L__time_mktime_tzi)
  680.13 -+	 defined(L__time_mktime) || defined(L__time_mktime_tzi) || \
  680.14 -+	 ((defined(L_strftime) || defined(L_strftime_l)) && \
  680.15 -+	  defined(__UCLIBC_HAS_XLOCALE__))
  680.16 - 
  680.17 - void _time_tzset (int);
  680.18 - 
   681.1 --- a/patches/uClibc/0.9.28.1/004-ctype.patch	Mon Jul 28 21:08:01 2008 +0000
   681.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   681.3 @@ -1,17 +0,0 @@
   681.4 -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   681.5 ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   681.6 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   681.7 -@@ -34,11 +34,11 @@
   681.8 -
   681.9 - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  681.10 -
  681.11 --typedef __uint16_t __ctype_mask_t;
  681.12 -+typedef __uint32_t __ctype_mask_t;
  681.13 -
  681.14 - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  681.15 -
  681.16 --typedef __int16_t __ctype_touplow_t;
  681.17 -+typedef __int32_t __ctype_touplow_t;
  681.18 - #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  681.19 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  681.20 -
   682.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   682.2 +++ b/patches/uClibc/0.9.28.1/100-string-functions.patch	Mon Jul 28 21:32:33 2008 +0000
   682.3 @@ -0,0 +1,14 @@
   682.4 +Give preference to target-optimised functions over glibc's ones,
   682.5 +which in turn ahave precedence over generic ones.
   682.6 +
   682.7 +--- uClibc.orig/libc/Makefile	2005-07-20 08:10:44.000000000 +0200
   682.8 ++++ uclibc/libc/Makefile	2005-07-28 13:33:40.000000000 +0200
   682.9 +@@ -59,7 +59,7 @@
  682.10 + 	$(AR) dN 2 $(LIBNAME) $$objs && \
  682.11 + 	$(AR) dN 2 $(LIBNAME) $$objs
  682.12 + 	@for objfile in obj.signal \
  682.13 +-	                obj.string.generic obj.string.$(TARGET_ARCH) obj.string \
  682.14 ++	                obj.string obj.string.generic obj.string.$(TARGET_ARCH) \
  682.15 + 	                obj.sysdeps.common obj.sysdeps.$(TARGET_ARCH) ; do \
  682.16 + 		if [ -e $$objfile ] ; then \
  682.17 + 			echo $(AR) $(ARFLAGS) $(LIBNAME) $$objfile ; \
   683.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   683.2 +++ b/patches/uClibc/0.9.28.1/110-install_dev.patch	Mon Jul 28 21:32:33 2008 +0000
   683.3 @@ -0,0 +1,22 @@
   683.4 +We know that the kernel headers are in place. Don't try to install them.
   683.5 +
   683.6 +diff -dur uClibc-0.9.28.1.orig/Makefile uClibc-0.9.28.1/Makefile
   683.7 +--- uClibc-0.9.28.1.orig/Makefile	2007-01-28 06:38:00.000000000 +0100
   683.8 ++++ uClibc-0.9.28.1/Makefile	2007-01-28 18:55:46.000000000 +0100
   683.9 +@@ -158,12 +158,10 @@
  683.10 + 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
  683.11 + 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
  683.12 + 	-$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
  683.13 +-	if [ "$(KERNEL_SOURCE)" = "$(DEVEL_PREFIX)" ] ; then \
  683.14 +-		extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  683.15 +-	else \
  683.16 +-		extra_exclude="" ; \
  683.17 +-	fi ; \
  683.18 +-	tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
  683.19 ++	extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  683.20 ++	tar -chf - include --exclude .svn --exclude CVS \
  683.21 ++	                   --exclude include/linux      \
  683.22 ++	                   --exclude include/asm'*'     \
  683.23 + 		| tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
  683.24 + ifneq ($(strip $(UCLIBC_HAS_FLOATS)),y)
  683.25 + 	# Remove floating point related headers since float support is disabled.
   684.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   684.2 +++ b/patches/uClibc/0.9.28.1/120-no_LFS-no_readahead.patch	Mon Jul 28 21:32:33 2008 +0000
   684.3 @@ -0,0 +1,14 @@
   684.4 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile
   684.5 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile	2007-01-26 00:54:19.000000000 +0100
   684.6 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile	2007-02-01 08:44:37.000000000 +0100
   684.7 +@@ -25,6 +25,10 @@
   684.8 + SRCS := $(filter-out sbrk.c,$(SRCS))
   684.9 + endif
  684.10 + 
  684.11 ++ifneq ($(strip $(UCLIBC_HAS_LFS)),y)
  684.12 ++SRCS := $(filter-out readahead.c,$(SRCS))
  684.13 ++endif
  684.14 ++
  684.15 + ifneq ($(strip $(UCLIBC_HAS_SSP)),y)
  684.16 + SRCS := $(filter-out ssp.c,$(SRCS))
  684.17 + endif
   685.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   685.2 +++ b/patches/uClibc/0.9.28.1/130-time-locale.patch	Mon Jul 28 21:32:33 2008 +0000
   685.3 @@ -0,0 +1,15 @@
   685.4 +Index: libc/misc/time/time.c
   685.5 +===================================================================
   685.6 +--- a/libc/misc/time/time.c	(revision 17534)
   685.7 ++++ b/libc/misc/time/time.c	(revision 17647)
   685.8 +@@ -158,7 +158,9 @@
   685.9 + #endif
  685.10 + 
  685.11 + #if defined (L_tzset) || defined (L_localtime_r) || defined(L_strftime) || \
  685.12 +-    defined(L__time_mktime) || defined(L__time_mktime_tzi)
  685.13 ++	 defined(L__time_mktime) || defined(L__time_mktime_tzi) || \
  685.14 ++	 ((defined(L_strftime) || defined(L_strftime_l)) && \
  685.15 ++	  defined(__UCLIBC_HAS_XLOCALE__))
  685.16 + 
  685.17 + void _time_tzset (int);
  685.18 + 
   686.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   686.2 +++ b/patches/uClibc/0.9.28.1/140-ctype.patch	Mon Jul 28 21:32:33 2008 +0000
   686.3 @@ -0,0 +1,17 @@
   686.4 +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   686.5 +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   686.6 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   686.7 +@@ -34,11 +34,11 @@
   686.8 +
   686.9 + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  686.10 +
  686.11 +-typedef __uint16_t __ctype_mask_t;
  686.12 ++typedef __uint32_t __ctype_mask_t;
  686.13 +
  686.14 + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  686.15 +
  686.16 +-typedef __int16_t __ctype_touplow_t;
  686.17 ++typedef __int32_t __ctype_touplow_t;
  686.18 + #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  686.19 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  686.20 +
   687.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   687.2 +++ b/patches/uClibc/0.9.28.1/150-custom-ISA.patch	Mon Jul 28 21:32:33 2008 +0000
   687.3 @@ -0,0 +1,31 @@
   687.4 +diff -dur uClibc-0.9.28.orig/Rules.mak uClibc-0.9.28/Rules.mak
   687.5 +--- uClibc-0.9.28.orig/Rules.mak	2005-08-18 00:49:49.000000000 +0200
   687.6 ++++ uClibc-0.9.28/Rules.mak	2007-01-30 10:53:34.000000000 +0100
   687.7 +@@ -168,6 +168,7 @@
   687.8 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
   687.9 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
  687.10 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
  687.11 ++	CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
  687.12 + endif
  687.13 + 
  687.14 + ifeq ($(strip $(TARGET_ARCH)),sh)
  687.15 +diff -dur uClibc-0.9.28.orig/extra/Configs/Config.mips uClibc-0.9.28/extra/Configs/Config.mips
  687.16 +--- uClibc-0.9.28.orig/extra/Configs/Config.mips	2005-08-18 00:49:41.000000000 +0200
  687.17 ++++ uClibc-0.9.28/extra/Configs/Config.mips	2007-01-30 10:52:12.000000000 +0100
  687.18 +@@ -63,4 +63,16 @@
  687.19 + config CONFIG_MIPS_ISA_MIPS64
  687.20 + 	bool "MIPS64"
  687.21 + 
  687.22 ++config CONFIG_MIPS_ISA_CUSTOM
  687.23 ++	bool "Custom"
  687.24 ++
  687.25 + endchoice
  687.26 ++
  687.27 ++config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
  687.28 ++	string
  687.29 ++	prompt "Custon ISA"
  687.30 ++	depends on CONFIG_MIPS_ISA_CUSTOM
  687.31 ++	default ""
  687.32 ++	help
  687.33 ++	  Enter your custom ISA here (eg: lx4189!).
  687.34 ++
   688.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   688.2 +++ b/patches/uClibc/0.9.28.1/160-mips-asm.h.patch	Mon Jul 28 21:32:33 2008 +0000
   688.3 @@ -0,0 +1,41 @@
   688.4 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S
   688.5 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S	2007-02-07 11:18:12.000000000 +0100
   688.6 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S	2007-02-07 10:41:34.000000000 +0100
   688.7 +@@ -24,7 +24,7 @@
   688.8 + #include <sys/regdef.h>
   688.9 + #define _ERRNO_H	1
  688.10 + #include <bits/errno.h>
  688.11 +-#include <asm/asm.h>
  688.12 ++#include <sys/asm.h>
  688.13 + 
  688.14 + /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
  688.15 + 
  688.16 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S
  688.17 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:18:12.000000000 +0100
  688.18 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:16:52.000000000 +0100
  688.19 +@@ -3,9 +3,9 @@
  688.20 + /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
  688.21 + 
  688.22 + #include <features.h>
  688.23 +-#include <asm/asm.h>
  688.24 ++#include <sys/asm.h>
  688.25 + #include <asm/unistd.h>
  688.26 +-#include <asm/regdef.h>
  688.27 ++#include <sys/regdef.h>
  688.28 + 
  688.29 +         .globl  pipe
  688.30 +         .ent    pipe, 0
  688.31 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S
  688.32 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:18:12.000000000 +0100
  688.33 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:17:03.000000000 +0100
  688.34 +@@ -17,8 +17,8 @@
  688.35 +    02111-1307 USA.  */
  688.36 + 
  688.37 + #include <features.h>
  688.38 +-#include <asm/asm.h>
  688.39 +-#include <asm/regdef.h>
  688.40 ++#include <sys/asm.h>
  688.41 ++#include <sys/regdef.h>
  688.42 + 
  688.43 + #ifdef __PIC__
  688.44 + 	.option pic2
   689.1 --- a/patches/uClibc/0.9.28.1/200-custom-ISA.patch	Mon Jul 28 21:08:01 2008 +0000
   689.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   689.3 @@ -1,31 +0,0 @@
   689.4 -diff -dur uClibc-0.9.28.orig/Rules.mak uClibc-0.9.28/Rules.mak
   689.5 ---- uClibc-0.9.28.orig/Rules.mak	2005-08-18 00:49:49.000000000 +0200
   689.6 -+++ uClibc-0.9.28/Rules.mak	2007-01-30 10:53:34.000000000 +0100
   689.7 -@@ -168,6 +168,7 @@
   689.8 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
   689.9 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
  689.10 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
  689.11 -+	CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
  689.12 - endif
  689.13 - 
  689.14 - ifeq ($(strip $(TARGET_ARCH)),sh)
  689.15 -diff -dur uClibc-0.9.28.orig/extra/Configs/Config.mips uClibc-0.9.28/extra/Configs/Config.mips
  689.16 ---- uClibc-0.9.28.orig/extra/Configs/Config.mips	2005-08-18 00:49:41.000000000 +0200
  689.17 -+++ uClibc-0.9.28/extra/Configs/Config.mips	2007-01-30 10:52:12.000000000 +0100
  689.18 -@@ -63,4 +63,16 @@
  689.19 - config CONFIG_MIPS_ISA_MIPS64
  689.20 - 	bool "MIPS64"
  689.21 - 
  689.22 -+config CONFIG_MIPS_ISA_CUSTOM
  689.23 -+	bool "Custom"
  689.24 -+
  689.25 - endchoice
  689.26 -+
  689.27 -+config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
  689.28 -+	string
  689.29 -+	prompt "Custon ISA"
  689.30 -+	depends on CONFIG_MIPS_ISA_CUSTOM
  689.31 -+	default ""
  689.32 -+	help
  689.33 -+	  Enter your custom ISA here (eg: lx4189!).
  689.34 -+
   690.1 --- a/patches/uClibc/0.9.28.1/201-mips-asm.h.patch	Mon Jul 28 21:08:01 2008 +0000
   690.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   690.3 @@ -1,41 +0,0 @@
   690.4 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S
   690.5 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S	2007-02-07 11:18:12.000000000 +0100
   690.6 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S	2007-02-07 10:41:34.000000000 +0100
   690.7 -@@ -24,7 +24,7 @@
   690.8 - #include <sys/regdef.h>
   690.9 - #define _ERRNO_H	1
  690.10 - #include <bits/errno.h>
  690.11 --#include <asm/asm.h>
  690.12 -+#include <sys/asm.h>
  690.13 - 
  690.14 - /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
  690.15 - 
  690.16 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S
  690.17 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:18:12.000000000 +0100
  690.18 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:16:52.000000000 +0100
  690.19 -@@ -3,9 +3,9 @@
  690.20 - /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
  690.21 - 
  690.22 - #include <features.h>
  690.23 --#include <asm/asm.h>
  690.24 -+#include <sys/asm.h>
  690.25 - #include <asm/unistd.h>
  690.26 --#include <asm/regdef.h>
  690.27 -+#include <sys/regdef.h>
  690.28 - 
  690.29 -         .globl  pipe
  690.30 -         .ent    pipe, 0
  690.31 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S
  690.32 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:18:12.000000000 +0100
  690.33 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:17:03.000000000 +0100
  690.34 -@@ -17,8 +17,8 @@
  690.35 -    02111-1307 USA.  */
  690.36 - 
  690.37 - #include <features.h>
  690.38 --#include <asm/asm.h>
  690.39 --#include <asm/regdef.h>
  690.40 -+#include <sys/asm.h>
  690.41 -+#include <sys/regdef.h>
  690.42 - 
  690.43 - #ifdef __PIC__
  690.44 - 	.option pic2
   691.1 --- a/patches/uClibc/0.9.28.2/000-string-functions.patch	Mon Jul 28 21:08:01 2008 +0000
   691.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   691.3 @@ -1,14 +0,0 @@
   691.4 -Give preference to target-optimised functions over glibc's ones,
   691.5 -which in turn ahave precedence over generic ones.
   691.6 -
   691.7 ---- uClibc.orig/libc/Makefile	2005-07-20 08:10:44.000000000 +0200
   691.8 -+++ uclibc/libc/Makefile	2005-07-28 13:33:40.000000000 +0200
   691.9 -@@ -59,7 +59,7 @@
  691.10 - 	$(AR) dN 2 $(LIBNAME) $$objs && \
  691.11 - 	$(AR) dN 2 $(LIBNAME) $$objs
  691.12 - 	@for objfile in obj.signal \
  691.13 --	                obj.string.generic obj.string.$(TARGET_ARCH) obj.string \
  691.14 -+	                obj.string obj.string.generic obj.string.$(TARGET_ARCH) \
  691.15 - 	                obj.sysdeps.common obj.sysdeps.$(TARGET_ARCH) ; do \
  691.16 - 		if [ -e $$objfile ] ; then \
  691.17 - 			echo $(AR) $(ARFLAGS) $(LIBNAME) $$objfile ; \
   692.1 --- a/patches/uClibc/0.9.28.2/001-install_dev.patch	Mon Jul 28 21:08:01 2008 +0000
   692.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   692.3 @@ -1,22 +0,0 @@
   692.4 -We know that the kernel headers are in place. Don't try to install them.
   692.5 -
   692.6 -diff -dur uClibc-0.9.28.1.orig/Makefile uClibc-0.9.28.1/Makefile
   692.7 ---- uClibc-0.9.28.1.orig/Makefile	2007-01-28 06:38:00.000000000 +0100
   692.8 -+++ uClibc-0.9.28.1/Makefile	2007-01-28 18:55:46.000000000 +0100
   692.9 -@@ -158,12 +158,10 @@
  692.10 - 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
  692.11 - 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
  692.12 - 	-$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
  692.13 --	if [ "$(KERNEL_SOURCE)" = "$(DEVEL_PREFIX)" ] ; then \
  692.14 --		extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  692.15 --	else \
  692.16 --		extra_exclude="" ; \
  692.17 --	fi ; \
  692.18 --	tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
  692.19 -+	extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  692.20 -+	tar -chf - include --exclude .svn --exclude CVS \
  692.21 -+	                   --exclude include/linux      \
  692.22 -+	                   --exclude include/asm'*'     \
  692.23 - 		| tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
  692.24 - 	echo '/* Dont use _syscall#() macros; use the syscall() function */' > \
  692.25 - 		$(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h
   693.1 --- a/patches/uClibc/0.9.28.2/002-no_LFS-no_readahead.patch	Mon Jul 28 21:08:01 2008 +0000
   693.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   693.3 @@ -1,14 +0,0 @@
   693.4 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile
   693.5 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile	2007-01-26 00:54:19.000000000 +0100
   693.6 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile	2007-02-01 08:44:37.000000000 +0100
   693.7 -@@ -25,6 +25,10 @@
   693.8 - SRCS := $(filter-out sbrk.c,$(SRCS))
   693.9 - endif
  693.10 - 
  693.11 -+ifneq ($(strip $(UCLIBC_HAS_LFS)),y)
  693.12 -+SRCS := $(filter-out readahead.c,$(SRCS))
  693.13 -+endif
  693.14 -+
  693.15 - ifneq ($(strip $(UCLIBC_HAS_SSP)),y)
  693.16 - SRCS := $(filter-out ssp.c,$(SRCS))
  693.17 - endif
   694.1 --- a/patches/uClibc/0.9.28.2/004-ctype.patch	Mon Jul 28 21:08:01 2008 +0000
   694.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   694.3 @@ -1,17 +0,0 @@
   694.4 -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   694.5 ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   694.6 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   694.7 -@@ -34,11 +34,11 @@
   694.8 -
   694.9 - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  694.10 -
  694.11 --typedef __uint16_t __ctype_mask_t;
  694.12 -+typedef __uint32_t __ctype_mask_t;
  694.13 -
  694.14 - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  694.15 -
  694.16 --typedef __int16_t __ctype_touplow_t;
  694.17 -+typedef __int32_t __ctype_touplow_t;
  694.18 - #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  694.19 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  694.20 -
   695.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   695.2 +++ b/patches/uClibc/0.9.28.2/100-string-functions.patch	Mon Jul 28 21:32:33 2008 +0000
   695.3 @@ -0,0 +1,14 @@
   695.4 +Give preference to target-optimised functions over glibc's ones,
   695.5 +which in turn ahave precedence over generic ones.
   695.6 +
   695.7 +--- uClibc.orig/libc/Makefile	2005-07-20 08:10:44.000000000 +0200
   695.8 ++++ uclibc/libc/Makefile	2005-07-28 13:33:40.000000000 +0200
   695.9 +@@ -59,7 +59,7 @@
  695.10 + 	$(AR) dN 2 $(LIBNAME) $$objs && \
  695.11 + 	$(AR) dN 2 $(LIBNAME) $$objs
  695.12 + 	@for objfile in obj.signal \
  695.13 +-	                obj.string.generic obj.string.$(TARGET_ARCH) obj.string \
  695.14 ++	                obj.string obj.string.generic obj.string.$(TARGET_ARCH) \
  695.15 + 	                obj.sysdeps.common obj.sysdeps.$(TARGET_ARCH) ; do \
  695.16 + 		if [ -e $$objfile ] ; then \
  695.17 + 			echo $(AR) $(ARFLAGS) $(LIBNAME) $$objfile ; \
   696.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   696.2 +++ b/patches/uClibc/0.9.28.2/110-install_dev.patch	Mon Jul 28 21:32:33 2008 +0000
   696.3 @@ -0,0 +1,22 @@
   696.4 +We know that the kernel headers are in place. Don't try to install them.
   696.5 +
   696.6 +diff -dur uClibc-0.9.28.1.orig/Makefile uClibc-0.9.28.1/Makefile
   696.7 +--- uClibc-0.9.28.1.orig/Makefile	2007-01-28 06:38:00.000000000 +0100
   696.8 ++++ uClibc-0.9.28.1/Makefile	2007-01-28 18:55:46.000000000 +0100
   696.9 +@@ -158,12 +158,10 @@
  696.10 + 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
  696.11 + 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
  696.12 + 	-$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
  696.13 +-	if [ "$(KERNEL_SOURCE)" = "$(DEVEL_PREFIX)" ] ; then \
  696.14 +-		extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  696.15 +-	else \
  696.16 +-		extra_exclude="" ; \
  696.17 +-	fi ; \
  696.18 +-	tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
  696.19 ++	extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  696.20 ++	tar -chf - include --exclude .svn --exclude CVS \
  696.21 ++	                   --exclude include/linux      \
  696.22 ++	                   --exclude include/asm'*'     \
  696.23 + 		| tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
  696.24 + 	echo '/* Dont use _syscall#() macros; use the syscall() function */' > \
  696.25 + 		$(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h
   697.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   697.2 +++ b/patches/uClibc/0.9.28.2/120-no_LFS-no_readahead.patch	Mon Jul 28 21:32:33 2008 +0000
   697.3 @@ -0,0 +1,14 @@
   697.4 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile
   697.5 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile	2007-01-26 00:54:19.000000000 +0100
   697.6 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile	2007-02-01 08:44:37.000000000 +0100
   697.7 +@@ -25,6 +25,10 @@
   697.8 + SRCS := $(filter-out sbrk.c,$(SRCS))
   697.9 + endif
  697.10 + 
  697.11 ++ifneq ($(strip $(UCLIBC_HAS_LFS)),y)
  697.12 ++SRCS := $(filter-out readahead.c,$(SRCS))
  697.13 ++endif
  697.14 ++
  697.15 + ifneq ($(strip $(UCLIBC_HAS_SSP)),y)
  697.16 + SRCS := $(filter-out ssp.c,$(SRCS))
  697.17 + endif
   698.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   698.2 +++ b/patches/uClibc/0.9.28.2/130-ctype.patch	Mon Jul 28 21:32:33 2008 +0000
   698.3 @@ -0,0 +1,17 @@
   698.4 +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   698.5 +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   698.6 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   698.7 +@@ -34,11 +34,11 @@
   698.8 +
   698.9 + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  698.10 +
  698.11 +-typedef __uint16_t __ctype_mask_t;
  698.12 ++typedef __uint32_t __ctype_mask_t;
  698.13 +
  698.14 + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  698.15 +
  698.16 +-typedef __int16_t __ctype_touplow_t;
  698.17 ++typedef __int32_t __ctype_touplow_t;
  698.18 + #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  698.19 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  698.20 +
   699.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   699.2 +++ b/patches/uClibc/0.9.28.2/140-custom-ISA.patch	Mon Jul 28 21:32:33 2008 +0000
   699.3 @@ -0,0 +1,31 @@
   699.4 +diff -dur uClibc-0.9.28.orig/Rules.mak uClibc-0.9.28/Rules.mak
   699.5 +--- uClibc-0.9.28.orig/Rules.mak	2005-08-18 00:49:49.000000000 +0200
   699.6 ++++ uClibc-0.9.28/Rules.mak	2007-01-30 10:53:34.000000000 +0100
   699.7 +@@ -168,6 +168,7 @@
   699.8 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
   699.9 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
  699.10 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
  699.11 ++	CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
  699.12 + endif
  699.13 + 
  699.14 + ifeq ($(strip $(TARGET_ARCH)),sh)
  699.15 +diff -dur uClibc-0.9.28.orig/extra/Configs/Config.mips uClibc-0.9.28/extra/Configs/Config.mips
  699.16 +--- uClibc-0.9.28.orig/extra/Configs/Config.mips	2005-08-18 00:49:41.000000000 +0200
  699.17 ++++ uClibc-0.9.28/extra/Configs/Config.mips	2007-01-30 10:52:12.000000000 +0100
  699.18 +@@ -63,4 +63,16 @@
  699.19 + config CONFIG_MIPS_ISA_MIPS64
  699.20 + 	bool "MIPS64"
  699.21 + 
  699.22 ++config CONFIG_MIPS_ISA_CUSTOM
  699.23 ++	bool "Custom"
  699.24 ++
  699.25 + endchoice
  699.26 ++
  699.27 ++config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
  699.28 ++	string
  699.29 ++	prompt "Custon ISA"
  699.30 ++	depends on CONFIG_MIPS_ISA_CUSTOM
  699.31 ++	default ""
  699.32 ++	help
  699.33 ++	  Enter your custom ISA here (eg: lx4189!).
  699.34 ++
   700.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   700.2 +++ b/patches/uClibc/0.9.28.2/150-mips-asm.h.patch	Mon Jul 28 21:32:33 2008 +0000
   700.3 @@ -0,0 +1,41 @@
   700.4 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S
   700.5 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S	2007-02-07 11:18:12.000000000 +0100
   700.6 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S	2007-02-07 10:41:34.000000000 +0100
   700.7 +@@ -24,7 +24,7 @@
   700.8 + #include <sys/regdef.h>
   700.9 + #define _ERRNO_H	1
  700.10 + #include <bits/errno.h>
  700.11 +-#include <asm/asm.h>
  700.12 ++#include <sys/asm.h>
  700.13 + 
  700.14 + /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
  700.15 + 
  700.16 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S
  700.17 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:18:12.000000000 +0100
  700.18 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:16:52.000000000 +0100
  700.19 +@@ -3,9 +3,9 @@
  700.20 + /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
  700.21 + 
  700.22 + #include <features.h>
  700.23 +-#include <asm/asm.h>
  700.24 ++#include <sys/asm.h>
  700.25 + #include <asm/unistd.h>
  700.26 +-#include <asm/regdef.h>
  700.27 ++#include <sys/regdef.h>
  700.28 + 
  700.29 +         .globl  pipe
  700.30 +         .ent    pipe, 0
  700.31 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S
  700.32 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:18:12.000000000 +0100
  700.33 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:17:03.000000000 +0100
  700.34 +@@ -17,8 +17,8 @@
  700.35 +    02111-1307 USA.  */
  700.36 + 
  700.37 + #include <features.h>
  700.38 +-#include <asm/asm.h>
  700.39 +-#include <asm/regdef.h>
  700.40 ++#include <sys/asm.h>
  700.41 ++#include <sys/regdef.h>
  700.42 + 
  700.43 + #ifdef __PIC__
  700.44 + 	.option pic2
   701.1 --- a/patches/uClibc/0.9.28.2/200-custom-ISA.patch	Mon Jul 28 21:08:01 2008 +0000
   701.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   701.3 @@ -1,31 +0,0 @@
   701.4 -diff -dur uClibc-0.9.28.orig/Rules.mak uClibc-0.9.28/Rules.mak
   701.5 ---- uClibc-0.9.28.orig/Rules.mak	2005-08-18 00:49:49.000000000 +0200
   701.6 -+++ uClibc-0.9.28/Rules.mak	2007-01-30 10:53:34.000000000 +0100
   701.7 -@@ -168,6 +168,7 @@
   701.8 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
   701.9 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
  701.10 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
  701.11 -+	CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
  701.12 - endif
  701.13 - 
  701.14 - ifeq ($(strip $(TARGET_ARCH)),sh)
  701.15 -diff -dur uClibc-0.9.28.orig/extra/Configs/Config.mips uClibc-0.9.28/extra/Configs/Config.mips
  701.16 ---- uClibc-0.9.28.orig/extra/Configs/Config.mips	2005-08-18 00:49:41.000000000 +0200
  701.17 -+++ uClibc-0.9.28/extra/Configs/Config.mips	2007-01-30 10:52:12.000000000 +0100
  701.18 -@@ -63,4 +63,16 @@
  701.19 - config CONFIG_MIPS_ISA_MIPS64
  701.20 - 	bool "MIPS64"
  701.21 - 
  701.22 -+config CONFIG_MIPS_ISA_CUSTOM
  701.23 -+	bool "Custom"
  701.24 -+
  701.25 - endchoice
  701.26 -+
  701.27 -+config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
  701.28 -+	string
  701.29 -+	prompt "Custon ISA"
  701.30 -+	depends on CONFIG_MIPS_ISA_CUSTOM
  701.31 -+	default ""
  701.32 -+	help
  701.33 -+	  Enter your custom ISA here (eg: lx4189!).
  701.34 -+
   702.1 --- a/patches/uClibc/0.9.28.2/201-mips-asm.h.patch	Mon Jul 28 21:08:01 2008 +0000
   702.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   702.3 @@ -1,41 +0,0 @@
   702.4 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S
   702.5 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S	2007-02-07 11:18:12.000000000 +0100
   702.6 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S	2007-02-07 10:41:34.000000000 +0100
   702.7 -@@ -24,7 +24,7 @@
   702.8 - #include <sys/regdef.h>
   702.9 - #define _ERRNO_H	1
  702.10 - #include <bits/errno.h>
  702.11 --#include <asm/asm.h>
  702.12 -+#include <sys/asm.h>
  702.13 - 
  702.14 - /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
  702.15 - 
  702.16 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S
  702.17 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:18:12.000000000 +0100
  702.18 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:16:52.000000000 +0100
  702.19 -@@ -3,9 +3,9 @@
  702.20 - /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
  702.21 - 
  702.22 - #include <features.h>
  702.23 --#include <asm/asm.h>
  702.24 -+#include <sys/asm.h>
  702.25 - #include <asm/unistd.h>
  702.26 --#include <asm/regdef.h>
  702.27 -+#include <sys/regdef.h>
  702.28 - 
  702.29 -         .globl  pipe
  702.30 -         .ent    pipe, 0
  702.31 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S
  702.32 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:18:12.000000000 +0100
  702.33 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:17:03.000000000 +0100
  702.34 -@@ -17,8 +17,8 @@
  702.35 -    02111-1307 USA.  */
  702.36 - 
  702.37 - #include <features.h>
  702.38 --#include <asm/asm.h>
  702.39 --#include <asm/regdef.h>
  702.40 -+#include <sys/asm.h>
  702.41 -+#include <sys/regdef.h>
  702.42 - 
  702.43 - #ifdef __PIC__
  702.44 - 	.option pic2
   703.1 --- a/patches/uClibc/0.9.28.3/000-string-functions.patch	Mon Jul 28 21:08:01 2008 +0000
   703.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   703.3 @@ -1,14 +0,0 @@
   703.4 -Give preference to target-optimised functions over glibc's ones,
   703.5 -which in turn ahave precedence over generic ones.
   703.6 -
   703.7 ---- uClibc.orig/libc/Makefile	2005-07-20 08:10:44.000000000 +0200
   703.8 -+++ uclibc/libc/Makefile	2005-07-28 13:33:40.000000000 +0200
   703.9 -@@ -59,7 +59,7 @@
  703.10 - 	$(AR) dN 2 $(LIBNAME) $$objs && \
  703.11 - 	$(AR) dN 2 $(LIBNAME) $$objs
  703.12 - 	@for objfile in obj.signal \
  703.13 --	                obj.string.generic obj.string.$(TARGET_ARCH) obj.string \
  703.14 -+	                obj.string obj.string.generic obj.string.$(TARGET_ARCH) \
  703.15 - 	                obj.sysdeps.common obj.sysdeps.$(TARGET_ARCH) ; do \
  703.16 - 		if [ -e $$objfile ] ; then \
  703.17 - 			echo $(AR) $(ARFLAGS) $(LIBNAME) $$objfile ; \
   704.1 --- a/patches/uClibc/0.9.28.3/001-install_dev.patch	Mon Jul 28 21:08:01 2008 +0000
   704.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   704.3 @@ -1,22 +0,0 @@
   704.4 -We know that the kernel headers are in place. Don't try to install them.
   704.5 -
   704.6 -diff -dur uClibc-0.9.28.1.orig/Makefile uClibc-0.9.28.1/Makefile
   704.7 ---- uClibc-0.9.28.1.orig/Makefile	2007-01-28 06:38:00.000000000 +0100
   704.8 -+++ uClibc-0.9.28.1/Makefile	2007-01-28 18:55:46.000000000 +0100
   704.9 -@@ -158,12 +158,10 @@
  704.10 - 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
  704.11 - 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
  704.12 - 	-$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
  704.13 --	if [ "$(KERNEL_SOURCE)" = "$(DEVEL_PREFIX)" ] ; then \
  704.14 --		extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  704.15 --	else \
  704.16 --		extra_exclude="" ; \
  704.17 --	fi ; \
  704.18 --	tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
  704.19 -+	extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  704.20 -+	tar -chf - include --exclude .svn --exclude CVS \
  704.21 -+	                   --exclude include/linux      \
  704.22 -+	                   --exclude include/asm'*'     \
  704.23 - 		| tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
  704.24 - 	echo '/* Dont use _syscall#() macros; use the syscall() function */' > \
  704.25 - 		$(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h
   705.1 --- a/patches/uClibc/0.9.28.3/002-no_LFS-no_readahead.patch	Mon Jul 28 21:08:01 2008 +0000
   705.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   705.3 @@ -1,14 +0,0 @@
   705.4 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile
   705.5 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile	2007-01-26 00:54:19.000000000 +0100
   705.6 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile	2007-02-01 08:44:37.000000000 +0100
   705.7 -@@ -25,6 +25,10 @@
   705.8 - SRCS := $(filter-out sbrk.c,$(SRCS))
   705.9 - endif
  705.10 - 
  705.11 -+ifneq ($(strip $(UCLIBC_HAS_LFS)),y)
  705.12 -+SRCS := $(filter-out readahead.c,$(SRCS))
  705.13 -+endif
  705.14 -+
  705.15 - ifneq ($(strip $(UCLIBC_HAS_SSP)),y)
  705.16 - SRCS := $(filter-out ssp.c,$(SRCS))
  705.17 - endif
   706.1 --- a/patches/uClibc/0.9.28.3/004-ctype.patch	Mon Jul 28 21:08:01 2008 +0000
   706.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   706.3 @@ -1,17 +0,0 @@
   706.4 -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   706.5 ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   706.6 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   706.7 -@@ -34,11 +34,11 @@
   706.8 -
   706.9 - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  706.10 -
  706.11 --typedef __uint16_t __ctype_mask_t;
  706.12 -+typedef __uint32_t __ctype_mask_t;
  706.13 -
  706.14 - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  706.15 -
  706.16 --typedef __int16_t __ctype_touplow_t;
  706.17 -+typedef __int32_t __ctype_touplow_t;
  706.18 - #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  706.19 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  706.20 -
   707.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   707.2 +++ b/patches/uClibc/0.9.28.3/100-string-functions.patch	Mon Jul 28 21:32:33 2008 +0000
   707.3 @@ -0,0 +1,14 @@
   707.4 +Give preference to target-optimised functions over glibc's ones,
   707.5 +which in turn ahave precedence over generic ones.
   707.6 +
   707.7 +--- uClibc.orig/libc/Makefile	2005-07-20 08:10:44.000000000 +0200
   707.8 ++++ uclibc/libc/Makefile	2005-07-28 13:33:40.000000000 +0200
   707.9 +@@ -59,7 +59,7 @@
  707.10 + 	$(AR) dN 2 $(LIBNAME) $$objs && \
  707.11 + 	$(AR) dN 2 $(LIBNAME) $$objs
  707.12 + 	@for objfile in obj.signal \
  707.13 +-	                obj.string.generic obj.string.$(TARGET_ARCH) obj.string \
  707.14 ++	                obj.string obj.string.generic obj.string.$(TARGET_ARCH) \
  707.15 + 	                obj.sysdeps.common obj.sysdeps.$(TARGET_ARCH) ; do \
  707.16 + 		if [ -e $$objfile ] ; then \
  707.17 + 			echo $(AR) $(ARFLAGS) $(LIBNAME) $$objfile ; \
   708.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   708.2 +++ b/patches/uClibc/0.9.28.3/110-install_dev.patch	Mon Jul 28 21:32:33 2008 +0000
   708.3 @@ -0,0 +1,22 @@
   708.4 +We know that the kernel headers are in place. Don't try to install them.
   708.5 +
   708.6 +diff -dur uClibc-0.9.28.1.orig/Makefile uClibc-0.9.28.1/Makefile
   708.7 +--- uClibc-0.9.28.1.orig/Makefile	2007-01-28 06:38:00.000000000 +0100
   708.8 ++++ uClibc-0.9.28.1/Makefile	2007-01-28 18:55:46.000000000 +0100
   708.9 +@@ -158,12 +158,10 @@
  708.10 + 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
  708.11 + 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
  708.12 + 	-$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
  708.13 +-	if [ "$(KERNEL_SOURCE)" = "$(DEVEL_PREFIX)" ] ; then \
  708.14 +-		extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  708.15 +-	else \
  708.16 +-		extra_exclude="" ; \
  708.17 +-	fi ; \
  708.18 +-	tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
  708.19 ++	extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  708.20 ++	tar -chf - include --exclude .svn --exclude CVS \
  708.21 ++	                   --exclude include/linux      \
  708.22 ++	                   --exclude include/asm'*'     \
  708.23 + 		| tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
  708.24 + 	echo '/* Dont use _syscall#() macros; use the syscall() function */' > \
  708.25 + 		$(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h
   709.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   709.2 +++ b/patches/uClibc/0.9.28.3/120-no_LFS-no_readahead.patch	Mon Jul 28 21:32:33 2008 +0000
   709.3 @@ -0,0 +1,14 @@
   709.4 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile
   709.5 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile	2007-01-26 00:54:19.000000000 +0100
   709.6 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile	2007-02-01 08:44:37.000000000 +0100
   709.7 +@@ -25,6 +25,10 @@
   709.8 + SRCS := $(filter-out sbrk.c,$(SRCS))
   709.9 + endif
  709.10 + 
  709.11 ++ifneq ($(strip $(UCLIBC_HAS_LFS)),y)
  709.12 ++SRCS := $(filter-out readahead.c,$(SRCS))
  709.13 ++endif
  709.14 ++
  709.15 + ifneq ($(strip $(UCLIBC_HAS_SSP)),y)
  709.16 + SRCS := $(filter-out ssp.c,$(SRCS))
  709.17 + endif
   710.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   710.2 +++ b/patches/uClibc/0.9.28.3/130-ctype.patch	Mon Jul 28 21:32:33 2008 +0000
   710.3 @@ -0,0 +1,17 @@
   710.4 +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   710.5 +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   710.6 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   710.7 +@@ -34,11 +34,11 @@
   710.8 +
   710.9 + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  710.10 +
  710.11 +-typedef __uint16_t __ctype_mask_t;
  710.12 ++typedef __uint32_t __ctype_mask_t;
  710.13 +
  710.14 + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  710.15 +
  710.16 +-typedef __int16_t __ctype_touplow_t;
  710.17 ++typedef __int32_t __ctype_touplow_t;
  710.18 + #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  710.19 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  710.20 +
   711.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   711.2 +++ b/patches/uClibc/0.9.28.3/140-custom-ISA.patch	Mon Jul 28 21:32:33 2008 +0000
   711.3 @@ -0,0 +1,31 @@
   711.4 +diff -dur uClibc-0.9.28.orig/Rules.mak uClibc-0.9.28/Rules.mak
   711.5 +--- uClibc-0.9.28.orig/Rules.mak	2005-08-18 00:49:49.000000000 +0200
   711.6 ++++ uClibc-0.9.28/Rules.mak	2007-01-30 10:53:34.000000000 +0100
   711.7 +@@ -168,6 +168,7 @@
   711.8 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
   711.9 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
  711.10 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
  711.11 ++	CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
  711.12 + endif
  711.13 + 
  711.14 + ifeq ($(strip $(TARGET_ARCH)),sh)
  711.15 +diff -dur uClibc-0.9.28.orig/extra/Configs/Config.mips uClibc-0.9.28/extra/Configs/Config.mips
  711.16 +--- uClibc-0.9.28.orig/extra/Configs/Config.mips	2005-08-18 00:49:41.000000000 +0200
  711.17 ++++ uClibc-0.9.28/extra/Configs/Config.mips	2007-01-30 10:52:12.000000000 +0100
  711.18 +@@ -63,4 +63,16 @@
  711.19 + config CONFIG_MIPS_ISA_MIPS64
  711.20 + 	bool "MIPS64"
  711.21 + 
  711.22 ++config CONFIG_MIPS_ISA_CUSTOM
  711.23 ++	bool "Custom"
  711.24 ++
  711.25 + endchoice
  711.26 ++
  711.27 ++config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
  711.28 ++	string
  711.29 ++	prompt "Custon ISA"
  711.30 ++	depends on CONFIG_MIPS_ISA_CUSTOM
  711.31 ++	default ""
  711.32 ++	help
  711.33 ++	  Enter your custom ISA here (eg: lx4189!).
  711.34 ++
   712.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   712.2 +++ b/patches/uClibc/0.9.28.3/150-mips-asm.h.patch	Mon Jul 28 21:32:33 2008 +0000
   712.3 @@ -0,0 +1,41 @@
   712.4 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S
   712.5 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S	2007-02-07 11:18:12.000000000 +0100
   712.6 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S	2007-02-07 10:41:34.000000000 +0100
   712.7 +@@ -24,7 +24,7 @@
   712.8 + #include <sys/regdef.h>
   712.9 + #define _ERRNO_H	1
  712.10 + #include <bits/errno.h>
  712.11 +-#include <asm/asm.h>
  712.12 ++#include <sys/asm.h>
  712.13 + 
  712.14 + /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
  712.15 + 
  712.16 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S
  712.17 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:18:12.000000000 +0100
  712.18 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:16:52.000000000 +0100
  712.19 +@@ -3,9 +3,9 @@
  712.20 + /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
  712.21 + 
  712.22 + #include <features.h>
  712.23 +-#include <asm/asm.h>
  712.24 ++#include <sys/asm.h>
  712.25 + #include <asm/unistd.h>
  712.26 +-#include <asm/regdef.h>
  712.27 ++#include <sys/regdef.h>
  712.28 + 
  712.29 +         .globl  pipe
  712.30 +         .ent    pipe, 0
  712.31 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S
  712.32 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:18:12.000000000 +0100
  712.33 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:17:03.000000000 +0100
  712.34 +@@ -17,8 +17,8 @@
  712.35 +    02111-1307 USA.  */
  712.36 + 
  712.37 + #include <features.h>
  712.38 +-#include <asm/asm.h>
  712.39 +-#include <asm/regdef.h>
  712.40 ++#include <sys/asm.h>
  712.41 ++#include <sys/regdef.h>
  712.42 + 
  712.43 + #ifdef __PIC__
  712.44 + 	.option pic2
   713.1 --- a/patches/uClibc/0.9.28.3/200-custom-ISA.patch	Mon Jul 28 21:08:01 2008 +0000
   713.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   713.3 @@ -1,31 +0,0 @@
   713.4 -diff -dur uClibc-0.9.28.orig/Rules.mak uClibc-0.9.28/Rules.mak
   713.5 ---- uClibc-0.9.28.orig/Rules.mak	2005-08-18 00:49:49.000000000 +0200
   713.6 -+++ uClibc-0.9.28/Rules.mak	2007-01-30 10:53:34.000000000 +0100
   713.7 -@@ -168,6 +168,7 @@
   713.8 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
   713.9 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
  713.10 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
  713.11 -+	CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
  713.12 - endif
  713.13 - 
  713.14 - ifeq ($(strip $(TARGET_ARCH)),sh)
  713.15 -diff -dur uClibc-0.9.28.orig/extra/Configs/Config.mips uClibc-0.9.28/extra/Configs/Config.mips
  713.16 ---- uClibc-0.9.28.orig/extra/Configs/Config.mips	2005-08-18 00:49:41.000000000 +0200
  713.17 -+++ uClibc-0.9.28/extra/Configs/Config.mips	2007-01-30 10:52:12.000000000 +0100
  713.18 -@@ -63,4 +63,16 @@
  713.19 - config CONFIG_MIPS_ISA_MIPS64
  713.20 - 	bool "MIPS64"
  713.21 - 
  713.22 -+config CONFIG_MIPS_ISA_CUSTOM
  713.23 -+	bool "Custom"
  713.24 -+
  713.25 - endchoice
  713.26 -+
  713.27 -+config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
  713.28 -+	string
  713.29 -+	prompt "Custon ISA"
  713.30 -+	depends on CONFIG_MIPS_ISA_CUSTOM
  713.31 -+	default ""
  713.32 -+	help
  713.33 -+	  Enter your custom ISA here (eg: lx4189!).
  713.34 -+
   714.1 --- a/patches/uClibc/0.9.28.3/201-mips-asm.h.patch	Mon Jul 28 21:08:01 2008 +0000
   714.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   714.3 @@ -1,41 +0,0 @@
   714.4 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S
   714.5 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S	2007-02-07 11:18:12.000000000 +0100
   714.6 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S	2007-02-07 10:41:34.000000000 +0100
   714.7 -@@ -24,7 +24,7 @@
   714.8 - #include <sys/regdef.h>
   714.9 - #define _ERRNO_H	1
  714.10 - #include <bits/errno.h>
  714.11 --#include <asm/asm.h>
  714.12 -+#include <sys/asm.h>
  714.13 - 
  714.14 - /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
  714.15 - 
  714.16 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S
  714.17 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:18:12.000000000 +0100
  714.18 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:16:52.000000000 +0100
  714.19 -@@ -3,9 +3,9 @@
  714.20 - /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
  714.21 - 
  714.22 - #include <features.h>
  714.23 --#include <asm/asm.h>
  714.24 -+#include <sys/asm.h>
  714.25 - #include <asm/unistd.h>
  714.26 --#include <asm/regdef.h>
  714.27 -+#include <sys/regdef.h>
  714.28 - 
  714.29 -         .globl  pipe
  714.30 -         .ent    pipe, 0
  714.31 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S
  714.32 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:18:12.000000000 +0100
  714.33 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:17:03.000000000 +0100
  714.34 -@@ -17,8 +17,8 @@
  714.35 -    02111-1307 USA.  */
  714.36 - 
  714.37 - #include <features.h>
  714.38 --#include <asm/asm.h>
  714.39 --#include <asm/regdef.h>
  714.40 -+#include <sys/asm.h>
  714.41 -+#include <sys/regdef.h>
  714.42 - 
  714.43 - #ifdef __PIC__
  714.44 - 	.option pic2
   715.1 --- a/patches/uClibc/0.9.28/000-string-functions.patch	Mon Jul 28 21:08:01 2008 +0000
   715.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   715.3 @@ -1,11 +0,0 @@
   715.4 ---- uClibc.orig/libc/Makefile	2005-07-20 08:10:44.000000000 +0200
   715.5 -+++ uclibc/libc/Makefile	2005-07-28 13:33:40.000000000 +0200
   715.6 -@@ -59,7 +59,7 @@
   715.7 - 	$(AR) dN 2 $(LIBNAME) $$objs && \
   715.8 - 	$(AR) dN 2 $(LIBNAME) $$objs
   715.9 - 	@for objfile in obj.signal \
  715.10 --	                obj.string.generic obj.string.$(TARGET_ARCH) obj.string \
  715.11 -+	                obj.string obj.string.generic obj.string.$(TARGET_ARCH) \
  715.12 - 	                obj.sysdeps.common obj.sysdeps.$(TARGET_ARCH) ; do \
  715.13 - 		if [ -e $$objfile ] ; then \
  715.14 - 			echo $(AR) $(ARFLAGS) $(LIBNAME) $$objfile ; \
   716.1 --- a/patches/uClibc/0.9.28/001-install_dev.patch	Mon Jul 28 21:08:01 2008 +0000
   716.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   716.3 @@ -1,39 +0,0 @@
   716.4 -There are at least three weird glitches in the Makefile:
   716.5 - - the test operator is a dual-equal sign (==) when it should be a single one (=);
   716.6 - - the exclude options are not accepted as is by GNU tar;
   716.7 - - how on earth could KERNEL_SOURCE possibly be equal to DEVEL_PREFIX ???
   716.8 -
   716.9 -We (Cedric DUVAL and I, Yann E. MORIN) are not quite sure why it is that way.
  716.10 -We're not quite sure either on how to solve this.
  716.11 -
  716.12 -What we need is to built a toolchain; in no way we need to install the linux headers.
  716.13 -  ==> systematically exclude them from the [s]tar command.
  716.14 -
  716.15 -This patch is inspired by the svn repository of uClibc as of 20060209.
  716.16 -diff -dur /home/ymorin/dev/uClibc-0.9.28/Makefile uClibc-0.9.28/Makefile
  716.17 ---- /home/ymorin/dev/uClibc-0.9.28/Makefile	2005-08-18 00:49:49.000000000 +0200
  716.18 -+++ uClibc-0.9.28/Makefile	2006-02-09 17:06:58.000000000 +0100
  716.19 -@@ -158,12 +158,17 @@
  716.20 - 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
  716.21 - 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
  716.22 - 	-$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
  716.23 --	if [ "$(KERNEL_SOURCE)" == "$(DEVEL_PREFIX)" ] ; then \
  716.24 --		extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  716.25 --	else \
  716.26 --		extra_exclude="" ; \
  716.27 --	fi ; \
  716.28 --	tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
  716.29 -+#	if [ "$(KERNEL_SOURCE)" == "$(DEVEL_PREFIX)" ] ; then \
  716.30 -+#		extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  716.31 -+#	else \
  716.32 -+#		extra_exclude="" ; \
  716.33 -+#	fi ; \
  716.34 -+#	tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
  716.35 -+#		| tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
  716.36 -+	printf ".svn\n.cvsignore\nCVS\n" > tar_exclude ; \
  716.37 -+	ls -1d include/linux include/asm* >> tar_exclude ; \
  716.38 -+	tar -chf - -X tar_exclude include \
  716.39 - 		| tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
  716.40 -+	rm -f tar_exclude
  716.41 - ifneq ($(strip $(UCLIBC_HAS_FLOATS)),y)
  716.42 - 	# Remove floating point related headers since float support is disabled.
   717.1 --- a/patches/uClibc/0.9.28/002-no_LFS-no_readahead.patch	Mon Jul 28 21:08:01 2008 +0000
   717.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   717.3 @@ -1,14 +0,0 @@
   717.4 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile
   717.5 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile	2007-01-26 00:54:19.000000000 +0100
   717.6 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile	2007-02-01 08:44:37.000000000 +0100
   717.7 -@@ -25,6 +25,10 @@
   717.8 - SRCS := $(filter-out sbrk.c,$(SRCS))
   717.9 - endif
  717.10 - 
  717.11 -+ifneq ($(strip $(UCLIBC_HAS_LFS)),y)
  717.12 -+SRCS := $(filter-out readahead.c,$(SRCS))
  717.13 -+endif
  717.14 -+
  717.15 - ifneq ($(strip $(UCLIBC_HAS_SSP)),y)
  717.16 - SRCS := $(filter-out ssp.c,$(SRCS))
  717.17 - endif
   718.1 --- a/patches/uClibc/0.9.28/004-ctype.patch	Mon Jul 28 21:08:01 2008 +0000
   718.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   718.3 @@ -1,17 +0,0 @@
   718.4 -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   718.5 ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   718.6 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   718.7 -@@ -34,11 +34,11 @@
   718.8 -
   718.9 - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  718.10 -
  718.11 --typedef __uint16_t __ctype_mask_t;
  718.12 -+typedef __uint32_t __ctype_mask_t;
  718.13 -
  718.14 - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  718.15 -
  718.16 --typedef __int16_t __ctype_touplow_t;
  718.17 -+typedef __int32_t __ctype_touplow_t;
  718.18 - #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  718.19 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  718.20 -
   719.1 --- a/patches/uClibc/0.9.28/005-fix_includes.sh.patch	Mon Jul 28 21:08:01 2008 +0000
   719.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   719.3 @@ -1,316 +0,0 @@
   719.4 ---- uClibc-0.9.28/extra/scripts/fix_includes.sh.orig	2006-12-13 05:44:21.000000000 -0700
   719.5 -+++ uClibc-0.9.28/extra/scripts/fix_includes.sh	2006-12-13 05:44:35.000000000 -0700
   719.6 -@@ -1,183 +1,155 @@
   719.7 - #!/bin/sh
   719.8 --# Copyright (C) 2003 Erik Andersen <andersen@uclibc.org>
   719.9 - #
  719.10 --# This program is free software; you can redistribute it and/or
  719.11 --# modify it under the terms of the GNU Library General Public
  719.12 --# License as published by the Free Software Foundation; either
  719.13 --# version 2 of the License, or (at your option) any later
  719.14 --# version.
  719.15 --#
  719.16 --# This program is distributed in the hope that it will be useful,
  719.17 --# but WITHOUT ANY WARRANTY; without even the implied warranty of
  719.18 --# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  719.19 --# GNU Library General Public License for more details.
  719.20 --#
  719.21 --# You should have received a copy of the GNU Library General
  719.22 --# Public License along with this program; if not, write to the
  719.23 --# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  719.24 --# Boston, MA 02111-1307 USA
  719.25 --
  719.26 --usage () {
  719.27 --    echo ""
  719.28 --    echo "usage: "`basename $0`" -k KERNEL_SOURCE_DIRECTORY -t TARGET_ARCH"
  719.29 --    echo ""
  719.30 --    echo "This utility scans the KERNEL_SOURCE_DIRECTORY directory and"
  719.31 --    echo "checks that it contains well formed kernel headers suitable"
  719.32 --    echo "for inclusion as the include/linux/ directory provided by"
  719.33 --    echo "uClibc."
  719.34 --    echo ""
  719.35 --    echo "If the specified kernel headers are present and already"
  719.36 --    echo "configured for the architecture specified by TARGET_ARCH,"
  719.37 --    echo "they will be used as-is."
  719.38 --    echo ""
  719.39 --    echo "If the specified kernel headers are missing entirely, this"
  719.40 --    echo "script will return an error."
  719.41 --    echo ""
  719.42 --    echo "If the specified kernel headers are present, but are either"
  719.43 --    echo "not yet configured or are configured for an architecture"
  719.44 --    echo "different than that specified by TARGET_ARCH, this script"
  719.45 --    echo "will attempt to 'fix' the kernel headers and make them"
  719.46 --    echo "suitable for use by uClibc.  This fixing process may fail."
  719.47 --    echo "It is therefore best to always provide kernel headers that"
  719.48 --    echo "are already configured for the selected architecture."
  719.49 --    echo ""
  719.50 --    echo "Most Linux distributions provide 'kernel-headers' packages"
  719.51 --    echo "that are suitable for use by uClibc."
  719.52 --    echo ""
  719.53 --    echo ""
  719.54 --    exit 1;
  719.55 -+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  719.56 -+#
  719.57 -+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  719.58 -+#
  719.59 -+
  719.60 -+usage() {
  719.61 -+	echo ""
  719.62 -+	echo "usage: "`basename $0`" -k KERNEL_SOURCE_DIRECTORY -t TARGET_ARCH"
  719.63 -+	echo ""
  719.64 -+	echo "This utility scans the KERNEL_SOURCE_DIRECTORY directory and"
  719.65 -+	echo "checks that it contains well formed kernel headers suitable"
  719.66 -+	echo "for inclusion as the include/linux/ directory provided by"
  719.67 -+	echo "uClibc."
  719.68 -+	echo ""
  719.69 -+	echo "If the specified kernel headers are present and already"
  719.70 -+	echo "configured for the architecture specified by TARGET_ARCH,"
  719.71 -+	echo "they will be used as-is."
  719.72 -+	echo ""
  719.73 -+	echo "If the specified kernel headers are missing entirely, this"
  719.74 -+	echo "script will return an error."
  719.75 -+	echo ""
  719.76 -+	echo "If the specified kernel headers are present, but are either"
  719.77 -+	echo "not yet configured or are configured for an architecture"
  719.78 -+	echo "different than that specified by TARGET_ARCH, this script"
  719.79 -+	echo "will attempt to 'fix' the kernel headers and make them"
  719.80 -+	echo "suitable for use by uClibc.  This fixing process may fail."
  719.81 -+	echo "It is therefore best to always provide kernel headers that"
  719.82 -+	echo "are already configured for the selected architecture."
  719.83 -+	echo ""
  719.84 -+	echo "Most Linux distributions provide 'kernel-headers' packages"
  719.85 -+	echo "that are suitable for use by uClibc."
  719.86 -+	echo ""
  719.87 -+	echo ""
  719.88 -+	exit 1
  719.89 - }
  719.90 - 
  719.91 --HAS_MMU="y";
  719.92 -+
  719.93 -+#
  719.94 -+# Parse our arguments
  719.95 -+#
  719.96 -+HAS_MMU="y"
  719.97 - while [ -n "$1" ]; do
  719.98 --    case $1 in
  719.99 --	-k ) shift; if [ -n "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
 719.100 --	-t ) shift; if [ -n "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
 719.101 --	-n ) shift; HAS_MMU="n"; ;;
 719.102 --	-* ) usage; ;;
 719.103 --	* ) usage; ;;
 719.104 --    esac;
 719.105 --done;
 719.106 -+	case $1 in
 719.107 -+		-k ) shift; if [ -n "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
 719.108 -+		-t ) shift; if [ -n "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
 719.109 -+		-n ) shift; HAS_MMU="n"; ;;
 719.110 -+		-* ) usage; ;;
 719.111 -+		* ) usage; ;;
 719.112 -+	esac
 719.113 -+done
 719.114 - 
 719.115 --if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
 719.116 --    echo "";
 719.117 --    echo "";
 719.118 --    echo "The file $KERNEL_SOURCE/Makefile or $KERNEL_SOURCE/include/linux/version.h is missing!";
 719.119 --    echo "Perhaps your kernel source is broken?"
 719.120 --    echo "";
 719.121 --    echo "";
 719.122 --    exit 1;
 719.123 --fi;
 719.124 - 
 719.125 --if [ ! -d "$KERNEL_SOURCE" ]; then
 719.126 --    echo "";
 719.127 --    echo "";
 719.128 --    echo "$KERNEL_SOURCE is not a directory";
 719.129 --    echo "";
 719.130 --    echo "";
 719.131 --    exit 1;
 719.132 --fi;
 719.133 --
 719.134 --if [ -f "$KERNEL_SOURCE/Makefile" ] ; then
 719.135 --# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION
 719.136 --eval `sed -n -e 's/^\([A-Z]*\) = \([0-9]*\)$/\1=\2/p' -e 's/^\([A-Z]*\) = \(-[-a-z0-9]*\)$/\1=\2/p' $KERNEL_SOURCE/Makefile`
 719.137 --else
 719.138 --ver=`grep UTS_RELEASE $KERNEL_SOURCE/include/linux/version.h | cut -d '"' -f 2`
 719.139 --VERSION=`echo "$ver" | cut -d '.' -f 1`
 719.140 --PATCHLEVEL=`echo "$ver" | cut -d '.' -f 2`
 719.141 --if echo "$ver" | grep -q '-' ; then
 719.142 --SUBLEVEL=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.//" | cut -d '-' -f 1`
 719.143 --EXTRAVERSION=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.${SUBLEVEL}-//"`
 719.144 --else
 719.145 --SUBLEVEL=`echo "$ver" | cut -d '.' -f 3`
 719.146 --#EXTRAVERSION=
 719.147 --fi
 719.148 -+#
 719.149 -+# Perform some sanity checks on our kernel sources
 719.150 -+#
 719.151 -+if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
 719.152 -+	echo ""
 719.153 -+	echo ""
 719.154 -+	echo "The file $KERNEL_SOURCE/Makefile or $KERNEL_SOURCE/include/linux/version.h is missing!"
 719.155 -+	echo "Perhaps your kernel source is broken?"
 719.156 -+	echo ""
 719.157 -+	echo ""
 719.158 -+	exit 1
 719.159 - fi
 719.160 --if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]
 719.161 --then
 719.162 --    echo "Unable to determine version for kernel headers"
 719.163 --    echo -e "\tprovided in directory $KERNEL_SOURCE"
 719.164 --    exit 1
 719.165 -+if [ ! -d "$KERNEL_SOURCE" ]; then
 719.166 -+	echo ""
 719.167 -+	echo ""
 719.168 -+	echo "$KERNEL_SOURCE is not a directory"
 719.169 -+	echo ""
 719.170 -+	echo ""
 719.171 -+	exit 1
 719.172 - fi
 719.173 - 
 719.174 --if [ "$MAKE_IS_SILENT" != "y" ]; then
 719.175 --echo "Current kernel version is $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION}"
 719.176 --echo -e "\n"
 719.177 --echo "Using kernel headers from $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION} for architecture '$TARGET_ARCH'"
 719.178 --echo -e "\tprovided in directory $KERNEL_SOURCE"
 719.179 --echo -e "\n"
 719.180 --fi
 719.181 - 
 719.182 -+#
 719.183 - # Create a symlink to include/asm
 719.184 --
 719.185 -+#
 719.186 - rm -f include/asm*
 719.187 - if [ ! -d "$KERNEL_SOURCE/include/asm" ]; then
 719.188 --    echo "";
 719.189 --    echo "";
 719.190 --    echo "The symlink $KERNEL_SOURCE/include/asm is missing\!";
 719.191 --    echo "Perhaps you forgot to configure your kernel source?";
 719.192 --    echo "You really should configure your kernel source tree so I";
 719.193 --    echo "do not have to try and guess about this sort of thing.";
 719.194 --    echo ""
 719.195 --    echo "Attempting to guess a usable value....";
 719.196 --    echo ""
 719.197 --    echo "";
 719.198 --    sleep 1;
 719.199 --
 719.200 --    if [ "$TARGET_ARCH" = "powerpc" ];then
 719.201 --	set -x;
 719.202 --	ln -fs $KERNEL_SOURCE/include/asm-ppc include/asm;
 719.203 --	set +x;
 719.204 --    elif [ "$TARGET_ARCH" = "mips" ];then
 719.205 --	set -x;
 719.206 --	ln -fs $KERNEL_SOURCE/include/asm-mips include/asm;
 719.207 --	set +x;
 719.208 --    elif [ "$TARGET_ARCH" = "arm" ];then
 719.209 --	set -x;
 719.210 --	ln -fs $KERNEL_SOURCE/include/asm-arm include/asm;
 719.211 --	set +x;
 719.212 --	if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ] ; then
 719.213 --	    if [ ! -L proc ] ; then
 719.214 --		(cd include/asm;
 719.215 --		ln -fs proc-armv proc;
 719.216 --		ln -fs arch-ebsa285 arch);
 719.217 --	    fi
 719.218 -+	echo ""
 719.219 -+	echo ""
 719.220 -+	echo "The symlink $KERNEL_SOURCE/include/asm is missing\!"
 719.221 -+	echo "Perhaps you forgot to configure your kernel source?"
 719.222 -+	echo "You really should configure your kernel source tree so I"
 719.223 -+	echo "do not have to try and guess about this sort of thing."
 719.224 -+	echo ""
 719.225 -+	echo "Attempting to guess a usable value...."
 719.226 -+	echo ""
 719.227 -+	echo ""
 719.228 -+	sleep 1
 719.229 -+
 719.230 -+	if [ "$TARGET_ARCH" = "powerpc" ]; then
 719.231 -+		set -x
 719.232 -+		ln -fs $KERNEL_SOURCE/include/asm-ppc include/asm
 719.233 -+		set +x
 719.234 -+	elif [ "$TARGET_ARCH" = "mips" ]; then
 719.235 -+		set -x
 719.236 -+		ln -fs $KERNEL_SOURCE/include/asm-mips include/asm
 719.237 -+		set +x
 719.238 -+	elif [ "$TARGET_ARCH" = "arm" ]; then
 719.239 -+		set -x
 719.240 -+		ln -fs $KERNEL_SOURCE/include/asm-arm include/asm
 719.241 -+		set +x
 719.242 -+	if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ]; then
 719.243 -+		if [ ! -L proc ]; then
 719.244 -+			(
 719.245 -+				cd include/asm
 719.246 -+				ln -fs proc-armv proc
 719.247 -+				ln -fs arch-ebsa285 arch
 719.248 -+			)
 719.249 -+		fi
 719.250 -+	fi
 719.251 -+	elif [ "$TARGET_ARCH" = "cris" ]; then
 719.252 -+		set -x
 719.253 -+		ln -fs $KERNEL_SOURCE/include/asm-cris include/asm
 719.254 -+		set +x
 719.255 -+	elif [ "$HAS_MMU" != "y" ]; then
 719.256 -+		if [ -d $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu ]; then
 719.257 -+			set -x
 719.258 -+			ln -fs $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu include/asm
 719.259 -+			set +x
 719.260 -+		else
 719.261 -+			set -x
 719.262 -+			ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm
 719.263 -+			set +x
 719.264 -+		fi
 719.265 -+	else
 719.266 -+		set -x
 719.267 -+		ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm
 719.268 -+		set +x
 719.269 - 	fi;
 719.270 --    elif [ "$TARGET_ARCH" = "cris" ]; then
 719.271 --	set -x;
 719.272 --	ln -fs $KERNEL_SOURCE/include/asm-cris include/asm;
 719.273 --	set +x;
 719.274 --    elif [ "$HAS_MMU" != "y" ]; then
 719.275 --	    if [ -d $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu ] ; then
 719.276 --		set -x;
 719.277 --		ln -fs $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu include/asm;
 719.278 --		set +x;
 719.279 --	    else
 719.280 --		set -x;
 719.281 --		ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm;
 719.282 --		set +x;
 719.283 --	    fi;
 719.284 --    else
 719.285 --	set -x;
 719.286 --	ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm;
 719.287 --	set +x;
 719.288 --    fi;
 719.289 - else
 719.290 --# No guessing required.....
 719.291 --ln -fs $KERNEL_SOURCE/include/asm include/asm
 719.292 --if [ -e $KERNEL_SOURCE/include/asm-$TARGET_ARCH ] ; then
 719.293 --ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm-$TARGET_ARCH
 719.294 -+	# No guessing required.....
 719.295 -+	for x in $KERNEL_SOURCE/include/asm* ; do
 719.296 -+		ln -fs ${x} include/
 719.297 -+	done
 719.298 - fi
 719.299 --fi;
 719.300 - 
 719.301 - 
 719.302 -+#
 719.303 - # Annoyingly, 2.6.x kernel headers also need an include/asm-generic/ directory
 719.304 --if [ $VERSION -eq 2 ] && [ $PATCHLEVEL -ge 6 ] ; then
 719.305 --    ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
 719.306 --fi;
 719.307 -+#
 719.308 -+if [ -e $KERNEL_SOURCE/include/asm-generic ]; then
 719.309 -+	rm -f include/asm-generic
 719.310 -+	ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
 719.311 -+fi
 719.312 - 
 719.313 - 
 719.314 -+#
 719.315 - # Create the include/linux symlink.
 719.316 -+#
 719.317 - rm -f include/linux
 719.318 - ln -fs $KERNEL_SOURCE/include/linux include/linux
 719.319 --
   720.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   720.2 +++ b/patches/uClibc/0.9.28/100-string-functions.patch	Mon Jul 28 21:32:33 2008 +0000
   720.3 @@ -0,0 +1,11 @@
   720.4 +--- uClibc.orig/libc/Makefile	2005-07-20 08:10:44.000000000 +0200
   720.5 ++++ uclibc/libc/Makefile	2005-07-28 13:33:40.000000000 +0200
   720.6 +@@ -59,7 +59,7 @@
   720.7 + 	$(AR) dN 2 $(LIBNAME) $$objs && \
   720.8 + 	$(AR) dN 2 $(LIBNAME) $$objs
   720.9 + 	@for objfile in obj.signal \
  720.10 +-	                obj.string.generic obj.string.$(TARGET_ARCH) obj.string \
  720.11 ++	                obj.string obj.string.generic obj.string.$(TARGET_ARCH) \
  720.12 + 	                obj.sysdeps.common obj.sysdeps.$(TARGET_ARCH) ; do \
  720.13 + 		if [ -e $$objfile ] ; then \
  720.14 + 			echo $(AR) $(ARFLAGS) $(LIBNAME) $$objfile ; \
   721.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   721.2 +++ b/patches/uClibc/0.9.28/110-install_dev.patch	Mon Jul 28 21:32:33 2008 +0000
   721.3 @@ -0,0 +1,39 @@
   721.4 +There are at least three weird glitches in the Makefile:
   721.5 + - the test operator is a dual-equal sign (==) when it should be a single one (=);
   721.6 + - the exclude options are not accepted as is by GNU tar;
   721.7 + - how on earth could KERNEL_SOURCE possibly be equal to DEVEL_PREFIX ???
   721.8 +
   721.9 +We (Cedric DUVAL and I, Yann E. MORIN) are not quite sure why it is that way.
  721.10 +We're not quite sure either on how to solve this.
  721.11 +
  721.12 +What we need is to built a toolchain; in no way we need to install the linux headers.
  721.13 +  ==> systematically exclude them from the [s]tar command.
  721.14 +
  721.15 +This patch is inspired by the svn repository of uClibc as of 20060209.
  721.16 +diff -dur /home/ymorin/dev/uClibc-0.9.28/Makefile uClibc-0.9.28/Makefile
  721.17 +--- /home/ymorin/dev/uClibc-0.9.28/Makefile	2005-08-18 00:49:49.000000000 +0200
  721.18 ++++ uClibc-0.9.28/Makefile	2006-02-09 17:06:58.000000000 +0100
  721.19 +@@ -158,12 +158,17 @@
  721.20 + 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
  721.21 + 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
  721.22 + 	-$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
  721.23 +-	if [ "$(KERNEL_SOURCE)" == "$(DEVEL_PREFIX)" ] ; then \
  721.24 +-		extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  721.25 +-	else \
  721.26 +-		extra_exclude="" ; \
  721.27 +-	fi ; \
  721.28 +-	tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
  721.29 ++#	if [ "$(KERNEL_SOURCE)" == "$(DEVEL_PREFIX)" ] ; then \
  721.30 ++#		extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
  721.31 ++#	else \
  721.32 ++#		extra_exclude="" ; \
  721.33 ++#	fi ; \
  721.34 ++#	tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
  721.35 ++#		| tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
  721.36 ++	printf ".svn\n.cvsignore\nCVS\n" > tar_exclude ; \
  721.37 ++	ls -1d include/linux include/asm* >> tar_exclude ; \
  721.38 ++	tar -chf - -X tar_exclude include \
  721.39 + 		| tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
  721.40 ++	rm -f tar_exclude
  721.41 + ifneq ($(strip $(UCLIBC_HAS_FLOATS)),y)
  721.42 + 	# Remove floating point related headers since float support is disabled.
   722.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   722.2 +++ b/patches/uClibc/0.9.28/120-no_LFS-no_readahead.patch	Mon Jul 28 21:32:33 2008 +0000
   722.3 @@ -0,0 +1,14 @@
   722.4 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile
   722.5 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile	2007-01-26 00:54:19.000000000 +0100
   722.6 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile	2007-02-01 08:44:37.000000000 +0100
   722.7 +@@ -25,6 +25,10 @@
   722.8 + SRCS := $(filter-out sbrk.c,$(SRCS))
   722.9 + endif
  722.10 + 
  722.11 ++ifneq ($(strip $(UCLIBC_HAS_LFS)),y)
  722.12 ++SRCS := $(filter-out readahead.c,$(SRCS))
  722.13 ++endif
  722.14 ++
  722.15 + ifneq ($(strip $(UCLIBC_HAS_SSP)),y)
  722.16 + SRCS := $(filter-out ssp.c,$(SRCS))
  722.17 + endif
   723.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   723.2 +++ b/patches/uClibc/0.9.28/130-ctype.patch	Mon Jul 28 21:32:33 2008 +0000
   723.3 @@ -0,0 +1,17 @@
   723.4 +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   723.5 +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   723.6 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   723.7 +@@ -34,11 +34,11 @@
   723.8 +
   723.9 + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  723.10 +
  723.11 +-typedef __uint16_t __ctype_mask_t;
  723.12 ++typedef __uint32_t __ctype_mask_t;
  723.13 +
  723.14 + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  723.15 +
  723.16 +-typedef __int16_t __ctype_touplow_t;
  723.17 ++typedef __int32_t __ctype_touplow_t;
  723.18 + #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  723.19 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  723.20 +
   724.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   724.2 +++ b/patches/uClibc/0.9.28/140-fix_includes.sh.patch	Mon Jul 28 21:32:33 2008 +0000
   724.3 @@ -0,0 +1,316 @@
   724.4 +--- uClibc-0.9.28/extra/scripts/fix_includes.sh.orig	2006-12-13 05:44:21.000000000 -0700
   724.5 ++++ uClibc-0.9.28/extra/scripts/fix_includes.sh	2006-12-13 05:44:35.000000000 -0700
   724.6 +@@ -1,183 +1,155 @@
   724.7 + #!/bin/sh
   724.8 +-# Copyright (C) 2003 Erik Andersen <andersen@uclibc.org>
   724.9 + #
  724.10 +-# This program is free software; you can redistribute it and/or
  724.11 +-# modify it under the terms of the GNU Library General Public
  724.12 +-# License as published by the Free Software Foundation; either
  724.13 +-# version 2 of the License, or (at your option) any later
  724.14 +-# version.
  724.15 +-#
  724.16 +-# This program is distributed in the hope that it will be useful,
  724.17 +-# but WITHOUT ANY WARRANTY; without even the implied warranty of
  724.18 +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  724.19 +-# GNU Library General Public License for more details.
  724.20 +-#
  724.21 +-# You should have received a copy of the GNU Library General
  724.22 +-# Public License along with this program; if not, write to the
  724.23 +-# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  724.24 +-# Boston, MA 02111-1307 USA
  724.25 +-
  724.26 +-usage () {
  724.27 +-    echo ""
  724.28 +-    echo "usage: "`basename $0`" -k KERNEL_SOURCE_DIRECTORY -t TARGET_ARCH"
  724.29 +-    echo ""
  724.30 +-    echo "This utility scans the KERNEL_SOURCE_DIRECTORY directory and"
  724.31 +-    echo "checks that it contains well formed kernel headers suitable"
  724.32 +-    echo "for inclusion as the include/linux/ directory provided by"
  724.33 +-    echo "uClibc."
  724.34 +-    echo ""
  724.35 +-    echo "If the specified kernel headers are present and already"
  724.36 +-    echo "configured for the architecture specified by TARGET_ARCH,"
  724.37 +-    echo "they will be used as-is."
  724.38 +-    echo ""
  724.39 +-    echo "If the specified kernel headers are missing entirely, this"
  724.40 +-    echo "script will return an error."
  724.41 +-    echo ""
  724.42 +-    echo "If the specified kernel headers are present, but are either"
  724.43 +-    echo "not yet configured or are configured for an architecture"
  724.44 +-    echo "different than that specified by TARGET_ARCH, this script"
  724.45 +-    echo "will attempt to 'fix' the kernel headers and make them"
  724.46 +-    echo "suitable for use by uClibc.  This fixing process may fail."
  724.47 +-    echo "It is therefore best to always provide kernel headers that"
  724.48 +-    echo "are already configured for the selected architecture."
  724.49 +-    echo ""
  724.50 +-    echo "Most Linux distributions provide 'kernel-headers' packages"
  724.51 +-    echo "that are suitable for use by uClibc."
  724.52 +-    echo ""
  724.53 +-    echo ""
  724.54 +-    exit 1;
  724.55 ++# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  724.56 ++#
  724.57 ++# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  724.58 ++#
  724.59 ++
  724.60 ++usage() {
  724.61 ++	echo ""
  724.62 ++	echo "usage: "`basename $0`" -k KERNEL_SOURCE_DIRECTORY -t TARGET_ARCH"
  724.63 ++	echo ""
  724.64 ++	echo "This utility scans the KERNEL_SOURCE_DIRECTORY directory and"
  724.65 ++	echo "checks that it contains well formed kernel headers suitable"
  724.66 ++	echo "for inclusion as the include/linux/ directory provided by"
  724.67 ++	echo "uClibc."
  724.68 ++	echo ""
  724.69 ++	echo "If the specified kernel headers are present and already"
  724.70 ++	echo "configured for the architecture specified by TARGET_ARCH,"
  724.71 ++	echo "they will be used as-is."
  724.72 ++	echo ""
  724.73 ++	echo "If the specified kernel headers are missing entirely, this"
  724.74 ++	echo "script will return an error."
  724.75 ++	echo ""
  724.76 ++	echo "If the specified kernel headers are present, but are either"
  724.77 ++	echo "not yet configured or are configured for an architecture"
  724.78 ++	echo "different than that specified by TARGET_ARCH, this script"
  724.79 ++	echo "will attempt to 'fix' the kernel headers and make them"
  724.80 ++	echo "suitable for use by uClibc.  This fixing process may fail."
  724.81 ++	echo "It is therefore best to always provide kernel headers that"
  724.82 ++	echo "are already configured for the selected architecture."
  724.83 ++	echo ""
  724.84 ++	echo "Most Linux distributions provide 'kernel-headers' packages"
  724.85 ++	echo "that are suitable for use by uClibc."
  724.86 ++	echo ""
  724.87 ++	echo ""
  724.88 ++	exit 1
  724.89 + }
  724.90 + 
  724.91 +-HAS_MMU="y";
  724.92 ++
  724.93 ++#
  724.94 ++# Parse our arguments
  724.95 ++#
  724.96 ++HAS_MMU="y"
  724.97 + while [ -n "$1" ]; do
  724.98 +-    case $1 in
  724.99 +-	-k ) shift; if [ -n "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
 724.100 +-	-t ) shift; if [ -n "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
 724.101 +-	-n ) shift; HAS_MMU="n"; ;;
 724.102 +-	-* ) usage; ;;
 724.103 +-	* ) usage; ;;
 724.104 +-    esac;
 724.105 +-done;
 724.106 ++	case $1 in
 724.107 ++		-k ) shift; if [ -n "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
 724.108 ++		-t ) shift; if [ -n "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
 724.109 ++		-n ) shift; HAS_MMU="n"; ;;
 724.110 ++		-* ) usage; ;;
 724.111 ++		* ) usage; ;;
 724.112 ++	esac
 724.113 ++done
 724.114 + 
 724.115 +-if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
 724.116 +-    echo "";
 724.117 +-    echo "";
 724.118 +-    echo "The file $KERNEL_SOURCE/Makefile or $KERNEL_SOURCE/include/linux/version.h is missing!";
 724.119 +-    echo "Perhaps your kernel source is broken?"
 724.120 +-    echo "";
 724.121 +-    echo "";
 724.122 +-    exit 1;
 724.123 +-fi;
 724.124 + 
 724.125 +-if [ ! -d "$KERNEL_SOURCE" ]; then
 724.126 +-    echo "";
 724.127 +-    echo "";
 724.128 +-    echo "$KERNEL_SOURCE is not a directory";
 724.129 +-    echo "";
 724.130 +-    echo "";
 724.131 +-    exit 1;
 724.132 +-fi;
 724.133 +-
 724.134 +-if [ -f "$KERNEL_SOURCE/Makefile" ] ; then
 724.135 +-# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION
 724.136 +-eval `sed -n -e 's/^\([A-Z]*\) = \([0-9]*\)$/\1=\2/p' -e 's/^\([A-Z]*\) = \(-[-a-z0-9]*\)$/\1=\2/p' $KERNEL_SOURCE/Makefile`
 724.137 +-else
 724.138 +-ver=`grep UTS_RELEASE $KERNEL_SOURCE/include/linux/version.h | cut -d '"' -f 2`
 724.139 +-VERSION=`echo "$ver" | cut -d '.' -f 1`
 724.140 +-PATCHLEVEL=`echo "$ver" | cut -d '.' -f 2`
 724.141 +-if echo "$ver" | grep -q '-' ; then
 724.142 +-SUBLEVEL=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.//" | cut -d '-' -f 1`
 724.143 +-EXTRAVERSION=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.${SUBLEVEL}-//"`
 724.144 +-else
 724.145 +-SUBLEVEL=`echo "$ver" | cut -d '.' -f 3`
 724.146 +-#EXTRAVERSION=
 724.147 +-fi
 724.148 ++#
 724.149 ++# Perform some sanity checks on our kernel sources
 724.150 ++#
 724.151 ++if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
 724.152 ++	echo ""
 724.153 ++	echo ""
 724.154 ++	echo "The file $KERNEL_SOURCE/Makefile or $KERNEL_SOURCE/include/linux/version.h is missing!"
 724.155 ++	echo "Perhaps your kernel source is broken?"
 724.156 ++	echo ""
 724.157 ++	echo ""
 724.158 ++	exit 1
 724.159 + fi
 724.160 +-if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]
 724.161 +-then
 724.162 +-    echo "Unable to determine version for kernel headers"
 724.163 +-    echo -e "\tprovided in directory $KERNEL_SOURCE"
 724.164 +-    exit 1
 724.165 ++if [ ! -d "$KERNEL_SOURCE" ]; then
 724.166 ++	echo ""
 724.167 ++	echo ""
 724.168 ++	echo "$KERNEL_SOURCE is not a directory"
 724.169 ++	echo ""
 724.170 ++	echo ""
 724.171 ++	exit 1
 724.172 + fi
 724.173 + 
 724.174 +-if [ "$MAKE_IS_SILENT" != "y" ]; then
 724.175 +-echo "Current kernel version is $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION}"
 724.176 +-echo -e "\n"
 724.177 +-echo "Using kernel headers from $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION} for architecture '$TARGET_ARCH'"
 724.178 +-echo -e "\tprovided in directory $KERNEL_SOURCE"
 724.179 +-echo -e "\n"
 724.180 +-fi
 724.181 + 
 724.182 ++#
 724.183 + # Create a symlink to include/asm
 724.184 +-
 724.185 ++#
 724.186 + rm -f include/asm*
 724.187 + if [ ! -d "$KERNEL_SOURCE/include/asm" ]; then
 724.188 +-    echo "";
 724.189 +-    echo "";
 724.190 +-    echo "The symlink $KERNEL_SOURCE/include/asm is missing\!";
 724.191 +-    echo "Perhaps you forgot to configure your kernel source?";
 724.192 +-    echo "You really should configure your kernel source tree so I";
 724.193 +-    echo "do not have to try and guess about this sort of thing.";
 724.194 +-    echo ""
 724.195 +-    echo "Attempting to guess a usable value....";
 724.196 +-    echo ""
 724.197 +-    echo "";
 724.198 +-    sleep 1;
 724.199 +-
 724.200 +-    if [ "$TARGET_ARCH" = "powerpc" ];then
 724.201 +-	set -x;
 724.202 +-	ln -fs $KERNEL_SOURCE/include/asm-ppc include/asm;
 724.203 +-	set +x;
 724.204 +-    elif [ "$TARGET_ARCH" = "mips" ];then
 724.205 +-	set -x;
 724.206 +-	ln -fs $KERNEL_SOURCE/include/asm-mips include/asm;
 724.207 +-	set +x;
 724.208 +-    elif [ "$TARGET_ARCH" = "arm" ];then
 724.209 +-	set -x;
 724.210 +-	ln -fs $KERNEL_SOURCE/include/asm-arm include/asm;
 724.211 +-	set +x;
 724.212 +-	if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ] ; then
 724.213 +-	    if [ ! -L proc ] ; then
 724.214 +-		(cd include/asm;
 724.215 +-		ln -fs proc-armv proc;
 724.216 +-		ln -fs arch-ebsa285 arch);
 724.217 +-	    fi
 724.218 ++	echo ""
 724.219 ++	echo ""
 724.220 ++	echo "The symlink $KERNEL_SOURCE/include/asm is missing\!"
 724.221 ++	echo "Perhaps you forgot to configure your kernel source?"
 724.222 ++	echo "You really should configure your kernel source tree so I"
 724.223 ++	echo "do not have to try and guess about this sort of thing."
 724.224 ++	echo ""
 724.225 ++	echo "Attempting to guess a usable value...."
 724.226 ++	echo ""
 724.227 ++	echo ""
 724.228 ++	sleep 1
 724.229 ++
 724.230 ++	if [ "$TARGET_ARCH" = "powerpc" ]; then
 724.231 ++		set -x
 724.232 ++		ln -fs $KERNEL_SOURCE/include/asm-ppc include/asm
 724.233 ++		set +x
 724.234 ++	elif [ "$TARGET_ARCH" = "mips" ]; then
 724.235 ++		set -x
 724.236 ++		ln -fs $KERNEL_SOURCE/include/asm-mips include/asm
 724.237 ++		set +x
 724.238 ++	elif [ "$TARGET_ARCH" = "arm" ]; then
 724.239 ++		set -x
 724.240 ++		ln -fs $KERNEL_SOURCE/include/asm-arm include/asm
 724.241 ++		set +x
 724.242 ++	if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ]; then
 724.243 ++		if [ ! -L proc ]; then
 724.244 ++			(
 724.245 ++				cd include/asm
 724.246 ++				ln -fs proc-armv proc
 724.247 ++				ln -fs arch-ebsa285 arch
 724.248 ++			)
 724.249 ++		fi
 724.250 ++	fi
 724.251 ++	elif [ "$TARGET_ARCH" = "cris" ]; then
 724.252 ++		set -x
 724.253 ++		ln -fs $KERNEL_SOURCE/include/asm-cris include/asm
 724.254 ++		set +x
 724.255 ++	elif [ "$HAS_MMU" != "y" ]; then
 724.256 ++		if [ -d $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu ]; then
 724.257 ++			set -x
 724.258 ++			ln -fs $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu include/asm
 724.259 ++			set +x
 724.260 ++		else
 724.261 ++			set -x
 724.262 ++			ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm
 724.263 ++			set +x
 724.264 ++		fi
 724.265 ++	else
 724.266 ++		set -x
 724.267 ++		ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm
 724.268 ++		set +x
 724.269 + 	fi;
 724.270 +-    elif [ "$TARGET_ARCH" = "cris" ]; then
 724.271 +-	set -x;
 724.272 +-	ln -fs $KERNEL_SOURCE/include/asm-cris include/asm;
 724.273 +-	set +x;
 724.274 +-    elif [ "$HAS_MMU" != "y" ]; then
 724.275 +-	    if [ -d $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu ] ; then
 724.276 +-		set -x;
 724.277 +-		ln -fs $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu include/asm;
 724.278 +-		set +x;
 724.279 +-	    else
 724.280 +-		set -x;
 724.281 +-		ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm;
 724.282 +-		set +x;
 724.283 +-	    fi;
 724.284 +-    else
 724.285 +-	set -x;
 724.286 +-	ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm;
 724.287 +-	set +x;
 724.288 +-    fi;
 724.289 + else
 724.290 +-# No guessing required.....
 724.291 +-ln -fs $KERNEL_SOURCE/include/asm include/asm
 724.292 +-if [ -e $KERNEL_SOURCE/include/asm-$TARGET_ARCH ] ; then
 724.293 +-ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm-$TARGET_ARCH
 724.294 ++	# No guessing required.....
 724.295 ++	for x in $KERNEL_SOURCE/include/asm* ; do
 724.296 ++		ln -fs ${x} include/
 724.297 ++	done
 724.298 + fi
 724.299 +-fi;
 724.300 + 
 724.301 + 
 724.302 ++#
 724.303 + # Annoyingly, 2.6.x kernel headers also need an include/asm-generic/ directory
 724.304 +-if [ $VERSION -eq 2 ] && [ $PATCHLEVEL -ge 6 ] ; then
 724.305 +-    ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
 724.306 +-fi;
 724.307 ++#
 724.308 ++if [ -e $KERNEL_SOURCE/include/asm-generic ]; then
 724.309 ++	rm -f include/asm-generic
 724.310 ++	ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
 724.311 ++fi
 724.312 + 
 724.313 + 
 724.314 ++#
 724.315 + # Create the include/linux symlink.
 724.316 ++#
 724.317 + rm -f include/linux
 724.318 + ln -fs $KERNEL_SOURCE/include/linux include/linux
 724.319 +-
   725.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   725.2 +++ b/patches/uClibc/0.9.28/150-custom-ISA.patch	Mon Jul 28 21:32:33 2008 +0000
   725.3 @@ -0,0 +1,31 @@
   725.4 +diff -dur uClibc-0.9.28.orig/Rules.mak uClibc-0.9.28/Rules.mak
   725.5 +--- uClibc-0.9.28.orig/Rules.mak	2005-08-18 00:49:49.000000000 +0200
   725.6 ++++ uClibc-0.9.28/Rules.mak	2007-01-30 10:53:34.000000000 +0100
   725.7 +@@ -168,6 +168,7 @@
   725.8 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
   725.9 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
  725.10 + 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
  725.11 ++	CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
  725.12 + endif
  725.13 + 
  725.14 + ifeq ($(strip $(TARGET_ARCH)),sh)
  725.15 +diff -dur uClibc-0.9.28.orig/extra/Configs/Config.mips uClibc-0.9.28/extra/Configs/Config.mips
  725.16 +--- uClibc-0.9.28.orig/extra/Configs/Config.mips	2005-08-18 00:49:41.000000000 +0200
  725.17 ++++ uClibc-0.9.28/extra/Configs/Config.mips	2007-01-30 10:52:12.000000000 +0100
  725.18 +@@ -63,4 +63,16 @@
  725.19 + config CONFIG_MIPS_ISA_MIPS64
  725.20 + 	bool "MIPS64"
  725.21 + 
  725.22 ++config CONFIG_MIPS_ISA_CUSTOM
  725.23 ++	bool "Custom"
  725.24 ++
  725.25 + endchoice
  725.26 ++
  725.27 ++config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
  725.28 ++	string
  725.29 ++	prompt "Custon ISA"
  725.30 ++	depends on CONFIG_MIPS_ISA_CUSTOM
  725.31 ++	default ""
  725.32 ++	help
  725.33 ++	  Enter your custom ISA here (eg: lx4189!).
  725.34 ++
   726.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   726.2 +++ b/patches/uClibc/0.9.28/160-mips-asm.h.patch	Mon Jul 28 21:32:33 2008 +0000
   726.3 @@ -0,0 +1,41 @@
   726.4 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S
   726.5 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S	2007-02-07 11:18:12.000000000 +0100
   726.6 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S	2007-02-07 10:41:34.000000000 +0100
   726.7 +@@ -24,7 +24,7 @@
   726.8 + #include <sys/regdef.h>
   726.9 + #define _ERRNO_H	1
  726.10 + #include <bits/errno.h>
  726.11 +-#include <asm/asm.h>
  726.12 ++#include <sys/asm.h>
  726.13 + 
  726.14 + /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
  726.15 + 
  726.16 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S
  726.17 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:18:12.000000000 +0100
  726.18 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:16:52.000000000 +0100
  726.19 +@@ -3,9 +3,9 @@
  726.20 + /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
  726.21 + 
  726.22 + #include <features.h>
  726.23 +-#include <asm/asm.h>
  726.24 ++#include <sys/asm.h>
  726.25 + #include <asm/unistd.h>
  726.26 +-#include <asm/regdef.h>
  726.27 ++#include <sys/regdef.h>
  726.28 + 
  726.29 +         .globl  pipe
  726.30 +         .ent    pipe, 0
  726.31 +diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S
  726.32 +--- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:18:12.000000000 +0100
  726.33 ++++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:17:03.000000000 +0100
  726.34 +@@ -17,8 +17,8 @@
  726.35 +    02111-1307 USA.  */
  726.36 + 
  726.37 + #include <features.h>
  726.38 +-#include <asm/asm.h>
  726.39 +-#include <asm/regdef.h>
  726.40 ++#include <sys/asm.h>
  726.41 ++#include <sys/regdef.h>
  726.42 + 
  726.43 + #ifdef __PIC__
  726.44 + 	.option pic2
   727.1 --- a/patches/uClibc/0.9.28/200-custom-ISA.patch	Mon Jul 28 21:08:01 2008 +0000
   727.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   727.3 @@ -1,31 +0,0 @@
   727.4 -diff -dur uClibc-0.9.28.orig/Rules.mak uClibc-0.9.28/Rules.mak
   727.5 ---- uClibc-0.9.28.orig/Rules.mak	2005-08-18 00:49:49.000000000 +0200
   727.6 -+++ uClibc-0.9.28/Rules.mak	2007-01-30 10:53:34.000000000 +0100
   727.7 -@@ -168,6 +168,7 @@
   727.8 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
   727.9 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
  727.10 - 	CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
  727.11 -+	CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
  727.12 - endif
  727.13 - 
  727.14 - ifeq ($(strip $(TARGET_ARCH)),sh)
  727.15 -diff -dur uClibc-0.9.28.orig/extra/Configs/Config.mips uClibc-0.9.28/extra/Configs/Config.mips
  727.16 ---- uClibc-0.9.28.orig/extra/Configs/Config.mips	2005-08-18 00:49:41.000000000 +0200
  727.17 -+++ uClibc-0.9.28/extra/Configs/Config.mips	2007-01-30 10:52:12.000000000 +0100
  727.18 -@@ -63,4 +63,16 @@
  727.19 - config CONFIG_MIPS_ISA_MIPS64
  727.20 - 	bool "MIPS64"
  727.21 - 
  727.22 -+config CONFIG_MIPS_ISA_CUSTOM
  727.23 -+	bool "Custom"
  727.24 -+
  727.25 - endchoice
  727.26 -+
  727.27 -+config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
  727.28 -+	string
  727.29 -+	prompt "Custon ISA"
  727.30 -+	depends on CONFIG_MIPS_ISA_CUSTOM
  727.31 -+	default ""
  727.32 -+	help
  727.33 -+	  Enter your custom ISA here (eg: lx4189!).
  727.34 -+
   728.1 --- a/patches/uClibc/0.9.28/201-mips-asm.h.patch	Mon Jul 28 21:08:01 2008 +0000
   728.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   728.3 @@ -1,41 +0,0 @@
   728.4 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S
   728.5 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S	2007-02-07 11:18:12.000000000 +0100
   728.6 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S	2007-02-07 10:41:34.000000000 +0100
   728.7 -@@ -24,7 +24,7 @@
   728.8 - #include <sys/regdef.h>
   728.9 - #define _ERRNO_H	1
  728.10 - #include <bits/errno.h>
  728.11 --#include <asm/asm.h>
  728.12 -+#include <sys/asm.h>
  728.13 - 
  728.14 - /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
  728.15 - 
  728.16 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S
  728.17 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:18:12.000000000 +0100
  728.18 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S	2007-02-07 11:16:52.000000000 +0100
  728.19 -@@ -3,9 +3,9 @@
  728.20 - /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
  728.21 - 
  728.22 - #include <features.h>
  728.23 --#include <asm/asm.h>
  728.24 -+#include <sys/asm.h>
  728.25 - #include <asm/unistd.h>
  728.26 --#include <asm/regdef.h>
  728.27 -+#include <sys/regdef.h>
  728.28 - 
  728.29 -         .globl  pipe
  728.30 -         .ent    pipe, 0
  728.31 -diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S
  728.32 ---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:18:12.000000000 +0100
  728.33 -+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S	2007-02-07 11:17:03.000000000 +0100
  728.34 -@@ -17,8 +17,8 @@
  728.35 -    02111-1307 USA.  */
  728.36 - 
  728.37 - #include <features.h>
  728.38 --#include <asm/asm.h>
  728.39 --#include <asm/regdef.h>
  728.40 -+#include <sys/asm.h>
  728.41 -+#include <sys/regdef.h>
  728.42 - 
  728.43 - #ifdef __PIC__
  728.44 - 	.option pic2
   729.1 --- a/patches/uClibc/0.9.29/000-fix-mmap.patch	Mon Jul 28 21:08:01 2008 +0000
   729.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   729.3 @@ -1,91 +0,0 @@
   729.4 ---- uClibc-0.9.29.oorig/test/mmap/mmap2.c	(revision 0)
   729.5 -+++ uClibc-0.9.29/test/mmap/mmap2.c	(revision 18616)
   729.6 -@@ -0,0 +1,41 @@
   729.7 -+/* When trying to map /dev/mem with offset 0xFFFFF000 on the ARM platform, mmap
   729.8 -+ * returns -EOVERFLOW.
   729.9 -+ *
  729.10 -+ * Since off_t is defined as a long int and the sign bit is set in the address,
  729.11 -+ * the shift operation shifts in ones instead of zeroes
  729.12 -+ * from the left. This results the offset sent to the kernel function becomes
  729.13 -+ * 0xFFFFFFFF instead of 0x000FFFFF with MMAP2_PAGE_SHIFT set to 12.
  729.14 -+ */
  729.15 -+
  729.16 -+#include <unistd.h>
  729.17 -+#include <stdio.h>
  729.18 -+#include <stdlib.h>
  729.19 -+#include <string.h>
  729.20 -+#include <errno.h>
  729.21 -+#include <fcntl.h>
  729.22 -+#include <sys/mman.h>
  729.23 -+
  729.24 -+#define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
  729.25 -+  __LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0)
  729.26 -+
  729.27 -+#define MAP_SIZE 4096UL
  729.28 -+#define MAP_MASK (MAP_SIZE - 1)
  729.29 -+
  729.30 -+int main(int argc, char **argv) {
  729.31 -+    void* map_base = 0;
  729.32 -+    int fd;
  729.33 -+    off_t target = 0xfffff000;
  729.34 -+    if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) FATAL;
  729.35 -+    printf("/dev/mem opened.\n");
  729.36 -+    fflush(stdout);
  729.37 -+
  729.38 -+   /* Map one page */
  729.39 -+    map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
  729.40 -+                        fd, target & ~MAP_MASK);
  729.41 -+    if(map_base == (void *) -1) FATAL;
  729.42 -+    printf("Memory mapped at address %p.\n", map_base);
  729.43 -+    fflush(stdout);
  729.44 -+    if(munmap(map_base, MAP_SIZE) == -1) FATAL;
  729.45 -+    close(fd);
  729.46 -+    return 0;
  729.47 -+}
  729.48 ---- uClibc-0.9.29.oorig/libc/sysdeps/linux/arm/mmap.c	(revision 18615)
  729.49 -+++ uClibc-0.9.29/libc/sysdeps/linux/arm/mmap.c	(revision 18616)
  729.50 -@@ -27,7 +27,6 @@ __ptr_t mmap(__ptr_t addr, size_t len, i
  729.51 - 
  729.52 - #elif defined  (__NR_mmap2)
  729.53 - #define __NR__mmap __NR_mmap2
  729.54 --
  729.55 - #ifndef MMAP2_PAGE_SHIFT
  729.56 - # define MMAP2_PAGE_SHIFT 12
  729.57 - #endif
  729.58 -@@ -39,9 +38,17 @@ __ptr_t mmap(__ptr_t addr, size_t len, i
  729.59 - {
  729.60 -   /* check if offset is page aligned */
  729.61 -     if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1))
  729.62 -+    {
  729.63 -+        __set_errno(EINVAL);
  729.64 -         return MAP_FAILED;
  729.65 -+    }
  729.66 -+#ifdef __USE_FILE_OFFSET64
  729.67 -+  return (__ptr_t) _mmap (addr, len, prot, flags,
  729.68 -+						  fd,((__u_quad_t) offset >> MMAP2_PAGE_SHIFT));
  729.69 -+#else
  729.70 -   return (__ptr_t) _mmap (addr, len, prot, flags,
  729.71 --						  fd,(off_t) (offset >> MMAP2_PAGE_SHIFT));
  729.72 -+                          fd,((__u_long) offset >> MMAP2_PAGE_SHIFT));
  729.73 -+#endif
  729.74 - }
  729.75 - #elif defined (__NR_mmap)
  729.76 - # define __NR__mmap __NR_mmap
  729.77 ---- uClibc-0.9.29.oorig/libc/sysdeps/linux/common/mmap64.c	(revision 18615)
  729.78 -+++ uClibc-0.9.29/libc/sysdeps/linux/common/mmap64.c	(revision 18616)
  729.79 -@@ -58,8 +58,13 @@ __ptr_t mmap64(__ptr_t addr, size_t len,
  729.80 - 		__set_errno(EINVAL);
  729.81 - 		return MAP_FAILED;
  729.82 - 	}
  729.83 --
  729.84 --	return __syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT));
  729.85 -+#ifdef __USE_FILE_OFFSET64
  729.86 -+  return __syscall_mmap2(addr, len, prot, flags,
  729.87 -+                         fd,((__u_quad_t)offset >> MMAP2_PAGE_SHIFT));
  729.88 -+#else
  729.89 -+   return __syscall_mmap2(addr, len, prot, flags,
  729.90 -+                          fd,((__u_long)offset >> MMAP2_PAGE_SHIFT));
  729.91 -+#endif
  729.92 - }
  729.93 - 
  729.94 - # endif
   730.1 --- a/patches/uClibc/0.9.29/100-conditional-sched_affinity.patch	Mon Jul 28 21:08:01 2008 +0000
   730.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   730.3 @@ -1,53 +0,0 @@
   730.4 -diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c
   730.5 ---- uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c	2007-02-12 16:52:32.000000000 -0600
   730.6 -+++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c	2007-05-09 18:05:09.397411811 -0500
   730.7 -@@ -29,6 +29,7 @@
   730.8 - #include <sys/param.h>
   730.9 - #include <sys/types.h>
  730.10 - 
  730.11 -+#ifdef __NR_sched_getaffinity
  730.12 - libc_hidden_proto(memset)
  730.13 - 
  730.14 - #define __NR___syscall_sched_getaffinity __NR_sched_getaffinity
  730.15 -@@ -48,5 +49,15 @@
  730.16 - 	}
  730.17 - 	return res;
  730.18 - }
  730.19 -+#else
  730.20 -+/*
  730.21 -+int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
  730.22 -+{
  730.23 -+	__set_errno(ENOSYS);
  730.24 -+	return -1;
  730.25 -+}
  730.26 -+*/
  730.27 - #endif
  730.28 - #endif
  730.29 -+
  730.30 -+#endif
  730.31 -diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c
  730.32 ---- uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c	2007-02-12 16:52:32.000000000 -0600
  730.33 -+++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c	2007-05-09 18:05:09.397411811 -0500
  730.34 -@@ -31,6 +31,7 @@
  730.35 - #include <sys/types.h>
  730.36 - #include <alloca.h>
  730.37 - 
  730.38 -+#ifdef __NR_sched_setaffinity
  730.39 - libc_hidden_proto(getpid)
  730.40 - 
  730.41 - #define __NR___syscall_sched_setaffinity __NR_sched_setaffinity
  730.42 -@@ -74,5 +75,14 @@
  730.43 - 
  730.44 - 	return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
  730.45 - }
  730.46 -+#else
  730.47 -+/*
  730.48 -+int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
  730.49 -+{
  730.50 -+	__set_errno(ENOSYS);
  730.51 -+	return -1;
  730.52 -+}
  730.53 -+*/
  730.54 -+#endif
  730.55 - #endif
  730.56 - #endif
   731.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   731.2 +++ b/patches/uClibc/0.9.29/100-fix-mmap.patch	Mon Jul 28 21:32:33 2008 +0000
   731.3 @@ -0,0 +1,91 @@
   731.4 +--- uClibc-0.9.29.oorig/test/mmap/mmap2.c	(revision 0)
   731.5 ++++ uClibc-0.9.29/test/mmap/mmap2.c	(revision 18616)
   731.6 +@@ -0,0 +1,41 @@
   731.7 ++/* When trying to map /dev/mem with offset 0xFFFFF000 on the ARM platform, mmap
   731.8 ++ * returns -EOVERFLOW.
   731.9 ++ *
  731.10 ++ * Since off_t is defined as a long int and the sign bit is set in the address,
  731.11 ++ * the shift operation shifts in ones instead of zeroes
  731.12 ++ * from the left. This results the offset sent to the kernel function becomes
  731.13 ++ * 0xFFFFFFFF instead of 0x000FFFFF with MMAP2_PAGE_SHIFT set to 12.
  731.14 ++ */
  731.15 ++
  731.16 ++#include <unistd.h>
  731.17 ++#include <stdio.h>
  731.18 ++#include <stdlib.h>
  731.19 ++#include <string.h>
  731.20 ++#include <errno.h>
  731.21 ++#include <fcntl.h>
  731.22 ++#include <sys/mman.h>
  731.23 ++
  731.24 ++#define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
  731.25 ++  __LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0)
  731.26 ++
  731.27 ++#define MAP_SIZE 4096UL
  731.28 ++#define MAP_MASK (MAP_SIZE - 1)
  731.29 ++
  731.30 ++int main(int argc, char **argv) {
  731.31 ++    void* map_base = 0;
  731.32 ++    int fd;
  731.33 ++    off_t target = 0xfffff000;
  731.34 ++    if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) FATAL;
  731.35 ++    printf("/dev/mem opened.\n");
  731.36 ++    fflush(stdout);
  731.37 ++
  731.38 ++   /* Map one page */
  731.39 ++    map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
  731.40 ++                        fd, target & ~MAP_MASK);
  731.41 ++    if(map_base == (void *) -1) FATAL;
  731.42 ++    printf("Memory mapped at address %p.\n", map_base);
  731.43 ++    fflush(stdout);
  731.44 ++    if(munmap(map_base, MAP_SIZE) == -1) FATAL;
  731.45 ++    close(fd);
  731.46 ++    return 0;
  731.47 ++}
  731.48 +--- uClibc-0.9.29.oorig/libc/sysdeps/linux/arm/mmap.c	(revision 18615)
  731.49 ++++ uClibc-0.9.29/libc/sysdeps/linux/arm/mmap.c	(revision 18616)
  731.50 +@@ -27,7 +27,6 @@ __ptr_t mmap(__ptr_t addr, size_t len, i
  731.51 + 
  731.52 + #elif defined  (__NR_mmap2)
  731.53 + #define __NR__mmap __NR_mmap2
  731.54 +-
  731.55 + #ifndef MMAP2_PAGE_SHIFT
  731.56 + # define MMAP2_PAGE_SHIFT 12
  731.57 + #endif
  731.58 +@@ -39,9 +38,17 @@ __ptr_t mmap(__ptr_t addr, size_t len, i
  731.59 + {
  731.60 +   /* check if offset is page aligned */
  731.61 +     if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1))
  731.62 ++    {
  731.63 ++        __set_errno(EINVAL);
  731.64 +         return MAP_FAILED;
  731.65 ++    }
  731.66 ++#ifdef __USE_FILE_OFFSET64
  731.67 ++  return (__ptr_t) _mmap (addr, len, prot, flags,
  731.68 ++						  fd,((__u_quad_t) offset >> MMAP2_PAGE_SHIFT));
  731.69 ++#else
  731.70 +   return (__ptr_t) _mmap (addr, len, prot, flags,
  731.71 +-						  fd,(off_t) (offset >> MMAP2_PAGE_SHIFT));
  731.72 ++                          fd,((__u_long) offset >> MMAP2_PAGE_SHIFT));
  731.73 ++#endif
  731.74 + }
  731.75 + #elif defined (__NR_mmap)
  731.76 + # define __NR__mmap __NR_mmap
  731.77 +--- uClibc-0.9.29.oorig/libc/sysdeps/linux/common/mmap64.c	(revision 18615)
  731.78 ++++ uClibc-0.9.29/libc/sysdeps/linux/common/mmap64.c	(revision 18616)
  731.79 +@@ -58,8 +58,13 @@ __ptr_t mmap64(__ptr_t addr, size_t len,
  731.80 + 		__set_errno(EINVAL);
  731.81 + 		return MAP_FAILED;
  731.82 + 	}
  731.83 +-
  731.84 +-	return __syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT));
  731.85 ++#ifdef __USE_FILE_OFFSET64
  731.86 ++  return __syscall_mmap2(addr, len, prot, flags,
  731.87 ++                         fd,((__u_quad_t)offset >> MMAP2_PAGE_SHIFT));
  731.88 ++#else
  731.89 ++   return __syscall_mmap2(addr, len, prot, flags,
  731.90 ++                          fd,((__u_long)offset >> MMAP2_PAGE_SHIFT));
  731.91 ++#endif
  731.92 + }
  731.93 + 
  731.94 + # endif
   732.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   732.2 +++ b/patches/uClibc/0.9.29/110-conditional-sched_affinity.patch	Mon Jul 28 21:32:33 2008 +0000
   732.3 @@ -0,0 +1,53 @@
   732.4 +diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c
   732.5 +--- uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c	2007-02-12 16:52:32.000000000 -0600
   732.6 ++++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c	2007-05-09 18:05:09.397411811 -0500
   732.7 +@@ -29,6 +29,7 @@
   732.8 + #include <sys/param.h>
   732.9 + #include <sys/types.h>
  732.10 + 
  732.11 ++#ifdef __NR_sched_getaffinity
  732.12 + libc_hidden_proto(memset)
  732.13 + 
  732.14 + #define __NR___syscall_sched_getaffinity __NR_sched_getaffinity
  732.15 +@@ -48,5 +49,15 @@
  732.16 + 	}
  732.17 + 	return res;
  732.18 + }
  732.19 ++#else
  732.20 ++/*
  732.21 ++int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
  732.22 ++{
  732.23 ++	__set_errno(ENOSYS);
  732.24 ++	return -1;
  732.25 ++}
  732.26 ++*/
  732.27 + #endif
  732.28 + #endif
  732.29 ++
  732.30 ++#endif
  732.31 +diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c
  732.32 +--- uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c	2007-02-12 16:52:32.000000000 -0600
  732.33 ++++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c	2007-05-09 18:05:09.397411811 -0500
  732.34 +@@ -31,6 +31,7 @@
  732.35 + #include <sys/types.h>
  732.36 + #include <alloca.h>
  732.37 + 
  732.38 ++#ifdef __NR_sched_setaffinity
  732.39 + libc_hidden_proto(getpid)
  732.40 + 
  732.41 + #define __NR___syscall_sched_setaffinity __NR_sched_setaffinity
  732.42 +@@ -74,5 +75,14 @@
  732.43 + 
  732.44 + 	return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
  732.45 + }
  732.46 ++#else
  732.47 ++/*
  732.48 ++int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
  732.49 ++{
  732.50 ++	__set_errno(ENOSYS);
  732.51 ++	return -1;
  732.52 ++}
  732.53 ++*/
  732.54 ++#endif
  732.55 + #endif
  732.56 + #endif
   733.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   733.2 +++ b/patches/uClibc/0.9.29/120-fix-internal_function-definition.patch	Mon Jul 28 21:32:33 2008 +0000
   733.3 @@ -0,0 +1,51 @@
   733.4 +Index: uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
   733.5 +===================================================================
   733.6 +--- uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h	(revision 18898)
   733.7 ++++ uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h	(working copy)
   733.8 +@@ -42,6 +42,8 @@
   733.9 + /* define if target supports IEEE signed zero floats */
  733.10 + #define __UCLIBC_HAVE_SIGNED_ZERO__
  733.11 + 
  733.12 ++#if defined _LIBC
  733.13 + #define internal_function __attribute__ ((regparm (3), stdcall))
  733.14 ++#endif
  733.15 + 
  733.16 + #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
  733.17 +Index: uClibc/include/libc-symbols.h
  733.18 +===================================================================
  733.19 +--- uClibc/include/libc-symbols.h	(revision 18898)
  733.20 ++++ uClibc/include/libc-symbols.h	(working copy)
  733.21 +@@ -22,6 +22,16 @@
  733.22 + #ifndef _LIBC_SYMBOLS_H
  733.23 + #define _LIBC_SYMBOLS_H	1
  733.24 + 
  733.25 ++/* This is defined for the compilation of all C library code.  features.h
  733.26 ++   tests this to avoid inclusion of stubs.h while compiling the library,
  733.27 ++   before stubs.h has been generated.  Some library code that is shared
  733.28 ++   with other packages also tests this symbol to see if it is being
  733.29 ++   compiled as part of the C library.  We must define this before including
  733.30 ++   config.h, because it makes some definitions conditional on whether libc
  733.31 ++   itself is being compiled, or just some generator program.  */
  733.32 ++#define _LIBC	1
  733.33 ++
  733.34 ++
  733.35 + /* This file's macros are included implicitly in the compilation of every
  733.36 +    file in the C library by -imacros.
  733.37 + 
  733.38 +@@ -40,16 +50,6 @@
  733.39 + 
  733.40 + #include <bits/uClibc_arch_features.h>
  733.41 + 
  733.42 +-
  733.43 +-/* This is defined for the compilation of all C library code.  features.h
  733.44 +-   tests this to avoid inclusion of stubs.h while compiling the library,
  733.45 +-   before stubs.h has been generated.  Some library code that is shared
  733.46 +-   with other packages also tests this symbol to see if it is being
  733.47 +-   compiled as part of the C library.  We must define this before including
  733.48 +-   config.h, because it makes some definitions conditional on whether libc
  733.49 +-   itself is being compiled, or just some generator program.  */
  733.50 +-#define _LIBC	1
  733.51 +-
  733.52 + /* Enable declarations of GNU extensions, since we are compiling them.  */
  733.53 + #define _GNU_SOURCE	1
  733.54 + 
   734.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   734.2 +++ b/patches/uClibc/0.9.29/130-fix-gethostent_r-failure-retval.patch	Mon Jul 28 21:32:33 2008 +0000
   734.3 @@ -0,0 +1,12 @@
   734.4 +diff -ur uClibc-0.9.29/libc/inet/resolv.c uClibc-0.9.29-patched/libc/inet/resolv.c
   734.5 +--- uClibc-0.9.29/libc/inet/resolv.c	2007-04-23 12:01:05.000000000 -0500
   734.6 ++++ uClibc-0.9.29-patched/libc/inet/resolv.c	2007-05-09 18:05:33.563404419 -0500
   734.7 +@@ -1700,7 +1700,7 @@
   734.8 + int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
   734.9 + 	struct hostent **result, int *h_errnop)
  734.10 + {
  734.11 +-    int ret;
  734.12 ++    int ret = HOST_NOT_FOUND;
  734.13 + 
  734.14 +     __UCLIBC_MUTEX_LOCK(mylock);
  734.15 +     if (__gethostent_fp == NULL) {
   735.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   735.2 +++ b/patches/uClibc/0.9.29/140-bits_sysnum_h.patch	Mon Jul 28 21:32:33 2008 +0000
   735.3 @@ -0,0 +1,33 @@
   735.4 +YEM-20070519:
   735.5 +bits/sysnum.h needs a cross compiler to be built. Fortunately, this
   735.6 +header is not needed to build gcc. Move generation of this header.
   735.7 +
   735.8 +Index: uClibc/Makefile.in
   735.9 +===================================================================
  735.10 +--- uClibc/Makefile.in	(revision 18651)
  735.11 ++++ uClibc/Makefile.in	(working copy)
  735.12 +@@ -91,6 +91,11 @@
  735.13 + 			$(LN) -fs $$i .; \
  735.14 + 		done; \
  735.15 + 	fi
  735.16 ++ifeq ($(UCLIBC_HAS_LOCALE),y)
  735.17 ++	$(MAKE) locale_headers
  735.18 ++endif
  735.19 ++
  735.20 ++pregen: headers
  735.21 + 	$(Q)\
  735.22 + 	set -e; \
  735.23 + 	cd $(top_builddir); \
  735.24 +@@ -102,12 +107,7 @@
  735.25 + 	else \
  735.26 + 		mv -f $$tmp include/bits/sysnum.h; \
  735.27 + 	fi
  735.28 +-ifeq ($(UCLIBC_HAS_LOCALE),y)
  735.29 +-	$(MAKE) locale_headers
  735.30 +-endif
  735.31 + 
  735.32 +-pregen: headers
  735.33 +-
  735.34 + install: install_runtime install_dev
  735.35 + 
  735.36 + 
   736.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   736.2 +++ b/patches/uClibc/0.9.29/150-bits_sysnum_h2.patch	Mon Jul 28 21:32:33 2008 +0000
   736.3 @@ -0,0 +1,18 @@
   736.4 +YEM-20070519:
   736.5 +Patch from Bernhard Fischer <rep.dot.nop@gmail.com> on the uClibc mailing
   736.6 +list ( http://www.uclibc.org/lists/uclibc/2008-January/018940.html ) above
   736.7 +the 400-bits_sysnum_h.patch.
   736.8 +
   736.9 +Index: uClibc/Makefile.in
  736.10 +===================================================================
  736.11 +--- uClibc/Makefile.in	(revision 18651)
  736.12 ++++ uClibc/Makefile.in	(working copy)
  736.13 +@@ -114,7 +116,7 @@ install: install_runtime install_dev
  736.14 + RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)lib $(RUNTIME_PREFIX)lib)
  736.15 + 
  736.16 + # Installs header files.
  736.17 +-install_headers:
  736.18 ++install_headers: headers
  736.19 + 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
  736.20 + 	printf ".svn\n.cvsignore\nCVS\n" > tar_exclude ; \
  736.21 + 	$(TAR) -chf - -X tar_exclude include \
   737.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   737.2 +++ b/patches/uClibc/0.9.29/160-custom-ISA.patch	Mon Jul 28 21:32:33 2008 +0000
   737.3 @@ -0,0 +1,31 @@
   737.4 +diff -dur uClibc-0.9.29.orig/extra/Configs/Config.mips uClibc-0.9.29/extra/Configs/Config.mips
   737.5 +--- uClibc-0.9.29.orig/extra/Configs/Config.mips	2007-03-16 20:38:14.000000000 +0100
   737.6 ++++ uClibc-0.9.29/extra/Configs/Config.mips	2007-05-22 19:30:43.000000000 +0200
   737.7 +@@ -71,4 +71,16 @@
   737.8 + config CONFIG_MIPS_ISA_MIPS64
   737.9 + 	bool "MIPS64"
  737.10 + 
  737.11 ++config CONFIG_MIPS_ISA_CUSTOM
  737.12 ++	bool "Custom"
  737.13 ++
  737.14 + endchoice
  737.15 ++
  737.16 ++config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
  737.17 ++	string
  737.18 ++	prompt "Custon ISA"
  737.19 ++	depends on CONFIG_MIPS_ISA_CUSTOM
  737.20 ++	default ""
  737.21 ++	help
  737.22 ++	  Enter your custom ISA here (eg: lx4189!).
  737.23 ++
  737.24 +diff -dur uClibc-0.9.29.orig/Rules.mak uClibc-0.9.29/Rules.mak
  737.25 +--- uClibc-0.9.29.orig/Rules.mak	2007-04-17 15:34:11.000000000 +0200
  737.26 ++++ uClibc-0.9.29/Rules.mak	2007-05-22 19:31:48.000000000 +0200
  737.27 +@@ -234,6 +234,7 @@
  737.28 + 	CPU_CFLAGS-$(CONFIG_MIPS_N64_ABI)+=-mabi=64
  737.29 + 	CPU_CFLAGS-$(CONFIG_MIPS_O32_ABI)+=-mabi=32
  737.30 + 	CPU_CFLAGS-$(CONFIG_MIPS_N32_ABI)+=-mabi=n32
  737.31 ++	CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
  737.32 + endif
  737.33 + 
  737.34 + ifeq ($(TARGET_ARCH),nios)
   738.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   738.2 +++ b/patches/uClibc/0.9.29/170-filter-gnu99-from-assembly-flags.patch	Mon Jul 28 21:32:33 2008 +0000
   738.3 @@ -0,0 +1,12 @@
   738.4 +diff -ur uClibc-0.9.29/Makerules uClibc-0.9.29-patched/Makerules
   738.5 +--- uClibc-0.9.29/Makerules	2006-12-10 18:25:23.000000000 -0600
   738.6 ++++ uClibc-0.9.29-patched/Makerules	2008-01-26 17:04:50.965699518 -0600
   738.7 +@@ -96,7 +96,7 @@
   738.8 + disp_ld        = $($(DISP)_disp_ld)
   738.9 + 
  738.10 + cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(filter-out $(CFLAGS-OMIT-$(notdir $<)),$(CFLAGS-$(notdir $(^D)))) $(CFLAGS-$(subst $(top_srcdir),,$(dir $<))) $(CFLAGS-$(notdir $<)) $(CFLAGS-$(notdir $@))
  738.11 +-cmd_compile.S = $(cmd_compile.c) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
  738.12 ++cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
  738.13 + cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
  738.14 + cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@))
  738.15 + cmd_strip     = $(STRIPTOOL) $(STRIP_FLAGS) $^
   739.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   739.2 +++ b/patches/uClibc/0.9.29/180-linuxthreads.patch	Mon Jul 28 21:32:33 2008 +0000
   739.3 @@ -0,0 +1,145 @@
   739.4 +--- a/libpthread/linuxthreads.old/attr.c	2006-01-24 12:41:01.000000000 -0500
   739.5 ++++ b/libpthread/linuxthreads.old/attr.c	2008-02-10 11:35:32.000000000 -0500
   739.6 +@@ -25,6 +25,14 @@
   739.7 + #include "pthread.h"
   739.8 + #include "internals.h"
   739.9 + 
  739.10 ++#include <sys/resource.h>
  739.11 ++#include <inttypes.h>
  739.12 ++#include <stdio.h>
  739.13 ++#include <stdio_ext.h>
  739.14 ++#include <stdlib.h>
  739.15 ++#include <sys/resource.h>
  739.16 ++
  739.17 ++
  739.18 + /* NOTE: With uClibc I don't think we need this versioning stuff.
  739.19 +  * Therefore, define the function pthread_attr_init() here using
  739.20 +  * a strong symbol. */
  739.21 +@@ -209,4 +217,94 @@ int __pthread_attr_getstacksize(const pt
  739.22 +   *stacksize = attr->__stacksize;
  739.23 +   return 0;
  739.24 + }
  739.25 ++
  739.26 ++
  739.27 ++extern int *__libc_stack_end;
  739.28 ++
  739.29 + weak_alias (__pthread_attr_getstacksize, pthread_attr_getstacksize)
  739.30 ++void* pthread_getattr_np(pthread_t thread, pthread_attr_t *attr)
  739.31 ++{
  739.32 ++    static void *stackBase = 0;
  739.33 ++    static size_t stackSize = 0;
  739.34 ++    int ret = 0;
  739.35 ++    /* Stack size limit.  */
  739.36 ++    struct rlimit rl;
  739.37 ++
  739.38 ++    /* The safest way to get the top of the stack is to read
  739.39 ++    /proc/self/maps and locate the line into which
  739.40 ++    __libc_stack_end falls.  */
  739.41 ++    FILE *fp = fopen("/proc/self/maps", "rc");
  739.42 ++    if (fp == NULL)
  739.43 ++        ret = errno;
  739.44 ++    /* We need the limit of the stack in any case.  */
  739.45 ++    else if (getrlimit (RLIMIT_STACK, &rl) != 0)
  739.46 ++        ret = errno;
  739.47 ++    else {
  739.48 ++        /* We need no locking.  */
  739.49 ++        __fsetlocking (fp, FSETLOCKING_BYCALLER);
  739.50 ++
  739.51 ++        /* Until we found an entry (which should always be the case)
  739.52 ++        mark the result as a failure.  */
  739.53 ++        ret = ENOENT;
  739.54 ++
  739.55 ++        char *line = NULL;
  739.56 ++        size_t linelen = 0;
  739.57 ++        uintptr_t last_to = 0;
  739.58 ++
  739.59 ++        while (! feof_unlocked (fp)) {
  739.60 ++            if (getdelim (&line, &linelen, '\n', fp) <= 0)
  739.61 ++                break;
  739.62 ++
  739.63 ++            uintptr_t from;
  739.64 ++            uintptr_t to;
  739.65 ++            if (sscanf (line, "%x-%x", &from, &to) != 2)
  739.66 ++                continue;
  739.67 ++            if (from <= (uintptr_t) __libc_stack_end
  739.68 ++            && (uintptr_t) __libc_stack_end < to) {
  739.69 ++                /* Found the entry.  Now we have the info we need.  */
  739.70 ++                attr->__stacksize = rl.rlim_cur;
  739.71 ++#ifdef _STACK_GROWS_UP
  739.72 ++                /* Don't check to enforce a limit on the __stacksize */
  739.73 ++                attr->__stackaddr = (void *) from;
  739.74 ++#else
  739.75 ++                attr->__stackaddr = (void *) to;
  739.76 ++
  739.77 ++                /* The limit might be too high.  */
  739.78 ++                if ((size_t) attr->__stacksize > (size_t) attr->__stackaddr - last_to)
  739.79 ++                    attr->__stacksize = (size_t) attr->__stackaddr - last_to;
  739.80 ++#endif
  739.81 ++
  739.82 ++                /* We succeed and no need to look further.  */
  739.83 ++                ret = 0;
  739.84 ++                break;
  739.85 ++            }
  739.86 ++            last_to = to;
  739.87 ++        }
  739.88 ++
  739.89 ++        fclose (fp);
  739.90 ++        free (line);
  739.91 ++    }
  739.92 ++#ifndef _STACK_GROWS_UP
  739.93 ++    stackBase = (char *) attr->__stackaddr - attr->__stacksize;
  739.94 ++#else
  739.95 ++    stackBase = attr->__stackaddr;
  739.96 ++#endif
  739.97 ++    stackSize = attr->__stacksize;
  739.98 ++    return (void*)(stackBase + stackSize);
  739.99 ++}
 739.100 ++
 739.101 ++int __pthread_attr_getstack (const pthread_attr_t *attr, void **stackaddr,
 739.102 ++			     size_t *stacksize)
 739.103 ++{
 739.104 ++  /* XXX This function has a stupid definition.  The standard specifies
 739.105 ++     no error value but what is if no stack address was set?  We simply
 739.106 ++     return the value we have in the member.  */
 739.107 ++#ifndef _STACK_GROWS_UP
 739.108 ++  *stackaddr = (char *) attr->__stackaddr - attr->__stacksize;
 739.109 ++#else
 739.110 ++  *stackaddr = attr->__stackaddr;
 739.111 ++#endif
 739.112 ++  *stacksize = attr->__stacksize;
 739.113 ++  return 0;
 739.114 ++}
 739.115 ++weak_alias (__pthread_attr_getstack, pthread_attr_getstack)
 739.116 +
 739.117 +--- a/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h	2006-12-07 22:19:36.000000000 -0500
 739.118 ++++ b/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h	2008-02-10 11:42:35.000000000 -0500
 739.119 +@@ -288,15 +288,11 @@ extern int pthread_attr_getstacksize (__
 739.120 + 				      __attr, size_t *__restrict __stacksize)
 739.121 +      __THROW;
 739.122 + 
 739.123 +-#if 0
 739.124 +-/* Not yet implemented in uClibc! */
 739.125 +-
 739.126 + #ifdef __USE_GNU
 739.127 + /* Initialize thread attribute *ATTR with attributes corresponding to the
 739.128 +    already running thread TH.  It shall be called on unitialized ATTR
 739.129 +    and destroyed with pthread_attr_destroy when no longer needed.  */
 739.130 +-extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW;
 739.131 +-#endif
 739.132 ++extern void* pthread_getattr_np(pthread_t thread, pthread_attr_t *attr);
 739.133 + #endif
 739.134 + 
 739.135 + /* Functions for scheduling control.  */
 739.136 +@@ -599,6 +595,11 @@ extern int pthread_cancel (pthread_t __c
 739.137 +    cancelled.  */
 739.138 + extern void pthread_testcancel (void);
 739.139 + 
 739.140 ++/* Return the previously set address for the stack.  */
 739.141 ++extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
 739.142 ++				  void **__restrict __stackaddr,
 739.143 ++				  size_t *__restrict __stacksize) __THROW;
 739.144 ++
 739.145 + 
 739.146 + /* Install a cleanup handler: ROUTINE will be called with arguments ARG
 739.147 +    when the thread is cancelled or calls pthread_exit.  ROUTINE will also
 739.148 +
   740.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   740.2 +++ b/patches/uClibc/0.9.29/190-rm-whitespace.patch	Mon Jul 28 21:32:33 2008 +0000
   740.3 @@ -0,0 +1,86 @@
   740.4 +diff -urN uClibc-0.9.29-0rig/include/assert.h uClibc-0.9.29/include/assert.h
   740.5 +--- uClibc-0.9.29-0rig/include/assert.h	2005-11-03 23:42:46.000000000 +0100
   740.6 ++++ uClibc-0.9.29/include/assert.h	2007-08-13 19:10:57.000000000 +0200
   740.7 +@@ -31,7 +31,7 @@
   740.8 + #define	_ASSERT_H	1
   740.9 + #include <features.h>
  740.10 + 
  740.11 +-#if defined __cplusplus && __GNUC_PREREQ (2,95)
  740.12 ++#if defined __cplusplus && __GNUC_PREREQ(2,95)
  740.13 + # define __ASSERT_VOID_CAST static_cast<void>
  740.14 + #else
  740.15 + # define __ASSERT_VOID_CAST (void)
  740.16 +@@ -59,13 +59,17 @@
  740.17 +   (__ASSERT_VOID_CAST ((expr) ? 0 :					      \
  740.18 + 		       (__assert (__STRING(expr), __FILE__, __LINE__,    \
  740.19 + 				       __ASSERT_FUNCTION), 0)))
  740.20 +-  
  740.21 ++
  740.22 ++/* Define some temporaries to workaround tinyx makedepend bug */
  740.23 ++#define	__GNUC_PREREQ_2_6	__GNUC_PREREQ(2, 6)
  740.24 ++#define	__GNUC_PREREQ_2_4	__GNUC_PREREQ(2, 4)
  740.25 + /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
  740.26 +    which contains the name of the function currently being defined.
  740.27 +    This is broken in G++ before version 2.6.
  740.28 +    C9x has a similar variable called __func__, but prefer the GCC one since
  740.29 +    it demangles C++ function names.  */
  740.30 +-# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
  740.31 ++
  740.32 ++# if defined __cplusplus ? __GNUC_PREREQ_2_6 : __GNUC_PREREQ_2_4
  740.33 + #   define __ASSERT_FUNCTION	__PRETTY_FUNCTION__
  740.34 + # else
  740.35 + #  if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
  740.36 +diff -urN uClibc-0.9.29-0rig/include/complex.h uClibc-0.9.29/include/complex.h
  740.37 +--- uClibc-0.9.29-0rig/include/complex.h	2002-05-09 10:15:21.000000000 +0200
  740.38 ++++ uClibc-0.9.29/include/complex.h	2007-08-13 17:55:29.000000000 +0200
  740.39 +@@ -33,7 +33,7 @@
  740.40 + /* We might need to add support for more compilers here.  But since ISO
  740.41 +    C99 is out hopefully all maintained compilers will soon provide the data
  740.42 +    types `float complex' and `double complex'.  */
  740.43 +-#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
  740.44 ++#if __GNUC_PREREQ(2, 7) && !__GNUC_PREREQ(2, 97)
  740.45 + # define _Complex __complex__
  740.46 + #endif
  740.47 + 
  740.48 +diff -urN uClibc-0.9.29-0rig/include/features.h uClibc-0.9.29/include/features.h
  740.49 +--- uClibc-0.9.29-0rig/include/features.h	2006-11-29 22:10:04.000000000 +0100
  740.50 ++++ uClibc-0.9.29/include/features.h	2007-08-13 17:55:51.000000000 +0200
  740.51 +@@ -143,7 +143,7 @@
  740.52 + 
  740.53 + /* Convenience macros to test the versions of glibc and gcc.
  740.54 +    Use them like this:
  740.55 +-   #if __GNUC_PREREQ (2,8)
  740.56 ++   #if __GNUC_PREREQ(2,8)
  740.57 +    ... code requiring gcc 2.8 or later ...
  740.58 +    #endif
  740.59 +    Note - they won't work for gcc1 or glibc1, since the _MINOR macros
  740.60 +@@ -297,7 +297,7 @@
  740.61 + /* uClibc does not support _FORTIFY_SOURCE */
  740.62 + #undef _FORTIFY_SOURCE
  740.63 + #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
  740.64 +-    && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
  740.65 ++    && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
  740.66 + # if _FORTIFY_SOURCE > 1
  740.67 + #  define __USE_FORTIFY_LEVEL 2
  740.68 + # else
  740.69 +@@ -366,7 +366,7 @@
  740.70 + #endif	/* !ASSEMBLER */
  740.71 + 
  740.72 + /* Decide whether we can define 'extern inline' functions in headers.  */
  740.73 +-#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
  740.74 ++#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
  740.75 +     && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
  740.76 + # define __USE_EXTERN_INLINES	1
  740.77 + #endif
  740.78 +diff -urN uClibc-0.9.29-0rig/include/tgmath.h uClibc-0.9.29/include/tgmath.h
  740.79 +--- uClibc-0.9.29-0rig/include/tgmath.h	2002-05-09 10:15:21.000000000 +0200
  740.80 ++++ uClibc-0.9.29/include/tgmath.h	2007-08-13 17:56:17.000000000 +0200
  740.81 +@@ -34,7 +34,7 @@
  740.82 +    do not try this for now and instead concentrate only on GNU CC.  Once
  740.83 +    we have more information support for other compilers might follow.  */
  740.84 + 
  740.85 +-#if __GNUC_PREREQ (2, 7)
  740.86 ++#if __GNUC_PREREQ(2, 7)
  740.87 + 
  740.88 + # ifdef __NO_LONG_DOUBLE_MATH
  740.89 + #  define __tgml(fct) fct
   741.1 --- a/patches/uClibc/0.9.29/200-fix-internal_function-definition.patch	Mon Jul 28 21:08:01 2008 +0000
   741.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   741.3 @@ -1,51 +0,0 @@
   741.4 -Index: uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
   741.5 -===================================================================
   741.6 ---- uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h	(revision 18898)
   741.7 -+++ uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h	(working copy)
   741.8 -@@ -42,6 +42,8 @@
   741.9 - /* define if target supports IEEE signed zero floats */
  741.10 - #define __UCLIBC_HAVE_SIGNED_ZERO__
  741.11 - 
  741.12 -+#if defined _LIBC
  741.13 - #define internal_function __attribute__ ((regparm (3), stdcall))
  741.14 -+#endif
  741.15 - 
  741.16 - #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
  741.17 -Index: uClibc/include/libc-symbols.h
  741.18 -===================================================================
  741.19 ---- uClibc/include/libc-symbols.h	(revision 18898)
  741.20 -+++ uClibc/include/libc-symbols.h	(working copy)
  741.21 -@@ -22,6 +22,16 @@
  741.22 - #ifndef _LIBC_SYMBOLS_H
  741.23 - #define _LIBC_SYMBOLS_H	1
  741.24 - 
  741.25 -+/* This is defined for the compilation of all C library code.  features.h
  741.26 -+   tests this to avoid inclusion of stubs.h while compiling the library,
  741.27 -+   before stubs.h has been generated.  Some library code that is shared
  741.28 -+   with other packages also tests this symbol to see if it is being
  741.29 -+   compiled as part of the C library.  We must define this before including
  741.30 -+   config.h, because it makes some definitions conditional on whether libc
  741.31 -+   itself is being compiled, or just some generator program.  */
  741.32 -+#define _LIBC	1
  741.33 -+
  741.34 -+
  741.35 - /* This file's macros are included implicitly in the compilation of every
  741.36 -    file in the C library by -imacros.
  741.37 - 
  741.38 -@@ -40,16 +50,6 @@
  741.39 - 
  741.40 - #include <bits/uClibc_arch_features.h>
  741.41 - 
  741.42 --
  741.43 --/* This is defined for the compilation of all C library code.  features.h
  741.44 --   tests this to avoid inclusion of stubs.h while compiling the library,
  741.45 --   before stubs.h has been generated.  Some library code that is shared
  741.46 --   with other packages also tests this symbol to see if it is being
  741.47 --   compiled as part of the C library.  We must define this before including
  741.48 --   config.h, because it makes some definitions conditional on whether libc
  741.49 --   itself is being compiled, or just some generator program.  */
  741.50 --#define _LIBC	1
  741.51 --
  741.52 - /* Enable declarations of GNU extensions, since we are compiling them.  */
  741.53 - #define _GNU_SOURCE	1
  741.54 - 
   742.1 --- a/patches/uClibc/0.9.29/300-fix-gethostent_r-failure-retval.patch	Mon Jul 28 21:08:01 2008 +0000
   742.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   742.3 @@ -1,12 +0,0 @@
   742.4 -diff -ur uClibc-0.9.29/libc/inet/resolv.c uClibc-0.9.29-patched/libc/inet/resolv.c
   742.5 ---- uClibc-0.9.29/libc/inet/resolv.c	2007-04-23 12:01:05.000000000 -0500
   742.6 -+++ uClibc-0.9.29-patched/libc/inet/resolv.c	2007-05-09 18:05:33.563404419 -0500
   742.7 -@@ -1700,7 +1700,7 @@
   742.8 - int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
   742.9 - 	struct hostent **result, int *h_errnop)
  742.10 - {
  742.11 --    int ret;
  742.12 -+    int ret = HOST_NOT_FOUND;
  742.13 - 
  742.14 -     __UCLIBC_MUTEX_LOCK(mylock);
  742.15 -     if (__gethostent_fp == NULL) {
   743.1 --- a/patches/uClibc/0.9.29/400-bits_sysnum_h.patch	Mon Jul 28 21:08:01 2008 +0000
   743.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   743.3 @@ -1,33 +0,0 @@
   743.4 -YEM-20070519:
   743.5 -bits/sysnum.h needs a cross compiler to be built. Fortunately, this
   743.6 -header is not needed to build gcc. Move generation of this header.
   743.7 -
   743.8 -Index: uClibc/Makefile.in
   743.9 -===================================================================
  743.10 ---- uClibc/Makefile.in	(revision 18651)
  743.11 -+++ uClibc/Makefile.in	(working copy)
  743.12 -@@ -91,6 +91,11 @@
  743.13 - 			$(LN) -fs $$i .; \
  743.14 - 		done; \
  743.15 - 	fi
  743.16 -+ifeq ($(UCLIBC_HAS_LOCALE),y)
  743.17 -+	$(MAKE) locale_headers
  743.18 -+endif
  743.19 -+
  743.20 -+pregen: headers
  743.21 - 	$(Q)\
  743.22 - 	set -e; \
  743.23 - 	cd $(top_builddir); \
  743.24 -@@ -102,12 +107,7 @@
  743.25 - 	else \
  743.26 - 		mv -f $$tmp include/bits/sysnum.h; \
  743.27 - 	fi
  743.28 --ifeq ($(UCLIBC_HAS_LOCALE),y)
  743.29 --	$(MAKE) locale_headers
  743.30 --endif
  743.31 - 
  743.32 --pregen: headers
  743.33 --
  743.34 - install: install_runtime install_dev
  743.35 - 
  743.36 - 
   744.1 --- a/patches/uClibc/0.9.29/401-bits_sysnum_h2.patch	Mon Jul 28 21:08:01 2008 +0000
   744.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   744.3 @@ -1,18 +0,0 @@
   744.4 -YEM-20070519:
   744.5 -Patch from Bernhard Fischer <rep.dot.nop@gmail.com> on the uClibc mailing
   744.6 -list ( http://www.uclibc.org/lists/uclibc/2008-January/018940.html ) above
   744.7 -the 400-bits_sysnum_h.patch.
   744.8 -
   744.9 -Index: uClibc/Makefile.in
  744.10 -===================================================================
  744.11 ---- uClibc/Makefile.in	(revision 18651)
  744.12 -+++ uClibc/Makefile.in	(working copy)
  744.13 -@@ -114,7 +116,7 @@ install: install_runtime install_dev
  744.14 - RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)lib $(RUNTIME_PREFIX)lib)
  744.15 - 
  744.16 - # Installs header files.
  744.17 --install_headers:
  744.18 -+install_headers: headers
  744.19 - 	$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
  744.20 - 	printf ".svn\n.cvsignore\nCVS\n" > tar_exclude ; \
  744.21 - 	$(TAR) -chf - -X tar_exclude include \
   745.1 --- a/patches/uClibc/0.9.29/500-custom-ISA.patch	Mon Jul 28 21:08:01 2008 +0000
   745.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   745.3 @@ -1,31 +0,0 @@
   745.4 -diff -dur uClibc-0.9.29.orig/extra/Configs/Config.mips uClibc-0.9.29/extra/Configs/Config.mips
   745.5 ---- uClibc-0.9.29.orig/extra/Configs/Config.mips	2007-03-16 20:38:14.000000000 +0100
   745.6 -+++ uClibc-0.9.29/extra/Configs/Config.mips	2007-05-22 19:30:43.000000000 +0200
   745.7 -@@ -71,4 +71,16 @@
   745.8 - config CONFIG_MIPS_ISA_MIPS64
   745.9 - 	bool "MIPS64"
  745.10 - 
  745.11 -+config CONFIG_MIPS_ISA_CUSTOM
  745.12 -+	bool "Custom"
  745.13 -+
  745.14 - endchoice
  745.15 -+
  745.16 -+config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
  745.17 -+	string
  745.18 -+	prompt "Custon ISA"
  745.19 -+	depends on CONFIG_MIPS_ISA_CUSTOM
  745.20 -+	default ""
  745.21 -+	help
  745.22 -+	  Enter your custom ISA here (eg: lx4189!).
  745.23 -+
  745.24 -diff -dur uClibc-0.9.29.orig/Rules.mak uClibc-0.9.29/Rules.mak
  745.25 ---- uClibc-0.9.29.orig/Rules.mak	2007-04-17 15:34:11.000000000 +0200
  745.26 -+++ uClibc-0.9.29/Rules.mak	2007-05-22 19:31:48.000000000 +0200
  745.27 -@@ -234,6 +234,7 @@
  745.28 - 	CPU_CFLAGS-$(CONFIG_MIPS_N64_ABI)+=-mabi=64
  745.29 - 	CPU_CFLAGS-$(CONFIG_MIPS_O32_ABI)+=-mabi=32
  745.30 - 	CPU_CFLAGS-$(CONFIG_MIPS_N32_ABI)+=-mabi=n32
  745.31 -+	CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
  745.32 - endif
  745.33 - 
  745.34 - ifeq ($(TARGET_ARCH),nios)
   746.1 --- a/patches/uClibc/0.9.29/600-filter-gnu99-from-assembly-flags.patch	Mon Jul 28 21:08:01 2008 +0000
   746.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   746.3 @@ -1,12 +0,0 @@
   746.4 -diff -ur uClibc-0.9.29/Makerules uClibc-0.9.29-patched/Makerules
   746.5 ---- uClibc-0.9.29/Makerules	2006-12-10 18:25:23.000000000 -0600
   746.6 -+++ uClibc-0.9.29-patched/Makerules	2008-01-26 17:04:50.965699518 -0600
   746.7 -@@ -96,7 +96,7 @@
   746.8 - disp_ld        = $($(DISP)_disp_ld)
   746.9 - 
  746.10 - cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(filter-out $(CFLAGS-OMIT-$(notdir $<)),$(CFLAGS-$(notdir $(^D)))) $(CFLAGS-$(subst $(top_srcdir),,$(dir $<))) $(CFLAGS-$(notdir $<)) $(CFLAGS-$(notdir $@))
  746.11 --cmd_compile.S = $(cmd_compile.c) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
  746.12 -+cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
  746.13 - cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
  746.14 - cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@))
  746.15 - cmd_strip     = $(STRIPTOOL) $(STRIP_FLAGS) $^
   747.1 --- a/patches/uClibc/0.9.29/700-linuxthreads.patch	Mon Jul 28 21:08:01 2008 +0000
   747.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   747.3 @@ -1,145 +0,0 @@
   747.4 ---- a/libpthread/linuxthreads.old/attr.c	2006-01-24 12:41:01.000000000 -0500
   747.5 -+++ b/libpthread/linuxthreads.old/attr.c	2008-02-10 11:35:32.000000000 -0500
   747.6 -@@ -25,6 +25,14 @@
   747.7 - #include "pthread.h"
   747.8 - #include "internals.h"
   747.9 - 
  747.10 -+#include <sys/resource.h>
  747.11 -+#include <inttypes.h>
  747.12 -+#include <stdio.h>
  747.13 -+#include <stdio_ext.h>
  747.14 -+#include <stdlib.h>
  747.15 -+#include <sys/resource.h>
  747.16 -+
  747.17 -+
  747.18 - /* NOTE: With uClibc I don't think we need this versioning stuff.
  747.19 -  * Therefore, define the function pthread_attr_init() here using
  747.20 -  * a strong symbol. */
  747.21 -@@ -209,4 +217,94 @@ int __pthread_attr_getstacksize(const pt
  747.22 -   *stacksize = attr->__stacksize;
  747.23 -   return 0;
  747.24 - }
  747.25 -+
  747.26 -+
  747.27 -+extern int *__libc_stack_end;
  747.28 -+
  747.29 - weak_alias (__pthread_attr_getstacksize, pthread_attr_getstacksize)
  747.30 -+void* pthread_getattr_np(pthread_t thread, pthread_attr_t *attr)
  747.31 -+{
  747.32 -+    static void *stackBase = 0;
  747.33 -+    static size_t stackSize = 0;
  747.34 -+    int ret = 0;
  747.35 -+    /* Stack size limit.  */
  747.36 -+    struct rlimit rl;
  747.37 -+
  747.38 -+    /* The safest way to get the top of the stack is to read
  747.39 -+    /proc/self/maps and locate the line into which
  747.40 -+    __libc_stack_end falls.  */
  747.41 -+    FILE *fp = fopen("/proc/self/maps", "rc");
  747.42 -+    if (fp == NULL)
  747.43 -+        ret = errno;
  747.44 -+    /* We need the limit of the stack in any case.  */
  747.45 -+    else if (getrlimit (RLIMIT_STACK, &rl) != 0)
  747.46 -+        ret = errno;
  747.47 -+    else {
  747.48 -+        /* We need no locking.  */
  747.49 -+        __fsetlocking (fp, FSETLOCKING_BYCALLER);
  747.50 -+
  747.51 -+        /* Until we found an entry (which should always be the case)
  747.52 -+        mark the result as a failure.  */
  747.53 -+        ret = ENOENT;
  747.54 -+
  747.55 -+        char *line = NULL;
  747.56 -+        size_t linelen = 0;
  747.57 -+        uintptr_t last_to = 0;
  747.58 -+
  747.59 -+        while (! feof_unlocked (fp)) {
  747.60 -+            if (getdelim (&line, &linelen, '\n', fp) <= 0)
  747.61 -+                break;
  747.62 -+
  747.63 -+            uintptr_t from;
  747.64 -+            uintptr_t to;
  747.65 -+            if (sscanf (line, "%x-%x", &from, &to) != 2)
  747.66 -+                continue;
  747.67 -+            if (from <= (uintptr_t) __libc_stack_end
  747.68 -+            && (uintptr_t) __libc_stack_end < to) {
  747.69 -+                /* Found the entry.  Now we have the info we need.  */
  747.70 -+                attr->__stacksize = rl.rlim_cur;
  747.71 -+#ifdef _STACK_GROWS_UP
  747.72 -+                /* Don't check to enforce a limit on the __stacksize */
  747.73 -+                attr->__stackaddr = (void *) from;
  747.74 -+#else
  747.75 -+                attr->__stackaddr = (void *) to;
  747.76 -+
  747.77 -+                /* The limit might be too high.  */
  747.78 -+                if ((size_t) attr->__stacksize > (size_t) attr->__stackaddr - last_to)
  747.79 -+                    attr->__stacksize = (size_t) attr->__stackaddr - last_to;
  747.80 -+#endif
  747.81 -+
  747.82 -+                /* We succeed and no need to look further.  */
  747.83 -+                ret = 0;
  747.84 -+                break;
  747.85 -+            }
  747.86 -+            last_to = to;
  747.87 -+        }
  747.88 -+
  747.89 -+        fclose (fp);
  747.90 -+        free (line);
  747.91 -+    }
  747.92 -+#ifndef _STACK_GROWS_UP
  747.93 -+    stackBase = (char *) attr->__stackaddr - attr->__stacksize;
  747.94 -+#else
  747.95 -+    stackBase = attr->__stackaddr;
  747.96 -+#endif
  747.97 -+    stackSize = attr->__stacksize;
  747.98 -+    return (void*)(stackBase + stackSize);
  747.99 -+}
 747.100 -+
 747.101 -+int __pthread_attr_getstack (const pthread_attr_t *attr, void **stackaddr,
 747.102 -+			     size_t *stacksize)
 747.103 -+{
 747.104 -+  /* XXX This function has a stupid definition.  The standard specifies
 747.105 -+     no error value but what is if no stack address was set?  We simply
 747.106 -+     return the value we have in the member.  */
 747.107 -+#ifndef _STACK_GROWS_UP
 747.108 -+  *stackaddr = (char *) attr->__stackaddr - attr->__stacksize;
 747.109 -+#else
 747.110 -+  *stackaddr = attr->__stackaddr;
 747.111 -+#endif
 747.112 -+  *stacksize = attr->__stacksize;
 747.113 -+  return 0;
 747.114 -+}
 747.115 -+weak_alias (__pthread_attr_getstack, pthread_attr_getstack)
 747.116 -
 747.117 ---- a/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h	2006-12-07 22:19:36.000000000 -0500
 747.118 -+++ b/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h	2008-02-10 11:42:35.000000000 -0500
 747.119 -@@ -288,15 +288,11 @@ extern int pthread_attr_getstacksize (__
 747.120 - 				      __attr, size_t *__restrict __stacksize)
 747.121 -      __THROW;
 747.122 - 
 747.123 --#if 0
 747.124 --/* Not yet implemented in uClibc! */
 747.125 --
 747.126 - #ifdef __USE_GNU
 747.127 - /* Initialize thread attribute *ATTR with attributes corresponding to the
 747.128 -    already running thread TH.  It shall be called on unitialized ATTR
 747.129 -    and destroyed with pthread_attr_destroy when no longer needed.  */
 747.130 --extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW;
 747.131 --#endif
 747.132 -+extern void* pthread_getattr_np(pthread_t thread, pthread_attr_t *attr);
 747.133 - #endif
 747.134 - 
 747.135 - /* Functions for scheduling control.  */
 747.136 -@@ -599,6 +595,11 @@ extern int pthread_cancel (pthread_t __c
 747.137 -    cancelled.  */
 747.138 - extern void pthread_testcancel (void);
 747.139 - 
 747.140 -+/* Return the previously set address for the stack.  */
 747.141 -+extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
 747.142 -+				  void **__restrict __stackaddr,
 747.143 -+				  size_t *__restrict __stacksize) __THROW;
 747.144 -+
 747.145 - 
 747.146 - /* Install a cleanup handler: ROUTINE will be called with arguments ARG
 747.147 -    when the thread is cancelled or calls pthread_exit.  ROUTINE will also
 747.148 -
   748.1 --- a/patches/uClibc/0.9.29/800-rm-whitespace.patch	Mon Jul 28 21:08:01 2008 +0000
   748.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   748.3 @@ -1,86 +0,0 @@
   748.4 -diff -urN uClibc-0.9.29-0rig/include/assert.h uClibc-0.9.29/include/assert.h
   748.5 ---- uClibc-0.9.29-0rig/include/assert.h	2005-11-03 23:42:46.000000000 +0100
   748.6 -+++ uClibc-0.9.29/include/assert.h	2007-08-13 19:10:57.000000000 +0200
   748.7 -@@ -31,7 +31,7 @@
   748.8 - #define	_ASSERT_H	1
   748.9 - #include <features.h>
  748.10 - 
  748.11 --#if defined __cplusplus && __GNUC_PREREQ (2,95)
  748.12 -+#if defined __cplusplus && __GNUC_PREREQ(2,95)
  748.13 - # define __ASSERT_VOID_CAST static_cast<void>
  748.14 - #else
  748.15 - # define __ASSERT_VOID_CAST (void)
  748.16 -@@ -59,13 +59,17 @@
  748.17 -   (__ASSERT_VOID_CAST ((expr) ? 0 :					      \
  748.18 - 		       (__assert (__STRING(expr), __FILE__, __LINE__,    \
  748.19 - 				       __ASSERT_FUNCTION), 0)))
  748.20 --  
  748.21 -+
  748.22 -+/* Define some temporaries to workaround tinyx makedepend bug */
  748.23 -+#define	__GNUC_PREREQ_2_6	__GNUC_PREREQ(2, 6)
  748.24 -+#define	__GNUC_PREREQ_2_4	__GNUC_PREREQ(2, 4)
  748.25 - /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
  748.26 -    which contains the name of the function currently being defined.
  748.27 -    This is broken in G++ before version 2.6.
  748.28 -    C9x has a similar variable called __func__, but prefer the GCC one since
  748.29 -    it demangles C++ function names.  */
  748.30 --# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
  748.31 -+
  748.32 -+# if defined __cplusplus ? __GNUC_PREREQ_2_6 : __GNUC_PREREQ_2_4
  748.33 - #   define __ASSERT_FUNCTION	__PRETTY_FUNCTION__
  748.34 - # else
  748.35 - #  if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
  748.36 -diff -urN uClibc-0.9.29-0rig/include/complex.h uClibc-0.9.29/include/complex.h
  748.37 ---- uClibc-0.9.29-0rig/include/complex.h	2002-05-09 10:15:21.000000000 +0200
  748.38 -+++ uClibc-0.9.29/include/complex.h	2007-08-13 17:55:29.000000000 +0200
  748.39 -@@ -33,7 +33,7 @@
  748.40 - /* We might need to add support for more compilers here.  But since ISO
  748.41 -    C99 is out hopefully all maintained compilers will soon provide the data
  748.42 -    types `float complex' and `double complex'.  */
  748.43 --#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
  748.44 -+#if __GNUC_PREREQ(2, 7) && !__GNUC_PREREQ(2, 97)
  748.45 - # define _Complex __complex__
  748.46 - #endif
  748.47 - 
  748.48 -diff -urN uClibc-0.9.29-0rig/include/features.h uClibc-0.9.29/include/features.h
  748.49 ---- uClibc-0.9.29-0rig/include/features.h	2006-11-29 22:10:04.000000000 +0100
  748.50 -+++ uClibc-0.9.29/include/features.h	2007-08-13 17:55:51.000000000 +0200
  748.51 -@@ -143,7 +143,7 @@
  748.52 - 
  748.53 - /* Convenience macros to test the versions of glibc and gcc.
  748.54 -    Use them like this:
  748.55 --   #if __GNUC_PREREQ (2,8)
  748.56 -+   #if __GNUC_PREREQ(2,8)
  748.57 -    ... code requiring gcc 2.8 or later ...
  748.58 -    #endif
  748.59 -    Note - they won't work for gcc1 or glibc1, since the _MINOR macros
  748.60 -@@ -297,7 +297,7 @@
  748.61 - /* uClibc does not support _FORTIFY_SOURCE */
  748.62 - #undef _FORTIFY_SOURCE
  748.63 - #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
  748.64 --    && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
  748.65 -+    && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
  748.66 - # if _FORTIFY_SOURCE > 1
  748.67 - #  define __USE_FORTIFY_LEVEL 2
  748.68 - # else
  748.69 -@@ -366,7 +366,7 @@
  748.70 - #endif	/* !ASSEMBLER */
  748.71 - 
  748.72 - /* Decide whether we can define 'extern inline' functions in headers.  */
  748.73 --#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
  748.74 -+#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
  748.75 -     && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
  748.76 - # define __USE_EXTERN_INLINES	1
  748.77 - #endif
  748.78 -diff -urN uClibc-0.9.29-0rig/include/tgmath.h uClibc-0.9.29/include/tgmath.h
  748.79 ---- uClibc-0.9.29-0rig/include/tgmath.h	2002-05-09 10:15:21.000000000 +0200
  748.80 -+++ uClibc-0.9.29/include/tgmath.h	2007-08-13 17:56:17.000000000 +0200
  748.81 -@@ -34,7 +34,7 @@
  748.82 -    do not try this for now and instead concentrate only on GNU CC.  Once
  748.83 -    we have more information support for other compilers might follow.  */
  748.84 - 
  748.85 --#if __GNUC_PREREQ (2, 7)
  748.86 -+#if __GNUC_PREREQ(2, 7)
  748.87 - 
  748.88 - # ifdef __NO_LONG_DOUBLE_MATH
  748.89 - #  define __tgml(fct) fct