#
# Copyright (C) 2001-2004 Erik Andersen <andersen@codepoet.org>
# Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
+# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as
#
#############################################################
-# What sortof target system shall we compile this for?
+# What sort of target system shall we compile this for?
+#
ARCH:=i386
#ARCH:=arm
#ARCH:=mips
#ARCH:=mipsel
#ARCH:=powerpc
#ARCH:=sh4
-# Busybox link failing due to needing libgcc functions that are statics.
#ARCH:=cris
-
-# The following currently fail to build since no shared lib support.
#ARCH:=sh64
#ARCH:=m68k
#ARCH:=v850
#ARCH:=sparc
#ARCH:=whatever
-# If you are building a native gcc toolchain, do you want to
-# build the old gcc-2.95 based toolchain, or would you prefer
-# a nice and shiny new gcc-3.3.2 toolchain?
+# Choose the kernel headers to use for kernel-headers target. This is
+# ignored if you are building your own kernel or using the system kernel.
+#
+DEFAULT_KERNEL_HEADERS:=2.4.25
+#DEFAULT_KERNEL_HEADERS:=2.6.7
+
+# Choose gcc version.
# WARNING -- 2.95 currently only builds for i386, arm, mips*, and powerpc.
# WARNING -- 2.95 does not currently build natively for the target.
-GCC_2_95_TOOLCHAIN:=false
+#
+#GCC_VERSION:=2.95
+#GCC_VERSION:=3.3.3
+#GCC_VERSION:=3.3.4
+#GCC_VERSION:=3.4.0
+GCC_VERSION:=3.4.1
+
+# Choose binutils version.
+#
+#BINUTILS_VERSION:=2.14.90.0.6
+#BINUTILS_VERSION:=2.14.90.0.7
+#BINUTILS_VERSION:=2.14.90.0.8
+#BINUTILS_VERSION:=2.15
+#BINUTILS_VERSION:=2.15.90.0.1
+#BINUTILS_VERSION:=2.15.90.0.1.1
+#BINUTILS_VERSION:=2.15.90.0.2
+BINUTILS_VERSION:=2.15.90.0.3
+#BINUTILS_VERSION:=2.15.91.0.1
+#BINUTILS_VERSION:=2.15.91.0.2
+
+# Choose gdb version.
+#
+#GDB_VERSION:=5.3
+GDB_VERSION:=6.1.1
+#GDB_VERSION:=6.2
+
# Enable this to use the uClibc daily snapshot instead of a released
# version. Daily snapshots may contain new features and bugfixes. Or
-# they may not even compile at all, depending on what Erik is doing...
-USE_UCLIBC_SNAPSHOT:=true
+# they may not even compile at all, depending on what Erik is doing.
-# Enable this to use the busybox daily snapshot instead of a released
-# version. Daily snapshots may contain new features and bugfixes. Or
-# they may not even compile at all....
-USE_BUSYBOX_SNAPSHOT:=true
+# Do you wish to use the latest release (), latest snapshot (snapshot),
+# or the snapshot from a specific date (yyyymmdd)? Note that snapshots
+# may contain new features and bugfixes. Or they may not even compile
+# at all, depending on what Erik and Manuel are doing.
+#
+#USE_UCLIBC_SNAPSHOT:=
+USE_UCLIBC_SNAPSHOT:=snapshot
+#USE_UCLIBC_SNAPSHOT:=20040807
+
+# Do you wish to use the latest release (), latest snapshot (snapshot),
+# or the snapshot from a specific date (yyyymmdd)? Note that snapshots
+# may contain new features and bugfixes. Or they may not even compile
+# at all...
+#
+#USE_BUSYBOX_SNAPSHOT:=
+USE_BUSYBOX_SNAPSHOT:=snapshot
+#USE_BUSYBOX_SNAPSHOT:=20040807
# Enable large file (files > 2 GB) support
BUILD_WITH_LARGEFILE:=true
#OPTIMIZE_FOR_CPU=i586
#OPTIMIZE_FOR_CPU=whatever
+# Might be worth experimenting with for gcc 3.4.x.
+GCC_WITH_CPU:=
+GCC_WITH_ARCH:=
+GCC_WITH_TUNE:=
+
+#GCC_WITH_CPU:=--with-cpu=
+#GCC_WITH_ARCH:=--with-arch=
+#GCC_WITH_TUNE:=--with-tune=
+
# Soft floating point options.
# Notes:
# Currently builds with gcc 3.3 for arm, mips, mipsel, powerpc.
#############################################################
TARGETS:=host-sed
-ifeq ($(GCC_2_95_TOOLCHAIN),true)
-TARGETS+=uclibc-configured binutils gcc2_95 ccache
-else
-TARGETS+=uclibc-configured binutils gcc3_3 ccache
-endif
+TARGETS+=uclibc-configured binutils gcc ccache
# Are you building your own kernel? Perhaps you have a kernel
# you have already configured and you want to use that? The
#If you want a development system, you probably want gcc built
# with uClibc so it can run within your dev system...
-#TARGETS+=gcc2_95_target ccache_target # NOT WORKING!!!
-#TARGETS+=gcc3_3_target ccache_target
+#TARGETS+=gcc_target ccache_target
# Of course, if you are installing a development system, you
# may want some header files so you can compile stuff....
# Pick your root filesystem type.
#
#############################################################
-TARGETS+=ext2root
+#TARGETS+=ext2root
# Must mount cramfs with 'ramdisk_blocksize=4096'
#TARGETS+=cramfsroot
#############################################################
ifeq ($(SOFT_FLOAT),true)
+# gcc 3.4.x soft float configuration is different than previous versions.
+ifeq ($(findstring 3.4.,$(GCC_VERSION)),3.4.)
+SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
+else
SOFT_FLOAT_CONFIG_OPTION:=--without-float
+endif
TARGET_SOFT_FLOAT:=-msoft-float
ARCH_FPU_SUFFIX:=_nofpu
else
$(BUILD_DIR):
mkdir $(BUILD_DIR)
+$(TOOL_BUILD_DIR):
+ mkdir $(TOOL_BUILD_DIR)
+
$(STAGING_DIR):
rm -rf $(STAGING_DIR)
mkdir -p $(STAGING_DIR)/lib
- mkdir -p $(STAGING_DIR)/usr
- ln -fs $(REAL_GNU_TARGET_NAME)/include $(STAGING_DIR)/include
- ln -fs ../lib $(STAGING_DIR)/usr/lib
- ln -fs ../$(REAL_GNU_TARGET_NAME)/include $(STAGING_DIR)/usr/include
+ mkdir -p $(STAGING_DIR)/include
+ mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)
+ ln -sf ../lib $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib
$(TARGET_DIR):
rm -rf $(TARGET_DIR)
#
#############################################################
clean: $(TARGETS_CLEAN)
- rm -rf $(TARGET_DIR) $(STAGING_DIR) $(IMAGE)
+ rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)
dirclean: $(TARGETS_DIRCLEAN)
- rm -rf $(TARGET_DIR) $(STAGING_DIR) $(IMAGE)
+ rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)
distclean:
rm -rf $(DL_DIR) $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE)
-sourceball:
+sourceball:
rm -rf $(BUILD_DIR)
set -e; \
cd ..; \
# autoconf
#
#############################################################
-AUTOCONF_SOURCE:=autoconf-2.57.tar.bz2
+AUTOCONF_SOURCE:=autoconf-2.59.tar.bz2
AUTOCONF_SITE:=ftp://ftp.gnu.org/gnu/autoconf
AUTOCONF_CAT:=bzcat
-AUTOCONF_DIR:=$(BUILD_DIR)/autoconf-2.57
+AUTOCONF_DIR:=$(BUILD_DIR)/autoconf-2.59
AUTOCONF_BINARY:=autoconf
AUTOCONF_TARGET_BINARY:=usr/bin/autoconf
# automake
#
#############################################################
-AUTOMAKE_SOURCE:=automake-1.6.3.tar.bz2
+AUTOMAKE_SOURCE:=automake-1.9.tar.bz2
AUTOMAKE_SITE:=ftp://ftp.gnu.org/gnu/automake
AUTOMAKE_CAT:=bzcat
-AUTOMAKE_DIR:=$(BUILD_DIR)/automake-1.6.3
+AUTOMAKE_DIR:=$(BUILD_DIR)/automake-1.9
AUTOMAKE_BINARY:=automake
AUTOMAKE_TARGET_BINARY:=usr/bin/automake
$(DISABLE_LARGEFILE) \
--with-curses \
--enable-alias \
+ --without-bash-malloc \
);
touch $(BASH_DIR)/.configured
# build binutils for use on the host system
#
#############################################################
+BINUTILS_VERSION:=$(strip $(BINUTILS_VERSION))
+
BINUTILS_SITE:=http://ftp.kernel.org/pub/linux/devel/binutils
-BINUTILS_SOURCE:=binutils-2.14.90.0.6.tar.bz2
-BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-2.14.90.0.6
+ifeq ($(BINUTILS_VERSION),2.15)
+BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/
+endif
+ifeq ($(BINUTILS_VERSION),2.14)
+BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/
+endif
+ifeq ($(BINUTILS_VERSION),2.13)
+BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/
+endif
+
+BINUTILS_SOURCE:=binutils-$(BINUTILS_VERSION).tar.bz2
+BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)
BINUTILS_CAT:=bzcat
-BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-build
+BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)-build
$(DL_DIR)/$(BINUTILS_SOURCE):
+ mkdir -p $(DL_DIR)
$(WGET) -P $(DL_DIR) $(BINUTILS_SITE)/$(BINUTILS_SOURCE)
$(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
mkdir -p $(TOOL_BUILD_DIR)
- mkdir -p $(DL_DIR)
$(BINUTILS_CAT) $(DL_DIR)/$(BINUTILS_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
touch $(BINUTILS_DIR)/.unpacked
$(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
- # Apply any files named binutils-*.patch from the source directory to binutils
- $(SOURCE_DIR)/patch-kernel.sh $(BINUTILS_DIR) $(SOURCE_DIR) binutils-uclibc*.patch
+ # Apply appropriate binutils patches.
+ $(SOURCE_DIR)/patch-kernel.sh $(BINUTILS_DIR) $(SOURCE_DIR)/binutils/$(BINUTILS_VERSION) *.patch
touch $(BINUTILS_DIR)/.patched
$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
# build binutils for use on the target system
#
#############################################################
-BINUTILS_DIR2:=$(BUILD_DIR)/binutils-target
+BINUTILS_DIR2:=$(BUILD_DIR)/binutils-$(BINUTILS_VERSION)-target
$(BINUTILS_DIR2)/.configured: $(BINUTILS_DIR)/.patched
mkdir -p $(BINUTILS_DIR2)
(cd $(BINUTILS_DIR2); \
#
#############################################################
-ifeq ($(USE_BUSYBOX_SNAPSHOT),true)
+ifneq ($(strip $(USE_BUSYBOX_SNAPSHOT)),)
# Be aware that this changes daily....
BUSYBOX_DIR:=$(BUILD_DIR)/busybox
-BUSYBOX_SOURCE:=busybox-snapshot.tar.bz2
+BUSYBOX_SOURCE:=busybox-$(strip $(USE_BUSYBOX_SNAPSHOT)).tar.bz2
BUSYBOX_SITE:=http://www.busybox.net/downloads/snapshots
else
-BUSYBOX_DIR:=$(BUILD_DIR)/busybox-1.00-pre8
-BUSYBOX_SOURCE:=busybox-1.00-pre8.tar.bz2
+BUSYBOX_DIR:=$(BUILD_DIR)/busybox-1.00-rc2
+BUSYBOX_SOURCE:=busybox-1.00-rc2.tar.bz2
BUSYBOX_SITE:=http://www.busybox.net/downloads
endif
BUSYBOX_UNZIP=bzcat
touch $(CCACHE_DIR1)/.unpacked
$(CCACHE_DIR1)/.patched: $(CCACHE_DIR1)/.unpacked
- $(SED) "s,getenv(\"CCACHE_PATH\"),\"$(STAGING_DIR)/usr/bin\",g" \
+ # WARNING - this will break if the toolchain is moved.
+ # Should probably patch things to use a relative path.
+ $(SED) "s,getenv(\"CCACHE_PATH\"),\"$(STAGING_DIR)/bin-ccache\",g" \
$(CCACHE_DIR1)/execute.c
+ # WARNING - this will break if the toolchain build dir is deleted.
$(SED) "s,getenv(\"CCACHE_DIR\"),\"$(CCACHE_DIR1)/cache\",g" \
$(CCACHE_DIR1)/ccache.c
mkdir -p $(CCACHE_DIR1)/cache
$(STAGING_DIR)/$(CCACHE_TARGET_BINARY): $(CCACHE_DIR1)/$(CCACHE_BINARY)
mkdir -p $(STAGING_DIR)/usr/bin;
- mkdir -p $(TOOL_BUILD_DIR)/.ccache;
cp $(CCACHE_DIR1)/ccache $(STAGING_DIR)/usr/bin
- (cd $(STAGING_DIR)/usr/bin; \
+ # Keep the actual toolchain binaries in a directory at the same level.
+ # Otherwise, relative paths for include dirs break.
+ mkdir -p $(STAGING_DIR)/bin-ccache;
+ (cd $(STAGING_DIR)/bin-ccache; \
ln -fs $(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc $(OPTIMIZE_FOR_CPU)-linux-gcc; \
ln -fs $(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc $(OPTIMIZE_FOR_CPU)-linux-cc; \
ln -fs $(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc $(OPTIMIZE_FOR_CPU)-linux-uclibc-cc);
[ -f $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc ] && \
- mv $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc $(STAGING_DIR)/usr/bin/
+ mv $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc $(STAGING_DIR)/bin-ccache/
(cd $(STAGING_DIR)/bin; \
ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-cc; \
ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-gcc; \
ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc);
ifeq ($(INSTALL_LIBSTDCPP),true)
[ -f $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-c++ ] && \
- mv $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-c++ $(STAGING_DIR)/usr/bin/
+ mv $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-c++ $(STAGING_DIR)/bin-ccache/
[ -f $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-g++ ] && \
- mv $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-g++ $(STAGING_DIR)/usr/bin/
+ mv $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-g++ $(STAGING_DIR)/bin-ccache/
(cd $(STAGING_DIR)/bin; \
ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-c++; \
ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-g++;\
ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-uclibc-g++);
endif
-ifeq ($(GCC_2_95_TOOLCHAIN),true)
-ccache: gcc2_95 $(STAGING_DIR)/$(CCACHE_TARGET_BINARY)
-else
-ccache: gcc3_3 $(STAGING_DIR)/$(CCACHE_TARGET_BINARY)
-endif
+ccache: gcc $(STAGING_DIR)/$(CCACHE_TARGET_BINARY)
ccache-clean:
$(MAKE) -C $(CCACHE_DIR1) uninstall
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
# put a bunch of symlinks into /bin, since that is earlier
# in the default PATH than /usr/bin where gcc lives
- (cd $(TARGET_DIR)/usr/bin; ln -fs gcc cc)
(cd $(TARGET_DIR)/bin; \
- ln -fs ../usr/bin/ccache cc; \
- ln -fs ../usr/bin/ccache gcc; \
- ln -fs ../usr/bin/ccache c++; \
- ln -fs ../usr/bin/ccache g++;)
+ ln -fs /usr/bin/ccache cc; \
+ ln -fs /usr/bin/ccache gcc; \
+ ln -fs /usr/bin/ccache c++; \
+ ln -fs /usr/bin/ccache g++;)
ccache_target: uclibc $(TARGET_DIR)/$(CCACHE_TARGET_BINARY)
# How much KB we want to add to the calculated size for slack space
GENEXT2_REALSIZE=$(subst total,, $(shell LANG=C du $(TARGET_DIR) -s -c -k | grep total ))
GENEXT2_ADDTOROOTSIZE=$(shell if [ $(GENEXT2_REALSIZE) -ge 20000 ] ; then echo 16384; else echo 16; fi)
-GENEXT2_SIZE=$(shell expr $(GENEXT2_REALSIZE) + $(GENEXT2_ADDTOROOTSIZE))
+GENEXT2_SIZE=$(shell expr $(GENEXT2_REALSIZE) + $(GENEXT2_ADDTOROOTSIZE) + 200)
# We currently add about 400 device nodes, so add that into the total
GENEXT2_INODES=$(shell expr $(shell find $(TARGET_DIR) | wc -l) + 400)
#GENEXT2_SIZE=100000
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-ifeq ($(GCC_2_95_TOOLCHAIN),true)
+ifeq ($(findstring 2.95,$(GCC_VERSION)),2.95)
+GCC_VERSION:=$(strip $(GCC_VERSION))
GCC_SITE:=http://www.uclibc.org/downloads/toolchain
GCC_SOURCE:=gcc-20011006.tar.bz2
# build the first pass gcc compiler
#
#############################################################
-GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc2_95-initial
+GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-initial
$(DL_DIR)/$(GCC_SOURCE):
+ mkdir -p $(DL_DIR)
$(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
+ mkdir -p $(TOOL_BUILD_DIR)
$(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
touch $(GCC_DIR)/.unpacked
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
# Apply any files named gcc-*.patch from the source directory to gcc
- $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc2.95-mega.patch.bz2
- $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc2.95-uclibc-conf.patch
- #$(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc-uclibc2_95*.patch
+ $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR)/gcc/$(GCC_VERSION) *.patch
#
# We do not wish to build the libstdc++ library provided with gcc,
# since it doesn't seem to work at all with uClibc plus gcc 2.95...
#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
-gcc2_95_initial: uclibc-configured binutils $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc
+gcc_initial: uclibc-configured binutils $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc
-gcc2_95_initial-clean:
+gcc_initial-clean:
rm -rf $(GCC_BUILD_DIR1)
rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-gcc2_95_initial-dirclean:
+gcc_initial-dirclean:
rm -rf $(GCC_BUILD_DIR1)
#############################################################
# the newly built shared uClibc library.
#
#############################################################
-GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc2_95-final
+GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-final
$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a
mkdir -p $(GCC_BUILD_DIR2)
);
touch $(GCC_BUILD_DIR2)/.installed
-gcc2_95: uclibc-configured binutils gcc2_95_initial $(LIBFLOAT_TARGET) uclibc \
+gcc: uclibc-configured binutils gcc_initial $(LIBFLOAT_TARGET) uclibc \
$(GCC_BUILD_DIR2)/.installed $(GCC_TARGETS) $(STLPORT_TARGET)
-gcc2_95-source: $(DL_DIR)/$(GCC_SOURCE)
+gcc-source: $(DL_DIR)/$(GCC_SOURCE)
-gcc2_95-clean:
+gcc-clean:
rm -rf $(GCC_BUILD_DIR2)
rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-gcc2_95-dirclean:
+gcc-dirclean:
rm -rf $(GCC_BUILD_DIR2)
#############################################################
# Next build target gcc compiler
#
#############################################################
-GCC_BUILD_DIR3:=$(BUILD_DIR)/gcc2_95-target
+GCC_BUILD_DIR3:=$(BUILD_DIR)/gcc-$(GCC_VERSION)-target
$(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR2)/.installed
mkdir -p $(GCC_BUILD_DIR3)
#rm -rf $(TARGET_DIR)/usr/lib/libgcc_s.so*
#touch -c $(TARGET_DIR)/usr/bin/gcc
-gcc2_95_target: uclibc_target binutils_target $(TARGET_DIR)/usr/bin/gcc
+gcc_target: uclibc_target binutils_target $(TARGET_DIR)/usr/bin/gcc
-gcc2_95_target-clean:
+gcc_target-clean:
rm -rf $(GCC_BUILD_DIR3)
rm -f $(TARGET_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-gcc2_95_target-dirclean:
+gcc_target-dirclean:
rm -rf $(GCC_BUILD_DIR3)
endif
+++ /dev/null
-# Makefile for to build a gcc/uClibc toolchain
-#
-# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
-# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
-#
-# 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
-
-ifneq ($(GCC_2_95_TOOLCHAIN),true)
-
-# Shiny new stuff...
-GCC_VERSION:=3.3.4
-GCC_SITE:=ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(GCC_VERSION)
-GCC_SITE:=http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(GCC_VERSION)
-
-#
-# snapshots....
-#GCC_VERSION:=3.3-20031013
-#GCC_SITE:=http://gcc.get-software.com/snapshots/$(GCC_VERSION)
-#
-GCC_SOURCE:=gcc-$(GCC_VERSION).tar.bz2
-GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)
-GCC_CAT:=bzcat
-GCC_STRIP_HOST_BINARIES:=true
-
-#############################################################
-#
-# Setup some initial stuff
-#
-#############################################################
-
-ifeq ($(INSTALL_LIBGCJ),true)
-TARGET_LANGUAGES:=c,c++,java
-else
-ifeq ($(INSTALL_LIBSTDCPP),true)
-TARGET_LANGUAGES:=c,c++
-else
-TARGET_LANGUAGES:=c
-endif
-endif
-
-#############################################################
-#
-# build the first pass gcc compiler
-#
-#############################################################
-GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-3.3-initial
-
-$(DL_DIR)/$(GCC_SOURCE):
- $(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
-
-$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
- $(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
- touch $(GCC_DIR)/.unpacked
-
-$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
- # Apply any files named gcc-*.patch from the source directory to gcc
- $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc-uclibc-3.3*.patch
-ifeq ($(SOFT_FLOAT),true)
-ifeq ("$(strip $(ARCH))","i386")
- $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) i386-gcc-soft-float.patch
-endif
-endif
- touch $(GCC_DIR)/.patched
-
-# 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)
- -mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include
- (cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) \
- $(GCC_DIR)/configure \
- --prefix=$(STAGING_DIR) \
- --build=$(GNU_HOST_NAME) \
- --host=$(GNU_HOST_NAME) \
- --target=$(REAL_GNU_TARGET_NAME) \
- --enable-languages=c \
- --disable-shared \
- --includedir=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include \
- --with-sysroot=$(TOOL_BUILD_DIR)/uClibc_dev/ \
- --disable-__cxa_atexit \
- --enable-target-optspace \
- --with-gnu-ld \
- $(DISABLE_NLS) \
- $(MULTILIB) \
- $(SOFT_FLOAT_CONFIG_OPTION) \
- $(EXTRA_GCC_CONFIG_OPTIONS));
- touch $(GCC_BUILD_DIR1)/.configured
-
-$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
- PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) all-gcc
- touch $(GCC_BUILD_DIR1)/.compiled
-
-$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
- PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -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
-
-gcc3_3_initial: uclibc-configured binutils $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc
-
-gcc3_3_initial-clean:
- rm -rf $(GCC_BUILD_DIR1)
- rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-
-gcc3_3_initial-dirclean:
- rm -rf $(GCC_BUILD_DIR1)
-
-#############################################################
-#
-# second pass compiler build. Build the compiler targeting
-# the newly built shared uClibc library.
-#
-#############################################################
-GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-3.3-final
-$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a
- mkdir -p $(GCC_BUILD_DIR2)
- # Important! Required for limits.h to be fixed.
- ln -sf include $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
- (cd $(GCC_BUILD_DIR2); PATH=$(TARGET_PATH) \
- $(GCC_DIR)/configure \
- --prefix=$(STAGING_DIR) \
- --build=$(GNU_HOST_NAME) \
- --host=$(GNU_HOST_NAME) \
- --target=$(REAL_GNU_TARGET_NAME) \
- --enable-languages=$(TARGET_LANGUAGES) \
- --enable-shared \
- --with-gxx-include-dir=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include/c++ \
- --disable-__cxa_atexit \
- --enable-target-optspace \
- --with-gnu-ld \
- $(DISABLE_NLS) \
- $(MULTILIB) \
- $(SOFT_FLOAT_CONFIG_OPTION) \
- $(GCC_USE_SJLJ_EXCEPTIONS) \
- $(EXTRA_GCC_CONFIG_OPTIONS));
- touch $(GCC_BUILD_DIR2)/.configured
-
-$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
- PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) all
- touch $(GCC_BUILD_DIR2)/.compiled
-
-$(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled
- PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) install
- # Strip the host binaries
-ifeq ($(GCC_STRIP_HOST_BINARIES),true)
- -strip --strip-all -R .note -R .comment $(STAGING_DIR)/bin/*
-endif
- # Set up the symlinks to enable lying about target name.
- set -e; \
- (cd $(STAGING_DIR); \
- ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
- cd bin; \
- for app in $(REAL_GNU_TARGET_NAME)-* ; do \
- ln -sf $${app} \
- $(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
- done; \
- );
-ifeq ($(SOFT_FLOAT),true)
- # 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 $(SOURCE_DIR)/specs-$(ARCH)-soft-float \
- $(STAGING_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
-endif
- touch $(GCC_BUILD_DIR2)/.installed
-
-$(TARGET_DIR)/lib/libgcc_s.so.1: $(GCC_BUILD_DIR2)/.installed
- # These are in /lib, so...
- rm -rf $(TARGET_DIR)/usr/lib/libgcc_s.so*
- -$(STRIP) $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libgcc_s.so.1
- -cp -a $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libgcc_s* $(TARGET_DIR)/lib/
-
-gcc3_3: uclibc-configured binutils gcc3_3_initial $(LIBFLOAT_TARGET) uclibc \
- $(TARGET_DIR)/lib/libgcc_s.so.1 $(GCC_BUILD_DIR2)/.installed $(GCC_TARGETS)
-
-gcc3_3-source: $(DL_DIR)/$(GCC_SOURCE)
-
-gcc3_3-clean:
- rm -rf $(GCC_BUILD_DIR2)
- rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-
-gcc3_3-dirclean:
- rm -rf $(GCC_BUILD_DIR2)
-
-#############################################################
-#
-# Next build target gcc compiler
-#
-#############################################################
-GCC_BUILD_DIR3:=$(BUILD_DIR)/gcc-3.3-target
-
-$(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR2)/.installed
- mkdir -p $(GCC_BUILD_DIR3)
- (cd $(GCC_BUILD_DIR3); PATH=$(TARGET_PATH) \
- $(GCC_DIR)/configure \
- --prefix=/usr \
- --build=$(GNU_HOST_NAME) \
- --host=$(REAL_GNU_TARGET_NAME) \
- --target=$(REAL_GNU_TARGET_NAME) \
- --enable-languages=$(TARGET_LANGUAGES) \
- --enable-shared \
- --with-gxx-include-dir=/usr/include/c++ \
- --disable-__cxa_atexit \
- --enable-target-optspace \
- --with-gnu-ld \
- $(DISABLE_NLS) \
- $(MULTILIB) \
- $(SOFT_FLOAT_CONFIG_OPTION) \
- $(GCC_USE_SJLJ_EXCEPTIONS) \
- $(EXTRA_GCC_CONFIG_OPTIONS));
- touch $(GCC_BUILD_DIR3)/.configured
-
-$(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured
- PATH=$(TARGET_PATH) \
- $(MAKE) $(JLEVEL) $(TARGET_GCC_ARGS) -C $(GCC_BUILD_DIR3) all
- touch $(GCC_BUILD_DIR3)/.compiled
-
-$(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled
- PATH=$(TARGET_PATH) \
- $(MAKE) $(JLEVEL) DESTDIR=$(TARGET_DIR) -C $(GCC_BUILD_DIR3) install
-ifeq ($(SOFT_FLOAT),true)
- # Replace specs file with one that defaults to soft float mode.
- if [ ! -f $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs ] ; then \
- echo target dir specs file is missing ; \
- /bin/false ; \
- fi;
- cp $(SOURCE_DIR)/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
-else
- # Remove broken specs file (cross compile flag is set).
- rm -f $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
-endif
- -(cd $(TARGET_DIR)/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
- -(cd $(TARGET_DIR)/usr/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
- -(cd $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION); $(STRIP) cc1 cc1plus collect2 > /dev/null 2>&1)
- -(cd $(TARGET_DIR)/usr/lib; $(STRIP) libstdc++.so.*.*.* > /dev/null 2>&1)
- -(cd $(TARGET_DIR)/lib; $(STRIP) 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
- cp -f $(STAGING_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/include/syslimits.h $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/include/
- # These are in /lib, so...
- #rm -rf $(TARGET_DIR)/usr/lib/libgcc_s.so*
- #touch -c $(TARGET_DIR)/usr/bin/gcc
-
-gcc3_3_target: uclibc_target binutils_target $(TARGET_DIR)/usr/bin/gcc
-
-gcc3_3_target-clean:
- rm -rf $(GCC_BUILD_DIR3)
- rm -f $(TARGET_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-
-gcc3_3_target-dirclean:
- rm -rf $(GCC_BUILD_DIR3)
-
-endif
--- /dev/null
+# Makefile for to build a gcc/uClibc toolchain
+#
+# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
+#
+# 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
+
+ifneq ($(findstring 2.95,$(GCC_VERSION)),2.95)
+GCC_VERSION:=$(strip $(GCC_VERSION))
+
+GCC_SITE:=ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(GCC_VERSION)
+#GCC_SITE:=http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(GCC_VERSION)
+
+#
+# snapshots....
+#GCC_VERSION:=3.3-20031013
+#GCC_SITE:=http://gcc.get-software.com/snapshots/$(GCC_VERSION)
+#
+GCC_SOURCE:=gcc-$(GCC_VERSION).tar.bz2
+GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)
+GCC_CAT:=bzcat
+GCC_STRIP_HOST_BINARIES:=true
+
+#############################################################
+#
+# Setup some initial stuff
+#
+#############################################################
+
+ifeq ($(INSTALL_LIBGCJ),true)
+TARGET_LANGUAGES:=c,c++,java
+else
+ifeq ($(INSTALL_LIBSTDCPP),true)
+TARGET_LANGUAGES:=c,c++
+else
+TARGET_LANGUAGES:=c
+endif
+endif
+
+#############################################################
+#
+# build the first pass gcc compiler
+#
+#############################################################
+GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-initial
+
+$(DL_DIR)/$(GCC_SOURCE):
+ echo GCC_SOURCE is $(GCC_SOURCE)
+ /bin/false
+ mkdir -p $(DL_DIR)
+ $(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
+
+$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
+ mkdir -p $(TOOL_BUILD_DIR)
+ $(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
+ touch $(GCC_DIR)/.unpacked
+
+$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
+ # Apply any files named gcc-*.patch from the source directory to gcc
+ $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR)/gcc/$(GCC_VERSION) *.patch
+ # 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 ($(SOFT_FLOAT),true)
+ifeq ("$(strip $(ARCH))","arm")
+ $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR)/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional
+endif
+ # Not yet updated to 3.4.1.
+ #ifeq ("$(strip $(ARCH))","i386")
+ #$(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR)/gcc i386-gcc-soft-float.patch
+ #endif
+endif
+ touch $(GCC_DIR)/.patched
+
+# 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) \
+ $(GCC_DIR)/configure \
+ --prefix=$(STAGING_DIR) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --enable-languages=c \
+ --disable-shared \
+ --with-sysroot=$(TOOL_BUILD_DIR)/uClibc_dev/ \
+ --disable-__cxa_atexit \
+ --enable-target-optspace \
+ --with-gnu-ld \
+ $(DISABLE_NLS) \
+ $(MULTILIB) \
+ $(SOFT_FLOAT_CONFIG_OPTION) \
+ $(GCC_WITH_CPU) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
+ $(EXTRA_GCC_CONFIG_OPTIONS));
+ touch $(GCC_BUILD_DIR1)/.configured
+
+$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
+ PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) all-gcc
+ touch $(GCC_BUILD_DIR1)/.compiled
+
+$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
+ PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -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
+
+gcc_initial: uclibc-configured binutils $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc
+
+gcc_initial-clean:
+ rm -rf $(GCC_BUILD_DIR1)
+ rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
+
+gcc_initial-dirclean:
+ rm -rf $(GCC_BUILD_DIR1)
+
+#############################################################
+#
+# 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:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-final
+$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(STAGING_DIR)/lib/libc.a
+ mkdir -p $(GCC_BUILD_DIR2)
+ # Important! Required for limits.h to be fixed.
+ ln -sf ../include $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
+ (cd $(GCC_BUILD_DIR2); PATH=$(TARGET_PATH) \
+ $(GCC_DIR)/configure \
+ --prefix=$(STAGING_DIR) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --enable-languages=$(TARGET_LANGUAGES) \
+ --enable-shared \
+ --disable-__cxa_atexit \
+ --enable-target-optspace \
+ --with-gnu-ld \
+ $(DISABLE_NLS) \
+ $(MULTILIB) \
+ $(SOFT_FLOAT_CONFIG_OPTION) \
+ $(GCC_WITH_CPU) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
+ $(GCC_USE_SJLJ_EXCEPTIONS) \
+ $(EXTRA_GCC_CONFIG_OPTIONS));
+ touch $(GCC_BUILD_DIR2)/.configured
+
+$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
+ PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) all
+ touch $(GCC_BUILD_DIR2)/.compiled
+
+$(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled
+ PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) install
+ # Strip the host binaries
+ifeq ($(GCC_STRIP_HOST_BINARIES),true)
+ -strip --strip-all -R .note -R .comment $(STAGING_DIR)/bin/*
+endif
+ # Set up the symlinks to enable lying about target name.
+ set -e; \
+ (cd $(STAGING_DIR); \
+ ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
+ cd bin; \
+ for app in $(REAL_GNU_TARGET_NAME)-* ; do \
+ ln -sf $${app} \
+ $(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
+ done; \
+ );
+ touch $(GCC_BUILD_DIR2)/.installed
+
+$(TARGET_DIR)/lib/libgcc_s.so.1: $(GCC_BUILD_DIR2)/.installed
+ # These are in /lib, so...
+ rm -rf $(TARGET_DIR)/usr/lib/libgcc_s.so*
+ -$(STRIP) $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libgcc_s.so.1
+ -cp -a $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libgcc_s* $(TARGET_DIR)/lib/
+
+gcc: uclibc-configured binutils gcc_initial $(LIBFLOAT_TARGET) uclibc \
+ $(TARGET_DIR)/lib/libgcc_s.so.1 $(GCC_BUILD_DIR2)/.installed $(GCC_TARGETS)
+
+gcc-source: $(DL_DIR)/$(GCC_SOURCE)
+
+gcc-clean:
+ rm -rf $(GCC_BUILD_DIR2)
+ rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
+
+gcc-dirclean:
+ rm -rf $(GCC_BUILD_DIR2)
+
+#############################################################
+#
+# Next build target gcc compiler
+#
+#############################################################
+GCC_BUILD_DIR3:=$(BUILD_DIR)/gcc-$(GCC_VERSION)-target
+
+$(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR2)/.installed
+ mkdir -p $(GCC_BUILD_DIR3)
+ (cd $(GCC_BUILD_DIR3); PATH=$(TARGET_PATH) \
+ $(GCC_DIR)/configure \
+ --prefix=/usr \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(REAL_GNU_TARGET_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --enable-languages=$(TARGET_LANGUAGES) \
+ --enable-shared \
+ --with-gxx-include-dir=/usr/include/c++ \
+ --disable-__cxa_atexit \
+ --enable-target-optspace \
+ --with-gnu-ld \
+ $(DISABLE_NLS) \
+ $(MULTILIB) \
+ $(SOFT_FLOAT_CONFIG_OPTION) \
+ $(GCC_WITH_CPU) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
+ $(GCC_USE_SJLJ_EXCEPTIONS) \
+ $(EXTRA_GCC_CONFIG_OPTIONS));
+ touch $(GCC_BUILD_DIR3)/.configured
+
+$(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured
+ PATH=$(TARGET_PATH) \
+ $(MAKE) $(JLEVEL) $(TARGET_GCC_ARGS) -C $(GCC_BUILD_DIR3) all
+ touch $(GCC_BUILD_DIR3)/.compiled
+
+#
+# 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
+
+$(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled
+ PATH=$(TARGET_PATH) \
+ $(MAKE) $(JLEVEL) 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
+ -(cd $(TARGET_DIR)/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
+ -(cd $(TARGET_DIR)/usr/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
+ -(cd $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR); $(STRIP) cc1 cc1plus collect2 > /dev/null 2>&1)
+ -(cd $(TARGET_DIR)/usr/lib; $(STRIP) libstdc++.so.*.*.* > /dev/null 2>&1)
+ -(cd $(TARGET_DIR)/lib; $(STRIP) 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)/$(GCC_LIB_SUBDIR)/include/syslimits.h \
+ $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/include/ ; \
+ 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)/bin/$(REAL_GNU_TARGET_NAME)*
+
+gcc_target-dirclean:
+ rm -rf $(GCC_BUILD_DIR3)
+
+endif
-#############################################################
+######################################################################
#
# gdb
#
-#############################################################
+######################################################################
+GDB_VERSION:=$(strip $(GDB_VERSION))
-GDB_SITE:=ftp://ftp.gnu.org/gnu/gdb/
-GDB_DIR:=$(BUILD_DIR)/gdb-5.3
-GDB_SOURCE:=gdb-5.3.tar.gz
-GDB_PATCH:=$(SOURCE_DIR)/gdb.patch
-GDB_UCLIBC_PATCH:=$(SOURCE_DIR)/gdb-5.3-uclibc.patch
+GDB_SITE:=http://ftp.gnu.org/gnu/gdb
+
+ifeq ($(GDB_VERSION),5.3)
+GDB_SOURCE:=gdb-$(GDB_VERSION).tar.gz
+GDB_CAT:=zcat
+else
+GDB_SOURCE:=gdb-$(GDB_VERSION).tar.bz2
+GDB_CAT:=bzcat
+endif
+
+GDB_DIR:=$(TOOL_BUILD_DIR)/gdb-$(GDB_VERSION)
$(DL_DIR)/$(GDB_SOURCE):
$(WGET) -P $(DL_DIR) $(GDB_SITE)/$(GDB_SOURCE)
-$(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE) $(GDB_PATCH)
- gunzip -c $(DL_DIR)/$(GDB_SOURCE) | tar -C $(BUILD_DIR) -xvf -
- cat $(GDB_PATCH) | patch -p1 -d $(GDB_DIR)
- cat $(GDB_UCLIBC_PATCH) | patch -p1 -d $(GDB_DIR)
- touch $(GDB_DIR)/.unpacked
-
-$(GDB_DIR)/.configured: $(GDB_DIR)/.unpacked
+$(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE)
+ $(GDB_CAT) $(DL_DIR)/$(GDB_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
+ $(SOURCE_DIR)/patch-kernel.sh $(GDB_DIR) $(SOURCE_DIR)/gdb/$(GDB_VERSION) *.patch
# Copy a config.sub from gcc. This is only necessary until
# gdb's config.sub supports <arch>-linux-uclibc tuples.
+ # Should probably integrate this into the patch.
+ifeq ($(GDB_VERSION),5.3)
+ chmod u+x $(GDB_DIR)/gdb/gdbserver/configure
cp $(GCC_DIR)/config.sub $(GDB_DIR)
cp $(GCC_DIR)/config.sub $(GDB_DIR)/readline/support/
- (cd $(GDB_DIR); rm -rf config.cache; \
+endif
+ touch $(GDB_DIR)/.unpacked
+
+######################################################################
+#
+# gdb target
+#
+######################################################################
+
+GDB_TARGET_DIR:=$(BUILD_DIR)/gdb-$(GDB_VERSION)-target
+
+GDB_TARGET_CONFIGURE_VARS:= \
+ ac_cv_type_uintptr_t=yes \
+ gt_cv_func_gettext_libintl=yes \
+ ac_cv_func_dcgettext=yes \
+ gdb_cv_func_sigsetjmp=yes \
+ bash_cv_func_strcoll_broken=no \
+ bash_cv_must_reinstall_sighandlers=no \
+ bash_cv_func_sigsetjmp=present \
+ bash_cv_have_mbstate_t=yes
+
+$(GDB_TARGET_DIR)/.configured: $(GDB_DIR)/.unpacked
+ mkdir -p $(GDB_TARGET_DIR)
+ (cd $(GDB_TARGET_DIR); \
$(TARGET_CONFIGURE_OPTS) \
- CFLAGS="$(TARGET_CFLAGS)" \
- ac_cv_type_uintptr_t=yes \
- gt_cv_func_gettext_libintl=yes \
- ac_cv_func_dcgettext=yes \
- gdb_cv_func_sigsetjmp=yes \
- bash_cv_func_strcoll_broken=no \
- bash_cv_must_reinstall_sighandlers=no \
- bash_cv_func_sigsetjmp=present \
- ./configure \
+ CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
+ $(GDB_TARGET_CONFIGURE_VARS) \
+ $(GDB_DIR)/configure \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(REAL_GNU_TARGET_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
+ --prefix=/usr \
+ $(DISABLE_NLS) \
+ --without-uiout --disable-gdbmi \
+ --disable-tui --disable-gdbtk --without-x \
+ --disable-sim --enable-gdbserver \
+ --without-included-gettext \
+ );
+ifeq ($(ENABLE_LOCALE),true)
+ -$(SED) "s,^INTL *=.*,INTL = -lintl,g;" $(GDB_DIR)/gdb/Makefile
+endif
+ touch $(GDB_TARGET_DIR)/.configured
+
+$(GDB_TARGET_DIR)/gdb/gdb: $(GDB_TARGET_DIR)/.configured
+ $(MAKE) CC=$(TARGET_CC) MT_CFLAGS="$(TARGET_CFLAGS)" \
+ -C $(GDB_TARGET_DIR)
+ $(STRIP) $(GDB_TARGET_DIR)/gdb/gdb
+
+$(TARGET_DIR)/usr/bin/gdb: $(GDB_TARGET_DIR)/gdb/gdb
+ install -c $(GDB_TARGET_DIR)/gdb/gdb $(TARGET_DIR)/usr/bin/gdb
+
+gdb_target: $(TARGET_DIR)/usr/bin/gdb
+
+gdb_target-source: $(DL_DIR)/$(GDB_SOURCE)
+
+gdb_target-clean:
+ $(MAKE) -C $(GDB_DIR) clean
+
+gdb_target-dirclean:
+ rm -rf $(GDB_DIR)
+
+######################################################################
+#
+# gdbserver
+#
+######################################################################
+
+GDB_SERVER_DIR:=$(BUILD_DIR)/gdbserver-$(GDB_VERSION)
+
+$(GDB_SERVER_DIR)/.configured: $(GDB_DIR)/.unpacked
+ mkdir -p $(GDB_SERVER_DIR)
+ (cd $(GDB_SERVER_DIR); \
+ $(TARGET_CONFIGURE_OPTS) \
+ $(GDB_DIR)/gdb/gdbserver/configure \
+ --build=$(GNU_HOST_NAME) \
--host=$(REAL_GNU_TARGET_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
$(DISABLE_NLS) \
--without-uiout --disable-gdbmi \
--disable-tui --disable-gdbtk --without-x \
- --disable-sim --enable-gdbserver \
--without-included-gettext \
);
-ifeq ($(ENABLE_LOCALE),true)
- -$(SED) "s,^INTL *=.*,INTL = -lintl,g;" $(GDB_DIR)/gdb/Makefile
-endif
- touch $(GDB_DIR)/.configured
+ touch $(GDB_SERVER_DIR)/.configured
-$(GDB_DIR)/gdb/gdb: $(GDB_DIR)/.configured
- $(MAKE) CC=$(TARGET_CC) -C $(GDB_DIR)
- $(STRIP) $(GDB_DIR)/gdb/gdb
+$(GDB_SERVER_DIR)/gdbserver: $(GDB_SERVER_DIR)/.configured
+ $(MAKE) CC=$(TARGET_CC) MT_CFLAGS="$(TARGET_CFLAGS)" \
+ -C $(GDB_SERVER_DIR)
+ $(STRIP) $(GDB_SERVER_DIR)/gdbserver
-$(TARGET_DIR)/usr/bin/gdb: $(GDB_DIR)/gdb/gdb
- install -c $(GDB_DIR)/gdb/gdb $(TARGET_DIR)/usr/bin/gdb
- rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
- $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
+$(TARGET_DIR)/usr/bin/gdbserver: $(GDB_SERVER_DIR)/gdbserver
+ install -c $(GDB_SERVER_DIR)/gdbserver $(TARGET_DIR)/usr/bin/gdbserver
-gdb: $(TARGET_DIR)/usr/bin/gdb
+gdbserver: $(TARGET_DIR)/usr/bin/gdbserver
-gdb-source: $(DL_DIR)/$(GDB_SOURCE)
+gdbserver-clean:
+ $(MAKE) -C $(GDB_SERVER_DIR) clean
+
+gdbserver-dirclean:
+ rm -rf $(GDB_SERVER_DIR)
+
+######################################################################
+#
+# gdb client
+#
+######################################################################
+
+GDB_CLIENT_DIR:=$(TOOL_BUILD_DIR)/gdbclient-$(GDB_VERSION)
+
+$(GDB_CLIENT_DIR)/.configured: $(GDB_DIR)/.unpacked
+ mkdir -p $(GDB_CLIENT_DIR)
+ (cd $(GDB_CLIENT_DIR); \
+ $(GDB_DIR)/configure \
+ --prefix=$(STAGING_DIR) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ $(DISABLE_NLS) \
+ --without-uiout --disable-gdbmi \
+ --disable-tui --disable-gdbtk --without-x \
+ --without-included-gettext \
+ );
+ touch $(GDB_CLIENT_DIR)/.configured
+
+$(GDB_CLIENT_DIR)/gdb/gdb: $(GDB_CLIENT_DIR)/.configured
+ $(MAKE) -C $(GDB_CLIENT_DIR)
+ strip $(GDB_CLIENT_DIR)/gdb/gdb
+
+$(TARGET_CROSS)gdb: $(GDB_CLIENT_DIR)/gdb/gdb
+ install -c $(GDB_CLIENT_DIR)/gdb/gdb $(TARGET_CROSS)gdb
+ ln -s ../../bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-gdb \
+ $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/gdb
+
+gdbclient: $(TARGET_CROSS)gdb
+
+gdbclient-clean:
+ $(MAKE) -C $(GDB_CLIENT_DIR) clean
+
+gdbclient-dirclean:
+ rm -rf $(GDB_CLIENT_DIR)
-gdb-clean:
- $(MAKE) -C $(GDB_DIR) clean
-gdb-dirclean:
- rm -rf $(GDB_DIR)
+++ /dev/null
-#############################################################
-#
-# gdbserver
-#
-#############################################################
-
-#Use GDB_DIR/etc values from gdb.mk
-#Build gdbserver in a dir outside of the main gdb tree
-GDB_WDIR:=$(BUILD_DIR)/gdbserver
-
-
-$(GDB_WDIR)/.configured: $(GDB_DIR)/.unpacked
- mkdir -p $(GDB_WDIR)
- (cd $(GDB_WDIR); rm -rf config.cache; \
- $(TARGET_CONFIGURE_OPTS) \
- $(GDB_DIR)/gdb/gdbserver/configure \
- --target=$(GNU_TARGET_NAME) \
- --host=$(GNU_TARGET_NAME) \
- --prefix=/usr \
- --exec-prefix=/usr \
- --bindir=/usr/bin \
- --sbindir=/usr/sbin \
- --libexecdir=/usr/lib \
- --sysconfdir=/etc \
- --datadir=/usr/share \
- --localstatedir=/var \
- --mandir=/usr/man \
- --infodir=/usr/info \
- --includedir=$(STAGING_DIR)/include \
- $(DISABLE_NLS) \
- --without-uiout --disable-gdbmi \
- --disable-tui --disable-gdbtk --without-x \
- --without-included-gettext \
- );
- touch $(GDB_WDIR)/.configured
-
-$(GDB_WDIR)/gdbserver: $(GDB_WDIR)/.configured
- $(MAKE) CC=$(TARGET_CC) -C $(GDB_WDIR)
- $(STRIP) $(GDB_WDIR)/gdbserver
-
-$(TARGET_DIR)/usr/bin/gdbserver: $(GDB_WDIR)/gdbserver
- install -c $(GDB_WDIR)/gdbserver $(TARGET_DIR)/usr/bin/gdbserver
- rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
- $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-gdbserver: $(TARGET_DIR)/usr/bin/gdbserver
-
-gdbserver-clean:
- $(MAKE) -C $(GDB_WDIR) clean
-
-gdbserver-dirclean:
- rm -rf $(GDB_WDIR)
-
#
#############################################################
ifneq ($(filter $(TARGETS),kernel-headers),)
+DEFAULT_KERNEL_HEADERS:=$(strip $(DEFAULT_KERNEL_HEADERS))
-VERSION=2
-PATCHLEVEL=4
-SUBLEVEL=25
+LINUX_SITE:=127.0.0.1
+LINUX_SOURCE:=unspecified-kernel-headers
+
+ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.4.25")
+VERSION:=2
+PATCHLEVEL:=4
+SUBLEVEL:=25
LINUX_SITE:=http://www.uclibc.org/downloads/toolchain
LINUX_SOURCE:=kernel-headers-2.4.25.tar.bz2
LINUX_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux
+endif
+ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.6.7")
+VERSION:=2
+PATCHLEVEL:=6
+SUBLEVEL:=7
+LINUX_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
+LINUX_SOURCE:=linux-libc-headers-2.6.7.0.tar.bz2
+LINUX_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.7.0
+endif
-# Uncomment this for 2.6.x kernel header files
-#VERSION=2
-#PATCHLEVEL=6
-#SUBLEVEL=8
-#LINUX_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
-#LINUX_SOURCE:=linux-libc-headers-2.6.8.0.tar.bz2
-#LINUX_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.8.0
-
+ifeq ("$(strip $(DEFAULT_KERNEL_HEADERS))","2.6.8")
+VERSION:=2
+PATCHLEVEL:=6
+SUBLEVEL:=8
+LINUX_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
+LINUX_SOURCE:=linux-libc-headers-2.6.8.0.tar.bz2
+LINUX_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.8.0
+endif
+LINUX_VERSION:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)
LINUX_DIR:=$(TOOL_BUILD_DIR)/linux
$(DL_DIR)/$(LINUX_SOURCE):
+ mkdir -p $(DL_DIR)
$(WGET) -P $(DL_DIR) $(LINUX_SITE)/$(LINUX_SOURCE)
$(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE)
endif
touch $(LINUX_DIR)/.unpacked
-$(LINUX_DIR)/.configured: $(LINUX_DIR)/.unpacked
+$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
+ $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR) $(SOURCE_DIR) linux-libc-headers-$(LINUX_VERSION)-*.patch
+ touch $(LINUX_DIR)/.patched
+
+$(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
rm -f $(LINUX_DIR)/include/asm
@if [ ! -f $(LINUX_DIR)/Makefile ] ; then \
echo -e "VERSION = $(VERSION)\nPATCHLEVEL = $(PATCHLEVEL)\n" > \
# libtool
#
#############################################################
-LIBTOOL_SOURCE:=libtool_1.4.3.orig.tar.gz
-LIBTOOL_SITE:=http://ftp.debian.org/debian/pool/main/libt/libtool
+LIBTOOL_SOURCE:=libtool-1.5.8.tar.gz
+LIBTOOL_SITE:=ftp://ftp.gnu.org/gnu/libtool
LIBTOOL_CAT:=zcat
-LIBTOOL_DIR:=$(BUILD_DIR)/libtool-1.4.3
+LIBTOOL_DIR:=$(BUILD_DIR)/libtool-1.5.8
LIBTOOL_BINARY:=libtool
LIBTOOL_TARGET_BINARY:=usr/bin/libtool
$(DL_DIR)/$(LINUX_SOURCE):
- $(WGET) -P $(DL_DIR) $(LINUX_SITE)/$(LINUX_SOURCE)
+ mkdir $(DL_DIR)
+ $(WGET) -P $(DL_DIR) $(LINUX_SITE)/$(LINUX_SOURCE)
$(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE)
- mkdir -p $(LINUX_DIR) $(TOOL_BUILD_DIR)
- rm -rf $(LINUX_DIR)
+ mkdir $(TOOL_BUILD_DIR)
+ #mkdir -p $(LINUX_DIR)
+ #rm -rf $(LINUX_DIR)
bzcat $(DL_DIR)/$(LINUX_SOURCE) | tar -C $(BUILD_DIR) -xvf -
ifneq ($(DOWNLOAD_LINUX_VERSION),$(LINUX_VERSION))
# Rename the dir from the downloaded version to the AFTER patch version
# ltrace
#
#############################################################
-LTRACE_SOURCE=ltrace_0.3.32.tar.gz
+LTRACE_SOURCE=ltrace_0.3.35.tar.gz
LTRACE_SITE=http://ftp.debian.org/debian/pool/main/l/ltrace
-LTRACE_DIR=$(BUILD_DIR)/ltrace-0.3.32
+LTRACE_DIR=$(BUILD_DIR)/ltrace-0.3.35
LTRACE_BINARY=ltrace
LTRACE_TARGET_BINARY=usr/bin/ltrace
touch $(LTRACE_DIR)/.configured;
$(LTRACE_DIR)/$(LTRACE_BINARY): $(LTRACE_DIR)/.configured
- $(MAKE) CC=$(TARGET_CC) -C $(LTRACE_DIR)
+ $(MAKE) CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld -C $(LTRACE_DIR)
$(TARGET_DIR)/$(LTRACE_TARGET_BINARY): $(LTRACE_DIR)/$(LTRACE_BINARY)
$(MAKE) DESTDIR=$(TARGET_DIR) -C $(LTRACE_DIR) install
#
#############################################################
# Copyright (C) 2002 by Ken Restivo <ken@246gt.com>
-# $Id: ncurses.mk,v 1.33 2004/07/28 19:26:04 andersen Exp $
+# $Id: ncurses.mk,v 1.34 2004/09/03 00:49:33 mjn3 Exp $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as
#use the local tic and not whatever the build system was going to find.
$(SED) 's~\$$srcdir/shlib tic\$$suffix~/usr/bin/tic~' \
$(NCURSES_DIR)/misc/run_tic.in
+ $(SOURCE_DIR)/patch-kernel.sh $(NCURSES_DIR) $(SOURCE_DIR) ncurses-*.patch
touch $(NCURSES_DIR)/.dist
$(NCURSES_DIR)/.configured: $(NCURSES_DIR)/.dist
HOST_SED_TARGET=$(shell ./sources/sedcheck.sh)
$(DL_DIR)/$(SED_SOURCE):
- $(WGET) -P $(DL_DIR) $(SED_SITE)/$(SED_SOURCE)
+ mkdir -p $(DL_DIR)
+ $(WGET) -P $(DL_DIR) $(SED_SITE)/$(SED_SOURCE)
sed-source: $(DL_DIR)/$(SED_SOURCE)
#############################################################
$(SED_DIR1)/.unpacked: $(DL_DIR)/$(SED_SOURCE)
mkdir -p $(TOOL_BUILD_DIR)
- mkdir -p $(DL_DIR)
mkdir -p $(STAGING_DIR)/bin;
$(SED_CAT) $(DL_DIR)/$(SED_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
touch $(SED_DIR1)/.unpacked
# strace
#
#############################################################
-STRACE_SOURCE:=strace-4.5.3.tar.bz2
+#STRACE_SOURCE:=strace-4.5.3.tar.bz2
+STRACE_SOURCE:=strace-4.5.6.tar.bz2
STRACE_SITE:=http://aleron.dl.sourceforge.net/sourceforge/strace
STRACE_CAT:=bzcat
-STRACE_DIR:=$(BUILD_DIR)/strace-4.5.3
+#STRACE_DIR:=$(BUILD_DIR)/strace-4.5.3
+STRACE_DIR:=$(BUILD_DIR)/strace-4.5.6
$(DL_DIR)/$(STRACE_SOURCE):
# uClibc (the C library)
#
#############################################################
-ifeq ($(USE_UCLIBC_SNAPSHOT),true)
+
+ifneq ($(strip $(USE_UCLIBC_SNAPSHOT)),)
# Be aware that this changes daily....
-UCLIBC_DIR=$(BUILD_DIR)/uClibc
-UCLIBC_SOURCE=uClibc-snapshot.tar.bz2
+UCLIBC_DIR:=$(TOOL_BUILD_DIR)/uClibc
+UCLIBC_SOURCE:=uClibc-$(strip $(USE_UCLIBC_SNAPSHOT)).tar.bz2
UCLIBC_SITE:=http://www.uclibc.org/downloads/snapshots
else
-UCLIBC_DIR:=$(BUILD_DIR)/uClibc-0.9.26
-UCLIBC_SOURCE:=uClibc-0.9.26.tar.bz2
+# Note: 0.9.26 has known problems. So best use a snapshot until .27 is out.
+# Anticipate the change.
+UCLIBC_DIR:=$(TOOL_BUILD_DIR)/uClibc-0.9.27
+UCLIBC_SOURCE:=uClibc-0.9.27.tar.bz2
UCLIBC_SITE:=http://www.uclibc.org/downloads
endif
$(DL_DIR)/$(UCLIBC_SOURCE):
+ mkdir -p $(DL_DIR)
$(WGET) -P $(DL_DIR) $(UCLIBC_SITE)/$(UCLIBC_SOURCE)
$(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
-ifeq ($(SOFT_FLOAT),true)
- # Make sure we have a soft float specs file for this arch
- if [ ! -f $(SOURCE_DIR)/specs-$(ARCH)-soft-float ] ; then \
- echo soft float configured but no specs file for this arch ; \
- /bin/false ; \
- fi;
-endif
- bzcat $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(BUILD_DIR) -xvf -
- #(cd $(BUILD_DIR) ; ln -s $(DL_DIR)/uClibc)
- #-mkdir $(UCLIBC_DIR)
- #(cd $(DL_DIR)/uClibc && tar cf - .) | (cd $(UCLIBC_DIR) && tar xvfp - )
- $(SOURCE_DIR)/patch-kernel.sh $(UCLIBC_DIR) $(SOURCE_DIR) uClibc-*.patch
+ mkdir -p $(TOOL_BUILD_DIR)
+ bzcat $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
touch $(UCLIBC_DIR)/.unpacked
$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked $(LINUX_DIR)/.configured
mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/include
mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/lib
mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/lib
- -$(MAKE) -C $(UCLIBC_DIR) \
- PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
- DEVEL_PREFIX=/usr/ \
- RUNTIME_PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
- HOSTCC="$(HOSTCC)" \
- oldconfig;
- -$(MAKE) -C $(UCLIBC_DIR) \
+ $(MAKE) -C $(UCLIBC_DIR) \
PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
DEVEL_PREFIX=/usr/ \
RUNTIME_PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
HOSTCC="$(HOSTCC)" \
- headers pregen install_dev;
+ pregen install_dev;
touch $(UCLIBC_DIR)/.configured
$(UCLIBC_DIR)/lib/libc.a: $(UCLIBC_DIR)/.configured $(LIBFLOAT_TARGET)
$(MAKE) -C $(UCLIBC_DIR) \
PREFIX= \
- DEVEL_PREFIX=$(REAL_GNU_TARGET_NAME)/ \
+ DEVEL_PREFIX=/ \
RUNTIME_PREFIX=/ \
HOSTCC="$(HOSTCC)" \
all
-$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a: $(UCLIBC_DIR)/lib/libc.a
+$(STAGING_DIR)/lib/libc.a: $(UCLIBC_DIR)/lib/libc.a
$(MAKE) -C $(UCLIBC_DIR) \
PREFIX=$(STAGING_DIR)/ \
- DEVEL_PREFIX=$(REAL_GNU_TARGET_NAME)/ \
- RUNTIME_PREFIX=$(REAL_GNU_TARGET_NAME)/ \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
install_runtime
$(MAKE) -C $(UCLIBC_DIR) \
PREFIX=$(STAGING_DIR)/ \
- DEVEL_PREFIX=$(REAL_GNU_TARGET_NAME)/ \
- RUNTIME_PREFIX=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/ \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
install_dev
$(MAKE) -C $(UCLIBC_DIR) \
PREFIX=$(STAGING_DIR) \
$(MAKE) -C $(UCLIBC_DIR)/utils clean
ifneq ($(TARGET_DIR),)
-$(TARGET_DIR)/lib/libc.so.0: $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a
+$(TARGET_DIR)/lib/libc.so.0: $(STAGING_DIR)/lib/libc.a
$(MAKE) -C $(UCLIBC_DIR) \
PREFIX=$(TARGET_DIR) \
DEVEL_PREFIX=/usr/ \
uclibc-configured: $(UCLIBC_DIR)/.configured
-uclibc: $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a \
+uclibc: $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc $(STAGING_DIR)/lib/libc.a \
$(UCLIBC_TARGETS)
uclibc-source: $(DL_DIR)/$(UCLIBC_SOURCE)
RUNTIME_PREFIX=/ \
install_dev
-ifeq ($(GCC_2_95_TOOLCHAIN),true)
-uclibc_target: gcc2_95 uclibc $(TARGET_DIR)/usr/lib/libc.a
-else
-uclibc_target: gcc3_3 uclibc $(TARGET_DIR)/usr/lib/libc.a
-endif
+uclibc_target: gcc uclibc $(TARGET_DIR)/usr/lib/libc.a
uclibc_target-clean:
rm -f $(TARGET_DIR)/include
#############################################################
UTIL-LINUX_SOURCE:=util-linux_2.12.orig.tar.gz
UTIL-LINUX_SITE:=http://ftp.debian.org/debian/pool/main/u/util-linux/
-UTIL-LINUX_PATCH:=util-linux_2.12-6.diff.gz
+UTIL-LINUX_PATCH:=util-linux_2.12-7.diff.gz
UTIL-LINUX_CAT:=zcat
UTIL-LINUX_DIR:=$(BUILD_DIR)/util-linux-2.12
UTIL-LINUX_BINARY:=$(UTIL-LINUX_DIR)/misc-utils/mcookie
+++ /dev/null
---- binutils-2.11.90.0.19.orig/ld/Makefile.am
-+++ binutils-2.11.90.0.19/ld/Makefile.am
-@@ -19,7 +19,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
-
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
---- binutils-2.11.90.0.19.orig/ld/Makefile.in
-+++ binutils-2.11.90.0.19/ld/Makefile.in
-@@ -123,7 +123,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
-
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
-diff -urN binutils-2.11.90.0.27/gprof/gprof.texi binutils-2.11.90.0.27.new/gprof/gprof.texi
---- binutils-2.11.90.0.27/gprof/gprof.texi Tue Jun 19 14:57:58 2001
-+++ binutils-2.11.90.0.27.new/gprof/gprof.texi Mon Aug 27 10:27:23 2001
-@@ -137,6 +137,10 @@
- If more than one profile file is specified, the @code{gprof}
- output shows the sum of the profile information in the given profile files.
-
-+If you use gcc 2.95.x or 3.0 to compile your binaries, you may need
-+to add the @samp{-fprofile-arcs} to the compile command line in order
-+for the call graphs to be properly stored in gmon.out.
-+
- @code{Gprof} calculates the amount of time spent in each routine.
- Next, these times are propagated along the edges of the call graph.
- Cycles are discovered, and calls into a cycle are made to share the time
-@@ -266,6 +270,11 @@
- to do the linking, simply specify @samp{-pg} in addition to your usual
- options. The same option, @samp{-pg}, alters either compilation or linking
- to do what is necessary for profiling. Here are examples:
-+
-+If you use gcc 2.95.x or 3.0.x, you may need to add the
-+@samp{-fprofile-arcs} option to the compile line along with @samp{-pg}
-+in order to allow the call-graphs to be properly included in the gmon.out
-+file.
-
- @example
- cc -g -c myprog.c utils.c -pg
-diff -urN binutils-2.11.92.0.5/bfd/opncls.c binutils-2.11.92.0.5.new/bfd/opncls.c
---- binutils-2.11.92.0.5/bfd/opncls.c Mon Oct 1 18:25:21 2001
-+++ binutils-2.11.92.0.5.new/bfd/opncls.c Sat Oct 13 11:26:59 2001
-@@ -127,6 +127,13 @@
- {
- bfd *nbfd;
- const bfd_target *target_vec;
-+ struct stat s;
-+
-+ if (stat (filename, &s) == 0)
-+ if (S_ISDIR(s.st_mode)) {
-+ bfd_set_error (bfd_error_file_not_recognized);
-+ return NULL;
-+ }
-
- nbfd = _bfd_new_bfd ();
- if (nbfd == NULL)
-diff -urN binutils-2.11.92.0.12.3/opcodes/i386-dis.c binutils-2.11.92.0.12.3.new/opcodes/i386-dis.c
---- binutils-2.11.92.0.12.3/opcodes/i386-dis.c Fri Nov 16 17:05:55 2001
-+++ binutils-2.11.92.0.12.3.new/opcodes/i386-dis.c Mon Dec 31 15:55:04 2001
-@@ -1830,7 +1830,7 @@
- * The function returns the length of this instruction in bytes.
- */
-
--static char intel_syntax;
-+static signed char intel_syntax;
- static char open_char;
- static char close_char;
- static char separator_char;
-diff -urN binutils-2.12.90.0.12/ld/emultempl/elf32.em binutils-2.12.90.0.12.new/ld/emultempl/elf32.em
---- binutils-2.12.90.0.12/ld/emultempl/elf32.em Wed Jun 19 00:41:59 2002
-+++ binutils-2.12.90.0.12.new/ld/emultempl/elf32.em Wed Jun 26 10:00:26 2002
-@@ -672,6 +672,8 @@
- && command_line.rpath == NULL)
- {
- lib_path = (const char *) getenv ("LD_RUN_PATH");
-+ if ((lib_path) && (strlen (lib_path) == 0))
-+ lib_path = NULL;
- if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
- force))
- break;
-@@ -867,6 +869,8 @@
- rpath = command_line.rpath;
- if (rpath == NULL)
- rpath = (const char *) getenv ("LD_RUN_PATH");
-+ if ((rpath) && (strlen (rpath) == 0))
-+ rpath = NULL;
- if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
- (output_bfd, command_line.soname, rpath,
- command_line.filter_shlib,
-diff -urN binutils-2.13.90.0.18/gprof/gprof.texi binutils-2.13.90.0.18.new/gprof/gprof.texi
---- binutils-2.13.90.0.18/gprof/gprof.texi 2003-02-02 18:29:09.000000000 -0500
-+++ binutils-2.13.90.0.18.new/gprof/gprof.texi 2003-02-02 18:28:37.000000000 -0500
-@@ -185,7 +185,7 @@
- @c man end
-
- @c man begin SEEALSO
--monitor(3), profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
-+profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
-
- ``An Execution Profiler for Modular Programs'',
- by S. Graham, P. Kessler, M. McKusick;
-diff -urN binutils-2.13.90.0.10/opcodes/alpha-opc.c binutils-2.13.90.0.10.new/opcodes/alpha-opc.c
---- binutils-2.13.90.0.10/opcodes/alpha-opc.c 2002-03-07 14:52:40.000000000 -0500
-+++ binutils-2.13.90.0.10.new/opcodes/alpha-opc.c 2002-10-12 20:16:08.000000000 -0400
-@@ -1101,7 +1101,8 @@
- { "wmb", MFC(0x18,0x4400), BASE, ARG_NONE },
- { "fetch", MFC(0x18,0x8000), BASE, { ZA, PRB } },
- { "fetch_m", MFC(0x18,0xA000), BASE, { ZA, PRB } },
-- { "rpcc", MFC(0x18,0xC000), BASE, { RA } },
-+ { "rpcc", MFC(0x18,0xC000), BASE, { RA, ZB } },
-+ { "rpcc", MFC(0x18,0xC000), BASE, { RA, RB } }, /* ev6 una */
- { "rc", MFC(0x18,0xE000), BASE, { RA } },
- { "ecb", MFC(0x18,0xE800), BASE, { ZA, PRB } }, /* ev56 una */
- { "rs", MFC(0x18,0xF000), BASE, { RA } },
---- binutils-2.13.90.0.18/bfd/elf64-alpha.c 2003-01-21 19:21:32.000000000 +0100
-+++ binutils-2.13.90.0.18-modif/bfd/elf64-alpha.c 2003-04-11 01:24:26.000000000 +0200
-@@ -4184,9 +4184,12 @@
-
- loc = srel->contents;
- loc += srel->reloc_count++ * sizeof (Elf64_External_Rela);
-- bfd_elf64_swap_reloca_out (abfd, &outrel, loc);
-- BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
-- <= srel->_cooked_size);
-+ if (loc)
-+ {
-+ bfd_elf64_swap_reloca_out (abfd, &outrel, loc);
-+ BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
-+ <= srel->_cooked_size);
-+ }
- }
-
- /* Relocate an Alpha ELF section for a relocatable link.
-2003-05-23 H.J. Lu <hongjiu.lu@intel.com>
-
- * ltmain.sh: Make symlink for shared library if needed.
-
-opcodes/
-
-2003-07-14 H.J. Lu <hongjiu.lu@intel.com>
-
- * Makefile.in: Regenerated.
-
-2003-06-11 H.J. Lu <hongjiu.lu@intel.com>
-
- * Makefile.in: Regenerated.
-
-2003-05-23 H.J. Lu <hongjiu.lu@intel.com>
-
- * Makefile.am (libopcodes_la_LIBADD): Use "-L../bfd -lbfd"
- instead of "../bfd/libbfd.la".
- * Makefile.in: Regenerated.
-
---- binutils/ltmain.sh.dso 2002-03-22 00:16:20.000000000 -0800
-+++ binutils/ltmain.sh 2003-07-14 12:50:17.000000000 -0700
-@@ -4413,6 +4413,10 @@ relink_command=\"$relink_command\""
- # LD_LIBRARY_PATH before the program is installed.
- $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
- $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
-+ if test -n "$linkname"; then
-+ $show "(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)"
-+ $run eval '(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)' || exit $?
-+ fi
- ;;
- esac
- exit 0
---- binutils/opcodes/Makefile.am.dso 2003-06-11 07:18:04.000000000 -0700
-+++ binutils/opcodes/Makefile.am 2003-07-14 12:50:18.000000000 -0700
-@@ -283,7 +283,7 @@ disassemble.lo: disassemble.c $(INCDIR)/
-
- libopcodes_la_SOURCES = dis-buf.c disassemble.c
- libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
--libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
-+libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ -L../bfd -lbfd
- libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
-
- # libtool will build .libs/libopcodes.a. We create libopcodes.a in
+++ /dev/null
-diff -urN binutils-2.14.90.0.6/bfd/config.bfd binutils-2.14.90.0.6-uClibc/bfd/config.bfd
---- binutils-2.14.90.0.6/bfd/config.bfd 2003-08-21 10:28:47.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/bfd/config.bfd 2004-01-06 23:20:32.000000000 -0600
-@@ -121,7 +121,7 @@
- targ_defvec=ecoffalpha_little_vec
- targ_selvecs=bfd_elf64_alpha_vec
- ;;
-- alpha*-*-linux-gnu* | alpha*-*-elf*)
-+ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
- targ_defvec=bfd_elf64_alpha_vec
- targ_selvecs=ecoffalpha_little_vec
- ;;
-@@ -131,7 +131,8 @@
- alpha*-*-*)
- targ_defvec=ecoffalpha_little_vec
- ;;
-- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*)
-+ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | \
-+ ia64*-*-linux-uclibc* | ia64*-*-elf*)
- targ_defvec=bfd_elf64_ia64_little_vec
- targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
- ;;
-@@ -214,7 +215,7 @@
- targ_defvec=bfd_elf32_littlearm_vec
- targ_selvecs=bfd_elf32_bigarm_vec
- ;;
-- armeb-*-elf | arm*b-*-linux-gnu*)
-+ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
- targ_defvec=bfd_elf32_bigarm_vec
- targ_selvecs=bfd_elf32_littlearm_vec
- ;;
-@@ -222,7 +223,8 @@
- targ_defvec=bfd_elf32_littlearm_vec
- targ_selvecs=bfd_elf32_bigarm_vec
- ;;
-- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*)
-+ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \
-+ arm*-*-conix* | arm*-*-uclinux*)
- targ_defvec=bfd_elf32_littlearm_vec
- targ_selvecs=bfd_elf32_bigarm_vec
- ;;
-@@ -355,7 +357,7 @@
- ;;
-
- #ifdef BFD64
-- hppa*64*-*-linux-gnu*)
-+ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
- targ_defvec=bfd_elf64_hppa_linux_vec
- targ_selvecs=bfd_elf64_hppa_vec
- ;;
-@@ -366,7 +368,7 @@
- ;;
- #endif
-
-- hppa*-*-linux-gnu*)
-+ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)
- targ_defvec=bfd_elf32_hppa_linux_vec
- targ_selvecs=bfd_elf32_hppa_vec
- ;;
-@@ -488,7 +490,7 @@
- targ_selvecs=bfd_elf32_i386_vec
- targ_underscore=yes
- ;;
-- i[3-7]86-*-linux-gnu*)
-+ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
- targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -502,7 +504,7 @@
- targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
- ;;
-- x86_64-*-linux-gnu*)
-+ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
- targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
- ;;
-@@ -662,7 +664,7 @@
- targ_selvecs=bfd_elf32_m68k_vec
- targ_underscore=yes
- ;;
-- m68*-*-linux-gnu*)
-+ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
- targ_defvec=bfd_elf32_m68k_vec
- targ_selvecs=m68klinux_vec
- ;;
-@@ -929,7 +931,8 @@
- ;;
- #endif
- powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
-- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+ powerpc-*-rtems* | \
- powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
- targ_defvec=bfd_elf32_powerpc_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -961,8 +964,8 @@
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
- ;;
- powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
-- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
-- powerpcle-*-rtems*)
-+ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+ powerpcle-*-vxworks* | powerpcle-*-rtems*)
- targ_defvec=bfd_elf32_powerpcle_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
- targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1110,7 +1113,7 @@
- targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
- targ_underscore=yes
- ;;
-- sparc-*-linux-gnu*)
-+ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
- targ_defvec=bfd_elf32_sparc_vec
- targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
- ;;
-@@ -1157,7 +1160,7 @@
- targ_defvec=sunos_big_vec
- targ_underscore=yes
- ;;
-- sparc64-*-linux-gnu*)
-+ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
- targ_defvec=bfd_elf64_sparc_vec
- targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
- ;;
-diff -urN binutils-2.14.90.0.6/bfd/configure binutils-2.14.90.0.6-uClibc/bfd/configure
---- binutils-2.14.90.0.6/bfd/configure 2003-08-21 10:28:47.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/bfd/configure 2004-01-06 20:26:51.000000000 -0600
-@@ -1698,6 +1698,11 @@
- lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
- ;;
-
-+linux-uclibc*)
-+ lt_cv_deplibs_check_method=pass_all
-+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+ ;;
-+
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5102,7 +5107,7 @@
- alpha*-*-freebsd*)
- COREFILE=''
- ;;
-- alpha*-*-linux-gnu*)
-+ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/alphalinux.h"'
- ;;
-@@ -5161,7 +5166,7 @@
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/i386mach3.h"'
- ;;
-- i[3-7]86-*-linux-gnu*)
-+ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/i386linux.h"'
- ;;
-@@ -5211,7 +5216,7 @@
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/hp300bsd.h"'
- ;;
-- m68*-*-linux-gnu*)
-+ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/m68klinux.h"'
- ;;
-diff -urN binutils-2.14.90.0.6/bfd/configure.in binutils-2.14.90.0.6-uClibc/bfd/configure.in
---- binutils-2.14.90.0.6/bfd/configure.in 2003-08-21 10:28:47.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/bfd/configure.in 2004-01-06 20:33:02.000000000 -0600
-@@ -153,7 +153,7 @@
- alpha*-*-freebsd*)
- COREFILE=''
- ;;
-- alpha*-*-linux-gnu*)
-+ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/alphalinux.h"'
- ;;
-@@ -233,7 +233,7 @@
- TRAD_HEADER='"hosts/i386mach3.h"'
- ;;
- changequote(,)dnl
-- i[3-7]86-*-linux-gnu*)
-+ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- changequote([,])dnl
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/i386linux.h"'
-@@ -286,7 +286,7 @@
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/hp300bsd.h"'
- ;;
-- m68*-*-linux-gnu*)
-+ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/m68klinux.h"'
- ;;
-diff -urN binutils-2.14.90.0.6/config.sub binutils-2.14.90.0.6-uClibc/config.sub
---- binutils-2.14.90.0.6/config.sub 2003-08-21 10:28:47.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/config.sub 2004-01-06 22:56:56.000000000 -0600
-@@ -118,7 +118,7 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
-- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-+ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
-@@ -1131,7 +1131,8 @@
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+ | -mingw32* | -linux-gnu* | -linux-uclibc* \
-+ | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-diff -urN binutils-2.14.90.0.6/configure binutils-2.14.90.0.6-uClibc/configure
---- binutils-2.14.90.0.6/configure 2003-08-21 10:29:32.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/configure 2004-01-07 05:43:40.000000000 -0600
-@@ -1257,6 +1262,18 @@
- i[3456789]86-*-freebsd*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
-+ i[3456789]86-*-linux-uclibc)
-+ # This section makes it possible to build newlib natively on linux.
-+ # If we are using a cross compiler then don't configure newlib.
-+ if test x${is_cross_compiler} != xno ; then
-+ noconfigdirs="$noconfigdirs target-newlib"
-+ fi
-+ noconfigdirs="$noconfigdirs target-libgloss"
-+ # If we are not using a cross compiler, do configure newlib.
-+ # Note however, that newlib will only be configured in this situation
-+ # if the --with-newlib option has been given, because otherwise
-+ # 'target-newlib' will appear in skipdirs.
-+ ;;
- i[3456789]86-*-linux*)
- # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
- # not build java stuff by default.
-diff -urN binutils-2.14.90.0.6/configure.in binutils-2.14.90.0.6-uClibc/configure.in
---- binutils-2.14.90.0.6/configure.in 2003-08-21 10:29:30.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/configure.in 2004-01-07 05:44:02.000000000 -0600
-@@ -508,6 +513,19 @@
- i[[3456789]]86-*-freebsd*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
-+ i[3456789]86-*-linux-uclibc)
-+ # This section makes it possible to build newlib natively on linux.
-+ # If we are using a cross compiler then don't configure newlib.
-+ if test x${is_cross_compiler} != xno ; then
-+ noconfigdirs="$noconfigdirs target-newlib"
-+ fi
-+ noconfigdirs="$noconfigdirs target-libgloss"
-+ build_modules=
-+ # If we are not using a cross compiler, do configure newlib.
-+ # Note however, that newlib will only be configured in this situation
-+ # if the --with-newlib option has been given, because otherwise
-+ # 'target-newlib' will appear in skipdirs.
-+ ;;
- i[[3456789]]86-*-linux*)
- # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
- # not build java stuff by default.
-diff -urN binutils-2.14.90.0.6/demangler/configure binutils-2.14.90.0.6-uClibc/demangler/configure
---- binutils-2.14.90.0.6/demangler/configure 2003-08-21 10:29:31.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/demangler/configure 2004-01-06 21:45:51.000000000 -0600
-@@ -1363,6 +1363,11 @@
- lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
- ;;
-
-+linux-uclibc*)
-+ lt_cv_deplibs_check_method=pass_all
-+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+ ;;
-+
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.14.90.0.6/gas/configure binutils-2.14.90.0.6-uClibc/gas/configure
---- binutils-2.14.90.0.6/gas/configure 2003-07-23 10:08:10.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/gas/configure 2004-01-06 21:57:25.000000000 -0600
-@@ -1576,6 +1576,11 @@
- lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
- ;;
-
-+linux-uclibc*)
-+ lt_cv_deplibs_check_method=pass_all
-+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+ ;;
-+
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -2370,6 +2375,7 @@
- alpha*-*-osf*) fmt=ecoff ;;
- alpha*-*-linuxecoff*) fmt=ecoff ;;
- alpha*-*-linux-gnu*) fmt=elf em=linux ;;
-+ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
- alpha*-*-netbsd*) fmt=elf em=nbsd ;;
- alpha*-*-openbsd*) fmt=elf em=obsd ;;
-
-@@ -2386,6 +2392,7 @@
- arm*-*-conix*) fmt=elf ;;
- arm-*-linux*aout*) fmt=aout em=linux ;;
- arm*-*-linux-gnu*) fmt=elf em=linux ;;
-+ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
- arm*-*-uclinux*) fmt=elf em=linux ;;
- arm-*-netbsdelf*) fmt=elf em=nbsd ;;
- arm-*-*n*bsd*) fmt=aout em=nbsd ;;
-@@ -2400,6 +2407,7 @@
- avr-*-*) fmt=elf ;;
-
- cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
-+ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
- cris-*-*) fmt=multi bfd_gas=yes ;;
-
- d10v-*-*) fmt=elf ;;
-@@ -2455,7 +2463,9 @@
- i386-*-linux*oldld) fmt=aout em=linux ;;
- i386-*-linux*coff*) fmt=coff em=linux ;;
- i386-*-linux-gnu*) fmt=elf em=linux ;;
-+ i386-*-linux-uclibc*) fmt=elf em=linux ;;
- x86_64-*-linux-gnu*) fmt=elf em=linux ;;
-+ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
- i386-*-lynxos*) fmt=coff em=lynx ;;
- i386-*-sysv[45]*) fmt=elf ;;
- i386-*-solaris*) fmt=elf ;;
-@@ -2512,6 +2522,7 @@
- ia64-*-elf*) fmt=elf ;;
- ia64-*-aix*) fmt=elf em=ia64aix ;;
- ia64-*-linux-gnu*) fmt=elf em=linux ;;
-+ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
- ia64-*-hpux*) fmt=elf em=hpux ;;
- ia64-*-netbsd*) fmt=elf em=nbsd ;;
-
-@@ -2538,6 +2549,7 @@
- m68k-*-hpux*) fmt=hp300 em=hp300 ;;
- m68k-*-linux*aout*) fmt=aout em=linux ;;
- m68k-*-linux-gnu*) fmt=elf em=linux ;;
-+ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
- m68k-*-gnu*) fmt=elf ;;
- m68k-*-lynxos*) fmt=coff em=lynx ;;
- m68k-*-netbsdelf*) fmt=elf em=nbsd ;;
-@@ -2592,6 +2604,7 @@
- ppc-*-beos*) fmt=coff ;;
- ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
- ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
-+ ppc-*-linux-uclibc* | \
- ppc-*-linux-gnu*) fmt=elf
- case "$endian" in
- big) ;;
-@@ -2616,7 +2629,9 @@
- ppc-*-kaos*) fmt=elf ;;
-
- s390x-*-linux-gnu*) fmt=elf em=linux ;;
-+ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
- s390-*-linux-gnu*) fmt=elf em=linux ;;
-+ s390-*-linux-uclibc*) fmt=elf em=linux ;;
-
- sh*-*-linux*) fmt=elf em=linux
- case ${cpu} in
-@@ -2649,6 +2664,7 @@
- sparc-*-coff) fmt=coff ;;
- sparc-*-linux*aout*) fmt=aout em=linux ;;
- sparc-*-linux-gnu*) fmt=elf em=linux ;;
-+ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
- sparc-*-lynxos*) fmt=coff em=lynx ;;
- sparc-fujitsu-none) fmt=aout ;;
- sparc-*-elf) fmt=elf ;;
-diff -urN binutils-2.14.90.0.6/gas/configure.in binutils-2.14.90.0.6-uClibc/gas/configure.in
---- binutils-2.14.90.0.6/gas/configure.in 2003-07-23 10:08:10.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/gas/configure.in 2004-01-06 21:57:26.000000000 -0600
-@@ -184,6 +184,7 @@
- alpha*-*-osf*) fmt=ecoff ;;
- alpha*-*-linuxecoff*) fmt=ecoff ;;
- alpha*-*-linux-gnu*) fmt=elf em=linux ;;
-+ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
- alpha*-*-netbsd*) fmt=elf em=nbsd ;;
- alpha*-*-openbsd*) fmt=elf em=obsd ;;
-
-@@ -200,6 +201,7 @@
- arm*-*-conix*) fmt=elf ;;
- arm-*-linux*aout*) fmt=aout em=linux ;;
- arm*-*-linux-gnu*) fmt=elf em=linux ;;
-+ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
- arm*-*-uclinux*) fmt=elf em=linux ;;
- arm-*-netbsdelf*) fmt=elf em=nbsd ;;
- arm-*-*n*bsd*) fmt=aout em=nbsd ;;
-@@ -214,6 +216,7 @@
- avr-*-*) fmt=elf ;;
-
- cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
-+ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
- cris-*-*) fmt=multi bfd_gas=yes ;;
-
- d10v-*-*) fmt=elf ;;
-@@ -269,7 +272,9 @@
- i386-*-linux*oldld) fmt=aout em=linux ;;
- i386-*-linux*coff*) fmt=coff em=linux ;;
- i386-*-linux-gnu*) fmt=elf em=linux ;;
-+ i386-*-linux-uclibc*) fmt=elf em=linux ;;
- x86_64-*-linux-gnu*) fmt=elf em=linux ;;
-+ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
- i386-*-lynxos*) fmt=coff em=lynx ;;
- changequote(,)dnl
- i386-*-sysv[45]*) fmt=elf ;;
-@@ -322,6 +327,7 @@
- ia64-*-elf*) fmt=elf ;;
- ia64-*-aix*) fmt=elf em=ia64aix ;;
- ia64-*-linux-gnu*) fmt=elf em=linux ;;
-+ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
- ia64-*-hpux*) fmt=elf em=hpux ;;
- ia64-*-netbsd*) fmt=elf em=nbsd ;;
-
-@@ -348,6 +354,7 @@
- m68k-*-hpux*) fmt=hp300 em=hp300 ;;
- m68k-*-linux*aout*) fmt=aout em=linux ;;
- m68k-*-linux-gnu*) fmt=elf em=linux ;;
-+ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
- m68k-*-gnu*) fmt=elf ;;
- m68k-*-lynxos*) fmt=coff em=lynx ;;
- m68k-*-netbsdelf*) fmt=elf em=nbsd ;;
-@@ -402,6 +409,7 @@
- ppc-*-beos*) fmt=coff ;;
- ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
- ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
-+ ppc-*-linux-uclibc* | \
- ppc-*-linux-gnu*) fmt=elf
- case "$endian" in
- big) ;;
-@@ -424,7 +432,9 @@
- ppc-*-kaos*) fmt=elf ;;
-
- s390x-*-linux-gnu*) fmt=elf em=linux ;;
-+ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
- s390-*-linux-gnu*) fmt=elf em=linux ;;
-+ s390-*-linux-uclibc*) fmt=elf em=linux ;;
-
- sh*-*-linux*) fmt=elf em=linux
- case ${cpu} in
-@@ -457,6 +467,7 @@
- sparc-*-coff) fmt=coff ;;
- sparc-*-linux*aout*) fmt=aout em=linux ;;
- sparc-*-linux-gnu*) fmt=elf em=linux ;;
-+ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
- sparc-*-lynxos*) fmt=coff em=lynx ;;
- sparc-fujitsu-none) fmt=aout ;;
- sparc-*-elf) fmt=elf ;;
-diff -urN binutils-2.14.90.0.6/ld/configure binutils-2.14.90.0.6-uClibc/ld/configure
---- binutils-2.14.90.0.6/ld/configure 2003-05-05 16:46:49.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/ld/configure 2004-01-06 21:59:31.000000000 -0600
-@@ -1578,6 +1578,11 @@
- lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
- ;;
-
-+linux-uclibc*)
-+ lt_cv_deplibs_check_method=pass_all
-+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+ ;;
-+
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.14.90.0.6/ld/configure.tgt binutils-2.14.90.0.6-uClibc/ld/configure.tgt
---- binutils-2.14.90.0.6/ld/configure.tgt 2003-08-21 10:28:48.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/ld/configure.tgt 2004-01-06 22:09:40.000000000 -0600
-@@ -30,6 +30,7 @@
- targ_extra_emuls="criself crislinux"
- targ_extra_libpath=$targ_extra_emuls ;;
- cris-*-linux-gnu*) targ_emul=crislinux ;;
-+cris-*-linux-uclibc*) targ_emul=crislinux ;;
- cris-*-*) targ_emul=criself
- targ_extra_emuls="crisaout crislinux"
- targ_extra_libpath=$targ_extra_emuls ;;
-@@ -59,14 +60,16 @@
- tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
- tdir_sun4=sparc-sun-sunos4
- ;;
--sparc64-*-linux-gnu*) targ_emul=elf64_sparc
-+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
-+ targ_emul=elf64_sparc
- targ_extra_emuls="elf32_sparc sparclinux sun4"
- targ_extra_libpath=elf32_sparc
- tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
- tdir_sparclinux=${tdir_elf32_sparc}aout
- tdir_sun4=sparc-sun-sunos4
- ;;
--sparc*-*-linux-gnu*) targ_emul=elf32_sparc
-+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
-+ targ_emul=elf32_sparc
- targ_extra_emuls="sparclinux elf64_sparc sun4"
- targ_extra_libpath=elf64_sparc
- tdir_sparclinux=${targ_alias}aout
-@@ -124,7 +127,7 @@
- m68*-ericsson-ose) targ_emul=sun3 ;;
- m68*-apple-aux*) targ_emul=m68kaux ;;
- *-tandem-none) targ_emul=st2000 ;;
--i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
- i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
- i[3-7]86-*-vsta) targ_emul=vsta ;;
- i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
-@@ -148,14 +151,16 @@
- tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
- ;;
- i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
--i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
-+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
-+ targ_emul=elf_i386
- targ_extra_emuls=i386linux
- if test x${want64} = xtrue; then
- targ_extra_emuls="$targ_extra_emuls elf_x86_64"
- fi
- tdir_i386linux=${targ_alias}aout
- ;;
--x86_64-*-linux-gnu*) targ_emul=elf_x86_64
-+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
-+ targ_emul=elf_x86_64
- targ_extra_emuls="elf_i386 i386linux"
- targ_extra_libpath=elf_i386
- tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
-@@ -250,10 +255,13 @@
- arm9e-*-elf) targ_emul=armelf ;;
- arm-*-oabi) targ_emul=armelf_oabi ;;
- arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
-+arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
- arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-conix*) targ_emul=armelf ;;
--thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
-+ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- strongarm-*-coff) targ_emul=armcoff ;;
- strongarm-*-elf) targ_emul=armelf ;;
- strongarm-*-kaos*) targ_emul=armelf ;;
-@@ -354,7 +362,8 @@
- targ_extra_emuls=m68kelf
- tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
- ;;
--m68k-*-linux-gnu*) targ_emul=m68kelf
-+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
-+ targ_emul=m68kelf
- targ_extra_emuls=m68klinux
- tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
- ;;
-@@ -370,9 +379,9 @@
- m68*-*-psos*) targ_emul=m68kpsos ;;
- m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
- m68*-*-rtems*) targ_emul=m68kelf ;;
--hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
-+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
- hppa*64*-*) targ_emul=elf64hppa ;;
--hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
-+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
- hppa*-*-*elf*) targ_emul=hppaelf ;;
- hppa*-*-lites*) targ_emul=hppaelf ;;
- hppa*-*-netbsd*) targ_emul=hppanbsd ;;
-@@ -416,16 +425,20 @@
- mips*-*-rtems*) targ_emul=elf32ebmip ;;
- mips*el-*-vxworks*) targ_emul=elf32elmip ;;
- mips*-*-vxworks*) targ_emul=elf32ebmip ;;
--mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
-+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) \
-+ targ_emul=elf32ltsmipn32
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
- ;;
--mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
-+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) \
-+ targ_emul=elf32btsmipn32
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
- ;;
--mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
-+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) \
-+ targ_emul=elf32ltsmip
- targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
- ;;
--mips*-*-linux-gnu*) targ_emul=elf32btsmip
-+mips*-*-linux-gnu* | mips*-*-linux-uclibc*) \
-+ targ_emul=elf32btsmip
- targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
- ;;
- mips*-*-lnews*) targ_emul=mipslnews ;;
-@@ -447,6 +460,10 @@
- alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
- tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
- ;;
-+alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
-+ # The following needs to be checked...
-+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-+ ;;
- alpha*-*-osf*) targ_emul=alpha ;;
- alpha*-*-gnu*) targ_emul=elf64alpha ;;
- alpha*-*-netware*) targ_emul=alpha ;;
-diff -urN binutils-2.14.90.0.6/libtool.m4 binutils-2.14.90.0.6-uClibc/libtool.m4
---- binutils-2.14.90.0.6/libtool.m4 2003-05-05 16:46:46.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/libtool.m4 2004-01-06 20:30:39.000000000 -0600
-@@ -645,6 +645,11 @@
- lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
- ;;
-
-+linux-uclibc*)
-+ lt_cv_deplibs_check_method=pass_all
-+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+ ;;
-+
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN binutils-2.14.90.0.6/ltconfig binutils-2.14.90.0.6-uClibc/ltconfig
---- binutils-2.14.90.0.6/ltconfig 2003-07-23 10:08:08.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/ltconfig 2004-01-06 21:05:11.000000000 -0600
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-
-@@ -1259,6 +1260,24 @@
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-+linux-uclibc*)
-+ version_type=linux
-+ need_lib_prefix=no
-+ need_version=no
-+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+ soname_spec='${libname}${release}.so$major'
-+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+ shlibpath_var=LD_LIBRARY_PATH
-+ shlibpath_overrides_runpath=no
-+ # This implies no fast_install, which is unacceptable.
-+ # Some rework will be needed to allow for fast_install
-+ # before this can be enabled.
-+ # Note: copied from linux-gnu, and may not be appropriate.
-+ hardcode_into_libs=yes
-+ # Assume using the uClibc dynamic linker.
-+ dynamic_linker="uClibc ld.so"
-+ ;;
-+
- netbsd*)
- need_lib_prefix=no
- need_version=no
+++ /dev/null
-Get around an odd build failure.
-diff -urN binutils-2.14.90.0.6/configure binutils-2.14.90.0.6-uClibc/configure
---- binutils-2.14.90.0.6/configure 2003-08-21 10:29:32.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/configure 2004-01-07 05:43:40.000000000 -0600
-@@ -906,6 +906,11 @@
- fi
-
-
-+case "$target" in
-+ *-*-*-uclibc*)
-+ build_modules=
-+ ;;
-+esac
- ################################################################################
-
- srcname="gnu development package"
-diff -urN binutils-2.14.90.0.6/configure.in binutils-2.14.90.0.6-uClibc/configure.in
---- binutils-2.14.90.0.6/configure.in 2003-08-21 10:29:30.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/configure.in 2004-01-07 05:44:02.000000000 -0600
-@@ -178,6 +178,11 @@
- fi
-
-
-+case "$target" in
-+ *-*-*-uclibc*)
-+ build_modules=
-+ ;;
-+esac
- ################################################################################
-
- srcname="gnu development package"
+++ /dev/null
-diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.am binutils-2.14.90.0.6.new/bfd/doc/Makefile.am
---- binutils-2.14.90.0.6/bfd/doc/Makefile.am 2003-07-23 10:08:09.000000000 -0500
-+++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.am 2004-03-01 16:05:16.000000000 -0600
-@@ -55,10 +55,10 @@
- MKDOC = chew$(EXEEXT_FOR_BUILD)
-
- $(MKDOC): chew.o
-- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
-+ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
-
- chew.o: chew.c
-- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
-+ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
-
- protos: libbfd.h libcoff.h bfd.h
-
-diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.in binutils-2.14.90.0.6.new/bfd/doc/Makefile.in
---- binutils-2.14.90.0.6/bfd/doc/Makefile.in 2003-07-23 10:08:09.000000000 -0500
-+++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.in 2004-03-01 16:05:03.000000000 -0600
-@@ -469,10 +469,10 @@
-
-
- $(MKDOC): chew.o
-- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
-+ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
-
- chew.o: chew.c
-- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
-+ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
-
- protos: libbfd.h libcoff.h bfd.h
-
--- /dev/null
+--- binutils-2.11.90.0.19.orig/ld/Makefile.am
++++ binutils-2.11.90.0.19/ld/Makefile.am
+@@ -19,7 +19,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+--- binutils-2.11.90.0.19.orig/ld/Makefile.in
++++ binutils-2.11.90.0.19/ld/Makefile.in
+@@ -123,7 +123,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+diff -urN binutils-2.11.90.0.27/gprof/gprof.texi binutils-2.11.90.0.27.new/gprof/gprof.texi
+--- binutils-2.11.90.0.27/gprof/gprof.texi Tue Jun 19 14:57:58 2001
++++ binutils-2.11.90.0.27.new/gprof/gprof.texi Mon Aug 27 10:27:23 2001
+@@ -137,6 +137,10 @@
+ If more than one profile file is specified, the @code{gprof}
+ output shows the sum of the profile information in the given profile files.
+
++If you use gcc 2.95.x or 3.0 to compile your binaries, you may need
++to add the @samp{-fprofile-arcs} to the compile command line in order
++for the call graphs to be properly stored in gmon.out.
++
+ @code{Gprof} calculates the amount of time spent in each routine.
+ Next, these times are propagated along the edges of the call graph.
+ Cycles are discovered, and calls into a cycle are made to share the time
+@@ -266,6 +270,11 @@
+ to do the linking, simply specify @samp{-pg} in addition to your usual
+ options. The same option, @samp{-pg}, alters either compilation or linking
+ to do what is necessary for profiling. Here are examples:
++
++If you use gcc 2.95.x or 3.0.x, you may need to add the
++@samp{-fprofile-arcs} option to the compile line along with @samp{-pg}
++in order to allow the call-graphs to be properly included in the gmon.out
++file.
+
+ @example
+ cc -g -c myprog.c utils.c -pg
+diff -urN binutils-2.11.92.0.5/bfd/opncls.c binutils-2.11.92.0.5.new/bfd/opncls.c
+--- binutils-2.11.92.0.5/bfd/opncls.c Mon Oct 1 18:25:21 2001
++++ binutils-2.11.92.0.5.new/bfd/opncls.c Sat Oct 13 11:26:59 2001
+@@ -127,6 +127,13 @@
+ {
+ bfd *nbfd;
+ const bfd_target *target_vec;
++ struct stat s;
++
++ if (stat (filename, &s) == 0)
++ if (S_ISDIR(s.st_mode)) {
++ bfd_set_error (bfd_error_file_not_recognized);
++ return NULL;
++ }
+
+ nbfd = _bfd_new_bfd ();
+ if (nbfd == NULL)
+diff -urN binutils-2.11.92.0.12.3/opcodes/i386-dis.c binutils-2.11.92.0.12.3.new/opcodes/i386-dis.c
+--- binutils-2.11.92.0.12.3/opcodes/i386-dis.c Fri Nov 16 17:05:55 2001
++++ binutils-2.11.92.0.12.3.new/opcodes/i386-dis.c Mon Dec 31 15:55:04 2001
+@@ -1830,7 +1830,7 @@
+ * The function returns the length of this instruction in bytes.
+ */
+
+-static char intel_syntax;
++static signed char intel_syntax;
+ static char open_char;
+ static char close_char;
+ static char separator_char;
+diff -urN binutils-2.12.90.0.12/ld/emultempl/elf32.em binutils-2.12.90.0.12.new/ld/emultempl/elf32.em
+--- binutils-2.12.90.0.12/ld/emultempl/elf32.em Wed Jun 19 00:41:59 2002
++++ binutils-2.12.90.0.12.new/ld/emultempl/elf32.em Wed Jun 26 10:00:26 2002
+@@ -672,6 +672,8 @@
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
++ if ((lib_path) && (strlen (lib_path) == 0))
++ lib_path = NULL;
+ if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
+ force))
+ break;
+@@ -867,6 +869,8 @@
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (strlen (rpath) == 0))
++ rpath = NULL;
+ if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
+ (output_bfd, command_line.soname, rpath,
+ command_line.filter_shlib,
+diff -urN binutils-2.13.90.0.18/gprof/gprof.texi binutils-2.13.90.0.18.new/gprof/gprof.texi
+--- binutils-2.13.90.0.18/gprof/gprof.texi 2003-02-02 18:29:09.000000000 -0500
++++ binutils-2.13.90.0.18.new/gprof/gprof.texi 2003-02-02 18:28:37.000000000 -0500
+@@ -185,7 +185,7 @@
+ @c man end
+
+ @c man begin SEEALSO
+-monitor(3), profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
++profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
+
+ ``An Execution Profiler for Modular Programs'',
+ by S. Graham, P. Kessler, M. McKusick;
+diff -urN binutils-2.13.90.0.10/opcodes/alpha-opc.c binutils-2.13.90.0.10.new/opcodes/alpha-opc.c
+--- binutils-2.13.90.0.10/opcodes/alpha-opc.c 2002-03-07 14:52:40.000000000 -0500
++++ binutils-2.13.90.0.10.new/opcodes/alpha-opc.c 2002-10-12 20:16:08.000000000 -0400
+@@ -1101,7 +1101,8 @@
+ { "wmb", MFC(0x18,0x4400), BASE, ARG_NONE },
+ { "fetch", MFC(0x18,0x8000), BASE, { ZA, PRB } },
+ { "fetch_m", MFC(0x18,0xA000), BASE, { ZA, PRB } },
+- { "rpcc", MFC(0x18,0xC000), BASE, { RA } },
++ { "rpcc", MFC(0x18,0xC000), BASE, { RA, ZB } },
++ { "rpcc", MFC(0x18,0xC000), BASE, { RA, RB } }, /* ev6 una */
+ { "rc", MFC(0x18,0xE000), BASE, { RA } },
+ { "ecb", MFC(0x18,0xE800), BASE, { ZA, PRB } }, /* ev56 una */
+ { "rs", MFC(0x18,0xF000), BASE, { RA } },
+--- binutils-2.13.90.0.18/bfd/elf64-alpha.c 2003-01-21 19:21:32.000000000 +0100
++++ binutils-2.13.90.0.18-modif/bfd/elf64-alpha.c 2003-04-11 01:24:26.000000000 +0200
+@@ -4184,9 +4184,12 @@
+
+ loc = srel->contents;
+ loc += srel->reloc_count++ * sizeof (Elf64_External_Rela);
+- bfd_elf64_swap_reloca_out (abfd, &outrel, loc);
+- BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
+- <= srel->_cooked_size);
++ if (loc)
++ {
++ bfd_elf64_swap_reloca_out (abfd, &outrel, loc);
++ BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
++ <= srel->_cooked_size);
++ }
+ }
+
+ /* Relocate an Alpha ELF section for a relocatable link.
+2003-05-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ltmain.sh: Make symlink for shared library if needed.
+
+opcodes/
+
+2003-07-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Makefile.in: Regenerated.
+
+2003-06-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Makefile.in: Regenerated.
+
+2003-05-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Makefile.am (libopcodes_la_LIBADD): Use "-L../bfd -lbfd"
+ instead of "../bfd/libbfd.la".
+ * Makefile.in: Regenerated.
+
+--- binutils/ltmain.sh.dso 2002-03-22 00:16:20.000000000 -0800
++++ binutils/ltmain.sh 2003-07-14 12:50:17.000000000 -0700
+@@ -4413,6 +4413,10 @@ relink_command=\"$relink_command\""
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
++ if test -n "$linkname"; then
++ $show "(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)"
++ $run eval '(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)' || exit $?
++ fi
+ ;;
+ esac
+ exit 0
+--- binutils/opcodes/Makefile.am.dso 2003-06-11 07:18:04.000000000 -0700
++++ binutils/opcodes/Makefile.am 2003-07-14 12:50:18.000000000 -0700
+@@ -283,7 +283,7 @@ disassemble.lo: disassemble.c $(INCDIR)/
+
+ libopcodes_la_SOURCES = dis-buf.c disassemble.c
+ libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
+-libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
++libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ -L../bfd -lbfd
+ libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
+
+ # libtool will build .libs/libopcodes.a. We create libopcodes.a in
--- /dev/null
+diff -urN binutils-2.14.90.0.6/bfd/config.bfd binutils-2.14.90.0.6-uClibc/bfd/config.bfd
+--- binutils-2.14.90.0.6/bfd/config.bfd 2003-08-21 10:28:47.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/bfd/config.bfd 2004-01-06 23:20:32.000000000 -0600
+@@ -121,7 +121,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -131,7 +131,8 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | \
++ ia64*-*-linux-uclibc* | ia64*-*-elf*)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -214,7 +215,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -222,7 +223,8 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*)
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \
++ arm*-*-conix* | arm*-*-uclinux*)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+@@ -355,7 +357,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -366,7 +368,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu*)
++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -488,7 +490,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -502,7 +504,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -662,7 +664,7 @@
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_m68k_vec
+ targ_selvecs=m68klinux_vec
+ ;;
+@@ -929,7 +931,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -961,8 +964,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1110,7 +1113,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1157,7 +1160,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+diff -urN binutils-2.14.90.0.6/bfd/configure binutils-2.14.90.0.6-uClibc/bfd/configure
+--- binutils-2.14.90.0.6/bfd/configure 2003-08-21 10:28:47.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/bfd/configure 2004-01-06 20:26:51.000000000 -0600
+@@ -1698,6 +1698,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5102,7 +5107,7 @@
+ alpha*-*-freebsd*)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5161,7 +5166,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5211,7 +5216,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+diff -urN binutils-2.14.90.0.6/bfd/configure.in binutils-2.14.90.0.6-uClibc/bfd/configure.in
+--- binutils-2.14.90.0.6/bfd/configure.in 2003-08-21 10:28:47.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/bfd/configure.in 2004-01-06 20:33:02.000000000 -0600
+@@ -153,7 +153,7 @@
+ alpha*-*-freebsd*)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -233,7 +233,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -286,7 +286,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+diff -urN binutils-2.14.90.0.6/config.sub binutils-2.14.90.0.6-uClibc/config.sub
+--- binutils-2.14.90.0.6/config.sub 2003-08-21 10:28:47.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/config.sub 2004-01-06 22:56:56.000000000 -0600
+@@ -118,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
++ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -1131,7 +1131,8 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+diff -urN binutils-2.14.90.0.6/configure binutils-2.14.90.0.6-uClibc/configure
+--- binutils-2.14.90.0.6/configure 2003-08-21 10:29:32.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/configure 2004-01-07 05:43:40.000000000 -0600
+@@ -1257,6 +1262,18 @@
+ i[3456789]86-*-freebsd*)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[3456789]86-*-linux-uclibc)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[3456789]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.14.90.0.6/configure.in binutils-2.14.90.0.6-uClibc/configure.in
+--- binutils-2.14.90.0.6/configure.in 2003-08-21 10:29:30.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/configure.in 2004-01-07 05:44:02.000000000 -0600
+@@ -508,6 +513,19 @@
+ i[[3456789]]86-*-freebsd*)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[3456789]86-*-linux-uclibc)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ build_modules=
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[[3456789]]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.14.90.0.6/demangler/configure binutils-2.14.90.0.6-uClibc/demangler/configure
+--- binutils-2.14.90.0.6/demangler/configure 2003-08-21 10:29:31.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/demangler/configure 2004-01-06 21:45:51.000000000 -0600
+@@ -1363,6 +1363,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.14.90.0.6/gas/configure binutils-2.14.90.0.6-uClibc/gas/configure
+--- binutils-2.14.90.0.6/gas/configure 2003-07-23 10:08:10.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/gas/configure 2004-01-06 21:57:25.000000000 -0600
+@@ -1576,6 +1576,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -2370,6 +2375,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -2386,6 +2392,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -2400,6 +2407,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -2455,7 +2463,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ i386-*-sysv[45]*) fmt=elf ;;
+ i386-*-solaris*) fmt=elf ;;
+@@ -2512,6 +2522,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -2538,6 +2549,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+ m68k-*-netbsdelf*) fmt=elf em=nbsd ;;
+@@ -2592,6 +2604,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf
+ case "$endian" in
+ big) ;;
+@@ -2616,7 +2629,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -2649,6 +2664,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.14.90.0.6/gas/configure.in binutils-2.14.90.0.6-uClibc/gas/configure.in
+--- binutils-2.14.90.0.6/gas/configure.in 2003-07-23 10:08:10.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/gas/configure.in 2004-01-06 21:57:26.000000000 -0600
+@@ -184,6 +184,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -200,6 +201,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -214,6 +216,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -269,7 +272,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ changequote(,)dnl
+ i386-*-sysv[45]*) fmt=elf ;;
+@@ -322,6 +327,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -348,6 +354,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+ m68k-*-netbsdelf*) fmt=elf em=nbsd ;;
+@@ -402,6 +409,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf
+ case "$endian" in
+ big) ;;
+@@ -424,7 +432,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -457,6 +467,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.14.90.0.6/ld/configure binutils-2.14.90.0.6-uClibc/ld/configure
+--- binutils-2.14.90.0.6/ld/configure 2003-05-05 16:46:49.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/ld/configure 2004-01-06 21:59:31.000000000 -0600
+@@ -1578,6 +1578,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.14.90.0.6/ld/configure.tgt binutils-2.14.90.0.6-uClibc/ld/configure.tgt
+--- binutils-2.14.90.0.6/ld/configure.tgt 2003-08-21 10:28:48.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/ld/configure.tgt 2004-01-06 22:09:40.000000000 -0600
+@@ -30,6 +30,7 @@
+ targ_extra_emuls="criself crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ cris-*-linux-gnu*) targ_emul=crislinux ;;
++cris-*-linux-uclibc*) targ_emul=crislinux ;;
+ cris-*-*) targ_emul=criself
+ targ_extra_emuls="crisaout crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+@@ -59,14 +60,16 @@
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
++ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
++ targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+@@ -124,7 +127,7 @@
+ m68*-ericsson-ose) targ_emul=sun3 ;;
+ m68*-apple-aux*) targ_emul=m68kaux ;;
+ *-tandem-none) targ_emul=st2000 ;;
+-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
+ i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+ i[3-7]86-*-vsta) targ_emul=vsta ;;
+ i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+@@ -148,14 +151,16 @@
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+ i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
++ targ_emul=elf_i386
+ targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+ tdir_i386linux=${targ_alias}aout
+ ;;
+-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
++ targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386linux"
+ targ_extra_libpath=elf_i386
+ tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
+@@ -250,10 +255,13 @@
+ arm9e-*-elf) targ_emul=armelf ;;
+ arm-*-oabi) targ_emul=armelf_oabi ;;
+ arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+ arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-conix*) targ_emul=armelf ;;
+-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ strongarm-*-coff) targ_emul=armcoff ;;
+ strongarm-*-elf) targ_emul=armelf ;;
+ strongarm-*-kaos*) targ_emul=armelf ;;
+@@ -354,7 +362,8 @@
+ targ_extra_emuls=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+-m68k-*-linux-gnu*) targ_emul=m68kelf
++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
++ targ_emul=m68kelf
+ targ_extra_emuls=m68klinux
+ tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
+ ;;
+@@ -370,9 +379,9 @@
+ m68*-*-psos*) targ_emul=m68kpsos ;;
+ m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
+ m68*-*-rtems*) targ_emul=m68kelf ;;
+-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
+ hppa*64*-*) targ_emul=elf64hppa ;;
+-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
+ hppa*-*-*elf*) targ_emul=hppaelf ;;
+ hppa*-*-lites*) targ_emul=hppaelf ;;
+ hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+@@ -416,16 +425,20 @@
+ mips*-*-rtems*) targ_emul=elf32ebmip ;;
+ mips*el-*-vxworks*) targ_emul=elf32elmip ;;
+ mips*-*-vxworks*) targ_emul=elf32ebmip ;;
+-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) \
++ targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) \
++ targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
+-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) \
++ targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
+-mips*-*-linux-gnu*) targ_emul=elf32btsmip
++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) \
++ targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
+ ;;
+ mips*-*-lnews*) targ_emul=mipslnews ;;
+@@ -447,6 +460,10 @@
+ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+ ;;
++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
++ # The following needs to be checked...
++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
++ ;;
+ alpha*-*-osf*) targ_emul=alpha ;;
+ alpha*-*-gnu*) targ_emul=elf64alpha ;;
+ alpha*-*-netware*) targ_emul=alpha ;;
+diff -urN binutils-2.14.90.0.6/libtool.m4 binutils-2.14.90.0.6-uClibc/libtool.m4
+--- binutils-2.14.90.0.6/libtool.m4 2003-05-05 16:46:46.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/libtool.m4 2004-01-06 20:30:39.000000000 -0600
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN binutils-2.14.90.0.6/ltconfig binutils-2.14.90.0.6-uClibc/ltconfig
+--- binutils-2.14.90.0.6/ltconfig 2003-07-23 10:08:08.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/ltconfig 2004-01-06 21:05:11.000000000 -0600
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1260,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
--- /dev/null
+Get around an odd build failure.
+diff -urN binutils-2.14.90.0.6/configure binutils-2.14.90.0.6-uClibc/configure
+--- binutils-2.14.90.0.6/configure 2003-08-21 10:29:32.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/configure 2004-01-07 05:43:40.000000000 -0600
+@@ -906,6 +906,11 @@
+ fi
+
+
++case "$target" in
++ *-*-*-uclibc*)
++ build_modules=
++ ;;
++esac
+ ################################################################################
+
+ srcname="gnu development package"
+diff -urN binutils-2.14.90.0.6/configure.in binutils-2.14.90.0.6-uClibc/configure.in
+--- binutils-2.14.90.0.6/configure.in 2003-08-21 10:29:30.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/configure.in 2004-01-07 05:44:02.000000000 -0600
+@@ -178,6 +178,11 @@
+ fi
+
+
++case "$target" in
++ *-*-*-uclibc*)
++ build_modules=
++ ;;
++esac
+ ################################################################################
+
+ srcname="gnu development package"
--- /dev/null
+diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.am binutils-2.14.90.0.6.new/bfd/doc/Makefile.am
+--- binutils-2.14.90.0.6/bfd/doc/Makefile.am 2003-07-23 10:08:09.000000000 -0500
++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.am 2004-03-01 16:05:16.000000000 -0600
+@@ -55,10 +55,10 @@
+ MKDOC = chew$(EXEEXT_FOR_BUILD)
+
+ $(MKDOC): chew.o
+- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
+
+ chew.o: chew.c
+- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
+
+ protos: libbfd.h libcoff.h bfd.h
+
+diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.in binutils-2.14.90.0.6.new/bfd/doc/Makefile.in
+--- binutils-2.14.90.0.6/bfd/doc/Makefile.in 2003-07-23 10:08:09.000000000 -0500
++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.in 2004-03-01 16:05:03.000000000 -0600
+@@ -469,10 +469,10 @@
+
+
+ $(MKDOC): chew.o
+- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
+
+ chew.o: chew.c
+- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
+
+ protos: libbfd.h libcoff.h bfd.h
+
--- /dev/null
+diff -urN binutils-2.14.90.0.7.orig/bfd/ChangeLog binutils-2.14.90.0.7/bfd/ChangeLog
+--- binutils-2.14.90.0.7.orig/bfd/ChangeLog 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/ChangeLog 2004-04-20 01:26:12.000000000 -0600
+@@ -1,3 +1,34 @@
++2003-10-29 Daniel Jacobowitz <drow@mvista.com>
++
++ * elf32-arm.h (elf32_arm_final_link_relocate): Move check for
++ SEC_ALLOC.
++
++2003-10-29 Philip Blundell <philb@gnu.org>
++
++ * elf32-arm.h (elf32_arm_plt0_entry, elf32_arm_plt_entry): New
++ code sequence.
++ (PLT_HEADER_SIZE): New.
++ (struct elf32_arm_pcrel_relocs_copied): Rename to ...
++ (struct elf32_arm_relocs_copied): ... this. Count both
++ pcrel and non-pcrel relocs. All uses updated.
++ (struct elf32_arm_link_hash_table): Add pointers to dynamic linker
++ sections and symbol/section mapping cache.
++ (create_got_section): New.
++ (elf32_arm_create_dynamic_sections): New.
++ (elf_backend_create_dynamic_sections): Use it.
++ (elf32_arm_final_link_relocate): Support garbage collection of relocs.
++ (elf32_arm_check_relocs): Likewise.
++ (elf32_arm_adjust_dynamic_symbol): Likewise.
++ (elf32_arm_copy_indirect_symbol): New.
++ (elf32_arm_link_hash_table_create): Initialise new fields.
++ (elf32_arm_gc_sweep_hook): Implement.
++ (elf32_arm_discard_copies): Delete.
++ (elf32_arm_finish_dynamic_symbol): Use new PLT code.
++ (elf32_arm_finish_dynamic_sections): Likewise.
++ (elf_backend_can_refcount): Define.
++ (elf_backend_copy_indirect_symbol): Likewise.
++ (elf_backend_plt_header_size): Set to PLT_HEADER_SIZE.
++
+ 2003-10-29 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (elf_backend_grok_prstatus): Define.
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf-bfd.h binutils-2.14.90.0.7/bfd/elf-bfd.h
+--- binutils-2.14.90.0.7.orig/bfd/elf-bfd.h 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf-bfd.h 2004-04-20 01:26:12.000000000 -0600
+@@ -1303,7 +1303,7 @@
+ extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
+ (const Elf_Internal_Rela *);
+ extern bfd_vma _bfd_elf_rela_local_sym
+- (bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *);
++ (bfd *, Elf_Internal_Sym *, asection **, Elf_Internal_Rela *);
+ extern bfd_vma _bfd_elf_rel_local_sym
+ (bfd *, Elf_Internal_Sym *, asection **, bfd_vma);
+ extern bfd_vma _bfd_elf_section_offset
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf-hppa.h binutils-2.14.90.0.7/bfd/elf-hppa.h
+--- binutils-2.14.90.0.7.orig/bfd/elf-hppa.h 2003-08-21 09:28:47.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf-hppa.h 2004-04-20 01:26:12.000000000 -0600
+@@ -1346,11 +1346,11 @@
+ /* This is a local symbol. */
+ sym = local_syms + r_symndx;
+ sym_sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel);
+
+ /* If this symbol has an entry in the PA64 dynamic hash
+ table, then get it. */
+- dyn_name = get_dyn_name (input_section, h, rel,
++ dyn_name = get_dyn_name (input_bfd, h, rel,
+ &dynh_buf, &dynh_buflen);
+ dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
+ dyn_name, FALSE, FALSE);
+@@ -1373,7 +1373,7 @@
+
+ /* If this symbol has an entry in the PA64 dynamic hash
+ table, then get it. */
+- dyn_name = get_dyn_name (input_section, h, rel,
++ dyn_name = get_dyn_name (input_bfd, h, rel,
+ &dynh_buf, &dynh_buflen);
+ dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
+ dyn_name, FALSE, FALSE);
+@@ -1410,7 +1410,7 @@
+
+ /* If this symbol has an entry in the PA64 dynamic hash
+ table, then get it. */
+- dyn_name = get_dyn_name (input_section, h, rel,
++ dyn_name = get_dyn_name (input_bfd, h, rel,
+ &dynh_buf, &dynh_buflen);
+ dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
+ dyn_name, FALSE, FALSE);
+@@ -1426,7 +1426,7 @@
+ }
+ else if (h->root.type == bfd_link_hash_undefweak)
+ {
+- dyn_name = get_dyn_name (input_section, h, rel,
++ dyn_name = get_dyn_name (input_bfd, h, rel,
+ &dynh_buf, &dynh_buflen);
+ dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
+ dyn_name, FALSE, FALSE);
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf-m10200.c binutils-2.14.90.0.7/bfd/elf-m10200.c
+--- binutils-2.14.90.0.7.orig/bfd/elf-m10200.c 2003-07-23 09:08:08.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf-m10200.c 2004-04-20 01:26:12.000000000 -0600
+@@ -373,7 +373,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf-m10300.c binutils-2.14.90.0.7/bfd/elf-m10300.c
+--- binutils-2.14.90.0.7.orig/bfd/elf-m10300.c 2003-08-21 09:28:47.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf-m10300.c 2004-04-20 01:26:12.000000000 -0600
+@@ -1574,7 +1574,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf.c binutils-2.14.90.0.7/bfd/elf.c
+--- binutils-2.14.90.0.7.orig/bfd/elf.c 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf.c 2004-04-20 01:26:12.000000000 -0600
+@@ -7367,9 +7367,10 @@
+ bfd_vma
+ _bfd_elf_rela_local_sym (bfd *abfd,
+ Elf_Internal_Sym *sym,
+- asection *sec,
++ asection **psec,
+ Elf_Internal_Rela *rel)
+ {
++ asection *sec = *psec;
+ bfd_vma relocation;
+
+ relocation = (sec->output_section->vma
+@@ -7379,16 +7380,14 @@
+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION
+ && sec->sec_info_type == ELF_INFO_TYPE_MERGE)
+ {
+- asection *msec;
+-
+- msec = sec;
+ rel->r_addend =
+- _bfd_merged_section_offset (abfd, &msec,
++ _bfd_merged_section_offset (abfd, psec,
+ elf_section_data (sec)->sec_info,
+ sym->st_value + rel->r_addend,
+- 0)
+- - relocation;
+- rel->r_addend += msec->output_section->vma + msec->output_offset;
++ 0);
++ sec = *psec;
++ rel->r_addend -= relocation;
++ rel->r_addend += sec->output_section->vma + sec->output_offset;
+ }
+ return relocation;
+ }
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-arm.h binutils-2.14.90.0.7/bfd/elf32-arm.h
+--- binutils-2.14.90.0.7.orig/bfd/elf32-arm.h 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf32-arm.h 2004-04-20 01:26:12.000000000 -0600
+@@ -84,6 +84,12 @@
+ static void arm_add_to_rel
+ PARAMS ((bfd *, bfd_byte *, reloc_howto_type *, bfd_signed_vma));
+ #endif
++static bfd_boolean allocate_dynrelocs
++ PARAMS ((struct elf_link_hash_entry *h, PTR inf));
++static bfd_boolean create_got_section
++ PARAMS ((bfd * dynobj, struct bfd_link_info * info));
++static bfd_boolean elf32_arm_create_dynamic_sections
++ PARAMS ((bfd * dynobj, struct bfd_link_info * info));
+ static enum elf_reloc_type_class elf32_arm_reloc_type_class
+ PARAMS ((const Elf_Internal_Rela *));
+ static bfd_boolean elf32_arm_object_p
+@@ -119,6 +125,12 @@
+ section. */
+ #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
+
++#ifdef FOUR_WORD_PLT
++
++/* The size in bytes of the special first entry in the procedure
++ linkage table. */
++#define PLT_HEADER_SIZE 16
++
+ /* The size in bytes of an entry in the procedure linkage table. */
+ #define PLT_ENTRY_SIZE 16
+
+@@ -126,23 +138,56 @@
+ this. It is set up so that any shared library function that is
+ called before the relocation has been set up calls the dynamic
+ linker first. */
+-static const bfd_vma elf32_arm_plt0_entry [PLT_ENTRY_SIZE / 4] =
++static const bfd_vma elf32_arm_plt0_entry [PLT_HEADER_SIZE / 4] =
+ {
+- 0xe52de004, /* str lr, [sp, #-4]! */
+- 0xe59fe010, /* ldr lr, [pc, #16] */
+- 0xe08fe00e, /* add lr, pc, lr */
+- 0xe5bef008 /* ldr pc, [lr, #8]! */
++ 0xe52de004, /* str lr, [sp, #-4]! */
++ 0xe59fe010, /* ldr lr, [pc, #16] */
++ 0xe08fe00e, /* add lr, pc, lr */
++ 0xe5bef008, /* ldr pc, [lr, #8]! */
+ };
+
+ /* Subsequent entries in a procedure linkage table look like
+ this. */
+ static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] =
+- {
+- 0xe59fc004, /* ldr ip, [pc, #4] */
+- 0xe08fc00c, /* add ip, pc, ip */
+- 0xe59cf000, /* ldr pc, [ip] */
+- 0x00000000 /* offset to symbol in got */
+- };
++ {
++ 0xe28fc600, /* add ip, pc, #NN */
++ 0xe28cca00, /* add ip, ip, #NN */
++ 0xe5bcf000, /* ldr pc, [ip, #NN]! */
++ 0x00000000, /* unused */
++ };
++
++#else
++
++/* The size in bytes of the special first entry in the procedure
++ linkage table. */
++#define PLT_HEADER_SIZE 20
++
++/* The size in bytes of an entry in the procedure linkage table. */
++#define PLT_ENTRY_SIZE 12
++
++/* The first entry in a procedure linkage table looks like
++ this. It is set up so that any shared library function that is
++ called before the relocation has been set up calls the dynamic
++ linker first. */
++static const bfd_vma elf32_arm_plt0_entry [PLT_HEADER_SIZE / 4] =
++ {
++ 0xe52de004, /* str lr, [sp, #-4]! */
++ 0xe59fe004, /* ldr lr, [pc, #4] */
++ 0xe08fe00e, /* add lr, pc, lr */
++ 0xe5bef008, /* ldr pc, [lr, #8]! */
++ 0x00000000, /* &GOT[0] - . */
++ };
++
++/* Subsequent entries in a procedure linkage table look like
++ this. */
++static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] =
++ {
++ 0xe28fc600, /* add ip, pc, #0xNN00000 */
++ 0xe28cca00, /* add ip, ip, #0xNN000 */
++ 0xe5bcf000, /* ldr pc, [ip, #0xNNN]! */
++ };
++
++#endif
+
+ /* The ARM linker needs to keep track of the number of relocs that it
+ decides to copy in check_relocs for each symbol. This is so that
+@@ -152,14 +197,16 @@
+
+ /* This structure keeps track of the number of PC relative relocs we
+ have copied for a given symbol. */
+-struct elf32_arm_pcrel_relocs_copied
++struct elf32_arm_relocs_copied
+ {
+ /* Next section. */
+- struct elf32_arm_pcrel_relocs_copied * next;
++ struct elf32_arm_relocs_copied * next;
+ /* A section in dynobj. */
+ asection * section;
+ /* Number of relocs copied in this section. */
+ bfd_size_type count;
++ /* Number of relocs copied in this section. */
++ bfd_size_type pc_count;
+ };
+
+ /* Arm ELF linker hash entry. */
+@@ -168,13 +215,9 @@
+ struct elf_link_hash_entry root;
+
+ /* Number of PC relative relocs copied for this symbol. */
+- struct elf32_arm_pcrel_relocs_copied * pcrel_relocs_copied;
++ struct elf32_arm_relocs_copied * relocs_copied;
+ };
+
+-/* Declare this now that the above structures are defined. */
+-static bfd_boolean elf32_arm_discard_copies
+- PARAMS ((struct elf32_arm_link_hash_entry *, PTR));
+-
+ /* Traverse an arm ELF linker hash table. */
+ #define elf32_arm_link_hash_traverse(table, func, info) \
+ (elf_link_hash_traverse \
+@@ -204,6 +247,18 @@
+ /* A boolean indicating whether knowledge of the ARM's pipeline
+ length should be applied by the linker. */
+ int no_pipeline_knowledge;
++
++ /* Short-cuts to get to dynamic linker sections. */
++ asection *sgot;
++ asection *sgotplt;
++ asection *srelgot;
++ asection *splt;
++ asection *srelplt;
++ asection *sdynbss;
++ asection *srelbss;
++
++ /* Small local sym to section mapping cache. */
++ struct sym_sec_cache sym_sec;
+ };
+
+ /* Create an entry in an ARM ELF linker hash table. */
+@@ -231,11 +286,121 @@
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+ table, string));
+ if (ret != (struct elf32_arm_link_hash_entry *) NULL)
+- ret->pcrel_relocs_copied = NULL;
++ ret->relocs_copied = NULL;
+
+ return (struct bfd_hash_entry *) ret;
+ }
+
++/* Create .got, .gotplt, and .rel.got sections in DYNOBJ, and set up
++ shortcuts to them in our hash table. */
++
++static bfd_boolean
++create_got_section (dynobj, info)
++ bfd *dynobj;
++ struct bfd_link_info *info;
++{
++ struct elf32_arm_link_hash_table *htab;
++
++ if (! _bfd_elf_create_got_section (dynobj, info))
++ return FALSE;
++
++ htab = elf32_arm_hash_table (info);
++ htab->sgot = bfd_get_section_by_name (dynobj, ".got");
++ htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
++ if (!htab->sgot || !htab->sgotplt)
++ abort ();
++
++ htab->srelgot = bfd_make_section (dynobj, ".rel.got");
++ if (htab->srelgot == NULL
++ || ! bfd_set_section_flags (dynobj, htab->srelgot,
++ (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
++ | SEC_IN_MEMORY | SEC_LINKER_CREATED
++ | SEC_READONLY))
++ || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2))
++ return FALSE;
++ return TRUE;
++}
++
++/* Create .plt, .rel.plt, .got, .got.plt, .rel.got, .dynbss, and
++ .rel.bss sections in DYNOBJ, and set up shortcuts to them in our
++ hash table. */
++
++static bfd_boolean
++elf32_arm_create_dynamic_sections (dynobj, info)
++ bfd *dynobj;
++ struct bfd_link_info *info;
++{
++ struct elf32_arm_link_hash_table *htab;
++
++ htab = elf32_arm_hash_table (info);
++ if (!htab->sgot && !create_got_section (dynobj, info))
++ return FALSE;
++
++ if (!_bfd_elf_create_dynamic_sections (dynobj, info))
++ return FALSE;
++
++ htab->splt = bfd_get_section_by_name (dynobj, ".plt");
++ htab->srelplt = bfd_get_section_by_name (dynobj, ".rel.plt");
++ htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss");
++ if (!info->shared)
++ htab->srelbss = bfd_get_section_by_name (dynobj, ".rel.bss");
++
++ if (!htab->splt || !htab->srelplt || !htab->sdynbss
++ || (!info->shared && !htab->srelbss))
++ abort ();
++
++ return TRUE;
++}
++
++/* Copy the extra info we tack onto an elf_link_hash_entry. */
++
++static void
++elf32_arm_copy_indirect_symbol (const struct elf_backend_data *bed,
++ struct elf_link_hash_entry *dir,
++ struct elf_link_hash_entry *ind)
++{
++ struct elf32_arm_link_hash_entry *edir, *eind;
++
++ edir = (struct elf32_arm_link_hash_entry *) dir;
++ eind = (struct elf32_arm_link_hash_entry *) ind;
++
++ if (eind->relocs_copied != NULL)
++ {
++ if (edir->relocs_copied != NULL)
++ {
++ struct elf32_arm_relocs_copied **pp;
++ struct elf32_arm_relocs_copied *p;
++
++ if (ind->root.type == bfd_link_hash_indirect)
++ abort ();
++
++ /* Add reloc counts against the weak sym to the strong sym
++ list. Merge any entries against the same section. */
++ for (pp = &eind->relocs_copied; (p = *pp) != NULL; )
++ {
++ struct elf32_arm_relocs_copied *q;
++
++ for (q = edir->relocs_copied; q != NULL; q = q->next)
++ if (q->section == p->section)
++ {
++ q->pc_count += p->pc_count;
++ q->count += p->count;
++ *pp = p->next;
++ break;
++ }
++ if (q == NULL)
++ pp = &p->next;
++ }
++ *pp = edir->relocs_copied;
++ }
++
++ edir->relocs_copied = eind->relocs_copied;
++ eind->relocs_copied = NULL;
++ }
++
++ _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
++}
++
+ /* Create an ARM elf linker hash table. */
+
+ static struct bfd_link_hash_table *
+@@ -256,10 +421,18 @@
+ return NULL;
+ }
+
++ ret->sgot = NULL;
++ ret->sgotplt = NULL;
++ ret->srelgot = NULL;
++ ret->splt = NULL;
++ ret->srelplt = NULL;
++ ret->sdynbss = NULL;
++ ret->srelbss = NULL;
+ ret->thumb_glue_size = 0;
+ ret->arm_glue_size = 0;
+ ret->bfd_of_glue_owner = NULL;
+ ret->no_pipeline_knowledge = 0;
++ ret->sym_sec.abfd = NULL;
+
+ return &ret->root.root;
+ }
+@@ -1134,16 +1307,21 @@
+ #ifndef OLD_ARM_ABI
+ case R_ARM_XPC25:
+ #endif
++ /* r_symndx will be zero only for relocs against symbols
++ from removed linkonce sections, or sections discarded by
++ a linker script. */
++ if (r_symndx == 0)
++ return bfd_reloc_ok;
++
+ /* When generating a shared object, these relocations are copied
+ into the output file to be resolved at run time. */
+- if (info->shared
+- && r_symndx != 0
+- && (r_type != R_ARM_PC24
+- || (h != NULL
+- && h->dynindx != -1
+- && (! info->symbolic
+- || (h->elf_link_hash_flags
+- & ELF_LINK_HASH_DEF_REGULAR) == 0))))
++ if ((info->shared
++ && (input_section->flags & SEC_ALLOC)
++ && (h == NULL
++ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
++ || h->root.type != bfd_link_hash_undefweak)
++ && (r_type != R_ARM_PC24
++ || !SYMBOL_CALLS_LOCAL (info, h))))
+ {
+ Elf_Internal_Rela outrel;
+ bfd_byte *loc;
+@@ -1184,30 +1362,19 @@
+
+ if (skip)
+ memset (&outrel, 0, sizeof outrel);
+- else if (r_type == R_ARM_PC24)
+- {
+- BFD_ASSERT (h != NULL && h->dynindx != -1);
+- if ((input_section->flags & SEC_ALLOC) == 0)
+- relocate = TRUE;
+- outrel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_PC24);
+- }
++ else if (h != NULL
++ && h->dynindx != -1
++ && (r_type == R_ARM_PC24
++ || !info->shared
++ || !info->symbolic
++ || (h->elf_link_hash_flags
++ & ELF_LINK_HASH_DEF_REGULAR) == 0))
++ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+ else
+ {
+- if (h == NULL
+- || ((info->symbolic || h->dynindx == -1)
+- && (h->elf_link_hash_flags
+- & ELF_LINK_HASH_DEF_REGULAR) != 0))
+- {
+- relocate = TRUE;
+- outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
+- }
+- else
+- {
+- BFD_ASSERT (h->dynindx != -1);
+- if ((input_section->flags & SEC_ALLOC) == 0)
+- relocate = TRUE;
+- outrel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_ABS32);
+- }
++ /* This symbol is local, or marked to become local. */
++ relocate = TRUE;
++ outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
+ }
+
+ loc = sreloc->contents;
+@@ -1617,16 +1784,17 @@
+ if (h != NULL)
+ {
+ bfd_vma off;
+- bfd_boolean dyn = elf_hash_table (info)->dynamic_sections_created;
++ bfd_boolean dyn;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) -1);
++ dyn = globals->root.dynamic_sections_created;
+
+- if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
++ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
+ || (info->shared
+- && (info->symbolic || h->dynindx == -1
+- || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
++ && SYMBOL_REFERENCES_LOCAL (info, h))
++ || (ELF_ST_VISIBILITY (h->other)
++ && h->root.type == bfd_link_hash_undefweak))
+ {
+ /* This is actually a static link, or it is a -Bsymbolic link
+ and the symbol is defined locally. We must initialize this
+@@ -1712,7 +1880,8 @@
+ contents, rel->r_offset, value,
+ (bfd_vma) 0);
+
+- if (h->plt.offset == (bfd_vma) -1)
++ if (h->plt.offset == (bfd_vma) -1
++ || globals->splt == NULL)
+ /* We didn't make a PLT entry for this symbol. This
+ happens when statically linking PIC code, or when
+ using -Bsymbolic. */
+@@ -1958,7 +2127,7 @@
+ bfd_put_32 (input_bfd, value, contents + rel->r_offset);
+ }
+ #else
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ #endif
+ }
+ else
+@@ -1983,9 +2152,10 @@
+ case R_ARM_THM_PC22:
+ if (info->shared
+ && (
+- (!info->symbolic && h->dynindx != -1)
++ (!info->symbolic && h->dynindx != -1)
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ )
++ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ && ((input_section->flags & SEC_ALLOC) != 0
+ /* DWARF will emit R_ARM_ABS32 relocations in its
+ sections against symbols defined externally
+@@ -2603,7 +2773,82 @@
+ asection *sec ATTRIBUTE_UNUSED;
+ const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
+ {
+- /* We don't support garbage collection of GOT and PLT relocs yet. */
++ Elf_Internal_Shdr *symtab_hdr;
++ struct elf_link_hash_entry **sym_hashes;
++ bfd_signed_vma *local_got_refcounts;
++ const Elf_Internal_Rela *rel, *relend;
++ unsigned long r_symndx;
++ struct elf_link_hash_entry *h;
++
++ elf_section_data (sec)->local_dynrel = NULL;
++
++ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
++ sym_hashes = elf_sym_hashes (abfd);
++ local_got_refcounts = elf_local_got_refcounts (abfd);
++
++ relend = relocs + sec->reloc_count;
++ for (rel = relocs; rel < relend; rel++)
++ switch (ELF32_R_TYPE (rel->r_info))
++ {
++ case R_ARM_GOT32:
++ r_symndx = ELF32_R_SYM (rel->r_info);
++ if (r_symndx >= symtab_hdr->sh_info)
++ {
++ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
++ if (h->got.refcount > 0)
++ h->got.refcount -= 1;
++ }
++ else if (local_got_refcounts != NULL)
++ {
++ if (local_got_refcounts[r_symndx] > 0)
++ local_got_refcounts[r_symndx] -= 1;
++ }
++ break;
++
++ case R_ARM_ABS32:
++ case R_ARM_REL32:
++ case R_ARM_PC24:
++ r_symndx = ELF32_R_SYM (rel->r_info);
++ if (r_symndx >= symtab_hdr->sh_info)
++ {
++ struct elf32_arm_link_hash_entry *eh;
++ struct elf32_arm_relocs_copied **pp;
++ struct elf32_arm_relocs_copied *p;
++
++ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
++
++ if (!info->shared && h->plt.refcount > 0)
++ h->plt.refcount -= 1;
++
++ eh = (struct elf32_arm_link_hash_entry *) h;
++
++ for (pp = &eh->relocs_copied; (p = *pp) != NULL; pp = &p->next)
++ if (p->section == sec)
++ {
++ if (ELF32_R_TYPE (rel->r_info) == R_ARM_PC24)
++ p->pc_count -= 1;
++ p->count -= 1;
++ if (p->count == 0)
++ *pp = p->next;
++ break;
++ }
++ }
++ break;
++
++ case R_ARM_PLT32:
++ r_symndx = ELF32_R_SYM (rel->r_info);
++ if (r_symndx >= symtab_hdr->sh_info)
++ {
++ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
++ if (h->plt.refcount > 0)
++ h->plt.refcount -= 1;
++ }
++ break;
++
++ default:
++ break;
++ }
++
+ return TRUE;
+ }
+
+@@ -2622,13 +2867,15 @@
+ const Elf_Internal_Rela *rel;
+ const Elf_Internal_Rela *rel_end;
+ bfd *dynobj;
+- asection *sgot, *srelgot, *sreloc;
++ asection *sreloc;
+ bfd_vma *local_got_offsets;
++ struct elf32_arm_link_hash_table *htab;
+
+ if (info->relocatable)
+ return TRUE;
+
+- sgot = srelgot = sreloc = NULL;
++ htab = elf32_arm_hash_table (info);
++ sreloc = NULL;
+
+ dynobj = elf_hash_table (info)->dynobj;
+ local_got_offsets = elf_local_got_offsets (abfd);
+@@ -2653,126 +2900,82 @@
+ else
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+- /* Some relocs require a global offset table. */
+- if (dynobj == NULL)
+- {
+- switch (ELF32_R_TYPE (rel->r_info))
+- {
+- case R_ARM_GOT32:
+- case R_ARM_GOTOFF:
+- case R_ARM_GOTPC:
+- elf_hash_table (info)->dynobj = dynobj = abfd;
+- if (! _bfd_elf_create_got_section (dynobj, info))
+- return FALSE;
+- break;
+-
+- default:
+- break;
+- }
+- }
+-
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+- case R_ARM_GOT32:
+- /* This symbol requires a global offset table entry. */
+- if (sgot == NULL)
+- {
+- sgot = bfd_get_section_by_name (dynobj, ".got");
+- BFD_ASSERT (sgot != NULL);
+- }
++ case R_ARM_PLT32:
++ /* This symbol requires a procedure linkage table entry. We
++ actually build the entry in adjust_dynamic_symbol,
++ because this might be a case of linking PIC code which is
++ never referenced by a dynamic object, in which case we
++ don't need to generate a procedure linkage table entry
++ after all. */
+
+- /* Get the got relocation section if necessary. */
+- if (srelgot == NULL
+- && (h != NULL || info->shared))
+- {
+- srelgot = bfd_get_section_by_name (dynobj, ".rel.got");
++ /* If this is a local symbol, we resolve it directly without
++ creating a procedure linkage table entry. */
++ if (h == NULL)
++ continue;
+
+- /* If no got relocation section, make one and initialize. */
+- if (srelgot == NULL)
+- {
+- srelgot = bfd_make_section (dynobj, ".rel.got");
+- if (srelgot == NULL
+- || ! bfd_set_section_flags (dynobj, srelgot,
+- (SEC_ALLOC
+- | SEC_LOAD
+- | SEC_HAS_CONTENTS
+- | SEC_IN_MEMORY
+- | SEC_LINKER_CREATED
+- | SEC_READONLY))
+- || ! bfd_set_section_alignment (dynobj, srelgot, 2))
+- return FALSE;
+- }
+- }
++ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
++ h->plt.refcount++;
++ break;
+
++ case R_ARM_GOT32:
++ /* This symbol requires a global offset table entry. */
+ if (h != NULL)
+ {
+- if (h->got.offset != (bfd_vma) -1)
+- /* We have already allocated space in the .got. */
+- break;
+-
+- h->got.offset = sgot->_raw_size;
+-
+- /* Make sure this symbol is output as a dynamic symbol. */
+- if (h->dynindx == -1)
+- if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+- return FALSE;
+-
+- srelgot->_raw_size += sizeof (Elf32_External_Rel);
++ h->got.refcount++;
+ }
+ else
+ {
+- /* This is a global offset table entry for a local
+- symbol. */
+- if (local_got_offsets == NULL)
++ bfd_signed_vma *local_got_refcounts;
++
++ /* This is a global offset table entry for a local symbol. */
++ local_got_refcounts = elf_local_got_refcounts (abfd);
++ if (local_got_refcounts == NULL)
+ {
+ bfd_size_type size;
+- unsigned int i;
+
+ size = symtab_hdr->sh_info;
+- size *= sizeof (bfd_vma);
+- local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size);
+- if (local_got_offsets == NULL)
++ size *= (sizeof (bfd_signed_vma) + sizeof(char));
++ local_got_refcounts = ((bfd_signed_vma *)
++ bfd_zalloc (abfd, size));
++ if (local_got_refcounts == NULL)
+ return FALSE;
+- elf_local_got_offsets (abfd) = local_got_offsets;
+- for (i = 0; i < symtab_hdr->sh_info; i++)
+- local_got_offsets[i] = (bfd_vma) -1;
++ elf_local_got_refcounts (abfd) = local_got_refcounts;
+ }
+-
+- if (local_got_offsets[r_symndx] != (bfd_vma) -1)
+- /* We have already allocated space in the .got. */
+- break;
+-
+- local_got_offsets[r_symndx] = sgot->_raw_size;
+-
+- if (info->shared)
+- /* If we are generating a shared object, we need to
+- output a R_ARM_RELATIVE reloc so that the dynamic
+- linker can adjust this GOT entry. */
+- srelgot->_raw_size += sizeof (Elf32_External_Rel);
++ local_got_refcounts[r_symndx] += 1;
+ }
+-
+- sgot->_raw_size += 4;
+ break;
+
+- case R_ARM_PLT32:
+- /* This symbol requires a procedure linkage table entry. We
+- actually build the entry in adjust_dynamic_symbol,
+- because this might be a case of linking PIC code which is
+- never referenced by a dynamic object, in which case we
+- don't need to generate a procedure linkage table entry
+- after all. */
+-
+- /* If this is a local symbol, we resolve it directly without
+- creating a procedure linkage table entry. */
+- if (h == NULL)
+- continue;
+-
+- h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
++ case R_ARM_GOTOFF:
++ case R_ARM_GOTPC:
++ if (htab->sgot == NULL)
++ {
++ if (htab->root.dynobj == NULL)
++ htab->root.dynobj = abfd;
++ if (!create_got_section (htab->root.dynobj, info))
++ return FALSE;
++ }
+ break;
+
+ case R_ARM_ABS32:
+ case R_ARM_REL32:
+ case R_ARM_PC24:
++ if (h != NULL && !info->shared)
++ {
++ /* If this reloc is in a read-only section, we might
++ need a copy reloc. We can't check reliably at this
++ stage whether the section is read-only, as input
++ sections have not yet been mapped to output sections.
++ Tentatively set the flag for now, and correct in
++ adjust_dynamic_symbol. */
++ h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
++
++ /* We may need a .plt entry if the function this reloc
++ refers to is in a shared lib. */
++ h->plt.refcount += 1;
++ }
++
+ /* If we are creating a shared library, and this is a reloc
+ against a global symbol, or a non PC relative reloc
+ against a local symbol, then we need to copy the reloc
+@@ -2784,14 +2987,17 @@
+ possible that DEF_REGULAR is not set now but will be set
+ later (it is never cleared). We account for that
+ possibility below by storing information in the
+- pcrel_relocs_copied field of the hash table entry. */
++ relocs_copied field of the hash table entry. */
+ if (info->shared
+- && (ELF32_R_TYPE (rel->r_info) != R_ARM_PC24
+- || (h != NULL
+- && (! info->symbolic
+- || (h->elf_link_hash_flags
+- & ELF_LINK_HASH_DEF_REGULAR) == 0))))
++ && (sec->flags & SEC_ALLOC) != 0
++ && (ELF32_R_TYPE (rel->r_info) != R_ARM_PC24
++ || (h != NULL
++ && (! info->symbolic
++ || (h->elf_link_hash_flags
++ & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+ {
++ struct elf32_arm_relocs_copied *p, **head;
++
+ /* When creating a shared object, we must copy these
+ reloc types into the output file. We create a reloc
+ section in dynobj and make room for this reloc. */
+@@ -2825,45 +3031,49 @@
+ || ! bfd_set_section_alignment (dynobj, sreloc, 2))
+ return FALSE;
+ }
+- if (sec->flags & SEC_READONLY)
+- info->flags |= DF_TEXTREL;
++
++ elf_section_data (sec)->sreloc = sreloc;
+ }
+
+- sreloc->_raw_size += sizeof (Elf32_External_Rel);
+- /* If we are linking with -Bsymbolic, and this is a
+- global symbol, we count the number of PC relative
+- relocations we have entered for this symbol, so that
+- we can discard them again if the symbol is later
+- defined by a regular object. Note that this function
+- is only called if we are using an elf_i386 linker
+- hash table, which means that h is really a pointer to
+- an elf_i386_link_hash_entry. */
+- if (h != NULL && info->symbolic
+- && ELF32_R_TYPE (rel->r_info) == R_ARM_PC24)
++ /* If this is a global symbol, we count the number of
++ relocations we need for this symbol. */
++ if (h != NULL)
+ {
+- struct elf32_arm_link_hash_entry * eh;
+- struct elf32_arm_pcrel_relocs_copied * p;
+-
+- eh = (struct elf32_arm_link_hash_entry *) h;
+-
+- for (p = eh->pcrel_relocs_copied; p != NULL; p = p->next)
+- if (p->section == sreloc)
+- break;
+-
++ head = &((struct elf32_arm_link_hash_entry *) h)->relocs_copied;
++ }
++ else
++ {
++ /* Track dynamic relocs needed for local syms too.
++ We really need local syms available to do this
++ easily. Oh well. */
++
++ asection *s;
++ s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
++ sec, r_symndx);
++ if (s == NULL)
++ return FALSE;
++
++ head = ((struct elf32_arm_relocs_copied **)
++ &elf_section_data (s)->local_dynrel);
++ }
++
++ p = *head;
++ if (p == NULL || p->section != sec)
++ {
++ bfd_size_type amt = sizeof *p;
++ p = bfd_alloc (htab->root.dynobj, amt);
+ if (p == NULL)
+- {
+- p = ((struct elf32_arm_pcrel_relocs_copied *)
+- bfd_alloc (dynobj, (bfd_size_type) sizeof * p));
+- if (p == NULL)
+- return FALSE;
+- p->next = eh->pcrel_relocs_copied;
+- eh->pcrel_relocs_copied = p;
+- p->section = sreloc;
+- p->count = 0;
+- }
+-
+- ++p->count;
++ return FALSE;
++ p->next = *head;
++ *head = p;
++ p->section = sec;
++ p->count = 0;
++ p->pc_count = 0;
+ }
++
++ p->count += 1;
++ if (ELF32_R_TYPE (rel->r_info) == R_ARM_PC24)
++ p->pc_count += 1;
+ }
+ break;
+
+@@ -3003,71 +3213,29 @@
+ if (h->type == STT_FUNC
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
+ {
+- /* If we link a program (not a DSO), we'll get rid of unnecessary
+- PLT entries; we point to the actual symbols -- even for pic
+- relocs, because a program built with -fpic should have the same
+- result as one built without -fpic, specifically considering weak
+- symbols.
+- FIXME: m68k and i386 differ here, for unclear reasons. */
+- if (! info->shared
+- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0)
++ if (h->plt.refcount <= 0
++ || SYMBOL_CALLS_LOCAL (info, h)
++ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
++ && h->root.type == bfd_link_hash_undefweak))
+ {
+ /* This case can occur if we saw a PLT32 reloc in an input
+- file, but the symbol was not defined by a dynamic object.
+- In such a case, we don't actually need to build a
+- procedure linkage table, and we can just do a PC32 reloc
+- instead. */
+- BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
++ file, but the symbol was never referred to by a dynamic
++ object, or if all references were garbage collected. In
++ such a case, we don't actually need to build a procedure
++ linkage table, and we can just do a PC24 reloc instead. */
++ h->plt.offset = (bfd_vma) -1;
+ h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
+- return TRUE;
+- }
+-
+- /* Make sure this symbol is output as a dynamic symbol. */
+- if (h->dynindx == -1)
+- {
+- if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+- return FALSE;
+ }
+
+- s = bfd_get_section_by_name (dynobj, ".plt");
+- BFD_ASSERT (s != NULL);
+-
+- /* If this is the first .plt entry, make room for the special
+- first entry. */
+- if (s->_raw_size == 0)
+- s->_raw_size += PLT_ENTRY_SIZE;
+-
+- /* If this symbol is not defined in a regular file, and we are
+- not generating a shared library, then set the symbol to this
+- location in the .plt. This is required to make function
+- pointers compare as equal between the normal executable and
+- the shared library. */
+- if (! info->shared
+- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+- {
+- h->root.u.def.section = s;
+- h->root.u.def.value = s->_raw_size;
+- }
+-
+- h->plt.offset = s->_raw_size;
+-
+- /* Make room for this entry. */
+- s->_raw_size += PLT_ENTRY_SIZE;
+-
+- /* We also need to make an entry in the .got.plt section, which
+- will be placed in the .got section by the linker script. */
+- s = bfd_get_section_by_name (dynobj, ".got.plt");
+- BFD_ASSERT (s != NULL);
+- s->_raw_size += 4;
+-
+- /* We also need to make an entry in the .rel.plt section. */
+-
+- s = bfd_get_section_by_name (dynobj, ".rel.plt");
+- BFD_ASSERT (s != NULL);
+- s->_raw_size += sizeof (Elf32_External_Rel);
+-
+ return TRUE;
+ }
++ else
++ /* It's possible that we incorrectly decided a .plt reloc was
++ needed for an R_ARM_PC24 reloc to a non-function sym in
++ check_relocs. We can't decide accurately between function and
++ non-function syms in check-relocs; Objects loaded later in
++ the link may change h->type. So fix it now. */
++ h->plt.offset = (bfd_vma) -1;
+
+ /* If this is a weak symbol, and there is a real definition, the
+ processor independent code will have arranged for us to see the
+@@ -3142,6 +3310,198 @@
+ return TRUE;
+ }
+
++/* Allocate space in .plt, .got and associated reloc sections for
++ dynamic relocs. */
++
++static bfd_boolean
++allocate_dynrelocs (h, inf)
++ struct elf_link_hash_entry *h;
++ PTR inf;
++{
++ struct bfd_link_info *info;
++ struct elf32_arm_link_hash_table *htab;
++ struct elf32_arm_link_hash_entry *eh;
++ struct elf32_arm_relocs_copied *p;
++
++ if (h->root.type == bfd_link_hash_indirect)
++ return TRUE;
++
++ if (h->root.type == bfd_link_hash_warning)
++ /* When warning symbols are created, they **replace** the "real"
++ entry in the hash table, thus we never get to see the real
++ symbol in a hash traversal. So look at it now. */
++ h = (struct elf_link_hash_entry *) h->root.u.i.link;
++
++ info = (struct bfd_link_info *) inf;
++ htab = elf32_arm_hash_table (info);
++
++ if (htab->root.dynamic_sections_created
++ && h->plt.refcount > 0)
++ {
++ /* Make sure this symbol is output as a dynamic symbol.
++ Undefined weak syms won't yet be marked as dynamic. */
++ if (h->dynindx == -1
++ && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
++ {
++ if (! bfd_elf32_link_record_dynamic_symbol (info, h))
++ return FALSE;
++ }
++
++ if (info->shared
++ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
++ {
++ asection *s = htab->splt;
++
++ /* If this is the first .plt entry, make room for the special
++ first entry. */
++ if (s->_raw_size == 0)
++ s->_raw_size += PLT_HEADER_SIZE;
++
++ h->plt.offset = s->_raw_size;
++
++ /* If this symbol is not defined in a regular file, and we are
++ not generating a shared library, then set the symbol to this
++ location in the .plt. This is required to make function
++ pointers compare as equal between the normal executable and
++ the shared library. */
++ if (! info->shared
++ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
++ {
++ h->root.u.def.section = s;
++ h->root.u.def.value = h->plt.offset;
++ }
++
++ /* Make room for this entry. */
++ s->_raw_size += PLT_ENTRY_SIZE;
++
++ /* We also need to make an entry in the .got.plt section, which
++ will be placed in the .got section by the linker script. */
++ htab->sgotplt->_raw_size += 4;
++
++ /* We also need to make an entry in the .rel.plt section. */
++ htab->srelplt->_raw_size += sizeof (Elf32_External_Rel);
++ }
++ else
++ {
++ h->plt.offset = (bfd_vma) -1;
++ h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
++ }
++ }
++ else
++ {
++ h->plt.offset = (bfd_vma) -1;
++ h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
++ }
++
++ if (h->got.refcount > 0)
++ {
++ asection *s;
++ bfd_boolean dyn;
++
++ /* Make sure this symbol is output as a dynamic symbol.
++ Undefined weak syms won't yet be marked as dynamic. */
++ if (h->dynindx == -1
++ && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
++ {
++ if (! bfd_elf32_link_record_dynamic_symbol (info, h))
++ return FALSE;
++ }
++
++ s = htab->sgot;
++ h->got.offset = s->_raw_size;
++ s->_raw_size += 4;
++ dyn = htab->root.dynamic_sections_created;
++ if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
++ || h->root.type != bfd_link_hash_undefweak)
++ && (info->shared
++ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
++ htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
++ }
++ else
++ h->got.offset = (bfd_vma) -1;
++
++ eh = (struct elf32_arm_link_hash_entry *) h;
++ if (eh->relocs_copied == NULL)
++ return TRUE;
++
++ /* In the shared -Bsymbolic case, discard space allocated for
++ dynamic pc-relative relocs against symbols which turn out to be
++ defined in regular objects. For the normal shared case, discard
++ space for pc-relative relocs that have become local due to symbol
++ visibility changes. */
++
++ if (info->shared)
++ {
++ /* The only reloc that uses pc_count is R_ARM_PC24, which will
++ appear on a call or on something like ".long foo - .". We
++ want calls to protected symbols to resolve directly to the
++ function rather than going via the plt. If people want
++ function pointer comparisons to work as expected then they
++ should avoid writing assembly like ".long foo - .". */
++ if (SYMBOL_CALLS_LOCAL (info, h))
++ {
++ struct elf32_arm_relocs_copied **pp;
++
++ for (pp = &eh->relocs_copied; (p = *pp) != NULL; )
++ {
++ p->count -= p->pc_count;
++ p->pc_count = 0;
++ if (p->count == 0)
++ *pp = p->next;
++ else
++ pp = &p->next;
++ }
++ }
++
++ /* Also discard relocs on undefined weak syms with non-default
++ visibility. */
++ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
++ && h->root.type == bfd_link_hash_undefweak)
++ eh->relocs_copied = NULL;
++ }
++ else
++ {
++ /* For the non-shared case, discard space for relocs against
++ symbols which turn out to need copy relocs or are not
++ dynamic. */
++
++ if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
++ && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
++ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
++ || (htab->root.dynamic_sections_created
++ && (h->root.type == bfd_link_hash_undefweak
++ || h->root.type == bfd_link_hash_undefined))))
++ {
++ /* Make sure this symbol is output as a dynamic symbol.
++ Undefined weak syms won't yet be marked as dynamic. */
++ if (h->dynindx == -1
++ && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
++ {
++ if (! bfd_elf32_link_record_dynamic_symbol (info, h))
++ return FALSE;
++ }
++
++ /* If that succeeded, we know we'll be keeping all the
++ relocs. */
++ if (h->dynindx != -1)
++ goto keep;
++ }
++
++ eh->relocs_copied = NULL;
++
++ keep: ;
++ }
++
++ /* Finally, allocate space. */
++ for (p = eh->relocs_copied; p != NULL; p = p->next)
++ {
++ asection *sreloc = elf_section_data (p->section)->sreloc;
++ sreloc->_raw_size += p->count * sizeof (Elf32_External_Rel);
++ }
++
++ return TRUE;
++}
++
+ /* Set the sizes of the dynamic sections. */
+
+ static bfd_boolean
+@@ -3153,7 +3513,10 @@
+ asection * s;
+ bfd_boolean plt;
+ bfd_boolean relocs;
++ bfd *ibfd;
++ struct elf32_arm_link_hash_table *htab;
+
++ htab = elf32_arm_hash_table (info);
+ dynobj = elf_hash_table (info)->dynobj;
+ BFD_ASSERT (dynobj != NULL);
+
+@@ -3168,26 +3531,74 @@
+ s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+ }
+ }
+- else
+- {
+- /* We may have created entries in the .rel.got section.
+- However, if we are not creating the dynamic sections, we will
+- not actually use these entries. Reset the size of .rel.got,
+- which will cause it to get stripped from the output file
+- below. */
+- s = bfd_get_section_by_name (dynobj, ".rel.got");
+- if (s != NULL)
+- s->_raw_size = 0;
+- }
+-
+- /* If this is a -Bsymbolic shared link, then we need to discard all
+- PC relative relocs against symbols defined in a regular object.
+- We allocated space for them in the check_relocs routine, but we
+- will not fill them in in the relocate_section routine. */
+- if (info->shared && info->symbolic)
+- elf32_arm_link_hash_traverse (elf32_arm_hash_table (info),
+- elf32_arm_discard_copies,
+- (PTR) NULL);
++
++ /* Set up .got offsets for local syms, and space for local dynamic
++ relocs. */
++ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
++ {
++ bfd_signed_vma *local_got;
++ bfd_signed_vma *end_local_got;
++ char *local_tls_type;
++ bfd_size_type locsymcount;
++ Elf_Internal_Shdr *symtab_hdr;
++ asection *srel;
++
++ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
++ continue;
++
++ for (s = ibfd->sections; s != NULL; s = s->next)
++ {
++ struct elf32_arm_relocs_copied *p;
++
++ for (p = *((struct elf32_arm_relocs_copied **)
++ &elf_section_data (s)->local_dynrel);
++ p != NULL;
++ p = p->next)
++ {
++ if (!bfd_is_abs_section (p->section)
++ && bfd_is_abs_section (p->section->output_section))
++ {
++ /* Input section has been discarded, either because
++ it is a copy of a linkonce section or due to
++ linker script /DISCARD/, so we'll be discarding
++ the relocs too. */
++ }
++ else if (p->count != 0)
++ {
++ srel = elf_section_data (p->section)->sreloc;
++ srel->_raw_size += p->count * sizeof (Elf32_External_Rel);
++ if ((p->section->output_section->flags & SEC_READONLY) != 0)
++ info->flags |= DF_TEXTREL;
++ }
++ }
++ }
++
++ local_got = elf_local_got_refcounts (ibfd);
++ if (!local_got)
++ continue;
++
++ symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
++ locsymcount = symtab_hdr->sh_info;
++ end_local_got = local_got + locsymcount;
++ s = htab->sgot;
++ srel = htab->srelgot;
++ for (; local_got < end_local_got; ++local_got, ++local_tls_type)
++ {
++ if (*local_got > 0)
++ {
++ *local_got = s->_raw_size;
++ s->_raw_size += 4;
++ if (info->shared)
++ srel->_raw_size += sizeof (Elf32_External_Rel);
++ }
++ else
++ *local_got = (bfd_vma) -1;
++ }
++ }
++
++ /* Allocate global sym .plt and .got entries, and space for global
++ sym dynamic relocs. */
++ elf_link_hash_traverse (&htab->root, allocate_dynrelocs, (PTR) info);
+
+ /* The check_relocs and adjust_dynamic_symbol entry points have
+ determined the sizes of the various dynamic sections. Allocate
+@@ -3312,33 +3723,6 @@
+ return TRUE;
+ }
+
+-/* This function is called via elf32_arm_link_hash_traverse if we are
+- creating a shared object with -Bsymbolic. It discards the space
+- allocated to copy PC relative relocs against symbols which are
+- defined in regular objects. We allocated space for them in the
+- check_relocs routine, but we won't fill them in in the
+- relocate_section routine. */
+-
+-static bfd_boolean
+-elf32_arm_discard_copies (h, ignore)
+- struct elf32_arm_link_hash_entry * h;
+- PTR ignore ATTRIBUTE_UNUSED;
+-{
+- struct elf32_arm_pcrel_relocs_copied * s;
+-
+- if (h->root.root.type == bfd_link_hash_warning)
+- h = (struct elf32_arm_link_hash_entry *) h->root.root.u.i.link;
+-
+- /* We only discard relocs for symbols defined in a regular object. */
+- if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+- return TRUE;
+-
+- for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
+- s->section->_raw_size -= s->count * sizeof (Elf32_External_Rel);
+-
+- return TRUE;
+-}
+-
+ /* Finish up dynamic symbol handling. We set the contents of various
+ dynamic sections here. */
+
+@@ -3362,6 +3746,7 @@
+ bfd_vma got_offset;
+ Elf_Internal_Rela rel;
+ bfd_byte *loc;
++ bfd_vma got_displacement;
+
+ /* This symbol has an entry in the procedure linkage table. Set
+ it up. */
+@@ -3377,35 +3762,43 @@
+ corresponds to this symbol. This is the index of this symbol
+ in all the symbols for which we are making plt entries. The
+ first entry in the procedure linkage table is reserved. */
+- plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
++ plt_index = (h->plt.offset - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE;
+
+ /* Get the offset into the .got table of the entry that
+ corresponds to this function. Each .got entry is 4 bytes.
+ The first three are reserved. */
+ got_offset = (plt_index + 3) * 4;
+
++ /* Calculate the displacement between the PLT slot and the
++ entry in the GOT. */
++ got_displacement = (sgot->output_section->vma
++ + sgot->output_offset
++ + got_offset
++ - splt->output_section->vma
++ - splt->output_offset
++ - h->plt.offset
++ - 8);
++
++ BFD_ASSERT ((got_displacement & 0xf0000000) == 0);
++
+ /* Fill in the entry in the procedure linkage table. */
+- bfd_put_32 (output_bfd, elf32_arm_plt_entry[0],
++ bfd_put_32 (output_bfd, elf32_arm_plt_entry[0] | ((got_displacement & 0x0ff00000) >> 20),
+ splt->contents + h->plt.offset + 0);
+- bfd_put_32 (output_bfd, elf32_arm_plt_entry[1],
++ bfd_put_32 (output_bfd, elf32_arm_plt_entry[1] | ((got_displacement & 0x000ff000) >> 12),
+ splt->contents + h->plt.offset + 4);
+- bfd_put_32 (output_bfd, elf32_arm_plt_entry[2],
++ bfd_put_32 (output_bfd, elf32_arm_plt_entry[2] | (got_displacement & 0x00000fff),
+ splt->contents + h->plt.offset + 8);
+- bfd_put_32 (output_bfd,
+- (sgot->output_section->vma
+- + sgot->output_offset
+- + got_offset
+- - splt->output_section->vma
+- - splt->output_offset
+- - h->plt.offset - 12),
+- splt->contents + h->plt.offset + 12);
++#ifdef FOUR_WORD_PLT
++ bfd_put_32 (output_bfd, elf32_arm_plt_entry[3],
++ splt->contents + h->plt.offset + 12);
++#endif
+
+ /* Fill in the entry in the global offset table. */
+ bfd_put_32 (output_bfd,
+ (splt->output_section->vma
+ + splt->output_offset),
+ sgot->contents + got_offset);
+-
++
+ /* Fill in the entry in the .rel.plt section. */
+ rel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+@@ -3446,16 +3839,20 @@
+ + sgot->output_offset
+ + (h->got.offset &~ (bfd_vma) 1));
+
+- /* If this is a -Bsymbolic link, and the symbol is defined
+- locally, we just want to emit a RELATIVE reloc. The entry in
+- the global offset table will already have been initialized in
+- the relocate_section function. */
++ /* If this is a static link, or it is a -Bsymbolic link and the
++ symbol is defined locally or was forced to be local because
++ of a version file, we just want to emit a RELATIVE reloc.
++ The entry in the global offset table will already have been
++ initialized in the relocate_section function. */
+ if (info->shared
+- && (info->symbolic || h->dynindx == -1)
+- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+- rel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
++ && SYMBOL_REFERENCES_LOCAL (info, h))
++ {
++ BFD_ASSERT((h->got.offset & 1) != 0);
++ rel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
++ }
+ else
+ {
++ BFD_ASSERT((h->got.offset & 1) == 0);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
+ rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_GLOB_DAT);
+ }
+@@ -3609,10 +4006,26 @@
+ /* Fill in the first entry in the procedure linkage table. */
+ if (splt->_raw_size > 0)
+ {
++ bfd_vma got_displacement;
++
++ /* Calculate the displacement between the PLT slot and &GOT[0]. */
++ got_displacement = (sgot->output_section->vma
++ + sgot->output_offset
++ - splt->output_section->vma
++ - splt->output_offset
++ - 16);
++
+ bfd_put_32 (output_bfd, elf32_arm_plt0_entry[0], splt->contents + 0);
+ bfd_put_32 (output_bfd, elf32_arm_plt0_entry[1], splt->contents + 4);
+ bfd_put_32 (output_bfd, elf32_arm_plt0_entry[2], splt->contents + 8);
+ bfd_put_32 (output_bfd, elf32_arm_plt0_entry[3], splt->contents + 12);
++#ifdef FOUR_WORD_PLT
++ /* The displacement value goes in the otherwise-unused last word of
++ the second entry. */
++ bfd_put_32 (output_bfd, got_displacement, splt->contents + 28);
++#else
++ bfd_put_32 (output_bfd, got_displacement, splt->contents + 16);
++#endif
+ }
+
+ /* UnixWare sets the entsize of .plt to 4, although that doesn't
+@@ -3714,7 +4127,7 @@
+ #define elf_backend_check_relocs elf32_arm_check_relocs
+ #define elf_backend_relocate_section elf32_arm_relocate_section
+ #define elf_backend_adjust_dynamic_symbol elf32_arm_adjust_dynamic_symbol
+-#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
++#define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections
+ #define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol
+ #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections
+ #define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections
+@@ -3723,7 +4136,9 @@
+ #define elf_backend_object_p elf32_arm_object_p
+ #define elf_backend_section_flags elf32_arm_section_flags
+ #define elf_backend_final_write_processing elf32_arm_final_write_processing
++#define elf_backend_copy_indirect_symbol elf32_arm_copy_indirect_symbol
+
++#define elf_backend_can_refcount 1
+ #define elf_backend_can_gc_sections 1
+ #define elf_backend_plt_readonly 1
+ #define elf_backend_want_got_plt 1
+@@ -3733,7 +4148,7 @@
+ #endif
+
+ #define elf_backend_got_header_size 12
+-#define elf_backend_plt_header_size PLT_ENTRY_SIZE
++#define elf_backend_plt_header_size PLT_HEADER_SIZE
+
+ #include "elf32-target.h"
+
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-avr.c binutils-2.14.90.0.7/bfd/elf32-avr.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-avr.c 2003-07-23 09:08:08.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf32-avr.c 2004-04-20 01:26:12.000000000 -0600
+@@ -750,7 +750,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections [r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-cris.c binutils-2.14.90.0.7/bfd/elf32-cris.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-cris.c 2003-08-21 09:28:47.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf32-cris.c 2004-04-20 01:26:12.000000000 -0600
+@@ -847,7 +847,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections [r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ symname = (bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name));
+@@ -1292,16 +1292,7 @@
+ {
+ long indx;
+
+- if (h == NULL)
+- sec = local_sections[r_symndx];
+- else
+- {
+- BFD_ASSERT (h->root.type == bfd_link_hash_defined
+- || (h->root.type
+- == bfd_link_hash_defweak));
+- sec = h->root.u.def.section;
+- }
+- if (sec != NULL && bfd_is_abs_section (sec))
++ if (bfd_is_abs_section (sec))
+ indx = 0;
+ else if (sec == NULL || sec->owner == NULL)
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-fr30.c binutils-2.14.90.0.7/bfd/elf32-fr30.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-fr30.c 2003-07-23 09:08:08.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf32-fr30.c 2004-04-20 01:26:12.000000000 -0600
+@@ -552,7 +552,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections [r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-frv.c binutils-2.14.90.0.7/bfd/elf32-frv.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-frv.c 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf32-frv.c 2004-04-20 01:26:12.000000000 -0600
+@@ -724,7 +724,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections [r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-h8300.c binutils-2.14.90.0.7/bfd/elf32-h8300.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-h8300.c 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf32-h8300.c 2004-04-20 01:26:12.000000000 -0600
+@@ -435,7 +435,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-hppa.c binutils-2.14.90.0.7/bfd/elf32-hppa.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-hppa.c 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf32-hppa.c 2004-04-20 01:26:12.000000000 -0600
+@@ -3408,7 +3408,7 @@
+ /* This is a local symbol, h defaults to NULL. */
+ sym = local_syms + r_symndx;
+ sym_sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel);
+ }
+ else
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-i370.c binutils-2.14.90.0.7/bfd/elf32-i370.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-i370.c 2003-07-23 09:08:08.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf32-i370.c 2004-04-20 01:26:12.000000000 -0600
+@@ -1210,7 +1210,7 @@
+ sec = local_sections[r_symndx];
+ sym_name = "<local symbol>";
+
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ addend = rel->r_addend;
+ }
+ else
+@@ -1363,16 +1363,7 @@
+ {
+ long indx;
+
+- if (h == NULL)
+- sec = local_sections[r_symndx];
+- else
+- {
+- BFD_ASSERT (h->root.type == bfd_link_hash_defined
+- || (h->root.type
+- == bfd_link_hash_defweak));
+- sec = h->root.u.def.section;
+- }
+- if (sec != NULL && bfd_is_abs_section (sec))
++ if (bfd_is_abs_section (sec))
+ indx = 0;
+ else if (sec == NULL || sec->owner == NULL)
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-i860.c binutils-2.14.90.0.7/bfd/elf32-i860.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-i860.c 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf32-i860.c 2004-04-20 01:26:12.000000000 -0600
+@@ -1104,7 +1104,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections [r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-m32r.c binutils-2.14.90.0.7/bfd/elf32-m32r.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-m32r.c 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf32-m32r.c 2004-04-20 01:26:12.000000000 -0600
+@@ -1107,7 +1107,7 @@
+ sec = local_sections[r_symndx];
+ sym_name = "<local symbol>";
+ #if !USE_REL
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ addend = rel->r_addend;
+ #else
+ /* FIXME: This won't handle local relocations against SEC_MERGE
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-m68k.c binutils-2.14.90.0.7/bfd/elf32-m68k.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-m68k.c 2003-08-21 09:28:47.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf32-m68k.c 2004-04-20 01:26:12.000000000 -0600
+@@ -1403,7 +1403,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+@@ -1657,16 +1657,7 @@
+ {
+ long indx;
+
+- if (h == NULL)
+- sec = local_sections[r_symndx];
+- else
+- {
+- BFD_ASSERT (h->root.type == bfd_link_hash_defined
+- || (h->root.type
+- == bfd_link_hash_defweak));
+- sec = h->root.u.def.section;
+- }
+- if (sec != NULL && bfd_is_abs_section (sec))
++ if (bfd_is_abs_section (sec))
+ indx = 0;
+ else if (sec == NULL || sec->owner == NULL)
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-mcore.c binutils-2.14.90.0.7/bfd/elf32-mcore.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-mcore.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf32-mcore.c 2004-04-20 01:26:12.000000000 -0600
+@@ -467,7 +467,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections [r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ addend = rel->r_addend;
+ }
+ else
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-msp430.c binutils-2.14.90.0.7/bfd/elf32-msp430.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-msp430.c 2003-08-21 09:28:47.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf32-msp430.c 2004-04-20 01:26:12.000000000 -0600
+@@ -449,7 +449,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-openrisc.c binutils-2.14.90.0.7/bfd/elf32-openrisc.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-openrisc.c 2003-07-23 09:08:08.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf32-openrisc.c 2004-04-20 01:26:12.000000000 -0600
+@@ -375,7 +375,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-ppc.c binutils-2.14.90.0.7/bfd/elf32-ppc.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-ppc.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf32-ppc.c 2004-04-20 01:26:12.000000000 -0600
+@@ -4727,7 +4727,7 @@
+ sec = local_sections[r_symndx];
+ sym_name = bfd_elf_local_sym_name (input_bfd, sym);
+
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+@@ -5455,44 +5455,9 @@
+ break;
+
+ case R_PPC_RELAX32:
+- {
+- unsigned long r_symndx;
+- Elf_Internal_Sym *sym;
+- asection *sym_sec;
+- bfd_byte *hit_addr = 0;
+- bfd_vma value = 0;
+-
+- r_symndx = ELF32_R_SYM (rel->r_info);
+-
+- if (r_symndx < symtab_hdr->sh_info)
+- {
+- sym = local_syms + r_symndx;
+- sym_sec = local_sections[r_symndx];
+-
+- value = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
+- }
+- else
+- {
+- bfd_boolean warned;
+- bfd_boolean unresolved_reloc;
+-
+- RELOC_FOR_GLOBAL_SYMBOL (h, elf_sym_hashes (input_bfd),
+- r_symndx, symtab_hdr,
+- value, sym_sec,
+- unresolved_reloc, info,
+- warned);
+- if (warned)
+- continue;
+- }
+- hit_addr = contents + rel->r_offset;
+- value += rel->r_addend;
+-
+- r = ppc_elf_install_value (output_bfd, hit_addr, value, r_type);
+- if (r != bfd_reloc_ok)
+- break;
+- else
+- continue;
+- }
++ ppc_elf_install_value (output_bfd, contents + rel->r_offset,
++ relocation + addend, r_type);
++ continue;
+
+ /* Indirect .sdata relocation. */
+ case R_PPC_EMB_SDAI16:
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-s390.c binutils-2.14.90.0.7/bfd/elf32-s390.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-s390.c 2003-08-21 09:28:47.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf32-s390.c 2004-04-20 01:26:12.000000000 -0600
+@@ -2327,7 +2327,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-sh.c binutils-2.14.90.0.7/bfd/elf32-sh.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-sh.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf32-sh.c 2004-04-20 01:26:12.000000000 -0600
+@@ -4805,7 +4805,7 @@
+ }
+ else if (! howto->partial_inplace)
+ {
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ addend = rel->r_addend;
+ }
+ else if ((sec->flags & SEC_MERGE)
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-sparc.c binutils-2.14.90.0.7/bfd/elf32-sparc.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-sparc.c 2003-08-21 09:28:48.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf32-sparc.c 2004-04-20 01:26:12.000000000 -0600
+@@ -2182,7 +2182,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+@@ -2459,16 +2459,8 @@
+
+ if (is_plt)
+ sec = htab->splt;
+- else if (h == NULL)
+- sec = local_sections[r_symndx];
+- else
+- {
+- BFD_ASSERT (h->root.type == bfd_link_hash_defined
+- || (h->root.type
+- == bfd_link_hash_defweak));
+- sec = h->root.u.def.section;
+- }
+- if (sec != NULL && bfd_is_abs_section (sec))
++
++ if (bfd_is_abs_section (sec))
+ indx = 0;
+ else if (sec == NULL || sec->owner == NULL)
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-v850.c binutils-2.14.90.0.7/bfd/elf32-v850.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-v850.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf32-v850.c 2004-04-20 01:26:12.000000000 -0600
+@@ -1681,7 +1681,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ #if 0
+ {
+ char * name;
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-vax.c binutils-2.14.90.0.7/bfd/elf32-vax.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-vax.c 2003-08-21 09:28:48.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf32-vax.c 2004-04-20 01:26:12.000000000 -0600
+@@ -1483,7 +1483,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+@@ -1737,16 +1737,7 @@
+ {
+ long indx;
+
+- if (h == NULL)
+- sec = local_sections[r_symndx];
+- else
+- {
+- BFD_ASSERT (h->root.type == bfd_link_hash_defined
+- || (h->root.type
+- == bfd_link_hash_defweak));
+- sec = h->root.u.def.section;
+- }
+- if (sec != NULL && bfd_is_abs_section (sec))
++ if (bfd_is_abs_section (sec))
+ indx = 0;
+ else if (sec == NULL || sec->owner == NULL)
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-xstormy16.c binutils-2.14.90.0.7/bfd/elf32-xstormy16.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-xstormy16.c 2003-07-23 09:08:09.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf32-xstormy16.c 2004-04-20 01:26:12.000000000 -0600
+@@ -845,7 +845,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections [r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-xtensa.c binutils-2.14.90.0.7/bfd/elf32-xtensa.c
+--- binutils-2.14.90.0.7.orig/bfd/elf32-xtensa.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf32-xtensa.c 2004-04-20 01:26:12.000000000 -0600
+@@ -2004,7 +2004,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-alpha.c binutils-2.14.90.0.7/bfd/elf64-alpha.c
+--- binutils-2.14.90.0.7.orig/bfd/elf64-alpha.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf64-alpha.c 2004-04-20 01:26:12.000000000 -0600
+@@ -4394,9 +4394,11 @@
+
+ if (r_symndx < symtab_hdr->sh_info)
+ {
++ asection *msec;
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- value = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ msec = sec;
++ value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel);
+
+ /* If this is a tp-relative relocation against sym 0,
+ this is hackery from relax_section. Force the value to
+@@ -4424,7 +4426,6 @@
+ && !gotent->reloc_xlated)
+ {
+ struct alpha_elf_got_entry *ent;
+- asection *msec;
+
+ for (ent = gotent; ent; ent = ent->next)
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-hppa.c binutils-2.14.90.0.7/bfd/elf64-hppa.c
+--- binutils-2.14.90.0.7.orig/bfd/elf64-hppa.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf64-hppa.c 2004-04-20 01:26:12.000000000 -0600
+@@ -173,7 +173,7 @@
+ PTR info));
+
+ static const char *get_dyn_name
+- PARAMS ((asection *, struct elf_link_hash_entry *,
++ PARAMS ((bfd *, struct elf_link_hash_entry *,
+ const Elf_Internal_Rela *, char **, size_t *));
+
+ /* This must follow the definitions of the various derived linker
+@@ -446,13 +446,14 @@
+ allocate memory as necessary, possibly reusing PBUF/PLEN. */
+
+ static const char *
+-get_dyn_name (sec, h, rel, pbuf, plen)
+- asection *sec;
++get_dyn_name (abfd, h, rel, pbuf, plen)
++ bfd *abfd;
+ struct elf_link_hash_entry *h;
+ const Elf_Internal_Rela *rel;
+ char **pbuf;
+ size_t *plen;
+ {
++ asection *sec = abfd->sections;
+ size_t nlen, tlen;
+ char *buf;
+ size_t len;
+@@ -858,7 +859,7 @@
+ continue;
+
+ /* Collect a canonical name for this address. */
+- addr_name = get_dyn_name (sec, h, rel, &buf, &buf_len);
++ addr_name = get_dyn_name (abfd, h, rel, &buf, &buf_len);
+
+ /* Collect the canonical entry data for this address. */
+ dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-mmix.c binutils-2.14.90.0.7/bfd/elf64-mmix.c
+--- binutils-2.14.90.0.7.orig/bfd/elf64-mmix.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf64-mmix.c 2004-04-20 01:26:12.000000000 -0600
+@@ -1472,7 +1472,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections [r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-ppc.c binutils-2.14.90.0.7/bfd/elf64-ppc.c
+--- binutils-2.14.90.0.7.orig/bfd/elf64-ppc.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf64-ppc.c 2004-04-20 01:26:12.000000000 -0600
+@@ -7385,7 +7385,7 @@
+ sec = local_sections[r_symndx];
+ sym_name = bfd_elf_local_sym_name (input_bfd, sym);
+ sym_type = ELF64_ST_TYPE (sym->st_info);
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ if (elf_section_data (sec) != NULL)
+ {
+ long *opd_sym_adjust;
+@@ -8178,7 +8178,9 @@
+ relocation = TOCstart;
+ if (r_symndx == 0)
+ relocation += htab->stub_group[input_section->id].toc_off;
+- else if (sec != NULL && !unresolved_reloc)
++ else if (unresolved_reloc)
++ ;
++ else if (sec != NULL && sec->id <= htab->top_id)
+ relocation += htab->stub_group[sec->id].toc_off;
+ else
+ unresolved_reloc = TRUE;
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-s390.c binutils-2.14.90.0.7/bfd/elf64-s390.c
+--- binutils-2.14.90.0.7.orig/bfd/elf64-s390.c 2003-08-21 09:28:48.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf64-s390.c 2004-04-20 01:26:12.000000000 -0600
+@@ -2297,7 +2297,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-sh64.c binutils-2.14.90.0.7/bfd/elf64-sh64.c
+--- binutils-2.14.90.0.7.orig/bfd/elf64-sh64.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elf64-sh64.c 2004-04-20 01:26:12.000000000 -0600
+@@ -1582,7 +1582,7 @@
+ }
+ else if (! howto->partial_inplace)
+ {
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ relocation |= ((sym->st_other & STO_SH5_ISA32) != 0);
+ }
+ else if ((sec->flags & SEC_MERGE)
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-sparc.c binutils-2.14.90.0.7/bfd/elf64-sparc.c
+--- binutils-2.14.90.0.7.orig/bfd/elf64-sparc.c 2003-08-21 09:28:48.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf64-sparc.c 2004-04-20 01:26:12.000000000 -0600
+@@ -2070,7 +2070,7 @@
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+@@ -2247,16 +2247,8 @@
+
+ if (is_plt)
+ sec = splt;
+- else if (h == NULL)
+- sec = local_sections[r_symndx];
+- else
+- {
+- BFD_ASSERT (h->root.type == bfd_link_hash_defined
+- || (h->root.type
+- == bfd_link_hash_defweak));
+- sec = h->root.u.def.section;
+- }
+- if (sec != NULL && bfd_is_abs_section (sec))
++
++ if (bfd_is_abs_section (sec))
+ indx = 0;
+ else if (sec == NULL || sec->owner == NULL)
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-x86-64.c binutils-2.14.90.0.7/bfd/elf64-x86-64.c
+--- binutils-2.14.90.0.7.orig/bfd/elf64-x86-64.c 2003-08-21 09:28:48.000000000 -0600
++++ binutils-2.14.90.0.7/bfd/elf64-x86-64.c 2004-04-20 01:26:12.000000000 -0600
+@@ -1823,7 +1823,7 @@
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+
+- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
++ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
+ else
+ {
+@@ -2048,16 +2048,7 @@
+ {
+ long sindx;
+
+- if (h == NULL)
+- sec = local_sections[r_symndx];
+- else
+- {
+- BFD_ASSERT (h->root.type == bfd_link_hash_defined
+- || (h->root.type
+- == bfd_link_hash_defweak));
+- sec = h->root.u.def.section;
+- }
+- if (sec != NULL && bfd_is_abs_section (sec))
++ if (bfd_is_abs_section (sec))
+ sindx = 0;
+ else if (sec == NULL || sec->owner == NULL)
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/elfxx-ia64.c binutils-2.14.90.0.7/bfd/elfxx-ia64.c
+--- binutils-2.14.90.0.7.orig/bfd/elfxx-ia64.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/elfxx-ia64.c 2004-04-20 01:26:12.000000000 -0600
+@@ -3849,9 +3849,11 @@
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ /* Reloc against local symbol. */
++ asection *msec;
+ sym = local_syms + r_symndx;
+ sym_sec = local_sections[r_symndx];
+- value = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
++ msec = sym_sec;
++ value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel);
+ if ((sym_sec->flags & SEC_MERGE)
+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION
+ && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE)
+@@ -3862,7 +3864,6 @@
+ if (loc_h && ! loc_h->sec_merge_done)
+ {
+ struct elfNN_ia64_dyn_sym_info *dynent;
+- asection *msec;
+
+ for (dynent = loc_h->info; dynent; dynent = dynent->next)
+ {
+diff -urN binutils-2.14.90.0.7.orig/bfd/opncls.c binutils-2.14.90.0.7/bfd/opncls.c
+--- binutils-2.14.90.0.7.orig/bfd/opncls.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/opncls.c 2004-04-20 01:26:11.000000000 -0600
+@@ -150,6 +150,13 @@
+ {
+ bfd *nbfd;
+ const bfd_target *target_vec;
++ struct stat s;
++
++ if (stat (filename, &s) == 0)
++ if (S_ISDIR(s.st_mode)) {
++ bfd_set_error (bfd_error_file_not_recognized);
++ return NULL;
++ }
+
+ nbfd = _bfd_new_bfd ();
+ if (nbfd == NULL)
+diff -urN binutils-2.14.90.0.7.orig/binutils/objcopy.c binutils-2.14.90.0.7/binutils/objcopy.c
+--- binutils-2.14.90.0.7.orig/binutils/objcopy.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/binutils/objcopy.c 2004-04-20 01:26:12.000000000 -0600
+@@ -27,6 +27,7 @@
+ #include "libiberty.h"
+ #include "budbg.h"
+ #include "filenames.h"
++#include "elf-bfd.h"
+ #include <sys/stat.h>
+
+ /* A list of symbols to explicitly strip out, or to keep. A linked
+@@ -385,6 +386,7 @@
+ -g --strip-debug Remove all debugging symbols & sections\n\
+ --strip-unneeded Remove all symbols not needed by relocations\n\
+ -N --strip-symbol <name> Do not copy symbol <name>\n\
++ --only-keep-debug Strip everything but the debug information\n\
+ -K --keep-symbol <name> Only copy symbol <name>\n\
+ -L --localize-symbol <name> Force symbol <name> to be marked as a local\n\
+ -G --keep-global-symbol <name> Localize all symbols except <name>\n\
+@@ -457,6 +459,7 @@
+ -s --strip-all Remove all symbol and relocation information\n\
+ -g -S -d --strip-debug Remove all debugging symbols & sections\n\
+ --strip-unneeded Remove all symbols not needed by relocations\n\
++ --only-keep-debug Strip everything but the debug information\n\
+ -N --strip-symbol=<name> Do not copy symbol <name>\n\
+ -K --keep-symbol=<name> Only copy symbol <name>\n\
+ -x --discard-all Remove all non-global symbols\n\
+@@ -734,7 +737,7 @@
+ return FALSE;
+ }
+
+- return strip_symbols == STRIP_NONDEBUG ? TRUE : FALSE;
++ return FALSE;
+ }
+
+ /* Choose which symbol entries to copy; put the result in OSYMS.
+@@ -1806,6 +1809,13 @@
+
+ if (p != NULL && p->set_flags)
+ flags = p->flags | (flags & (SEC_HAS_CONTENTS | SEC_RELOC));
++ else if (strip_symbols == STRIP_NONDEBUG && (flags & SEC_ALLOC) != 0)
++ {
++ flags &= ~(SEC_HAS_CONTENTS | SEC_LOAD);
++ if (obfd->xvec->flavour == bfd_target_elf_flavour)
++ elf_section_type (osection) = SHT_NOBITS;
++ }
++
+ if (!bfd_set_section_flags (obfd, osection, flags))
+ {
+ err = _("flags");
+@@ -1926,6 +1936,8 @@
+ }
+
+ bfd_set_reloc (obfd, osection, relcount == 0 ? NULL : relpp, relcount);
++ if (relcount == 0)
++ free (relpp);
+ }
+
+ isection->_cooked_size = isection->_raw_size;
+diff -urN binutils-2.14.90.0.7.orig/binutils/readelf.c binutils-2.14.90.0.7/binutils/readelf.c
+--- binutils-2.14.90.0.7.orig/binutils/readelf.c 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/binutils/readelf.c 2004-04-20 01:26:12.000000000 -0600
+@@ -6055,7 +6055,7 @@
+
+ bytes = section->sh_size;
+
+- if (bytes == 0)
++ if (bytes == 0 || section->sh_type == SHT_NOBITS)
+ {
+ printf (_("\nSection '%s' has no data to dump.\n"),
+ SECTION_NAME (section));
+diff -urN binutils-2.14.90.0.7.orig/gprof/gprof.texi binutils-2.14.90.0.7/gprof/gprof.texi
+--- binutils-2.14.90.0.7.orig/gprof/gprof.texi 2002-08-01 18:49:32.000000000 -0600
++++ binutils-2.14.90.0.7/gprof/gprof.texi 2004-04-20 01:26:11.000000000 -0600
+@@ -137,6 +137,10 @@
+ If more than one profile file is specified, the @code{gprof}
+ output shows the sum of the profile information in the given profile files.
+
++If you use gcc 2.95.x or 3.0 to compile your binaries, you may need
++to add the @samp{-fprofile-arcs} to the compile command line in order
++for the call graphs to be properly stored in gmon.out.
++
+ @code{Gprof} calculates the amount of time spent in each routine.
+ Next, these times are propagated along the edges of the call graph.
+ Cycles are discovered, and calls into a cycle are made to share the time
+@@ -181,7 +185,7 @@
+ @c man end
+
+ @c man begin SEEALSO
+-monitor(3), profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
++profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
+
+ ``An Execution Profiler for Modular Programs'',
+ by S. Graham, P. Kessler, M. McKusick;
+@@ -267,6 +271,11 @@
+ options. The same option, @samp{-pg}, alters either compilation or linking
+ to do what is necessary for profiling. Here are examples:
+
++If you use gcc 2.95.x or 3.0.x, you may need to add the
++@samp{-fprofile-arcs} option to the compile line along with @samp{-pg}
++in order to allow the call-graphs to be properly included in the gmon.out
++file.
++
+ @example
+ cc -g -c myprog.c utils.c -pg
+ cc -o myprog myprog.o utils.o -pg
+diff -urN binutils-2.14.90.0.7.orig/ld/Makefile.am binutils-2.14.90.0.7/ld/Makefile.am
+--- binutils-2.14.90.0.7.orig/ld/Makefile.am 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/ld/Makefile.am 2004-04-20 01:26:11.000000000 -0600
+@@ -19,7 +19,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+diff -urN binutils-2.14.90.0.7.orig/ld/Makefile.in binutils-2.14.90.0.7/ld/Makefile.in
+--- binutils-2.14.90.0.7.orig/ld/Makefile.in 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/ld/Makefile.in 2004-04-20 01:26:11.000000000 -0600
+@@ -128,7 +128,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+diff -urN binutils-2.14.90.0.7.orig/ld/emultempl/elf32.em binutils-2.14.90.0.7/ld/emultempl/elf32.em
+--- binutils-2.14.90.0.7.orig/ld/emultempl/elf32.em 2003-08-21 09:28:48.000000000 -0600
++++ binutils-2.14.90.0.7/ld/emultempl/elf32.em 2004-04-20 01:26:11.000000000 -0600
+@@ -679,6 +679,8 @@
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
++ if ((lib_path) && (strlen (lib_path) == 0))
++ lib_path = NULL;
+ if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
+ force))
+ break;
+@@ -855,6 +857,8 @@
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (strlen (rpath) == 0))
++ rpath = NULL;
+ if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
+ (output_bfd, command_line.soname, rpath,
+ command_line.filter_shlib,
+diff -urN binutils-2.14.90.0.7.orig/ltmain.sh binutils-2.14.90.0.7/ltmain.sh
+--- binutils-2.14.90.0.7.orig/ltmain.sh 2002-03-22 15:06:16.000000000 -0700
++++ binutils-2.14.90.0.7/ltmain.sh 2004-04-20 01:26:12.000000000 -0600
+@@ -4413,6 +4413,10 @@
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
++ if test -n "$linkname"; then
++ $show "(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)"
++ $run eval '(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)' || exit $?
++ fi
+ ;;
+ esac
+ exit 0
+diff -urN binutils-2.14.90.0.7.orig/opcodes/Makefile.am binutils-2.14.90.0.7/opcodes/Makefile.am
+--- binutils-2.14.90.0.7.orig/opcodes/Makefile.am 2003-10-29 10:37:49.000000000 -0700
++++ binutils-2.14.90.0.7/opcodes/Makefile.am 2004-04-20 01:26:12.000000000 -0600
+@@ -284,7 +284,7 @@
+
+ libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c
+ libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
+-libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
++libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ -L../bfd -lbfd
+ libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
+
+ # libtool will build .libs/libopcodes.a. We create libopcodes.a in
+diff -urN binutils-2.14.90.0.7.orig/opcodes/Makefile.in binutils-2.14.90.0.7/opcodes/Makefile.in
+--- binutils-2.14.90.0.7.orig/opcodes/Makefile.in 2003-10-29 10:37:49.000000000 -0700
++++ binutils-2.14.90.0.7/opcodes/Makefile.in 2004-04-20 01:26:12.000000000 -0600
+@@ -394,7 +394,7 @@
+
+ libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c
+ libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
+-libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
++libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ -L../bfd -lbfd
+ libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
+
+ # libtool will build .libs/libopcodes.a. We create libopcodes.a in
+@@ -593,7 +593,7 @@
+ all-recursive install-data-recursive install-exec-recursive \
+ installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
+ check-recursive installcheck-recursive info-recursive dvi-recursive:
+- @set fnord $(MAKEFLAGS); amf=$$2; \
++ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+@@ -613,7 +613,7 @@
+
+ mostlyclean-recursive clean-recursive distclean-recursive \
+ maintainer-clean-recursive:
+- @set fnord $(MAKEFLAGS); amf=$$2; \
++ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+diff -urN binutils-2.14.90.0.7.orig/opcodes/alpha-opc.c binutils-2.14.90.0.7/opcodes/alpha-opc.c
+--- binutils-2.14.90.0.7.orig/opcodes/alpha-opc.c 2003-01-21 11:21:34.000000000 -0700
++++ binutils-2.14.90.0.7/opcodes/alpha-opc.c 2004-04-20 01:26:11.000000000 -0600
+@@ -1105,7 +1105,8 @@
+ { "wmb", MFC(0x18,0x4400), BASE, ARG_NONE },
+ { "fetch", MFC(0x18,0x8000), BASE, { ZA, PRB } },
+ { "fetch_m", MFC(0x18,0xA000), BASE, { ZA, PRB } },
+- { "rpcc", MFC(0x18,0xC000), BASE, { RA } },
++ { "rpcc", MFC(0x18,0xC000), BASE, { RA, ZB } },
++ { "rpcc", MFC(0x18,0xC000), BASE, { RA, RB } }, /* ev6 una */
+ { "rc", MFC(0x18,0xE000), BASE, { RA } },
+ { "ecb", MFC(0x18,0xE800), BASE, { ZA, PRB } }, /* ev56 una */
+ { "rs", MFC(0x18,0xF000), BASE, { RA } },
+diff -urN binutils-2.14.90.0.7.orig/opcodes/m68k-opc.c binutils-2.14.90.0.7/opcodes/m68k-opc.c
+--- binutils-2.14.90.0.7.orig/opcodes/m68k-opc.c 2003-10-29 10:37:49.000000000 -0700
++++ binutils-2.14.90.0.7/opcodes/m68k-opc.c 2004-04-20 01:26:12.000000000 -0600
+@@ -847,15 +847,15 @@
+ {"fmoved", two(0xF000, 0x7400), two(0xF1C0, 0xFC7F), "IiF7ws", cfloat },
+ {"fmovel", two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+ {"fmovel", two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7$l", mfloat },
++/* FIXME: the next two variants should not permit moving an address
++ register to anything but the floating point instruction register. */
++{"fmovel", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
++{"fmovel", two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ls8", mfloat },
+ {"fmovel", two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+ {"fmovel", two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7bs", cfloat },
+ /* Move the FP control registers */
+ {"fmovel", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8ps", cfloat },
+ {"fmovel", two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Iibss8", cfloat },
+-/* FIXME: the next two variants should not permit moving an address
+- register to anything but the floating point instruction register. */
+-{"fmovel", two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
+-{"fmovel", two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ls8", mfloat },
+ {"fmovep", two(0xF000, 0x4C00), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+ {"fmovep", two(0xF000, 0x6C00), two(0xF1C0, 0xFC00), "IiF7~pkC", mfloat },
+ {"fmovep", two(0xF000, 0x7C00), two(0xF1C0, 0xFC0F), "IiF7~pDk", mfloat },
--- /dev/null
+diff -urN binutils-2.14.90.0.7.orig/bfd/config.bfd binutils-2.14.90.0.7/bfd/config.bfd
+--- binutils-2.14.90.0.7.orig/bfd/config.bfd 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/config.bfd 2004-04-20 01:37:12.000000000 -0600
+@@ -121,7 +121,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -131,7 +131,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-linux-uclibc* | ia64*-*-kfreebsd*-gnu)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -214,7 +214,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -222,7 +222,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux* | arm-*-kfreebsd*-gnu)
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux* | arm*-*-linux-uclibc* | arm-*-kfreebsd*-gnu)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+@@ -355,7 +355,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -366,7 +366,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-netbsd* | hppa*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -488,7 +488,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -502,7 +502,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -662,7 +662,7 @@
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_m68k_vec
+ targ_selvecs=m68klinux_vec
+ ;;
+@@ -929,7 +929,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -961,8 +962,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1110,7 +1111,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1157,7 +1158,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+diff -urN binutils-2.14.90.0.7.orig/bfd/configure binutils-2.14.90.0.7/bfd/configure
+--- binutils-2.14.90.0.7.orig/bfd/configure 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/configure 2004-04-20 01:32:29.000000000 -0600
+@@ -1699,6 +1699,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5278,7 +5283,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5338,7 +5343,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5388,7 +5393,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+diff -urN binutils-2.14.90.0.7.orig/bfd/configure.in binutils-2.14.90.0.7/bfd/configure.in
+--- binutils-2.14.90.0.7.orig/bfd/configure.in 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/bfd/configure.in 2004-04-20 01:32:29.000000000 -0600
+@@ -178,7 +178,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -259,7 +259,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -312,7 +312,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+diff -urN binutils-2.14.90.0.7.orig/config.sub binutils-2.14.90.0.7/config.sub
+--- binutils-2.14.90.0.7.orig/config.sub 2003-08-21 09:28:47.000000000 -0600
++++ binutils-2.14.90.0.7/config.sub 2004-04-20 01:32:29.000000000 -0600
+@@ -118,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
++ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -1131,7 +1131,8 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+diff -urN binutils-2.14.90.0.7.orig/configure binutils-2.14.90.0.7/configure
+--- binutils-2.14.90.0.7.orig/configure 2003-10-29 10:38:23.000000000 -0700
++++ binutils-2.14.90.0.7/configure 2004-04-20 01:32:29.000000000 -0600
+@@ -1276,6 +1276,18 @@
+ i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[3456789]86-*-linux-uclibc)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[3456789]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.14.90.0.7.orig/configure.in binutils-2.14.90.0.7/configure.in
+--- binutils-2.14.90.0.7.orig/configure.in 2003-10-29 10:38:20.000000000 -0700
++++ binutils-2.14.90.0.7/configure.in 2004-04-20 01:32:29.000000000 -0600
+@@ -515,6 +515,19 @@
+ i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[3456789]86-*-linux-uclibc)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ build_modules=
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[[3456789]]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.14.90.0.7.orig/demangler/configure binutils-2.14.90.0.7/demangler/configure
+--- binutils-2.14.90.0.7.orig/demangler/configure 2003-10-29 10:38:20.000000000 -0700
++++ binutils-2.14.90.0.7/demangler/configure 2004-04-20 01:32:29.000000000 -0600
+@@ -1380,6 +1380,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.14.90.0.7.orig/gas/configure binutils-2.14.90.0.7/gas/configure
+--- binutils-2.14.90.0.7.orig/gas/configure 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/gas/configure 2004-04-20 01:37:58.000000000 -0600
+@@ -3215,6 +3215,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -4028,6 +4033,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -4044,6 +4050,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -4058,6 +4065,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -4114,7 +4122,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ i386-*-sysv[45]*) fmt=elf ;;
+ i386-*-solaris*) fmt=elf ;;
+@@ -4175,6 +4185,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -4201,6 +4212,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+ m68k-*-netbsdelf*) fmt=elf em=nbsd ;;
+@@ -4257,7 +4269,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
+- ppc-*-linux-gnu*) fmt=elf em=linux
++ ppc-*-linux-uclibc* | ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+ *) { { echo "$as_me:$LINENO: error: GNU/Linux must be configured big endian" >&5
+@@ -4286,7 +4298,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -4319,6 +4333,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.14.90.0.7.orig/gas/configure.in binutils-2.14.90.0.7/gas/configure.in
+--- binutils-2.14.90.0.7.orig/gas/configure.in 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/gas/configure.in 2004-04-20 01:38:23.000000000 -0600
+@@ -192,6 +192,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -208,6 +209,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -222,6 +224,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -278,7 +281,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ changequote(,)dnl
+ i386-*-sysv[45]*) fmt=elf ;;
+@@ -332,6 +337,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -358,6 +364,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+ m68k-*-netbsdelf*) fmt=elf em=nbsd ;;
+@@ -412,7 +419,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
+- ppc-*-linux-gnu*) fmt=elf em=linux
++ ppc-*-linux-uclibc* | ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+ *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;;
+@@ -434,7 +441,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -467,6 +476,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.14.90.0.7.orig/ld/configure binutils-2.14.90.0.7/ld/configure
+--- binutils-2.14.90.0.7.orig/ld/configure 2003-05-05 15:46:49.000000000 -0600
++++ binutils-2.14.90.0.7/ld/configure 2004-04-20 01:32:29.000000000 -0600
+@@ -1578,6 +1578,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.14.90.0.7.orig/ld/configure.tgt binutils-2.14.90.0.7/ld/configure.tgt
+--- binutils-2.14.90.0.7.orig/ld/configure.tgt 2003-10-29 10:37:48.000000000 -0700
++++ binutils-2.14.90.0.7/ld/configure.tgt 2004-04-20 01:32:29.000000000 -0600
+@@ -30,6 +30,7 @@
+ targ_extra_emuls="criself crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ cris-*-linux-gnu*) targ_emul=crislinux ;;
++cris-*-linux-uclibc*) targ_emul=crislinux ;;
+ cris-*-*) targ_emul=criself
+ targ_extra_emuls="crisaout crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+@@ -59,14 +60,16 @@
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
++ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
++ targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+@@ -125,7 +128,7 @@
+ m68*-ericsson-ose) targ_emul=sun3 ;;
+ m68*-apple-aux*) targ_emul=m68kaux ;;
+ *-tandem-none) targ_emul=st2000 ;;
+-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
+ i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+ i[3-7]86-*-vsta) targ_emul=vsta ;;
+ i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+@@ -149,14 +152,16 @@
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+ i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
++ targ_emul=elf_i386
+ targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+ tdir_i386linux=${targ_alias}aout
+ ;;
+-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
++ targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386linux"
+ targ_extra_libpath=elf_i386
+ tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
+@@ -256,10 +261,13 @@
+ arm9e-*-elf) targ_emul=armelf ;;
+ arm-*-oabi) targ_emul=armelf_oabi ;;
+ arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+ arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-conix*) targ_emul=armelf ;;
+-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ strongarm-*-coff) targ_emul=armcoff ;;
+ strongarm-*-elf) targ_emul=armelf ;;
+ strongarm-*-kaos*) targ_emul=armelf ;;
+@@ -360,7 +368,8 @@
+ targ_extra_emuls=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+-m68k-*-linux-gnu*) targ_emul=m68kelf
++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
++ targ_emul=m68kelf
+ targ_extra_emuls=m68klinux
+ tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
+ ;;
+@@ -376,9 +385,9 @@
+ m68*-*-psos*) targ_emul=m68kpsos ;;
+ m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
+ m68*-*-rtems*) targ_emul=m68kelf ;;
+-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
+ hppa*64*-*) targ_emul=elf64hppa ;;
+-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
+ hppa*-*-*elf*) targ_emul=hppaelf ;;
+ hppa*-*-lites*) targ_emul=hppaelf ;;
+ hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+@@ -422,16 +431,20 @@
+ mips*-*-rtems*) targ_emul=elf32ebmip ;;
+ mips*el-*-vxworks*) targ_emul=elf32elmip ;;
+ mips*-*-vxworks*) targ_emul=elf32ebmip ;;
+-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) \
++ targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) \
++ targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
+-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) \
++ targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
+-mips*-*-linux-gnu*) targ_emul=elf32btsmip
++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) \
++ targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
+ ;;
+ mips*-*-lnews*) targ_emul=mipslnews ;;
+@@ -454,6 +467,10 @@
+ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+ ;;
++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
++ # The following needs to be checked...
++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
++ ;;
+ alpha*-*-osf*) targ_emul=alpha ;;
+ alpha*-*-gnu*) targ_emul=elf64alpha ;;
+ alpha*-*-netware*) targ_emul=alpha ;;
+diff -urN binutils-2.14.90.0.7.orig/libtool.m4 binutils-2.14.90.0.7/libtool.m4
+--- binutils-2.14.90.0.7.orig/libtool.m4 2003-05-05 15:46:46.000000000 -0600
++++ binutils-2.14.90.0.7/libtool.m4 2004-04-20 01:32:29.000000000 -0600
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN binutils-2.14.90.0.7.orig/ltconfig binutils-2.14.90.0.7/ltconfig
+--- binutils-2.14.90.0.7.orig/ltconfig 2003-10-29 10:37:47.000000000 -0700
++++ binutils-2.14.90.0.7/ltconfig 2004-04-20 01:32:29.000000000 -0600
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1260,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
--- /dev/null
+Get around an odd build failure.
+diff -urN binutils-2.14.90.0.6/configure binutils-2.14.90.0.6-uClibc/configure
+--- binutils-2.14.90.0.6/configure 2003-08-21 10:29:32.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/configure 2004-01-07 05:43:40.000000000 -0600
+@@ -906,6 +906,11 @@
+ fi
+
+
++case "$target" in
++ *-*-*-uclibc*)
++ build_modules=
++ ;;
++esac
+ ################################################################################
+
+ srcname="gnu development package"
+diff -urN binutils-2.14.90.0.6/configure.in binutils-2.14.90.0.6-uClibc/configure.in
+--- binutils-2.14.90.0.6/configure.in 2003-08-21 10:29:30.000000000 -0500
++++ binutils-2.14.90.0.6-uClibc/configure.in 2004-01-07 05:44:02.000000000 -0600
+@@ -178,6 +178,11 @@
+ fi
+
+
++case "$target" in
++ *-*-*-uclibc*)
++ build_modules=
++ ;;
++esac
+ ################################################################################
+
+ srcname="gnu development package"
--- /dev/null
+diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.am binutils-2.14.90.0.6.new/bfd/doc/Makefile.am
+--- binutils-2.14.90.0.6/bfd/doc/Makefile.am 2003-07-23 10:08:09.000000000 -0500
++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.am 2004-03-01 16:05:16.000000000 -0600
+@@ -55,10 +55,10 @@
+ MKDOC = chew$(EXEEXT_FOR_BUILD)
+
+ $(MKDOC): chew.o
+- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
+
+ chew.o: chew.c
+- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
+
+ protos: libbfd.h libcoff.h bfd.h
+
+diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.in binutils-2.14.90.0.6.new/bfd/doc/Makefile.in
+--- binutils-2.14.90.0.6/bfd/doc/Makefile.in 2003-07-23 10:08:09.000000000 -0500
++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.in 2004-03-01 16:05:03.000000000 -0600
+@@ -469,10 +469,10 @@
+
+
+ $(MKDOC): chew.o
+- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
+
+ chew.o: chew.c
+- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
+
+ protos: libbfd.h libcoff.h bfd.h
+
--- /dev/null
+diff -urN binutils-2.14.90.0.8-dist/bfd/elf64-alpha.c binutils-2.14.90.0.8/bfd/elf64-alpha.c
+--- binutils-2.14.90.0.8-dist/bfd/elf64-alpha.c 2004-01-14 15:07:43.000000000 -0600
++++ binutils-2.14.90.0.8/bfd/elf64-alpha.c 2004-02-11 03:42:05.000000000 -0600
+@@ -4144,9 +4144,12 @@
+
+ loc = srel->contents;
+ loc += srel->reloc_count++ * sizeof (Elf64_External_Rela);
+- bfd_elf64_swap_reloca_out (abfd, &outrel, loc);
+- BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
+- <= srel->_cooked_size);
++ if (loc)
++ {
++ bfd_elf64_swap_reloca_out (abfd, &outrel, loc);
++ BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
++ <= srel->_cooked_size);
++ }
+ }
+
+ /* Relocate an Alpha ELF section for a relocatable link.
+diff -urN binutils-2.14.90.0.8-dist/bfd/opncls.c binutils-2.14.90.0.8/bfd/opncls.c
+--- binutils-2.14.90.0.8-dist/bfd/opncls.c 2004-01-14 15:07:43.000000000 -0600
++++ binutils-2.14.90.0.8/bfd/opncls.c 2004-02-11 03:42:01.000000000 -0600
+@@ -150,6 +150,13 @@
+ {
+ bfd *nbfd;
+ const bfd_target *target_vec;
++ struct stat s;
++
++ if (stat (filename, &s) == 0)
++ if (S_ISDIR(s.st_mode)) {
++ bfd_set_error (bfd_error_file_not_recognized);
++ return NULL;
++ }
+
+ nbfd = _bfd_new_bfd ();
+ if (nbfd == NULL)
+diff -urN binutils-2.14.90.0.8-dist/gprof/gprof.texi binutils-2.14.90.0.8/gprof/gprof.texi
+--- binutils-2.14.90.0.8-dist/gprof/gprof.texi 2004-01-14 15:07:51.000000000 -0600
++++ binutils-2.14.90.0.8/gprof/gprof.texi 2004-02-11 03:42:01.000000000 -0600
+@@ -138,6 +138,10 @@
+ If more than one profile file is specified, the @code{gprof}
+ output shows the sum of the profile information in the given profile files.
+
++If you use gcc 2.95.x or 3.0 to compile your binaries, you may need
++to add the @samp{-fprofile-arcs} to the compile command line in order
++for the call graphs to be properly stored in gmon.out.
++
+ @code{Gprof} calculates the amount of time spent in each routine.
+ Next, these times are propagated along the edges of the call graph.
+ Cycles are discovered, and calls into a cycle are made to share the time
+@@ -182,7 +186,7 @@
+ @c man end
+
+ @c man begin SEEALSO
+-monitor(3), profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
++profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
+
+ ``An Execution Profiler for Modular Programs'',
+ by S. Graham, P. Kessler, M. McKusick;
+@@ -268,6 +272,11 @@
+ options. The same option, @samp{-pg}, alters either compilation or linking
+ to do what is necessary for profiling. Here are examples:
+
++If you use gcc 2.95.x or 3.0.x, you may need to add the
++@samp{-fprofile-arcs} option to the compile line along with @samp{-pg}
++in order to allow the call-graphs to be properly included in the gmon.out
++file.
++
+ @example
+ cc -g -c myprog.c utils.c -pg
+ cc -o myprog myprog.o utils.o -pg
+diff -urN binutils-2.14.90.0.8-dist/ld/Makefile.am binutils-2.14.90.0.8/ld/Makefile.am
+--- binutils-2.14.90.0.8-dist/ld/Makefile.am 2004-01-14 15:07:52.000000000 -0600
++++ binutils-2.14.90.0.8/ld/Makefile.am 2004-02-11 03:42:01.000000000 -0600
+@@ -19,7 +19,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+diff -urN binutils-2.14.90.0.8-dist/ld/Makefile.in binutils-2.14.90.0.8/ld/Makefile.in
+--- binutils-2.14.90.0.8-dist/ld/Makefile.in 2004-01-14 15:07:52.000000000 -0600
++++ binutils-2.14.90.0.8/ld/Makefile.in 2004-02-11 03:42:01.000000000 -0600
+@@ -128,7 +128,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+diff -urN binutils-2.14.90.0.8-dist/ld/emultempl/elf32.em binutils-2.14.90.0.8/ld/emultempl/elf32.em
+--- binutils-2.14.90.0.8-dist/ld/emultempl/elf32.em 2004-01-14 15:07:53.000000000 -0600
++++ binutils-2.14.90.0.8/ld/emultempl/elf32.em 2004-02-11 03:42:01.000000000 -0600
+@@ -671,6 +671,8 @@
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
++ if ((lib_path) && (strlen (lib_path) == 0))
++ lib_path = NULL;
+ if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
+ force))
+ break;
+@@ -850,6 +852,8 @@
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (strlen (rpath) == 0))
++ rpath = NULL;
+ if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
+ (output_bfd, command_line.soname, rpath,
+ command_line.filter_shlib,
+diff -urN binutils-2.14.90.0.8-dist/ltmain.sh binutils-2.14.90.0.8/ltmain.sh
+--- binutils-2.14.90.0.8-dist/ltmain.sh 2002-03-22 16:06:16.000000000 -0600
++++ binutils-2.14.90.0.8/ltmain.sh 2004-02-11 03:42:05.000000000 -0600
+@@ -4413,6 +4413,10 @@
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
++ if test -n "$linkname"; then
++ $show "(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)"
++ $run eval '(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)' || exit $?
++ fi
+ ;;
+ esac
+ exit 0
+diff -urN binutils-2.14.90.0.8-dist/opcodes/i386-dis.c binutils-2.14.90.0.8/opcodes/i386-dis.c
+--- binutils-2.14.90.0.8-dist/opcodes/i386-dis.c 2004-01-14 15:07:55.000000000 -0600
++++ binutils-2.14.90.0.8/opcodes/i386-dis.c 2004-02-11 03:42:01.000000000 -0600
+@@ -1879,7 +1879,7 @@
+ * The function returns the length of this instruction in bytes.
+ */
+
+-static char intel_syntax;
++static signed char intel_syntax;
+ static char open_char;
+ static char close_char;
+ static char separator_char;
--- /dev/null
+diff -urN binutils-2.14.90.0.8-001-debian/bfd/config.bfd binutils-2.14.90.0.8/bfd/config.bfd
+--- binutils-2.14.90.0.8-001-debian/bfd/config.bfd 2004-01-14 15:07:43.000000000 -0600
++++ binutils-2.14.90.0.8/bfd/config.bfd 2004-02-12 14:18:14.000000000 -0600
+@@ -121,7 +121,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -131,7 +131,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -208,7 +208,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -216,8 +216,8 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
+- arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \
++ arm*-*-conix* | arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+@@ -350,7 +350,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -361,7 +361,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -483,7 +483,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -497,7 +497,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -672,7 +672,7 @@
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_m68k_vec
+ targ_selvecs=m68klinux_vec
+ ;;
+@@ -952,7 +952,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -984,8 +985,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1141,7 +1142,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1188,7 +1189,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+diff -urN binutils-2.14.90.0.8-001-debian/bfd/configure binutils-2.14.90.0.8/bfd/configure
+--- binutils-2.14.90.0.8-001-debian/bfd/configure 2004-01-14 15:07:43.000000000 -0600
++++ binutils-2.14.90.0.8/bfd/configure 2004-02-12 14:09:10.000000000 -0600
+@@ -1699,6 +1699,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5278,7 +5283,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5338,7 +5343,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5388,7 +5393,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+diff -urN binutils-2.14.90.0.8-001-debian/bfd/configure.in binutils-2.14.90.0.8/bfd/configure.in
+--- binutils-2.14.90.0.8-001-debian/bfd/configure.in 2004-01-14 15:07:43.000000000 -0600
++++ binutils-2.14.90.0.8/bfd/configure.in 2004-02-12 14:09:10.000000000 -0600
+@@ -178,7 +178,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -259,7 +259,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -312,7 +312,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+diff -urN binutils-2.14.90.0.8-001-debian/config.sub binutils-2.14.90.0.8/config.sub
+--- binutils-2.14.90.0.8-001-debian/config.sub 2004-01-14 15:07:42.000000000 -0600
++++ binutils-2.14.90.0.8/config.sub 2004-02-12 14:09:10.000000000 -0600
+@@ -118,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
++ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -1131,7 +1131,8 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+diff -urN binutils-2.14.90.0.8-001-debian/configure binutils-2.14.90.0.8/configure
+--- binutils-2.14.90.0.8-001-debian/configure 2004-01-14 15:07:42.000000000 -0600
++++ binutils-2.14.90.0.8/configure 2004-02-12 14:09:10.000000000 -0600
+@@ -1273,6 +1273,18 @@
+ i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[3456789]86-*-linux-uclibc)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[3456789]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.14.90.0.8-001-debian/configure.in binutils-2.14.90.0.8/configure.in
+--- binutils-2.14.90.0.8-001-debian/configure.in 2004-01-14 15:07:42.000000000 -0600
++++ binutils-2.14.90.0.8/configure.in 2004-02-12 14:50:56.000000000 -0600
+@@ -512,6 +512,18 @@
+ i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[[3456789]]86-*-linux-uclibc)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[[3456789]]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.14.90.0.8-001-debian/gas/configure binutils-2.14.90.0.8/gas/configure
+--- binutils-2.14.90.0.8-001-debian/gas/configure 2004-01-14 15:07:45.000000000 -0600
++++ binutils-2.14.90.0.8/gas/configure 2004-02-12 14:57:43.000000000 -0600
+@@ -3215,6 +3215,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -4030,6 +4035,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -4046,6 +4052,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -4059,6 +4066,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -4115,7 +4123,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ i386-*-sysv[45]*) fmt=elf ;;
+ i386-*-solaris*) fmt=elf ;;
+@@ -4175,6 +4185,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -4202,6 +4213,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -4265,6 +4277,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -4292,7 +4305,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -4325,6 +4340,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.14.90.0.8-001-debian/gas/configure.in binutils-2.14.90.0.8/gas/configure.in
+--- binutils-2.14.90.0.8-001-debian/gas/configure.in 2004-01-14 15:07:45.000000000 -0600
++++ binutils-2.14.90.0.8/gas/configure.in 2004-02-12 14:21:06.000000000 -0600
+@@ -194,6 +194,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -210,6 +211,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -223,6 +225,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -279,7 +282,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ changequote(,)dnl
+ i386-*-sysv[45]*) fmt=elf ;;
+@@ -332,6 +337,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -359,6 +365,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -419,6 +426,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -439,7 +447,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -472,6 +482,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.14.90.0.8-001-debian/ld/configure binutils-2.14.90.0.8/ld/configure
+--- binutils-2.14.90.0.8-001-debian/ld/configure 2003-05-05 16:46:49.000000000 -0500
++++ binutils-2.14.90.0.8/ld/configure 2004-02-12 14:09:10.000000000 -0600
+@@ -1578,6 +1578,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.14.90.0.8-001-debian/ld/configure.tgt binutils-2.14.90.0.8/ld/configure.tgt
+--- binutils-2.14.90.0.8-001-debian/ld/configure.tgt 2004-01-14 15:07:52.000000000 -0600
++++ binutils-2.14.90.0.8/ld/configure.tgt 2004-02-12 14:14:12.000000000 -0600
+@@ -30,6 +30,7 @@
+ targ_extra_emuls="criself crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ cris-*-linux-gnu*) targ_emul=crislinux ;;
++cris-*-linux-uclibc*) targ_emul=crislinux ;;
+ cris-*-*) targ_emul=criself
+ targ_extra_emuls="crisaout crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+@@ -59,14 +60,16 @@
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
++ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
++ targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+@@ -128,7 +131,7 @@
+ m68*-ericsson-ose) targ_emul=sun3 ;;
+ m68*-apple-aux*) targ_emul=m68kaux ;;
+ *-tandem-none) targ_emul=st2000 ;;
+-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
+ i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+ i[3-7]86-*-vsta) targ_emul=vsta ;;
+ i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+@@ -152,14 +155,16 @@
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+ i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
++ targ_emul=elf_i386
+ targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+ tdir_i386linux=${targ_alias}aout
+ ;;
+-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
++ targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386linux"
+ targ_extra_libpath=elf_i386
+ tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
+@@ -259,10 +264,13 @@
+ arm9e-*-elf) targ_emul=armelf ;;
+ arm-*-oabi) targ_emul=armelf_oabi ;;
+ arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+ arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-conix*) targ_emul=armelf ;;
+-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ strongarm-*-coff) targ_emul=armcoff ;;
+ strongarm-*-elf) targ_emul=armelf ;;
+ strongarm-*-kaos*) targ_emul=armelf ;;
+@@ -363,7 +371,8 @@
+ targ_extra_emuls=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+-m68k-*-linux-gnu*) targ_emul=m68kelf
++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
++ targ_emul=m68kelf
+ targ_extra_emuls=m68klinux
+ tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
+ ;;
+@@ -380,9 +389,9 @@
+ m68*-*-psos*) targ_emul=m68kpsos ;;
+ m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
+ m68*-*-rtems*) targ_emul=m68kelf ;;
+-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
+ hppa*64*-*) targ_emul=elf64hppa ;;
+-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
+ hppa*-*-*elf*) targ_emul=hppaelf ;;
+ hppa*-*-lites*) targ_emul=hppaelf ;;
+ hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+@@ -429,16 +438,20 @@
+ mips*-*-vxworks*) targ_emul=elf32ebmip
+ targ_extra_emuls="elf32elmip" ;;
+ mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) \
++ targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) \
++ targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
+-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) \
++ targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
+-mips*-*-linux-gnu*) targ_emul=elf32btsmip
++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) \
++ targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
+ ;;
+ mips*-*-lnews*) targ_emul=mipslnews ;;
+@@ -461,6 +474,10 @@
+ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+ ;;
++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
++ # The following needs to be checked...
++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
++ ;;
+ alpha*-*-osf*) targ_emul=alpha ;;
+ alpha*-*-gnu*) targ_emul=elf64alpha ;;
+ alpha*-*-netware*) targ_emul=alpha ;;
+diff -urN binutils-2.14.90.0.8-001-debian/libtool.m4 binutils-2.14.90.0.8/libtool.m4
+--- binutils-2.14.90.0.8-001-debian/libtool.m4 2003-05-05 16:46:46.000000000 -0500
++++ binutils-2.14.90.0.8/libtool.m4 2004-02-12 14:09:10.000000000 -0600
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN binutils-2.14.90.0.8-001-debian/ltconfig binutils-2.14.90.0.8/ltconfig
+--- binutils-2.14.90.0.8-001-debian/ltconfig 2004-01-14 15:07:42.000000000 -0600
++++ binutils-2.14.90.0.8/ltconfig 2004-02-12 14:09:10.000000000 -0600
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1260,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
--- /dev/null
+diff -urN binutils-2.15.90.0.1.1-dist/bfd/config.bfd binutils-2.15.90.0.1.1/bfd/config.bfd
+--- binutils-2.15.90.0.1.1-dist/bfd/config.bfd 2004-01-14 15:07:43.000000000 -0600
++++ binutils-2.15.90.0.1.1/bfd/config.bfd 2004-08-06 17:29:55.000000000 -0500
+@@ -121,7 +121,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -131,7 +131,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -208,7 +208,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -216,7 +216,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
+ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+@@ -350,7 +350,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -361,7 +361,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -483,7 +483,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -497,7 +497,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -672,7 +672,7 @@
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_m68k_vec
+ targ_selvecs=m68klinux_vec
+ ;;
+@@ -952,7 +952,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -984,8 +985,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1141,7 +1142,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1188,7 +1189,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+@@ -1257,7 +1258,7 @@
+ targ_underscore=yes
+ ;;
+
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_vax_vec
+ ;;
+
+diff -urN binutils-2.15.90.0.1.1-dist/bfd/configure binutils-2.15.90.0.1.1/bfd/configure
+--- binutils-2.15.90.0.1.1-dist/bfd/configure 2004-03-05 19:18:21.000000000 -0600
++++ binutils-2.15.90.0.1.1/bfd/configure 2004-08-06 17:29:55.000000000 -0500
+@@ -1699,6 +1699,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5278,7 +5283,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5338,7 +5343,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5388,7 +5393,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -5489,7 +5494,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.90.0.1.1-dist/bfd/configure.in binutils-2.15.90.0.1.1/bfd/configure.in
+--- binutils-2.15.90.0.1.1-dist/bfd/configure.in 2004-03-05 19:18:21.000000000 -0600
++++ binutils-2.15.90.0.1.1/bfd/configure.in 2004-08-06 17:29:55.000000000 -0500
+@@ -178,7 +178,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -259,7 +259,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -312,7 +312,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -397,7 +397,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.90.0.1.1-dist/binutils/configure binutils-2.15.90.0.1.1/binutils/configure
+--- binutils-2.15.90.0.1.1-dist/binutils/configure 2004-01-14 15:07:44.000000000 -0600
++++ binutils-2.15.90.0.1.1/binutils/configure 2004-08-06 17:29:55.000000000 -0500
+@@ -1574,6 +1574,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.1.1-dist/configure binutils-2.15.90.0.1.1/configure
+--- binutils-2.15.90.0.1.1-dist/configure 2004-03-03 14:24:33.000000000 -0600
++++ binutils-2.15.90.0.1.1/configure 2004-08-06 17:29:55.000000000 -0500
+@@ -1288,6 +1288,18 @@
+ i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[3456789]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[3456789]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.90.0.1.1-dist/configure.in binutils-2.15.90.0.1.1/configure.in
+--- binutils-2.15.90.0.1.1-dist/configure.in 2004-03-03 14:24:33.000000000 -0600
++++ binutils-2.15.90.0.1.1/configure.in 2004-08-06 17:29:55.000000000 -0500
+@@ -521,6 +521,18 @@
+ i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[[3456789]]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[[3456789]]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.90.0.1.1-dist/gas/configure binutils-2.15.90.0.1.1/gas/configure
+--- binutils-2.15.90.0.1.1-dist/gas/configure 2004-03-05 19:18:21.000000000 -0600
++++ binutils-2.15.90.0.1.1/gas/configure 2004-08-06 17:29:55.000000000 -0500
+@@ -3401,6 +3401,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -4226,6 +4231,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -4242,6 +4248,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -4255,6 +4262,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -4311,7 +4319,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ i386-*-sysv[45]*) fmt=elf ;;
+ i386-*-solaris*) fmt=elf ;;
+@@ -4371,6 +4381,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -4398,6 +4409,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -4461,6 +4473,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -4488,7 +4501,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -4521,6 +4536,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.90.0.1.1-dist/gas/configure.in binutils-2.15.90.0.1.1/gas/configure.in
+--- binutils-2.15.90.0.1.1-dist/gas/configure.in 2004-01-14 15:07:45.000000000 -0600
++++ binutils-2.15.90.0.1.1/gas/configure.in 2004-08-06 17:29:55.000000000 -0500
+@@ -194,6 +194,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -210,6 +211,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -223,6 +225,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -279,7 +282,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ changequote(,)dnl
+ i386-*-sysv[45]*) fmt=elf ;;
+@@ -332,6 +337,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -359,6 +365,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -419,6 +426,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -439,7 +447,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -472,6 +482,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.90.0.1.1-dist/gprof/configure binutils-2.15.90.0.1.1/gprof/configure
+--- binutils-2.15.90.0.1.1-dist/gprof/configure 2004-01-14 15:07:51.000000000 -0600
++++ binutils-2.15.90.0.1.1/gprof/configure 2004-08-06 17:29:55.000000000 -0500
+@@ -1570,6 +1570,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.1.1-dist/ld/configure binutils-2.15.90.0.1.1/ld/configure
+--- binutils-2.15.90.0.1.1-dist/ld/configure 2003-05-05 16:46:49.000000000 -0500
++++ binutils-2.15.90.0.1.1/ld/configure 2004-08-06 17:29:55.000000000 -0500
+@@ -1578,6 +1578,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.1.1-dist/ld/configure.tgt binutils-2.15.90.0.1.1/ld/configure.tgt
+--- binutils-2.15.90.0.1.1-dist/ld/configure.tgt 2004-01-14 15:07:52.000000000 -0600
++++ binutils-2.15.90.0.1.1/ld/configure.tgt 2004-08-06 17:29:55.000000000 -0500
+@@ -30,6 +30,7 @@
+ targ_extra_emuls="criself crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ cris-*-linux-gnu*) targ_emul=crislinux ;;
++cris-*-linux-uclibc*) targ_emul=crislinux ;;
+ cris-*-*) targ_emul=criself
+ targ_extra_emuls="crisaout crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+@@ -59,14 +60,16 @@
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
++ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
++ targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+@@ -118,7 +121,9 @@
+ m32r*le-*-elf*) targ_emul=m32rlelf ;;
+ m32r*-*-elf*) targ_emul=m32relf ;;
+ m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;;
++m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
+ m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;;
++m32r*-*-linux-uclibc*) targ_emul=m32relf_linux ;;
+ m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
+ targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
+ m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
+@@ -128,7 +133,7 @@
+ m68*-ericsson-ose) targ_emul=sun3 ;;
+ m68*-apple-aux*) targ_emul=m68kaux ;;
+ *-tandem-none) targ_emul=st2000 ;;
+-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
+ i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+ i[3-7]86-*-vsta) targ_emul=vsta ;;
+ i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+@@ -152,14 +157,16 @@
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+ i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
++ targ_emul=elf_i386
+ targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+ tdir_i386linux=${targ_alias}aout
+ ;;
+-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
++ targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386linux"
+ targ_extra_libpath=elf_i386
+ tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
+@@ -259,10 +266,13 @@
+ arm9e-*-elf) targ_emul=armelf ;;
+ arm-*-oabi) targ_emul=armelf_oabi ;;
+ arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+ arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-conix*) targ_emul=armelf ;;
+-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ strongarm-*-coff) targ_emul=armcoff ;;
+ strongarm-*-elf) targ_emul=armelf ;;
+ strongarm-*-kaos*) targ_emul=armelf ;;
+@@ -363,7 +373,8 @@
+ targ_extra_emuls=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+-m68k-*-linux-gnu*) targ_emul=m68kelf
++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
++ targ_emul=m68kelf
+ targ_extra_emuls=m68klinux
+ tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
+ ;;
+@@ -380,9 +391,9 @@
+ m68*-*-psos*) targ_emul=m68kpsos ;;
+ m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
+ m68*-*-rtems*) targ_emul=m68kelf ;;
+-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
+ hppa*64*-*) targ_emul=elf64hppa ;;
+-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
+ hppa*-*-*elf*) targ_emul=hppaelf ;;
+ hppa*-*-lites*) targ_emul=hppaelf ;;
+ hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+@@ -395,6 +406,7 @@
+ targ_emul=vaxnbsd
+ targ_extra_emuls=elf32vax ;;
+ vax-*-linux-gnu*) targ_emul=elf32vax ;;
++vax-*-linux-uclibc*) targ_emul=elf32vax ;;
+ mips*-*-pe) targ_emul=mipspe ;
+ targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+ mips*-dec-ultrix*) targ_emul=mipslit ;;
+@@ -429,16 +441,16 @@
+ mips*-*-vxworks*) targ_emul=elf32ebmip
+ targ_extra_emuls="elf32elmip" ;;
+ mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
+-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
+-mips*-*-linux-gnu*) targ_emul=elf32btsmip
++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
+ ;;
+ mips*-*-lnews*) targ_emul=mipslnews ;;
+@@ -461,6 +473,10 @@
+ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+ ;;
++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
++ # The following needs to be checked...
++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
++ ;;
+ alpha*-*-osf*) targ_emul=alpha ;;
+ alpha*-*-gnu*) targ_emul=elf64alpha ;;
+ alpha*-*-netware*) targ_emul=alpha ;;
+diff -urN binutils-2.15.90.0.1.1-dist/libtool.m4 binutils-2.15.90.0.1.1/libtool.m4
+--- binutils-2.15.90.0.1.1-dist/libtool.m4 2003-05-05 16:46:46.000000000 -0500
++++ binutils-2.15.90.0.1.1/libtool.m4 2004-08-06 17:29:55.000000000 -0500
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN binutils-2.15.90.0.1.1-dist/ltconfig binutils-2.15.90.0.1.1/ltconfig
+--- binutils-2.15.90.0.1.1-dist/ltconfig 2004-01-14 15:07:42.000000000 -0600
++++ binutils-2.15.90.0.1.1/ltconfig 2004-08-06 17:29:55.000000000 -0500
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1260,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
+diff -urN binutils-2.15.90.0.1.1-dist/opcodes/configure binutils-2.15.90.0.1.1/opcodes/configure
+--- binutils-2.15.90.0.1.1-dist/opcodes/configure 2004-01-14 15:07:54.000000000 -0600
++++ binutils-2.15.90.0.1.1/opcodes/configure 2004-08-06 17:29:55.000000000 -0500
+@@ -1689,6 +1689,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- /dev/null
+diff -urN binutils-2.15.90.0.1-dist/bfd/config.bfd binutils-2.15.90.0.1/bfd/config.bfd
+--- binutils-2.15.90.0.1-dist/bfd/config.bfd 2004-01-14 15:07:43.000000000 -0600
++++ binutils-2.15.90.0.1/bfd/config.bfd 2004-08-06 17:39:55.000000000 -0500
+@@ -121,7 +121,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -131,7 +131,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -208,7 +208,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -216,7 +216,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
+ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+@@ -350,7 +350,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -361,7 +361,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -483,7 +483,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -497,7 +497,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -672,7 +672,7 @@
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_m68k_vec
+ targ_selvecs=m68klinux_vec
+ ;;
+@@ -952,7 +952,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -984,8 +985,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1141,7 +1142,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1188,7 +1189,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+@@ -1257,7 +1258,7 @@
+ targ_underscore=yes
+ ;;
+
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_vax_vec
+ ;;
+
+diff -urN binutils-2.15.90.0.1-dist/bfd/configure binutils-2.15.90.0.1/bfd/configure
+--- binutils-2.15.90.0.1-dist/bfd/configure 2004-03-03 14:24:33.000000000 -0600
++++ binutils-2.15.90.0.1/bfd/configure 2004-08-06 17:39:55.000000000 -0500
+@@ -1699,6 +1699,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5278,7 +5283,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5338,7 +5343,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5388,7 +5393,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -5489,7 +5494,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.90.0.1-dist/bfd/configure.in binutils-2.15.90.0.1/bfd/configure.in
+--- binutils-2.15.90.0.1-dist/bfd/configure.in 2004-03-03 14:24:33.000000000 -0600
++++ binutils-2.15.90.0.1/bfd/configure.in 2004-08-06 17:39:55.000000000 -0500
+@@ -178,7 +178,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -259,7 +259,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -312,7 +312,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -397,7 +397,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.90.0.1-dist/binutils/configure binutils-2.15.90.0.1/binutils/configure
+--- binutils-2.15.90.0.1-dist/binutils/configure 2004-01-14 15:07:44.000000000 -0600
++++ binutils-2.15.90.0.1/binutils/configure 2004-08-06 17:39:55.000000000 -0500
+@@ -1574,6 +1574,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.1-dist/configure binutils-2.15.90.0.1/configure
+--- binutils-2.15.90.0.1-dist/configure 2004-03-03 14:24:33.000000000 -0600
++++ binutils-2.15.90.0.1/configure 2004-08-06 17:39:55.000000000 -0500
+@@ -1288,6 +1288,18 @@
+ i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[3456789]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[3456789]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.90.0.1-dist/configure.in binutils-2.15.90.0.1/configure.in
+--- binutils-2.15.90.0.1-dist/configure.in 2004-03-03 14:24:33.000000000 -0600
++++ binutils-2.15.90.0.1/configure.in 2004-08-06 17:39:55.000000000 -0500
+@@ -521,6 +521,18 @@
+ i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[[3456789]]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[[3456789]]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.90.0.1-dist/gas/configure binutils-2.15.90.0.1/gas/configure
+--- binutils-2.15.90.0.1-dist/gas/configure 2004-01-14 15:07:45.000000000 -0600
++++ binutils-2.15.90.0.1/gas/configure 2004-08-06 17:39:55.000000000 -0500
+@@ -3215,6 +3215,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -4030,6 +4035,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -4046,6 +4052,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -4059,6 +4066,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -4115,7 +4123,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ i386-*-sysv[45]*) fmt=elf ;;
+ i386-*-solaris*) fmt=elf ;;
+@@ -4175,6 +4185,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -4202,6 +4213,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -4265,6 +4277,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -4292,7 +4305,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -4325,6 +4340,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.90.0.1-dist/gas/configure.in binutils-2.15.90.0.1/gas/configure.in
+--- binutils-2.15.90.0.1-dist/gas/configure.in 2004-01-14 15:07:45.000000000 -0600
++++ binutils-2.15.90.0.1/gas/configure.in 2004-08-06 17:39:55.000000000 -0500
+@@ -194,6 +194,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -210,6 +211,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -223,6 +225,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -279,7 +282,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ changequote(,)dnl
+ i386-*-sysv[45]*) fmt=elf ;;
+@@ -332,6 +337,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -359,6 +365,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -419,6 +426,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -439,7 +447,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -472,6 +482,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.90.0.1-dist/gprof/configure binutils-2.15.90.0.1/gprof/configure
+--- binutils-2.15.90.0.1-dist/gprof/configure 2004-01-14 15:07:51.000000000 -0600
++++ binutils-2.15.90.0.1/gprof/configure 2004-08-06 17:39:55.000000000 -0500
+@@ -1570,6 +1570,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.1-dist/ld/configure binutils-2.15.90.0.1/ld/configure
+--- binutils-2.15.90.0.1-dist/ld/configure 2003-05-05 16:46:49.000000000 -0500
++++ binutils-2.15.90.0.1/ld/configure 2004-08-06 17:39:55.000000000 -0500
+@@ -1578,6 +1578,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.1-dist/ld/configure.tgt binutils-2.15.90.0.1/ld/configure.tgt
+--- binutils-2.15.90.0.1-dist/ld/configure.tgt 2004-01-14 15:07:52.000000000 -0600
++++ binutils-2.15.90.0.1/ld/configure.tgt 2004-08-06 17:39:55.000000000 -0500
+@@ -30,6 +30,7 @@
+ targ_extra_emuls="criself crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ cris-*-linux-gnu*) targ_emul=crislinux ;;
++cris-*-linux-uclibc*) targ_emul=crislinux ;;
+ cris-*-*) targ_emul=criself
+ targ_extra_emuls="crisaout crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+@@ -59,14 +60,16 @@
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
++ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
++ targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+@@ -118,7 +121,9 @@
+ m32r*le-*-elf*) targ_emul=m32rlelf ;;
+ m32r*-*-elf*) targ_emul=m32relf ;;
+ m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;;
++m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
+ m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;;
++m32r*-*-linux-uclibc*) targ_emul=m32relf_linux ;;
+ m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
+ targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
+ m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
+@@ -128,7 +133,7 @@
+ m68*-ericsson-ose) targ_emul=sun3 ;;
+ m68*-apple-aux*) targ_emul=m68kaux ;;
+ *-tandem-none) targ_emul=st2000 ;;
+-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
+ i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+ i[3-7]86-*-vsta) targ_emul=vsta ;;
+ i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+@@ -152,14 +157,16 @@
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+ i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
++ targ_emul=elf_i386
+ targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+ tdir_i386linux=${targ_alias}aout
+ ;;
+-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
++ targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386linux"
+ targ_extra_libpath=elf_i386
+ tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
+@@ -259,10 +266,13 @@
+ arm9e-*-elf) targ_emul=armelf ;;
+ arm-*-oabi) targ_emul=armelf_oabi ;;
+ arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+ arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-conix*) targ_emul=armelf ;;
+-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ strongarm-*-coff) targ_emul=armcoff ;;
+ strongarm-*-elf) targ_emul=armelf ;;
+ strongarm-*-kaos*) targ_emul=armelf ;;
+@@ -363,7 +373,8 @@
+ targ_extra_emuls=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+-m68k-*-linux-gnu*) targ_emul=m68kelf
++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
++ targ_emul=m68kelf
+ targ_extra_emuls=m68klinux
+ tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
+ ;;
+@@ -380,9 +391,9 @@
+ m68*-*-psos*) targ_emul=m68kpsos ;;
+ m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
+ m68*-*-rtems*) targ_emul=m68kelf ;;
+-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
+ hppa*64*-*) targ_emul=elf64hppa ;;
+-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
+ hppa*-*-*elf*) targ_emul=hppaelf ;;
+ hppa*-*-lites*) targ_emul=hppaelf ;;
+ hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+@@ -395,6 +406,7 @@
+ targ_emul=vaxnbsd
+ targ_extra_emuls=elf32vax ;;
+ vax-*-linux-gnu*) targ_emul=elf32vax ;;
++vax-*-linux-uclibc*) targ_emul=elf32vax ;;
+ mips*-*-pe) targ_emul=mipspe ;
+ targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+ mips*-dec-ultrix*) targ_emul=mipslit ;;
+@@ -429,16 +441,16 @@
+ mips*-*-vxworks*) targ_emul=elf32ebmip
+ targ_extra_emuls="elf32elmip" ;;
+ mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
+-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
+-mips*-*-linux-gnu*) targ_emul=elf32btsmip
++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
+ ;;
+ mips*-*-lnews*) targ_emul=mipslnews ;;
+@@ -461,6 +473,10 @@
+ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+ ;;
++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
++ # The following needs to be checked...
++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
++ ;;
+ alpha*-*-osf*) targ_emul=alpha ;;
+ alpha*-*-gnu*) targ_emul=elf64alpha ;;
+ alpha*-*-netware*) targ_emul=alpha ;;
+diff -urN binutils-2.15.90.0.1-dist/libtool.m4 binutils-2.15.90.0.1/libtool.m4
+--- binutils-2.15.90.0.1-dist/libtool.m4 2003-05-05 16:46:46.000000000 -0500
++++ binutils-2.15.90.0.1/libtool.m4 2004-08-06 17:39:55.000000000 -0500
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN binutils-2.15.90.0.1-dist/ltconfig binutils-2.15.90.0.1/ltconfig
+--- binutils-2.15.90.0.1-dist/ltconfig 2004-01-14 15:07:42.000000000 -0600
++++ binutils-2.15.90.0.1/ltconfig 2004-08-06 17:39:55.000000000 -0500
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1260,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
+diff -urN binutils-2.15.90.0.1-dist/opcodes/configure binutils-2.15.90.0.1/opcodes/configure
+--- binutils-2.15.90.0.1-dist/opcodes/configure 2004-01-14 15:07:54.000000000 -0600
++++ binutils-2.15.90.0.1/opcodes/configure 2004-08-06 17:39:55.000000000 -0500
+@@ -1689,6 +1689,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- /dev/null
+diff -urN binutils-2.15.90.0.3-dist/bfd/config.bfd binutils-2.15.90.0.3/bfd/config.bfd
+--- binutils-2.15.90.0.3-dist/bfd/config.bfd 2004-04-12 14:56:33.000000000 -0500
++++ binutils-2.15.90.0.3/bfd/config.bfd 2004-08-06 17:02:17.000000000 -0500
+@@ -126,7 +126,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -136,7 +136,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -213,7 +213,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -221,7 +221,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
+ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+@@ -360,7 +360,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -371,7 +371,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -494,7 +494,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -508,7 +508,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -683,7 +683,7 @@
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_m68k_vec
+ targ_selvecs=m68klinux_vec
+ ;;
+@@ -955,7 +955,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -987,8 +988,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1149,7 +1150,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1196,7 +1197,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+@@ -1265,7 +1266,7 @@
+ targ_underscore=yes
+ ;;
+
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_vax_vec
+ ;;
+
+diff -urN binutils-2.15.90.0.3-dist/bfd/configure binutils-2.15.90.0.3/bfd/configure
+--- binutils-2.15.90.0.3-dist/bfd/configure 2004-04-14 23:26:05.000000000 -0500
++++ binutils-2.15.90.0.3/bfd/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1699,6 +1699,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5278,7 +5283,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5338,7 +5343,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5376,7 +5381,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -5477,7 +5482,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.90.0.3-dist/bfd/configure.in binutils-2.15.90.0.3/bfd/configure.in
+--- binutils-2.15.90.0.3-dist/bfd/configure.in 2004-04-14 23:26:05.000000000 -0500
++++ binutils-2.15.90.0.3/bfd/configure.in 2004-08-06 17:02:17.000000000 -0500
+@@ -178,7 +178,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -259,7 +259,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -300,7 +300,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -385,7 +385,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.90.0.3-dist/binutils/configure binutils-2.15.90.0.3/binutils/configure
+--- binutils-2.15.90.0.3-dist/binutils/configure 2004-04-12 14:56:34.000000000 -0500
++++ binutils-2.15.90.0.3/binutils/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1575,6 +1575,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.3-dist/configure binutils-2.15.90.0.3/configure
+--- binutils-2.15.90.0.3-dist/configure 2004-04-12 14:56:33.000000000 -0500
++++ binutils-2.15.90.0.3/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1298,6 +1298,18 @@
+ i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[3456789]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[3456789]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.90.0.3-dist/configure.in binutils-2.15.90.0.3/configure.in
+--- binutils-2.15.90.0.3-dist/configure.in 2004-04-12 14:56:33.000000000 -0500
++++ binutils-2.15.90.0.3/configure.in 2004-08-06 17:02:17.000000000 -0500
+@@ -521,6 +521,18 @@
+ i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[[3456789]]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[[3456789]]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.90.0.3-dist/gas/configure binutils-2.15.90.0.3/gas/configure
+--- binutils-2.15.90.0.3-dist/gas/configure 2004-04-12 14:56:34.000000000 -0500
++++ binutils-2.15.90.0.3/gas/configure 2004-08-06 17:04:29.000000000 -0500
+@@ -3401,6 +3401,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -4226,6 +4231,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -4242,6 +4248,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -4255,6 +4262,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -4311,7 +4319,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ i386-*-sysv[45]*) fmt=elf ;;
+ i386-*-solaris*) fmt=elf ;;
+@@ -4371,6 +4381,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -4398,6 +4409,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -4460,6 +4472,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -4487,7 +4500,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -4520,6 +4535,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.90.0.3-dist/gas/configure.in binutils-2.15.90.0.3/gas/configure.in
+--- binutils-2.15.90.0.3-dist/gas/configure.in 2004-04-12 14:56:34.000000000 -0500
++++ binutils-2.15.90.0.3/gas/configure.in 2004-08-06 17:04:27.000000000 -0500
+@@ -194,6 +194,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -210,6 +211,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -223,6 +225,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -279,7 +282,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ changequote(,)dnl
+ i386-*-sysv[45]*) fmt=elf ;;
+@@ -332,6 +337,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -359,6 +365,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -418,6 +425,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -438,7 +446,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -471,6 +481,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.90.0.3-dist/gprof/configure binutils-2.15.90.0.3/gprof/configure
+--- binutils-2.15.90.0.3-dist/gprof/configure 2004-01-14 15:07:51.000000000 -0600
++++ binutils-2.15.90.0.3/gprof/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1570,6 +1570,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.3-dist/ld/configure binutils-2.15.90.0.3/ld/configure
+--- binutils-2.15.90.0.3-dist/ld/configure 2003-05-05 16:46:49.000000000 -0500
++++ binutils-2.15.90.0.3/ld/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1578,6 +1578,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.3-dist/ld/configure.tgt binutils-2.15.90.0.3/ld/configure.tgt
+--- binutils-2.15.90.0.3-dist/ld/configure.tgt 2004-04-12 14:56:35.000000000 -0500
++++ binutils-2.15.90.0.3/ld/configure.tgt 2004-08-06 17:02:17.000000000 -0500
+@@ -31,6 +31,7 @@
+ targ_extra_emuls="criself crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ cris-*-linux-gnu*) targ_emul=crislinux ;;
++cris-*-linux-uclibc*) targ_emul=crislinux ;;
+ cris-*-*) targ_emul=criself
+ targ_extra_emuls="crisaout crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+@@ -60,14 +61,16 @@
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
++ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
++ targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+@@ -119,7 +122,9 @@
+ m32r*le-*-elf*) targ_emul=m32rlelf ;;
+ m32r*-*-elf*) targ_emul=m32relf ;;
+ m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;;
++m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
+ m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;;
++m32r*-*-linux-uclibc*) targ_emul=m32relf_linux ;;
+ m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
+ targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
+ m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
+@@ -129,7 +134,7 @@
+ m68*-ericsson-ose) targ_emul=sun3 ;;
+ m68*-apple-aux*) targ_emul=m68kaux ;;
+ *-tandem-none) targ_emul=st2000 ;;
+-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
+ i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+ i[3-7]86-*-vsta) targ_emul=vsta ;;
+ i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+@@ -153,14 +158,16 @@
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+ i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
++ targ_emul=elf_i386
+ targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+ tdir_i386linux=${targ_alias}aout
+ ;;
+-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
++ targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386linux"
+ targ_extra_libpath=elf_i386
+ tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
+@@ -260,10 +267,13 @@
+ arm9e-*-elf) targ_emul=armelf ;;
+ arm-*-oabi) targ_emul=armelf_oabi ;;
+ arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+ arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-conix*) targ_emul=armelf ;;
+-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ strongarm-*-coff) targ_emul=armcoff ;;
+ strongarm-*-elf) targ_emul=armelf ;;
+ strongarm-*-kaos*) targ_emul=armelf ;;
+@@ -365,7 +375,8 @@
+ targ_extra_emuls=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+-m68k-*-linux-gnu*) targ_emul=m68kelf
++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
++ targ_emul=m68kelf
+ targ_extra_emuls=m68klinux
+ tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
+ ;;
+@@ -382,9 +393,9 @@
+ m68*-*-psos*) targ_emul=m68kpsos ;;
+ m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
+ m68*-*-rtems*) targ_emul=m68kelf ;;
+-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
+ hppa*64*-*) targ_emul=elf64hppa ;;
+-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
+ hppa*-*-*elf*) targ_emul=hppaelf ;;
+ hppa*-*-lites*) targ_emul=hppaelf ;;
+ hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+@@ -397,6 +408,7 @@
+ targ_emul=vaxnbsd
+ targ_extra_emuls=elf32vax ;;
+ vax-*-linux-gnu*) targ_emul=elf32vax ;;
++vax-*-linux-uclibc*) targ_emul=elf32vax ;;
+ mips*-*-pe) targ_emul=mipspe ;
+ targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+ mips*-dec-ultrix*) targ_emul=mipslit ;;
+@@ -430,16 +442,16 @@
+ mips*-*-vxworks*) targ_emul=elf32ebmip
+ targ_extra_emuls="elf32elmip" ;;
+ mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
+-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
+-mips*-*-linux-gnu*) targ_emul=elf32btsmip
++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
+ ;;
+ mips*-*-lnews*) targ_emul=mipslnews ;;
+@@ -462,6 +474,10 @@
+ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+ ;;
++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
++ # The following needs to be checked...
++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
++ ;;
+ alpha*-*-osf*) targ_emul=alpha ;;
+ alpha*-*-gnu*) targ_emul=elf64alpha ;;
+ alpha*-*-netware*) targ_emul=alpha ;;
+diff -urN binutils-2.15.90.0.3-dist/libtool.m4 binutils-2.15.90.0.3/libtool.m4
+--- binutils-2.15.90.0.3-dist/libtool.m4 2003-05-05 16:46:46.000000000 -0500
++++ binutils-2.15.90.0.3/libtool.m4 2004-08-06 17:02:17.000000000 -0500
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN binutils-2.15.90.0.3-dist/ltconfig binutils-2.15.90.0.3/ltconfig
+--- binutils-2.15.90.0.3-dist/ltconfig 2004-01-14 15:07:42.000000000 -0600
++++ binutils-2.15.90.0.3/ltconfig 2004-08-06 17:02:17.000000000 -0500
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1260,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
+diff -urN binutils-2.15.90.0.3-dist/opcodes/configure binutils-2.15.90.0.3/opcodes/configure
+--- binutils-2.15.90.0.3-dist/opcodes/configure 2004-04-12 14:56:38.000000000 -0500
++++ binutils-2.15.90.0.3/opcodes/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1690,6 +1690,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- /dev/null
+diff -urN binutils-2.15.90.0.3-dist/bfd/config.bfd binutils-2.15.90.0.3/bfd/config.bfd
+--- binutils-2.15.90.0.3-dist/bfd/config.bfd 2004-04-12 14:56:33.000000000 -0500
++++ binutils-2.15.90.0.3/bfd/config.bfd 2004-08-06 17:02:17.000000000 -0500
+@@ -126,7 +126,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -136,7 +136,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -213,7 +213,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -221,7 +221,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
+ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+@@ -360,7 +360,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -371,7 +371,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -494,7 +494,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -508,7 +508,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -683,7 +683,7 @@
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_m68k_vec
+ targ_selvecs=m68klinux_vec
+ ;;
+@@ -955,7 +955,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -987,8 +988,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1149,7 +1150,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1196,7 +1197,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+@@ -1265,7 +1266,7 @@
+ targ_underscore=yes
+ ;;
+
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_vax_vec
+ ;;
+
+diff -urN binutils-2.15.90.0.3-dist/bfd/configure binutils-2.15.90.0.3/bfd/configure
+--- binutils-2.15.90.0.3-dist/bfd/configure 2004-04-14 23:26:05.000000000 -0500
++++ binutils-2.15.90.0.3/bfd/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1699,6 +1699,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5278,7 +5283,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5338,7 +5343,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5376,7 +5381,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -5477,7 +5482,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.90.0.3-dist/bfd/configure.in binutils-2.15.90.0.3/bfd/configure.in
+--- binutils-2.15.90.0.3-dist/bfd/configure.in 2004-04-14 23:26:05.000000000 -0500
++++ binutils-2.15.90.0.3/bfd/configure.in 2004-08-06 17:02:17.000000000 -0500
+@@ -178,7 +178,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -259,7 +259,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -300,7 +300,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -385,7 +385,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.90.0.3-dist/binutils/configure binutils-2.15.90.0.3/binutils/configure
+--- binutils-2.15.90.0.3-dist/binutils/configure 2004-04-12 14:56:34.000000000 -0500
++++ binutils-2.15.90.0.3/binutils/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1575,6 +1575,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.3-dist/configure binutils-2.15.90.0.3/configure
+--- binutils-2.15.90.0.3-dist/configure 2004-04-12 14:56:33.000000000 -0500
++++ binutils-2.15.90.0.3/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1298,6 +1298,18 @@
+ i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[3456789]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[3456789]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.90.0.3-dist/configure.in binutils-2.15.90.0.3/configure.in
+--- binutils-2.15.90.0.3-dist/configure.in 2004-04-12 14:56:33.000000000 -0500
++++ binutils-2.15.90.0.3/configure.in 2004-08-06 17:02:17.000000000 -0500
+@@ -521,6 +521,18 @@
+ i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[[3456789]]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[[3456789]]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.90.0.3-dist/gas/configure binutils-2.15.90.0.3/gas/configure
+--- binutils-2.15.90.0.3-dist/gas/configure 2004-04-12 14:56:34.000000000 -0500
++++ binutils-2.15.90.0.3/gas/configure 2004-08-06 17:04:29.000000000 -0500
+@@ -3401,6 +3401,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -4226,6 +4231,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -4242,6 +4248,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -4255,6 +4262,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -4311,7 +4319,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ i386-*-sysv[45]*) fmt=elf ;;
+ i386-*-solaris*) fmt=elf ;;
+@@ -4371,6 +4381,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -4398,6 +4409,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -4460,6 +4472,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -4487,7 +4500,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -4520,6 +4535,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.90.0.3-dist/gas/configure.in binutils-2.15.90.0.3/gas/configure.in
+--- binutils-2.15.90.0.3-dist/gas/configure.in 2004-04-12 14:56:34.000000000 -0500
++++ binutils-2.15.90.0.3/gas/configure.in 2004-08-06 17:04:27.000000000 -0500
+@@ -194,6 +194,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -210,6 +211,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -223,6 +225,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -279,7 +282,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ changequote(,)dnl
+ i386-*-sysv[45]*) fmt=elf ;;
+@@ -332,6 +337,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -359,6 +365,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -418,6 +425,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -438,7 +446,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -471,6 +481,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.90.0.3-dist/gprof/configure binutils-2.15.90.0.3/gprof/configure
+--- binutils-2.15.90.0.3-dist/gprof/configure 2004-01-14 15:07:51.000000000 -0600
++++ binutils-2.15.90.0.3/gprof/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1570,6 +1570,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.3-dist/ld/configure binutils-2.15.90.0.3/ld/configure
+--- binutils-2.15.90.0.3-dist/ld/configure 2003-05-05 16:46:49.000000000 -0500
++++ binutils-2.15.90.0.3/ld/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1578,6 +1578,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.90.0.3-dist/ld/configure.tgt binutils-2.15.90.0.3/ld/configure.tgt
+--- binutils-2.15.90.0.3-dist/ld/configure.tgt 2004-04-12 14:56:35.000000000 -0500
++++ binutils-2.15.90.0.3/ld/configure.tgt 2004-08-06 17:02:17.000000000 -0500
+@@ -31,6 +31,7 @@
+ targ_extra_emuls="criself crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ cris-*-linux-gnu*) targ_emul=crislinux ;;
++cris-*-linux-uclibc*) targ_emul=crislinux ;;
+ cris-*-*) targ_emul=criself
+ targ_extra_emuls="crisaout crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+@@ -60,14 +61,16 @@
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
++ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
++ targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+@@ -119,7 +122,9 @@
+ m32r*le-*-elf*) targ_emul=m32rlelf ;;
+ m32r*-*-elf*) targ_emul=m32relf ;;
+ m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;;
++m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
+ m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;;
++m32r*-*-linux-uclibc*) targ_emul=m32relf_linux ;;
+ m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
+ targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
+ m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
+@@ -129,7 +134,7 @@
+ m68*-ericsson-ose) targ_emul=sun3 ;;
+ m68*-apple-aux*) targ_emul=m68kaux ;;
+ *-tandem-none) targ_emul=st2000 ;;
+-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
+ i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+ i[3-7]86-*-vsta) targ_emul=vsta ;;
+ i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+@@ -153,14 +158,16 @@
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+ i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
++ targ_emul=elf_i386
+ targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+ tdir_i386linux=${targ_alias}aout
+ ;;
+-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
++ targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386linux"
+ targ_extra_libpath=elf_i386
+ tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
+@@ -260,10 +267,13 @@
+ arm9e-*-elf) targ_emul=armelf ;;
+ arm-*-oabi) targ_emul=armelf_oabi ;;
+ arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+ arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-conix*) targ_emul=armelf ;;
+-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ strongarm-*-coff) targ_emul=armcoff ;;
+ strongarm-*-elf) targ_emul=armelf ;;
+ strongarm-*-kaos*) targ_emul=armelf ;;
+@@ -365,7 +375,8 @@
+ targ_extra_emuls=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+-m68k-*-linux-gnu*) targ_emul=m68kelf
++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
++ targ_emul=m68kelf
+ targ_extra_emuls=m68klinux
+ tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
+ ;;
+@@ -382,9 +393,9 @@
+ m68*-*-psos*) targ_emul=m68kpsos ;;
+ m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
+ m68*-*-rtems*) targ_emul=m68kelf ;;
+-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
+ hppa*64*-*) targ_emul=elf64hppa ;;
+-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
+ hppa*-*-*elf*) targ_emul=hppaelf ;;
+ hppa*-*-lites*) targ_emul=hppaelf ;;
+ hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+@@ -397,6 +408,7 @@
+ targ_emul=vaxnbsd
+ targ_extra_emuls=elf32vax ;;
+ vax-*-linux-gnu*) targ_emul=elf32vax ;;
++vax-*-linux-uclibc*) targ_emul=elf32vax ;;
+ mips*-*-pe) targ_emul=mipspe ;
+ targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+ mips*-dec-ultrix*) targ_emul=mipslit ;;
+@@ -430,16 +442,16 @@
+ mips*-*-vxworks*) targ_emul=elf32ebmip
+ targ_extra_emuls="elf32elmip" ;;
+ mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
+-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
+-mips*-*-linux-gnu*) targ_emul=elf32btsmip
++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
+ ;;
+ mips*-*-lnews*) targ_emul=mipslnews ;;
+@@ -462,6 +474,10 @@
+ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+ ;;
++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
++ # The following needs to be checked...
++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
++ ;;
+ alpha*-*-osf*) targ_emul=alpha ;;
+ alpha*-*-gnu*) targ_emul=elf64alpha ;;
+ alpha*-*-netware*) targ_emul=alpha ;;
+diff -urN binutils-2.15.90.0.3-dist/libtool.m4 binutils-2.15.90.0.3/libtool.m4
+--- binutils-2.15.90.0.3-dist/libtool.m4 2003-05-05 16:46:46.000000000 -0500
++++ binutils-2.15.90.0.3/libtool.m4 2004-08-06 17:02:17.000000000 -0500
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN binutils-2.15.90.0.3-dist/ltconfig binutils-2.15.90.0.3/ltconfig
+--- binutils-2.15.90.0.3-dist/ltconfig 2004-01-14 15:07:42.000000000 -0600
++++ binutils-2.15.90.0.3/ltconfig 2004-08-06 17:02:17.000000000 -0500
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1260,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
+diff -urN binutils-2.15.90.0.3-dist/opcodes/configure binutils-2.15.90.0.3/opcodes/configure
+--- binutils-2.15.90.0.3-dist/opcodes/configure 2004-04-12 14:56:38.000000000 -0500
++++ binutils-2.15.90.0.3/opcodes/configure 2004-08-06 17:02:17.000000000 -0500
+@@ -1690,6 +1690,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- /dev/null
+diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.am binutils-2.14.90.0.6.new/bfd/doc/Makefile.am
+--- binutils-2.14.90.0.6/bfd/doc/Makefile.am 2003-07-23 10:08:09.000000000 -0500
++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.am 2004-03-01 16:05:16.000000000 -0600
+@@ -55,10 +55,10 @@
+ MKDOC = chew$(EXEEXT_FOR_BUILD)
+
+ $(MKDOC): chew.o
+- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
+
+ chew.o: chew.c
+- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
+
+ protos: libbfd.h libcoff.h bfd.h
+
+diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.in binutils-2.14.90.0.6.new/bfd/doc/Makefile.in
+--- binutils-2.14.90.0.6/bfd/doc/Makefile.in 2003-07-23 10:08:09.000000000 -0500
++++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.in 2004-03-01 16:05:03.000000000 -0600
+@@ -472,10 +472,10 @@
+
+
+ $(MKDOC): chew.o
+- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
++ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
+
+ chew.o: chew.c
+- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
++ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
+
+ protos: libbfd.h libcoff.h bfd.h
+
--- /dev/null
+--- binutils-2.15.90.0.3/gas/config/tc-mips.c-dist 2004-08-19 12:56:20.000000000 -0500
++++ binutils-2.15.90.0.3/gas/config/tc-mips.c 2004-08-19 12:57:30.000000000 -0500
+@@ -2708,6 +2708,7 @@
+ prev_insn_reloc_type[1] = BFD_RELOC_UNUSED;
+ prev_insn_reloc_type[2] = BFD_RELOC_UNUSED;
+ prev_insn_extended = 0;
++ prev_insn_is_delay_slot = 1;
+ }
+ else
+ {
--- /dev/null
+diff -urN binutils-2.15.91.0.1-dist/bfd/config.bfd binutils-2.15.91.0.1/bfd/config.bfd
+--- binutils-2.15.91.0.1-dist/bfd/config.bfd 2004-05-27 13:26:01.000000000 -0500
++++ binutils-2.15.91.0.1/bfd/config.bfd 2004-07-16 14:57:21.000000000 -0500
+@@ -128,7 +128,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -138,7 +138,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -215,7 +215,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -223,7 +223,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
+ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+@@ -367,7 +367,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -378,7 +378,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -501,7 +501,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -515,7 +515,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -690,7 +690,7 @@
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_m68k_vec
+ targ_selvecs=m68klinux_vec
+ ;;
+@@ -966,7 +966,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -1003,8 +1004,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1165,7 +1166,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1212,7 +1213,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+@@ -1281,7 +1282,7 @@
+ targ_underscore=yes
+ ;;
+
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_vax_vec
+ ;;
+
+diff -urN binutils-2.15.91.0.1-dist/bfd/configure binutils-2.15.91.0.1/bfd/configure
+--- binutils-2.15.91.0.1-dist/bfd/configure 2004-05-27 13:26:02.000000000 -0500
++++ binutils-2.15.91.0.1/bfd/configure 2004-07-16 14:57:21.000000000 -0500
+@@ -1687,6 +1687,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5266,7 +5271,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5326,7 +5331,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5364,7 +5369,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -5468,7 +5473,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.91.0.1-dist/bfd/configure.in binutils-2.15.91.0.1/bfd/configure.in
+--- binutils-2.15.91.0.1-dist/bfd/configure.in 2004-05-27 13:26:02.000000000 -0500
++++ binutils-2.15.91.0.1/bfd/configure.in 2004-07-16 14:57:21.000000000 -0500
+@@ -164,7 +164,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -245,7 +245,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -286,7 +286,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -374,7 +374,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.91.0.1-dist/binutils/configure binutils-2.15.91.0.1/binutils/configure
+--- binutils-2.15.91.0.1-dist/binutils/configure 2004-04-12 14:56:34.000000000 -0500
++++ binutils-2.15.91.0.1/binutils/configure 2004-07-27 21:50:54.000000000 -0500
+@@ -1575,6 +1575,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.91.0.1-dist/configure binutils-2.15.91.0.1/configure
+--- binutils-2.15.91.0.1-dist/configure 2004-05-27 13:26:01.000000000 -0500
++++ binutils-2.15.91.0.1/configure 2004-07-16 14:57:21.000000000 -0500
+@@ -1365,6 +1365,18 @@
+ i[3456789]86-*-coff | i[3456789]86-*-elf)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
++ i[3456789]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[3456789]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.91.0.1-dist/configure.in binutils-2.15.91.0.1/configure.in
+--- binutils-2.15.91.0.1-dist/configure.in 2004-05-27 13:26:01.000000000 -0500
++++ binutils-2.15.91.0.1/configure.in 2004-07-16 14:57:21.000000000 -0500
+@@ -551,6 +551,18 @@
+ i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
++ i[[3456789]]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[[3456789]]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.91.0.1-dist/gas/configure binutils-2.15.91.0.1/gas/configure
+--- binutils-2.15.91.0.1-dist/gas/configure 2004-05-27 13:26:03.000000000 -0500
++++ binutils-2.15.91.0.1/gas/configure 2004-07-16 14:57:21.000000000 -0500
+@@ -3408,6 +3408,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -4233,6 +4238,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -4249,6 +4255,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -4262,6 +4269,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -4319,7 +4327,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
+ i386-*-sysv[45]*) fmt=elf ;;
+ i386-*-solaris*) fmt=elf ;;
+@@ -4379,6 +4389,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -4406,6 +4417,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -4468,6 +4480,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -4496,7 +4509,9 @@
+ ppc-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -4529,6 +4544,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.91.0.1-dist/gas/configure.in binutils-2.15.91.0.1/gas/configure.in
+--- binutils-2.15.91.0.1-dist/gas/configure.in 2004-05-27 13:26:03.000000000 -0500
++++ binutils-2.15.91.0.1/gas/configure.in 2004-07-16 14:57:21.000000000 -0500
+@@ -194,6 +194,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -210,6 +211,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -223,6 +225,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -280,7 +283,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
+ changequote(,)dnl
+ i386-*-sysv[45]*) fmt=elf ;;
+@@ -333,6 +338,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -360,6 +366,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -419,6 +426,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -440,7 +448,9 @@
+ ppc-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -473,6 +483,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.91.0.1-dist/gprof/configure binutils-2.15.91.0.1/gprof/configure
+--- binutils-2.15.91.0.1-dist/gprof/configure 2004-01-14 15:07:51.000000000 -0600
++++ binutils-2.15.91.0.1/gprof/configure 2004-07-27 21:53:11.000000000 -0500
+@@ -1570,6 +1570,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.91.0.1-dist/ld/configure binutils-2.15.91.0.1/ld/configure
+--- binutils-2.15.91.0.1-dist/ld/configure 2003-05-05 16:46:49.000000000 -0500
++++ binutils-2.15.91.0.1/ld/configure 2004-07-16 14:57:21.000000000 -0500
+@@ -1578,6 +1578,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.91.0.1-dist/ld/configure.tgt binutils-2.15.91.0.1/ld/configure.tgt
+--- binutils-2.15.91.0.1-dist/ld/configure.tgt 2004-05-27 13:26:04.000000000 -0500
++++ binutils-2.15.91.0.1/ld/configure.tgt 2004-07-16 14:57:21.000000000 -0500
+@@ -31,6 +31,7 @@
+ targ_extra_emuls="criself crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ cris-*-linux-gnu*) targ_emul=crislinux ;;
++cris-*-linux-uclibc*) targ_emul=crislinux ;;
+ cris-*-*) targ_emul=criself
+ targ_extra_emuls="crisaout crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+@@ -60,14 +61,16 @@
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
++ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
++ targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+@@ -119,7 +122,9 @@
+ m32r*le-*-elf*) targ_emul=m32rlelf ;;
+ m32r*-*-elf*) targ_emul=m32relf ;;
+ m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;;
++m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
+ m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;;
++m32r*-*-linux-uclibc*) targ_emul=m32relf_linux ;;
+ m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
+ targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
+ m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
+@@ -129,7 +134,7 @@
+ m68*-ericsson-ose) targ_emul=sun3 ;;
+ m68*-apple-aux*) targ_emul=m68kaux ;;
+ *-tandem-none) targ_emul=st2000 ;;
+-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
+ i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+ i[3-7]86-*-vsta) targ_emul=vsta ;;
+ i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+@@ -153,14 +158,16 @@
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+ i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
++ targ_emul=elf_i386
+ targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+ tdir_i386linux=${targ_alias}aout
+ ;;
+-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
++ targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386linux"
+ targ_extra_libpath=elf_i386
+ tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
+@@ -260,10 +267,13 @@
+ arm9e-*-elf) targ_emul=armelf ;;
+ arm-*-oabi) targ_emul=armelf_oabi ;;
+ arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+ arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-conix*) targ_emul=armelf ;;
+-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ strongarm-*-coff) targ_emul=armcoff ;;
+ strongarm-*-elf) targ_emul=armelf ;;
+ strongarm-*-kaos*) targ_emul=armelf ;;
+@@ -365,7 +375,8 @@
+ targ_extra_emuls=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+-m68k-*-linux-gnu*) targ_emul=m68kelf
++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
++ targ_emul=m68kelf
+ targ_extra_emuls=m68klinux
+ tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
+ ;;
+@@ -382,9 +393,9 @@
+ m68*-*-psos*) targ_emul=m68kpsos ;;
+ m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
+ m68*-*-rtems*) targ_emul=m68kelf ;;
+-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
+ hppa*64*-*) targ_emul=elf64hppa ;;
+-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
+ hppa*-*-*elf*) targ_emul=hppaelf ;;
+ hppa*-*-lites*) targ_emul=hppaelf ;;
+ hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+@@ -397,6 +408,7 @@
+ targ_emul=vaxnbsd
+ targ_extra_emuls=elf32vax ;;
+ vax-*-linux-gnu*) targ_emul=elf32vax ;;
++vax-*-linux-uclibc*) targ_emul=elf32vax ;;
+ mips*-*-pe) targ_emul=mipspe ;
+ targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+ mips*-dec-ultrix*) targ_emul=mipslit ;;
+@@ -430,16 +442,16 @@
+ mips*-*-vxworks*) targ_emul=elf32ebmip
+ targ_extra_emuls="elf32elmip" ;;
+ mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
+-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
+-mips*-*-linux-gnu*) targ_emul=elf32btsmip
++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
+ ;;
+ mips*-*-lnews*) targ_emul=mipslnews ;;
+@@ -462,6 +474,10 @@
+ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+ ;;
++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
++ # The following needs to be checked...
++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
++ ;;
+ alpha*-*-osf*) targ_emul=alpha ;;
+ alpha*-*-gnu*) targ_emul=elf64alpha ;;
+ alpha*-*-netware*) targ_emul=alpha ;;
+diff -urN binutils-2.15.91.0.1-dist/libtool.m4 binutils-2.15.91.0.1/libtool.m4
+--- binutils-2.15.91.0.1-dist/libtool.m4 2003-05-05 16:46:46.000000000 -0500
++++ binutils-2.15.91.0.1/libtool.m4 2004-07-16 14:57:21.000000000 -0500
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN binutils-2.15.91.0.1-dist/ltconfig binutils-2.15.91.0.1/ltconfig
+--- binutils-2.15.91.0.1-dist/ltconfig 2004-01-14 15:07:42.000000000 -0600
++++ binutils-2.15.91.0.1/ltconfig 2004-07-16 14:57:21.000000000 -0500
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1260,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
+diff -urN binutils-2.15.91.0.1-dist/opcodes/configure binutils-2.15.91.0.1/opcodes/configure
+--- binutils-2.15.91.0.1-dist/opcodes/configure 2004-04-12 14:56:38.000000000 -0500
++++ binutils-2.15.91.0.1/opcodes/configure 2004-07-27 21:55:25.000000000 -0500
+@@ -1690,6 +1690,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- /dev/null
+diff -urN binutils-2.15.91.0.2-dist/bfd/config.bfd binutils-2.15.91.0.2/bfd/config.bfd
+--- binutils-2.15.91.0.2-dist/bfd/config.bfd 2004-07-27 23:36:07.000000000 -0500
++++ binutils-2.15.91.0.2/bfd/config.bfd 2004-07-29 20:09:48.000000000 -0500
+@@ -129,7 +129,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -139,7 +139,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -216,7 +216,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -224,7 +224,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
+ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+@@ -373,7 +373,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -384,7 +384,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -507,7 +507,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -521,7 +521,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -696,7 +696,7 @@
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_m68k_vec
+ targ_selvecs=m68klinux_vec
+ ;;
+@@ -972,7 +972,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -1009,8 +1010,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1177,7 +1178,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1224,7 +1225,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+@@ -1293,7 +1294,7 @@
+ targ_underscore=yes
+ ;;
+
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_vax_vec
+ ;;
+
+diff -urN binutils-2.15.91.0.2-dist/bfd/configure binutils-2.15.91.0.2/bfd/configure
+--- binutils-2.15.91.0.2-dist/bfd/configure 2004-07-27 23:36:07.000000000 -0500
++++ binutils-2.15.91.0.2/bfd/configure 2004-07-29 20:09:48.000000000 -0500
+@@ -1687,6 +1687,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5266,7 +5271,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5330,7 +5335,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5368,7 +5373,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -5472,7 +5477,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.91.0.2-dist/bfd/configure.in binutils-2.15.91.0.2/bfd/configure.in
+--- binutils-2.15.91.0.2-dist/bfd/configure.in 2004-07-27 23:36:07.000000000 -0500
++++ binutils-2.15.91.0.2/bfd/configure.in 2004-07-29 20:09:48.000000000 -0500
+@@ -164,7 +164,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -249,7 +249,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -290,7 +290,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -378,7 +378,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15.91.0.2-dist/configure binutils-2.15.91.0.2/configure
+--- binutils-2.15.91.0.2-dist/configure 2004-07-27 23:36:06.000000000 -0500
++++ binutils-2.15.91.0.2/configure 2004-07-29 20:09:48.000000000 -0500
+@@ -1349,6 +1349,18 @@
+ i[3456789]86-*-coff | i[3456789]86-*-elf)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
++ i[3456789]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[3456789]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.91.0.2-dist/configure.in binutils-2.15.91.0.2/configure.in
+--- binutils-2.15.91.0.2-dist/configure.in 2004-07-27 23:36:06.000000000 -0500
++++ binutils-2.15.91.0.2/configure.in 2004-07-29 20:09:48.000000000 -0500
+@@ -569,6 +569,18 @@
+ i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
++ i[[3456789]]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[[3456789]]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15.91.0.2-dist/gas/configure binutils-2.15.91.0.2/gas/configure
+--- binutils-2.15.91.0.2-dist/gas/configure 2004-07-27 23:36:09.000000000 -0500
++++ binutils-2.15.91.0.2/gas/configure 2004-07-29 20:09:48.000000000 -0500
+@@ -3408,6 +3408,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -4234,6 +4239,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -4250,6 +4256,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -4263,6 +4270,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ crx-*-elf*) fmt=elf ;;
+@@ -4322,7 +4330,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
+ i386-*-sysv[45]*) fmt=elf ;;
+ i386-*-solaris*) fmt=elf ;;
+@@ -4382,6 +4392,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -4409,6 +4420,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -4471,6 +4483,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -4498,7 +4511,9 @@
+ ppc-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -4538,6 +4553,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.91.0.2-dist/gas/configure.in binutils-2.15.91.0.2/gas/configure.in
+--- binutils-2.15.91.0.2-dist/gas/configure.in 2004-07-27 23:36:09.000000000 -0500
++++ binutils-2.15.91.0.2/gas/configure.in 2004-07-29 20:09:48.000000000 -0500
+@@ -195,6 +195,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -211,6 +212,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -224,6 +226,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ crx-*-elf*) fmt=elf ;;
+@@ -283,7 +286,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
+ changequote(,)dnl
+ i386-*-sysv[45]*) fmt=elf ;;
+@@ -336,6 +341,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -363,6 +369,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -422,6 +429,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -442,7 +450,9 @@
+ ppc-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -478,6 +488,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15.91.0.2-dist/ld/configure binutils-2.15.91.0.2/ld/configure
+--- binutils-2.15.91.0.2-dist/ld/configure 2004-07-27 23:36:11.000000000 -0500
++++ binutils-2.15.91.0.2/ld/configure 2004-07-29 20:09:48.000000000 -0500
+@@ -1578,6 +1578,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15.91.0.2-dist/ld/configure.tgt binutils-2.15.91.0.2/ld/configure.tgt
+--- binutils-2.15.91.0.2-dist/ld/configure.tgt 2004-07-27 23:36:11.000000000 -0500
++++ binutils-2.15.91.0.2/ld/configure.tgt 2004-07-29 20:09:48.000000000 -0500
+@@ -31,6 +31,7 @@
+ targ_extra_emuls="criself crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ cris-*-linux-gnu*) targ_emul=crislinux ;;
++cris-*-linux-uclibc*) targ_emul=crislinux ;;
+ cris-*-*) targ_emul=criself
+ targ_extra_emuls="crisaout crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+@@ -61,14 +62,16 @@
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
++ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
++ targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+@@ -120,7 +123,9 @@
+ m32r*le-*-elf*) targ_emul=m32rlelf ;;
+ m32r*-*-elf*) targ_emul=m32relf ;;
+ m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;;
++m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
+ m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;;
++m32r*-*-linux-uclibc*) targ_emul=m32relf_linux ;;
+ m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
+ targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
+ m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
+@@ -130,7 +135,7 @@
+ m68*-ericsson-ose) targ_emul=sun3 ;;
+ m68*-apple-aux*) targ_emul=m68kaux ;;
+ *-tandem-none) targ_emul=st2000 ;;
+-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
+ i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+ i[3-7]86-*-vsta) targ_emul=vsta ;;
+ i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+@@ -154,14 +159,16 @@
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+ i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
++ targ_emul=elf_i386
+ targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+ tdir_i386linux=${targ_alias}aout
+ ;;
+-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
++ targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386linux"
+ targ_extra_libpath=elf_i386
+ tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
+@@ -261,10 +268,13 @@
+ arm9e-*-elf) targ_emul=armelf ;;
+ arm-*-oabi) targ_emul=armelf_oabi ;;
+ arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+ arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-conix*) targ_emul=armelf ;;
+-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ strongarm-*-coff) targ_emul=armcoff ;;
+ strongarm-*-elf) targ_emul=armelf ;;
+ strongarm-*-kaos*) targ_emul=armelf ;;
+@@ -369,7 +379,8 @@
+ targ_extra_emuls=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+-m68k-*-linux-gnu*) targ_emul=m68kelf
++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
++ targ_emul=m68kelf
+ targ_extra_emuls=m68klinux
+ tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
+ ;;
+@@ -386,9 +397,9 @@
+ m68*-*-psos*) targ_emul=m68kpsos ;;
+ m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
+ m68*-*-rtems*) targ_emul=m68kelf ;;
+-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
+ hppa*64*-*) targ_emul=elf64hppa ;;
+-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
+ hppa*-*-*elf*) targ_emul=hppaelf ;;
+ hppa*-*-lites*) targ_emul=hppaelf ;;
+ hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+@@ -401,6 +412,7 @@
+ targ_emul=vaxnbsd
+ targ_extra_emuls=elf32vax ;;
+ vax-*-linux-gnu*) targ_emul=elf32vax ;;
++vax-*-linux-uclibc*) targ_emul=elf32vax ;;
+ mips*-*-pe) targ_emul=mipspe ;
+ targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+ mips*-dec-ultrix*) targ_emul=mipslit ;;
+@@ -434,16 +446,16 @@
+ mips*-*-vxworks*) targ_emul=elf32ebmip
+ targ_extra_emuls="elf32elmip" ;;
+ mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
+-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
+-mips*-*-linux-gnu*) targ_emul=elf32btsmip
++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
+ ;;
+ mips*-*-lnews*) targ_emul=mipslnews ;;
+@@ -466,6 +478,10 @@
+ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+ ;;
++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
++ # The following needs to be checked...
++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
++ ;;
+ alpha*-*-osf*) targ_emul=alpha ;;
+ alpha*-*-gnu*) targ_emul=elf64alpha ;;
+ alpha*-*-netware*) targ_emul=alpha ;;
+diff -urN binutils-2.15.91.0.2-dist/libtool.m4 binutils-2.15.91.0.2/libtool.m4
+--- binutils-2.15.91.0.2-dist/libtool.m4 2004-07-27 23:36:06.000000000 -0500
++++ binutils-2.15.91.0.2/libtool.m4 2004-07-30 01:25:35.000000000 -0500
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | 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 -urN binutils-2.15.91.0.2-dist/ltconfig binutils-2.15.91.0.2/ltconfig
+--- binutils-2.15.91.0.2-dist/ltconfig 2004-07-27 23:36:06.000000000 -0500
++++ binutils-2.15.91.0.2/ltconfig 2004-07-29 20:09:48.000000000 -0500
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1270,6 +1271,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
--- /dev/null
+diff -urN binutils-2.15-dist/bfd/config.bfd binutils-2.15/bfd/config.bfd
+--- binutils-2.15-dist/bfd/config.bfd 2004-05-17 14:35:56.000000000 -0500
++++ binutils-2.15/bfd/config.bfd 2004-08-04 12:01:44.000000000 -0500
+@@ -126,7 +126,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -136,7 +136,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -213,7 +213,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -221,7 +221,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
+ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+@@ -360,7 +360,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -371,7 +371,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -494,7 +494,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -508,7 +508,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -683,7 +683,7 @@
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_m68k_vec
+ targ_selvecs=m68klinux_vec
+ ;;
+@@ -955,7 +955,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -987,8 +988,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1149,7 +1150,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1196,7 +1197,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+@@ -1265,7 +1266,7 @@
+ targ_underscore=yes
+ ;;
+
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_vax_vec
+ ;;
+
+diff -urN binutils-2.15-dist/bfd/configure binutils-2.15/bfd/configure
+--- binutils-2.15-dist/bfd/configure 2004-05-17 14:35:57.000000000 -0500
++++ binutils-2.15/bfd/configure 2004-08-04 12:01:44.000000000 -0500
+@@ -1699,6 +1699,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5278,7 +5283,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5338,7 +5343,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5376,7 +5381,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -5477,7 +5482,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15-dist/bfd/configure.in binutils-2.15/bfd/configure.in
+--- binutils-2.15-dist/bfd/configure.in 2004-05-17 14:35:57.000000000 -0500
++++ binutils-2.15/bfd/configure.in 2004-08-04 12:01:44.000000000 -0500
+@@ -178,7 +178,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -259,7 +259,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -300,7 +300,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -385,7 +385,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN binutils-2.15-dist/binutils/configure binutils-2.15/binutils/configure
+--- binutils-2.15-dist/binutils/configure 2004-01-02 11:08:04.000000000 -0600
++++ binutils-2.15/binutils/configure 2004-08-04 12:01:44.000000000 -0500
+@@ -1585,6 +1585,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15-dist/configure binutils-2.15/configure
+--- binutils-2.15-dist/configure 2004-05-17 14:36:20.000000000 -0500
++++ binutils-2.15/configure 2004-08-04 12:01:44.000000000 -0500
+@@ -1288,6 +1288,18 @@
+ i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[3456789]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[3456789]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15-dist/configure.in binutils-2.15/configure.in
+--- binutils-2.15-dist/configure.in 2004-05-17 14:40:54.000000000 -0500
++++ binutils-2.15/configure.in 2004-08-04 12:01:44.000000000 -0500
+@@ -521,6 +521,18 @@
+ i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ i[[3456789]]86-*-linux-uclibc*)
++ # This section makes it possible to build newlib natively on linux.
++ # If we are using a cross compiler then don't configure newlib.
++ if test x${is_cross_compiler} != xno ; then
++ noconfigdirs="$noconfigdirs target-newlib"
++ fi
++ noconfigdirs="$noconfigdirs target-libgloss"
++ # If we are not using a cross compiler, do configure newlib.
++ # Note however, that newlib will only be configured in this situation
++ # if the --with-newlib option has been given, because otherwise
++ # 'target-newlib' will appear in skipdirs.
++ ;;
+ i[[3456789]]86-*-linux*)
+ # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+ # not build java stuff by default.
+diff -urN binutils-2.15-dist/gas/configure binutils-2.15/gas/configure
+--- binutils-2.15-dist/gas/configure 2004-05-17 14:36:07.000000000 -0500
++++ binutils-2.15/gas/configure 2004-08-04 12:07:50.000000000 -0500
+@@ -3400,6 +3400,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -4224,6 +4229,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -4240,6 +4246,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -4253,6 +4260,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -4310,7 +4318,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ i386-*-sysv[45]*) fmt=elf ;;
+ i386-*-solaris*) fmt=elf ;;
+@@ -4370,6 +4380,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -4397,6 +4408,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -4459,6 +4471,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -4486,7 +4499,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -4519,6 +4534,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15-dist/gas/configure.in binutils-2.15/gas/configure.in
+--- binutils-2.15-dist/gas/configure.in 2004-05-17 14:36:07.000000000 -0500
++++ binutils-2.15/gas/configure.in 2004-08-04 12:07:21.000000000 -0500
+@@ -194,6 +194,7 @@
+ alpha*-*-osf*) fmt=ecoff ;;
+ alpha*-*-linuxecoff*) fmt=ecoff ;;
+ alpha*-*-linux-gnu*) fmt=elf em=linux ;;
++ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
+ alpha*-*-netbsd*) fmt=elf em=nbsd ;;
+ alpha*-*-openbsd*) fmt=elf em=obsd ;;
+
+@@ -210,6 +211,7 @@
+ arm*-*-conix*) fmt=elf ;;
+ arm-*-linux*aout*) fmt=aout em=linux ;;
+ arm*-*-linux-gnu*) fmt=elf em=linux ;;
++ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
+ arm*-*-uclinux*) fmt=elf em=linux ;;
+ arm-*-netbsdelf*) fmt=elf em=nbsd ;;
+ arm-*-*n*bsd*) fmt=aout em=nbsd ;;
+@@ -223,6 +225,7 @@
+ avr-*-*) fmt=elf ;;
+
+ cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;;
++ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
+ cris-*-*) fmt=multi bfd_gas=yes ;;
+
+ d10v-*-*) fmt=elf ;;
+@@ -280,7 +283,9 @@
+ i386-*-linux*oldld) fmt=aout em=linux ;;
+ i386-*-linux*coff*) fmt=coff em=linux ;;
+ i386-*-linux-gnu*) fmt=elf em=linux ;;
++ i386-*-linux-uclibc*) fmt=elf em=linux ;;
+ x86_64-*-linux-gnu*) fmt=elf em=linux ;;
++ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
+ i386-*-lynxos*) fmt=coff em=lynx ;;
+ changequote(,)dnl
+ i386-*-sysv[45]*) fmt=elf ;;
+@@ -333,6 +338,7 @@
+ ia64-*-elf*) fmt=elf ;;
+ ia64-*-aix*) fmt=elf em=ia64aix ;;
+ ia64-*-linux-gnu*) fmt=elf em=linux ;;
++ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
+ ia64-*-hpux*) fmt=elf em=hpux ;;
+ ia64-*-netbsd*) fmt=elf em=nbsd ;;
+
+@@ -360,6 +366,7 @@
+ m68k-*-hpux*) fmt=hp300 em=hp300 ;;
+ m68k-*-linux*aout*) fmt=aout em=linux ;;
+ m68k-*-linux-gnu*) fmt=elf em=linux ;;
++ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
+ m68k-*-uclinux*) fmt=elf ;;
+ m68k-*-gnu*) fmt=elf ;;
+ m68k-*-lynxos*) fmt=coff em=lynx ;;
+@@ -419,6 +426,7 @@
+ ppc-*-beos*) fmt=coff ;;
+ ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
+ ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
++ ppc-*-linux-uclibc* | \
+ ppc-*-linux-gnu*) fmt=elf em=linux
+ case "$endian" in
+ big) ;;
+@@ -439,7 +447,9 @@
+ ppc-*-kaos*) fmt=elf ;;
+
+ s390x-*-linux-gnu*) fmt=elf em=linux ;;
++ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
+ s390-*-linux-gnu*) fmt=elf em=linux ;;
++ s390-*-linux-uclibc*) fmt=elf em=linux ;;
+
+ sh*-*-linux*) fmt=elf em=linux
+ case ${cpu} in
+@@ -472,6 +482,7 @@
+ sparc-*-coff) fmt=coff ;;
+ sparc-*-linux*aout*) fmt=aout em=linux ;;
+ sparc-*-linux-gnu*) fmt=elf em=linux ;;
++ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
+ sparc-*-lynxos*) fmt=coff em=lynx ;;
+ sparc-fujitsu-none) fmt=aout ;;
+ sparc-*-elf) fmt=elf ;;
+diff -urN binutils-2.15-dist/gprof/configure binutils-2.15/gprof/configure
+--- binutils-2.15-dist/gprof/configure 2003-08-26 12:19:19.000000000 -0500
++++ binutils-2.15/gprof/configure 2004-08-04 12:01:45.000000000 -0500
+@@ -1581,6 +1581,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15-dist/ld/configure binutils-2.15/ld/configure
+--- binutils-2.15-dist/ld/configure 2003-04-24 07:36:07.000000000 -0500
++++ binutils-2.15/ld/configure 2004-08-04 12:01:45.000000000 -0500
+@@ -1589,6 +1589,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN binutils-2.15-dist/ld/configure.tgt binutils-2.15/ld/configure.tgt
+--- binutils-2.15-dist/ld/configure.tgt 2004-05-17 14:36:15.000000000 -0500
++++ binutils-2.15/ld/configure.tgt 2004-08-04 12:01:45.000000000 -0500
+@@ -30,6 +30,7 @@
+ targ_extra_emuls="criself crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ cris-*-linux-gnu*) targ_emul=crislinux ;;
++cris-*-linux-uclibc*) targ_emul=crislinux ;;
+ cris-*-*) targ_emul=criself
+ targ_extra_emuls="crisaout crislinux"
+ targ_extra_libpath=$targ_extra_emuls ;;
+@@ -59,14 +60,16 @@
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
++sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
++ targ_emul=elf64_sparc
+ targ_extra_emuls="elf32_sparc sparclinux sun4"
+ targ_extra_libpath=elf32_sparc
+ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+ tdir_sparclinux=${tdir_elf32_sparc}aout
+ tdir_sun4=sparc-sun-sunos4
+ ;;
+-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
++sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
++ targ_emul=elf32_sparc
+ targ_extra_emuls="sparclinux elf64_sparc sun4"
+ targ_extra_libpath=elf64_sparc
+ tdir_sparclinux=${targ_alias}aout
+@@ -118,7 +121,9 @@
+ m32r*le-*-elf*) targ_emul=m32rlelf ;;
+ m32r*-*-elf*) targ_emul=m32relf ;;
+ m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;;
++m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
+ m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;;
++m32r*-*-linux-uclibc*) targ_emul=m32relf_linux ;;
+ m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
+ targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
+ m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
+@@ -128,7 +133,7 @@
+ m68*-ericsson-ose) targ_emul=sun3 ;;
+ m68*-apple-aux*) targ_emul=m68kaux ;;
+ *-tandem-none) targ_emul=st2000 ;;
+-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
++i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
+ i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+ i[3-7]86-*-vsta) targ_emul=vsta ;;
+ i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+@@ -152,14 +157,16 @@
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+ i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
++i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
++ targ_emul=elf_i386
+ targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
+ tdir_i386linux=${targ_alias}aout
+ ;;
+-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
++x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
++ targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386linux"
+ targ_extra_libpath=elf_i386
+ tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
+@@ -259,10 +266,13 @@
+ arm9e-*-elf) targ_emul=armelf ;;
+ arm-*-oabi) targ_emul=armelf_oabi ;;
+ arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
++arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
+ arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ arm*-*-conix*) targ_emul=armelf ;;
+-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
++thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
++ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
+ strongarm-*-coff) targ_emul=armcoff ;;
+ strongarm-*-elf) targ_emul=armelf ;;
+ strongarm-*-kaos*) targ_emul=armelf ;;
+@@ -364,7 +374,8 @@
+ targ_extra_emuls=m68kelf
+ tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
+ ;;
+-m68k-*-linux-gnu*) targ_emul=m68kelf
++m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
++ targ_emul=m68kelf
+ targ_extra_emuls=m68klinux
+ tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
+ ;;
+@@ -381,9 +392,9 @@
+ m68*-*-psos*) targ_emul=m68kpsos ;;
+ m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
+ m68*-*-rtems*) targ_emul=m68kelf ;;
+-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
++hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
+ hppa*64*-*) targ_emul=elf64hppa ;;
+-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
++hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
+ hppa*-*-*elf*) targ_emul=hppaelf ;;
+ hppa*-*-lites*) targ_emul=hppaelf ;;
+ hppa*-*-netbsd*) targ_emul=hppanbsd ;;
+@@ -396,6 +407,7 @@
+ targ_emul=vaxnbsd
+ targ_extra_emuls=elf32vax ;;
+ vax-*-linux-gnu*) targ_emul=elf32vax ;;
++vax-*-linux-uclibc*) targ_emul=elf32vax ;;
+ mips*-*-pe) targ_emul=mipspe ;
+ targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+ mips*-dec-ultrix*) targ_emul=mipslit ;;
+@@ -429,16 +441,16 @@
+ mips*-*-vxworks*) targ_emul=elf32ebmip
+ targ_extra_emuls="elf32elmip" ;;
+ mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
++mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
++mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
+-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
++mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
+-mips*-*-linux-gnu*) targ_emul=elf32btsmip
++mips*-*-linux-gnu* | mips*-*-linux-uclibc*) targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
+ ;;
+ mips*-*-lnews*) targ_emul=mipslnews ;;
+@@ -461,6 +473,10 @@
+ alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
+ ;;
++alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
++ # The following needs to be checked...
++ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
++ ;;
+ alpha*-*-osf*) targ_emul=alpha ;;
+ alpha*-*-gnu*) targ_emul=elf64alpha ;;
+ alpha*-*-netware*) targ_emul=alpha ;;
+diff -urN binutils-2.15-dist/libtool.m4 binutils-2.15/libtool.m4
+--- binutils-2.15-dist/libtool.m4 2003-04-10 22:58:39.000000000 -0500
++++ binutils-2.15/libtool.m4 2004-08-04 12:01:45.000000000 -0500
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN binutils-2.15-dist/ltconfig binutils-2.15/ltconfig
+--- binutils-2.15-dist/ltconfig 2003-10-03 23:54:47.000000000 -0500
++++ binutils-2.15/ltconfig 2004-08-04 12:01:45.000000000 -0500
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1260,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
+diff -urN binutils-2.15-dist/opcodes/configure binutils-2.15/opcodes/configure
+--- binutils-2.15-dist/opcodes/configure 2003-08-05 04:39:31.000000000 -0500
++++ binutils-2.15/opcodes/configure 2004-08-04 12:01:45.000000000 -0500
+@@ -1700,6 +1700,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
# Linux Module Utilities
#
CONFIG_INSMOD=y
-# CONFIG_FEATURE_2_2_MODULES is not set
CONFIG_FEATURE_2_4_MODULES=y
# CONFIG_FEATURE_2_6_MODULES is not set
# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
# CONFIG_FDFLUSH is not set
CONFIG_FDFORMAT=y
CONFIG_FDISK=y
+FDISK_SUPPORT_LARGE_DISKS=y
CONFIG_FEATURE_FDISK_WRITABLE=y
# CONFIG_FEATURE_AIX_LABEL is not set
# CONFIG_FEATURE_SGI_LABEL is not set
+++ /dev/null
-diff -urN gcc-3.3.3/boehm-gc/config.sub gcc-3.3.3-new/boehm-gc/config.sub
---- gcc-3.3.3/boehm-gc/config.sub 2002-02-11 22:37:53.000000000 -0600
-+++ gcc-3.3.3-new/boehm-gc/config.sub 2004-02-16 21:12:16.000000000 -0600
-@@ -118,7 +118,7 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
-- nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
-+ nto-qnx* | linux-gnu* | linux-uclibc* | storm-chaos* | os2-emx* | windows32-*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
-@@ -1089,7 +1089,8 @@
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+ | -mingw32* | -linux-gnu* | -linux-uclibc* \
-+ | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-diff -urN gcc-3.3.3/config.sub gcc-3.3.3-new/config.sub
---- gcc-3.3.3/config.sub 2003-01-30 17:25:36.000000000 -0600
-+++ gcc-3.3.3-new/config.sub 2004-02-16 21:12:16.000000000 -0600
-@@ -118,7 +118,7 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
-- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-+ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
-@@ -1112,7 +1112,8 @@
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+ | -mingw32* | -linux-gnu* | -linux-uclibc* \
-+ | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-diff -urN gcc-3.3.3/gcc/config/arm/linux-elf.h gcc-3.3.3-new/gcc/config/arm/linux-elf.h
---- gcc-3.3.3/gcc/config/arm/linux-elf.h 2003-09-16 10:39:23.000000000 -0500
-+++ gcc-3.3.3-new/gcc/config/arm/linux-elf.h 2004-02-16 21:12:16.000000000 -0600
-@@ -78,6 +78,18 @@
- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
-
- #undef LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC "%{h*} %{version:-v} \
-+ %{b} %{Wl,*:%*} \
-+ %{static:-Bstatic} \
-+ %{shared:-shared} \
-+ %{symbolic:-Bsymbolic} \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
-+ -X \
-+ %{mbig-endian:-EB}" \
-+ SUBTARGET_EXTRA_LINK_SPEC
-+#else
- #define LINK_SPEC "%{h*} %{version:-v} \
- %{b} %{Wl,*:%*} \
- %{static:-Bstatic} \
-@@ -88,6 +100,7 @@
- -X \
- %{mbig-endian:-EB}" \
- SUBTARGET_EXTRA_LINK_SPEC
-+#endif
-
- #define TARGET_OS_CPP_BUILTINS() \
- do { \
-diff -urN gcc-3.3.3/gcc/config/cris/linux.h gcc-3.3.3-new/gcc/config/cris/linux.h
---- gcc-3.3.3/gcc/config/cris/linux.h 2003-03-10 21:01:35.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/cris/linux.h 2004-02-16 21:12:16.000000000 -0600
-@@ -81,6 +81,25 @@
- #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"
-
-@@ -95,6 +114,8 @@
- %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
- %{!r:%{O2|O3: --gc-sections}}"
-
-+#endif /* USE_UCLIBC */
-+
-
- /* Node: Run-time Target */
-
-diff -urN gcc-3.3.3/gcc/config/cris/t-linux-uclibc gcc-3.3.3-new/gcc/config/cris/t-linux-uclibc
---- gcc-3.3.3/gcc/config/cris/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/cris/t-linux-uclibc 2004-02-16 21:12:16.000000000 -0600
-@@ -0,0 +1,3 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+TARGET_LIBGCC2_CFLAGS += -fPIC
-+CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
-diff -urN gcc-3.3.3/gcc/config/i386/linux.h gcc-3.3.3-new/gcc/config/i386/linux.h
---- gcc-3.3.3/gcc/config/i386/linux.h 2003-11-14 00:46:12.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/i386/linux.h 2004-02-16 21:12:16.000000000 -0600
-@@ -136,6 +136,15 @@
- %{static:-static}}}"
- #endif
- #else
-+#if defined USE_UCLIBC
-+#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
-+ %{!shared: \
-+ %{!ibcs: \
-+ %{!static: \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+ %{static:-static}}}"
-+#else
- #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
- %{!shared: \
- %{!ibcs: \
-@@ -144,6 +153,7 @@
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
- %{static:-static}}}"
- #endif
-+#endif
-
- /* A C statement (sans semicolon) to output to the stdio stream
- FILE the assembler definition of uninitialized global DECL named
-diff -urN gcc-3.3.3/gcc/config/mips/linux.h gcc-3.3.3-new/gcc/config/mips/linux.h
---- gcc-3.3.3/gcc/config/mips/linux.h 2003-12-23 02:58:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/mips/linux.h 2004-02-16 21:12:16.000000000 -0600
-@@ -175,6 +175,17 @@
-
- /* Borrowed from sparc/linux.h */
- #undef LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC \
-+ "%(endian_spec) \
-+ %{shared:-shared} \
-+ %{!shared: \
-+ %{!ibcs: \
-+ %{!static: \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+ %{static:-static}}}"
-+#else
- #define LINK_SPEC \
- "%(endian_spec) \
- %{shared:-shared} \
-@@ -184,6 +195,7 @@
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
- %{static:-static}}}"
-+#endif
-
- #undef SUBTARGET_ASM_SPEC
- #define SUBTARGET_ASM_SPEC "\
-diff -urN gcc-3.3.3/gcc/config/sh/linux.h gcc-3.3.3-new/gcc/config/sh/linux.h
---- gcc-3.3.3/gcc/config/sh/linux.h 2003-11-06 17:13:33.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/sh/linux.h 2004-02-16 21:12:16.000000000 -0600
-@@ -44,12 +44,21 @@
- #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
-
- /* The GNU C++ standard library requires that these macros be defined. */
- #undef CPLUSPLUS_CPP_SPEC
-diff -urN gcc-3.3.3/gcc/config/sh/t-linux-uclibc gcc-3.3.3-new/gcc/config/sh/t-linux-uclibc
---- gcc-3.3.3/gcc/config/sh/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/sh/t-linux-uclibc 2004-02-16 21:12:16.000000000 -0600
-@@ -0,0 +1,16 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+# Don't run fixproto
-+STMP_FIXPROTO =
-+
-+TARGET_LIBGCC2_CFLAGS = -fpic
-+LIB1ASMFUNCS_CACHE = _ic_invalidate
-+
-+LIB2FUNCS_EXTRA=
-+
-+MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m3e/m4
-+MULTILIB_DIRNAMES=
-+MULTILIB_MATCHES =
-+MULTILIB_EXCEPTIONS=
-+
-+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
-diff -urN gcc-3.3.3/gcc/config/sh/t-sh64-uclibc gcc-3.3.3-new/gcc/config/sh/t-sh64-uclibc
---- gcc-3.3.3/gcc/config/sh/t-sh64-uclibc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/sh/t-sh64-uclibc 2004-02-16 21:12:16.000000000 -0600
-@@ -0,0 +1,13 @@
-+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o
-+
-+LIB1ASMFUNCS = \
-+ _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
-+ _shcompact_call_trampoline _shcompact_return_trampoline \
-+ _shcompact_incoming_args _ic_invalidate _nested_trampoline \
-+ _push_pop_shmedia_regs \
-+ _udivdi3 _divdi3 _umoddi3 _moddi3
-+
-+MULTILIB_OPTIONS = $(MULTILIB_ENDIAN) m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
-+MULTILIB_DIRNAMES= $(MULTILIB_ENDIAN) nofpu compact nofpu/compact media64 nofpu/media64
-+MULTILIB_MATCHES=
-+MULTILIB_EXCEPTIONS=
-diff -urN gcc-3.3.3/gcc/config/t-linux-uclibc gcc-3.3.3-new/gcc/config/t-linux-uclibc
---- gcc-3.3.3/gcc/config/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/t-linux-uclibc 2004-02-16 21:12:16.000000000 -0600
-@@ -0,0 +1,23 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+# Don't run fixproto
-+STMP_FIXPROTO =
-+
-+# Compile crtbeginS.o and crtendS.o with pic.
-+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
-+# Compile libgcc2.a with pic.
-+TARGET_LIBGCC2_CFLAGS = -fPIC
-+
-+# Override t-slibgcc-elf-ver to export some libgcc symbols with
-+# the symbol versions that glibc used.
-+SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
-+
-+# Use unwind-dw2-fde-glibc
-+#LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
-+# $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-+#LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
-+
-+# Use unwind-dw2-fde
-+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
-+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
-diff -urN gcc-3.3.3/gcc/config.gcc gcc-3.3.3-new/gcc/config.gcc
---- gcc-3.3.3/gcc/config.gcc 2004-01-21 00:06:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config.gcc 2004-02-16 21:12:16.000000000 -0600
-@@ -697,6 +697,17 @@
- extra_parts=""
- use_collect2=yes
- ;;
-+arm*-*-linux-uclibc*) # ARM GNU/Linux with ELF - uClibc
-+ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
-+ tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux"
-+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-+ gnu_ld=yes
-+ case x${enable_threads} in
-+ x | xyes | xpthreads | xposix)
-+ thread_file='posix'
-+ ;;
-+ esac
-+ ;;
- arm*-*-linux*) # ARM GNU/Linux with ELF
- tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
- tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
-@@ -772,6 +783,10 @@
- tmake_file="cris/t-cris cris/t-elfmulti"
- gas=yes
- ;;
-+cris-*-linux-uclibc*)
-+ tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
-+ tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux-uclibc"
-+ ;;
- cris-*-linux*)
- tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
- tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
-@@ -1173,6 +1188,11 @@
- thread_file='single'
- fi
- ;;
-+i[34567]86-*-linux*uclibc*) # Intel 80386's running GNU/Linux
-+ # with ELF format using uClibc
-+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h"
-+ tmake_file="t-slibgcc-elf-ver t-linux-uclibc i386/t-crtstuff"
-+ ;;
- i[34567]86-*-linux*) # Intel 80386's running GNU/Linux
- # with ELF format using glibc 2
- # aka GNU/Linux C library 6
-@@ -1883,6 +1903,16 @@
- tm_file="elfos.h ${tm_file} mips/netbsd.h"
- tmake_file="${tmake_file} mips/t-netbsd"
- ;;
-+mips*-*-linux-uclibc*) # Linux MIPS, either endian. uClibc
-+ tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
-+ case $machine in
-+ mipsisa32*-*)
-+ target_cpu_default="MASK_SOFT_FLOAT"
-+ tm_defines="MIPS_ISA_DEFAULT=32"
-+ ;;
-+ esac
-+ tmake_file="t-slibgcc-elf-ver t-linux-uclibc mips/t-linux"
-+ ;;
- mips*-*-linux*) # Linux MIPS, either endian.
- tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
- case $machine in
-@@ -2129,6 +2159,11 @@
- out_file=rs6000/rs6000.c
- tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
- ;;
-+powerpc-*-linux-uclibc*)
-+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
-+ out_file=rs6000/rs6000.c
-+ tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux-uclibc rs6000/t-ppccomm"
-+ ;;
- powerpc-*-linux*)
- tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
- out_file=rs6000/rs6000.c
-@@ -2313,10 +2348,18 @@
- tmake_file="${tmake_file} sh/t-le"
- ;;
- esac
-- tmake_file="${tmake_file} sh/t-linux"
-+ case $machine in
-+ *-*-linux-uclibc*) tmake_file="${tmake_file} sh/t-linux-uclibc" ;;
-+ *) tmake_file="${tmake_file} sh/t-linux" ;;
-+ esac
- tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h"
- gas=yes gnu_ld=yes
- case $machine in
-+ sh64*-*-linux-uclibc*)
-+ tmake_file="${tmake_file} sh/t-sh64-uclibc"
-+ tm_file="${tm_file} sh/sh64.h"
-+ extra_headers="shmedia.h ushmedia.h sshmedia.h"
-+ ;;
- sh64*)
- tmake_file="${tmake_file} sh/t-sh64"
- tm_file="${tm_file} sh/sh64.h"
-diff -urN gcc-3.3.3/libstdc++-v3/aclocal.m4 gcc-3.3.3-new/libstdc++-v3/aclocal.m4
---- gcc-3.3.3/libstdc++-v3/aclocal.m4 2004-01-12 10:18:44.000000000 -0600
-+++ gcc-3.3.3-new/libstdc++-v3/aclocal.m4 2004-02-16 21:12:16.000000000 -0600
-@@ -1216,6 +1216,9 @@
- dnl Default to "generic"
- if test x$enable_clocale_flag = xno; then
- case x${target_os} in
-+ xlinux-uclibc*)
-+ enable_clocale_flag=uclibc
-+ ;;
- xlinux* | xgnu*)
- AC_EGREP_CPP([_GLIBCPP_ok], [
- #include <features.h>
-@@ -1339,6 +1342,41 @@
- CTIME_CC=config/locale/generic/time_members.cc
- CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
- ;;
-+ xuclibc)
-+ 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 \
-+ glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
-+ glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
-+ done
-+ AC_SUBST(glibcpp_MOFILES)
-+ AC_SUBST(glibcpp_POFILES)
-+
-+ CLOCALE_H=config/locale/uclibc/c_locale.h
-+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+ CCODECVT_H=config/locale/uclibc/codecvt_specializations.h
-+ 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
-+ ;;
- *)
- echo "$enable_clocale is an unknown locale package" 1>&2
- exit 1
-diff -urN gcc-3.3.3/libstdc++-v3/configure gcc-3.3.3-new/libstdc++-v3/configure
---- gcc-3.3.3/libstdc++-v3/configure 2004-01-12 10:18:45.000000000 -0600
-+++ gcc-3.3.3-new/libstdc++-v3/configure 2004-02-17 00:21:12.000000000 -0600
-@@ -2996,6 +2996,9 @@
-
- if test x$enable_clocale_flag = xno; then
- case x${target_os} in
-+ xlinux-uclibc*)
-+ enable_clocale_flag=uclibc
-+ ;;
- xlinux* | xgnu*)
- cat > conftest.$ac_ext <<EOF
- #line 3002 "configure"
-@@ -3182,6 +3185,70 @@
- CTIME_CC=config/locale/generic/time_members.cc
- CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
- ;;
-+ xuclibc)
-+ echo "$ac_t""uclibc" 1>&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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-+echo "configure:3117: checking for $ac_word" >&5
-+if eval "test \"`echo '$''{'ac_cv_prog_check_msgfmt'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ if test -n "$check_msgfmt"; then
-+ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
-+else
-+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
-+ ac_dummy="$PATH"
-+ for ac_dir in $ac_dummy; do
-+ test -z "$ac_dir" && ac_dir=.
-+ if test -f $ac_dir/$ac_word; then
-+ ac_cv_prog_check_msgfmt="yes"
-+ break
-+ fi
-+ done
-+ IFS="$ac_save_ifs"
-+ 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 "$ac_t""$check_msgfmt" 1>&6
-+else
-+ echo "$ac_t""no" 1>&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 \
-+ glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
-+ glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
-+ done
-+
-+
-+
-+ CLOCALE_H=config/locale/uclibc/c_locale.h
-+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+ CCODECVT_H=config/locale/uclibc/codecvt_specializations.h
-+ 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
-+ ;;
- *)
- echo "$enable_clocale is an unknown locale package" 1>&2
- exit 1
-@@ -4212,6 +4279,968 @@
- # GLIBCPP_CHECK_MATH_SUPPORT
-
- case "$target" in
-+ *-uclibc*)
-+ os_include_dir="os/uclibc"
-+ for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \
-+ machine/endian.h machine/param.h sys/machine.h sys/types.h \
-+ fp.h locale.h float.h inttypes.h
-+do
-+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-+echo "configure:4224: checking for $ac_hdr" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4229 "configure"
-+#include "confdefs.h"
-+#include <$ac_hdr>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+ rm -rf conftest*
-+ eval "ac_cv_header_$ac_safe=yes"
-+else
-+ echo "$ac_err" >&5
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_hdr 1
-+EOF
-+
-+else
-+ echo "$ac_t""no" 1>&6
-+fi
-+done
-+
-+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
-+
-+
-+ # If we're not using GNU ld, then there's no point in even trying these
-+ # tests. Check for that first. We should have already tested for gld
-+ # by now (in libtool), but require it now just to be safe...
-+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
-+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-+
-+
-+ # The name set by libtool depends on the version of libtool. Shame on us
-+ # for depending on an impl detail, but c'est la vie. Older versions used
-+ # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
-+ # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
-+ # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
-+ # set (hence we're using an older libtool), then set it.
-+ if test x${with_gnu_ld+set} != xset; then
-+ if test x${ac_cv_prog_gnu_ld+set} != xset; then
-+ # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
-+ with_gnu_ld=no
-+ else
-+ with_gnu_ld=$ac_cv_prog_gnu_ld
-+ fi
-+ fi
-+
-+ # Start by getting the version number. I think the libtool test already
-+ # does some of this, but throws away the result.
-+
-+ ldver=`$LD --version 2>/dev/null | head -1 | \
-+ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
-+
-+ glibcpp_gnu_ld_version=`echo $ldver | \
-+ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
-+
-+ # Set --gc-sections.
-+ if test "$with_gnu_ld" = "notbroken"; then
-+ # GNU ld it is! Joy and bunny rabbits!
-+
-+ # All these tests are for C++; save the language and the compiler flags.
-+ # Need to do this so that g++ won't try to link in libstdc++
-+ ac_test_CFLAGS="${CFLAGS+set}"
-+ ac_save_CFLAGS="$CFLAGS"
-+ CFLAGS='-x c++ -Wl,--gc-sections'
-+
-+ # Check for -Wl,--gc-sections
-+ # XXX This test is broken at the moment, as symbols required for
-+ # linking are now in libsupc++ (not built yet.....). In addition,
-+ # this test has cored on solaris in the past. In addition,
-+ # --gc-sections doesn't really work at the moment (keeps on discarding
-+ # used sections, first .eh_frame and now some of the glibc sections for
-+ # iconv). Bzzzzt. Thanks for playing, maybe next time.
-+ echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-+echo "configure:4312: checking for ld that supports -Wl,--gc-sections" >&5
-+ if test "$cross_compiling" = yes; then
-+ ac_sectionLDflags=yes
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4317 "configure"
-+#include "confdefs.h"
-+
-+ int main(void)
-+ {
-+ try { throw 1; }
-+ catch (...) { };
-+ return 0;
-+ }
-+
-+EOF
-+if { (eval echo configure:4328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-+then
-+ ac_sectionLDflags=yes
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -fr conftest*
-+ ac_sectionLDflags=no
-+fi
-+rm -fr conftest*
-+fi
-+
-+ if test "$ac_test_CFLAGS" = set; then
-+ CFLAGS="$ac_save_CFLAGS"
-+ else
-+ # this is the suspicious part
-+ CFLAGS=''
-+ fi
-+ if test "$ac_sectionLDflags" = "yes"; then
-+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
-+ fi
-+ echo "$ac_t""$ac_sectionLDflags" 1>&6
-+ fi
-+
-+ # Set linker optimization flags.
-+ if test x"$with_gnu_ld" = x"yes"; then
-+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
-+ fi
-+
-+
-+
-+
-+
-+ echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-+echo "configure:4362: checking for main in -lm" >&5
-+ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
-+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ ac_save_LIBS="$LIBS"
-+LIBS="-lm $LIBS"
-+cat > conftest.$ac_ext <<EOF
-+#line 4370 "configure"
-+#include "confdefs.h"
-+
-+int main() {
-+main()
-+; return 0; }
-+EOF
-+if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+ rm -rf conftest*
-+ eval "ac_cv_lib_$ac_lib_var=yes"
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_lib_$ac_lib_var=no"
-+fi
-+rm -f conftest*
-+LIBS="$ac_save_LIBS"
-+
-+fi
-+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_lib 1
-+EOF
-+
-+ LIBS="-lm $LIBS"
-+
-+else
-+ echo "$ac_t""no" 1>&6
-+fi
-+
-+ for ac_func in nan copysignf
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4407: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4412 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+ which can conflict with char $ac_func(); below. */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error. */
-+/* We use char because int might match the return type of a gcc2
-+ builtin and then its argument prototype would still apply. */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+ to always fail with ENOSYS. Some functions are actually named
-+ something starting with __ and the normal name is an alias. */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=yes"
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+
-+else
-+ echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
-+fi
-+done
-+
-+
-+ for ac_func in __signbit
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4464: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4469 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+ which can conflict with char $ac_func(); below. */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error. */
-+/* We use char because int might match the return type of a gcc2
-+ builtin and then its argument prototype would still apply. */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+ to always fail with ENOSYS. Some functions are actually named
-+ something starting with __ and the normal name is an alias. */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=yes"
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+
-+else
-+ echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
-+fi
-+done
-+
-+ for ac_func in __signbitf
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4520: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4525 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+ which can conflict with char $ac_func(); below. */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error. */
-+/* We use char because int might match the return type of a gcc2
-+ builtin and then its argument prototype would still apply. */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+ to always fail with ENOSYS. Some functions are actually named
-+ something starting with __ and the normal name is an alias. */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=yes"
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+
-+else
-+ echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
-+fi
-+done
-+
-+
-+ if test x$ac_cv_func_copysignl = x"yes"; then
-+ for ac_func in __signbitl
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4578: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4583 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+ which can conflict with char $ac_func(); below. */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error. */
-+/* We use char because int might match the return type of a gcc2
-+ builtin and then its argument prototype would still apply. */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+ to always fail with ENOSYS. Some functions are actually named
-+ something starting with __ and the normal name is an alias. */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=yes"
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+
-+else
-+ echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
-+fi
-+done
-+
-+ fi
-+
-+ if test -n "$LIBMATHOBJS"; then
-+ need_libmath=yes
-+ fi
-+
-+
-+
-+if test "$need_libmath" = yes; then
-+ GLIBCPP_BUILD_LIBMATH_TRUE=
-+ GLIBCPP_BUILD_LIBMATH_FALSE='#'
-+else
-+ GLIBCPP_BUILD_LIBMATH_TRUE='#'
-+ GLIBCPP_BUILD_LIBMATH_FALSE=
-+fi
-+
-+
-+ enable_wchar_t=no
-+
-+ echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-+echo "configure:4651: checking for mbstate_t" >&5
-+ cat > conftest.$ac_ext <<EOF
-+#line 4653 "configure"
-+#include "confdefs.h"
-+#include <wchar.h>
-+int main() {
-+mbstate_t teststate;
-+; return 0; }
-+EOF
-+if { (eval echo configure:4660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+ rm -rf conftest*
-+ have_mbstate_t=yes
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ have_mbstate_t=no
-+fi
-+rm -f conftest*
-+ echo "$ac_t""$have_mbstate_t" 1>&6
-+ if test x"$have_mbstate_t" = xyes; then
-+ cat >> confdefs.h <<\EOF
-+#define HAVE_MBSTATE_T 1
-+EOF
-+
-+ fi
-+
-+ for ac_hdr in wchar.h
-+do
-+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-+echo "configure:4682: checking for $ac_hdr" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4687 "configure"
-+#include "confdefs.h"
-+#include <$ac_hdr>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+ rm -rf conftest*
-+ eval "ac_cv_header_$ac_safe=yes"
-+else
-+ echo "$ac_err" >&5
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_hdr 1
-+EOF
-+ ac_has_wchar_h=yes
-+else
-+ echo "$ac_t""no" 1>&6
-+ac_has_wchar_h=no
-+fi
-+done
-+
-+ for ac_hdr in wctype.h
-+do
-+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-+echo "configure:4723: checking for $ac_hdr" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4728 "configure"
-+#include "confdefs.h"
-+#include <$ac_hdr>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+ rm -rf conftest*
-+ eval "ac_cv_header_$ac_safe=yes"
-+else
-+ echo "$ac_err" >&5
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_hdr 1
-+EOF
-+ ac_has_wctype_h=yes
-+else
-+ echo "$ac_t""no" 1>&6
-+ac_has_wctype_h=no
-+fi
-+done
-+
-+
-+ if test x"$ac_has_wchar_h" = xyes &&
-+ test x"$ac_has_wctype_h" = xyes &&
-+ test x"$enable_c_mbchar" != xno; then
-+
-+ echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-+echo "configure:4766: checking for WCHAR_MIN and WCHAR_MAX" >&5
-+ cat > conftest.$ac_ext <<EOF
-+#line 4768 "configure"
-+#include "confdefs.h"
-+#include <wchar.h>
-+int main() {
-+int i = WCHAR_MIN; int j = WCHAR_MAX;
-+; return 0; }
-+EOF
-+if { (eval echo configure:4775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+ rm -rf conftest*
-+ has_wchar_minmax=yes
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ has_wchar_minmax=no
-+fi
-+rm -f conftest*
-+ echo "$ac_t""$has_wchar_minmax" 1>&6
-+
-+ echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-+echo "configure:4788: checking for WEOF" >&5
-+ cat > conftest.$ac_ext <<EOF
-+#line 4790 "configure"
-+#include "confdefs.h"
-+
-+ #include <wchar.h>
-+ #include <stddef.h>
-+int main() {
-+wint_t i = WEOF;
-+; return 0; }
-+EOF
-+if { (eval echo configure:4799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+ rm -rf conftest*
-+ has_weof=yes
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ has_weof=no
-+fi
-+rm -f conftest*
-+ echo "$ac_t""$has_weof" 1>&6
-+
-+ ac_wfuncs=yes
-+ for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4815: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4820 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+ which can conflict with char $ac_func(); below. */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error. */
-+/* We use char because int might match the return type of a gcc2
-+ builtin and then its argument prototype would still apply. */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+ to always fail with ENOSYS. Some functions are actually named
-+ something starting with __ and the normal name is an alias. */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=yes"
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+
-+else
-+ echo "$ac_t""no" 1>&6
-+\
-+ ac_wfuncs=no
-+fi
-+done
-+
-+
-+ for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
-+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
-+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
-+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
-+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
-+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4878: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4883 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+ which can conflict with char $ac_func(); below. */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error. */
-+/* We use char because int might match the return type of a gcc2
-+ builtin and then its argument prototype would still apply. */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+ to always fail with ENOSYS. Some functions are actually named
-+ something starting with __ and the normal name is an alias. */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=yes"
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+
-+else
-+ echo "$ac_t""no" 1>&6
-+\
-+ ac_wfuncs=no
-+fi
-+done
-+
-+
-+ echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-+echo "configure:4934: checking for ISO C99 wchar_t support" >&5
-+ if test x"$has_weof" = xyes &&
-+ test x"$has_wchar_minmax" = xyes &&
-+ test x"$ac_wfuncs" = xyes; then
-+ ac_isoC99_wchar_t=yes
-+ else
-+ ac_isoC99_wchar_t=no
-+ fi
-+ echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
-+
-+ ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-+echo "configure:4946: checking for iconv.h" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4951 "configure"
-+#include "confdefs.h"
-+#include <iconv.h>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+ rm -rf conftest*
-+ eval "ac_cv_header_$ac_safe=yes"
-+else
-+ echo "$ac_err" >&5
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_has_iconv_h=yes
-+else
-+ echo "$ac_t""no" 1>&6
-+ac_has_iconv_h=no
-+fi
-+
-+ ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-+echo "configure:4980: checking for langinfo.h" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 4985 "configure"
-+#include "confdefs.h"
-+#include <langinfo.h>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+ rm -rf conftest*
-+ eval "ac_cv_header_$ac_safe=yes"
-+else
-+ echo "$ac_err" >&5
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_has_langinfo_h=yes
-+else
-+ echo "$ac_t""no" 1>&6
-+ac_has_langinfo_h=no
-+fi
-+
-+
-+ echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-+echo "configure:5014: checking for iconv in -liconv" >&5
-+ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
-+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ ac_save_LIBS="$LIBS"
-+LIBS="-liconv $LIBS"
-+cat > conftest.$ac_ext <<EOF
-+#line 5022 "configure"
-+#include "confdefs.h"
-+/* Override any gcc2 internal prototype to avoid an error. */
-+/* We use char because int might match the return type of a gcc2
-+ builtin and then its argument prototype would still apply. */
-+char iconv();
-+
-+int main() {
-+iconv()
-+; return 0; }
-+EOF
-+if { (eval echo configure:5033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+ rm -rf conftest*
-+ eval "ac_cv_lib_$ac_lib_var=yes"
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_lib_$ac_lib_var=no"
-+fi
-+rm -f conftest*
-+LIBS="$ac_save_LIBS"
-+
-+fi
-+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ libiconv="-liconv"
-+else
-+ echo "$ac_t""no" 1>&6
-+fi
-+
-+ ac_save_LIBS="$LIBS"
-+ LIBS="$LIBS $libiconv"
-+
-+ for ac_func in iconv_open iconv_close iconv nl_langinfo
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:5059: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 5064 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+ which can conflict with char $ac_func(); below. */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error. */
-+/* We use char because int might match the return type of a gcc2
-+ builtin and then its argument prototype would still apply. */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+ to always fail with ENOSYS. Some functions are actually named
-+ something starting with __ and the normal name is an alias. */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:5087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=yes"
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ \
-+ ac_XPG2funcs=yes
-+else
-+ echo "$ac_t""no" 1>&6
-+ac_XPG2funcs=no
-+fi
-+done
-+
-+
-+ LIBS="$ac_save_LIBS"
-+
-+ echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-+echo "configure:5117: checking for XPG2 wchar_t support" >&5
-+ if test x"$ac_has_iconv_h" = xyes &&
-+ test x"$ac_has_langinfo_h" = xyes &&
-+ test x"$ac_XPG2funcs" = xyes; then
-+ ac_XPG2_wchar_t=yes
-+ else
-+ ac_XPG2_wchar_t=no
-+ fi
-+ echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
-+
-+ if test x"$ac_isoC99_wchar_t" = xyes &&
-+ test x"$ac_XPG2_wchar_t" = xyes; then
-+ cat >> confdefs.h <<\EOF
-+#define _GLIBCPP_USE_WCHAR_T 1
-+EOF
-+
-+ enable_wchar_t=yes
-+ fi
-+ fi
-+ echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-+echo "configure:5137: checking for enabled wchar_t specializations" >&5
-+ echo "$ac_t""$enable_wchar_t" 1>&6
-+
-+
-+if test "$enable_wchar_t" = yes; then
-+ GLIBCPP_TEST_WCHAR_T_TRUE=
-+ GLIBCPP_TEST_WCHAR_T_FALSE='#'
-+else
-+ GLIBCPP_TEST_WCHAR_T_TRUE='#'
-+ GLIBCPP_TEST_WCHAR_T_FALSE=
-+fi
-+
-+
-+ cat >> confdefs.h <<\EOF
-+#define HAVE_COPYSIGN 1
-+EOF
-+
-+ cat >> confdefs.h <<\EOF
-+#define HAVE_FINITE 1
-+EOF
-+
-+ cat >> confdefs.h <<\EOF
-+#define HAVE_FINITEF 1
-+EOF
-+
-+ cat >> confdefs.h <<\EOF
-+#define HAVE_ISINF 1
-+EOF
-+
-+ cat >> confdefs.h <<\EOF
-+#define HAVE_ISINFF 1
-+EOF
-+
-+ cat >> confdefs.h <<\EOF
-+#define HAVE_ISNAN 1
-+EOF
-+
-+ cat >> confdefs.h <<\EOF
-+#define HAVE_ISNANF 1
-+EOF
-+ ;;
- *-linux*)
- os_include_dir="os/gnu-linux"
- for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \
-diff -urN gcc-3.3.3/libstdc++-v3/configure.in gcc-3.3.3-new/libstdc++-v3/configure.in
---- gcc-3.3.3/libstdc++-v3/configure.in 2004-01-12 10:19:22.000000000 -0600
-+++ gcc-3.3.3-new/libstdc++-v3/configure.in 2004-02-16 23:13:45.000000000 -0600
-@@ -117,6 +117,36 @@
- # GLIBCPP_CHECK_MATH_SUPPORT
-
- case "$target" in
-+ *-uclibc*)
-+ os_include_dir="os/uclibc"
-+ 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 locale.h float.h inttypes.h])
-+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
-+ AC_SUBST(SECTION_FLAGS)
-+ GLIBCPP_CHECK_LINKER_FEATURES
-+ GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
-+ GLIBCPP_CHECK_WCHAR_T_SUPPORT
-+
-+ AC_DEFINE(HAVE_COPYSIGN)
-+ #AC_DEFINE(HAVE_COPYSIGNF)
-+ AC_DEFINE(HAVE_FINITE)
-+ AC_DEFINE(HAVE_FINITEF)
-+ #AC_DEFINE(HAVE_FREXPF)
-+ #AC_DEFINE(HAVE_HYPOTF)
-+ AC_DEFINE(HAVE_ISINF)
-+ AC_DEFINE(HAVE_ISINFF)
-+ AC_DEFINE(HAVE_ISNAN)
-+ AC_DEFINE(HAVE_ISNANF)
-+ #AC_DEFINE(HAVE_SINCOS)
-+ #AC_DEFINE(HAVE_SINCOSF)
-+ #if test x"long_double_math_on_this_cpu" = x"yes"; then
-+ #AC_DEFINE(HAVE_FINITEL)
-+ #AC_DEFINE(HAVE_HYPOTL)
-+ #AC_DEFINE(HAVE_ISINFL)
-+ #AC_DEFINE(HAVE_ISNANL)
-+ #fi
-+ ;;
- *-linux*)
- os_include_dir="os/gnu-linux"
- AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
-diff -urN gcc-3.3.3/libstdc++-v3/configure.target gcc-3.3.3-new/libstdc++-v3/configure.target
---- gcc-3.3.3/libstdc++-v3/configure.target 2003-10-01 14:07:07.000000000 -0500
-+++ gcc-3.3.3-new/libstdc++-v3/configure.target 2004-02-16 21:12:16.000000000 -0600
-@@ -133,6 +133,9 @@
- freebsd*)
- os_include_dir="os/bsd/freebsd"
- ;;
-+ linux-uclibc*)
-+ os_include_dir="os/uclibc"
-+ ;;
- gnu* | linux*)
- os_include_dir="os/gnu-linux"
- ;;
-diff -urN gcc-3.3.3/libstdc++-v3/include/c_std/std_cstdlib.h gcc-3.3.3-new/libstdc++-v3/include/c_std/std_cstdlib.h
---- gcc-3.3.3/libstdc++-v3/include/c_std/std_cstdlib.h 2003-04-18 05:08:05.000000000 -0500
-+++ gcc-3.3.3-new/libstdc++-v3/include/c_std/std_cstdlib.h 2004-02-16 21:12:16.000000000 -0600
-@@ -101,9 +101,11 @@
- using ::labs;
- using ::ldiv;
- using ::malloc;
-+#if _GLIBCPP_USE_WCHAR_T
- using ::mblen;
- using ::mbstowcs;
- using ::mbtowc;
-+#endif
- using ::qsort;
- using ::rand;
- using ::realloc;
-@@ -112,8 +114,10 @@
- using ::strtol;
- using ::strtoul;
- using ::system;
-+#if _GLIBCPP_USE_WCHAR_T
- using ::wcstombs;
- using ::wctomb;
-+#endif
-
- inline long
- abs(long __i) { return labs(__i); }
-diff -urN gcc-3.3.3/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.3.3-new/libstdc++-v3/include/c_std/std_cwchar.h
---- gcc-3.3.3/libstdc++-v3/include/c_std/std_cwchar.h 2003-04-18 05:08:05.000000000 -0500
-+++ gcc-3.3.3-new/libstdc++-v3/include/c_std/std_cwchar.h 2004-02-16 21:12:16.000000000 -0600
-@@ -165,7 +165,9 @@
- using ::wcscoll;
- using ::wcscpy;
- using ::wcscspn;
-+#ifdef HAVE_WCSFTIME
- using ::wcsftime;
-+#endif
- using ::wcslen;
- using ::wcsncat;
- using ::wcsncmp;
-diff -urN gcc-3.3.3/ltconfig gcc-3.3.3-new/ltconfig
---- gcc-3.3.3/ltconfig 2003-02-19 20:10:02.000000000 -0600
-+++ gcc-3.3.3-new/ltconfig 2004-02-16 21:12:16.000000000 -0600
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-
-@@ -1247,6 +1248,24 @@
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-+linux-uclibc*)
-+ version_type=linux
-+ need_lib_prefix=no
-+ need_version=no
-+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+ soname_spec='${libname}${release}.so$major'
-+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+ shlibpath_var=LD_LIBRARY_PATH
-+ shlibpath_overrides_runpath=no
-+ # This implies no fast_install, which is unacceptable.
-+ # Some rework will be needed to allow for fast_install
-+ # before this can be enabled.
-+ # Note: copied from linux-gnu, and may not be appropriate.
-+ hardcode_into_libs=yes
-+ # Assume using the uClibc dynamic linker.
-+ dynamic_linker="uClibc ld.so"
-+ ;;
-+
- netbsd*)
- need_lib_prefix=no
- need_version=no
+++ /dev/null
-Use the patch by Carl Miller <chaz@energoncube.net> for powerpc, with
-some minor modifications. Changed *os_uclibc to *os_linux_uclibc since
-at some point we might support other platforms. Also updated to 3.3.3.
-diff -urN gcc-3.3.3/gcc/config/rs6000/linux.h gcc-3.3.3-new/gcc/config/rs6000/linux.h
---- gcc-3.3.3/gcc/config/rs6000/linux.h 2003-11-14 00:46:10.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/rs6000/linux.h 2004-02-16 21:13:40.000000000 -0600
-@@ -64,7 +64,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
-
- #undef TARGET_VERSION
- #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
-diff -urN gcc-3.3.3/gcc/config/rs6000/sysv4.h gcc-3.3.3-new/gcc/config/rs6000/sysv4.h
---- gcc-3.3.3/gcc/config/rs6000/sysv4.h 2003-10-28 13:55:41.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/rs6000/sysv4.h 2004-02-16 21:13:40.000000000 -0600
-@@ -968,9 +968,11 @@
- %{mcall-linux: %(link_os_linux) } \
- %{mcall-gnu: %(link_os_gnu) } \
- %{mcall-netbsd: %(link_os_netbsd) } \
-+%{mcall-uclibc: %(link_os_linux_uclibc) } \
- %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
- %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
-- %{!mcall-netbsd: %(link_os_default) }}}}}}}}}"
-+ %{!mcall-netbsd: %{!mcall-uclibc: \
-+ %(link_os_default) }}}}}}}}}}"
-
- #define LINK_OS_DEFAULT_SPEC ""
-
-@@ -1307,6 +1309,12 @@
-
- #define LINK_OS_WINDISS_SPEC ""
-
-+/* uClibc support for Linux. */
-+
-+#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
-+
- /* Define any extra SPECS that the compiler needs to generate. */
- /* Override rs6000.h definition. */
- #undef SUBTARGET_EXTRA_SPECS
-@@ -1372,6 +1380,7 @@
- { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
- { "link_os_vxworks", LINK_OS_VXWORKS_SPEC }, \
- { "link_os_windiss", LINK_OS_WINDISS_SPEC }, \
-+ { "link_os_linux_uclibc", LINK_OS_LINUX_UCLIBC_SPEC }, \
- { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
- { "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \
- { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
+++ /dev/null
---- gcc-3.3.2-old/configure.in 2003-08-09 01:57:21.000000000 -0500
-+++ gcc-3.3.2/configure.in 2004-01-15 12:46:29.000000000 -0600
-@@ -1418,6 +1418,11 @@
- fi
-
- FLAGS_FOR_TARGET=
-+case " $targargs " in
-+ *" --nfp "* | *" --without-float "*)
-+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -msoft-float'
-+ ;;
-+esac
- case " $target_configdirs " in
- *" newlib "*)
- case " $targargs " in
+++ /dev/null
-Warning! This patch is not finished. The wide char time-related stuff
-is broken or non-functional. But it serves as a starting point to get
-things building while I continue to work on the uClibc locale internals.
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2004-01-09 07:55:02.000000000 -0600
-@@ -0,0 +1,63 @@
-+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
-+
-+// Copyright (C) 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.
-+
-+// Written by Jakub Jelinek <jakub@redhat.com>
-+
-+#include <clocale>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning clean this up
-+#endif
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+
-+extern "C" __typeof(iswctype_l) __iswctype_l;
-+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(strtol_l) __strtol_l;
-+extern "C" __typeof(strtoll_l) __strtoll_l;
-+extern "C" __typeof(strtoul_l) __strtoul_l;
-+extern "C" __typeof(strtoull_l) __strtoull_l;
-+extern "C" __typeof(strxfrm_l) __strxfrm_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;
-+extern "C" __typeof(newlocale) __newlocale;
-+extern "C" __typeof(freelocale) __freelocale;
-+extern "C" __typeof(duplocale) __duplocale;
-+extern "C" __typeof(uselocale) __uselocale;
-+
-+#endif // GLIBC 2.3 and later
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc 2004-01-09 08:37:55.000000000 -0600
-@@ -0,0 +1,231 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 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.
-+
-+//
-+// ISO C++ 14882: 22.8 Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <stdexcept>
-+#include <langinfo.h>
-+#include <bits/c++locale_internal.h>
-+
-+#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))
-+#endif
-+
-+namespace std
-+{
-+ template<>
-+ void
-+ __convert_to_v(const char* __s, long& __v, ios_base::iostate& __err,
-+ const __c_locale& __cloc, int __base)
-+ {
-+ if (!(__err & ios_base::failbit))
-+ {
-+ char* __sanity;
-+ errno = 0;
-+ long __l = __strtol_l(__s, &__sanity, __base, __cloc);
-+ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+ __v = __l;
-+ else
-+ __err |= ios_base::failbit;
-+ }
-+ }
-+
-+ template<>
-+ void
-+ __convert_to_v(const char* __s, unsigned long& __v,
-+ ios_base::iostate& __err, const __c_locale& __cloc,
-+ int __base)
-+ {
-+ if (!(__err & ios_base::failbit))
-+ {
-+ char* __sanity;
-+ errno = 0;
-+ unsigned long __ul = __strtoul_l(__s, &__sanity, __base, __cloc);
-+ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+ __v = __ul;
-+ else
-+ __err |= ios_base::failbit;
-+ }
-+ }
-+
-+#ifdef _GLIBCPP_USE_LONG_LONG
-+ template<>
-+ void
-+ __convert_to_v(const char* __s, long long& __v, ios_base::iostate& __err,
-+ const __c_locale& __cloc, int __base)
-+ {
-+ if (!(__err & ios_base::failbit))
-+ {
-+ char* __sanity;
-+ errno = 0;
-+ long long __ll = __strtoll_l(__s, &__sanity, __base, __cloc);
-+ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+ __v = __ll;
-+ else
-+ __err |= ios_base::failbit;
-+ }
-+ }
-+
-+ template<>
-+ void
-+ __convert_to_v(const char* __s, unsigned long long& __v,
-+ ios_base::iostate& __err, const __c_locale& __cloc,
-+ int __base)
-+ {
-+ if (!(__err & ios_base::failbit))
-+ {
-+ char* __sanity;
-+ errno = 0;
-+ unsigned long long __ull = __strtoull_l(__s, &__sanity, __base,
-+ __cloc);
-+ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+ __v = __ull;
-+ else
-+ __err |= ios_base::failbit;
-+ }
-+ }
-+#endif
-+
-+ template<>
-+ void
-+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
-+ const __c_locale& __cloc, int)
-+ {
-+ if (!(__err & ios_base::failbit))
-+ {
-+ char* __sanity;
-+ errno = 0;
-+ float __f = __strtof_l(__s, &__sanity, __cloc);
-+ if (__sanity != __s && *__sanity == '\0' && 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, int)
-+ {
-+ if (!(__err & ios_base::failbit))
-+ {
-+ char* __sanity;
-+ errno = 0;
-+ double __d = __strtod_l(__s, &__sanity, __cloc);
-+ if (__sanity != __s && *__sanity == '\0' && 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, int)
-+ {
-+ if (!(__err & ios_base::failbit))
-+ {
-+ char* __sanity;
-+ errno = 0;
-+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
-+ if (__sanity != __s && *__sanity == '\0' && 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)
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __cloc = __newlocale(1 << LC_ALL, __s, __old);
-+ if (!__cloc)
-+ {
-+ // This named locale is not supported by the underlying OS.
-+ __throw_runtime_error("attempt to create locale from unknown name");
-+ }
-+#else
-+ __cloc = NULL;
-+#endif
-+ }
-+
-+ void
-+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ if (_S_c_locale != __cloc)
-+ __freelocale(__cloc);
-+#else
-+ __cloc = NULL;
-+#endif
-+ }
-+
-+ __c_locale
-+ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ { return __duplocale(__cloc); }
-+#else
-+ { return __c_locale(); }
-+#endif
-+
-+ const char* locale::_S_categories[_S_categories_size
-+ + _S_extra_categories_size] =
-+ {
-+ "LC_CTYPE",
-+ "LC_NUMERIC",
-+ "LC_TIME",
-+ "LC_COLLATE",
-+ "LC_MONETARY",
-+ "LC_MESSAGES"
-+#if _GLIBCPP_NUM_CATEGORIES != 0
-+ ,
-+ "LC_PAPER",
-+ "LC_NAME",
-+ "LC_ADDRESS",
-+ "LC_TELEPHONE",
-+ "LC_MEASUREMENT",
-+ "LC_IDENTIFICATION"
-+#endif
-+ };
-+} // namespace std
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h 2004-01-09 07:51:06.000000000 -0600
-@@ -0,0 +1,118 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 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.
-+
-+//
-+// ISO C++ 14882: 22.8 Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#ifndef _CPP_BITS_C_LOCALE_H
-+#define _CPP_BITS_C_LOCALE_H 1
-+
-+#pragma GCC system_header
-+
-+#include <clocale>
-+#include <langinfo.h> // For codecvt
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC_HAS_LOCALE__
-+#include <iconv.h> // For codecvt using iconv, iconv_t
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+#include <libintl.h> // For messages
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning what is _GLIBCPP_C_LOCALE_GNU for
-+#endif
-+#define _GLIBCPP_C_LOCALE_GNU 1
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix categories
-+#endif
-+// #define _GLIBCPP_NUM_CATEGORIES 6
-+#define _GLIBCPP_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<typename _Tv>
-+ int
-+ __convert_from_v(char* __out, const int __size, const char* __fmt,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ _Tv __v, const __c_locale& __cloc, int __prec = -1)
-+ {
-+ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
-+#else
-+ _Tv __v, const __c_locale&, int __prec = -1)
-+ {
-+# ifdef __UCLIBC_HAS_LOCALE__
-+ char* __old = setlocale(LC_ALL, NULL);
-+ char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
-+ if (__sav)
-+ strcpy(__sav, __old);
-+ setlocale(LC_ALL, "C");
-+# endif
-+#endif
-+
-+ int __ret;
-+ if (__prec >= 0)
-+ __ret = snprintf(__out, __size, __fmt, __prec, __v);
-+ else
-+ __ret = snprintf(__out, __size, __fmt, __v);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __gnu_cxx::__uselocale(__old);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+ setlocale(LC_ALL, __sav);
-+ free(__sav);
-+#endif
-+ return __ret;
-+ }
-+}
-+
-+#endif
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2004-01-09 04:04:34.000000000 -0600
-@@ -0,0 +1,113 @@
-+// 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, 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.2.1.5 - Template class codecvt
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+namespace std
-+{
-+ // Specializations.
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+ codecvt_base::result
-+ codecvt<wchar_t, char, mbstate_t>::
-+ 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 = error;
-+ size_t __len = min(__from_end - __from, __to_end - __to);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_S_c_locale);
-+#endif
-+ size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+
-+ if (__conv == __len)
-+ {
-+ __from_next = __from;
-+ __to_next = __to + __conv;
-+ __ret = ok;
-+ }
-+ else if (__conv > 0 && __conv < __len)
-+ {
-+ __from_next = __from;
-+ __to_next = __to + __conv;
-+ __ret = partial;
-+ }
-+ else
-+ __ret = error;
-+
-+ return __ret;
-+ }
-+
-+ codecvt_base::result
-+ codecvt<wchar_t, char, mbstate_t>::
-+ 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 = error;
-+ size_t __len = min(__from_end - __from, __to_end - __to);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_S_c_locale);
-+#endif
-+ size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+
-+ if (__conv == __len)
-+ {
-+ __from_next = __from;
-+ __to_next = __to + __conv;
-+ __ret = ok;
-+ }
-+ else if (__conv > 0 && __conv < __len)
-+ {
-+ __from_next = __from;
-+ __to_next = __to + __conv;
-+ __ret = partial;
-+ }
-+ else
-+ __ret = error;
-+
-+ return __ret;
-+ }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h 2004-01-09 01:53:51.000000000 -0600
-@@ -0,0 +1,461 @@
-+// Locale support (codecvt) -*- C++ -*-
-+
-+// Copyright (C) 2000, 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, 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.2.1.5 Template class codecvt
-+//
-+
-+// Warning: this file is not meant for user inclusion. Use <locale>.
-+
-+// Written by Benjamin Kosnik <bkoz@cygnus.com>
-+
-+ // XXX
-+ // Define this here to codecvt.cc can have _S_max_size definition.
-+#define _GLIBCPP_USE___ENC_TRAITS 1
-+
-+ // Extension to use icov for dealing with character encodings,
-+ // including conversions and comparisons between various character
-+ // sets. This object encapsulates data that may need to be shared between
-+ // char_traits, codecvt and ctype.
-+ class __enc_traits
-+ {
-+ public:
-+ // Types:
-+ // NB: A conversion descriptor subsumes and enhances the
-+ // functionality of a simple state type such as mbstate_t.
-+ typedef iconv_t __desc_type;
-+
-+ protected:
-+ // Data Members:
-+ // Max size of charset encoding name
-+ static const int _S_max_size = 32;
-+ // Name of internal character set encoding.
-+ char _M_int_enc[_S_max_size];
-+ // Name of external character set encoding.
-+ char _M_ext_enc[_S_max_size];
-+
-+ // Conversion descriptor between external encoding to internal encoding.
-+ __desc_type _M_in_desc;
-+ // Conversion descriptor between internal encoding to external encoding.
-+ __desc_type _M_out_desc;
-+
-+ // Details the byte-order marker for the external encoding, if necessary.
-+ int _M_ext_bom;
-+
-+ // Details the byte-order marker for the internal encoding, if necessary.
-+ int _M_int_bom;
-+
-+ public:
-+ explicit __enc_traits()
-+ : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
-+ {
-+ memset(_M_int_enc, 0, _S_max_size);
-+ memset(_M_ext_enc, 0, _S_max_size);
-+ }
-+
-+ explicit __enc_traits(const char* __int, const char* __ext,
-+ int __ibom = 0, int __ebom = 0)
-+ : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
-+ {
-+ strncpy(_M_int_enc, __int, _S_max_size);
-+ strncpy(_M_ext_enc, __ext, _S_max_size);
-+ }
-+
-+ // 21.1.2 traits typedefs
-+ // p4
-+ // typedef STATE_T state_type
-+ // requires: state_type shall meet the requirements of
-+ // CopyConstructible types (20.1.3)
-+ __enc_traits(const __enc_traits& __obj): _M_in_desc(0), _M_out_desc(0)
-+ {
-+ strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
-+ strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
-+ _M_ext_bom = __obj._M_ext_bom;
-+ _M_int_bom = __obj._M_int_bom;
-+ }
-+
-+ // Need assignment operator as well.
-+ __enc_traits&
-+ operator=(const __enc_traits& __obj)
-+ {
-+ strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
-+ strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
-+ _M_in_desc = 0;
-+ _M_out_desc = 0;
-+ _M_ext_bom = __obj._M_ext_bom;
-+ _M_int_bom = __obj._M_int_bom;
-+ return *this;
-+ }
-+
-+ ~__enc_traits()
-+ {
-+ __desc_type __err = reinterpret_cast<iconv_t>(-1);
-+ if (_M_in_desc && _M_in_desc != __err)
-+ iconv_close(_M_in_desc);
-+ if (_M_out_desc && _M_out_desc != __err)
-+ iconv_close(_M_out_desc);
-+ }
-+
-+ void
-+ _M_init()
-+ {
-+ const __desc_type __err = reinterpret_cast<iconv_t>(-1);
-+ if (!_M_in_desc)
-+ {
-+ _M_in_desc = iconv_open(_M_int_enc, _M_ext_enc);
-+ if (_M_in_desc == __err)
-+ __throw_runtime_error("creating iconv input descriptor failed.");
-+ }
-+ if (!_M_out_desc)
-+ {
-+ _M_out_desc = iconv_open(_M_ext_enc, _M_int_enc);
-+ if (_M_out_desc == __err)
-+ __throw_runtime_error("creating iconv output descriptor failed.");
-+ }
-+ }
-+
-+ bool
-+ _M_good()
-+ {
-+ const __desc_type __err = reinterpret_cast<iconv_t>(-1);
-+ bool __test = _M_in_desc && _M_in_desc != __err;
-+ __test &= _M_out_desc && _M_out_desc != __err;
-+ return __test;
-+ }
-+
-+ const __desc_type*
-+ _M_get_in_descriptor()
-+ { return &_M_in_desc; }
-+
-+ const __desc_type*
-+ _M_get_out_descriptor()
-+ { return &_M_out_desc; }
-+
-+ int
-+ _M_get_external_bom()
-+ { return _M_ext_bom; }
-+
-+ int
-+ _M_get_internal_bom()
-+ { return _M_int_bom; }
-+
-+ const char*
-+ _M_get_internal_enc()
-+ { return _M_int_enc; }
-+
-+ const char*
-+ _M_get_external_enc()
-+ { return _M_ext_enc; }
-+ };
-+
-+ // Partial specialization
-+ // This specialization takes advantage of iconv to provide code
-+ // conversions between a large number of character encodings.
-+ template<typename _InternT, typename _ExternT>
-+ class codecvt<_InternT, _ExternT, __enc_traits>
-+ : public __codecvt_abstract_base<_InternT, _ExternT, __enc_traits>
-+ {
-+ public:
-+ // Types:
-+ typedef codecvt_base::result result;
-+ typedef _InternT intern_type;
-+ typedef _ExternT extern_type;
-+ typedef __enc_traits state_type;
-+ typedef __enc_traits::__desc_type __desc_type;
-+ typedef __enc_traits __enc_type;
-+
-+ // Data Members:
-+ static locale::id id;
-+
-+ explicit
-+ codecvt(size_t __refs = 0)
-+ : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
-+ { }
-+
-+ explicit
-+ codecvt(__enc_type* __enc, size_t __refs = 0)
-+ : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
-+ { }
-+
-+ protected:
-+ virtual
-+ ~codecvt() { }
-+
-+ virtual result
-+ 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;
-+
-+ virtual result
-+ do_unshift(state_type& __state, extern_type* __to,
-+ extern_type* __to_end, extern_type*& __to_next) const;
-+
-+ virtual result
-+ 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;
-+
-+ virtual int
-+ do_encoding() const throw();
-+
-+ virtual bool
-+ do_always_noconv() const throw();
-+
-+ virtual int
-+ do_length(const state_type&, const extern_type* __from,
-+ const extern_type* __end, size_t __max) const;
-+
-+ virtual int
-+ do_max_length() const throw();
-+ };
-+
-+ template<typename _InternT, typename _ExternT>
-+ locale::id
-+ codecvt<_InternT, _ExternT, __enc_traits>::id;
-+
-+ // This adaptor works around the signature problems of the second
-+ // argument to iconv(): SUSv2 and others use 'const char**', but glibc 2.2
-+ // uses 'char**', which matches the POSIX 1003.1-2001 standard.
-+ // Using this adaptor, g++ will do the work for us.
-+ template<typename _T>
-+ inline size_t
-+ __iconv_adaptor(size_t(*__func)(iconv_t, _T, size_t*, char**, size_t*),
-+ iconv_t __cd, char** __inbuf, size_t* __inbytes,
-+ char** __outbuf, size_t* __outbytes)
-+ { return __func(__cd, (_T)__inbuf, __inbytes, __outbuf, __outbytes); }
-+
-+ template<typename _InternT, typename _ExternT>
-+ codecvt_base::result
-+ codecvt<_InternT, _ExternT, __enc_traits>::
-+ 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 = codecvt_base::error;
-+ if (__state._M_good())
-+ {
-+ typedef state_type::__desc_type __desc_type;
-+ const __desc_type* __desc = __state._M_get_out_descriptor();
-+ const size_t __fmultiple = sizeof(intern_type);
-+ size_t __fbytes = __fmultiple * (__from_end - __from);
-+ const size_t __tmultiple = sizeof(extern_type);
-+ size_t __tbytes = __tmultiple * (__to_end - __to);
-+
-+ // Argument list for iconv specifies a byte sequence. Thus,
-+ // all to/from arrays must be brutally casted to char*.
-+ char* __cto = reinterpret_cast<char*>(__to);
-+ char* __cfrom;
-+ size_t __conv;
-+
-+ // Some encodings need a byte order marker as the first item
-+ // in the byte stream, to designate endian-ness. The default
-+ // value for the byte order marker is NULL, so if this is
-+ // the case, it's not necessary and we can just go on our
-+ // merry way.
-+ int __int_bom = __state._M_get_internal_bom();
-+ if (__int_bom)
-+ {
-+ size_t __size = __from_end - __from;
-+ intern_type* __cfixed = static_cast<intern_type*>(__builtin_alloca(sizeof(intern_type) * (__size + 1)));
-+ __cfixed[0] = static_cast<intern_type>(__int_bom);
-+ char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
-+ __cfrom = reinterpret_cast<char*>(__cfixed);
-+ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
-+ &__fbytes, &__cto, &__tbytes);
-+ }
-+ else
-+ {
-+ intern_type* __cfixed = const_cast<intern_type*>(__from);
-+ __cfrom = reinterpret_cast<char*>(__cfixed);
-+ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom, &__fbytes,
-+ &__cto, &__tbytes);
-+ }
-+
-+ if (__conv != size_t(-1))
-+ {
-+ __from_next = reinterpret_cast<const intern_type*>(__cfrom);
-+ __to_next = reinterpret_cast<extern_type*>(__cto);
-+ __ret = codecvt_base::ok;
-+ }
-+ else
-+ {
-+ if (__fbytes < __fmultiple * (__from_end - __from))
-+ {
-+ __from_next = reinterpret_cast<const intern_type*>(__cfrom);
-+ __to_next = reinterpret_cast<extern_type*>(__cto);
-+ __ret = codecvt_base::partial;
-+ }
-+ else
-+ __ret = codecvt_base::error;
-+ }
-+ }
-+ return __ret;
-+ }
-+
-+ template<typename _InternT, typename _ExternT>
-+ codecvt_base::result
-+ codecvt<_InternT, _ExternT, __enc_traits>::
-+ do_unshift(state_type& __state, extern_type* __to,
-+ extern_type* __to_end, extern_type*& __to_next) const
-+ {
-+ result __ret = codecvt_base::error;
-+ if (__state._M_good())
-+ {
-+ typedef state_type::__desc_type __desc_type;
-+ const __desc_type* __desc = __state._M_get_in_descriptor();
-+ const size_t __tmultiple = sizeof(intern_type);
-+ size_t __tlen = __tmultiple * (__to_end - __to);
-+
-+ // Argument list for iconv specifies a byte sequence. Thus,
-+ // all to/from arrays must be brutally casted to char*.
-+ char* __cto = reinterpret_cast<char*>(__to);
-+ size_t __conv = __iconv_adaptor(iconv,*__desc, NULL, NULL,
-+ &__cto, &__tlen);
-+
-+ if (__conv != size_t(-1))
-+ {
-+ __to_next = reinterpret_cast<extern_type*>(__cto);
-+ if (__tlen == __tmultiple * (__to_end - __to))
-+ __ret = codecvt_base::noconv;
-+ else if (__tlen == 0)
-+ __ret = codecvt_base::ok;
-+ else
-+ __ret = codecvt_base::partial;
-+ }
-+ else
-+ __ret = codecvt_base::error;
-+ }
-+ return __ret;
-+ }
-+
-+ template<typename _InternT, typename _ExternT>
-+ codecvt_base::result
-+ codecvt<_InternT, _ExternT, __enc_traits>::
-+ 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 = codecvt_base::error;
-+ if (__state._M_good())
-+ {
-+ typedef state_type::__desc_type __desc_type;
-+ const __desc_type* __desc = __state._M_get_in_descriptor();
-+ const size_t __fmultiple = sizeof(extern_type);
-+ size_t __flen = __fmultiple * (__from_end - __from);
-+ const size_t __tmultiple = sizeof(intern_type);
-+ size_t __tlen = __tmultiple * (__to_end - __to);
-+
-+ // Argument list for iconv specifies a byte sequence. Thus,
-+ // all to/from arrays must be brutally casted to char*.
-+ char* __cto = reinterpret_cast<char*>(__to);
-+ char* __cfrom;
-+ size_t __conv;
-+
-+ // Some encodings need a byte order marker as the first item
-+ // in the byte stream, to designate endian-ness. The default
-+ // value for the byte order marker is NULL, so if this is
-+ // the case, it's not necessary and we can just go on our
-+ // merry way.
-+ int __ext_bom = __state._M_get_external_bom();
-+ if (__ext_bom)
-+ {
-+ size_t __size = __from_end - __from;
-+ extern_type* __cfixed = static_cast<extern_type*>(__builtin_alloca(sizeof(extern_type) * (__size + 1)));
-+ __cfixed[0] = static_cast<extern_type>(__ext_bom);
-+ char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
-+ __cfrom = reinterpret_cast<char*>(__cfixed);
-+ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
-+ &__flen, &__cto, &__tlen);
-+ }
-+ else
-+ {
-+ extern_type* __cfixed = const_cast<extern_type*>(__from);
-+ __cfrom = reinterpret_cast<char*>(__cfixed);
-+ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
-+ &__flen, &__cto, &__tlen);
-+ }
-+
-+
-+ if (__conv != size_t(-1))
-+ {
-+ __from_next = reinterpret_cast<const extern_type*>(__cfrom);
-+ __to_next = reinterpret_cast<intern_type*>(__cto);
-+ __ret = codecvt_base::ok;
-+ }
-+ else
-+ {
-+ if (__flen < static_cast<size_t>(__from_end - __from))
-+ {
-+ __from_next = reinterpret_cast<const extern_type*>(__cfrom);
-+ __to_next = reinterpret_cast<intern_type*>(__cto);
-+ __ret = codecvt_base::partial;
-+ }
-+ else
-+ __ret = codecvt_base::error;
-+ }
-+ }
-+ return __ret;
-+ }
-+
-+ template<typename _InternT, typename _ExternT>
-+ int
-+ codecvt<_InternT, _ExternT, __enc_traits>::
-+ do_encoding() const throw()
-+ {
-+ int __ret = 0;
-+ if (sizeof(_ExternT) <= sizeof(_InternT))
-+ __ret = sizeof(_InternT)/sizeof(_ExternT);
-+ return __ret;
-+ }
-+
-+ template<typename _InternT, typename _ExternT>
-+ bool
-+ codecvt<_InternT, _ExternT, __enc_traits>::
-+ do_always_noconv() const throw()
-+ { return false; }
-+
-+ template<typename _InternT, typename _ExternT>
-+ int
-+ codecvt<_InternT, _ExternT, __enc_traits>::
-+ do_length(const state_type&, const extern_type* __from,
-+ const extern_type* __end, size_t __max) const
-+ { return min(__max, static_cast<size_t>(__end - __from)); }
-+
-+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
-+// 74. Garbled text for codecvt::do_max_length
-+ template<typename _InternT, typename _ExternT>
-+ int
-+ codecvt<_InternT, _ExternT, __enc_traits>::
-+ do_max_length() const throw()
-+ { return 1; }
-+#endif
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc 2004-01-09 08:06:24.000000000 -0600
-@@ -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, 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.2.4.1.2 collate virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#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<char>::_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<char>::_M_transform(char* __to, const char* __from,
-+ size_t __n) const
-+ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+ template<>
-+ int
-+ collate<wchar_t>::_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<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
-+ size_t __n) const
-+ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2004-01-09 08:15:41.000000000 -0600
-@@ -0,0 +1,274 @@
-+// std::ctype implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 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.
-+
-+//
-+// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#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<char> specializations are in src/locale.cc and
-+ // various /config/os/* files.
-+ template<>
-+ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
-+ : ctype<char>(0, false, __refs)
-+ {
-+ _S_destroy_c_locale(_M_c_locale_ctype);
-+ _S_create_c_locale(_M_c_locale_ctype, __s);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ _M_toupper = _M_c_locale_ctype->__ctype_toupper;
-+ _M_tolower = _M_c_locale_ctype->__ctype_tolower;
-+ _M_table = _M_c_locale_ctype->__ctype_b;
-+#endif
-+ }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+ ctype<wchar_t>::__wmask_type
-+ ctype<wchar_t>::_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 = 0;
-+ }
-+ return __ret;
-+ };
-+
-+ wchar_t
-+ ctype<wchar_t>::do_toupper(wchar_t __c) const
-+ { return __towupper_l(__c, _M_c_locale_ctype); }
-+
-+ const wchar_t*
-+ ctype<wchar_t>::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<wchar_t>::do_tolower(wchar_t __c) const
-+ { return __towlower_l(__c, _M_c_locale_ctype); }
-+
-+ const wchar_t*
-+ ctype<wchar_t>::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<wchar_t>::
-+ do_is(mask __m, wchar_t __c) const
-+ {
-+ // Highest bitmask in ctype_base == 10, but extra in "C"
-+ // library for blank.
-+ bool __ret = false;
-+ const size_t __bitmasksize = 11;
-+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+ {
-+ const mask __bit = static_cast<mask>(_ISbit(__bitcur));
-+ if (__m & __bit)
-+ __ret |= __iswctype_l(__c, _M_convert_to_wmask(__bit),
-+ _M_c_locale_ctype);
-+ }
-+ return __ret;
-+ }
-+
-+ const wchar_t*
-+ ctype<wchar_t>::
-+ 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)
-+ {
-+ const mask __bit = static_cast<mask>(_ISbit(__bitcur));
-+ if (__iswctype_l(*__lo, _M_convert_to_wmask(__bit),
-+ _M_c_locale_ctype))
-+ __m |= __bit;
-+ }
-+ *__vec = __m;
-+ }
-+ return __hi;
-+ }
-+
-+ const wchar_t*
-+ ctype<wchar_t>::
-+ 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<wchar_t>::
-+ 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<wchar_t>::
-+ do_widen(char __c) const
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+ wchar_t __ret = btowc(__c);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+ return __ret;
-+ }
-+
-+ const char*
-+ ctype<wchar_t>::
-+ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+ mbstate_t __state;
-+ memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
-+ mbsrtowcs(__dest, &__lo, __hi - __lo, &__state);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+ return __hi;
-+ }
-+
-+ char
-+ ctype<wchar_t>::
-+ do_narrow(wchar_t __wc, char __dfault) const
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+ int __c = wctob(__wc);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+ return (__c == EOF ? __dfault : static_cast<char>(__c));
-+ }
-+
-+ const wchar_t*
-+ ctype<wchar_t>::
-+ 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
-+ size_t __offset = 0;
-+ while (true)
-+ {
-+ const wchar_t* __start = __lo + __offset;
-+ size_t __len = __hi - __start;
-+
-+ mbstate_t __state;
-+ memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
-+ size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state);
-+ if (__con != __len && __start != 0)
-+ {
-+ __offset = __start - __lo;
-+ __dest[__offset++] = __dfault;
-+ }
-+ else
-+ break;
-+ }
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+ return __hi;
-+ }
-+#endif // _GLIBCPP_USE_WCHAR_T
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc 2004-01-09 08:46:16.000000000 -0600
-@@ -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, 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.2.7.1.2 messages virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#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<char>::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<const char*>(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 _GLIBCPP_USE_WCHAR_T
-+ template<>
-+ wstring
-+ messages<wchar_t>::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
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h 2004-01-09 08:52:48.000000000 -0600
-@@ -0,0 +1,122 @@
-+// std::messages implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 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.
-+
-+//
-+// ISO C++ 14882: 22.2.7.1.2 messages functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#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<typename _CharT>
-+ messages<_CharT>::messages(size_t __refs)
-+ : locale::facet(__refs)
-+ {
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+ _M_name_messages = _S_c_name;
-+#endif
-+ _M_c_locale_messages = _S_c_locale;
-+ }
-+
-+ template<typename _CharT>
-+ messages<_CharT>::messages(__c_locale __cloc,
-+ const char* __s, size_t __refs)
-+ : locale::facet(__refs)
-+ {
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+ _M_name_messages = new char[strlen(__s) + 1];
-+ strcpy(_M_name_messages, __s);
-+#endif
-+ _M_c_locale_messages = _S_clone_c_locale(__cloc);
-+ }
-+
-+ template<typename _CharT>
-+ typename messages<_CharT>::catalog
-+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
-+ const char* __dir) const
-+ {
-+ __bindtextdomain(__s.c_str(), __dir);
-+ return this->do_open(__s, __loc);
-+ }
-+
-+ // Virtual member functions.
-+ template<typename _CharT>
-+ messages<_CharT>::~messages()
-+ {
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+ if (_S_c_name != _M_name_messages)
-+ delete [] _M_name_messages;
-+#endif
-+ _S_destroy_c_locale(_M_c_locale_messages);
-+ }
-+
-+ template<typename _CharT>
-+ typename messages<_CharT>::catalog
-+ messages<_CharT>::do_open(const basic_string<char>& __s,
-+ const locale&) const
-+ {
-+ // No error checking is done, assume the catalog exists and can
-+ // be used.
-+ __textdomain(__s.c_str());
-+ return 0;
-+ }
-+
-+ template<typename _CharT>
-+ void
-+ messages<_CharT>::do_close(catalog) const
-+ { }
-+
-+ // messages_byname
-+ template<typename _CharT>
-+ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
-+ : messages<_CharT>(__refs)
-+ {
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+ if (_S_c_name != _M_name_messages)
-+ delete [] _M_name_messages;
-+ _M_name_messages = new char[strlen(__s) + 1];
-+ strcpy(_M_name_messages, __s);
-+#endif
-+ _S_destroy_c_locale(_M_c_locale_messages);
-+ _S_create_c_locale(_M_c_locale_messages, __s);
-+ }
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2004-01-09 18:20:23.000000000 -0600
-@@ -0,0 +1,578 @@
-+// std::moneypunct 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, 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.2.6.3.2 moneypunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#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.
-+ if (__space)
-+ {
-+ // Pattern starts with sign.
-+ if (__precedes)
-+ {
-+ __ret.field[1] = symbol;
-+ __ret.field[2] = space;
-+ __ret.field[3] = value;
-+ }
-+ else
-+ {
-+ __ret.field[1] = value;
-+ __ret.field[2] = space;
-+ __ret.field[3] = symbol;
-+ }
-+ __ret.field[0] = sign;
-+ }
-+ 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[0] = sign;
-+ __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[1] = space;
-+ __ret.field[2] = value;
-+ }
-+ else
-+ {
-+ __ret.field[0] = value;
-+ __ret.field[1] = space;
-+ __ret.field[2] = symbol;
-+ }
-+ __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 (__space)
-+ {
-+ // Have space.
-+ if (__precedes)
-+ {
-+ __ret.field[0] = sign;
-+ __ret.field[1] = symbol;
-+ __ret.field[2] = space;
-+ __ret.field[3] = value;
-+ }
-+ else
-+ {
-+ __ret.field[0] = value;
-+ __ret.field[1] = space;
-+ __ret.field[2] = sign;
-+ __ret.field[3] = symbol;
-+ }
-+ }
-+ else
-+ {
-+ // Have none.
-+ if (__precedes)
-+ {
-+ __ret.field[0] = sign;
-+ __ret.field[1] = symbol;
-+ __ret.field[2] = value;
-+ }
-+ else
-+ {
-+ __ret.field[0] = value;
-+ __ret.field[1] = sign;
-+ __ret.field[2] = symbol;
-+ }
-+ __ret.field[3] = none;
-+ }
-+ break;
-+ case 4:
-+ // 4 The sign immediately follows the symbol.
-+ if (__space)
-+ {
-+ // Have space.
-+ if (__precedes)
-+ {
-+ __ret.field[0] = symbol;
-+ __ret.field[1] = sign;
-+ __ret.field[2] = space;
-+ __ret.field[3] = value;
-+ }
-+ else
-+ {
-+ __ret.field[0] = value;
-+ __ret.field[1] = space;
-+ __ret.field[2] = symbol;
-+ __ret.field[3] = sign;
-+ }
-+ }
-+ else
-+ {
-+ // Have none.
-+ if (__precedes)
-+ {
-+ __ret.field[0] = symbol;
-+ __ret.field[1] = sign;
-+ __ret.field[2] = value;
-+ }
-+ else
-+ {
-+ __ret.field[0] = value;
-+ __ret.field[1] = symbol;
-+ __ret.field[2] = sign;
-+ }
-+ __ret.field[3] = none;
-+ }
-+ break;
-+ default:
-+ ;
-+ }
-+ return __ret;
-+ }
-+
-+ template<>
-+ void
-+ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
-+ const char*)
-+ {
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_decimal_point = '.';
-+ _M_thousands_sep = ',';
-+ _M_grouping = "";
-+ _M_curr_symbol = "";
-+ _M_positive_sign = "";
-+ _M_negative_sign = "";
-+ _M_frac_digits = 0;
-+ _M_pos_format = money_base::_S_default_pattern;
-+ _M_neg_format = money_base::_S_default_pattern;
-+ }
-+ else
-+ {
-+ // Named locale.
-+ _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
-+ _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
-+ _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+ _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+
-+ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+ if (!__nposn)
-+ _M_negative_sign = "()";
-+ else
-+ _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+
-+ // _Intl == true
-+ _M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
-+ _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_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_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
-+ }
-+ }
-+
-+ template<>
-+ void
-+ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
-+ const char*)
-+ {
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_decimal_point = '.';
-+ _M_thousands_sep = ',';
-+ _M_grouping = "";
-+ _M_curr_symbol = "";
-+ _M_positive_sign = "";
-+ _M_negative_sign = "";
-+ _M_frac_digits = 0;
-+ _M_pos_format = money_base::_S_default_pattern;
-+ _M_neg_format = money_base::_S_default_pattern;
-+ }
-+ else
-+ {
-+ // Named locale.
-+ _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
-+ _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
-+ _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+ _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+
-+ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+ if (!__nposn)
-+ _M_negative_sign = "()";
-+ else
-+ _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+
-+ // _Intl == false
-+ _M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
-+ _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_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_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
-+ }
-+ }
-+
-+ template<>
-+ moneypunct<char, true>::~moneypunct()
-+ { }
-+
-+ template<>
-+ moneypunct<char, false>::~moneypunct()
-+ { }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+ template<>
-+ void
-+ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ const char*)
-+#else
-+ const char* __name)
-+#endif
-+ {
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_decimal_point = L'.';
-+ _M_thousands_sep = L',';
-+ _M_grouping = "";
-+ _M_curr_symbol = L"";
-+ _M_positive_sign = L"";
-+ _M_negative_sign = L"";
-+ _M_frac_digits = 0;
-+ _M_pos_format = money_base::_S_default_pattern;
-+ _M_neg_format = money_base::_S_default_pattern;
-+ }
-+ 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
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+ _M_decimal_point = __cloc->decimal_point_wc;
-+ _M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+ _M_decimal_point = __global_locale->decimal_point_wc;
-+ _M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+ _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
-+
-+ _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
-+#endif
-+ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+
-+ 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);
-+
-+ mbstate_t __state;
-+ size_t __len = strlen(__cpossign);
-+ if (__len)
-+ {
-+ ++__len;
-+ memset(&__state, 0, sizeof(mbstate_t));
-+ wchar_t* __wcs = new wchar_t[__len];
-+ mbsrtowcs(__wcs, &__cpossign, __len, &__state);
-+ _M_positive_sign = __wcs;
-+ }
-+ else
-+ _M_positive_sign = L"";
-+
-+ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+ __len = strlen(__cnegsign);
-+ if (!__nposn)
-+ _M_negative_sign = L"()";
-+ else if (__len)
-+ {
-+ ++__len;
-+ memset(&__state, 0, sizeof(mbstate_t));
-+ wchar_t* __wcs = new wchar_t[__len];
-+ mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
-+ _M_negative_sign = __wcs;
-+ }
-+ else
-+ _M_negative_sign = L"";
-+
-+ // _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_curr_symbol = __wcs;
-+ }
-+ else
-+ _M_curr_symbol = L"";
-+
-+ _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_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_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<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ const char*)
-+#else
-+ const char* __name)
-+#endif
-+ {
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_decimal_point = L'.';
-+ _M_thousands_sep = L',';
-+ _M_grouping = "";
-+ _M_curr_symbol = L"";
-+ _M_positive_sign = L"";
-+ _M_negative_sign = L"";
-+ _M_frac_digits = 0;
-+ _M_pos_format = money_base::_S_default_pattern;
-+ _M_neg_format = money_base::_S_default_pattern;
-+ }
-+ 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
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+ _M_decimal_point = __cloc->decimal_point_wc;
-+ _M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+ _M_decimal_point = __global_locale->decimal_point_wc;
-+ _M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+ _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
-+ _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
-+#endif
-+ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+
-+ 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);
-+
-+ mbstate_t __state;
-+ size_t __len;
-+ __len = strlen(__cpossign);
-+ if (__len)
-+ {
-+ ++__len;
-+ memset(&__state, 0, sizeof(mbstate_t));
-+ wchar_t* __wcs = new wchar_t[__len];
-+ mbsrtowcs(__wcs, &__cpossign, __len, &__state);
-+ _M_positive_sign = __wcs;
-+ }
-+ else
-+ _M_positive_sign = L"";
-+
-+ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+ __len = strlen(__cnegsign);
-+ if (!__nposn)
-+ _M_negative_sign = L"()";
-+ else if (__len)
-+ {
-+ ++__len;
-+ memset(&__state, 0, sizeof(mbstate_t));
-+ wchar_t* __wcs = new wchar_t[__len];
-+ mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
-+ _M_negative_sign = __wcs;
-+ }
-+ else
-+ _M_negative_sign = L"";
-+
-+ // _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_curr_symbol = __wcs;
-+ }
-+ else
-+ _M_curr_symbol = L"";
-+
-+ _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_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_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#else
-+ setlocale(LC_ALL, __old);
-+ free(__old);
-+#endif
-+ }
-+ }
-+
-+ template<>
-+ moneypunct<wchar_t, true>::~moneypunct()
-+ {
-+ if (wcslen(_M_positive_sign))
-+ delete [] _M_positive_sign;
-+ if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
-+ delete [] _M_negative_sign;
-+ if (wcslen(_M_curr_symbol))
-+ delete [] _M_curr_symbol;
-+ }
-+
-+ template<>
-+ moneypunct<wchar_t, false>::~moneypunct()
-+ {
-+ if (wcslen(_M_positive_sign))
-+ delete [] _M_positive_sign;
-+ if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
-+ delete [] _M_negative_sign;
-+ if (wcslen(_M_curr_symbol))
-+ delete [] _M_curr_symbol;
-+ }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2004-01-09 18:20:59.000000000 -0600
-@@ -0,0 +1,129 @@
-+// std::numpunct 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, 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.2.3.1.2 numpunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#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<char>::_M_initialize_numpunct(__c_locale __cloc)
-+ {
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_decimal_point = '.';
-+ _M_thousands_sep = ',';
-+ _M_grouping = "";
-+ }
-+ else
-+ {
-+ // Named locale.
-+ _M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
-+ _M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __cloc));
-+ // Check for NUL, which implies no grouping.
-+ if (_M_thousands_sep == '\0')
-+ _M_grouping = "";
-+ else
-+ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+ }
-+ // NB: There is no way to extact this info from posix locales.
-+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+ _M_truename = "true";
-+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+ _M_falsename = "false";
-+ }
-+
-+ template<>
-+ numpunct<char>::~numpunct()
-+ { }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+ template<>
-+ void
-+ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
-+ {
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_decimal_point = L'.';
-+ _M_thousands_sep = L',';
-+ _M_grouping = "";
-+ }
-+ else
-+ {
-+ // Named locale.
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+ _M_decimal_point = __cloc->decimal_point_wc;
-+ _M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+ _M_decimal_point = __global_locale->decimal_point_wc;
-+ _M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+ _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
-+ _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
-+#endif
-+ if (_M_thousands_sep == L'\0')
-+ _M_grouping = "";
-+ else
-+ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+ }
-+ // NB: There is no way to extact this info from posix locales.
-+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+ _M_truename = L"true";
-+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+ _M_falsename = L"false";
-+ }
-+
-+ template<>
-+ numpunct<wchar_t>::~numpunct()
-+ { }
-+ #endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-01-09 08:25:03.000000000 -0600
-@@ -0,0 +1,341 @@
-+// std::time_get, std::time_put implementation, 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, 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.2.5.1.2 - time_get virtual functions
-+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#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<char>::
-+ _M_put(char* __s, size_t __maxlen, const char* __format,
-+ const tm* __tm) const
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
-+#else
-+ char* __old = strdup(setlocale(LC_ALL, NULL));
-+ setlocale(LC_ALL, _M_name_timepunct);
-+ strftime(__s, __maxlen, __format, __tm);
-+ setlocale(LC_ALL, __old);
-+ free(__old);
-+#endif
-+ }
-+
-+ template<>
-+ void
-+ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
-+ {
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_c_locale_timepunct = _S_c_locale;
-+
-+ _M_date_format = "%m/%d/%y";
-+ _M_date_era_format = "%m/%d/%y";
-+ _M_time_format = "%H:%M:%S";
-+ _M_time_era_format = "%H:%M:%S";
-+ _M_date_time_format = "";
-+ _M_date_time_era_format = "";
-+ _M_am = "AM";
-+ _M_pm = "PM";
-+ _M_am_pm_format = "";
-+
-+ // Day names, starting with "C"'s Sunday.
-+ _M_day1 = "Sunday";
-+ _M_day2 = "Monday";
-+ _M_day3 = "Tuesday";
-+ _M_day4 = "Wednesday";
-+ _M_day5 = "Thursday";
-+ _M_day6 = "Friday";
-+ _M_day7 = "Saturday";
-+
-+ // Abbreviated day names, starting with "C"'s Sun.
-+ _M_day_a1 = "Sun";
-+ _M_day_a2 = "Mon";
-+ _M_day_a3 = "Tue";
-+ _M_day_a4 = "Wed";
-+ _M_day_a5 = "Thu";
-+ _M_day_a6 = "Fri";
-+ _M_day_a7 = "Sat";
-+
-+ // Month names, starting with "C"'s January.
-+ _M_month01 = "January";
-+ _M_month02 = "February";
-+ _M_month03 = "March";
-+ _M_month04 = "April";
-+ _M_month05 = "May";
-+ _M_month06 = "June";
-+ _M_month07 = "July";
-+ _M_month08 = "August";
-+ _M_month09 = "September";
-+ _M_month10 = "October";
-+ _M_month11 = "November";
-+ _M_month12 = "December";
-+
-+ // Abbreviated month names, starting with "C"'s Jan.
-+ _M_month_a01 = "Jan";
-+ _M_month_a02 = "Feb";
-+ _M_month_a03 = "Mar";
-+ _M_month_a04 = "Apr";
-+ _M_month_a05 = "May";
-+ _M_month_a06 = "Jun";
-+ _M_month_a07 = "July";
-+ _M_month_a08 = "Aug";
-+ _M_month_a09 = "Sep";
-+ _M_month_a10 = "Oct";
-+ _M_month_a11 = "Nov";
-+ _M_month_a12 = "Dec";
-+ }
-+ else
-+ {
-+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
-+
-+ _M_date_format = __nl_langinfo_l(D_FMT, __cloc);
-+ _M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
-+ _M_time_format = __nl_langinfo_l(T_FMT, __cloc);
-+ _M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
-+ _M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
-+ _M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
-+ _M_am = __nl_langinfo_l(AM_STR, __cloc);
-+ _M_pm = __nl_langinfo_l(PM_STR, __cloc);
-+ _M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
-+
-+ // Day names, starting with "C"'s Sunday.
-+ _M_day1 = __nl_langinfo_l(DAY_1, __cloc);
-+ _M_day2 = __nl_langinfo_l(DAY_2, __cloc);
-+ _M_day3 = __nl_langinfo_l(DAY_3, __cloc);
-+ _M_day4 = __nl_langinfo_l(DAY_4, __cloc);
-+ _M_day5 = __nl_langinfo_l(DAY_5, __cloc);
-+ _M_day6 = __nl_langinfo_l(DAY_6, __cloc);
-+ _M_day7 = __nl_langinfo_l(DAY_7, __cloc);
-+
-+ // Abbreviated day names, starting with "C"'s Sun.
-+ _M_day_a1 = __nl_langinfo_l(ABDAY_1, __cloc);
-+ _M_day_a2 = __nl_langinfo_l(ABDAY_2, __cloc);
-+ _M_day_a3 = __nl_langinfo_l(ABDAY_3, __cloc);
-+ _M_day_a4 = __nl_langinfo_l(ABDAY_4, __cloc);
-+ _M_day_a5 = __nl_langinfo_l(ABDAY_5, __cloc);
-+ _M_day_a6 = __nl_langinfo_l(ABDAY_6, __cloc);
-+ _M_day_a7 = __nl_langinfo_l(ABDAY_7, __cloc);
-+
-+ // Month names, starting with "C"'s January.
-+ _M_month01 = __nl_langinfo_l(MON_1, __cloc);
-+ _M_month02 = __nl_langinfo_l(MON_2, __cloc);
-+ _M_month03 = __nl_langinfo_l(MON_3, __cloc);
-+ _M_month04 = __nl_langinfo_l(MON_4, __cloc);
-+ _M_month05 = __nl_langinfo_l(MON_5, __cloc);
-+ _M_month06 = __nl_langinfo_l(MON_6, __cloc);
-+ _M_month07 = __nl_langinfo_l(MON_7, __cloc);
-+ _M_month08 = __nl_langinfo_l(MON_8, __cloc);
-+ _M_month09 = __nl_langinfo_l(MON_9, __cloc);
-+ _M_month10 = __nl_langinfo_l(MON_10, __cloc);
-+ _M_month11 = __nl_langinfo_l(MON_11, __cloc);
-+ _M_month12 = __nl_langinfo_l(MON_12, __cloc);
-+
-+ // Abbreviated month names, starting with "C"'s Jan.
-+ _M_month_a01 = __nl_langinfo_l(ABMON_1, __cloc);
-+ _M_month_a02 = __nl_langinfo_l(ABMON_2, __cloc);
-+ _M_month_a03 = __nl_langinfo_l(ABMON_3, __cloc);
-+ _M_month_a04 = __nl_langinfo_l(ABMON_4, __cloc);
-+ _M_month_a05 = __nl_langinfo_l(ABMON_5, __cloc);
-+ _M_month_a06 = __nl_langinfo_l(ABMON_6, __cloc);
-+ _M_month_a07 = __nl_langinfo_l(ABMON_7, __cloc);
-+ _M_month_a08 = __nl_langinfo_l(ABMON_8, __cloc);
-+ _M_month_a09 = __nl_langinfo_l(ABMON_9, __cloc);
-+ _M_month_a10 = __nl_langinfo_l(ABMON_10, __cloc);
-+ _M_month_a11 = __nl_langinfo_l(ABMON_11, __cloc);
-+ _M_month_a12 = __nl_langinfo_l(ABMON_12, __cloc);
-+ }
-+ }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+ template<>
-+ void
-+ __timepunct<wchar_t>::
-+ _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);
-+#else
-+ char* __old = strdup(setlocale(LC_ALL, NULL));
-+ setlocale(LC_ALL, _M_name_timepunct);
-+ wcsftime(__s, __maxlen, __format, __tm);
-+ setlocale(LC_ALL, __old);
-+ free(__old);
-+#endif
-+ }
-+
-+ template<>
-+ void
-+ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
-+ {
-+#warning wide time stuff
-+// if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_c_locale_timepunct = _S_c_locale;
-+
-+ _M_date_format = L"%m/%d/%y";
-+ _M_date_era_format = L"%m/%d/%y";
-+ _M_time_format = L"%H:%M:%S";
-+ _M_time_era_format = L"%H:%M:%S";
-+ _M_date_time_format = L"";
-+ _M_date_time_era_format = L"";
-+ _M_am = L"AM";
-+ _M_pm = L"PM";
-+ _M_am_pm_format = L"";
-+
-+ // Day names, starting with "C"'s Sunday.
-+ _M_day1 = L"Sunday";
-+ _M_day2 = L"Monday";
-+ _M_day3 = L"Tuesday";
-+ _M_day4 = L"Wednesday";
-+ _M_day5 = L"Thursday";
-+ _M_day6 = L"Friday";
-+ _M_day7 = L"Saturday";
-+
-+ // Abbreviated day names, starting with "C"'s Sun.
-+ _M_day_a1 = L"Sun";
-+ _M_day_a2 = L"Mon";
-+ _M_day_a3 = L"Tue";
-+ _M_day_a4 = L"Wed";
-+ _M_day_a5 = L"Thu";
-+ _M_day_a6 = L"Fri";
-+ _M_day_a7 = L"Sat";
-+
-+ // Month names, starting with "C"'s January.
-+ _M_month01 = L"January";
-+ _M_month02 = L"February";
-+ _M_month03 = L"March";
-+ _M_month04 = L"April";
-+ _M_month05 = L"May";
-+ _M_month06 = L"June";
-+ _M_month07 = L"July";
-+ _M_month08 = L"August";
-+ _M_month09 = L"September";
-+ _M_month10 = L"October";
-+ _M_month11 = L"November";
-+ _M_month12 = L"December";
-+
-+ // Abbreviated month names, starting with "C"'s Jan.
-+ _M_month_a01 = L"Jan";
-+ _M_month_a02 = L"Feb";
-+ _M_month_a03 = L"Mar";
-+ _M_month_a04 = L"Apr";
-+ _M_month_a05 = L"May";
-+ _M_month_a06 = L"Jun";
-+ _M_month_a07 = L"July";
-+ _M_month_a08 = L"Aug";
-+ _M_month_a09 = L"Sep";
-+ _M_month_a10 = L"Oct";
-+ _M_month_a11 = L"Nov";
-+ _M_month_a12 = L"Dec";
-+ }
-+#if 0
-+ else
-+ {
-+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
-+
-+ _M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
-+ _M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
-+ _M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
-+ _M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
-+ _M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
-+ _M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
-+ _M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
-+ _M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
-+ _M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
-+
-+ // Day names, starting with "C"'s Sunday.
-+ _M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
-+ _M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
-+ _M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
-+ _M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
-+ _M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
-+ _M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
-+ _M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
-+
-+ // Abbreviated day names, starting with "C"'s Sun.
-+ _M_day_a1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
-+ _M_day_a2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
-+ _M_day_a3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
-+ _M_day_a4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
-+ _M_day_a5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
-+ _M_day_a6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
-+ _M_day_a7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
-+
-+ // Month names, starting with "C"'s January.
-+ _M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
-+ _M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
-+ _M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
-+ _M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
-+ _M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
-+ _M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
-+ _M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
-+ _M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
-+ _M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
-+ _M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
-+ _M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
-+ _M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
-+
-+ // Abbreviated month names, starting with "C"'s Jan.
-+ _M_month_a01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
-+ _M_month_a02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
-+ _M_month_a03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
-+ _M_month_a04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
-+ _M_month_a05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
-+ _M_month_a06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
-+ _M_month_a07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
-+ _M_month_a08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
-+ _M_month_a09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
-+ _M_month_a10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
-+ _M_month_a11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
-+ _M_month_a12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
-+ }
-+#endif // 0
-+ }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h 2004-01-09 04:26:21.000000000 -0600
-@@ -0,0 +1,68 @@
-+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-+
-+// Copyright (C) 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.
-+
-+//
-+// 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 <bkoz@redhat.com>
-+
-+ template<typename _CharT>
-+ __timepunct<_CharT>::__timepunct(size_t __refs)
-+ : locale::facet(__refs)
-+ {
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+ _M_name_timepunct = _S_c_name;
-+#endif
-+ _M_initialize_timepunct();
-+ }
-+
-+ template<typename _CharT>
-+ __timepunct<_CharT>::__timepunct(__c_locale __cloc,
-+ const char* __s,
-+ size_t __refs)
-+ : locale::facet(__refs)
-+ {
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+ _M_name_timepunct = new char[strlen(__s) + 1];
-+ strcpy(_M_name_timepunct, __s);
-+#endif
-+ _M_initialize_timepunct(__cloc);
-+ }
-+
-+ template<typename _CharT>
-+ __timepunct<_CharT>::~__timepunct()
-+ {
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+ if (_S_c_name != _M_name_timepunct)
-+ delete [] _M_name_timepunct;
-+#endif
-+ _S_destroy_c_locale(_M_c_locale_timepunct);
-+ }
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h 2004-01-09 02:54:54.000000000 -0600
-@@ -0,0 +1,57 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 1997, 1998, 1999, 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
-+//
-+
-+// Information as gleaned from /usr/include/ctype.h
-+
-+ 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<char>::_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 = _ISgraph;
-+ static const mask cntrl = _IScntrl;
-+ static const mask punct = _ISpunct;
-+ static const mask alnum = _ISalnum;
-+ };
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h 2002-06-24 00:49:19.000000000 -0500
-@@ -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<char>::
-+ is(mask __m, char __c) const
-+ { return _M_table[static_cast<unsigned char>(__c)] & __m; }
-+
-+ const char*
-+ ctype<char>::
-+ is(const char* __low, const char* __high, mask* __vec) const
-+ {
-+ while (__low < __high)
-+ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
-+ return __high;
-+ }
-+
-+ const char*
-+ ctype<char>::
-+ scan_is(mask __m, const char* __low, const char* __high) const
-+ {
-+ while (__low < __high
-+ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
-+ ++__low;
-+ return __low;
-+ }
-+
-+ const char*
-+ ctype<char>::
-+ scan_not(mask __m, const char* __low, const char* __high) const
-+ {
-+ while (__low < __high
-+ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
-+ ++__low;
-+ return __low;
-+ }
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2004-01-09 03:34:53.000000000 -0600
-@@ -0,0 +1,90 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 1997, 1998, 1999, 2000, 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, 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<char>::classic_table() throw()
-+ {
-+ return __C_ctype_b;
-+ }
-+
-+ ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
-+ size_t __refs)
-+ : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
-+ {
-+ _M_toupper = __C_ctype_toupper;
-+ _M_tolower = __C_ctype_tolower;
-+ _M_table = __table ? __table : __C_ctype_b;
-+ _M_c_locale_ctype = _S_c_locale;
-+ }
-+
-+ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
-+ __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
-+ {
-+ _M_toupper = __C_ctype_toupper;
-+ _M_tolower = __C_ctype_tolower;
-+ _M_table = __table ? __table : __C_ctype_b;
-+ _M_c_locale_ctype = _S_c_locale;
-+ }
-+
-+ char
-+ ctype<char>::do_toupper(char __c) const
-+ { return _M_toupper[static_cast<unsigned char>(__c)]; }
-+
-+ const char*
-+ ctype<char>::do_toupper(char* __low, const char* __high) const
-+ {
-+ while (__low < __high)
-+ {
-+ *__low = _M_toupper[static_cast<unsigned char>(*__low)];
-+ ++__low;
-+ }
-+ return __high;
-+ }
-+
-+ char
-+ ctype<char>::do_tolower(char __c) const
-+ { return _M_tolower[static_cast<unsigned char>(__c)]; }
-+
-+ const char*
-+ ctype<char>::do_tolower(char* __low, const char* __high) const
-+ {
-+ while (__low < __high)
-+ {
-+ *__low = _M_tolower[static_cast<unsigned char>(*__low)];
-+ ++__low;
-+ }
-+ return __high;
-+ }
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h 2004-01-09 04:56:13.000000000 -0600
-@@ -0,0 +1,56 @@
-+// Specific definitions for GNU/Linux -*- C++ -*-
-+
-+// Copyright (C) 2000, 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, 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 _GLIBCPP_OS_DEFINES
-+#define _GLIBCPP_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 <features.h>
-+
-+// These systems have declarations mismatching those in libio.h by
-+// omitting throw qualifiers. Cleanest way out is to not provide
-+// throw-qualifiers at all. Defining it as empty here will make libio.h
-+// not define it.
-+#undef __THROW
-+#define __THROW
-+
-+// Tell Glibc not to try to provide its own inline versions of
-+// some math functions. Those cause assembly-time clashes with
-+// our definitions.
-+#define __NO_MATH_INLINES
-+
-+// We must not see the optimized string functions GNU libc defines.
-+#define __NO_STRING_INLINES
-+
-+#endif
+++ /dev/null
---- gcc/gcc/loop.c 14 Feb 2004 14:46:03 -0000 1.488.2.3
-+++ gcc/gcc/loop.c 28 Apr 2004 22:02:53 -0000
-@@ -929,6 +929,7 @@
- || (! (GET_CODE (SET_SRC (set)) == REG
- && (REGNO (SET_SRC (set))
- < FIRST_PSEUDO_REGISTER))))
-+ && regno >= FIRST_PSEUDO_REGISTER
- /* This test is not redundant; SET_SRC (set) might be
- a call-clobbered register and the life of REGNO
- might span a call. */
--- /dev/null
+Warning! The powerpc patch (rs6000/linux.h) is hack-ish and would
+definitely need to be improved to be acceptable upstream. Also,
+this patch isn't complete as it only supports i386, arm, mips, and
+powerpc (rs6000).
+diff -urN gcc-20011006/config.sub gcc-20011006-new/config.sub
+--- gcc-20011006/config.sub 2004-01-13 06:15:28.000000000 -0600
++++ gcc-20011006-new/config.sub 2004-01-10 11:09:35.000000000 -0600
+@@ -68,7 +68,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- linux-gnu*)
++ linux-gnu* | linux-uclibc*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -936,7 +936,8 @@
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* )
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+diff -urN gcc-20011006/gcc/config/arm/linux-elf.h gcc-20011006-new/gcc/config/arm/linux-elf.h
+--- gcc-20011006/gcc/config/arm/linux-elf.h 2004-01-13 06:15:28.000000000 -0600
++++ gcc-20011006-new/gcc/config/arm/linux-elf.h 2004-01-10 11:12:11.000000000 -0600
+@@ -90,6 +90,18 @@
+ #define ENDFILE_SPEC \
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+
++#ifdef USE_UCLIBC
++#define LINK_SPEC "%{h*} %{version:-v} \
++ %{b} %{Wl,*:%*} \
++ %{static:-Bstatic} \
++ %{shared:-shared} \
++ %{symbolic:-Bsymbolic} \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
++ -X \
++ %{mbig-endian:-EB}" \
++ SUBTARGET_EXTRA_LINK_SPEC
++#else
+ #define LINK_SPEC "%{h*} %{version:-v} \
+ %{b} %{Wl,*:%*} \
+ %{static:-Bstatic} \
+@@ -100,6 +112,7 @@
+ -X \
+ %{mbig-endian:-EB}" \
+ SUBTARGET_EXTRA_LINK_SPEC
++#endif
+
+ #undef CPP_PREDEFINES
+ #define CPP_PREDEFINES \
+diff -urN gcc-20011006/gcc/config/i386/linux.h gcc-20011006-new/gcc/config/i386/linux.h
+--- gcc-20011006/gcc/config/i386/linux.h 2001-04-03 17:38:59.000000000 -0500
++++ gcc-20011006-new/gcc/config/i386/linux.h 2004-01-10 11:15:38.000000000 -0600
+@@ -199,6 +199,15 @@
+ %{static:-static}}}"
+ #endif
+ #else
++#if defined USE_UCLIBC
++#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
++ %{!shared: \
++ %{!ibcs: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}}}"
++#else
+ #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+@@ -207,6 +216,7 @@
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{static:-static}}}"
+ #endif
++#endif
+
+ /* Get perform_* macros to build libgcc.a. */
+ #include "i386/perform.h"
+diff -urN gcc-20011006/gcc/config/mips/linux.h gcc-20011006-new/gcc/config/mips/linux.h
+--- gcc-20011006/gcc/config/mips/linux.h 2004-01-13 06:15:28.000000000 -0600
++++ gcc-20011006-new/gcc/config/mips/linux.h 2004-01-10 11:16:39.000000000 -0600
+@@ -154,6 +154,17 @@
+
+ /* Borrowed from sparc/linux.h */
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define LINK_SPEC \
++ "%(endian_spec) \
++ %{shared:-shared} \
++ %{!shared: \
++ %{!ibcs: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}}}"
++#else
+ #define LINK_SPEC \
+ "%(endian_spec) \
+ %{shared:-shared} \
+@@ -163,6 +174,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{static:-static}}}"
++#endif
+
+
+ #undef SUBTARGET_ASM_SPEC
+diff -urN old/gcc-20011006/gcc/config/mips/t-linux-uclibc gcc-20011006/gcc/config/mips/t-linux-uclibc
+--- old/gcc-20011006/gcc/config/mips/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-20011006/gcc/config/mips/t-linux-uclibc 2004-01-14 02:51:10.000000000 -0600
+@@ -0,0 +1 @@
++T_CFLAGS = -DUSE_UCLIBC
+diff -urN gcc-20011006/gcc/config/rs6000/linux.h gcc-20011006-new/gcc/config/rs6000/linux.h
+--- gcc-20011006/gcc/config/rs6000/linux.h 2001-04-03 17:38:59.000000000 -0500
++++ gcc-20011006-new/gcc/config/rs6000/linux.h 2004-01-10 11:15:38.000000000 -0600
+@@ -36,12 +36,21 @@
+ #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
+
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define LINK_SPEC "-m elf32ppclinux %{G*} %{shared:-shared} \
++ %{!shared: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}}"
++#else
+ #define LINK_SPEC "-m elf32ppclinux %{G*} %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{static:-static}}"
++#endif
+
+ #undef LIB_DEFAULT_SPEC
+ #define LIB_DEFAULT_SPEC "%(lib_linux)"
+diff -urN gcc-20011006/gcc/config/t-linux-uclibc gcc-20011006-new/gcc/config/t-linux-uclibc
+--- gcc-20011006/gcc/config/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-20011006-new/gcc/config/t-linux-uclibc 2004-01-10 11:18:46.000000000 -0600
+@@ -0,0 +1,18 @@
++T_CFLAGS = -DUSE_UCLIBC
++
++# Don't run fixproto
++STMP_FIXPROTO =
++
++# Don't install "assert.h" in gcc. We use the one in glibc.
++INSTALL_ASSERT_H =
++
++# Compile crtbeginS.o and crtendS.o with pic.
++CRTSTUFF_T_CFLAGS_S = -fPIC
++# Compile libgcc2.a with pic.
++TARGET_LIBGCC2_CFLAGS = -fPIC
++
++# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux
++# C library can handle them.
++LIBGCC1 =
++CROSS_LIBGCC1 =
++LIBGCC1_TEST =
+diff -urN gcc-20011006/gcc/configure gcc-20011006-new/gcc/configure
+--- gcc-20011006/gcc/configure 2004-01-13 06:15:28.000000000 -0600
++++ gcc-20011006-new/gcc/configure 2004-01-10 11:28:54.000000000 -0600
+@@ -3219,6 +3219,24 @@
+ ;;
+ esac
+ ;;
++ arm*-*-linux-uclibc*) # ARM GNU/Linux with ELF - uClibc
++ xm_file=arm/xm-linux.h
++ xmake_file=x-linux
++ tm_file="arm/linux-elf.h"
++ case $machine in
++ armv2*-*-*)
++ tm_file="arm/linux-elf26.h $tm_file"
++ ;;
++ esac
++ tmake_file="t-linux-uclibc arm/t-linux"
++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
++ gnu_ld=yes
++ case x${enable_threads} in
++ x | xyes | xpthreads | xposix)
++ thread_file='posix'
++ ;;
++ esac
++ ;;
+ arm*-*-aout)
+ tm_file=arm/aout.h
+ tmake_file=arm/t-bare
+@@ -3631,6 +3649,18 @@
+ thread_file='single'
+ fi
+ ;;
++ i[34567]86-*-linux*uclibc*) # Intel 80386's running GNU/Linux
++ # with ELF format using uClibc
++ xmake_file=x-linux
++ tm_file=i386/linux.h
++ tmake_file="t-linux-uclibc i386/t-crtstuff"
++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
++ gnu_ld=yes
++ float_format=i386
++ if test x$enable_threads = xyes; then
++ thread_file='posix'
++ fi
++ ;;
+ i[34567]86-*-linux-gnu*) # Intel 80386's running GNU/Linux
+ # aka GNU/Linux C library 6
+ xmake_file=x-linux
+@@ -4696,7 +4726,19 @@
+ # On NetBSD, the headers are already okay, except for math.h.
+ tmake_file=t-netbsd
+ ;;
+- mips*-*-linux*) # Linux MIPS, either endian.
++ mips*-*-linux-uclibc*) # Linux (uclibc) MIPS, either endian.
++ tmake_file=mips/t-linux-uclibc
++ xmake_file=x-linux
++ xm_file="xm-siglist.h ${xm_file}"
++ case $machine in
++ mipsel-*) tm_file="mips/elfl.h mips/linux.h" ;;
++ *) tm_file="mips/elf.h mips/linux.h" ;;
++ esac
++ extra_parts="crtbegin.o crtend.o"
++ gnu_ld=yes
++ gas=yes
++ ;;
++ mips*-*-linux*) # Linux MIPS, either endian.
+ xmake_file=x-linux
+ xm_file="xm-siglist.h ${xm_file}"
+ case $machine in
+@@ -5159,6 +5201,24 @@
+ thread_file='posix'
+ fi
+ ;;
++ powerpc-*-linux-uclibc*)
++ tm_file=rs6000/linux.h
++ xm_file="xm-siglist.h rs6000/xm-sysv4.h"
++ xm_defines="USG ${xm_defines}"
++ out_file=rs6000/rs6000.c
++ if test x$gas = xyes
++ then
++ tmake_file="rs6000/t-ppcos t-linux-uclibc rs6000/t-ppccomm"
++ else
++ tmake_file="rs6000/t-ppc t-linux-uclibc rs6000/t-ppccomm"
++ fi
++ xmake_file=x-linux
++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
++ extra_headers=ppc-asm.h
++ if test x$enable_threads = xyes; then
++ thread_file='posix'
++ fi
++ ;;
+ powerpc-wrs-vxworks*)
+ cpu_type=rs6000
+ xm_file="xm-siglist.h rs6000/xm-sysv4.h"
+diff -urN gcc-20011006/ltconfig gcc-20011006-new/ltconfig
+--- gcc-20011006/ltconfig 1999-06-21 21:35:12.000000000 -0500
++++ gcc-20011006-new/ltconfig 2004-01-10 11:34:23.000000000 -0600
+@@ -436,6 +436,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case "$host_os" in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1773,6 +1774,22 @@
+ fi
+ ;;
+
++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
++ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
++ file_magic_cmd=/usr/bin/file
++ file_magic_test_file=`echo /lib/libuClibc-*.so`
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ version_type=sunos
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
--- /dev/null
+diff -urN gcc-3.3.3-dist/boehm-gc/config.sub gcc-3.3.3/boehm-gc/config.sub
+--- gcc-3.3.3-dist/boehm-gc/config.sub 2002-02-11 22:37:53.000000000 -0600
++++ gcc-3.3.3/boehm-gc/config.sub 2004-08-12 04:47:51.000000000 -0500
+@@ -118,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
++ nto-qnx* | linux-gnu* | linux-uclibc* | storm-chaos* | os2-emx* | windows32-*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -1089,7 +1089,8 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+diff -urN gcc-3.3.3-dist/boehm-gc/configure gcc-3.3.3/boehm-gc/configure
+--- gcc-3.3.3-dist/boehm-gc/configure 2004-02-14 14:34:20.000000000 -0600
++++ gcc-3.3.3/boehm-gc/configure 2004-08-12 04:47:51.000000000 -0500
+@@ -1940,6 +1940,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN gcc-3.3.3-dist/config.sub gcc-3.3.3/config.sub
+--- gcc-3.3.3-dist/config.sub 2003-01-30 17:25:36.000000000 -0600
++++ gcc-3.3.3/config.sub 2004-08-12 04:47:51.000000000 -0500
+@@ -118,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
++ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -1112,7 +1112,8 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+diff -urN gcc-3.3.3-dist/gcc/config/arm/linux-elf.h gcc-3.3.3/gcc/config/arm/linux-elf.h
+--- gcc-3.3.3-dist/gcc/config/arm/linux-elf.h 2003-09-16 10:39:23.000000000 -0500
++++ gcc-3.3.3/gcc/config/arm/linux-elf.h 2004-08-12 04:47:51.000000000 -0500
+@@ -78,6 +78,18 @@
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define LINK_SPEC "%{h*} %{version:-v} \
++ %{b} %{Wl,*:%*} \
++ %{static:-Bstatic} \
++ %{shared:-shared} \
++ %{symbolic:-Bsymbolic} \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
++ -X \
++ %{mbig-endian:-EB}" \
++ SUBTARGET_EXTRA_LINK_SPEC
++#else
+ #define LINK_SPEC "%{h*} %{version:-v} \
+ %{b} %{Wl,*:%*} \
+ %{static:-Bstatic} \
+@@ -88,6 +100,7 @@
+ -X \
+ %{mbig-endian:-EB}" \
+ SUBTARGET_EXTRA_LINK_SPEC
++#endif
+
+ #define TARGET_OS_CPP_BUILTINS() \
+ do { \
+diff -urN gcc-3.3.3-dist/gcc/config/cris/linux.h gcc-3.3.3/gcc/config/cris/linux.h
+--- gcc-3.3.3-dist/gcc/config/cris/linux.h 2003-03-10 21:01:35.000000000 -0600
++++ gcc-3.3.3/gcc/config/cris/linux.h 2004-08-12 04:47:51.000000000 -0500
+@@ -81,6 +81,25 @@
+ #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"
+
+@@ -95,6 +114,8 @@
+ %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
+ %{!r:%{O2|O3: --gc-sections}}"
+
++#endif /* USE_UCLIBC */
++
+
+ /* Node: Run-time Target */
+
+diff -urN gcc-3.3.3-dist/gcc/config/cris/t-linux-uclibc gcc-3.3.3/gcc/config/cris/t-linux-uclibc
+--- gcc-3.3.3-dist/gcc/config/cris/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.3/gcc/config/cris/t-linux-uclibc 2004-08-12 04:47:51.000000000 -0500
+@@ -0,0 +1,3 @@
++T_CFLAGS = -DUSE_UCLIBC
++TARGET_LIBGCC2_CFLAGS += -fPIC
++CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
+diff -urN gcc-3.3.3-dist/gcc/config/i386/linux.h gcc-3.3.3/gcc/config/i386/linux.h
+--- gcc-3.3.3-dist/gcc/config/i386/linux.h 2003-11-14 00:46:12.000000000 -0600
++++ gcc-3.3.3/gcc/config/i386/linux.h 2004-08-12 04:47:51.000000000 -0500
+@@ -136,6 +136,15 @@
+ %{static:-static}}}"
+ #endif
+ #else
++#if defined USE_UCLIBC
++#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
++ %{!shared: \
++ %{!ibcs: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}}}"
++#else
+ #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+@@ -144,6 +153,7 @@
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{static:-static}}}"
+ #endif
++#endif
+
+ /* A C statement (sans semicolon) to output to the stdio stream
+ FILE the assembler definition of uninitialized global DECL named
+diff -urN gcc-3.3.3-dist/gcc/config/mips/linux.h gcc-3.3.3/gcc/config/mips/linux.h
+--- gcc-3.3.3-dist/gcc/config/mips/linux.h 2003-12-23 02:58:00.000000000 -0600
++++ gcc-3.3.3/gcc/config/mips/linux.h 2004-08-12 04:47:51.000000000 -0500
+@@ -175,6 +175,17 @@
+
+ /* Borrowed from sparc/linux.h */
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define LINK_SPEC \
++ "%(endian_spec) \
++ %{shared:-shared} \
++ %{!shared: \
++ %{!ibcs: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}}}"
++#else
+ #define LINK_SPEC \
+ "%(endian_spec) \
+ %{shared:-shared} \
+@@ -184,6 +195,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{static:-static}}}"
++#endif
+
+ #undef SUBTARGET_ASM_SPEC
+ #define SUBTARGET_ASM_SPEC "\
+diff -urN gcc-3.3.3-dist/gcc/config/sh/linux.h gcc-3.3.3/gcc/config/sh/linux.h
+--- gcc-3.3.3-dist/gcc/config/sh/linux.h 2003-11-06 17:13:33.000000000 -0600
++++ gcc-3.3.3/gcc/config/sh/linux.h 2004-08-12 04:47:51.000000000 -0500
+@@ -44,12 +44,21 @@
+ #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
+
+ /* The GNU C++ standard library requires that these macros be defined. */
+ #undef CPLUSPLUS_CPP_SPEC
+diff -urN gcc-3.3.3-dist/gcc/config/sh/t-linux-uclibc gcc-3.3.3/gcc/config/sh/t-linux-uclibc
+--- gcc-3.3.3-dist/gcc/config/sh/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.3/gcc/config/sh/t-linux-uclibc 2004-08-12 04:47:51.000000000 -0500
+@@ -0,0 +1,16 @@
++T_CFLAGS = -DUSE_UCLIBC
++
++# Don't run fixproto
++STMP_FIXPROTO =
++
++TARGET_LIBGCC2_CFLAGS = -fpic
++LIB1ASMFUNCS_CACHE = _ic_invalidate
++
++LIB2FUNCS_EXTRA=
++
++MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m3e/m4
++MULTILIB_DIRNAMES=
++MULTILIB_MATCHES =
++MULTILIB_EXCEPTIONS=
++
++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
+diff -urN gcc-3.3.3-dist/gcc/config/sh/t-sh64-uclibc gcc-3.3.3/gcc/config/sh/t-sh64-uclibc
+--- gcc-3.3.3-dist/gcc/config/sh/t-sh64-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.3/gcc/config/sh/t-sh64-uclibc 2004-08-12 04:47:51.000000000 -0500
+@@ -0,0 +1,13 @@
++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o
++
++LIB1ASMFUNCS = \
++ _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
++ _shcompact_call_trampoline _shcompact_return_trampoline \
++ _shcompact_incoming_args _ic_invalidate _nested_trampoline \
++ _push_pop_shmedia_regs \
++ _udivdi3 _divdi3 _umoddi3 _moddi3
++
++MULTILIB_OPTIONS = $(MULTILIB_ENDIAN) m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
++MULTILIB_DIRNAMES= $(MULTILIB_ENDIAN) nofpu compact nofpu/compact media64 nofpu/media64
++MULTILIB_MATCHES=
++MULTILIB_EXCEPTIONS=
+diff -urN gcc-3.3.3-dist/gcc/config/t-linux-uclibc gcc-3.3.3/gcc/config/t-linux-uclibc
+--- gcc-3.3.3-dist/gcc/config/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.3/gcc/config/t-linux-uclibc 2004-08-12 04:47:51.000000000 -0500
+@@ -0,0 +1,23 @@
++T_CFLAGS = -DUSE_UCLIBC
++
++# Don't run fixproto
++STMP_FIXPROTO =
++
++# Compile crtbeginS.o and crtendS.o with pic.
++CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
++# Compile libgcc2.a with pic.
++TARGET_LIBGCC2_CFLAGS = -fPIC
++
++# Override t-slibgcc-elf-ver to export some libgcc symbols with
++# the symbol versions that glibc used.
++SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
++
++# Use unwind-dw2-fde-glibc
++#LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
++# $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
++#LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
++
++# Use unwind-dw2-fde
++LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
++ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
++LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
+diff -urN gcc-3.3.3-dist/gcc/config.gcc gcc-3.3.3/gcc/config.gcc
+--- gcc-3.3.3-dist/gcc/config.gcc 2004-01-21 00:06:00.000000000 -0600
++++ gcc-3.3.3/gcc/config.gcc 2004-08-12 04:47:51.000000000 -0500
+@@ -697,6 +697,17 @@
+ extra_parts=""
+ use_collect2=yes
+ ;;
++arm*-*-linux-uclibc*) # ARM GNU/Linux with ELF - uClibc
++ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux"
++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
++ gnu_ld=yes
++ case x${enable_threads} in
++ x | xyes | xpthreads | xposix)
++ thread_file='posix'
++ ;;
++ esac
++ ;;
+ arm*-*-linux*) # ARM GNU/Linux with ELF
+ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
+ tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
+@@ -772,6 +783,10 @@
+ tmake_file="cris/t-cris cris/t-elfmulti"
+ gas=yes
+ ;;
++cris-*-linux-uclibc*)
++ tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
++ tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux-uclibc"
++ ;;
+ cris-*-linux*)
+ tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
+ tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
+@@ -1173,6 +1188,11 @@
+ thread_file='single'
+ fi
+ ;;
++i[34567]86-*-linux*uclibc*) # Intel 80386's running GNU/Linux
++ # with ELF format using uClibc
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h"
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc i386/t-crtstuff"
++ ;;
+ i[34567]86-*-linux*) # Intel 80386's running GNU/Linux
+ # with ELF format using glibc 2
+ # aka GNU/Linux C library 6
+@@ -1883,6 +1903,16 @@
+ tm_file="elfos.h ${tm_file} mips/netbsd.h"
+ tmake_file="${tmake_file} mips/t-netbsd"
+ ;;
++mips*-*-linux-uclibc*) # Linux MIPS, either endian. uClibc
++ tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
++ case $machine in
++ mipsisa32*-*)
++ target_cpu_default="MASK_SOFT_FLOAT"
++ tm_defines="MIPS_ISA_DEFAULT=32"
++ ;;
++ esac
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc mips/t-linux"
++ ;;
+ mips*-*-linux*) # Linux MIPS, either endian.
+ tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
+ case $machine in
+@@ -2129,6 +2159,11 @@
+ out_file=rs6000/rs6000.c
+ tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
+ ;;
++powerpc-*-linux-uclibc*)
++ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
++ out_file=rs6000/rs6000.c
++ tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux-uclibc rs6000/t-ppccomm"
++ ;;
+ powerpc-*-linux*)
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
+ out_file=rs6000/rs6000.c
+@@ -2313,10 +2348,18 @@
+ tmake_file="${tmake_file} sh/t-le"
+ ;;
+ esac
+- tmake_file="${tmake_file} sh/t-linux"
++ case $machine in
++ *-*-linux-uclibc*) tmake_file="${tmake_file} sh/t-linux-uclibc" ;;
++ *) tmake_file="${tmake_file} sh/t-linux" ;;
++ esac
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h"
+ gas=yes gnu_ld=yes
+ case $machine in
++ sh64*-*-linux-uclibc*)
++ tmake_file="${tmake_file} sh/t-sh64-uclibc"
++ tm_file="${tm_file} sh/sh64.h"
++ extra_headers="shmedia.h ushmedia.h sshmedia.h"
++ ;;
+ sh64*)
+ tmake_file="${tmake_file} sh/t-sh64"
+ tm_file="${tm_file} sh/sh64.h"
+diff -urN gcc-3.3.3-dist/libstdc++-v3/aclocal.m4 gcc-3.3.3/libstdc++-v3/aclocal.m4
+--- gcc-3.3.3-dist/libstdc++-v3/aclocal.m4 2004-01-12 10:18:44.000000000 -0600
++++ gcc-3.3.3/libstdc++-v3/aclocal.m4 2004-08-12 04:47:51.000000000 -0500
+@@ -1216,6 +1216,9 @@
+ dnl Default to "generic"
+ if test x$enable_clocale_flag = xno; then
+ case x${target_os} in
++ xlinux-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ xlinux* | xgnu*)
+ AC_EGREP_CPP([_GLIBCPP_ok], [
+ #include <features.h>
+@@ -1339,6 +1342,41 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ xuclibc)
++ 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 \
++ glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
++ glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
++ done
++ AC_SUBST(glibcpp_MOFILES)
++ AC_SUBST(glibcpp_POFILES)
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_H=config/locale/uclibc/codecvt_specializations.h
++ 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
++ ;;
+ *)
+ echo "$enable_clocale is an unknown locale package" 1>&2
+ exit 1
+diff -urN gcc-3.3.3-dist/libstdc++-v3/configure gcc-3.3.3/libstdc++-v3/configure
+--- gcc-3.3.3-dist/libstdc++-v3/configure 2004-01-12 10:18:45.000000000 -0600
++++ gcc-3.3.3/libstdc++-v3/configure 2004-08-12 04:49:13.000000000 -0500
+@@ -2010,6 +2010,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -2996,6 +3001,9 @@
+
+ if test x$enable_clocale_flag = xno; then
+ case x${target_os} in
++ xlinux-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ xlinux* | xgnu*)
+ cat > conftest.$ac_ext <<EOF
+ #line 3002 "configure"
+@@ -3182,6 +3190,70 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ xuclibc)
++ echo "$ac_t""uclibc" 1>&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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:3117: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_check_msgfmt'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ if test -n "$check_msgfmt"; then
++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
++else
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="$PATH"
++ for ac_dir in $ac_dummy; do
++ test -z "$ac_dir" && ac_dir=.
++ if test -f $ac_dir/$ac_word; then
++ ac_cv_prog_check_msgfmt="yes"
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ 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 "$ac_t""$check_msgfmt" 1>&6
++else
++ echo "$ac_t""no" 1>&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 \
++ glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
++ glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
++ done
++
++
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_H=config/locale/uclibc/codecvt_specializations.h
++ 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
++ ;;
+ *)
+ echo "$enable_clocale is an unknown locale package" 1>&2
+ exit 1
+@@ -4212,6 +4284,968 @@
+ # GLIBCPP_CHECK_MATH_SUPPORT
+
+ case "$target" in
++ *-uclibc*)
++ os_include_dir="os/uclibc"
++ for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \
++ machine/endian.h machine/param.h sys/machine.h sys/types.h \
++ fp.h locale.h float.h inttypes.h
++do
++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
++echo "configure:4224: checking for $ac_hdr" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4229 "configure"
++#include "confdefs.h"
++#include <$ac_hdr>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:4234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=yes"
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_hdr 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++fi
++done
++
++ SECTION_FLAGS='-ffunction-sections -fdata-sections'
++
++
++ # If we're not using GNU ld, then there's no point in even trying these
++ # tests. Check for that first. We should have already tested for gld
++ # by now (in libtool), but require it now just to be safe...
++ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
++ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
++
++
++ # The name set by libtool depends on the version of libtool. Shame on us
++ # for depending on an impl detail, but c'est la vie. Older versions used
++ # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
++ # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
++ # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
++ # set (hence we're using an older libtool), then set it.
++ if test x${with_gnu_ld+set} != xset; then
++ if test x${ac_cv_prog_gnu_ld+set} != xset; then
++ # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
++ with_gnu_ld=no
++ else
++ with_gnu_ld=$ac_cv_prog_gnu_ld
++ fi
++ fi
++
++ # Start by getting the version number. I think the libtool test already
++ # does some of this, but throws away the result.
++
++ ldver=`$LD --version 2>/dev/null | head -1 | \
++ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
++
++ glibcpp_gnu_ld_version=`echo $ldver | \
++ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
++
++ # Set --gc-sections.
++ if test "$with_gnu_ld" = "notbroken"; then
++ # GNU ld it is! Joy and bunny rabbits!
++
++ # All these tests are for C++; save the language and the compiler flags.
++ # Need to do this so that g++ won't try to link in libstdc++
++ ac_test_CFLAGS="${CFLAGS+set}"
++ ac_save_CFLAGS="$CFLAGS"
++ CFLAGS='-x c++ -Wl,--gc-sections'
++
++ # Check for -Wl,--gc-sections
++ # XXX This test is broken at the moment, as symbols required for
++ # linking are now in libsupc++ (not built yet.....). In addition,
++ # this test has cored on solaris in the past. In addition,
++ # --gc-sections doesn't really work at the moment (keeps on discarding
++ # used sections, first .eh_frame and now some of the glibc sections for
++ # iconv). Bzzzzt. Thanks for playing, maybe next time.
++ echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
++echo "configure:4312: checking for ld that supports -Wl,--gc-sections" >&5
++ if test "$cross_compiling" = yes; then
++ ac_sectionLDflags=yes
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4317 "configure"
++#include "confdefs.h"
++
++ int main(void)
++ {
++ try { throw 1; }
++ catch (...) { };
++ return 0;
++ }
++
++EOF
++if { (eval echo configure:4328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++then
++ ac_sectionLDflags=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -fr conftest*
++ ac_sectionLDflags=no
++fi
++rm -fr conftest*
++fi
++
++ if test "$ac_test_CFLAGS" = set; then
++ CFLAGS="$ac_save_CFLAGS"
++ else
++ # this is the suspicious part
++ CFLAGS=''
++ fi
++ if test "$ac_sectionLDflags" = "yes"; then
++ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
++ fi
++ echo "$ac_t""$ac_sectionLDflags" 1>&6
++ fi
++
++ # Set linker optimization flags.
++ if test x"$with_gnu_ld" = x"yes"; then
++ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
++ fi
++
++
++
++
++
++ echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
++echo "configure:4362: checking for main in -lm" >&5
++ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="-lm $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 4370 "configure"
++#include "confdefs.h"
++
++int main() {
++main()
++; return 0; }
++EOF
++if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
++ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_lib 1
++EOF
++
++ LIBS="-lm $LIBS"
++
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++ for ac_func in nan copysignf
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4407: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4412 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
++fi
++done
++
++
++ for ac_func in __signbit
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4464: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4469 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
++fi
++done
++
++ for ac_func in __signbitf
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4520: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4525 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
++fi
++done
++
++
++ if test x$ac_cv_func_copysignl = x"yes"; then
++ for ac_func in __signbitl
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4578: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4583 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
++fi
++done
++
++ fi
++
++ if test -n "$LIBMATHOBJS"; then
++ need_libmath=yes
++ fi
++
++
++
++if test "$need_libmath" = yes; then
++ GLIBCPP_BUILD_LIBMATH_TRUE=
++ GLIBCPP_BUILD_LIBMATH_FALSE='#'
++else
++ GLIBCPP_BUILD_LIBMATH_TRUE='#'
++ GLIBCPP_BUILD_LIBMATH_FALSE=
++fi
++
++
++ enable_wchar_t=no
++
++ echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
++echo "configure:4651: checking for mbstate_t" >&5
++ cat > conftest.$ac_ext <<EOF
++#line 4653 "configure"
++#include "confdefs.h"
++#include <wchar.h>
++int main() {
++mbstate_t teststate;
++; return 0; }
++EOF
++if { (eval echo configure:4660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ have_mbstate_t=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ have_mbstate_t=no
++fi
++rm -f conftest*
++ echo "$ac_t""$have_mbstate_t" 1>&6
++ if test x"$have_mbstate_t" = xyes; then
++ cat >> confdefs.h <<\EOF
++#define HAVE_MBSTATE_T 1
++EOF
++
++ fi
++
++ for ac_hdr in wchar.h
++do
++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
++echo "configure:4682: checking for $ac_hdr" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4687 "configure"
++#include "confdefs.h"
++#include <$ac_hdr>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:4692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=yes"
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_hdr 1
++EOF
++ ac_has_wchar_h=yes
++else
++ echo "$ac_t""no" 1>&6
++ac_has_wchar_h=no
++fi
++done
++
++ for ac_hdr in wctype.h
++do
++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
++echo "configure:4723: checking for $ac_hdr" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4728 "configure"
++#include "confdefs.h"
++#include <$ac_hdr>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:4733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=yes"
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_hdr 1
++EOF
++ ac_has_wctype_h=yes
++else
++ echo "$ac_t""no" 1>&6
++ac_has_wctype_h=no
++fi
++done
++
++
++ if test x"$ac_has_wchar_h" = xyes &&
++ test x"$ac_has_wctype_h" = xyes &&
++ test x"$enable_c_mbchar" != xno; then
++
++ echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
++echo "configure:4766: checking for WCHAR_MIN and WCHAR_MAX" >&5
++ cat > conftest.$ac_ext <<EOF
++#line 4768 "configure"
++#include "confdefs.h"
++#include <wchar.h>
++int main() {
++int i = WCHAR_MIN; int j = WCHAR_MAX;
++; return 0; }
++EOF
++if { (eval echo configure:4775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ has_wchar_minmax=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ has_wchar_minmax=no
++fi
++rm -f conftest*
++ echo "$ac_t""$has_wchar_minmax" 1>&6
++
++ echo $ac_n "checking for WEOF""... $ac_c" 1>&6
++echo "configure:4788: checking for WEOF" >&5
++ cat > conftest.$ac_ext <<EOF
++#line 4790 "configure"
++#include "confdefs.h"
++
++ #include <wchar.h>
++ #include <stddef.h>
++int main() {
++wint_t i = WEOF;
++; return 0; }
++EOF
++if { (eval echo configure:4799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ has_weof=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ has_weof=no
++fi
++rm -f conftest*
++ echo "$ac_t""$has_weof" 1>&6
++
++ ac_wfuncs=yes
++ for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4815: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4820 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++\
++ ac_wfuncs=no
++fi
++done
++
++
++ for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
++ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
++ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
++ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
++ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
++ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4878: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4883 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++\
++ ac_wfuncs=no
++fi
++done
++
++
++ echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
++echo "configure:4934: checking for ISO C99 wchar_t support" >&5
++ if test x"$has_weof" = xyes &&
++ test x"$has_wchar_minmax" = xyes &&
++ test x"$ac_wfuncs" = xyes; then
++ ac_isoC99_wchar_t=yes
++ else
++ ac_isoC99_wchar_t=no
++ fi
++ echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
++
++ ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
++echo "configure:4946: checking for iconv.h" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4951 "configure"
++#include "confdefs.h"
++#include <iconv.h>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:4956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=yes"
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_has_iconv_h=yes
++else
++ echo "$ac_t""no" 1>&6
++ac_has_iconv_h=no
++fi
++
++ ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
++echo "configure:4980: checking for langinfo.h" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4985 "configure"
++#include "confdefs.h"
++#include <langinfo.h>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:4990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=yes"
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_has_langinfo_h=yes
++else
++ echo "$ac_t""no" 1>&6
++ac_has_langinfo_h=no
++fi
++
++
++ echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
++echo "configure:5014: checking for iconv in -liconv" >&5
++ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="-liconv $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 5022 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char iconv();
++
++int main() {
++iconv()
++; return 0; }
++EOF
++if { (eval echo configure:5033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ libiconv="-liconv"
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++ ac_save_LIBS="$LIBS"
++ LIBS="$LIBS $libiconv"
++
++ for ac_func in iconv_open iconv_close iconv nl_langinfo
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:5059: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 5064 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:5087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++ \
++ ac_XPG2funcs=yes
++else
++ echo "$ac_t""no" 1>&6
++ac_XPG2funcs=no
++fi
++done
++
++
++ LIBS="$ac_save_LIBS"
++
++ echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
++echo "configure:5117: checking for XPG2 wchar_t support" >&5
++ if test x"$ac_has_iconv_h" = xyes &&
++ test x"$ac_has_langinfo_h" = xyes &&
++ test x"$ac_XPG2funcs" = xyes; then
++ ac_XPG2_wchar_t=yes
++ else
++ ac_XPG2_wchar_t=no
++ fi
++ echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
++
++ if test x"$ac_isoC99_wchar_t" = xyes &&
++ test x"$ac_XPG2_wchar_t" = xyes; then
++ cat >> confdefs.h <<\EOF
++#define _GLIBCPP_USE_WCHAR_T 1
++EOF
++
++ enable_wchar_t=yes
++ fi
++ fi
++ echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
++echo "configure:5137: checking for enabled wchar_t specializations" >&5
++ echo "$ac_t""$enable_wchar_t" 1>&6
++
++
++if test "$enable_wchar_t" = yes; then
++ GLIBCPP_TEST_WCHAR_T_TRUE=
++ GLIBCPP_TEST_WCHAR_T_FALSE='#'
++else
++ GLIBCPP_TEST_WCHAR_T_TRUE='#'
++ GLIBCPP_TEST_WCHAR_T_FALSE=
++fi
++
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_COPYSIGN 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_FINITE 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_FINITEF 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_ISINF 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_ISINFF 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_ISNAN 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_ISNANF 1
++EOF
++ ;;
+ *-linux*)
+ os_include_dir="os/gnu-linux"
+ for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \
+diff -urN gcc-3.3.3-dist/libstdc++-v3/configure.in gcc-3.3.3/libstdc++-v3/configure.in
+--- gcc-3.3.3-dist/libstdc++-v3/configure.in 2004-01-12 10:19:22.000000000 -0600
++++ gcc-3.3.3/libstdc++-v3/configure.in 2004-08-12 04:47:51.000000000 -0500
+@@ -117,6 +117,36 @@
+ # GLIBCPP_CHECK_MATH_SUPPORT
+
+ case "$target" in
++ *-uclibc*)
++ os_include_dir="os/uclibc"
++ 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 locale.h float.h inttypes.h])
++ SECTION_FLAGS='-ffunction-sections -fdata-sections'
++ AC_SUBST(SECTION_FLAGS)
++ GLIBCPP_CHECK_LINKER_FEATURES
++ GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
++ GLIBCPP_CHECK_WCHAR_T_SUPPORT
++
++ AC_DEFINE(HAVE_COPYSIGN)
++ #AC_DEFINE(HAVE_COPYSIGNF)
++ AC_DEFINE(HAVE_FINITE)
++ AC_DEFINE(HAVE_FINITEF)
++ #AC_DEFINE(HAVE_FREXPF)
++ #AC_DEFINE(HAVE_HYPOTF)
++ AC_DEFINE(HAVE_ISINF)
++ AC_DEFINE(HAVE_ISINFF)
++ AC_DEFINE(HAVE_ISNAN)
++ AC_DEFINE(HAVE_ISNANF)
++ #AC_DEFINE(HAVE_SINCOS)
++ #AC_DEFINE(HAVE_SINCOSF)
++ #if test x"long_double_math_on_this_cpu" = x"yes"; then
++ #AC_DEFINE(HAVE_FINITEL)
++ #AC_DEFINE(HAVE_HYPOTL)
++ #AC_DEFINE(HAVE_ISINFL)
++ #AC_DEFINE(HAVE_ISNANL)
++ #fi
++ ;;
+ *-linux*)
+ os_include_dir="os/gnu-linux"
+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
+diff -urN gcc-3.3.3-dist/libstdc++-v3/configure.target gcc-3.3.3/libstdc++-v3/configure.target
+--- gcc-3.3.3-dist/libstdc++-v3/configure.target 2003-10-01 14:07:07.000000000 -0500
++++ gcc-3.3.3/libstdc++-v3/configure.target 2004-08-12 04:47:51.000000000 -0500
+@@ -133,6 +133,9 @@
+ freebsd*)
+ os_include_dir="os/bsd/freebsd"
+ ;;
++ linux-uclibc*)
++ os_include_dir="os/uclibc"
++ ;;
+ gnu* | linux*)
+ os_include_dir="os/gnu-linux"
+ ;;
+diff -urN gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cstdlib.h gcc-3.3.3/libstdc++-v3/include/c_std/std_cstdlib.h
+--- gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cstdlib.h 2003-04-18 05:08:05.000000000 -0500
++++ gcc-3.3.3/libstdc++-v3/include/c_std/std_cstdlib.h 2004-08-12 04:47:51.000000000 -0500
+@@ -101,9 +101,11 @@
+ using ::labs;
+ using ::ldiv;
+ using ::malloc;
++#if _GLIBCPP_USE_WCHAR_T
+ using ::mblen;
+ using ::mbstowcs;
+ using ::mbtowc;
++#endif
+ using ::qsort;
+ using ::rand;
+ using ::realloc;
+@@ -112,8 +114,10 @@
+ using ::strtol;
+ using ::strtoul;
+ using ::system;
++#if _GLIBCPP_USE_WCHAR_T
+ using ::wcstombs;
+ using ::wctomb;
++#endif
+
+ inline long
+ abs(long __i) { return labs(__i); }
+diff -urN gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.3.3/libstdc++-v3/include/c_std/std_cwchar.h
+--- gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cwchar.h 2003-04-18 05:08:05.000000000 -0500
++++ gcc-3.3.3/libstdc++-v3/include/c_std/std_cwchar.h 2004-08-12 04:47:51.000000000 -0500
+@@ -165,7 +165,9 @@
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
++#ifdef HAVE_WCSFTIME
+ using ::wcsftime;
++#endif
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
+diff -urN gcc-3.3.3-dist/libtool.m4 gcc-3.3.3/libtool.m4
+--- gcc-3.3.3-dist/libtool.m4 2003-09-09 03:04:17.000000000 -0500
++++ gcc-3.3.3/libtool.m4 2004-08-12 04:47:51.000000000 -0500
+@@ -687,6 +687,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN gcc-3.3.3-dist/ltconfig gcc-3.3.3/ltconfig
+--- gcc-3.3.3-dist/ltconfig 2003-02-19 20:10:02.000000000 -0600
++++ gcc-3.3.3/ltconfig 2004-08-12 04:47:51.000000000 -0500
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1247,6 +1248,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
--- /dev/null
+Use the patch by Carl Miller <chaz@energoncube.net> for powerpc, with
+some minor modifications. Changed *os_uclibc to *os_linux_uclibc since
+at some point we might support other platforms. Also updated to 3.3.3.
+diff -urN gcc-3.3.3/gcc/config/rs6000/linux.h gcc-3.3.3-new/gcc/config/rs6000/linux.h
+--- gcc-3.3.3/gcc/config/rs6000/linux.h 2003-11-14 00:46:10.000000000 -0600
++++ gcc-3.3.3-new/gcc/config/rs6000/linux.h 2004-02-16 21:13:40.000000000 -0600
+@@ -64,7 +64,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
+
+ #undef TARGET_VERSION
+ #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
+diff -urN gcc-3.3.3/gcc/config/rs6000/sysv4.h gcc-3.3.3-new/gcc/config/rs6000/sysv4.h
+--- gcc-3.3.3/gcc/config/rs6000/sysv4.h 2003-10-28 13:55:41.000000000 -0600
++++ gcc-3.3.3-new/gcc/config/rs6000/sysv4.h 2004-02-16 21:13:40.000000000 -0600
+@@ -968,9 +968,11 @@
+ %{mcall-linux: %(link_os_linux) } \
+ %{mcall-gnu: %(link_os_gnu) } \
+ %{mcall-netbsd: %(link_os_netbsd) } \
++%{mcall-uclibc: %(link_os_linux_uclibc) } \
+ %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
+ %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
+- %{!mcall-netbsd: %(link_os_default) }}}}}}}}}"
++ %{!mcall-netbsd: %{!mcall-uclibc: \
++ %(link_os_default) }}}}}}}}}}"
+
+ #define LINK_OS_DEFAULT_SPEC ""
+
+@@ -1307,6 +1309,12 @@
+
+ #define LINK_OS_WINDISS_SPEC ""
+
++/* uClibc support for Linux. */
++
++#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
++
+ /* Define any extra SPECS that the compiler needs to generate. */
+ /* Override rs6000.h definition. */
+ #undef SUBTARGET_EXTRA_SPECS
+@@ -1372,6 +1380,7 @@
+ { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
+ { "link_os_vxworks", LINK_OS_VXWORKS_SPEC }, \
+ { "link_os_windiss", LINK_OS_WINDISS_SPEC }, \
++ { "link_os_linux_uclibc", LINK_OS_LINUX_UCLIBC_SPEC }, \
+ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
+ { "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \
+ { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
--- /dev/null
+--- gcc-3.3.2-old/configure.in 2003-08-09 01:57:21.000000000 -0500
++++ gcc-3.3.2/configure.in 2004-01-15 12:46:29.000000000 -0600
+@@ -1418,6 +1418,11 @@
+ fi
+
+ FLAGS_FOR_TARGET=
++case " $targargs " in
++ *" --nfp "* | *" --without-float "*)
++ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -msoft-float'
++ ;;
++esac
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $targargs " in
--- /dev/null
+Warning! This patch is not finished. The wide char time-related stuff
+is broken or non-functional. But it serves as a starting point to get
+things building while I continue to work on the uClibc locale internals.
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2004-01-09 07:55:02.000000000 -0600
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 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.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(iswctype_l) __iswctype_l;
++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(strtol_l) __strtol_l;
++extern "C" __typeof(strtoll_l) __strtoll_l;
++extern "C" __typeof(strtoul_l) __strtoul_l;
++extern "C" __typeof(strtoull_l) __strtoull_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_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;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#endif // GLIBC 2.3 and later
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc 2004-01-09 08:37:55.000000000 -0600
+@@ -0,0 +1,231 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#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))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __convert_to_v(const char* __s, long& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc, int __base)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ long __l = __strtol_l(__s, &__sanity, __base, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
++ __v = __l;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, unsigned long& __v,
++ ios_base::iostate& __err, const __c_locale& __cloc,
++ int __base)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ unsigned long __ul = __strtoul_l(__s, &__sanity, __base, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
++ __v = __ul;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++#ifdef _GLIBCPP_USE_LONG_LONG
++ template<>
++ void
++ __convert_to_v(const char* __s, long long& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc, int __base)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ long long __ll = __strtoll_l(__s, &__sanity, __base, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
++ __v = __ll;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, unsigned long long& __v,
++ ios_base::iostate& __err, const __c_locale& __cloc,
++ int __base)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ unsigned long long __ull = __strtoull_l(__s, &__sanity, __base,
++ __cloc);
++ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
++ __v = __ull;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++#endif
++
++ template<>
++ void
++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc, int)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && 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, int)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && 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, int)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && 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)
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __cloc = __newlocale(1 << LC_ALL, __s, __old);
++ if (!__cloc)
++ {
++ // This named locale is not supported by the underlying OS.
++ __throw_runtime_error("attempt to create locale from unknown name");
++ }
++#else
++ __cloc = NULL;
++#endif
++ }
++
++ void
++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ if (_S_c_locale != __cloc)
++ __freelocale(__cloc);
++#else
++ __cloc = NULL;
++#endif
++ }
++
++ __c_locale
++ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++#ifdef __UCLIBC_HAS_XLOCALE__
++ { return __duplocale(__cloc); }
++#else
++ { return __c_locale(); }
++#endif
++
++ const char* locale::_S_categories[_S_categories_size
++ + _S_extra_categories_size] =
++ {
++ "LC_CTYPE",
++ "LC_NUMERIC",
++ "LC_TIME",
++ "LC_COLLATE",
++ "LC_MONETARY",
++ "LC_MESSAGES"
++#if _GLIBCPP_NUM_CATEGORIES != 0
++ ,
++ "LC_PAPER",
++ "LC_NAME",
++ "LC_ADDRESS",
++ "LC_TELEPHONE",
++ "LC_MEASUREMENT",
++ "LC_IDENTIFICATION"
++#endif
++ };
++} // namespace std
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h 2004-01-09 07:51:06.000000000 -0600
+@@ -0,0 +1,118 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _CPP_BITS_C_LOCALE_H
++#define _CPP_BITS_C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <clocale>
++#include <langinfo.h> // For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h> // For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> // For messages
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning what is _GLIBCPP_C_LOCALE_GNU for
++#endif
++#define _GLIBCPP_C_LOCALE_GNU 1
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix categories
++#endif
++// #define _GLIBCPP_NUM_CATEGORIES 6
++#define _GLIBCPP_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<typename _Tv>
++ int
++ __convert_from_v(char* __out, const int __size, const char* __fmt,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ _Tv __v, const __c_locale& __cloc, int __prec = -1)
++ {
++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++ _Tv __v, const __c_locale&, int __prec = -1)
++ {
++# ifdef __UCLIBC_HAS_LOCALE__
++ char* __old = setlocale(LC_ALL, NULL);
++ char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
++ if (__sav)
++ strcpy(__sav, __old);
++ setlocale(LC_ALL, "C");
++# endif
++#endif
++
++ int __ret;
++ if (__prec >= 0)
++ __ret = snprintf(__out, __size, __fmt, __prec, __v);
++ else
++ __ret = snprintf(__out, __size, __fmt, __v);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++ setlocale(LC_ALL, __sav);
++ free(__sav);
++#endif
++ return __ret;
++ }
++}
++
++#endif
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2004-01-09 04:04:34.000000000 -0600
+@@ -0,0 +1,113 @@
++// 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, 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.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++ // Specializations.
++#ifdef _GLIBCPP_USE_WCHAR_T
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ 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 = error;
++ size_t __len = min(__from_end - __from, __to_end - __to);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_S_c_locale);
++#endif
++ size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ if (__conv == __len)
++ {
++ __from_next = __from;
++ __to_next = __to + __conv;
++ __ret = ok;
++ }
++ else if (__conv > 0 && __conv < __len)
++ {
++ __from_next = __from;
++ __to_next = __to + __conv;
++ __ret = partial;
++ }
++ else
++ __ret = error;
++
++ return __ret;
++ }
++
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ 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 = error;
++ size_t __len = min(__from_end - __from, __to_end - __to);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_S_c_locale);
++#endif
++ size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ if (__conv == __len)
++ {
++ __from_next = __from;
++ __to_next = __to + __conv;
++ __ret = ok;
++ }
++ else if (__conv > 0 && __conv < __len)
++ {
++ __from_next = __from;
++ __to_next = __to + __conv;
++ __ret = partial;
++ }
++ else
++ __ret = error;
++
++ return __ret;
++ }
++#endif
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h 2004-01-09 01:53:51.000000000 -0600
+@@ -0,0 +1,461 @@
++// Locale support (codecvt) -*- C++ -*-
++
++// Copyright (C) 2000, 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, 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.2.1.5 Template class codecvt
++//
++
++// Warning: this file is not meant for user inclusion. Use <locale>.
++
++// Written by Benjamin Kosnik <bkoz@cygnus.com>
++
++ // XXX
++ // Define this here to codecvt.cc can have _S_max_size definition.
++#define _GLIBCPP_USE___ENC_TRAITS 1
++
++ // Extension to use icov for dealing with character encodings,
++ // including conversions and comparisons between various character
++ // sets. This object encapsulates data that may need to be shared between
++ // char_traits, codecvt and ctype.
++ class __enc_traits
++ {
++ public:
++ // Types:
++ // NB: A conversion descriptor subsumes and enhances the
++ // functionality of a simple state type such as mbstate_t.
++ typedef iconv_t __desc_type;
++
++ protected:
++ // Data Members:
++ // Max size of charset encoding name
++ static const int _S_max_size = 32;
++ // Name of internal character set encoding.
++ char _M_int_enc[_S_max_size];
++ // Name of external character set encoding.
++ char _M_ext_enc[_S_max_size];
++
++ // Conversion descriptor between external encoding to internal encoding.
++ __desc_type _M_in_desc;
++ // Conversion descriptor between internal encoding to external encoding.
++ __desc_type _M_out_desc;
++
++ // Details the byte-order marker for the external encoding, if necessary.
++ int _M_ext_bom;
++
++ // Details the byte-order marker for the internal encoding, if necessary.
++ int _M_int_bom;
++
++ public:
++ explicit __enc_traits()
++ : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
++ {
++ memset(_M_int_enc, 0, _S_max_size);
++ memset(_M_ext_enc, 0, _S_max_size);
++ }
++
++ explicit __enc_traits(const char* __int, const char* __ext,
++ int __ibom = 0, int __ebom = 0)
++ : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
++ {
++ strncpy(_M_int_enc, __int, _S_max_size);
++ strncpy(_M_ext_enc, __ext, _S_max_size);
++ }
++
++ // 21.1.2 traits typedefs
++ // p4
++ // typedef STATE_T state_type
++ // requires: state_type shall meet the requirements of
++ // CopyConstructible types (20.1.3)
++ __enc_traits(const __enc_traits& __obj): _M_in_desc(0), _M_out_desc(0)
++ {
++ strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
++ strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
++ _M_ext_bom = __obj._M_ext_bom;
++ _M_int_bom = __obj._M_int_bom;
++ }
++
++ // Need assignment operator as well.
++ __enc_traits&
++ operator=(const __enc_traits& __obj)
++ {
++ strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
++ strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
++ _M_in_desc = 0;
++ _M_out_desc = 0;
++ _M_ext_bom = __obj._M_ext_bom;
++ _M_int_bom = __obj._M_int_bom;
++ return *this;
++ }
++
++ ~__enc_traits()
++ {
++ __desc_type __err = reinterpret_cast<iconv_t>(-1);
++ if (_M_in_desc && _M_in_desc != __err)
++ iconv_close(_M_in_desc);
++ if (_M_out_desc && _M_out_desc != __err)
++ iconv_close(_M_out_desc);
++ }
++
++ void
++ _M_init()
++ {
++ const __desc_type __err = reinterpret_cast<iconv_t>(-1);
++ if (!_M_in_desc)
++ {
++ _M_in_desc = iconv_open(_M_int_enc, _M_ext_enc);
++ if (_M_in_desc == __err)
++ __throw_runtime_error("creating iconv input descriptor failed.");
++ }
++ if (!_M_out_desc)
++ {
++ _M_out_desc = iconv_open(_M_ext_enc, _M_int_enc);
++ if (_M_out_desc == __err)
++ __throw_runtime_error("creating iconv output descriptor failed.");
++ }
++ }
++
++ bool
++ _M_good()
++ {
++ const __desc_type __err = reinterpret_cast<iconv_t>(-1);
++ bool __test = _M_in_desc && _M_in_desc != __err;
++ __test &= _M_out_desc && _M_out_desc != __err;
++ return __test;
++ }
++
++ const __desc_type*
++ _M_get_in_descriptor()
++ { return &_M_in_desc; }
++
++ const __desc_type*
++ _M_get_out_descriptor()
++ { return &_M_out_desc; }
++
++ int
++ _M_get_external_bom()
++ { return _M_ext_bom; }
++
++ int
++ _M_get_internal_bom()
++ { return _M_int_bom; }
++
++ const char*
++ _M_get_internal_enc()
++ { return _M_int_enc; }
++
++ const char*
++ _M_get_external_enc()
++ { return _M_ext_enc; }
++ };
++
++ // Partial specialization
++ // This specialization takes advantage of iconv to provide code
++ // conversions between a large number of character encodings.
++ template<typename _InternT, typename _ExternT>
++ class codecvt<_InternT, _ExternT, __enc_traits>
++ : public __codecvt_abstract_base<_InternT, _ExternT, __enc_traits>
++ {
++ public:
++ // Types:
++ typedef codecvt_base::result result;
++ typedef _InternT intern_type;
++ typedef _ExternT extern_type;
++ typedef __enc_traits state_type;
++ typedef __enc_traits::__desc_type __desc_type;
++ typedef __enc_traits __enc_type;
++
++ // Data Members:
++ static locale::id id;
++
++ explicit
++ codecvt(size_t __refs = 0)
++ : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
++ { }
++
++ explicit
++ codecvt(__enc_type* __enc, size_t __refs = 0)
++ : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
++ { }
++
++ protected:
++ virtual
++ ~codecvt() { }
++
++ virtual result
++ 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;
++
++ virtual result
++ do_unshift(state_type& __state, extern_type* __to,
++ extern_type* __to_end, extern_type*& __to_next) const;
++
++ virtual result
++ 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;
++
++ virtual int
++ do_encoding() const throw();
++
++ virtual bool
++ do_always_noconv() const throw();
++
++ virtual int
++ do_length(const state_type&, const extern_type* __from,
++ const extern_type* __end, size_t __max) const;
++
++ virtual int
++ do_max_length() const throw();
++ };
++
++ template<typename _InternT, typename _ExternT>
++ locale::id
++ codecvt<_InternT, _ExternT, __enc_traits>::id;
++
++ // This adaptor works around the signature problems of the second
++ // argument to iconv(): SUSv2 and others use 'const char**', but glibc 2.2
++ // uses 'char**', which matches the POSIX 1003.1-2001 standard.
++ // Using this adaptor, g++ will do the work for us.
++ template<typename _T>
++ inline size_t
++ __iconv_adaptor(size_t(*__func)(iconv_t, _T, size_t*, char**, size_t*),
++ iconv_t __cd, char** __inbuf, size_t* __inbytes,
++ char** __outbuf, size_t* __outbytes)
++ { return __func(__cd, (_T)__inbuf, __inbytes, __outbuf, __outbytes); }
++
++ template<typename _InternT, typename _ExternT>
++ codecvt_base::result
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ 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 = codecvt_base::error;
++ if (__state._M_good())
++ {
++ typedef state_type::__desc_type __desc_type;
++ const __desc_type* __desc = __state._M_get_out_descriptor();
++ const size_t __fmultiple = sizeof(intern_type);
++ size_t __fbytes = __fmultiple * (__from_end - __from);
++ const size_t __tmultiple = sizeof(extern_type);
++ size_t __tbytes = __tmultiple * (__to_end - __to);
++
++ // Argument list for iconv specifies a byte sequence. Thus,
++ // all to/from arrays must be brutally casted to char*.
++ char* __cto = reinterpret_cast<char*>(__to);
++ char* __cfrom;
++ size_t __conv;
++
++ // Some encodings need a byte order marker as the first item
++ // in the byte stream, to designate endian-ness. The default
++ // value for the byte order marker is NULL, so if this is
++ // the case, it's not necessary and we can just go on our
++ // merry way.
++ int __int_bom = __state._M_get_internal_bom();
++ if (__int_bom)
++ {
++ size_t __size = __from_end - __from;
++ intern_type* __cfixed = static_cast<intern_type*>(__builtin_alloca(sizeof(intern_type) * (__size + 1)));
++ __cfixed[0] = static_cast<intern_type>(__int_bom);
++ char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
++ __cfrom = reinterpret_cast<char*>(__cfixed);
++ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
++ &__fbytes, &__cto, &__tbytes);
++ }
++ else
++ {
++ intern_type* __cfixed = const_cast<intern_type*>(__from);
++ __cfrom = reinterpret_cast<char*>(__cfixed);
++ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom, &__fbytes,
++ &__cto, &__tbytes);
++ }
++
++ if (__conv != size_t(-1))
++ {
++ __from_next = reinterpret_cast<const intern_type*>(__cfrom);
++ __to_next = reinterpret_cast<extern_type*>(__cto);
++ __ret = codecvt_base::ok;
++ }
++ else
++ {
++ if (__fbytes < __fmultiple * (__from_end - __from))
++ {
++ __from_next = reinterpret_cast<const intern_type*>(__cfrom);
++ __to_next = reinterpret_cast<extern_type*>(__cto);
++ __ret = codecvt_base::partial;
++ }
++ else
++ __ret = codecvt_base::error;
++ }
++ }
++ return __ret;
++ }
++
++ template<typename _InternT, typename _ExternT>
++ codecvt_base::result
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ do_unshift(state_type& __state, extern_type* __to,
++ extern_type* __to_end, extern_type*& __to_next) const
++ {
++ result __ret = codecvt_base::error;
++ if (__state._M_good())
++ {
++ typedef state_type::__desc_type __desc_type;
++ const __desc_type* __desc = __state._M_get_in_descriptor();
++ const size_t __tmultiple = sizeof(intern_type);
++ size_t __tlen = __tmultiple * (__to_end - __to);
++
++ // Argument list for iconv specifies a byte sequence. Thus,
++ // all to/from arrays must be brutally casted to char*.
++ char* __cto = reinterpret_cast<char*>(__to);
++ size_t __conv = __iconv_adaptor(iconv,*__desc, NULL, NULL,
++ &__cto, &__tlen);
++
++ if (__conv != size_t(-1))
++ {
++ __to_next = reinterpret_cast<extern_type*>(__cto);
++ if (__tlen == __tmultiple * (__to_end - __to))
++ __ret = codecvt_base::noconv;
++ else if (__tlen == 0)
++ __ret = codecvt_base::ok;
++ else
++ __ret = codecvt_base::partial;
++ }
++ else
++ __ret = codecvt_base::error;
++ }
++ return __ret;
++ }
++
++ template<typename _InternT, typename _ExternT>
++ codecvt_base::result
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ 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 = codecvt_base::error;
++ if (__state._M_good())
++ {
++ typedef state_type::__desc_type __desc_type;
++ const __desc_type* __desc = __state._M_get_in_descriptor();
++ const size_t __fmultiple = sizeof(extern_type);
++ size_t __flen = __fmultiple * (__from_end - __from);
++ const size_t __tmultiple = sizeof(intern_type);
++ size_t __tlen = __tmultiple * (__to_end - __to);
++
++ // Argument list for iconv specifies a byte sequence. Thus,
++ // all to/from arrays must be brutally casted to char*.
++ char* __cto = reinterpret_cast<char*>(__to);
++ char* __cfrom;
++ size_t __conv;
++
++ // Some encodings need a byte order marker as the first item
++ // in the byte stream, to designate endian-ness. The default
++ // value for the byte order marker is NULL, so if this is
++ // the case, it's not necessary and we can just go on our
++ // merry way.
++ int __ext_bom = __state._M_get_external_bom();
++ if (__ext_bom)
++ {
++ size_t __size = __from_end - __from;
++ extern_type* __cfixed = static_cast<extern_type*>(__builtin_alloca(sizeof(extern_type) * (__size + 1)));
++ __cfixed[0] = static_cast<extern_type>(__ext_bom);
++ char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
++ __cfrom = reinterpret_cast<char*>(__cfixed);
++ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
++ &__flen, &__cto, &__tlen);
++ }
++ else
++ {
++ extern_type* __cfixed = const_cast<extern_type*>(__from);
++ __cfrom = reinterpret_cast<char*>(__cfixed);
++ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
++ &__flen, &__cto, &__tlen);
++ }
++
++
++ if (__conv != size_t(-1))
++ {
++ __from_next = reinterpret_cast<const extern_type*>(__cfrom);
++ __to_next = reinterpret_cast<intern_type*>(__cto);
++ __ret = codecvt_base::ok;
++ }
++ else
++ {
++ if (__flen < static_cast<size_t>(__from_end - __from))
++ {
++ __from_next = reinterpret_cast<const extern_type*>(__cfrom);
++ __to_next = reinterpret_cast<intern_type*>(__cto);
++ __ret = codecvt_base::partial;
++ }
++ else
++ __ret = codecvt_base::error;
++ }
++ }
++ return __ret;
++ }
++
++ template<typename _InternT, typename _ExternT>
++ int
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ do_encoding() const throw()
++ {
++ int __ret = 0;
++ if (sizeof(_ExternT) <= sizeof(_InternT))
++ __ret = sizeof(_InternT)/sizeof(_ExternT);
++ return __ret;
++ }
++
++ template<typename _InternT, typename _ExternT>
++ bool
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ do_always_noconv() const throw()
++ { return false; }
++
++ template<typename _InternT, typename _ExternT>
++ int
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ do_length(const state_type&, const extern_type* __from,
++ const extern_type* __end, size_t __max) const
++ { return min(__max, static_cast<size_t>(__end - __from)); }
++
++#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
++// 74. Garbled text for codecvt::do_max_length
++ template<typename _InternT, typename _ExternT>
++ int
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ do_max_length() const throw()
++ { return 1; }
++#endif
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc 2004-01-09 08:06:24.000000000 -0600
+@@ -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, 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.2.4.1.2 collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::_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<char>::_M_transform(char* __to, const char* __from,
++ size_t __n) const
++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++
++#ifdef _GLIBCPP_USE_WCHAR_T
++ template<>
++ int
++ collate<wchar_t>::_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<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++ size_t __n) const
++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2004-01-09 08:15:41.000000000 -0600
+@@ -0,0 +1,274 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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<char> specializations are in src/locale.cc and
++ // various /config/os/* files.
++ template<>
++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++ : ctype<char>(0, false, __refs)
++ {
++ _S_destroy_c_locale(_M_c_locale_ctype);
++ _S_create_c_locale(_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ _M_toupper = _M_c_locale_ctype->__ctype_toupper;
++ _M_tolower = _M_c_locale_ctype->__ctype_tolower;
++ _M_table = _M_c_locale_ctype->__ctype_b;
++#endif
++ }
++
++#ifdef _GLIBCPP_USE_WCHAR_T
++ ctype<wchar_t>::__wmask_type
++ ctype<wchar_t>::_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 = 0;
++ }
++ return __ret;
++ };
++
++ wchar_t
++ ctype<wchar_t>::do_toupper(wchar_t __c) const
++ { return __towupper_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::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<wchar_t>::do_tolower(wchar_t __c) const
++ { return __towlower_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::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<wchar_t>::
++ do_is(mask __m, wchar_t __c) const
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ bool __ret = false;
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ {
++ const mask __bit = static_cast<mask>(_ISbit(__bitcur));
++ if (__m & __bit)
++ __ret |= __iswctype_l(__c, _M_convert_to_wmask(__bit),
++ _M_c_locale_ctype);
++ }
++ return __ret;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ 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)
++ {
++ const mask __bit = static_cast<mask>(_ISbit(__bitcur));
++ if (__iswctype_l(*__lo, _M_convert_to_wmask(__bit),
++ _M_c_locale_ctype))
++ __m |= __bit;
++ }
++ *__vec = __m;
++ }
++ return __hi;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ 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<wchar_t>::
++ 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<wchar_t>::
++ do_widen(char __c) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ wchar_t __ret = btowc(__c);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ const char*
++ ctype<wchar_t>::
++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ mbstate_t __state;
++ memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
++ mbsrtowcs(__dest, &__lo, __hi - __lo, &__state);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++
++ char
++ ctype<wchar_t>::
++ do_narrow(wchar_t __wc, char __dfault) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ int __c = wctob(__wc);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ 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
++ size_t __offset = 0;
++ while (true)
++ {
++ const wchar_t* __start = __lo + __offset;
++ size_t __len = __hi - __start;
++
++ mbstate_t __state;
++ memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
++ size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state);
++ if (__con != __len && __start != 0)
++ {
++ __offset = __start - __lo;
++ __dest[__offset++] = __dfault;
++ }
++ else
++ break;
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++#endif // _GLIBCPP_USE_WCHAR_T
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc 2004-01-09 08:46:16.000000000 -0600
+@@ -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, 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.2.7.1.2 messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::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<const char*>(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 _GLIBCPP_USE_WCHAR_T
++ template<>
++ wstring
++ messages<wchar_t>::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
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h 2004-01-09 08:52:48.000000000 -0600
+@@ -0,0 +1,122 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#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<typename _CharT>
++ messages<_CharT>::messages(size_t __refs)
++ : locale::facet(__refs)
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ _M_name_messages = _S_c_name;
++#endif
++ _M_c_locale_messages = _S_c_locale;
++ }
++
++ template<typename _CharT>
++ messages<_CharT>::messages(__c_locale __cloc,
++ const char* __s, size_t __refs)
++ : locale::facet(__refs)
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ _M_name_messages = new char[strlen(__s) + 1];
++ strcpy(_M_name_messages, __s);
++#endif
++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++ const char* __dir) const
++ {
++ __bindtextdomain(__s.c_str(), __dir);
++ return this->do_open(__s, __loc);
++ }
++
++ // Virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::~messages()
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ if (_S_c_name != _M_name_messages)
++ delete [] _M_name_messages;
++#endif
++ _S_destroy_c_locale(_M_c_locale_messages);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::do_open(const basic_string<char>& __s,
++ const locale&) const
++ {
++ // No error checking is done, assume the catalog exists and can
++ // be used.
++ __textdomain(__s.c_str());
++ return 0;
++ }
++
++ template<typename _CharT>
++ void
++ messages<_CharT>::do_close(catalog) const
++ { }
++
++ // messages_byname
++ template<typename _CharT>
++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++ : messages<_CharT>(__refs)
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ if (_S_c_name != _M_name_messages)
++ delete [] _M_name_messages;
++ _M_name_messages = new char[strlen(__s) + 1];
++ strcpy(_M_name_messages, __s);
++#endif
++ _S_destroy_c_locale(_M_c_locale_messages);
++ _S_create_c_locale(_M_c_locale_messages, __s);
++ }
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2004-01-09 18:20:23.000000000 -0600
+@@ -0,0 +1,578 @@
++// std::moneypunct 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, 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.2.6.3.2 moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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.
++ if (__space)
++ {
++ // Pattern starts with sign.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[2] = space;
++ __ret.field[3] = symbol;
++ }
++ __ret.field[0] = sign;
++ }
++ 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[0] = sign;
++ __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[1] = space;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = space;
++ __ret.field[2] = symbol;
++ }
++ __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 (__space)
++ {
++ // Have space.
++ if (__precedes)
++ {
++ __ret.field[0] = sign;
++ __ret.field[1] = symbol;
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = space;
++ __ret.field[2] = sign;
++ __ret.field[3] = symbol;
++ }
++ }
++ else
++ {
++ // Have none.
++ if (__precedes)
++ {
++ __ret.field[0] = sign;
++ __ret.field[1] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = sign;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[3] = none;
++ }
++ break;
++ case 4:
++ // 4 The sign immediately follows the symbol.
++ if (__space)
++ {
++ // Have space.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = sign;
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = space;
++ __ret.field[2] = symbol;
++ __ret.field[3] = sign;
++ }
++ }
++ else
++ {
++ // Have none.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = sign;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = symbol;
++ __ret.field[2] = sign;
++ }
++ __ret.field[3] = none;
++ }
++ break;
++ default:
++ ;
++ }
++ return __ret;
++ }
++
++ template<>
++ void
++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = '.';
++ _M_thousands_sep = ',';
++ _M_grouping = "";
++ _M_curr_symbol = "";
++ _M_positive_sign = "";
++ _M_negative_sign = "";
++ _M_frac_digits = 0;
++ _M_pos_format = money_base::_S_default_pattern;
++ _M_neg_format = money_base::_S_default_pattern;
++ }
++ else
++ {
++ // Named locale.
++ _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
++ _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
++ _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++
++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_negative_sign = "()";
++ else
++ _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++
++ // _Intl == true
++ _M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++ _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_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_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
++ }
++ }
++
++ template<>
++ void
++ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = '.';
++ _M_thousands_sep = ',';
++ _M_grouping = "";
++ _M_curr_symbol = "";
++ _M_positive_sign = "";
++ _M_negative_sign = "";
++ _M_frac_digits = 0;
++ _M_pos_format = money_base::_S_default_pattern;
++ _M_neg_format = money_base::_S_default_pattern;
++ }
++ else
++ {
++ // Named locale.
++ _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
++ _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
++ _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++
++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_negative_sign = "()";
++ else
++ _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++
++ // _Intl == false
++ _M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++ _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_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_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
++ }
++ }
++
++ template<>
++ moneypunct<char, true>::~moneypunct()
++ { }
++
++ template<>
++ moneypunct<char, false>::~moneypunct()
++ { }
++
++#ifdef _GLIBCPP_USE_WCHAR_T
++ template<>
++ void
++ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = L'.';
++ _M_thousands_sep = L',';
++ _M_grouping = "";
++ _M_curr_symbol = L"";
++ _M_positive_sign = L"";
++ _M_negative_sign = L"";
++ _M_frac_digits = 0;
++ _M_pos_format = money_base::_S_default_pattern;
++ _M_neg_format = money_base::_S_default_pattern;
++ }
++ 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
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_decimal_point = __cloc->decimal_point_wc;
++ _M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_decimal_point = __global_locale->decimal_point_wc;
++ _M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
++
++ _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
++#endif
++ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++
++ 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);
++
++ mbstate_t __state;
++ size_t __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__cpossign, __len, &__state);
++ _M_positive_sign = __wcs;
++ }
++ else
++ _M_positive_sign = L"";
++
++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
++ _M_negative_sign = __wcs;
++ }
++ else
++ _M_negative_sign = L"";
++
++ // _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_curr_symbol = __wcs;
++ }
++ else
++ _M_curr_symbol = L"";
++
++ _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_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_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<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = L'.';
++ _M_thousands_sep = L',';
++ _M_grouping = "";
++ _M_curr_symbol = L"";
++ _M_positive_sign = L"";
++ _M_negative_sign = L"";
++ _M_frac_digits = 0;
++ _M_pos_format = money_base::_S_default_pattern;
++ _M_neg_format = money_base::_S_default_pattern;
++ }
++ 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
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_decimal_point = __cloc->decimal_point_wc;
++ _M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_decimal_point = __global_locale->decimal_point_wc;
++ _M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
++ _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
++#endif
++ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++
++ 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);
++
++ mbstate_t __state;
++ size_t __len;
++ __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__cpossign, __len, &__state);
++ _M_positive_sign = __wcs;
++ }
++ else
++ _M_positive_sign = L"";
++
++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
++ _M_negative_sign = __wcs;
++ }
++ else
++ _M_negative_sign = L"";
++
++ // _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_curr_symbol = __wcs;
++ }
++ else
++ _M_curr_symbol = L"";
++
++ _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_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_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ moneypunct<wchar_t, true>::~moneypunct()
++ {
++ if (wcslen(_M_positive_sign))
++ delete [] _M_positive_sign;
++ if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
++ delete [] _M_negative_sign;
++ if (wcslen(_M_curr_symbol))
++ delete [] _M_curr_symbol;
++ }
++
++ template<>
++ moneypunct<wchar_t, false>::~moneypunct()
++ {
++ if (wcslen(_M_positive_sign))
++ delete [] _M_positive_sign;
++ if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
++ delete [] _M_negative_sign;
++ if (wcslen(_M_curr_symbol))
++ delete [] _M_curr_symbol;
++ }
++#endif
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2004-01-09 18:20:59.000000000 -0600
+@@ -0,0 +1,129 @@
++// std::numpunct 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, 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.2.3.1.2 numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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<char>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = '.';
++ _M_thousands_sep = ',';
++ _M_grouping = "";
++ }
++ else
++ {
++ // Named locale.
++ _M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
++ _M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __cloc));
++ // Check for NUL, which implies no grouping.
++ if (_M_thousands_sep == '\0')
++ _M_grouping = "";
++ else
++ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ }
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_truename = "true";
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_falsename = "false";
++ }
++
++ template<>
++ numpunct<char>::~numpunct()
++ { }
++
++#ifdef _GLIBCPP_USE_WCHAR_T
++ template<>
++ void
++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = L'.';
++ _M_thousands_sep = L',';
++ _M_grouping = "";
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_decimal_point = __cloc->decimal_point_wc;
++ _M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_decimal_point = __global_locale->decimal_point_wc;
++ _M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
++ _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
++#endif
++ if (_M_thousands_sep == L'\0')
++ _M_grouping = "";
++ else
++ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ }
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_truename = L"true";
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_falsename = L"false";
++ }
++
++ template<>
++ numpunct<wchar_t>::~numpunct()
++ { }
++ #endif
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-01-09 08:25:03.000000000 -0600
+@@ -0,0 +1,341 @@
++// std::time_get, std::time_put implementation, 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, 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.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::
++ _M_put(char* __s, size_t __maxlen, const char* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ strftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++
++ template<>
++ void
++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_c_locale;
++
++ _M_date_format = "%m/%d/%y";
++ _M_date_era_format = "%m/%d/%y";
++ _M_time_format = "%H:%M:%S";
++ _M_time_era_format = "%H:%M:%S";
++ _M_date_time_format = "";
++ _M_date_time_era_format = "";
++ _M_am = "AM";
++ _M_pm = "PM";
++ _M_am_pm_format = "";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_day1 = "Sunday";
++ _M_day2 = "Monday";
++ _M_day3 = "Tuesday";
++ _M_day4 = "Wednesday";
++ _M_day5 = "Thursday";
++ _M_day6 = "Friday";
++ _M_day7 = "Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_day_a1 = "Sun";
++ _M_day_a2 = "Mon";
++ _M_day_a3 = "Tue";
++ _M_day_a4 = "Wed";
++ _M_day_a5 = "Thu";
++ _M_day_a6 = "Fri";
++ _M_day_a7 = "Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_month01 = "January";
++ _M_month02 = "February";
++ _M_month03 = "March";
++ _M_month04 = "April";
++ _M_month05 = "May";
++ _M_month06 = "June";
++ _M_month07 = "July";
++ _M_month08 = "August";
++ _M_month09 = "September";
++ _M_month10 = "October";
++ _M_month11 = "November";
++ _M_month12 = "December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_month_a01 = "Jan";
++ _M_month_a02 = "Feb";
++ _M_month_a03 = "Mar";
++ _M_month_a04 = "Apr";
++ _M_month_a05 = "May";
++ _M_month_a06 = "Jun";
++ _M_month_a07 = "July";
++ _M_month_a08 = "Aug";
++ _M_month_a09 = "Sep";
++ _M_month_a10 = "Oct";
++ _M_month_a11 = "Nov";
++ _M_month_a12 = "Dec";
++ }
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ _M_date_format = __nl_langinfo_l(D_FMT, __cloc);
++ _M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
++ _M_time_format = __nl_langinfo_l(T_FMT, __cloc);
++ _M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
++ _M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
++ _M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
++ _M_am = __nl_langinfo_l(AM_STR, __cloc);
++ _M_pm = __nl_langinfo_l(PM_STR, __cloc);
++ _M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
++
++ // Day names, starting with "C"'s Sunday.
++ _M_day1 = __nl_langinfo_l(DAY_1, __cloc);
++ _M_day2 = __nl_langinfo_l(DAY_2, __cloc);
++ _M_day3 = __nl_langinfo_l(DAY_3, __cloc);
++ _M_day4 = __nl_langinfo_l(DAY_4, __cloc);
++ _M_day5 = __nl_langinfo_l(DAY_5, __cloc);
++ _M_day6 = __nl_langinfo_l(DAY_6, __cloc);
++ _M_day7 = __nl_langinfo_l(DAY_7, __cloc);
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_day_a1 = __nl_langinfo_l(ABDAY_1, __cloc);
++ _M_day_a2 = __nl_langinfo_l(ABDAY_2, __cloc);
++ _M_day_a3 = __nl_langinfo_l(ABDAY_3, __cloc);
++ _M_day_a4 = __nl_langinfo_l(ABDAY_4, __cloc);
++ _M_day_a5 = __nl_langinfo_l(ABDAY_5, __cloc);
++ _M_day_a6 = __nl_langinfo_l(ABDAY_6, __cloc);
++ _M_day_a7 = __nl_langinfo_l(ABDAY_7, __cloc);
++
++ // Month names, starting with "C"'s January.
++ _M_month01 = __nl_langinfo_l(MON_1, __cloc);
++ _M_month02 = __nl_langinfo_l(MON_2, __cloc);
++ _M_month03 = __nl_langinfo_l(MON_3, __cloc);
++ _M_month04 = __nl_langinfo_l(MON_4, __cloc);
++ _M_month05 = __nl_langinfo_l(MON_5, __cloc);
++ _M_month06 = __nl_langinfo_l(MON_6, __cloc);
++ _M_month07 = __nl_langinfo_l(MON_7, __cloc);
++ _M_month08 = __nl_langinfo_l(MON_8, __cloc);
++ _M_month09 = __nl_langinfo_l(MON_9, __cloc);
++ _M_month10 = __nl_langinfo_l(MON_10, __cloc);
++ _M_month11 = __nl_langinfo_l(MON_11, __cloc);
++ _M_month12 = __nl_langinfo_l(MON_12, __cloc);
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_month_a01 = __nl_langinfo_l(ABMON_1, __cloc);
++ _M_month_a02 = __nl_langinfo_l(ABMON_2, __cloc);
++ _M_month_a03 = __nl_langinfo_l(ABMON_3, __cloc);
++ _M_month_a04 = __nl_langinfo_l(ABMON_4, __cloc);
++ _M_month_a05 = __nl_langinfo_l(ABMON_5, __cloc);
++ _M_month_a06 = __nl_langinfo_l(ABMON_6, __cloc);
++ _M_month_a07 = __nl_langinfo_l(ABMON_7, __cloc);
++ _M_month_a08 = __nl_langinfo_l(ABMON_8, __cloc);
++ _M_month_a09 = __nl_langinfo_l(ABMON_9, __cloc);
++ _M_month_a10 = __nl_langinfo_l(ABMON_10, __cloc);
++ _M_month_a11 = __nl_langinfo_l(ABMON_11, __cloc);
++ _M_month_a12 = __nl_langinfo_l(ABMON_12, __cloc);
++ }
++ }
++
++#ifdef _GLIBCPP_USE_WCHAR_T
++ template<>
++ void
++ __timepunct<wchar_t>::
++ _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);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ wcsftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++
++ template<>
++ void
++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++#warning wide time stuff
++// if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_c_locale;
++
++ _M_date_format = L"%m/%d/%y";
++ _M_date_era_format = L"%m/%d/%y";
++ _M_time_format = L"%H:%M:%S";
++ _M_time_era_format = L"%H:%M:%S";
++ _M_date_time_format = L"";
++ _M_date_time_era_format = L"";
++ _M_am = L"AM";
++ _M_pm = L"PM";
++ _M_am_pm_format = L"";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_day1 = L"Sunday";
++ _M_day2 = L"Monday";
++ _M_day3 = L"Tuesday";
++ _M_day4 = L"Wednesday";
++ _M_day5 = L"Thursday";
++ _M_day6 = L"Friday";
++ _M_day7 = L"Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_day_a1 = L"Sun";
++ _M_day_a2 = L"Mon";
++ _M_day_a3 = L"Tue";
++ _M_day_a4 = L"Wed";
++ _M_day_a5 = L"Thu";
++ _M_day_a6 = L"Fri";
++ _M_day_a7 = L"Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_month01 = L"January";
++ _M_month02 = L"February";
++ _M_month03 = L"March";
++ _M_month04 = L"April";
++ _M_month05 = L"May";
++ _M_month06 = L"June";
++ _M_month07 = L"July";
++ _M_month08 = L"August";
++ _M_month09 = L"September";
++ _M_month10 = L"October";
++ _M_month11 = L"November";
++ _M_month12 = L"December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_month_a01 = L"Jan";
++ _M_month_a02 = L"Feb";
++ _M_month_a03 = L"Mar";
++ _M_month_a04 = L"Apr";
++ _M_month_a05 = L"May";
++ _M_month_a06 = L"Jun";
++ _M_month_a07 = L"July";
++ _M_month_a08 = L"Aug";
++ _M_month_a09 = L"Sep";
++ _M_month_a10 = L"Oct";
++ _M_month_a11 = L"Nov";
++ _M_month_a12 = L"Dec";
++ }
++#if 0
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ _M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
++ _M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
++ _M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
++ _M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
++ _M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
++ _M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
++ _M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
++ _M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
++ _M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
++
++ // Day names, starting with "C"'s Sunday.
++ _M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
++ _M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
++ _M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
++ _M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
++ _M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
++ _M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
++ _M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_day_a1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
++ _M_day_a2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
++ _M_day_a3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
++ _M_day_a4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
++ _M_day_a5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
++ _M_day_a6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
++ _M_day_a7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
++
++ // Month names, starting with "C"'s January.
++ _M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
++ _M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
++ _M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
++ _M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
++ _M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
++ _M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
++ _M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
++ _M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
++ _M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
++ _M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
++ _M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
++ _M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_month_a01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
++ _M_month_a02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
++ _M_month_a03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
++ _M_month_a04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
++ _M_month_a05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
++ _M_month_a06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
++ _M_month_a07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
++ _M_month_a08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
++ _M_month_a09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
++ _M_month_a10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
++ _M_month_a11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
++ _M_month_a12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
++ }
++#endif // 0
++ }
++#endif
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h 2004-01-09 04:26:21.000000000 -0600
+@@ -0,0 +1,68 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// 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 <bkoz@redhat.com>
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(size_t __refs)
++ : locale::facet(__refs)
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ _M_name_timepunct = _S_c_name;
++#endif
++ _M_initialize_timepunct();
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__c_locale __cloc,
++ const char* __s,
++ size_t __refs)
++ : locale::facet(__refs)
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ _M_name_timepunct = new char[strlen(__s) + 1];
++ strcpy(_M_name_timepunct, __s);
++#endif
++ _M_initialize_timepunct(__cloc);
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::~__timepunct()
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ if (_S_c_name != _M_name_timepunct)
++ delete [] _M_name_timepunct;
++#endif
++ _S_destroy_c_locale(_M_c_locale_timepunct);
++ }
+diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h
+--- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h 2004-01-09 02:54:54.000000000 -0600
+@@ -0,0 +1,57 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 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
++//
++
++// Information as gleaned from /usr/include/ctype.h
++
++ 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<char>::_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 = _ISgraph;
++ static const mask cntrl = _IScntrl;
++ static const mask punct = _ISpunct;
++ static const mask alnum = _ISalnum;
++ };
+diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h
+--- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h 2002-06-24 00:49:19.000000000 -0500
+@@ -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<char>::
++ is(mask __m, char __c) const
++ { return _M_table[static_cast<unsigned char>(__c)] & __m; }
++
++ const char*
++ ctype<char>::
++ is(const char* __low, const char* __high, mask* __vec) const
++ {
++ while (__low < __high)
++ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
++ return __high;
++ }
++
++ const char*
++ ctype<char>::
++ scan_is(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high
++ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
++ ++__low;
++ return __low;
++ }
++
++ const char*
++ ctype<char>::
++ scan_not(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high
++ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
++ ++__low;
++ return __low;
++ }
+diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h
+--- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2004-01-09 03:34:53.000000000 -0600
+@@ -0,0 +1,90 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 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, 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<char>::classic_table() throw()
++ {
++ return __C_ctype_b;
++ }
++
++ ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
++ size_t __refs)
++ : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
++ {
++ _M_toupper = __C_ctype_toupper;
++ _M_tolower = __C_ctype_tolower;
++ _M_table = __table ? __table : __C_ctype_b;
++ _M_c_locale_ctype = _S_c_locale;
++ }
++
++ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
++ __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
++ {
++ _M_toupper = __C_ctype_toupper;
++ _M_tolower = __C_ctype_tolower;
++ _M_table = __table ? __table : __C_ctype_b;
++ _M_c_locale_ctype = _S_c_locale;
++ }
++
++ char
++ ctype<char>::do_toupper(char __c) const
++ { return _M_toupper[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<char>::do_toupper(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = _M_toupper[static_cast<unsigned char>(*__low)];
++ ++__low;
++ }
++ return __high;
++ }
++
++ char
++ ctype<char>::do_tolower(char __c) const
++ { return _M_tolower[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<char>::do_tolower(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = _M_tolower[static_cast<unsigned char>(*__low)];
++ ++__low;
++ }
++ return __high;
++ }
+diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h
+--- gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h 2004-01-09 04:56:13.000000000 -0600
+@@ -0,0 +1,56 @@
++// Specific definitions for GNU/Linux -*- C++ -*-
++
++// Copyright (C) 2000, 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, 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 _GLIBCPP_OS_DEFINES
++#define _GLIBCPP_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 <features.h>
++
++// These systems have declarations mismatching those in libio.h by
++// omitting throw qualifiers. Cleanest way out is to not provide
++// throw-qualifiers at all. Defining it as empty here will make libio.h
++// not define it.
++#undef __THROW
++#define __THROW
++
++// Tell Glibc not to try to provide its own inline versions of
++// some math functions. Those cause assembly-time clashes with
++// our definitions.
++#define __NO_MATH_INLINES
++
++// We must not see the optimized string functions GNU libc defines.
++#define __NO_STRING_INLINES
++
++#endif
--- /dev/null
+--- gcc/gcc/loop.c 14 Feb 2004 14:46:03 -0000 1.488.2.3
++++ gcc/gcc/loop.c 28 Apr 2004 22:02:53 -0000
+@@ -929,6 +929,7 @@
+ || (! (GET_CODE (SET_SRC (set)) == REG
+ && (REGNO (SET_SRC (set))
+ < FIRST_PSEUDO_REGISTER))))
++ && regno >= FIRST_PSEUDO_REGISTER
+ /* This test is not redundant; SET_SRC (set) might be
+ a call-clobbered register and the life of REGNO
+ might span a call. */
--- /dev/null
+diff -urN gcc-3.3.3-dist/boehm-gc/config.sub gcc-3.3.3/boehm-gc/config.sub
+--- gcc-3.3.3-dist/boehm-gc/config.sub 2002-02-11 22:37:53.000000000 -0600
++++ gcc-3.3.3/boehm-gc/config.sub 2004-08-12 04:47:51.000000000 -0500
+@@ -118,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
++ nto-qnx* | linux-gnu* | linux-uclibc* | storm-chaos* | os2-emx* | windows32-*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -1089,7 +1089,8 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+diff -urN gcc-3.3.3-dist/boehm-gc/configure gcc-3.3.3/boehm-gc/configure
+--- gcc-3.3.3-dist/boehm-gc/configure 2004-02-14 14:34:20.000000000 -0600
++++ gcc-3.3.3/boehm-gc/configure 2004-08-12 04:47:51.000000000 -0500
+@@ -1940,6 +1940,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN gcc-3.3.3-dist/config.sub gcc-3.3.3/config.sub
+--- gcc-3.3.3-dist/config.sub 2003-01-30 17:25:36.000000000 -0600
++++ gcc-3.3.3/config.sub 2004-08-12 04:47:51.000000000 -0500
+@@ -118,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
++ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -1112,7 +1112,8 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+diff -urN gcc-3.3.3-dist/gcc/config/arm/linux-elf.h gcc-3.3.3/gcc/config/arm/linux-elf.h
+--- gcc-3.3.3-dist/gcc/config/arm/linux-elf.h 2003-09-16 10:39:23.000000000 -0500
++++ gcc-3.3.3/gcc/config/arm/linux-elf.h 2004-08-12 04:47:51.000000000 -0500
+@@ -78,6 +78,18 @@
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define LINK_SPEC "%{h*} %{version:-v} \
++ %{b} %{Wl,*:%*} \
++ %{static:-Bstatic} \
++ %{shared:-shared} \
++ %{symbolic:-Bsymbolic} \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
++ -X \
++ %{mbig-endian:-EB}" \
++ SUBTARGET_EXTRA_LINK_SPEC
++#else
+ #define LINK_SPEC "%{h*} %{version:-v} \
+ %{b} %{Wl,*:%*} \
+ %{static:-Bstatic} \
+@@ -88,6 +100,7 @@
+ -X \
+ %{mbig-endian:-EB}" \
+ SUBTARGET_EXTRA_LINK_SPEC
++#endif
+
+ #define TARGET_OS_CPP_BUILTINS() \
+ do { \
+diff -urN gcc-3.3.3-dist/gcc/config/cris/linux.h gcc-3.3.3/gcc/config/cris/linux.h
+--- gcc-3.3.3-dist/gcc/config/cris/linux.h 2003-03-10 21:01:35.000000000 -0600
++++ gcc-3.3.3/gcc/config/cris/linux.h 2004-08-12 04:47:51.000000000 -0500
+@@ -81,6 +81,25 @@
+ #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"
+
+@@ -95,6 +114,8 @@
+ %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
+ %{!r:%{O2|O3: --gc-sections}}"
+
++#endif /* USE_UCLIBC */
++
+
+ /* Node: Run-time Target */
+
+diff -urN gcc-3.3.3-dist/gcc/config/cris/t-linux-uclibc gcc-3.3.3/gcc/config/cris/t-linux-uclibc
+--- gcc-3.3.3-dist/gcc/config/cris/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.3/gcc/config/cris/t-linux-uclibc 2004-08-12 04:47:51.000000000 -0500
+@@ -0,0 +1,3 @@
++T_CFLAGS = -DUSE_UCLIBC
++TARGET_LIBGCC2_CFLAGS += -fPIC
++CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
+diff -urN gcc-3.3.3-dist/gcc/config/i386/linux.h gcc-3.3.3/gcc/config/i386/linux.h
+--- gcc-3.3.3-dist/gcc/config/i386/linux.h 2003-11-14 00:46:12.000000000 -0600
++++ gcc-3.3.3/gcc/config/i386/linux.h 2004-08-12 04:47:51.000000000 -0500
+@@ -136,6 +136,15 @@
+ %{static:-static}}}"
+ #endif
+ #else
++#if defined USE_UCLIBC
++#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
++ %{!shared: \
++ %{!ibcs: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}}}"
++#else
+ #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+@@ -144,6 +153,7 @@
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{static:-static}}}"
+ #endif
++#endif
+
+ /* A C statement (sans semicolon) to output to the stdio stream
+ FILE the assembler definition of uninitialized global DECL named
+diff -urN gcc-3.3.3-dist/gcc/config/mips/linux.h gcc-3.3.3/gcc/config/mips/linux.h
+--- gcc-3.3.3-dist/gcc/config/mips/linux.h 2003-12-23 02:58:00.000000000 -0600
++++ gcc-3.3.3/gcc/config/mips/linux.h 2004-08-12 04:47:51.000000000 -0500
+@@ -175,6 +175,17 @@
+
+ /* Borrowed from sparc/linux.h */
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define LINK_SPEC \
++ "%(endian_spec) \
++ %{shared:-shared} \
++ %{!shared: \
++ %{!ibcs: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}}}"
++#else
+ #define LINK_SPEC \
+ "%(endian_spec) \
+ %{shared:-shared} \
+@@ -184,6 +195,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{static:-static}}}"
++#endif
+
+ #undef SUBTARGET_ASM_SPEC
+ #define SUBTARGET_ASM_SPEC "\
+diff -urN gcc-3.3.3-dist/gcc/config/sh/linux.h gcc-3.3.3/gcc/config/sh/linux.h
+--- gcc-3.3.3-dist/gcc/config/sh/linux.h 2003-11-06 17:13:33.000000000 -0600
++++ gcc-3.3.3/gcc/config/sh/linux.h 2004-08-12 04:47:51.000000000 -0500
+@@ -44,12 +44,21 @@
+ #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
+
+ /* The GNU C++ standard library requires that these macros be defined. */
+ #undef CPLUSPLUS_CPP_SPEC
+diff -urN gcc-3.3.3-dist/gcc/config/sh/t-linux-uclibc gcc-3.3.3/gcc/config/sh/t-linux-uclibc
+--- gcc-3.3.3-dist/gcc/config/sh/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.3/gcc/config/sh/t-linux-uclibc 2004-08-12 04:47:51.000000000 -0500
+@@ -0,0 +1,16 @@
++T_CFLAGS = -DUSE_UCLIBC
++
++# Don't run fixproto
++STMP_FIXPROTO =
++
++TARGET_LIBGCC2_CFLAGS = -fpic
++LIB1ASMFUNCS_CACHE = _ic_invalidate
++
++LIB2FUNCS_EXTRA=
++
++MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m3e/m4
++MULTILIB_DIRNAMES=
++MULTILIB_MATCHES =
++MULTILIB_EXCEPTIONS=
++
++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
+diff -urN gcc-3.3.3-dist/gcc/config/sh/t-sh64-uclibc gcc-3.3.3/gcc/config/sh/t-sh64-uclibc
+--- gcc-3.3.3-dist/gcc/config/sh/t-sh64-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.3/gcc/config/sh/t-sh64-uclibc 2004-08-12 04:47:51.000000000 -0500
+@@ -0,0 +1,13 @@
++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o
++
++LIB1ASMFUNCS = \
++ _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
++ _shcompact_call_trampoline _shcompact_return_trampoline \
++ _shcompact_incoming_args _ic_invalidate _nested_trampoline \
++ _push_pop_shmedia_regs \
++ _udivdi3 _divdi3 _umoddi3 _moddi3
++
++MULTILIB_OPTIONS = $(MULTILIB_ENDIAN) m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
++MULTILIB_DIRNAMES= $(MULTILIB_ENDIAN) nofpu compact nofpu/compact media64 nofpu/media64
++MULTILIB_MATCHES=
++MULTILIB_EXCEPTIONS=
+diff -urN gcc-3.3.3-dist/gcc/config/t-linux-uclibc gcc-3.3.3/gcc/config/t-linux-uclibc
+--- gcc-3.3.3-dist/gcc/config/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.3/gcc/config/t-linux-uclibc 2004-08-12 04:47:51.000000000 -0500
+@@ -0,0 +1,23 @@
++T_CFLAGS = -DUSE_UCLIBC
++
++# Don't run fixproto
++STMP_FIXPROTO =
++
++# Compile crtbeginS.o and crtendS.o with pic.
++CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
++# Compile libgcc2.a with pic.
++TARGET_LIBGCC2_CFLAGS = -fPIC
++
++# Override t-slibgcc-elf-ver to export some libgcc symbols with
++# the symbol versions that glibc used.
++SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
++
++# Use unwind-dw2-fde-glibc
++#LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
++# $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
++#LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
++
++# Use unwind-dw2-fde
++LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
++ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
++LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
+diff -urN gcc-3.3.3-dist/gcc/config.gcc gcc-3.3.3/gcc/config.gcc
+--- gcc-3.3.3-dist/gcc/config.gcc 2004-01-21 00:06:00.000000000 -0600
++++ gcc-3.3.3/gcc/config.gcc 2004-08-12 04:47:51.000000000 -0500
+@@ -697,6 +697,17 @@
+ extra_parts=""
+ use_collect2=yes
+ ;;
++arm*-*-linux-uclibc*) # ARM GNU/Linux with ELF - uClibc
++ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux"
++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
++ gnu_ld=yes
++ case x${enable_threads} in
++ x | xyes | xpthreads | xposix)
++ thread_file='posix'
++ ;;
++ esac
++ ;;
+ arm*-*-linux*) # ARM GNU/Linux with ELF
+ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
+ tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
+@@ -772,6 +783,10 @@
+ tmake_file="cris/t-cris cris/t-elfmulti"
+ gas=yes
+ ;;
++cris-*-linux-uclibc*)
++ tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
++ tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux-uclibc"
++ ;;
+ cris-*-linux*)
+ tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
+ tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
+@@ -1173,6 +1188,11 @@
+ thread_file='single'
+ fi
+ ;;
++i[34567]86-*-linux*uclibc*) # Intel 80386's running GNU/Linux
++ # with ELF format using uClibc
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h"
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc i386/t-crtstuff"
++ ;;
+ i[34567]86-*-linux*) # Intel 80386's running GNU/Linux
+ # with ELF format using glibc 2
+ # aka GNU/Linux C library 6
+@@ -1883,6 +1903,16 @@
+ tm_file="elfos.h ${tm_file} mips/netbsd.h"
+ tmake_file="${tmake_file} mips/t-netbsd"
+ ;;
++mips*-*-linux-uclibc*) # Linux MIPS, either endian. uClibc
++ tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
++ case $machine in
++ mipsisa32*-*)
++ target_cpu_default="MASK_SOFT_FLOAT"
++ tm_defines="MIPS_ISA_DEFAULT=32"
++ ;;
++ esac
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc mips/t-linux"
++ ;;
+ mips*-*-linux*) # Linux MIPS, either endian.
+ tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
+ case $machine in
+@@ -2129,6 +2159,11 @@
+ out_file=rs6000/rs6000.c
+ tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
+ ;;
++powerpc-*-linux-uclibc*)
++ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
++ out_file=rs6000/rs6000.c
++ tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux-uclibc rs6000/t-ppccomm"
++ ;;
+ powerpc-*-linux*)
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
+ out_file=rs6000/rs6000.c
+@@ -2313,10 +2348,18 @@
+ tmake_file="${tmake_file} sh/t-le"
+ ;;
+ esac
+- tmake_file="${tmake_file} sh/t-linux"
++ case $machine in
++ *-*-linux-uclibc*) tmake_file="${tmake_file} sh/t-linux-uclibc" ;;
++ *) tmake_file="${tmake_file} sh/t-linux" ;;
++ esac
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h"
+ gas=yes gnu_ld=yes
+ case $machine in
++ sh64*-*-linux-uclibc*)
++ tmake_file="${tmake_file} sh/t-sh64-uclibc"
++ tm_file="${tm_file} sh/sh64.h"
++ extra_headers="shmedia.h ushmedia.h sshmedia.h"
++ ;;
+ sh64*)
+ tmake_file="${tmake_file} sh/t-sh64"
+ tm_file="${tm_file} sh/sh64.h"
+diff -urN gcc-3.3.3-dist/libstdc++-v3/aclocal.m4 gcc-3.3.3/libstdc++-v3/aclocal.m4
+--- gcc-3.3.3-dist/libstdc++-v3/aclocal.m4 2004-01-12 10:18:44.000000000 -0600
++++ gcc-3.3.3/libstdc++-v3/aclocal.m4 2004-08-12 04:47:51.000000000 -0500
+@@ -1216,6 +1216,9 @@
+ dnl Default to "generic"
+ if test x$enable_clocale_flag = xno; then
+ case x${target_os} in
++ xlinux-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ xlinux* | xgnu*)
+ AC_EGREP_CPP([_GLIBCPP_ok], [
+ #include <features.h>
+@@ -1339,6 +1342,41 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ xuclibc)
++ 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 \
++ glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
++ glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
++ done
++ AC_SUBST(glibcpp_MOFILES)
++ AC_SUBST(glibcpp_POFILES)
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_H=config/locale/uclibc/codecvt_specializations.h
++ 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
++ ;;
+ *)
+ echo "$enable_clocale is an unknown locale package" 1>&2
+ exit 1
+diff -urN gcc-3.3.3-dist/libstdc++-v3/configure gcc-3.3.3/libstdc++-v3/configure
+--- gcc-3.3.3-dist/libstdc++-v3/configure 2004-01-12 10:18:45.000000000 -0600
++++ gcc-3.3.3/libstdc++-v3/configure 2004-08-12 04:49:13.000000000 -0500
+@@ -2010,6 +2010,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -2996,6 +3001,9 @@
+
+ if test x$enable_clocale_flag = xno; then
+ case x${target_os} in
++ xlinux-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ xlinux* | xgnu*)
+ cat > conftest.$ac_ext <<EOF
+ #line 3002 "configure"
+@@ -3182,6 +3190,70 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ xuclibc)
++ echo "$ac_t""uclibc" 1>&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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:3117: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_check_msgfmt'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ if test -n "$check_msgfmt"; then
++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
++else
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="$PATH"
++ for ac_dir in $ac_dummy; do
++ test -z "$ac_dir" && ac_dir=.
++ if test -f $ac_dir/$ac_word; then
++ ac_cv_prog_check_msgfmt="yes"
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ 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 "$ac_t""$check_msgfmt" 1>&6
++else
++ echo "$ac_t""no" 1>&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 \
++ glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
++ glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
++ done
++
++
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_H=config/locale/uclibc/codecvt_specializations.h
++ 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
++ ;;
+ *)
+ echo "$enable_clocale is an unknown locale package" 1>&2
+ exit 1
+@@ -4212,6 +4284,968 @@
+ # GLIBCPP_CHECK_MATH_SUPPORT
+
+ case "$target" in
++ *-uclibc*)
++ os_include_dir="os/uclibc"
++ for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \
++ machine/endian.h machine/param.h sys/machine.h sys/types.h \
++ fp.h locale.h float.h inttypes.h
++do
++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
++echo "configure:4224: checking for $ac_hdr" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4229 "configure"
++#include "confdefs.h"
++#include <$ac_hdr>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:4234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=yes"
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_hdr 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++fi
++done
++
++ SECTION_FLAGS='-ffunction-sections -fdata-sections'
++
++
++ # If we're not using GNU ld, then there's no point in even trying these
++ # tests. Check for that first. We should have already tested for gld
++ # by now (in libtool), but require it now just to be safe...
++ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
++ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
++
++
++ # The name set by libtool depends on the version of libtool. Shame on us
++ # for depending on an impl detail, but c'est la vie. Older versions used
++ # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
++ # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
++ # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
++ # set (hence we're using an older libtool), then set it.
++ if test x${with_gnu_ld+set} != xset; then
++ if test x${ac_cv_prog_gnu_ld+set} != xset; then
++ # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
++ with_gnu_ld=no
++ else
++ with_gnu_ld=$ac_cv_prog_gnu_ld
++ fi
++ fi
++
++ # Start by getting the version number. I think the libtool test already
++ # does some of this, but throws away the result.
++
++ ldver=`$LD --version 2>/dev/null | head -1 | \
++ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
++
++ glibcpp_gnu_ld_version=`echo $ldver | \
++ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
++
++ # Set --gc-sections.
++ if test "$with_gnu_ld" = "notbroken"; then
++ # GNU ld it is! Joy and bunny rabbits!
++
++ # All these tests are for C++; save the language and the compiler flags.
++ # Need to do this so that g++ won't try to link in libstdc++
++ ac_test_CFLAGS="${CFLAGS+set}"
++ ac_save_CFLAGS="$CFLAGS"
++ CFLAGS='-x c++ -Wl,--gc-sections'
++
++ # Check for -Wl,--gc-sections
++ # XXX This test is broken at the moment, as symbols required for
++ # linking are now in libsupc++ (not built yet.....). In addition,
++ # this test has cored on solaris in the past. In addition,
++ # --gc-sections doesn't really work at the moment (keeps on discarding
++ # used sections, first .eh_frame and now some of the glibc sections for
++ # iconv). Bzzzzt. Thanks for playing, maybe next time.
++ echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
++echo "configure:4312: checking for ld that supports -Wl,--gc-sections" >&5
++ if test "$cross_compiling" = yes; then
++ ac_sectionLDflags=yes
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4317 "configure"
++#include "confdefs.h"
++
++ int main(void)
++ {
++ try { throw 1; }
++ catch (...) { };
++ return 0;
++ }
++
++EOF
++if { (eval echo configure:4328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++then
++ ac_sectionLDflags=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -fr conftest*
++ ac_sectionLDflags=no
++fi
++rm -fr conftest*
++fi
++
++ if test "$ac_test_CFLAGS" = set; then
++ CFLAGS="$ac_save_CFLAGS"
++ else
++ # this is the suspicious part
++ CFLAGS=''
++ fi
++ if test "$ac_sectionLDflags" = "yes"; then
++ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
++ fi
++ echo "$ac_t""$ac_sectionLDflags" 1>&6
++ fi
++
++ # Set linker optimization flags.
++ if test x"$with_gnu_ld" = x"yes"; then
++ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
++ fi
++
++
++
++
++
++ echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
++echo "configure:4362: checking for main in -lm" >&5
++ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="-lm $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 4370 "configure"
++#include "confdefs.h"
++
++int main() {
++main()
++; return 0; }
++EOF
++if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
++ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_lib 1
++EOF
++
++ LIBS="-lm $LIBS"
++
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++ for ac_func in nan copysignf
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4407: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4412 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
++fi
++done
++
++
++ for ac_func in __signbit
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4464: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4469 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
++fi
++done
++
++ for ac_func in __signbitf
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4520: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4525 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
++fi
++done
++
++
++ if test x$ac_cv_func_copysignl = x"yes"; then
++ for ac_func in __signbitl
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4578: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4583 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
++fi
++done
++
++ fi
++
++ if test -n "$LIBMATHOBJS"; then
++ need_libmath=yes
++ fi
++
++
++
++if test "$need_libmath" = yes; then
++ GLIBCPP_BUILD_LIBMATH_TRUE=
++ GLIBCPP_BUILD_LIBMATH_FALSE='#'
++else
++ GLIBCPP_BUILD_LIBMATH_TRUE='#'
++ GLIBCPP_BUILD_LIBMATH_FALSE=
++fi
++
++
++ enable_wchar_t=no
++
++ echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
++echo "configure:4651: checking for mbstate_t" >&5
++ cat > conftest.$ac_ext <<EOF
++#line 4653 "configure"
++#include "confdefs.h"
++#include <wchar.h>
++int main() {
++mbstate_t teststate;
++; return 0; }
++EOF
++if { (eval echo configure:4660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ have_mbstate_t=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ have_mbstate_t=no
++fi
++rm -f conftest*
++ echo "$ac_t""$have_mbstate_t" 1>&6
++ if test x"$have_mbstate_t" = xyes; then
++ cat >> confdefs.h <<\EOF
++#define HAVE_MBSTATE_T 1
++EOF
++
++ fi
++
++ for ac_hdr in wchar.h
++do
++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
++echo "configure:4682: checking for $ac_hdr" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4687 "configure"
++#include "confdefs.h"
++#include <$ac_hdr>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:4692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=yes"
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_hdr 1
++EOF
++ ac_has_wchar_h=yes
++else
++ echo "$ac_t""no" 1>&6
++ac_has_wchar_h=no
++fi
++done
++
++ for ac_hdr in wctype.h
++do
++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
++echo "configure:4723: checking for $ac_hdr" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4728 "configure"
++#include "confdefs.h"
++#include <$ac_hdr>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:4733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=yes"
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_hdr 1
++EOF
++ ac_has_wctype_h=yes
++else
++ echo "$ac_t""no" 1>&6
++ac_has_wctype_h=no
++fi
++done
++
++
++ if test x"$ac_has_wchar_h" = xyes &&
++ test x"$ac_has_wctype_h" = xyes &&
++ test x"$enable_c_mbchar" != xno; then
++
++ echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
++echo "configure:4766: checking for WCHAR_MIN and WCHAR_MAX" >&5
++ cat > conftest.$ac_ext <<EOF
++#line 4768 "configure"
++#include "confdefs.h"
++#include <wchar.h>
++int main() {
++int i = WCHAR_MIN; int j = WCHAR_MAX;
++; return 0; }
++EOF
++if { (eval echo configure:4775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ has_wchar_minmax=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ has_wchar_minmax=no
++fi
++rm -f conftest*
++ echo "$ac_t""$has_wchar_minmax" 1>&6
++
++ echo $ac_n "checking for WEOF""... $ac_c" 1>&6
++echo "configure:4788: checking for WEOF" >&5
++ cat > conftest.$ac_ext <<EOF
++#line 4790 "configure"
++#include "confdefs.h"
++
++ #include <wchar.h>
++ #include <stddef.h>
++int main() {
++wint_t i = WEOF;
++; return 0; }
++EOF
++if { (eval echo configure:4799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ has_weof=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ has_weof=no
++fi
++rm -f conftest*
++ echo "$ac_t""$has_weof" 1>&6
++
++ ac_wfuncs=yes
++ for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4815: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4820 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++\
++ ac_wfuncs=no
++fi
++done
++
++
++ for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
++ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
++ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
++ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
++ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
++ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:4878: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4883 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++\
++ ac_wfuncs=no
++fi
++done
++
++
++ echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
++echo "configure:4934: checking for ISO C99 wchar_t support" >&5
++ if test x"$has_weof" = xyes &&
++ test x"$has_wchar_minmax" = xyes &&
++ test x"$ac_wfuncs" = xyes; then
++ ac_isoC99_wchar_t=yes
++ else
++ ac_isoC99_wchar_t=no
++ fi
++ echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
++
++ ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
++echo "configure:4946: checking for iconv.h" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4951 "configure"
++#include "confdefs.h"
++#include <iconv.h>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:4956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=yes"
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_has_iconv_h=yes
++else
++ echo "$ac_t""no" 1>&6
++ac_has_iconv_h=no
++fi
++
++ ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
++echo "configure:4980: checking for langinfo.h" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4985 "configure"
++#include "confdefs.h"
++#include <langinfo.h>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:4990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=yes"
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_has_langinfo_h=yes
++else
++ echo "$ac_t""no" 1>&6
++ac_has_langinfo_h=no
++fi
++
++
++ echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
++echo "configure:5014: checking for iconv in -liconv" >&5
++ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="-liconv $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 5022 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char iconv();
++
++int main() {
++iconv()
++; return 0; }
++EOF
++if { (eval echo configure:5033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ libiconv="-liconv"
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++ ac_save_LIBS="$LIBS"
++ LIBS="$LIBS $libiconv"
++
++ for ac_func in iconv_open iconv_close iconv nl_langinfo
++do
++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
++echo "configure:5059: checking for $ac_func" >&5
++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 5064 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++$ac_func();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:5087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_$ac_func=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_func 1
++EOF
++ \
++ ac_XPG2funcs=yes
++else
++ echo "$ac_t""no" 1>&6
++ac_XPG2funcs=no
++fi
++done
++
++
++ LIBS="$ac_save_LIBS"
++
++ echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
++echo "configure:5117: checking for XPG2 wchar_t support" >&5
++ if test x"$ac_has_iconv_h" = xyes &&
++ test x"$ac_has_langinfo_h" = xyes &&
++ test x"$ac_XPG2funcs" = xyes; then
++ ac_XPG2_wchar_t=yes
++ else
++ ac_XPG2_wchar_t=no
++ fi
++ echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
++
++ if test x"$ac_isoC99_wchar_t" = xyes &&
++ test x"$ac_XPG2_wchar_t" = xyes; then
++ cat >> confdefs.h <<\EOF
++#define _GLIBCPP_USE_WCHAR_T 1
++EOF
++
++ enable_wchar_t=yes
++ fi
++ fi
++ echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
++echo "configure:5137: checking for enabled wchar_t specializations" >&5
++ echo "$ac_t""$enable_wchar_t" 1>&6
++
++
++if test "$enable_wchar_t" = yes; then
++ GLIBCPP_TEST_WCHAR_T_TRUE=
++ GLIBCPP_TEST_WCHAR_T_FALSE='#'
++else
++ GLIBCPP_TEST_WCHAR_T_TRUE='#'
++ GLIBCPP_TEST_WCHAR_T_FALSE=
++fi
++
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_COPYSIGN 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_FINITE 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_FINITEF 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_ISINF 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_ISINFF 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_ISNAN 1
++EOF
++
++ cat >> confdefs.h <<\EOF
++#define HAVE_ISNANF 1
++EOF
++ ;;
+ *-linux*)
+ os_include_dir="os/gnu-linux"
+ for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \
+diff -urN gcc-3.3.3-dist/libstdc++-v3/configure.in gcc-3.3.3/libstdc++-v3/configure.in
+--- gcc-3.3.3-dist/libstdc++-v3/configure.in 2004-01-12 10:19:22.000000000 -0600
++++ gcc-3.3.3/libstdc++-v3/configure.in 2004-08-12 04:47:51.000000000 -0500
+@@ -117,6 +117,36 @@
+ # GLIBCPP_CHECK_MATH_SUPPORT
+
+ case "$target" in
++ *-uclibc*)
++ os_include_dir="os/uclibc"
++ 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 locale.h float.h inttypes.h])
++ SECTION_FLAGS='-ffunction-sections -fdata-sections'
++ AC_SUBST(SECTION_FLAGS)
++ GLIBCPP_CHECK_LINKER_FEATURES
++ GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
++ GLIBCPP_CHECK_WCHAR_T_SUPPORT
++
++ AC_DEFINE(HAVE_COPYSIGN)
++ #AC_DEFINE(HAVE_COPYSIGNF)
++ AC_DEFINE(HAVE_FINITE)
++ AC_DEFINE(HAVE_FINITEF)
++ #AC_DEFINE(HAVE_FREXPF)
++ #AC_DEFINE(HAVE_HYPOTF)
++ AC_DEFINE(HAVE_ISINF)
++ AC_DEFINE(HAVE_ISINFF)
++ AC_DEFINE(HAVE_ISNAN)
++ AC_DEFINE(HAVE_ISNANF)
++ #AC_DEFINE(HAVE_SINCOS)
++ #AC_DEFINE(HAVE_SINCOSF)
++ #if test x"long_double_math_on_this_cpu" = x"yes"; then
++ #AC_DEFINE(HAVE_FINITEL)
++ #AC_DEFINE(HAVE_HYPOTL)
++ #AC_DEFINE(HAVE_ISINFL)
++ #AC_DEFINE(HAVE_ISNANL)
++ #fi
++ ;;
+ *-linux*)
+ os_include_dir="os/gnu-linux"
+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
+diff -urN gcc-3.3.3-dist/libstdc++-v3/configure.target gcc-3.3.3/libstdc++-v3/configure.target
+--- gcc-3.3.3-dist/libstdc++-v3/configure.target 2003-10-01 14:07:07.000000000 -0500
++++ gcc-3.3.3/libstdc++-v3/configure.target 2004-08-12 04:47:51.000000000 -0500
+@@ -133,6 +133,9 @@
+ freebsd*)
+ os_include_dir="os/bsd/freebsd"
+ ;;
++ linux-uclibc*)
++ os_include_dir="os/uclibc"
++ ;;
+ gnu* | linux*)
+ os_include_dir="os/gnu-linux"
+ ;;
+diff -urN gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cstdlib.h gcc-3.3.3/libstdc++-v3/include/c_std/std_cstdlib.h
+--- gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cstdlib.h 2003-04-18 05:08:05.000000000 -0500
++++ gcc-3.3.3/libstdc++-v3/include/c_std/std_cstdlib.h 2004-08-12 04:47:51.000000000 -0500
+@@ -101,9 +101,11 @@
+ using ::labs;
+ using ::ldiv;
+ using ::malloc;
++#if _GLIBCPP_USE_WCHAR_T
+ using ::mblen;
+ using ::mbstowcs;
+ using ::mbtowc;
++#endif
+ using ::qsort;
+ using ::rand;
+ using ::realloc;
+@@ -112,8 +114,10 @@
+ using ::strtol;
+ using ::strtoul;
+ using ::system;
++#if _GLIBCPP_USE_WCHAR_T
+ using ::wcstombs;
+ using ::wctomb;
++#endif
+
+ inline long
+ abs(long __i) { return labs(__i); }
+diff -urN gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.3.3/libstdc++-v3/include/c_std/std_cwchar.h
+--- gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cwchar.h 2003-04-18 05:08:05.000000000 -0500
++++ gcc-3.3.3/libstdc++-v3/include/c_std/std_cwchar.h 2004-08-12 04:47:51.000000000 -0500
+@@ -165,7 +165,9 @@
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
++#ifdef HAVE_WCSFTIME
+ using ::wcsftime;
++#endif
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
+diff -urN gcc-3.3.3-dist/libtool.m4 gcc-3.3.3/libtool.m4
+--- gcc-3.3.3-dist/libtool.m4 2003-09-09 03:04:17.000000000 -0500
++++ gcc-3.3.3/libtool.m4 2004-08-12 04:47:51.000000000 -0500
+@@ -687,6 +687,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN gcc-3.3.3-dist/ltconfig gcc-3.3.3/ltconfig
+--- gcc-3.3.3-dist/ltconfig 2003-02-19 20:10:02.000000000 -0600
++++ gcc-3.3.3/ltconfig 2004-08-12 04:47:51.000000000 -0500
+@@ -603,6 +603,7 @@
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+ linux-gnu*) ;;
++linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1247,6 +1248,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
--- /dev/null
+Use the patch by Carl Miller <chaz@energoncube.net> for powerpc, with
+some minor modifications. Changed *os_uclibc to *os_linux_uclibc since
+at some point we might support other platforms. Also updated to 3.3.3.
+diff -urN gcc-3.3.3/gcc/config/rs6000/linux.h gcc-3.3.3-new/gcc/config/rs6000/linux.h
+--- gcc-3.3.3/gcc/config/rs6000/linux.h 2003-11-14 00:46:10.000000000 -0600
++++ gcc-3.3.3-new/gcc/config/rs6000/linux.h 2004-02-16 21:13:40.000000000 -0600
+@@ -64,7 +64,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
+
+ #undef TARGET_VERSION
+ #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
+diff -urN gcc-3.3.3/gcc/config/rs6000/sysv4.h gcc-3.3.3-new/gcc/config/rs6000/sysv4.h
+--- gcc-3.3.3/gcc/config/rs6000/sysv4.h 2003-10-28 13:55:41.000000000 -0600
++++ gcc-3.3.3-new/gcc/config/rs6000/sysv4.h 2004-02-16 21:13:40.000000000 -0600
+@@ -968,9 +968,11 @@
+ %{mcall-linux: %(link_os_linux) } \
+ %{mcall-gnu: %(link_os_gnu) } \
+ %{mcall-netbsd: %(link_os_netbsd) } \
++%{mcall-uclibc: %(link_os_linux_uclibc) } \
+ %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
+ %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
+- %{!mcall-netbsd: %(link_os_default) }}}}}}}}}"
++ %{!mcall-netbsd: %{!mcall-uclibc: \
++ %(link_os_default) }}}}}}}}}}"
+
+ #define LINK_OS_DEFAULT_SPEC ""
+
+@@ -1307,6 +1309,12 @@
+
+ #define LINK_OS_WINDISS_SPEC ""
+
++/* uClibc support for Linux. */
++
++#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
++
+ /* Define any extra SPECS that the compiler needs to generate. */
+ /* Override rs6000.h definition. */
+ #undef SUBTARGET_EXTRA_SPECS
+@@ -1372,6 +1380,7 @@
+ { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
+ { "link_os_vxworks", LINK_OS_VXWORKS_SPEC }, \
+ { "link_os_windiss", LINK_OS_WINDISS_SPEC }, \
++ { "link_os_linux_uclibc", LINK_OS_LINUX_UCLIBC_SPEC }, \
+ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
+ { "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \
+ { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
--- /dev/null
+--- gcc-3.3.2-old/configure.in 2003-08-09 01:57:21.000000000 -0500
++++ gcc-3.3.2/configure.in 2004-01-15 12:46:29.000000000 -0600
+@@ -1418,6 +1418,11 @@
+ fi
+
+ FLAGS_FOR_TARGET=
++case " $targargs " in
++ *" --nfp "* | *" --without-float "*)
++ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -msoft-float'
++ ;;
++esac
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $targargs " in
--- /dev/null
+Warning! This patch is not finished. The wide char time-related stuff
+is broken or non-functional. But it serves as a starting point to get
+things building while I continue to work on the uClibc locale internals.
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2004-01-09 07:55:02.000000000 -0600
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 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.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(iswctype_l) __iswctype_l;
++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(strtol_l) __strtol_l;
++extern "C" __typeof(strtoll_l) __strtoll_l;
++extern "C" __typeof(strtoul_l) __strtoul_l;
++extern "C" __typeof(strtoull_l) __strtoull_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_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;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#endif // GLIBC 2.3 and later
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc 2004-01-09 08:37:55.000000000 -0600
+@@ -0,0 +1,231 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#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))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __convert_to_v(const char* __s, long& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc, int __base)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ long __l = __strtol_l(__s, &__sanity, __base, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
++ __v = __l;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, unsigned long& __v,
++ ios_base::iostate& __err, const __c_locale& __cloc,
++ int __base)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ unsigned long __ul = __strtoul_l(__s, &__sanity, __base, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
++ __v = __ul;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++#ifdef _GLIBCPP_USE_LONG_LONG
++ template<>
++ void
++ __convert_to_v(const char* __s, long long& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc, int __base)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ long long __ll = __strtoll_l(__s, &__sanity, __base, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
++ __v = __ll;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, unsigned long long& __v,
++ ios_base::iostate& __err, const __c_locale& __cloc,
++ int __base)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ unsigned long long __ull = __strtoull_l(__s, &__sanity, __base,
++ __cloc);
++ if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
++ __v = __ull;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++#endif
++
++ template<>
++ void
++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc, int)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && 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, int)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && 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, int)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && *__sanity == '\0' && 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)
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __cloc = __newlocale(1 << LC_ALL, __s, __old);
++ if (!__cloc)
++ {
++ // This named locale is not supported by the underlying OS.
++ __throw_runtime_error("attempt to create locale from unknown name");
++ }
++#else
++ __cloc = NULL;
++#endif
++ }
++
++ void
++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ if (_S_c_locale != __cloc)
++ __freelocale(__cloc);
++#else
++ __cloc = NULL;
++#endif
++ }
++
++ __c_locale
++ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++#ifdef __UCLIBC_HAS_XLOCALE__
++ { return __duplocale(__cloc); }
++#else
++ { return __c_locale(); }
++#endif
++
++ const char* locale::_S_categories[_S_categories_size
++ + _S_extra_categories_size] =
++ {
++ "LC_CTYPE",
++ "LC_NUMERIC",
++ "LC_TIME",
++ "LC_COLLATE",
++ "LC_MONETARY",
++ "LC_MESSAGES"
++#if _GLIBCPP_NUM_CATEGORIES != 0
++ ,
++ "LC_PAPER",
++ "LC_NAME",
++ "LC_ADDRESS",
++ "LC_TELEPHONE",
++ "LC_MEASUREMENT",
++ "LC_IDENTIFICATION"
++#endif
++ };
++} // namespace std
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h 2004-01-09 07:51:06.000000000 -0600
+@@ -0,0 +1,118 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _CPP_BITS_C_LOCALE_H
++#define _CPP_BITS_C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <clocale>
++#include <langinfo.h> // For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h> // For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> // For messages
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning what is _GLIBCPP_C_LOCALE_GNU for
++#endif
++#define _GLIBCPP_C_LOCALE_GNU 1
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix categories
++#endif
++// #define _GLIBCPP_NUM_CATEGORIES 6
++#define _GLIBCPP_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<typename _Tv>
++ int
++ __convert_from_v(char* __out, const int __size, const char* __fmt,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ _Tv __v, const __c_locale& __cloc, int __prec = -1)
++ {
++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++ _Tv __v, const __c_locale&, int __prec = -1)
++ {
++# ifdef __UCLIBC_HAS_LOCALE__
++ char* __old = setlocale(LC_ALL, NULL);
++ char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
++ if (__sav)
++ strcpy(__sav, __old);
++ setlocale(LC_ALL, "C");
++# endif
++#endif
++
++ int __ret;
++ if (__prec >= 0)
++ __ret = snprintf(__out, __size, __fmt, __prec, __v);
++ else
++ __ret = snprintf(__out, __size, __fmt, __v);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++ setlocale(LC_ALL, __sav);
++ free(__sav);
++#endif
++ return __ret;
++ }
++}
++
++#endif
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2004-01-09 04:04:34.000000000 -0600
+@@ -0,0 +1,113 @@
++// 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, 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.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++ // Specializations.
++#ifdef _GLIBCPP_USE_WCHAR_T
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ 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 = error;
++ size_t __len = min(__from_end - __from, __to_end - __to);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_S_c_locale);
++#endif
++ size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ if (__conv == __len)
++ {
++ __from_next = __from;
++ __to_next = __to + __conv;
++ __ret = ok;
++ }
++ else if (__conv > 0 && __conv < __len)
++ {
++ __from_next = __from;
++ __to_next = __to + __conv;
++ __ret = partial;
++ }
++ else
++ __ret = error;
++
++ return __ret;
++ }
++
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ 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 = error;
++ size_t __len = min(__from_end - __from, __to_end - __to);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_S_c_locale);
++#endif
++ size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ if (__conv == __len)
++ {
++ __from_next = __from;
++ __to_next = __to + __conv;
++ __ret = ok;
++ }
++ else if (__conv > 0 && __conv < __len)
++ {
++ __from_next = __from;
++ __to_next = __to + __conv;
++ __ret = partial;
++ }
++ else
++ __ret = error;
++
++ return __ret;
++ }
++#endif
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h 2004-01-09 01:53:51.000000000 -0600
+@@ -0,0 +1,461 @@
++// Locale support (codecvt) -*- C++ -*-
++
++// Copyright (C) 2000, 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, 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.2.1.5 Template class codecvt
++//
++
++// Warning: this file is not meant for user inclusion. Use <locale>.
++
++// Written by Benjamin Kosnik <bkoz@cygnus.com>
++
++ // XXX
++ // Define this here to codecvt.cc can have _S_max_size definition.
++#define _GLIBCPP_USE___ENC_TRAITS 1
++
++ // Extension to use icov for dealing with character encodings,
++ // including conversions and comparisons between various character
++ // sets. This object encapsulates data that may need to be shared between
++ // char_traits, codecvt and ctype.
++ class __enc_traits
++ {
++ public:
++ // Types:
++ // NB: A conversion descriptor subsumes and enhances the
++ // functionality of a simple state type such as mbstate_t.
++ typedef iconv_t __desc_type;
++
++ protected:
++ // Data Members:
++ // Max size of charset encoding name
++ static const int _S_max_size = 32;
++ // Name of internal character set encoding.
++ char _M_int_enc[_S_max_size];
++ // Name of external character set encoding.
++ char _M_ext_enc[_S_max_size];
++
++ // Conversion descriptor between external encoding to internal encoding.
++ __desc_type _M_in_desc;
++ // Conversion descriptor between internal encoding to external encoding.
++ __desc_type _M_out_desc;
++
++ // Details the byte-order marker for the external encoding, if necessary.
++ int _M_ext_bom;
++
++ // Details the byte-order marker for the internal encoding, if necessary.
++ int _M_int_bom;
++
++ public:
++ explicit __enc_traits()
++ : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
++ {
++ memset(_M_int_enc, 0, _S_max_size);
++ memset(_M_ext_enc, 0, _S_max_size);
++ }
++
++ explicit __enc_traits(const char* __int, const char* __ext,
++ int __ibom = 0, int __ebom = 0)
++ : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
++ {
++ strncpy(_M_int_enc, __int, _S_max_size);
++ strncpy(_M_ext_enc, __ext, _S_max_size);
++ }
++
++ // 21.1.2 traits typedefs
++ // p4
++ // typedef STATE_T state_type
++ // requires: state_type shall meet the requirements of
++ // CopyConstructible types (20.1.3)
++ __enc_traits(const __enc_traits& __obj): _M_in_desc(0), _M_out_desc(0)
++ {
++ strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
++ strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
++ _M_ext_bom = __obj._M_ext_bom;
++ _M_int_bom = __obj._M_int_bom;
++ }
++
++ // Need assignment operator as well.
++ __enc_traits&
++ operator=(const __enc_traits& __obj)
++ {
++ strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
++ strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
++ _M_in_desc = 0;
++ _M_out_desc = 0;
++ _M_ext_bom = __obj._M_ext_bom;
++ _M_int_bom = __obj._M_int_bom;
++ return *this;
++ }
++
++ ~__enc_traits()
++ {
++ __desc_type __err = reinterpret_cast<iconv_t>(-1);
++ if (_M_in_desc && _M_in_desc != __err)
++ iconv_close(_M_in_desc);
++ if (_M_out_desc && _M_out_desc != __err)
++ iconv_close(_M_out_desc);
++ }
++
++ void
++ _M_init()
++ {
++ const __desc_type __err = reinterpret_cast<iconv_t>(-1);
++ if (!_M_in_desc)
++ {
++ _M_in_desc = iconv_open(_M_int_enc, _M_ext_enc);
++ if (_M_in_desc == __err)
++ __throw_runtime_error("creating iconv input descriptor failed.");
++ }
++ if (!_M_out_desc)
++ {
++ _M_out_desc = iconv_open(_M_ext_enc, _M_int_enc);
++ if (_M_out_desc == __err)
++ __throw_runtime_error("creating iconv output descriptor failed.");
++ }
++ }
++
++ bool
++ _M_good()
++ {
++ const __desc_type __err = reinterpret_cast<iconv_t>(-1);
++ bool __test = _M_in_desc && _M_in_desc != __err;
++ __test &= _M_out_desc && _M_out_desc != __err;
++ return __test;
++ }
++
++ const __desc_type*
++ _M_get_in_descriptor()
++ { return &_M_in_desc; }
++
++ const __desc_type*
++ _M_get_out_descriptor()
++ { return &_M_out_desc; }
++
++ int
++ _M_get_external_bom()
++ { return _M_ext_bom; }
++
++ int
++ _M_get_internal_bom()
++ { return _M_int_bom; }
++
++ const char*
++ _M_get_internal_enc()
++ { return _M_int_enc; }
++
++ const char*
++ _M_get_external_enc()
++ { return _M_ext_enc; }
++ };
++
++ // Partial specialization
++ // This specialization takes advantage of iconv to provide code
++ // conversions between a large number of character encodings.
++ template<typename _InternT, typename _ExternT>
++ class codecvt<_InternT, _ExternT, __enc_traits>
++ : public __codecvt_abstract_base<_InternT, _ExternT, __enc_traits>
++ {
++ public:
++ // Types:
++ typedef codecvt_base::result result;
++ typedef _InternT intern_type;
++ typedef _ExternT extern_type;
++ typedef __enc_traits state_type;
++ typedef __enc_traits::__desc_type __desc_type;
++ typedef __enc_traits __enc_type;
++
++ // Data Members:
++ static locale::id id;
++
++ explicit
++ codecvt(size_t __refs = 0)
++ : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
++ { }
++
++ explicit
++ codecvt(__enc_type* __enc, size_t __refs = 0)
++ : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
++ { }
++
++ protected:
++ virtual
++ ~codecvt() { }
++
++ virtual result
++ 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;
++
++ virtual result
++ do_unshift(state_type& __state, extern_type* __to,
++ extern_type* __to_end, extern_type*& __to_next) const;
++
++ virtual result
++ 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;
++
++ virtual int
++ do_encoding() const throw();
++
++ virtual bool
++ do_always_noconv() const throw();
++
++ virtual int
++ do_length(const state_type&, const extern_type* __from,
++ const extern_type* __end, size_t __max) const;
++
++ virtual int
++ do_max_length() const throw();
++ };
++
++ template<typename _InternT, typename _ExternT>
++ locale::id
++ codecvt<_InternT, _ExternT, __enc_traits>::id;
++
++ // This adaptor works around the signature problems of the second
++ // argument to iconv(): SUSv2 and others use 'const char**', but glibc 2.2
++ // uses 'char**', which matches the POSIX 1003.1-2001 standard.
++ // Using this adaptor, g++ will do the work for us.
++ template<typename _T>
++ inline size_t
++ __iconv_adaptor(size_t(*__func)(iconv_t, _T, size_t*, char**, size_t*),
++ iconv_t __cd, char** __inbuf, size_t* __inbytes,
++ char** __outbuf, size_t* __outbytes)
++ { return __func(__cd, (_T)__inbuf, __inbytes, __outbuf, __outbytes); }
++
++ template<typename _InternT, typename _ExternT>
++ codecvt_base::result
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ 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 = codecvt_base::error;
++ if (__state._M_good())
++ {
++ typedef state_type::__desc_type __desc_type;
++ const __desc_type* __desc = __state._M_get_out_descriptor();
++ const size_t __fmultiple = sizeof(intern_type);
++ size_t __fbytes = __fmultiple * (__from_end - __from);
++ const size_t __tmultiple = sizeof(extern_type);
++ size_t __tbytes = __tmultiple * (__to_end - __to);
++
++ // Argument list for iconv specifies a byte sequence. Thus,
++ // all to/from arrays must be brutally casted to char*.
++ char* __cto = reinterpret_cast<char*>(__to);
++ char* __cfrom;
++ size_t __conv;
++
++ // Some encodings need a byte order marker as the first item
++ // in the byte stream, to designate endian-ness. The default
++ // value for the byte order marker is NULL, so if this is
++ // the case, it's not necessary and we can just go on our
++ // merry way.
++ int __int_bom = __state._M_get_internal_bom();
++ if (__int_bom)
++ {
++ size_t __size = __from_end - __from;
++ intern_type* __cfixed = static_cast<intern_type*>(__builtin_alloca(sizeof(intern_type) * (__size + 1)));
++ __cfixed[0] = static_cast<intern_type>(__int_bom);
++ char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
++ __cfrom = reinterpret_cast<char*>(__cfixed);
++ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
++ &__fbytes, &__cto, &__tbytes);
++ }
++ else
++ {
++ intern_type* __cfixed = const_cast<intern_type*>(__from);
++ __cfrom = reinterpret_cast<char*>(__cfixed);
++ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom, &__fbytes,
++ &__cto, &__tbytes);
++ }
++
++ if (__conv != size_t(-1))
++ {
++ __from_next = reinterpret_cast<const intern_type*>(__cfrom);
++ __to_next = reinterpret_cast<extern_type*>(__cto);
++ __ret = codecvt_base::ok;
++ }
++ else
++ {
++ if (__fbytes < __fmultiple * (__from_end - __from))
++ {
++ __from_next = reinterpret_cast<const intern_type*>(__cfrom);
++ __to_next = reinterpret_cast<extern_type*>(__cto);
++ __ret = codecvt_base::partial;
++ }
++ else
++ __ret = codecvt_base::error;
++ }
++ }
++ return __ret;
++ }
++
++ template<typename _InternT, typename _ExternT>
++ codecvt_base::result
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ do_unshift(state_type& __state, extern_type* __to,
++ extern_type* __to_end, extern_type*& __to_next) const
++ {
++ result __ret = codecvt_base::error;
++ if (__state._M_good())
++ {
++ typedef state_type::__desc_type __desc_type;
++ const __desc_type* __desc = __state._M_get_in_descriptor();
++ const size_t __tmultiple = sizeof(intern_type);
++ size_t __tlen = __tmultiple * (__to_end - __to);
++
++ // Argument list for iconv specifies a byte sequence. Thus,
++ // all to/from arrays must be brutally casted to char*.
++ char* __cto = reinterpret_cast<char*>(__to);
++ size_t __conv = __iconv_adaptor(iconv,*__desc, NULL, NULL,
++ &__cto, &__tlen);
++
++ if (__conv != size_t(-1))
++ {
++ __to_next = reinterpret_cast<extern_type*>(__cto);
++ if (__tlen == __tmultiple * (__to_end - __to))
++ __ret = codecvt_base::noconv;
++ else if (__tlen == 0)
++ __ret = codecvt_base::ok;
++ else
++ __ret = codecvt_base::partial;
++ }
++ else
++ __ret = codecvt_base::error;
++ }
++ return __ret;
++ }
++
++ template<typename _InternT, typename _ExternT>
++ codecvt_base::result
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ 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 = codecvt_base::error;
++ if (__state._M_good())
++ {
++ typedef state_type::__desc_type __desc_type;
++ const __desc_type* __desc = __state._M_get_in_descriptor();
++ const size_t __fmultiple = sizeof(extern_type);
++ size_t __flen = __fmultiple * (__from_end - __from);
++ const size_t __tmultiple = sizeof(intern_type);
++ size_t __tlen = __tmultiple * (__to_end - __to);
++
++ // Argument list for iconv specifies a byte sequence. Thus,
++ // all to/from arrays must be brutally casted to char*.
++ char* __cto = reinterpret_cast<char*>(__to);
++ char* __cfrom;
++ size_t __conv;
++
++ // Some encodings need a byte order marker as the first item
++ // in the byte stream, to designate endian-ness. The default
++ // value for the byte order marker is NULL, so if this is
++ // the case, it's not necessary and we can just go on our
++ // merry way.
++ int __ext_bom = __state._M_get_external_bom();
++ if (__ext_bom)
++ {
++ size_t __size = __from_end - __from;
++ extern_type* __cfixed = static_cast<extern_type*>(__builtin_alloca(sizeof(extern_type) * (__size + 1)));
++ __cfixed[0] = static_cast<extern_type>(__ext_bom);
++ char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
++ __cfrom = reinterpret_cast<char*>(__cfixed);
++ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
++ &__flen, &__cto, &__tlen);
++ }
++ else
++ {
++ extern_type* __cfixed = const_cast<extern_type*>(__from);
++ __cfrom = reinterpret_cast<char*>(__cfixed);
++ __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
++ &__flen, &__cto, &__tlen);
++ }
++
++
++ if (__conv != size_t(-1))
++ {
++ __from_next = reinterpret_cast<const extern_type*>(__cfrom);
++ __to_next = reinterpret_cast<intern_type*>(__cto);
++ __ret = codecvt_base::ok;
++ }
++ else
++ {
++ if (__flen < static_cast<size_t>(__from_end - __from))
++ {
++ __from_next = reinterpret_cast<const extern_type*>(__cfrom);
++ __to_next = reinterpret_cast<intern_type*>(__cto);
++ __ret = codecvt_base::partial;
++ }
++ else
++ __ret = codecvt_base::error;
++ }
++ }
++ return __ret;
++ }
++
++ template<typename _InternT, typename _ExternT>
++ int
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ do_encoding() const throw()
++ {
++ int __ret = 0;
++ if (sizeof(_ExternT) <= sizeof(_InternT))
++ __ret = sizeof(_InternT)/sizeof(_ExternT);
++ return __ret;
++ }
++
++ template<typename _InternT, typename _ExternT>
++ bool
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ do_always_noconv() const throw()
++ { return false; }
++
++ template<typename _InternT, typename _ExternT>
++ int
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ do_length(const state_type&, const extern_type* __from,
++ const extern_type* __end, size_t __max) const
++ { return min(__max, static_cast<size_t>(__end - __from)); }
++
++#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
++// 74. Garbled text for codecvt::do_max_length
++ template<typename _InternT, typename _ExternT>
++ int
++ codecvt<_InternT, _ExternT, __enc_traits>::
++ do_max_length() const throw()
++ { return 1; }
++#endif
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc 2004-01-09 08:06:24.000000000 -0600
+@@ -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, 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.2.4.1.2 collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::_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<char>::_M_transform(char* __to, const char* __from,
++ size_t __n) const
++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++
++#ifdef _GLIBCPP_USE_WCHAR_T
++ template<>
++ int
++ collate<wchar_t>::_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<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++ size_t __n) const
++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2004-01-09 08:15:41.000000000 -0600
+@@ -0,0 +1,274 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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<char> specializations are in src/locale.cc and
++ // various /config/os/* files.
++ template<>
++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++ : ctype<char>(0, false, __refs)
++ {
++ _S_destroy_c_locale(_M_c_locale_ctype);
++ _S_create_c_locale(_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ _M_toupper = _M_c_locale_ctype->__ctype_toupper;
++ _M_tolower = _M_c_locale_ctype->__ctype_tolower;
++ _M_table = _M_c_locale_ctype->__ctype_b;
++#endif
++ }
++
++#ifdef _GLIBCPP_USE_WCHAR_T
++ ctype<wchar_t>::__wmask_type
++ ctype<wchar_t>::_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 = 0;
++ }
++ return __ret;
++ };
++
++ wchar_t
++ ctype<wchar_t>::do_toupper(wchar_t __c) const
++ { return __towupper_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::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<wchar_t>::do_tolower(wchar_t __c) const
++ { return __towlower_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::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<wchar_t>::
++ do_is(mask __m, wchar_t __c) const
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ bool __ret = false;
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ {
++ const mask __bit = static_cast<mask>(_ISbit(__bitcur));
++ if (__m & __bit)
++ __ret |= __iswctype_l(__c, _M_convert_to_wmask(__bit),
++ _M_c_locale_ctype);
++ }
++ return __ret;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ 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)
++ {
++ const mask __bit = static_cast<mask>(_ISbit(__bitcur));
++ if (__iswctype_l(*__lo, _M_convert_to_wmask(__bit),
++ _M_c_locale_ctype))
++ __m |= __bit;
++ }
++ *__vec = __m;
++ }
++ return __hi;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ 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<wchar_t>::
++ 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<wchar_t>::
++ do_widen(char __c) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ wchar_t __ret = btowc(__c);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ const char*
++ ctype<wchar_t>::
++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ mbstate_t __state;
++ memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
++ mbsrtowcs(__dest, &__lo, __hi - __lo, &__state);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++
++ char
++ ctype<wchar_t>::
++ do_narrow(wchar_t __wc, char __dfault) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ int __c = wctob(__wc);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ 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
++ size_t __offset = 0;
++ while (true)
++ {
++ const wchar_t* __start = __lo + __offset;
++ size_t __len = __hi - __start;
++
++ mbstate_t __state;
++ memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
++ size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state);
++ if (__con != __len && __start != 0)
++ {
++ __offset = __start - __lo;
++ __dest[__offset++] = __dfault;
++ }
++ else
++ break;
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++#endif // _GLIBCPP_USE_WCHAR_T
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc 2004-01-09 08:46:16.000000000 -0600
+@@ -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, 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.2.7.1.2 messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::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<const char*>(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 _GLIBCPP_USE_WCHAR_T
++ template<>
++ wstring
++ messages<wchar_t>::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
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h 2004-01-09 08:52:48.000000000 -0600
+@@ -0,0 +1,122 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#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<typename _CharT>
++ messages<_CharT>::messages(size_t __refs)
++ : locale::facet(__refs)
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ _M_name_messages = _S_c_name;
++#endif
++ _M_c_locale_messages = _S_c_locale;
++ }
++
++ template<typename _CharT>
++ messages<_CharT>::messages(__c_locale __cloc,
++ const char* __s, size_t __refs)
++ : locale::facet(__refs)
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ _M_name_messages = new char[strlen(__s) + 1];
++ strcpy(_M_name_messages, __s);
++#endif
++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++ const char* __dir) const
++ {
++ __bindtextdomain(__s.c_str(), __dir);
++ return this->do_open(__s, __loc);
++ }
++
++ // Virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::~messages()
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ if (_S_c_name != _M_name_messages)
++ delete [] _M_name_messages;
++#endif
++ _S_destroy_c_locale(_M_c_locale_messages);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::do_open(const basic_string<char>& __s,
++ const locale&) const
++ {
++ // No error checking is done, assume the catalog exists and can
++ // be used.
++ __textdomain(__s.c_str());
++ return 0;
++ }
++
++ template<typename _CharT>
++ void
++ messages<_CharT>::do_close(catalog) const
++ { }
++
++ // messages_byname
++ template<typename _CharT>
++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++ : messages<_CharT>(__refs)
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ if (_S_c_name != _M_name_messages)
++ delete [] _M_name_messages;
++ _M_name_messages = new char[strlen(__s) + 1];
++ strcpy(_M_name_messages, __s);
++#endif
++ _S_destroy_c_locale(_M_c_locale_messages);
++ _S_create_c_locale(_M_c_locale_messages, __s);
++ }
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2004-01-09 18:20:23.000000000 -0600
+@@ -0,0 +1,578 @@
++// std::moneypunct 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, 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.2.6.3.2 moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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.
++ if (__space)
++ {
++ // Pattern starts with sign.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[2] = space;
++ __ret.field[3] = symbol;
++ }
++ __ret.field[0] = sign;
++ }
++ 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[0] = sign;
++ __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[1] = space;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = space;
++ __ret.field[2] = symbol;
++ }
++ __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 (__space)
++ {
++ // Have space.
++ if (__precedes)
++ {
++ __ret.field[0] = sign;
++ __ret.field[1] = symbol;
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = space;
++ __ret.field[2] = sign;
++ __ret.field[3] = symbol;
++ }
++ }
++ else
++ {
++ // Have none.
++ if (__precedes)
++ {
++ __ret.field[0] = sign;
++ __ret.field[1] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = sign;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[3] = none;
++ }
++ break;
++ case 4:
++ // 4 The sign immediately follows the symbol.
++ if (__space)
++ {
++ // Have space.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = sign;
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = space;
++ __ret.field[2] = symbol;
++ __ret.field[3] = sign;
++ }
++ }
++ else
++ {
++ // Have none.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = sign;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = symbol;
++ __ret.field[2] = sign;
++ }
++ __ret.field[3] = none;
++ }
++ break;
++ default:
++ ;
++ }
++ return __ret;
++ }
++
++ template<>
++ void
++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = '.';
++ _M_thousands_sep = ',';
++ _M_grouping = "";
++ _M_curr_symbol = "";
++ _M_positive_sign = "";
++ _M_negative_sign = "";
++ _M_frac_digits = 0;
++ _M_pos_format = money_base::_S_default_pattern;
++ _M_neg_format = money_base::_S_default_pattern;
++ }
++ else
++ {
++ // Named locale.
++ _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
++ _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
++ _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++
++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_negative_sign = "()";
++ else
++ _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++
++ // _Intl == true
++ _M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++ _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_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_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
++ }
++ }
++
++ template<>
++ void
++ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = '.';
++ _M_thousands_sep = ',';
++ _M_grouping = "";
++ _M_curr_symbol = "";
++ _M_positive_sign = "";
++ _M_negative_sign = "";
++ _M_frac_digits = 0;
++ _M_pos_format = money_base::_S_default_pattern;
++ _M_neg_format = money_base::_S_default_pattern;
++ }
++ else
++ {
++ // Named locale.
++ _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
++ _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
++ _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++
++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_negative_sign = "()";
++ else
++ _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++
++ // _Intl == false
++ _M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++ _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_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_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
++ }
++ }
++
++ template<>
++ moneypunct<char, true>::~moneypunct()
++ { }
++
++ template<>
++ moneypunct<char, false>::~moneypunct()
++ { }
++
++#ifdef _GLIBCPP_USE_WCHAR_T
++ template<>
++ void
++ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = L'.';
++ _M_thousands_sep = L',';
++ _M_grouping = "";
++ _M_curr_symbol = L"";
++ _M_positive_sign = L"";
++ _M_negative_sign = L"";
++ _M_frac_digits = 0;
++ _M_pos_format = money_base::_S_default_pattern;
++ _M_neg_format = money_base::_S_default_pattern;
++ }
++ 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
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_decimal_point = __cloc->decimal_point_wc;
++ _M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_decimal_point = __global_locale->decimal_point_wc;
++ _M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
++
++ _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
++#endif
++ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++
++ 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);
++
++ mbstate_t __state;
++ size_t __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__cpossign, __len, &__state);
++ _M_positive_sign = __wcs;
++ }
++ else
++ _M_positive_sign = L"";
++
++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
++ _M_negative_sign = __wcs;
++ }
++ else
++ _M_negative_sign = L"";
++
++ // _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_curr_symbol = __wcs;
++ }
++ else
++ _M_curr_symbol = L"";
++
++ _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_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_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<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = L'.';
++ _M_thousands_sep = L',';
++ _M_grouping = "";
++ _M_curr_symbol = L"";
++ _M_positive_sign = L"";
++ _M_negative_sign = L"";
++ _M_frac_digits = 0;
++ _M_pos_format = money_base::_S_default_pattern;
++ _M_neg_format = money_base::_S_default_pattern;
++ }
++ 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
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_decimal_point = __cloc->decimal_point_wc;
++ _M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_decimal_point = __global_locale->decimal_point_wc;
++ _M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
++ _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
++#endif
++ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++
++ 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);
++
++ mbstate_t __state;
++ size_t __len;
++ __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__cpossign, __len, &__state);
++ _M_positive_sign = __wcs;
++ }
++ else
++ _M_positive_sign = L"";
++
++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
++ _M_negative_sign = __wcs;
++ }
++ else
++ _M_negative_sign = L"";
++
++ // _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_curr_symbol = __wcs;
++ }
++ else
++ _M_curr_symbol = L"";
++
++ _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_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_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ moneypunct<wchar_t, true>::~moneypunct()
++ {
++ if (wcslen(_M_positive_sign))
++ delete [] _M_positive_sign;
++ if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
++ delete [] _M_negative_sign;
++ if (wcslen(_M_curr_symbol))
++ delete [] _M_curr_symbol;
++ }
++
++ template<>
++ moneypunct<wchar_t, false>::~moneypunct()
++ {
++ if (wcslen(_M_positive_sign))
++ delete [] _M_positive_sign;
++ if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
++ delete [] _M_negative_sign;
++ if (wcslen(_M_curr_symbol))
++ delete [] _M_curr_symbol;
++ }
++#endif
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2004-01-09 18:20:59.000000000 -0600
+@@ -0,0 +1,129 @@
++// std::numpunct 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, 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.2.3.1.2 numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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<char>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = '.';
++ _M_thousands_sep = ',';
++ _M_grouping = "";
++ }
++ else
++ {
++ // Named locale.
++ _M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
++ _M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __cloc));
++ // Check for NUL, which implies no grouping.
++ if (_M_thousands_sep == '\0')
++ _M_grouping = "";
++ else
++ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ }
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_truename = "true";
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_falsename = "false";
++ }
++
++ template<>
++ numpunct<char>::~numpunct()
++ { }
++
++#ifdef _GLIBCPP_USE_WCHAR_T
++ template<>
++ void
++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_decimal_point = L'.';
++ _M_thousands_sep = L',';
++ _M_grouping = "";
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_decimal_point = __cloc->decimal_point_wc;
++ _M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_decimal_point = __global_locale->decimal_point_wc;
++ _M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
++ _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
++#endif
++ if (_M_thousands_sep == L'\0')
++ _M_grouping = "";
++ else
++ _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ }
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_truename = L"true";
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_falsename = L"false";
++ }
++
++ template<>
++ numpunct<wchar_t>::~numpunct()
++ { }
++ #endif
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-01-09 08:25:03.000000000 -0600
+@@ -0,0 +1,341 @@
++// std::time_get, std::time_put implementation, 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, 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.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::
++ _M_put(char* __s, size_t __maxlen, const char* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ strftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++
++ template<>
++ void
++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_c_locale;
++
++ _M_date_format = "%m/%d/%y";
++ _M_date_era_format = "%m/%d/%y";
++ _M_time_format = "%H:%M:%S";
++ _M_time_era_format = "%H:%M:%S";
++ _M_date_time_format = "";
++ _M_date_time_era_format = "";
++ _M_am = "AM";
++ _M_pm = "PM";
++ _M_am_pm_format = "";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_day1 = "Sunday";
++ _M_day2 = "Monday";
++ _M_day3 = "Tuesday";
++ _M_day4 = "Wednesday";
++ _M_day5 = "Thursday";
++ _M_day6 = "Friday";
++ _M_day7 = "Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_day_a1 = "Sun";
++ _M_day_a2 = "Mon";
++ _M_day_a3 = "Tue";
++ _M_day_a4 = "Wed";
++ _M_day_a5 = "Thu";
++ _M_day_a6 = "Fri";
++ _M_day_a7 = "Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_month01 = "January";
++ _M_month02 = "February";
++ _M_month03 = "March";
++ _M_month04 = "April";
++ _M_month05 = "May";
++ _M_month06 = "June";
++ _M_month07 = "July";
++ _M_month08 = "August";
++ _M_month09 = "September";
++ _M_month10 = "October";
++ _M_month11 = "November";
++ _M_month12 = "December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_month_a01 = "Jan";
++ _M_month_a02 = "Feb";
++ _M_month_a03 = "Mar";
++ _M_month_a04 = "Apr";
++ _M_month_a05 = "May";
++ _M_month_a06 = "Jun";
++ _M_month_a07 = "July";
++ _M_month_a08 = "Aug";
++ _M_month_a09 = "Sep";
++ _M_month_a10 = "Oct";
++ _M_month_a11 = "Nov";
++ _M_month_a12 = "Dec";
++ }
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ _M_date_format = __nl_langinfo_l(D_FMT, __cloc);
++ _M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
++ _M_time_format = __nl_langinfo_l(T_FMT, __cloc);
++ _M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
++ _M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
++ _M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
++ _M_am = __nl_langinfo_l(AM_STR, __cloc);
++ _M_pm = __nl_langinfo_l(PM_STR, __cloc);
++ _M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
++
++ // Day names, starting with "C"'s Sunday.
++ _M_day1 = __nl_langinfo_l(DAY_1, __cloc);
++ _M_day2 = __nl_langinfo_l(DAY_2, __cloc);
++ _M_day3 = __nl_langinfo_l(DAY_3, __cloc);
++ _M_day4 = __nl_langinfo_l(DAY_4, __cloc);
++ _M_day5 = __nl_langinfo_l(DAY_5, __cloc);
++ _M_day6 = __nl_langinfo_l(DAY_6, __cloc);
++ _M_day7 = __nl_langinfo_l(DAY_7, __cloc);
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_day_a1 = __nl_langinfo_l(ABDAY_1, __cloc);
++ _M_day_a2 = __nl_langinfo_l(ABDAY_2, __cloc);
++ _M_day_a3 = __nl_langinfo_l(ABDAY_3, __cloc);
++ _M_day_a4 = __nl_langinfo_l(ABDAY_4, __cloc);
++ _M_day_a5 = __nl_langinfo_l(ABDAY_5, __cloc);
++ _M_day_a6 = __nl_langinfo_l(ABDAY_6, __cloc);
++ _M_day_a7 = __nl_langinfo_l(ABDAY_7, __cloc);
++
++ // Month names, starting with "C"'s January.
++ _M_month01 = __nl_langinfo_l(MON_1, __cloc);
++ _M_month02 = __nl_langinfo_l(MON_2, __cloc);
++ _M_month03 = __nl_langinfo_l(MON_3, __cloc);
++ _M_month04 = __nl_langinfo_l(MON_4, __cloc);
++ _M_month05 = __nl_langinfo_l(MON_5, __cloc);
++ _M_month06 = __nl_langinfo_l(MON_6, __cloc);
++ _M_month07 = __nl_langinfo_l(MON_7, __cloc);
++ _M_month08 = __nl_langinfo_l(MON_8, __cloc);
++ _M_month09 = __nl_langinfo_l(MON_9, __cloc);
++ _M_month10 = __nl_langinfo_l(MON_10, __cloc);
++ _M_month11 = __nl_langinfo_l(MON_11, __cloc);
++ _M_month12 = __nl_langinfo_l(MON_12, __cloc);
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_month_a01 = __nl_langinfo_l(ABMON_1, __cloc);
++ _M_month_a02 = __nl_langinfo_l(ABMON_2, __cloc);
++ _M_month_a03 = __nl_langinfo_l(ABMON_3, __cloc);
++ _M_month_a04 = __nl_langinfo_l(ABMON_4, __cloc);
++ _M_month_a05 = __nl_langinfo_l(ABMON_5, __cloc);
++ _M_month_a06 = __nl_langinfo_l(ABMON_6, __cloc);
++ _M_month_a07 = __nl_langinfo_l(ABMON_7, __cloc);
++ _M_month_a08 = __nl_langinfo_l(ABMON_8, __cloc);
++ _M_month_a09 = __nl_langinfo_l(ABMON_9, __cloc);
++ _M_month_a10 = __nl_langinfo_l(ABMON_10, __cloc);
++ _M_month_a11 = __nl_langinfo_l(ABMON_11, __cloc);
++ _M_month_a12 = __nl_langinfo_l(ABMON_12, __cloc);
++ }
++ }
++
++#ifdef _GLIBCPP_USE_WCHAR_T
++ template<>
++ void
++ __timepunct<wchar_t>::
++ _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);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ wcsftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++
++ template<>
++ void
++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++#warning wide time stuff
++// if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_c_locale;
++
++ _M_date_format = L"%m/%d/%y";
++ _M_date_era_format = L"%m/%d/%y";
++ _M_time_format = L"%H:%M:%S";
++ _M_time_era_format = L"%H:%M:%S";
++ _M_date_time_format = L"";
++ _M_date_time_era_format = L"";
++ _M_am = L"AM";
++ _M_pm = L"PM";
++ _M_am_pm_format = L"";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_day1 = L"Sunday";
++ _M_day2 = L"Monday";
++ _M_day3 = L"Tuesday";
++ _M_day4 = L"Wednesday";
++ _M_day5 = L"Thursday";
++ _M_day6 = L"Friday";
++ _M_day7 = L"Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_day_a1 = L"Sun";
++ _M_day_a2 = L"Mon";
++ _M_day_a3 = L"Tue";
++ _M_day_a4 = L"Wed";
++ _M_day_a5 = L"Thu";
++ _M_day_a6 = L"Fri";
++ _M_day_a7 = L"Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_month01 = L"January";
++ _M_month02 = L"February";
++ _M_month03 = L"March";
++ _M_month04 = L"April";
++ _M_month05 = L"May";
++ _M_month06 = L"June";
++ _M_month07 = L"July";
++ _M_month08 = L"August";
++ _M_month09 = L"September";
++ _M_month10 = L"October";
++ _M_month11 = L"November";
++ _M_month12 = L"December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_month_a01 = L"Jan";
++ _M_month_a02 = L"Feb";
++ _M_month_a03 = L"Mar";
++ _M_month_a04 = L"Apr";
++ _M_month_a05 = L"May";
++ _M_month_a06 = L"Jun";
++ _M_month_a07 = L"July";
++ _M_month_a08 = L"Aug";
++ _M_month_a09 = L"Sep";
++ _M_month_a10 = L"Oct";
++ _M_month_a11 = L"Nov";
++ _M_month_a12 = L"Dec";
++ }
++#if 0
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ _M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
++ _M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
++ _M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
++ _M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
++ _M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
++ _M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
++ _M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
++ _M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
++ _M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
++
++ // Day names, starting with "C"'s Sunday.
++ _M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
++ _M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
++ _M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
++ _M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
++ _M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
++ _M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
++ _M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_day_a1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
++ _M_day_a2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
++ _M_day_a3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
++ _M_day_a4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
++ _M_day_a5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
++ _M_day_a6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
++ _M_day_a7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
++
++ // Month names, starting with "C"'s January.
++ _M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
++ _M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
++ _M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
++ _M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
++ _M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
++ _M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
++ _M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
++ _M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
++ _M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
++ _M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
++ _M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
++ _M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_month_a01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
++ _M_month_a02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
++ _M_month_a03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
++ _M_month_a04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
++ _M_month_a05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
++ _M_month_a06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
++ _M_month_a07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
++ _M_month_a08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
++ _M_month_a09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
++ _M_month_a10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
++ _M_month_a11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
++ _M_month_a12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
++ }
++#endif // 0
++ }
++#endif
++}
+diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h
+--- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h 2004-01-09 04:26:21.000000000 -0600
+@@ -0,0 +1,68 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// 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 <bkoz@redhat.com>
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(size_t __refs)
++ : locale::facet(__refs)
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ _M_name_timepunct = _S_c_name;
++#endif
++ _M_initialize_timepunct();
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__c_locale __cloc,
++ const char* __s,
++ size_t __refs)
++ : locale::facet(__refs)
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ _M_name_timepunct = new char[strlen(__s) + 1];
++ strcpy(_M_name_timepunct, __s);
++#endif
++ _M_initialize_timepunct(__cloc);
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::~__timepunct()
++ {
++#ifndef __UCLIBC_HAS_XLOCALE__
++ if (_S_c_name != _M_name_timepunct)
++ delete [] _M_name_timepunct;
++#endif
++ _S_destroy_c_locale(_M_c_locale_timepunct);
++ }
+diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h
+--- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h 2004-01-09 02:54:54.000000000 -0600
+@@ -0,0 +1,57 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 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
++//
++
++// Information as gleaned from /usr/include/ctype.h
++
++ 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<char>::_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 = _ISgraph;
++ static const mask cntrl = _IScntrl;
++ static const mask punct = _ISpunct;
++ static const mask alnum = _ISalnum;
++ };
+diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h
+--- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h 2002-06-24 00:49:19.000000000 -0500
+@@ -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<char>::
++ is(mask __m, char __c) const
++ { return _M_table[static_cast<unsigned char>(__c)] & __m; }
++
++ const char*
++ ctype<char>::
++ is(const char* __low, const char* __high, mask* __vec) const
++ {
++ while (__low < __high)
++ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
++ return __high;
++ }
++
++ const char*
++ ctype<char>::
++ scan_is(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high
++ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
++ ++__low;
++ return __low;
++ }
++
++ const char*
++ ctype<char>::
++ scan_not(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high
++ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
++ ++__low;
++ return __low;
++ }
+diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h
+--- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2004-01-09 03:34:53.000000000 -0600
+@@ -0,0 +1,90 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 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, 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<char>::classic_table() throw()
++ {
++ return __C_ctype_b;
++ }
++
++ ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
++ size_t __refs)
++ : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
++ {
++ _M_toupper = __C_ctype_toupper;
++ _M_tolower = __C_ctype_tolower;
++ _M_table = __table ? __table : __C_ctype_b;
++ _M_c_locale_ctype = _S_c_locale;
++ }
++
++ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
++ __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
++ {
++ _M_toupper = __C_ctype_toupper;
++ _M_tolower = __C_ctype_tolower;
++ _M_table = __table ? __table : __C_ctype_b;
++ _M_c_locale_ctype = _S_c_locale;
++ }
++
++ char
++ ctype<char>::do_toupper(char __c) const
++ { return _M_toupper[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<char>::do_toupper(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = _M_toupper[static_cast<unsigned char>(*__low)];
++ ++__low;
++ }
++ return __high;
++ }
++
++ char
++ ctype<char>::do_tolower(char __c) const
++ { return _M_tolower[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<char>::do_tolower(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = _M_tolower[static_cast<unsigned char>(*__low)];
++ ++__low;
++ }
++ return __high;
++ }
+diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h
+--- gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h 2004-01-09 04:56:13.000000000 -0600
+@@ -0,0 +1,56 @@
++// Specific definitions for GNU/Linux -*- C++ -*-
++
++// Copyright (C) 2000, 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, 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 _GLIBCPP_OS_DEFINES
++#define _GLIBCPP_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 <features.h>
++
++// These systems have declarations mismatching those in libio.h by
++// omitting throw qualifiers. Cleanest way out is to not provide
++// throw-qualifiers at all. Defining it as empty here will make libio.h
++// not define it.
++#undef __THROW
++#define __THROW
++
++// Tell Glibc not to try to provide its own inline versions of
++// some math functions. Those cause assembly-time clashes with
++// our definitions.
++#define __NO_MATH_INLINES
++
++// We must not see the optimized string functions GNU libc defines.
++#define __NO_STRING_INLINES
++
++#endif
--- /dev/null
+diff -urN gcc-3.4.0-dist/boehm-gc/configure gcc-3.4.0/boehm-gc/configure
+--- gcc-3.4.0-dist/boehm-gc/configure 2004-04-18 21:23:04.000000000 -0500
++++ gcc-3.4.0/boehm-gc/configure 2004-08-12 16:51:15.000000000 -0500
+@@ -1947,6 +1947,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN gcc-3.4.0-dist/boehm-gc/ltconfig gcc-3.4.0/boehm-gc/ltconfig
+--- gcc-3.4.0-dist/boehm-gc/ltconfig 2002-11-20 09:59:06.000000000 -0600
++++ gcc-3.4.0/boehm-gc/ltconfig 2004-08-12 16:51:15.000000000 -0500
+@@ -1981,6 +1981,23 @@
+ fi
+ ;;
+
++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
++ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
++ file_magic_cmd=/usr/bin/file
++ file_magic_test_file=`echo /lib/libuClibc-*.so`
++
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ version_type=sunos
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+diff -urN gcc-3.4.0-dist/gcc/config/arm/linux-elf.h gcc-3.4.0/gcc/config/arm/linux-elf.h
+--- gcc-3.4.0-dist/gcc/config/arm/linux-elf.h 2004-01-31 00:18:11.000000000 -0600
++++ gcc-3.4.0/gcc/config/arm/linux-elf.h 2004-08-12 16:51:15.000000000 -0500
+@@ -81,6 +81,18 @@
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define LINK_SPEC "%{h*} %{version:-v} \
++ %{b} %{Wl,*:%*} \
++ %{static:-Bstatic} \
++ %{shared:-shared} \
++ %{symbolic:-Bsymbolic} \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
++ -X \
++ %{mbig-endian:-EB}" \
++ SUBTARGET_EXTRA_LINK_SPEC
++#else
+ #define LINK_SPEC "%{h*} %{version:-v} \
+ %{b} %{Wl,*:%*} \
+ %{static:-Bstatic} \
+@@ -91,6 +103,7 @@
+ -X \
+ %{mbig-endian:-EB}" \
+ SUBTARGET_EXTRA_LINK_SPEC
++#endif
+
+ #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
+
+diff -urN gcc-3.4.0-dist/gcc/config/cris/linux.h gcc-3.4.0/gcc/config/cris/linux.h
+--- gcc-3.4.0-dist/gcc/config/cris/linux.h 2003-11-28 21:08:09.000000000 -0600
++++ gcc-3.4.0/gcc/config/cris/linux.h 2004-08-12 16:51:15.000000000 -0500
+@@ -79,6 +79,25 @@
+ #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"
+
+@@ -93,6 +112,8 @@
+ %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
+ %{!r:%{O2|O3: --gc-sections}}"
+
++#endif /* USE_UCLIBC */
++
+
+ /* Node: Run-time Target */
+
+diff -urN gcc-3.4.0-dist/gcc/config/cris/t-linux-uclibc gcc-3.4.0/gcc/config/cris/t-linux-uclibc
+--- gcc-3.4.0-dist/gcc/config/cris/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/gcc/config/cris/t-linux-uclibc 2004-08-12 16:51:15.000000000 -0500
+@@ -0,0 +1,3 @@
++T_CFLAGS = -DUSE_UCLIBC
++TARGET_LIBGCC2_CFLAGS += -fPIC
++CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
+diff -urN gcc-3.4.0-dist/gcc/config/i386/linux.h gcc-3.4.0/gcc/config/i386/linux.h
+--- gcc-3.4.0-dist/gcc/config/i386/linux.h 2003-11-28 21:08:10.000000000 -0600
++++ gcc-3.4.0/gcc/config/i386/linux.h 2004-08-12 16:51:15.000000000 -0500
+@@ -118,6 +118,15 @@
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
+ %{static:-static}}}"
+ #else
++#if defined USE_UCLIBC
++#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
++ %{!shared: \
++ %{!ibcs: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}}}"
++#else
+ #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+@@ -126,6 +135,7 @@
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{static:-static}}}"
+ #endif
++#endif
+
+ /* A C statement (sans semicolon) to output to the stdio stream
+ FILE the assembler definition of uninitialized global DECL named
+diff -urN gcc-3.4.0-dist/gcc/config/mips/linux.h gcc-3.4.0/gcc/config/mips/linux.h
+--- gcc-3.4.0-dist/gcc/config/mips/linux.h 2004-02-19 15:45:21.000000000 -0600
++++ gcc-3.4.0/gcc/config/mips/linux.h 2004-08-12 16:51:15.000000000 -0500
+@@ -109,6 +109,17 @@
+
+ /* Borrowed from sparc/linux.h */
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define LINK_SPEC \
++ "%(endian_spec) \
++ %{shared:-shared} \
++ %{!shared: \
++ %{!ibcs: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}}}"
++#else
+ #define LINK_SPEC \
+ "%(endian_spec) \
+ %{shared:-shared} \
+@@ -118,6 +129,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{static:-static}}}"
++#endif
+
+ #undef SUBTARGET_ASM_SPEC
+ #define SUBTARGET_ASM_SPEC "\
+diff -urN gcc-3.4.0-dist/gcc/config/rs6000/linux.h gcc-3.4.0/gcc/config/rs6000/linux.h
+--- gcc-3.4.0-dist/gcc/config/rs6000/linux.h 2004-02-25 09:11:19.000000000 -0600
++++ gcc-3.4.0/gcc/config/rs6000/linux.h 2004-08-12 16:51:15.000000000 -0500
+@@ -61,7 +61,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}"
+diff -urN gcc-3.4.0-dist/gcc/config/rs6000/sysv4.h gcc-3.4.0/gcc/config/rs6000/sysv4.h
+--- gcc-3.4.0-dist/gcc/config/rs6000/sysv4.h 2004-03-02 16:34:58.000000000 -0600
++++ gcc-3.4.0/gcc/config/rs6000/sysv4.h 2004-08-12 16:51:15.000000000 -0500
+@@ -952,6 +952,7 @@
+ 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) }"
+
+@@ -1129,6 +1130,10 @@
+ %{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
+@@ -1295,6 +1300,7 @@
+ { "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 }, \
+diff -urN gcc-3.4.0-dist/gcc/config/sh/linux.h gcc-3.4.0/gcc/config/sh/linux.h
+--- gcc-3.4.0-dist/gcc/config/sh/linux.h 2004-01-11 20:29:13.000000000 -0600
++++ gcc-3.4.0/gcc/config/sh/linux.h 2004-08-12 16:51:15.000000000 -0500
+@@ -73,12 +73,21 @@
+ #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
+
+ #undef LIB_SPEC
+ #define LIB_SPEC \
+diff -urN gcc-3.4.0-dist/gcc/config/sh/t-linux-uclibc gcc-3.4.0/gcc/config/sh/t-linux-uclibc
+--- gcc-3.4.0-dist/gcc/config/sh/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/gcc/config/sh/t-linux-uclibc 2004-08-12 16:51:15.000000000 -0500
+@@ -0,0 +1,13 @@
++T_CFLAGS = -DUSE_UCLIBC
++
++TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES
++LIB1ASMFUNCS_CACHE = _ic_invalidate
++
++LIB2FUNCS_EXTRA=
++
++MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m3e/m4
++MULTILIB_DIRNAMES=
++MULTILIB_MATCHES =
++MULTILIB_EXCEPTIONS=
++
++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
+diff -urN gcc-3.4.0-dist/gcc/config/sh/t-sh64-uclibc gcc-3.4.0/gcc/config/sh/t-sh64-uclibc
+--- gcc-3.4.0-dist/gcc/config/sh/t-sh64-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/gcc/config/sh/t-sh64-uclibc 2004-08-12 16:51:15.000000000 -0500
+@@ -0,0 +1,13 @@
++EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o crtbegin.o crtend.o
++
++LIB1ASMFUNCS = \
++ _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
++ _shcompact_call_trampoline _shcompact_return_trampoline \
++ _shcompact_incoming_args _ic_invalidate _nested_trampoline \
++ _push_pop_shmedia_regs \
++ _udivdi3 _divdi3 _umoddi3 _moddi3
++
++MULTILIB_OPTIONS = $(MULTILIB_ENDIAN) m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
++MULTILIB_DIRNAMES= $(MULTILIB_ENDIAN) nofpu compact nofpu/compact media64 nofpu/media64
++MULTILIB_MATCHES=
++MULTILIB_EXCEPTIONS=
+diff -urN gcc-3.4.0-dist/gcc/config/t-linux-uclibc gcc-3.4.0/gcc/config/t-linux-uclibc
+--- gcc-3.4.0-dist/gcc/config/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/gcc/config/t-linux-uclibc 2004-08-12 16:51:15.000000000 -0500
+@@ -0,0 +1,15 @@
++T_CFLAGS = -DUSE_UCLIBC
++
++# Compile crtbeginS.o and crtendS.o with pic.
++CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
++# Compile libgcc2.a with pic.
++TARGET_LIBGCC2_CFLAGS = -fPIC
++
++# Override t-slibgcc-elf-ver to export some libgcc symbols with
++# the symbol versions that glibc used.
++SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
++
++# Use unwind-dw2-fde
++LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
++ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
++LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c gthr-gnat.c
+diff -urN gcc-3.4.0-dist/gcc/config.gcc gcc-3.4.0/gcc/config.gcc
+--- gcc-3.4.0-dist/gcc/config.gcc 2004-04-16 21:28:24.000000000 -0500
++++ gcc-3.4.0/gcc/config.gcc 2004-08-12 16:51:15.000000000 -0500
+@@ -664,6 +664,12 @@
+ extra_parts=""
+ use_collect2=yes
+ ;;
++arm*-*-linux-uclibc*) # ARM GNU/Linux with ELF - uClibc
++ tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux"
++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
++ gnu_ld=yes
++ ;;
+ 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 arm/aout.h arm/arm.h"
+ tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
+@@ -725,6 +731,10 @@
+ tmake_file="cris/t-cris cris/t-elfmulti"
+ gas=yes
+ ;;
++cris-*-linux-uclibc*)
++ tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
++ tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux-uclibc"
++ ;;
+ cris-*-linux*)
+ tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
+ tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
+@@ -988,6 +998,11 @@
+ thread_file='single'
+ fi
+ ;;
++i[34567]86-*-linux*uclibc*) # Intel 80386's running GNU/Linux
++ # with ELF format using uClibc
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h"
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc i386/t-crtstuff"
++ ;;
+ i[34567]86-*-linux*) # Intel 80386's running GNU/Linux
+ # with ELF format using glibc 2
+ # aka GNU/Linux C library 6
+@@ -1547,6 +1562,16 @@
+ gnu_ld=yes
+ gas=yes
+ ;;
++mips*-*-linux-uclibc*) # Linux MIPS, either endian. uClibc
++ tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
++ case ${target} in
++ mipsisa32*-*)
++ target_cpu_default="MASK_SOFT_FLOAT"
++ tm_defines="MIPS_ISA_DEFAULT=32"
++ ;;
++ esac
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc"
++ ;;
+ mips*-*-linux*) # Linux MIPS, either endian.
+ tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
+ case ${target} in
+@@ -1764,6 +1789,10 @@
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxspe.h"
+ tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
+ ;;
++powerpc-*-linux-uclibc*)
++ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
++ tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux-uclibc rs6000/t-ppccomm"
++ ;;
+ powerpc-*-linux*)
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
+ tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
+@@ -1924,9 +1953,17 @@
+ tmake_file="${tmake_file} sh/t-le"
+ ;;
+ esac
+- tmake_file="${tmake_file} sh/t-linux"
++ case ${target} in
++ *-*-linux-uclibc*) tmake_file="${tmake_file} sh/t-linux-uclibc" ;;
++ *) tmake_file="${tmake_file} sh/t-linux" ;;
++ esac
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h"
+ case ${target} in
++ sh64*-*-linux-uclibc*)
++ tmake_file="${tmake_file} sh/t-sh64-uclibc"
++ tm_file="${tm_file} sh/sh64.h"
++ extra_headers="shmedia.h ushmedia.h sshmedia.h"
++ ;;
+ sh64*)
+ tmake_file="${tmake_file} sh/t-sh64"
+ tm_file="${tm_file} sh/sh64.h"
+diff -urN gcc-3.4.0-dist/libtool.m4 gcc-3.4.0/libtool.m4
+--- gcc-3.4.0-dist/libtool.m4 2003-11-18 23:29:32.000000000 -0600
++++ gcc-3.4.0/libtool.m4 2004-08-12 16:51:15.000000000 -0500
+@@ -689,6 +689,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN gcc-3.4.0-dist/ltconfig gcc-3.4.0/ltconfig
+--- gcc-3.4.0-dist/ltconfig 2004-03-05 15:05:41.000000000 -0600
++++ gcc-3.4.0/ltconfig 2004-08-12 16:51:15.000000000 -0500
+@@ -602,6 +602,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
++linux-uclibc*) ;;
+ linux-gnu*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+@@ -1262,6 +1263,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
--- /dev/null
+diff -urN gcc-3.4.0-dist/libstdc++-v3/acinclude.m4 gcc-3.4.0/libstdc++-v3/acinclude.m4
+--- gcc-3.4.0-dist/libstdc++-v3/acinclude.m4 2004-03-18 11:35:22.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/acinclude.m4 2004-08-12 17:08:19.000000000 -0500
+@@ -995,7 +995,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
+@@ -1011,6 +1011,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case x${target_os} in
++ x*-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
+ AC_EGREP_CPP([_GLIBCXX_ok], [
+ #include <features.h>
+@@ -1137,6 +1140,41 @@
+ 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_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
++ 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
+diff -urN gcc-3.4.0-dist/libstdc++-v3/aclocal.m4 gcc-3.4.0/libstdc++-v3/aclocal.m4
+--- gcc-3.4.0-dist/libstdc++-v3/aclocal.m4 2004-03-18 11:35:23.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/aclocal.m4 2004-08-12 17:13:42.000000000 -0500
+@@ -1024,6 +1024,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case x${target_os} in
++ x*-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
+ AC_EGREP_CPP([_GLIBCXX_ok], [
+ #include <features.h>
+@@ -1150,6 +1153,41 @@
+ 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_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
++ 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
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2004-08-12 17:08:19.000000000 -0500
+@@ -0,0 +1,59 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 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.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(iswctype_l) __iswctype_l;
++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(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;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#endif // GLIBC 2.3 and later
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2004-08-12 17:08:19.000000000 -0500
+@@ -0,0 +1,160 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno> // For errno
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#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)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ 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)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ 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)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ 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 (_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
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.h
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2004-08-12 17:08:19.000000000 -0500
+@@ -0,0 +1,119 @@
++// Wrapper for underlying C-language localization -*- 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, 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.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _C_LOCALE_H
++#define _C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <cstring> // get std::strlen
++#include <cstdio> // get std::snprintf or std::sprintf
++#include <clocale>
++#include <langinfo.h> // For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h> // For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> // 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<typename _Tv>
++ int
++ __convert_from_v(char* __out, const int __size, const char* __fmt,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ _Tv __v, const __c_locale& __cloc, int __prec = -1)
++ {
++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++ _Tv __v, const __c_locale&, int __prec = -1)
++ {
++# 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
++
++ int __ret;
++ if (__prec >= 0)
++ __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++ else
++ __ret = std::snprintf(__out, __size, __fmt, __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
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2004-08-12 17:08:19.000000000 -0500
+@@ -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, 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.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++ // Specializations.
++#ifdef _GLIBCXX_USE_WCHAR_T
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ 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<size_t>(-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<size_t>(__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<wchar_t, char, mbstate_t>::
++ 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<const extern_type*>(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<size_t>(-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<size_t>(-1)
++ || __conv == static_cast<size_t>(-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<wchar_t, char, mbstate_t>::
++ 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<wchar_t, char, mbstate_t>::
++ 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<wchar_t, char, mbstate_t>::
++ 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<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
++ * __max));
++ while (__from < __end && __max)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(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<size_t>(-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<size_t>(-1)
++ || __conv == static_cast<size_t>(-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
++}
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2004-08-12 17:08:19.000000000 -0500
+@@ -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, 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.2.4.1.2 collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::_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<char>::_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<wchar_t>::_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<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++ size_t __n) const
++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2004-08-12 17:08:19.000000000 -0500
+@@ -0,0 +1,300 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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<char> specializations are in src/locale.cc and
++ // various /config/os/* files.
++ template<>
++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++ : ctype<char>(0, false, __refs)
++ {
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ _S_destroy_c_locale(_M_c_locale_ctype);
++ _S_create_c_locale(_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ _M_toupper = _M_c_locale_ctype->__ctype_toupper;
++ _M_tolower = _M_c_locale_ctype->__ctype_tolower;
++ _M_table = _M_c_locale_ctype->__ctype_b;
++#endif
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ ctype<wchar_t>::__wmask_type
++ ctype<wchar_t>::_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 = 0;
++ }
++ return __ret;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_toupper(wchar_t __c) const
++ { return __towupper_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::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<wchar_t>::do_tolower(wchar_t __c) const
++ { return __towlower_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::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<wchar_t>::
++ do_is(mask __m, wchar_t __c) const
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ bool __ret = false;
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur]
++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ return __ret;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ 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<wchar_t>::
++ 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<wchar_t>::
++ 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<wchar_t>::
++ do_widen(char __c) const
++ { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<wchar_t>::
++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++ {
++ while (__lo < __hi)
++ {
++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++ ++__lo;
++ ++__dest;
++ }
++ return __hi;
++ }
++
++ char
++ ctype<wchar_t>::
++ 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<char>(__c));
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ 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<char>(__c));
++ }
++ ++__lo;
++ ++__dest;
++ }
++ else
++ while (__lo < __hi)
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ ++__lo;
++ ++__dest;
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++
++ void
++ ctype<wchar_t>::_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<char>(__c);
++ }
++ if (__i == 128)
++ _M_narrow_ok = true;
++ else
++ _M_narrow_ok = false;
++ for (size_t __i = 0;
++ __i < sizeof(_M_widen) / sizeof(wint_t); ++__i)
++ _M_widen[__i] = btowc(__i);
++
++ for (size_t __i = 0; __i <= 11; ++__i)
++ {
++ _M_bit[__i] = static_cast<mask>(_ISbit(__i));
++ _M_wmask[__i] = _M_convert_to_wmask(_M_bit[__i]);
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ }
++#endif // _GLIBCXX_USE_WCHAR_T
++}
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2004-08-12 17:08:19.000000000 -0500
+@@ -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, 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.2.7.1.2 messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::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<const char*>(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<wchar_t>::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
++}
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.h
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2004-08-12 17:08:19.000000000 -0500
+@@ -0,0 +1,109 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#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<typename _CharT>
++ messages<_CharT>::messages(size_t __refs)
++ : facet(__refs)
++ {
++ _M_c_locale_messages = _S_get_c_locale();
++ }
++
++ template<typename _CharT>
++ messages<_CharT>::messages(__c_locale __cloc,
++ const char* __s __attribute__ ((__unused__)),
++ size_t __refs)
++ : facet(__refs)
++ {
++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++ const char* __dir) const
++ {
++ __bindtextdomain(__s.c_str(), __dir);
++ return this->do_open(__s, __loc);
++ }
++
++ // Virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::~messages()
++ {
++ _S_destroy_c_locale(_M_c_locale_messages);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::do_open(const basic_string<char>& __s,
++ const locale&) const
++ {
++ // No error checking is done, assume the catalog exists and can
++ // be used.
++ __textdomain(__s.c_str());
++ return 0;
++ }
++
++ template<typename _CharT>
++ void
++ messages<_CharT>::do_close(catalog) const
++ { }
++
++ // messages_byname
++ template<typename _CharT>
++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++ : messages<_CharT>(__refs)
++ {
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ _S_destroy_c_locale(this->_M_c_locale_messages);
++ _S_create_c_locale(this->_M_c_locale_messages, __s);
++ }
++ }
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2004-08-12 17:08:19.000000000 -0500
+@@ -0,0 +1,698 @@
++// 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, 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.2.6.3.2 moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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:
++ ;
++ }
++ return __ret;
++ }
++
++ template<>
++ void
++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, true>;
++
++ 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<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, false>;
++
++ 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<char, true>::~moneypunct()
++ { delete _M_data; }
++
++ template<>
++ moneypunct<char, false>::~moneypunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ moneypunct<wchar_t, true>::_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<wchar_t, true>;
++
++ 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...
++ unsigned char uc;
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ {
++ uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
++ _M_data->_M_atoms[__i] = btowc(uc);
++ }
++ }
++ 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;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union __s_and_w { const char *__s; unsigned int __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = static_cast<wchar_t>(__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<wchar_t, false>::_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<wchar_t, false>;
++
++ 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...
++ unsigned char uc;
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ {
++ uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
++ _M_data->_M_atoms[__i] = btowc(uc);
++ }
++ }
++ 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;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union __s_and_w { const char *__s; unsigned int __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = static_cast<wchar_t>(__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<wchar_t, true>::~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<wchar_t, false>::~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
++}
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2004-08-12 17:15:14.000000000 -0500
+@@ -0,0 +1,181 @@
++// 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, 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.2.3.1.2 numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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<char>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<char>;
++
++ 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 __i = 0; __i < __num_base::_S_iend; ++__i)
++ _M_data->_M_atoms_in[__i] = __num_base::_S_atoms_in[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __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 = strlen(_M_data->_M_truename);
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = "false";
++ _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
++ }
++
++ template<>
++ numpunct<char>::~numpunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<wchar_t>;
++
++ 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',';
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_S_get_c_locale());
++#endif
++ // Use ctype::widen code without the facet...
++ unsigned char uc;
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ {
++ uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
++ _M_data->_M_atoms_out[__i] = btowc(uc);
++ }
++
++ for (size_t __i = 0; __i < __num_base::_S_iend; ++__i)
++ {
++ uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__i]);
++ _M_data->_M_atoms_in[__i] = btowc(uc);
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ }
++ else
++ {
++ // Named locale.
++#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;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union __s_and_w { const char *__s; unsigned int __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
++
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = static_cast<wchar_t>(__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 = wcslen(_M_data->_M_truename);
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = L"false";
++ _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
++ }
++
++ template<>
++ numpunct<wchar_t>::~numpunct()
++ { delete _M_data; }
++ #endif
++}
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.cc
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-08-12 17:08:19.000000000 -0500
+@@ -0,0 +1,347 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// 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 <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::
++ _M_put(char* __s, size_t __maxlen, const char* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ strftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++
++ template<>
++ void
++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<char>;
++
++ 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 = "July";
++ _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<wchar_t>::
++ _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);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ wcsftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++
++ template<>
++ void
++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<wchar_t>;
++
++#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"July";
++ _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);
++
++ _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
++ _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
++ _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
++ _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
++ _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
++ _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
++ _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
++ _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
++ _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
++ _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
++ _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
++ _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
++ _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
++ _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
++ _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
++ _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
++ _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
++ _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
++ _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
++ _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
++ _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
++ _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
++ _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
++ _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
++ _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
++ _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
++ _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
++ _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
++ _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
++ _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
++ _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
++ _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
++ _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
++ _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
++ _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
++ _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
++ _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
++ _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
++ _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
++ _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
++ _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
++ _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
++ _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
++ }
++#endif // 0
++ }
++#endif
++}
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.h
+--- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.h 2004-08-12 17:08:19.000000000 -0500
+@@ -0,0 +1,80 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// 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 <bkoz@redhat.com>
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(size_t __refs)
++ : facet(__refs), _M_data(NULL)
++ {
++#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
++ _M_name_timepunct = _S_get_c_name();
++#endif
++ _M_initialize_timepunct();
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
++ : facet(__refs), _M_data(__cache)
++ {
++#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
++ _M_name_timepunct = _S_get_c_name();
++#endif
++ _M_initialize_timepunct();
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__c_locale __cloc,
++ const char* __s __attribute__ ((__unused__)),
++ size_t __refs)
++ : facet(__refs), _M_data(NULL)
++ {
++#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_timepunct = __tmp;
++#endif
++ _M_initialize_timepunct(__cloc);
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::~__timepunct()
++ {
++#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
++ if (_M_name_timepunct != _S_get_c_name())
++ delete [] _M_name_timepunct;
++#endif
++ delete _M_data;
++ _S_destroy_c_locale(_M_c_locale_timepunct);
++ }
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_base.h
+--- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_base.h 2004-08-12 17:08:19.000000000 -0500
+@@ -0,0 +1,58 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 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.
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++// Information as gleaned from /usr/include/ctype.h
++
++ 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<char>::_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;
++ };
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
+--- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_inline.h 2004-08-12 17:08:19.000000000 -0500
+@@ -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<char>::
++ is(mask __m, char __c) const
++ { return _M_table[static_cast<unsigned char>(__c)] & __m; }
++
++ const char*
++ ctype<char>::
++ is(const char* __low, const char* __high, mask* __vec) const
++ {
++ while (__low < __high)
++ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
++ return __high;
++ }
++
++ const char*
++ ctype<char>::
++ scan_is(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high
++ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
++ ++__low;
++ return __low;
++ }
++
++ const char*
++ ctype<char>::
++ scan_not(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high
++ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
++ ++__low;
++ return __low;
++ }
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
+--- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2004-08-12 17:08:19.000000000 -0500
+@@ -0,0 +1,96 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 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, 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<char>::classic_table() throw()
++ { return __C_ctype_b; }
++
++ ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
++ size_t __refs)
++ : facet(__refs), _M_del(__table != 0 && __del)
++ {
++ _M_c_locale_ctype = _S_clone_c_locale(__cloc);
++ _M_toupper = __C_ctype_toupper;
++ _M_tolower = __C_ctype_tolower;
++ _M_table = __table ? __table : __C_ctype_b;
++ memset(_M_widen, 0, sizeof(_M_widen));
++ _M_widen_ok = 0;
++ memset(_M_narrow, 0, sizeof(_M_narrow));
++ _M_narrow_ok = 0;
++ }
++
++ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
++ : facet(__refs), _M_del(__table != 0 && __del)
++ {
++ _M_c_locale_ctype = _S_get_c_locale();
++ _M_toupper = __C_ctype_toupper;
++ _M_tolower = __C_ctype_tolower;
++ _M_table = __table ? __table : __C_ctype_b;
++ memset(_M_widen, 0, sizeof(_M_widen));
++ _M_widen_ok = 0;
++ memset(_M_narrow, 0, sizeof(_M_narrow));
++ _M_narrow_ok = 0;
++ }
++
++ char
++ ctype<char>::do_toupper(char __c) const
++ { return _M_toupper[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<char>::do_toupper(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = _M_toupper[static_cast<unsigned char>(*__low)];
++ ++__low;
++ }
++ return __high;
++ }
++
++ char
++ ctype<char>::do_tolower(char __c) const
++ { return _M_tolower[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<char>::do_tolower(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = _M_tolower[static_cast<unsigned char>(*__low)];
++ ++__low;
++ }
++ return __high;
++ }
+diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/os_defines.h
+--- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/os_defines.h 2004-08-12 17:08:19.000000000 -0500
+@@ -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 <features.h>
++
++// We must not see the optimized string functions GNU libc defines.
++#define __NO_STRING_INLINES
++
++#endif
+diff -urN gcc-3.4.0-dist/libstdc++-v3/configure gcc-3.4.0/libstdc++-v3/configure
+--- gcc-3.4.0-dist/libstdc++-v3/configure 2004-03-18 11:35:25.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/configure 2004-08-12 17:08:58.000000000 -0500
+@@ -3878,6 +3878,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5545,6 +5550,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case x${target_os} in
++ xlinux-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -5759,6 +5767,77 @@
+ 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_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
++ 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
+diff -urN gcc-3.4.0-dist/libstdc++-v3/configure.host gcc-3.4.0/libstdc++-v3/configure.host
+--- gcc-3.4.0-dist/libstdc++-v3/configure.host 2004-03-18 11:36:12.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/configure.host 2004-08-12 17:08:19.000000000 -0500
+@@ -217,6 +217,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.
+diff -urN gcc-3.4.0-dist/libstdc++-v3/crossconfig.m4 gcc-3.4.0/libstdc++-v3/crossconfig.m4
+--- gcc-3.4.0-dist/libstdc++-v3/crossconfig.m4 2004-02-09 01:17:55.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/crossconfig.m4 2004-08-12 17:08:19.000000000 -0500
+@@ -122,6 +122,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 \
+@@ -136,7 +229,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)
+diff -urN gcc-3.4.0-dist/libstdc++-v3/include/c_compatibility/wchar.h gcc-3.4.0/libstdc++-v3/include/c_compatibility/wchar.h
+--- gcc-3.4.0-dist/libstdc++-v3/include/c_compatibility/wchar.h 2003-12-08 21:51:45.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/include/c_compatibility/wchar.h 2004-08-12 17:14:36.000000000 -0500
+@@ -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;
+diff -urN gcc-3.4.0-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.4.0/libstdc++-v3/include/c_std/std_cwchar.h
+--- gcc-3.4.0-dist/libstdc++-v3/include/c_std/std_cwchar.h 2003-12-08 21:44:35.000000000 -0600
++++ gcc-3.4.0/libstdc++-v3/include/c_std/std_cwchar.h 2004-08-12 17:08:19.000000000 -0500
+@@ -179,7 +179,9 @@
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using ::wcsftime;
++#endif
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
--- /dev/null
+#
+# Submitted:
+#
+# Dimitry Andric <dimitry@andric.com>, 2004-05-01
+#
+# Description:
+#
+# Nicholas Pitre released this patch for gcc soft-float support here:
+# http://lists.arm.linux.org.uk/pipermail/linux-arm/2003-October/006436.html
+#
+# This version has been adapted to work with gcc 3.4.0.
+#
+# The original patch doesn't distinguish between softfpa and softvfp modes
+# in the way Nicholas Pitre probably meant. His description is:
+#
+# "Default is to use APCS-32 mode with soft-vfp. The old Linux default for
+# floats can be achieved with -mhard-float or with the configure
+# --with-float=hard option. If -msoft-float or --with-float=soft is used then
+# software float support will be used just like the default but with the legacy
+# big endian word ordering for double float representation instead."
+#
+# Which means the following:
+#
+# * If you compile without -mhard-float or -msoft-float, you should get
+# software floating point, using the VFP format. The produced object file
+# should have these flags in its header:
+#
+# private flags = 600: [APCS-32] [VFP float format] [software FP]
+#
+# * If you compile with -mhard-float, you should get hardware floating point,
+# which always uses the FPA format. Object file header flags should be:
+#
+# private flags = 0: [APCS-32] [FPA float format]
+#
+# * If you compile with -msoft-float, you should get software floating point,
+# using the FPA format. This is done for compatibility reasons with many
+# existing distributions. Object file header flags should be:
+#
+# private flags = 200: [APCS-32] [FPA float format] [software FP]
+#
+# The original patch from Nicholas Pitre contained the following constructs:
+#
+# #define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
+# %{mhard-float:-mfpu=fpa} \
+# %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
+#
+# However, gcc doesn't accept this ";:" notation, used in the 3rd line. This
+# is probably the reason Robert Schwebel modified it to:
+#
+# #define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
+# %{mhard-float:-mfpu=fpa} \
+# %{!mhard-float: %{msoft-float:-mfpu=softfpa -mfpu=softvfp}}"
+#
+# But this causes the following behaviour:
+#
+# * If you compile without -mhard-float or -msoft-float, the compiler generates
+# software floating point instructions, but *nothing* is passed to the
+# assembler, which results in an object file which has flags:
+#
+# private flags = 0: [APCS-32] [FPA float format]
+#
+# This is not correct!
+#
+# * If you compile with -mhard-float, the compiler generates hardware floating
+# point instructions, and passes "-mfpu=fpa" to the assembler, which results
+# in an object file which has the same flags as in the previous item, but now
+# those *are* correct.
+#
+# * If you compile with -msoft-float, the compiler generates software floating
+# point instructions, and passes "-mfpu=softfpa -mfpu=softvfp" (in that
+# order) to the assembler, which results in an object file with flags:
+#
+# private flags = 600: [APCS-32] [VFP float format] [software FP]
+#
+# This is not correct, because the last "-mfpu=" option on the assembler
+# command line determines the actual FPU convention used (which should be FPA
+# in this case).
+#
+# Therefore, I modified this patch to get the desired behaviour. Every
+# instance of the notation:
+#
+# %{msoft-float:-mfpu=softfpa -mfpu=softvfp}
+#
+# was changed to:
+#
+# %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}
+#
+# I also did the following:
+#
+# * Modified all TARGET_DEFAULT macros I could find to include ARM_FLAG_VFP, to
+# be consistent with Nicholas' original patch.
+# * Removed any "msoft-float" or "mhard-float" from all MULTILIB_DEFAULTS
+# macros I could find. I think that if you compile without any options, you
+# would like to get the defaults. :)
+# * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed
+# anymore. (The required functions are now in libgcc.)
+
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/coff.h gcc-3.4.0/gcc/config/arm/coff.h
+--- gcc-3.4.0-orig/gcc/config/arm/coff.h 2004-02-24 15:25:22.000000000 +0100
++++ gcc-3.4.0/gcc/config/arm/coff.h 2004-05-01 19:07:06.059409600 +0200
+@@ -31,11 +31,16 @@
+ #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
+
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_SOFT_FLOAT \
++ | ARM_FLAG_VFP \
++ | ARM_FLAG_APCS_32 \
++ | ARM_FLAG_APCS_FRAME \
++ | ARM_FLAG_MMU_TRAPS )
+
+ #ifndef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
++ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
+ #endif
+ \f
+ /* This is COFF, but prefer stabs. */
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/elf.h gcc-3.4.0/gcc/config/arm/elf.h
+--- gcc-3.4.0-orig/gcc/config/arm/elf.h 2004-02-24 15:25:22.000000000 +0100
++++ gcc-3.4.0/gcc/config/arm/elf.h 2004-05-01 19:12:16.976486400 +0200
+@@ -46,7 +46,9 @@
+
+ #ifndef SUBTARGET_ASM_FLOAT_SPEC
+ #define SUBTARGET_ASM_FLOAT_SPEC "\
+-%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
++%{mapcs-float:-mfloat} \
++%{mhard-float:-mfpu=fpa} \
++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
+ #endif
+
+ #ifndef ASM_SPEC
+@@ -106,12 +108,17 @@
+ #endif
+
+ #ifndef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_SOFT_FLOAT \
++ | ARM_FLAG_VFP \
++ | ARM_FLAG_APCS_32 \
++ | ARM_FLAG_APCS_FRAME \
++ | ARM_FLAG_MMU_TRAPS )
+ #endif
+
+ #ifndef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
++ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
+ #endif
+ \f
+ #define TARGET_ASM_FILE_START_APP_OFF true
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/linux-elf.h gcc-3.4.0/gcc/config/arm/linux-elf.h
+--- gcc-3.4.0-orig/gcc/config/arm/linux-elf.h 2004-01-31 07:18:11.000000000 +0100
++++ gcc-3.4.0/gcc/config/arm/linux-elf.h 2004-05-01 19:19:06.935979200 +0200
+@@ -30,9 +30,27 @@
+ /* Do not assume anything about header files. */
+ #define NO_IMPLICIT_EXTERN_C
+
+-/* Default is to use APCS-32 mode. */
++/*
++ * Default is to use APCS-32 mode with soft-vfp.
++ * The old Linux default for floats can be achieved with -mhard-float
++ * or with the configure --with-float=hard option.
++ * If -msoft-float or --with-float=soft is used then software float
++ * support will be used just like the default but with the legacy
++ * big endian word ordering for double float representation instead.
++ */
++
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_APCS_32 \
++ | ARM_FLAG_SOFT_FLOAT \
++ | ARM_FLAG_VFP \
++ | ARM_FLAG_MMU_TRAPS )
++
++#undef SUBTARGET_EXTRA_ASM_SPEC
++#define SUBTARGET_EXTRA_ASM_SPEC "\
++%{!mcpu=*:-mcpu=xscale} \
++%{mhard-float:-mfpu=fpa} \
++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
+
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+
+@@ -40,7 +58,7 @@
+
+ #undef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
++ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
+
+ #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
+
+@@ -55,7 +73,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
+ the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/t-linux gcc-3.4.0/gcc/config/arm/t-linux
+--- gcc-3.4.0-orig/gcc/config/arm/t-linux 2003-09-20 23:09:07.000000000 +0200
++++ gcc-3.4.0/gcc/config/arm/t-linux 2004-05-01 20:31:59.102846400 +0200
+@@ -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
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/unknown-elf.h gcc-3.4.0/gcc/config/arm/unknown-elf.h
+--- gcc-3.4.0-orig/gcc/config/arm/unknown-elf.h 2004-02-24 15:25:22.000000000 +0100
++++ gcc-3.4.0/gcc/config/arm/unknown-elf.h 2004-05-01 19:09:09.016212800 +0200
+@@ -30,7 +30,12 @@
+
+ /* Default to using APCS-32 and software floating point. */
+ #ifndef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_SOFT_FLOAT \
++ | ARM_FLAG_VFP \
++ | ARM_FLAG_APCS_32 \
++ | ARM_FLAG_APCS_FRAME \
++ | ARM_FLAG_MMU_TRAPS )
+ #endif
+
+ /* Now we define the strings used to build the spec file. */
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/xscale-elf.h gcc-3.4.0/gcc/config/arm/xscale-elf.h
+--- gcc-3.4.0-orig/gcc/config/arm/xscale-elf.h 2003-07-02 01:26:43.000000000 +0200
++++ gcc-3.4.0/gcc/config/arm/xscale-elf.h 2004-05-01 20:15:36.620105600 +0200
+@@ -49,11 +49,12 @@
+ endian, regardless of the endian-ness of the memory
+ system. */
+
+-#define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
+- %{mhard-float:-mfpu=fpa} \
+- %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
++#define SUBTARGET_EXTRA_ASM_SPEC "\
++%{!mcpu=*:-mcpu=xscale} \
++%{mhard-float:-mfpu=fpa} \
++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
+
+ #ifndef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" }
++ { "mlittle-endian", "mno-thumb-interwork", "marm" }
+ #endif
--- /dev/null
+diff -urN gcc-3.4.1-dist/boehm-gc/configure gcc-3.4.1/boehm-gc/configure
+--- gcc-3.4.1-dist/boehm-gc/configure 2004-07-01 14:14:03.000000000 -0500
++++ gcc-3.4.1/boehm-gc/configure 2004-08-12 16:22:57.000000000 -0500
+@@ -1947,6 +1947,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -urN gcc-3.4.1-dist/boehm-gc/ltconfig gcc-3.4.1/boehm-gc/ltconfig
+--- gcc-3.4.1-dist/boehm-gc/ltconfig 2002-11-20 09:59:06.000000000 -0600
++++ gcc-3.4.1/boehm-gc/ltconfig 2004-08-12 15:54:42.000000000 -0500
+@@ -1981,6 +1981,23 @@
+ fi
+ ;;
+
++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
++ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
++ file_magic_cmd=/usr/bin/file
++ file_magic_test_file=`echo /lib/libuClibc-*.so`
++
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ version_type=sunos
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+diff -urN gcc-3.4.1-dist/gcc/config/arm/linux-elf.h gcc-3.4.1/gcc/config/arm/linux-elf.h
+--- gcc-3.4.1-dist/gcc/config/arm/linux-elf.h 2004-01-31 00:18:11.000000000 -0600
++++ gcc-3.4.1/gcc/config/arm/linux-elf.h 2004-08-12 15:54:42.000000000 -0500
+@@ -81,6 +81,18 @@
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define LINK_SPEC "%{h*} %{version:-v} \
++ %{b} %{Wl,*:%*} \
++ %{static:-Bstatic} \
++ %{shared:-shared} \
++ %{symbolic:-Bsymbolic} \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
++ -X \
++ %{mbig-endian:-EB}" \
++ SUBTARGET_EXTRA_LINK_SPEC
++#else
+ #define LINK_SPEC "%{h*} %{version:-v} \
+ %{b} %{Wl,*:%*} \
+ %{static:-Bstatic} \
+@@ -91,6 +103,7 @@
+ -X \
+ %{mbig-endian:-EB}" \
+ SUBTARGET_EXTRA_LINK_SPEC
++#endif
+
+ #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
+
+diff -urN gcc-3.4.1-dist/gcc/config/cris/linux.h gcc-3.4.1/gcc/config/cris/linux.h
+--- gcc-3.4.1-dist/gcc/config/cris/linux.h 2003-11-28 21:08:09.000000000 -0600
++++ gcc-3.4.1/gcc/config/cris/linux.h 2004-08-12 15:54:43.000000000 -0500
+@@ -79,6 +79,25 @@
+ #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"
+
+@@ -93,6 +112,8 @@
+ %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
+ %{!r:%{O2|O3: --gc-sections}}"
+
++#endif /* USE_UCLIBC */
++
+
+ /* Node: Run-time Target */
+
+diff -urN gcc-3.4.1-dist/gcc/config/cris/t-linux-uclibc gcc-3.4.1/gcc/config/cris/t-linux-uclibc
+--- gcc-3.4.1-dist/gcc/config/cris/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/gcc/config/cris/t-linux-uclibc 2004-08-12 15:54:43.000000000 -0500
+@@ -0,0 +1,3 @@
++T_CFLAGS = -DUSE_UCLIBC
++TARGET_LIBGCC2_CFLAGS += -fPIC
++CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
+diff -urN gcc-3.4.1-dist/gcc/config/i386/linux.h gcc-3.4.1/gcc/config/i386/linux.h
+--- gcc-3.4.1-dist/gcc/config/i386/linux.h 2003-11-28 21:08:10.000000000 -0600
++++ gcc-3.4.1/gcc/config/i386/linux.h 2004-08-12 15:54:43.000000000 -0500
+@@ -118,6 +118,15 @@
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
+ %{static:-static}}}"
+ #else
++#if defined USE_UCLIBC
++#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
++ %{!shared: \
++ %{!ibcs: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}}}"
++#else
+ #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+@@ -126,6 +135,7 @@
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{static:-static}}}"
+ #endif
++#endif
+
+ /* A C statement (sans semicolon) to output to the stdio stream
+ FILE the assembler definition of uninitialized global DECL named
+diff -urN gcc-3.4.1-dist/gcc/config/mips/linux.h gcc-3.4.1/gcc/config/mips/linux.h
+--- gcc-3.4.1-dist/gcc/config/mips/linux.h 2004-06-15 20:42:24.000000000 -0500
++++ gcc-3.4.1/gcc/config/mips/linux.h 2004-08-12 15:54:43.000000000 -0500
+@@ -109,6 +109,17 @@
+
+ /* Borrowed from sparc/linux.h */
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define LINK_SPEC \
++ "%(endian_spec) \
++ %{shared:-shared} \
++ %{!shared: \
++ %{!ibcs: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}}}"
++#else
+ #define LINK_SPEC \
+ "%(endian_spec) \
+ %{shared:-shared} \
+@@ -118,6 +129,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{static:-static}}}"
++#endif
+
+ #undef SUBTARGET_ASM_SPEC
+ #define SUBTARGET_ASM_SPEC "\
+diff -urN gcc-3.4.1-dist/gcc/config/rs6000/linux.h gcc-3.4.1/gcc/config/rs6000/linux.h
+--- gcc-3.4.1-dist/gcc/config/rs6000/linux.h 2004-02-25 09:11:19.000000000 -0600
++++ gcc-3.4.1/gcc/config/rs6000/linux.h 2004-08-12 15:54:43.000000000 -0500
+@@ -61,7 +61,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}"
+diff -urN gcc-3.4.1-dist/gcc/config/rs6000/sysv4.h gcc-3.4.1/gcc/config/rs6000/sysv4.h
+--- gcc-3.4.1-dist/gcc/config/rs6000/sysv4.h 2004-06-10 01:39:50.000000000 -0500
++++ gcc-3.4.1/gcc/config/rs6000/sysv4.h 2004-08-12 15:54:43.000000000 -0500
+@@ -947,6 +947,7 @@
+ 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) }"
+
+@@ -1124,6 +1125,10 @@
+ %{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
+@@ -1290,6 +1295,7 @@
+ { "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 }, \
+diff -urN gcc-3.4.1-dist/gcc/config/sh/linux.h gcc-3.4.1/gcc/config/sh/linux.h
+--- gcc-3.4.1-dist/gcc/config/sh/linux.h 2004-01-11 20:29:13.000000000 -0600
++++ gcc-3.4.1/gcc/config/sh/linux.h 2004-08-12 15:54:43.000000000 -0500
+@@ -73,12 +73,21 @@
+ #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
+
+ #undef LIB_SPEC
+ #define LIB_SPEC \
+diff -urN gcc-3.4.1-dist/gcc/config/sh/t-linux-uclibc gcc-3.4.1/gcc/config/sh/t-linux-uclibc
+--- gcc-3.4.1-dist/gcc/config/sh/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/gcc/config/sh/t-linux-uclibc 2004-08-12 15:54:43.000000000 -0500
+@@ -0,0 +1,13 @@
++T_CFLAGS = -DUSE_UCLIBC
++
++TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES
++LIB1ASMFUNCS_CACHE = _ic_invalidate
++
++LIB2FUNCS_EXTRA=
++
++MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m3e/m4
++MULTILIB_DIRNAMES=
++MULTILIB_MATCHES =
++MULTILIB_EXCEPTIONS=
++
++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
+diff -urN gcc-3.4.1-dist/gcc/config/sh/t-sh64-uclibc gcc-3.4.1/gcc/config/sh/t-sh64-uclibc
+--- gcc-3.4.1-dist/gcc/config/sh/t-sh64-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/gcc/config/sh/t-sh64-uclibc 2004-08-12 15:54:43.000000000 -0500
+@@ -0,0 +1,13 @@
++EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o crtbegin.o crtend.o
++
++LIB1ASMFUNCS = \
++ _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
++ _shcompact_call_trampoline _shcompact_return_trampoline \
++ _shcompact_incoming_args _ic_invalidate _nested_trampoline \
++ _push_pop_shmedia_regs \
++ _udivdi3 _divdi3 _umoddi3 _moddi3
++
++MULTILIB_OPTIONS = $(MULTILIB_ENDIAN) m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
++MULTILIB_DIRNAMES= $(MULTILIB_ENDIAN) nofpu compact nofpu/compact media64 nofpu/media64
++MULTILIB_MATCHES=
++MULTILIB_EXCEPTIONS=
+diff -urN gcc-3.4.1-dist/gcc/config/t-linux-uclibc gcc-3.4.1/gcc/config/t-linux-uclibc
+--- gcc-3.4.1-dist/gcc/config/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/gcc/config/t-linux-uclibc 2004-08-12 15:54:43.000000000 -0500
+@@ -0,0 +1,15 @@
++T_CFLAGS = -DUSE_UCLIBC
++
++# Compile crtbeginS.o and crtendS.o with pic.
++CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
++# Compile libgcc2.a with pic.
++TARGET_LIBGCC2_CFLAGS = -fPIC
++
++# Override t-slibgcc-elf-ver to export some libgcc symbols with
++# the symbol versions that glibc used.
++SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
++
++# Use unwind-dw2-fde
++LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
++ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
++LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c gthr-gnat.c
+diff -urN gcc-3.4.1-dist/gcc/config.gcc gcc-3.4.1/gcc/config.gcc
+--- gcc-3.4.1-dist/gcc/config.gcc 2004-04-21 10:12:35.000000000 -0500
++++ gcc-3.4.1/gcc/config.gcc 2004-08-12 15:59:46.000000000 -0500
+@@ -664,6 +664,12 @@
+ extra_parts=""
+ use_collect2=yes
+ ;;
++arm*-*-linux-uclibc*) # ARM GNU/Linux with ELF - uClibc
++ tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux"
++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
++ gnu_ld=yes
++ ;;
+ 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 arm/aout.h arm/arm.h"
+ tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
+@@ -725,6 +731,10 @@
+ tmake_file="cris/t-cris cris/t-elfmulti"
+ gas=yes
+ ;;
++cris-*-linux-uclibc*)
++ tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
++ tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux-uclibc"
++ ;;
+ cris-*-linux*)
+ tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
+ tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
+@@ -988,6 +998,11 @@
+ thread_file='single'
+ fi
+ ;;
++i[34567]86-*-linux*uclibc*) # Intel 80386's running GNU/Linux
++ # with ELF format using uClibc
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h"
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc i386/t-crtstuff"
++ ;;
+ i[34567]86-*-linux*) # Intel 80386's running GNU/Linux
+ # with ELF format using glibc 2
+ # aka GNU/Linux C library 6
+@@ -1547,6 +1562,16 @@
+ gnu_ld=yes
+ gas=yes
+ ;;
++mips*-*-linux-uclibc*) # Linux MIPS, either endian. uClibc
++ tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
++ case ${target} in
++ mipsisa32*-*)
++ target_cpu_default="MASK_SOFT_FLOAT"
++ tm_defines="MIPS_ISA_DEFAULT=32"
++ ;;
++ esac
++ tmake_file="t-slibgcc-elf-ver t-linux-uclibc"
++ ;;
+ mips*-*-linux*) # Linux MIPS, either endian.
+ tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
+ case ${target} in
+@@ -1764,6 +1789,10 @@
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxspe.h"
+ tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
+ ;;
++powerpc-*-linux-uclibc*)
++ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
++ tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux-uclibc rs6000/t-ppccomm"
++ ;;
+ powerpc-*-linux*)
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
+ tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
+@@ -1924,9 +1953,17 @@
+ tmake_file="${tmake_file} sh/t-le"
+ ;;
+ esac
+- tmake_file="${tmake_file} sh/t-linux"
++ case ${target} in
++ *-*-linux-uclibc*) tmake_file="${tmake_file} sh/t-linux-uclibc" ;;
++ *) tmake_file="${tmake_file} sh/t-linux" ;;
++ esac
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h"
+ case ${target} in
++ sh64*-*-linux-uclibc*)
++ tmake_file="${tmake_file} sh/t-sh64-uclibc"
++ tm_file="${tm_file} sh/sh64.h"
++ extra_headers="shmedia.h ushmedia.h sshmedia.h"
++ ;;
+ sh64*)
+ tmake_file="${tmake_file} sh/t-sh64"
+ tm_file="${tm_file} sh/sh64.h"
+diff -urN gcc-3.4.1-dist/libtool.m4 gcc-3.4.1/libtool.m4
+--- gcc-3.4.1-dist/libtool.m4 2004-05-18 04:08:37.000000000 -0500
++++ gcc-3.4.1/libtool.m4 2004-08-12 15:54:43.000000000 -0500
+@@ -689,6 +689,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN gcc-3.4.1-dist/ltconfig gcc-3.4.1/ltconfig
+--- gcc-3.4.1-dist/ltconfig 2004-03-05 15:05:41.000000000 -0600
++++ gcc-3.4.1/ltconfig 2004-08-12 15:55:48.000000000 -0500
+@@ -602,6 +602,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
++linux-uclibc*) ;;
+ linux-gnu*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+@@ -1262,6 +1263,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
--- /dev/null
+diff -urN gcc-3.4.1-dist/libstdc++-v3/acinclude.m4 gcc-3.4.1/libstdc++-v3/acinclude.m4
+--- gcc-3.4.1-dist/libstdc++-v3/acinclude.m4 2004-05-14 05:53:11.000000000 -0500
++++ gcc-3.4.1/libstdc++-v3/acinclude.m4 2004-08-12 15:54:48.000000000 -0500
+@@ -996,7 +996,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
+@@ -1012,6 +1012,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case x${target_os} in
++ x*-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
+ AC_EGREP_CPP([_GLIBCXX_ok], [
+ #include <features.h>
+@@ -1138,6 +1141,41 @@
+ 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_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
++ 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
+diff -urN gcc-3.4.1-dist/libstdc++-v3/aclocal.m4 gcc-3.4.1/libstdc++-v3/aclocal.m4
+--- gcc-3.4.1-dist/libstdc++-v3/aclocal.m4 2004-05-15 15:43:59.000000000 -0500
++++ gcc-3.4.1/libstdc++-v3/aclocal.m4 2004-08-12 16:14:37.000000000 -0500
+@@ -1025,6 +1025,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case x${target_os} in
++ x*-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
+ AC_EGREP_CPP([_GLIBCXX_ok], [
+ #include <features.h>
+@@ -1151,6 +1154,41 @@
+ 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_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
++ 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
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2004-08-12 15:54:48.000000000 -0500
+@@ -0,0 +1,59 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 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.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(iswctype_l) __iswctype_l;
++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(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;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#endif // GLIBC 2.3 and later
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2004-08-12 15:54:48.000000000 -0500
+@@ -0,0 +1,160 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 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.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno> // For errno
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#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)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ 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)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ 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)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ 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 (_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
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c_locale.h
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2004-08-12 15:54:48.000000000 -0500
+@@ -0,0 +1,119 @@
++// Wrapper for underlying C-language localization -*- 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, 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.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _C_LOCALE_H
++#define _C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <cstring> // get std::strlen
++#include <cstdio> // get std::snprintf or std::sprintf
++#include <clocale>
++#include <langinfo.h> // For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h> // For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> // 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<typename _Tv>
++ int
++ __convert_from_v(char* __out, const int __size, const char* __fmt,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ _Tv __v, const __c_locale& __cloc, int __prec = -1)
++ {
++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++ _Tv __v, const __c_locale&, int __prec = -1)
++ {
++# 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
++
++ int __ret;
++ if (__prec >= 0)
++ __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++ else
++ __ret = std::snprintf(__out, __size, __fmt, __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
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2004-08-12 15:54:48.000000000 -0500
+@@ -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, 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.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++ // Specializations.
++#ifdef _GLIBCXX_USE_WCHAR_T
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ 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<size_t>(-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<size_t>(__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<wchar_t, char, mbstate_t>::
++ 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<const extern_type*>(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<size_t>(-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<size_t>(-1)
++ || __conv == static_cast<size_t>(-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<wchar_t, char, mbstate_t>::
++ 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<wchar_t, char, mbstate_t>::
++ 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<wchar_t, char, mbstate_t>::
++ 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<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
++ * __max));
++ while (__from < __end && __max)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(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<size_t>(-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<size_t>(-1)
++ || __conv == static_cast<size_t>(-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
++}
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2004-08-12 15:54:48.000000000 -0500
+@@ -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, 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.2.4.1.2 collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::_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<char>::_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<wchar_t>::_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<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++ size_t __n) const
++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2004-08-12 15:54:48.000000000 -0500
+@@ -0,0 +1,300 @@
++// 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, 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.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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<char> specializations are in src/locale.cc and
++ // various /config/os/* files.
++ template<>
++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++ : ctype<char>(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<wchar_t>::__wmask_type
++ ctype<wchar_t>::_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 = 0;
++ }
++ return __ret;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_toupper(wchar_t __c) const
++ { return __towupper_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::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<wchar_t>::do_tolower(wchar_t __c) const
++ { return __towlower_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::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<wchar_t>::
++ do_is(mask __m, wchar_t __c) const
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ bool __ret = false;
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur]
++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ return __ret;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ 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<wchar_t>::
++ 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<wchar_t>::
++ 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<wchar_t>::
++ do_widen(char __c) const
++ { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<wchar_t>::
++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++ {
++ while (__lo < __hi)
++ {
++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++ ++__lo;
++ ++__dest;
++ }
++ return __hi;
++ }
++
++ char
++ ctype<wchar_t>::
++ 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<char>(__c));
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ 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<char>(__c));
++ }
++ ++__lo;
++ ++__dest;
++ }
++ else
++ while (__lo < __hi)
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ ++__lo;
++ ++__dest;
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++
++ void
++ ctype<wchar_t>::_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<char>(__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<mask>(_ISbit(__k));
++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ }
++#endif // _GLIBCXX_USE_WCHAR_T
++}
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2004-08-12 15:54:48.000000000 -0500
+@@ -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, 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.2.7.1.2 messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::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<const char*>(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<wchar_t>::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
++}
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.4.1/libstdc++-v3/config/locale/uclibc/messages_members.h
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2004-08-12 15:54:48.000000000 -0500
+@@ -0,0 +1,118 @@
++// std::messages 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, 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.2.7.1.2 messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#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<typename _CharT>
++ messages<_CharT>::messages(size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
++ _M_name_messages(_S_get_c_name())
++ { }
++
++ template<typename _CharT>
++ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
++ _M_name_messages(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_messages = __tmp;
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++ const char* __dir) const
++ {
++ __bindtextdomain(__s.c_str(), __dir);
++ return this->do_open(__s, __loc);
++ }
++
++ // Virtual member functions.
++ template<typename _CharT>
++ 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 _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::do_open(const basic_string<char>& __s,
++ const locale&) const
++ {
++ // No error checking is done, assume the catalog exists and can
++ // be used.
++ __textdomain(__s.c_str());
++ return 0;
++ }
++
++ template<typename _CharT>
++ void
++ messages<_CharT>::do_close(catalog) const
++ { }
++
++ // messages_byname
++ template<typename _CharT>
++ 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);
++ }
++ }
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2004-08-12 15:54:48.000000000 -0500
+@@ -0,0 +1,698 @@
++// 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, 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.2.6.3.2 moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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:
++ ;
++ }
++ return __ret;
++ }
++
++ template<>
++ void
++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, true>;
++
++ 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<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, false>;
++
++ 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<char, true>::~moneypunct()
++ { delete _M_data; }
++
++ template<>
++ moneypunct<char, false>::~moneypunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ moneypunct<wchar_t, true>::_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<wchar_t, true>;
++
++ 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...
++ unsigned char uc;
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ {
++ uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
++ _M_data->_M_atoms[__i] = btowc(uc);
++ }
++ }
++ 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;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union __s_and_w { const char *__s; unsigned int __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = static_cast<wchar_t>(__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<wchar_t, false>::_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<wchar_t, false>;
++
++ 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...
++ unsigned char uc;
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ {
++ uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
++ _M_data->_M_atoms[__i] = btowc(uc);
++ }
++ }
++ 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;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union __s_and_w { const char *__s; unsigned int __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = static_cast<wchar_t>(__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<wchar_t, true>::~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<wchar_t, false>::~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
++}
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2004-08-12 16:13:31.000000000 -0500
+@@ -0,0 +1,183 @@
++// 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, 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.2.3.1.2 numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#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<char>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<char>;
++
++ 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 = strlen(_M_data->_M_truename);
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = "false";
++ _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
++ }
++
++ template<>
++ numpunct<char>::~numpunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<wchar_t>;
++
++ 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',';
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_S_get_c_locale());
++#endif
++ // Use ctype::widen code without the facet...
++ unsigned char uc;
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ {
++ uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
++ _M_data->_M_atoms_out[__i] = btowc(uc);
++ }
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ {
++ uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__j]);
++ _M_data->_M_atoms_in[__j] = btowc(uc);
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ }
++ else
++ {
++ // Named locale.
++#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;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union __s_and_w { const char *__s; unsigned int __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
++
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = static_cast<wchar_t>(__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 = wcslen(_M_data->_M_truename);
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = L"false";
++ _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
++ }
++
++ template<>
++ numpunct<wchar_t>::~numpunct()
++ { delete _M_data; }
++ #endif
++}
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/time_members.cc
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-08-12 15:54:48.000000000 -0500
+@@ -0,0 +1,347 @@
++// 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, 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.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#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<char>::
++ _M_put(char* __s, size_t __maxlen, const char* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ strftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++
++ template<>
++ void
++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<char>;
++
++ 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<wchar_t>::
++ _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);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ wcsftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++
++ template<>
++ void
++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<wchar_t>;
++
++#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);
++
++ _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
++ _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
++ _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
++ _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
++ _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
++ _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
++ _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
++ _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
++ _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
++ _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
++ _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
++ _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
++ _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
++ _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
++ _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
++ _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
++ _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
++ _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
++ _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
++ _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
++ _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
++ _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
++ _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
++ _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
++ _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
++ _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
++ _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
++ _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
++ _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
++ _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
++ _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
++ _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
++ _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
++ _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
++ _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
++ _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
++ _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
++ _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
++ _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
++ _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
++ _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
++ _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
++ _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
++ }
++#endif // 0
++ }
++#endif
++}
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.4.1/libstdc++-v3/config/locale/uclibc/time_members.h
+--- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/time_members.h 2004-08-12 15:54:48.000000000 -0500
+@@ -0,0 +1,68 @@
++// 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, 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.2.5.1.2 - time_get functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++ template<typename _CharT>
++ __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<typename _CharT>
++ __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<typename _CharT>
++ __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(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_timepunct = __tmp;
++ _M_initialize_timepunct(__cloc);
++ }
++
++ template<typename _CharT>
++ __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);
++ }
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_base.h
+--- gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_base.h 2004-08-12 15:54:48.000000000 -0500
+@@ -0,0 +1,58 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 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.
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++// Information as gleaned from /usr/include/ctype.h
++
++ 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<char>::_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;
++ };
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_inline.h
+--- gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_inline.h 2004-08-12 15:54:48.000000000 -0500
+@@ -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<char>::
++ is(mask __m, char __c) const
++ { return _M_table[static_cast<unsigned char>(__c)] & __m; }
++
++ const char*
++ ctype<char>::
++ is(const char* __low, const char* __high, mask* __vec) const
++ {
++ while (__low < __high)
++ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
++ return __high;
++ }
++
++ const char*
++ ctype<char>::
++ scan_is(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high
++ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
++ ++__low;
++ return __low;
++ }
++
++ const char*
++ ctype<char>::
++ scan_not(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high
++ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
++ ++__low;
++ return __low;
++ }
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_noninline.h
+--- gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2004-08-12 15:54:48.000000000 -0500
+@@ -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<char>::classic_table() throw()
++ { return __C_ctype_b; }
++
++ ctype<char>::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<char>::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<char>::do_toupper(char __c) const
++ { return _M_toupper[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<char>::do_toupper(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = _M_toupper[static_cast<unsigned char>(*__low)];
++ ++__low;
++ }
++ return __high;
++ }
++
++ char
++ ctype<char>::do_tolower(char __c) const
++ { return _M_tolower[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<char>::do_tolower(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = _M_tolower[static_cast<unsigned char>(*__low)];
++ ++__low;
++ }
++ return __high;
++ }
+diff -urN gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.4.1/libstdc++-v3/config/os/uclibc/os_defines.h
+--- gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/config/os/uclibc/os_defines.h 2004-08-12 15:54:48.000000000 -0500
+@@ -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 <features.h>
++
++// We must not see the optimized string functions GNU libc defines.
++#define __NO_STRING_INLINES
++
++#endif
+diff -urN gcc-3.4.1-dist/libstdc++-v3/configure gcc-3.4.1/libstdc++-v3/configure
+--- gcc-3.4.1-dist/libstdc++-v3/configure 2004-06-25 17:02:47.000000000 -0500
++++ gcc-3.4.1/libstdc++-v3/configure 2004-08-12 16:20:43.000000000 -0500
+@@ -3878,6 +3878,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5545,6 +5550,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case x${target_os} in
++ xlinux-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -5759,6 +5767,77 @@
+ 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_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
++ 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
+diff -urN gcc-3.4.1-dist/libstdc++-v3/configure.host gcc-3.4.1/libstdc++-v3/configure.host
+--- gcc-3.4.1-dist/libstdc++-v3/configure.host 2004-03-18 11:36:12.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/configure.host 2004-08-12 15:54:48.000000000 -0500
+@@ -217,6 +217,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.
+diff -urN gcc-3.4.1-dist/libstdc++-v3/crossconfig.m4 gcc-3.4.1/libstdc++-v3/crossconfig.m4
+--- gcc-3.4.1-dist/libstdc++-v3/crossconfig.m4 2004-06-10 12:12:14.000000000 -0500
++++ gcc-3.4.1/libstdc++-v3/crossconfig.m4 2004-08-12 15:54:48.000000000 -0500
+@@ -122,6 +122,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 \
+@@ -136,7 +229,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)
+diff -urN gcc-3.4.1-dist/libstdc++-v3/include/c_compatibility/wchar.h gcc-3.4.1/libstdc++-v3/include/c_compatibility/wchar.h
+--- gcc-3.4.1-dist/libstdc++-v3/include/c_compatibility/wchar.h 2003-12-08 21:51:45.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/include/c_compatibility/wchar.h 2004-08-12 16:14:07.000000000 -0500
+@@ -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;
+diff -urN gcc-3.4.1-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.4.1/libstdc++-v3/include/c_std/std_cwchar.h
+--- gcc-3.4.1-dist/libstdc++-v3/include/c_std/std_cwchar.h 2003-12-08 21:44:35.000000000 -0600
++++ gcc-3.4.1/libstdc++-v3/include/c_std/std_cwchar.h 2004-08-12 15:54:48.000000000 -0500
+@@ -179,7 +179,9 @@
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using ::wcsftime;
++#endif
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
--- /dev/null
+#
+# Submitted:
+#
+# Dimitry Andric <dimitry@andric.com>, 2004-05-01
+#
+# Description:
+#
+# Nicholas Pitre released this patch for gcc soft-float support here:
+# http://lists.arm.linux.org.uk/pipermail/linux-arm/2003-October/006436.html
+#
+# This version has been adapted to work with gcc 3.4.0.
+#
+# The original patch doesn't distinguish between softfpa and softvfp modes
+# in the way Nicholas Pitre probably meant. His description is:
+#
+# "Default is to use APCS-32 mode with soft-vfp. The old Linux default for
+# floats can be achieved with -mhard-float or with the configure
+# --with-float=hard option. If -msoft-float or --with-float=soft is used then
+# software float support will be used just like the default but with the legacy
+# big endian word ordering for double float representation instead."
+#
+# Which means the following:
+#
+# * If you compile without -mhard-float or -msoft-float, you should get
+# software floating point, using the VFP format. The produced object file
+# should have these flags in its header:
+#
+# private flags = 600: [APCS-32] [VFP float format] [software FP]
+#
+# * If you compile with -mhard-float, you should get hardware floating point,
+# which always uses the FPA format. Object file header flags should be:
+#
+# private flags = 0: [APCS-32] [FPA float format]
+#
+# * If you compile with -msoft-float, you should get software floating point,
+# using the FPA format. This is done for compatibility reasons with many
+# existing distributions. Object file header flags should be:
+#
+# private flags = 200: [APCS-32] [FPA float format] [software FP]
+#
+# The original patch from Nicholas Pitre contained the following constructs:
+#
+# #define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
+# %{mhard-float:-mfpu=fpa} \
+# %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
+#
+# However, gcc doesn't accept this ";:" notation, used in the 3rd line. This
+# is probably the reason Robert Schwebel modified it to:
+#
+# #define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
+# %{mhard-float:-mfpu=fpa} \
+# %{!mhard-float: %{msoft-float:-mfpu=softfpa -mfpu=softvfp}}"
+#
+# But this causes the following behaviour:
+#
+# * If you compile without -mhard-float or -msoft-float, the compiler generates
+# software floating point instructions, but *nothing* is passed to the
+# assembler, which results in an object file which has flags:
+#
+# private flags = 0: [APCS-32] [FPA float format]
+#
+# This is not correct!
+#
+# * If you compile with -mhard-float, the compiler generates hardware floating
+# point instructions, and passes "-mfpu=fpa" to the assembler, which results
+# in an object file which has the same flags as in the previous item, but now
+# those *are* correct.
+#
+# * If you compile with -msoft-float, the compiler generates software floating
+# point instructions, and passes "-mfpu=softfpa -mfpu=softvfp" (in that
+# order) to the assembler, which results in an object file with flags:
+#
+# private flags = 600: [APCS-32] [VFP float format] [software FP]
+#
+# This is not correct, because the last "-mfpu=" option on the assembler
+# command line determines the actual FPU convention used (which should be FPA
+# in this case).
+#
+# Therefore, I modified this patch to get the desired behaviour. Every
+# instance of the notation:
+#
+# %{msoft-float:-mfpu=softfpa -mfpu=softvfp}
+#
+# was changed to:
+#
+# %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}
+#
+# I also did the following:
+#
+# * Modified all TARGET_DEFAULT macros I could find to include ARM_FLAG_VFP, to
+# be consistent with Nicholas' original patch.
+# * Removed any "msoft-float" or "mhard-float" from all MULTILIB_DEFAULTS
+# macros I could find. I think that if you compile without any options, you
+# would like to get the defaults. :)
+# * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed
+# anymore. (The required functions are now in libgcc.)
+
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/coff.h gcc-3.4.0/gcc/config/arm/coff.h
+--- gcc-3.4.0-orig/gcc/config/arm/coff.h 2004-02-24 15:25:22.000000000 +0100
++++ gcc-3.4.0/gcc/config/arm/coff.h 2004-05-01 19:07:06.059409600 +0200
+@@ -31,11 +31,16 @@
+ #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
+
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_SOFT_FLOAT \
++ | ARM_FLAG_VFP \
++ | ARM_FLAG_APCS_32 \
++ | ARM_FLAG_APCS_FRAME \
++ | ARM_FLAG_MMU_TRAPS )
+
+ #ifndef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
++ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
+ #endif
+ \f
+ /* This is COFF, but prefer stabs. */
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/elf.h gcc-3.4.0/gcc/config/arm/elf.h
+--- gcc-3.4.0-orig/gcc/config/arm/elf.h 2004-02-24 15:25:22.000000000 +0100
++++ gcc-3.4.0/gcc/config/arm/elf.h 2004-05-01 19:12:16.976486400 +0200
+@@ -46,7 +46,9 @@
+
+ #ifndef SUBTARGET_ASM_FLOAT_SPEC
+ #define SUBTARGET_ASM_FLOAT_SPEC "\
+-%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
++%{mapcs-float:-mfloat} \
++%{mhard-float:-mfpu=fpa} \
++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
+ #endif
+
+ #ifndef ASM_SPEC
+@@ -106,12 +108,17 @@
+ #endif
+
+ #ifndef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_SOFT_FLOAT \
++ | ARM_FLAG_VFP \
++ | ARM_FLAG_APCS_32 \
++ | ARM_FLAG_APCS_FRAME \
++ | ARM_FLAG_MMU_TRAPS )
+ #endif
+
+ #ifndef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
++ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
+ #endif
+ \f
+ #define TARGET_ASM_FILE_START_APP_OFF true
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/linux-elf.h gcc-3.4.0/gcc/config/arm/linux-elf.h
+--- gcc-3.4.0-orig/gcc/config/arm/linux-elf.h 2004-01-31 07:18:11.000000000 +0100
++++ gcc-3.4.0/gcc/config/arm/linux-elf.h 2004-05-01 19:19:06.935979200 +0200
+@@ -30,9 +30,27 @@
+ /* Do not assume anything about header files. */
+ #define NO_IMPLICIT_EXTERN_C
+
+-/* Default is to use APCS-32 mode. */
++/*
++ * Default is to use APCS-32 mode with soft-vfp.
++ * The old Linux default for floats can be achieved with -mhard-float
++ * or with the configure --with-float=hard option.
++ * If -msoft-float or --with-float=soft is used then software float
++ * support will be used just like the default but with the legacy
++ * big endian word ordering for double float representation instead.
++ */
++
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_APCS_32 \
++ | ARM_FLAG_SOFT_FLOAT \
++ | ARM_FLAG_VFP \
++ | ARM_FLAG_MMU_TRAPS )
++
++#undef SUBTARGET_EXTRA_ASM_SPEC
++#define SUBTARGET_EXTRA_ASM_SPEC "\
++%{!mcpu=*:-mcpu=xscale} \
++%{mhard-float:-mfpu=fpa} \
++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
+
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+
+@@ -40,7 +58,7 @@
+
+ #undef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
++ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
+
+ #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
+
+@@ -55,7 +73,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
+ the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/t-linux gcc-3.4.0/gcc/config/arm/t-linux
+--- gcc-3.4.0-orig/gcc/config/arm/t-linux 2003-09-20 23:09:07.000000000 +0200
++++ gcc-3.4.0/gcc/config/arm/t-linux 2004-05-01 20:31:59.102846400 +0200
+@@ -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
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/unknown-elf.h gcc-3.4.0/gcc/config/arm/unknown-elf.h
+--- gcc-3.4.0-orig/gcc/config/arm/unknown-elf.h 2004-02-24 15:25:22.000000000 +0100
++++ gcc-3.4.0/gcc/config/arm/unknown-elf.h 2004-05-01 19:09:09.016212800 +0200
+@@ -30,7 +30,12 @@
+
+ /* Default to using APCS-32 and software floating point. */
+ #ifndef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_SOFT_FLOAT \
++ | ARM_FLAG_VFP \
++ | ARM_FLAG_APCS_32 \
++ | ARM_FLAG_APCS_FRAME \
++ | ARM_FLAG_MMU_TRAPS )
+ #endif
+
+ /* Now we define the strings used to build the spec file. */
+diff -urNd gcc-3.4.0-orig/gcc/config/arm/xscale-elf.h gcc-3.4.0/gcc/config/arm/xscale-elf.h
+--- gcc-3.4.0-orig/gcc/config/arm/xscale-elf.h 2003-07-02 01:26:43.000000000 +0200
++++ gcc-3.4.0/gcc/config/arm/xscale-elf.h 2004-05-01 20:15:36.620105600 +0200
+@@ -49,11 +49,12 @@
+ endian, regardless of the endian-ness of the memory
+ system. */
+
+-#define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
+- %{mhard-float:-mfpu=fpa} \
+- %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
++#define SUBTARGET_EXTRA_ASM_SPEC "\
++%{!mcpu=*:-mcpu=xscale} \
++%{mhard-float:-mfpu=fpa} \
++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
+
+ #ifndef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" }
++ { "mlittle-endian", "mno-thumb-interwork", "marm" }
+ #endif
--- /dev/null
+http://www.linux-mips.org/archives/linux-mips/2004-09/msg00000.html
+
+Atsushi Nemoto <anemo@mba.ocn.ne.jp> writes:
+>/ Is this a get_user's problem or gcc's?/
+
+The latter. gcc is putting the empty asm:
+
+ __asm__ ("":"=r" (__gu_val));
+
+into the delay slot of the call.
+
+Part of the problem is that gcc estimates the length of an asm to be the
+number of instruction separators + 1. This means that it estimates the
+asm above to be one instruction long, which is perhaps a little silly
+for an empty string.
+
+But the real problem is that gcc should never trust this estimate anyway,
+since each "instruction" could obviously be a multi-instruction macro.
+gcc should certainly never put asms into delay slots.
+
+FWIW, I don't think the bug is specific to 3.3 or 3.4. It could
+probably trigger for other gcc versions too. It is highly dependent
+on scheduling though.
+
+The attached 3.4.x patch fixes the problem there, but if you want to work
+around it for old versions, just avoid using empty asms if you can,
+or make them volatile if you can't.
+
+Of course, the problem isn't confined to empty asms. If you have an asm
+with a single, multi-instruction macro, gcc might try putting that in a
+delay slot too. You should at least get an assembler warning in that case.
+
+Richard
+
+
+--- gcc-3.4.1/gcc/config/mips/mips.md-orig 2004-09-02 10:38:36.000000000 -0500
++++ gcc-3.4.1/gcc/config/mips/mips.md 2004-09-02 10:38:42.000000000 -0500
+@@ -251,7 +251,7 @@
+
+ ;; Can the instruction be put into a delay slot?
+ (define_attr "can_delay" "no,yes"
+- (if_then_else (and (eq_attr "type" "!branch,call,jump")
++ (if_then_else (and (eq_attr "type" "!branch,call,jump,multi")
+ (and (eq_attr "hazard" "none")
+ (eq_attr "single_insn" "yes")))
+ (const_string "yes")
--- /dev/null
+By Lennert Buytenhek <buytenh@wantstofly.org>
+Adds support for arm*b-linux* big-endian ARM targets
+
+See http://gcc.gnu.org/PR16350
+
+diff -urN gcc-3.4.1-dist/gcc/config/arm/linux-elf.h gcc-3.4.1/gcc/config/arm/linux-elf.h
+--- gcc-3.4.1-dist/gcc/config/arm/linux-elf.h 2004-08-16 16:01:50.000000000 -0500
++++ gcc-3.4.1/gcc/config/arm/linux-elf.h 2004-08-16 15:43:40.000000000 -0500
+@@ -30,17 +30,34 @@
+ /* Do not assume anything about header files. */
+ #define NO_IMPLICIT_EXTERN_C
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_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
++
+ /* Default is to use APCS-32 mode. */
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
++#define TARGET_DEFAULT \
++ ( ARM_FLAG_APCS_32 | \
++ ARM_FLAG_MMU_TRAPS | \
++ 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", "mapcs-32", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
+
+ #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
+
+@@ -101,7 +118,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
+ -X \
+- %{mbig-endian:-EB}" \
++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
+ SUBTARGET_EXTRA_LINK_SPEC
+ #endif
+
+diff -urN gcc-3.4.1-dist/gcc/config.gcc gcc-3.4.1/gcc/config.gcc
+--- gcc-3.4.1-dist/gcc/config.gcc 2004-08-16 16:01:50.000000000 -0500
++++ gcc-3.4.1/gcc/config.gcc 2004-08-16 16:01:25.000000000 -0500
+@@ -672,6 +672,11 @@
+ ;;
+ 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 arm/aout.h arm/arm.h"
++ case $target in
++ arm*b-*)
++ tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
++ ;;
++ esac
+ tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ gnu_ld=yes
--- /dev/null
+diff -urN gcc-3.4.1-dist/gcc/config/arm/linux-elf.h gcc-3.4.1/gcc/config/arm/linux-elf.h
+--- gcc-3.4.1-dist/gcc/config/arm/linux-elf.h 2004-08-16 16:08:18.000000000 -0500
++++ gcc-3.4.1/gcc/config/arm/linux-elf.h 2004-08-16 16:06:24.000000000 -0500
+@@ -107,7 +107,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
+ -X \
+- %{mbig-endian:-EB}" \
++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
+ SUBTARGET_EXTRA_LINK_SPEC
+ #else
+ #define LINK_SPEC "%{h*} %{version:-v} \
+diff -urN gcc-3.4.1-dist/gcc/config.gcc gcc-3.4.1/gcc/config.gcc
+--- gcc-3.4.1-dist/gcc/config.gcc 2004-08-16 16:08:18.000000000 -0500
++++ gcc-3.4.1/gcc/config.gcc 2004-08-16 16:03:25.000000000 -0500
+@@ -666,6 +666,11 @@
+ ;;
+ arm*-*-linux-uclibc*) # ARM GNU/Linux with ELF - uClibc
+ tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
++ case $target in
++ arm*b-*)
++ tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
++ ;;
++ esac
+ tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux"
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ gnu_ld=yes
+++ /dev/null
-Warning! The powerpc patch (rs6000/linux.h) is hack-ish and would
-definitely need to be improved to be acceptable upstream. Also,
-this patch isn't complete as it only supports i386, arm, mips, and
-powerpc (rs6000).
-diff -urN gcc-20011006/config.sub gcc-20011006-new/config.sub
---- gcc-20011006/config.sub 2004-01-13 06:15:28.000000000 -0600
-+++ gcc-20011006-new/config.sub 2004-01-10 11:09:35.000000000 -0600
-@@ -68,7 +68,7 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
-- linux-gnu*)
-+ linux-gnu* | linux-uclibc*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
-@@ -936,7 +936,8 @@
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+ | -mingw32* | -linux-gnu* | -linux-uclibc* \
-+ | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* )
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
-diff -urN gcc-20011006/gcc/config/arm/linux-elf.h gcc-20011006-new/gcc/config/arm/linux-elf.h
---- gcc-20011006/gcc/config/arm/linux-elf.h 2004-01-13 06:15:28.000000000 -0600
-+++ gcc-20011006-new/gcc/config/arm/linux-elf.h 2004-01-10 11:12:11.000000000 -0600
-@@ -90,6 +90,18 @@
- #define ENDFILE_SPEC \
- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
-
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC "%{h*} %{version:-v} \
-+ %{b} %{Wl,*:%*} \
-+ %{static:-Bstatic} \
-+ %{shared:-shared} \
-+ %{symbolic:-Bsymbolic} \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
-+ -X \
-+ %{mbig-endian:-EB}" \
-+ SUBTARGET_EXTRA_LINK_SPEC
-+#else
- #define LINK_SPEC "%{h*} %{version:-v} \
- %{b} %{Wl,*:%*} \
- %{static:-Bstatic} \
-@@ -100,6 +112,7 @@
- -X \
- %{mbig-endian:-EB}" \
- SUBTARGET_EXTRA_LINK_SPEC
-+#endif
-
- #undef CPP_PREDEFINES
- #define CPP_PREDEFINES \
-diff -urN gcc-20011006/gcc/config/i386/linux.h gcc-20011006-new/gcc/config/i386/linux.h
---- gcc-20011006/gcc/config/i386/linux.h 2001-04-03 17:38:59.000000000 -0500
-+++ gcc-20011006-new/gcc/config/i386/linux.h 2004-01-10 11:15:38.000000000 -0600
-@@ -199,6 +199,15 @@
- %{static:-static}}}"
- #endif
- #else
-+#if defined USE_UCLIBC
-+#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
-+ %{!shared: \
-+ %{!ibcs: \
-+ %{!static: \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+ %{static:-static}}}"
-+#else
- #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
- %{!shared: \
- %{!ibcs: \
-@@ -207,6 +216,7 @@
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
- %{static:-static}}}"
- #endif
-+#endif
-
- /* Get perform_* macros to build libgcc.a. */
- #include "i386/perform.h"
-diff -urN gcc-20011006/gcc/config/mips/linux.h gcc-20011006-new/gcc/config/mips/linux.h
---- gcc-20011006/gcc/config/mips/linux.h 2004-01-13 06:15:28.000000000 -0600
-+++ gcc-20011006-new/gcc/config/mips/linux.h 2004-01-10 11:16:39.000000000 -0600
-@@ -154,6 +154,17 @@
-
- /* Borrowed from sparc/linux.h */
- #undef LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC \
-+ "%(endian_spec) \
-+ %{shared:-shared} \
-+ %{!shared: \
-+ %{!ibcs: \
-+ %{!static: \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+ %{static:-static}}}"
-+#else
- #define LINK_SPEC \
- "%(endian_spec) \
- %{shared:-shared} \
-@@ -163,6 +174,7 @@
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
- %{static:-static}}}"
-+#endif
-
-
- #undef SUBTARGET_ASM_SPEC
-diff -urN old/gcc-20011006/gcc/config/mips/t-linux-uclibc gcc-20011006/gcc/config/mips/t-linux-uclibc
---- old/gcc-20011006/gcc/config/mips/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-20011006/gcc/config/mips/t-linux-uclibc 2004-01-14 02:51:10.000000000 -0600
-@@ -0,0 +1 @@
-+T_CFLAGS = -DUSE_UCLIBC
-diff -urN gcc-20011006/gcc/config/rs6000/linux.h gcc-20011006-new/gcc/config/rs6000/linux.h
---- gcc-20011006/gcc/config/rs6000/linux.h 2001-04-03 17:38:59.000000000 -0500
-+++ gcc-20011006-new/gcc/config/rs6000/linux.h 2004-01-10 11:15:38.000000000 -0600
-@@ -36,12 +36,21 @@
- #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
-
- #undef LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC "-m elf32ppclinux %{G*} %{shared:-shared} \
-+ %{!shared: \
-+ %{!static: \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+ %{static:-static}}"
-+#else
- #define LINK_SPEC "-m elf32ppclinux %{G*} %{shared:-shared} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
- %{static:-static}}"
-+#endif
-
- #undef LIB_DEFAULT_SPEC
- #define LIB_DEFAULT_SPEC "%(lib_linux)"
-diff -urN gcc-20011006/gcc/config/t-linux-uclibc gcc-20011006-new/gcc/config/t-linux-uclibc
---- gcc-20011006/gcc/config/t-linux-uclibc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-20011006-new/gcc/config/t-linux-uclibc 2004-01-10 11:18:46.000000000 -0600
-@@ -0,0 +1,18 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+# Don't run fixproto
-+STMP_FIXPROTO =
-+
-+# Don't install "assert.h" in gcc. We use the one in glibc.
-+INSTALL_ASSERT_H =
-+
-+# Compile crtbeginS.o and crtendS.o with pic.
-+CRTSTUFF_T_CFLAGS_S = -fPIC
-+# Compile libgcc2.a with pic.
-+TARGET_LIBGCC2_CFLAGS = -fPIC
-+
-+# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux
-+# C library can handle them.
-+LIBGCC1 =
-+CROSS_LIBGCC1 =
-+LIBGCC1_TEST =
-diff -urN gcc-20011006/gcc/configure gcc-20011006-new/gcc/configure
---- gcc-20011006/gcc/configure 2004-01-13 06:15:28.000000000 -0600
-+++ gcc-20011006-new/gcc/configure 2004-01-10 11:28:54.000000000 -0600
-@@ -3219,6 +3219,24 @@
- ;;
- esac
- ;;
-+ arm*-*-linux-uclibc*) # ARM GNU/Linux with ELF - uClibc
-+ xm_file=arm/xm-linux.h
-+ xmake_file=x-linux
-+ tm_file="arm/linux-elf.h"
-+ case $machine in
-+ armv2*-*-*)
-+ tm_file="arm/linux-elf26.h $tm_file"
-+ ;;
-+ esac
-+ tmake_file="t-linux-uclibc arm/t-linux"
-+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-+ gnu_ld=yes
-+ case x${enable_threads} in
-+ x | xyes | xpthreads | xposix)
-+ thread_file='posix'
-+ ;;
-+ esac
-+ ;;
- arm*-*-aout)
- tm_file=arm/aout.h
- tmake_file=arm/t-bare
-@@ -3631,6 +3649,18 @@
- thread_file='single'
- fi
- ;;
-+ i[34567]86-*-linux*uclibc*) # Intel 80386's running GNU/Linux
-+ # with ELF format using uClibc
-+ xmake_file=x-linux
-+ tm_file=i386/linux.h
-+ tmake_file="t-linux-uclibc i386/t-crtstuff"
-+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-+ gnu_ld=yes
-+ float_format=i386
-+ if test x$enable_threads = xyes; then
-+ thread_file='posix'
-+ fi
-+ ;;
- i[34567]86-*-linux-gnu*) # Intel 80386's running GNU/Linux
- # aka GNU/Linux C library 6
- xmake_file=x-linux
-@@ -4696,7 +4726,19 @@
- # On NetBSD, the headers are already okay, except for math.h.
- tmake_file=t-netbsd
- ;;
-- mips*-*-linux*) # Linux MIPS, either endian.
-+ mips*-*-linux-uclibc*) # Linux (uclibc) MIPS, either endian.
-+ tmake_file=mips/t-linux-uclibc
-+ xmake_file=x-linux
-+ xm_file="xm-siglist.h ${xm_file}"
-+ case $machine in
-+ mipsel-*) tm_file="mips/elfl.h mips/linux.h" ;;
-+ *) tm_file="mips/elf.h mips/linux.h" ;;
-+ esac
-+ extra_parts="crtbegin.o crtend.o"
-+ gnu_ld=yes
-+ gas=yes
-+ ;;
-+ mips*-*-linux*) # Linux MIPS, either endian.
- xmake_file=x-linux
- xm_file="xm-siglist.h ${xm_file}"
- case $machine in
-@@ -5159,6 +5201,24 @@
- thread_file='posix'
- fi
- ;;
-+ powerpc-*-linux-uclibc*)
-+ tm_file=rs6000/linux.h
-+ xm_file="xm-siglist.h rs6000/xm-sysv4.h"
-+ xm_defines="USG ${xm_defines}"
-+ out_file=rs6000/rs6000.c
-+ if test x$gas = xyes
-+ then
-+ tmake_file="rs6000/t-ppcos t-linux-uclibc rs6000/t-ppccomm"
-+ else
-+ tmake_file="rs6000/t-ppc t-linux-uclibc rs6000/t-ppccomm"
-+ fi
-+ xmake_file=x-linux
-+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-+ extra_headers=ppc-asm.h
-+ if test x$enable_threads = xyes; then
-+ thread_file='posix'
-+ fi
-+ ;;
- powerpc-wrs-vxworks*)
- cpu_type=rs6000
- xm_file="xm-siglist.h rs6000/xm-sysv4.h"
-diff -urN gcc-20011006/ltconfig gcc-20011006-new/ltconfig
---- gcc-20011006/ltconfig 1999-06-21 21:35:12.000000000 -0500
-+++ gcc-20011006-new/ltconfig 2004-01-10 11:34:23.000000000 -0600
-@@ -436,6 +436,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case "$host_os" in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-
-@@ -1773,6 +1774,22 @@
- fi
- ;;
-
-+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
-+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
-+ file_magic_cmd=/usr/bin/file
-+ file_magic_test_file=`echo /lib/libuClibc-*.so`
-+ # Assume using the uClibc dynamic linker.
-+ dynamic_linker="uClibc ld.so"
-+ ;;
-+
- netbsd*)
- version_type=sunos
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+++ /dev/null
-diff -urN gdb-5.3/bfd/config.bfd gdb-5.3-new/bfd/config.bfd
---- gdb-5.3/bfd/config.bfd 2002-09-05 15:34:35.000000000 -0500
-+++ gdb-5.3-new/bfd/config.bfd 2004-01-11 06:25:31.000000000 -0600
-@@ -83,7 +83,7 @@
- targ_defvec=ecoffalpha_little_vec
- targ_selvecs=bfd_elf64_alpha_vec
- ;;
-- alpha*-*-linux-gnu* | alpha*-*-elf*)
-+ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
- targ_defvec=bfd_elf64_alpha_vec
- targ_selvecs=ecoffalpha_little_vec
- ;;
-@@ -97,7 +97,8 @@
- targ_defvec=bfd_elf64_ia64_aix_little_vec
- targ_selvecs="bfd_elf64_ia64_aix_big_vec bfd_efi_app_ia64_vec"
- ;;
-- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*)
-+ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | \
-+ ia64*-*-linux-uclibc* | ia64*-*-elf*)
- targ_defvec=bfd_elf64_ia64_little_vec
- targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
- ;;
-@@ -176,11 +177,12 @@
- targ_defvec=bfd_elf32_littlearm_vec
- targ_selvecs=bfd_elf32_bigarm_vec
- ;;
-- armeb-*-elf | arm*b-*-linux-gnu*)
-+ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
- targ_defvec=bfd_elf32_bigarm_vec
- targ_selvecs=bfd_elf32_littlearm_vec
- ;;
-- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*)
-+ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \
-+ arm*-*-conix* | arm*-*-uclinux*)
- targ_defvec=bfd_elf32_littlearm_vec
- targ_selvecs=bfd_elf32_bigarm_vec
- ;;
-@@ -313,7 +315,7 @@
- ;;
-
- #ifdef BFD64
-- hppa*64*-*-linux-gnu*)
-+ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
- targ_defvec=bfd_elf64_hppa_linux_vec
- targ_selvecs=bfd_elf64_hppa_vec
- ;;
-@@ -324,7 +326,7 @@
- ;;
- #endif
-
-- hppa*-*-linux-gnu*)
-+ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)
- targ_defvec=bfd_elf32_hppa_linux_vec
- targ_selvecs=bfd_elf32_hppa_vec
- ;;
-@@ -424,7 +426,7 @@
- targ_selvecs=bfd_elf32_i386_vec
- targ_underscore=yes
- ;;
-- i[3456]86-*-linux-gnu*)
-+ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- targ_defvec=bfd_elf32_i386_vec
- targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
- targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -438,7 +440,7 @@
- targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
- ;;
-- x86_64-*-linux-gnu*)
-+ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
- targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
- ;;
-@@ -589,7 +591,7 @@
- targ_defvec=hp300hpux_vec
- targ_underscore=yes
- ;;
-- m68*-*-linux*aout*)
-+ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
- targ_defvec=m68klinux_vec
- targ_selvecs=bfd_elf32_m68k_vec
- targ_underscore=yes
-@@ -865,7 +867,8 @@
- ;;
- #endif
- powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
-- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+ powerpc-*-rtems* | \
- powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
- targ_defvec=bfd_elf32_powerpc_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -887,8 +890,8 @@
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpcqnx_vec ppcboot_vec"
- ;;
- powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
-- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
-- powerpcle-*-rtems*)
-+ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+ powerpcle-*-vxworks* | powerpcle-*-rtems*)
- targ_defvec=bfd_elf32_powerpcle_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
- targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1038,7 +1041,7 @@
- targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
- targ_underscore=yes
- ;;
-- sparc-*-linux-gnu*)
-+ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
- targ_defvec=bfd_elf32_sparc_vec
- targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
- ;;
-@@ -1081,7 +1084,7 @@
- targ_defvec=sunos_big_vec
- targ_underscore=yes
- ;;
-- sparc64-*-linux-gnu*)
-+ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
- targ_defvec=bfd_elf64_sparc_vec
- targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
- ;;
-diff -urN gdb-5.3/bfd/configure gdb-5.3-new/bfd/configure
---- gdb-5.3/bfd/configure 2002-08-28 05:38:44.000000000 -0500
-+++ gdb-5.3-new/bfd/configure 2004-01-11 06:27:15.000000000 -0600
-@@ -1677,6 +1677,11 @@
- lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
- ;;
-
-+linux-uclibc*)
-+ lt_cv_deplibs_check_method=pass_all
-+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+ ;;
-+
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5067,7 +5072,7 @@
- alpha*-*-freebsd*)
- COREFILE=''
- ;;
-- alpha*-*-linux-gnu*)
-+ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/alphalinux.h"'
- ;;
-@@ -5126,7 +5131,7 @@
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/i386mach3.h"'
- ;;
-- i[3456]86-*-linux-gnu*)
-+ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- COREFILE=trad-core.lo
- TRAD_HEADER='"hosts/i386linux.h"'
- ;;
+++ /dev/null
-Patch pending upstream, probably acceptable.
---------------------------------------------
-
-
-
-Daniel Jacobowitz <drow@mvista.com> writes:
-> I like this. The way func_frame_chain_valid should really be used is
-> by something like:
->
-> /* NOTE: tm-i386nw.h and tm-i386v4.h override this. */
-> set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
->
-> (copied from i386-tdep.c).
->
-> Does this patch work for you?
-
-Yes, thanks. I've included a revised version of my patch below.
-
-> I'm curious as to why we can't just set this universally, or at least a
-> little more globally. Most things that have a main () use it as a
-> normal main (). I'd propose that we set it as the default frame chain,
-> and provide/document an option to ignore inside_main_func.
-
-Well, gdbarch is never supposed to change the default behavior of
-macros; this helps us convert pre-gdbarch targets incrementally.
-Simply turning on gdbarch for one's target ideally wouldn't change its
-behavior at all.
-
-
-[Patch revised for Debian snapshot]
---- snap/gdb/i386-linux-tdep.c.orig 2002-08-18 19:53:57.000000000 -0400
-+++ snap/gdb/i386-linux-tdep.c 2002-08-18 19:54:31.000000000 -0400
-@@ -452,6 +452,9 @@
-
- set_solib_svr4_fetch_link_map_offsets (gdbarch,
- i386_linux_svr4_fetch_link_map_offsets);
-+
-+ set_gdbarch_frame_chain_valid (gdbarch,
-+ generic_func_frame_chain_valid);
- }
-
- /* Provide a prototype to silence -Wmissing-prototypes. */
-[Hurd needs 6. Take 8, since it does no real harm.]
-
-
-Package: gdb
-Severity: normal
-Tags: patch, sid
-
-Hello,
-
-GDB will crash on the Hurd after issuing the 'show' and hitting enter
-a few times:
-
-../../gdb/ui-out.c:130: gdb-internal-error: push_level: Assertion +`uiout->level >= 0 && uiout->level < MAX_UI_OUT_LEVELS' failed.
-
-the problem is that MAX_UI_OUT_LEVELS is not high enough for the extra
-option we have on the Hurd, it should be rised to 6 then, which works
-fine:
-
---- gdb-5.2.cvs20020401/gdb/ui-out.c~ Fri May 3 02:19:20 2002
-+++ gdb-5.2.cvs20020401/gdb/ui-out.c Fri May 3 02:19:32 2002
-@@ -45,7 +45,7 @@
- is always available. Stack/nested level 0 is reserved for the
- top-level result. */
-
--enum { MAX_UI_OUT_LEVELS = 5 };
-+enum { MAX_UI_OUT_LEVELS = 8 };
-
- struct ui_out_level
- {
-
---
-Robert Millan
-
-"5 years from now everyone will be running
-free GNU on their 200 MIPS, 64M SPARCstation-5"
-
- Andrew S. Tanenbaum, 30 Jan 1992
-
-
-Submitted upstream, not liked very much. It's a hack, but it will do for
-now.
-
-2002-07-31 Daniel Jacobowitz <drow@mvista.com>
-
- Fix PR gdb/568
- * thread-db.c (lwp_from_thread): Only warn if unable to find
- the thread.
-
-Index: thread-db.c
-===================================================================
-RCS file: /cvs/src/src/gdb/thread-db.c,v
-retrieving revision 1.22
-diff -u -p -r1.22 thread-db.c
---- gdb/gdb/thread-db.c 23 Mar 2002 17:38:13 -0000 1.22
-+++ gdb/gdb/thread-db.c 31 Jul 2002 16:29:52 -0000
-@@ -260,6 +260,12 @@ lwp_from_thread (ptid_t ptid)
- return ptid;
-
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
-+ if (err == TD_ERR)
-+ {
-+ warning ("Cannot find thread %ld: %s",
-+ (long) GET_THREAD (ptid), thread_db_err_str (err));
-+ return ptid;
-+ }
- if (err != TD_OK)
- error ("Cannot find thread %ld: %s",
- (long) GET_THREAD (ptid), thread_db_err_str (err));
-From Michael Fedrowitz <michaelf@debian.org>. Not submitted to FSF yet.
-
- Hi,
-
-gdb fails to build from source on m68k because some definitions have
-been removed from tm-m68k.h. The patch below readds them.
-
--Michael
-
-
-diff -urN gdb-5.2.cvs20020818.orig/gdb/config/m68k/tm-m68k.h gdb-5.2.cvs20020818/gdb/config/m68k/tm-m68k.h
---- gdb-5.2.cvs20020818.orig/gdb/config/m68k/tm-m68k.h 2002-07-10 19:01:38.000000000 +0200
-+++ gdb-5.2.cvs20020818/gdb/config/m68k/tm-m68k.h 2002-10-06 18:01:59.000000000 +0200
-@@ -26,8 +26,11 @@
- /* Generic 68000 stuff, to be included by other tm-*.h files. */
-
- /* D0_REGNM and A0_REGNUM must be defined here because they are
-- used by the monitor. */
-+ used by the monitor. FPC_REGNUM, FPS_REGNUM and FPI_REGNUM are
-+ defined here because they are used by m68klinux-nat.c. */
-
- #define D0_REGNUM 0
- #define A0_REGNUM 8
--
-+#define FPC_REGNUM 26
-+#define FPS_REGNUM 27
-+#define FPI_REGNUM 28
-
-
-2002-11-24 Daniel Jacobowitz <drow@mvista.com>
-
- * doublest.c (convert_floatformat_to_doublest): Cast exp_bias to int.
- * config/alpha/alpha-linux.mh (MH_CFLAGS): Add -mieee.
-
---- gdb-5.2.debian90.cvs20021120/gdb/doublest.c.orig 2002-11-24 17:48:16.000000000 -0500
-+++ gdb-5.2.debian90.cvs20021120/gdb/doublest.c 2002-11-24 17:48:25.000000000 -0500
-@@ -177,7 +177,7 @@
- if (!special_exponent)
- exponent -= fmt->exp_bias;
- else if (exponent == 0)
-- exponent = 1 - fmt->exp_bias;
-+ exponent = 1 - (int)fmt->exp_bias;
-
- /* Build the result algebraically. Might go infinite, underflow, etc;
- who cares. */
---- gdb-5.2.debian90.cvs20021120/gdb/config/alpha/alpha-linux.mh.orig 2002-11-24 17:50:30.000000000 -0500
-+++ gdb-5.2.debian90.cvs20021120/gdb/config/alpha/alpha-linux.mh 2002-11-24 17:50:41.000000000 -0500
-@@ -8,3 +8,5 @@
-
- MMALLOC =
- MMALLOC_CFLAGS = -DNO_MMALLOC
-+
-+MH_CFLAGS = -mieee
-In CVS but not in 5.3 branch...
-
-2002-10-23 Daniel Jacobowitz <drow@mvista.com>
-
- * lin-lwp.c (lin_lwp_resume): Remove resume_all test for !step.
-
-Index: lin-lwp.c
-===================================================================
-RCS file: /cvs/src/src/gdb/lin-lwp.c,v
-retrieving revision 1.35
-diff -u -p -r1.35 lin-lwp.c
---- gdb-5.2.90/gdb/lin-lwp.c 27 Aug 2002 22:37:06 -0000 1.35
-+++ gdb-5.2.90/gdb/lin-lwp.c 23 Oct 2002 04:23:13 -0000
-@@ -579,11 +579,8 @@ lin_lwp_resume (ptid_t ptid, int step, e
- struct lwp_info *lp;
- int resume_all;
-
-- /* Apparently the interpretation of PID is dependent on STEP: If
-- STEP is non-zero, a specific PID means `step only this process
-- id'. But if STEP is zero, then PID means `continue *all*
-- processes, but give the signal only to this one'. */
-- resume_all = (PIDGET (ptid) == -1) || !step;
-+ /* A specific PTID means `step only this process id'. */
-+ resume_all = (PIDGET (ptid) == -1);
-
- if (resume_all)
- iterate_over_lwps (resume_set_callback, NULL);
-
-Not submitted yet, testing.
-
---- gdb-5.2.90/gdb/alpha-tdep.c.orig Sun Nov 24 21:42:53 2002
-+++ gdb-5.2.90/gdb/alpha-tdep.c Sun Nov 24 21:48:26 2002
-@@ -99,10 +99,12 @@
-
- static alpha_extra_func_info_t heuristic_proc_desc (CORE_ADDR,
- CORE_ADDR,
-- struct frame_info *);
-+ struct frame_info *,
-+ int);
-
- static alpha_extra_func_info_t find_proc_desc (CORE_ADDR,
-- struct frame_info *);
-+ struct frame_info *,
-+ int);
-
- #if 0
- static int alpha_in_lenient_prologue (CORE_ADDR, CORE_ADDR);
-@@ -512,7 +514,7 @@
- if (tmp != 0)
- pc = tmp;
-
-- proc_desc = find_proc_desc (pc, frame->next);
-+ proc_desc = find_proc_desc (pc, frame->next, 1);
- pcreg = proc_desc ? PROC_PC_REG (proc_desc) : ALPHA_RA_REGNUM;
-
- if (frame->signal_handler_caller)
-@@ -596,10 +598,10 @@
-
- static alpha_extra_func_info_t
- heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
-- struct frame_info *next_frame)
-+ struct frame_info *next_frame, int read_sp_p)
- {
-- CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
-- CORE_ADDR vfp = sp;
-+ CORE_ADDR sp;
-+ CORE_ADDR vfp;
- CORE_ADDR cur_pc;
- int frame_size;
- int has_frame_reg = 0;
-@@ -607,6 +609,11 @@
- int pcreg = -1;
- int regno;
-
-+ if (read_sp_p)
-+ vfp = sp = read_next_frame_reg (next_frame, SP_REGNUM);
-+ else
-+ vfp = sp = 0;
-+
- if (start_pc == 0)
- return NULL;
- memset (&temp_proc_desc, '\0', sizeof (temp_proc_desc));
-@@ -761,7 +768,7 @@
- CORE_ADDR func_addr, func_end;
-
- if (!proc_desc)
-- proc_desc = find_proc_desc (pc, NULL);
-+ proc_desc = find_proc_desc (pc, NULL, 0);
-
- if (proc_desc)
- {
-@@ -807,7 +814,7 @@
- }
-
- static alpha_extra_func_info_t
--find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame)
-+find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int read_sp_p)
- {
- alpha_extra_func_info_t proc_desc;
- struct block *b;
-@@ -879,7 +886,7 @@
- {
- alpha_extra_func_info_t found_heuristic =
- heuristic_proc_desc (PROC_LOW_ADDR (proc_desc),
-- pc, next_frame);
-+ pc, next_frame, read_sp_p);
- if (found_heuristic)
- {
- PROC_LOCALOFF (found_heuristic) =
-@@ -921,7 +928,7 @@
- startaddr = heuristic_proc_start (pc);
-
- proc_desc =
-- heuristic_proc_desc (startaddr, pc, next_frame);
-+ heuristic_proc_desc (startaddr, pc, next_frame, read_sp_p);
- }
- return proc_desc;
- }
-@@ -937,7 +944,7 @@
- if (saved_pc == 0 || inside_entry_file (saved_pc))
- return 0;
-
-- proc_desc = find_proc_desc (saved_pc, frame);
-+ proc_desc = find_proc_desc (saved_pc, frame, 1);
- if (!proc_desc)
- return 0;
-
-@@ -979,7 +986,7 @@
- {
- /* Use proc_desc calculated in frame_chain */
- alpha_extra_func_info_t proc_desc =
-- frame->next ? cached_proc_desc : find_proc_desc (frame->pc, frame->next);
-+ frame->next ? cached_proc_desc : find_proc_desc (frame->pc, frame->next, 1);
-
- frame->extra_info = (struct frame_extra_info *)
- frame_obstack_alloc (sizeof (struct frame_extra_info));
-@@ -1291,7 +1298,7 @@
- /* we need proc_desc to know how to restore the registers;
- if it is NULL, construct (a temporary) one */
- if (proc_desc == NULL)
-- proc_desc = find_proc_desc (frame->pc, frame->next);
-+ proc_desc = find_proc_desc (frame->pc, frame->next, 1);
-
- /* Question: should we copy this proc_desc and save it in
- frame->proc_desc? If we do, who will free it?
-Not yet submitted upstream. This requires some serious thinking about.
-If the target stack worked in any logical way, this wouldn't be necessary...
-ending up with roughly:
- thread_stratum: thread-db (silent reference to lin-lwp)
- core_stratum: corelow
- exec_stratum: exec
- dummy_stratum: dummy
-just makes no sense.
-
-This patch fixes debugging threaded applications which are statically linked
-without breaking debugging threaded core files. It also fixes the PIDs in
-generate-core-file'd corefiles. Mostly.
-
-diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/corelow.c gdb-5.2.debian90.cvs20021120/gdb/corelow.c
---- o/gdb-5.2.debian90.cvs20021120/gdb/corelow.c 2002-09-18 13:23:15.000000000 -0400
-+++ gdb-5.2.debian90.cvs20021120/gdb/corelow.c 2002-12-03 14:03:32.000000000 -0500
-@@ -350,7 +350,7 @@
- bfd_map_over_sections (core_bfd, add_to_thread_list,
- bfd_get_section_by_name (core_bfd, ".reg"));
-
-- if (ontop)
-+ if (ontop || 1)
- {
- /* Fetch all registers from core file. */
- target_fetch_registers (-1);
-diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c
---- o/gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c 2002-12-03 14:13:52.000000000 -0500
-+++ gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c 2002-12-03 13:56:34.000000000 -0500
-@@ -177,7 +177,7 @@
- #ifdef FILL_FPXREGSET
- gdb_fpxregset_t fpxregs;
- #endif
-- unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid);
-+ unsigned long merged_pid = ptid_get_tid (ptid) << 16; /* | ptid_get_pid (ptid); */
-
- fill_gregset (&gregs, -1);
- note_data = (char *) elfcore_write_prstatus (obfd,
-diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/target.c gdb-5.2.debian90.cvs20021120/gdb/target.c
---- o/gdb-5.2.debian90.cvs20021120/gdb/target.c 2002-09-18 13:23:22.000000000 -0400
-+++ gdb-5.2.debian90.cvs20021120/gdb/target.c 2002-12-03 14:06:07.000000000 -0500
-@@ -1589,6 +1589,7 @@
- dummy_target.to_find_memory_regions = dummy_find_memory_regions;
- dummy_target.to_make_corefile_notes = dummy_make_corefile_notes;
- dummy_target.to_magic = OPS_MAGIC;
-+ cleanup_target (&dummy_target);
- }
- \f
-
-diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/thread-db.c gdb-5.2.debian90.cvs20021120/gdb/thread-db.c
---- o/gdb-5.2.debian90.cvs20021120/gdb/thread-db.c 2002-12-03 14:13:50.000000000 -0500
-+++ gdb-5.2.debian90.cvs20021120/gdb/thread-db.c 2002-12-03 13:39:54.000000000 -0500
-@@ -57,6 +57,31 @@
- /* Non-zero if we're using this module's target vector. */
- static int using_thread_db;
-
-+/* Macros to pass an event to the next target if we should not be handling it
-+ here in the thread_stratum. */
-+#define FIND_NEXT_TARGET(METHOD_NAME) \
-+ struct target_ops *next_target = &thread_db_ops; \
-+ while (1) \
-+ { \
-+ next_target = find_target_beneath (next_target); \
-+ if (next_target->METHOD_NAME != NULL) \
-+ break; \
-+ }
-+
-+#define MAYBE_HAND_DOWN(METHOD_NAME,ARGS) \
-+ if (proc_handle.pid == 0) \
-+ { \
-+ FIND_NEXT_TARGET (METHOD_NAME); \
-+ (*next_target->METHOD_NAME) ARGS; \
-+ return; \
-+ }
-+#define MAYBE_HAND_DOWN_RETURN(METHOD_NAME,ARGS) \
-+ if (proc_handle.pid == 0) \
-+ { \
-+ FIND_NEXT_TARGET (METHOD_NAME); \
-+ return (*next_target->METHOD_NAME) ARGS; \
-+ }
-+
- /* Non-zero if we have to keep this module's target vector active
- across re-runs. */
- static int keep_thread_db;
-@@ -489,9 +514,7 @@
- {
- td_err_e err;
-
-- /* Don't attempt to use thread_db on targets which can not run
-- (core files). */
-- if (objfile == NULL || !target_has_execution)
-+ if (objfile == NULL)
- {
- /* All symbols have been discarded. If the thread_db target is
- active, deactivate it now. */
-@@ -515,7 +538,10 @@
- /* Initialize the structure that identifies the child process. Note
- that at this point there is no guarantee that we actually have a
- child process. */
-- proc_handle.pid = GET_PID (inferior_ptid);
-+ if (target_has_execution)
-+ proc_handle.pid = GET_PID (inferior_ptid);
-+ else
-+ proc_handle.pid = 0;
-
- /* Now attempt to open a connection to the thread library. */
- err = td_ta_new_p (&proc_handle, &thread_agent);
-@@ -758,6 +784,9 @@
- struct cleanup *old_chain = save_inferior_ptid ();
- int xfer;
-
-+ MAYBE_HAND_DOWN_RETURN (to_xfer_memory, (memaddr, myaddr, len, write,
-+ attrib, target));
-+
- if (is_thread (inferior_ptid))
- {
- /* FIXME: This seems to be necessary to make sure breakpoints
-@@ -782,6 +811,8 @@
- gdb_prfpregset_t fpregset;
- td_err_e err;
-
-+ MAYBE_HAND_DOWN (to_fetch_registers, (regno));
-+
- if (!is_thread (inferior_ptid))
- {
- /* Pass the request to the target beneath us. */
-@@ -819,6 +850,8 @@
- gdb_prfpregset_t fpregset;
- td_err_e err;
-
-+ MAYBE_HAND_DOWN (to_store_registers, (regno));
-+
- if (!is_thread (inferior_ptid))
- {
- /* Pass the request to the target beneath us. */
-@@ -908,6 +941,8 @@
- td_thrinfo_t ti;
- td_err_e err;
-
-+ MAYBE_HAND_DOWN_RETURN (to_thread_alive, (ptid));
-+
- if (is_thread (ptid))
- {
- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
-@@ -961,6 +996,8 @@
- {
- td_err_e err;
-
-+ MAYBE_HAND_DOWN (to_find_new_threads, ());
-+
- /* Iterate over all user-space threads to discover new threads. */
- err = td_ta_thr_iter_p (thread_agent, find_new_threads_callback, NULL,
- TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
-@@ -972,6 +1009,8 @@
- static char *
- thread_db_pid_to_str (ptid_t ptid)
- {
-+ MAYBE_HAND_DOWN_RETURN (to_pid_to_str, (ptid));
-+
- if (is_thread (ptid))
- {
- static char buf[64];
-Trivial. Need to submit this.
-
---- gdb-5.2.debian90.cvs20021120/gdb/tracepoint.c.orig 2002-12-03 14:35:44.000000000 -0500
-+++ gdb-5.2.debian90.cvs20021120/gdb/tracepoint.c 2002-12-03 14:43:02.000000000 -0500
-@@ -861,6 +861,8 @@
- else
- line = gdb_readline (0);
-
-+ if (line == NULL || *line == EOF)
-+ break;
- linetype = validate_actionline (&line, t);
- if (linetype == BADLINE)
- continue; /* already warned -- collect another line */
-Fix build on Sparc.
-
---- gdb-5.3/gdb/sparc-nat.c.orig 2003-01-04 00:11:28.000000000 -0500
-+++ gdb-5.3/gdb/sparc-nat.c 2003-01-04 00:12:42.000000000 -0500
-@@ -33,6 +33,13 @@
- #include <sys/ptrace.h>
- #include <sys/wait.h>
- #ifdef __linux__
-+/* Sadly, <sys/ucontext.h> conflicts with <asm/reg.h> on Linux. And
-+ -D_GNU_SOURCE brings in <sys/ucontext.h> implicitly with <signal.h>.
-+ Hack around this. */
-+#undef FPU_REGS_TYPE
-+#define fpu asm_reg_fpu
-+#define fq asm_reg_fq
-+#define fpq asm_reg_fpq
- #include <asm/reg.h>
- #else
- #include <machine/reg.h>
-diff -urN gdb-5.3/gdb/gdbserver.orig/gdbreplay.c gdb-5.3/gdb/gdbserver/gdbreplay.c
---- gdb-5.3/gdb/gdbserver.orig/gdbreplay.c 2002-07-09 11:38:58.000000000 -0600
-+++ gdb-5.3/gdb/gdbserver/gdbreplay.c 2003-08-20 08:44:20.000000000 -0600
-@@ -54,14 +54,15 @@
- perror_with_name (char *string)
- {
- #ifndef STDC_HEADERS
-- extern int sys_nerr;
- extern char *sys_errlist[];
- extern int errno;
- #endif
- const char *err;
- char *combined;
-
-- err = (errno < sys_nerr) ? sys_errlist[errno] : "unknown error";
-+ err = strerror (errno);
-+ if (err == NULL)
-+ err = "unknown error";
- combined = (char *) alloca (strlen (err) + strlen (string) + 3);
- strcpy (combined, string);
- strcat (combined, ": ");
-diff -urN gdb-5.3/gdb/gdbserver.orig/low-hppabsd.c gdb-5.3/gdb/gdbserver/low-hppabsd.c
---- gdb-5.3/gdb/gdbserver.orig/low-hppabsd.c 2002-01-17 14:13:49.000000000 -0700
-+++ gdb-5.3/gdb/gdbserver/low-hppabsd.c 2003-08-20 08:46:04.000000000 -0600
-@@ -61,7 +61,7 @@
- execv (program, allargs);
-
- fprintf (stderr, "Cannot exec %s: %s.\n", program,
-- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
-+ strerror (errno));
- fflush (stderr);
- _exit (0177);
- }
-diff -urN gdb-5.3/gdb/gdbserver.orig/low-lynx.c gdb-5.3/gdb/gdbserver/low-lynx.c
---- gdb-5.3/gdb/gdbserver.orig/low-lynx.c 2002-01-17 14:13:49.000000000 -0700
-+++ gdb-5.3/gdb/gdbserver/low-lynx.c 2003-08-20 08:46:18.000000000 -0600
-@@ -79,7 +79,7 @@
-
- fprintf (stderr, "GDBserver (process %d): Cannot exec %s: %s.\n",
- getpid (), program,
-- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
-+ strerror (errno));
- fflush (stderr);
- _exit (0177);
- }
-diff -urN gdb-5.3/gdb/gdbserver.orig/low-nbsd.c gdb-5.3/gdb/gdbserver/low-nbsd.c
---- gdb-5.3/gdb/gdbserver.orig/low-nbsd.c 2002-01-17 14:13:49.000000000 -0700
-+++ gdb-5.3/gdb/gdbserver/low-nbsd.c 2003-08-20 08:46:27.000000000 -0600
-@@ -137,7 +137,7 @@
- execv (program, allargs);
-
- fprintf (stderr, "Cannot exec %s: %s.\n", program,
-- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
-+ strerror (errno));
- fflush (stderr);
- _exit (0177);
- }
-diff -urN gdb-5.3/gdb/gdbserver.orig/low-sparc.c gdb-5.3/gdb/gdbserver/low-sparc.c
---- gdb-5.3/gdb/gdbserver.orig/low-sparc.c 2002-01-17 14:13:50.000000000 -0700
-+++ gdb-5.3/gdb/gdbserver/low-sparc.c 2003-08-20 08:46:38.000000000 -0600
-@@ -44,7 +44,6 @@
- #include <sys/ptrace.h>
- #include <sys/reg.h>
-
--extern int sys_nerr;
- extern char **sys_errlist;
- extern int errno;
-
-@@ -67,7 +66,7 @@
- execv (program, allargs);
-
- fprintf (stderr, "Cannot exec %s: %s.\n", program,
-- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
-+ strerror (errno));
- fflush (stderr);
- _exit (0177);
- }
-diff -urN gdb-5.3/gdb/gdbserver.orig/low-sun3.c gdb-5.3/gdb/gdbserver/low-sun3.c
---- gdb-5.3/gdb/gdbserver.orig/low-sun3.c 2002-01-17 14:13:50.000000000 -0700
-+++ gdb-5.3/gdb/gdbserver/low-sun3.c 2003-08-20 08:46:51.000000000 -0600
-@@ -41,7 +41,6 @@
- #include <sys/ptrace.h>
- #include <machine/reg.h>
-
--extern int sys_nerr;
- extern char **sys_errlist;
- extern int errno;
-
-@@ -64,7 +63,7 @@
- execv (program, allargs);
-
- fprintf (stderr, "Cannot exec %s: %s.\n", program,
-- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
-+ strerror (errno));
- fflush (stderr);
- _exit (0177);
- }
-diff -urN gdb-5.3/gdb/gdbserver.orig/utils.c gdb-5.3/gdb/gdbserver/utils.c
---- gdb-5.3/gdb/gdbserver.orig/utils.c 2003-08-20 08:47:56.000000000 -0600
-+++ gdb-5.3/gdb/gdbserver/utils.c 2003-08-20 08:48:15.000000000 -0600
-@@ -33,16 +33,13 @@
- perror_with_name (char *string)
- {
- #ifndef STDC_HEADERS
-- extern int sys_nerr;
-- extern char *sys_errlist[];
- extern int errno;
- #endif
- const char *err;
- char *combined;
-
-- if (errno < sys_nerr)
-- err = sys_errlist[errno];
-- else
-+ err = strerror (errno);
-+ if (err == NULL)
- err = "unknown error";
-
- combined = (char *) alloca (strlen (err) + strlen (string) + 3);
-diff -urN gdb-5.3/gdb/gdbserver.orig/linux-low.c.orig gdb-5.3/gdb/gdbserver/linux-low.c.orig
---- gdb-5.3/gdb/gdbserver.orig/linux-low.c 2003-08-20 08:40:27.000000000 -0600
-+++ gdb-5.3/gdb/gdbserver/linux-low.c 2003-08-20 08:44:54.000000000 -0600
-@@ -175,8 +175,7 @@
- if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0)
- {
- fprintf (stderr, "Cannot attach to process %d: %s (%d)\n", pid,
-- errno < sys_nerr ? sys_errlist[errno] : "unknown error",
-- errno);
-+ strerror (errno), errno);
- fflush (stderr);
-
- /* If we fail to attach to an LWP, just return. */
-
--- /dev/null
+Patch pending upstream, probably acceptable.
+--------------------------------------------
+
+
+
+Daniel Jacobowitz <drow@mvista.com> writes:
+> I like this. The way func_frame_chain_valid should really be used is
+> by something like:
+>
+> /* NOTE: tm-i386nw.h and tm-i386v4.h override this. */
+> set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
+>
+> (copied from i386-tdep.c).
+>
+> Does this patch work for you?
+
+Yes, thanks. I've included a revised version of my patch below.
+
+> I'm curious as to why we can't just set this universally, or at least a
+> little more globally. Most things that have a main () use it as a
+> normal main (). I'd propose that we set it as the default frame chain,
+> and provide/document an option to ignore inside_main_func.
+
+Well, gdbarch is never supposed to change the default behavior of
+macros; this helps us convert pre-gdbarch targets incrementally.
+Simply turning on gdbarch for one's target ideally wouldn't change its
+behavior at all.
+
+
+[Patch revised for Debian snapshot]
+--- snap/gdb/i386-linux-tdep.c.orig 2002-08-18 19:53:57.000000000 -0400
++++ snap/gdb/i386-linux-tdep.c 2002-08-18 19:54:31.000000000 -0400
+@@ -452,6 +452,9 @@
+
+ set_solib_svr4_fetch_link_map_offsets (gdbarch,
+ i386_linux_svr4_fetch_link_map_offsets);
++
++ set_gdbarch_frame_chain_valid (gdbarch,
++ generic_func_frame_chain_valid);
+ }
+
+ /* Provide a prototype to silence -Wmissing-prototypes. */
+[Hurd needs 6. Take 8, since it does no real harm.]
+
+
+Package: gdb
+Severity: normal
+Tags: patch, sid
+
+Hello,
+
+GDB will crash on the Hurd after issuing the 'show' and hitting enter
+a few times:
+
+../../gdb/ui-out.c:130: gdb-internal-error: push_level: Assertion +`uiout->level >= 0 && uiout->level < MAX_UI_OUT_LEVELS' failed.
+
+the problem is that MAX_UI_OUT_LEVELS is not high enough for the extra
+option we have on the Hurd, it should be rised to 6 then, which works
+fine:
+
+--- gdb-5.2.cvs20020401/gdb/ui-out.c~ Fri May 3 02:19:20 2002
++++ gdb-5.2.cvs20020401/gdb/ui-out.c Fri May 3 02:19:32 2002
+@@ -45,7 +45,7 @@
+ is always available. Stack/nested level 0 is reserved for the
+ top-level result. */
+
+-enum { MAX_UI_OUT_LEVELS = 5 };
++enum { MAX_UI_OUT_LEVELS = 8 };
+
+ struct ui_out_level
+ {
+
+--
+Robert Millan
+
+"5 years from now everyone will be running
+free GNU on their 200 MIPS, 64M SPARCstation-5"
+
+ Andrew S. Tanenbaum, 30 Jan 1992
+
+
+Submitted upstream, not liked very much. It's a hack, but it will do for
+now.
+
+2002-07-31 Daniel Jacobowitz <drow@mvista.com>
+
+ Fix PR gdb/568
+ * thread-db.c (lwp_from_thread): Only warn if unable to find
+ the thread.
+
+Index: thread-db.c
+===================================================================
+RCS file: /cvs/src/src/gdb/thread-db.c,v
+retrieving revision 1.22
+diff -u -p -r1.22 thread-db.c
+--- gdb/gdb/thread-db.c 23 Mar 2002 17:38:13 -0000 1.22
++++ gdb/gdb/thread-db.c 31 Jul 2002 16:29:52 -0000
+@@ -260,6 +260,12 @@ lwp_from_thread (ptid_t ptid)
+ return ptid;
+
+ err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
++ if (err == TD_ERR)
++ {
++ warning ("Cannot find thread %ld: %s",
++ (long) GET_THREAD (ptid), thread_db_err_str (err));
++ return ptid;
++ }
+ if (err != TD_OK)
+ error ("Cannot find thread %ld: %s",
+ (long) GET_THREAD (ptid), thread_db_err_str (err));
+From Michael Fedrowitz <michaelf@debian.org>. Not submitted to FSF yet.
+
+ Hi,
+
+gdb fails to build from source on m68k because some definitions have
+been removed from tm-m68k.h. The patch below readds them.
+
+-Michael
+
+
+diff -urN gdb-5.2.cvs20020818.orig/gdb/config/m68k/tm-m68k.h gdb-5.2.cvs20020818/gdb/config/m68k/tm-m68k.h
+--- gdb-5.2.cvs20020818.orig/gdb/config/m68k/tm-m68k.h 2002-07-10 19:01:38.000000000 +0200
++++ gdb-5.2.cvs20020818/gdb/config/m68k/tm-m68k.h 2002-10-06 18:01:59.000000000 +0200
+@@ -26,8 +26,11 @@
+ /* Generic 68000 stuff, to be included by other tm-*.h files. */
+
+ /* D0_REGNM and A0_REGNUM must be defined here because they are
+- used by the monitor. */
++ used by the monitor. FPC_REGNUM, FPS_REGNUM and FPI_REGNUM are
++ defined here because they are used by m68klinux-nat.c. */
+
+ #define D0_REGNUM 0
+ #define A0_REGNUM 8
+-
++#define FPC_REGNUM 26
++#define FPS_REGNUM 27
++#define FPI_REGNUM 28
+
+
+2002-11-24 Daniel Jacobowitz <drow@mvista.com>
+
+ * doublest.c (convert_floatformat_to_doublest): Cast exp_bias to int.
+ * config/alpha/alpha-linux.mh (MH_CFLAGS): Add -mieee.
+
+--- gdb-5.2.debian90.cvs20021120/gdb/doublest.c.orig 2002-11-24 17:48:16.000000000 -0500
++++ gdb-5.2.debian90.cvs20021120/gdb/doublest.c 2002-11-24 17:48:25.000000000 -0500
+@@ -177,7 +177,7 @@
+ if (!special_exponent)
+ exponent -= fmt->exp_bias;
+ else if (exponent == 0)
+- exponent = 1 - fmt->exp_bias;
++ exponent = 1 - (int)fmt->exp_bias;
+
+ /* Build the result algebraically. Might go infinite, underflow, etc;
+ who cares. */
+--- gdb-5.2.debian90.cvs20021120/gdb/config/alpha/alpha-linux.mh.orig 2002-11-24 17:50:30.000000000 -0500
++++ gdb-5.2.debian90.cvs20021120/gdb/config/alpha/alpha-linux.mh 2002-11-24 17:50:41.000000000 -0500
+@@ -8,3 +8,5 @@
+
+ MMALLOC =
+ MMALLOC_CFLAGS = -DNO_MMALLOC
++
++MH_CFLAGS = -mieee
+In CVS but not in 5.3 branch...
+
+2002-10-23 Daniel Jacobowitz <drow@mvista.com>
+
+ * lin-lwp.c (lin_lwp_resume): Remove resume_all test for !step.
+
+Index: lin-lwp.c
+===================================================================
+RCS file: /cvs/src/src/gdb/lin-lwp.c,v
+retrieving revision 1.35
+diff -u -p -r1.35 lin-lwp.c
+--- gdb-5.2.90/gdb/lin-lwp.c 27 Aug 2002 22:37:06 -0000 1.35
++++ gdb-5.2.90/gdb/lin-lwp.c 23 Oct 2002 04:23:13 -0000
+@@ -579,11 +579,8 @@ lin_lwp_resume (ptid_t ptid, int step, e
+ struct lwp_info *lp;
+ int resume_all;
+
+- /* Apparently the interpretation of PID is dependent on STEP: If
+- STEP is non-zero, a specific PID means `step only this process
+- id'. But if STEP is zero, then PID means `continue *all*
+- processes, but give the signal only to this one'. */
+- resume_all = (PIDGET (ptid) == -1) || !step;
++ /* A specific PTID means `step only this process id'. */
++ resume_all = (PIDGET (ptid) == -1);
+
+ if (resume_all)
+ iterate_over_lwps (resume_set_callback, NULL);
+
+Not submitted yet, testing.
+
+--- gdb-5.2.90/gdb/alpha-tdep.c.orig Sun Nov 24 21:42:53 2002
++++ gdb-5.2.90/gdb/alpha-tdep.c Sun Nov 24 21:48:26 2002
+@@ -99,10 +99,12 @@
+
+ static alpha_extra_func_info_t heuristic_proc_desc (CORE_ADDR,
+ CORE_ADDR,
+- struct frame_info *);
++ struct frame_info *,
++ int);
+
+ static alpha_extra_func_info_t find_proc_desc (CORE_ADDR,
+- struct frame_info *);
++ struct frame_info *,
++ int);
+
+ #if 0
+ static int alpha_in_lenient_prologue (CORE_ADDR, CORE_ADDR);
+@@ -512,7 +514,7 @@
+ if (tmp != 0)
+ pc = tmp;
+
+- proc_desc = find_proc_desc (pc, frame->next);
++ proc_desc = find_proc_desc (pc, frame->next, 1);
+ pcreg = proc_desc ? PROC_PC_REG (proc_desc) : ALPHA_RA_REGNUM;
+
+ if (frame->signal_handler_caller)
+@@ -596,10 +598,10 @@
+
+ static alpha_extra_func_info_t
+ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
+- struct frame_info *next_frame)
++ struct frame_info *next_frame, int read_sp_p)
+ {
+- CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
+- CORE_ADDR vfp = sp;
++ CORE_ADDR sp;
++ CORE_ADDR vfp;
+ CORE_ADDR cur_pc;
+ int frame_size;
+ int has_frame_reg = 0;
+@@ -607,6 +609,11 @@
+ int pcreg = -1;
+ int regno;
+
++ if (read_sp_p)
++ vfp = sp = read_next_frame_reg (next_frame, SP_REGNUM);
++ else
++ vfp = sp = 0;
++
+ if (start_pc == 0)
+ return NULL;
+ memset (&temp_proc_desc, '\0', sizeof (temp_proc_desc));
+@@ -761,7 +768,7 @@
+ CORE_ADDR func_addr, func_end;
+
+ if (!proc_desc)
+- proc_desc = find_proc_desc (pc, NULL);
++ proc_desc = find_proc_desc (pc, NULL, 0);
+
+ if (proc_desc)
+ {
+@@ -807,7 +814,7 @@
+ }
+
+ static alpha_extra_func_info_t
+-find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame)
++find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int read_sp_p)
+ {
+ alpha_extra_func_info_t proc_desc;
+ struct block *b;
+@@ -879,7 +886,7 @@
+ {
+ alpha_extra_func_info_t found_heuristic =
+ heuristic_proc_desc (PROC_LOW_ADDR (proc_desc),
+- pc, next_frame);
++ pc, next_frame, read_sp_p);
+ if (found_heuristic)
+ {
+ PROC_LOCALOFF (found_heuristic) =
+@@ -921,7 +928,7 @@
+ startaddr = heuristic_proc_start (pc);
+
+ proc_desc =
+- heuristic_proc_desc (startaddr, pc, next_frame);
++ heuristic_proc_desc (startaddr, pc, next_frame, read_sp_p);
+ }
+ return proc_desc;
+ }
+@@ -937,7 +944,7 @@
+ if (saved_pc == 0 || inside_entry_file (saved_pc))
+ return 0;
+
+- proc_desc = find_proc_desc (saved_pc, frame);
++ proc_desc = find_proc_desc (saved_pc, frame, 1);
+ if (!proc_desc)
+ return 0;
+
+@@ -979,7 +986,7 @@
+ {
+ /* Use proc_desc calculated in frame_chain */
+ alpha_extra_func_info_t proc_desc =
+- frame->next ? cached_proc_desc : find_proc_desc (frame->pc, frame->next);
++ frame->next ? cached_proc_desc : find_proc_desc (frame->pc, frame->next, 1);
+
+ frame->extra_info = (struct frame_extra_info *)
+ frame_obstack_alloc (sizeof (struct frame_extra_info));
+@@ -1291,7 +1298,7 @@
+ /* we need proc_desc to know how to restore the registers;
+ if it is NULL, construct (a temporary) one */
+ if (proc_desc == NULL)
+- proc_desc = find_proc_desc (frame->pc, frame->next);
++ proc_desc = find_proc_desc (frame->pc, frame->next, 1);
+
+ /* Question: should we copy this proc_desc and save it in
+ frame->proc_desc? If we do, who will free it?
+Not yet submitted upstream. This requires some serious thinking about.
+If the target stack worked in any logical way, this wouldn't be necessary...
+ending up with roughly:
+ thread_stratum: thread-db (silent reference to lin-lwp)
+ core_stratum: corelow
+ exec_stratum: exec
+ dummy_stratum: dummy
+just makes no sense.
+
+This patch fixes debugging threaded applications which are statically linked
+without breaking debugging threaded core files. It also fixes the PIDs in
+generate-core-file'd corefiles. Mostly.
+
+diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/corelow.c gdb-5.2.debian90.cvs20021120/gdb/corelow.c
+--- o/gdb-5.2.debian90.cvs20021120/gdb/corelow.c 2002-09-18 13:23:15.000000000 -0400
++++ gdb-5.2.debian90.cvs20021120/gdb/corelow.c 2002-12-03 14:03:32.000000000 -0500
+@@ -350,7 +350,7 @@
+ bfd_map_over_sections (core_bfd, add_to_thread_list,
+ bfd_get_section_by_name (core_bfd, ".reg"));
+
+- if (ontop)
++ if (ontop || 1)
+ {
+ /* Fetch all registers from core file. */
+ target_fetch_registers (-1);
+diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c
+--- o/gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c 2002-12-03 14:13:52.000000000 -0500
++++ gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c 2002-12-03 13:56:34.000000000 -0500
+@@ -177,7 +177,7 @@
+ #ifdef FILL_FPXREGSET
+ gdb_fpxregset_t fpxregs;
+ #endif
+- unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid);
++ unsigned long merged_pid = ptid_get_tid (ptid) << 16; /* | ptid_get_pid (ptid); */
+
+ fill_gregset (&gregs, -1);
+ note_data = (char *) elfcore_write_prstatus (obfd,
+diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/target.c gdb-5.2.debian90.cvs20021120/gdb/target.c
+--- o/gdb-5.2.debian90.cvs20021120/gdb/target.c 2002-09-18 13:23:22.000000000 -0400
++++ gdb-5.2.debian90.cvs20021120/gdb/target.c 2002-12-03 14:06:07.000000000 -0500
+@@ -1589,6 +1589,7 @@
+ dummy_target.to_find_memory_regions = dummy_find_memory_regions;
+ dummy_target.to_make_corefile_notes = dummy_make_corefile_notes;
+ dummy_target.to_magic = OPS_MAGIC;
++ cleanup_target (&dummy_target);
+ }
+ \f
+
+diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/thread-db.c gdb-5.2.debian90.cvs20021120/gdb/thread-db.c
+--- o/gdb-5.2.debian90.cvs20021120/gdb/thread-db.c 2002-12-03 14:13:50.000000000 -0500
++++ gdb-5.2.debian90.cvs20021120/gdb/thread-db.c 2002-12-03 13:39:54.000000000 -0500
+@@ -57,6 +57,31 @@
+ /* Non-zero if we're using this module's target vector. */
+ static int using_thread_db;
+
++/* Macros to pass an event to the next target if we should not be handling it
++ here in the thread_stratum. */
++#define FIND_NEXT_TARGET(METHOD_NAME) \
++ struct target_ops *next_target = &thread_db_ops; \
++ while (1) \
++ { \
++ next_target = find_target_beneath (next_target); \
++ if (next_target->METHOD_NAME != NULL) \
++ break; \
++ }
++
++#define MAYBE_HAND_DOWN(METHOD_NAME,ARGS) \
++ if (proc_handle.pid == 0) \
++ { \
++ FIND_NEXT_TARGET (METHOD_NAME); \
++ (*next_target->METHOD_NAME) ARGS; \
++ return; \
++ }
++#define MAYBE_HAND_DOWN_RETURN(METHOD_NAME,ARGS) \
++ if (proc_handle.pid == 0) \
++ { \
++ FIND_NEXT_TARGET (METHOD_NAME); \
++ return (*next_target->METHOD_NAME) ARGS; \
++ }
++
+ /* Non-zero if we have to keep this module's target vector active
+ across re-runs. */
+ static int keep_thread_db;
+@@ -489,9 +514,7 @@
+ {
+ td_err_e err;
+
+- /* Don't attempt to use thread_db on targets which can not run
+- (core files). */
+- if (objfile == NULL || !target_has_execution)
++ if (objfile == NULL)
+ {
+ /* All symbols have been discarded. If the thread_db target is
+ active, deactivate it now. */
+@@ -515,7 +538,10 @@
+ /* Initialize the structure that identifies the child process. Note
+ that at this point there is no guarantee that we actually have a
+ child process. */
+- proc_handle.pid = GET_PID (inferior_ptid);
++ if (target_has_execution)
++ proc_handle.pid = GET_PID (inferior_ptid);
++ else
++ proc_handle.pid = 0;
+
+ /* Now attempt to open a connection to the thread library. */
+ err = td_ta_new_p (&proc_handle, &thread_agent);
+@@ -758,6 +784,9 @@
+ struct cleanup *old_chain = save_inferior_ptid ();
+ int xfer;
+
++ MAYBE_HAND_DOWN_RETURN (to_xfer_memory, (memaddr, myaddr, len, write,
++ attrib, target));
++
+ if (is_thread (inferior_ptid))
+ {
+ /* FIXME: This seems to be necessary to make sure breakpoints
+@@ -782,6 +811,8 @@
+ gdb_prfpregset_t fpregset;
+ td_err_e err;
+
++ MAYBE_HAND_DOWN (to_fetch_registers, (regno));
++
+ if (!is_thread (inferior_ptid))
+ {
+ /* Pass the request to the target beneath us. */
+@@ -819,6 +850,8 @@
+ gdb_prfpregset_t fpregset;
+ td_err_e err;
+
++ MAYBE_HAND_DOWN (to_store_registers, (regno));
++
+ if (!is_thread (inferior_ptid))
+ {
+ /* Pass the request to the target beneath us. */
+@@ -908,6 +941,8 @@
+ td_thrinfo_t ti;
+ td_err_e err;
+
++ MAYBE_HAND_DOWN_RETURN (to_thread_alive, (ptid));
++
+ if (is_thread (ptid))
+ {
+ err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
+@@ -961,6 +996,8 @@
+ {
+ td_err_e err;
+
++ MAYBE_HAND_DOWN (to_find_new_threads, ());
++
+ /* Iterate over all user-space threads to discover new threads. */
+ err = td_ta_thr_iter_p (thread_agent, find_new_threads_callback, NULL,
+ TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
+@@ -972,6 +1009,8 @@
+ static char *
+ thread_db_pid_to_str (ptid_t ptid)
+ {
++ MAYBE_HAND_DOWN_RETURN (to_pid_to_str, (ptid));
++
+ if (is_thread (ptid))
+ {
+ static char buf[64];
+Trivial. Need to submit this.
+
+--- gdb-5.2.debian90.cvs20021120/gdb/tracepoint.c.orig 2002-12-03 14:35:44.000000000 -0500
++++ gdb-5.2.debian90.cvs20021120/gdb/tracepoint.c 2002-12-03 14:43:02.000000000 -0500
+@@ -861,6 +861,8 @@
+ else
+ line = gdb_readline (0);
+
++ if (line == NULL || *line == EOF)
++ break;
+ linetype = validate_actionline (&line, t);
+ if (linetype == BADLINE)
+ continue; /* already warned -- collect another line */
+Fix build on Sparc.
+
+--- gdb-5.3/gdb/sparc-nat.c.orig 2003-01-04 00:11:28.000000000 -0500
++++ gdb-5.3/gdb/sparc-nat.c 2003-01-04 00:12:42.000000000 -0500
+@@ -33,6 +33,13 @@
+ #include <sys/ptrace.h>
+ #include <sys/wait.h>
+ #ifdef __linux__
++/* Sadly, <sys/ucontext.h> conflicts with <asm/reg.h> on Linux. And
++ -D_GNU_SOURCE brings in <sys/ucontext.h> implicitly with <signal.h>.
++ Hack around this. */
++#undef FPU_REGS_TYPE
++#define fpu asm_reg_fpu
++#define fq asm_reg_fq
++#define fpq asm_reg_fpq
+ #include <asm/reg.h>
+ #else
+ #include <machine/reg.h>
+diff -urN gdb-5.3/gdb/gdbserver.orig/gdbreplay.c gdb-5.3/gdb/gdbserver/gdbreplay.c
+--- gdb-5.3/gdb/gdbserver.orig/gdbreplay.c 2002-07-09 11:38:58.000000000 -0600
++++ gdb-5.3/gdb/gdbserver/gdbreplay.c 2003-08-20 08:44:20.000000000 -0600
+@@ -54,14 +54,15 @@
+ perror_with_name (char *string)
+ {
+ #ifndef STDC_HEADERS
+- extern int sys_nerr;
+ extern char *sys_errlist[];
+ extern int errno;
+ #endif
+ const char *err;
+ char *combined;
+
+- err = (errno < sys_nerr) ? sys_errlist[errno] : "unknown error";
++ err = strerror (errno);
++ if (err == NULL)
++ err = "unknown error";
+ combined = (char *) alloca (strlen (err) + strlen (string) + 3);
+ strcpy (combined, string);
+ strcat (combined, ": ");
+diff -urN gdb-5.3/gdb/gdbserver.orig/low-hppabsd.c gdb-5.3/gdb/gdbserver/low-hppabsd.c
+--- gdb-5.3/gdb/gdbserver.orig/low-hppabsd.c 2002-01-17 14:13:49.000000000 -0700
++++ gdb-5.3/gdb/gdbserver/low-hppabsd.c 2003-08-20 08:46:04.000000000 -0600
+@@ -61,7 +61,7 @@
+ execv (program, allargs);
+
+ fprintf (stderr, "Cannot exec %s: %s.\n", program,
+- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
++ strerror (errno));
+ fflush (stderr);
+ _exit (0177);
+ }
+diff -urN gdb-5.3/gdb/gdbserver.orig/low-lynx.c gdb-5.3/gdb/gdbserver/low-lynx.c
+--- gdb-5.3/gdb/gdbserver.orig/low-lynx.c 2002-01-17 14:13:49.000000000 -0700
++++ gdb-5.3/gdb/gdbserver/low-lynx.c 2003-08-20 08:46:18.000000000 -0600
+@@ -79,7 +79,7 @@
+
+ fprintf (stderr, "GDBserver (process %d): Cannot exec %s: %s.\n",
+ getpid (), program,
+- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
++ strerror (errno));
+ fflush (stderr);
+ _exit (0177);
+ }
+diff -urN gdb-5.3/gdb/gdbserver.orig/low-nbsd.c gdb-5.3/gdb/gdbserver/low-nbsd.c
+--- gdb-5.3/gdb/gdbserver.orig/low-nbsd.c 2002-01-17 14:13:49.000000000 -0700
++++ gdb-5.3/gdb/gdbserver/low-nbsd.c 2003-08-20 08:46:27.000000000 -0600
+@@ -137,7 +137,7 @@
+ execv (program, allargs);
+
+ fprintf (stderr, "Cannot exec %s: %s.\n", program,
+- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
++ strerror (errno));
+ fflush (stderr);
+ _exit (0177);
+ }
+diff -urN gdb-5.3/gdb/gdbserver.orig/low-sparc.c gdb-5.3/gdb/gdbserver/low-sparc.c
+--- gdb-5.3/gdb/gdbserver.orig/low-sparc.c 2002-01-17 14:13:50.000000000 -0700
++++ gdb-5.3/gdb/gdbserver/low-sparc.c 2003-08-20 08:46:38.000000000 -0600
+@@ -44,7 +44,6 @@
+ #include <sys/ptrace.h>
+ #include <sys/reg.h>
+
+-extern int sys_nerr;
+ extern char **sys_errlist;
+ extern int errno;
+
+@@ -67,7 +66,7 @@
+ execv (program, allargs);
+
+ fprintf (stderr, "Cannot exec %s: %s.\n", program,
+- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
++ strerror (errno));
+ fflush (stderr);
+ _exit (0177);
+ }
+diff -urN gdb-5.3/gdb/gdbserver.orig/low-sun3.c gdb-5.3/gdb/gdbserver/low-sun3.c
+--- gdb-5.3/gdb/gdbserver.orig/low-sun3.c 2002-01-17 14:13:50.000000000 -0700
++++ gdb-5.3/gdb/gdbserver/low-sun3.c 2003-08-20 08:46:51.000000000 -0600
+@@ -41,7 +41,6 @@
+ #include <sys/ptrace.h>
+ #include <machine/reg.h>
+
+-extern int sys_nerr;
+ extern char **sys_errlist;
+ extern int errno;
+
+@@ -64,7 +63,7 @@
+ execv (program, allargs);
+
+ fprintf (stderr, "Cannot exec %s: %s.\n", program,
+- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
++ strerror (errno));
+ fflush (stderr);
+ _exit (0177);
+ }
+diff -urN gdb-5.3/gdb/gdbserver.orig/utils.c gdb-5.3/gdb/gdbserver/utils.c
+--- gdb-5.3/gdb/gdbserver.orig/utils.c 2003-08-20 08:47:56.000000000 -0600
++++ gdb-5.3/gdb/gdbserver/utils.c 2003-08-20 08:48:15.000000000 -0600
+@@ -33,16 +33,13 @@
+ perror_with_name (char *string)
+ {
+ #ifndef STDC_HEADERS
+- extern int sys_nerr;
+- extern char *sys_errlist[];
+ extern int errno;
+ #endif
+ const char *err;
+ char *combined;
+
+- if (errno < sys_nerr)
+- err = sys_errlist[errno];
+- else
++ err = strerror (errno);
++ if (err == NULL)
+ err = "unknown error";
+
+ combined = (char *) alloca (strlen (err) + strlen (string) + 3);
+diff -urN gdb-5.3/gdb/gdbserver.orig/linux-low.c.orig gdb-5.3/gdb/gdbserver/linux-low.c.orig
+--- gdb-5.3/gdb/gdbserver.orig/linux-low.c 2003-08-20 08:40:27.000000000 -0600
++++ gdb-5.3/gdb/gdbserver/linux-low.c 2003-08-20 08:44:54.000000000 -0600
+@@ -175,8 +175,7 @@
+ if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0)
+ {
+ fprintf (stderr, "Cannot attach to process %d: %s (%d)\n", pid,
+- errno < sys_nerr ? sys_errlist[errno] : "unknown error",
+- errno);
++ strerror (errno), errno);
+ fflush (stderr);
+
+ /* If we fail to attach to an LWP, just return. */
+
--- /dev/null
+diff -urN gdb-5.3/bfd/config.bfd gdb-5.3-new/bfd/config.bfd
+--- gdb-5.3/bfd/config.bfd 2002-09-05 15:34:35.000000000 -0500
++++ gdb-5.3-new/bfd/config.bfd 2004-01-11 06:25:31.000000000 -0600
+@@ -83,7 +83,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -97,7 +97,8 @@
+ targ_defvec=bfd_elf64_ia64_aix_little_vec
+ targ_selvecs="bfd_elf64_ia64_aix_big_vec bfd_efi_app_ia64_vec"
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | \
++ ia64*-*-linux-uclibc* | ia64*-*-elf*)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -176,11 +177,12 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*)
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \
++ arm*-*-conix* | arm*-*-uclinux*)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+@@ -313,7 +315,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -324,7 +326,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu*)
++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -424,7 +426,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3456]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -438,7 +440,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -589,7 +591,7 @@
+ targ_defvec=hp300hpux_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux*aout*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ targ_defvec=m68klinux_vec
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+@@ -865,7 +867,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
++ powerpc-*-rtems* | \
+ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+@@ -887,8 +890,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcqnx_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1038,7 +1041,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1081,7 +1084,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+diff -urN gdb-5.3/bfd/configure gdb-5.3-new/bfd/configure
+--- gdb-5.3/bfd/configure 2002-08-28 05:38:44.000000000 -0500
++++ gdb-5.3-new/bfd/configure 2004-01-11 06:27:15.000000000 -0600
+@@ -1677,6 +1677,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5067,7 +5072,7 @@
+ alpha*-*-freebsd*)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5126,7 +5131,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3456]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
--- /dev/null
+diff -urN gdb-6.1.1-dist/bfd/config.bfd gdb-6.1.1/bfd/config.bfd
+--- gdb-6.1.1-dist/bfd/config.bfd 2004-03-13 06:37:09.000000000 -0600
++++ gdb-6.1.1/bfd/config.bfd 2004-08-08 05:01:47.000000000 -0500
+@@ -121,7 +121,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -131,7 +131,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu | ia64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -208,7 +208,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -216,7 +216,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
+ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+@@ -350,7 +350,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -361,7 +361,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-netbsd* | hppa*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -483,7 +483,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -497,7 +497,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -667,7 +667,7 @@
+ targ_defvec=hp300hpux_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux*aout*)
++ m68*-*-linux*aout* | m68*-*-linux-uclibc*)
+ targ_defvec=m68klinux_vec
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+@@ -952,8 +952,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
+- powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | powerpc-*-rtems* | \
++ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss* )
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -984,8 +984,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* | \
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1141,7 +1141,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1188,7 +1188,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+@@ -1257,7 +1257,7 @@
+ targ_underscore=yes
+ ;;
+
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_vax_vec
+ ;;
+
+diff -urN gdb-6.1.1-dist/bfd/configure gdb-6.1.1/bfd/configure
+--- gdb-6.1.1-dist/bfd/configure 2004-03-13 06:37:09.000000000 -0600
++++ gdb-6.1.1/bfd/configure 2004-08-08 05:01:47.000000000 -0500
+@@ -1710,6 +1710,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5276,7 +5281,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5336,7 +5341,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5386,7 +5391,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -5487,7 +5492,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN gdb-6.1.1-dist/bfd/configure.in gdb-6.1.1/bfd/configure.in
+--- gdb-6.1.1-dist/bfd/configure.in 2004-03-13 06:37:09.000000000 -0600
++++ gdb-6.1.1/bfd/configure.in 2004-08-08 05:01:47.000000000 -0500
+@@ -178,7 +178,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -259,7 +259,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -312,7 +312,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -397,7 +397,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN gdb-6.1.1-dist/libtool.m4 gdb-6.1.1/libtool.m4
+--- gdb-6.1.1-dist/libtool.m4 2003-04-10 22:58:39.000000000 -0500
++++ gdb-6.1.1/libtool.m4 2004-08-08 05:01:47.000000000 -0500
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN gdb-6.1.1-dist/ltconfig gdb-6.1.1/ltconfig
+--- gdb-6.1.1-dist/ltconfig 2003-10-03 23:54:47.000000000 -0500
++++ gdb-6.1.1/ltconfig 2004-08-08 05:01:47.000000000 -0500
+@@ -602,7 +602,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1259,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
+diff -urN gdb-6.1.1-dist/opcodes/configure gdb-6.1.1/opcodes/configure
+--- gdb-6.1.1-dist/opcodes/configure 2003-08-05 04:39:31.000000000 -0500
++++ gdb-6.1.1/opcodes/configure 2004-08-08 05:01:47.000000000 -0500
+@@ -1700,6 +1700,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- /dev/null
+--- gdb-6.1.1-dist/readline/configure 2003-05-27 18:29:47.000000000 -0500
++++ gdb-6.1.1/readline/configure 2004-08-09 14:20:23.000000000 -0500
+@@ -6249,7 +6249,12 @@
+
+
+ echo "$as_me:$LINENO: checking for mbstate_t" >&5
++echo $ECHO_N "bash_cv_have_mbstate_t=$bash_cv_have_mbstate_t" >&6
+ echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
++if test "${bash_cv_have_mbstate_t+set}" != set; then
++ bash_cv_have_mbstate_t=yes
++ echo $ECHO_N "WARNING!! forcing to yes!!! $ECHO_C" >&6
++fi
+ if test "${bash_cv_have_mbstate_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
--- /dev/null
+diff -urN gdb-6.2-dist/bfd/config.bfd gdb-6.2/bfd/config.bfd
+--- gdb-6.2-dist/bfd/config.bfd 2004-07-09 07:32:35.000000000 -0500
++++ gdb-6.2/bfd/config.bfd 2004-08-08 04:23:19.000000000 -0500
+@@ -129,7 +129,7 @@
+ targ_defvec=ecoffalpha_little_vec
+ targ_selvecs=bfd_elf64_alpha_vec
+ ;;
+- alpha*-*-linux-gnu* | alpha*-*-elf*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
+ targ_defvec=bfd_elf64_alpha_vec
+ targ_selvecs=ecoffalpha_little_vec
+ ;;
+@@ -139,7 +139,7 @@
+ alpha*-*-*)
+ targ_defvec=ecoffalpha_little_vec
+ ;;
+- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu | ia64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_ia64_little_vec
+ targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+ ;;
+@@ -216,7 +216,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- armeb-*-elf | arm*b-*-linux-gnu*)
++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
+@@ -224,7 +224,7 @@
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
+ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+@@ -373,7 +373,7 @@
+ ;;
+
+ #ifdef BFD64
+- hppa*64*-*-linux-gnu*)
++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_hppa_linux_vec
+ targ_selvecs=bfd_elf64_hppa_vec
+ ;;
+@@ -384,7 +384,7 @@
+ ;;
+ #endif
+
+- hppa*-*-linux-gnu* | hppa*-*-netbsd*)
++ hppa*-*-linux-gnu* | hppa*-*-netbsd* | hppa*-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_hppa_linux_vec
+ targ_selvecs=bfd_elf32_hppa_vec
+ ;;
+@@ -507,7 +507,7 @@
+ targ_selvecs=bfd_elf32_i386_vec
+ targ_underscore=yes
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+ targ64_selvecs=bfd_elf64_x86_64_vec
+@@ -521,7 +521,7 @@
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
+ ;;
+- x86_64-*-linux-gnu*)
++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_x86_64_vec
+ targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
+ ;;
+@@ -691,7 +691,7 @@
+ targ_defvec=hp300hpux_vec
+ targ_underscore=yes
+ ;;
+- m68*-*-linux*aout*)
++ m68*-*-linux*aout* | m68*-*-linux-uclibc*)
+ targ_defvec=m68klinux_vec
+ targ_selvecs=bfd_elf32_m68k_vec
+ targ_underscore=yes
+@@ -972,8 +972,8 @@
+ ;;
+ #endif
+ powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
+- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
+- powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | powerpc-*-rtems* | \
++ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss* )
+ targ_defvec=bfd_elf32_powerpc_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1009,8 +1009,8 @@
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ ;;
+ powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
+- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+- powerpcle-*-rtems*)
++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* | \
++ powerpcle-*-vxworks* | powerpcle-*-rtems*)
+ targ_defvec=bfd_elf32_powerpcle_vec
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
+@@ -1177,7 +1177,7 @@
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ targ_underscore=yes
+ ;;
+- sparc-*-linux-gnu*)
++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+@@ -1224,7 +1224,7 @@
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+- sparc64-*-linux-gnu*)
++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
+ targ_defvec=bfd_elf64_sparc_vec
+ targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
+ ;;
+@@ -1293,7 +1293,7 @@
+ targ_underscore=yes
+ ;;
+
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ targ_defvec=bfd_elf32_vax_vec
+ ;;
+
+diff -urN gdb-6.2-dist/bfd/configure gdb-6.2/bfd/configure
+--- gdb-6.2-dist/bfd/configure 2004-07-07 12:28:45.000000000 -0500
++++ gdb-6.2/bfd/configure 2004-08-08 04:27:01.000000000 -0500
+@@ -1698,6 +1698,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5264,7 +5269,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -5328,7 +5333,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+ ;;
+@@ -5366,7 +5371,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -5470,7 +5475,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN gdb-6.2-dist/bfd/configure.in gdb-6.2/bfd/configure.in
+--- gdb-6.2-dist/bfd/configure.in 2004-07-07 12:28:45.000000000 -0500
++++ gdb-6.2/bfd/configure.in 2004-08-08 04:28:07.000000000 -0500
+@@ -164,7 +164,7 @@
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ COREFILE=''
+ ;;
+- alpha*-*-linux-gnu*)
++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/alphalinux.h"'
+ ;;
+@@ -249,7 +249,7 @@
+ TRAD_HEADER='"hosts/i386mach3.h"'
+ ;;
+ changequote(,)dnl
+- i[3-7]86-*-linux-gnu*)
++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
+ changequote([,])dnl
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i386linux.h"'
+@@ -290,7 +290,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/hp300bsd.h"'
+ ;;
+- m68*-*-linux-gnu*)
++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/m68klinux.h"'
+ ;;
+@@ -378,7 +378,7 @@
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxult2.h"'
+ ;;
+- vax-*-linux-gnu*)
++ vax-*-linux-gnu* | vax-*-linux-uclibc*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/vaxlinux.h"'
+ ;;
+diff -urN gdb-6.2-dist/libtool.m4 gdb-6.2/libtool.m4
+--- gdb-6.2-dist/libtool.m4 2003-04-10 22:58:39.000000000 -0500
++++ gdb-6.2/libtool.m4 2004-08-08 03:48:33.000000000 -0500
+@@ -645,6 +645,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+diff -urN gdb-6.2-dist/ltconfig gdb-6.2/ltconfig
+--- gdb-6.2-dist/ltconfig 2003-10-03 23:54:47.000000000 -0500
++++ gdb-6.2/ltconfig 2004-08-08 03:48:33.000000000 -0500
+@@ -602,7 +602,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1259,6 +1259,24 @@
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ # Note: copied from linux-gnu, and may not be appropriate.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
+diff -urN gdb-6.2-dist/opcodes/configure gdb-6.2/opcodes/configure
+--- gdb-6.2-dist/opcodes/configure 2004-07-07 12:28:53.000000000 -0500
++++ gdb-6.2/opcodes/configure 2004-08-08 04:53:55.000000000 -0500
+@@ -1701,6 +1701,11 @@
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- /dev/null
+--- gdb-6.1.1-dist/readline/configure 2003-05-27 18:29:47.000000000 -0500
++++ gdb-6.1.1/readline/configure 2004-08-09 14:20:23.000000000 -0500
+@@ -6249,7 +6249,12 @@
+
+
+ echo "$as_me:$LINENO: checking for mbstate_t" >&5
++echo $ECHO_N "bash_cv_have_mbstate_t=$bash_cv_have_mbstate_t" >&6
+ echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
++if test "${bash_cv_have_mbstate_t+set}" != set; then
++ bash_cv_have_mbstate_t=yes
++ echo $ECHO_N "WARNING!! forcing to yes!!! $ECHO_C" >&6
++fi
+ if test "${bash_cv_have_mbstate_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
--- /dev/null
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/addrspace.h linux-libc-headers-2.6.8.0/include/asm-mips/addrspace.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/addrspace.h 2004-03-28 07:51:50.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/addrspace.h 2004-08-26 05:53:12.000000000 -0500
+@@ -10,7 +10,23 @@
+ #ifndef _ASM_ADDRSPACE_H
+ #define _ASM_ADDRSPACE_H
+
+-#include <spaces.h>
++/**********************************************************************/
++/* Include the common bits for #include <spaces.h> */
++#ifndef __mips64
++
++#define CAC_BASE 0x80000000
++#define IO_BASE 0xa0000000
++#define UNCAC_BASE 0xa0000000
++#define MAP_BASE 0xc0000000
++
++/*
++ * This handles the memory map.
++ * We handle pages at KSEG0 for kernels with 32 bit address space.
++ */
++#define PAGE_OFFSET 0x80000000UL
++
++#endif /* ndef __mips64 */
++/**********************************************************************/
+
+ /*
+ * Configure language
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/asmmacro.h linux-libc-headers-2.6.8.0/include/asm-mips/asmmacro.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/asmmacro.h 2004-08-18 13:15:41.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/asmmacro.h 2004-08-26 05:14:41.000000000 -0500
+@@ -9,10 +9,10 @@
+ #define _ASM_ASMMACRO_H
+
+
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ #include <asm/asmmacro-32.h>
+ #endif
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ #include <asm/asmmacro-64.h>
+ #endif
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/checksum.h linux-libc-headers-2.6.8.0/include/asm-mips/checksum.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/checksum.h 2004-06-23 16:52:45.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/checksum.h 2004-08-26 05:14:41.000000000 -0500
+@@ -125,7 +125,7 @@
+ {
+ __asm__(
+ ".set\tnoat\t\t\t# csum_tcpudp_nofold\n\t"
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ "addu\t%0, %2\n\t"
+ "sltu\t$1, %0, %2\n\t"
+ "addu\t%0, $1\n\t"
+@@ -138,7 +138,7 @@
+ "sltu\t$1, %0, %4\n\t"
+ "addu\t%0, $1\n\t"
+ #endif
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ "daddu\t%0, %2\n\t"
+ "daddu\t%0, %3\n\t"
+ "daddu\t%0, %4\n\t"
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/compat.h linux-libc-headers-2.6.8.0/include/asm-mips/compat.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/compat.h 2003-12-15 12:47:02.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/compat.h 2004-08-26 05:23:05.000000000 -0500
+@@ -8,64 +8,64 @@
+
+ #define COMPAT_USER_HZ 100
+
+-typedef u32 compat_size_t;
+-typedef s32 compat_ssize_t;
+-typedef s32 compat_time_t;
+-typedef s32 compat_clock_t;
+-typedef s32 compat_suseconds_t;
+-
+-typedef s32 compat_pid_t;
+-typedef s32 compat_uid_t;
+-typedef s32 compat_gid_t;
+-typedef u32 compat_mode_t;
+-typedef u32 compat_ino_t;
+-typedef u32 compat_dev_t;
+-typedef s32 compat_off_t;
+-typedef s64 compat_loff_t;
+-typedef u32 compat_nlink_t;
+-typedef s32 compat_ipc_pid_t;
+-typedef s32 compat_daddr_t;
+-typedef s32 compat_caddr_t;
++typedef __u32 compat_size_t;
++typedef __s32 compat_ssize_t;
++typedef __s32 compat_time_t;
++typedef __s32 compat_clock_t;
++typedef __s32 compat_suseconds_t;
++
++typedef __s32 compat_pid_t;
++typedef __s32 compat_uid_t;
++typedef __s32 compat_gid_t;
++typedef __u32 compat_mode_t;
++typedef __u32 compat_ino_t;
++typedef __u32 compat_dev_t;
++typedef __s32 compat_off_t;
++typedef __s64 compat_loff_t;
++typedef __u32 compat_nlink_t;
++typedef __s32 compat_ipc_pid_t;
++typedef __s32 compat_daddr_t;
++typedef __s32 compat_caddr_t;
+ typedef struct {
+- s32 val[2];
++ __s32 val[2];
+ } compat_fsid_t;
+
+-typedef s32 compat_int_t;
+-typedef s32 compat_long_t;
+-typedef u32 compat_uint_t;
+-typedef u32 compat_ulong_t;
++typedef __s32 compat_int_t;
++typedef __s32 compat_long_t;
++typedef __u32 compat_uint_t;
++typedef __u32 compat_ulong_t;
+
+ struct compat_timespec {
+ compat_time_t tv_sec;
+- s32 tv_nsec;
++ __s32 tv_nsec;
+ };
+
+ struct compat_timeval {
+ compat_time_t tv_sec;
+- s32 tv_usec;
++ __s32 tv_usec;
+ };
+
+ struct compat_stat {
+ compat_dev_t st_dev;
+- s32 st_pad1[3];
++ __s32 st_pad1[3];
+ compat_ino_t st_ino;
+ compat_mode_t st_mode;
+ compat_nlink_t st_nlink;
+ compat_uid_t st_uid;
+ compat_gid_t st_gid;
+ compat_dev_t st_rdev;
+- s32 st_pad2[2];
++ __s32 st_pad2[2];
+ compat_off_t st_size;
+- s32 st_pad3;
++ __s32 st_pad3;
+ compat_time_t st_atime;
+- s32 st_atime_nsec;
++ __s32 st_atime_nsec;
+ compat_time_t st_mtime;
+- s32 st_mtime_nsec;
++ __s32 st_mtime_nsec;
+ compat_time_t st_ctime;
+- s32 st_ctime_nsec;
+- s32 st_blksize;
+- s32 st_blocks;
+- s32 st_pad4[14];
++ __s32 st_ctime_nsec;
++ __s32 st_blksize;
++ __s32 st_blocks;
++ __s32 st_pad4[14];
+ };
+
+ struct compat_flock {
+@@ -73,10 +73,10 @@
+ short l_whence;
+ compat_off_t l_start;
+ compat_off_t l_len;
+- s32 l_sysid;
++ __s32 l_sysid;
+ compat_pid_t l_pid;
+ short __unused;
+- s32 pad[4];
++ __s32 pad[4];
+ };
+
+ #define F_GETLK64 33
+@@ -107,12 +107,12 @@
+
+ #define COMPAT_RLIM_INFINITY 0x7fffffffUL
+
+-typedef u32 compat_old_sigset_t; /* at least 32 bits */
++typedef __u32 compat_old_sigset_t; /* at least 32 bits */
+
+ #define _COMPAT_NSIG 128 /* Don't ask !$@#% ... */
+ #define _COMPAT_NSIG_BPW 32
+
+-typedef u32 compat_sigset_word;
++typedef __u32 compat_sigset_word;
+
+ #define COMPAT_OFF_T_MAX 0x7fffffff
+ #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
+@@ -123,7 +123,7 @@
+ * as pointers because the syscall entry code will have
+ * appropriately comverted them already.
+ */
+-typedef u32 compat_uptr_t;
++typedef __u32 compat_uptr_t;
+
+ static inline void *compat_ptr(compat_uptr_t uptr)
+ {
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5074.h linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5074.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5074.h 2003-12-15 12:47:03.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5074.h 2004-08-26 13:21:48.000000000 -0500
+@@ -34,5 +34,5 @@
+ extern void ddb5074_led_d2(int on);
+ extern void ddb5074_led_d3(int on);
+
+-extern void nile4_irq_setup(u32 base);
++extern void nile4_irq_setup(__u32 base);
+ #endif
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5476.h linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5476.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5476.h 2003-12-15 12:47:03.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5476.h 2004-08-26 05:24:06.000000000 -0500
+@@ -145,13 +145,13 @@
+ extern void nile4_enable_irq(int nile4_irq);
+ extern void nile4_disable_irq(int nile4_irq);
+ extern void nile4_disable_irq_all(void);
+-extern u16 nile4_get_irq_stat(int cpu_irq);
++extern __u16 nile4_get_irq_stat(int cpu_irq);
+ extern void nile4_enable_irq_output(int cpu_irq);
+ extern void nile4_disable_irq_output(int cpu_irq);
+ extern void nile4_set_pci_irq_polarity(int pci_irq, int high);
+ extern void nile4_set_pci_irq_level_or_edge(int pci_irq, int level);
+ extern void nile4_clear_irq(int nile4_irq);
+-extern void nile4_clear_irq_mask(u32 mask);
+-extern u8 nile4_i8259_iack(void);
++extern void nile4_clear_irq_mask(__u32 mask);
++extern __u8 nile4_i8259_iack(void);
+ extern void nile4_dump_irq_status(void); /* Debug */
+ #endif /* !__ASSEMBLY__ */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5xxx.h linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5xxx.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5xxx.h 2004-01-17 17:03:47.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5xxx.h 2004-08-26 05:24:01.000000000 -0500
+@@ -177,46 +177,46 @@
+ * interrupt load
+ */
+ #ifndef CONFIG_DDB5074
+- volatile u32 *p = (volatile u32 *)0xbfc00000;
++ volatile __u32 *p = (volatile __u32 *)0xbfc00000;
+ (void)(*p);
+ #endif
+ }
+
+-static inline void ddb_out32(u32 offset, u32 val)
++static inline void ddb_out32(__u32 offset, __u32 val)
+ {
+- *(volatile u32 *)(DDB_BASE+offset) = val;
++ *(volatile __u32 *)(DDB_BASE+offset) = val;
+ ddb_sync();
+ }
+
+-static inline u32 ddb_in32(u32 offset)
++static inline __u32 ddb_in32(__u32 offset)
+ {
+- u32 val = *(volatile u32 *)(DDB_BASE+offset);
++ __u32 val = *(volatile __u32 *)(DDB_BASE+offset);
+ ddb_sync();
+ return val;
+ }
+
+-static inline void ddb_out16(u32 offset, u16 val)
++static inline void ddb_out16(__u32 offset, __u16 val)
+ {
+- *(volatile u16 *)(DDB_BASE+offset) = val;
++ *(volatile __u16 *)(DDB_BASE+offset) = val;
+ ddb_sync();
+ }
+
+-static inline u16 ddb_in16(u32 offset)
++static inline __u16 ddb_in16(__u32 offset)
+ {
+- u16 val = *(volatile u16 *)(DDB_BASE+offset);
++ __u16 val = *(volatile __u16 *)(DDB_BASE+offset);
+ ddb_sync();
+ return val;
+ }
+
+-static inline void ddb_out8(u32 offset, u8 val)
++static inline void ddb_out8(__u32 offset, __u8 val)
+ {
+- *(volatile u8 *)(DDB_BASE+offset) = val;
++ *(volatile __u8 *)(DDB_BASE+offset) = val;
+ ddb_sync();
+ }
+
+-static inline u8 ddb_in8(u32 offset)
++static inline __u8 ddb_in8(__u32 offset)
+ {
+- u8 val = *(volatile u8 *)(DDB_BASE+offset);
++ __u8 val = *(volatile __u8 *)(DDB_BASE+offset);
+ ddb_sync();
+ return val;
+ }
+@@ -226,10 +226,10 @@
+ * Physical Device Address Registers
+ */
+
+-extern u32
+-ddb_calc_pdar(u32 phys, u32 size, int width, int on_memory_bus, int pci_visible);
++extern __u32
++ddb_calc_pdar(__u32 phys, __u32 size, int width, int on_memory_bus, int pci_visible);
+ extern void
+-ddb_set_pdar(u32 pdar, u32 phys, u32 size, int width,
++ddb_set_pdar(__u32 pdar, __u32 phys, __u32 size, int width,
+ int on_memory_bus, int pci_visible);
+
+ /*
+@@ -248,7 +248,7 @@
+ #define DDB_PCI_ACCESS_32 0x10 /* for pci init0/1 regs */
+
+
+-extern void ddb_set_pmr(u32 pmr, u32 type, u32 addr, u32 options);
++extern void ddb_set_pmr(__u32 pmr, __u32 type, __u32 addr, __u32 options);
+
+ /*
+ * we need to reset pci bus when we start up and shutdown
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/dec/ioasic.h linux-libc-headers-2.6.8.0/include/asm-mips/dec/ioasic.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/dec/ioasic.h 2004-01-17 17:03:47.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/dec/ioasic.h 2004-08-26 05:25:44.000000000 -0500
+@@ -18,14 +18,14 @@
+
+ extern spinlock_t ioasic_ssr_lock;
+
+-extern volatile u32 *ioasic_base;
++extern volatile __u32 *ioasic_base;
+
+-static inline void ioasic_write(unsigned int reg, u32 v)
++static inline void ioasic_write(unsigned int reg, __u32 v)
+ {
+ ioasic_base[reg / 4] = v;
+ }
+
+-static inline u32 ioasic_read(unsigned int reg)
++static inline __u32 ioasic_read(unsigned int reg)
+ {
+ return ioasic_base[reg / 4];
+ }
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/dec/kn02.h linux-libc-headers-2.6.8.0/include/asm-mips/dec/kn02.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/dec/kn02.h 2004-01-17 17:03:47.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/dec/kn02.h 2004-08-26 05:25:47.000000000 -0500
+@@ -97,7 +97,7 @@
+
+
+ #ifndef __ASSEMBLY__
+-extern u32 cached_kn02_csr;
++extern __u32 cached_kn02_csr;
+ extern spinlock_t kn02_lock;
+ extern void init_kn02_irqs(int base);
+ #endif
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/elf.h linux-libc-headers-2.6.8.0/include/asm-mips/elf.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/elf.h 2004-03-28 07:51:51.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/elf.h 2004-08-26 05:17:25.000000000 -0500
+@@ -122,7 +122,7 @@
+ typedef double elf_fpreg_t;
+ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+
+ /*
+ * This is used to ensure we don't load something for the wrong architecture.
+@@ -150,9 +150,9 @@
+ */
+ #define ELF_CLASS ELFCLASS32
+
+-#endif /* CONFIG_MIPS32 */
++#endif /* ndef __mips64 */
+
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ /*
+ * This is used to ensure we don't load something for the wrong architecture.
+ */
+@@ -174,7 +174,7 @@
+ */
+ #define ELF_CLASS ELFCLASS64
+
+-#endif /* CONFIG_MIPS64 */
++#endif /* __mips64 */
+
+ /*
+ * These are used to set parameters in the core dumps.
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/galileo-boards/ev96100.h linux-libc-headers-2.6.8.0/include/asm-mips/galileo-boards/ev96100.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/galileo-boards/ev96100.h 2004-03-28 07:51:53.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/galileo-boards/ev96100.h 2004-08-26 05:23:12.000000000 -0500
+@@ -46,9 +46,9 @@
+ * bytes when running bigendian.
+ */
+ #define __GT_READ(ofs) \
+- (*(volatile u32 *)(GT64120_BASE+(ofs)))
++ (*(volatile __u32 *)(GT64120_BASE+(ofs)))
+ #define __GT_WRITE(ofs, data) \
+- do { *(volatile u32 *)(GT64120_BASE+(ofs)) = (data); } while (0)
++ do { *(volatile __u32 *)(GT64120_BASE+(ofs)) = (data); } while (0)
+ #define GT_READ(ofs) le32_to_cpu(__GT_READ(ofs))
+ #define GT_WRITE(ofs, data) __GT_WRITE(ofs, cpu_to_le32(data))
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/galileo-boards/gt96100.h linux-libc-headers-2.6.8.0/include/asm-mips/galileo-boards/gt96100.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/galileo-boards/gt96100.h 2004-03-28 07:51:53.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/galileo-boards/gt96100.h 2004-08-26 05:23:17.000000000 -0500
+@@ -27,9 +27,9 @@
+ #define MIPS_GT96100_BASE (KSEG1ADDR(0x14000000))
+
+ #define GT96100_WRITE(ofs, data) \
+- *(volatile u32 *)(MIPS_GT96100_BASE+ofs) = cpu_to_le32(data)
++ *(volatile __u32 *)(MIPS_GT96100_BASE+ofs) = cpu_to_le32(data)
+ #define GT96100_READ(ofs) \
+- le32_to_cpu(*(volatile u32 *)(MIPS_GT96100_BASE+ofs))
++ le32_to_cpu(*(volatile __u32 *)(MIPS_GT96100_BASE+ofs))
+
+ #define GT96100_ETH_IO_SIZE 0x4000
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/gt64120.h linux-libc-headers-2.6.8.0/include/asm-mips/gt64120.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/gt64120.h 2004-03-28 07:51:51.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/gt64120.h 2004-08-26 05:22:36.000000000 -0500
+@@ -420,9 +420,9 @@
+ * bytes when running bigendian. We also provide non-swapping versions.
+ */
+ #define __GT_READ(ofs) \
+- (*(volatile u32 *)(GT64120_BASE+(ofs)))
++ (*(volatile __u32 *)(GT64120_BASE+(ofs)))
+ #define __GT_WRITE(ofs, data) \
+- do { *(volatile u32 *)(GT64120_BASE+(ofs)) = (data); } while (0)
++ do { *(volatile __u32 *)(GT64120_BASE+(ofs)) = (data); } while (0)
+ #define GT_READ(ofs) le32_to_cpu(__GT_READ(ofs))
+ #define GT_WRITE(ofs, data) __GT_WRITE(ofs, cpu_to_le32(data))
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/io.h linux-libc-headers-2.6.8.0/include/asm-mips/io.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/io.h 2004-03-28 07:51:51.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/io.h 2004-08-26 05:24:16.000000000 -0500
+@@ -173,14 +173,14 @@
+ unsigned long flags)
+ {
+ if (cpu_has_64bit_addresses) {
+- u64 base = UNCAC_BASE;
++ __u64 base = UNCAC_BASE;
+
+ /*
+ * R10000 supports a 2 bit uncached attribute therefore
+ * UNCAC_BASE may not equal IO_BASE.
+ */
+ if (flags == _CACHE_UNCACHED)
+- base = (u64) IO_BASE;
++ base = (__u64) IO_BASE;
+ return (void *) (unsigned long) (base + offset);
+ }
+
+@@ -245,10 +245,10 @@
+ #define __raw_readb(addr) (*(volatile unsigned char *)(addr))
+ #define __raw_readw(addr) (*(volatile unsigned short *)(addr))
+ #define __raw_readl(addr) (*(volatile unsigned int *)(addr))
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ #define ____raw_readq(addr) \
+ ({ \
+- u64 __res; \
++ __u64 __res; \
+ \
+ __asm__ __volatile__ ( \
+ " .set mips3 # ____raw_readq \n" \
+@@ -263,7 +263,7 @@
+ #define __raw_readq(addr) \
+ ({ \
+ unsigned long __flags; \
+- u64 __res; \
++ __u64 __res; \
+ \
+ local_irq_save(__flags); \
+ __res = ____raw_readq(addr); \
+@@ -271,7 +271,7 @@
+ __res; \
+ })
+ #endif
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ #define ____raw_readq(addr) (*(volatile unsigned long *)(addr))
+ #define __raw_readq(addr) ____raw_readq(addr)
+ #endif
+@@ -288,10 +288,10 @@
+ #define __raw_writeb(b,addr) ((*(volatile unsigned char *)(addr)) = (b))
+ #define __raw_writew(w,addr) ((*(volatile unsigned short *)(addr)) = (w))
+ #define __raw_writel(l,addr) ((*(volatile unsigned int *)(addr)) = (l))
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ #define ____raw_writeq(val,addr) \
+ ({ \
+- u64 __tmp; \
++ __u64 __tmp; \
+ \
+ __asm__ __volatile__ ( \
+ " .set mips3 \n" \
+@@ -313,7 +313,7 @@
+ local_irq_restore(__flags); \
+ })
+ #endif
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ #define ____raw_writeq(q,addr) ((*(volatile unsigned long *)(addr)) = (q))
+ #define __raw_writeq(q,addr) ____raw_writeq(q, addr)
+ #endif
+@@ -400,28 +400,28 @@
+ {
+ port = __swizzle_addr_b(port);
+
+- *(volatile u8 *)(mips_io_port_base + port) = __ioswab8(val);
++ *(volatile __u8 *)(mips_io_port_base + port) = __ioswab8(val);
+ }
+
+ static inline void __outw(unsigned short val, unsigned long port)
+ {
+ port = __swizzle_addr_w(port);
+
+- *(volatile u16 *)(mips_io_port_base + port) = __ioswab16(val);
++ *(volatile __u16 *)(mips_io_port_base + port) = __ioswab16(val);
+ }
+
+ static inline void __outl(unsigned int val, unsigned long port)
+ {
+ port = __swizzle_addr_l(port);
+
+- *(volatile u32 *)(mips_io_port_base + port) = __ioswab32(val);
++ *(volatile __u32 *)(mips_io_port_base + port) = __ioswab32(val);
+ }
+
+ static inline void __outb_p(unsigned char val, unsigned long port)
+ {
+ port = __swizzle_addr_b(port);
+
+- *(volatile u8 *)(mips_io_port_base + port) = __ioswab8(val);
++ *(volatile __u8 *)(mips_io_port_base + port) = __ioswab8(val);
+ SLOW_DOWN_IO;
+ }
+
+@@ -429,7 +429,7 @@
+ {
+ port = __swizzle_addr_w(port);
+
+- *(volatile u16 *)(mips_io_port_base + port) = __ioswab16(val);
++ *(volatile __u16 *)(mips_io_port_base + port) = __ioswab16(val);
+ SLOW_DOWN_IO;
+ }
+
+@@ -437,7 +437,7 @@
+ {
+ port = __swizzle_addr_l(port);
+
+- *(volatile u32 *)(mips_io_port_base + port) = __ioswab32(val);
++ *(volatile __u32 *)(mips_io_port_base + port) = __ioswab32(val);
+ SLOW_DOWN_IO;
+ }
+
+@@ -452,30 +452,30 @@
+ {
+ port = __swizzle_addr_b(port);
+
+- return __ioswab8(*(volatile u8 *)(mips_io_port_base + port));
++ return __ioswab8(*(volatile __u8 *)(mips_io_port_base + port));
+ }
+
+ static inline unsigned short __inw(unsigned long port)
+ {
+ port = __swizzle_addr_w(port);
+
+- return __ioswab16(*(volatile u16 *)(mips_io_port_base + port));
++ return __ioswab16(*(volatile __u16 *)(mips_io_port_base + port));
+ }
+
+ static inline unsigned int __inl(unsigned long port)
+ {
+ port = __swizzle_addr_l(port);
+
+- return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
++ return __ioswab32(*(volatile __u32 *)(mips_io_port_base + port));
+ }
+
+ static inline unsigned char __inb_p(unsigned long port)
+ {
+- u8 __val;
++ __u8 __val;
+
+ port = __swizzle_addr_b(port);
+
+- __val = *(volatile u8 *)(mips_io_port_base + port);
++ __val = *(volatile __u8 *)(mips_io_port_base + port);
+ SLOW_DOWN_IO;
+
+ return __ioswab8(__val);
+@@ -483,11 +483,11 @@
+
+ static inline unsigned short __inw_p(unsigned long port)
+ {
+- u16 __val;
++ __u16 __val;
+
+ port = __swizzle_addr_w(port);
+
+- __val = *(volatile u16 *)(mips_io_port_base + port);
++ __val = *(volatile __u16 *)(mips_io_port_base + port);
+ SLOW_DOWN_IO;
+
+ return __ioswab16(__val);
+@@ -495,11 +495,11 @@
+
+ static inline unsigned int __inl_p(unsigned long port)
+ {
+- u32 __val;
++ __u32 __val;
+
+ port = __swizzle_addr_l(port);
+
+- __val = *(volatile u32 *)(mips_io_port_base + port);
++ __val = *(volatile __u32 *)(mips_io_port_base + port);
+ SLOW_DOWN_IO;
+
+ return __ioswab32(__val);
+@@ -515,7 +515,7 @@
+ static inline void __outsb(unsigned long port, void *addr, unsigned int count)
+ {
+ while (count--) {
+- outb(*(u8 *)addr, port);
++ outb(*(__u8 *)addr, port);
+ addr++;
+ }
+ }
+@@ -523,7 +523,7 @@
+ static inline void __insb(unsigned long port, void *addr, unsigned int count)
+ {
+ while (count--) {
+- *(u8 *)addr = inb(port);
++ *(__u8 *)addr = inb(port);
+ addr++;
+ }
+ }
+@@ -531,7 +531,7 @@
+ static inline void __outsw(unsigned long port, void *addr, unsigned int count)
+ {
+ while (count--) {
+- outw(*(u16 *)addr, port);
++ outw(*(__u16 *)addr, port);
+ addr += 2;
+ }
+ }
+@@ -539,7 +539,7 @@
+ static inline void __insw(unsigned long port, void *addr, unsigned int count)
+ {
+ while (count--) {
+- *(u16 *)addr = inw(port);
++ *(__u16 *)addr = inw(port);
+ addr += 2;
+ }
+ }
+@@ -547,7 +547,7 @@
+ static inline void __outsl(unsigned long port, void *addr, unsigned int count)
+ {
+ while (count--) {
+- outl(*(u32 *)addr, port);
++ outl(*(__u32 *)addr, port);
+ addr += 4;
+ }
+ }
+@@ -555,7 +555,7 @@
+ static inline void __insl(unsigned long port, void *addr, unsigned int count)
+ {
+ while (count--) {
+- *(u32 *)addr = inl(port);
++ *(__u32 *)addr = inl(port);
+ addr += 4;
+ }
+ }
+@@ -617,7 +617,7 @@
+ #define __CSR_32_ADJUST 0
+ #endif
+
+-#define csr_out32(v,a) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST) = (v))
+-#define csr_in32(a) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST))
++#define csr_out32(v,a) (*(volatile __u32 *)((unsigned long)(a) + __CSR_32_ADJUST) = (v))
++#define csr_in32(a) (*(volatile __u32 *)((unsigned long)(a) + __CSR_32_ADJUST))
+
+ #endif /* _ASM_IO_H */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/ip32/mace.h linux-libc-headers-2.6.8.0/include/asm-mips/ip32/mace.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/ip32/mace.h 2004-06-09 07:00:41.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/ip32/mace.h 2004-08-26 05:14:41.000000000 -0500
+@@ -22,7 +22,7 @@
+ #undef BIT
+ #define BIT(x) (1ULL << (x))
+
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ typedef struct {
+ volatile unsigned long long reg;
+ } mace64_t;
+@@ -32,7 +32,7 @@
+ volatile unsigned long reg;
+ } mace32_t;
+ #endif
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ typedef struct {
+ volatile unsigned long reg;
+ } mace64_t;
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/it8172/it8172.h linux-libc-headers-2.6.8.0/include/asm-mips/it8172/it8172.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/it8172/it8172.h 2003-12-15 12:47:03.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/it8172/it8172.h 2004-08-26 05:22:54.000000000 -0500
+@@ -336,13 +336,13 @@
+ #define TIMER_TIDR 0x0E
+
+
+-#define IT_WRITE(ofs, data) *(volatile u32 *)KSEG1ADDR((IT8172_BASE+ofs)) = data
+-#define IT_READ(ofs, data) data = *(volatile u32 *)KSEG1ADDR((IT8172_BASE+ofs))
++#define IT_WRITE(ofs, data) *(volatile __u32 *)KSEG1ADDR((IT8172_BASE+ofs)) = data
++#define IT_READ(ofs, data) data = *(volatile __u32 *)KSEG1ADDR((IT8172_BASE+ofs))
+
+-#define IT_IO_WRITE(ofs, data) *(volatile u32 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) = data
+-#define IT_IO_READ(ofs, data) data = *(volatile u32 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs))
++#define IT_IO_WRITE(ofs, data) *(volatile __u32 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) = data
++#define IT_IO_READ(ofs, data) data = *(volatile __u32 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs))
+
+-#define IT_IO_WRITE16(ofs, data) *(volatile u16 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) = data
+-#define IT_IO_READ16(ofs, data) data = *(volatile u16 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs))
++#define IT_IO_WRITE16(ofs, data) *(volatile __u16 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) = data
++#define IT_IO_READ16(ofs, data) data = *(volatile __u16 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs))
+
+ #endif
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/lasat/head.h linux-libc-headers-2.6.8.0/include/asm-mips/lasat/head.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/lasat/head.h 2003-12-15 12:47:03.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/lasat/head.h 2004-08-26 05:23:42.000000000 -0500
+@@ -10,12 +10,12 @@
+ #ifndef _LANGUAGE_ASSEMBLY
+ #include <linux/types.h>
+ struct bootloader_header {
+- u32 magic[2];
+- u32 version;
+- u32 image_start;
+- u32 image_size;
+- u32 kernel_start;
+- u32 kernel_entry;
++ __u32 magic[2];
++ __u32 version;
++ __u32 image_start;
++ __u32 image_size;
++ __u32 kernel_start;
++ __u32 kernel_entry;
+ };
+ #endif
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/lasat/lasat.h linux-libc-headers-2.6.8.0/include/asm-mips/lasat/lasat.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/lasat/lasat.h 2004-06-09 07:00:42.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/lasat/lasat.h 2004-08-26 05:23:50.000000000 -0500
+@@ -25,9 +25,9 @@
+ #ifndef _LANGUAGE_ASSEMBLY
+
+ extern struct lasat_misc {
+- volatile u32 *reset_reg;
+- volatile u32 *flash_wp_reg;
+- u32 flash_wp_bit;
++ volatile __u32 *reset_reg;
++ volatile __u32 *flash_wp_reg;
++ __u32 flash_wp_bit;
+ } *lasat_misc;
+
+ enum lasat_mtdparts {
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/m48t35.h linux-libc-headers-2.6.8.0/include/asm-mips/m48t35.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/m48t35.h 2004-01-17 17:03:44.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/m48t35.h 2004-08-26 05:23:39.000000000 -0500
+@@ -8,15 +8,15 @@
+ extern spinlock_t rtc_lock;
+
+ struct m48t35_rtc {
+- volatile u8 pad[0x7ff8]; /* starts at 0x7ff8 */
+- volatile u8 control;
+- volatile u8 sec;
+- volatile u8 min;
+- volatile u8 hour;
+- volatile u8 day;
+- volatile u8 date;
+- volatile u8 month;
+- volatile u8 year;
++ volatile __u8 pad[0x7ff8]; /* starts at 0x7ff8 */
++ volatile __u8 control;
++ volatile __u8 sec;
++ volatile __u8 min;
++ volatile __u8 hour;
++ volatile __u8 day;
++ volatile __u8 date;
++ volatile __u8 month;
++ volatile __u8 year;
+ };
+
+ #define M48T35_RTC_SET 0x80
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/bonito64.h linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/bonito64.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/bonito64.h 2004-03-28 07:51:54.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/bonito64.h 2004-08-26 05:21:59.000000000 -0500
+@@ -34,7 +34,7 @@
+ extern unsigned long _pcictrl_bonito;
+ extern unsigned long _pcictrl_bonito_pcicfg;
+
+-#define BONITO(x) *(volatile u32 *)(_pcictrl_bonito + (x))
++#define BONITO(x) *(volatile __u32 *)(_pcictrl_bonito + (x))
+
+ #endif /* __ASSEMBLY__ */
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/generic.h linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/generic.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/generic.h 2004-03-28 07:51:54.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/generic.h 2004-08-26 05:22:06.000000000 -0500
+@@ -74,7 +74,7 @@
+ #define MIPS_REVISION_CORID_CORE_EMUL_BON 0x63
+ #define MIPS_REVISION_CORID_CORE_EMUL_MSC 0x65
+
+-#define MIPS_REVISION_CORID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f)
++#define MIPS_REVISION_CORID (((*(volatile __u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f)
+
+ extern unsigned int mips_revision_corid;
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/msc01_pci.h linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/msc01_pci.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/msc01_pci.h 2004-03-28 07:51:54.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/msc01_pci.h 2004-08-26 05:22:10.000000000 -0500
+@@ -212,8 +212,8 @@
+
+ #define MSC01_PCI_REG_BASE _pcictrl_msc
+
+-#define MSC_WRITE(reg, data) do { *(volatile u32 *)(reg) = data; } while (0)
+-#define MSC_READ(reg, data) do { data = *(volatile u32 *)(reg); } while (0)
++#define MSC_WRITE(reg, data) do { *(volatile __u32 *)(reg) = data; } while (0)
++#define MSC_READ(reg, data) do { data = *(volatile __u32 *)(reg); } while (0)
+
+ /*
+ * Registers absolute addresses
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/mipsregs.h linux-libc-headers-2.6.8.0/include/asm-mips/mipsregs.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/mipsregs.h 2004-08-18 13:15:41.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/mipsregs.h 2004-08-26 13:00:51.000000000 -0500
+@@ -14,7 +14,6 @@
+ #define _ASM_MIPSREGS_H
+
+ #include <linux/linkage.h>
+-#include <asm/hazards.h>
+
+ /*
+ * The following macros are especially useful for __asm__
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/mmu_context.h linux-libc-headers-2.6.8.0/include/asm-mips/mmu_context.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/mmu_context.h 2004-08-18 13:15:41.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/mmu_context.h 2004-08-26 05:14:41.000000000 -0500
+@@ -27,12 +27,12 @@
+ */
+ #define TLBMISS_HANDLER_SETUP_PGD(pgd) \
+ pgd_current[smp_processor_id()] = (unsigned long)(pgd)
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ #define TLBMISS_HANDLER_SETUP() \
+ write_c0_context((unsigned long) smp_processor_id() << 23); \
+ TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
+ #endif
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ #define TLBMISS_HANDLER_SETUP() \
+ write_c0_context((unsigned long) &pgd_current[smp_processor_id()] << 23); \
+ TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/module.h linux-libc-headers-2.6.8.0/include/asm-mips/module.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/module.h 2004-08-18 13:15:41.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/module.h 2004-08-26 05:14:41.000000000 -0500
+@@ -21,7 +21,7 @@
+ Elf64_Sxword r_addend; /* Addend. */
+ } Elf64_Mips_Rela;
+
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+
+ #define Elf_Shdr Elf32_Shdr
+ #define Elf_Sym Elf32_Sym
+@@ -29,7 +29,7 @@
+
+ #endif
+
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+
+ #define Elf_Shdr Elf64_Shdr
+ #define Elf_Sym Elf64_Sym
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/msgbuf.h linux-libc-headers-2.6.8.0/include/asm-mips/msgbuf.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/msgbuf.h 2004-01-17 17:03:44.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/msgbuf.h 2004-08-26 05:15:04.000000000 -0500
+@@ -14,25 +14,25 @@
+
+ struct msqid64_ds {
+ struct ipc64_perm msg_perm;
+-#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
++#if !defined(__mips64) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused1;
+ #endif
+ __kernel_time_t msg_stime; /* last msgsnd time */
+-#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN)
++#if !defined(__mips64) && defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused1;
+ #endif
+-#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
++#if !defined(__mips64) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused2;
+ #endif
+ __kernel_time_t msg_rtime; /* last msgrcv time */
+-#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN)
++#if !defined(__mips64) && defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused2;
+ #endif
+-#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
++#if !defined(__mips64) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused3;
+ #endif
+ __kernel_time_t msg_ctime; /* last change time */
+-#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN)
++#if !defined(__mips64) && defined(CONFIG_CPU_LITTLE_ENDIAN)
+ unsigned long __unused3;
+ #endif
+ unsigned long msg_cbytes; /* current number of bytes on queue */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/nile4.h linux-libc-headers-2.6.8.0/include/asm-mips/nile4.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/nile4.h 2003-12-15 12:47:02.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/nile4.h 2004-08-26 05:22:46.000000000 -0500
+@@ -202,45 +202,45 @@
+
+ static inline void nile4_sync(void)
+ {
+- volatile u32 *p = (volatile u32 *)0xbfc00000;
++ volatile __u32 *p = (volatile __u32 *)0xbfc00000;
+ (void)(*p);
+ }
+
+-static inline void nile4_out32(u32 offset, u32 val)
++static inline void nile4_out32(__u32 offset, __u32 val)
+ {
+- *(volatile u32 *)(NILE4_BASE+offset) = val;
++ *(volatile __u32 *)(NILE4_BASE+offset) = val;
+ nile4_sync();
+ }
+
+-static inline u32 nile4_in32(u32 offset)
++static inline __u32 nile4_in32(__u32 offset)
+ {
+- u32 val = *(volatile u32 *)(NILE4_BASE+offset);
++ __u32 val = *(volatile __u32 *)(NILE4_BASE+offset);
+ nile4_sync();
+ return val;
+ }
+
+-static inline void nile4_out16(u32 offset, u16 val)
++static inline void nile4_out16(__u32 offset, __u16 val)
+ {
+- *(volatile u16 *)(NILE4_BASE+offset) = val;
++ *(volatile __u16 *)(NILE4_BASE+offset) = val;
+ nile4_sync();
+ }
+
+-static inline u16 nile4_in16(u32 offset)
++static inline __u16 nile4_in16(__u32 offset)
+ {
+- u16 val = *(volatile u16 *)(NILE4_BASE+offset);
++ __u16 val = *(volatile __u16 *)(NILE4_BASE+offset);
+ nile4_sync();
+ return val;
+ }
+
+-static inline void nile4_out8(u32 offset, u8 val)
++static inline void nile4_out8(__u32 offset, __u8 val)
+ {
+- *(volatile u8 *)(NILE4_BASE+offset) = val;
++ *(volatile __u8 *)(NILE4_BASE+offset) = val;
+ nile4_sync();
+ }
+
+-static inline u8 nile4_in8(u32 offset)
++static inline __u8 nile4_in8(__u32 offset)
+ {
+- u8 val = *(volatile u8 *)(NILE4_BASE+offset);
++ __u8 val = *(volatile __u8 *)(NILE4_BASE+offset);
+ nile4_sync();
+ return val;
+ }
+@@ -250,7 +250,7 @@
+ * Physical Device Address Registers
+ */
+
+-extern void nile4_set_pdar(u32 pdar, u32 phys, u32 size, int width,
++extern void nile4_set_pdar(__u32 pdar, __u32 phys, __u32 size, int width,
+ int on_memory_bus, int visible);
+
+
+@@ -276,7 +276,7 @@
+ #define NILE4_PCI_IACK_BASE NILE4_PCI_IO_BASE
+
+
+-extern void nile4_set_pmr(u32 pmr, u32 type, u32 addr);
++extern void nile4_set_pmr(__u32 pmr, __u32 type, __u32 addr);
+
+
+ /*
+@@ -296,14 +296,14 @@
+ extern void nile4_enable_irq(unsigned int nile4_irq);
+ extern void nile4_disable_irq(unsigned int nile4_irq);
+ extern void nile4_disable_irq_all(void);
+-extern u16 nile4_get_irq_stat(int cpu_irq);
++extern __u16 nile4_get_irq_stat(int cpu_irq);
+ extern void nile4_enable_irq_output(int cpu_irq);
+ extern void nile4_disable_irq_output(int cpu_irq);
+ extern void nile4_set_pci_irq_polarity(int pci_irq, int high);
+ extern void nile4_set_pci_irq_level_or_edge(int pci_irq, int level);
+ extern void nile4_clear_irq(int nile4_irq);
+-extern void nile4_clear_irq_mask(u32 mask);
+-extern u8 nile4_i8259_iack(void);
++extern void nile4_clear_irq_mask(__u32 mask);
++extern __u8 nile4_i8259_iack(void);
+ extern void nile4_dump_irq_status(void); /* Debug */
+
+ #endif
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/paccess.h linux-libc-headers-2.6.8.0/include/asm-mips/paccess.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/paccess.h 2004-01-17 17:03:44.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/paccess.h 2004-08-26 05:17:48.000000000 -0500
+@@ -14,11 +14,12 @@
+ #define _ASM_PACCESS_H
+
+ #include <linux/errno.h>
++#include <linux/linkage.h>
+
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ #define __PA_ADDR ".word"
+ #endif
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ #define __PA_ADDR ".dword"
+ #endif
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/pci/bridge.h linux-libc-headers-2.6.8.0/include/asm-mips/pci/bridge.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/pci/bridge.h 2004-03-28 07:51:54.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/pci/bridge.h 2004-08-26 05:25:40.000000000 -0500
+@@ -48,9 +48,9 @@
+ * All accesses to bridge hardware registers must be done
+ * using 32-bit loads and stores.
+ */
+-typedef u32 bridgereg_t;
++typedef __u32 bridgereg_t;
+
+-typedef u64 bridge_ate_t;
++typedef __u64 bridge_ate_t;
+
+ /* pointers to bridge ATEs
+ * are always "pointer to volatile"
+@@ -199,37 +199,37 @@
+
+ /* PCI Device Configuration Spaces 0x020000-0x027FFF */
+ union { /* make all access sizes available. */
+- u8 c[0x1000 / 1];
+- u16 s[0x1000 / 2];
+- u32 l[0x1000 / 4];
+- u64 d[0x1000 / 8];
++ __u8 c[0x1000 / 1];
++ __u16 s[0x1000 / 2];
++ __u32 l[0x1000 / 4];
++ __u64 d[0x1000 / 8];
+ union {
+- u8 c[0x100 / 1];
+- u16 s[0x100 / 2];
+- u32 l[0x100 / 4];
+- u64 d[0x100 / 8];
++ __u8 c[0x100 / 1];
++ __u16 s[0x100 / 2];
++ __u32 l[0x100 / 4];
++ __u64 d[0x100 / 8];
+ } f[8];
+ } b_type0_cfg_dev[8]; /* 0x020000 */
+
+ /* PCI Type 1 Configuration Space 0x028000-0x028FFF */
+ union { /* make all access sizes available. */
+- u8 c[0x1000 / 1];
+- u16 s[0x1000 / 2];
+- u32 l[0x1000 / 4];
+- u64 d[0x1000 / 8];
++ __u8 c[0x1000 / 1];
++ __u16 s[0x1000 / 2];
++ __u32 l[0x1000 / 4];
++ __u64 d[0x1000 / 8];
+ } b_type1_cfg; /* 0x028000-0x029000 */
+
+ char _pad_029000[0x007000]; /* 0x029000-0x030000 */
+
+ /* PCI Interrupt Acknowledge Cycle 0x030000 */
+ union {
+- u8 c[8 / 1];
+- u16 s[8 / 2];
+- u32 l[8 / 4];
+- u64 d[8 / 8];
++ __u8 c[8 / 1];
++ __u16 s[8 / 2];
++ __u32 l[8 / 4];
++ __u64 d[8 / 8];
+ } b_pci_iack; /* 0x030000 */
+
+- u8 _pad_030007[0x04fff8]; /* 0x030008-0x07FFFF */
++ __u8 _pad_030007[0x04fff8]; /* 0x030008-0x07FFFF */
+
+ /* External Address Translation Entry RAM 0x080000-0x0FFFFF */
+ bridge_ate_t b_ext_ate_ram[0x10000];
+@@ -239,10 +239,10 @@
+
+ /* PCI/GIO Device Spaces 0x200000-0xBFFFFF */
+ union { /* make all access sizes available. */
+- u8 c[0x100000 / 1];
+- u16 s[0x100000 / 2];
+- u32 l[0x100000 / 4];
+- u64 d[0x100000 / 8];
++ __u8 c[0x100000 / 1];
++ __u16 s[0x100000 / 2];
++ __u32 l[0x100000 / 4];
++ __u64 d[0x100000 / 8];
+ } b_devio_raw[10]; /* 0x200000 */
+
+ /* b_devio macro is a bit strange; it reflects the
+@@ -253,10 +253,10 @@
+
+ /* External Flash Proms 1,0 0xC00000-0xFFFFFF */
+ union { /* make all access sizes available. */
+- u8 c[0x400000 / 1]; /* read-only */
+- u16 s[0x400000 / 2]; /* read-write */
+- u32 l[0x400000 / 4]; /* read-only */
+- u64 d[0x400000 / 8]; /* read-only */
++ __u8 c[0x400000 / 1]; /* read-only */
++ __u16 s[0x400000 / 2]; /* read-write */
++ __u32 l[0x400000 / 4]; /* read-only */
++ __u64 d[0x400000 / 8]; /* read-only */
+ } b_external_flash; /* 0xC00000 */
+ } bridge_t;
+
+@@ -266,9 +266,9 @@
+ */
+ typedef struct bridge_err_cmdword_s {
+ union {
+- u32 cmd_word;
++ __u32 cmd_word;
+ struct {
+- u32 didn:4, /* Destination ID */
++ __u32 didn:4, /* Destination ID */
+ sidn:4, /* Source ID */
+ pactyp:4, /* Packet type */
+ tnum:5, /* Trans Number */
+@@ -799,17 +799,17 @@
+ #ifndef __ASSEMBLY__
+ /* Address translation entry for mapped pci32 accesses */
+ typedef union ate_u {
+- u64 ent;
++ __u64 ent;
+ struct ate_s {
+- u64 rmf:16;
+- u64 addr:36;
+- u64 targ:4;
+- u64 reserved:3;
+- u64 barrier:1;
+- u64 prefetch:1;
+- u64 precise:1;
+- u64 coherent:1;
+- u64 valid:1;
++ __u64 rmf:16;
++ __u64 addr:36;
++ __u64 targ:4;
++ __u64 reserved:3;
++ __u64 barrier:1;
++ __u64 prefetch:1;
++ __u64 precise:1;
++ __u64 coherent:1;
++ __u64 valid:1;
+ } field;
+ } ate_t;
+ #endif /* !__ASSEMBLY__ */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/pci_channel.h linux-libc-headers-2.6.8.0/include/asm-mips/pci_channel.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/pci_channel.h 2004-03-28 07:51:52.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/pci_channel.h 2004-08-26 05:21:47.000000000 -0500
+@@ -41,6 +41,6 @@
+ /*
+ * board supplied pci irq fixup routine
+ */
+-extern int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin);
++extern int pcibios_map_irq(struct pci_dev *dev, __u8 slot, __u8 pin);
+
+ #endif /* __ASM_PCI_CHANNEL_H */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/pgalloc.h linux-libc-headers-2.6.8.0/include/asm-mips/pgalloc.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/pgalloc.h 2004-06-09 07:00:41.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/pgalloc.h 2004-08-26 05:14:41.000000000 -0500
+@@ -85,7 +85,7 @@
+
+ #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
+
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ #define pgd_populate(mm, pmd, pte) BUG()
+
+ /*
+@@ -97,7 +97,7 @@
+ #define __pmd_free_tlb(tlb,x) do { } while (0)
+ #endif
+
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+
+ #define pgd_populate(mm, pgd, pmd) set_pgd(pgd, __pgd(pmd))
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/prctl.h linux-libc-headers-2.6.8.0/include/asm-mips/prctl.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/prctl.h 2003-12-15 12:47:02.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/prctl.h 2004-08-26 05:21:43.000000000 -0500
+@@ -12,21 +12,21 @@
+ #define PRDA ((struct prda *) PRDA_ADDRESS)
+
+ struct prda_sys {
+- pid_t t_pid;
+- u32 t_hint;
+- u32 t_dlactseq;
+- u32 t_fpflags;
+- u32 t_prid; /* processor type, $prid CP0 register */
+- u32 t_dlendseq;
+- u64 t_unused1[5];
+- pid_t t_rpid;
+- s32 t_resched;
+- u32 t_unused[8];
+- u32 t_cpu; /* current/last cpu */
++ pid_t t_pid;
++ __u32 t_hint;
++ __u32 t_dlactseq;
++ __u32 t_fpflags;
++ __u32 t_prid; /* processor type, $prid CP0 register */
++ __u32 t_dlendseq;
++ __u64 t_unused1[5];
++ pid_t t_rpid;
++ __s32 t_resched;
++ __u32 t_unused[8];
++ __u32 t_cpu; /* current/last cpu */
+
+ /* FIXME: The signal information, not supported by Linux now */
+- u32 t_flags; /* if true, then the sigprocmask is in userspace */
+- u32 t_sigprocmask [1]; /* the sigprocmask */
++ __u32 t_flags; /* if true, then the sigprocmask is in userspace */
++ __u32 t_sigprocmask [1]; /* the sigprocmask */
+ };
+
+ struct prda {
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/processor.h linux-libc-headers-2.6.8.0/include/asm-mips/processor.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/processor.h 2004-08-18 13:15:41.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/processor.h 2004-08-26 05:23:24.000000000 -0500
+@@ -102,7 +102,7 @@
+ #define MCA_bus 0
+ #define MCA_bus__is_a_macro /* for versions in ksyms.c */
+
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ /*
+ * User space process size: 2GB. This is hardcoded into a few places,
+ * so don't change it unless you know what you are doing.
+@@ -116,7 +116,7 @@
+ #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
+ #endif
+
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ /*
+ * User space process size: 1TB. This is hardcoded into a few places,
+ * so don't change it unless you know what you are doing. TASK_SIZE
+@@ -142,7 +142,7 @@
+
+ #define NUM_FPU_REGS 32
+
+-typedef u64 fpureg_t;
++typedef __u64 fpureg_t;
+
+ struct mips_fpu_hard_struct {
+ fpureg_t fpr[NUM_FPU_REGS];
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/ptrace.h linux-libc-headers-2.6.8.0/include/asm-mips/ptrace.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/ptrace.h 2004-03-28 07:51:52.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/ptrace.h 2004-08-26 05:14:41.000000000 -0500
+@@ -27,7 +27,7 @@
+ * system call/exception. As usual the registers k0/k1 aren't being saved.
+ */
+ struct pt_regs {
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ /* Pad bytes for argument save space on the stack. */
+ unsigned long pad0[6];
+ #endif
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/serial.h linux-libc-headers-2.6.8.0/include/asm-mips/serial.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/serial.h 2004-08-18 13:15:41.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/serial.h 2004-08-26 13:21:37.000000000 -0500
+@@ -68,7 +68,7 @@
+
+ #define _JAZZ_SERIAL_INIT(int, base) \
+ { .baud_base = JAZZ_BASE_BAUD, .irq = int, .flags = STD_COM_FLAGS, \
+- .iomem_base = (u8 *) base, .iomem_reg_shift = 0, \
++ .iomem_base = (__u8 *) base, .iomem_reg_shift = 0, \
+ .io_type = SERIAL_IO_MEM }
+ #define JAZZ_SERIAL_PORT_DEFNS \
+ _JAZZ_SERIAL_INIT(JAZZ_SERIAL1_IRQ, JAZZ_SERIAL1_BASE), \
+@@ -243,7 +243,7 @@
+ #define _JAGUAR_ATX_SERIAL_INIT(int, base) \
+ { baud_base: JAGUAR_ATX_BASE_BAUD, irq: int, \
+ flags: (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
+- iomem_base: (u8 *) base, iomem_reg_shift: 2, \
++ iomem_base: (__u8 *) base, iomem_reg_shift: 2, \
+ io_type: SERIAL_IO_MEM }
+ #define MOMENCO_JAGUAR_ATX_SERIAL_PORT_DEFNS \
+ _JAGUAR_ATX_SERIAL_INIT(JAGUAR_ATX_SERIAL1_IRQ, JAGUAR_ATX_SERIAL1_BASE)
+@@ -260,7 +260,7 @@
+
+ #define _OCELOT_SERIAL_INIT(int, base) \
+ { .baud_base = OCELOT_BASE_BAUD, .irq = int, .flags = STD_COM_FLAGS, \
+- .iomem_base = (u8 *) base, .iomem_reg_shift = 2, \
++ .iomem_base = (__u8 *) base, .iomem_reg_shift = 2, \
+ .io_type = SERIAL_IO_MEM }
+ #define MOMENCO_OCELOT_SERIAL_PORT_DEFNS \
+ _OCELOT_SERIAL_INIT(OCELOT_SERIAL1_IRQ, OCELOT_SERIAL1_BASE)
+@@ -281,7 +281,7 @@
+
+ #define _OCELOT_G_SERIAL_INIT(int, base) \
+ { .baud_base = OCELOT_G_BASE_BAUD, .irq = int, .flags = STD_COM_FLAGS,\
+- .iomem_base = (u8 *) base, .iomem_reg_shift = 2, \
++ .iomem_base = (__u8 *) base, .iomem_reg_shift = 2, \
+ .io_type = SERIAL_IO_MEM }
+ #define MOMENCO_OCELOT_G_SERIAL_PORT_DEFNS \
+ _OCELOT_G_SERIAL_INIT(OCELOT_G_SERIAL1_IRQ, OCELOT_G_SERIAL1_BASE)
+@@ -303,7 +303,7 @@
+ { .baud_base = OCELOT_C_BASE_BAUD, \
+ .irq = (int), \
+ .flags = STD_COM_FLAGS, \
+- .iomem_base = (u8 *) base, \
++ .iomem_base = (__u8 *) base, \
+ .iomem_reg_shift = 2, \
+ .io_type = SERIAL_IO_MEM \
+ }
+@@ -318,10 +318,10 @@
+ #include <asm/ddb5xxx/ddb5477.h>
+ #define DDB5477_SERIAL_PORT_DEFNS \
+ { .baud_base = BASE_BAUD, .irq = VRC5477_IRQ_UART0, \
+- .flags = STD_COM_FLAGS, .iomem_base = (u8*)0xbfa04200, \
++ .flags = STD_COM_FLAGS, .iomem_base = (__u8*)0xbfa04200, \
+ .iomem_reg_shift = 3, .io_type = SERIAL_IO_MEM}, \
+ { .baud_base = BASE_BAUD, .irq = VRC5477_IRQ_UART1, \
+- .flags = STD_COM_FLAGS, .iomem_base = (u8*)0xbfa04240, \
++ .flags = STD_COM_FLAGS, .iomem_base = (__u8*)0xbfa04240, \
+ .iomem_reg_shift = 3, .io_type = SERIAL_IO_MEM},
+ #else
+ #define DDB5477_SERIAL_PORT_DEFNS
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/hpc3.h linux-libc-headers-2.6.8.0/include/asm-mips/sgi/hpc3.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/hpc3.h 2003-12-15 12:47:03.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sgi/hpc3.h 2004-08-26 05:24:34.000000000 -0500
+@@ -17,8 +17,8 @@
+
+ /* An HPC DMA descriptor. */
+ struct hpc_dma_desc {
+- u32 pbuf; /* physical address of data buffer */
+- u32 cntinfo; /* counter and info bits */
++ __u32 pbuf; /* physical address of data buffer */
++ __u32 cntinfo; /* counter and info bits */
+ #define HPCDMA_EOX 0x80000000 /* last desc in chain for tx */
+ #define HPCDMA_EOR 0x80000000 /* last desc in chain for rx */
+ #define HPCDMA_EOXP 0x40000000 /* end of packet for tx */
+@@ -30,15 +30,15 @@
+ #define HPCDMA_OWN 0x00004000 /* Denotes ring buffer ownership on rx */
+ #define HPCDMA_BCNT 0x00003fff /* size in bytes of this dma buffer */
+
+- u32 pnext; /* paddr of next hpc_dma_desc if any */
++ __u32 pnext; /* paddr of next hpc_dma_desc if any */
+ };
+
+ /* The set of regs for each HPC3 PBUS DMA channel. */
+ struct hpc3_pbus_dmacregs {
+- volatile u32 pbdma_bptr; /* pbus dma channel buffer ptr */
+- volatile u32 pbdma_dptr; /* pbus dma channel desc ptr */
+- u32 _unused0[0x1000/4 - 2]; /* padding */
+- volatile u32 pbdma_ctrl; /* pbus dma channel control register has
++ volatile __u32 pbdma_bptr; /* pbus dma channel buffer ptr */
++ volatile __u32 pbdma_dptr; /* pbus dma channel desc ptr */
++ __u32 _unused0[0x1000/4 - 2]; /* padding */
++ volatile __u32 pbdma_ctrl; /* pbus dma channel control register has
+ * copletely different meaning for read
+ * compared with write */
+ /* read */
+@@ -55,20 +55,20 @@
+ #define HPC3_PDMACTRL_FB 0x003f0000 /* Ptr to beginning of fifo */
+ #define HPC3_PDMACTRL_FE 0x3f000000 /* Ptr to end of fifo */
+
+- u32 _unused1[0x1000/4 - 1]; /* padding */
++ __u32 _unused1[0x1000/4 - 1]; /* padding */
+ };
+
+ /* The HPC3 SCSI registers, this does not include external ones. */
+ struct hpc3_scsiregs {
+- volatile u32 cbptr; /* current dma buffer ptr, diagnostic use only */
+- volatile u32 ndptr; /* next dma descriptor ptr */
+- u32 _unused0[0x1000/4 - 2]; /* padding */
+- volatile u32 bcd; /* byte count info */
++ volatile __u32 cbptr; /* current dma buffer ptr, diagnostic use only */
++ volatile __u32 ndptr; /* next dma descriptor ptr */
++ __u32 _unused0[0x1000/4 - 2]; /* padding */
++ volatile __u32 bcd; /* byte count info */
+ #define HPC3_SBCD_BCNTMSK 0x00003fff /* bytes to transfer from/to memory */
+ #define HPC3_SBCD_XIE 0x00004000 /* Send IRQ when done with cur buf */
+ #define HPC3_SBCD_EOX 0x00008000 /* Indicates this is last buf in chain */
+
+- volatile u32 ctrl; /* control register */
++ volatile __u32 ctrl; /* control register */
+ #define HPC3_SCTRL_IRQ 0x01 /* IRQ asserted, either dma done or parity */
+ #define HPC3_SCTRL_ENDIAN 0x02 /* DMA endian mode, 0=big 1=little */
+ #define HPC3_SCTRL_DIR 0x04 /* DMA direction, 1=dev2mem 0=mem2dev */
+@@ -78,9 +78,9 @@
+ #define HPC3_SCTRL_CRESET 0x40 /* Resets dma channel and external controller */
+ #define HPC3_SCTRL_PERR 0x80 /* Bad parity on HPC3 iface to scsi controller */
+
+- volatile u32 gfptr; /* current GIO fifo ptr */
+- volatile u32 dfptr; /* current device fifo ptr */
+- volatile u32 dconfig; /* DMA configuration register */
++ volatile __u32 gfptr; /* current GIO fifo ptr */
++ volatile __u32 dfptr; /* current device fifo ptr */
++ volatile __u32 dconfig; /* DMA configuration register */
+ #define HPC3_SDCFG_HCLK 0x00001 /* Enable DMA half clock mode */
+ #define HPC3_SDCFG_D1 0x00006 /* Cycles to spend in D1 state */
+ #define HPC3_SDCFG_D2 0x00038 /* Cycles to spend in D2 state */
+@@ -92,7 +92,7 @@
+ #define HPC3_SDCFG_POLL 0x08000 /* hd_dreq polarity control */
+ #define HPC3_SDCFG_ERLY 0x30000 /* hd_dreq behavior control bits */
+
+- volatile u32 pconfig; /* PIO configuration register */
++ volatile __u32 pconfig; /* PIO configuration register */
+ #define HPC3_SPCFG_P3 0x0003 /* Cycles to spend in P3 state */
+ #define HPC3_SPCFG_P2W 0x001c /* Cycles to spend in P2 state for writes */
+ #define HPC3_SPCFG_P2R 0x01e0 /* Cycles to spend in P2 state for reads */
+@@ -102,21 +102,21 @@
+ #define HPC3_SPCFG_EPAR 0x4000 /* Enable parity checking for PIO */
+ #define HPC3_SPCFG_FUJI 0x8000 /* Fujitsu scsi controller mode for faster dma/pio */
+
+- u32 _unused1[0x1000/4 - 6]; /* padding */
++ __u32 _unused1[0x1000/4 - 6]; /* padding */
+ };
+
+ /* SEEQ ethernet HPC3 registers, only one seeq per HPC3. */
+ struct hpc3_ethregs {
+ /* Receiver registers. */
+- volatile u32 rx_cbptr; /* current dma buffer ptr, diagnostic use only */
+- volatile u32 rx_ndptr; /* next dma descriptor ptr */
+- u32 _unused0[0x1000/4 - 2]; /* padding */
+- volatile u32 rx_bcd; /* byte count info */
++ volatile __u32 rx_cbptr; /* current dma buffer ptr, diagnostic use only */
++ volatile __u32 rx_ndptr; /* next dma descriptor ptr */
++ __u32 _unused0[0x1000/4 - 2]; /* padding */
++ volatile __u32 rx_bcd; /* byte count info */
+ #define HPC3_ERXBCD_BCNTMSK 0x00003fff /* bytes to be sent to memory */
+ #define HPC3_ERXBCD_XIE 0x20000000 /* HPC3 interrupts cpu at end of this buf */
+ #define HPC3_ERXBCD_EOX 0x80000000 /* flags this as end of descriptor chain */
+
+- volatile u32 rx_ctrl; /* control register */
++ volatile __u32 rx_ctrl; /* control register */
+ #define HPC3_ERXCTRL_STAT50 0x0000003f /* Receive status reg bits of Seeq8003 */
+ #define HPC3_ERXCTRL_STAT6 0x00000040 /* Rdonly irq status */
+ #define HPC3_ERXCTRL_STAT7 0x00000080 /* Rdonlt old/new status bit from Seeq */
+@@ -125,15 +125,15 @@
+ #define HPC3_ERXCTRL_AMASK 0x00000400 /* Tells if ACTIVE inhibits PIO's to hpc3 */
+ #define HPC3_ERXCTRL_RBO 0x00000800 /* Receive buffer overflow if set to 1 */
+
+- volatile u32 rx_gfptr; /* current GIO fifo ptr */
+- volatile u32 rx_dfptr; /* current device fifo ptr */
+- u32 _unused1; /* padding */
+- volatile u32 rx_reset; /* reset register */
++ volatile __u32 rx_gfptr; /* current GIO fifo ptr */
++ volatile __u32 rx_dfptr; /* current device fifo ptr */
++ __u32 _unused1; /* padding */
++ volatile __u32 rx_reset; /* reset register */
+ #define HPC3_ERXRST_CRESET 0x1 /* Reset dma channel and external controller */
+ #define HPC3_ERXRST_CLRIRQ 0x2 /* Clear channel interrupt */
+ #define HPC3_ERXRST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */
+
+- volatile u32 rx_dconfig; /* DMA configuration register */
++ volatile __u32 rx_dconfig; /* DMA configuration register */
+ #define HPC3_ERXDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */
+ #define HPC3_ERXDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */
+ #define HPC3_ERXDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */
+@@ -143,26 +143,26 @@
+ #define HPC3_ERXDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */
+ #define HPC3_ERXDCFG_PTO 0x30000 /* Programmed timeout value for above two */
+
+- volatile u32 rx_pconfig; /* PIO configuration register */
++ volatile __u32 rx_pconfig; /* PIO configuration register */
+ #define HPC3_ERXPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */
+ #define HPC3_ERXPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */
+ #define HPC3_ERXPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */
+ #define HPC3_ERXPCFG_TST 0x1000 /* Diagnistic ram test feature bit */
+
+- u32 _unused2[0x1000/4 - 8]; /* padding */
++ __u32 _unused2[0x1000/4 - 8]; /* padding */
+
+ /* Transmitter registers. */
+- volatile u32 tx_cbptr; /* current dma buffer ptr, diagnostic use only */
+- volatile u32 tx_ndptr; /* next dma descriptor ptr */
+- u32 _unused3[0x1000/4 - 2]; /* padding */
+- volatile u32 tx_bcd; /* byte count info */
++ volatile __u32 tx_cbptr; /* current dma buffer ptr, diagnostic use only */
++ volatile __u32 tx_ndptr; /* next dma descriptor ptr */
++ __u32 _unused3[0x1000/4 - 2]; /* padding */
++ volatile __u32 tx_bcd; /* byte count info */
+ #define HPC3_ETXBCD_BCNTMSK 0x00003fff /* bytes to be read from memory */
+ #define HPC3_ETXBCD_ESAMP 0x10000000 /* if set, too late to add descriptor */
+ #define HPC3_ETXBCD_XIE 0x20000000 /* Interrupt cpu at end of cur desc */
+ #define HPC3_ETXBCD_EOP 0x40000000 /* Last byte of cur buf is end of packet */
+ #define HPC3_ETXBCD_EOX 0x80000000 /* This buf is the end of desc chain */
+
+- volatile u32 tx_ctrl; /* control register */
++ volatile __u32 tx_ctrl; /* control register */
+ #define HPC3_ETXCTRL_STAT30 0x0000000f /* Rdonly copy of seeq tx stat reg */
+ #define HPC3_ETXCTRL_STAT4 0x00000010 /* Indicate late collision occurred */
+ #define HPC3_ETXCTRL_STAT75 0x000000e0 /* Rdonly irq status from seeq */
+@@ -170,9 +170,9 @@
+ #define HPC3_ETXCTRL_ACTIVE 0x00000200 /* DMA tx channel is active */
+ #define HPC3_ETXCTRL_AMASK 0x00000400 /* Indicates ACTIVE inhibits PIO's */
+
+- volatile u32 tx_gfptr; /* current GIO fifo ptr */
+- volatile u32 tx_dfptr; /* current device fifo ptr */
+- u32 _unused4[0x1000/4 - 4]; /* padding */
++ volatile __u32 tx_gfptr; /* current GIO fifo ptr */
++ volatile __u32 tx_dfptr; /* current device fifo ptr */
++ __u32 _unused4[0x1000/4 - 4]; /* padding */
+ };
+
+ struct hpc3_regs {
+@@ -188,7 +188,7 @@
+ /* Here are where the hpc3 fifo's can be directly accessed
+ * via PIO accesses. Under normal operation we never stick
+ * our grubby paws in here so it's just padding. */
+- u32 _unused0[0x18000/4];
++ __u32 _unused0[0x18000/4];
+
+ /* HPC3 irq status regs. Due to a peculiar bug you need to
+ * look at two different register addresses to get at all of
+@@ -197,42 +197,42 @@
+ * reliably report bits 9:5 of the hpc3 irq status. I told
+ * you it was a peculiar bug. ;-)
+ */
+- volatile u32 istat0; /* Irq status, only bits <4:0> reliable. */
++ volatile __u32 istat0; /* Irq status, only bits <4:0> reliable. */
+ #define HPC3_ISTAT_PBIMASK 0x0ff /* irq bits for pbus devs 0 --> 7 */
+ #define HPC3_ISTAT_SC0MASK 0x100 /* irq bit for scsi channel 0 */
+ #define HPC3_ISTAT_SC1MASK 0x200 /* irq bit for scsi channel 1 */
+
+- volatile u32 gio_misc; /* GIO misc control bits. */
++ volatile __u32 gio_misc; /* GIO misc control bits. */
+ #define HPC3_GIOMISC_ERTIME 0x1 /* Enable external timer real time. */
+ #define HPC3_GIOMISC_DENDIAN 0x2 /* dma descriptor endian, 1=lit 0=big */
+
+- volatile u32 eeprom; /* EEPROM data reg. */
++ volatile __u32 eeprom; /* EEPROM data reg. */
+ #define HPC3_EEPROM_EPROT 0x01 /* Protect register enable */
+ #define HPC3_EEPROM_CSEL 0x02 /* Chip select */
+ #define HPC3_EEPROM_ECLK 0x04 /* EEPROM clock */
+ #define HPC3_EEPROM_DATO 0x08 /* Data out */
+ #define HPC3_EEPROM_DATI 0x10 /* Data in */
+
+- volatile u32 istat1; /* Irq status, only bits <9:5> reliable. */
+- volatile u32 bestat; /* Bus error interrupt status reg. */
++ volatile __u32 istat1; /* Irq status, only bits <9:5> reliable. */
++ volatile __u32 bestat; /* Bus error interrupt status reg. */
+ #define HPC3_BESTAT_BLMASK 0x000ff /* Bus lane where bad parity occurred */
+ #define HPC3_BESTAT_CTYPE 0x00100 /* Bus cycle type, 0=PIO 1=DMA */
+ #define HPC3_BESTAT_PIDSHIFT 9
+ #define HPC3_BESTAT_PIDMASK 0x3f700 /* DMA channel parity identifier */
+
+- u32 _unused1[0x14000/4 - 5]; /* padding */
++ __u32 _unused1[0x14000/4 - 5]; /* padding */
+
+ /* Now direct PIO per-HPC3 peripheral access to external regs. */
+- volatile u32 scsi0_ext[256]; /* SCSI channel 0 external regs */
+- u32 _unused2[0x7c00/4];
+- volatile u32 scsi1_ext[256]; /* SCSI channel 1 external regs */
+- u32 _unused3[0x7c00/4];
+- volatile u32 eth_ext[320]; /* Ethernet external registers */
+- u32 _unused4[0x3b00/4];
++ volatile __u32 scsi0_ext[256]; /* SCSI channel 0 external regs */
++ __u32 _unused2[0x7c00/4];
++ volatile __u32 scsi1_ext[256]; /* SCSI channel 1 external regs */
++ __u32 _unused3[0x7c00/4];
++ volatile __u32 eth_ext[320]; /* Ethernet external registers */
++ __u32 _unused4[0x3b00/4];
+
+ /* Per-peripheral device external registers and DMA/PIO control. */
+- volatile u32 pbus_extregs[16][256];
+- volatile u32 pbus_dmacfg[8][128];
++ volatile __u32 pbus_extregs[16][256];
++ volatile __u32 pbus_dmacfg[8][128];
+ /* Cycles to spend in D3 for reads */
+ #define HPC3_DMACFG_D3R_MASK 0x00000001
+ #define HPC3_DMACFG_D3R_SHIFT 0
+@@ -262,7 +262,7 @@
+ #define HPC3_DMACFG_BURST_SHIFT 22
+ /* Use live pbus_dreq unsynchronized signal */
+ #define HPC3_DMACFG_DRQLIVE 0x08000000
+- volatile u32 pbus_piocfg[16][64];
++ volatile __u32 pbus_piocfg[16][64];
+ /* Cycles to spend in P2 state for reads */
+ #define HPC3_PIOCFG_P2R_MASK 0x00001
+ #define HPC3_PIOCFG_P2R_SHIFT 0
+@@ -287,21 +287,21 @@
+ #define HPC3_PIOCFG_EVENHI 0x80000
+
+ /* PBUS PROM control regs. */
+- volatile u32 pbus_promwe; /* PROM write enable register */
++ volatile __u32 pbus_promwe; /* PROM write enable register */
+ #define HPC3_PROM_WENAB 0x1 /* Enable writes to the PROM */
+
+- u32 _unused5[0x0800/4 - 1];
+- volatile u32 pbus_promswap; /* Chip select swap reg */
++ __u32 _unused5[0x0800/4 - 1];
++ volatile __u32 pbus_promswap; /* Chip select swap reg */
+ #define HPC3_PROM_SWAP 0x1 /* invert GIO addr bit to select prom0 or prom1 */
+
+- u32 _unused6[0x0800/4 - 1];
+- volatile u32 pbus_gout; /* PROM general purpose output reg */
++ __u32 _unused6[0x0800/4 - 1];
++ volatile __u32 pbus_gout; /* PROM general purpose output reg */
+ #define HPC3_PROM_STAT 0x1 /* General purpose status bit in gout */
+
+- u32 _unused7[0x1000/4 - 1];
+- volatile u32 rtcregs[14]; /* Dallas clock registers */
+- u32 _unused8[50];
+- volatile u32 bbram[8192-50-14]; /* Battery backed ram */
++ __u32 _unused7[0x1000/4 - 1];
++ volatile __u32 rtcregs[14]; /* Dallas clock registers */
++ __u32 _unused8[50];
++ volatile __u32 bbram[8192-50-14]; /* Battery backed ram */
+ };
+
+ /*
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/ioc.h linux-libc-headers-2.6.8.0/include/asm-mips/sgi/ioc.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/ioc.h 2004-03-28 07:51:54.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sgi/ioc.h 2004-08-26 05:24:48.000000000 -0500
+@@ -22,26 +22,26 @@
+ */
+
+ struct sgioc_uart_regs {
+- u8 _ctrl1[3];
+- volatile u8 ctrl1;
+- u8 _data1[3];
+- volatile u8 data1;
+- u8 _ctrl2[3];
+- volatile u8 ctrl2;
+- u8 _data2[3];
+- volatile u8 data2;
++ __u8 _ctrl1[3];
++ volatile __u8 ctrl1;
++ __u8 _data1[3];
++ volatile __u8 data1;
++ __u8 _ctrl2[3];
++ volatile __u8 ctrl2;
++ __u8 _data2[3];
++ volatile __u8 data2;
+ };
+
+ struct sgioc_keyb_regs {
+- u8 _data[3];
+- volatile u8 data;
+- u8 _command[3];
+- volatile u8 command;
++ __u8 _data[3];
++ volatile __u8 data;
++ __u8 _command[3];
++ volatile __u8 command;
+ };
+
+ struct sgint_regs {
+- u8 _istat0[3];
+- volatile u8 istat0; /* Interrupt status zero */
++ __u8 _istat0[3];
++ volatile __u8 istat0; /* Interrupt status zero */
+ #define SGINT_ISTAT0_FFULL 0x01
+ #define SGINT_ISTAT0_SCSI0 0x02
+ #define SGINT_ISTAT0_SCSI1 0x04
+@@ -50,10 +50,10 @@
+ #define SGINT_ISTAT0_PPORT 0x20
+ #define SGINT_ISTAT0_HPC2 0x40
+ #define SGINT_ISTAT0_LIO2 0x80
+- u8 _imask0[3];
+- volatile u8 imask0; /* Interrupt mask zero */
+- u8 _istat1[3];
+- volatile u8 istat1; /* Interrupt status one */
++ __u8 _imask0[3];
++ volatile __u8 imask0; /* Interrupt mask zero */
++ __u8 _istat1[3];
++ volatile __u8 istat1; /* Interrupt status one */
+ #define SGINT_ISTAT1_ISDNI 0x01
+ #define SGINT_ISTAT1_PWR 0x02
+ #define SGINT_ISTAT1_ISDNH 0x04
+@@ -62,29 +62,29 @@
+ #define SGINT_ISTAT1_AFAIL 0x20
+ #define SGINT_ISTAT1_VIDEO 0x40
+ #define SGINT_ISTAT1_GIO2 0x80
+- u8 _imask1[3];
+- volatile u8 imask1; /* Interrupt mask one */
+- u8 _vmeistat[3];
+- volatile u8 vmeistat; /* VME interrupt status */
+- u8 _cmeimask0[3];
+- volatile u8 cmeimask0; /* VME interrupt mask zero */
+- u8 _cmeimask1[3];
+- volatile u8 cmeimask1; /* VME interrupt mask one */
+- u8 _cmepol[3];
+- volatile u8 cmepol; /* VME polarity */
+- u8 _tclear[3];
+- volatile u8 tclear;
+- u8 _errstat[3];
+- volatile u8 errstat; /* Error status reg, reserved on INT2 */
+- u32 _unused0[2];
+- u8 _tcnt0[3];
+- volatile u8 tcnt0; /* counter 0 */
+- u8 _tcnt1[3];
+- volatile u8 tcnt1; /* counter 1 */
+- u8 _tcnt2[3];
+- volatile u8 tcnt2; /* counter 2 */
+- u8 _tcword[3];
+- volatile u8 tcword; /* control word */
++ __u8 _imask1[3];
++ volatile __u8 imask1; /* Interrupt mask one */
++ __u8 _vmeistat[3];
++ volatile __u8 vmeistat; /* VME interrupt status */
++ __u8 _cmeimask0[3];
++ volatile __u8 cmeimask0; /* VME interrupt mask zero */
++ __u8 _cmeimask1[3];
++ volatile __u8 cmeimask1; /* VME interrupt mask one */
++ __u8 _cmepol[3];
++ volatile __u8 cmepol; /* VME polarity */
++ __u8 _tclear[3];
++ volatile __u8 tclear;
++ __u8 _errstat[3];
++ volatile __u8 errstat; /* Error status reg, reserved on INT2 */
++ __u32 _unused0[2];
++ __u8 _tcnt0[3];
++ volatile __u8 tcnt0; /* counter 0 */
++ __u8 _tcnt1[3];
++ volatile __u8 tcnt1; /* counter 1 */
++ __u8 _tcnt2[3];
++ volatile __u8 tcnt2; /* counter 2 */
++ __u8 _tcword[3];
++ volatile __u8 tcword; /* control word */
+ #define SGINT_TCWORD_BCD 0x01 /* Use BCD mode for counters */
+ #define SGINT_TCWORD_MMASK 0x0e /* Mode bitmask. */
+ #define SGINT_TCWORD_MITC 0x00 /* IRQ on terminal count (doesn't work) */
+@@ -115,55 +115,55 @@
+ #define SGINT_TCSAMP_COUNTER ((SGINT_TIMER_CLOCK / HZ) + 255)
+
+ /* We need software copies of these because they are write only. */
+-extern u8 sgi_ioc_reset, sgi_ioc_write;
++extern __u8 sgi_ioc_reset, sgi_ioc_write;
+
+ struct sgioc_regs {
+ struct pi1_regs pport;
+- u32 _unused0[2];
++ __u32 _unused0[2];
+ struct sgioc_uart_regs serport;
+ struct sgioc_keyb_regs kbdmouse;
+- u8 _gcsel[3];
+- volatile u8 gcsel;
+- u8 _genctrl[3];
+- volatile u8 genctrl;
+- u8 _panel[3];
+- volatile u8 panel;
++ __u8 _gcsel[3];
++ volatile __u8 gcsel;
++ __u8 _genctrl[3];
++ volatile __u8 genctrl;
++ __u8 _panel[3];
++ volatile __u8 panel;
+ #define SGIOC_PANEL_POWERON 0x01
+ #define SGIOC_PANEL_POWERINTR 0x02
+ #define SGIOC_PANEL_VOLDNINTR 0x10
+ #define SGIOC_PANEL_VOLDNHOLD 0x20
+ #define SGIOC_PANEL_VOLUPINTR 0x40
+ #define SGIOC_PANEL_VOLUPHOLD 0x80
+- u32 _unused1;
+- u8 _sysid[3];
+- volatile u8 sysid;
++ __u32 _unused1;
++ __u8 _sysid[3];
++ volatile __u8 sysid;
+ #define SGIOC_SYSID_FULLHOUSE 0x01
+ #define SGIOC_SYSID_BOARDREV(x) ((x & 0xe0) > 5)
+ #define SGIOC_SYSID_CHIPREV(x) ((x & 0x1e) > 1)
+- u32 _unused2;
+- u8 _read[3];
+- volatile u8 read;
+- u32 _unused3;
+- u8 _dmasel[3];
+- volatile u8 dmasel;
++ __u32 _unused2;
++ __u8 _read[3];
++ volatile __u8 read;
++ __u32 _unused3;
++ __u8 _dmasel[3];
++ volatile __u8 dmasel;
+ #define SGIOC_DMASEL_SCLK10MHZ 0x00 /* use 10MHZ serial clock */
+ #define SGIOC_DMASEL_ISDNB 0x01 /* enable isdn B */
+ #define SGIOC_DMASEL_ISDNA 0x02 /* enable isdn A */
+ #define SGIOC_DMASEL_PPORT 0x04 /* use parallel DMA */
+ #define SGIOC_DMASEL_SCLK667MHZ 0x10 /* use 6.67MHZ serial clock */
+ #define SGIOC_DMASEL_SCLKEXT 0x20 /* use external serial clock */
+- u32 _unused4;
+- u8 _reset[3];
+- volatile u8 reset;
++ __u32 _unused4;
++ __u8 _reset[3];
++ volatile __u8 reset;
+ #define SGIOC_RESET_PPORT 0x01 /* 0=parport reset, 1=nornal */
+ #define SGIOC_RESET_KBDMOUSE 0x02 /* 0=kbdmouse reset, 1=normal */
+ #define SGIOC_RESET_EISA 0x04 /* 0=eisa reset, 1=normal */
+ #define SGIOC_RESET_ISDN 0x08 /* 0=isdn reset, 1=normal */
+ #define SGIOC_RESET_LC0OFF 0x10 /* guiness: turn led off (red, else green) */
+ #define SGIOC_RESET_LC1OFF 0x20 /* guiness: turn led off (green, else amber) */
+- u32 _unused5;
+- u8 _write[3];
+- volatile u8 write;
++ __u32 _unused5;
++ __u8 _write[3];
++ volatile __u8 write;
+ #define SGIOC_WRITE_NTHRESH 0x01 /* use 4.5db threshhold */
+ #define SGIOC_WRITE_TPSPEED 0x02 /* use 100ohm TP speed */
+ #define SGIOC_WRITE_EPSEL 0x04 /* force cable mode: 1=AUI 0=TP */
+@@ -172,10 +172,10 @@
+ #define SGIOC_WRITE_U0AMODE 0x20 /* 1=PC 0=MAC UART mode */
+ #define SGIOC_WRITE_MLO 0x40 /* 1=4.75V 0=+5V */
+ #define SGIOC_WRITE_MHI 0x80 /* 1=5.25V 0=+5V */
+- u32 _unused6;
++ __u32 _unused6;
+ struct sgint_regs int3;
+- u32 _unused7[16];
+- volatile u32 extio; /* FullHouse only */
++ __u32 _unused7[16];
++ volatile __u32 extio; /* FullHouse only */
+ #define EXTIO_S0_IRQ_3 0x8000 /* S0: vid.vsync */
+ #define EXTIO_S0_IRQ_2 0x4000 /* S0: gfx.fifofull */
+ #define EXTIO_S0_IRQ_1 0x2000 /* S0: gfx.int */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/mc.h linux-libc-headers-2.6.8.0/include/asm-mips/sgi/mc.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/mc.h 2003-12-15 12:47:03.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sgi/mc.h 2004-08-26 05:25:28.000000000 -0500
+@@ -14,8 +14,8 @@
+ #define _SGI_MC_H
+
+ struct sgimc_regs {
+- u32 _unused0;
+- volatile u32 cpuctrl0; /* CPU control register 0, readwrite */
++ __u32 _unused0;
++ volatile __u32 cpuctrl0; /* CPU control register 0, readwrite */
+ #define SGIMC_CCTRL0_REFS 0x0000000f /* REFS mask */
+ #define SGIMC_CCTRL0_EREFRESH 0x00000010 /* Memory refresh enable */
+ #define SGIMC_CCTRL0_EPERRGIO 0x00000020 /* GIO parity error enable */
+@@ -35,8 +35,8 @@
+ #define SGIMC_CCTRL0_CMEMBADPAR 0x02000000 /* Generate bad perr from cpu to mem */
+ #define SGIMC_CCTRL0_R4KNOCHKPARR 0x04000000 /* Don't chk parity on mem data reads */
+ #define SGIMC_CCTRL0_GIOBTOB 0x08000000 /* Allow GIO back to back writes */
+- u32 _unused1;
+- volatile u32 cpuctrl1; /* CPU control register 1, readwrite */
++ __u32 _unused1;
++ volatile __u32 cpuctrl1; /* CPU control register 1, readwrite */
+ #define SGIMC_CCTRL1_EGIOTIMEO 0x00000010 /* GIO bus timeout enable */
+ #define SGIMC_CCTRL1_FIXEDEHPC 0x00001000 /* Fixed HPC endianness */
+ #define SGIMC_CCTRL1_LITTLEHPC 0x00002000 /* Little endian HPC */
+@@ -45,33 +45,33 @@
+ #define SGIMC_CCTRL1_FIXEDEEXP1 0x00010000 /* Fixed EXP1 endianness */
+ #define SGIMC_CCTRL1_LITTLEEXP1 0x00020000 /* Little endian EXP1 */
+
+- u32 _unused2;
+- volatile u32 watchdogt; /* Watchdog reg rdonly, write clears */
++ __u32 _unused2;
++ volatile __u32 watchdogt; /* Watchdog reg rdonly, write clears */
+
+- u32 _unused3;
+- volatile u32 systemid; /* MC system ID register, readonly */
++ __u32 _unused3;
++ volatile __u32 systemid; /* MC system ID register, readonly */
+ #define SGIMC_SYSID_MASKREV 0x0000000f /* Revision of MC controller */
+ #define SGIMC_SYSID_EPRESENT 0x00000010 /* Indicates presence of EISA bus */
+
+- u32 _unused4[3];
+- volatile u32 divider; /* Divider reg for RPSS */
++ __u32 _unused4[3];
++ volatile __u32 divider; /* Divider reg for RPSS */
+
+- u32 _unused5;
+- volatile u32 eeprom; /* EEPROM byte reg for r4k */
++ __u32 _unused5;
++ volatile __u32 eeprom; /* EEPROM byte reg for r4k */
+ #define SGIMC_EEPROM_PRE 0x00000001 /* eeprom chip PRE pin assertion */
+ #define SGIMC_EEPROM_CSEL 0x00000002 /* Active high, eeprom chip select */
+ #define SGIMC_EEPROM_SECLOCK 0x00000004 /* EEPROM serial clock */
+ #define SGIMC_EEPROM_SDATAO 0x00000008 /* Serial EEPROM data-out */
+ #define SGIMC_EEPROM_SDATAI 0x00000010 /* Serial EEPROM data-in */
+
+- u32 _unused6[3];
+- volatile u32 rcntpre; /* Preload refresh counter */
++ __u32 _unused6[3];
++ volatile __u32 rcntpre; /* Preload refresh counter */
+
+- u32 _unused7;
+- volatile u32 rcounter; /* Readonly refresh counter */
++ __u32 _unused7;
++ volatile __u32 rcounter; /* Readonly refresh counter */
+
+- u32 _unused8[13];
+- volatile u32 giopar; /* Parameter word for GIO64 */
++ __u32 _unused8[13];
++ volatile __u32 giopar; /* Parameter word for GIO64 */
+ #define SGIMC_GIOPAR_HPC64 0x00000001 /* HPC talks to GIO using 64-bits */
+ #define SGIMC_GIOPAR_GFX64 0x00000002 /* GFX talks to GIO using 64-bits */
+ #define SGIMC_GIOPAR_EXP064 0x00000004 /* EXP(slot0) talks using 64-bits */
+@@ -89,36 +89,36 @@
+ #define SGIMC_GIOPAR_PLINEEXP0 0x00004000 /* EXP(slot0) has pipeline attr */
+ #define SGIMC_GIOPAR_PLINEEXP1 0x00008000 /* EXP(slot1) has pipeline attr */
+
+- u32 _unused9;
+- volatile u32 cputp; /* CPU bus arb time period */
++ __u32 _unused9;
++ volatile __u32 cputp; /* CPU bus arb time period */
+
+- u32 _unused10[3];
+- volatile u32 lbursttp; /* Time period for long bursts */
++ __u32 _unused10[3];
++ volatile __u32 lbursttp; /* Time period for long bursts */
+
+ /* MC chip can drive up to 4 bank 4 SIMMs each. All SIMMs in bank must
+ * be the same size. The size encoding for supported SIMMs is bellow */
+- u32 _unused11[9];
+- volatile u32 mconfig0; /* Memory config register zero */
+- u32 _unused12;
+- volatile u32 mconfig1; /* Memory config register one */
++ __u32 _unused11[9];
++ volatile __u32 mconfig0; /* Memory config register zero */
++ __u32 _unused12;
++ volatile __u32 mconfig1; /* Memory config register one */
+ #define SGIMC_MCONFIG_BASEADDR 0x000000ff /* Base address of bank*/
+ #define SGIMC_MCONFIG_RMASK 0x00001f00 /* Ram config bitmask */
+ #define SGIMC_MCONFIG_BVALID 0x00002000 /* Bank is valid */
+ #define SGIMC_MCONFIG_SBANKS 0x00004000 /* Number of subbanks */
+
+- u32 _unused13;
+- volatile u32 cmacc; /* Mem access config for CPU */
+- u32 _unused14;
+- volatile u32 gmacc; /* Mem access config for GIO */
++ __u32 _unused13;
++ volatile __u32 cmacc; /* Mem access config for CPU */
++ __u32 _unused14;
++ volatile __u32 gmacc; /* Mem access config for GIO */
+
+ /* This define applies to both cmacc and gmacc registers above. */
+ #define SGIMC_MACC_ALIASBIG 0x20000000 /* 512MB home for alias */
+
+ /* Error address/status regs from GIO and CPU perspectives. */
+- u32 _unused15;
+- volatile u32 cerr; /* Error address reg for CPU */
+- u32 _unused16;
+- volatile u32 cstat; /* Status reg for CPU */
++ __u32 _unused15;
++ volatile __u32 cerr; /* Error address reg for CPU */
++ __u32 _unused16;
++ volatile __u32 cstat; /* Status reg for CPU */
+ #define SGIMC_CSTAT_RD 0x00000100 /* read parity error */
+ #define SGIMC_CSTAT_PAR 0x00000200 /* CPU parity error */
+ #define SGIMC_CSTAT_ADDR 0x00000400 /* memory bus error bad addr */
+@@ -128,10 +128,10 @@
+ #define SGIMC_CSTAT_PAR_MASK 0x00001f00 /* parity error mask */
+ #define SGIMC_CSTAT_RD_PAR (SGIMC_CSTAT_RD | SGIMC_CSTAT_PAR)
+
+- u32 _unused17;
+- volatile u32 gerr; /* Error address reg for GIO */
+- u32 _unused18;
+- volatile u32 gstat; /* Status reg for GIO */
++ __u32 _unused17;
++ volatile __u32 gerr; /* Error address reg for GIO */
++ __u32 _unused18;
++ volatile __u32 gstat; /* Status reg for GIO */
+ #define SGIMC_GSTAT_RD 0x00000100 /* read parity error */
+ #define SGIMC_GSTAT_WR 0x00000200 /* write parity error */
+ #define SGIMC_GSTAT_TIME 0x00000400 /* GIO bus timed out */
+@@ -142,76 +142,76 @@
+ #define SGIMC_GSTAT_PIO_WR 0x00008000 /* write data parity on pio */
+
+ /* Special hard bus locking registers. */
+- u32 _unused19;
+- volatile u32 syssembit; /* Uni-bit system semaphore */
+- u32 _unused20;
+- volatile u32 mlock; /* Global GIO memory access lock */
+- u32 _unused21;
+- volatile u32 elock; /* Locks EISA from GIO accesses */
++ __u32 _unused19;
++ volatile __u32 syssembit; /* Uni-bit system semaphore */
++ __u32 _unused20;
++ volatile __u32 mlock; /* Global GIO memory access lock */
++ __u32 _unused21;
++ volatile __u32 elock; /* Locks EISA from GIO accesses */
+
+ /* GIO dma control registers. */
+- u32 _unused22[15];
+- volatile u32 gio_dma_trans; /* DMA mask to translation GIO addrs */
+- u32 _unused23;
+- volatile u32 gio_dma_sbits; /* DMA GIO addr substitution bits */
+- u32 _unused24;
+- volatile u32 dma_intr_cause; /* DMA IRQ cause indicator bits */
+- u32 _unused25;
+- volatile u32 dma_ctrl; /* Main DMA control reg */
++ __u32 _unused22[15];
++ volatile __u32 gio_dma_trans; /* DMA mask to translation GIO addrs */
++ __u32 _unused23;
++ volatile __u32 gio_dma_sbits; /* DMA GIO addr substitution bits */
++ __u32 _unused24;
++ volatile __u32 dma_intr_cause; /* DMA IRQ cause indicator bits */
++ __u32 _unused25;
++ volatile __u32 dma_ctrl; /* Main DMA control reg */
+
+ /* DMA TLB entry 0 */
+- u32 _unused26[5];
+- volatile u32 dtlb_hi0;
+- u32 _unused27;
+- volatile u32 dtlb_lo0;
++ __u32 _unused26[5];
++ volatile __u32 dtlb_hi0;
++ __u32 _unused27;
++ volatile __u32 dtlb_lo0;
+
+ /* DMA TLB entry 1 */
+- u32 _unused28;
+- volatile u32 dtlb_hi1;
+- u32 _unused29;
+- volatile u32 dtlb_lo1;
++ __u32 _unused28;
++ volatile __u32 dtlb_hi1;
++ __u32 _unused29;
++ volatile __u32 dtlb_lo1;
+
+ /* DMA TLB entry 2 */
+- u32 _unused30;
+- volatile u32 dtlb_hi2;
+- u32 _unused31;
+- volatile u32 dtlb_lo2;
++ __u32 _unused30;
++ volatile __u32 dtlb_hi2;
++ __u32 _unused31;
++ volatile __u32 dtlb_lo2;
+
+ /* DMA TLB entry 3 */
+- u32 _unused32;
+- volatile u32 dtlb_hi3;
+- u32 _unused33;
+- volatile u32 dtlb_lo3;
++ __u32 _unused32;
++ volatile __u32 dtlb_hi3;
++ __u32 _unused33;
++ volatile __u32 dtlb_lo3;
+
+- u32 _unused34[0x0392];
++ __u32 _unused34[0x0392];
+
+- u32 _unused35;
+- volatile u32 rpsscounter; /* Chirps at 100ns */
++ __u32 _unused35;
++ volatile __u32 rpsscounter; /* Chirps at 100ns */
+
+- u32 _unused36[0x1000/4-2*4];
++ __u32 _unused36[0x1000/4-2*4];
+
+- u32 _unused37;
+- volatile u32 maddronly; /* Address DMA goes at */
+- u32 _unused38;
+- volatile u32 maddrpdeflts; /* Same as above, plus set defaults */
+- u32 _unused39;
+- volatile u32 dmasz; /* DMA count */
+- u32 _unused40;
+- volatile u32 ssize; /* DMA stride size */
+- u32 _unused41;
+- volatile u32 gmaddronly; /* Set GIO DMA but don't start trans */
+- u32 _unused42;
+- volatile u32 dmaddnpgo; /* Set GIO DMA addr + start transfer */
+- u32 _unused43;
+- volatile u32 dmamode; /* DMA mode config bit settings */
+- u32 _unused44;
+- volatile u32 dmaccount; /* Zoom and byte count for DMA */
+- u32 _unused45;
+- volatile u32 dmastart; /* Pedal to the metal. */
+- u32 _unused46;
+- volatile u32 dmarunning; /* DMA op is in progress */
+- u32 _unused47;
+- volatile u32 maddrdefstart; /* Set dma addr, defaults, and kick it */
++ __u32 _unused37;
++ volatile __u32 maddronly; /* Address DMA goes at */
++ __u32 _unused38;
++ volatile __u32 maddrpdeflts; /* Same as above, plus set defaults */
++ __u32 _unused39;
++ volatile __u32 dmasz; /* DMA count */
++ __u32 _unused40;
++ volatile __u32 ssize; /* DMA stride size */
++ __u32 _unused41;
++ volatile __u32 gmaddronly; /* Set GIO DMA but don't start trans */
++ __u32 _unused42;
++ volatile __u32 dmaddnpgo; /* Set GIO DMA addr + start transfer */
++ __u32 _unused43;
++ volatile __u32 dmamode; /* DMA mode config bit settings */
++ __u32 _unused44;
++ volatile __u32 dmaccount; /* Zoom and byte count for DMA */
++ __u32 _unused45;
++ volatile __u32 dmastart; /* Pedal to the metal. */
++ __u32 _unused46;
++ volatile __u32 dmarunning; /* DMA op is in progress */
++ __u32 _unused47;
++ volatile __u32 maddrdefstart; /* Set dma addr, defaults, and kick it */
+ };
+
+ extern struct sgimc_regs *sgimc;
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgiarcs.h linux-libc-headers-2.6.8.0/include/asm-mips/sgiarcs.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgiarcs.h 2004-03-28 07:51:52.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sgiarcs.h 2004-08-26 05:21:53.000000000 -0500
+@@ -164,11 +164,11 @@
+ /* This prom has a bolixed design. */
+ struct linux_bigint {
+ #ifdef __MIPSEL__
+- u32 lo;
+- s32 hi;
++ __u32 lo;
++ __s32 hi;
+ #else /* !(__MIPSEL__) */
+- s32 hi;
+- u32 lo;
++ __s32 hi;
++ __u32 lo;
+ #endif
+ };
+
+@@ -366,7 +366,7 @@
+ * Macros for calling a 32-bit ARC implementation from 64-bit code
+ */
+
+-#if defined(CONFIG_MIPS64) && defined(CONFIG_ARC32)
++#if defined(__mips64) && defined(CONFIG_ARC32)
+
+ #define __arc_clobbers \
+ "$2","$3" /* ... */, "$8","$9","$10","$11", \
+@@ -475,10 +475,10 @@
+ __res; \
+ })
+
+-#endif /* defined(CONFIG_MIPS64) && defined(CONFIG_ARC32) */
++#endif /* defined(__mips64) && defined(CONFIG_ARC32) */
+
+-#if (defined(CONFIG_MIPS32) && defined(CONFIG_ARC32)) || \
+- (defined(CONFIG_MIPS64) && defined(CONFIG_ARC64))
++#if (!defined(__mips64) && defined(CONFIG_ARC32)) || \
++ (defined(__mips64) && defined(CONFIG_ARC64))
+
+ #define ARC_CALL0(dest) \
+ ({ long __res; \
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/siginfo.h linux-libc-headers-2.6.8.0/include/asm-mips/siginfo.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/siginfo.h 2004-06-09 07:00:41.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/siginfo.h 2004-08-26 05:14:41.000000000 -0500
+@@ -66,10 +66,10 @@
+
+ /* SIGPOLL, SIGXFSZ (To do ...) */
+ struct {
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ #endif
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ long _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ #endif
+ int _fd;
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sim.h linux-libc-headers-2.6.8.0/include/asm-mips/sim.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sim.h 2004-03-28 07:51:52.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sim.h 2004-08-26 05:17:16.000000000 -0500
+@@ -18,7 +18,7 @@
+ #define __str2(x) #x
+ #define __str(x) __str2(x)
+
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+
+ #define save_static_function(symbol) \
+ __asm__ ( \
+@@ -43,9 +43,9 @@
+
+ #define nabi_no_regargs
+
+-#endif /* CONFIG_MIPS32 */
++#endif /* ndef __mips64 */
+
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+
+ #define save_static_function(symbol) \
+ __asm__ ( \
+@@ -78,6 +78,6 @@
+ unsigned long __dummy6, \
+ unsigned long __dummy7,
+
+-#endif /* CONFIG_MIPS64 */
++#endif /* __mips64 */
+
+ #endif /* _ASM_SIM_H */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/arch.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/arch.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/arch.h 2004-06-09 07:00:42.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/arch.h 2004-08-26 05:26:16.000000000 -0500
+@@ -17,8 +17,8 @@
+ #include <asm/sn/sn0/arch.h>
+ #endif
+
+-typedef u64 hubreg_t;
+-typedef u64 nic_t;
++typedef __u64 hubreg_t;
++typedef __u64 nic_t;
+
+ #define cputonasid(cpu) (cpu_data[(cpu)].p_nasid)
+ #define cputoslice(cpu) (cpu_data[(cpu)].p_slice)
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/gda.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/gda.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/gda.h 2003-12-15 12:47:02.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/gda.h 2004-08-26 05:26:30.000000000 -0500
+@@ -44,11 +44,11 @@
+ #ifndef __ASSEMBLY__
+
+ typedef struct gda {
+- u32 g_magic; /* GDA magic number */
+- u16 g_version; /* Version of this structure */
+- u16 g_masterid; /* The NASID:CPUNUM of the master cpu */
+- u32 g_promop; /* Passes requests from the kernel to prom */
+- u32 g_vds; /* Store the virtual dipswitches here */
++ __u32 g_magic; /* GDA magic number */
++ __u16 g_version; /* Version of this structure */
++ __u16 g_masterid; /* The NASID:CPUNUM of the master cpu */
++ __u32 g_promop; /* Passes requests from the kernel to prom */
++ __u32 g_vds; /* Store the virtual dipswitches here */
+ void **g_hooked_norm;/* ptr to pda loc for norm hndlr */
+ void **g_hooked_utlb;/* ptr to pda loc for utlb hndlr */
+ void **g_hooked_xtlb;/* ptr to pda loc for xtlb hndlr */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/ioc3.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/ioc3.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/ioc3.h 2003-12-15 12:47:02.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/ioc3.h 2004-08-26 05:26:06.000000000 -0500
+@@ -8,23 +8,23 @@
+ /* SUPERIO uart register map */
+ typedef volatile struct ioc3_uartregs {
+ union {
+- volatile u8 rbr; /* read only, DLAB == 0 */
+- volatile u8 thr; /* write only, DLAB == 0 */
+- volatile u8 dll; /* DLAB == 1 */
++ volatile __u8 rbr; /* read only, DLAB == 0 */
++ volatile __u8 thr; /* write only, DLAB == 0 */
++ volatile __u8 dll; /* DLAB == 1 */
+ } u1;
+ union {
+- volatile u8 ier; /* DLAB == 0 */
+- volatile u8 dlm; /* DLAB == 1 */
++ volatile __u8 ier; /* DLAB == 0 */
++ volatile __u8 dlm; /* DLAB == 1 */
+ } u2;
+ union {
+- volatile u8 iir; /* read only */
+- volatile u8 fcr; /* write only */
++ volatile __u8 iir; /* read only */
++ volatile __u8 fcr; /* write only */
+ } u3;
+- volatile u8 iu_lcr;
+- volatile u8 iu_mcr;
+- volatile u8 iu_lsr;
+- volatile u8 iu_msr;
+- volatile u8 iu_scr;
++ volatile __u8 iu_lcr;
++ volatile __u8 iu_mcr;
++ volatile __u8 iu_lsr;
++ volatile __u8 iu_msr;
++ volatile __u8 iu_scr;
+ } ioc3_uregs_t;
+
+ #define iu_rbr u1.rbr
+@@ -36,29 +36,29 @@
+ #define iu_fcr u3.fcr
+
+ struct ioc3_sioregs {
+- volatile u8 fill[0x141]; /* starts at 0x141 */
++ volatile __u8 fill[0x141]; /* starts at 0x141 */
+
+- volatile u8 uartc;
+- volatile u8 kbdcg;
++ volatile __u8 uartc;
++ volatile __u8 kbdcg;
+
+- volatile u8 fill0[0x150 - 0x142 - 1];
++ volatile __u8 fill0[0x150 - 0x142 - 1];
+
+- volatile u8 pp_data;
+- volatile u8 pp_dsr;
+- volatile u8 pp_dcr;
++ volatile __u8 pp_data;
++ volatile __u8 pp_dsr;
++ volatile __u8 pp_dcr;
+
+- volatile u8 fill1[0x158 - 0x152 - 1];
++ volatile __u8 fill1[0x158 - 0x152 - 1];
+
+- volatile u8 pp_fifa;
+- volatile u8 pp_cfgb;
+- volatile u8 pp_ecr;
++ volatile __u8 pp_fifa;
++ volatile __u8 pp_cfgb;
++ volatile __u8 pp_ecr;
+
+- volatile u8 fill2[0x168 - 0x15a - 1];
++ volatile __u8 fill2[0x168 - 0x15a - 1];
+
+- volatile u8 rtcad;
+- volatile u8 rtcdat;
++ volatile __u8 rtcad;
++ volatile __u8 rtcdat;
+
+- volatile u8 fill3[0x170 - 0x169 - 1];
++ volatile __u8 fill3[0x170 - 0x169 - 1];
+
+ struct ioc3_uartregs uartb; /* 0x20170 */
+ struct ioc3_uartregs uarta; /* 0x20178 */
+@@ -66,103 +66,103 @@
+
+ /* Register layout of IOC3 in configuration space. */
+ struct ioc3 {
+- volatile u32 pad0[7]; /* 0x00000 */
+- volatile u32 sio_ir; /* 0x0001c */
+- volatile u32 sio_ies; /* 0x00020 */
+- volatile u32 sio_iec; /* 0x00024 */
+- volatile u32 sio_cr; /* 0x00028 */
+- volatile u32 int_out; /* 0x0002c */
+- volatile u32 mcr; /* 0x00030 */
++ volatile __u32 pad0[7]; /* 0x00000 */
++ volatile __u32 sio_ir; /* 0x0001c */
++ volatile __u32 sio_ies; /* 0x00020 */
++ volatile __u32 sio_iec; /* 0x00024 */
++ volatile __u32 sio_cr; /* 0x00028 */
++ volatile __u32 int_out; /* 0x0002c */
++ volatile __u32 mcr; /* 0x00030 */
+
+ /* General Purpose I/O registers */
+- volatile u32 gpcr_s; /* 0x00034 */
+- volatile u32 gpcr_c; /* 0x00038 */
+- volatile u32 gpdr; /* 0x0003c */
+- volatile u32 gppr_0; /* 0x00040 */
+- volatile u32 gppr_1; /* 0x00044 */
+- volatile u32 gppr_2; /* 0x00048 */
+- volatile u32 gppr_3; /* 0x0004c */
+- volatile u32 gppr_4; /* 0x00050 */
+- volatile u32 gppr_5; /* 0x00054 */
+- volatile u32 gppr_6; /* 0x00058 */
+- volatile u32 gppr_7; /* 0x0005c */
+- volatile u32 gppr_8; /* 0x00060 */
+- volatile u32 gppr_9; /* 0x00064 */
+- volatile u32 gppr_10; /* 0x00068 */
+- volatile u32 gppr_11; /* 0x0006c */
+- volatile u32 gppr_12; /* 0x00070 */
+- volatile u32 gppr_13; /* 0x00074 */
+- volatile u32 gppr_14; /* 0x00078 */
+- volatile u32 gppr_15; /* 0x0007c */
++ volatile __u32 gpcr_s; /* 0x00034 */
++ volatile __u32 gpcr_c; /* 0x00038 */
++ volatile __u32 gpdr; /* 0x0003c */
++ volatile __u32 gppr_0; /* 0x00040 */
++ volatile __u32 gppr_1; /* 0x00044 */
++ volatile __u32 gppr_2; /* 0x00048 */
++ volatile __u32 gppr_3; /* 0x0004c */
++ volatile __u32 gppr_4; /* 0x00050 */
++ volatile __u32 gppr_5; /* 0x00054 */
++ volatile __u32 gppr_6; /* 0x00058 */
++ volatile __u32 gppr_7; /* 0x0005c */
++ volatile __u32 gppr_8; /* 0x00060 */
++ volatile __u32 gppr_9; /* 0x00064 */
++ volatile __u32 gppr_10; /* 0x00068 */
++ volatile __u32 gppr_11; /* 0x0006c */
++ volatile __u32 gppr_12; /* 0x00070 */
++ volatile __u32 gppr_13; /* 0x00074 */
++ volatile __u32 gppr_14; /* 0x00078 */
++ volatile __u32 gppr_15; /* 0x0007c */
+
+ /* Parallel Port Registers */
+- volatile u32 ppbr_h_a; /* 0x00080 */
+- volatile u32 ppbr_l_a; /* 0x00084 */
+- volatile u32 ppcr_a; /* 0x00088 */
+- volatile u32 ppcr; /* 0x0008c */
+- volatile u32 ppbr_h_b; /* 0x00090 */
+- volatile u32 ppbr_l_b; /* 0x00094 */
+- volatile u32 ppcr_b; /* 0x00098 */
++ volatile __u32 ppbr_h_a; /* 0x00080 */
++ volatile __u32 ppbr_l_a; /* 0x00084 */
++ volatile __u32 ppcr_a; /* 0x00088 */
++ volatile __u32 ppcr; /* 0x0008c */
++ volatile __u32 ppbr_h_b; /* 0x00090 */
++ volatile __u32 ppbr_l_b; /* 0x00094 */
++ volatile __u32 ppcr_b; /* 0x00098 */
+
+ /* Keyboard and Mouse Registers */
+- volatile u32 km_csr; /* 0x0009c */
+- volatile u32 k_rd; /* 0x000a0 */
+- volatile u32 m_rd; /* 0x000a4 */
+- volatile u32 k_wd; /* 0x000a8 */
+- volatile u32 m_wd; /* 0x000ac */
++ volatile __u32 km_csr; /* 0x0009c */
++ volatile __u32 k_rd; /* 0x000a0 */
++ volatile __u32 m_rd; /* 0x000a4 */
++ volatile __u32 k_wd; /* 0x000a8 */
++ volatile __u32 m_wd; /* 0x000ac */
+
+ /* Serial Port Registers */
+- volatile u32 sbbr_h; /* 0x000b0 */
+- volatile u32 sbbr_l; /* 0x000b4 */
+- volatile u32 sscr_a; /* 0x000b8 */
+- volatile u32 stpir_a; /* 0x000bc */
+- volatile u32 stcir_a; /* 0x000c0 */
+- volatile u32 srpir_a; /* 0x000c4 */
+- volatile u32 srcir_a; /* 0x000c8 */
+- volatile u32 srtr_a; /* 0x000cc */
+- volatile u32 shadow_a; /* 0x000d0 */
+- volatile u32 sscr_b; /* 0x000d4 */
+- volatile u32 stpir_b; /* 0x000d8 */
+- volatile u32 stcir_b; /* 0x000dc */
+- volatile u32 srpir_b; /* 0x000e0 */
+- volatile u32 srcir_b; /* 0x000e4 */
+- volatile u32 srtr_b; /* 0x000e8 */
+- volatile u32 shadow_b; /* 0x000ec */
++ volatile __u32 sbbr_h; /* 0x000b0 */
++ volatile __u32 sbbr_l; /* 0x000b4 */
++ volatile __u32 sscr_a; /* 0x000b8 */
++ volatile __u32 stpir_a; /* 0x000bc */
++ volatile __u32 stcir_a; /* 0x000c0 */
++ volatile __u32 srpir_a; /* 0x000c4 */
++ volatile __u32 srcir_a; /* 0x000c8 */
++ volatile __u32 srtr_a; /* 0x000cc */
++ volatile __u32 shadow_a; /* 0x000d0 */
++ volatile __u32 sscr_b; /* 0x000d4 */
++ volatile __u32 stpir_b; /* 0x000d8 */
++ volatile __u32 stcir_b; /* 0x000dc */
++ volatile __u32 srpir_b; /* 0x000e0 */
++ volatile __u32 srcir_b; /* 0x000e4 */
++ volatile __u32 srtr_b; /* 0x000e8 */
++ volatile __u32 shadow_b; /* 0x000ec */
+
+ /* Ethernet Registers */
+- volatile u32 emcr; /* 0x000f0 */
+- volatile u32 eisr; /* 0x000f4 */
+- volatile u32 eier; /* 0x000f8 */
+- volatile u32 ercsr; /* 0x000fc */
+- volatile u32 erbr_h; /* 0x00100 */
+- volatile u32 erbr_l; /* 0x00104 */
+- volatile u32 erbar; /* 0x00108 */
+- volatile u32 ercir; /* 0x0010c */
+- volatile u32 erpir; /* 0x00110 */
+- volatile u32 ertr; /* 0x00114 */
+- volatile u32 etcsr; /* 0x00118 */
+- volatile u32 ersr; /* 0x0011c */
+- volatile u32 etcdc; /* 0x00120 */
+- volatile u32 ebir; /* 0x00124 */
+- volatile u32 etbr_h; /* 0x00128 */
+- volatile u32 etbr_l; /* 0x0012c */
+- volatile u32 etcir; /* 0x00130 */
+- volatile u32 etpir; /* 0x00134 */
+- volatile u32 emar_h; /* 0x00138 */
+- volatile u32 emar_l; /* 0x0013c */
+- volatile u32 ehar_h; /* 0x00140 */
+- volatile u32 ehar_l; /* 0x00144 */
+- volatile u32 micr; /* 0x00148 */
+- volatile u32 midr_r; /* 0x0014c */
+- volatile u32 midr_w; /* 0x00150 */
+- volatile u32 pad1[(0x20000 - 0x00154) / 4];
++ volatile __u32 emcr; /* 0x000f0 */
++ volatile __u32 eisr; /* 0x000f4 */
++ volatile __u32 eier; /* 0x000f8 */
++ volatile __u32 ercsr; /* 0x000fc */
++ volatile __u32 erbr_h; /* 0x00100 */
++ volatile __u32 erbr_l; /* 0x00104 */
++ volatile __u32 erbar; /* 0x00108 */
++ volatile __u32 ercir; /* 0x0010c */
++ volatile __u32 erpir; /* 0x00110 */
++ volatile __u32 ertr; /* 0x00114 */
++ volatile __u32 etcsr; /* 0x00118 */
++ volatile __u32 ersr; /* 0x0011c */
++ volatile __u32 etcdc; /* 0x00120 */
++ volatile __u32 ebir; /* 0x00124 */
++ volatile __u32 etbr_h; /* 0x00128 */
++ volatile __u32 etbr_l; /* 0x0012c */
++ volatile __u32 etcir; /* 0x00130 */
++ volatile __u32 etpir; /* 0x00134 */
++ volatile __u32 emar_h; /* 0x00138 */
++ volatile __u32 emar_l; /* 0x0013c */
++ volatile __u32 ehar_h; /* 0x00140 */
++ volatile __u32 ehar_l; /* 0x00144 */
++ volatile __u32 micr; /* 0x00148 */
++ volatile __u32 midr_r; /* 0x0014c */
++ volatile __u32 midr_w; /* 0x00150 */
++ volatile __u32 pad1[(0x20000 - 0x00154) / 4];
+
+ /* SuperIO Registers XXX */
+ struct ioc3_sioregs sregs; /* 0x20000 */
+- volatile u32 pad2[(0x40000 - 0x20180) / 4];
++ volatile __u32 pad2[(0x40000 - 0x20180) / 4];
+
+ /* SSRAM Diagnostic Access */
+- volatile u32 ssram[(0x80000 - 0x40000) / 4];
++ volatile __u32 ssram[(0x80000 - 0x40000) / 4];
+
+ /* Bytebus device offsets
+ 0x80000 - Access to the generic devices selected with DEV0
+@@ -179,8 +179,8 @@
+ * Ethernet RX Buffer
+ */
+ struct ioc3_erxbuf {
+- u32 w0; /* first word (valid,bcnt,cksum) */
+- u32 err; /* second word various errors */
++ __u32 w0; /* first word (valid,bcnt,cksum) */
++ __u32 err; /* second word various errors */
+ /* next comes n bytes of padding */
+ /* then the received ethernet frame itself */
+ };
+@@ -208,11 +208,11 @@
+ */
+ #define ETXD_DATALEN 104
+ struct ioc3_etxd {
+- u32 cmd; /* command field */
+- u32 bufcnt; /* buffer counts field */
+- u64 p1; /* buffer pointer 1 */
+- u64 p2; /* buffer pointer 2 */
+- u8 data[ETXD_DATALEN]; /* opt. tx data */
++ __u32 cmd; /* command field */
++ __u32 bufcnt; /* buffer counts field */
++ __u64 p1; /* buffer pointer 1 */
++ __u64 p2; /* buffer pointer 2 */
++ __u8 data[ETXD_DATALEN]; /* opt. tx data */
+ };
+
+ #define ETXD_BYTECNT_MASK 0x000007ff /* total byte count */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/klconfig.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/klconfig.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/klconfig.h 2004-03-28 07:51:55.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/klconfig.h 2004-08-26 05:26:13.000000000 -0500
+@@ -64,9 +64,9 @@
+ #define KLCFGINFO_MAGIC 0xbeedbabe
+
+ #ifdef FRUTEST
+-typedef u64 klconf_off_t;
++typedef __u64 klconf_off_t;
+ #else
+-typedef s32 klconf_off_t;
++typedef __s32 klconf_off_t;
+ #endif
+
+ /*
+@@ -160,8 +160,8 @@
+ /* Functions/macros needed to use this structure */
+
+ typedef struct kl_config_hdr {
+- u64 ch_magic; /* set this to KLCFGINFO_MAGIC */
+- u32 ch_version; /* structure version number */
++ __u64 ch_magic; /* set this to KLCFGINFO_MAGIC */
++ __u32 ch_version; /* structure version number */
+ klconf_off_t ch_malloc_hdr_off; /* offset of ch_malloc_hdr */
+ klconf_off_t ch_cons_off; /* offset of ch_cons */
+ klconf_off_t ch_board_info; /* the link list of boards */
+@@ -609,14 +609,14 @@
+
+ /* Info holders for various hardware components */
+
+-typedef u64 *pci_t;
+-typedef u64 *vmeb_t;
+-typedef u64 *vmed_t;
+-typedef u64 *fddi_t;
+-typedef u64 *scsi_t;
+-typedef u64 *mio_t;
+-typedef u64 *graphics_t;
+-typedef u64 *router_t;
++typedef __u64 *pci_t;
++typedef __u64 *vmeb_t;
++typedef __u64 *vmed_t;
++typedef __u64 *fddi_t;
++typedef __u64 *scsi_t;
++typedef __u64 *mio_t;
++typedef __u64 *graphics_t;
++typedef __u64 *router_t;
+
+ /*
+ * The port info in ip27_cfg area translates to a lboart_t in the
+@@ -659,7 +659,7 @@
+ klport_t hub_port; /* hub is connected to this */
+ nic_t hub_box_nic; /* nic of containing box */
+ klconf_off_t hub_mfg_nic; /* MFG NIC string */
+- u64 hub_speed; /* Speed of hub in HZ */
++ __u64 hub_speed; /* Speed of hub in HZ */
+ } klhub_t ;
+
+ typedef struct klhub_uart_s { /* HUB */
+@@ -716,8 +716,8 @@
+ #define MAX_PCI_SLOTS 8
+
+ typedef struct klpci_device_s {
+- s32 pci_device_id; /* 32 bits of vendor/device ID. */
+- s32 pci_device_pad; /* 32 bits of padding. */
++ __s32 pci_device_id; /* 32 bits of vendor/device ID. */
++ __s32 pci_device_pad; /* 32 bits of padding. */
+ } klpci_device_t;
+
+ #define BRIDGE_STRUCT_VERSION 2
+@@ -767,7 +767,7 @@
+ nic_t rou_box_nic ; /* nic of the containing module */
+ klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */
+ klconf_off_t rou_mfg_nic ; /* MFG NIC string */
+- u64 rou_vector; /* vector from master node */
++ __u64 rou_vector; /* vector from master node */
+ } klrou_t ;
+
+ /*
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/kldir.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/kldir.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/kldir.h 2004-01-17 17:03:49.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/kldir.h 2004-08-26 05:26:25.000000000 -0500
+@@ -210,7 +210,7 @@
+
+ #ifndef __ASSEMBLY__
+ typedef struct kldir_ent_s {
+- u64 magic; /* Indicates validity of entry */
++ __u64 magic; /* Indicates validity of entry */
+ off_t offset; /* Offset from start of node space */
+ #if defined(CONFIG_SGI_IO) /* FIXME */
+ __psunsigned_t pointer; /* Pointer to area in some cases */
+@@ -218,7 +218,7 @@
+ unsigned long pointer; /* Pointer to area in some cases */
+ #endif
+ size_t size; /* Size in bytes */
+- u64 count; /* Repeat count if array, 1 if not */
++ __u64 count; /* Repeat count if array, 1 if not */
+ size_t stride; /* Stride if array, 0 if not */
+ char rsvd[16]; /* Pad entry to 0x40 bytes */
+ /* NOTE: These 16 bytes are used in the Partition KLDIR
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/launch.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/launch.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/launch.h 2004-01-17 17:03:49.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/launch.h 2004-08-26 05:25:52.000000000 -0500
+@@ -62,14 +62,14 @@
+ #ifndef __ASSEMBLY__
+
+ typedef int launch_state_t;
+-typedef void (*launch_proc_t)(u64 call_parm);
++typedef void (*launch_proc_t)(__u64 call_parm);
+
+ typedef struct launch_s {
+- volatile u64 magic; /* Magic number */
+- volatile u64 busy; /* Slave currently active */
++ volatile __u64 magic; /* Magic number */
++ volatile __u64 busy; /* Slave currently active */
+ volatile launch_proc_t call_addr; /* Func. for slave to call */
+- volatile u64 call_addr_c; /* 1's complement of call_addr*/
+- volatile u64 call_parm; /* Single parm passed to call*/
++ volatile __u64 call_addr_c; /* 1's complement of call_addr*/
++ volatile __u64 call_parm; /* Single parm passed to call*/
+ volatile void *stack_addr; /* Stack pointer for slave function */
+ volatile void *gp_addr; /* Global pointer for slave func. */
+ volatile char *bevutlb;/* Address of bev utlb ex handler */
+@@ -84,7 +84,7 @@
+
+ #define LAUNCH_SLAVE (*(void (*)(int nasid, int cpu, \
+ launch_proc_t call_addr, \
+- u64 call_parm, \
++ __u64 call_parm, \
+ void *stack_addr, \
+ void *gp_addr)) \
+ IP27PROM_LAUNCHSLAVE)
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubio.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubio.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubio.h 2003-12-15 12:47:02.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubio.h 2004-08-26 05:27:21.000000000 -0500
+@@ -172,9 +172,9 @@
+ #ifndef __ASSEMBLY__
+
+ typedef union hubii_wid_u {
+- u64 wid_reg_value;
++ __u64 wid_reg_value;
+ struct {
+- u64 wid_rsvd: 32, /* unused */
++ __u64 wid_rsvd: 32, /* unused */
+ wid_rev_num: 4, /* revision number */
+ wid_part_num: 16, /* the widget type: hub=c101 */
+ wid_mfg_num: 11, /* Manufacturer id (IBM) */
+@@ -184,9 +184,9 @@
+
+
+ typedef union hubii_wcr_u {
+- u64 wcr_reg_value;
++ __u64 wcr_reg_value;
+ struct {
+- u64 wcr_rsvd: 41, /* unused */
++ __u64 wcr_rsvd: 41, /* unused */
+ wcr_e_thresh: 5, /* elasticity threshold */
+ wcr_dir_con: 1, /* widget direct connect */
+ wcr_f_bad_pkt: 1, /* Force bad llp pkt enable */
+@@ -200,9 +200,9 @@
+ #define iwcr_dir_con wcr_fields_s.wcr_dir_con
+
+ typedef union hubii_wstat_u {
+- u64 reg_value;
++ __u64 reg_value;
+ struct {
+- u64 rsvd1: 31,
++ __u64 rsvd1: 31,
+ crazy: 1, /* Crazy bit */
+ rsvd2: 8,
+ llp_tx_cnt: 8, /* LLP Xmit retry counter */
+@@ -217,9 +217,9 @@
+
+
+ typedef union hubii_ilcsr_u {
+- u64 icsr_reg_value;
++ __u64 icsr_reg_value;
+ struct {
+- u64 icsr_rsvd: 22, /* unused */
++ __u64 icsr_rsvd: 22, /* unused */
+ icsr_max_burst: 10, /* max burst */
+ icsr_rsvd4: 6, /* reserved */
+ icsr_max_retry: 10, /* max retry */
+@@ -237,9 +237,9 @@
+
+
+ typedef union hubii_iowa_u {
+- u64 iowa_reg_value;
++ __u64 iowa_reg_value;
+ struct {
+- u64 iowa_rsvd: 48, /* unused */
++ __u64 iowa_rsvd: 48, /* unused */
+ iowa_wxoac: 8, /* xtalk widget access bits */
+ iowa_rsvd1: 7, /* xtalk widget access bits */
+ iowa_w0oac: 1; /* xtalk widget access bits */
+@@ -247,9 +247,9 @@
+ } hubii_iowa_t;
+
+ typedef union hubii_iiwa_u {
+- u64 iiwa_reg_value;
++ __u64 iiwa_reg_value;
+ struct {
+- u64 iiwa_rsvd: 48, /* unused */
++ __u64 iiwa_rsvd: 48, /* unused */
+ iiwa_wxiac: 8, /* hub wid access bits */
+ iiwa_rsvd1: 7, /* reserved */
+ iiwa_w0iac: 1; /* hub wid0 access */
+@@ -257,9 +257,9 @@
+ } hubii_iiwa_t;
+
+ typedef union hubii_illr_u {
+- u64 illr_reg_value;
++ __u64 illr_reg_value;
+ struct {
+- u64 illr_rsvd: 32, /* unused */
++ __u64 illr_rsvd: 32, /* unused */
+ illr_cb_cnt: 16, /* checkbit error count */
+ illr_sn_cnt: 16; /* sequence number count */
+ } illr_fields_s;
+@@ -271,9 +271,9 @@
+ /* io_perf_sel allows the caller to specify what tests will be
+ performed */
+ typedef union io_perf_sel {
+- u64 perf_sel_reg;
++ __u64 perf_sel_reg;
+ struct {
+- u64 perf_rsvd : 48,
++ __u64 perf_rsvd : 48,
+ perf_icct : 8,
+ perf_ippr1 : 4,
+ perf_ippr0 : 4;
+@@ -284,9 +284,9 @@
+ hardware problems there is only one counter, not two. */
+
+ typedef union io_perf_cnt {
+- u64 perf_cnt;
++ __u64 perf_cnt;
+ struct {
+- u64 perf_rsvd1 : 32,
++ __u64 perf_rsvd1 : 32,
+ perf_rsvd2 : 12,
+ perf_cnt : 20;
+ } perf_cnt_bits;
+@@ -442,9 +442,9 @@
+ */
+ #ifndef __ASSEMBLY__
+ typedef union icrba_u {
+- u64 reg_value;
++ __u64 reg_value;
+ struct {
+- u64 resvd: 6,
++ __u64 resvd: 6,
+ stall_bte0: 1, /* Stall BTE 0 */
+ stall_bte1: 1, /* Stall BTE 1 */
+ error: 1, /* CRB has an error */
+@@ -464,10 +464,10 @@
+ runtime selection of the format based on the REV_ID field of the
+ NI_STATUS_REV_ID register. */
+ typedef union h1_icrba_u {
+- u64 reg_value;
++ __u64 reg_value;
+
+ struct {
+- u64 resvd: 6,
++ __u64 resvd: 6,
+ unused: 1, /* Unused but RW!! */
+ error: 1, /* CRB has an error */
+ ecode: 4, /* Error Code */
+@@ -525,9 +525,9 @@
+ */
+ #ifndef __ASSEMBLY__
+ typedef union icrbb_u {
+- u64 reg_value;
++ __u64 reg_value;
+ struct {
+- u64 rsvd1: 5,
++ __u64 rsvd1: 5,
+ btenum: 1, /* BTE to which entry belongs to */
+ cohtrans: 1, /* Coherent transaction */
+ xtsize: 2, /* Xtalk operation size
+@@ -567,9 +567,9 @@
+ runtime selection of the format based on the REV_ID field of the
+ NI_STATUS_REV_ID register. */
+ typedef union h1_icrbb_u {
+- u64 reg_value;
++ __u64 reg_value;
+ struct {
+- u64 rsvd1: 5,
++ __u64 rsvd1: 5,
+ btenum: 1, /* BTE to which entry belongs to */
+ cohtrans: 1, /* Coherent transaction */
+ xtsize: 2, /* Xtalk operation size
+@@ -683,9 +683,9 @@
+ #ifndef __ASSEMBLY__
+
+ typedef union icrbc_s {
+- u64 reg_value;
++ __u64 reg_value;
+ struct {
+- u64 rsvd: 6,
++ __u64 rsvd: 6,
+ sleep: 1,
+ pricnt: 4, /* Priority count sent with Read req */
+ pripsc: 4, /* Priority Pre scalar */
+@@ -720,9 +720,9 @@
+
+ #ifndef __ASSEMBLY__
+ typedef union icrbd_s {
+- u64 reg_value;
++ __u64 reg_value;
+ struct {
+- u64 rsvd: 38,
++ __u64 rsvd: 38,
+ toutvld: 1, /* Timeout in progress for this CRB */
+ ctxtvld: 1, /* Context field below is valid */
+ rsvd2: 1,
+@@ -742,9 +742,9 @@
+
+
+ typedef union hubii_ifdr_u {
+- u64 hi_ifdr_value;
++ __u64 hi_ifdr_value;
+ struct {
+- u64 ifdr_rsvd: 49,
++ __u64 ifdr_rsvd: 49,
+ ifdr_maxrp: 7,
+ ifdr_rsvd1: 1,
+ ifdr_maxrq: 7;
+@@ -801,9 +801,9 @@
+ #ifndef __ASSEMBLY__
+
+ typedef union iprte_a {
+- u64 entry;
++ __u64 entry;
+ struct {
+- u64 rsvd1 : 7, /* Reserved field */
++ __u64 rsvd1 : 7, /* Reserved field */
+ valid : 1, /* Maps to a timeout entry */
+ rsvd2 : 1,
+ srcnode : 9, /* Node which did this PIO */
+@@ -835,9 +835,9 @@
+ */
+
+ typedef union iprb_u {
+- u64 reg_value;
++ __u64 reg_value;
+ struct {
+- u64 rsvd1: 15,
++ __u64 rsvd1: 15,
+ error: 1, /* Widget rcvd wr resp pkt w/ error */
+ ovflow: 5, /* Over flow count. perf measurement */
+ fire_and_forget: 1, /* Launch Write without response */
+@@ -877,9 +877,9 @@
+ */
+ #ifndef __ASSEMBLY__
+ typedef union icrbp_a {
+- u64 ip_reg; /* the entire register value */
++ __u64 ip_reg; /* the entire register value */
+ struct {
+- u64 error: 1, /* 63, error occurred */
++ __u64 error: 1, /* 63, error occurred */
+ ln_uce: 1, /* 62: uncorrectable memory */
+ ln_ae: 1, /* 61: protection violation */
+ ln_werr:1, /* 60: write access error */
+@@ -919,9 +919,9 @@
+
+ #ifndef __ASSEMBLY__
+ typedef union hubii_idsr {
+- u64 iin_reg;
++ __u64 iin_reg;
+ struct {
+- u64 rsvd1 : 35,
++ __u64 rsvd1 : 35,
+ isent : 1,
+ rsvd2 : 3,
+ ienable: 1,
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubmd.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubmd.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubmd.h 2004-01-17 17:03:49.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubmd.h 2004-08-26 05:27:00.000000000 -0500
+@@ -541,7 +541,7 @@
+ */
+
+ struct dir_error_reg {
+- u64 uce_vld: 1, /* 63: valid directory uce */
++ __u64 uce_vld: 1, /* 63: valid directory uce */
+ ae_vld: 1, /* 62: valid dir prot ecc error */
+ ce_vld: 1, /* 61: valid correctable ECC err*/
+ rsvd1: 19, /* 60-42: reserved */
+@@ -555,13 +555,13 @@
+ };
+
+ typedef union md_dir_error {
+- u64 derr_reg; /* the entire register */
++ __u64 derr_reg; /* the entire register */
+ struct dir_error_reg derr_fmt; /* the register format */
+ } md_dir_error_t;
+
+
+ struct mem_error_reg {
+- u64 uce_vld: 1, /* 63: valid memory uce */
++ __u64 uce_vld: 1, /* 63: valid memory uce */
+ ce_vld: 1, /* 62: valid correctable ECC err*/
+ rsvd1: 22, /* 61-40: reserved */
+ bad_syn: 8, /* 39-32: bad mem ecc syndrome */
+@@ -573,13 +573,13 @@
+
+
+ typedef union md_mem_error {
+- u64 merr_reg; /* the entire register */
++ __u64 merr_reg; /* the entire register */
+ struct mem_error_reg merr_fmt; /* format of the mem_error reg */
+ } md_mem_error_t;
+
+
+ struct proto_error_reg {
+- u64 valid: 1, /* 63: valid protocol error */
++ __u64 valid: 1, /* 63: valid protocol error */
+ rsvd1: 2, /* 62-61: reserved */
+ initiator:11, /* 60-50: id of request initiator*/
+ backoff: 2, /* 49-48: backoff control */
+@@ -594,7 +594,7 @@
+ };
+
+ typedef union md_proto_error {
+- u64 perr_reg; /* the entire register */
++ __u64 perr_reg; /* the entire register */
+ struct proto_error_reg perr_fmt; /* format of the register */
+ } md_proto_error_t;
+
+@@ -642,7 +642,7 @@
+
+
+ struct md_pdir_high_fmt {
+- u64 pd_hi_unused : 16,
++ __u64 pd_hi_unused : 16,
+ pd_hi_bvec : 38,
+ pd_hi_unused1 : 3,
+ pd_hi_ecc : 7;
+@@ -651,14 +651,14 @@
+
+ typedef union md_pdir_high {
+ /* The 48 bits of standard directory, upper word */
+- u64 pd_hi_val;
++ __u64 pd_hi_val;
+ struct md_pdir_high_fmt pd_hi_fmt;
+ }md_pdir_high_t;
+
+
+ struct md_pdir_low_shared_fmt {
+ /* The meaning of lower directory, shared */
+- u64 pds_lo_unused : 16,
++ __u64 pds_lo_unused : 16,
+ pds_lo_bvec : 26,
+ pds_lo_cnt : 6,
+ pds_lo_state : 3,
+@@ -670,7 +670,7 @@
+
+ struct md_pdir_low_exclusive_fmt {
+ /* The meaning of lower directory, exclusive */
+- u64 pde_lo_unused : 31,
++ __u64 pde_lo_unused : 31,
+ pde_lo_ptr : 11,
+ pde_lo_unused1 : 6,
+ pde_lo_state : 3,
+@@ -683,7 +683,7 @@
+
+ typedef union md_pdir_loent {
+ /* The 48 bits of premium directory, lower word */
+- u64 pd_lo_val;
++ __u64 pd_lo_val;
+ struct md_pdir_low_exclusive_fmt pde_lo_fmt;
+ struct md_pdir_low_shared_fmt pds_lo_fmt;
+ }md_pdir_low_t;
+@@ -711,25 +711,25 @@
+ } bddir_entry_t;
+
+ typedef struct dir_mem_entry {
+- u64 prcpf[MAX_REGIONS];
++ __u64 prcpf[MAX_REGIONS];
+ bddir_entry_t directory_words[MD_PAGE_SIZE/CACHE_SLINE_SIZE];
+ } dir_mem_entry_t;
+
+
+
+ typedef union md_perf_sel {
+- u64 perf_sel_reg;
++ __u64 perf_sel_reg;
+ struct {
+- u64 perf_rsvd : 60,
++ __u64 perf_rsvd : 60,
+ perf_en : 1,
+ perf_sel : 3;
+ } perf_sel_bits;
+ } md_perf_sel_t;
+
+ typedef union md_perf_cnt {
+- u64 perf_cnt;
++ __u64 perf_cnt;
+ struct {
+- u64 perf_rsvd : 44,
++ __u64 perf_rsvd : 44,
+ perf_cnt : 20;
+ } perf_cnt_bits;
+ } md_perf_cnt_t;
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubni.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubni.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubni.h 2003-12-15 12:47:02.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubni.h 2004-08-26 05:26:48.000000000 -0500
+@@ -229,9 +229,9 @@
+ #ifndef __ASSEMBLY__
+
+ typedef union hubni_port_error_u {
+- u64 nipe_reg_value;
++ __u64 nipe_reg_value;
+ struct {
+- u64 nipe_rsvd: 26, /* unused */
++ __u64 nipe_rsvd: 26, /* unused */
+ nipe_lnk_reset: 1, /* link reset */
+ nipe_intl_err: 1, /* internal error */
+ nipe_bad_msg: 1, /* bad message */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubpi.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubpi.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubpi.h 2003-12-15 12:47:02.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubpi.h 2004-08-26 05:26:36.000000000 -0500
+@@ -312,7 +312,7 @@
+ */
+
+ struct err_stack_format {
+- u64 sk_addr : 33, /* address */
++ __u64 sk_addr : 33, /* address */
+ sk_cmd : 8, /* message command */
+ sk_crb_sts : 10, /* status from RRB or WRB */
+ sk_rw_rb : 1, /* RRB == 0, WRB == 1 */
+@@ -323,12 +323,12 @@
+ };
+
+ typedef union pi_err_stack {
+- u64 pi_stk_word;
++ __u64 pi_stk_word;
+ struct err_stack_format pi_stk_fmt;
+ } pi_err_stack_t;
+
+ struct err_status0_format {
+- u64 s0_valid : 1, /* Valid */
++ __u64 s0_valid : 1, /* Valid */
+ s0_ovr_run : 1, /* Overrun, spooled to memory */
+ s0_addr : 37, /* address */
+ s0_cmd : 8, /* message command */
+@@ -338,12 +338,12 @@
+ };
+
+ typedef union pi_err_stat0 {
+- u64 pi_stat0_word;
++ __u64 pi_stat0_word;
+ struct err_status0_format pi_stat0_fmt;
+ } pi_err_stat0_t;
+
+ struct err_status1_format {
+- u64 s1_src : 11, /* message source */
++ __u64 s1_src : 11, /* message source */
+ s1_crb_sts : 10, /* status from RRB or WRB */
+ s1_rw_rb : 1, /* RRB == 0, WRB == 1 */
+ s1_crb_num : 3, /* WRB (0 to 7) or RRB (0 to 4) */
+@@ -353,11 +353,11 @@
+ };
+
+ typedef union pi_err_stat1 {
+- u64 pi_stat1_word;
++ __u64 pi_stat1_word;
+ struct err_status1_format pi_stat1_fmt;
+ } pi_err_stat1_t;
+
+-typedef u64 rtc_time_t;
++typedef __u64 rtc_time_t;
+
+ #endif /* !__ASSEMBLY__ */
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/stackframe.h linux-libc-headers-2.6.8.0/include/asm-mips/stackframe.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/stackframe.h 2004-08-18 13:15:41.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/stackframe.h 2004-08-26 05:14:41.000000000 -0500
+@@ -25,7 +25,7 @@
+
+ .macro SAVE_TEMP
+ mfhi v1
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ LONG_S $8, PT_R8(sp)
+ LONG_S $9, PT_R9(sp)
+ #endif
+@@ -55,7 +55,7 @@
+
+ #ifdef CONFIG_SMP
+ .macro get_saved_sp /* SMP variation */
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ mfc0 k0, CP0_CONTEXT
+ lui k1, %hi(kernelsp)
+ srl k0, k0, 23
+@@ -63,7 +63,7 @@
+ addu k1, k0
+ LONG_L k1, %lo(kernelsp)(k1)
+ #endif
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ MFC0 k1, CP0_CONTEXT
+ dsra k1, 23
+ lui k0, %hi(pgd_current)
+@@ -76,13 +76,13 @@
+ .endm
+
+ .macro set_saved_sp stackp temp temp2
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ mfc0 \temp, CP0_CONTEXT
+ srl \temp, 23
+ sll \temp, 2
+ LONG_S \stackp, kernelsp(\temp)
+ #endif
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ lw \temp, TI_CPU(gp)
+ dsll \temp, 3
+ lui \temp2, %hi(kernelsp)
+@@ -127,7 +127,7 @@
+ LONG_S $6, PT_R6(sp)
+ MFC0 v1, CP0_EPC
+ LONG_S $7, PT_R7(sp)
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ LONG_S $8, PT_R8(sp)
+ LONG_S $9, PT_R9(sp)
+ #endif
+@@ -156,7 +156,7 @@
+
+ .macro RESTORE_TEMP
+ LONG_L $24, PT_LO(sp)
+-#ifdef CONFIG_MIPS32
++#ifndef __mips64
+ LONG_L $8, PT_R8(sp)
+ LONG_L $9, PT_R9(sp)
+ #endif
+@@ -204,7 +204,7 @@
+ LONG_L $31, PT_R31(sp)
+ LONG_L $28, PT_R28(sp)
+ LONG_L $25, PT_R25(sp)
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ LONG_L $8, PT_R8(sp)
+ LONG_L $9, PT_R9(sp)
+ #endif
+@@ -249,7 +249,7 @@
+ LONG_L $31, PT_R31(sp)
+ LONG_L $28, PT_R28(sp)
+ LONG_L $25, PT_R25(sp)
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ LONG_L $8, PT_R8(sp)
+ LONG_L $9, PT_R9(sp)
+ #endif
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/system.h linux-libc-headers-2.6.8.0/include/asm-mips/system.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/system.h 2004-08-18 13:15:42.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/system.h 2004-08-28 18:13:39.000000000 -0500
+@@ -15,10 +15,11 @@
+ #include <asm/sgidefs.h>
+
+ #include <linux/kernel.h>
++#include <linux/linkage.h>
+
+ #include <asm/addrspace.h>
+ #include <asm/ptrace.h>
+-#include <asm/hazards.h>
++#include <asm/types.h>
+
+ __asm__ (
+ ".macro\tlocal_irq_enable\n\t"
+@@ -311,7 +312,7 @@
+ return retval;
+ }
+
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
+ {
+ __u64 retval;
+@@ -406,7 +407,7 @@
+ return retval;
+ }
+
+-#ifdef CONFIG_MIPS64
++#ifdef __mips64
+ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
+ unsigned long new)
+ {
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/tx4927/tx4927_mips.h linux-libc-headers-2.6.8.0/include/asm-mips/tx4927/tx4927_mips.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/tx4927/tx4927_mips.h 2003-12-15 12:47:03.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/tx4927/tx4927_mips.h 2004-08-26 05:22:30.000000000 -0500
+@@ -36,15 +36,15 @@
+ ".set\tmips0");
+ }
+
+-#define reg_rd08(r) ((u8 )(*((vu8 *)(r))))
+-#define reg_rd16(r) ((u16)(*((vu16*)(r))))
+-#define reg_rd32(r) ((u32)(*((vu32*)(r))))
+-#define reg_rd64(r) ((u64)(*((vu64*)(r))))
++#define reg_rd08(r) ((__u8 )(*((vu8 *)(r))))
++#define reg_rd16(r) ((__u16)(*((vu16*)(r))))
++#define reg_rd32(r) ((__u32)(*((vu32*)(r))))
++#define reg_rd64(r) ((__u64)(*((vu64*)(r))))
+
+-#define reg_wr08(r,v) ((*((vu8 *)(r)))=((u8 )(v)))
+-#define reg_wr16(r,v) ((*((vu16*)(r)))=((u16)(v)))
+-#define reg_wr32(r,v) ((*((vu32*)(r)))=((u32)(v)))
+-#define reg_wr64(r,v) ((*((vu64*)(r)))=((u64)(v)))
++#define reg_wr08(r,v) ((*((vu8 *)(r)))=((__u8 )(v)))
++#define reg_wr16(r,v) ((*((vu16*)(r)))=((__u16)(v)))
++#define reg_wr32(r,v) ((*((vu32*)(r)))=((__u32)(v)))
++#define reg_wr64(r,v) ((*((vu64*)(r)))=((__u64)(v)))
+
+ typedef volatile __signed char vs8;
+ typedef volatile unsigned char vu8;
+@@ -55,10 +55,10 @@
+ typedef volatile __signed int vs32;
+ typedef volatile unsigned int vu32;
+
+-typedef s8 s08;
++typedef __s8 s08;
+ typedef vs8 vs08;
+
+-typedef u8 u08;
++typedef __u8 u08;
+ typedef vu8 vu08;
+
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/unaligned.h linux-libc-headers-2.6.8.0/include/asm-mips/unaligned.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/unaligned.h 2004-08-15 15:38:27.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/asm-mips/unaligned.h 2004-08-26 05:22:21.000000000 -0500
+@@ -17,7 +17,7 @@
+ *
+ * This macro should be used for accessing values larger in size than
+ * single bytes at locations that are expected to be improperly aligned,
+- * e.g. retrieving a u16 value from a location not u16-aligned.
++ * e.g. retrieving a __u16 value from a location not __u16-aligned.
+ *
+ * Note that unaligned accesses can be very expensive on some architectures.
+ */
+@@ -31,7 +31,7 @@
+ *
+ * This macro should be used for placing values larger in size than
+ * single bytes at locations that are expected to be improperly aligned,
+- * e.g. writing a u16 value to a location not u16-aligned.
++ * e.g. writing a __u16 value to a location not __u16-aligned.
+ *
+ * Note that unaligned accesses can be very expensive on some architectures.
+ */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/xtalk/xwidget.h linux-libc-headers-2.6.8.0/include/asm-mips/xtalk/xwidget.h
+--- linux-libc-headers-2.6.8.0-dist/include/asm-mips/xtalk/xwidget.h 2003-12-15 12:47:03.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/asm-mips/xtalk/xwidget.h 2004-08-26 05:23:33.000000000 -0500
+@@ -92,7 +92,7 @@
+ * defined here
+ */
+ #ifndef __ASSEMBLY__
+-typedef u32 widgetreg_t;
++typedef __u32 widgetreg_t;
+
+ /* widget configuration registers */
+ typedef volatile struct widget_cfg {
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/acpi.h linux-libc-headers-2.6.8.0/include/linux/acpi.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/acpi.h 2004-08-18 13:16:01.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/acpi.h 2004-08-26 05:41:49.000000000 -0500
+@@ -51,49 +51,49 @@
+
+ struct acpi_table_rsdp {
+ char signature[8];
+- u8 checksum;
++ __u8 checksum;
+ char oem_id[6];
+- u8 revision;
+- u32 rsdt_address;
++ __u8 revision;
++ __u32 rsdt_address;
+ } __attribute__ ((packed));
+
+ struct acpi20_table_rsdp {
+ char signature[8];
+- u8 checksum;
++ __u8 checksum;
+ char oem_id[6];
+- u8 revision;
+- u32 rsdt_address;
+- u32 length;
+- u64 xsdt_address;
+- u8 ext_checksum;
+- u8 reserved[3];
++ __u8 revision;
++ __u32 rsdt_address;
++ __u32 length;
++ __u64 xsdt_address;
++ __u8 ext_checksum;
++ __u8 reserved[3];
+ } __attribute__ ((packed));
+
+ typedef struct {
+- u8 type;
+- u8 length;
++ __u8 type;
++ __u8 length;
+ } __attribute__ ((packed)) acpi_table_entry_header;
+
+ /* Root System Description Table (RSDT) */
+
+ struct acpi_table_rsdt {
+ struct acpi_table_header header;
+- u32 entry[8];
++ __u32 entry[8];
+ } __attribute__ ((packed));
+
+ /* Extended System Description Table (XSDT) */
+
+ struct acpi_table_xsdt {
+ struct acpi_table_header header;
+- u64 entry[1];
++ __u64 entry[1];
+ } __attribute__ ((packed));
+
+ /* Fixed ACPI Description Table (FADT) */
+
+ struct acpi_table_fadt {
+ struct acpi_table_header header;
+- u32 facs_addr;
+- u32 dsdt_addr;
++ __u32 facs_addr;
++ __u32 dsdt_addr;
+ /* ... */
+ } __attribute__ ((packed));
+
+@@ -101,10 +101,10 @@
+
+ struct acpi_table_madt {
+ struct acpi_table_header header;
+- u32 lapic_address;
++ __u32 lapic_address;
+ struct {
+- u32 pcat_compat:1;
+- u32 reserved:31;
++ __u32 pcat_compat:1;
++ __u32 reserved:31;
+ } flags;
+ } __attribute__ ((packed));
+
+@@ -122,85 +122,85 @@
+ };
+
+ typedef struct {
+- u16 polarity:2;
+- u16 trigger:2;
+- u16 reserved:12;
++ __u16 polarity:2;
++ __u16 trigger:2;
++ __u16 reserved:12;
+ } __attribute__ ((packed)) acpi_interrupt_flags;
+
+ struct acpi_table_lapic {
+ acpi_table_entry_header header;
+- u8 acpi_id;
+- u8 id;
++ __u8 acpi_id;
++ __u8 id;
+ struct {
+- u32 enabled:1;
+- u32 reserved:31;
++ __u32 enabled:1;
++ __u32 reserved:31;
+ } flags;
+ } __attribute__ ((packed));
+
+ struct acpi_table_ioapic {
+ acpi_table_entry_header header;
+- u8 id;
+- u8 reserved;
+- u32 address;
+- u32 global_irq_base;
++ __u8 id;
++ __u8 reserved;
++ __u32 address;
++ __u32 global_irq_base;
+ } __attribute__ ((packed));
+
+ struct acpi_table_int_src_ovr {
+ acpi_table_entry_header header;
+- u8 bus;
+- u8 bus_irq;
+- u32 global_irq;
++ __u8 bus;
++ __u8 bus_irq;
++ __u32 global_irq;
+ acpi_interrupt_flags flags;
+ } __attribute__ ((packed));
+
+ struct acpi_table_nmi_src {
+ acpi_table_entry_header header;
+ acpi_interrupt_flags flags;
+- u32 global_irq;
++ __u32 global_irq;
+ } __attribute__ ((packed));
+
+ struct acpi_table_lapic_nmi {
+ acpi_table_entry_header header;
+- u8 acpi_id;
++ __u8 acpi_id;
+ acpi_interrupt_flags flags;
+- u8 lint;
++ __u8 lint;
+ } __attribute__ ((packed));
+
+ struct acpi_table_lapic_addr_ovr {
+ acpi_table_entry_header header;
+- u8 reserved[2];
+- u64 address;
++ __u8 reserved[2];
++ __u64 address;
+ } __attribute__ ((packed));
+
+ struct acpi_table_iosapic {
+ acpi_table_entry_header header;
+- u8 id;
+- u8 reserved;
+- u32 global_irq_base;
+- u64 address;
++ __u8 id;
++ __u8 reserved;
++ __u32 global_irq_base;
++ __u64 address;
+ } __attribute__ ((packed));
+
+ struct acpi_table_lsapic {
+ acpi_table_entry_header header;
+- u8 acpi_id;
+- u8 id;
+- u8 eid;
+- u8 reserved[3];
++ __u8 acpi_id;
++ __u8 id;
++ __u8 eid;
++ __u8 reserved[3];
+ struct {
+- u32 enabled:1;
+- u32 reserved:31;
++ __u32 enabled:1;
++ __u32 reserved:31;
+ } flags;
+ } __attribute__ ((packed));
+
+ struct acpi_table_plat_int_src {
+ acpi_table_entry_header header;
+ acpi_interrupt_flags flags;
+- u8 type; /* See acpi_interrupt_type */
+- u8 id;
+- u8 eid;
+- u8 iosapic_vector;
+- u32 global_irq;
+- u32 reserved;
++ __u8 type; /* See acpi_interrupt_type */
++ __u8 id;
++ __u8 eid;
++ __u8 iosapic_vector;
++ __u32 global_irq;
++ __u32 reserved;
+ } __attribute__ ((packed));
+
+ enum acpi_interrupt_id {
+@@ -213,21 +213,21 @@
+ #define ACPI_SPACE_MEM 0
+
+ struct acpi_gen_regaddr {
+- u8 space_id;
+- u8 bit_width;
+- u8 bit_offset;
+- u8 resv;
+- u32 addrl;
+- u32 addrh;
++ __u8 space_id;
++ __u8 bit_width;
++ __u8 bit_offset;
++ __u8 resv;
++ __u32 addrl;
++ __u32 addrh;
+ } __attribute__ ((packed));
+
+ struct acpi_table_hpet {
+ struct acpi_table_header header;
+- u32 id;
++ __u32 id;
+ struct acpi_gen_regaddr addr;
+- u8 number;
+- u16 min_tick;
+- u8 page_protect;
++ __u8 number;
++ __u16 min_tick;
++ __u8 page_protect;
+ } __attribute__ ((packed));
+
+ /*
+@@ -236,17 +236,17 @@
+ */
+ struct acpi_table_sbf
+ {
+- u8 sbf_signature[4];
+- u32 sbf_len;
+- u8 sbf_revision;
+- u8 sbf_csum;
+- u8 sbf_oemid[6];
+- u8 sbf_oemtable[8];
+- u8 sbf_revdata[4];
+- u8 sbf_creator[4];
+- u8 sbf_crearev[4];
+- u8 sbf_cmos;
+- u8 sbf_spare[3];
++ __u8 sbf_signature[4];
++ __u32 sbf_len;
++ __u8 sbf_revision;
++ __u8 sbf_csum;
++ __u8 sbf_oemid[6];
++ __u8 sbf_oemtable[8];
++ __u8 sbf_revdata[4];
++ __u8 sbf_creator[4];
++ __u8 sbf_crearev[4];
++ __u8 sbf_cmos;
++ __u8 sbf_spare[3];
+ } __attribute__ ((packed));
+
+ /*
+@@ -256,8 +256,8 @@
+
+ struct acpi_table_srat {
+ struct acpi_table_header header;
+- u32 table_revision;
+- u64 reserved;
++ __u32 table_revision;
++ __u64 reserved;
+ } __attribute__ ((packed));
+
+ enum acpi_srat_entry_id {
+@@ -268,31 +268,31 @@
+
+ struct acpi_table_processor_affinity {
+ acpi_table_entry_header header;
+- u8 proximity_domain;
+- u8 apic_id;
++ __u8 proximity_domain;
++ __u8 apic_id;
+ struct {
+- u32 enabled:1;
+- u32 reserved:31;
++ __u32 enabled:1;
++ __u32 reserved:31;
+ } flags;
+- u8 lsapic_eid;
+- u8 reserved[7];
++ __u8 lsapic_eid;
++ __u8 reserved[7];
+ } __attribute__ ((packed));
+
+ struct acpi_table_memory_affinity {
+ acpi_table_entry_header header;
+- u8 proximity_domain;
+- u8 reserved1[5];
+- u32 base_addr_lo;
+- u32 base_addr_hi;
+- u32 length_lo;
+- u32 length_hi;
+- u32 memory_type; /* See acpi_address_range_id */
++ __u8 proximity_domain;
++ __u8 reserved1[5];
++ __u32 base_addr_lo;
++ __u32 base_addr_hi;
++ __u32 length_lo;
++ __u32 length_hi;
++ __u32 memory_type; /* See acpi_address_range_id */
+ struct {
+- u32 enabled:1;
+- u32 hot_pluggable:1;
+- u32 reserved:30;
++ __u32 enabled:1;
++ __u32 hot_pluggable:1;
++ __u32 reserved:30;
+ } flags;
+- u64 reserved2;
++ __u64 reserved2;
+ } __attribute__ ((packed));
+
+ enum acpi_address_range_id {
+@@ -310,17 +310,17 @@
+
+ struct acpi_table_slit {
+ struct acpi_table_header header;
+- u64 localities;
+- u8 entry[1]; /* real size = localities^2 */
++ __u64 localities;
++ __u8 entry[1]; /* real size = localities^2 */
+ } __attribute__ ((packed));
+
+ /* Smart Battery Description Table (SBST) */
+
+ struct acpi_table_sbst {
+ struct acpi_table_header header;
+- u32 warning; /* Warn user */
+- u32 low; /* Critical sleep */
+- u32 critical; /* Critical shutdown */
++ __u32 warning; /* Warn user */
++ __u32 low; /* Critical sleep */
++ __u32 critical; /* Critical shutdown */
+ } __attribute__ ((packed));
+
+ /* Embedded Controller Boot Resources Table (ECDT) */
+@@ -329,8 +329,8 @@
+ struct acpi_table_header header;
+ struct acpi_generic_address ec_control;
+ struct acpi_generic_address ec_data;
+- u32 uid;
+- u8 gpe_bit;
++ __u32 uid;
++ __u8 gpe_bit;
+ char ec_id[0];
+ } __attribute__ ((packed));
+
+@@ -338,9 +338,9 @@
+
+ struct acpi_table_mcfg {
+ struct acpi_table_header header;
+- u8 reserved[8];
+- u32 base_address;
+- u32 base_reserved;
++ __u8 reserved[8];
++ __u32 base_address;
++ __u32 base_reserved;
+ } __attribute__ ((packed));
+
+ /* Table Handlers */
+@@ -396,7 +396,7 @@
+
+ extern int acpi_mp_config;
+
+-extern u32 pci_mmcfg_base_addr;
++extern __u32 pci_mmcfg_base_addr;
+
+ extern int sbf_port ;
+
+@@ -411,20 +411,20 @@
+
+ #endif /*!CONFIG_ACPI_BOOT*/
+
+-unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
+-int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
++unsigned int acpi_register_gsi (__u32 gsi, int edge_level, int active_high_low);
++int acpi_gsi_to_irq (__u32 gsi, unsigned int *irq);
+
+ #ifdef CONFIG_ACPI_PCI
+
+ struct acpi_prt_entry {
+ struct list_head node;
+ struct acpi_pci_id id;
+- u8 pin;
++ __u8 pin;
+ struct {
+ acpi_handle handle;
+- u32 index;
++ __u32 index;
+ } link;
+- u32 irq;
++ __u32 irq;
+ };
+
+ struct acpi_prt_list {
+@@ -451,8 +451,8 @@
+
+ #ifdef CONFIG_ACPI_EC
+
+-int ec_read(u8 addr, u8 *val);
+-int ec_write(u8 addr, u8 val);
++int ec_read(__u8 addr, __u8 *val);
++int ec_write(__u8 addr, __u8 val);
+
+ #endif /*CONFIG_ACPI_EC*/
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/affs_fs_i.h linux-libc-headers-2.6.8.0/include/linux/affs_fs_i.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/affs_fs_i.h 2003-12-31 17:46:48.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/affs_fs_i.h 2004-08-26 05:41:49.000000000 -0500
+@@ -9,13 +9,13 @@
+ //#define AFFS_CACHE_SIZE (4*4)
+
+ #define AFFS_MAX_PREALLOC 32
+-#define AFFS_LC_SIZE (AFFS_CACHE_SIZE/sizeof(u32)/2)
++#define AFFS_LC_SIZE (AFFS_CACHE_SIZE/sizeof(__u32)/2)
+ #define AFFS_AC_SIZE (AFFS_CACHE_SIZE/sizeof(struct affs_ext_key)/2)
+ #define AFFS_AC_MASK (AFFS_AC_SIZE-1)
+
+ struct affs_ext_key {
+- u32 ext; /* idx of the extended block */
+- u32 key; /* block number */
++ __u32 ext; /* idx of the extended block */
++ __u32 key; /* block number */
+ };
+
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/affs_fs_sb.h linux-libc-headers-2.6.8.0/include/linux/affs_fs_sb.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/affs_fs_sb.h 2004-08-18 13:16:01.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/affs_fs_sb.h 2004-08-26 05:41:49.000000000 -0500
+@@ -9,8 +9,8 @@
+ */
+
+ struct affs_bm_info {
+- u32 bm_key; /* Disk block number */
+- u32 bm_free; /* Free blocks in here */
++ __u32 bm_key; /* Disk block number */
++ __u32 bm_free; /* Free blocks in here */
+ };
+
+ #define SF_INTL 0x0001 /* International filesystem. */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/affs_hardblocks.h linux-libc-headers-2.6.8.0/include/linux/affs_hardblocks.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/affs_hardblocks.h 2003-12-15 12:46:58.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/affs_hardblocks.h 2004-08-26 05:41:49.000000000 -0500
+@@ -4,59 +4,59 @@
+ /* Just the needed definitions for the RDB of an Amiga HD. */
+
+ struct RigidDiskBlock {
+- u32 rdb_ID;
+- u32 rdb_SummedLongs;
+- s32 rdb_ChkSum;
+- u32 rdb_HostID;
+- u32 rdb_BlockBytes;
+- u32 rdb_Flags;
+- u32 rdb_BadBlockList;
+- u32 rdb_PartitionList;
+- u32 rdb_FileSysHeaderList;
+- u32 rdb_DriveInit;
+- u32 rdb_Reserved1[6];
+- u32 rdb_Cylinders;
+- u32 rdb_Sectors;
+- u32 rdb_Heads;
+- u32 rdb_Interleave;
+- u32 rdb_Park;
+- u32 rdb_Reserved2[3];
+- u32 rdb_WritePreComp;
+- u32 rdb_ReducedWrite;
+- u32 rdb_StepRate;
+- u32 rdb_Reserved3[5];
+- u32 rdb_RDBBlocksLo;
+- u32 rdb_RDBBlocksHi;
+- u32 rdb_LoCylinder;
+- u32 rdb_HiCylinder;
+- u32 rdb_CylBlocks;
+- u32 rdb_AutoParkSeconds;
+- u32 rdb_HighRDSKBlock;
+- u32 rdb_Reserved4;
++ __u32 rdb_ID;
++ __u32 rdb_SummedLongs;
++ __s32 rdb_ChkSum;
++ __u32 rdb_HostID;
++ __u32 rdb_BlockBytes;
++ __u32 rdb_Flags;
++ __u32 rdb_BadBlockList;
++ __u32 rdb_PartitionList;
++ __u32 rdb_FileSysHeaderList;
++ __u32 rdb_DriveInit;
++ __u32 rdb_Reserved1[6];
++ __u32 rdb_Cylinders;
++ __u32 rdb_Sectors;
++ __u32 rdb_Heads;
++ __u32 rdb_Interleave;
++ __u32 rdb_Park;
++ __u32 rdb_Reserved2[3];
++ __u32 rdb_WritePreComp;
++ __u32 rdb_ReducedWrite;
++ __u32 rdb_StepRate;
++ __u32 rdb_Reserved3[5];
++ __u32 rdb_RDBBlocksLo;
++ __u32 rdb_RDBBlocksHi;
++ __u32 rdb_LoCylinder;
++ __u32 rdb_HiCylinder;
++ __u32 rdb_CylBlocks;
++ __u32 rdb_AutoParkSeconds;
++ __u32 rdb_HighRDSKBlock;
++ __u32 rdb_Reserved4;
+ char rdb_DiskVendor[8];
+ char rdb_DiskProduct[16];
+ char rdb_DiskRevision[4];
+ char rdb_ControllerVendor[8];
+ char rdb_ControllerProduct[16];
+ char rdb_ControllerRevision[4];
+- u32 rdb_Reserved5[10];
++ __u32 rdb_Reserved5[10];
+ };
+
+ #define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */
+
+ struct PartitionBlock {
+- u32 pb_ID;
+- u32 pb_SummedLongs;
+- s32 pb_ChkSum;
+- u32 pb_HostID;
+- u32 pb_Next;
+- u32 pb_Flags;
+- u32 pb_Reserved1[2];
+- u32 pb_DevFlags;
+- u8 pb_DriveName[32];
+- u32 pb_Reserved2[15];
+- u32 pb_Environment[17];
+- u32 pb_EReserved[15];
++ __u32 pb_ID;
++ __u32 pb_SummedLongs;
++ __s32 pb_ChkSum;
++ __u32 pb_HostID;
++ __u32 pb_Next;
++ __u32 pb_Flags;
++ __u32 pb_Reserved1[2];
++ __u32 pb_DevFlags;
++ __u8 pb_DriveName[32];
++ __u32 pb_Reserved2[15];
++ __u32 pb_Environment[17];
++ __u32 pb_EReserved[15];
+ };
+
+ #define IDNAME_PARTITION 0x50415254 /* "PART" */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/amigaffs.h linux-libc-headers-2.6.8.0/include/linux/amigaffs.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/amigaffs.h 2003-12-31 17:46:48.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/amigaffs.h 2004-08-26 05:41:49.000000000 -0500
+@@ -64,90 +64,90 @@
+ #define AFFS_DATA(bh) (((struct affs_data_head *)(bh)->b_data)->data)
+
+ struct affs_date {
+- u32 days;
+- u32 mins;
+- u32 ticks;
++ __u32 days;
++ __u32 mins;
++ __u32 ticks;
+ };
+
+ struct affs_short_date {
+- u16 days;
+- u16 mins;
+- u16 ticks;
++ __u16 days;
++ __u16 mins;
++ __u16 ticks;
+ };
+
+ struct affs_root_head {
+- u32 ptype;
+- u32 spare1;
+- u32 spare2;
+- u32 hash_size;
+- u32 spare3;
+- u32 checksum;
+- u32 hashtable[1];
++ __u32 ptype;
++ __u32 spare1;
++ __u32 spare2;
++ __u32 hash_size;
++ __u32 spare3;
++ __u32 checksum;
++ __u32 hashtable[1];
+ };
+
+ struct affs_root_tail {
+- u32 bm_flag;
+- u32 bm_blk[AFFS_ROOT_BMAPS];
+- u32 bm_ext;
++ __u32 bm_flag;
++ __u32 bm_blk[AFFS_ROOT_BMAPS];
++ __u32 bm_ext;
+ struct affs_date root_change;
+- u8 disk_name[32];
+- u32 spare1;
+- u32 spare2;
++ __u8 disk_name[32];
++ __u32 spare1;
++ __u32 spare2;
+ struct affs_date disk_change;
+ struct affs_date disk_create;
+- u32 spare3;
+- u32 spare4;
+- u32 dcache;
+- u32 stype;
++ __u32 spare3;
++ __u32 spare4;
++ __u32 dcache;
++ __u32 stype;
+ };
+
+ struct affs_head {
+- u32 ptype;
+- u32 key;
+- u32 block_count;
+- u32 spare1;
+- u32 first_data;
+- u32 checksum;
+- u32 table[1];
++ __u32 ptype;
++ __u32 key;
++ __u32 block_count;
++ __u32 spare1;
++ __u32 first_data;
++ __u32 checksum;
++ __u32 table[1];
+ };
+
+ struct affs_tail {
+- u32 spare1;
+- u16 uid;
+- u16 gid;
+- u32 protect;
+- u32 size;
+- u8 comment[92];
++ __u32 spare1;
++ __u16 uid;
++ __u16 gid;
++ __u32 protect;
++ __u32 size;
++ __u8 comment[92];
+ struct affs_date change;
+- u8 name[32];
+- u32 spare2;
+- u32 original;
+- u32 link_chain;
+- u32 spare[5];
+- u32 hash_chain;
+- u32 parent;
+- u32 extension;
+- u32 stype;
++ __u8 name[32];
++ __u32 spare2;
++ __u32 original;
++ __u32 link_chain;
++ __u32 spare[5];
++ __u32 hash_chain;
++ __u32 parent;
++ __u32 extension;
++ __u32 stype;
+ };
+
+ struct slink_front
+ {
+- u32 ptype;
+- u32 key;
+- u32 spare1[3];
+- u32 checksum;
+- u8 symname[1]; /* depends on block size */
++ __u32 ptype;
++ __u32 key;
++ __u32 spare1[3];
++ __u32 checksum;
++ __u8 symname[1]; /* depends on block size */
+ };
+
+ struct affs_data_head
+ {
+- u32 ptype;
+- u32 key;
+- u32 sequence;
+- u32 size;
+- u32 next;
+- u32 checksum;
+- u8 data[1]; /* depends on block size */
++ __u32 ptype;
++ __u32 key;
++ __u32 sequence;
++ __u32 size;
++ __u32 next;
++ __u32 checksum;
++ __u8 data[1]; /* depends on block size */
+ };
+
+ /* Permission bits */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/ata.h linux-libc-headers-2.6.8.0/include/linux/ata.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/ata.h 2004-08-18 13:16:01.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/ata.h 2004-08-26 05:41:49.000000000 -0500
+@@ -34,7 +34,7 @@
+ ATA_MAX_PRD = 256, /* we could make these 256/256 */
+ ATA_SECT_SIZE = 512,
+ ATA_SECT_SIZE_MASK = (ATA_SECT_SIZE - 1),
+- ATA_SECT_DWORDS = ATA_SECT_SIZE / sizeof(u32),
++ ATA_SECT_DWORDS = ATA_SECT_SIZE / sizeof(__u32),
+
+ ATA_ID_WORDS = 256,
+ ATA_ID_PROD_OFS = 27,
+@@ -176,31 +176,31 @@
+ /* core structures */
+
+ struct ata_prd {
+- u32 addr;
+- u32 flags_len;
++ __u32 addr;
++ __u32 flags_len;
+ } __attribute__((packed));
+
+ struct ata_taskfile {
+ unsigned long flags; /* ATA_TFLAG_xxx */
+- u8 protocol; /* ATA_PROT_xxx */
++ __u8 protocol; /* ATA_PROT_xxx */
+
+- u8 ctl; /* control reg */
++ __u8 ctl; /* control reg */
+
+- u8 hob_feature; /* additional data */
+- u8 hob_nsect; /* to support LBA48 */
+- u8 hob_lbal;
+- u8 hob_lbam;
+- u8 hob_lbah;
++ __u8 hob_feature; /* additional data */
++ __u8 hob_nsect; /* to support LBA48 */
++ __u8 hob_lbal;
++ __u8 hob_lbam;
++ __u8 hob_lbah;
+
+- u8 feature;
+- u8 nsect;
+- u8 lbal;
+- u8 lbam;
+- u8 lbah;
++ __u8 feature;
++ __u8 nsect;
++ __u8 lbal;
++ __u8 lbam;
++ __u8 lbah;
+
+- u8 device;
++ __u8 device;
+
+- u8 command; /* IO operation */
++ __u8 command; /* IO operation */
+ };
+
+ #define ata_id_is_ata(dev) (((dev)->id[0] & (1 << 15)) == 0)
+@@ -213,12 +213,12 @@
+ #define ata_id_has_dma(dev) ((dev)->id[49] & (1 << 8))
+ #define ata_id_removeable(dev) ((dev)->id[0] & (1 << 7))
+ #define ata_id_u32(dev,n) \
+- (((u32) (dev)->id[(n) + 1] << 16) | ((u32) (dev)->id[(n)]))
++ (((__u32) (dev)->id[(n) + 1] << 16) | ((__u32) (dev)->id[(n)]))
+ #define ata_id_u64(dev,n) \
+- ( ((u64) dev->id[(n) + 3] << 48) | \
+- ((u64) dev->id[(n) + 2] << 32) | \
+- ((u64) dev->id[(n) + 1] << 16) | \
+- ((u64) dev->id[(n) + 0]) )
++ ( ((__u64) dev->id[(n) + 3] << 48) | \
++ ((__u64) dev->id[(n) + 2] << 32) | \
++ ((__u64) dev->id[(n) + 1] << 16) | \
++ ((__u64) dev->id[(n) + 0]) )
+
+ static inline int is_atapi_taskfile(struct ata_taskfile *tf)
+ {
+@@ -226,7 +226,7 @@
+ (tf->protocol == ATA_PROT_ATAPI_DMA);
+ }
+
+-static inline int ata_ok(u8 status)
++static inline int ata_ok(__u8 status)
+ {
+ return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
+ == ATA_DRDY);
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/bitops.h linux-libc-headers-2.6.8.0/include/linux/bitops.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/bitops.h 2004-06-09 07:00:49.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/bitops.h 2004-08-26 05:41:49.000000000 -0500
+@@ -114,7 +114,7 @@
+ return generic_hweight32((unsigned int)(w >> 32)) +
+ generic_hweight32((unsigned int)w);
+ #else
+- u64 res;
++ __u64 res;
+ res = (w & 0x5555555555555555ul) + ((w >> 1) & 0x5555555555555555ul);
+ res = (res & 0x3333333333333333ul) + ((res >> 2) & 0x3333333333333333ul);
+ res = (res & 0x0F0F0F0F0F0F0F0Ful) + ((res >> 4) & 0x0F0F0F0F0F0F0F0Ful);
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/compat.h linux-libc-headers-2.6.8.0/include/linux/compat.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/compat.h 2004-06-09 07:00:49.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/compat.h 2004-08-26 05:41:49.000000000 -0500
+@@ -78,9 +78,9 @@
+ };
+
+ struct compat_dirent {
+- u32 d_ino;
++ __u32 d_ino;
+ compat_off_t d_off;
+- u16 d_reclen;
++ __u16 d_reclen;
+ char d_name[256];
+ };
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/console.h linux-libc-headers-2.6.8.0/include/linux/console.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/console.h 2004-08-18 13:16:02.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/console.h 2004-08-26 05:41:49.000000000 -0500
+@@ -49,9 +49,9 @@
+ int (*con_scrolldelta)(struct vc_data *, int);
+ int (*con_set_origin)(struct vc_data *);
+ void (*con_save_screen)(struct vc_data *);
+- u8 (*con_build_attr)(struct vc_data *, u8, u8, u8, u8, u8);
+- void (*con_invert_region)(struct vc_data *, u16 *, int);
+- u16 *(*con_screen_pos)(struct vc_data *, int);
++ __u8 (*con_build_attr)(struct vc_data *, __u8, __u8, __u8, __u8, __u8);
++ void (*con_invert_region)(struct vc_data *, __u16 *, int);
++ __u16 *(*con_screen_pos)(struct vc_data *, int);
+ unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *);
+ };
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/cpufreq.h linux-libc-headers-2.6.8.0/include/linux/cpufreq.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/cpufreq.h 2004-06-23 16:52:53.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/cpufreq.h 2004-08-26 05:41:49.000000000 -0500
+@@ -103,7 +103,7 @@
+ unsigned int cpu; /* cpu nr */
+ unsigned int old;
+ unsigned int new;
+- u8 flags; /* flags of cpufreq_driver, see below. */
++ __u8 flags; /* flags of cpufreq_driver, see below. */
+ };
+
+
+@@ -120,13 +120,13 @@
+ {
+ #if BITS_PER_LONG == 32
+
+- u64 result = ((u64) old) * ((u64) mult);
++ __u64 result = ((__u64) old) * ((__u64) mult);
+ do_div(result, div);
+ return (unsigned long) result;
+
+ #elif BITS_PER_LONG == 64
+
+- unsigned long result = old * ((u64) mult);
++ unsigned long result = old * ((__u64) mult);
+ result /= div;
+ return result;
+
+@@ -178,7 +178,7 @@
+ struct cpufreq_driver {
+ struct module *owner;
+ char name[CPUFREQ_NAME_LEN];
+- u8 flags;
++ __u8 flags;
+
+ /* needed by all drivers */
+ int (*init) (struct cpufreq_policy *policy);
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/cramfs_fs.h linux-libc-headers-2.6.8.0/include/linux/cramfs_fs.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/cramfs_fs.h 2004-01-05 12:42:27.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/cramfs_fs.h 2004-08-26 05:41:49.000000000 -0500
+@@ -2,9 +2,9 @@
+ #define __CRAMFS_H
+
+
+-typedef unsigned char u8;
+-typedef unsigned short u16;
+-typedef unsigned int u32;
++typedef unsigned char __u8;
++typedef unsigned short __u16;
++typedef unsigned int __u32;
+
+
+ #define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
+@@ -31,9 +31,9 @@
+ * Reasonably terse representation of the inode data.
+ */
+ struct cramfs_inode {
+- u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
++ __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
+ /* SIZE for device files is i_rdev */
+- u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
++ __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
+ /* NAMELEN is the length of the file name, divided by 4 and
+ rounded up. (cramfs doesn't support hard links.) */
+ /* OFFSET: For symlinks and non-empty regular files, this
+@@ -42,27 +42,27 @@
+ see README). For non-empty directories it is the offset
+ (divided by 4) of the inode of the first file in that
+ directory. For anything else, offset is zero. */
+- u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH;
++ __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH;
+ };
+
+ struct cramfs_info {
+- u32 crc;
+- u32 edition;
+- u32 blocks;
+- u32 files;
++ __u32 crc;
++ __u32 edition;
++ __u32 blocks;
++ __u32 files;
+ };
+
+ /*
+ * Superblock information at the beginning of the FS.
+ */
+ struct cramfs_super {
+- u32 magic; /* 0x28cd3d45 - random number */
+- u32 size; /* length in bytes */
+- u32 flags; /* feature flags */
+- u32 future; /* reserved for future use */
+- u8 signature[16]; /* "Compressed ROMFS" */
++ __u32 magic; /* 0x28cd3d45 - random number */
++ __u32 size; /* length in bytes */
++ __u32 flags; /* feature flags */
++ __u32 future; /* reserved for future use */
++ __u8 signature[16]; /* "Compressed ROMFS" */
+ struct cramfs_info fsid; /* unique filesystem info */
+- u8 name[16]; /* user-defined name */
++ __u8 name[16]; /* user-defined name */
+ struct cramfs_inode root; /* root inode data */
+ };
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/crc32.h linux-libc-headers-2.6.8.0/include/linux/crc32.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/crc32.h 2003-12-15 12:46:57.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/crc32.h 2004-08-26 05:41:49.000000000 -0500
+@@ -7,9 +7,9 @@
+
+ #include <linux/types.h>
+
+-extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len);
+-extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len);
+-extern u32 bitreverse(u32 in);
++extern __u32 crc32_le(__u32 crc, unsigned char const *p, size_t len);
++extern __u32 crc32_be(__u32 crc, unsigned char const *p, size_t len);
++extern __u32 bitreverse(__u32 in);
+
+ #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length)
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/crypto.h linux-libc-headers-2.6.8.0/include/linux/crypto.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/crypto.h 2004-04-19 16:13:51.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/crypto.h 2004-08-26 05:41:49.000000000 -0500
+@@ -63,28 +63,28 @@
+ struct cipher_alg {
+ unsigned int cia_min_keysize;
+ unsigned int cia_max_keysize;
+- int (*cia_setkey)(void *ctx, const u8 *key,
+- unsigned int keylen, u32 *flags);
+- void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src);
+- void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src);
++ int (*cia_setkey)(void *ctx, const __u8 *key,
++ unsigned int keylen, __u32 *flags);
++ void (*cia_encrypt)(void *ctx, __u8 *dst, const __u8 *src);
++ void (*cia_decrypt)(void *ctx, __u8 *dst, const __u8 *src);
+ };
+
+ struct digest_alg {
+ unsigned int dia_digestsize;
+ void (*dia_init)(void *ctx);
+- void (*dia_update)(void *ctx, const u8 *data, unsigned int len);
+- void (*dia_final)(void *ctx, u8 *out);
+- int (*dia_setkey)(void *ctx, const u8 *key,
+- unsigned int keylen, u32 *flags);
++ void (*dia_update)(void *ctx, const __u8 *data, unsigned int len);
++ void (*dia_final)(void *ctx, __u8 *out);
++ int (*dia_setkey)(void *ctx, const __u8 *key,
++ unsigned int keylen, __u32 *flags);
+ };
+
+ struct compress_alg {
+ int (*coa_init)(void *ctx);
+ void (*coa_exit)(void *ctx);
+- int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen,
+- u8 *dst, unsigned int *dlen);
+- int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen,
+- u8 *dst, unsigned int *dlen);
++ int (*coa_compress)(void *ctx, const __u8 *src, unsigned int slen,
++ __u8 *dst, unsigned int *dlen);
++ int (*coa_decompress)(void *ctx, const __u8 *src, unsigned int slen,
++ __u8 *dst, unsigned int *dlen);
+ };
+
+ #define cra_cipher cra_u.cipher
+@@ -93,7 +93,7 @@
+
+ struct crypto_alg {
+ struct list_head cra_list;
+- u32 cra_flags;
++ __u32 cra_flags;
+ unsigned int cra_blocksize;
+ unsigned int cra_ctxsize;
+ const char cra_name[CRYPTO_MAX_ALG_NAME];
+@@ -116,7 +116,7 @@
+ /*
+ * Algorithm query interface.
+ */
+-int crypto_alg_available(const char *name, u32 flags);
++int crypto_alg_available(const char *name, __u32 flags);
+
+ /*
+ * Transforms: user-instantiated objects which encapsulate algorithms
+@@ -128,9 +128,9 @@
+ struct cipher_tfm {
+ void *cit_iv;
+ unsigned int cit_ivsize;
+- u32 cit_mode;
++ __u32 cit_mode;
+ int (*cit_setkey)(struct crypto_tfm *tfm,
+- const u8 *key, unsigned int keylen);
++ const __u8 *key, unsigned int keylen);
+ int (*cit_encrypt)(struct crypto_tfm *tfm,
+ struct scatterlist *dst,
+ struct scatterlist *src,
+@@ -138,7 +138,7 @@
+ int (*cit_encrypt_iv)(struct crypto_tfm *tfm,
+ struct scatterlist *dst,
+ struct scatterlist *src,
+- unsigned int nbytes, u8 *iv);
++ unsigned int nbytes, __u8 *iv);
+ int (*cit_decrypt)(struct crypto_tfm *tfm,
+ struct scatterlist *dst,
+ struct scatterlist *src,
+@@ -146,19 +146,19 @@
+ int (*cit_decrypt_iv)(struct crypto_tfm *tfm,
+ struct scatterlist *dst,
+ struct scatterlist *src,
+- unsigned int nbytes, u8 *iv);
+- void (*cit_xor_block)(u8 *dst, const u8 *src);
++ unsigned int nbytes, __u8 *iv);
++ void (*cit_xor_block)(__u8 *dst, const __u8 *src);
+ };
+
+ struct digest_tfm {
+ void (*dit_init)(struct crypto_tfm *tfm);
+ void (*dit_update)(struct crypto_tfm *tfm,
+ struct scatterlist *sg, unsigned int nsg);
+- void (*dit_final)(struct crypto_tfm *tfm, u8 *out);
++ void (*dit_final)(struct crypto_tfm *tfm, __u8 *out);
+ void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg,
+- unsigned int nsg, u8 *out);
++ unsigned int nsg, __u8 *out);
+ int (*dit_setkey)(struct crypto_tfm *tfm,
+- const u8 *key, unsigned int keylen);
++ const __u8 *key, unsigned int keylen);
+ #ifdef CONFIG_CRYPTO_HMAC
+ void *dit_hmac_block;
+ #endif
+@@ -166,11 +166,11 @@
+
+ struct compress_tfm {
+ int (*cot_compress)(struct crypto_tfm *tfm,
+- const u8 *src, unsigned int slen,
+- u8 *dst, unsigned int *dlen);
++ const __u8 *src, unsigned int slen,
++ __u8 *dst, unsigned int *dlen);
+ int (*cot_decompress)(struct crypto_tfm *tfm,
+- const u8 *src, unsigned int slen,
+- u8 *dst, unsigned int *dlen);
++ const __u8 *src, unsigned int slen,
++ __u8 *dst, unsigned int *dlen);
+ };
+
+ #define crt_cipher crt_u.cipher
+@@ -179,7 +179,7 @@
+
+ struct crypto_tfm {
+
+- u32 crt_flags;
++ __u32 crt_flags;
+
+ union {
+ struct cipher_tfm cipher;
+@@ -203,7 +203,7 @@
+ * crypto_free_tfm() frees up the transform and any associated resources,
+ * then drops the refcount on the associated algorithm.
+ */
+-struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags);
++struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, __u32 tfm_flags);
+ void crypto_free_tfm(struct crypto_tfm *tfm);
+
+ /*
+@@ -219,7 +219,7 @@
+ return module_name(tfm->__crt_alg->cra_module);
+ }
+
+-static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
++static inline __u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
+ {
+ return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK;
+ }
+@@ -270,7 +270,7 @@
+ tfm->crt_digest.dit_update(tfm, sg, nsg);
+ }
+
+-static inline void crypto_digest_final(struct crypto_tfm *tfm, u8 *out)
++static inline void crypto_digest_final(struct crypto_tfm *tfm, __u8 *out)
+ {
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
+ tfm->crt_digest.dit_final(tfm, out);
+@@ -278,14 +278,14 @@
+
+ static inline void crypto_digest_digest(struct crypto_tfm *tfm,
+ struct scatterlist *sg,
+- unsigned int nsg, u8 *out)
++ unsigned int nsg, __u8 *out)
+ {
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
+ tfm->crt_digest.dit_digest(tfm, sg, nsg, out);
+ }
+
+ static inline int crypto_digest_setkey(struct crypto_tfm *tfm,
+- const u8 *key, unsigned int keylen)
++ const __u8 *key, unsigned int keylen)
+ {
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
+ if (tfm->crt_digest.dit_setkey == NULL)
+@@ -294,7 +294,7 @@
+ }
+
+ static inline int crypto_cipher_setkey(struct crypto_tfm *tfm,
+- const u8 *key, unsigned int keylen)
++ const __u8 *key, unsigned int keylen)
+ {
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
+ return tfm->crt_cipher.cit_setkey(tfm, key, keylen);
+@@ -312,7 +312,7 @@
+ static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
+ struct scatterlist *dst,
+ struct scatterlist *src,
+- unsigned int nbytes, u8 *iv)
++ unsigned int nbytes, __u8 *iv)
+ {
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
+ BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB);
+@@ -331,7 +331,7 @@
+ static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
+ struct scatterlist *dst,
+ struct scatterlist *src,
+- unsigned int nbytes, u8 *iv)
++ unsigned int nbytes, __u8 *iv)
+ {
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
+ BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB);
+@@ -339,30 +339,30 @@
+ }
+
+ static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm,
+- const u8 *src, unsigned int len)
++ const __u8 *src, unsigned int len)
+ {
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
+ memcpy(tfm->crt_cipher.cit_iv, src, len);
+ }
+
+ static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm,
+- u8 *dst, unsigned int len)
++ __u8 *dst, unsigned int len)
+ {
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
+ memcpy(dst, tfm->crt_cipher.cit_iv, len);
+ }
+
+ static inline int crypto_comp_compress(struct crypto_tfm *tfm,
+- const u8 *src, unsigned int slen,
+- u8 *dst, unsigned int *dlen)
++ const __u8 *src, unsigned int slen,
++ __u8 *dst, unsigned int *dlen)
+ {
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS);
+ return tfm->crt_compress.cot_compress(tfm, src, slen, dst, dlen);
+ }
+
+ static inline int crypto_comp_decompress(struct crypto_tfm *tfm,
+- const u8 *src, unsigned int slen,
+- u8 *dst, unsigned int *dlen)
++ const __u8 *src, unsigned int slen,
++ __u8 *dst, unsigned int *dlen)
+ {
+ BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS);
+ return tfm->crt_compress.cot_decompress(tfm, src, slen, dst, dlen);
+@@ -372,13 +372,13 @@
+ * HMAC support.
+ */
+ #ifdef CONFIG_CRYPTO_HMAC
+-void crypto_hmac_init(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen);
++void crypto_hmac_init(struct crypto_tfm *tfm, __u8 *key, unsigned int *keylen);
+ void crypto_hmac_update(struct crypto_tfm *tfm,
+ struct scatterlist *sg, unsigned int nsg);
+-void crypto_hmac_final(struct crypto_tfm *tfm, u8 *key,
+- unsigned int *keylen, u8 *out);
+-void crypto_hmac(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen,
+- struct scatterlist *sg, unsigned int nsg, u8 *out);
++void crypto_hmac_final(struct crypto_tfm *tfm, __u8 *key,
++ unsigned int *keylen, __u8 *out);
++void crypto_hmac(struct crypto_tfm *tfm, __u8 *key, unsigned int *keylen,
++ struct scatterlist *sg, unsigned int nsg, __u8 *out);
+ #endif /* CONFIG_CRYPTO_HMAC */
+
+ #endif /* _LINUX_CRYPTO_H */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/cycx_drv.h linux-libc-headers-2.6.8.0/include/linux/cycx_drv.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/cycx_drv.h 2003-12-15 12:46:57.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/cycx_drv.h 2004-08-26 05:41:49.000000000 -0500
+@@ -14,9 +14,9 @@
+ * ============================================================================
+ * 1999/10/23 acme cycxhw_t cleanup
+ * 1999/01/03 acme more judicious use of data types...
+-* uclong, ucchar, etc deleted, the u8, u16, u32
++* uclong, ucchar, etc deleted, the __u8, __u16, __u32
+ * types are the portable way to go.
+-* 1999/01/03 acme judicious use of data types... u16, u32, etc
++* 1999/01/03 acme judicious use of data types... __u16, __u32, etc
+ * 1998/12/26 acme FIXED_BUFFERS, CONF_OFFSET,
+ * removal of cy_read{bwl}
+ * 1998/08/08 acme Initial version.
+@@ -46,18 +46,18 @@
+ * @reserved - reserved for future use
+ */
+ struct cycx_hw {
+- u32 fwid;
++ __u32 fwid;
+ int irq;
+ void *dpmbase;
+- u32 dpmsize;
+- u32 reserved[5];
++ __u32 dpmsize;
++ __u32 reserved[5];
+ };
+
+ /* Function Prototypes */
+-extern int cycx_setup(struct cycx_hw *hw, void *sfm, u32 len);
++extern int cycx_setup(struct cycx_hw *hw, void *sfm, __u32 len);
+ extern int cycx_down(struct cycx_hw *hw);
+-extern int cycx_peek(struct cycx_hw *hw, u32 addr, void *buf, u32 len);
+-extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len);
++extern int cycx_peek(struct cycx_hw *hw, __u32 addr, void *buf, __u32 len);
++extern int cycx_poke(struct cycx_hw *hw, __u32 addr, void *buf, __u32 len);
+ extern int cycx_exec(void *addr);
+
+ extern void cycx_inten(struct cycx_hw *hw);
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/cycx_x25.h linux-libc-headers-2.6.8.0/include/linux/cycx_x25.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/cycx_x25.h 2003-12-15 12:46:58.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/cycx_x25.h 2004-08-26 05:41:49.000000000 -0500
+@@ -38,10 +38,10 @@
+ /* Data Structures */
+ /* X.25 Command Block. */
+ struct cycx_x25_cmd {
+- u16 command PACKED;
+- u16 link PACKED; /* values: 0 or 1 */
+- u16 len PACKED; /* values: 0 thru 0x205 (517) */
+- u32 buf PACKED;
++ __u16 command PACKED;
++ __u16 link PACKED; /* values: 0 or 1 */
++ __u16 len PACKED; /* values: 0 thru 0x205 (517) */
++ __u32 buf PACKED;
+ };
+
+ /* Defines for the 'command' field. */
+@@ -92,34 +92,34 @@
+ * @flags - see dosx25.doc, in portuguese, for details
+ */
+ struct cycx_x25_config {
+- u8 link PACKED;
+- u8 speed PACKED;
+- u8 clock PACKED;
+- u8 n2 PACKED;
+- u8 n2win PACKED;
+- u8 n3win PACKED;
+- u8 nvc PACKED;
+- u8 pktlen PACKED;
+- u8 locaddr PACKED;
+- u8 remaddr PACKED;
+- u16 t1 PACKED;
+- u16 t2 PACKED;
+- u8 t21 PACKED;
+- u8 npvc PACKED;
+- u8 t23 PACKED;
+- u8 flags PACKED;
++ __u8 link PACKED;
++ __u8 speed PACKED;
++ __u8 clock PACKED;
++ __u8 n2 PACKED;
++ __u8 n2win PACKED;
++ __u8 n3win PACKED;
++ __u8 nvc PACKED;
++ __u8 pktlen PACKED;
++ __u8 locaddr PACKED;
++ __u8 remaddr PACKED;
++ __u16 t1 PACKED;
++ __u16 t2 PACKED;
++ __u8 t21 PACKED;
++ __u8 npvc PACKED;
++ __u8 t23 PACKED;
++ __u8 flags PACKED;
+ };
+
+ struct cycx_x25_stats {
+- u16 rx_crc_errors PACKED;
+- u16 rx_over_errors PACKED;
+- u16 n2_tx_frames PACKED;
+- u16 n2_rx_frames PACKED;
+- u16 tx_timeouts PACKED;
+- u16 rx_timeouts PACKED;
+- u16 n3_tx_packets PACKED;
+- u16 n3_rx_packets PACKED;
+- u16 tx_aborts PACKED;
+- u16 rx_aborts PACKED;
++ __u16 rx_crc_errors PACKED;
++ __u16 rx_over_errors PACKED;
++ __u16 n2_tx_frames PACKED;
++ __u16 n2_rx_frames PACKED;
++ __u16 tx_timeouts PACKED;
++ __u16 rx_timeouts PACKED;
++ __u16 n3_tx_packets PACKED;
++ __u16 n3_rx_packets PACKED;
++ __u16 tx_aborts PACKED;
++ __u16 rx_aborts PACKED;
+ };
+ #endif /* _CYCX_X25_H */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/device.h linux-libc-headers-2.6.8.0/include/linux/device.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/device.h 2004-08-18 13:16:02.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/device.h 2004-08-26 05:41:49.000000000 -0500
+@@ -57,7 +57,7 @@
+ struct device * (*add) (struct device * parent, char * bus_id);
+ int (*hotplug) (struct device *dev, char **envp,
+ int num_envp, char *buffer, int buffer_size);
+- int (*suspend)(struct device * dev, u32 state);
++ int (*suspend)(struct device * dev, __u32 state);
+ int (*resume)(struct device * dev);
+ };
+
+@@ -105,8 +105,8 @@
+ int (*probe) (struct device * dev);
+ int (*remove) (struct device * dev);
+ void (*shutdown) (struct device * dev);
+- int (*suspend) (struct device * dev, u32 state, u32 level);
+- int (*resume) (struct device * dev, u32 level);
++ int (*suspend) (struct device * dev, __u32 state, __u32 level);
++ int (*resume) (struct device * dev, __u32 level);
+ };
+
+
+@@ -262,17 +262,17 @@
+ void *platform_data; /* Platform specific data (e.g. ACPI,
+ BIOS data relevant to device) */
+ struct dev_pm_info power;
+- u32 power_state; /* Current operating state. In
++ __u32 power_state; /* Current operating state. In
+ ACPI-speak, this is D0-D3, D0
+ being fully functional, and D3
+ being off. */
+
+ unsigned char *saved_state; /* saved device state */
+- u32 detach_state; /* State to enter when device is
++ __u32 detach_state; /* State to enter when device is
+ detached from its driver. */
+
+- u64 *dma_mask; /* dma mask (if dma'able device) */
+- u64 coherent_dma_mask;/* Like dma_mask, but for
++ __u64 *dma_mask; /* dma mask (if dma'able device) */
++ __u64 coherent_dma_mask;/* Like dma_mask, but for
+ alloc_coherent mappings as
+ not all hardware supports
+ 64 bit addresses for consistent
+@@ -360,9 +360,9 @@
+
+ struct platform_device {
+ char * name;
+- u32 id;
++ __u32 id;
+ struct device dev;
+- u32 num_resources;
++ __u32 num_resources;
+ struct resource * resource;
+ };
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/divert.h linux-libc-headers-2.6.8.0/include/linux/divert.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/divert.h 2004-06-09 07:00:49.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/divert.h 2004-08-26 05:41:49.000000000 -0500
+@@ -27,10 +27,10 @@
+ {
+ int divert; /* are we active */
+ unsigned int protos; /* protocols */
+- u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */
+- u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */
+- u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */
+- u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */
++ __u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */
++ __u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */
++ __u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */
++ __u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */
+ };
+
+ /*
+@@ -40,12 +40,12 @@
+
+ typedef union _divert_cf_arg
+ {
+- s16 int16;
+- u16 uint16;
+- s32 int32;
+- u32 uint32;
+- s64 int64;
+- u64 uint64;
++ __s16 int16;
++ __u16 uint16;
++ __s32 int32;
++ __u32 uint32;
++ __s64 int64;
++ __u64 uint64;
+ void *ptr;
+ } divert_cf_arg;
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/eeprom.h linux-libc-headers-2.6.8.0/include/linux/eeprom.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/eeprom.h 2003-12-19 07:05:15.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/eeprom.h 2004-08-26 13:26:38.000000000 -0500
+@@ -26,15 +26,15 @@
+ unsigned ee_state;
+
+ spinlock_t *lock;
+- u32 *cache;
++ __u32 *cache;
+ };
+
+
+-u8 eeprom_readb(struct eeprom *ee, unsigned address);
+-void eeprom_read(struct eeprom *ee, unsigned address, u8 *bytes,
++__u8 eeprom_readb(struct eeprom *ee, unsigned address);
++void eeprom_read(struct eeprom *ee, unsigned address, __u8 *bytes,
+ unsigned count);
+-void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data);
+-void eeprom_write(struct eeprom *ee, unsigned address, u8 *bytes,
++void eeprom_writeb(struct eeprom *ee, unsigned address, __u8 data);
++void eeprom_write(struct eeprom *ee, unsigned address, __u8 *bytes,
+ unsigned count);
+
+ /* The EEPROM commands include the alway-set leading bit. */
+@@ -56,10 +56,10 @@
+ }
+
+ /* foo. put this in a .c file */
+-static inline void eeprom_update(struct eeprom *ee, u32 mask, int pol)
++static inline void eeprom_update(struct eeprom *ee, __u32 mask, int pol)
+ {
+ unsigned long flags;
+- u32 data;
++ __u32 data;
+
+ spin_lock_irqsave(ee->lock, flags);
+ data = *ee->cache;
+@@ -106,17 +106,17 @@
+ eeprom_update(ee, ee->eedi, pol);
+ }
+
+-u16 eeprom_readw(struct eeprom *ee, unsigned address)
++__u16 eeprom_readw(struct eeprom *ee, unsigned address)
+ {
+ unsigned i;
+- u16 res = 0;
++ __u16 res = 0;
+
+ eeprom_clk_lo(ee);
+ eeprom_update(ee, ee->eesel, 1 ^ !!(ee->polarity & EEPOL_EESEL));
+ eeprom_send_addr(ee, address);
+
+ for (i=0; i<16; i++) {
+- u32 data;
++ __u32 data;
+ eeprom_clk_hi(ee);
+ res <<= 1;
+ data = readl(ee->addr);
+@@ -130,6 +130,6 @@
+ }
+
+
+-void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data)
++void eeprom_writeb(struct eeprom *ee, unsigned address, __u8 data)
+ {
+ }
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/efi.h linux-libc-headers-2.6.8.0/include/linux/efi.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/efi.h 2004-08-18 13:16:02.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/efi.h 2004-08-26 05:42:08.000000000 -0500
+@@ -30,12 +30,12 @@
+ #define EFI_NOT_FOUND (14 | (1UL << (BITS_PER_LONG-1)))
+
+ typedef unsigned long efi_status_t;
+-typedef u8 efi_bool_t;
+-typedef u16 efi_char16_t; /* UNICODE character */
++typedef __u8 efi_bool_t;
++typedef __u16 efi_char16_t; /* UNICODE character */
+
+
+ typedef struct {
+- u8 b[16];
++ __u8 b[16];
+ } efi_guid_t;
+
+ #define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
+@@ -49,11 +49,11 @@
+ * Generic EFI table header
+ */
+ typedef struct {
+- u64 signature;
+- u32 revision;
+- u32 headersize;
+- u32 crc32;
+- u32 reserved;
++ __u64 signature;
++ __u32 revision;
++ __u32 headersize;
++ __u32 crc32;
++ __u32 reserved;
+ } efi_table_hdr_t;
+
+ /*
+@@ -78,14 +78,14 @@
+ #define EFI_MAX_MEMORY_TYPE 14
+
+ /* Attribute values: */
+-#define EFI_MEMORY_UC ((u64)0x0000000000000001ULL) /* uncached */
+-#define EFI_MEMORY_WC ((u64)0x0000000000000002ULL) /* write-coalescing */
+-#define EFI_MEMORY_WT ((u64)0x0000000000000004ULL) /* write-through */
+-#define EFI_MEMORY_WB ((u64)0x0000000000000008ULL) /* write-back */
+-#define EFI_MEMORY_WP ((u64)0x0000000000001000ULL) /* write-protect */
+-#define EFI_MEMORY_RP ((u64)0x0000000000002000ULL) /* read-protect */
+-#define EFI_MEMORY_XP ((u64)0x0000000000004000ULL) /* execute-protect */
+-#define EFI_MEMORY_RUNTIME ((u64)0x8000000000000000ULL) /* range requires runtime mapping */
++#define EFI_MEMORY_UC ((__u64)0x0000000000000001ULL) /* uncached */
++#define EFI_MEMORY_WC ((__u64)0x0000000000000002ULL) /* write-coalescing */
++#define EFI_MEMORY_WT ((__u64)0x0000000000000004ULL) /* write-through */
++#define EFI_MEMORY_WB ((__u64)0x0000000000000008ULL) /* write-back */
++#define EFI_MEMORY_WP ((__u64)0x0000000000001000ULL) /* write-protect */
++#define EFI_MEMORY_RP ((__u64)0x0000000000002000ULL) /* read-protect */
++#define EFI_MEMORY_XP ((__u64)0x0000000000004000ULL) /* execute-protect */
++#define EFI_MEMORY_RUNTIME ((__u64)0x8000000000000000ULL) /* range requires runtime mapping */
+ #define EFI_MEMORY_DESCRIPTOR_VERSION 1
+
+ #define EFI_PAGE_SHIFT 12
+@@ -96,14 +96,14 @@
+ * the case in ia64. Need to have this fixed in the f/w.
+ */
+ typedef struct {
+- u32 type;
+- u32 pad;
+- u64 phys_addr;
+- u64 virt_addr;
+- u64 num_pages;
+- u64 attribute;
++ __u32 type;
++ __u32 pad;
++ __u64 phys_addr;
++ __u64 virt_addr;
++ __u64 num_pages;
++ __u64 attribute;
+ #if defined (__i386__)
+- u64 pad1;
++ __u64 pad1;
+ #endif
+ } efi_memory_desc_t;
+
+@@ -117,23 +117,23 @@
+ #define EFI_UNSPECIFIED_TIMEZONE 0x07ff
+
+ typedef struct {
+- u16 year;
+- u8 month;
+- u8 day;
+- u8 hour;
+- u8 minute;
+- u8 second;
+- u8 pad1;
+- u32 nanosecond;
+- s16 timezone;
+- u8 daylight;
+- u8 pad2;
++ __u16 year;
++ __u8 month;
++ __u8 day;
++ __u8 hour;
++ __u8 minute;
++ __u8 second;
++ __u8 pad1;
++ __u32 nanosecond;
++ __s16 timezone;
++ __u8 daylight;
++ __u8 pad2;
+ } efi_time_t;
+
+ typedef struct {
+- u32 resolution;
+- u32 accuracy;
+- u8 sets_to_zero;
++ __u32 resolution;
++ __u32 accuracy;
++ __u8 sets_to_zero;
+ } efi_time_cap_t;
+
+ /*
+@@ -146,7 +146,7 @@
+ /*
+ * EFI Runtime Services table
+ */
+-#define EFI_RUNTIME_SERVICES_SIGNATURE ((u64)0x5652453544e5552ULL)
++#define EFI_RUNTIME_SERVICES_SIGNATURE ((__u64)0x5652453544e5552ULL)
+ #define EFI_RUNTIME_SERVICES_REVISION 0x00010000
+
+ typedef struct {
+@@ -169,19 +169,19 @@
+ typedef efi_status_t efi_get_wakeup_time_t (efi_bool_t *enabled, efi_bool_t *pending,
+ efi_time_t *tm);
+ typedef efi_status_t efi_set_wakeup_time_t (efi_bool_t enabled, efi_time_t *tm);
+-typedef efi_status_t efi_get_variable_t (efi_char16_t *name, efi_guid_t *vendor, u32 *attr,
++typedef efi_status_t efi_get_variable_t (efi_char16_t *name, efi_guid_t *vendor, __u32 *attr,
+ unsigned long *data_size, void *data);
+ typedef efi_status_t efi_get_next_variable_t (unsigned long *name_size, efi_char16_t *name,
+ efi_guid_t *vendor);
+ typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *vendor,
+ unsigned long attr, unsigned long data_size,
+ void *data);
+-typedef efi_status_t efi_get_next_high_mono_count_t (u32 *count);
++typedef efi_status_t efi_get_next_high_mono_count_t (__u32 *count);
+ typedef void efi_reset_system_t (int reset_type, efi_status_t status,
+ unsigned long data_size, efi_char16_t *data);
+ typedef efi_status_t efi_set_virtual_address_map_t (unsigned long memory_map_size,
+ unsigned long descriptor_size,
+- u32 descriptor_version,
++ __u32 descriptor_version,
+ efi_memory_desc_t *virtual_map);
+
+ /*
+@@ -219,13 +219,13 @@
+ unsigned long table;
+ } efi_config_table_t;
+
+-#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL)
++#define EFI_SYSTEM_TABLE_SIGNATURE ((__u64)0x5453595320494249ULL)
+ #define EFI_SYSTEM_TABLE_REVISION ((1 << 16) | 00)
+
+ typedef struct {
+ efi_table_hdr_t hdr;
+ unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */
+- u32 fw_revision;
++ __u32 fw_revision;
+ unsigned long con_in_handle;
+ unsigned long con_in;
+ unsigned long con_out_handle;
+@@ -293,9 +293,9 @@
+ extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
+ extern void efi_gettimeofday (struct timespec *ts);
+ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */
+-extern u64 efi_get_iobase (void);
+-extern u32 efi_mem_type (unsigned long phys_addr);
+-extern u64 efi_mem_attributes (unsigned long phys_addr);
++extern __u64 efi_get_iobase (void);
++extern __u32 efi_mem_type (unsigned long phys_addr);
++extern __u64 efi_mem_attributes (unsigned long phys_addr);
+ extern int __init efi_uart_console_only (void);
+ extern void efi_initialize_iomem_resources(struct resource *code_resource,
+ struct resource *data_resource);
+@@ -368,9 +368,9 @@
+ #define EFI_DEV_END_ENTIRE 0xFF
+
+ struct efi_generic_dev_path {
+- u8 type;
+- u8 sub_type;
+- u16 length;
++ __u8 type;
++ __u8 sub_type;
++ __u16 length;
+ } __attribute ((packed));
+
+ #endif /* _LINUX_EFI_H */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/eisa.h linux-libc-headers-2.6.8.0/include/linux/eisa.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/eisa.h 2003-12-15 12:46:58.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/eisa.h 2004-08-26 05:42:08.000000000 -0500
+@@ -43,7 +43,7 @@
+ int state;
+ unsigned long base_addr;
+ struct resource res[EISA_MAX_RESOURCES];
+- u64 dma_mask;
++ __u64 dma_mask;
+ struct device dev; /* generic device */
+ #ifdef CONFIG_EISA_NAMES
+ char pretty_name[DEVICE_NAME_SIZE];
+@@ -91,7 +91,7 @@
+ unsigned long bus_base_addr;
+ int slots; /* Max slot number */
+ int force_probe; /* Probe even when no slot 0 */
+- u64 dma_mask; /* from bridge device */
++ __u64 dma_mask; /* from bridge device */
+ int bus_nr; /* Set by eisa_root_register */
+ struct resource eisa_root_res; /* ditto */
+ };
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/ethtool.h linux-libc-headers-2.6.8.0/include/linux/ethtool.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/ethtool.h 2004-06-23 16:52:54.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/ethtool.h 2004-08-26 13:29:11.000000000 -0500
+@@ -15,24 +15,24 @@
+
+ /* This should work for both 32 and 64 bit userland. */
+ struct ethtool_cmd {
+- u32 cmd;
+- u32 supported; /* Features this interface supports */
+- u32 advertising; /* Features this interface advertises */
+- u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
+- u8 duplex; /* Duplex, half or full */
+- u8 port; /* Which connector port */
+- u8 phy_address;
+- u8 transceiver; /* Which transceiver to use */
+- u8 autoneg; /* Enable or disable autonegotiation */
+- u32 maxtxpkt; /* Tx pkts before generating tx int */
+- u32 maxrxpkt; /* Rx pkts before generating rx int */
+- u32 reserved[4];
++ __u32 cmd;
++ __u32 supported; /* Features this interface supports */
++ __u32 advertising; /* Features this interface advertises */
++ __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
++ __u8 duplex; /* Duplex, half or full */
++ __u8 port; /* Which connector port */
++ __u8 phy_address;
++ __u8 transceiver; /* Which transceiver to use */
++ __u8 autoneg; /* Enable or disable autonegotiation */
++ __u32 maxtxpkt; /* Tx pkts before generating tx int */
++ __u32 maxrxpkt; /* Rx pkts before generating rx int */
++ __u32 reserved[4];
+ };
+
+ #define ETHTOOL_BUSINFO_LEN 32
+ /* these strings are set to whatever the driver author decides... */
+ struct ethtool_drvinfo {
+- u32 cmd;
++ __u32 cmd;
+ char driver[32]; /* driver short name, "tulip", "eepro100" */
+ char version[32]; /* driver version string */
+ char fw_version[32]; /* firmware version string, if applicable */
+@@ -40,53 +40,53 @@
+ /* For PCI devices, use pci_name(pci_dev). */
+ char reserved1[32];
+ char reserved2[16];
+- u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
+- u32 testinfo_len;
+- u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
+- u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
++ __u32 n_stats; /* number of __u64's from ETHTOOL_GSTATS */
++ __u32 testinfo_len;
++ __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
++ __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
+ };
+
+ #define SOPASS_MAX 6
+ /* wake-on-lan settings */
+ struct ethtool_wolinfo {
+- u32 cmd;
+- u32 supported;
+- u32 wolopts;
+- u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
++ __u32 cmd;
++ __u32 supported;
++ __u32 wolopts;
++ __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
+ };
+
+ /* for passing single values */
+ struct ethtool_value {
+- u32 cmd;
+- u32 data;
++ __u32 cmd;
++ __u32 data;
+ };
+
+ /* for passing big chunks of data */
+ struct ethtool_regs {
+- u32 cmd;
+- u32 version; /* driver-specific, indicates different chips/revs */
+- u32 len; /* bytes */
+- u8 data[0];
++ __u32 cmd;
++ __u32 version; /* driver-specific, indicates different chips/revs */
++ __u32 len; /* bytes */
++ __u8 data[0];
+ };
+
+ /* for passing EEPROM chunks */
+ struct ethtool_eeprom {
+- u32 cmd;
+- u32 magic;
+- u32 offset; /* in bytes */
+- u32 len; /* in bytes */
+- u8 data[0];
++ __u32 cmd;
++ __u32 magic;
++ __u32 offset; /* in bytes */
++ __u32 len; /* in bytes */
++ __u8 data[0];
+ };
+
+ /* for configuring coalescing parameters of chip */
+ struct ethtool_coalesce {
+- u32 cmd; /* ETHTOOL_{G,S}COALESCE */
++ __u32 cmd; /* ETHTOOL_{G,S}COALESCE */
+
+ /* How many usecs to delay an RX interrupt after
+ * a packet arrives. If 0, only rx_max_coalesced_frames
+ * is used.
+ */
+- u32 rx_coalesce_usecs;
++ __u32 rx_coalesce_usecs;
+
+ /* How many packets to delay an RX interrupt after
+ * a packet arrives. If 0, only rx_coalesce_usecs is
+@@ -94,21 +94,21 @@
+ * to zero as this would cause RX interrupts to never be
+ * generated.
+ */
+- u32 rx_max_coalesced_frames;
++ __u32 rx_max_coalesced_frames;
+
+ /* Same as above two parameters, except that these values
+ * apply while an IRQ is being serviced by the host. Not
+ * all cards support this feature and the values are ignored
+ * in that case.
+ */
+- u32 rx_coalesce_usecs_irq;
+- u32 rx_max_coalesced_frames_irq;
++ __u32 rx_coalesce_usecs_irq;
++ __u32 rx_max_coalesced_frames_irq;
+
+ /* How many usecs to delay a TX interrupt after
+ * a packet is sent. If 0, only tx_max_coalesced_frames
+ * is used.
+ */
+- u32 tx_coalesce_usecs;
++ __u32 tx_coalesce_usecs;
+
+ /* How many packets to delay a TX interrupt after
+ * a packet is sent. If 0, only tx_coalesce_usecs is
+@@ -116,22 +116,22 @@
+ * to zero as this would cause TX interrupts to never be
+ * generated.
+ */
+- u32 tx_max_coalesced_frames;
++ __u32 tx_max_coalesced_frames;
+
+ /* Same as above two parameters, except that these values
+ * apply while an IRQ is being serviced by the host. Not
+ * all cards support this feature and the values are ignored
+ * in that case.
+ */
+- u32 tx_coalesce_usecs_irq;
+- u32 tx_max_coalesced_frames_irq;
++ __u32 tx_coalesce_usecs_irq;
++ __u32 tx_max_coalesced_frames_irq;
+
+ /* How many usecs to delay in-memory statistics
+ * block updates. Some drivers do not have an in-memory
+ * statistic block, and in such cases this value is ignored.
+ * This value must not be zero.
+ */
+- u32 stats_block_coalesce_usecs;
++ __u32 stats_block_coalesce_usecs;
+
+ /* Adaptive RX/TX coalescing is an algorithm implemented by
+ * some drivers to improve latency under low packet rates and
+@@ -140,18 +140,18 @@
+ * not implemented by the driver causes these values to be
+ * silently ignored.
+ */
+- u32 use_adaptive_rx_coalesce;
+- u32 use_adaptive_tx_coalesce;
++ __u32 use_adaptive_rx_coalesce;
++ __u32 use_adaptive_tx_coalesce;
+
+ /* When the packet rate (measured in packets per second)
+ * is below pkt_rate_low, the {rx,tx}_*_low parameters are
+ * used.
+ */
+- u32 pkt_rate_low;
+- u32 rx_coalesce_usecs_low;
+- u32 rx_max_coalesced_frames_low;
+- u32 tx_coalesce_usecs_low;
+- u32 tx_max_coalesced_frames_low;
++ __u32 pkt_rate_low;
++ __u32 rx_coalesce_usecs_low;
++ __u32 rx_max_coalesced_frames_low;
++ __u32 tx_coalesce_usecs_low;
++ __u32 tx_max_coalesced_frames_low;
+
+ /* When the packet rate is below pkt_rate_high but above
+ * pkt_rate_low (both measured in packets per second) the
+@@ -162,43 +162,43 @@
+ * is above pkt_rate_high, the {rx,tx}_*_high parameters are
+ * used.
+ */
+- u32 pkt_rate_high;
+- u32 rx_coalesce_usecs_high;
+- u32 rx_max_coalesced_frames_high;
+- u32 tx_coalesce_usecs_high;
+- u32 tx_max_coalesced_frames_high;
++ __u32 pkt_rate_high;
++ __u32 rx_coalesce_usecs_high;
++ __u32 rx_max_coalesced_frames_high;
++ __u32 tx_coalesce_usecs_high;
++ __u32 tx_max_coalesced_frames_high;
+
+ /* How often to do adaptive coalescing packet rate sampling,
+ * measured in seconds. Must not be zero.
+ */
+- u32 rate_sample_interval;
++ __u32 rate_sample_interval;
+ };
+
+ /* for configuring RX/TX ring parameters */
+ struct ethtool_ringparam {
+- u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
++ __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
+
+ /* Read only attributes. These indicate the maximum number
+ * of pending RX/TX ring entries the driver will allow the
+ * user to set.
+ */
+- u32 rx_max_pending;
+- u32 rx_mini_max_pending;
+- u32 rx_jumbo_max_pending;
+- u32 tx_max_pending;
++ __u32 rx_max_pending;
++ __u32 rx_mini_max_pending;
++ __u32 rx_jumbo_max_pending;
++ __u32 tx_max_pending;
+
+ /* Values changeable by the user. The valid values are
+ * in the range 1 to the "*_max_pending" counterpart above.
+ */
+- u32 rx_pending;
+- u32 rx_mini_pending;
+- u32 rx_jumbo_pending;
+- u32 tx_pending;
++ __u32 rx_pending;
++ __u32 rx_mini_pending;
++ __u32 rx_jumbo_pending;
++ __u32 tx_pending;
+ };
+
+ /* for configuring link flow control parameters */
+ struct ethtool_pauseparam {
+- u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
++ __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
+
+ /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
+ * being true) the user may set 'autonet' here non-zero to have the
+@@ -210,9 +210,9 @@
+ * then {rx,tx}_pause force the driver to use/not-use pause
+ * flow control.
+ */
+- u32 autoneg;
+- u32 rx_pause;
+- u32 tx_pause;
++ __u32 autoneg;
++ __u32 rx_pause;
++ __u32 tx_pause;
+ };
+
+ #define ETH_GSTRING_LEN 32
+@@ -223,10 +223,10 @@
+
+ /* for passing string sets for data tagging */
+ struct ethtool_gstrings {
+- u32 cmd; /* ETHTOOL_GSTRINGS */
+- u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
+- u32 len; /* number of strings in the string set */
+- u8 data[0];
++ __u32 cmd; /* ETHTOOL_GSTRINGS */
++ __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
++ __u32 len; /* number of strings in the string set */
++ __u8 data[0];
+ };
+
+ enum ethtool_test_flags {
+@@ -236,30 +236,30 @@
+
+ /* for requesting NIC test and getting results*/
+ struct ethtool_test {
+- u32 cmd; /* ETHTOOL_TEST */
+- u32 flags; /* ETH_TEST_FL_xxx */
+- u32 reserved;
+- u32 len; /* result length, in number of u64 elements */
+- u64 data[0];
++ __u32 cmd; /* ETHTOOL_TEST */
++ __u32 flags; /* ETH_TEST_FL_xxx */
++ __u32 reserved;
++ __u32 len; /* result length, in number of __u64 elements */
++ __u64 data[0];
+ };
+
+ /* for dumping NIC-specific statistics */
+ struct ethtool_stats {
+- u32 cmd; /* ETHTOOL_GSTATS */
+- u32 n_stats; /* number of u64's being returned */
+- u64 data[0];
++ __u32 cmd; /* ETHTOOL_GSTATS */
++ __u32 n_stats; /* number of __u64's being returned */
++ __u64 data[0];
+ };
+
+ struct net_device;
+
+ /* Some generic methods drivers may use in their ethtool_ops */
+-u32 ethtool_op_get_link(struct net_device *dev);
+-u32 ethtool_op_get_tx_csum(struct net_device *dev);
+-int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
+-u32 ethtool_op_get_sg(struct net_device *dev);
+-int ethtool_op_set_sg(struct net_device *dev, u32 data);
+-u32 ethtool_op_get_tso(struct net_device *dev);
+-int ethtool_op_set_tso(struct net_device *dev, u32 data);
++__u32 ethtool_op_get_link(struct net_device *dev);
++__u32 ethtool_op_get_tx_csum(struct net_device *dev);
++int ethtool_op_set_tx_csum(struct net_device *dev, __u32 data);
++__u32 ethtool_op_get_sg(struct net_device *dev);
++int ethtool_op_set_sg(struct net_device *dev, __u32 data);
++__u32 ethtool_op_get_tso(struct net_device *dev);
++int ethtool_op_set_tso(struct net_device *dev, __u32 data);
+
+ /**
+ * ðtool_ops - Alter and report network device settings
+@@ -324,33 +324,33 @@
+ void (*get_regs)(struct net_device *, struct ethtool_regs *, void *);
+ void (*get_wol)(struct net_device *, struct ethtool_wolinfo *);
+ int (*set_wol)(struct net_device *, struct ethtool_wolinfo *);
+- u32 (*get_msglevel)(struct net_device *);
+- void (*set_msglevel)(struct net_device *, u32);
++ __u32 (*get_msglevel)(struct net_device *);
++ void (*set_msglevel)(struct net_device *, __u32);
+ int (*nway_reset)(struct net_device *);
+- u32 (*get_link)(struct net_device *);
++ __u32 (*get_link)(struct net_device *);
+ int (*get_eeprom_len)(struct net_device *);
+- int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
+- int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
++ int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, __u8 *);
++ int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, __u8 *);
+ int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
+ int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *);
+ void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *);
+ int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *);
+ void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
+ int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
+- u32 (*get_rx_csum)(struct net_device *);
+- int (*set_rx_csum)(struct net_device *, u32);
+- u32 (*get_tx_csum)(struct net_device *);
+- int (*set_tx_csum)(struct net_device *, u32);
+- u32 (*get_sg)(struct net_device *);
+- int (*set_sg)(struct net_device *, u32);
+- u32 (*get_tso)(struct net_device *);
+- int (*set_tso)(struct net_device *, u32);
++ __u32 (*get_rx_csum)(struct net_device *);
++ int (*set_rx_csum)(struct net_device *, __u32);
++ __u32 (*get_tx_csum)(struct net_device *);
++ int (*set_tx_csum)(struct net_device *, __u32);
++ __u32 (*get_sg)(struct net_device *);
++ int (*set_sg)(struct net_device *, __u32);
++ __u32 (*get_tso)(struct net_device *);
++ int (*set_tso)(struct net_device *, __u32);
+ int (*self_test_count)(struct net_device *);
+- void (*self_test)(struct net_device *, struct ethtool_test *, u64 *);
+- void (*get_strings)(struct net_device *, u32 stringset, u8 *);
+- int (*phys_id)(struct net_device *, u32);
++ void (*self_test)(struct net_device *, struct ethtool_test *, __u64 *);
++ void (*get_strings)(struct net_device *, __u32 stringset, __u8 *);
++ int (*phys_id)(struct net_device *, __u32);
+ int (*get_stats_count)(struct net_device *);
+- void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *);
++ void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, __u64 *);
+ int (*begin)(struct net_device *);
+ void (*complete)(struct net_device *);
+ };
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/firmware.h linux-libc-headers-2.6.8.0/include/linux/firmware.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/firmware.h 2003-12-15 12:46:58.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/firmware.h 2004-08-26 05:42:08.000000000 -0500
+@@ -5,7 +5,7 @@
+ #define FIRMWARE_NAME_MAX 30
+ struct firmware {
+ size_t size;
+- u8 *data;
++ __u8 *data;
+ };
+ int request_firmware(const struct firmware **fw, const char *name,
+ struct device *device);
+@@ -15,5 +15,5 @@
+ void (*cont)(const struct firmware *fw, void *context));
+
+ void release_firmware(const struct firmware *fw);
+-void register_firmware(const char *name, const u8 *data, size_t size);
++void register_firmware(const char *name, const __u8 *data, size_t size);
+ #endif
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/fs.h linux-libc-headers-2.6.8.0/include/linux/fs.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/fs.h 2004-08-18 13:16:02.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/fs.h 2004-08-26 05:42:08.000000000 -0500
+@@ -198,7 +198,7 @@
+ /* A jump here: 108-111 have been used for various private purposes. */
+ #define BLKBSZGET _IOR(0x12,112,size_t)
+ #define BLKBSZSET _IOW(0x12,113,size_t)
+-#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
++#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (__u64 *arg) */
+
+ #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
+ #define FIBMAP _IO(0x00,1) /* bmap access */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/i2c.h linux-libc-headers-2.6.8.0/include/linux/i2c.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/i2c.h 2004-06-23 16:52:54.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/i2c.h 2004-08-26 05:42:08.000000000 -0500
+@@ -70,36 +70,36 @@
+ and probably just as fast.
+ Note that we use i2c_adapter here, because you do not need a specific
+ smbus adapter to call this function. */
+-extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr,
++extern __s32 i2c_smbus_xfer (struct i2c_adapter * adapter, __u16 addr,
+ unsigned short flags,
+- char read_write, u8 command, int size,
++ char read_write, __u8 command, int size,
+ union i2c_smbus_data * data);
+
+ /* Now follow the 'nice' access routines. These also document the calling
+ conventions of smbus_access. */
+
+-extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value);
+-extern s32 i2c_smbus_read_byte(struct i2c_client * client);
+-extern s32 i2c_smbus_write_byte(struct i2c_client * client, u8 value);
+-extern s32 i2c_smbus_read_byte_data(struct i2c_client * client, u8 command);
+-extern s32 i2c_smbus_write_byte_data(struct i2c_client * client,
+- u8 command, u8 value);
+-extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command);
+-extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
+- u8 command, u16 value);
+-extern s32 i2c_smbus_process_call(struct i2c_client * client,
+- u8 command, u16 value);
++extern __s32 i2c_smbus_write_quick(struct i2c_client * client, __u8 value);
++extern __s32 i2c_smbus_read_byte(struct i2c_client * client);
++extern __s32 i2c_smbus_write_byte(struct i2c_client * client, __u8 value);
++extern __s32 i2c_smbus_read_byte_data(struct i2c_client * client, __u8 command);
++extern __s32 i2c_smbus_write_byte_data(struct i2c_client * client,
++ __u8 command, __u8 value);
++extern __s32 i2c_smbus_read_word_data(struct i2c_client * client, __u8 command);
++extern __s32 i2c_smbus_write_word_data(struct i2c_client * client,
++ __u8 command, __u16 value);
++extern __s32 i2c_smbus_process_call(struct i2c_client * client,
++ __u8 command, __u16 value);
+ /* Returns the number of read bytes */
+-extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
+- u8 command, u8 *values);
+-extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
+- u8 command, u8 length,
+- u8 *values);
+-extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
+- u8 command, u8 *values);
+-extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
+- u8 command, u8 length,
+- u8 *values);
++extern __s32 i2c_smbus_read_block_data(struct i2c_client * client,
++ __u8 command, __u8 *values);
++extern __s32 i2c_smbus_write_block_data(struct i2c_client * client,
++ __u8 command, __u8 length,
++ __u8 *values);
++extern __s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
++ __u8 command, __u8 *values);
++extern __s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
++ __u8 command, __u8 length,
++ __u8 *values);
+
+
+ /*
+@@ -203,9 +203,9 @@
+ using common I2C messages */
+ int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[],
+ int num);
+- int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
++ int (*smbus_xfer) (struct i2c_adapter *adap, __u16 addr,
+ unsigned short flags, char read_write,
+- u8 command, int size, union i2c_smbus_data * data);
++ __u8 command, int size, union i2c_smbus_data * data);
+
+ /* --- these optional/future use for some adapter types.*/
+ int (*slave_send)(struct i2c_adapter *,char*,int);
+@@ -215,7 +215,7 @@
+ int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long);
+
+ /* To determine what the adapter supports */
+- u32 (*functionality) (struct i2c_adapter *);
++ __u32 (*functionality) (struct i2c_adapter *);
+ };
+
+ /*
+@@ -381,10 +381,10 @@
+
+
+ /* Return the functionality mask */
+-extern u32 i2c_get_functionality (struct i2c_adapter *adap);
++extern __u32 i2c_get_functionality (struct i2c_adapter *adap);
+
+ /* Return 1 if adapter supports everything we need, 0 if not. */
+-extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func);
++extern int i2c_check_functionality (struct i2c_adapter *adap, __u32 func);
+
+ /*
+ * I2C Message - used for pure i2c transaction, also from /dev interface
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/i2o-dev.h linux-libc-headers-2.6.8.0/include/linux/i2o-dev.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/i2o-dev.h 2004-06-23 16:52:54.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/i2o-dev.h 2004-08-26 05:42:08.000000000 -0500
+@@ -29,7 +29,7 @@
+ * I2O Control IOCTLs and structures
+ */
+ #define I2O_MAGIC_NUMBER 'i'
+-#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,u8[MAX_I2O_CONTROLLERS])
++#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,__u8[MAX_I2O_CONTROLLERS])
+ #define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct)
+ #define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct)
+ #define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget)
+@@ -37,7 +37,7 @@
+ #define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer)
+ #define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer)
+ #define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer)
+-#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,u32)
++#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,__u32)
+ #define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html)
+ #define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id)
+ #define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info)
+@@ -129,65 +129,65 @@
+ #define I2O_BUS_CARDBUS 7
+ #define I2O_BUS_UNKNOWN 0x80
+
+-typedef unsigned char u8;
+-typedef unsigned short u16;
+-typedef unsigned int u32;
++typedef unsigned char __u8;
++typedef unsigned short __u16;
++typedef unsigned int __u32;
+
+ typedef struct _i2o_pci_bus
+ {
+- u8 PciFunctionNumber;
+- u8 PciDeviceNumber;
+- u8 PciBusNumber;
+- u8 reserved;
+- u16 PciVendorID;
+- u16 PciDeviceID;
++ __u8 PciFunctionNumber;
++ __u8 PciDeviceNumber;
++ __u8 PciBusNumber;
++ __u8 reserved;
++ __u16 PciVendorID;
++ __u16 PciDeviceID;
+ } i2o_pci_bus;
+
+ typedef struct _i2o_local_bus
+ {
+- u16 LbBaseIOPort;
+- u16 reserved;
+- u32 LbBaseMemoryAddress;
++ __u16 LbBaseIOPort;
++ __u16 reserved;
++ __u32 LbBaseMemoryAddress;
+ } i2o_local_bus;
+
+ typedef struct _i2o_isa_bus
+ {
+- u16 IsaBaseIOPort;
+- u8 CSN;
+- u8 reserved;
+- u32 IsaBaseMemoryAddress;
++ __u16 IsaBaseIOPort;
++ __u8 CSN;
++ __u8 reserved;
++ __u32 IsaBaseMemoryAddress;
+ } i2o_isa_bus;
+
+ typedef struct _i2o_eisa_bus_info
+ {
+- u16 EisaBaseIOPort;
+- u8 reserved;
+- u8 EisaSlotNumber;
+- u32 EisaBaseMemoryAddress;
++ __u16 EisaBaseIOPort;
++ __u8 reserved;
++ __u8 EisaSlotNumber;
++ __u32 EisaBaseMemoryAddress;
+ } i2o_eisa_bus;
+
+ typedef struct _i2o_mca_bus
+ {
+- u16 McaBaseIOPort;
+- u8 reserved;
+- u8 McaSlotNumber;
+- u32 McaBaseMemoryAddress;
++ __u16 McaBaseIOPort;
++ __u8 reserved;
++ __u8 McaSlotNumber;
++ __u32 McaBaseMemoryAddress;
+ } i2o_mca_bus;
+
+ typedef struct _i2o_other_bus
+ {
+- u16 BaseIOPort;
+- u16 reserved;
+- u32 BaseMemoryAddress;
++ __u16 BaseIOPort;
++ __u16 reserved;
++ __u32 BaseMemoryAddress;
+ } i2o_other_bus;
+
+ typedef struct _i2o_hrt_entry
+ {
+- u32 adapter_id;
+- u32 parent_tid:12;
+- u32 state:4;
+- u32 bus_num:8;
+- u32 bus_type:8;
++ __u32 adapter_id;
++ __u32 parent_tid:12;
++ __u32 state:4;
++ __u32 bus_num:8;
++ __u32 bus_type:8;
+ union
+ {
+ i2o_pci_bus pci_bus;
+@@ -201,69 +201,69 @@
+
+ typedef struct _i2o_hrt
+ {
+- u16 num_entries;
+- u8 entry_len;
+- u8 hrt_version;
+- u32 change_ind;
++ __u16 num_entries;
++ __u8 entry_len;
++ __u8 hrt_version;
++ __u32 change_ind;
+ i2o_hrt_entry hrt_entry[1];
+ } i2o_hrt;
+
+ typedef struct _i2o_lct_entry
+ {
+- u32 entry_size:16;
+- u32 tid:12;
+- u32 reserved:4;
+- u32 change_ind;
+- u32 device_flags;
+- u32 class_id:12;
+- u32 version:4;
+- u32 vendor_id:16;
+- u32 sub_class;
+- u32 user_tid:12;
+- u32 parent_tid:12;
+- u32 bios_info:8;
+- u8 identity_tag[8];
+- u32 event_capabilities;
++ __u32 entry_size:16;
++ __u32 tid:12;
++ __u32 reserved:4;
++ __u32 change_ind;
++ __u32 device_flags;
++ __u32 class_id:12;
++ __u32 version:4;
++ __u32 vendor_id:16;
++ __u32 sub_class;
++ __u32 user_tid:12;
++ __u32 parent_tid:12;
++ __u32 bios_info:8;
++ __u8 identity_tag[8];
++ __u32 event_capabilities;
+ } i2o_lct_entry;
+
+ typedef struct _i2o_lct
+ {
+- u32 table_size:16;
+- u32 boot_tid:12;
+- u32 lct_ver:4;
+- u32 iop_flags;
+- u32 change_ind;
++ __u32 table_size:16;
++ __u32 boot_tid:12;
++ __u32 lct_ver:4;
++ __u32 iop_flags;
++ __u32 change_ind;
+ i2o_lct_entry lct_entry[1];
+ } i2o_lct;
+
+ typedef struct _i2o_status_block
+ {
+- u16 org_id;
+- u16 reserved;
+- u16 iop_id:12;
+- u16 reserved1:4;
+- u16 host_unit_id;
+- u16 segment_number:12;
+- u16 i2o_version:4;
+- u8 iop_state;
+- u8 msg_type;
+- u16 inbound_frame_size;
+- u8 init_code;
+- u8 reserved2;
+- u32 max_inbound_frames;
+- u32 cur_inbound_frames;
+- u32 max_outbound_frames;
++ __u16 org_id;
++ __u16 reserved;
++ __u16 iop_id:12;
++ __u16 reserved1:4;
++ __u16 host_unit_id;
++ __u16 segment_number:12;
++ __u16 i2o_version:4;
++ __u8 iop_state;
++ __u8 msg_type;
++ __u16 inbound_frame_size;
++ __u8 init_code;
++ __u8 reserved2;
++ __u32 max_inbound_frames;
++ __u32 cur_inbound_frames;
++ __u32 max_outbound_frames;
+ char product_id[24];
+- u32 expected_lct_size;
+- u32 iop_capabilities;
+- u32 desired_mem_size;
+- u32 current_mem_size;
+- u32 current_mem_base;
+- u32 desired_io_size;
+- u32 current_io_size;
+- u32 current_io_base;
+- u32 reserved3:24;
+- u32 cmd_status:8;
++ __u32 expected_lct_size;
++ __u32 iop_capabilities;
++ __u32 desired_mem_size;
++ __u32 current_mem_size;
++ __u32 current_mem_base;
++ __u32 desired_io_size;
++ __u32 current_io_size;
++ __u32 current_io_base;
++ __u32 reserved3:24;
++ __u32 cmd_status:8;
+ } i2o_status_block;
+
+ /* Event indicator mask flags */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/isdn/capilli.h linux-libc-headers-2.6.8.0/include/linux/isdn/capilli.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/isdn/capilli.h 2004-03-28 07:52:12.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/isdn/capilli.h 2004-08-26 13:26:47.000000000 -0500
+@@ -43,20 +43,20 @@
+ char *driver_name; /* name of driver */
+ int (*load_firmware)(struct capi_ctr *, capiloaddata *);
+ void (*reset_ctr)(struct capi_ctr *);
+- void (*register_appl)(struct capi_ctr *, u16 appl,
++ void (*register_appl)(struct capi_ctr *, __u16 appl,
+ capi_register_params *);
+- void (*release_appl)(struct capi_ctr *, u16 appl);
+- u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb);
++ void (*release_appl)(struct capi_ctr *, __u16 appl);
++ __u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb);
+
+ char *(*procinfo)(struct capi_ctr *);
+ int (*ctr_read_proc)(char *page, char **start, off_t off,
+ int count, int *eof, struct capi_ctr *card);
+
+ /* filled in before calling ready callback */
+- u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */
++ __u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */
+ capi_version version; /* CAPI_GET_VERSION */
+ capi_profile profile; /* CAPI_GET_PROFILE */
+- u8 serial[CAPI_SERIAL_LEN]; /* CAPI_GET_SERIAL */
++ __u8 serial[CAPI_SERIAL_LEN]; /* CAPI_GET_SERIAL */
+
+ /* management information for kcapi */
+
+@@ -81,7 +81,7 @@
+ void capi_ctr_reseted(struct capi_ctr * card);
+ void capi_ctr_suspend_output(struct capi_ctr * card);
+ void capi_ctr_resume_output(struct capi_ctr * card);
+-void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff *skb);
++void capi_ctr_handle_message(struct capi_ctr * card, __u16 appl, struct sk_buff *skb);
+
+ // ---------------------------------------------------------------------------
+ // needed for AVM capi drivers
+@@ -102,11 +102,11 @@
+ // ---------------------------------------------------------------------------
+ // library functions for use by hardware controller drivers
+
+-void capilib_new_ncci(struct list_head *head, u16 applid, u32 ncci, u32 winsize);
+-void capilib_free_ncci(struct list_head *head, u16 applid, u32 ncci);
+-void capilib_release_appl(struct list_head *head, u16 applid);
++void capilib_new_ncci(struct list_head *head, __u16 applid, __u32 ncci, __u32 winsize);
++void capilib_free_ncci(struct list_head *head, __u16 applid, __u32 ncci);
++void capilib_release_appl(struct list_head *head, __u16 applid);
+ void capilib_release(struct list_head *head);
+-void capilib_data_b3_conf(struct list_head *head, u16 applid, u32 ncci, u16 msgid);
+-u16 capilib_data_b3_req(struct list_head *head, u16 applid, u32 ncci, u16 msgid);
++void capilib_data_b3_conf(struct list_head *head, __u16 applid, __u32 ncci, __u16 msgid);
++__u16 capilib_data_b3_req(struct list_head *head, __u16 applid, __u32 ncci, __u16 msgid);
+
+ #endif /* __CAPILLI_H__ */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/jhash.h linux-libc-headers-2.6.8.0/include/linux/jhash.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/jhash.h 2004-03-28 07:52:09.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/jhash.h 2004-08-26 05:42:08.000000000 -0500
+@@ -41,19 +41,19 @@
+ * of bytes. No alignment or length assumptions are made about
+ * the input key.
+ */
+-static inline u32 jhash(const void *key, u32 length, u32 initval)
++static inline __u32 jhash(const void *key, __u32 length, __u32 initval)
+ {
+- u32 a, b, c, len;
+- const u8 *k = key;
++ __u32 a, b, c, len;
++ const __u8 *k = key;
+
+ len = length;
+ a = b = JHASH_GOLDEN_RATIO;
+ c = initval;
+
+ while (len >= 12) {
+- a += (k[0] +((u32)k[1]<<8) +((u32)k[2]<<16) +((u32)k[3]<<24));
+- b += (k[4] +((u32)k[5]<<8) +((u32)k[6]<<16) +((u32)k[7]<<24));
+- c += (k[8] +((u32)k[9]<<8) +((u32)k[10]<<16)+((u32)k[11]<<24));
++ a += (k[0] +((__u32)k[1]<<8) +((__u32)k[2]<<16) +((__u32)k[3]<<24));
++ b += (k[4] +((__u32)k[5]<<8) +((__u32)k[6]<<16) +((__u32)k[7]<<24));
++ c += (k[8] +((__u32)k[9]<<8) +((__u32)k[10]<<16)+((__u32)k[11]<<24));
+
+ __jhash_mix(a,b,c);
+
+@@ -63,16 +63,16 @@
+
+ c += length;
+ switch (len) {
+- case 11: c += ((u32)k[10]<<24);
+- case 10: c += ((u32)k[9]<<16);
+- case 9 : c += ((u32)k[8]<<8);
+- case 8 : b += ((u32)k[7]<<24);
+- case 7 : b += ((u32)k[6]<<16);
+- case 6 : b += ((u32)k[5]<<8);
++ case 11: c += ((__u32)k[10]<<24);
++ case 10: c += ((__u32)k[9]<<16);
++ case 9 : c += ((__u32)k[8]<<8);
++ case 8 : b += ((__u32)k[7]<<24);
++ case 7 : b += ((__u32)k[6]<<16);
++ case 6 : b += ((__u32)k[5]<<8);
+ case 5 : b += k[4];
+- case 4 : a += ((u32)k[3]<<24);
+- case 3 : a += ((u32)k[2]<<16);
+- case 2 : a += ((u32)k[1]<<8);
++ case 4 : a += ((__u32)k[3]<<24);
++ case 3 : a += ((__u32)k[2]<<16);
++ case 2 : a += ((__u32)k[1]<<8);
+ case 1 : a += k[0];
+ };
+
+@@ -81,12 +81,12 @@
+ return c;
+ }
+
+-/* A special optimized version that handles 1 or more of u32s.
+- * The length parameter here is the number of u32s in the key.
++/* A special optimized version that handles 1 or more of __u32s.
++ * The length parameter here is the number of __u32s in the key.
+ */
+-static inline u32 jhash2(u32 *k, u32 length, u32 initval)
++static inline __u32 jhash2(__u32 *k, __u32 length, __u32 initval)
+ {
+- u32 a, b, c, len;
++ __u32 a, b, c, len;
+
+ a = b = JHASH_GOLDEN_RATIO;
+ c = initval;
+@@ -119,7 +119,7 @@
+ * NOTE: In partilar the "c += length; __jhash_mix(a,b,c);" normally
+ * done at the end is not done here.
+ */
+-static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval)
++static inline __u32 jhash_3words(__u32 a, __u32 b, __u32 c, __u32 initval)
+ {
+ a += JHASH_GOLDEN_RATIO;
+ b += JHASH_GOLDEN_RATIO;
+@@ -130,12 +130,12 @@
+ return c;
+ }
+
+-static inline u32 jhash_2words(u32 a, u32 b, u32 initval)
++static inline __u32 jhash_2words(__u32 a, __u32 b, __u32 initval)
+ {
+ return jhash_3words(a, b, 0, initval);
+ }
+
+-static inline u32 jhash_1word(u32 a, u32 initval)
++static inline __u32 jhash_1word(__u32 a, __u32 initval)
+ {
+ return jhash_3words(a, 0, 0, initval);
+ }
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/jiffies.h linux-libc-headers-2.6.8.0/include/linux/jiffies.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/jiffies.h 2004-01-17 17:04:30.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/jiffies.h 2004-08-26 13:26:33.000000000 -0500
+@@ -12,15 +12,15 @@
+ * without sampling the sequence number in xtime_lock.
+ * get_jiffies_64() will do this for you as appropriate.
+ */
+-extern u64 jiffies_64;
++extern __u64 jiffies_64;
+ extern unsigned long volatile jiffies;
+
+ #if (BITS_PER_LONG < 64)
+-u64 get_jiffies_64(void);
++__u64 get_jiffies_64(void);
+ #else
+-static inline u64 get_jiffies_64(void)
++static inline __u64 get_jiffies_64(void)
+ {
+- return (u64)jiffies;
++ return (__u64)jiffies;
+ }
+ #endif
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/kernel_stat.h linux-libc-headers-2.6.8.0/include/linux/kernel_stat.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/kernel_stat.h 2004-04-19 16:13:51.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/kernel_stat.h 2004-08-26 05:42:08.000000000 -0500
+@@ -12,13 +12,13 @@
+ */
+
+ struct cpu_usage_stat {
+- u64 user;
+- u64 nice;
+- u64 system;
+- u64 softirq;
+- u64 irq;
+- u64 idle;
+- u64 iowait;
++ __u64 user;
++ __u64 nice;
++ __u64 system;
++ __u64 softirq;
++ __u64 irq;
++ __u64 idle;
++ __u64 iowait;
+ };
+
+ struct kernel_stat {
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/libata.h linux-libc-headers-2.6.8.0/include/linux/libata.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/libata.h 2004-08-18 13:16:03.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/libata.h 2004-08-26 05:42:08.000000000 -0500
+@@ -160,7 +160,7 @@
+ struct ata_queued_cmd;
+
+ /* typedefs */
+-typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, u8 drv_stat);
++typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, __u8 drv_stat);
+
+ struct ata_ioports {
+ unsigned long cmd_addr;
+@@ -246,18 +246,18 @@
+ };
+
+ struct ata_device {
+- u64 n_sectors; /* size of device, if ATA */
++ __u64 n_sectors; /* size of device, if ATA */
+ unsigned long flags; /* ATA_DFLAG_xxx */
+ unsigned int class; /* ATA_DEV_xxx */
+ unsigned int devno; /* 0 or 1 */
+- u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
++ __u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
+ unsigned int pio_mode;
+ unsigned int udma_mode;
+
+ /* cache info about current transfer mode */
+- u8 xfer_protocol; /* taskfile xfer protocol */
+- u8 read_cmd; /* opcode to use on read */
+- u8 write_cmd; /* opcode to use on write */
++ __u8 xfer_protocol; /* taskfile xfer protocol */
++ __u8 read_cmd; /* opcode to use on read */
++ __u8 write_cmd; /* opcode to use on write */
+ };
+
+ struct ata_port {
+@@ -272,8 +272,8 @@
+
+ struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */
+
+- u8 ctl; /* cache of ATA control register */
+- u8 last_ctl; /* Cache last written value */
++ __u8 ctl; /* cache of ATA control register */
++ __u8 last_ctl; /* Cache last written value */
+ unsigned int bus_state;
+ unsigned int port_state;
+ unsigned int pio_mask;
+@@ -312,7 +312,7 @@
+ void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
+
+ void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
+- u8 (*check_status)(struct ata_port *ap);
++ __u8 (*check_status)(struct ata_port *ap);
+
+ void (*phy_reset) (struct ata_port *ap);
+ void (*post_set_mode) (struct ata_port *ap);
+@@ -328,9 +328,9 @@
+ irqreturn_t (*irq_handler)(int, void *, struct pt_regs *);
+ void (*irq_clear) (struct ata_port *);
+
+- u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
++ __u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
+ void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
+- u32 val);
++ __u32 val);
+
+ int (*port_start) (struct ata_port *ap);
+ void (*port_stop) (struct ata_port *ap);
+@@ -374,10 +374,10 @@
+ extern void ata_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf);
+ extern void ata_tf_read_pio(struct ata_port *ap, struct ata_taskfile *tf);
+ extern void ata_tf_read_mmio(struct ata_port *ap, struct ata_taskfile *tf);
+-extern void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp);
+-extern void ata_tf_from_fis(u8 *fis, struct ata_taskfile *tf);
+-extern u8 ata_check_status_pio(struct ata_port *ap);
+-extern u8 ata_check_status_mmio(struct ata_port *ap);
++extern void ata_tf_to_fis(struct ata_taskfile *tf, __u8 *fis, __u8 pmp);
++extern void ata_tf_from_fis(__u8 *fis, struct ata_taskfile *tf);
++extern __u8 ata_check_status_pio(struct ata_port *ap);
++extern __u8 ata_check_status_mmio(struct ata_port *ap);
+ extern void ata_exec_command_pio(struct ata_port *ap, struct ata_taskfile *tf);
+ extern void ata_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf);
+ extern int ata_port_start (struct ata_port *ap);
+@@ -397,7 +397,7 @@
+ extern void ata_bmdma_start_pio (struct ata_queued_cmd *qc);
+ extern void ata_bmdma_irq_clear(struct ata_port *ap);
+ extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits);
+-extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat);
++extern void ata_qc_complete(struct ata_queued_cmd *qc, __u8 drv_stat);
+ extern void ata_eng_timeout(struct ata_port *ap);
+ extern int ata_std_bios_param(struct scsi_device *sdev,
+ struct block_device *bdev,
+@@ -416,7 +416,7 @@
+ (dev->class == ATA_DEV_ATAPI));
+ }
+
+-static inline u8 ata_chk_err(struct ata_port *ap)
++static inline __u8 ata_chk_err(struct ata_port *ap)
+ {
+ if (ap->flags & ATA_FLAG_MMIO) {
+ return readb((void *) ap->ioaddr.error_addr);
+@@ -424,12 +424,12 @@
+ return inb(ap->ioaddr.error_addr);
+ }
+
+-static inline u8 ata_chk_status(struct ata_port *ap)
++static inline __u8 ata_chk_status(struct ata_port *ap)
+ {
+ return ap->ops->check_status(ap);
+ }
+
+-static inline u8 ata_altstatus(struct ata_port *ap)
++static inline __u8 ata_altstatus(struct ata_port *ap)
+ {
+ if (ap->flags & ATA_FLAG_MMIO)
+ return readb(ap->ioaddr.altstatus_addr);
+@@ -442,10 +442,10 @@
+ ndelay(400);
+ }
+
+-static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits,
++static inline __u8 ata_busy_wait(struct ata_port *ap, unsigned int bits,
+ unsigned int max)
+ {
+- u8 status;
++ __u8 status;
+
+ do {
+ udelay(10);
+@@ -456,9 +456,9 @@
+ return status;
+ }
+
+-static inline u8 ata_wait_idle(struct ata_port *ap)
++static inline __u8 ata_wait_idle(struct ata_port *ap)
+ {
+- u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
++ __u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
+
+ if (status & (ATA_BUSY | ATA_DRQ)) {
+ unsigned long l = ap->ioaddr.status_addr;
+@@ -495,10 +495,10 @@
+ tf->device = ATA_DEVICE_OBS | ATA_DEV1;
+ }
+
+-static inline u8 ata_irq_on(struct ata_port *ap)
++static inline __u8 ata_irq_on(struct ata_port *ap)
+ {
+ struct ata_ioports *ioaddr = &ap->ioaddr;
+- u8 tmp;
++ __u8 tmp;
+
+ ap->ctl &= ~ATA_NIEN;
+ ap->last_ctl = ap->ctl;
+@@ -514,10 +514,10 @@
+ return tmp;
+ }
+
+-static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
++static inline __u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
+ {
+ unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
+- u8 host_stat, post_stat, status;
++ __u8 host_stat, post_stat, status;
+
+ status = ata_busy_wait(ap, bits, 1000);
+ if (status & bits)
+@@ -545,12 +545,12 @@
+ return status;
+ }
+
+-static inline u32 scr_read(struct ata_port *ap, unsigned int reg)
++static inline __u32 scr_read(struct ata_port *ap, unsigned int reg)
+ {
+ return ap->ops->scr_read(ap, reg);
+ }
+
+-static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val)
++static inline void scr_write(struct ata_port *ap, unsigned int reg, __u32 val)
+ {
+ ap->ops->scr_write(ap, reg, val);
+ }
+@@ -589,9 +589,9 @@
+ }
+ }
+
+-static inline u8 ata_bmdma_status(struct ata_port *ap)
++static inline __u8 ata_bmdma_status(struct ata_port *ap)
+ {
+- u8 host_stat;
++ __u8 host_stat;
+ if (ap->flags & ATA_FLAG_MMIO) {
+ void *mmio = (void *) ap->ioaddr.bmdma_addr;
+ host_stat = readb(mmio + ATA_DMA_STATUS);
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/bind.h linux-libc-headers-2.6.8.0/include/linux/lockd/bind.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/bind.h 2003-12-15 12:46:58.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/lockd/bind.h 2004-08-26 05:42:08.000000000 -0500
+@@ -18,7 +18,7 @@
+ * This is the set of functions for lockd->nfsd communication
+ */
+ struct nlmsvc_binding {
+- u32 (*fopen)(struct svc_rqst *,
++ __u32 (*fopen)(struct svc_rqst *,
+ struct nfs_fh *,
+ struct file *);
+ void (*fclose)(struct file *);
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/nlm.h linux-libc-headers-2.6.8.0/include/linux/lockd/nlm.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/nlm.h 2004-01-17 17:04:34.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/lockd/nlm.h 2004-08-26 05:42:08.000000000 -0500
+@@ -11,8 +11,8 @@
+
+
+ /* Maximum file offset in file_lock.fl_end */
+-# define NLM_OFFSET_MAX ((s32) 0x7fffffff)
+-# define NLM4_OFFSET_MAX ((s64) ((~(u64)0) >> 1))
++# define NLM_OFFSET_MAX ((__s32) 0x7fffffff)
++# define NLM4_OFFSET_MAX ((__s64) ((~(__u64)0) >> 1))
+
+ /* Return states for NLM */
+ enum {
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/share.h linux-libc-headers-2.6.8.0/include/linux/lockd/share.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/share.h 2003-12-15 12:46:58.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/lockd/share.h 2004-08-26 13:26:43.000000000 -0500
+@@ -17,13 +17,13 @@
+ struct nlm_host * s_host; /* client host */
+ struct nlm_file * s_file; /* shared file */
+ struct xdr_netobj s_owner; /* owner handle */
+- u32 s_access; /* access mode */
+- u32 s_mode; /* deny mode */
++ __u32 s_access; /* access mode */
++ __u32 s_mode; /* deny mode */
+ };
+
+-u32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *,
++__u32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *,
+ struct nlm_args *);
+-u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *,
++__u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *,
+ struct nlm_args *);
+ int nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *, int);
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/sm_inter.h linux-libc-headers-2.6.8.0/include/linux/lockd/sm_inter.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/sm_inter.h 2003-12-15 12:46:58.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/lockd/sm_inter.h 2004-08-26 05:42:08.000000000 -0500
+@@ -24,23 +24,23 @@
+ * Arguments for all calls to statd
+ */
+ struct nsm_args {
+- u32 addr; /* remote address */
+- u32 prog; /* RPC callback info */
+- u32 vers;
+- u32 proc;
+- u32 proto; /* protocol (udp/tcp) plus server/client flag */
++ __u32 addr; /* remote address */
++ __u32 prog; /* RPC callback info */
++ __u32 vers;
++ __u32 proc;
++ __u32 proto; /* protocol (udp/tcp) plus server/client flag */
+ };
+
+ /*
+ * Result returned by statd
+ */
+ struct nsm_res {
+- u32 status;
+- u32 state;
++ __u32 status;
++ __u32 state;
+ };
+
+ int nsm_monitor(struct nlm_host *);
+ int nsm_unmonitor(struct nlm_host *);
+-extern u32 nsm_local_state;
++extern __u32 nsm_local_state;
+
+ #endif /* LINUX_LOCKD_SM_INTER_H */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/xdr.h linux-libc-headers-2.6.8.0/include/linux/lockd/xdr.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/xdr.h 2004-01-05 12:42:33.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/lockd/xdr.h 2004-08-26 05:42:08.000000000 -0500
+@@ -48,12 +48,12 @@
+ struct nlm_args {
+ struct nlm_cookie cookie;
+ struct nlm_lock lock;
+- u32 block;
+- u32 reclaim;
+- u32 state;
+- u32 monitor;
+- u32 fsm_access;
+- u32 fsm_mode;
++ __u32 block;
++ __u32 reclaim;
++ __u32 state;
++ __u32 monitor;
++ __u32 fsm_access;
++ __u32 fsm_mode;
+ };
+
+ typedef struct nlm_args nlm_args;
+@@ -63,7 +63,7 @@
+ */
+ struct nlm_res {
+ struct nlm_cookie cookie;
+- u32 status;
++ __u32 status;
+ struct nlm_lock lock;
+ };
+
+@@ -73,10 +73,10 @@
+ struct nlm_reboot {
+ char * mon;
+ int len;
+- u32 state;
+- u32 addr;
+- u32 vers;
+- u32 proto;
++ __u32 state;
++ __u32 addr;
++ __u32 vers;
++ __u32 proto;
+ };
+
+ /*
+@@ -84,24 +84,24 @@
+ */
+ #define NLMSVC_XDRSIZE sizeof(struct nlm_args)
+
+-int nlmsvc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlmsvc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *);
+-int nlmsvc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlmsvc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlmsvc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlmsvc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *);
+-int nlmsvc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *);
+-int nlmsvc_encode_void(struct svc_rqst *, u32 *, void *);
+-int nlmsvc_decode_void(struct svc_rqst *, u32 *, void *);
+-int nlmsvc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlmsvc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *);
+-int nlmsvc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlmsvc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *);
++int nlmsvc_decode_testargs(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlmsvc_encode_testres(struct svc_rqst *, __u32 *, struct nlm_res *);
++int nlmsvc_decode_lockargs(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlmsvc_decode_cancargs(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlmsvc_decode_unlockargs(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlmsvc_encode_res(struct svc_rqst *, __u32 *, struct nlm_res *);
++int nlmsvc_decode_res(struct svc_rqst *, __u32 *, struct nlm_res *);
++int nlmsvc_encode_void(struct svc_rqst *, __u32 *, void *);
++int nlmsvc_decode_void(struct svc_rqst *, __u32 *, void *);
++int nlmsvc_decode_shareargs(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlmsvc_encode_shareres(struct svc_rqst *, __u32 *, struct nlm_res *);
++int nlmsvc_decode_notify(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlmsvc_decode_reboot(struct svc_rqst *, __u32 *, struct nlm_reboot *);
+ /*
+-int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
+-int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
+-int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *);
+-int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
++int nlmclt_encode_testargs(struct rpc_rqst *, __u32 *, struct nlm_args *);
++int nlmclt_encode_lockargs(struct rpc_rqst *, __u32 *, struct nlm_args *);
++int nlmclt_encode_cancargs(struct rpc_rqst *, __u32 *, struct nlm_args *);
++int nlmclt_encode_unlockargs(struct rpc_rqst *, __u32 *, struct nlm_args *);
+ */
+
+ #endif /* LOCKD_XDR_H */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/xdr4.h linux-libc-headers-2.6.8.0/include/linux/lockd/xdr4.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/xdr4.h 2004-01-05 12:42:33.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/lockd/xdr4.h 2004-08-26 05:42:08.000000000 -0500
+@@ -22,24 +22,24 @@
+
+
+
+-int nlm4svc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlm4svc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *);
+-int nlm4svc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlm4svc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlm4svc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlm4svc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *);
+-int nlm4svc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *);
+-int nlm4svc_encode_void(struct svc_rqst *, u32 *, void *);
+-int nlm4svc_decode_void(struct svc_rqst *, u32 *, void *);
+-int nlm4svc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlm4svc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *);
+-int nlm4svc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *);
+-int nlm4svc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *);
++int nlm4svc_decode_testargs(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlm4svc_encode_testres(struct svc_rqst *, __u32 *, struct nlm_res *);
++int nlm4svc_decode_lockargs(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlm4svc_decode_cancargs(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlm4svc_decode_unlockargs(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlm4svc_encode_res(struct svc_rqst *, __u32 *, struct nlm_res *);
++int nlm4svc_decode_res(struct svc_rqst *, __u32 *, struct nlm_res *);
++int nlm4svc_encode_void(struct svc_rqst *, __u32 *, void *);
++int nlm4svc_decode_void(struct svc_rqst *, __u32 *, void *);
++int nlm4svc_decode_shareargs(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlm4svc_encode_shareres(struct svc_rqst *, __u32 *, struct nlm_res *);
++int nlm4svc_decode_notify(struct svc_rqst *, __u32 *, struct nlm_args *);
++int nlm4svc_decode_reboot(struct svc_rqst *, __u32 *, struct nlm_reboot *);
+ /*
+-int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
+-int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
+-int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *);
+-int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
++int nlmclt_encode_testargs(struct rpc_rqst *, __u32 *, struct nlm_args *);
++int nlmclt_encode_lockargs(struct rpc_rqst *, __u32 *, struct nlm_args *);
++int nlmclt_encode_cancargs(struct rpc_rqst *, __u32 *, struct nlm_args *);
++int nlmclt_encode_unlockargs(struct rpc_rqst *, __u32 *, struct nlm_args *);
+ */
+
+ #endif /* LOCKD_XDR4_H */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/mca.h linux-libc-headers-2.6.8.0/include/linux/mca.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/mca.h 2004-08-18 13:16:03.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/mca.h 2004-08-26 05:42:08.000000000 -0500
+@@ -50,7 +50,7 @@
+ };
+
+ struct mca_device {
+- u64 dma_mask;
++ __u64 dma_mask;
+ int pos_id;
+ int slot;
+
+@@ -91,7 +91,7 @@
+ };
+
+ struct mca_bus {
+- u64 default_dma_mask;
++ __u64 default_dma_mask;
+ int number;
+ struct mca_bus_accessor_functions f;
+ struct device dev;
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/mii.h linux-libc-headers-2.6.8.0/include/linux/mii.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/mii.h 2004-06-23 16:52:55.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/mii.h 2004-08-26 05:42:08.000000000 -0500
+@@ -138,10 +138,10 @@
+
+ /* This structure is used in all SIOCxMIIxxx ioctl calls */
+ struct mii_ioctl_data {
+- u16 phy_id;
+- u16 reg_num;
+- u16 val_in;
+- u16 val_out;
++ __u16 phy_id;
++ __u16 reg_num;
++ __u16 val_in;
++ __u16 val_out;
+ };
+
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/mtd/map.h linux-libc-headers-2.6.8.0/include/linux/mtd/map.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/mtd/map.h 2004-08-18 13:16:06.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/mtd/map.h 2004-08-26 05:42:08.000000000 -0500
+@@ -36,20 +36,20 @@
+ int buswidth; /* in octets */
+
+ #ifdef CONFIG_MTD_COMPLEX_MAPPINGS
+- u8 (*read8)(struct map_info *, unsigned long);
+- u16 (*read16)(struct map_info *, unsigned long);
+- u32 (*read32)(struct map_info *, unsigned long);
+- u64 (*read64)(struct map_info *, unsigned long);
++ __u8 (*read8)(struct map_info *, unsigned long);
++ __u16 (*read16)(struct map_info *, unsigned long);
++ __u32 (*read32)(struct map_info *, unsigned long);
++ __u64 (*read64)(struct map_info *, unsigned long);
+ /* If it returned a 'long' I'd call it readl.
+ * It doesn't.
+ * I won't.
+ * dwmw2 */
+
+ void (*copy_from)(struct map_info *, void *, unsigned long, ssize_t);
+- void (*write8)(struct map_info *, u8, unsigned long);
+- void (*write16)(struct map_info *, u16, unsigned long);
+- void (*write32)(struct map_info *, u32, unsigned long);
+- void (*write64)(struct map_info *, u64, unsigned long);
++ void (*write8)(struct map_info *, __u8, unsigned long);
++ void (*write16)(struct map_info *, __u16, unsigned long);
++ void (*write32)(struct map_info *, __u32, unsigned long);
++ void (*write64)(struct map_info *, __u64, unsigned long);
+ void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t);
+
+ /* We can perhaps put in 'point' and 'unpoint' methods, if we really
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/mtd/nand.h linux-libc-headers-2.6.8.0/include/linux/mtd/nand.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/mtd/nand.h 2004-08-18 13:16:06.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/mtd/nand.h 2004-08-26 05:42:08.000000000 -0500
+@@ -271,8 +271,8 @@
+
+ u_char (*read_byte)(struct mtd_info *mtd);
+ void (*write_byte)(struct mtd_info *mtd, u_char byte);
+- u16 (*read_word)(struct mtd_info *mtd);
+- void (*write_word)(struct mtd_info *mtd, u16 word);
++ __u16 (*read_word)(struct mtd_info *mtd);
++ void (*write_word)(struct mtd_info *mtd, __u16 word);
+
+ void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len);
+ void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len);
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/mtd/pmc551.h linux-libc-headers-2.6.8.0/include/linux/mtd/pmc551.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/mtd/pmc551.h 2004-03-28 07:52:13.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/mtd/pmc551.h 2004-08-26 05:42:08.000000000 -0500
+@@ -25,9 +25,9 @@
+ struct mypriv {
+ struct pci_dev *dev;
+ u_char *start;
+- u32 base_map0;
+- u32 curr_map0;
+- u32 asize;
++ __u32 base_map0;
++ __u32 curr_map0;
++ __u32 asize;
+ struct mtd_info *nextpmc551;
+ };
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nbd.h linux-libc-headers-2.6.8.0/include/linux/nbd.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/nbd.h 2004-03-28 07:52:09.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/nbd.h 2004-08-26 05:42:08.000000000 -0500
+@@ -45,11 +45,11 @@
+ * server. All data are in network byte order.
+ */
+ struct nbd_request {
+- u32 magic;
+- u32 type; /* == READ || == WRITE */
++ __u32 magic;
++ __u32 type; /* == READ || == WRITE */
+ char handle[8];
+- u64 from;
+- u32 len;
++ __u64 from;
++ __u32 len;
+ }
+ #ifdef __GNUC__
+ __attribute__ ((packed))
+@@ -61,8 +61,8 @@
+ * it has completed an I/O request (or an error occurs).
+ */
+ struct nbd_reply {
+- u32 magic;
+- u32 error; /* 0 = ok, else error */
++ __u32 magic;
++ __u32 error; /* 0 = ok, else error */
+ char handle[8]; /* handle you got from request */
+ };
+ #endif
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfs_fs_i.h linux-libc-headers-2.6.8.0/include/linux/nfs_fs_i.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/nfs_fs_i.h 2004-01-17 17:04:31.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/nfs_fs_i.h 2004-08-26 05:42:08.000000000 -0500
+@@ -8,8 +8,8 @@
+ * NFS lock info
+ */
+ struct nfs_lock_info {
+- u32 state;
+- u32 flags;
++ __u32 state;
++ __u32 flags;
+ struct nlm_host *host;
+ };
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfs_fs_sb.h linux-libc-headers-2.6.8.0/include/linux/nfs_fs_sb.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/nfs_fs_sb.h 2004-06-09 07:00:50.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/nfs_fs_sb.h 2004-08-26 05:42:08.000000000 -0500
+@@ -37,10 +37,10 @@
+ struct list_head nfs4_siblings; /* List of other nfs_server structs
+ * that share the same clientid
+ */
+- u32 attr_bitmask[2];/* V4 bitmask representing the set
++ __u32 attr_bitmask[2];/* V4 bitmask representing the set
+ of attributes supported on this
+ filesystem */
+- u32 acl_bitmask; /* V4 bitmask representing the ACEs
++ __u32 acl_bitmask; /* V4 bitmask representing the ACEs
+ that are supported on this
+ filesystem */
+ #endif
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfs_xdr.h linux-libc-headers-2.6.8.0/include/linux/nfs_xdr.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/nfs_xdr.h 2004-06-09 07:00:50.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/nfs_xdr.h 2004-08-26 05:42:08.000000000 -0500
+@@ -90,9 +90,9 @@
+ };
+
+ struct nfs4_change_info {
+- u32 atomic;
+- u64 before;
+- u64 after;
++ __u32 atomic;
++ __u64 before;
++ __u64 after;
+ };
+
+ /*
+@@ -112,7 +112,7 @@
+ } u;
+ const struct qstr * name;
+ const struct nfs_server *server; /* Needed for ID mapping */
+- const u32 * bitmask;
++ const __u32 * bitmask;
+ };
+
+ struct nfs_openres {
+@@ -168,7 +168,7 @@
+ * */
+ struct nfs_lowner {
+ __u64 clientid;
+- u32 id;
++ __u32 id;
+ };
+
+ struct nfs_open_to_lock {
+@@ -328,7 +328,7 @@
+ nfs4_stateid stateid;
+ struct iattr * iap;
+ const struct nfs_server * server; /* Needed for name mapping */
+- const u32 * bitmask;
++ const __u32 * bitmask;
+ };
+
+ struct nfs_setattrres {
+@@ -482,32 +482,32 @@
+
+ #ifdef CONFIG_NFS_V4
+
+-typedef u64 clientid4;
++typedef __u64 clientid4;
+
+ struct nfs4_accessargs {
+ const struct nfs_fh * fh;
+- u32 access;
++ __u32 access;
+ };
+
+ struct nfs4_accessres {
+- u32 supported;
+- u32 access;
++ __u32 supported;
++ __u32 access;
+ };
+
+ struct nfs4_create_arg {
+- u32 ftype;
++ __u32 ftype;
+ union {
+ struct qstr * symlink; /* NF4LNK */
+ struct {
+- u32 specdata1;
+- u32 specdata2;
++ __u32 specdata1;
++ __u32 specdata2;
+ } device; /* NF4BLK, NF4CHR */
+ } u;
+ const struct qstr * name;
+ const struct nfs_server * server;
+ const struct iattr * attrs;
+ const struct nfs_fh * dir_fh;
+- const u32 * bitmask;
++ const __u32 * bitmask;
+ };
+
+ struct nfs4_create_res {
+@@ -519,12 +519,12 @@
+
+ struct nfs4_fsinfo_arg {
+ const struct nfs_fh * fh;
+- const u32 * bitmask;
++ const __u32 * bitmask;
+ };
+
+ struct nfs4_getattr_arg {
+ const struct nfs_fh * fh;
+- const u32 * bitmask;
++ const __u32 * bitmask;
+ };
+
+ struct nfs4_getattr_res {
+@@ -541,7 +541,7 @@
+ struct nfs4_lookup_arg {
+ const struct nfs_fh * dir_fh;
+ const struct qstr * name;
+- const u32 * bitmask;
++ const __u32 * bitmask;
+ };
+
+ struct nfs4_lookup_res {
+@@ -551,19 +551,19 @@
+ };
+
+ struct nfs4_lookup_root_arg {
+- const u32 * bitmask;
++ const __u32 * bitmask;
+ };
+
+ struct nfs4_pathconf_arg {
+ const struct nfs_fh * fh;
+- const u32 * bitmask;
++ const __u32 * bitmask;
+ };
+
+ struct nfs4_readdir_arg {
+ const struct nfs_fh * fh;
+- u64 cookie;
++ __u64 cookie;
+ nfs4_verifier verifier;
+- u32 count;
++ __u32 count;
+ struct page ** pages; /* zero-copy data */
+ unsigned int pgbase; /* zero-copy data */
+ };
+@@ -575,7 +575,7 @@
+
+ struct nfs4_readlink {
+ const struct nfs_fh * fh;
+- u32 count; /* zero-copy data */
++ __u32 count; /* zero-copy data */
+ struct page ** pages; /* zero-copy data */
+ };
+
+@@ -599,23 +599,23 @@
+ struct nfs4_setclientid {
+ nfs4_verifier sc_verifier; /* request */
+ char * sc_name; /* request */
+- u32 sc_prog; /* request */
++ __u32 sc_prog; /* request */
+ char sc_netid[4]; /* request */
+ char sc_uaddr[24]; /* request */
+- u32 sc_cb_ident; /* request */
++ __u32 sc_cb_ident; /* request */
+ struct nfs4_client * sc_state; /* response */
+ };
+
+ struct nfs4_statfs_arg {
+ const struct nfs_fh * fh;
+- const u32 * bitmask;
++ const __u32 * bitmask;
+ };
+
+ struct nfs4_server_caps_res {
+- u32 attr_bitmask[2];
+- u32 acl_bitmask;
+- u32 has_links;
+- u32 has_symlinks;
++ __u32 attr_bitmask[2];
++ __u32 acl_bitmask;
++ __u32 has_links;
++ __u32 has_symlinks;
+ };
+
+ #endif /* CONFIG_NFS_V4 */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/state.h linux-libc-headers-2.6.8.0/include/linux/nfsd/state.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/state.h 2004-08-18 13:16:07.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/nfsd/state.h 2004-08-26 05:42:08.000000000 -0500
+@@ -41,18 +41,18 @@
+
+ #define NFS4_OPAQUE_LIMIT 1024
+ typedef struct {
+- u32 cl_boot;
+- u32 cl_id;
++ __u32 cl_boot;
++ __u32 cl_id;
+ } clientid_t;
+
+ typedef struct {
+- u32 so_boot;
+- u32 so_stateownerid;
+- u32 so_fileid;
++ __u32 so_boot;
++ __u32 so_stateownerid;
++ __u32 so_fileid;
+ } stateid_opaque_t;
+
+ typedef struct {
+- u32 si_generation;
++ __u32 si_generation;
+ stateid_opaque_t si_opaque;
+ } stateid_t;
+ #define si_boot si_opaque.so_boot
+@@ -68,14 +68,14 @@
+ /* client delegation callback info */
+ struct nfs4_callback {
+ /* SETCLIENTID info */
+- u32 cb_parsed; /* addr parsed */
+- u32 cb_addr;
++ __u32 cb_parsed; /* addr parsed */
++ __u32 cb_addr;
+ unsigned short cb_port;
+- u32 cb_prog;
+- u32 cb_ident;
++ __u32 cb_prog;
++ __u32 cb_ident;
+ struct xdr_netobj cb_netid;
+ /* RPC client info */
+- u32 cb_set; /* successful CB_NULL call */
++ __u32 cb_set; /* successful CB_NULL call */
+ struct rpc_program cb_program;
+ struct rpc_stat cb_stat;
+ struct rpc_clnt * cb_client;
+@@ -99,7 +99,7 @@
+ struct xdr_netobj cl_name; /* id generated by client */
+ nfs4_verifier cl_verifier; /* generated by client */
+ time_t cl_time; /* time of last lease renewal */
+- u32 cl_addr; /* client ipaddress */
++ __u32 cl_addr; /* client ipaddress */
+ struct svc_cred cl_cred; /* setclientid principal */
+ clientid_t cl_clientid; /* generated by server */
+ nfs4_verifier cl_confirm; /* generated by server */
+@@ -116,7 +116,7 @@
+ struct list_head cr_strhash; /* hash by cr_name */
+ struct xdr_netobj cr_name; /* id generated by client */
+ time_t cr_first_state; /* first state aquisition */
+- u32 cr_expired; /* boolean: lease expired? */
++ __u32 cr_expired; /* boolean: lease expired? */
+ };
+
+ static inline void
+@@ -139,7 +139,7 @@
+ * is cached.
+ */
+ struct nfs4_replay {
+- u32 rp_status;
++ __u32 rp_status;
+ unsigned int rp_buflen;
+ char *rp_buf;
+ unsigned intrp_allocated;
+@@ -175,9 +175,9 @@
+ struct list_head so_close_lru; /* tail queue */
+ time_t so_time; /* time of placement on so_close_lru */
+ int so_is_open_owner; /* 1=openowner,0=lockowner */
+- u32 so_id;
++ __u32 so_id;
+ struct nfs4_client * so_client;
+- u32 so_seqid;
++ __u32 so_seqid;
+ struct xdr_netobj so_owner; /* open owner name */
+ int so_confirmed; /* successful OPEN_CONFIRM? */
+ struct nfs4_replay so_replay;
+@@ -192,7 +192,7 @@
+ struct list_head fi_hash; /* hash by "struct inode *" */
+ struct list_head fi_perfile; /* list: nfs4_stateid */
+ struct inode *fi_inode;
+- u32 fi_id; /* used with stateowner->so_id
++ __u32 fi_id; /* used with stateowner->so_id
+ * for stateid_hashtbl hash */
+ };
+
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr.h linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr.h 2004-08-18 13:16:07.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr.h 2004-08-26 05:42:08.000000000 -0500
+@@ -83,7 +83,7 @@
+ struct svc_fh fh;
+ __u32 cookie;
+ __u32 count;
+- u32 * buffer;
++ __u32 * buffer;
+ };
+
+ struct nfsd_attrstat {
+@@ -107,9 +107,9 @@
+ int count;
+
+ struct readdir_cd common;
+- u32 * buffer;
++ __u32 * buffer;
+ int buflen;
+- u32 * offset;
++ __u32 * offset;
+ };
+
+ struct nfsd_statfsres {
+@@ -134,39 +134,39 @@
+ #define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore)
+
+
+-int nfssvc_decode_void(struct svc_rqst *, u32 *, void *);
+-int nfssvc_decode_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *);
+-int nfssvc_decode_sattrargs(struct svc_rqst *, u32 *,
++int nfssvc_decode_void(struct svc_rqst *, __u32 *, void *);
++int nfssvc_decode_fhandle(struct svc_rqst *, __u32 *, struct nfsd_fhandle *);
++int nfssvc_decode_sattrargs(struct svc_rqst *, __u32 *,
+ struct nfsd_sattrargs *);
+-int nfssvc_decode_diropargs(struct svc_rqst *, u32 *,
++int nfssvc_decode_diropargs(struct svc_rqst *, __u32 *,
+ struct nfsd_diropargs *);
+-int nfssvc_decode_readargs(struct svc_rqst *, u32 *,
++int nfssvc_decode_readargs(struct svc_rqst *, __u32 *,
+ struct nfsd_readargs *);
+-int nfssvc_decode_writeargs(struct svc_rqst *, u32 *,
++int nfssvc_decode_writeargs(struct svc_rqst *, __u32 *,
+ struct nfsd_writeargs *);
+-int nfssvc_decode_createargs(struct svc_rqst *, u32 *,
++int nfssvc_decode_createargs(struct svc_rqst *, __u32 *,
+ struct nfsd_createargs *);
+-int nfssvc_decode_renameargs(struct svc_rqst *, u32 *,
++int nfssvc_decode_renameargs(struct svc_rqst *, __u32 *,
+ struct nfsd_renameargs *);
+-int nfssvc_decode_readlinkargs(struct svc_rqst *, u32 *,
++int nfssvc_decode_readlinkargs(struct svc_rqst *, __u32 *,
+ struct nfsd_readlinkargs *);
+-int nfssvc_decode_linkargs(struct svc_rqst *, u32 *,
++int nfssvc_decode_linkargs(struct svc_rqst *, __u32 *,
+ struct nfsd_linkargs *);
+-int nfssvc_decode_symlinkargs(struct svc_rqst *, u32 *,
++int nfssvc_decode_symlinkargs(struct svc_rqst *, __u32 *,
+ struct nfsd_symlinkargs *);
+-int nfssvc_decode_readdirargs(struct svc_rqst *, u32 *,
++int nfssvc_decode_readdirargs(struct svc_rqst *, __u32 *,
+ struct nfsd_readdirargs *);
+-int nfssvc_encode_void(struct svc_rqst *, u32 *, void *);
+-int nfssvc_encode_attrstat(struct svc_rqst *, u32 *, struct nfsd_attrstat *);
+-int nfssvc_encode_diropres(struct svc_rqst *, u32 *, struct nfsd_diropres *);
+-int nfssvc_encode_readlinkres(struct svc_rqst *, u32 *, struct nfsd_readlinkres *);
+-int nfssvc_encode_readres(struct svc_rqst *, u32 *, struct nfsd_readres *);
+-int nfssvc_encode_statfsres(struct svc_rqst *, u32 *, struct nfsd_statfsres *);
+-int nfssvc_encode_readdirres(struct svc_rqst *, u32 *, struct nfsd_readdirres *);
++int nfssvc_encode_void(struct svc_rqst *, __u32 *, void *);
++int nfssvc_encode_attrstat(struct svc_rqst *, __u32 *, struct nfsd_attrstat *);
++int nfssvc_encode_diropres(struct svc_rqst *, __u32 *, struct nfsd_diropres *);
++int nfssvc_encode_readlinkres(struct svc_rqst *, __u32 *, struct nfsd_readlinkres *);
++int nfssvc_encode_readres(struct svc_rqst *, __u32 *, struct nfsd_readres *);
++int nfssvc_encode_statfsres(struct svc_rqst *, __u32 *, struct nfsd_statfsres *);
++int nfssvc_encode_readdirres(struct svc_rqst *, __u32 *, struct nfsd_readdirres *);
+
+ int nfssvc_encode_entry(struct readdir_cd *, const char *name,
+ int namlen, loff_t offset, ino_t ino, unsigned int);
+
+-int nfssvc_release_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *);
++int nfssvc_release_fhandle(struct svc_rqst *, __u32 *, struct nfsd_fhandle *);
+
+ #endif /* LINUX_NFSD_H */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr3.h linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr3.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr3.h 2004-08-18 13:16:07.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr3.h 2004-08-26 05:42:08.000000000 -0500
+@@ -101,7 +101,7 @@
+ __u32 dircount;
+ __u32 count;
+ __u32 * verf;
+- u32 * buffer;
++ __u32 * buffer;
+ };
+
+ struct nfsd3_commitargs {
+@@ -167,10 +167,10 @@
+ __u32 verf[2];
+
+ struct readdir_cd common;
+- u32 * buffer;
++ __u32 * buffer;
+ int buflen;
+- u32 * offset;
+- u32 * offset1;
++ __u32 * offset;
++ __u32 * offset1;
+ struct svc_rqst * rqstp;
+
+ };
+@@ -245,70 +245,70 @@
+
+ #define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore)
+
+-int nfs3svc_decode_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *);
+-int nfs3svc_decode_sattrargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_fhandle(struct svc_rqst *, __u32 *, struct nfsd_fhandle *);
++int nfs3svc_decode_sattrargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_sattrargs *);
+-int nfs3svc_decode_diropargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_diropargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_diropargs *);
+-int nfs3svc_decode_accessargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_accessargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_accessargs *);
+-int nfs3svc_decode_readargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_readargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_readargs *);
+-int nfs3svc_decode_writeargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_writeargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_writeargs *);
+-int nfs3svc_decode_createargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_createargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_createargs *);
+-int nfs3svc_decode_mkdirargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_mkdirargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_createargs *);
+-int nfs3svc_decode_mknodargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_mknodargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_mknodargs *);
+-int nfs3svc_decode_renameargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_renameargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_renameargs *);
+-int nfs3svc_decode_readlinkargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_readlinkargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_readlinkargs *);
+-int nfs3svc_decode_linkargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_linkargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_linkargs *);
+-int nfs3svc_decode_symlinkargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_symlinkargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_symlinkargs *);
+-int nfs3svc_decode_readdirargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_readdirargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_readdirargs *);
+-int nfs3svc_decode_readdirplusargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_readdirargs *);
+-int nfs3svc_decode_commitargs(struct svc_rqst *, u32 *,
++int nfs3svc_decode_commitargs(struct svc_rqst *, __u32 *,
+ struct nfsd3_commitargs *);
+-int nfs3svc_encode_voidres(struct svc_rqst *, u32 *, void *);
+-int nfs3svc_encode_attrstat(struct svc_rqst *, u32 *,
++int nfs3svc_encode_voidres(struct svc_rqst *, __u32 *, void *);
++int nfs3svc_encode_attrstat(struct svc_rqst *, __u32 *,
+ struct nfsd3_attrstat *);
+-int nfs3svc_encode_wccstat(struct svc_rqst *, u32 *,
++int nfs3svc_encode_wccstat(struct svc_rqst *, __u32 *,
+ struct nfsd3_attrstat *);
+-int nfs3svc_encode_diropres(struct svc_rqst *, u32 *,
++int nfs3svc_encode_diropres(struct svc_rqst *, __u32 *,
+ struct nfsd3_diropres *);
+-int nfs3svc_encode_accessres(struct svc_rqst *, u32 *,
++int nfs3svc_encode_accessres(struct svc_rqst *, __u32 *,
+ struct nfsd3_accessres *);
+-int nfs3svc_encode_readlinkres(struct svc_rqst *, u32 *,
++int nfs3svc_encode_readlinkres(struct svc_rqst *, __u32 *,
+ struct nfsd3_readlinkres *);
+-int nfs3svc_encode_readres(struct svc_rqst *, u32 *, struct nfsd3_readres *);
+-int nfs3svc_encode_writeres(struct svc_rqst *, u32 *, struct nfsd3_writeres *);
+-int nfs3svc_encode_createres(struct svc_rqst *, u32 *,
++int nfs3svc_encode_readres(struct svc_rqst *, __u32 *, struct nfsd3_readres *);
++int nfs3svc_encode_writeres(struct svc_rqst *, __u32 *, struct nfsd3_writeres *);
++int nfs3svc_encode_createres(struct svc_rqst *, __u32 *,
+ struct nfsd3_diropres *);
+-int nfs3svc_encode_renameres(struct svc_rqst *, u32 *,
++int nfs3svc_encode_renameres(struct svc_rqst *, __u32 *,
+ struct nfsd3_renameres *);
+-int nfs3svc_encode_linkres(struct svc_rqst *, u32 *,
++int nfs3svc_encode_linkres(struct svc_rqst *, __u32 *,
+ struct nfsd3_linkres *);
+-int nfs3svc_encode_readdirres(struct svc_rqst *, u32 *,
++int nfs3svc_encode_readdirres(struct svc_rqst *, __u32 *,
+ struct nfsd3_readdirres *);
+-int nfs3svc_encode_fsstatres(struct svc_rqst *, u32 *,
++int nfs3svc_encode_fsstatres(struct svc_rqst *, __u32 *,
+ struct nfsd3_fsstatres *);
+-int nfs3svc_encode_fsinfores(struct svc_rqst *, u32 *,
++int nfs3svc_encode_fsinfores(struct svc_rqst *, __u32 *,
+ struct nfsd3_fsinfores *);
+-int nfs3svc_encode_pathconfres(struct svc_rqst *, u32 *,
++int nfs3svc_encode_pathconfres(struct svc_rqst *, __u32 *,
+ struct nfsd3_pathconfres *);
+-int nfs3svc_encode_commitres(struct svc_rqst *, u32 *,
++int nfs3svc_encode_commitres(struct svc_rqst *, __u32 *,
+ struct nfsd3_commitres *);
+
+-int nfs3svc_release_fhandle(struct svc_rqst *, u32 *,
++int nfs3svc_release_fhandle(struct svc_rqst *, __u32 *,
+ struct nfsd3_attrstat *);
+-int nfs3svc_release_fhandle2(struct svc_rqst *, u32 *,
++int nfs3svc_release_fhandle2(struct svc_rqst *, __u32 *,
+ struct nfsd3_fhandle_pair *);
+ int nfs3svc_encode_entry(struct readdir_cd *, const char *name,
+ int namlen, loff_t offset, ino_t ino,
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr4.h linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr4.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr4.h 2004-08-18 13:16:07.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr4.h 2004-08-26 05:42:08.000000000 -0500
+@@ -42,9 +42,9 @@
+ #define NFSD4_MAX_TAGLEN 128
+ #define XDR_LEN(n) (((n) + 3) & ~3)
+
+-typedef u32 delegation_zero_t;
+-typedef u32 delegation_boot_t;
+-typedef u64 delegation_id_t;
++typedef __u32 delegation_zero_t;
++typedef __u32 delegation_boot_t;
++typedef __u64 delegation_id_t;
+
+ typedef struct {
+ delegation_zero_t ds_zero;
+@@ -53,46 +53,46 @@
+ } delegation_stateid_t;
+
+ struct nfsd4_change_info {
+- u32 atomic;
+- u32 before_ctime_sec;
+- u32 before_ctime_nsec;
+- u32 after_ctime_sec;
+- u32 after_ctime_nsec;
++ __u32 atomic;
++ __u32 before_ctime_sec;
++ __u32 before_ctime_nsec;
++ __u32 after_ctime_sec;
++ __u32 after_ctime_nsec;
+ };
+
+ struct nfsd4_access {
+- u32 ac_req_access; /* request */
+- u32 ac_supported; /* response */
+- u32 ac_resp_access; /* response */
++ __u32 ac_req_access; /* request */
++ __u32 ac_supported; /* response */
++ __u32 ac_resp_access; /* response */
+ };
+
+ struct nfsd4_close {
+- u32 cl_seqid; /* request */
++ __u32 cl_seqid; /* request */
+ stateid_t cl_stateid; /* request+response */
+ struct nfs4_stateowner * cl_stateowner; /* response */
+ };
+
+ struct nfsd4_commit {
+- u64 co_offset; /* request */
+- u32 co_count; /* request */
++ __u64 co_offset; /* request */
++ __u32 co_count; /* request */
+ nfs4_verifier co_verf; /* response */
+ };
+
+ struct nfsd4_create {
+- u32 cr_namelen; /* request */
++ __u32 cr_namelen; /* request */
+ char * cr_name; /* request */
+- u32 cr_type; /* request */
++ __u32 cr_type; /* request */
+ union { /* request */
+ struct {
+- u32 namelen;
++ __u32 namelen;
+ char *name;
+ } link; /* NF4LNK */
+ struct {
+- u32 specdata1;
+- u32 specdata2;
++ __u32 specdata1;
++ __u32 specdata2;
+ } dev; /* NF4BLK, NF4CHR */
+ } u;
+- u32 cr_bmval[2]; /* request */
++ __u32 cr_bmval[2]; /* request */
+ struct iattr cr_iattr; /* request */
+ struct nfsd4_change_info cr_cinfo; /* response */
+ };
+@@ -102,41 +102,41 @@
+ #define cr_specdata2 u.dev.specdata2
+
+ struct nfsd4_getattr {
+- u32 ga_bmval[2]; /* request */
++ __u32 ga_bmval[2]; /* request */
+ struct svc_fh *ga_fhp; /* response */
+ };
+
+ struct nfsd4_link {
+- u32 li_namelen; /* request */
++ __u32 li_namelen; /* request */
+ char * li_name; /* request */
+ struct nfsd4_change_info li_cinfo; /* response */
+ };
+
+ struct nfsd4_lock_denied {
+ struct nfs4_stateowner *ld_sop;
+- u64 ld_start;
+- u64 ld_length;
+- u32 ld_type;
++ __u64 ld_start;
++ __u64 ld_length;
++ __u32 ld_type;
+ };
+
+ struct nfsd4_lock {
+ /* request */
+- u32 lk_type;
+- u32 lk_reclaim; /* boolean */
+- u64 lk_offset;
+- u64 lk_length;
+- u32 lk_is_new;
++ __u32 lk_type;
++ __u32 lk_reclaim; /* boolean */
++ __u64 lk_offset;
++ __u64 lk_length;
++ __u32 lk_is_new;
+ union {
+ struct {
+- u32 open_seqid;
++ __u32 open_seqid;
+ stateid_t open_stateid;
+- u32 lock_seqid;
++ __u32 lock_seqid;
+ clientid_t clientid;
+ struct xdr_netobj owner;
+ } new;
+ struct {
+ stateid_t lock_stateid;
+- u32 lock_seqid;
++ __u32 lock_seqid;
+ } old;
+ } v;
+
+@@ -164,56 +164,56 @@
+
+
+ struct nfsd4_lockt {
+- u32 lt_type;
++ __u32 lt_type;
+ clientid_t lt_clientid;
+ struct xdr_netobj lt_owner;
+- u64 lt_offset;
+- u64 lt_length;
++ __u64 lt_offset;
++ __u64 lt_length;
+ struct nfs4_stateowner * lt_stateowner;
+ struct nfsd4_lock_denied lt_denied;
+ };
+
+
+ struct nfsd4_locku {
+- u32 lu_type;
+- u32 lu_seqid;
++ __u32 lu_type;
++ __u32 lu_seqid;
+ stateid_t lu_stateid;
+- u64 lu_offset;
+- u64 lu_length;
++ __u64 lu_offset;
++ __u64 lu_length;
+ struct nfs4_stateowner *lu_stateowner;
+ };
+
+
+ struct nfsd4_lookup {
+- u32 lo_len; /* request */
++ __u32 lo_len; /* request */
+ char * lo_name; /* request */
+ };
+
+ struct nfsd4_putfh {
+- u32 pf_fhlen; /* request */
++ __u32 pf_fhlen; /* request */
+ char *pf_fhval; /* request */
+ };
+
+ struct nfsd4_open {
+- u32 op_claim_type; /* request */
++ __u32 op_claim_type; /* request */
+ struct xdr_netobj op_fname; /* request - everything but CLAIM_PREV */
+- u32 op_delegate_type; /* request - CLAIM_PREV only */
++ __u32 op_delegate_type; /* request - CLAIM_PREV only */
+ delegation_stateid_t op_delegate_stateid; /* request - CLAIM_DELEGATE_CUR only */
+- u32 op_create; /* request */
+- u32 op_createmode; /* request */
+- u32 op_bmval[2]; /* request */
++ __u32 op_create; /* request */
++ __u32 op_createmode; /* request */
++ __u32 op_bmval[2]; /* request */
+ union { /* request */
+ struct iattr iattr; /* UNCHECKED4,GUARDED4 */
+ nfs4_verifier verf; /* EXCLUSIVE4 */
+ } u;
+ clientid_t op_clientid; /* request */
+ struct xdr_netobj op_owner; /* request */
+- u32 op_seqid; /* request */
+- u32 op_share_access; /* request */
+- u32 op_share_deny; /* request */
++ __u32 op_seqid; /* request */
++ __u32 op_share_access; /* request */
++ __u32 op_share_deny; /* request */
+ stateid_t op_stateid; /* response */
+ struct nfsd4_change_info op_cinfo; /* response */
+- u32 op_rflags; /* response */
++ __u32 op_rflags; /* response */
+ int op_truncate; /* used during processing */
+ struct nfs4_stateowner *op_stateowner; /* used during processing */
+
+@@ -223,24 +223,24 @@
+
+ struct nfsd4_open_confirm {
+ stateid_t oc_req_stateid /* request */;
+- u32 oc_seqid /* request */;
++ __u32 oc_seqid /* request */;
+ stateid_t oc_resp_stateid /* response */;
+ struct nfs4_stateowner * oc_stateowner; /* response */
+ };
+
+ struct nfsd4_open_downgrade {
+ stateid_t od_stateid;
+- u32 od_seqid;
+- u32 od_share_access;
+- u32 od_share_deny;
++ __u32 od_seqid;
++ __u32 od_share_access;
++ __u32 od_share_deny;
+ struct nfs4_stateowner *od_stateowner;
+ };
+
+
+ struct nfsd4_read {
+ stateid_t rd_stateid; /* request */
+- u64 rd_offset; /* request */
+- u32 rd_length; /* request */
++ __u64 rd_offset; /* request */
++ __u32 rd_length; /* request */
+ struct kvec rd_iov[RPCSVC_MAXPAGES];
+ int rd_vlen;
+
+@@ -249,18 +249,18 @@
+ };
+
+ struct nfsd4_readdir {
+- u64 rd_cookie; /* request */
++ __u64 rd_cookie; /* request */
+ nfs4_verifier rd_verf; /* request */
+- u32 rd_dircount; /* request */
+- u32 rd_maxcount; /* request */
+- u32 rd_bmval[2]; /* request */
++ __u32 rd_dircount; /* request */
++ __u32 rd_maxcount; /* request */
++ __u32 rd_bmval[2]; /* request */
+ struct svc_rqst *rd_rqstp; /* response */
+ struct svc_fh * rd_fhp; /* response */
+
+ struct readdir_cd common;
+- u32 * buffer;
++ __u32 * buffer;
+ int buflen;
+- u32 * offset;
++ __u32 * offset;
+ };
+
+ struct nfsd4_release_lockowner {
+@@ -273,15 +273,15 @@
+ };
+
+ struct nfsd4_remove {
+- u32 rm_namelen; /* request */
++ __u32 rm_namelen; /* request */
+ char * rm_name; /* request */
+ struct nfsd4_change_info rm_cinfo; /* response */
+ };
+
+ struct nfsd4_rename {
+- u32 rn_snamelen; /* request */
++ __u32 rn_snamelen; /* request */
+ char * rn_sname; /* request */
+- u32 rn_tnamelen; /* request */
++ __u32 rn_tnamelen; /* request */
+ char * rn_tname; /* request */
+ struct nfsd4_change_info rn_sinfo; /* response */
+ struct nfsd4_change_info rn_tinfo; /* response */
+@@ -289,20 +289,20 @@
+
+ struct nfsd4_setattr {
+ stateid_t sa_stateid; /* request */
+- u32 sa_bmval[2]; /* request */
++ __u32 sa_bmval[2]; /* request */
+ struct iattr sa_iattr; /* request */
+ };
+
+ struct nfsd4_setclientid {
+ nfs4_verifier se_verf; /* request */
+- u32 se_namelen; /* request */
++ __u32 se_namelen; /* request */
+ char * se_name; /* request */
+- u32 se_callback_prog; /* request */
+- u32 se_callback_netid_len; /* request */
++ __u32 se_callback_prog; /* request */
++ __u32 se_callback_netid_len; /* request */
+ char * se_callback_netid_val; /* request */
+- u32 se_callback_addr_len; /* request */
++ __u32 se_callback_addr_len; /* request */
+ char * se_callback_addr_val; /* request */
+- u32 se_callback_ident; /* request */
++ __u32 se_callback_ident; /* request */
+ clientid_t se_clientid; /* response */
+ nfs4_verifier se_confirm; /* response */
+ };
+@@ -314,21 +314,21 @@
+
+ /* also used for NVERIFY */
+ struct nfsd4_verify {
+- u32 ve_bmval[2]; /* request */
+- u32 ve_attrlen; /* request */
++ __u32 ve_bmval[2]; /* request */
++ __u32 ve_attrlen; /* request */
+ char * ve_attrval; /* request */
+ };
+
+ struct nfsd4_write {
+ stateid_t wr_stateid; /* request */
+- u64 wr_offset; /* request */
+- u32 wr_stable_how; /* request */
+- u32 wr_buflen; /* request */
++ __u64 wr_offset; /* request */
++ __u32 wr_stable_how; /* request */
++ __u32 wr_buflen; /* request */
+ struct kvec wr_vec[RPCSVC_MAXPAGES]; /* request */
+ int wr_vlen;
+
+- u32 wr_bytes_written; /* response */
+- u32 wr_how_written; /* response */
++ __u32 wr_bytes_written; /* response */
++ __u32 wr_how_written; /* response */
+ nfs4_verifier wr_verifier; /* response */
+ };
+
+@@ -370,12 +370,12 @@
+
+ struct nfsd4_compoundargs {
+ /* scratch variables for XDR decode */
+- u32 * p;
+- u32 * end;
++ __u32 * p;
++ __u32 * end;
+ struct page ** pagelist;
+ int pagelen;
+- u32 tmp[8];
+- u32 * tmpp;
++ __u32 tmp[8];
++ __u32 * tmpp;
+ struct tmpbuf {
+ struct tmpbuf *next;
+ void (*release)(const void *);
+@@ -384,25 +384,25 @@
+
+ struct svc_rqst *rqstp;
+
+- u32 taglen;
++ __u32 taglen;
+ char * tag;
+- u32 minorversion;
+- u32 opcnt;
++ __u32 minorversion;
++ __u32 opcnt;
+ struct nfsd4_op *ops;
+ struct nfsd4_op iops[8];
+ };
+
+ struct nfsd4_compoundres {
+ /* scratch variables for XDR encode */
+- u32 * p;
+- u32 * end;
++ __u32 * p;
++ __u32 * end;
+ struct xdr_buf * xbuf;
+ struct svc_rqst * rqstp;
+
+- u32 taglen;
++ __u32 taglen;
+ char * tag;
+- u32 opcnt;
+- u32 * tagp; /* where to encode tag and opcount */
++ __u32 opcnt;
++ __u32 * tagp; /* where to encode tag and opcount */
+ };
+
+ #define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs)
+@@ -418,16 +418,16 @@
+ cinfo->after_ctime_nsec = fhp->fh_post_ctime.tv_nsec;
+ }
+
+-int nfs4svc_encode_voidres(struct svc_rqst *, u32 *, void *);
+-int nfs4svc_decode_compoundargs(struct svc_rqst *, u32 *,
++int nfs4svc_encode_voidres(struct svc_rqst *, __u32 *, void *);
++int nfs4svc_decode_compoundargs(struct svc_rqst *, __u32 *,
+ struct nfsd4_compoundargs *);
+-int nfs4svc_encode_compoundres(struct svc_rqst *, u32 *,
++int nfs4svc_encode_compoundres(struct svc_rqst *, __u32 *,
+ struct nfsd4_compoundres *);
+ void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
+ void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op);
+ int nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
+- struct dentry *dentry, u32 *buffer, int *countp,
+- u32 *bmval, struct svc_rqst *);
++ struct dentry *dentry, __u32 *buffer, int *countp,
++ __u32 *bmval, struct svc_rqst *);
+ extern int nfsd4_setclientid(struct svc_rqst *rqstp,
+ struct nfsd4_setclientid *setclid);
+ extern int nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/pmu.h linux-libc-headers-2.6.8.0/include/linux/pmu.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/pmu.h 2004-01-17 17:04:31.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/pmu.h 2004-08-26 05:42:08.000000000 -0500
+@@ -120,15 +120,15 @@
+
+ /* no param */
+ #define PMU_IOC_SLEEP _IO('B', 0)
+-/* out param: u32* backlight value: 0 to 15 */
++/* out param: __u32* backlight value: 0 to 15 */
+ #define PMU_IOC_GET_BACKLIGHT _IOR('B', 1, size_t)
+-/* in param: u32 backlight value: 0 to 15 */
++/* in param: __u32 backlight value: 0 to 15 */
+ #define PMU_IOC_SET_BACKLIGHT _IOW('B', 2, size_t)
+-/* out param: u32* PMU model */
++/* out param: __u32* PMU model */
+ #define PMU_IOC_GET_MODEL _IOR('B', 3, size_t)
+-/* out param: u32* has_adb: 0 or 1 */
++/* out param: __u32* has_adb: 0 or 1 */
+ #define PMU_IOC_HAS_ADB _IOR('B', 4, size_t)
+-/* out param: u32* can_sleep: 0 or 1 */
++/* out param: __u32* can_sleep: 0 or 1 */
+ #define PMU_IOC_CAN_SLEEP _IOR('B', 5, size_t)
+ /* no param, but historically was _IOR('B', 6, 0), meaning 4 bytes */
+ #define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, size_t)
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/reiserfs_fs.h linux-libc-headers-2.6.8.0/include/linux/reiserfs_fs.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/reiserfs_fs.h 2004-08-18 13:16:04.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/reiserfs_fs.h 2004-08-26 13:26:06.000000000 -0500
+@@ -1821,7 +1821,7 @@
+ * to use for a new object underneat it. The locality is returned
+ * in disk byte order (le).
+ */
+-u32 reiserfs_choose_packing(struct inode *dir);
++__u32 reiserfs_choose_packing(struct inode *dir);
+
+ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value);
+ void reiserfs_free_block (struct reiserfs_transaction_handle *th, struct inode *, b_blocknr_t, int for_unformatted);
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/scx200_gpio.h linux-libc-headers-2.6.8.0/include/linux/scx200_gpio.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/scx200_gpio.h 2004-01-17 17:04:32.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/scx200_gpio.h 2004-08-26 13:26:01.000000000 -0500
+@@ -1,5 +1,5 @@
+
+-u32 scx200_gpio_configure(int index, u32 set, u32 clear);
++__u32 scx200_gpio_configure(int index, __u32 set, __u32 clear);
+ void scx200_gpio_dump(unsigned index);
+
+ extern unsigned scx200_gpio_base;
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sdladrv.h linux-libc-headers-2.6.8.0/include/linux/sdladrv.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/sdladrv.h 2003-12-15 12:46:58.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/sdladrv.h 2004-08-26 05:42:08.000000000 -0500
+@@ -55,8 +55,8 @@
+ extern int sdla_inten (sdlahw_t* hw);
+ extern int sdla_intde (sdlahw_t* hw);
+ extern int sdla_intack (sdlahw_t* hw);
+-extern void S514_intack (sdlahw_t* hw, u32 int_status);
+-extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status);
++extern void S514_intack (sdlahw_t* hw, __u32 int_status);
++extern void read_S514_int_stat (sdlahw_t* hw, __u32* int_status);
+ extern int sdla_intr (sdlahw_t* hw);
+ extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr);
+ extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf,
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/selection.h linux-libc-headers-2.6.8.0/include/linux/selection.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/selection.h 2004-06-23 16:52:56.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/selection.h 2004-08-26 05:42:08.000000000 -0500
+@@ -32,14 +32,14 @@
+ extern int default_blu[];
+
+ extern unsigned short *screen_pos(int currcons, int w_offset, int viewed);
+-extern u16 screen_glyph(int currcons, int offset);
++extern __u16 screen_glyph(int currcons, int offset);
+ extern void complement_pos(int currcons, int offset);
+ extern void invert_screen(int currcons, int offset, int count, int shift);
+
+ extern void getconsxy(int currcons, unsigned char *p);
+ extern void putconsxy(int currcons, unsigned char *p);
+
+-extern u16 vcs_scr_readw(int currcons, const u16 *org);
+-extern void vcs_scr_writew(int currcons, u16 val, u16 *org);
++extern __u16 vcs_scr_readw(int currcons, const __u16 *org);
++extern void vcs_scr_writew(int currcons, __u16 val, __u16 *org);
+
+ #endif
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/serialP.h linux-libc-headers-2.6.8.0/include/linux/serialP.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/serialP.h 2004-08-18 13:16:04.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/serialP.h 2004-08-26 05:42:08.000000000 -0500
+@@ -39,8 +39,8 @@
+ int xmit_fifo_size;
+ int custom_divisor;
+ int count;
+- u8 *iomem_base;
+- u16 iomem_reg_shift;
++ __u8 *iomem_base;
++ __u16 iomem_reg_shift;
+ unsigned short close_delay;
+ unsigned short closing_wait; /* time to wait before closing */
+ struct async_icount icount;
+@@ -75,8 +75,8 @@
+ int blocked_open; /* # of blocked opens */
+ struct circ_buf xmit;
+ spinlock_t xmit_lock;
+- u8 *iomem_base;
+- u16 iomem_reg_shift;
++ __u8 *iomem_base;
++ __u16 iomem_reg_shift;
+ int io_type;
+ struct work_struct work;
+ struct tasklet_struct tlet;
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/clnt.h linux-libc-headers-2.6.8.0/include/linux/sunrpc/clnt.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/clnt.h 2004-02-29 10:36:05.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/sunrpc/clnt.h 2004-08-26 05:42:08.000000000 -0500
+@@ -36,7 +36,7 @@
+ atomic_t cl_users; /* number of references */
+ struct rpc_xprt * cl_xprt; /* transport */
+ struct rpc_procinfo * cl_procinfo; /* procedure info */
+- u32 cl_maxproc; /* max procedure number */
++ __u32 cl_maxproc; /* max procedure number */
+
+ char * cl_server; /* server machine name */
+ char * cl_protname; /* protocol name */
+@@ -75,7 +75,7 @@
+ #define RPC_MAXVERSION 4
+ struct rpc_program {
+ char * name; /* protocol name */
+- u32 number; /* program number */
++ __u32 number; /* program number */
+ unsigned int nrvers; /* number of versions */
+ struct rpc_version ** version; /* version array */
+ struct rpc_stat * stats; /* statistics */
+@@ -83,7 +83,7 @@
+ };
+
+ struct rpc_version {
+- u32 number; /* version number */
++ __u32 number; /* version number */
+ unsigned int nrprocs; /* number of procs */
+ struct rpc_procinfo * procs; /* procedure array */
+ };
+@@ -92,7 +92,7 @@
+ * Procedure information
+ */
+ struct rpc_procinfo {
+- u32 p_proc; /* RPC procedure number */
++ __u32 p_proc; /* RPC procedure number */
+ kxdrproc_t p_encode; /* XDR encode function */
+ kxdrproc_t p_decode; /* XDR decode function */
+ unsigned int p_bufsiz; /* req. buffer size */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/gss_asn1.h linux-libc-headers-2.6.8.0/include/linux/sunrpc/gss_asn1.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/gss_asn1.h 2004-06-23 16:52:58.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/sunrpc/gss_asn1.h 2004-08-26 13:26:25.000000000 -0500
+@@ -64,14 +64,14 @@
+ (((o1)->len == (o2)->len) && \
+ (memcmp((o1)->data,(o2)->data,(int) (o1)->len) == 0))
+
+-u32 g_verify_token_header(
++__u32 g_verify_token_header(
+ struct xdr_netobj *mech,
+ int *body_size,
+ unsigned char **buf_in,
+ int tok_type,
+ int toksize);
+
+-u32 g_get_mech_oid(struct xdr_netobj *mech, struct xdr_netobj * in_buf);
++__u32 g_get_mech_oid(struct xdr_netobj *mech, struct xdr_netobj * in_buf);
+
+ int g_token_size(
+ struct xdr_netobj *mech,
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/gss_krb5.h linux-libc-headers-2.6.8.0/include/linux/sunrpc/gss_krb5.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/gss_krb5.h 2004-06-23 16:52:58.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/sunrpc/gss_krb5.h 2004-08-26 13:26:21.000000000 -0500
+@@ -46,8 +46,8 @@
+ int sealalg;
+ struct crypto_tfm *enc;
+ struct crypto_tfm *seq;
+- s32 endtime;
+- u32 seq_send;
++ __s32 endtime;
++ __u32 seq_send;
+ struct xdr_netobj mech_used;
+ };
+
+@@ -112,35 +112,35 @@
+ #define ENCTYPE_DES3_CBC_SHA1 0x0010
+ #define ENCTYPE_UNKNOWN 0x01ff
+
+-s32
+-make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body,
++__s32
++make_checksum(__s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body,
+ struct xdr_netobj *cksum);
+
+-u32
++__u32
+ krb5_make_token(struct krb5_ctx *context_handle, int qop_req,
+ struct xdr_buf *input_message_buffer,
+ struct xdr_netobj *output_message_buffer, int toktype);
+
+-u32
++__u32
+ krb5_read_token(struct krb5_ctx *context_handle,
+ struct xdr_netobj *input_token_buffer,
+ struct xdr_buf *message_buffer,
+ int *qop_state, int toktype);
+
+-u32
++__u32
+ krb5_encrypt(struct crypto_tfm * key,
+ void *iv, void *in, void *out, int length);
+
+-u32
++__u32
+ krb5_decrypt(struct crypto_tfm * key,
+ void *iv, void *in, void *out, int length);
+
+-s32
++__s32
+ krb5_make_seq_num(struct crypto_tfm * key,
+ int direction,
+- s32 seqnum, unsigned char *cksum, unsigned char *buf);
++ __s32 seqnum, unsigned char *cksum, unsigned char *buf);
+
+-s32
++__s32
+ krb5_get_seq_num(struct crypto_tfm * key,
+ unsigned char *cksum,
+- unsigned char *buf, int *direction, s32 * seqnum);
++ unsigned char *buf, int *direction, __s32 * seqnum);
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/svc.h linux-libc-headers-2.6.8.0/include/linux/sunrpc/svc.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/svc.h 2004-08-18 13:16:07.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/sunrpc/svc.h 2004-08-26 05:42:08.000000000 -0500
+@@ -75,20 +75,20 @@
+ */
+ #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2)
+
+-static inline u32 svc_getu32(struct kvec *iov)
++static inline __u32 svc_getu32(struct kvec *iov)
+ {
+- u32 val, *vp;
++ __u32 val, *vp;
+ vp = iov->iov_base;
+ val = *vp++;
+ iov->iov_base = (void*)vp;
+- iov->iov_len -= sizeof(u32);
++ iov->iov_len -= sizeof(__u32);
+ return val;
+ }
+-static inline void svc_putu32(struct kvec *iov, u32 val)
++static inline void svc_putu32(struct kvec *iov, __u32 val)
+ {
+- u32 *vp = iov->iov_base + iov->iov_len;
++ __u32 *vp = iov->iov_base + iov->iov_len;
+ *vp = val;
+- iov->iov_len += sizeof(u32);
++ iov->iov_len += sizeof(__u32);
+ }
+
+
+@@ -119,11 +119,11 @@
+ short rq_arghi; /* pages available in argument page list */
+ short rq_resused; /* pages used for result */
+
+- u32 rq_xid; /* transmission id */
+- u32 rq_prog; /* program number */
+- u32 rq_vers; /* program version */
+- u32 rq_proc; /* procedure number */
+- u32 rq_prot; /* IP protocol */
++ __u32 rq_xid; /* transmission id */
++ __u32 rq_prog; /* program number */
++ __u32 rq_vers; /* program version */
++ __u32 rq_proc; /* procedure number */
++ __u32 rq_prot; /* IP protocol */
+ unsigned short
+ rq_secure : 1; /* secure port */
+
+@@ -156,7 +156,7 @@
+ * Check buffer bounds after decoding arguments
+ */
+ static inline int
+-xdr_argsize_check(struct svc_rqst *rqstp, u32 *p)
++xdr_argsize_check(struct svc_rqst *rqstp, __u32 *p)
+ {
+ char *cp = (char *)p;
+ struct kvec *vec = &rqstp->rq_arg.head[0];
+@@ -164,7 +164,7 @@
+ }
+
+ static inline int
+-xdr_ressize_check(struct svc_rqst *rqstp, u32 *p)
++xdr_ressize_check(struct svc_rqst *rqstp, __u32 *p)
+ {
+ struct kvec *vec = &rqstp->rq_res.head[0];
+ char *cp = (char*)p;
+@@ -220,19 +220,19 @@
+ }
+
+ struct svc_deferred_req {
+- u32 prot; /* protocol (UDP or TCP) */
++ __u32 prot; /* protocol (UDP or TCP) */
+ struct sockaddr_in addr;
+ struct svc_sock *svsk; /* where reply must go */
+ struct cache_deferred_req handle;
+ int argslen;
+- u32 args[0];
++ __u32 args[0];
+ };
+
+ /*
+ * RPC program
+ */
+ struct svc_program {
+- u32 pg_prog; /* program number */
++ __u32 pg_prog; /* program number */
+ unsigned int pg_lovers; /* lowest version */
+ unsigned int pg_hivers; /* lowest version */
+ unsigned int pg_nvers; /* number of versions */
+@@ -246,16 +246,16 @@
+ * RPC program version
+ */
+ struct svc_version {
+- u32 vs_vers; /* version number */
+- u32 vs_nproc; /* number of procedures */
++ __u32 vs_vers; /* version number */
++ __u32 vs_nproc; /* number of procedures */
+ struct svc_procedure * vs_proc; /* per-procedure info */
+- u32 vs_xdrsize; /* xdrsize needed for this version */
++ __u32 vs_xdrsize; /* xdrsize needed for this version */
+
+ /* Override dispatch function (e.g. when caching replies).
+ * A return value of 0 means drop the request.
+ * vs_dispatch == NULL means use default dispatcher.
+ */
+- int (*vs_dispatch)(struct svc_rqst *, u32 *);
++ int (*vs_dispatch)(struct svc_rqst *, __u32 *);
+ };
+
+ /*
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/xprt.h linux-libc-headers-2.6.8.0/include/linux/sunrpc/xprt.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/xprt.h 2004-06-23 16:52:58.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/sunrpc/xprt.h 2004-08-26 05:42:08.000000000 -0500
+@@ -93,7 +93,7 @@
+ __u32 rq_xid; /* request XID */
+ int rq_cong; /* has incremented xprt->cong */
+ int rq_received; /* receive completed */
+- u32 rq_seqno; /* gss seq no. used on req. */
++ __u32 rq_seqno; /* gss seq no. used on req. */
+
+ struct list_head rq_list;
+
+@@ -106,13 +106,13 @@
+ /*
+ * For authentication (e.g. auth_des)
+ */
+- u32 rq_creddata[2];
++ __u32 rq_creddata[2];
+
+ /*
+ * Partial send handling
+ */
+
+- u32 rq_bytes_sent; /* Bytes we have sent */
++ __u32 rq_bytes_sent; /* Bytes we have sent */
+
+ unsigned long rq_xtime; /* when transmitted */
+ int rq_ntrans;
+@@ -160,7 +160,7 @@
+ /*
+ * State of TCP reply receive stuff
+ */
+- u32 tcp_recm, /* Fragment header */
++ __u32 tcp_recm, /* Fragment header */
+ tcp_xid, /* Current XID */
+ tcp_reclen, /* fragment length */
+ tcp_offset; /* fragment offset */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/suspend.h linux-libc-headers-2.6.8.0/include/linux/suspend.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/suspend.h 2004-08-18 13:16:05.000000000 -0500
++++ linux-libc-headers-2.6.8.0/include/linux/suspend.h 2004-08-26 05:42:08.000000000 -0500
+@@ -23,7 +23,7 @@
+ #define SWAP_FILENAME_MAXLENGTH 32
+
+ struct suspend_header {
+- u32 version_code;
++ __u32 version_code;
+ unsigned long num_physpages;
+ char machine[8];
+ char version[20];
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sysdev.h linux-libc-headers-2.6.8.0/include/linux/sysdev.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/sysdev.h 2004-03-28 07:52:11.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/sysdev.h 2004-08-26 05:42:08.000000000 -0500
+@@ -31,7 +31,7 @@
+
+ /* Default operations for these types of devices */
+ int (*shutdown)(struct sys_device *);
+- int (*suspend)(struct sys_device *, u32 state);
++ int (*suspend)(struct sys_device *, __u32 state);
+ int (*resume)(struct sys_device *);
+ struct kset kset;
+ };
+@@ -50,7 +50,7 @@
+ int (*add)(struct sys_device *);
+ int (*remove)(struct sys_device *);
+ int (*shutdown)(struct sys_device *);
+- int (*suspend)(struct sys_device *, u32 state);
++ int (*suspend)(struct sys_device *, __u32 state);
+ int (*resume)(struct sys_device *);
+ };
+
+@@ -65,7 +65,7 @@
+ */
+
+ struct sys_device {
+- u32 id;
++ __u32 id;
+ struct sysdev_class * cls;
+ struct kobject kobj;
+ };
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sysv_fs.h linux-libc-headers-2.6.8.0/include/linux/sysv_fs.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/sysv_fs.h 2003-12-15 12:46:58.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/sysv_fs.h 2004-08-26 05:42:08.000000000 -0500
+@@ -9,12 +9,12 @@
+
+
+ /* inode numbers are 16 bit */
+-typedef u16 sysv_ino_t;
++typedef __u16 sysv_ino_t;
+
+ /* Block numbers are 24 bit, sometimes stored in 32 bit.
+ On Coherent FS, they are always stored in PDP-11 manner: the least
+ significant 16 bits come last. */
+-typedef u32 sysv_zone_t;
++typedef __u32 sysv_zone_t;
+
+ /* 0 is non-existent */
+ #define SYSV_BADBL_INO 1 /* inode of bad blocks file */
+@@ -25,29 +25,29 @@
+ #define XENIX_NICINOD 100 /* number of inode cache entries */
+ #define XENIX_NICFREE 100 /* number of free block list chunk entries */
+ struct xenix_super_block {
+- u16 s_isize; /* index of first data zone */
+- u32 s_fsize __packed2__; /* total number of zones of this fs */
++ __u16 s_isize; /* index of first data zone */
++ __u32 s_fsize __packed2__; /* total number of zones of this fs */
+ /* the start of the free block list: */
+- u16 s_nfree; /* number of free blocks in s_free, <= XENIX_NICFREE */
+- u32 s_free[XENIX_NICFREE]; /* first free block list chunk */
++ __u16 s_nfree; /* number of free blocks in s_free, <= XENIX_NICFREE */
++ __u32 s_free[XENIX_NICFREE]; /* first free block list chunk */
+ /* the cache of free inodes: */
+- u16 s_ninode; /* number of free inodes in s_inode, <= XENIX_NICINOD */
++ __u16 s_ninode; /* number of free inodes in s_inode, <= XENIX_NICINOD */
+ sysv_ino_t s_inode[XENIX_NICINOD]; /* some free inodes */
+ /* locks, not used by Linux: */
+ char s_flock; /* lock during free block list manipulation */
+ char s_ilock; /* lock during inode cache manipulation */
+ char s_fmod; /* super-block modified flag */
+ char s_ronly; /* flag whether fs is mounted read-only */
+- u32 s_time __packed2__; /* time of last super block update */
+- u32 s_tfree __packed2__; /* total number of free zones */
+- u16 s_tinode; /* total number of free inodes */
+- s16 s_dinfo[4]; /* device information ?? */
++ __u32 s_time __packed2__; /* time of last super block update */
++ __u32 s_tfree __packed2__; /* total number of free zones */
++ __u16 s_tinode; /* total number of free inodes */
++ __s16 s_dinfo[4]; /* device information ?? */
+ char s_fname[6]; /* file system volume name */
+ char s_fpack[6]; /* file system pack name */
+ char s_clean; /* set to 0x46 when filesystem is properly unmounted */
+ char s_fill[371];
+- s32 s_magic; /* version of file system */
+- s32 s_type; /* type of file system: 1 for 512 byte blocks
++ __s32 s_magic; /* version of file system */
++ __s32 s_type; /* type of file system: 1 for 512 byte blocks
+ 2 for 1024 byte blocks
+ 3 for 2048 byte blocks */
+
+@@ -63,61 +63,61 @@
+
+ /* SystemV4 super-block data on disk */
+ struct sysv4_super_block {
+- u16 s_isize; /* index of first data zone */
+- u16 s_pad0;
+- u32 s_fsize; /* total number of zones of this fs */
++ __u16 s_isize; /* index of first data zone */
++ __u16 s_pad0;
++ __u32 s_fsize; /* total number of zones of this fs */
+ /* the start of the free block list: */
+- u16 s_nfree; /* number of free blocks in s_free, <= SYSV_NICFREE */
+- u16 s_pad1;
+- u32 s_free[SYSV_NICFREE]; /* first free block list chunk */
++ __u16 s_nfree; /* number of free blocks in s_free, <= SYSV_NICFREE */
++ __u16 s_pad1;
++ __u32 s_free[SYSV_NICFREE]; /* first free block list chunk */
+ /* the cache of free inodes: */
+- u16 s_ninode; /* number of free inodes in s_inode, <= SYSV_NICINOD */
+- u16 s_pad2;
++ __u16 s_ninode; /* number of free inodes in s_inode, <= SYSV_NICINOD */
++ __u16 s_pad2;
+ sysv_ino_t s_inode[SYSV_NICINOD]; /* some free inodes */
+ /* locks, not used by Linux: */
+ char s_flock; /* lock during free block list manipulation */
+ char s_ilock; /* lock during inode cache manipulation */
+ char s_fmod; /* super-block modified flag */
+ char s_ronly; /* flag whether fs is mounted read-only */
+- u32 s_time; /* time of last super block update */
+- s16 s_dinfo[4]; /* device information ?? */
+- u32 s_tfree; /* total number of free zones */
+- u16 s_tinode; /* total number of free inodes */
+- u16 s_pad3;
++ __u32 s_time; /* time of last super block update */
++ __s16 s_dinfo[4]; /* device information ?? */
++ __u32 s_tfree; /* total number of free zones */
++ __u16 s_tinode; /* total number of free inodes */
++ __u16 s_pad3;
+ char s_fname[6]; /* file system volume name */
+ char s_fpack[6]; /* file system pack name */
+- s32 s_fill[12];
+- s32 s_state; /* file system state: 0x7c269d38-s_time means clean */
+- s32 s_magic; /* version of file system */
+- s32 s_type; /* type of file system: 1 for 512 byte blocks
++ __s32 s_fill[12];
++ __s32 s_state; /* file system state: 0x7c269d38-s_time means clean */
++ __s32 s_magic; /* version of file system */
++ __s32 s_type; /* type of file system: 1 for 512 byte blocks
+ 2 for 1024 byte blocks */
+ };
+
+ /* SystemV2 super-block data on disk */
+ struct sysv2_super_block {
+- u16 s_isize; /* index of first data zone */
+- u32 s_fsize __packed2__; /* total number of zones of this fs */
++ __u16 s_isize; /* index of first data zone */
++ __u32 s_fsize __packed2__; /* total number of zones of this fs */
+ /* the start of the free block list: */
+- u16 s_nfree; /* number of free blocks in s_free, <= SYSV_NICFREE */
+- u32 s_free[SYSV_NICFREE]; /* first free block list chunk */
++ __u16 s_nfree; /* number of free blocks in s_free, <= SYSV_NICFREE */
++ __u32 s_free[SYSV_NICFREE]; /* first free block list chunk */
+ /* the cache of free inodes: */
+- u16 s_ninode; /* number of free inodes in s_inode, <= SYSV_NICINOD */
++ __u16 s_ninode; /* number of free inodes in s_inode, <= SYSV_NICINOD */
+ sysv_ino_t s_inode[SYSV_NICINOD]; /* some free inodes */
+ /* locks, not used by Linux: */
+ char s_flock; /* lock during free block list manipulation */
+ char s_ilock; /* lock during inode cache manipulation */
+ char s_fmod; /* super-block modified flag */
+ char s_ronly; /* flag whether fs is mounted read-only */
+- u32 s_time __packed2__; /* time of last super block update */
+- s16 s_dinfo[4]; /* device information ?? */
+- u32 s_tfree __packed2__; /* total number of free zones */
+- u16 s_tinode; /* total number of free inodes */
++ __u32 s_time __packed2__; /* time of last super block update */
++ __s16 s_dinfo[4]; /* device information ?? */
++ __u32 s_tfree __packed2__; /* total number of free zones */
++ __u16 s_tinode; /* total number of free inodes */
+ char s_fname[6]; /* file system volume name */
+ char s_fpack[6]; /* file system pack name */
+- s32 s_fill[14];
+- s32 s_state; /* file system state: 0xcb096f43 means clean */
+- s32 s_magic; /* version of file system */
+- s32 s_type; /* type of file system: 1 for 512 byte blocks
++ __s32 s_fill[14];
++ __s32 s_state; /* file system state: 0xcb096f43 means clean */
++ __s32 s_magic; /* version of file system */
++ __s32 s_type; /* type of file system: 1 for 512 byte blocks
+ 2 for 1024 byte blocks */
+ };
+
+@@ -125,25 +125,25 @@
+ #define V7_NICINOD 100 /* number of inode cache entries */
+ #define V7_NICFREE 50 /* number of free block list chunk entries */
+ struct v7_super_block {
+- u16 s_isize; /* index of first data zone */
+- u32 s_fsize __packed2__; /* total number of zones of this fs */
++ __u16 s_isize; /* index of first data zone */
++ __u32 s_fsize __packed2__; /* total number of zones of this fs */
+ /* the start of the free block list: */
+- u16 s_nfree; /* number of free blocks in s_free, <= V7_NICFREE */
+- u32 s_free[V7_NICFREE]; /* first free block list chunk */
++ __u16 s_nfree; /* number of free blocks in s_free, <= V7_NICFREE */
++ __u32 s_free[V7_NICFREE]; /* first free block list chunk */
+ /* the cache of free inodes: */
+- u16 s_ninode; /* number of free inodes in s_inode, <= V7_NICINOD */
++ __u16 s_ninode; /* number of free inodes in s_inode, <= V7_NICINOD */
+ sysv_ino_t s_inode[V7_NICINOD]; /* some free inodes */
+ /* locks, not used by Linux or V7: */
+ char s_flock; /* lock during free block list manipulation */
+ char s_ilock; /* lock during inode cache manipulation */
+ char s_fmod; /* super-block modified flag */
+ char s_ronly; /* flag whether fs is mounted read-only */
+- u32 s_time __packed2__; /* time of last super block update */
++ __u32 s_time __packed2__; /* time of last super block update */
+ /* the following fields are not maintained by V7: */
+- u32 s_tfree __packed2__; /* total number of free zones */
+- u16 s_tinode; /* total number of free inodes */
+- u16 s_m; /* interleave factor */
+- u16 s_n; /* interleave factor */
++ __u32 s_tfree __packed2__; /* total number of free zones */
++ __u16 s_tinode; /* total number of free inodes */
++ __u16 s_m; /* interleave factor */
++ __u16 s_n; /* interleave factor */
+ char s_fname[6]; /* file system name */
+ char s_fpack[6]; /* file system pack name */
+ };
+@@ -152,41 +152,41 @@
+ #define COH_NICINOD 100 /* number of inode cache entries */
+ #define COH_NICFREE 64 /* number of free block list chunk entries */
+ struct coh_super_block {
+- u16 s_isize; /* index of first data zone */
+- u32 s_fsize __packed2__; /* total number of zones of this fs */
++ __u16 s_isize; /* index of first data zone */
++ __u32 s_fsize __packed2__; /* total number of zones of this fs */
+ /* the start of the free block list: */
+- u16 s_nfree; /* number of free blocks in s_free, <= COH_NICFREE */
+- u32 s_free[COH_NICFREE] __packed2__; /* first free block list chunk */
++ __u16 s_nfree; /* number of free blocks in s_free, <= COH_NICFREE */
++ __u32 s_free[COH_NICFREE] __packed2__; /* first free block list chunk */
+ /* the cache of free inodes: */
+- u16 s_ninode; /* number of free inodes in s_inode, <= COH_NICINOD */
++ __u16 s_ninode; /* number of free inodes in s_inode, <= COH_NICINOD */
+ sysv_ino_t s_inode[COH_NICINOD]; /* some free inodes */
+ /* locks, not used by Linux: */
+ char s_flock; /* lock during free block list manipulation */
+ char s_ilock; /* lock during inode cache manipulation */
+ char s_fmod; /* super-block modified flag */
+ char s_ronly; /* flag whether fs is mounted read-only */
+- u32 s_time __packed2__; /* time of last super block update */
+- u32 s_tfree __packed2__; /* total number of free zones */
+- u16 s_tinode; /* total number of free inodes */
+- u16 s_interleave_m; /* interleave factor */
+- u16 s_interleave_n;
++ __u32 s_time __packed2__; /* time of last super block update */
++ __u32 s_tfree __packed2__; /* total number of free zones */
++ __u16 s_tinode; /* total number of free inodes */
++ __u16 s_interleave_m; /* interleave factor */
++ __u16 s_interleave_n;
+ char s_fname[6]; /* file system volume name */
+ char s_fpack[6]; /* file system pack name */
+- u32 s_unique; /* zero, not used */
++ __u32 s_unique; /* zero, not used */
+ };
+
+ /* SystemV/Coherent inode data on disk */
+ struct sysv_inode {
+- u16 i_mode;
+- u16 i_nlink;
+- u16 i_uid;
+- u16 i_gid;
+- u32 i_size;
+- u8 i_data[3*(10+1+1+1)];
+- u8 i_gen;
+- u32 i_atime; /* time of last access */
+- u32 i_mtime; /* time of last modification */
+- u32 i_ctime; /* time of creation */
++ __u16 i_mode;
++ __u16 i_nlink;
++ __u16 i_uid;
++ __u16 i_gid;
++ __u32 i_size;
++ __u8 i_data[3*(10+1+1+1)];
++ __u8 i_gen;
++ __u32 i_atime; /* time of last access */
++ __u32 i_mtime; /* time of last modification */
++ __u32 i_ctime; /* time of creation */
+ };
+
+ /* SystemV/Coherent directory entry on disk */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/tiocl.h linux-libc-headers-2.6.8.0/include/linux/tiocl.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/tiocl.h 2003-12-15 12:46:58.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/tiocl.h 2004-08-26 05:42:08.000000000 -0500
+@@ -23,7 +23,7 @@
+
+ #define TIOCL_SELLOADLUT 5
+ /* set characters to be considered alphabetic when selecting */
+- /* u32[8] bit array, 4 bytes-aligned with type */
++ /* __u32[8] bit array, 4 bytes-aligned with type */
+
+ /* these two don't return a value: they write it back in the type */
+ #define TIOCL_GETSHIFTSTATE 6 /* write shift state */
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/umem.h linux-libc-headers-2.6.8.0/include/linux/umem.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/umem.h 2003-12-15 12:46:58.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/umem.h 2004-08-26 05:42:08.000000000 -0500
+@@ -110,19 +110,19 @@
+ #define DMA_WRITE_TO_HOST 1
+
+ struct mm_dma_desc {
+- u64 pci_addr;
+- u64 local_addr;
+- u32 transfer_size;
+- u32 zero1;
+- u64 next_desc_addr;
+- u64 sem_addr;
+- u32 control_bits;
+- u32 zero2;
++ __u64 pci_addr;
++ __u64 local_addr;
++ __u32 transfer_size;
++ __u32 zero1;
++ __u64 next_desc_addr;
++ __u64 sem_addr;
++ __u32 control_bits;
++ __u32 zero2;
+
+ dma_addr_t data_dma_handle;
+
+ /* Copy of the bits */
+- u64 sem_control_bits;
++ __u64 sem_control_bits;
+ } __attribute__((aligned(8)));
+
+ #define PCI_VENDOR_ID_MICRO_MEMORY 0x1332
+diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/vt_buffer.h linux-libc-headers-2.6.8.0/include/linux/vt_buffer.h
+--- linux-libc-headers-2.6.8.0-dist/include/linux/vt_buffer.h 2004-01-17 17:04:33.000000000 -0600
++++ linux-libc-headers-2.6.8.0/include/linux/vt_buffer.h 2004-08-26 05:42:08.000000000 -0500
+@@ -28,7 +28,7 @@
+ #endif
+
+ #ifndef VT_BUF_HAVE_MEMSETW
+-static inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
++static inline void scr_memsetw(__u16 *s, __u16 c, unsigned int count)
+ {
+ count /= 2;
+ while (count--)
+@@ -37,7 +37,7 @@
+ #endif
+
+ #ifndef VT_BUF_HAVE_MEMCPYW
+-static inline void scr_memcpyw(u16 *d, const u16 *s, unsigned int count)
++static inline void scr_memcpyw(__u16 *d, const __u16 *s, unsigned int count)
+ {
+ count /= 2;
+ while (count--)
+@@ -46,7 +46,7 @@
+ #endif
+
+ #ifndef VT_BUF_HAVE_MEMMOVEW
+-static inline void scr_memmovew(u16 *d, const u16 *s, unsigned int count)
++static inline void scr_memmovew(__u16 *d, const __u16 *s, unsigned int count)
+ {
+ if (d < s)
+ scr_memcpyw(d, s, count);
--- /dev/null
+--- ncurses-5.2/ncurses/Makefile.in.orig 2000-10-14 17:55:35.000000000 -0500
++++ ncurses-5.2/ncurses/Makefile.in 2004-08-09 11:34:13.000000000 -0500
+@@ -85,7 +85,7 @@
+ CCFLAGS = $(CPPFLAGS) $(CFLAGS)
+
+ HOSTCC = @BUILD_CC@
+-HOSTCCFLAGS = @CFLAGS@ $(CPPFLAGS)
++HOSTCCFLAGS = $(CPPFLAGS)
+ HOSTLDFLAGS = @LDFLAGS@ @LIBS@
+
+ CFLAGS_LIBTOOL = $(CCFLAGS)
#
HAVE_ELF=y
TARGET_ARCH="none"
-# ARCH_LITTLE_ENDIAN is not set
-# ARCH_BIG_ENDIAN is not set
# ARCH_HAS_NO_MMU is not set
UCLIBC_HAS_FLOATS=y
HAS_FPU=y
#
HAVE_ELF=y
TARGET_ARCH="none"
-# ARCH_LITTLE_ENDIAN is not set
-# ARCH_BIG_ENDIAN is not set
# ARCH_HAS_NO_MMU is not set
UCLIBC_HAS_FLOATS=y
HAS_FPU=y