From 5fd095b3748115d7cbe89524332e4b310550b7c3 Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Tue, 15 Jun 2010 23:10:03 +0200 Subject: toolchain: remove gcc 4.1.2 and non-sysroot support Signed-off-by: Peter Korsgaard --- toolchain/Config.in.2 | 1 - toolchain/Makefile.in | 12 - toolchain/binutils/binutils.mk | 6 +- toolchain/gcc/4.1.2/100-uclibc-conf.patch | 544 ---- toolchain/gcc/4.1.2/110-arm-eabi.patch | 27 - toolchain/gcc/4.1.2/200-uclibc-locale.patch | 3239 -------------------- toolchain/gcc/4.1.2/300-libstdc++-pic.patch | 50 - toolchain/gcc/4.1.2/301-missing-execinfo_h.patch | 11 - toolchain/gcc/4.1.2/302-c99-snprintf.patch | 11 - .../gcc/4.1.2/303-c99-complex-ugly-hack.patch | 12 - toolchain/gcc/4.1.2/304-index_macro.patch | 24 - .../gcc/4.1.2/402-libbackend_dep_gcov-iov.h.patch | 12 - toolchain/gcc/4.1.2/740-sh-pr24836.patch | 25 - toolchain/gcc/4.1.2/800-arm-bigendian.patch | 127 - toolchain/gcc/4.1.2/801-arm-bootstrap-libgcc.patch | 63 - toolchain/gcc/4.1.2/910-soft-float.patch | 26 - toolchain/gcc/Config.in | 26 +- toolchain/gcc/Makefile.in | 7 +- toolchain/gcc/gcc-uclibc-3.x.mk | 484 --- toolchain/gcc/gcc-uclibc-4.x.mk | 13 +- toolchain/uClibc/uclibc.mk | 9 - 21 files changed, 8 insertions(+), 4721 deletions(-) delete mode 100644 toolchain/gcc/4.1.2/100-uclibc-conf.patch delete mode 100644 toolchain/gcc/4.1.2/110-arm-eabi.patch delete mode 100644 toolchain/gcc/4.1.2/200-uclibc-locale.patch delete mode 100644 toolchain/gcc/4.1.2/300-libstdc++-pic.patch delete mode 100644 toolchain/gcc/4.1.2/301-missing-execinfo_h.patch delete mode 100644 toolchain/gcc/4.1.2/302-c99-snprintf.patch delete mode 100644 toolchain/gcc/4.1.2/303-c99-complex-ugly-hack.patch delete mode 100644 toolchain/gcc/4.1.2/304-index_macro.patch delete mode 100644 toolchain/gcc/4.1.2/402-libbackend_dep_gcov-iov.h.patch delete mode 100644 toolchain/gcc/4.1.2/740-sh-pr24836.patch delete mode 100644 toolchain/gcc/4.1.2/800-arm-bigendian.patch delete mode 100644 toolchain/gcc/4.1.2/801-arm-bootstrap-libgcc.patch delete mode 100644 toolchain/gcc/4.1.2/910-soft-float.patch delete mode 100644 toolchain/gcc/gcc-uclibc-3.x.mk (limited to 'toolchain') diff --git a/toolchain/Config.in.2 b/toolchain/Config.in.2 index 71bded2e0..35263ce81 100644 --- a/toolchain/Config.in.2 +++ b/toolchain/Config.in.2 @@ -148,7 +148,6 @@ config BR2_GCC_CROSS_CXX config BR2_INSTALL_LIBSTDCPP bool "Build/install c++ compiler and libstdc++?" - select BR2_LARGEFILE if (!BR2_GCC_SUPPORTS_SYSROOT && BR2_TOOLCHAIN_BUILDROOT) select BR2_GCC_CROSS_CXX help If you are building your own toolchain and want to build and install diff --git a/toolchain/Makefile.in b/toolchain/Makefile.in index 57d84a3e7..5d0e5a1c2 100644 --- a/toolchain/Makefile.in +++ b/toolchain/Makefile.in @@ -10,8 +10,6 @@ else MULTILIB:=--disable-multilib endif -ifeq ($(BR2_TOOLCHAIN_SYSROOT),y) -BR2_SYSROOT_PREFIX=# nothing, straight into /usr BR2_SYSROOT_STAGING_DESTDIR=DESTDIR=$(STAGING_DIR)/ BR2_SYSROOT_TARGET_DESTDIR=DESTDIR=$(TARGET_DIR)/ BR2_CONFIGURE_DEVEL_SYSROOT=--with-sysroot=$(TOOLCHAIN_DIR)/uClibc_dev/ @@ -19,16 +17,6 @@ BR2_CONFIGURE_STAGING_SYSROOT=--with-sysroot=$(STAGING_DIR) BR2_CONFIGURE_BUILD_TOOLS=--with-build-time-tools=$(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin BR2_SYSROOT=--sysroot=$(STAGING_DIR)/ BR2_ISYSROOT=-isysroot $(STAGING_DIR) -else -BR2_SYSROOT_PREFIX=$(STAGING_DIR) -BR2_SYSROOT_STAGING_DESTDIR=# nothing -BR2_SYSROOT_TARGET_DESTDIR=# nothing -BR2_CONFIGURE_DEVEL_SYSROOT=--with-sysroot=$(TOOLCHAIN_DIR)/uClibc_dev/ -BR2_CONFIGURE_STAGING_SYSROOT=# nothing -BR2_CONFIGURE_BUILD_TOOLS=# nothing -BR2_SYSROOT=# nothing -BR2_ISYSROOT=#nothing -endif # gcc has a bunch of needed stuff.... include toolchain/gcc/Makefile.in diff --git a/toolchain/binutils/binutils.mk b/toolchain/binutils/binutils.mk index c24acc4b5..9ac6a223a 100644 --- a/toolchain/binutils/binutils.mk +++ b/toolchain/binutils/binutils.mk @@ -73,12 +73,12 @@ $(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched (cd $(BINUTILS_DIR1); rm -rf config.cache; \ $(HOST_CONFIGURE_OPTS) \ $(BINUTILS_DIR)/configure $(QUIET) \ - --prefix=$(BR2_SYSROOT_PREFIX)/usr \ + --prefix=/usr \ --build=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \ --target=$(REAL_GNU_TARGET_NAME) \ - --mandir=$(BR2_SYSROOT_PREFIX)/usr/share/man \ - --infodir=$(BR2_SYSROOT_PREFIX)/usr/share/info \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ $(BR2_CONFIGURE_DEVEL_SYSROOT) \ $(BR2_CONFIGURE_STAGING_SYSROOT) \ $(DISABLE_NLS) \ diff --git a/toolchain/gcc/4.1.2/100-uclibc-conf.patch b/toolchain/gcc/4.1.2/100-uclibc-conf.patch deleted file mode 100644 index 49d576c7d..000000000 --- a/toolchain/gcc/4.1.2/100-uclibc-conf.patch +++ /dev/null @@ -1,544 +0,0 @@ ---- gcc-4.1.0/gcc/config/t-linux-uclibc -+++ gcc-4.1.0/gcc/config/t-linux-uclibc -@@ -0,0 +1,5 @@ -+# Remove glibc specific files added in t-linux -+SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES)) -+ -+# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc -+LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH)) ---- gcc-4.1.0/gcc/config.gcc -+++ gcc-4.1.0/gcc/config.gcc -@@ -1887,7 +1887,7 @@ s390x-ibm-tpf*) - ;; - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \ - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ -- sh-*-linux* | sh[346lbe]*-*-linux* | \ -+ sh*-*-linux* | sh[346lbe]*-*-linux* | \ - sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ - sh64-*-netbsd* | sh64l*-*-netbsd*) - tmake_file="${tmake_file} sh/t-sh sh/t-elf" -@@ -2341,6 +2341,12 @@ m32c-*-elf*) - ;; - esac - -+# Rather than hook into each target, just do it after all the linux -+# targets have been processed -+case ${target} in -+*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc" -+esac -+ - case ${target} in - i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1) - tmake_file="${tmake_file} i386/t-gmm_malloc" ---- gcc-4.1.0/boehm-gc/configure -+++ gcc-4.1.0/boehm-gc/configure -@@ -4320,6 +4320,11 @@ linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' ---- gcc-4.1.0/configure -+++ gcc-4.1.0/configure -@@ -1133,7 +1133,7 @@ no) - ;; - "") - case "${target}" in -- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu) -+ *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*) - # Enable libmudflap by default in GNU and friends. - ;; - *-*-freebsd*) ---- gcc-4.1.0/configure.in -+++ gcc-4.1.0/configure.in -@@ -341,7 +341,7 @@ no) - ;; - "") - case "${target}" in -- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu) -+ *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*) - # Enable libmudflap by default in GNU and friends. - ;; - *-*-freebsd*) ---- gcc-4.1.0/contrib/regression/objs-gcc.sh -+++ gcc-4.1.0/contrib/regression/objs-gcc.sh -@@ -105,6 +105,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H - then - make all-gdb all-dejagnu all-ld || exit 1 - make install-gdb install-dejagnu install-ld || exit 1 -+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ] -+ then -+ make all-gdb all-dejagnu all-ld || exit 1 -+ make install-gdb install-dejagnu install-ld || exit 1 - elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then - make bootstrap || exit 1 - make install || exit 1 ---- gcc-4.1.0/gcc/config/alpha/linux-elf.h -+++ gcc-4.1.0/gcc/config/alpha/linux-elf.h -@@ -27,7 +27,11 @@ Boston, MA 02110-1301, USA. */ - #define SUBTARGET_EXTRA_SPECS \ - { "elf_dynamic_linker", ELF_DYNAMIC_LINKER }, - -+#if defined USE_UCLIBC -+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" -+#else - #define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2" -+#endif - - #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \ - %{O*:-O3} %{!O*:-O1} \ ---- gcc-4.1.0/gcc/config/arm/linux-elf.h -+++ gcc-4.1.0/gcc/config/arm/linux-elf.h -@@ -51,7 +51,11 @@ - - #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" - -+#ifdef USE_UCLIBC -+#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0" -+#else - #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2" -+#endif - - #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \ - %{b} \ ---- gcc-4.1.0/gcc/config/cris/linux.h -+++ gcc-4.1.0/gcc/config/cris/linux.h -@@ -73,6 +73,25 @@ Boston, MA 02110-1301, USA. */ - #undef CRIS_DEFAULT_CPU_VERSION - #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG - -+#ifdef USE_UCLIBC -+ -+#undef CRIS_SUBTARGET_VERSION -+#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc" -+ -+#undef CRIS_LINK_SUBTARGET_SPEC -+#define CRIS_LINK_SUBTARGET_SPEC \ -+ "-mcrislinux\ -+ -rpath-link include/asm/../..%s\ -+ %{shared} %{static}\ -+ %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\ -+ %{!shared: \ -+ %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \ -+ %{!r:%{O2|O3: --gc-sections}}" -+ -+#else /* USE_UCLIBC */ -+ - #undef CRIS_SUBTARGET_VERSION - #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu" - -@@ -87,6 +106,8 @@ Boston, MA 02110-1301, USA. */ - %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\ - %{!r:%{O2|O3: --gc-sections}}" - -+#endif /* USE_UCLIBC */ -+ - - /* Node: Run-time Target */ - ---- gcc-4.1.0/gcc/config/i386/linux.h -+++ gcc-4.1.0/gcc/config/i386/linux.h -@@ -107,6 +107,11 @@ Boston, MA 02110-1301, USA. */ - #define LINK_EMULATION "elf_i386" - #define DYNAMIC_LINKER "/lib/ld-linux.so.2" - -+#if defined USE_UCLIBC -+#undef DYNAMIC_LINKER -+#define DYNAMIC_LINKER "/lib/ld-uClibc.so.0" -+#endif -+ - #undef SUBTARGET_EXTRA_SPECS - #define SUBTARGET_EXTRA_SPECS \ - { "link_emulation", LINK_EMULATION },\ ---- gcc-4.1.0/gcc/config/i386/linux64.h -+++ gcc-4.1.0/gcc/config/i386/linux64.h -@@ -54,14 +54,21 @@ Boston, MA 02110-1301, USA. */ - When the -shared link option is used a final link is not being - done. */ - -+#ifdef USE_UCLIBC -+#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" -+#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0" -+#else -+#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2" -+#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2" -+#endif - #undef LINK_SPEC - #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \ - %{shared:-shared} \ - %{!shared: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ -- %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ -- %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \ -+ %{m32:%{!dynamic-linker:-dynamic-linker " ELF32_DYNAMIC_LINKER "}} \ -+ %{!m32:%{!dynamic-linker:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}} \ - %{static:-static}}" - - /* Similar to standard Linux, but adding -ffast-math support. */ ---- gcc-4.1.0/gcc/config/ia64/linux.h -+++ gcc-4.1.0/gcc/config/ia64/linux.h -@@ -37,13 +37,18 @@ do { \ - /* Define this for shared library support because it isn't in the main - linux.h file. */ - -+#ifdef USE_UCLIBC -+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" -+#else -+#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2" -+#endif - #undef LINK_SPEC - #define LINK_SPEC "\ - %{shared:-shared} \ - %{!shared: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ -- %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \ -+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ - %{static:-static}}" - - ---- gcc-4.1.0/gcc/config/m68k/linux.h -+++ gcc-4.1.0/gcc/config/m68k/linux.h -@@ -123,12 +123,17 @@ Boston, MA 02110-1301, USA. */ - - /* If ELF is the default format, we should not use /lib/elf. */ - -+#ifdef USE_UCLIBC -+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" -+#else -+#define ELF_DYNAMIC_LINKER "/lib/ld.so.1" -+#endif - #undef LINK_SPEC - #define LINK_SPEC "-m m68kelf %{shared} \ - %{!shared: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ -- %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \ -+ %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ - %{static}}" - - /* For compatibility with linux/a.out */ ---- gcc-4.1.0/gcc/config/mips/linux.h -+++ gcc-4.1.0/gcc/config/mips/linux.h -@@ -105,6 +105,11 @@ Boston, MA 02110-1301, USA. */ - - /* Borrowed from sparc/linux.h */ - #undef LINK_SPEC -+#ifdef USE_UCLIBC -+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" -+#else -+#define ELF_DYNAMIC_LINKER "/lib/ld.so.1" -+#endif - #define LINK_SPEC \ - "%(endian_spec) \ - %{shared:-shared} \ -@@ -112,7 +117,7 @@ Boston, MA 02110-1301, USA. */ - %{!ibcs: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ -- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ -+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ - %{static:-static}}}" - - #undef SUBTARGET_ASM_SPEC ---- gcc-4.1.0/gcc/config/pa/pa-linux.h -+++ gcc-4.1.0/gcc/config/pa/pa-linux.h -@@ -49,13 +49,18 @@ Boston, MA 02110-1301, USA. */ - /* Define this for shared library support because it isn't in the main - linux.h file. */ - -+#ifdef USE_UCLIBC -+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" -+#else -+#define ELF_DYNAMIC_LINKER "/lib/ld.so.1" -+#endif - #undef LINK_SPEC - #define LINK_SPEC "\ - %{shared:-shared} \ - %{!shared: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ -- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ -+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ - %{static:-static}}" - - /* glibc's profiling functions don't need gcc to allocate counters. */ ---- gcc-4.1.0/gcc/config/rs6000/linux.h -+++ gcc-4.1.0/gcc/config/rs6000/linux.h -@@ -72,7 +72,11 @@ - #define LINK_START_DEFAULT_SPEC "%(link_start_linux)" - - #undef LINK_OS_DEFAULT_SPEC -+#ifdef USE_UCLIBC -+#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)" -+#else - #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" -+#endif - - #define LINK_GCC_C_SEQUENCE_SPEC \ - "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" ---- gcc-4.1.0/gcc/config/rs6000/sysv4.h -+++ gcc-4.1.0/gcc/config/rs6000/sysv4.h -@@ -866,6 +866,7 @@ extern int fixuplabelno; - mcall-linux : %(link_os_linux) ; \ - mcall-gnu : %(link_os_gnu) ; \ - mcall-netbsd : %(link_os_netbsd) ; \ -+ mcall-linux-uclibc : %(link_os_linux_uclibc); \ - mcall-openbsd: %(link_os_openbsd) ; \ - : %(link_os_default) }" - -@@ -1043,6 +1044,10 @@ extern int fixuplabelno; - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" - -+#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}" -+ - #if defined(HAVE_LD_EH_FRAME_HDR) - # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " - #endif -@@ -1209,6 +1214,7 @@ ncrtn.o%s" - { "link_os_sim", LINK_OS_SIM_SPEC }, \ - { "link_os_freebsd", LINK_OS_FREEBSD_SPEC }, \ - { "link_os_linux", LINK_OS_LINUX_SPEC }, \ -+ { "link_os_linux_uclibc", LINK_OS_LINUX_UCLIBC_SPEC }, \ - { "link_os_gnu", LINK_OS_GNU_SPEC }, \ - { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \ - { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \ ---- gcc-4.1.0/gcc/config/s390/linux.h -+++ gcc-4.1.0/gcc/config/s390/linux.h -@@ -77,6 +77,13 @@ Software Foundation, 51 Franklin Street, - #define MULTILIB_DEFAULTS { "m31" } - #endif - -+#ifdef USE_UCLIBC -+#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" -+#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0" -+#else -+#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1" -+#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1" -+#endif - #undef LINK_SPEC - #define LINK_SPEC \ - "%{m31:-m elf_s390}%{m64:-m elf64_s390} \ -@@ -86,8 +93,8 @@ Software Foundation, 51 Franklin Street, - %{!static: \ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker: \ -- %{m31:-dynamic-linker /lib/ld.so.1} \ -- %{m64:-dynamic-linker /lib/ld64.so.1}}}}" -+ %{m31:-dynamic-linker " ELF31_DYNAMIC_LINKER "} \ -+ %{m64:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}}}" - - - #define TARGET_ASM_FILE_END file_end_indicate_exec_stack ---- gcc-4.1.0/gcc/config/sh/linux.h -+++ gcc-4.1.0/gcc/config/sh/linux.h -@@ -56,12 +56,21 @@ Boston, MA 02110-1301, USA. */ - #undef SUBTARGET_LINK_EMUL_SUFFIX - #define SUBTARGET_LINK_EMUL_SUFFIX "_linux" - #undef SUBTARGET_LINK_SPEC -+#ifdef USE_UCLIBC -+#define SUBTARGET_LINK_SPEC \ -+ "%{shared:-shared} \ -+ %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \ -+ %{static:-static}" -+#else - #define SUBTARGET_LINK_SPEC \ - "%{shared:-shared} \ - %{!static: \ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ - %{static:-static}" -+#endif - - /* Output assembler code to STREAM to call the profiler. */ - ---- gcc-4.1.0/gcc/config/sparc/linux.h -+++ gcc-4.1.0/gcc/config/sparc/linux.h -@@ -125,6 +125,11 @@ Boston, MA 02110-1301, USA. */ - - /* If ELF is the default format, we should not use /lib/elf. */ - -+#ifdef USE_UCLIBC -+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" -+#else -+#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2" -+#endif - #undef LINK_SPEC - #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ - %{!mno-relax:%{!r:-relax}} \ -@@ -132,7 +137,7 @@ Boston, MA 02110-1301, USA. */ - %{!ibcs: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ -- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ -+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ - %{static:-static}}}" - - /* The sun bundled assembler doesn't accept -Yd, (and neither does gas). ---- gcc-4.1.0/gcc/config/sparc/linux64.h -+++ gcc-4.1.0/gcc/config/sparc/linux64.h -@@ -162,12 +162,17 @@ Boston, MA 02110-1301, USA. */ - { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \ - { "link_arch", LINK_ARCH_SPEC }, - -+#ifdef USE_UCLIBC -+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" -+#else -+#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2" -+#endif - #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ - %{!shared: \ - %{!ibcs: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ -- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ -+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ - %{static:-static}}} \ - " - ---- gcc-4.1.0/libffi/configure -+++ gcc-4.1.0/libffi/configure -@@ -3457,6 +3457,11 @@ linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' ---- gcc-4.1.0/libgfortran/configure -+++ gcc-4.1.0/libgfortran/configure -@@ -3699,6 +3699,11 @@ linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' ---- gcc-4.1.0/libjava/configure -+++ gcc-4.1.0/libjava/configure -@@ -5137,6 +5137,11 @@ linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' ---- gcc-4.1.0/libmudflap/configure -+++ gcc-4.1.0/libmudflap/configure -@@ -5382,6 +5382,11 @@ linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' ---- gcc-4.1.0/libobjc/configure -+++ gcc-4.1.0/libobjc/configure -@@ -3312,6 +3312,11 @@ linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' ---- gcc-4.1.0/libtool.m4 -+++ gcc-4.1.0/libtool.m4 -@@ -743,6 +743,11 @@ linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'] ---- gcc-4.1.0/ltconfig -+++ gcc-4.1.0/ltconfig -@@ -603,6 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)- - - # Transform linux* to *-*-linux-gnu*, to support old configure scripts. - case $host_os in -+linux-uclibc*) ;; - linux-gnu*) ;; - linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` - esac -@@ -1274,6 +1275,23 @@ linux-gnu*) - dynamic_linker='GNU/Linux ld.so' - ;; - -+linux-uclibc*) -+ version_type=linux -+ need_lib_prefix=no -+ need_version=no -+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' -+ soname_spec='${libname}${release}.so$major' -+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' -+ shlibpath_var=LD_LIBRARY_PATH -+ shlibpath_overrides_runpath=no -+ # This implies no fast_install, which is unacceptable. -+ # Some rework will be needed to allow for fast_install -+ # before this can be enabled. -+ hardcode_into_libs=yes -+ # Assume using the uClibc dynamic linker. -+ dynamic_linker="uClibc ld.so" -+ ;; -+ - netbsd*) - need_lib_prefix=no - need_version=no ---- gcc-4.1.0/zlib/configure -+++ gcc-4.1.0/zlib/configure -@@ -3426,6 +3426,11 @@ linux-gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' diff --git a/toolchain/gcc/4.1.2/110-arm-eabi.patch b/toolchain/gcc/4.1.2/110-arm-eabi.patch deleted file mode 100644 index acebe5308..000000000 --- a/toolchain/gcc/4.1.2/110-arm-eabi.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- gcc-2005q3-1.orig/gcc/config.gcc 2005-10-31 19:02:54.000000000 +0300 -+++ gcc-2005q3-1/gcc/config.gcc 2006-01-27 01:09:09.000000000 +0300 -@@ -674,7 +674,7 @@ - tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" - tmake_file="t-slibgcc-elf-ver t-linux arm/t-arm" - case ${target} in -- arm*-*-linux-gnueabi) -+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) - tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h" - tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi" - # The BPABI long long divmod functions return a 128-bit value in - -diff -urN gcc-2005q3-2/gcc/config/arm/linux-eabi.h gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h ---- gcc-2005q3-2/gcc/config/arm/linux-eabi.h 2005-12-07 23:14:16.000000000 +0300 -+++ gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h 2006-03-29 19:02:34.000000000 +0400 -@@ -53,7 +53,11 @@ - /* Use ld-linux.so.3 so that it will be possible to run "classic" - GNU/Linux binaries on an EABI system. */ - #undef LINUX_TARGET_INTERPRETER -+#ifdef USE_UCLIBC -+#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0" -+#else - #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.3" -+#endif - - /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to - use the GNU/Linux version, not the generic BPABI version. */ diff --git a/toolchain/gcc/4.1.2/200-uclibc-locale.patch b/toolchain/gcc/4.1.2/200-uclibc-locale.patch deleted file mode 100644 index e5d712e72..000000000 --- a/toolchain/gcc/4.1.2/200-uclibc-locale.patch +++ /dev/null @@ -1,3239 +0,0 @@ ---- gcc-4.1.0-dist/libstdc++-v3/acinclude.m4 -+++ gcc-4.1.0/libstdc++-v3/acinclude.m4 -@@ -1071,7 +1071,7 @@ - AC_MSG_CHECKING([for C locale to use]) - GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@], - [use MODEL for target locale package], -- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto]) -+ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto]) - - # If they didn't use this option switch, or if they specified --enable - # with no specific model, we'll have to look for one. If they -@@ -1087,6 +1087,9 @@ - # Default to "generic". - if test $enable_clocale_flag = auto; then - case ${target_os} in -+ *-uclibc*) -+ enable_clocale_flag=uclibc -+ ;; - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) - AC_EGREP_CPP([_GLIBCXX_ok], [ - #include -@@ -1230,6 +1233,40 @@ - CTIME_CC=config/locale/generic/time_members.cc - CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h - ;; -+ uclibc) -+ AC_MSG_RESULT(uclibc) -+ -+ # Declare intention to use gettext, and add support for specific -+ # languages. -+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT -+ ALL_LINGUAS="de fr" -+ -+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. -+ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) -+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then -+ USE_NLS=yes -+ fi -+ # Export the build objects. -+ for ling in $ALL_LINGUAS; do \ -+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ -+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ -+ done -+ AC_SUBST(glibcxx_MOFILES) -+ AC_SUBST(glibcxx_POFILES) -+ -+ CLOCALE_H=config/locale/uclibc/c_locale.h -+ CLOCALE_CC=config/locale/uclibc/c_locale.cc -+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc -+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc -+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc -+ CMESSAGES_H=config/locale/uclibc/messages_members.h -+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc -+ CMONEY_CC=config/locale/uclibc/monetary_members.cc -+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc -+ CTIME_H=config/locale/uclibc/time_members.h -+ CTIME_CC=config/locale/uclibc/time_members.cc -+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h -+ ;; - esac - - # This is where the testsuite looks for locale catalogs, using the ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h -@@ -0,0 +1,63 @@ -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- -+ -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// Written by Jakub Jelinek -+ -+#include -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning clean this up -+#endif -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l; -+extern "C" __typeof(strcoll_l) __strcoll_l; -+extern "C" __typeof(strftime_l) __strftime_l; -+extern "C" __typeof(strtod_l) __strtod_l; -+extern "C" __typeof(strtof_l) __strtof_l; -+extern "C" __typeof(strtold_l) __strtold_l; -+extern "C" __typeof(strxfrm_l) __strxfrm_l; -+extern "C" __typeof(newlocale) __newlocale; -+extern "C" __typeof(freelocale) __freelocale; -+extern "C" __typeof(duplocale) __duplocale; -+extern "C" __typeof(uselocale) __uselocale; -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+extern "C" __typeof(iswctype_l) __iswctype_l; -+extern "C" __typeof(towlower_l) __towlower_l; -+extern "C" __typeof(towupper_l) __towupper_l; -+extern "C" __typeof(wcscoll_l) __wcscoll_l; -+extern "C" __typeof(wcsftime_l) __wcsftime_l; -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; -+extern "C" __typeof(wctype_l) __wctype_l; -+#endif -+ -+#endif // GLIBC 2.3 and later ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc -@@ -0,0 +1,152 @@ -+// Wrapper for underlying C-language localization -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 -+// Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.8 Standard locale categories. -+// -+ -+// Written by Benjamin Kosnik -+ -+#include // For errno -+#include -+#include -+#include -+#include -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) -+#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) -+#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) -+#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) -+#define __strtof_l(S, E, L) strtof((S), (E)) -+#define __strtod_l(S, E, L) strtod((S), (E)) -+#define __strtold_l(S, E, L) strtold((S), (E)) -+#warning should dummy __newlocale check for C|POSIX ? -+#define __newlocale(a, b, c) NULL -+#define __freelocale(a) ((void)0) -+#define __duplocale(a) __c_locale() -+#endif -+ -+namespace std -+{ -+ template<> -+ void -+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, -+ const __c_locale& __cloc) -+ { -+ char* __sanity; -+ errno = 0; -+ float __f = __strtof_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __f; -+ else -+ __err |= ios_base::failbit; -+ } -+ -+ template<> -+ void -+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, -+ const __c_locale& __cloc) -+ { -+ char* __sanity; -+ errno = 0; -+ double __d = __strtod_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __d; -+ else -+ __err |= ios_base::failbit; -+ } -+ -+ template<> -+ void -+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, -+ const __c_locale& __cloc) -+ { -+ char* __sanity; -+ errno = 0; -+ long double __ld = __strtold_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __ld; -+ else -+ __err |= ios_base::failbit; -+ } -+ -+ void -+ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, -+ __c_locale __old) -+ { -+ __cloc = __newlocale(1 << LC_ALL, __s, __old); -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ if (!__cloc) -+ { -+ // This named locale is not supported by the underlying OS. -+ __throw_runtime_error(__N("locale::facet::_S_create_c_locale " -+ "name not valid")); -+ } -+#endif -+ } -+ -+ void -+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc) -+ { -+ if (__cloc && _S_get_c_locale() != __cloc) -+ __freelocale(__cloc); -+ } -+ -+ __c_locale -+ locale::facet::_S_clone_c_locale(__c_locale& __cloc) -+ { return __duplocale(__cloc); } -+} // namespace std -+ -+namespace __gnu_cxx -+{ -+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = -+ { -+ "LC_CTYPE", -+ "LC_NUMERIC", -+ "LC_TIME", -+ "LC_COLLATE", -+ "LC_MONETARY", -+ "LC_MESSAGES", -+#if _GLIBCXX_NUM_CATEGORIES != 0 -+ "LC_PAPER", -+ "LC_NAME", -+ "LC_ADDRESS", -+ "LC_TELEPHONE", -+ "LC_MEASUREMENT", -+ "LC_IDENTIFICATION" -+#endif -+ }; -+} -+ -+namespace std -+{ -+ const char* const* const locale::_S_categories = __gnu_cxx::category_names; -+} // namespace std ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h -@@ -0,0 +1,117 @@ -+// Wrapper for underlying C-language localization -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.8 Standard locale categories. -+// -+ -+// Written by Benjamin Kosnik -+ -+#ifndef _C_LOCALE_H -+#define _C_LOCALE_H 1 -+ -+#pragma GCC system_header -+ -+#include // get std::strlen -+#include // get std::snprintf or std::sprintf -+#include -+#include // For codecvt -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this -+#endif -+#ifdef __UCLIBC_HAS_LOCALE__ -+#include // For codecvt using iconv, iconv_t -+#endif -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+#include // For messages -+#endif -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning what is _GLIBCXX_C_LOCALE_GNU for -+#endif -+#define _GLIBCXX_C_LOCALE_GNU 1 -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix categories -+#endif -+// #define _GLIBCXX_NUM_CATEGORIES 6 -+#define _GLIBCXX_NUM_CATEGORIES 0 -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+namespace __gnu_cxx -+{ -+ extern "C" __typeof(uselocale) __uselocale; -+} -+#endif -+ -+namespace std -+{ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ typedef __locale_t __c_locale; -+#else -+ typedef int* __c_locale; -+#endif -+ -+ // Convert numeric value of type _Tv to string and return length of -+ // string. If snprintf is available use it, otherwise fall back to -+ // the unsafe sprintf which, in general, can be dangerous and should -+ // be avoided. -+ template -+ int -+ __convert_from_v(char* __out, -+ const int __size __attribute__ ((__unused__)), -+ const char* __fmt, -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ _Tv __v, const __c_locale& __cloc, int __prec) -+ { -+ __c_locale __old = __gnu_cxx::__uselocale(__cloc); -+#else -+ _Tv __v, const __c_locale&, int __prec) -+ { -+# ifdef __UCLIBC_HAS_LOCALE__ -+ char* __old = std::setlocale(LC_ALL, NULL); -+ char* __sav = new char[std::strlen(__old) + 1]; -+ std::strcpy(__sav, __old); -+ std::setlocale(LC_ALL, "C"); -+# endif -+#endif -+ -+ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __gnu_cxx::__uselocale(__old); -+#elif defined __UCLIBC_HAS_LOCALE__ -+ std::setlocale(LC_ALL, __sav); -+ delete [] __sav; -+#endif -+ return __ret; -+ } -+} -+ -+#endif ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc -@@ -0,0 +1,306 @@ -+// std::codecvt implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+namespace std -+{ -+ // Specializations. -+#ifdef _GLIBCXX_USE_WCHAR_T -+ codecvt_base::result -+ codecvt:: -+ do_out(state_type& __state, const intern_type* __from, -+ const intern_type* __from_end, const intern_type*& __from_next, -+ extern_type* __to, extern_type* __to_end, -+ extern_type*& __to_next) const -+ { -+ result __ret = ok; -+ state_type __tmp_state(__state); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ -+ // wcsnrtombs is *very* fast but stops if encounters NUL characters: -+ // in case we fall back to wcrtomb and then continue, in a loop. -+ // NB: wcsnrtombs is a GNU extension -+ for (__from_next = __from, __to_next = __to; -+ __from_next < __from_end && __to_next < __to_end -+ && __ret == ok;) -+ { -+ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0', -+ __from_end - __from_next); -+ if (!__from_chunk_end) -+ __from_chunk_end = __from_end; -+ -+ __from = __from_next; -+ const size_t __conv = wcsnrtombs(__to_next, &__from_next, -+ __from_chunk_end - __from_next, -+ __to_end - __to_next, &__state); -+ if (__conv == static_cast(-1)) -+ { -+ // In case of error, in order to stop at the exact place we -+ // have to start again from the beginning with a series of -+ // wcrtomb. -+ for (; __from < __from_next; ++__from) -+ __to_next += wcrtomb(__to_next, *__from, &__tmp_state); -+ __state = __tmp_state; -+ __ret = error; -+ } -+ else if (__from_next && __from_next < __from_chunk_end) -+ { -+ __to_next += __conv; -+ __ret = partial; -+ } -+ else -+ { -+ __from_next = __from_chunk_end; -+ __to_next += __conv; -+ } -+ -+ if (__from_next < __from_end && __ret == ok) -+ { -+ extern_type __buf[MB_LEN_MAX]; -+ __tmp_state = __state; -+ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state); -+ if (__conv > static_cast(__to_end - __to_next)) -+ __ret = partial; -+ else -+ { -+ memcpy(__to_next, __buf, __conv); -+ __state = __tmp_state; -+ __to_next += __conv; -+ ++__from_next; -+ } -+ } -+ } -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ -+ return __ret; -+ } -+ -+ codecvt_base::result -+ codecvt:: -+ do_in(state_type& __state, const extern_type* __from, -+ const extern_type* __from_end, const extern_type*& __from_next, -+ intern_type* __to, intern_type* __to_end, -+ intern_type*& __to_next) const -+ { -+ result __ret = ok; -+ state_type __tmp_state(__state); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ -+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: -+ // in case we store a L'\0' and then continue, in a loop. -+ // NB: mbsnrtowcs is a GNU extension -+ for (__from_next = __from, __to_next = __to; -+ __from_next < __from_end && __to_next < __to_end -+ && __ret == ok;) -+ { -+ const extern_type* __from_chunk_end; -+ __from_chunk_end = static_cast(memchr(__from_next, '\0', -+ __from_end -+ - __from_next)); -+ if (!__from_chunk_end) -+ __from_chunk_end = __from_end; -+ -+ __from = __from_next; -+ size_t __conv = mbsnrtowcs(__to_next, &__from_next, -+ __from_chunk_end - __from_next, -+ __to_end - __to_next, &__state); -+ if (__conv == static_cast(-1)) -+ { -+ // In case of error, in order to stop at the exact place we -+ // have to start again from the beginning with a series of -+ // mbrtowc. -+ for (;; ++__to_next, __from += __conv) -+ { -+ __conv = mbrtowc(__to_next, __from, __from_end - __from, -+ &__tmp_state); -+ if (__conv == static_cast(-1) -+ || __conv == static_cast(-2)) -+ break; -+ } -+ __from_next = __from; -+ __state = __tmp_state; -+ __ret = error; -+ } -+ else if (__from_next && __from_next < __from_chunk_end) -+ { -+ // It is unclear what to return in this case (see DR 382). -+ __to_next += __conv; -+ __ret = partial; -+ } -+ else -+ { -+ __from_next = __from_chunk_end; -+ __to_next += __conv; -+ } -+ -+ if (__from_next < __from_end && __ret == ok) -+ { -+ if (__to_next < __to_end) -+ { -+ // XXX Probably wrong for stateful encodings -+ __tmp_state = __state; -+ ++__from_next; -+ *__to_next++ = L'\0'; -+ } -+ else -+ __ret = partial; -+ } -+ } -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ -+ return __ret; -+ } -+ -+ int -+ codecvt:: -+ do_encoding() const throw() -+ { -+ // XXX This implementation assumes that the encoding is -+ // stateless and is either single-byte or variable-width. -+ int __ret = 0; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ if (MB_CUR_MAX == 1) -+ __ret = 1; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return __ret; -+ } -+ -+ int -+ codecvt:: -+ do_max_length() const throw() -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ // XXX Probably wrong for stateful encodings. -+ int __ret = MB_CUR_MAX; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return __ret; -+ } -+ -+ int -+ codecvt:: -+ do_length(state_type& __state, const extern_type* __from, -+ const extern_type* __end, size_t __max) const -+ { -+ int __ret = 0; -+ state_type __tmp_state(__state); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ -+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: -+ // in case we advance past it and then continue, in a loop. -+ // NB: mbsnrtowcs is a GNU extension -+ -+ // A dummy internal buffer is needed in order for mbsnrtocws to consider -+ // its fourth parameter (it wouldn't with NULL as first parameter). -+ wchar_t* __to = static_cast(__builtin_alloca(sizeof(wchar_t) -+ * __max)); -+ while (__from < __end && __max) -+ { -+ const extern_type* __from_chunk_end; -+ __from_chunk_end = static_cast(memchr(__from, '\0', -+ __end -+ - __from)); -+ if (!__from_chunk_end) -+ __from_chunk_end = __end; -+ -+ const extern_type* __tmp_from = __from; -+ size_t __conv = mbsnrtowcs(__to, &__from, -+ __from_chunk_end - __from, -+ __max, &__state); -+ if (__conv == static_cast(-1)) -+ { -+ // In case of error, in order to stop at the exact place we -+ // have to start again from the beginning with a series of -+ // mbrtowc. -+ for (__from = __tmp_from;; __from += __conv) -+ { -+ __conv = mbrtowc(NULL, __from, __end - __from, -+ &__tmp_state); -+ if (__conv == static_cast(-1) -+ || __conv == static_cast(-2)) -+ break; -+ } -+ __state = __tmp_state; -+ __ret += __from - __tmp_from; -+ break; -+ } -+ if (!__from) -+ __from = __from_chunk_end; -+ -+ __ret += __from - __tmp_from; -+ __max -= __conv; -+ -+ if (__from < __end && __max) -+ { -+ // XXX Probably wrong for stateful encodings -+ __tmp_state = __state; -+ ++__from; -+ ++__ret; -+ --__max; -+ } -+ } -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ -+ return __ret; -+ } -+#endif -+} ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc -@@ -0,0 +1,80 @@ -+// std::collate implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.4.1.2 collate virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) -+#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) -+#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) -+#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) -+#endif -+ -+namespace std -+{ -+ // These are basically extensions to char_traits, and perhaps should -+ // be put there instead of here. -+ template<> -+ int -+ collate::_M_compare(const char* __one, const char* __two) const -+ { -+ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate); -+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); -+ } -+ -+ template<> -+ size_t -+ collate::_M_transform(char* __to, const char* __from, -+ size_t __n) const -+ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ int -+ collate::_M_compare(const wchar_t* __one, -+ const wchar_t* __two) const -+ { -+ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate); -+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); -+ } -+ -+ template<> -+ size_t -+ collate::_M_transform(wchar_t* __to, const wchar_t* __from, -+ size_t __n) const -+ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); } -+#endif -+} ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc -@@ -0,0 +1,314 @@ -+// std::ctype implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. -+// -+ -+// Written by Benjamin Kosnik -+ -+#define _LIBC -+#include -+#undef _LIBC -+#include -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __wctype_l(S, L) wctype((S)) -+#define __towupper_l(C, L) towupper((C)) -+#define __towlower_l(C, L) towlower((C)) -+#define __iswctype_l(C, M, L) iswctype((C), (M)) -+#endif -+ -+namespace std -+{ -+ // NB: The other ctype specializations are in src/locale.cc and -+ // various /config/os/* files. -+ template<> -+ ctype_byname::ctype_byname(const char* __s, size_t __refs) -+ : ctype(0, false, __refs) -+ { -+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) -+ { -+ this->_S_destroy_c_locale(this->_M_c_locale_ctype); -+ this->_S_create_c_locale(this->_M_c_locale_ctype, __s); -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper; -+ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower; -+ this->_M_table = this->_M_c_locale_ctype->__ctype_b; -+#endif -+ } -+ } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ ctype::__wmask_type -+ ctype::_M_convert_to_wmask(const mask __m) const -+ { -+ __wmask_type __ret; -+ switch (__m) -+ { -+ case space: -+ __ret = __wctype_l("space", _M_c_locale_ctype); -+ break; -+ case print: -+ __ret = __wctype_l("print", _M_c_locale_ctype); -+ break; -+ case cntrl: -+ __ret = __wctype_l("cntrl", _M_c_locale_ctype); -+ break; -+ case upper: -+ __ret = __wctype_l("upper", _M_c_locale_ctype); -+ break; -+ case lower: -+ __ret = __wctype_l("lower", _M_c_locale_ctype); -+ break; -+ case alpha: -+ __ret = __wctype_l("alpha", _M_c_locale_ctype); -+ break; -+ case digit: -+ __ret = __wctype_l("digit", _M_c_locale_ctype); -+ break; -+ case punct: -+ __ret = __wctype_l("punct", _M_c_locale_ctype); -+ break; -+ case xdigit: -+ __ret = __wctype_l("xdigit", _M_c_locale_ctype); -+ break; -+ case alnum: -+ __ret = __wctype_l("alnum", _M_c_locale_ctype); -+ break; -+ case graph: -+ __ret = __wctype_l("graph", _M_c_locale_ctype); -+ break; -+ default: -+ __ret = __wmask_type(); -+ } -+ return __ret; -+ } -+ -+ wchar_t -+ ctype::do_toupper(wchar_t __c) const -+ { return __towupper_l(__c, _M_c_locale_ctype); } -+ -+ const wchar_t* -+ ctype::do_toupper(wchar_t* __lo, const wchar_t* __hi) const -+ { -+ while (__lo < __hi) -+ { -+ *__lo = __towupper_l(*__lo, _M_c_locale_ctype); -+ ++__lo; -+ } -+ return __hi; -+ } -+ -+ wchar_t -+ ctype::do_tolower(wchar_t __c) const -+ { return __towlower_l(__c, _M_c_locale_ctype); } -+ -+ const wchar_t* -+ ctype::do_tolower(wchar_t* __lo, const wchar_t* __hi) const -+ { -+ while (__lo < __hi) -+ { -+ *__lo = __towlower_l(*__lo, _M_c_locale_ctype); -+ ++__lo; -+ } -+ return __hi; -+ } -+ -+ bool -+ ctype:: -+ do_is(mask __m, wchar_t __c) const -+ { -+ // The case of __m == ctype_base::space is particularly important, -+ // due to its use in many istream functions. Therefore we deal with -+ // it first, exploiting the knowledge that on GNU systems _M_bit[5] -+ // is the mask corresponding to ctype_base::space. NB: an encoding -+ // change would not affect correctness! -+ bool __ret = false; -+ if (__m == _M_bit[5]) -+ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype); -+ else -+ { -+ // Highest bitmask in ctype_base == 10, but extra in "C" -+ // library for blank. -+ const size_t __bitmasksize = 11; -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) -+ if (__m & _M_bit[__bitcur]) -+ { -+ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) -+ { -+ __ret = true; -+ break; -+ } -+ else if (__m == _M_bit[__bitcur]) -+ break; -+ } -+ } -+ return __ret; -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const -+ { -+ for (; __lo < __hi; ++__vec, ++__lo) -+ { -+ // Highest bitmask in ctype_base == 10, but extra in "C" -+ // library for blank. -+ const size_t __bitmasksize = 11; -+ mask __m = 0; -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) -+ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype)) -+ __m |= _M_bit[__bitcur]; -+ *__vec = __m; -+ } -+ return __hi; -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const -+ { -+ while (__lo < __hi && !this->do_is(__m, *__lo)) -+ ++__lo; -+ return __lo; -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const -+ { -+ while (__lo < __hi && this->do_is(__m, *__lo) != 0) -+ ++__lo; -+ return __lo; -+ } -+ -+ wchar_t -+ ctype:: -+ do_widen(char __c) const -+ { return _M_widen[static_cast(__c)]; } -+ -+ const char* -+ ctype:: -+ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const -+ { -+ while (__lo < __hi) -+ { -+ *__dest = _M_widen[static_cast(*__lo)]; -+ ++__lo; -+ ++__dest; -+ } -+ return __hi; -+ } -+ -+ char -+ ctype:: -+ do_narrow(wchar_t __wc, char __dfault) const -+ { -+ if (__wc >= 0 && __wc < 128 && _M_narrow_ok) -+ return _M_narrow[__wc]; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_ctype); -+#endif -+ const int __c = wctob(__wc); -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return (__c == EOF ? __dfault : static_cast(__c)); -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, -+ char* __dest) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_ctype); -+#endif -+ if (_M_narrow_ok) -+ while (__lo < __hi) -+ { -+ if (*__lo >= 0 && *__lo < 128) -+ *__dest = _M_narrow[*__lo]; -+ else -+ { -+ const int __c = wctob(*__lo); -+ *__dest = (__c == EOF ? __dfault : static_cast(__c)); -+ } -+ ++__lo; -+ ++__dest; -+ } -+ else -+ while (__lo < __hi) -+ { -+ const int __c = wctob(*__lo); -+ *__dest = (__c == EOF ? __dfault : static_cast(__c)); -+ ++__lo; -+ ++__dest; -+ } -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return __hi; -+ } -+ -+ void -+ ctype::_M_initialize_ctype() -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_ctype); -+#endif -+ wint_t __i; -+ for (__i = 0; __i < 128; ++__i) -+ { -+ const int __c = wctob(__i); -+ if (__c == EOF) -+ break; -+ else -+ _M_narrow[__i] = static_cast(__c); -+ } -+ if (__i == 128) -+ _M_narrow_ok = true; -+ else -+ _M_narrow_ok = false; -+ for (size_t __j = 0; -+ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j) -+ _M_widen[__j] = btowc(__j); -+ -+ for (size_t __k = 0; __k <= 11; ++__k) -+ { -+ _M_bit[__k] = static_cast(_ISbit(__k)); -+ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]); -+ } -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ } -+#endif // _GLIBCXX_USE_WCHAR_T -+} ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc -@@ -0,0 +1,100 @@ -+// std::messages implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.7.1.2 messages virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix gettext stuff -+#endif -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+extern "C" char *__dcgettext(const char *domainname, -+ const char *msgid, int category); -+#undef gettext -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) -+#else -+#undef gettext -+#define gettext(msgid) (msgid) -+#endif -+ -+namespace std -+{ -+ // Specializations. -+ template<> -+ string -+ messages::do_get(catalog, int, int, const string& __dfault) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_messages); -+ const char* __msg = const_cast(gettext(__dfault.c_str())); -+ __uselocale(__old); -+ return string(__msg); -+#elif defined __UCLIBC_HAS_LOCALE__ -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_messages); -+ const char* __msg = gettext(__dfault.c_str()); -+ setlocale(LC_ALL, __old); -+ free(__old); -+ return string(__msg); -+#else -+ const char* __msg = gettext(__dfault.c_str()); -+ return string(__msg); -+#endif -+ } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ wstring -+ messages::do_get(catalog, int, int, const wstring& __dfault) const -+ { -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_messages); -+ char* __msg = gettext(_M_convert_to_char(__dfault)); -+ __uselocale(__old); -+ return _M_convert_from_char(__msg); -+# elif defined __UCLIBC_HAS_LOCALE__ -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_messages); -+ char* __msg = gettext(_M_convert_to_char(__dfault)); -+ setlocale(LC_ALL, __old); -+ free(__old); -+ return _M_convert_from_char(__msg); -+# else -+ char* __msg = gettext(_M_convert_to_char(__dfault)); -+ return _M_convert_from_char(__msg); -+# endif -+ } -+#endif -+} ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h -@@ -0,0 +1,121 @@ -+// std::messages implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.7.1.2 messages functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix prototypes for *textdomain funcs -+#endif -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+extern "C" char *__textdomain(const char *domainname); -+extern "C" char *__bindtextdomain(const char *domainname, -+ const char *dirname); -+#else -+#undef __textdomain -+#undef __bindtextdomain -+#define __textdomain(D) ((void)0) -+#define __bindtextdomain(D,P) ((void)0) -+#endif -+ -+ // Non-virtual member functions. -+ template -+ messages<_CharT>::messages(size_t __refs) -+ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), -+ _M_name_messages(_S_get_c_name()) -+ { } -+ -+ template -+ messages<_CharT>::messages(__c_locale __cloc, const char* __s, -+ size_t __refs) -+ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL) -+ { -+ const size_t __len = std::strlen(__s) + 1; -+ char* __tmp = new char[__len]; -+ std::memcpy(__tmp, __s, __len); -+ _M_name_messages = __tmp; -+ -+ // Last to avoid leaking memory if new throws. -+ _M_c_locale_messages = _S_clone_c_locale(__cloc); -+ } -+ -+ template -+ typename messages<_CharT>::catalog -+ messages<_CharT>::open(const basic_string& __s, const locale& __loc, -+ const char* __dir) const -+ { -+ __bindtextdomain(__s.c_str(), __dir); -+ return this->do_open(__s, __loc); -+ } -+ -+ // Virtual member functions. -+ template -+ messages<_CharT>::~messages() -+ { -+ if (_M_name_messages != _S_get_c_name()) -+ delete [] _M_name_messages; -+ _S_destroy_c_locale(_M_c_locale_messages); -+ } -+ -+ template -+ typename messages<_CharT>::catalog -+ messages<_CharT>::do_open(const basic_string& __s, -+ const locale&) const -+ { -+ // No error checking is done, assume the catalog exists and can -+ // be used. -+ __textdomain(__s.c_str()); -+ return 0; -+ } -+ -+ template -+ void -+ messages<_CharT>::do_close(catalog) const -+ { } -+ -+ // messages_byname -+ template -+ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) -+ : messages<_CharT>(__refs) -+ { -+ if (this->_M_name_messages != locale::facet::_S_get_c_name()) -+ delete [] this->_M_name_messages; -+ char* __tmp = new char[std::strlen(__s) + 1]; -+ std::strcpy(__tmp, __s); -+ this->_M_name_messages = __tmp; -+ -+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) -+ { -+ this->_S_destroy_c_locale(this->_M_c_locale_messages); -+ this->_S_create_c_locale(this->_M_c_locale_messages, __s); -+ } -+ } ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc -@@ -0,0 +1,692 @@ -+// std::moneypunct implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#define _LIBC -+#include -+#undef _LIBC -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning optimize this for uclibc -+#warning tailor for stub locale support -+#endif -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __nl_langinfo_l(N, L) nl_langinfo((N)) -+#endif -+ -+namespace std -+{ -+ // Construct and return valid pattern consisting of some combination of: -+ // space none symbol sign value -+ money_base::pattern -+ money_base::_S_construct_pattern(char __precedes, char __space, char __posn) -+ { -+ pattern __ret; -+ -+ // This insanely complicated routine attempts to construct a valid -+ // pattern for use with monyepunct. A couple of invariants: -+ -+ // if (__precedes) symbol -> value -+ // else value -> symbol -+ -+ // if (__space) space -+ // else none -+ -+ // none == never first -+ // space never first or last -+ -+ // Any elegant implementations of this are welcome. -+ switch (__posn) -+ { -+ case 0: -+ case 1: -+ // 1 The sign precedes the value and symbol. -+ __ret.field[0] = sign; -+ if (__space) -+ { -+ // Pattern starts with sign. -+ if (__precedes) -+ { -+ __ret.field[1] = symbol; -+ __ret.field[3] = value; -+ } -+ else -+ { -+ __ret.field[1] = value; -+ __ret.field[3] = symbol; -+ } -+ __ret.field[2] = space; -+ } -+ else -+ { -+ // Pattern starts with sign and ends with none. -+ if (__precedes) -+ { -+ __ret.field[1] = symbol; -+ __ret.field[2] = value; -+ } -+ else -+ { -+ __ret.field[1] = value; -+ __ret.field[2] = symbol; -+ } -+ __ret.field[3] = none; -+ } -+ break; -+ case 2: -+ // 2 The sign follows the value and symbol. -+ if (__space) -+ { -+ // Pattern either ends with sign. -+ if (__precedes) -+ { -+ __ret.field[0] = symbol; -+ __ret.field[2] = value; -+ } -+ else -+ { -+ __ret.field[0] = value; -+ __ret.field[2] = symbol; -+ } -+ __ret.field[1] = space; -+ __ret.field[3] = sign; -+ } -+ else -+ { -+ // Pattern ends with sign then none. -+ if (__precedes) -+ { -+ __ret.field[0] = symbol; -+ __ret.field[1] = value; -+ } -+ else -+ { -+ __ret.field[0] = value; -+ __ret.field[1] = symbol; -+ } -+ __ret.field[2] = sign; -+ __ret.field[3] = none; -+ } -+ break; -+ case 3: -+ // 3 The sign immediately precedes the symbol. -+ if (__precedes) -+ { -+ __ret.field[0] = sign; -+ __ret.field[1] = symbol; -+ if (__space) -+ { -+ __ret.field[2] = space; -+ __ret.field[3] = value; -+ } -+ else -+ { -+ __ret.field[2] = value; -+ __ret.field[3] = none; -+ } -+ } -+ else -+ { -+ __ret.field[0] = value; -+ if (__space) -+ { -+ __ret.field[1] = space; -+ __ret.field[2] = sign; -+ __ret.field[3] = symbol; -+ } -+ else -+ { -+ __ret.field[1] = sign; -+ __ret.field[2] = symbol; -+ __ret.field[3] = none; -+ } -+ } -+ break; -+ case 4: -+ // 4 The sign immediately follows the symbol. -+ if (__precedes) -+ { -+ __ret.field[0] = symbol; -+ __ret.field[1] = sign; -+ if (__space) -+ { -+ __ret.field[2] = space; -+ __ret.field[3] = value; -+ } -+ else -+ { -+ __ret.field[2] = value; -+ __ret.field[3] = none; -+ } -+ } -+ else -+ { -+ __ret.field[0] = value; -+ if (__space) -+ { -+ __ret.field[1] = space; -+ __ret.field[2] = symbol; -+ __ret.field[3] = sign; -+ } -+ else -+ { -+ __ret.field[1] = symbol; -+ __ret.field[2] = sign; -+ __ret.field[3] = none; -+ } -+ } -+ break; -+ default: -+ __ret = pattern(); -+ } -+ return __ret; -+ } -+ -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+ const char*) -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = '.'; -+ _M_data->_M_thousands_sep = ','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = ""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = ""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = ""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; -+ } -+ else -+ { -+ // Named locale. -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, -+ __cloc)); -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, -+ __cloc)); -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); -+ -+ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); -+ if (!__nposn) -+ _M_data->_M_negative_sign = "()"; -+ else -+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, -+ __cloc); -+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); -+ -+ // _Intl == true -+ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); -+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, -+ __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ } -+ } -+ -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+ const char*) -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = '.'; -+ _M_data->_M_thousands_sep = ','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = ""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = ""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = ""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; -+ } -+ else -+ { -+ // Named locale. -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, -+ __cloc)); -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, -+ __cloc)); -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); -+ -+ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); -+ if (!__nposn) -+ _M_data->_M_negative_sign = "()"; -+ else -+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, -+ __cloc); -+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); -+ -+ // _Intl == false -+ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); -+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ } -+ } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { delete _M_data; } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { delete _M_data; } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ const char*) -+#else -+ const char* __name) -+#endif -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = L'.'; -+ _M_data->_M_thousands_sep = L','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ // Use ctype::widen code without the facet... -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = -+ static_cast(money_base::_S_atoms[__i]); -+ } -+ else -+ { -+ // Named locale. -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(__cloc); -+#else -+ // Switch to named locale so that mbsrtowcs will work. -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, __name); -+#endif -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this... should be monetary -+#endif -+#ifdef __UCLIBC__ -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc; -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; -+# elif defined __UCLIBC_HAS_LOCALE__ -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; -+# endif -+#else -+ union { char *__s; wchar_t __w; } __u; -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); -+ _M_data->_M_decimal_point = __u.__w; -+ -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); -+ _M_data->_M_thousands_sep = __u.__w; -+#endif -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ -+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); -+ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); -+ -+ wchar_t* __wcs_ps = 0; -+ wchar_t* __wcs_ns = 0; -+ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); -+ try -+ { -+ mbstate_t __state; -+ size_t __len = strlen(__cpossign); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ps = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); -+ _M_data->_M_positive_sign = __wcs_ps; -+ } -+ else -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); -+ -+ __len = strlen(__cnegsign); -+ if (!__nposn) -+ _M_data->_M_negative_sign = L"()"; -+ else if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ns = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); -+ _M_data->_M_negative_sign = __wcs_ns; -+ } -+ else -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); -+ -+ // _Intl == true. -+ __len = strlen(__ccurr); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ wchar_t* __wcs = new wchar_t[__len]; -+ mbsrtowcs(__wcs, &__ccurr, __len, &__state); -+ _M_data->_M_curr_symbol = __wcs; -+ } -+ else -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); -+ } -+ catch (...) -+ { -+ delete _M_data; -+ _M_data = 0; -+ delete __wcs_ps; -+ delete __wcs_ns; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ __throw_exception_again; -+ } -+ -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, -+ __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ } -+ } -+ -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ const char*) -+#else -+ const char* __name) -+#endif -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = L'.'; -+ _M_data->_M_thousands_sep = L','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ // Use ctype::widen code without the facet... -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = -+ static_cast(money_base::_S_atoms[__i]); -+ } -+ else -+ { -+ // Named locale. -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(__cloc); -+#else -+ // Switch to named locale so that mbsrtowcs will work. -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, __name); -+#endif -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this... should be monetary -+#endif -+#ifdef __UCLIBC__ -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc; -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; -+# elif defined __UCLIBC_HAS_LOCALE__ -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; -+# endif -+#else -+ union { char *__s; wchar_t __w; } __u; -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); -+ _M_data->_M_decimal_point = __u.__w; -+ -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); -+ _M_data->_M_thousands_sep = __u.__w; -+#endif -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ -+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); -+ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); -+ -+ wchar_t* __wcs_ps = 0; -+ wchar_t* __wcs_ns = 0; -+ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); -+ try -+ { -+ mbstate_t __state; -+ size_t __len; -+ __len = strlen(__cpossign); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ps = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); -+ _M_data->_M_positive_sign = __wcs_ps; -+ } -+ else -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); -+ -+ __len = strlen(__cnegsign); -+ if (!__nposn) -+ _M_data->_M_negative_sign = L"()"; -+ else if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ns = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); -+ _M_data->_M_negative_sign = __wcs_ns; -+ } -+ else -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); -+ -+ // _Intl == true. -+ __len = strlen(__ccurr); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ wchar_t* __wcs = new wchar_t[__len]; -+ mbsrtowcs(__wcs, &__ccurr, __len, &__state); -+ _M_data->_M_curr_symbol = __wcs; -+ } -+ else -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); -+ } -+ catch (...) -+ { -+ delete _M_data; -+ _M_data = 0; -+ delete __wcs_ps; -+ delete __wcs_ns; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ __throw_exception_again; -+ } -+ -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ } -+ } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { -+ if (_M_data->_M_positive_sign_size) -+ delete [] _M_data->_M_positive_sign; -+ if (_M_data->_M_negative_sign_size -+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) -+ delete [] _M_data->_M_negative_sign; -+ if (_M_data->_M_curr_symbol_size) -+ delete [] _M_data->_M_curr_symbol; -+ delete _M_data; -+ } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { -+ if (_M_data->_M_positive_sign_size) -+ delete [] _M_data->_M_positive_sign; -+ if (_M_data->_M_negative_sign_size -+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) -+ delete [] _M_data->_M_negative_sign; -+ if (_M_data->_M_curr_symbol_size) -+ delete [] _M_data->_M_curr_symbol; -+ delete _M_data; -+ } -+#endif -+} ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc -@@ -0,0 +1,173 @@ -+// std::numpunct implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#define _LIBC -+#include -+#undef _LIBC -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning tailor for stub locale support -+#endif -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __nl_langinfo_l(N, L) nl_langinfo((N)) -+#endif -+ -+namespace std -+{ -+ template<> -+ void -+ numpunct::_M_initialize_numpunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __numpunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_use_grouping = false; -+ -+ _M_data->_M_decimal_point = '.'; -+ _M_data->_M_thousands_sep = ','; -+ -+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) -+ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; -+ -+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) -+ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j]; -+ } -+ else -+ { -+ // Named locale. -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, -+ __cloc)); -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, -+ __cloc)); -+ -+ // Check for NULL, which implies no grouping. -+ if (_M_data->_M_thousands_sep == '\0') -+ _M_data->_M_grouping = ""; -+ else -+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ } -+ -+ // NB: There is no way to extact this info from posix locales. -+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); -+ _M_data->_M_truename = "true"; -+ _M_data->_M_truename_size = 4; -+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); -+ _M_data->_M_falsename = "false"; -+ _M_data->_M_falsename_size = 5; -+ } -+ -+ template<> -+ numpunct::~numpunct() -+ { delete _M_data; } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ void -+ numpunct::_M_initialize_numpunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __numpunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_use_grouping = false; -+ -+ _M_data->_M_decimal_point = L'.'; -+ _M_data->_M_thousands_sep = L','; -+ -+ // Use ctype::widen code without the facet... -+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) -+ _M_data->_M_atoms_out[__i] = -+ static_cast(__num_base::_S_atoms_out[__i]); -+ -+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) -+ _M_data->_M_atoms_in[__j] = -+ static_cast(__num_base::_S_atoms_in[__j]); -+ } -+ else -+ { -+ // Named locale. -+ // NB: In the GNU model wchar_t is always 32 bit wide. -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this -+#endif -+#ifdef __UCLIBC__ -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc; -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; -+# elif defined __UCLIBC_HAS_LOCALE__ -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; -+# endif -+#else -+ union { char *__s; wchar_t __w; } __u; -+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); -+ _M_data->_M_decimal_point = __u.__w; -+ -+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); -+ _M_data->_M_thousands_sep = __u.__w; -+#endif -+ -+ if (_M_data->_M_thousands_sep == L'\0') -+ _M_data->_M_grouping = ""; -+ else -+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ } -+ -+ // NB: There is no way to extact this info from posix locales. -+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); -+ _M_data->_M_truename = L"true"; -+ _M_data->_M_truename_size = 4; -+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); -+ _M_data->_M_falsename = L"false"; -+ _M_data->_M_falsename_size = 5; -+ } -+ -+ template<> -+ numpunct::~numpunct() -+ { delete _M_data; } -+ #endif -+} ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc -@@ -0,0 +1,406 @@ -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning tailor for stub locale support -+#endif -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __nl_langinfo_l(N, L) nl_langinfo((N)) -+#endif -+ -+namespace std -+{ -+ template<> -+ void -+ __timepunct:: -+ _M_put(char* __s, size_t __maxlen, const char* __format, -+ const tm* __tm) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, -+ _M_c_locale_timepunct); -+#else -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_timepunct); -+ const size_t __len = strftime(__s, __maxlen, __format, __tm); -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ // Make sure __s is null terminated. -+ if (__len == 0) -+ __s[0] = '\0'; -+ } -+ -+ template<> -+ void -+ __timepunct::_M_initialize_timepunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __timepunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_c_locale_timepunct = _S_get_c_locale(); -+ -+ _M_data->_M_date_format = "%m/%d/%y"; -+ _M_data->_M_date_era_format = "%m/%d/%y"; -+ _M_data->_M_time_format = "%H:%M:%S"; -+ _M_data->_M_time_era_format = "%H:%M:%S"; -+ _M_data->_M_date_time_format = ""; -+ _M_data->_M_date_time_era_format = ""; -+ _M_data->_M_am = "AM"; -+ _M_data->_M_pm = "PM"; -+ _M_data->_M_am_pm_format = ""; -+ -+ // Day names, starting with "C"'s Sunday. -+ _M_data->_M_day1 = "Sunday"; -+ _M_data->_M_day2 = "Monday"; -+ _M_data->_M_day3 = "Tuesday"; -+ _M_data->_M_day4 = "Wednesday"; -+ _M_data->_M_day5 = "Thursday"; -+ _M_data->_M_day6 = "Friday"; -+ _M_data->_M_day7 = "Saturday"; -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ _M_data->_M_aday1 = "Sun"; -+ _M_data->_M_aday2 = "Mon"; -+ _M_data->_M_aday3 = "Tue"; -+ _M_data->_M_aday4 = "Wed"; -+ _M_data->_M_aday5 = "Thu"; -+ _M_data->_M_aday6 = "Fri"; -+ _M_data->_M_aday7 = "Sat"; -+ -+ // Month names, starting with "C"'s January. -+ _M_data->_M_month01 = "January"; -+ _M_data->_M_month02 = "February"; -+ _M_data->_M_month03 = "March"; -+ _M_data->_M_month04 = "April"; -+ _M_data->_M_month05 = "May"; -+ _M_data->_M_month06 = "June"; -+ _M_data->_M_month07 = "July"; -+ _M_data->_M_month08 = "August"; -+ _M_data->_M_month09 = "September"; -+ _M_data->_M_month10 = "October"; -+ _M_data->_M_month11 = "November"; -+ _M_data->_M_month12 = "December"; -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ _M_data->_M_amonth01 = "Jan"; -+ _M_data->_M_amonth02 = "Feb"; -+ _M_data->_M_amonth03 = "Mar"; -+ _M_data->_M_amonth04 = "Apr"; -+ _M_data->_M_amonth05 = "May"; -+ _M_data->_M_amonth06 = "Jun"; -+ _M_data->_M_amonth07 = "Jul"; -+ _M_data->_M_amonth08 = "Aug"; -+ _M_data->_M_amonth09 = "Sep"; -+ _M_data->_M_amonth10 = "Oct"; -+ _M_data->_M_amonth11 = "Nov"; -+ _M_data->_M_amonth12 = "Dec"; -+ } -+ else -+ { -+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); -+ -+ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc); -+ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc); -+ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc); -+ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc); -+ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc); -+ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, -+ __cloc); -+ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc); -+ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc); -+ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc); -+ -+ // Day names, starting with "C"'s Sunday. -+ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc); -+ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc); -+ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc); -+ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc); -+ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc); -+ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc); -+ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc); -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc); -+ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc); -+ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc); -+ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc); -+ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc); -+ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc); -+ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc); -+ -+ // Month names, starting with "C"'s January. -+ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc); -+ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc); -+ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc); -+ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc); -+ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc); -+ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc); -+ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc); -+ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc); -+ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc); -+ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc); -+ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc); -+ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc); -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc); -+ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc); -+ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc); -+ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc); -+ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc); -+ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc); -+ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc); -+ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc); -+ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc); -+ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc); -+ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc); -+ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc); -+ } -+ } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ void -+ __timepunct:: -+ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, -+ const tm* __tm) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); -+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, -+ _M_c_locale_timepunct); -+#else -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_timepunct); -+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm); -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ // Make sure __s is null terminated. -+ if (__len == 0) -+ __s[0] = L'\0'; -+ } -+ -+ template<> -+ void -+ __timepunct::_M_initialize_timepunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __timepunct_cache; -+ -+#warning wide time stuff -+// if (!__cloc) -+ { -+ // "C" locale -+ _M_c_locale_timepunct = _S_get_c_locale(); -+ -+ _M_data->_M_date_format = L"%m/%d/%y"; -+ _M_data->_M_date_era_format = L"%m/%d/%y"; -+ _M_data->_M_time_format = L"%H:%M:%S"; -+ _M_data->_M_time_era_format = L"%H:%M:%S"; -+ _M_data->_M_date_time_format = L""; -+ _M_data->_M_date_time_era_format = L""; -+ _M_data->_M_am = L"AM"; -+ _M_data->_M_pm = L"PM"; -+ _M_data->_M_am_pm_format = L""; -+ -+ // Day names, starting with "C"'s Sunday. -+ _M_data->_M_day1 = L"Sunday"; -+ _M_data->_M_day2 = L"Monday"; -+ _M_data->_M_day3 = L"Tuesday"; -+ _M_data->_M_day4 = L"Wednesday"; -+ _M_data->_M_day5 = L"Thursday"; -+ _M_data->_M_day6 = L"Friday"; -+ _M_data->_M_day7 = L"Saturday"; -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ _M_data->_M_aday1 = L"Sun"; -+ _M_data->_M_aday2 = L"Mon"; -+ _M_data->_M_aday3 = L"Tue"; -+ _M_data->_M_aday4 = L"Wed"; -+ _M_data->_M_aday5 = L"Thu"; -+ _M_data->_M_aday6 = L"Fri"; -+ _M_data->_M_aday7 = L"Sat"; -+ -+ // Month names, starting with "C"'s January. -+ _M_data->_M_month01 = L"January"; -+ _M_data->_M_month02 = L"February"; -+ _M_data->_M_month03 = L"March"; -+ _M_data->_M_month04 = L"April"; -+ _M_data->_M_month05 = L"May"; -+ _M_data->_M_month06 = L"June"; -+ _M_data->_M_month07 = L"July"; -+ _M_data->_M_month08 = L"August"; -+ _M_data->_M_month09 = L"September"; -+ _M_data->_M_month10 = L"October"; -+ _M_data->_M_month11 = L"November"; -+ _M_data->_M_month12 = L"December"; -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ _M_data->_M_amonth01 = L"Jan"; -+ _M_data->_M_amonth02 = L"Feb"; -+ _M_data->_M_amonth03 = L"Mar"; -+ _M_data->_M_amonth04 = L"Apr"; -+ _M_data->_M_amonth05 = L"May"; -+ _M_data->_M_amonth06 = L"Jun"; -+ _M_data->_M_amonth07 = L"Jul"; -+ _M_data->_M_amonth08 = L"Aug"; -+ _M_data->_M_amonth09 = L"Sep"; -+ _M_data->_M_amonth10 = L"Oct"; -+ _M_data->_M_amonth11 = L"Nov"; -+ _M_data->_M_amonth12 = L"Dec"; -+ } -+#if 0 -+ else -+ { -+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); -+ -+ union { char *__s; wchar_t *__w; } __u; -+ -+ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc); -+ _M_data->_M_date_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc); -+ _M_data->_M_date_era_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc); -+ _M_data->_M_time_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc); -+ _M_data->_M_time_era_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc); -+ _M_data->_M_date_time_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc); -+ _M_data->_M_date_time_era_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc); -+ _M_data->_M_am = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc); -+ _M_data->_M_pm = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc); -+ _M_data->_M_am_pm_format = __u.__w; -+ -+ // Day names, starting with "C"'s Sunday. -+ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc); -+ _M_data->_M_day1 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc); -+ _M_data->_M_day2 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc); -+ _M_data->_M_day3 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc); -+ _M_data->_M_day4 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc); -+ _M_data->_M_day5 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc); -+ _M_data->_M_day6 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc); -+ _M_data->_M_day7 = __u.__w; -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc); -+ _M_data->_M_aday1 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc); -+ _M_data->_M_aday2 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc); -+ _M_data->_M_aday3 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc); -+ _M_data->_M_aday4 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc); -+ _M_data->_M_aday5 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc); -+ _M_data->_M_aday6 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc); -+ _M_data->_M_aday7 = __u.__w; -+ -+ // Month names, starting with "C"'s January. -+ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc); -+ _M_data->_M_month01 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc); -+ _M_data->_M_month02 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc); -+ _M_data->_M_month03 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc); -+ _M_data->_M_month04 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc); -+ _M_data->_M_month05 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc); -+ _M_data->_M_month06 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc); -+ _M_data->_M_month07 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc); -+ _M_data->_M_month08 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc); -+ _M_data->_M_month09 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc); -+ _M_data->_M_month10 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc); -+ _M_data->_M_month11 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc); -+ _M_data->_M_month12 = __u.__w; -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc); -+ _M_data->_M_amonth01 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc); -+ _M_data->_M_amonth02 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc); -+ _M_data->_M_amonth03 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc); -+ _M_data->_M_amonth04 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc); -+ _M_data->_M_amonth05 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc); -+ _M_data->_M_amonth06 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc); -+ _M_data->_M_amonth07 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc); -+ _M_data->_M_amonth08 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc); -+ _M_data->_M_amonth09 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc); -+ _M_data->_M_amonth10 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc); -+ _M_data->_M_amonth11 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc); -+ _M_data->_M_amonth12 = __u.__w; -+ } -+#endif // 0 -+ } -+#endif -+} ---- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h -+++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h -@@ -0,0 +1,76 @@ -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions -+// -+ -+// Written by Benjamin Kosnik -+ -+ template -+ __timepunct<_CharT>::__timepunct(size_t __refs) -+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -+ _M_name_timepunct(_S_get_c_name()) -+ { _M_initialize_timepunct(); } -+ -+ template -+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) -+ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), -+ _M_name_timepunct(_S_get_c_name()) -+ { _M_initialize_timepunct(); } -+ -+ template -+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, -+ size_t __refs) -+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -+ _M_name_timepunct(NULL) -+ { -+ const size_t __len = std::strlen(__s) + 1; -+ char* __tmp = new char[__len]; -+ std::memcpy(__tmp, __s, __len); -+ _M_name_timepunct = __tmp; -+ -+ try -+ { _M_initialize_timepunct(__cloc); } -+ catch(...) -+ { -+ delete [] _M_name_timepunct; -+ __throw_exception_again; -+ } -+ } -+ -+ template -+ __timepunct<_CharT>::~__timepunct() -+ { -+ if (_M_name_timepunct != _S_get_c_name()) -+ delete [] _M_name_timepunct; -+ delete _M_data; -+ _S_destroy_c_locale(_M_c_locale_timepunct); -+ } ---- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h -+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h -@@ -0,0 +1,64 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004 -+// Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+/** @file ctype_base.h -+ * This is an internal header file, included by other library headers. -+ * You should not attempt to use it directly. -+ */ -+ -+// Information as gleaned from /usr/include/ctype.h -+ -+ /// @brief Base class for ctype. -+ struct ctype_base -+ { -+ // Note: In uClibc, the following two types depend on configuration. -+ -+ // Non-standard typedefs. -+ typedef const __ctype_touplow_t* __to_type; -+ -+ // NB: Offsets into ctype::_M_table force a particular size -+ // on the mask type. Because of this, we don't use an enum. -+ typedef __ctype_mask_t mask; -+ static const mask upper = _ISupper; -+ static const mask lower = _ISlower; -+ static const mask alpha = _ISalpha; -+ static const mask digit = _ISdigit; -+ static const mask xdigit = _ISxdigit; -+ static const mask space = _ISspace; -+ static const mask print = _ISprint; -+ static const mask graph = _ISalpha | _ISdigit | _ISpunct; -+ static const mask cntrl = _IScntrl; -+ static const mask punct = _ISpunct; -+ static const mask alnum = _ISalpha | _ISdigit; -+ }; ---- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h -+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h -@@ -0,0 +1,69 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 2000, 2002 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) -+// functions go in ctype.cc -+ -+ bool -+ ctype:: -+ is(mask __m, char __c) const -+ { return _M_table[static_cast(__c)] & __m; } -+ -+ const char* -+ ctype:: -+ is(const char* __low, const char* __high, mask* __vec) const -+ { -+ while (__low < __high) -+ *__vec++ = _M_table[static_cast(*__low++)]; -+ return __high; -+ } -+ -+ const char* -+ ctype:: -+ scan_is(mask __m, const char* __low, const char* __high) const -+ { -+ while (__low < __high -+ && !(_M_table[static_cast(*__low)] & __m)) -+ ++__low; -+ return __low; -+ } -+ -+ const char* -+ ctype:: -+ scan_not(mask __m, const char* __low, const char* __high) const -+ { -+ while (__low < __high -+ && (_M_table[static_cast(*__low)] & __m) != 0) -+ ++__low; -+ return __low; -+ } ---- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h -+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h -@@ -0,0 +1,92 @@ -+// Locale support -*- C++ -*- -+ -+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 -+// Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.1 Locales -+// -+ -+// Information as gleaned from /usr/include/ctype.h -+ -+ const ctype_base::mask* -+ ctype::classic_table() throw() -+ { return __C_ctype_b; } -+ -+ ctype::ctype(__c_locale, const mask* __table, bool __del, -+ size_t __refs) -+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), -+ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) -+ { -+ _M_toupper = __C_ctype_toupper; -+ _M_tolower = __C_ctype_tolower; -+ _M_table = __table ? __table : __C_ctype_b; -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ } -+ -+ ctype::ctype(const mask* __table, bool __del, size_t __refs) -+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), -+ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) -+ { -+ _M_toupper = __C_ctype_toupper; -+ _M_tolower = __C_ctype_tolower; -+ _M_table = __table ? __table : __C_ctype_b; -+ memset(_M_widen, 0, sizeof(_M_widen)); -+ memset(_M_narrow, 0, sizeof(_M_narrow)); -+ } -+ -+ char -+ ctype::do_toupper(char __c) const -+ { return _M_toupper[static_cast(__c)]; } -+ -+ const char* -+ ctype::do_toupper(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = _M_toupper[static_cast(*__low)]; -+ ++__low; -+ } -+ return __high; -+ } -+ -+ char -+ ctype::do_tolower(char __c) const -+ { return _M_tolower[static_cast(__c)]; } -+ -+ const char* -+ ctype::do_tolower(char* __low, const char* __high) const -+ { -+ while (__low < __high) -+ { -+ *__low = _M_tolower[static_cast(*__low)]; -+ ++__low; -+ } -+ return __high; -+ } ---- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h -+++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h -@@ -0,0 +1,44 @@ -+// Specific definitions for GNU/Linux -*- C++ -*- -+ -+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+#ifndef _GLIBCXX_OS_DEFINES -+#define _GLIBCXX_OS_DEFINES 1 -+ -+// System-specific #define, typedefs, corrections, etc, go here. This -+// file will come before all others. -+ -+// This keeps isanum, et al from being propagated as macros. -+#define __NO_CTYPE 1 -+ -+#include -+ -+// We must not see the optimized string functions GNU libc defines. -+#define __NO_STRING_INLINES -+ -+#endif ---- gcc-4.1.0-dist/libstdc++-v3/configure -+++ gcc-4.1.0/libstdc++-v3/configure -@@ -4005,6 +4005,11 @@ - lt_cv_deplibs_check_method=pass_all - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' -@@ -5740,7 +5745,7 @@ - enableval="$enable_clocale" - - case "$enableval" in -- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;; -+ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;; - *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;} - { (exit 1); exit 1; }; } ;; -@@ -5765,6 +5770,9 @@ - # Default to "generic". - if test $enable_clocale_flag = auto; then - case ${target_os} in -+ linux-uclibc*) -+ enable_clocale_flag=uclibc -+ ;; - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ -@@ -5995,6 +6003,76 @@ - CTIME_CC=config/locale/generic/time_members.cc - CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h - ;; -+ uclibc) -+ echo "$as_me:$LINENO: result: uclibc" >&5 -+echo "${ECHO_T}uclibc" >&6 -+ -+ # Declare intention to use gettext, and add support for specific -+ # languages. -+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT -+ ALL_LINGUAS="de fr" -+ -+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. -+ # Extract the first word of "msgfmt", so it can be a program name with args. -+set dummy msgfmt; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$check_msgfmt"; then -+ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_check_msgfmt="yes" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" -+fi -+fi -+check_msgfmt=$ac_cv_prog_check_msgfmt -+if test -n "$check_msgfmt"; then -+ echo "$as_me:$LINENO: result: $check_msgfmt" >&5 -+echo "${ECHO_T}$check_msgfmt" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then -+ USE_NLS=yes -+ fi -+ # Export the build objects. -+ for ling in $ALL_LINGUAS; do \ -+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ -+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ -+ done -+ -+ -+ -+ CLOCALE_H=config/locale/uclibc/c_locale.h -+ CLOCALE_CC=config/locale/uclibc/c_locale.cc -+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc -+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc -+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc -+ CMESSAGES_H=config/locale/uclibc/messages_members.h -+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc -+ CMONEY_CC=config/locale/uclibc/monetary_members.cc -+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc -+ CTIME_H=config/locale/uclibc/time_members.h -+ CTIME_CC=config/locale/uclibc/time_members.cc -+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h -+ ;; - esac - - # This is where the testsuite looks for locale catalogs, using the ---- gcc-4.1.0-dist/libstdc++-v3/configure.host -+++ gcc-4.1.0/libstdc++-v3/configure.host -@@ -261,6 +261,12 @@ - ;; - esac - -+# Override for uClibc since linux-uclibc gets mishandled above. -+case "${host_os}" in -+ *-uclibc*) -+ os_include_dir="os/uclibc" -+ ;; -+esac - - # Set any OS-dependent and CPU-dependent bits. - # THIS TABLE IS SORTED. KEEP IT THAT WAY. ---- gcc-4.1.0-dist/libstdc++-v3/crossconfig.m4 -+++ gcc-4.1.0/libstdc++-v3/crossconfig.m4 -@@ -143,6 +143,99 @@ - ;; - esac - ;; -+ *-uclibc*) -+# Temporary hack until we implement the float versions of the libm funcs -+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ -+ machine/endian.h machine/param.h sys/machine.h sys/types.h \ -+ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) -+ SECTION_FLAGS='-ffunction-sections -fdata-sections' -+ AC_SUBST(SECTION_FLAGS) -+ GLIBCXX_CHECK_LINKER_FEATURES -+ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT -+ GLIBCXX_CHECK_WCHAR_T_SUPPORT -+ -+ # For LFS. -+ AC_DEFINE(HAVE_INT64_T) -+ case "$target" in -+ *-uclinux*) -+ # Don't enable LFS with uClinux -+ ;; -+ *) -+ AC_DEFINE(_GLIBCXX_USE_LFS) -+ esac -+ -+ # For showmanyc_helper(). -+ AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h) -+ GLIBCXX_CHECK_POLL -+ GLIBCXX_CHECK_S_ISREG_OR_S_IFREG -+ -+ # For xsputn_2(). -+ AC_CHECK_HEADERS(sys/uio.h) -+ GLIBCXX_CHECK_WRITEV -+ -+# AC_DEFINE(HAVE_ACOSF) -+# AC_DEFINE(HAVE_ASINF) -+# AC_DEFINE(HAVE_ATANF) -+# AC_DEFINE(HAVE_ATAN2F) -+ AC_DEFINE(HAVE_CEILF) -+ AC_DEFINE(HAVE_COPYSIGN) -+# AC_DEFINE(HAVE_COPYSIGNF) -+# AC_DEFINE(HAVE_COSF) -+# AC_DEFINE(HAVE_COSHF) -+# AC_DEFINE(HAVE_EXPF) -+# AC_DEFINE(HAVE_FABSF) -+ AC_DEFINE(HAVE_FINITE) -+ AC_DEFINE(HAVE_FINITEF) -+ AC_DEFINE(HAVE_FLOORF) -+# AC_DEFINE(HAVE_FMODF) -+# AC_DEFINE(HAVE_FREXPF) -+ AC_DEFINE(HAVE_HYPOT) -+# AC_DEFINE(HAVE_HYPOTF) -+ AC_DEFINE(HAVE_ISINF) -+ AC_DEFINE(HAVE_ISINFF) -+ AC_DEFINE(HAVE_ISNAN) -+ AC_DEFINE(HAVE_ISNANF) -+# AC_DEFINE(HAVE_LOGF) -+# AC_DEFINE(HAVE_LOG10F) -+# AC_DEFINE(HAVE_MODFF) -+# AC_DEFINE(HAVE_SINF) -+# AC_DEFINE(HAVE_SINHF) -+# AC_DEFINE(HAVE_SINCOS) -+# AC_DEFINE(HAVE_SINCOSF) -+ AC_DEFINE(HAVE_SQRTF) -+# AC_DEFINE(HAVE_TANF) -+# AC_DEFINE(HAVE_TANHF) -+ if test x"long_double_math_on_this_cpu" = x"yes"; then -+ AC_MSG_ERROR([long_double_math_on_this_cpu is yes!]) -+# AC_DEFINE(HAVE_ACOSL) -+# AC_DEFINE(HAVE_ASINL) -+# AC_DEFINE(HAVE_ATANL) -+# AC_DEFINE(HAVE_ATAN2L) -+# AC_DEFINE(HAVE_CEILL) -+# AC_DEFINE(HAVE_COPYSIGNL) -+# AC_DEFINE(HAVE_COSL) -+# AC_DEFINE(HAVE_COSHL) -+# AC_DEFINE(HAVE_EXPL) -+# AC_DEFINE(HAVE_FABSL) -+# AC_DEFINE(HAVE_FINITEL) -+# AC_DEFINE(HAVE_FLOORL) -+# AC_DEFINE(HAVE_FMODL) -+# AC_DEFINE(HAVE_FREXPL) -+# AC_DEFINE(HAVE_HYPOTL) -+# AC_DEFINE(HAVE_ISINFL) -+# AC_DEFINE(HAVE_ISNANL) -+# AC_DEFINE(HAVE_LOGL) -+# AC_DEFINE(HAVE_LOG10L) -+# AC_DEFINE(HAVE_MODFL) -+# AC_DEFINE(HAVE_POWL) -+# AC_DEFINE(HAVE_SINL) -+# AC_DEFINE(HAVE_SINHL) -+# AC_DEFINE(HAVE_SINCOSL) -+# AC_DEFINE(HAVE_SQRTL) -+# AC_DEFINE(HAVE_TANL) -+# AC_DEFINE(HAVE_TANHL) -+ fi -+ ;; - *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu) - AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ - machine/endian.h machine/param.h sys/machine.h sys/types.h \ -@@ -157,7 +250,7 @@ - AC_DEFINE(HAVE_INT64_T) - case "$target" in - *-uclinux*) -- # Don't enable LFS with uClibc -+ # Don't enable LFS with uClinux - ;; - *) - AC_DEFINE(_GLIBCXX_USE_LFS) ---- gcc-4.1.0-dist/libstdc++-v3/include/c_compatibility/wchar.h -+++ gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h -@@ -101,7 +101,9 @@ - using std::wmemcpy; - using std::wmemmove; - using std::wmemset; -+#if _GLIBCXX_HAVE_WCSFTIME - using std::wcsftime; -+#endif - - #if _GLIBCXX_USE_C99 - using std::wcstold; ---- gcc-4.1.0-dist/libstdc++-v3/include/c_std/std_cwchar.h -+++ gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h -@@ -180,7 +180,9 @@ - using ::wcscoll; - using ::wcscpy; - using ::wcscspn; -+#if _GLIBCXX_HAVE_WCSFTIME - using ::wcsftime; -+#endif - using ::wcslen; - using ::wcsncat; - using ::wcsncmp; diff --git a/toolchain/gcc/4.1.2/300-libstdc++-pic.patch b/toolchain/gcc/4.1.2/300-libstdc++-pic.patch deleted file mode 100644 index 560bcb237..000000000 --- a/toolchain/gcc/4.1.2/300-libstdc++-pic.patch +++ /dev/null @@ -1,50 +0,0 @@ -# DP: Build and install libstdc++_pic.a library. - ---- gcc/libstdc++-v3/src/Makefile.am -+++ gcc/libstdc++-v3/src/Makefile.am -@@ -214,6 +214,12 @@ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@ - - -+install-exec-local: -+ifeq ($(enable_shared),yes) -+ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o -+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) -+endif -+ - # Added bits to build debug library. - if GLIBCXX_BUILD_DEBUG - all-local: build_debug ---- gcc/libstdc++-v3/src/Makefile.in -+++ gcc/libstdc++-v3/src/Makefile.in -@@ -627,7 +627,7 @@ - - install-data-am: install-data-local - --install-exec-am: install-toolexeclibLTLIBRARIES -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local - - install-info: install-info-am - -@@ -660,6 +660,7 @@ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-data-local install-exec \ -+ install-exec-local \ - install-exec-am install-info install-info-am install-man \ - install-strip install-toolexeclibLTLIBRARIES installcheck \ - installcheck-am installdirs maintainer-clean \ -@@ -743,6 +743,13 @@ - install_debug: - (cd ${debugdir} && $(MAKE) \ - toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) -+ -+install-exec-local: -+ifeq ($(enable_shared),yes) -+ $(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o -+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) -+endif -+ - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. - .NOEXPORT: diff --git a/toolchain/gcc/4.1.2/301-missing-execinfo_h.patch b/toolchain/gcc/4.1.2/301-missing-execinfo_h.patch deleted file mode 100644 index 0e2092f3f..000000000 --- a/toolchain/gcc/4.1.2/301-missing-execinfo_h.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500 -+++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500 -@@ -500,7 +500,7 @@ - #ifdef __linux__ - # include - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ -- && !defined(__ia64__) -+ && !defined(__ia64__) && !defined(__UCLIBC__) - # ifndef GC_HAVE_BUILTIN_BACKTRACE - # define GC_HAVE_BUILTIN_BACKTRACE - # endif diff --git a/toolchain/gcc/4.1.2/302-c99-snprintf.patch b/toolchain/gcc/4.1.2/302-c99-snprintf.patch deleted file mode 100644 index dfb22d681..000000000 --- a/toolchain/gcc/4.1.2/302-c99-snprintf.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h-orig 2005-04-29 00:08:41.000000000 -0500 -+++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h 2005-04-29 00:08:45.000000000 -0500 -@@ -142,7 +142,7 @@ - using ::vsprintf; - } - --#if _GLIBCXX_USE_C99 -+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__) - - #undef snprintf - #undef vfscanf diff --git a/toolchain/gcc/4.1.2/303-c99-complex-ugly-hack.patch b/toolchain/gcc/4.1.2/303-c99-complex-ugly-hack.patch deleted file mode 100644 index 2ccc80d9b..000000000 --- a/toolchain/gcc/4.1.2/303-c99-complex-ugly-hack.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- gcc-4.0.0/libstdc++-v3/configure-old 2005-04-30 22:04:48.061603912 -0500 -+++ gcc-4.0.0/libstdc++-v3/configure 2005-04-30 22:06:13.678588152 -0500 -@@ -7194,6 +7194,9 @@ - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include -+#ifdef __UCLIBC__ -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs -+#endif - int - main () - { diff --git a/toolchain/gcc/4.1.2/304-index_macro.patch b/toolchain/gcc/4.1.2/304-index_macro.patch deleted file mode 100644 index 1fac112fa..000000000 --- a/toolchain/gcc/4.1.2/304-index_macro.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps 2006-03-24 01:49:51 +0100 -+++ gcc-4.1.0/libstdc++-v3/include/ext/rope 2006-03-24 01:49:37 +0100 -@@ -59,6 +59,9 @@ - #include - #include - -+/* cope w/ index defined as macro, SuSv3 proposal */ -+#undef index -+ - # ifdef __GC - # define __GC_CONST const - # else ---- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps 2006-03-24 01:50:04 +0100 -+++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h 2006-03-24 01:50:28 +0100 -@@ -53,6 +53,9 @@ - #include // For uninitialized_copy_n - #include // For power - -+/* cope w/ index defined as macro, SuSv3 proposal */ -+#undef index -+ - namespace __gnu_cxx - { - using std::size_t; diff --git a/toolchain/gcc/4.1.2/402-libbackend_dep_gcov-iov.h.patch b/toolchain/gcc/4.1.2/402-libbackend_dep_gcov-iov.h.patch deleted file mode 100644 index b7d9bb993..000000000 --- a/toolchain/gcc/4.1.2/402-libbackend_dep_gcov-iov.h.patch +++ /dev/null @@ -1,12 +0,0 @@ -# gcc.gnu.org/PR30620 ---- gcc-4.1.2-20070208.orig/gcc/Makefile.in 2006-11-01 15:40:44.000000000 +0100 -+++ gcc-4.1.2-20070208/gcc/Makefile.in 2007-02-13 19:23:31.000000000 +0100 -@@ -2522,7 +2522,7 @@ - # FIXME: writing proper dependencies for this is a *LOT* of work. - libbackend.o : $(OBJS-common:.o=.c) $(out_file) \ - insn-config.h insn-flags.h insn-codes.h insn-constants.h \ -- insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) -+ insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ - -DTARGET_NAME=\"$(target_noncanonical)\" \ - -DLOCALEDIR=\"$(localedir)\" \ diff --git a/toolchain/gcc/4.1.2/740-sh-pr24836.patch b/toolchain/gcc/4.1.2/740-sh-pr24836.patch deleted file mode 100644 index 7992282cf..000000000 --- a/toolchain/gcc/4.1.2/740-sh-pr24836.patch +++ /dev/null @@ -1,25 +0,0 @@ -http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836 - ---- gcc/gcc/configure.ac (revision 106699) -+++ gcc/gcc/configure.ac (working copy) -@@ -2446,7 +2446,7 @@ - tls_first_minor=14 - tls_as_opt="-m64 -Aesame --fatal-warnings" - ;; -- sh-*-* | sh[34]-*-*) -+ sh-*-* | sh[34]*-*-*) - conftest_s=' - .section ".tdata","awT",@progbits - foo: .long 25 ---- gcc/gcc/configure -+++ gcc/gcc/configure -@@ -14846,7 +14846,7 @@ - tls_first_minor=14 - tls_as_opt="-m64 -Aesame --fatal-warnings" - ;; -- sh-*-* | sh[34]-*-*) -+ sh-*-* | sh[34]*-*-*) - conftest_s=' - .section ".tdata","awT",@progbits - foo: .long 25 diff --git a/toolchain/gcc/4.1.2/800-arm-bigendian.patch b/toolchain/gcc/4.1.2/800-arm-bigendian.patch deleted file mode 100644 index 0a9417419..000000000 --- a/toolchain/gcc/4.1.2/800-arm-bigendian.patch +++ /dev/null @@ -1,127 +0,0 @@ -By Lennert Buytenhek -Adds support for arm*b-linux* big-endian ARM targets - -See http://gcc.gnu.org/PR16350 - -Index: gcc-4.1.1/gcc/config/arm/linux-elf.h -=================================================================== ---- gcc-4.1.1.orig/gcc/config/arm/linux-elf.h -+++ gcc-4.1.1/gcc/config/arm/linux-elf.h -@@ -28,19 +28,33 @@ - #undef TARGET_VERSION - #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr); - -+/* -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-* -+ * (big endian) configurations. -+ */ -+#if TARGET_BIG_ENDIAN_DEFAULT -+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END -+#define TARGET_ENDIAN_OPTION "mbig-endian" -+#define TARGET_LINKER_EMULATION "armelfb_linux" -+#else -+#define TARGET_ENDIAN_DEFAULT 0 -+#define TARGET_ENDIAN_OPTION "mlittle-endian" -+#define TARGET_LINKER_EMULATION "armelf_linux" -+#endif -+ - #undef TARGET_DEFAULT_FLOAT_ABI - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD - - #undef TARGET_DEFAULT --#define TARGET_DEFAULT (0) -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT) - - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 - --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p" -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" - - #undef MULTILIB_DEFAULTS - #define MULTILIB_DEFAULTS \ -- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } -+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" } - - /* Now we define the strings used to build the spec file. */ - #undef LIB_SPEC -@@ -61,7 +75,7 @@ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \ - -X \ -- %{mbig-endian:-EB}" \ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ - SUBTARGET_EXTRA_LINK_SPEC - - #undef LINK_SPEC -Index: gcc-4.1.1/gcc/config.gcc -=================================================================== ---- gcc-4.1.1.orig/gcc/config.gcc -+++ gcc-4.1.1/gcc/config.gcc -@@ -672,6 +672,11 @@ arm*-*-netbsd*) - ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" -+ case $target in -+ arm*b-*) -+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" -+ ;; -+ esac - tmake_file="${tmake_file} t-linux arm/t-arm" - case ${target} in - arm*-*-linux-gnueabi) -Index: gcc-4.1.1/gcc/config/arm/linux-eabi.h -=================================================================== ---- gcc-4.1.1.orig/gcc/config/arm/linux-eabi.h -+++ gcc-4.1.1/gcc/config/arm/linux-eabi.h -@@ -20,6 +20,17 @@ - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -+/* -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-* -+ * (big endian) configurations. -+ */ -+#undef TARGET_LINKER_EMULATION -+#if TARGET_BIG_ENDIAN_DEFAULT -+#define TARGET_LINKER_EMULATION "armelfb_linux_eabi" -+#else -+#define TARGET_LINKER_EMULATION "armelf_linux_eabi" -+#endif -+ - /* On EABI GNU/Linux, we want both the BPABI builtins and the - GNU/Linux builtins. */ - #undef TARGET_OS_CPP_BUILTINS -@@ -48,7 +59,7 @@ - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi - - #undef SUBTARGET_EXTRA_LINK_SPEC --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi" -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION - - /* Use ld-linux.so.3 so that it will be possible to run "classic" - GNU/Linux binaries on an EABI system. */ -Index: gcc-4.1.1/gcc/config/arm/bpabi.h -=================================================================== ---- gcc-4.1.1.orig/gcc/config/arm/bpabi.h -+++ gcc-4.1.1/gcc/config/arm/bpabi.h -@@ -33,9 +33,19 @@ - #undef FPUTYPE_DEFAULT - #define FPUTYPE_DEFAULT FPUTYPE_VFP - -+/* -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-* -+ * (big endian) configurations. -+ */ -+#if TARGET_BIG_ENDIAN_DEFAULT -+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END -+#else -+#define TARGET_ENDIAN_DEFAULT 0 -+#endif -+ - /* EABI targets should enable interworking by default. */ - #undef TARGET_DEFAULT --#define TARGET_DEFAULT MASK_INTERWORK -+#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT) - - /* The ARM BPABI functions return a boolean; they use no special - calling convention. */ diff --git a/toolchain/gcc/4.1.2/801-arm-bootstrap-libgcc.patch b/toolchain/gcc/4.1.2/801-arm-bootstrap-libgcc.patch deleted file mode 100644 index 078da5bb4..000000000 --- a/toolchain/gcc/4.1.2/801-arm-bootstrap-libgcc.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff -ur gcc-4.1.2/gcc/config/arm/unwind-arm.c gcc-4.1.2-patched/gcc/config/arm/unwind-arm.c ---- gcc-4.1.2/gcc/config/arm/unwind-arm.c 2006-09-20 12:31:12.000000000 -0500 -+++ gcc-4.1.2-patched/gcc/config/arm/unwind-arm.c 2008-02-27 13:30:45.339282365 -0600 -@@ -29,7 +29,13 @@ - - /* We add a prototype for abort here to avoid creating a dependency on - target headers. */ -+#ifndef BOOTSTRAP_GCC - extern void abort (void); -+#else -+void abort (void) -+{ -+} -+#endif - - /* Definitions for C++ runtime support routines. We make these weak - declarations to avoid pulling in libsupc++ unnecessarily. */ -@@ -542,7 +548,9 @@ - { - UCB_SAVED_CALLSITE_ADDR (ucbp) = saved_vrs.core.r[R_PC]; - -+#ifndef BOOTSTRAP_GCC - next_vrs = saved_vrs; -+#endif - - /* Call the pr to decide what to do. */ - pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) -@@ -572,7 +580,9 @@ - if (entry_code != _URC_OK) - return entry_code; - -+#ifndef BOOTSTRAP_GCC - saved_vrs = next_vrs; -+#endif - } - while (pr_result == _URC_CONTINUE_UNWIND); - -diff -ur gcc-4.1.2/gcc/mklibgcc.in gcc-4.1.2-patched/gcc/mklibgcc.in ---- gcc-4.1.2/gcc/mklibgcc.in 2006-09-10 02:13:12.000000000 -0500 -+++ gcc-4.1.2-patched/gcc/mklibgcc.in 2008-02-27 13:39:15.697843177 -0600 -@@ -169,7 +169,7 @@ - # It is too hard to guarantee that vis_hide and gen-hide-list will never - # be referenced if SHLIB_LINK is not set, so set them to the values they'd - # have if SHLIB_LINK were set and we didn't have visibility support. -- echo "vis_hide =" -+ echo "vis_hide :=-DBOOTSTRAP_GCC" - echo "gen-hide-list = echo > \$@" - fi - -diff -ur gcc-4.1.2/gcc/unwind-dw2.c gcc-4.1.2-patched/gcc/unwind-dw2.c ---- gcc-4.1.2/gcc/unwind-dw2.c 2005-11-17 19:19:10.000000000 -0600 -+++ gcc-4.1.2-patched/gcc/unwind-dw2.c 2008-02-27 13:29:55.414640030 -0600 -@@ -1311,8 +1311,10 @@ - void *c = current->reg[i]; - void *t = target->reg[i]; - -+#ifndef BOOTSTRAP_GCC - if (t && c && t != c) - memcpy (c, t, dwarf_reg_size_table[i]); -+#endif - } - - /* If the current frame doesn't have a saved stack pointer, then we diff --git a/toolchain/gcc/4.1.2/910-soft-float.patch b/toolchain/gcc/4.1.2/910-soft-float.patch deleted file mode 100644 index 3f886acbf..000000000 --- a/toolchain/gcc/4.1.2/910-soft-float.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- gcc-4.2-20061205/gcc/config/arm/t-linux 2006-12-08 15:18:33.000000000 -0800 -+++ gcc-4.2-20061205/gcc/config/arm/t-linux 2006-12-08 15:18:33.000000000 -0800 -@@ -4,7 +4,10 @@ - LIBGCC2_DEBUG_CFLAGS = -g0 - - LIB1ASMSRC = arm/lib1funcs.asm --LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx -+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \ -+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ -+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ -+ _fixsfsi _fixunssfsi _floatdidf _floatundidf _floatdisf _floatundisf - - # MULTILIB_OPTIONS = mhard-float/msoft-float - # MULTILIB_DIRNAMES = hard-float soft-float - ---- gcc-4.2-20061205/gcc/config/arm/linux-elf.h 2006-12-08 15:18:33.000000000 -0800 -+++ gcc-4.2-20061205/gcc/config/arm/linux-elf.h 2006-12-08 15:18:33.000000000 -0800 -@@ -63,7 +63,7 @@ - %{shared:-lc} \ - %{!shared:%{profile:-lc_p}%{!profile:-lc}}" - --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" -+#define LIBGCC_SPEC "-lgcc" - - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" - diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in index 9140a8de8..0c7295764 100644 --- a/toolchain/gcc/Config.in +++ b/toolchain/gcc/Config.in @@ -9,11 +9,6 @@ choice help Select the version of gcc you wish to use. - config BR2_GCC_VERSION_4_1_2 - depends on !BR2_avr32 - depends on BR2_DEPRECATED - bool "gcc 4.1.2" - config BR2_GCC_VERSION_4_2_1 depends on !BR2_avr32 depends on BR2_DEPRECATED @@ -50,13 +45,9 @@ choice bool "gcc snapshot" endchoice -config BR2_GCC_SUPPORTS_SYSROOT - bool - default y if !BR2_GCC_VERSION_4_1_2 - config BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE bool - default y if !BR2_GCC_VERSION_4_1_2 && !BR2_GCC_VERSION_4_2_1 && !BR2_GCC_VERSION_4_2_2 && !BR2_GCC_VERSION_4_2_3 && !BR2_GCC_VERSION_4_2_4 && !BR2_GCC_VERSION_4_2_2_AVR32_2_1_5 + default y if !BR2_GCC_VERSION_4_2_1 && !BR2_GCC_VERSION_4_2_2 && !BR2_GCC_VERSION_4_2_3 && !BR2_GCC_VERSION_4_2_4 && !BR2_GCC_VERSION_4_2_2_AVR32_2_1_5 config BR2_GCC_SNAP_DATE string "GCC snapshot date" @@ -68,7 +59,6 @@ config BR2_GCC_SNAP_DATE config BR2_GCC_VERSION string - default "4.1.2" if BR2_GCC_VERSION_4_1_2 default "4.2.1" if BR2_GCC_VERSION_4_2_1 default "4.2.2" if BR2_GCC_VERSION_4_2_2 default "4.2.2-avr32-2.1.5" if BR2_GCC_VERSION_4_2_2_AVR32_2_1_5 @@ -78,20 +68,6 @@ config BR2_GCC_VERSION default "4.4.4" if BR2_GCC_VERSION_4_4_X default $BR2_GCC_SNAP_DATE if BR2_GCC_VERSION_SNAP -config BR2_TOOLCHAIN_SYSROOT - bool "Enable toolchain with --sysroot support" - depends on BR2_GCC_SUPPORTS_SYSROOT - default y - help - Enables --sysroot=dir for binutils and gcc. - Use dir as the logical root directory for headers and libraries. - For example, if the compiler would normally search for headers in - /usr/include and libraries in /usr/lib, it will instead search - dir/usr/include and dir/usr/lib. - - This does not work with gcc < 4.2.0 (4.1.2 gets - ORIGINAL_AS_FOR_TARGET wrong) - config BR2_GCC_USE_SJLJ_EXCEPTIONS bool "Enable setjmp/longjmp exceptions?" help diff --git a/toolchain/gcc/Makefile.in b/toolchain/gcc/Makefile.in index 23b5c7339..19c97d135 100644 --- a/toolchain/gcc/Makefile.in +++ b/toolchain/gcc/Makefile.in @@ -1,8 +1,7 @@ # gcc has a bunch of options that need to be shared with -# both gcc-uclibc-2.95.mk and gcc-uclibc-3.x.mk, and are -# use by other packages... So include them in this file -# and arrange to include it soon after invoking make from -# the top level. +# both gcc-uclibc-4.x.mk, and are use by other packages... +# So include them in this file and arrange to include it +# soon after invoking make from the top level. GCC_VERSION:=$(call qstrip,$(BR2_GCC_VERSION)) TARGET_OPTIMIZATION:=$(call qstrip,$(BR2_TARGET_OPTIMIZATION)) diff --git a/toolchain/gcc/gcc-uclibc-3.x.mk b/toolchain/gcc/gcc-uclibc-3.x.mk deleted file mode 100644 index 332af884a..000000000 --- a/toolchain/gcc/gcc-uclibc-3.x.mk +++ /dev/null @@ -1,484 +0,0 @@ -# Makefile for to build a gcc/uClibc toolchain -# -# Copyright (C) 2002-2003 Erik Andersen -# Copyright (C) 2004 Manuel Novoa III -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) - -# without sysroot support. Sysroot toolchain is gcc-uclibc-4.x.mk -ifneq ($(BR2_TOOLCHAIN_SYSROOT),y) - -ifneq ($(GCC_SNAP_DATE),) - GCC_SITE:=ftp://sources.redhat.com/pub/gcc/snapshots/$(GCC_VERSION) -else ifeq ($(findstring avr32,$(GCC_VERSION)),avr32) - GCC_SITE:=ftp://www.at91.com/pub/buildroot/ -else - GCC_SITE:=$(BR2_GNU_MIRROR)/gcc/gcc-$(GCC_VERSION) -endif - -GCC_SOURCE:=gcc-$(GCC_VERSION).tar.bz2 -GCC_DIR:=$(TOOLCHAIN_DIR)/gcc-$(GCC_VERSION) -GCC_PATCH_DIR:=toolchain/gcc/$(GCC_VERSION) -GCC_CAT:=$(BZCAT) -GCC_STRIP_HOST_BINARIES:=true - -ifneq ($(BR2_INSTALL_FORTRAN),y) -# fortran needs gmp and mpfr -ifeq ($(findstring 4.0.,$(GCC_VERSION)),4.0.) -GCC_NO_MPFR:=y -endif -ifeq ($(findstring 4.1.,$(GCC_VERSION)),4.1.) -GCC_NO_MPFR:=y -endif -endif - -############################################################# -# -# Setup some initial stuff -# -############################################################# - - -GCC_CROSS_LANGUAGES:=c -ifeq ($(BR2_GCC_CROSS_CXX),y) -GCC_CROSS_LANGUAGES:=$(GCC_CROSS_LANGUAGES),c++ -endif -ifeq ($(BR2_GCC_CROSS_FORTRAN),y) -GCC_CROSS_LANGUAGES:=$(GCC_CROSS_LANGUAGES),fortran -endif -ifeq ($(BR2_GCC_CROSS_OBJC),y) -GCC_CROSS_LANGUAGES:=$(GCC_CROSS_LANGUAGES),objc -endif - - -GCC_TARGET_LANGUAGES:=c -ifeq ($(BR2_INSTALL_LIBSTDCPP),y) -GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),c++ -endif -ifeq ($(BR2_INSTALL_LIBGCJ),y) -GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),java -endif -ifeq ($(BR2_INSTALL_OBJC),y) -GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),objc -endif - -GCC_TARGET_PREREQ = -GCC_STAGING_PREREQ= $(STAGING_DIR)/usr/lib/libc.a - -ifndef GCC_NO_MPFR -GCC_WITH_HOST_GMP=--with-gmp=$(GMP_HOST_DIR) -GCC_WITH_HOST_MPFR=--with-mpfr=$(MPFR_HOST_DIR) - -ifeq ($(BR2_INSTALL_FORTRAN),y) -GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),fortran -#GCC_TARGET_PREREQ += $(TARGET_DIR)/lib/libmpfr.so $(TARGET_DIR)/lib/libgmp.so -#GCC_STAGING_PREREQ+= $(TOOLCHAIN_DIR)/mpfr/lib/libmpfr.so -GCC_WITH_TARGET_GMP=--with-gmp="$(GMP_TARGET_DIR)" -GCC_WITH_TARGET_MPFR=--with-mpfr="$(MPFR_TARGET_DIR)" -endif -endif # ifndef GCC_NO_MPFR - -ifeq ($(BR2_GCC_SHARED_LIBGCC),y) -GCC_SHARED_LIBGCC:=--enable-shared -else -GCC_SHARED_LIBGCC:=--disable-shared -endif - -HOST_SOURCE+=gcc-source - -############################################################# -# -# build the first pass gcc compiler -# -############################################################# -GCC_BUILD_DIR1:=$(TOOLCHAIN_DIR)/gcc-$(GCC_VERSION)-initial - -$(DL_DIR)/$(GCC_SOURCE): - mkdir -p $(DL_DIR) - $(call DOWNLOAD,$(GCC_SITE),$(GCC_SOURCE)) - -gcc-unpacked: $(GCC_DIR)/.patched -$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE) - mkdir -p $(TOOLCHAIN_DIR) - $(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOLCHAIN_DIR) $(TAR_OPTIONS) - - $(CONFIG_UPDATE) $(@D) - touch $@ - -gcc-patched: $(GCC_DIR)/.patched -$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked - # Apply any files named gcc-*.patch from the source directory to gcc -ifneq ($(wildcard $(GCC_PATCH_DIR)),) - toolchain/patch-kernel.sh $(GCC_DIR) $(GCC_PATCH_DIR) \*.patch -endif - # Note: The soft float situation has improved considerably with gcc 3.4.x. - # We can dispense with the custom spec files, as well as libfloat for the arm case. - # However, we still need a patch for arm. There's a similar patch for gcc 3.3.x - # which needs to be integrated so we can kill of libfloat for good, except for - # anyone (?) who might still be using gcc 2.95. mjn3 -ifeq ($(BR2_SOFT_FLOAT),y) -ifeq ("$(strip $(ARCH))","arm") - toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional -endif -ifeq ("$(strip $(ARCH))","armeb") - toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional -endif -endif - touch $@ - -# The --without-headers option stopped working with gcc 3.0 and has never been -# fixed, so we need to actually have working C library header files prior to -# the step or libgcc will not build... - -$(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched - mkdir -p $(GCC_BUILD_DIR1) - (cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) \ - $(HOST_CONFIGURE_OPTS) \ - $(GCC_DIR)/configure $(QUIET) \ - --prefix=$(STAGING_DIR)/usr \ - --build=$(GNU_HOST_NAME) \ - --host=$(GNU_HOST_NAME) \ - --target=$(REAL_GNU_TARGET_NAME) \ - --enable-languages=c \ - --with-sysroot=$(TOOLCHAIN_DIR)/uClibc_dev/ \ - --disable-__cxa_atexit \ - --enable-target-optspace \ - --with-gnu-ld \ - --disable-shared \ - --disable-libssp \ - $(GCC_WITH_HOST_GMP) \ - $(GCC_WITH_HOST_MPFR) \ - $(DISABLE_NLS) \ - $(THREADS) \ - $(MULTILIB) \ - $(SOFT_FLOAT_CONFIG_OPTION) \ - $(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \ - $(EXTRA_GCC_CONFIG_OPTIONS) \ - $(QUIET) \ - ) - touch $@ - -$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured - PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc - touch $@ - -gcc_initial=$(GCC_BUILD_DIR1)/.installed -$(gcc_initial) $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled - PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc - #rm -f $(STAGING_DIR)/bin/gccbug $(STAGING_DIR)/bin/gcov - #rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc $(STAGING_DIR)/share/locale - touch $(gcc_initial) - -gcc_initial: uclibc-configured binutils $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc - -gcc_initial-clean: - rm -rf $(GCC_BUILD_DIR1) - -gcc_initial-dirclean: - rm -rf $(GCC_BUILD_DIR1) $(GCC_DIR) - -############################################################# -# -# second pass compiler build. Build the compiler targeting -# the newly built shared uClibc library. -# -############################################################# -# -# Sigh... I had to rework things because using --with-gxx-include-dir -# causes issues with include dir search order for g++. This seems to -# have something to do with "path translations" and possibly doesn't -# affect gcc-target. However, I haven't tested gcc-target yet so no -# guarantees. mjn3 - -GCC_BUILD_DIR2:=$(TOOLCHAIN_DIR)/gcc-$(GCC_VERSION)-final -$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(GCC_STAGING_PREREQ) - mkdir -p $(GCC_BUILD_DIR2) - # Important! Required for limits.h to be fixed. - ln -snf ../include $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/sys-include - #-rmdir $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib - #ln -snf ../lib/ $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib - (cd $(GCC_BUILD_DIR2); rm -rf config.cache; \ - $(HOST_CONFIGURE_OPTS) \ - GCC=$(TARGET_CROSS)gcc \ - CPP=$(TARGET_CROSS)cpp \ - LDFLAGS_FOR_TARGET="$(patsubst %,LDFLAGS+=-Wl$(comma)%,$(TARGET_LDFLAGS)) -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \ - $(GCC_DIR)/configure $(QUIET) \ - --prefix=$(STAGING_DIR) \ - --build=$(GNU_HOST_NAME) \ - --host=$(GNU_HOST_NAME) \ - --target=$(REAL_GNU_TARGET_NAME) \ - --enable-languages=$(GCC_CROSS_LANGUAGES) \ - --disable-__cxa_atexit \ - --enable-target-optspace \ - --with-gnu-ld \ - --disable-libssp \ - $(GCC_WITH_HOST_GMP) \ - $(GCC_WITH_HOST_MPFR) \ - $(GCC_SHARED_LIBGCC) \ - $(DISABLE_NLS) \ - $(THREADS) \ - $(MULTILIB) \ - $(SOFT_FLOAT_CONFIG_OPTION) \ - $(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \ - $(GCC_USE_SJLJ_EXCEPTIONS) \ - $(DISABLE_LARGEFILE) \ - $(EXTRA_GCC_CONFIG_OPTIONS) \ - ) - touch $@ - -$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured - PATH=$(TARGET_PATH) $(MAKE) $(HOST_CONFIGURE_OPTS) CPP=$(TARGET_CROSS)cpp -C $(GCC_BUILD_DIR2) all - touch $@ - -$(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled - PATH=$(TARGET_PATH) \ - $(MAKE) $(HOST_CONFIGURE_OPTS) \ - LDFLAGS_FOR_TARGET="$(patsubst %,LDFLAGS+=-Wl$(comma)%,$(TARGET_LDFLAGS)) -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \ - -C $(GCC_BUILD_DIR2) install - if [ -d "$(STAGING_DIR)/usr/lib64" ]; then \ - if [ ! -e "$(STAGING_DIR)/usr/lib" ]; then \ - mkdir -p "$(STAGING_DIR)/usr/lib"; \ - fi; \ - mv "$(STAGING_DIR)/usr/lib64/"* "$(STAGING_DIR)/usr/lib/"; \ - rmdir "$(STAGING_DIR)/usr/lib64"; \ - fi - # Strip the host binaries -ifeq ($(GCC_STRIP_HOST_BINARIES),true) - strip --strip-all -R .note -R .comment $(filter-out %-gccbug %-embedspu,$(wildcard $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-*)) -endif - # Make sure we have 'cc'. - if [ ! -e $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-cc ]; then \ - ln -snf $(REAL_GNU_TARGET_NAME)-gcc \ - $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-cc; \ - fi - if [ ! -e $(STAGING_DIR)/usr/bin/gcc ]; then \ - ln -snf gcc $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-cc; \ - fi - # Set up the symlinks to enable lying about target name. - set -e; \ - (cd $(STAGING_DIR)/usr; \ - ln -snf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \ - cd bin; \ - for app in $(REAL_GNU_TARGET_NAME)-*; do \ - ln -snf $${app} \ - $(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \ - done; \ - ) - # - # Now for the ugly 3.3.x soft float hack... - # -ifeq ($(BR2_SOFT_FLOAT),y) -ifeq ($(findstring 3.3.,$(GCC_VERSION)),3.3.) - # Make sure we have a soft float specs file for this arch - if [ ! -f toolchain/gcc/$(GCC_VERSION)/specs-$(ARCH)-soft-float ]; then \ - echo soft float configured but no specs file for this arch; \ - /bin/false; \ - fi - # Replace specs file with one that defaults to soft float mode. - if [ ! -f $(STAGING_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs ]; then \ - echo staging dir specs file is missing; \ - /bin/false; \ - fi - cp toolchain/gcc/$(GCC_VERSION)/specs-$(ARCH)-soft-float $(STAGING_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs -endif -endif - # - # Ok... that's enough of that. - # - mkdir -p $(TARGET_DIR)/usr/lib $(TARGET_DIR)/usr/sbin - touch $@ - -$(STAMP_DIR)/gcc_libs_target_installed: $(GCC_BUILD_DIR2)/.installed -ifeq ($(BR2_GCC_SHARED_LIBGCC),y) - # These are in /lib, so... - rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so* - -cp -dpf $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib/libgcc_s* \ - $(TARGET_DIR)/lib/ - -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/lib/libgcc_s* -endif -ifeq ($(BR2_INSTALL_LIBSTDCPP),y) -ifeq ($(BR2_GCC_SHARED_LIBGCC),y) - mkdir -p $(TARGET_DIR)/usr/lib - -cp -dpf $(STAGING_DIR)/lib/libstdc++.so* $(TARGET_DIR)/usr/lib/ - -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libstdc++.so* -endif -endif -ifeq ($(BR2_INSTALL_LIBGCJ),y) - cp -dpf $(STAGING_DIR)/lib/libgcj.so* $(TARGET_DIR)/usr/lib/ - cp -dpf $(STAGING_DIR)/lib/lib-org-w3c-dom.so* $(TARGET_DIR)/usr/lib/ - cp -dpf $(STAGING_DIR)/lib/lib-org-xml-sax.so* $(TARGET_DIR)/usr/lib/ - mkdir -p $(TARGET_DIR)/usr/lib/security - cp -dpf $(STAGING_DIR)/usr/lib/security/libgcj.security \ - $(TARGET_DIR)/usr/lib/security/ - cp -dpf $(STAGING_DIR)/usr/lib/security/classpath.security \ - $(TARGET_DIR)/usr/lib/security/ -endif - mkdir -p $(@D) - touch $@ - -cross_compiler:=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc -cross_compiler gcc: gcc-config $(GCC_BUILD_DIR2)/.installed \ - $(STAMP_DIR)/gcc_libs_target_installed \ - $(GCC_TARGETS) - -gcc-source: $(DL_DIR)/$(GCC_SOURCE) - -gcc-config: uclibc-configured binutils gcc_initial $(LIBFLOAT_TARGET) \ - uclibc $(GCC_BUILD_DIR2)/.configured - -gcc-clean: - rm -rf $(GCC_BUILD_DIR2) - for prog in cpp gcc gcc-[0-9]* protoize unprotoize gcov gccbug cc; do \ - rm -f $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-$$prog; \ - rm -f $(STAGING_DIR)/usr/bin/$(GNU_TARGET_NAME)-$$prog; \ - done - -gcc-dirclean: gcc_initial-dirclean - rm -rf $(GCC_BUILD_DIR2) - -############################################################# -# -# Next build target gcc compiler -# -############################################################# -GCC_BUILD_DIR3:=$(BUILD_DIR)/gcc-$(GCC_VERSION)-target - -$(GCC_BUILD_DIR3)/.prepared: $(STAMP_DIR)/gcc_libs_target_installed $(GCC_TARGET_PREREQ) - mkdir -p $(GCC_BUILD_DIR3) - touch $@ - -$(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR3)/.prepared - (cd $(GCC_BUILD_DIR3); rm -rf config.cache; \ - $(TARGET_CONFIGURE_OPTS) \ - CFLAGS_FOR_BUILD="-g -O2 $(HOST_CFLAGS)" \ - $(TARGET_GCC_FLAGS) \ - $(GCC_DIR)/configure $(QUIET) \ - --prefix=/usr \ - --build=$(GNU_HOST_NAME) \ - --host=$(REAL_GNU_TARGET_NAME) \ - --target=$(REAL_GNU_TARGET_NAME) \ - --enable-languages=$(GCC_TARGET_LANGUAGES) \ - --with-gxx-include-dir=/usr/include/c++ \ - --disable-__cxa_atexit \ - --with-gnu-ld \ - --with-gnu-as \ - --disable-libssp \ - $(GCC_SHARED_LIBGCC) \ - $(GCC_WITH_TARGET_GMP) \ - $(GCC_WITH_TARGET_MPFR) \ - $(DISABLE_NLS) \ - $(THREADS) \ - $(MULTILIB) \ - $(SOFT_FLOAT_CONFIG_OPTION) \ - $(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \ - $(GCC_USE_SJLJ_EXCEPTIONS) \ - $(DISABLE_LARGEFILE) \ - $(EXTRA_GCC_CONFIG_OPTIONS) \ - $(EXTRA_TARGET_GCC_CONFIG_OPTIONS) \ - ) - touch $@ - -$(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured - PATH=$(TARGET_PATH) \ - $(MAKE) $(TARGET_CONFIGURE_OPTS) \ - CFLAGS_FOR_BUILD="-g -O2 $(HOST_CFLAGS)" \ - $(TARGET_GCC_FLAGS) \ - -C $(GCC_BUILD_DIR3) all - touch $@ - -# -# gcc-lib dir changes names to gcc with 3.4.mumble -# -ifeq ($(findstring 3.4.,$(GCC_VERSION)),3.4.) -GCC_LIB_SUBDIR=lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION) -else -GCC_LIB_SUBDIR=lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION) -endif -# sigh... we need to find a better way -ifeq ($(findstring 4.0.,$(GCC_VERSION)),4.0.) -GCC_LIB_SUBDIR=lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION) -endif -ifeq ($(findstring 4.1.,$(GCC_VERSION)),4.1.) -GCC_LIB_SUBDIR=lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION) -endif -ifeq ($(findstring 4.2,$(GCC_VERSION)),4.2) -ifneq ($(findstring 4.2.,$(GCC_VERSION)),4.2.) -REAL_GCC_VERSION=$(shell cat $(GCC_DIR)/gcc/BASE-VER) -GCC_LIB_SUBDIR=lib/gcc/$(REAL_GNU_TARGET_NAME)/$(REAL_GCC_VERSION) -else -GCC_LIB_SUBDIR=lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION) -endif -endif - -$(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled - PATH=$(TARGET_PATH) \ - $(MAKE) $(TARGET_CONFIGURE_OPTS) \ - CFLAGS_FOR_BUILD="-g -O2 $(HOST_CFLAGS)" \ - $(TARGET_GCC_FLAGS) \ - DESTDIR=$(TARGET_DIR) \ - -C $(GCC_BUILD_DIR3) install - # Remove broken specs file (cross compile flag is set). - rm -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/specs - # - # Now for the ugly 3.3.x soft float hack... - # -ifeq ($(BR2_SOFT_FLOAT),y) -ifeq ($(findstring 3.3.,$(GCC_VERSION)),3.3.) - # Add a specs file that defaults to soft float mode. - cp toolchain/gcc/$(GCC_VERSION)/specs-$(ARCH)-soft-float $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs - # Make sure gcc does not think we are cross compiling - $(SED) "s/^1/0/;" $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs -endif -endif - # - # Ok... that's enough of that. - # - -(cd $(TARGET_DIR)/bin && find -type f | xargs $(STRIPCMD) > /dev/null 2>&1) - -(cd $(TARGET_DIR)/usr/bin && find -type f | xargs $(STRIPCMD) > /dev/null 2>&1) - -(cd $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR) && $(STRIPCMD) cc1 cc1plus collect2 > /dev/null 2>&1) - -(cd $(TARGET_DIR)/usr/lib && $(STRIPCMD) libstdc++.so.*.*.* > /dev/null 2>&1) - -(cd $(TARGET_DIR)/lib && $(STRIPCMD) libgcc_s*.so.*.*.* > /dev/null 2>&1) - # - rm -f $(TARGET_DIR)/usr/lib/*.la* - #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \ - # $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc - # Work around problem of missing syslimits.h - if [ ! -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/include/syslimits.h ]; then \ - echo "warning: working around missing syslimits.h"; \ - cp -f $(STAGING_DIR)/usr/$(GCC_LIB_SUBDIR)/include/syslimits.h \ - $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/include/; \ - fi - # Make sure we have 'cc'. - if [ ! -e $(TARGET_DIR)/usr/bin/cc ]; then \ - ln -snf gcc $(TARGET_DIR)/usr/bin/cc; \ - fi - # These are in /lib, so... - #rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so* - #touch -c $(TARGET_DIR)/usr/bin/gcc - -gcc_target: uclibc_target binutils_target $(TARGET_DIR)/usr/bin/gcc - -gcc_target-clean: - rm -rf $(GCC_BUILD_DIR3) - rm -f $(TARGET_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)* - -gcc_target-dirclean: - rm -rf $(GCC_BUILD_DIR3) - -endif -# gcc-3.x only - -endif diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk index cf76e8ad1..6cede5ea3 100644 --- a/toolchain/gcc/gcc-uclibc-4.x.mk +++ b/toolchain/gcc/gcc-uclibc-4.x.mk @@ -17,9 +17,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# sysroot support works with gcc >= 4.2.0 only -ifeq ($(BR2_TOOLCHAIN_SYSROOT),y) - ifneq ($(GCC_SNAP_DATE),) GCC_SITE:=ftp://sources.redhat.com/pub/gcc/snapshots/$(GCC_VERSION) else ifeq ($(findstring avr32,$(GCC_VERSION)),avr32) @@ -275,7 +272,7 @@ $(GCC_BUILD_DIR2)/.configured: $(GCC_SRC_DIR)/.patched $(GCC_STAGING_PREREQ) (cd $(GCC_BUILD_DIR2); rm -rf config.cache; \ $(HOST_CONFIGURE_OPTS) \ $(GCC_SRC_DIR)/configure $(QUIET) \ - --prefix=$(BR2_SYSROOT_PREFIX)/usr \ + --prefix=/usr \ --build=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \ --target=$(REAL_GNU_TARGET_NAME) \ @@ -502,11 +499,3 @@ gcc_target-clean: gcc_target-dirclean: rm -rf $(GCC_BUILD_DIR3) - -gcc-status: - @echo GCC_VERSION=$(GCC_VERSION) - @echo GCC_PATCH_DIR=$(GCC_PATCH_DIR) - @echo GCC_SITE=$(GCC_SITE) - -endif -# gcc-4.x only diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk index 91abc6822..ce1396a97 100644 --- a/toolchain/uClibc/uclibc.mk +++ b/toolchain/uClibc/uclibc.mk @@ -438,21 +438,12 @@ uclibc-menuconfig: host-sed dirs $(UCLIBC_DIR)/.config $(STAGING_DIR)/usr/lib/libc.a: $(UCLIBC_DIR)/lib/libc.a -ifneq ($(BR2_TOOLCHAIN_SYSROOT),y) - $(MAKE1) -C $(UCLIBC_DIR) \ - ARCH="$(UCLIBC_TARGET_ARCH)" \ - PREFIX= \ - DEVEL_PREFIX=$(STAGING_DIR)/ \ - RUNTIME_PREFIX=$(STAGING_DIR)/ \ - install_runtime install_dev -else $(MAKE1) -C $(UCLIBC_DIR) \ ARCH="$(UCLIBC_TARGET_ARCH)" \ PREFIX=$(STAGING_DIR) \ DEVEL_PREFIX=/usr/ \ RUNTIME_PREFIX=/ \ install_runtime install_dev -endif # Install the kernel headers to the staging dir if necessary if [ ! -f $(STAGING_DIR)/usr/include/linux/version.h ]; then \ cp -pLR $(LINUX_HEADERS_DIR)/include/* \ -- cgit v1.2.3