aboutsummaryrefslogtreecommitdiff
path: root/4.1.2
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-02-14 10:47:56 +0000
committerMike Frysinger <vapier@gentoo.org>2007-02-14 10:47:56 +0000
commitdbe42911ad810f3262c82e8871cfaf9aa4cf6872 (patch)
treec9884a5bd11f4efdd32b4415b6657daf06da9346 /4.1.2
parentinitial 4.0.4 patchset based on last 4.0.3 patchset (diff)
downloadgcc-patches-dbe42911ad810f3262c82e8871cfaf9aa4cf6872.tar.gz
gcc-patches-dbe42911ad810f3262c82e8871cfaf9aa4cf6872.tar.bz2
gcc-patches-dbe42911ad810f3262c82e8871cfaf9aa4cf6872.zip
initial 4.1.2 patchset
Diffstat (limited to '4.1.2')
-rw-r--r--4.1.2/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch31
-rw-r--r--4.1.2/gentoo/00_all_gcc-trampolinewarn.patch32
-rw-r--r--4.1.2/gentoo/01_all_gcc4-ice-hack.patch317
-rw-r--r--4.1.2/gentoo/02_all_gcc4-ppc64-m32-m64-multilib-only.patch22
-rw-r--r--4.1.2/gentoo/03_all_gcc4-java-nomulti.patch25
-rw-r--r--4.1.2/gentoo/04_all_gcc42-boehmgc-include.patch181
-rw-r--r--4.1.2/gentoo/05_all_gcc42-multilib-print-search-dirs.patch907
-rw-r--r--4.1.2/gentoo/06_all_gcc4-slow-pthread-self.patch15
-rw-r--r--4.1.2/gentoo/10_all_gcc4-libltdl-multilib.patch191
-rw-r--r--4.1.2/gentoo/11_all_gcc-netbsd-symbolic.patch12
-rw-r--r--4.1.2/gentoo/13_all_gcc4-libjava-ia64-backtrace.patch29
-rw-r--r--4.1.2/gentoo/15_all_gcc42-builtin-frame-address.patch34
-rw-r--r--4.1.2/gentoo/20_all_cris-dont-force-limits-header.patch11
-rw-r--r--4.1.2/gentoo/29_all_gcc4-pr19664.patch1717
-rw-r--r--4.1.2/gentoo/34_all_arm-bigendian.patch96
-rw-r--r--4.1.2/gentoo/39_all_gcc-pr28516.patch25
-rw-r--r--4.1.2/gentoo/40_all_gcc4-debian-hppa-cbranch.patch1751
-rw-r--r--4.1.2/gentoo/41_all_gcc4-debian-hppa-cbranch2.patch626
-rw-r--r--4.1.2/gentoo/42_all_gcc4-pr27627.patch34
-rw-r--r--4.1.2/gentoo/48_all_gcc4-hppa-mfctl.patch17
-rw-r--r--4.1.2/gentoo/49_all_gcc41-pr30473.patch44
-rw-r--r--4.1.2/gentoo/51_all_gcc-3.4-libiberty-pic.patch10
-rw-r--r--4.1.2/gentoo/53_all_gcc4-superh-default-multilib.patch23
-rw-r--r--4.1.2/gentoo/54_all_300-libstdc++-pic.patch53
-rw-r--r--4.1.2/gentoo/61_all_gcc4-ia64-noteGNUstack.patch88
-rw-r--r--4.1.2/gentoo/62_all_gcc4-noteGNUstack.patch182
-rw-r--r--4.1.2/gentoo/74_all_sh-pr24836.patch25
-rw-r--r--4.1.2/gentoo/85_all_gcc-ca-translation-typo.patch17
-rw-r--r--4.1.2/gentoo/89_all_gcc42-sparc64-ssp.patch23
-rw-r--r--4.1.2/gentoo/90_all_mips-add-march-r10k.patch394
-rw-r--r--4.1.2/gentoo/91_all_mips-ip28_cache_barriers-v4.patch359
-rw-r--r--4.1.2/gentoo/95_all_gcc-mips-dwarf-info.patch92
-rw-r--r--4.1.2/gentoo/95_all_gcc-mips-dwarf-old-info.patch24
-rw-r--r--4.1.2/uclibc/90_all_100-uclibc-conf.patch544
-rw-r--r--4.1.2/uclibc/90_all_110-arm-eabi.patch27
-rw-r--r--4.1.2/uclibc/90_all_200-uclibc-locale.patch3239
-rw-r--r--4.1.2/uclibc/90_all_301-missing-execinfo_h.patch11
-rw-r--r--4.1.2/uclibc/90_all_302-c99-snprintf.patch11
-rw-r--r--4.1.2/uclibc/90_all_303-c99-complex-ugly-hack.patch12
39 files changed, 11251 insertions, 0 deletions
diff --git a/4.1.2/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch b/4.1.2/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
new file mode 100644
index 0000000..6d87684
--- /dev/null
+++ b/4.1.2/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
@@ -0,0 +1,31 @@
+Set the default behavior on alpha to use -mieee since the large majority of
+time we want this (bad/weird things can happen with packages built without
+-mieee).
+
+To satisfy those people who may not want -mieee forced on them all the time,
+we also provide -mno-ieee.
+
+Patch by Mike Frysinger <vapier@gentoo.org>
+
+--- gcc-4_1-branch/gcc/config/alpha/alpha.h
++++ gcc-4_1-branch/gcc/config/alpha/alpha.h
+@@ -96,7 +96,7 @@
+ while (0)
+ #endif
+
+-#define CPP_SPEC "%(cpp_subtarget)"
++#define CPP_SPEC "%(cpp_subtarget) %{!no-ieee:-mieee}"
+
+ #ifndef CPP_SUBTARGET_SPEC
+ #define CPP_SUBTARGET_SPEC ""
+--- gcc-4_1-branch/gcc/config/alpha/alpha.opt
++++ gcc-4_1-branch/gcc/config/alpha/alpha.opt
+@@ -40,7 +40,7 @@
+ Request IEEE-conformant math library routines (OSF/1)
+
+ mieee
+-Target Report RejectNegative Mask(IEEE)
++Target Report Mask(IEEE)
+ Emit IEEE-conformant code, without inexact exceptions
+
+ mieee-with-inexact
diff --git a/4.1.2/gentoo/00_all_gcc-trampolinewarn.patch b/4.1.2/gentoo/00_all_gcc-trampolinewarn.patch
new file mode 100644
index 0000000..a68a43f
--- /dev/null
+++ b/4.1.2/gentoo/00_all_gcc-trampolinewarn.patch
@@ -0,0 +1,32 @@
+ This trivial patch causes gcc to emit a warning whenever
+ it generates a trampoline. These are otherwise hard to
+ locate. It is rigged to default ON - to have it default
+ to OFF remove the text 'Init(1)' from the common.opt
+ patch, leaving just 'Common Var(warn_trampolines)'.
+ Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
+
+--- gcc/gcc/common.opt
++++ gcc/gcc/common.opt
+@@ -141,6 +141,10 @@
+ Common Var(warn_system_headers)
+ Do not suppress warnings from system headers
+
++Wtrampolines
++Common Var(warn_trampolines) Init(1)
++Warn whenever a trampoline is generated
++
+ Wuninitialized
+ Common Var(warn_uninitialized)
+ Warn about uninitialized automatic variables
+--- gcc/gcc/builtins.c
++++ gcc/gcc/builtins.c
+@@ -5224,6 +5224,9 @@
+ #endif
+ trampolines_created = 1;
+ INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
++
++ if (warn_trampolines)
++ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
+
+ return const0_rtx;
+ }
diff --git a/4.1.2/gentoo/01_all_gcc4-ice-hack.patch b/4.1.2/gentoo/01_all_gcc4-ice-hack.patch
new file mode 100644
index 0000000..5a8b090
--- /dev/null
+++ b/4.1.2/gentoo/01_all_gcc4-ice-hack.patch
@@ -0,0 +1,317 @@
+2004-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ * system.h (ICE_EXIT_CODE): Define.
+ * gcc.c (execute): Don't free first string early, but at the end
+ of the function. Call retry_ice if compiler exited with
+ ICE_EXIT_CODE.
+ (retry_ice): New function.
+ * diagnostic.c (diagnostic_count_diagnostic,
+ diagnostic_action_after_output, error_recursion): Exit with
+ ICE_EXIT_CODE instead of FATAL_EXIT_CODE.
+
+--- gcc/system.h.jj 2004-01-19 17:29:30.000000000 +0100
++++ gcc/system.h 2004-01-21 11:53:41.000000000 +0100
+@@ -153,6 +153,10 @@ extern int errno;
+ # endif
+ #endif
+
++#ifndef ICE_EXIT_CODE
++# define ICE_EXIT_CODE 27
++#endif
++
+ #ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+--- gcc/gcc.c.jj 2004-01-21 11:45:20.000000000 +0100
++++ gcc/gcc.c 2004-01-21 11:56:46.000000000 +0100
+@@ -346,6 +346,9 @@ static void init_gcc_specs (struct obsta
+ #if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
+ static const char *convert_filename (const char *, int, int);
+ #endif
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++static void retry_ice (const char *prog, const char **argv);
++#endif
+
+ static const char *if_exists_spec_function (int, const char **);
+ static const char *if_exists_else_spec_function (int, const char **);
+@@ -2841,7 +2844,7 @@ execute (void)
+ }
+ }
+
+- if (string != commands[i].prog)
++ if (i && string != commands[i].prog)
+ free ((void *) string);
+ }
+
+@@ -2897,6 +2900,17 @@ See %s for instructions.",
+ else if (WIFEXITED (status)
+ && WEXITSTATUS (status) >= MIN_FATAL_STATUS)
+ {
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++ /* For ICEs in cc1, cc1obj, cc1plus see if it is
++ reproducible or not. */
++ char *p;
++ if (getenv("GCC_RETRY_ICE") == NULL
++ && WEXITSTATUS (status) == ICE_EXIT_CODE
++ && i == 0
++ && (p = strrchr (commands[0].argv[0], DIR_SEPARATOR))
++ && ! strncmp (p + 1, "cc1", 3))
++ retry_ice (commands[0].prog, commands[0].argv);
++#endif
+ if (WEXITSTATUS (status) > greatest_status)
+ greatest_status = WEXITSTATUS (status);
+ ret_code = -1;
+@@ -2917,6 +2930,9 @@ See %s for instructions.",
+ }
+ }
+
++ if (commands[0].argv[0] != commands[0].prog)
++ free ((PTR) commands[0].argv[0]);
++
+ return ret_code;
+ }
+ }
+@@ -5898,6 +5914,224 @@ give_switch (int switchnum, int omit_fir
+ switches[switchnum].validated = 1;
+ }
+
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++#define RETRY_ICE_ATTEMPTS 2
++
++static void
++retry_ice (const char *prog, const char **argv)
++{
++ int nargs, out_arg = -1, quiet = 0, attempt;
++ int pid, retries, sleep_interval;
++ const char **new_argv;
++ char *temp_filenames[RETRY_ICE_ATTEMPTS * 2 + 2];
++
++ if (input_filename == NULL || ! strcmp (input_filename, "-"))
++ return;
++
++ for (nargs = 0; argv[nargs] != NULL; ++nargs)
++ /* Only retry compiler ICEs, not preprocessor ones. */
++ if (! strcmp (argv[nargs], "-E"))
++ return;
++ else if (argv[nargs][0] == '-' && argv[nargs][1] == 'o')
++ {
++ if (out_arg == -1)
++ out_arg = nargs;
++ else
++ return;
++ }
++ /* If the compiler is going to output any time information,
++ it might vary between invocations. */
++ else if (! strcmp (argv[nargs], "-quiet"))
++ quiet = 1;
++ else if (! strcmp (argv[nargs], "-ftime-report"))
++ return;
++
++ if (out_arg == -1 || !quiet)
++ return;
++
++ memset (temp_filenames, '\0', sizeof (temp_filenames));
++ new_argv = alloca ((nargs + 3) * sizeof (const char *));
++ memcpy (new_argv, argv, (nargs + 1) * sizeof (const char *));
++ new_argv[nargs++] = "-frandom-seed=0";
++ new_argv[nargs] = NULL;
++ if (new_argv[out_arg][2] == '\0')
++ new_argv[out_arg + 1] = "-";
++ else
++ new_argv[out_arg] = "-o-";
++
++ for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS + 1; ++attempt)
++ {
++ int fd = -1;
++ int status;
++
++ temp_filenames[attempt * 2] = make_temp_file (".out");
++ temp_filenames[attempt * 2 + 1] = make_temp_file (".err");
++
++ if (attempt == RETRY_ICE_ATTEMPTS)
++ {
++ int i;
++ int fd1, fd2;
++ struct stat st1, st2;
++ size_t n, len;
++ char *buf;
++
++ buf = xmalloc (8192);
++
++ for (i = 0; i < 2; ++i)
++ {
++ fd1 = open (temp_filenames[i], O_RDONLY);
++ fd2 = open (temp_filenames[2 + i], O_RDONLY);
++
++ if (fd1 < 0 || fd2 < 0)
++ {
++ i = -1;
++ close (fd1);
++ close (fd2);
++ break;
++ }
++
++ if (fstat (fd1, &st1) < 0 || fstat (fd2, &st2) < 0)
++ {
++ i = -1;
++ close (fd1);
++ close (fd2);
++ break;
++ }
++
++ if (st1.st_size != st2.st_size)
++ {
++ close (fd1);
++ close (fd2);
++ break;
++ }
++
++ len = 0;
++ for (n = st1.st_size; n; n -= len)
++ {
++ len = n;
++ if (len > 4096)
++ len = 4096;
++
++ if (read (fd1, buf, len) != (int) len
++ || read (fd2, buf + 4096, len) != (int) len)
++ {
++ i = -1;
++ break;
++ }
++
++ if (memcmp (buf, buf + 4096, len) != 0)
++ break;
++ }
++
++ close (fd1);
++ close (fd2);
++
++ if (n)
++ break;
++ }
++
++ free (buf);
++ if (i == -1)
++ break;
++
++ if (i != 2)
++ {
++ notice ("The bug is not reproducible, so it is likely a hardware or OS problem.\n");
++ break;
++ }
++
++ fd = open (temp_filenames[attempt * 2], O_RDWR);
++ if (fd < 0)
++ break;
++ write (fd, "//", 2);
++ for (i = 0; i < nargs; i++)
++ {
++ write (fd, " ", 1);
++ write (fd, new_argv[i], strlen (new_argv[i]));
++ }
++ write (fd, "\n", 1);
++ new_argv[nargs] = "-E";
++ new_argv[nargs + 1] = NULL;
++ }
++
++ /* Fork a subprocess; wait and retry if it fails. */
++ sleep_interval = 1;
++ pid = -1;
++ for (retries = 0; retries < 4; retries++)
++ {
++ pid = fork ();
++ if (pid >= 0)
++ break;
++ sleep (sleep_interval);
++ sleep_interval *= 2;
++ }
++
++ if (pid < 0)
++ break;
++ else if (pid == 0)
++ {
++ if (attempt != RETRY_ICE_ATTEMPTS)
++ fd = open (temp_filenames[attempt * 2], O_RDWR);
++ if (fd < 0)
++ exit (-1);
++ if (fd != 1)
++ {
++ close (1);
++ dup (fd);
++ close (fd);
++ }
++
++ fd = open (temp_filenames[attempt * 2 + 1], O_RDWR);
++ if (fd < 0)
++ exit (-1);
++ if (fd != 2)
++ {
++ close (2);
++ dup (fd);
++ close (fd);
++ }
++
++ if (prog == new_argv[0])
++ execvp (prog, (char *const *) new_argv);
++ else
++ execv (new_argv[0], (char *const *) new_argv);
++ exit (-1);
++ }
++
++ if (waitpid (pid, &status, 0) < 0)
++ break;
++
++ if (attempt < RETRY_ICE_ATTEMPTS
++ && (! WIFEXITED (status) || WEXITSTATUS (status) != ICE_EXIT_CODE))
++ {
++ notice ("The bug is not reproducible, so it is likely a hardware or OS problem.\n");
++ break;
++ }
++ else if (attempt == RETRY_ICE_ATTEMPTS)
++ {
++ close (fd);
++ if (WIFEXITED (status)
++ && WEXITSTATUS (status) == SUCCESS_EXIT_CODE)
++ {
++ notice ("Preprocessed source stored into %s file, please attach this to your bugreport.\n",
++ temp_filenames[attempt * 2]);
++ /* Make sure it is not deleted. */
++ free (temp_filenames[attempt * 2]);
++ temp_filenames[attempt * 2] = NULL;
++ break;
++ }
++ }
++ }
++
++ for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS * 2 + 2; attempt++)
++ if (temp_filenames[attempt])
++ {
++ unlink (temp_filenames[attempt]);
++ free (temp_filenames[attempt]);
++ }
++}
++#endif
++
+ /* Search for a file named NAME trying various prefixes including the
+ user's -B prefix and some standard ones.
+ Return the absolute file name found. If nothing is found, return NAME. */
+--- gcc/diagnostic.c.jj 2003-10-01 12:09:21.000000000 +0200
++++ gcc/diagnostic.c 2004-01-21 11:54:47.000000000 +0100
+@@ -237,14 +237,14 @@ diagnostic_action_after_output (diagnost
+ fnotice (stderr, "Please submit a full bug report,\n"
+ "with preprocessed source if appropriate.\n"
+ "See %s for instructions.\n", bug_report_url);
+- exit (FATAL_EXIT_CODE);
++ exit (ICE_EXIT_CODE);
+
+ case DK_FATAL:
+ if (context->abort_on_error)
+ real_abort ();
+
+ fnotice (stderr, "compilation terminated.\n");
+- exit (FATAL_EXIT_CODE);
++ exit (ICE_EXIT_CODE);
+
+ default:
+ gcc_unreachable ();
diff --git a/4.1.2/gentoo/02_all_gcc4-ppc64-m32-m64-multilib-only.patch b/4.1.2/gentoo/02_all_gcc4-ppc64-m32-m64-multilib-only.patch
new file mode 100644
index 0000000..00dbeac
--- /dev/null
+++ b/4.1.2/gentoo/02_all_gcc4-ppc64-m32-m64-multilib-only.patch
@@ -0,0 +1,22 @@
+--- gcc/config/rs6000/t-linux64 2003-06-03 05:11:45.000000000 -0400
++++ gcc/config/rs6000/t-linux64 2003-06-11 17:07:16.000000000 -0400
+@@ -4,13 +4,13 @@ LIB2FUNCS_EXTRA = tramp.S $(srcdir)/conf
+ # Modify the shared lib version file
+ SHLIB_MKMAP_OPTS = -v dotsyms=1
+
+-MULTILIB_OPTIONS = m64/m32 msoft-float
+-MULTILIB_DIRNAMES = 64 32 nof
++MULTILIB_OPTIONS = m64/m32
++MULTILIB_DIRNAMES = 64 32
+ MULTILIB_EXTRA_OPTS = fPIC mstrict-align
+-MULTILIB_EXCEPTIONS = m64/msoft-float
+-MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
+-MULTILIB_OSDIRNAMES = ../lib64 ../lib nof
+-MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
++MULTILIB_EXCEPTIONS =
++MULTILIB_EXCLUSIONS =
++MULTILIB_OSDIRNAMES = ../lib64 ../lib
++MULTILIB_MATCHES =
+
+ TARGET_LIBGCC2_CFLAGS = -mno-minimal-toc -fPIC
+
diff --git a/4.1.2/gentoo/03_all_gcc4-java-nomulti.patch b/4.1.2/gentoo/03_all_gcc4-java-nomulti.patch
new file mode 100644
index 0000000..3a6554d
--- /dev/null
+++ b/4.1.2/gentoo/03_all_gcc4-java-nomulti.patch
@@ -0,0 +1,25 @@
+--- libjava/configure.ac.jj 2004-08-16 21:13:29.000000000 +0200
++++ libjava/configure.ac 2004-08-21 11:44:59.020755542 +0200
+@@ -367,6 +367,10 @@ use_gtk_awt=""
+ TOOLKIT=
+ AC_SUBST(TOOLKIT)
+
++if test -n "${with_multisubdir}"; then
++ peerlibs=no
++fi
++
+ for peer in $peerlibs ; do
+ case $peer in
+ xlib)
+--- libjava/configure.jj 2004-08-16 21:22:14.000000000 +0200
++++ libjava/configure 2004-08-21 11:45:16.260738060 +0200
+@@ -4118,6 +4118,9 @@ use_gtk_awt=""
+ # The default toolkit to use is the first one specified.
+ TOOLKIT=
+
++if test -n "${with_multisubdir}"; then
++ peerlibs=no
++fi
+
+ for peer in $peerlibs ; do
+ case $peer in
diff --git a/4.1.2/gentoo/04_all_gcc42-boehmgc-include.patch b/4.1.2/gentoo/04_all_gcc42-boehmgc-include.patch
new file mode 100644
index 0000000..45936cf
--- /dev/null
+++ b/4.1.2/gentoo/04_all_gcc42-boehmgc-include.patch
@@ -0,0 +1,181 @@
+--- configure.in
++++ configure.in
+@@ -331,6 +331,19 @@
+ ;;
+ esac
+
++AC_ARG_ENABLE(objc-gc,
++[ --enable-objc-gc enable the use of Boehm's garbage collector with
++ the GNU Objective-C runtime.],
++[case $enable_objc_gc in
++ yes)
++ # reenable boehm-gc if it is needed for objc
++ noconfigdirs=`echo " ${noconfigdirs} " | sed -e 's/target-boehm-gc //'`
++ libgcj=`echo " ${libgcj} " | sed -e 's/target-boehm-gc //'`
++ libgcj_saved=`echo " ${libgcj_saved} " | sed -e 's/target-boehm-gc //'`
++ ;;
++ no)
++ ;;
++esac])
+
+ # Allow --disable-libmudflap to exclude target-libmudflap
+ case $enable_libmudflap in
+--- configure
++++ configure
+@@ -16,6 +16,9 @@
+ ac_help="$ac_help
+ --enable-libssp Builds libssp directory"
+ ac_help="$ac_help
++ --enable-objc-gc enable the use of Boehm's garbage collector with
++ the GNU Objective-C runtime."
++ac_help="$ac_help
+ --with-mpfr-dir=PATH Specify source directory for MPFR library"
+ ac_help="$ac_help
+ --with-mpfr=PATH Specify directory for installed MPFR library"
+@@ -1123,6 +1126,21 @@
+ ;;
+ esac
+
++# Check whether --enable-objc-gc or --disable-objc-gc was given.
++if test "${enable_objc_gc+set}" = set; then
++ enableval="$enable_objc_gc"
++ case $enable_objc_gc in
++ yes)
++ # reenable boehm-gc if it is needed for objc
++ noconfigdirs=`echo " ${noconfigdirs} " | sed -e 's/target-boehm-gc //'`
++ libgcj=`echo " ${libgcj} " | sed -e 's/target-boehm-gc //'`
++ libgcj_saved=`echo " ${libgcj_saved} " | sed -e 's/target-boehm-gc //'`
++ ;;
++ no)
++ ;;
++esac
++fi
++
+
+ # Allow --disable-libmudflap to exclude target-libmudflap
+ case $enable_libmudflap in
+--- libobjc/configure
++++ libobjc/configure
+@@ -309,7 +309,7 @@
+ # include <unistd.h>
+ #endif"
+
+-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_subdir host_subdir target_subdir VERSION OBJC_BOEHM_GC toplevel_srcdir host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical glibcpp_srcdir toolexecdir toolexeclibdir includedirname libext CC ac_ct_CC EXEEXT OBJEXT extra_ldflags_libobjc CFLAGS AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LN_S STRIP ac_ct_STRIP LIBTOOL SET_MAKE CPP CPPFLAGS EGREP LIBOBJS LTLIBOBJS'
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_subdir host_subdir target_subdir VERSION OBJC_BOEHM_GC OBJC_BOEHM_GC_INCLUDES toplevel_srcdir host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical glibcpp_srcdir toolexecdir toolexeclibdir includedirname libext CC ac_ct_CC EXEEXT OBJEXT extra_ldflags_libobjc CFLAGS AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LN_S STRIP ac_ct_STRIP LIBTOOL SET_MAKE CPP CPPFLAGS EGREP LIBOBJS LTLIBOBJS'
+ ac_subst_files=''
+
+ # Initialize some variables set by options.
+@@ -1467,14 +1467,21 @@
+ if test "${enable_objc_gc+set}" = set; then
+ enableval="$enable_objc_gc"
+ case $enable_objc_gc in
+- no) OBJC_BOEHM_GC='' ;;
+- *) OBJC_BOEHM_GC=libobjc_gc.la ;;
++ no)
++ OBJC_BOEHM_GC=''
++ OBJC_BOEHM_GC_INCLUDES=''
++ ;;
++ *)
++ OBJC_BOEHM_GC=libobjc_gc.la
++ OBJC_BOEHM_GC_INCLUDES='-I$(top_srcdir)/../boehm-gc/include -I../boehm-gc/include'
++ ;;
+ esac
+ else
+- OBJC_BOEHM_GC=''
++ OBJC_BOEHM_GC=''; OBJC_BOEHM_GC_INCLUDES=''
+ fi;
+
+
++
+ # -----------
+ # Directories
+ # -----------
+@@ -5906,6 +5901,7 @@
+ s,@target_subdir@,$target_subdir,;t t
+ s,@VERSION@,$VERSION,;t t
+ s,@OBJC_BOEHM_GC@,$OBJC_BOEHM_GC,;t t
++s,@OBJC_BOEHM_GC_INCLUDES@,$OBJC_BOEHM_GC_INCLUDES,;t t
+ s,@toplevel_srcdir@,$toplevel_srcdir,;t t
+ s,@host@,$host,;t t
+ s,@host_cpu@,$host_cpu,;t t
+--- libobjc/configure.ac
++++ libobjc/configure.ac
+@@ -73,11 +73,18 @@
+ [ --enable-objc-gc enable the use of Boehm's garbage collector with
+ the GNU Objective-C runtime.],
+ [case $enable_objc_gc in
+- no) OBJC_BOEHM_GC='' ;;
+- *) OBJC_BOEHM_GC=libobjc_gc.la ;;
++ no)
++ OBJC_BOEHM_GC=''
++ OBJC_BOEHM_GC_INCLUDES=''
++ ;;
++ *)
++ OBJC_BOEHM_GC=libobjc_gc.la
++ OBJC_BOEHM_GC_INCLUDES='-I$(top_srcdir)/../boehm-gc/include -I../boehm-gc/include'
++ ;;
+ esac],
+-[OBJC_BOEHM_GC=''])
++[OBJC_BOEHM_GC=''; OBJC_BOEHM_GC_INCLUDES=''])
+ AC_SUBST(OBJC_BOEHM_GC)
++AC_SUBST(OBJC_BOEHM_GC_INCLUDES)
+
+ # -----------
+ # Directories
+--- libobjc/Makefile.in
++++ libobjc/Makefile.in
+@@ -1,6 +1,6 @@
+ # Makefile for GNU Objective C runtime library.
+-# Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
+-# Free Software Foundation, Inc.
++# Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
++# 2005, 2006 Free Software Foundation, Inc.
+
+ #This file is part of GCC.
+
+@@ -91,14 +91,17 @@
+ LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
+ #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
+
++OBJC_GCFLAGS=-DOBJC_WITH_GC=1
++OBJC_THREAD_FILE=thr-objc
++OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
++OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
++
+ INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \
+ -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
+ -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
+- -I$(srcdir)/$(MULTISRCTOP)../include
++ -I$(srcdir)/$(MULTISRCTOP)../include \
++ $(OBJC_BOEHM_GC_INCLUDES)
+
+-OBJC_GCFLAGS=-DOBJC_WITH_GC=1
+-OBJC_THREAD_FILE=thr-objc
+-OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
+
+ .SUFFIXES:
+ .SUFFIXES: .c .m .lo
+--- Makefile.def
++++ Makefile.def
+@@ -431,7 +431,9 @@
+ dependencies = { module=all-target-libjava; on=all-target-boehm-gc; };
+ dependencies = { module=all-target-libjava; on=all-target-qthreads; };
+ dependencies = { module=all-target-libjava; on=all-target-libffi; };
++dependencies = { module=configure-target-libobjc; on=configure-target-boehm-gc; };
+ dependencies = { module=all-target-libobjc; on=all-target-libiberty; };
++dependencies = { module=all-target-libobjc; on=all-target-boehm-gc; };
+ dependencies = { module=all-target-libstdc++-v3; on=all-target-libiberty; };
+
+ // Target modules in the 'src' repository.
+--- Makefile.in
++++ Makefile.in
+@@ -36691,7 +36691,9 @@
+ all-target-libjava: maybe-all-target-boehm-gc
+ all-target-libjava: maybe-all-target-qthreads
+ all-target-libjava: maybe-all-target-libffi
++configure-target-libobjc: maybe-configure-target-boehm-gc
+ all-target-libobjc: maybe-all-target-libiberty
++all-target-libobjc: maybe-all-target-boehm-gc
+ all-target-libstdc++-v3: maybe-all-target-libiberty
+ all-target-libgloss: maybe-configure-target-newlib
+ all-target-winsup: maybe-all-target-libiberty
diff --git a/4.1.2/gentoo/05_all_gcc42-multilib-print-search-dirs.patch b/4.1.2/gentoo/05_all_gcc42-multilib-print-search-dirs.patch
new file mode 100644
index 0000000..f411fe1
--- /dev/null
+++ b/4.1.2/gentoo/05_all_gcc42-multilib-print-search-dirs.patch
@@ -0,0 +1,907 @@
+http://bugs.gentoo.org/145029
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20425
+http://gcc.gnu.org/ml/gcc-patches/2005-12/msg00607.html
+
+2005-12-16 Alan Modra <amodra@bigpond.net.au>
+
+ PR driver/20425
+ * gcc.c (for_each_path): New function.
+ (add_to_obstack, file_at_path): New functions.
+ (struct file_at_path_info, struct add_to_obstack_info): New.
+ (build_search_list): Rewrite using for_each_path. Constify struct
+ path_prefix pointer. Add do_multi param. Adjust all callers.
+ (find_a_file): Similarly, but just change existing param to bool.
+ (putenv_from_prefixes): Add do_multi param, make "paths" const.
+ (do_spec_path): Delete.
+ (struct spec_path_info): New.
+ (spec_path): New function.
+ (do_spec_1): Use for_each_path for %D and %I.
+ (find_file): Adjust for find_a_file changes.
+ (main): Search multilibs for specs. Print multilib lib path for
+ -print-search-dirs. Likewise add multilibs to LIBRARY_PATH_ENV.
+ (read_specs): Search multilibs for %include and %include_noerr.
+ (is_directory): Remove second string param. Change last param
+ to a bool. Don't use concat. Remove SMALL_ARG_MAX test, always
+ check path is a dir. Update all callers.
+
+Index: trunk/gcc/gcc.c
+===================================================================
+--- trunk/gcc/gcc.c (revision 108634)
++++ trunk/gcc/gcc.c (revision 108635)
+@@ -287,10 +287,12 @@ static char *load_specs (const char *);
+ static void read_specs (const char *, int);
+ static void set_spec (const char *, const char *);
+ static struct compiler *lookup_compiler (const char *, size_t, const char *);
+-static char *build_search_list (struct path_prefix *, const char *, int);
+-static void putenv_from_prefixes (struct path_prefix *, const char *);
++static char *build_search_list (const struct path_prefix *, const char *,
++ bool, bool);
++static void putenv_from_prefixes (const struct path_prefix *, const char *,
++ bool);
+ static int access_check (const char *, int);
+-static char *find_a_file (struct path_prefix *, const char *, int, int);
++static char *find_a_file (const struct path_prefix *, const char *, int, bool);
+ static void add_prefix (struct path_prefix *, const char *, const char *,
+ int, int, int);
+ static void add_sysrooted_prefix (struct path_prefix *, const char *,
+@@ -313,13 +315,12 @@ static const char *eval_spec_function (c
+ static const char *handle_spec_function (const char *);
+ static char *save_string (const char *, int);
+ static void set_collect_gcc_options (void);
+-static void do_spec_path (struct prefix_list *, const char *, int, int, int, const char *, const char *);
+ static int do_spec_1 (const char *, int, const char *);
+ static int do_spec_2 (const char *);
+ static void do_option_spec (const char *, const char *);
+ static void do_self_spec (const char *);
+ static const char *find_file (const char *);
+-static int is_directory (const char *, const char *, int);
++static int is_directory (const char *, bool);
+ static const char *validate_switches (const char *);
+ static void validate_all_switches (void);
+ static inline void validate_switches_from_spec (const char *);
+@@ -2041,7 +2042,7 @@ read_specs (const char *filename, int ma
+ (long) (p1 - buffer + 1));
+
+ p[-2] = '\0';
+- new_filename = find_a_file (&startfile_prefixes, p1, R_OK, 0);
++ new_filename = find_a_file (&startfile_prefixes, p1, R_OK, true);
+ read_specs (new_filename ? new_filename : p1, FALSE);
+ continue;
+ }
+@@ -2060,7 +2061,7 @@ read_specs (const char *filename, int ma
+ (long) (p1 - buffer + 1));
+
+ p[-2] = '\0';
+- new_filename = find_a_file (&startfile_prefixes, p1, R_OK, 0);
++ new_filename = find_a_file (&startfile_prefixes, p1, R_OK, true);
+ if (new_filename)
+ read_specs (new_filename, FALSE);
+ else if (verbose_flag)
+@@ -2357,65 +2358,214 @@ clear_failure_queue (void)
+ failure_delete_queue = 0;
+ }
+
+-/* Build a list of search directories from PATHS.
+- PREFIX is a string to prepend to the list.
+- If CHECK_DIR_P is nonzero we ensure the directory exists.
+- This is used mostly by putenv_from_prefixes so we use `collect_obstack'.
+- It is also used by the --print-search-dirs flag. */
+-
+-static char *
+-build_search_list (struct path_prefix *paths, const char *prefix,
+- int check_dir_p)
++/* Call CALLBACK for each path in PATHS, breaking out early if CALLBACK
++ returns non-NULL.
++ If DO_MULTI is true iterate over the paths twice, first with multilib
++ suffix then without, otherwise iterate over the paths once without
++ adding a multilib suffix. When DO_MULTI is true, some attempt is made
++ to avoid visiting the same path twice, but we could do better. For
++ instance, /usr/lib/../lib is considered different from /usr/lib.
++ At least EXTRA_SPACE chars past the end of the path passed to
++ CALLBACK are available for use by the callback.
++ CALLBACK_INFO allows extra parameters to be passed to CALLBACK.
++
++ Returns the value returned by CALLBACK. */
++
++static void *
++for_each_path (const struct path_prefix *paths,
++ bool do_multi,
++ size_t extra_space,
++ void *(*callback) (char *, void *),
++ void *callback_info)
+ {
+- int suffix_len = (machine_suffix) ? strlen (machine_suffix) : 0;
+- int just_suffix_len
+- = (just_machine_suffix) ? strlen (just_machine_suffix) : 0;
+- int first_time = TRUE;
+- struct prefix_list *pprefix;
+-
+- obstack_grow (&collect_obstack, prefix, strlen (prefix));
+- obstack_1grow (&collect_obstack, '=');
++ struct prefix_list *pl;
++ const char *multi_dir = NULL;
++ const char *multi_os_dir = NULL;
++ const char *multi_suffix;
++ const char *just_multi_suffix;
++ char *path = NULL;
++ void *ret = NULL;
++ bool skip_multi_dir = false;
++ bool skip_multi_os_dir = false;
++
++ multi_suffix = machine_suffix;
++ just_multi_suffix = just_machine_suffix;
++ if (do_multi && multilib_dir && strcmp (multilib_dir, ".") != 0)
++ {
++ multi_dir = concat (multilib_dir, dir_separator_str, NULL);
++ multi_suffix = concat (multi_suffix, multi_dir, NULL);
++ just_multi_suffix = concat (just_multi_suffix, multi_dir, NULL);
++ }
++ if (do_multi && multilib_os_dir && strcmp (multilib_os_dir, ".") != 0)
++ multi_os_dir = concat (multilib_os_dir, dir_separator_str, NULL);
+
+- for (pprefix = paths->plist; pprefix != 0; pprefix = pprefix->next)
++ while (1)
+ {
+- int len = strlen (pprefix->prefix);
++ size_t multi_dir_len = 0;
++ size_t multi_os_dir_len = 0;
++ size_t suffix_len;
++ size_t just_suffix_len;
++ size_t len;
++
++ if (multi_dir)
++ multi_dir_len = strlen (multi_dir);
++ if (multi_os_dir)
++ multi_os_dir_len = strlen (multi_os_dir);
++ suffix_len = strlen (multi_suffix);
++ just_suffix_len = strlen (just_multi_suffix);
++
++ if (path == NULL)
++ {
++ len = paths->max_len + extra_space + 1;
++ if (suffix_len > multi_os_dir_len)
++ len += suffix_len;
++ else
++ len += multi_os_dir_len;
++ path = xmalloc (len);
++ }
+
+- if (machine_suffix
+- && (! check_dir_p
+- || is_directory (pprefix->prefix, machine_suffix, 0)))
++ for (pl = paths->plist; pl != 0; pl = pl->next)
+ {
+- if (!first_time)
+- obstack_1grow (&collect_obstack, PATH_SEPARATOR);
++ len = strlen (pl->prefix);
++ memcpy (path, pl->prefix, len);
+
+- first_time = FALSE;
+- obstack_grow (&collect_obstack, pprefix->prefix, len);
+- obstack_grow (&collect_obstack, machine_suffix, suffix_len);
+- }
++ /* Look first in MACHINE/VERSION subdirectory. */
++ if (!skip_multi_dir)
++ {
++ memcpy (path + len, multi_suffix, suffix_len + 1);
++ ret = callback (path, callback_info);
++ if (ret)
++ break;
++ }
+
+- if (just_machine_suffix
+- && pprefix->require_machine_suffix == 2
+- && (! check_dir_p
+- || is_directory (pprefix->prefix, just_machine_suffix, 0)))
+- {
+- if (! first_time)
+- obstack_1grow (&collect_obstack, PATH_SEPARATOR);
++ /* Some paths are tried with just the machine (ie. target)
++ subdir. This is used for finding as, ld, etc. */
++ if (!skip_multi_dir
++ && pl->require_machine_suffix == 2)
++ {
++ memcpy (path + len, just_multi_suffix, just_suffix_len + 1);
++ ret = callback (path, callback_info);
++ if (ret)
++ break;
++ }
++
++ /* Now try the base path. */
++ if (!pl->require_machine_suffix
++ && !(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
++ {
++ const char *this_multi;
++ size_t this_multi_len;
++
++ if (pl->os_multilib)
++ {
++ this_multi = multi_os_dir;
++ this_multi_len = multi_os_dir_len;
++ }
++ else
++ {
++ this_multi = multi_dir;
++ this_multi_len = multi_dir_len;
++ }
+
+- first_time = FALSE;
+- obstack_grow (&collect_obstack, pprefix->prefix, len);
+- obstack_grow (&collect_obstack, just_machine_suffix,
+- just_suffix_len);
++ if (this_multi_len)
++ memcpy (path + len, this_multi, this_multi_len + 1);
++ else
++ path[len] = '\0';
++
++ ret = callback (path, callback_info);
++ if (ret)
++ break;
++ }
+ }
++ if (pl)
++ break;
+
+- if (! pprefix->require_machine_suffix)
+- {
+- if (! first_time)
+- obstack_1grow (&collect_obstack, PATH_SEPARATOR);
++ if (multi_dir == NULL && multi_os_dir == NULL)
++ break;
+
+- first_time = FALSE;
+- obstack_grow (&collect_obstack, pprefix->prefix, len);
++ /* Run through the paths again, this time without multilibs.
++ Don't repeat any we have already seen. */
++ if (multi_dir)
++ {
++ free ((char *) multi_dir);
++ multi_dir = NULL;
++ free ((char *) multi_suffix);
++ multi_suffix = machine_suffix;
++ free ((char *) just_multi_suffix);
++ just_multi_suffix = just_machine_suffix;
++ }
++ else
++ skip_multi_dir = true;
++ if (multi_os_dir)
++ {
++ free ((char *) multi_os_dir);
++ multi_os_dir = NULL;
+ }
++ else
++ skip_multi_os_dir = true;
+ }
+
++ if (multi_dir)
++ {
++ free ((char *) multi_dir);
++ free ((char *) multi_suffix);
++ free ((char *) just_multi_suffix);
++ }
++ if (multi_os_dir)
++ free ((char *) multi_os_dir);
++ if (ret != path)
++ free (path);
++ return ret;
++}
++
++/* Callback for build_search_list. Adds path to obstack being built. */
++
++struct add_to_obstack_info {
++ struct obstack *ob;
++ bool check_dir;
++ bool first_time;
++};
++
++static void *
++add_to_obstack (char *path, void *data)
++{
++ struct add_to_obstack_info *info = data;
++
++ if (info->check_dir && !is_directory (path, false))
++ return NULL;
++
++ if (!info->first_time)
++ obstack_1grow (info->ob, PATH_SEPARATOR);
++
++ obstack_grow (info->ob, path, strlen (path));
++
++ info->first_time = false;
++ return NULL;
++}
++
++/* Build a list of search directories from PATHS.
++ PREFIX is a string to prepend to the list.
++ If CHECK_DIR_P is true we ensure the directory exists.
++ If DO_MULTI is true, multilib paths are output first, then
++ non-multilib paths.
++ This is used mostly by putenv_from_prefixes so we use `collect_obstack'.
++ It is also used by the --print-search-dirs flag. */
++
++static char *
++build_search_list (const struct path_prefix *paths, const char *prefix,
++ bool check_dir, bool do_multi)
++{
++ struct add_to_obstack_info info;
++
++ info.ob = &collect_obstack;
++ info.check_dir = check_dir;
++ info.first_time = true;
++
++ obstack_grow (&collect_obstack, prefix, strlen (prefix));
++ obstack_1grow (&collect_obstack, '=');
++
++ for_each_path (paths, do_multi, 0, add_to_obstack, &info);
++
+ obstack_1grow (&collect_obstack, '\0');
+ return XOBFINISH (&collect_obstack, char *);
+ }
+@@ -2424,9 +2574,10 @@ build_search_list (struct path_prefix *p
+ for collect. */
+
+ static void
+-putenv_from_prefixes (struct path_prefix *paths, const char *env_var)
++putenv_from_prefixes (const struct path_prefix *paths, const char *env_var,
++ bool do_multi)
+ {
+- putenv (build_search_list (paths, env_var, 1));
++ putenv (build_search_list (paths, env_var, true, do_multi));
+ }
+
+ /* Check whether NAME can be accessed in MODE. This is like access,
+@@ -2447,20 +2598,53 @@ access_check (const char *name, int mode
+ return access (name, mode);
+ }
+
++/* Callback for find_a_file. Appends the file name to the directory
++ path. If the resulting file exists in the right mode, return the
++ full pathname to the file. */
++
++struct file_at_path_info {
++ const char *name;
++ const char *suffix;
++ int name_len;
++ int suffix_len;
++ int mode;
++};
++
++static void *
++file_at_path (char *path, void *data)
++{
++ struct file_at_path_info *info = data;
++ size_t len = strlen (path);
++
++ memcpy (path + len, info->name, info->name_len);
++ len += info->name_len;
++
++ /* Some systems have a suffix for executable files.
++ So try appending that first. */
++ if (info->suffix_len)
++ {
++ memcpy (path + len, info->suffix, info->suffix_len + 1);
++ if (access_check (path, info->mode) == 0)
++ return path;
++ }
++
++ path[len] = '\0';
++ if (access_check (path, info->mode) == 0)
++ return path;
++
++ return NULL;
++}
++
+ /* Search for NAME using the prefix list PREFIXES. MODE is passed to
+- access to check permissions.
++ access to check permissions. If DO_MULTI is true, search multilib
++ paths then non-multilib paths, otherwise do not search multilib paths.
+ Return 0 if not found, otherwise return its name, allocated with malloc. */
+
+ static char *
+-find_a_file (struct path_prefix *pprefix, const char *name, int mode,
+- int multilib)
++find_a_file (const struct path_prefix *pprefix, const char *name, int mode,
++ bool do_multi)
+ {
+- char *temp;
+- const char *const file_suffix =
+- ((mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : "");
+- struct prefix_list *pl;
+- int len = pprefix->max_len + strlen (name) + strlen (file_suffix) + 1;
+- const char *multilib_name, *multilib_os_name;
++ struct file_at_path_info info;
+
+ #ifdef DEFAULT_ASSEMBLER
+ if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, mode) == 0)
+@@ -2472,112 +2656,24 @@ find_a_file (struct path_prefix *pprefix
+ return xstrdup (DEFAULT_LINKER);
+ #endif
+
+- if (machine_suffix)
+- len += strlen (machine_suffix);
+-
+- multilib_name = name;
+- multilib_os_name = name;
+- if (multilib && multilib_os_dir)
+- {
+- int len1 = multilib_dir ? strlen (multilib_dir) + 1 : 0;
+- int len2 = strlen (multilib_os_dir) + 1;
+-
+- len += len1 > len2 ? len1 : len2;
+- if (multilib_dir)
+- multilib_name = ACONCAT ((multilib_dir, dir_separator_str, name,
+- NULL));
+- if (strcmp (multilib_os_dir, ".") != 0)
+- multilib_os_name = ACONCAT ((multilib_os_dir, dir_separator_str, name,
+- NULL));
+- }
+-
+- temp = xmalloc (len);
+-
+ /* Determine the filename to execute (special case for absolute paths). */
+
+ if (IS_ABSOLUTE_PATH (name))
+ {
+ if (access (name, mode) == 0)
+- {
+- strcpy (temp, name);
+- return temp;
+- }
+- }
+- else
+- for (pl = pprefix->plist; pl; pl = pl->next)
+- {
+- const char *this_name
+- = pl->os_multilib ? multilib_os_name : multilib_name;
++ return xstrdup (name);
+
+- if (machine_suffix)
+- {
+- /* Some systems have a suffix for executable files.
+- So try appending that first. */
+- if (file_suffix[0] != 0)
+- {
+- strcpy (temp, pl->prefix);
+- strcat (temp, machine_suffix);
+- strcat (temp, multilib_name);
+- strcat (temp, file_suffix);
+- if (access_check (temp, mode) == 0)
+- return temp;
+- }
+-
+- /* Now try just the multilib_name. */
+- strcpy (temp, pl->prefix);
+- strcat (temp, machine_suffix);
+- strcat (temp, multilib_name);
+- if (access_check (temp, mode) == 0)
+- return temp;
+- }
+-
+- /* Certain prefixes are tried with just the machine type,
+- not the version. This is used for finding as, ld, etc. */
+- if (just_machine_suffix && pl->require_machine_suffix == 2)
+- {
+- /* Some systems have a suffix for executable files.
+- So try appending that first. */
+- if (file_suffix[0] != 0)
+- {
+- strcpy (temp, pl->prefix);
+- strcat (temp, just_machine_suffix);
+- strcat (temp, multilib_name);
+- strcat (temp, file_suffix);
+- if (access_check (temp, mode) == 0)
+- return temp;
+- }
+-
+- strcpy (temp, pl->prefix);
+- strcat (temp, just_machine_suffix);
+- strcat (temp, multilib_name);
+- if (access_check (temp, mode) == 0)
+- return temp;
+- }
+-
+- /* Certain prefixes can't be used without the machine suffix
+- when the machine or version is explicitly specified. */
+- if (! pl->require_machine_suffix)
+- {
+- /* Some systems have a suffix for executable files.
+- So try appending that first. */
+- if (file_suffix[0] != 0)
+- {
+- strcpy (temp, pl->prefix);
+- strcat (temp, this_name);
+- strcat (temp, file_suffix);
+- if (access_check (temp, mode) == 0)
+- return temp;
+- }
++ return NULL;
++ }
+
+- strcpy (temp, pl->prefix);
+- strcat (temp, this_name);
+- if (access_check (temp, mode) == 0)
+- return temp;
+- }
+- }
++ info.name = name;
++ info.suffix = (mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : "";
++ info.name_len = strlen (info.name);
++ info.suffix_len = strlen (info.suffix);
++ info.mode = mode;
+
+- free (temp);
+- return 0;
++ return for_each_path (pprefix, do_multi, info.name_len + info.suffix_len,
++ file_at_path, &info);
+ }
+
+ /* Ranking of prefixes in the sort list. -B prefixes are put before
+@@ -2696,7 +2792,7 @@ execute (void)
+
+ commands[0].prog = argbuf[0]; /* first command. */
+ commands[0].argv = &argbuf[0];
+- string = find_a_file (&exec_prefixes, commands[0].prog, X_OK, 0);
++ string = find_a_file (&exec_prefixes, commands[0].prog, X_OK, false);
+
+ if (string)
+ commands[0].argv[0] = string;
+@@ -2711,7 +2807,7 @@ execute (void)
+ commands[n_commands].prog = argbuf[i + 1];
+ commands[n_commands].argv = &argbuf[i + 1];
+ string = find_a_file (&exec_prefixes, commands[n_commands].prog,
+- X_OK, 0);
++ X_OK, false);
+ if (string)
+ commands[n_commands].argv[0] = string;
+ n_commands++;
+@@ -3649,7 +3745,7 @@ warranty; not even for MERCHANTABILITY o
+ if appending a directory separator actually makes a
+ valid directory name. */
+ if (! IS_DIR_SEPARATOR (value [len - 1])
+- && is_directory (value, "", 0))
++ && is_directory (value, false))
+ {
+ char *tmp = xmalloc (len + 2);
+ strcpy (tmp, value);
+@@ -4397,108 +4493,55 @@ do_self_spec (const char *spec)
+ }
+ }
+
+-void
+-do_spec_path (struct prefix_list *pl, const char *option,
+- int omit_if_relative, int separate_options,
+- int only_subdir,
+- const char *dir_for_machine_suffix,
+- const char *dir_for_no_suffix)
+-{
+- static size_t bufsize = 0;
+- static char *buffer;
+- int idx;
+- bool multilib_p = false;
+-
+- /* Used on systems which record the specified -L dirs
+- and use them to search for dynamic linking. */
+- /* Relative directories always come from -B,
+- and it is better not to use them for searching
+- at run time. In particular, stage1 loses. */
+- if (omit_if_relative
+- && !IS_ABSOLUTE_PATH (pl->prefix))
+- return;
++/* Callback for processing %D and %I specs. */
+
+- /* Try subdirectory if there is one. */
+- if (machine_suffix && dir_for_machine_suffix)
+- {
+- if (strlen (pl->prefix) + strlen (machine_suffix)
+- >= bufsize)
+- bufsize = (strlen (pl->prefix)
+- + strlen (machine_suffix)) * 2 + 1;
+- buffer = xrealloc (buffer, bufsize);
+- strcpy (buffer, pl->prefix);
+- strcat (buffer, machine_suffix);
+- if (is_directory (buffer, dir_for_machine_suffix, 1))
+- {
+- multilib_p = true;
+- do_spec_1 (option, separate_options, NULL);
+- if (separate_options)
+- do_spec_1 (" ", 0, NULL);
+- do_spec_1 (buffer, 1, NULL);
+- do_spec_1 (dir_for_machine_suffix, 1, NULL);
+- /* Make this a separate argument. */
+- do_spec_1 (" ", 0, NULL);
+- }
+- }
+- if (!pl->require_machine_suffix && dir_for_no_suffix)
++struct spec_path_info {
++ const char *option;
++ const char *append;
++ size_t append_len;
++ bool omit_relative;
++ bool separate_options;
++};
++
++static void *
++spec_path (char *path, void *data)
++{
++ struct spec_path_info *info = data;
++ size_t len = 0;
++ char save = 0;
++
++ if (info->omit_relative && !IS_ABSOLUTE_PATH (path))
++ return NULL;
++
++ if (info->append_len != 0)
+ {
+- if (is_directory (pl->prefix, dir_for_no_suffix, 1))
+- {
+- multilib_p = true;
+- do_spec_1 (option, separate_options, NULL);
+- if (separate_options)
+- do_spec_1 (" ", 0, NULL);
+- do_spec_1 (pl->prefix, 1, NULL);
+- do_spec_1 (dir_for_no_suffix, 1, NULL);
+- /* Make this a separate argument. */
+- do_spec_1 (" ", 0, NULL);
+- }
++ len = strlen (path);
++ memcpy (path + len, info->append, info->append_len + 1);
+ }
+
+- if (only_subdir || multilib_p)
+- return;
++ if (!is_directory (path, true))
++ return NULL;
++
++ do_spec_1 (info->option, 1, NULL);
++ if (info->separate_options)
++ do_spec_1 (" ", 0, NULL);
+
+- if (machine_suffix)
++ if (info->append_len == 0)
+ {
+- if (is_directory (pl->prefix, machine_suffix, 1))
+- {
+- do_spec_1 (option, separate_options, NULL);
+- if (separate_options)
+- do_spec_1 (" ", 0, NULL);
+- do_spec_1 (pl->prefix, 1, NULL);
+- /* Remove slash from machine_suffix. */
+- if (strlen (machine_suffix) >= bufsize)
+- bufsize = strlen (machine_suffix) * 2 + 1;
+- buffer = xrealloc (buffer, bufsize);
+- strcpy (buffer, machine_suffix);
+- idx = strlen (buffer);
+- if (IS_DIR_SEPARATOR (buffer[idx - 1]))
+- buffer[idx - 1] = 0;
+- do_spec_1 (buffer, 1, NULL);
+- /* Make this a separate argument. */
+- do_spec_1 (" ", 0, NULL);
+- }
+- }
+- if (!pl->require_machine_suffix)
+- {
+- if (is_directory (pl->prefix, "", 1))
+- {
+- do_spec_1 (option, separate_options, NULL);
+- if (separate_options)
+- do_spec_1 (" ", 0, NULL);
+- /* Remove slash from pl->prefix. */
+- if (strlen (pl->prefix) >= bufsize)
+- bufsize = strlen (pl->prefix) * 2 + 1;
+- buffer = xrealloc (buffer, bufsize);
+- strcpy (buffer, pl->prefix);
+- idx = strlen (buffer);
+- if (IS_DIR_SEPARATOR (buffer[idx - 1]))
+- buffer[idx - 1] = 0;
+- do_spec_1 (buffer, 1, NULL);
+- /* Make this a separate argument. */
+- do_spec_1 (" ", 0, NULL);
+- }
++ len = strlen (path);
++ save = path[len - 1];
++ if (IS_DIR_SEPARATOR (path[len - 1]))
++ path[len - 1] = '\0';
+ }
++
++ do_spec_1 (path, 1, NULL);
++ do_spec_1 (" ", 0, NULL);
++
++ /* Must not damage the original path. */
++ if (info->append_len == 0)
++ path[len - 1] = save;
++
++ return NULL;
+ }
+
+ /* Process the sub-spec SPEC as a portion of a larger spec.
+@@ -4636,23 +4679,23 @@ do_spec_1 (const char *spec, int inswitc
+ that we search for startfiles. */
+ case 'D':
+ {
+- struct prefix_list *pl = startfile_prefixes.plist;
+-
+- for (; pl; pl = pl->next)
+- {
+- const char *no_suffix_multilib_dir;
++ struct spec_path_info info;
+
+- no_suffix_multilib_dir = pl->os_multilib ? multilib_os_dir
+- : multilib_dir;
+- /* Do not separate options, include non-multilibbed variant. */
+- do_spec_path (pl, "-L",
++ info.option = "-L";
++ info.append_len = 0;
+ #ifdef RELATIVE_PREFIX_NOT_LINKDIR
+- 1,
++ /* Used on systems which record the specified -L dirs
++ and use them to search for dynamic linking.
++ Relative directories always come from -B,
++ and it is better not to use them for searching
++ at run time. In particular, stage1 loses. */
++ info.omit_relative = true;
+ #else
+- 0,
++ info.omit_relative = false;
+ #endif
+- 0, 0, multilib_dir, no_suffix_multilib_dir);
+- }
++ info.separate_options = false;
++
++ for_each_path (&startfile_prefixes, true, 0, spec_path, &info);
+ }
+ break;
+
+@@ -4889,7 +4932,7 @@ do_spec_1 (const char *spec, int inswitc
+
+ case 'I':
+ {
+- struct prefix_list *pl = include_prefixes.plist;
++ struct spec_path_info info;
+
+ if (gcc_exec_prefix)
+ {
+@@ -4912,9 +4955,14 @@ do_spec_1 (const char *spec, int inswitc
+ do_spec_1 (" ", 0, NULL);
+ }
+
+- for (; pl; pl = pl->next)
+- /* Separate options, don't include non-suffixed variant. */
+- do_spec_path (pl, "-isystem", 0, 1, 1, "include", "include");
++ info.option = "-isystem";
++ info.append = "include";
++ info.append_len = strlen (info.append);
++ info.omit_relative = false;
++ info.separate_options = true;
++
++ for_each_path (&include_prefixes, false, info.append_len,
++ spec_path, &info);
+ }
+ break;
+
+@@ -5900,48 +5948,27 @@ give_switch (int switchnum, int omit_fir
+ static const char *
+ find_file (const char *name)
+ {
+- char *newname;
+-
+- /* Try multilib_dir if it is defined. */
+- if (multilib_os_dir != NULL)
+- {
+- newname = find_a_file (&startfile_prefixes, name, R_OK, 1);
+-
+- /* If we don't find it in the multi library dir, then fall
+- through and look for it in the normal places. */
+- if (newname != NULL)
+- return newname;
+- }
+-
+- newname = find_a_file (&startfile_prefixes, name, R_OK, 0);
++ char *newname = find_a_file (&startfile_prefixes, name, R_OK, true);
+ return newname ? newname : name;
+ }
+
+ /* Determine whether a directory exists. If LINKER, return 0 for
+- certain fixed names not needed by the linker. If not LINKER, it is
+- only important to return 0 if the host machine has a small ARG_MAX
+- limit. */
++ certain fixed names not needed by the linker. */
+
+ static int
+-is_directory (const char *path1, const char *path2, int linker)
++is_directory (const char *path1, bool linker)
+ {
+- int len1 = strlen (path1);
+- int len2 = strlen (path2);
+- char *path = alloca (3 + len1 + len2);
++ int len1;
++ char *path;
+ char *cp;
+ struct stat st;
+
+-#ifndef SMALL_ARG_MAX
+- if (! linker)
+- return 1;
+-#endif
+-
+- /* Construct the path from the two parts. Ensure the string ends with "/.".
+- The resulting path will be a directory even if the given path is a
+- symbolic link. */
++ /* Ensure the string ends with "/.". The resulting path will be a
++ directory even if the given path is a symbolic link. */
++ len1 = strlen (path1);
++ path = alloca (3 + len1);
+ memcpy (path, path1, len1);
+- memcpy (path + len1, path2, len2);
+- cp = path + len1 + len2;
++ cp = path + len1;
+ if (!IS_DIR_SEPARATOR (cp[-1]))
+ *cp++ = DIR_SEPARATOR;
+ *cp++ = '.';
+@@ -5949,13 +5976,13 @@ is_directory (const char *path1, const c
+
+ /* Exclude directories that the linker is known to search. */
+ if (linker
++ && IS_DIR_SEPARATOR (path[0])
+ && ((cp - path == 6
+- && strcmp (path, concat (dir_separator_str, "lib",
+- dir_separator_str, ".", NULL)) == 0)
++ && strncmp (path + 1, "lib", 3) == 0)
+ || (cp - path == 10
+- && strcmp (path, concat (dir_separator_str, "usr",
+- dir_separator_str, "lib",
+- dir_separator_str, ".", NULL)) == 0)))
++ && strncmp (path + 1, "usr", 3) == 0
++ && IS_DIR_SEPARATOR (path[4])
++ && strncmp (path + 5, "lib", 3) == 0)))
+ return 0;
+
+ return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode));
+@@ -6147,7 +6174,7 @@ main (int argc, char **argv)
+ spec_version, dir_separator_str, NULL);
+ just_machine_suffix = concat (spec_machine, dir_separator_str, NULL);
+
+- specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, 0);
++ specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, true);
+ /* Read the specs file unless it is a default one. */
+ if (specs_file != 0 && strcmp (specs_file, "specs"))
+ read_specs (specs_file, TRUE);
+@@ -6283,7 +6310,7 @@ main (int argc, char **argv)
+ for (uptr = user_specs_head; uptr; uptr = uptr->next)
+ {
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
+- R_OK, 0);
++ R_OK, true);
+ read_specs (filename ? filename : uptr->filename, FALSE);
+ }
+
+@@ -6312,8 +6339,10 @@ main (int argc, char **argv)
+ if (print_search_dirs)
+ {
+ printf (_("install: %s%s\n"), standard_exec_prefix, machine_suffix);
+- printf (_("programs: %s\n"), build_search_list (&exec_prefixes, "", 0));
+- printf (_("libraries: %s\n"), build_search_list (&startfile_prefixes, "", 0));
++ printf (_("programs: %s\n"),
++ build_search_list (&exec_prefixes, "", false, false));
++ printf (_("libraries: %s\n"),
++ build_search_list (&startfile_prefixes, "", false, true));
+ return (0);
+ }
+
+@@ -6630,14 +6659,14 @@ main (int argc, char **argv)
+ /* We'll use ld if we can't find collect2. */
+ if (! strcmp (linker_name_spec, "collect2"))
+ {
+- char *s = find_a_file (&exec_prefixes, "collect2", X_OK, 0);
++ char *s = find_a_file (&exec_prefixes, "collect2", X_OK, false);
+ if (s == NULL)
+ linker_name_spec = "ld";
+ }
+ /* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
+ for collect. */
+- putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH");
+- putenv_from_prefixes (&startfile_prefixes, LIBRARY_PATH_ENV);
++ putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH", false);
++ putenv_from_prefixes (&startfile_prefixes, LIBRARY_PATH_ENV, true);
+
+ value = do_spec (link_command_spec);
+ if (value < 0)
diff --git a/4.1.2/gentoo/06_all_gcc4-slow-pthread-self.patch b/4.1.2/gentoo/06_all_gcc4-slow-pthread-self.patch
new file mode 100644
index 0000000..f8f5012
--- /dev/null
+++ b/4.1.2/gentoo/06_all_gcc4-slow-pthread-self.patch
@@ -0,0 +1,15 @@
+2005-05-20 Jakub Jelinek <jakub@redhat.com>
+
+ * configure.host (slow_pthread_self): Set to empty unconditionally
+ on Linux targets.
+
+--- libjava/configure.host 2005-03-15 18:05:24.000000000 +0100
++++ libjava/configure.host 2005-05-20 07:47:13.000000000 +0200
+@@ -174,6 +174,7 @@ case "${host}" in
+ sh-linux* | sh[34]*-linux*)
+ can_unwind_signal=yes
+ libgcj_ld_symbolic='-Wl,-Bsymbolic'
++ slow_pthread_self=
+ if test x$slow_pthread_self = xyes \
+ && test x$cross_compiling != xyes; then
+ cat > conftest.c <<EOF
diff --git a/4.1.2/gentoo/10_all_gcc4-libltdl-multilib.patch b/4.1.2/gentoo/10_all_gcc4-libltdl-multilib.patch
new file mode 100644
index 0000000..7b94f57
--- /dev/null
+++ b/4.1.2/gentoo/10_all_gcc4-libltdl-multilib.patch
@@ -0,0 +1,191 @@
+2005-06-17 Jakub Jelinek <jakub@redhat.com>
+
+ * acinclude.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER): Set
+ sys_lib_dlsearch_path_spec on bi-arch linux architectures
+ for 64-bit builds.
+ * configure: Rebuilt.
+
+--- libjava/libltdl/acinclude.m4.jj 2005-03-11 14:02:06.000000000 +0100
++++ libjava/libltdl/acinclude.m4 2005-06-17 14:37:06.000000000 +0200
+@@ -1434,6 +1434,24 @@ linux*)
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
++
++ # Find out which ABI we are using.
++ case "$host_cpu" in
++ x86_64*|s390*|sparc*|ppc*|powerpc*)
++ AC_LANG_PUSH(C)
++ lt_linux_biarch_save_CC="$CC"
++ CC="${LTCC-$CC}"
++ echo 'int i;' > conftest.$ac_ext
++ if AC_TRY_EVAL(ac_compile); then
++ case "`/usr/bin/file conftest.o`" in
++ *64-bit*) sys_lib_dlsearch_path_spec="/lib64 /usr/lib64";;
++ esac
++ fi
++ rm -rf conftest*
++ CC="$lt_linux_biarch_save_CC"
++ AC_LANG_POP
++ ;;
++ esac
+ ;;
+
+ netbsd*)
+--- libjava/libltdl/configure.jj 2005-03-11 14:02:07.000000000 +0100
++++ libjava/libltdl/configure 2005-06-17 14:37:11.000000000 +0200
+@@ -8421,6 +8421,38 @@ linux*)
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
++
++ # Find out which ABI we are using.
++ case "$host_cpu" in
++ x86_64*|s390*|sparc*|ppc*|powerpc*)
++ ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++ lt_linux_biarch_save_CC="$CC"
++ CC="${LTCC-$CC}"
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ case "`/usr/bin/file conftest.o`" in
++ *64-bit*) sys_lib_dlsearch_path_spec="/lib64 /usr/lib64";;
++ esac
++ fi
++ rm -rf conftest*
++ CC="$lt_linux_biarch_save_CC"
++ ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++ ;;
++ esac
+ ;;
+
+ netbsd*)
+@@ -12071,6 +12103,38 @@ linux*)
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
++
++ # Find out which ABI we are using.
++ case "$host_cpu" in
++ x86_64*|s390*|sparc*|ppc*|powerpc*)
++ ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++ lt_linux_biarch_save_CC="$CC"
++ CC="${LTCC-$CC}"
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ case "`/usr/bin/file conftest.o`" in
++ *64-bit*) sys_lib_dlsearch_path_spec="/lib64 /usr/lib64";;
++ esac
++ fi
++ rm -rf conftest*
++ CC="$lt_linux_biarch_save_CC"
++ ac_ext=cc
++ac_cpp='$CXXCPP $CPPFLAGS'
++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
++
++ ;;
++ esac
+ ;;
+
+ netbsd*)
+@@ -15156,6 +15220,37 @@ linux*)
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
++
++ # Find out which ABI we are using.
++ case "$host_cpu" in
++ x86_64*|s390*|sparc*|ppc*|powerpc*)
++ ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++ lt_linux_biarch_save_CC="$CC"
++ CC="${LTCC-$CC}"
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ case "`/usr/bin/file conftest.o`" in
++ *64-bit*) sys_lib_dlsearch_path_spec="/lib64 /usr/lib64";;
++ esac
++ fi
++ rm -rf conftest*
++ CC="$lt_linux_biarch_save_CC"
++ ac_ext=f
++ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
++ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_f77_compiler_gnu
++
++ ;;
++ esac
+ ;;
+
+ netbsd*)
+@@ -17441,6 +17536,38 @@ linux*)
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
++
++ # Find out which ABI we are using.
++ case "$host_cpu" in
++ x86_64*|s390*|sparc*|ppc*|powerpc*)
++ ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++ lt_linux_biarch_save_CC="$CC"
++ CC="${LTCC-$CC}"
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ case "`/usr/bin/file conftest.o`" in
++ *64-bit*) sys_lib_dlsearch_path_spec="/lib64 /usr/lib64";;
++ esac
++ fi
++ rm -rf conftest*
++ CC="$lt_linux_biarch_save_CC"
++ ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++ ;;
++ esac
+ ;;
+
+ netbsd*)
diff --git a/4.1.2/gentoo/11_all_gcc-netbsd-symbolic.patch b/4.1.2/gentoo/11_all_gcc-netbsd-symbolic.patch
new file mode 100644
index 0000000..3b86491
--- /dev/null
+++ b/4.1.2/gentoo/11_all_gcc-netbsd-symbolic.patch
@@ -0,0 +1,12 @@
+http://bugs.gentoo.org/122698
+
+--- gcc/config/netbsd-elf.h
++++ gcc/config/netbsd-elf.h
+@@ -83,6 +83,7 @@
+ #define NETBSD_LINK_SPEC_ELF \
+ "%{assert*} %{R*} %{rpath*} \
+ %{shared:-shared} \
++ %{symbolic:-Bsymbolic} \
+ %{!shared: \
+ -dc -dp \
+ %{!nostdlib: \
diff --git a/4.1.2/gentoo/13_all_gcc4-libjava-ia64-backtrace.patch b/4.1.2/gentoo/13_all_gcc4-libjava-ia64-backtrace.patch
new file mode 100644
index 0000000..0315b43
--- /dev/null
+++ b/4.1.2/gentoo/13_all_gcc4-libjava-ia64-backtrace.patch
@@ -0,0 +1,29 @@
+2005-07-14 Jakub Jelinek <jakub@redhat.com>
+
+ * configure.ac (HAVE_BACKTRACE): Define even on ia64.
+ * configure: Rebuilt.
+
+--- libjava/configure.ac.jj 2005-04-12 22:28:45.000000000 +0200
++++ libjava/configure.ac 2005-07-14 18:09:23.000000000 +0200
+@@ -769,9 +769,6 @@ else
+ AC_CHECK_HEADERS(execinfo.h unistd.h dlfcn.h)
+ AC_CHECK_FUNC(backtrace, [
+ case "$host" in
+- ia64-*-linux*)
+- # Has broken backtrace()
+- ;;
+ mips*-*-linux*)
+ # Has broken backtrace(), but we supply our own.
+ if test -d sysdep; then true; else mkdir -p sysdep; fi
+--- libjava/configure.jj 2005-04-12 22:28:34.000000000 +0200
++++ libjava/configure 2005-07-14 18:11:07.000000000 +0200
+@@ -9303,9 +9303,6 @@ echo "${ECHO_T}$ac_cv_func_backtrace" >&
+ if test $ac_cv_func_backtrace = yes; then
+
+ case "$host" in
+- ia64-*-linux*)
+- # Has broken backtrace()
+- ;;
+ mips*-*-linux*)
+ # Has broken backtrace(), but we supply our own.
+ if test -d sysdep; then true; else mkdir -p sysdep; fi
diff --git a/4.1.2/gentoo/15_all_gcc42-builtin-frame-address.patch b/4.1.2/gentoo/15_all_gcc42-builtin-frame-address.patch
new file mode 100644
index 0000000..bbfd17c
--- /dev/null
+++ b/4.1.2/gentoo/15_all_gcc42-builtin-frame-address.patch
@@ -0,0 +1,34 @@
+http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00357.html
+
+2006-06-12 Mark Shinwell <shinwell@codesourcery.com>
+
+ * builtins.c (expand_builtin_return_addr): Only use
+ frame_pointer_rtx when count == 0 and we are expanding
+ __builtin_return_address.
+
+Index: trunk/gcc/builtins.c
+===================================================================
+--- trunk/gcc/builtins.c (revision 114566)
++++ trunk/gcc/builtins.c (revision 114567)
+@@ -509,12 +509,16 @@ expand_builtin_return_addr (enum built_i
+ #else
+ rtx tem;
+
+- /* For a zero count, we don't care what frame address we return, so frame
+- pointer elimination is OK, and using the soft frame pointer is OK.
+- For a non-zero count, we require a stable offset from the current frame
+- pointer to the previous one, so we must use the hard frame pointer, and
++ /* For a zero count with __builtin_return_address, we don't care what
++ frame address we return, because target-specific definitions will
++ override us. Therefore frame pointer elimination is OK, and using
++ the soft frame pointer is OK.
++
++ For a non-zero count, or a zero count with __builtin_frame_address,
++ we require a stable offset from the current frame pointer to the
++ previous one, so we must use the hard frame pointer, and
+ we must disable frame pointer elimination. */
+- if (count == 0)
++ if (count == 0 && fndecl_code == BUILT_IN_RETURN_ADDRESS)
+ tem = frame_pointer_rtx;
+ else
+ {
diff --git a/4.1.2/gentoo/20_all_cris-dont-force-limits-header.patch b/4.1.2/gentoo/20_all_cris-dont-force-limits-header.patch
new file mode 100644
index 0000000..e695c98
--- /dev/null
+++ b/4.1.2/gentoo/20_all_cris-dont-force-limits-header.patch
@@ -0,0 +1,11 @@
+Remove assumption since it breaks building --without-headers
+
+--- gcc-4_1-branch/gcc/config/cris/t-linux
++++ gcc-4_1-branch/gcc/config/cris/t-linux
+@@ -1,6 +1,2 @@
+ TARGET_LIBGCC2_CFLAGS += -fPIC
+ CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
+-
+-# We *know* we have a limits.h in the glibc library, with extra
+-# definitions needed for e.g. libgfortran.
+-LIMITS_H_TEST = :
diff --git a/4.1.2/gentoo/29_all_gcc4-pr19664.patch b/4.1.2/gentoo/29_all_gcc4-pr19664.patch
new file mode 100644
index 0000000..cc3c079
--- /dev/null
+++ b/4.1.2/gentoo/29_all_gcc4-pr19664.patch
@@ -0,0 +1,1717 @@
+--- libstdc++-v3/include/ext/algorithm.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/algorithm 2005-11-03 10:28:32.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Algorithm extensions -*- C++ -*-
+
+-// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -62,6 +62,7 @@
+ #define _EXT_ALGORITHM 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <algorithm>
+
+@@ -523,4 +524,6 @@
+ }
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif /* _EXT_ALGORITHM */
+--- libstdc++-v3/include/ext/array_allocator.h.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/array_allocator.h 2005-11-03 10:28:32.000000000 +0100
+@@ -34,6 +34,8 @@
+ #ifndef _ARRAY_ALLOCATOR_H
+ #define _ARRAY_ALLOCATOR_H 1
+
++#pragma GCC visibility push(default)
++
+ #include <cstddef>
+ #include <new>
+ #include <bits/functexcept.h>
+@@ -142,4 +144,6 @@
+ { return false; }
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/bitmap_allocator.h.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/bitmap_allocator.h 2005-11-03 10:28:32.000000000 +0100
+@@ -34,6 +34,8 @@
+ #ifndef _BITMAP_ALLOCATOR_H
+ #define _BITMAP_ALLOCATOR_H 1
+
++#pragma GCC visibility push(default)
++
+ // For std::size_t, and ptrdiff_t.
+ #include <cstddef>
+
+@@ -1289,6 +1291,8 @@
+
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+
+ // LocalWords: namespace GTHREADS bool const gthread endif Mutex mutex
+--- libstdc++-v3/include/ext/debug_allocator.h.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/debug_allocator.h 2005-11-03 10:28:32.000000000 +0100
+@@ -48,6 +48,8 @@
+ #ifndef _DEBUG_ALLOCATOR_H
+ #define _DEBUG_ALLOCATOR_H 1
+
++#pragma GCC visibility push(default)
++
+ #include <stdexcept>
+
+ namespace __gnu_cxx
+@@ -122,4 +124,6 @@
+ };
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/functional.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/functional 2005-11-03 10:28:32.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Functional extensions -*- C++ -*-
+
+-// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -62,6 +62,7 @@
+ #define _EXT_FUNCTIONAL 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <functional>
+
+@@ -421,5 +422,8 @@
+ mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
+ { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+ } // namespace __gnu_cxx
++
++#pragma GCC visibility pop
++
+ #endif
+
+--- libstdc++-v3/include/ext/hash_map.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/hash_map 2005-11-03 10:30:29.000000000 +0100
+@@ -61,6 +61,8 @@
+ #ifndef _HASH_MAP
+ #define _HASH_MAP 1
+
++#pragma GCC visibility push(default)
++
+ #include <ext/hashtable.h>
+ #include <bits/concept_check.h>
+
+@@ -622,4 +624,6 @@
+ # include <debug/hash_map>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/hash_set.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/hash_set 2005-11-03 10:30:57.000000000 +0100
+@@ -61,6 +61,8 @@
+ #ifndef _HASH_SET
+ #define _HASH_SET 1
+
++#pragma GCC visibility push(default)
++
+ #include <ext/hashtable.h>
+ #include <bits/concept_check.h>
+
+@@ -588,4 +590,6 @@
+ # include <debug/hash_set>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/iterator.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/iterator 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // HP/SGI iterator extensions -*- C++ -*-
+
+-// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -62,6 +62,7 @@
+ #define _EXT_ITERATOR 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/concept_check.h>
+ #include <iterator>
+@@ -113,5 +114,7 @@
+ }
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+
+--- libstdc++-v3/include/ext/malloc_allocator.h.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/malloc_allocator.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,7 @@
+ // Allocator that wraps "C" malloc -*- C++ -*-
+
+-// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2003, 2004, 2005
++// Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -34,6 +35,8 @@
+ #ifndef _MALLOC_ALLOCATOR_H
+ #define _MALLOC_ALLOCATOR_H 1
+
++#pragma GCC visibility push(default)
++
+ #include <cstdlib>
+ #include <new>
+ #include <bits/functexcept.h>
+@@ -122,4 +125,6 @@
+ { return false; }
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/memory.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/memory 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Memory extensions -*- C++ -*-
+
+-// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -62,6 +62,7 @@
+ #define _EXT_MEMORY 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <memory>
+ #include <bits/stl_tempbuf.h>
+@@ -194,5 +195,7 @@
+ };
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+
+--- libstdc++-v3/include/ext/mt_allocator.h.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/mt_allocator.h 2005-11-03 10:28:34.000000000 +0100
+@@ -34,6 +34,8 @@
+ #ifndef _MT_ALLOCATOR_H
+ #define _MT_ALLOCATOR_H 1
+
++#pragma GCC visibility push(default)
++
+ #include <new>
+ #include <cstdlib>
+ #include <bits/functexcept.h>
+@@ -731,4 +733,6 @@
+ #undef __thread_default
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/new_allocator.h.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/new_allocator.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Allocator that wraps operator new -*- C++ -*-
+
+-// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -34,6 +34,8 @@
+ #ifndef _NEW_ALLOCATOR_H
+ #define _NEW_ALLOCATOR_H 1
+
++#pragma GCC visibility push(default)
++
+ #include <new>
+ #include <bits/functexcept.h>
+
+@@ -118,4 +120,6 @@
+ { return false; }
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/numeric.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/numeric 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Numeric extensions -*- C++ -*-
+
+-// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -62,6 +62,7 @@
+ #define _EXT_NUMERIC 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/concept_check.h>
+ #include <numeric>
+@@ -146,5 +147,7 @@
+ }
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+
+--- libstdc++-v3/include/ext/pod_char_traits.h.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/pod_char_traits.h 2005-11-03 10:28:34.000000000 +0100
+@@ -37,6 +37,8 @@
+ #ifndef _POD_CHAR_TRAITS_H
+ #define _POD_CHAR_TRAITS_H 1
+
++#pragma GCC visibility push(default)
++
+ #include <string>
+
+ namespace __gnu_cxx
+@@ -182,4 +184,6 @@
+ };
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/pool_allocator.h.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/pool_allocator.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Allocators -*- C++ -*-
+
+-// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -47,6 +47,8 @@
+ #ifndef _POOL_ALLOCATOR_H
+ #define _POOL_ALLOCATOR_H 1
+
++#pragma GCC visibility push(default)
++
+ #include <bits/c++config.h>
+ #include <cstdlib>
+ #include <new>
+@@ -252,4 +254,6 @@
+ }
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/rb_tree.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/rb_tree 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // rb_tree extension -*- C++ -*-
+
+-// Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -62,6 +62,7 @@
+ #define _RB_TREE 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/stl_tree.h>
+
+@@ -94,4 +95,6 @@
+ };
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/rope.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/rope 2005-11-03 10:28:34.000000000 +0100
+@@ -48,6 +48,8 @@
+ #ifndef _ROPE
+ #define _ROPE 1
+
++#pragma GCC visibility push(default)
++
+ #include <bits/stl_algobase.h>
+ #include <bits/stl_construct.h>
+ #include <bits/stl_uninitialized.h>
+@@ -2898,4 +2900,6 @@
+
+ # include <ext/ropeimpl.h>
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/slist.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/slist 2005-11-03 10:28:34.000000000 +0100
+@@ -49,6 +49,8 @@
+ #ifndef _SLIST
+ #define _SLIST 1
+
++#pragma GCC visibility push(default)
++
+ #include <bits/stl_algobase.h>
+ #include <bits/allocator.h>
+ #include <bits/stl_construct.h>
+@@ -1076,4 +1078,7 @@
+ };
+
+ } // namespace std
++
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/stdio_filebuf.h.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/stdio_filebuf.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // File descriptor layer for filebuf -*- C++ -*-
+
+-// Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -35,6 +35,7 @@
+ #define _STDIO_FILEBUF_H 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <fstream>
+
+@@ -158,4 +159,6 @@
+ }
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/ext/stdio_sync_filebuf.h.vis1~ 2005-10-31 21:15:57.000000000 +0100
++++ libstdc++-v3/include/ext/stdio_sync_filebuf.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Iostreams wrapper for stdio FILE* -*- C++ -*-
+
+-// Copyright (C) 2003, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -35,6 +35,7 @@
+ #define _STDIO_SYNC_FILEBUF_H 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <streambuf>
+ #include <unistd.h>
+@@ -279,4 +280,6 @@
+ #endif
+ } // namespace __gnu_cxx
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/debug/bitset.vis1~ 2005-10-31 21:16:05.000000000 +0100
++++ libstdc++-v3/include/debug/bitset 2005-11-03 10:27:12.000000000 +0100
+@@ -31,6 +31,8 @@
+ #ifndef _GLIBCXX_DEBUG_BITSET
+ #define _GLIBCXX_DEBUG_BITSET
+
++#pragma GCC visibility push(default)
++
+ #include <bitset>
+ #include <debug/safe_sequence.h>
+ #include <debug/safe_iterator.h>
+@@ -318,4 +320,6 @@
+ { return __os << __x._M_base(); }
+ } // namespace __gnu_debug_def
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/debug/deque.vis1~ 2005-10-31 21:16:05.000000000 +0100
++++ libstdc++-v3/include/debug/deque 2005-11-03 10:28:26.000000000 +0100
+@@ -31,6 +31,8 @@
+ #ifndef _GLIBCXX_DEBUG_DEQUE
+ #define _GLIBCXX_DEBUG_DEQUE 1
+
++#pragma GCC visibility push(default)
++
+ #include <deque>
+ #include <debug/safe_sequence.h>
+ #include <debug/safe_iterator.h>
+@@ -383,4 +385,6 @@
+ { __lhs.swap(__rhs); }
+ } // namespace __gnu_debug_def
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/debug/hash_map.vis1~ 2005-10-31 21:16:05.000000000 +0100
++++ libstdc++-v3/include/debug/hash_map 2005-11-03 10:31:55.000000000 +0100
+@@ -31,8 +31,12 @@
+ #ifndef _GLIBCXX_DEBUG_HASH_MAP
+ #define _GLIBCXX_DEBUG_HASH_MAP 1
+
++#pragma GCC visibility push(default)
++
+ #include <ext/hash_map>
+ #include <debug/hash_map.h>
+ #include <debug/hash_multimap.h>
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/debug/hash_set.vis1~ 2005-10-31 21:16:05.000000000 +0100
++++ libstdc++-v3/include/debug/hash_set 2005-11-03 10:32:22.000000000 +0100
+@@ -31,8 +31,12 @@
+ #ifndef _GLIBCXX_DEBUG_HASH_SET
+ #define _GLIBCXX_DEBUG_HASH_SET 1
+
++#pragma GCC visibility push(default)
++
+ #include <ext/hash_set>
+ #include <debug/hash_set.h>
+ #include <debug/hash_multiset.h>
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/debug/list.vis1~ 2005-10-31 21:16:05.000000000 +0100
++++ libstdc++-v3/include/debug/list 2005-11-03 10:28:28.000000000 +0100
+@@ -31,6 +31,8 @@
+ #ifndef _GLIBCXX_DEBUG_LIST
+ #define _GLIBCXX_DEBUG_LIST 1
+
++#pragma GCC visibility push(default)
++
+ #include <list>
+ #include <bits/stl_algo.h>
+ #include <debug/safe_sequence.h>
+@@ -502,4 +504,6 @@
+ { __lhs.swap(__rhs); }
+ } // namespace __gnu_debug_def
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/debug/map.vis1~ 2005-10-31 21:16:05.000000000 +0100
++++ libstdc++-v3/include/debug/map 2005-11-03 10:28:28.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Debugging map/multimap implementation -*- C++ -*-
+
+-// Copyright (C) 2003
++// Copyright (C) 2003, 2005
+ // Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+@@ -31,8 +31,12 @@
+ #ifndef _GLIBCXX_DEBUG_MAP
+ #define _GLIBCXX_DEBUG_MAP 1
+
++#pragma GCC visibility push(default)
++
+ #include <map>
+ #include <debug/map.h>
+ #include <debug/multimap.h>
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/debug/set.vis1~ 2005-10-31 21:16:05.000000000 +0100
++++ libstdc++-v3/include/debug/set 2005-11-03 10:28:28.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Debugging set/multiset implementation -*- C++ -*-
+
+-// Copyright (C) 2003
++// Copyright (C) 2003, 2005
+ // Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+@@ -31,8 +31,12 @@
+ #ifndef _GLIBCXX_DEBUG_SET
+ #define _GLIBCXX_DEBUG_SET 1
+
++#pragma GCC visibility push(default)
++
+ #include <set>
+ #include <debug/set.h>
+ #include <debug/multiset.h>
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/debug/string.vis1~ 2005-10-31 21:16:05.000000000 +0100
++++ libstdc++-v3/include/debug/string 2005-11-03 10:28:30.000000000 +0100
+@@ -31,6 +31,8 @@
+ #ifndef _GLIBCXX_DEBUG_STRING
+ #define _GLIBCXX_DEBUG_STRING 1
+
++#pragma GCC visibility push(default)
++
+ #include <string>
+ #include <debug/safe_sequence.h>
+ #include <debug/safe_iterator.h>
+@@ -1015,4 +1017,6 @@
+
+ } // namespace __gnu_debug
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/debug/vector.vis1~ 2005-10-31 21:16:05.000000000 +0100
++++ libstdc++-v3/include/debug/vector 2005-11-03 10:28:32.000000000 +0100
+@@ -31,6 +31,8 @@
+ #ifndef _GLIBCXX_DEBUG_VECTOR
+ #define _GLIBCXX_DEBUG_VECTOR 1
+
++#pragma GCC visibility push(default)
++
+ #include <vector>
+ #include <utility>
+ #include <debug/safe_sequence.h>
+@@ -413,4 +415,6 @@
+ { __lhs.swap(__rhs); }
+ } // namespace __gnu_debug_def
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/tr1/array.vis1~ 2005-10-31 21:16:08.000000000 +0100
++++ libstdc++-v3/include/tr1/array 2005-11-03 10:28:38.000000000 +0100
+@@ -34,6 +34,8 @@
+ #ifndef _ARRAY
+ #define _ARRAY 1
+
++#pragma GCC visibility push(default)
++
+ #include <new>
+ #include <iterator>
+ #include <algorithm>
+@@ -231,4 +233,6 @@
+ } // namespace std::tr1
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/tr1/functional.vis1~ 2005-10-31 21:16:08.000000000 +0100
++++ libstdc++-v3/include/tr1/functional 2005-11-03 10:28:38.000000000 +0100
+@@ -36,6 +36,8 @@
+
+ #pragma GCC system_header
+
++#pragma GCC visibility push(default)
++
+ #include "../functional"
+ #include <typeinfo>
+ #include <tr1/type_traits>
+@@ -1270,4 +1272,6 @@
+ }
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/tr1/memory.vis1~ 2005-10-31 21:16:08.000000000 +0100
++++ libstdc++-v3/include/tr1/memory 2005-11-03 10:28:38.000000000 +0100
+@@ -30,6 +30,8 @@
+ #ifndef _TR1_MEMORY
+ #define _TR1_MEMORY 1
+
++#pragma GCC visibility push(default)
++
+ #include "../memory"
+ #include <functional> // std::less
+ #include <exception> // std::exception
+@@ -48,4 +50,6 @@
+
+ #include <tr1/boost_shared_ptr.h>
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/tr1/tuple.vis1~ 2005-10-31 21:16:08.000000000 +0100
++++ libstdc++-v3/include/tr1/tuple 2005-11-03 10:28:38.000000000 +0100
+@@ -36,6 +36,8 @@
+ #ifndef _TUPLE
+ #define _TUPLE 1
+
++#pragma GCC visibility push(default)
++
+ #include <tr1/utility>
+ #include <tr1/ref_fwd.h>
+
+@@ -272,4 +274,6 @@
+
+ #include <tr1/functional>
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/tr1/type_traits.vis1~ 2005-10-31 21:16:08.000000000 +0100
++++ libstdc++-v3/include/tr1/type_traits 2005-11-03 10:28:38.000000000 +0100
+@@ -34,6 +34,8 @@
+ #ifndef _TYPE_TRAITS
+ #define _TYPE_TRAITS 1
+
++#pragma GCC visibility push(default)
++
+ #include <bits/c++config.h>
+ #include <tr1/type_traits_fwd.h>
+
+@@ -703,4 +705,6 @@
+ }
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/tr1/unordered_map.vis1~ 2005-10-31 21:16:08.000000000 +0100
++++ libstdc++-v3/include/tr1/unordered_map 2005-11-03 10:28:38.000000000 +0100
+@@ -34,6 +34,8 @@
+ #ifndef GNU_LIBSTDCXX_TR1_UNORDERED_MAP_
+ #define GNU_LIBSTDCXX_TR1_UNORDERED_MAP_
+
++#pragma GCC visibility push(default)
++
+ #include <tr1/hashtable>
+ #include <tr1/functional>
+ #include <tr1/functional>
+@@ -167,4 +169,6 @@
+ }
+ }
+
++#pragma GCC visibility pop
++
+ #endif /* GNU_LIBSTDCXX_TR1_UNORDERED_MAP_ */
+--- libstdc++-v3/include/tr1/unordered_set.vis1~ 2005-10-31 21:16:08.000000000 +0100
++++ libstdc++-v3/include/tr1/unordered_set 2005-11-03 10:28:38.000000000 +0100
+@@ -34,6 +34,8 @@
+ #ifndef GNU_LIBSTDCXX_TR1_UNORDERED_SET_
+ #define GNU_LIBSTDCXX_TR1_UNORDERED_SET_
+
++#pragma GCC visibility push(default)
++
+ #include <tr1/hashtable>
+ #include <tr1/functional>
+ #include <memory>
+@@ -162,4 +164,6 @@
+ }
+ }
+
++#pragma GCC visibility pop
++
+ #endif /* GNU_LIBSTDCXX_TR1_UNORDERED_SET_ */
+--- libstdc++-v3/include/tr1/utility.vis1~ 2005-10-31 21:16:08.000000000 +0100
++++ libstdc++-v3/include/tr1/utility 2005-11-03 10:28:38.000000000 +0100
+@@ -34,6 +34,8 @@
+ #ifndef _TR1_UTILITY
+ #define _TR1_UTILITY 1
+
++#pragma GCC visibility push(default)
++
+ #include "../utility"
+
+ namespace std
+@@ -93,6 +95,8 @@
+ get(const pair<_Tp1, _Tp2>& __in)
+ { return __pair_get<_Int>::__const_get(__in); }
+ }
+-}
++}
++
++#pragma GCC visibility pop
+
+ #endif
+--- libstdc++-v3/include/std/std_algorithm.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_algorithm.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <algorithm> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -61,10 +61,13 @@
+ #define _GLIBCXX_ALGORITHM 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/stl_algobase.h>
+ #include <bits/stl_construct.h>
+ #include <bits/stl_uninitialized.h>
+ #include <bits/stl_algo.h>
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_ALGORITHM */
+--- libstdc++-v3/include/std/std_bitset.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_bitset.h 2005-11-03 10:28:34.000000000 +0100
+@@ -48,6 +48,7 @@
+ #define _GLIBCXX_BITSET 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <cstddef> // For size_t
+ #include <cstring> // For memset
+@@ -1300,4 +1301,6 @@
+ # include <debug/bitset>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_BITSET */
+--- libstdc++-v3/include/std/std_complex.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_complex.h 2005-11-03 10:28:34.000000000 +0100
+@@ -43,6 +43,7 @@
+ #define _GLIBCXX_COMPLEX 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <bits/cpp_type_traits.h>
+@@ -1485,4 +1486,6 @@
+ : _M_value(__z.__rep()) { }
+ } // namespace std
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_COMPLEX */
+--- libstdc++-v3/include/std/std_deque.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_deque.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <deque> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -61,6 +61,7 @@
+ #define _GLIBCXX_DEQUE 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/functexcept.h>
+ #include <bits/stl_algobase.h>
+@@ -77,4 +78,6 @@
+ # include <debug/deque>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_DEQUE */
+--- libstdc++-v3/include/std/std_fstream.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_fstream.h 2005-11-03 10:28:34.000000000 +0100
+@@ -40,6 +40,7 @@
+ #define _GLIBCXX_FSTREAM 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <istream>
+ #include <ostream>
+@@ -782,4 +783,6 @@
+ # include <bits/fstream.tcc>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_FSTREAM */
+--- libstdc++-v3/include/std/std_functional.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_functional.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <functional> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -49,9 +49,12 @@
+ #define _GLIBCXX_FUNCTIONAL 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <cstddef>
+ #include <bits/stl_function.h>
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_FUNCTIONAL */
+--- libstdc++-v3/include/std/std_iomanip.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_iomanip.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Standard stream manipulators -*- C++ -*-
+
+-// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003
++// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2005
+ // Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+@@ -40,6 +40,7 @@
+ #define _GLIBCXX_IOMANIP 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <istream>
+@@ -296,4 +297,6 @@
+ #endif
+ } // namespace std
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_IOMANIP */
+--- libstdc++-v3/include/std/std_ios.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_ios.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,7 @@
+ // Iostreams base classes -*- C++ -*-
+
+-// Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
++// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2005
++// Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -39,6 +40,7 @@
+ #define _GLIBCXX_IOS 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <iosfwd>
+ #include <exception> // For ios_base::failure
+@@ -49,4 +51,6 @@
+ #include <streambuf>
+ #include <bits/basic_ios.h>
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_IOS */
+--- libstdc++-v3/include/std/std_iosfwd.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_iosfwd.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Forwarding declarations -*- C++ -*-
+
+-// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003
++// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2005
+ // Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+@@ -40,6 +40,7 @@
+ #define _GLIBCXX_IOSFWD 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <bits/c++locale.h>
+@@ -164,4 +165,6 @@
+ /** @} */
+ } // namespace std
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_IOSFWD */
+--- libstdc++-v3/include/std/std_iostream.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_iostream.h 2005-11-03 10:28:34.000000000 +0100
+@@ -1,6 +1,7 @@
+ // Standard iostream objects -*- C++ -*-
+
+-// Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
++// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2005
++// Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -39,6 +40,7 @@
+ #define _GLIBCXX_IOSTREAM 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <ostream>
+@@ -76,4 +78,6 @@
+ static ios_base::Init __ioinit;
+ } // namespace std
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_IOSTREAM */
+--- libstdc++-v3/include/std/std_istream.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_istream.h 2005-11-03 10:28:35.000000000 +0100
+@@ -40,6 +40,7 @@
+ #define _GLIBCXX_ISTREAM 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <ios>
+ #include <limits> // For numeric_limits
+@@ -819,4 +820,6 @@
+ # include <bits/istream.tcc>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_ISTREAM */
+--- libstdc++-v3/include/std/std_iterator.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_iterator.h 2005-11-03 10:28:35.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <iterator> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -61,6 +61,7 @@
+ #define _GLIBCXX_ITERATOR 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <cstddef>
+@@ -72,4 +73,6 @@
+ #include <bits/stream_iterator.h>
+ #include <bits/streambuf_iterator.h>
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_ITERATOR */
+--- libstdc++-v3/include/std/std_limits.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_limits.h 2005-11-03 10:28:35.000000000 +0100
+@@ -1,6 +1,7 @@
+ // The template and inlines for the -*- C++ -*- numeric_limits classes.
+
+-// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005
++// Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -43,6 +44,7 @@
+ #define _GLIBCXX_NUMERIC_LIMITS 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+
+@@ -1156,4 +1158,6 @@
+ #undef __glibcxx_digits
+ #undef __glibcxx_digits10
+
++#pragma GCC visibility pop
++
+ #endif // _GLIBCXX_NUMERIC_LIMITS
+--- libstdc++-v3/include/std/std_list.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_list.h 2005-11-03 10:28:35.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <list> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -61,6 +61,7 @@
+ #define _GLIBCXX_LIST 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/functexcept.h>
+ #include <bits/stl_algobase.h>
+@@ -77,5 +78,7 @@
+ # include <debug/list>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_LIST */
+
+--- libstdc++-v3/include/std/std_locale.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_locale.h 2005-11-03 10:28:35.000000000 +0100
+@@ -1,6 +1,7 @@
+ // Locale support -*- C++ -*-
+
+-// Copyright (C) 1997, 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
++// Copyright (C) 1997, 1998, 1999, 2002, 2003, 2005
++// Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -39,10 +40,13 @@
+ #define _GLIBCXX_LOCALE 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/localefwd.h>
+ #include <bits/locale_classes.h>
+ #include <bits/locale_facets.h>
+ #include <bits/locale_facets.tcc>
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_LOCALE */
+--- libstdc++-v3/include/std/std_map.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_map.h 2005-11-03 10:28:35.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <map> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -61,6 +61,7 @@
+ #define _GLIBCXX_MAP 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/stl_tree.h>
+ #include <bits/stl_map.h>
+@@ -70,4 +71,6 @@
+ # include <debug/map>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_MAP */
+--- libstdc++-v3/include/std/std_memory.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_memory.h 2005-11-03 10:28:35.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <memory> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -49,6 +49,7 @@
+ #define _GLIBCXX_MEMORY 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/stl_algobase.h>
+ #include <bits/allocator.h>
+@@ -370,4 +371,6 @@
+ };
+ } // namespace std
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_MEMORY */
+--- libstdc++-v3/include/std/std_numeric.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_numeric.h 2005-11-03 10:28:35.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <numeric> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -61,6 +61,7 @@
+ #define _GLIBCXX_NUMERIC 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <cstddef>
+@@ -68,4 +69,6 @@
+ #include <bits/stl_function.h>
+ #include <bits/stl_numeric.h>
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_NUMERIC */
+--- libstdc++-v3/include/std/std_ostream.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_ostream.h 2005-11-03 10:28:35.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Output streams -*- C++ -*-
+
+-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005
+ // Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+@@ -40,6 +40,7 @@
+ #define _GLIBCXX_OSTREAM 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <ios>
+
+@@ -525,4 +526,6 @@
+ # include <bits/ostream.tcc>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_OSTREAM */
+--- libstdc++-v3/include/std/std_queue.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_queue.h 2005-11-03 10:28:35.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <queue> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -61,6 +61,7 @@
+ #define _GLIBCXX_QUEUE 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <bits/functexcept.h>
+@@ -74,4 +75,6 @@
+ #include <vector>
+ #include <bits/stl_queue.h>
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_QUEUE */
+--- libstdc++-v3/include/std/std_set.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_set.h 2005-11-03 10:28:35.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <set> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -61,7 +61,8 @@
+ #define _GLIBCXX_SET 1
+
+ #pragma GCC system_header
+-
++#pragma GCC visibility push(default)
++
+ #include <bits/stl_tree.h>
+ #include <bits/stl_set.h>
+ #include <bits/stl_multiset.h>
+@@ -70,4 +71,6 @@
+ # include <debug/set>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_SET */
+--- libstdc++-v3/include/std/std_sstream.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_sstream.h 2005-11-03 10:28:36.000000000 +0100
+@@ -40,6 +40,7 @@
+ #define _GLIBCXX_SSTREAM 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <istream>
+ #include <ostream>
+@@ -614,4 +615,6 @@
+ # include <bits/sstream.tcc>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_SSTREAM */
+--- libstdc++-v3/include/std/std_stack.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_stack.h 2005-11-03 10:28:36.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <stack> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -61,6 +61,7 @@
+ #define _GLIBCXX_STACK 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/stl_algobase.h>
+ #include <bits/allocator.h>
+@@ -69,4 +70,6 @@
+ #include <deque>
+ #include <bits/stl_stack.h>
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_STACK */
+--- libstdc++-v3/include/std/std_stdexcept.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_stdexcept.h 2005-11-03 10:28:36.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Standard exception classes -*- C++ -*-
+
+-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -39,6 +39,7 @@
+ #define _GLIBCXX_STDEXCEPT 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <exception>
+ #include <string>
+@@ -144,4 +145,6 @@
+ };
+ } // namespace std
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_STDEXCEPT */
+--- libstdc++-v3/include/std/std_streambuf.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_streambuf.h 2005-11-03 10:28:37.000000000 +0100
+@@ -40,6 +40,7 @@
+ #define _GLIBXX_STREAMBUF 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <iosfwd>
+@@ -806,4 +807,6 @@
+ # include <bits/streambuf.tcc>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_STREAMBUF */
+--- libstdc++-v3/include/std/std_string.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_string.h 2005-11-03 10:28:37.000000000 +0100
+@@ -40,6 +40,7 @@
+ #define _GLIBCXX_STRING 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <bits/stringfwd.h>
+@@ -56,4 +57,6 @@
+ # include <bits/basic_string.tcc>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_STRING */
+--- libstdc++-v3/include/std/std_utility.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_utility.h 2005-11-03 10:28:37.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <utility> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -61,9 +61,12 @@
+ #define _GLIBCXX_UTILITY 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <bits/stl_relops.h>
+ #include <bits/stl_pair.h>
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_UTILITY */
+--- libstdc++-v3/include/std/std_valarray.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_valarray.h 2005-11-03 10:28:37.000000000 +0100
+@@ -1,6 +1,6 @@
+ // The template and inlines for the -*- C++ -*- valarray class.
+
+-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005
+ // Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+@@ -38,6 +38,7 @@
+ #define _GLIBCXX_VALARRAY 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <cstddef>
+@@ -1007,4 +1008,6 @@
+
+ } // namespace std
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_VALARRAY */
+--- libstdc++-v3/include/std/std_vector.h.vis1~ 2005-10-31 21:16:10.000000000 +0100
++++ libstdc++-v3/include/std/std_vector.h 2005-11-03 10:28:37.000000000 +0100
+@@ -1,6 +1,6 @@
+ // <vector> -*- C++ -*-
+
+-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
+ // software; you can redistribute it and/or modify it under the
+@@ -61,6 +61,7 @@
+ #define _GLIBCXX_VECTOR 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/functexcept.h>
+ #include <bits/stl_algobase.h>
+@@ -78,5 +79,7 @@
+ # include <debug/vector>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif /* _GLIBCXX_VECTOR */
+
+--- libstdc++-v3/include/c_std/std_cassert.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cassert.h 2005-11-03 10:27:12.000000000 +0100
+@@ -45,5 +45,8 @@
+ // No include guards on this header...
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <assert.h>
++
++#pragma GCC visibility pop
+--- libstdc++-v3/include/c_std/std_cctype.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cctype.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CCTYPE 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <ctype.h>
+@@ -82,4 +83,6 @@
+ using ::toupper;
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_cerrno.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cerrno.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CERRNO 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <errno.h>
+
+@@ -54,4 +55,6 @@
+ #define errno errno
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_cfloat.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cfloat.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,7 +46,10 @@
+ #define _GLIBCXX_CFLOAT 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <float.h>
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_climits.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_climits.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,7 +46,9 @@
+ #define _GLIBCXX_CLIMITS 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <limits.h>
+
++#pragma GCC visibility pop
+ #endif
+--- libstdc++-v3/include/c_std/std_clocale.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_clocale.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CLOCALE 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <locale.h>
+
+@@ -60,4 +61,6 @@
+ using ::localeconv;
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_cmath.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cmath.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CMATH 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <bits/cpp_type_traits.h>
+@@ -575,4 +576,6 @@
+ # include <bits/cmath.tcc>
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_csetjmp.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_csetjmp.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CSETJMP 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <setjmp.h>
+
+@@ -63,4 +64,6 @@
+ using ::longjmp;
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_csignal.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_csignal.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CSIGNAL 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <signal.h>
+
+@@ -59,4 +60,6 @@
+ using ::raise;
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_cstdarg.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cstdarg.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CSTDARG 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <stdarg.h>
+
+@@ -59,4 +60,6 @@
+ using ::va_list;
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_cstddef.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cstddef.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CSTDDEF 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <stddef.h>
+
+@@ -55,4 +56,6 @@
+ using ::size_t;
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_cstdio.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cstdio.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CSTDIO 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <cstddef>
+@@ -184,4 +185,6 @@
+ }
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_cstdlib.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cstdlib.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CSTDLIB 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <cstddef>
+@@ -215,4 +216,6 @@
+ }
+ #endif
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_cstring.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cstring.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CSTRING 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <cstddef>
+
+@@ -126,4 +127,6 @@
+ { return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_ctime.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_ctime.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CTIME 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <cstddef>
+
+@@ -79,4 +80,6 @@
+ using ::strftime;
+ }
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_cwchar.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cwchar.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CWCHAR 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+ #include <cstddef>
+@@ -271,4 +272,6 @@
+
+ #endif //_GLIBCXX_USE_WCHAR_T
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/include/c_std/std_cwctype.h.vis1~ 2005-10-31 21:16:11.000000000 +0100
++++ libstdc++-v3/include/c_std/std_cwctype.h 2005-11-03 10:27:12.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define _GLIBCXX_CWCTYPE 1
+
+ #pragma GCC system_header
++#pragma GCC visibility push(default)
+
+ #include <bits/c++config.h>
+
+@@ -106,4 +107,6 @@
+ }
+ #endif //_GLIBCXX_USE_WCHAR_T
+
++#pragma GCC visibility pop
++
+ #endif
+--- libstdc++-v3/testsuite/20_util/memory/auto_ptr/assign_neg.cc.vis1~ 2005-10-31 21:19:34.000000000 +0100
++++ libstdc++-v3/testsuite/20_util/memory/auto_ptr/assign_neg.cc 2005-11-03 10:28:38.000000000 +0100
+@@ -46,5 +46,5 @@
+ test01();
+ return 0;
+ }
+-// { dg-error "candidates" "" { target *-*-* } 223 }
+-// { dg-error "std::auto_ptr" "" { target *-*-* } 353 }
++// { dg-error "candidates" "" { target *-*-* } 224 }
++// { dg-error "std::auto_ptr" "" { target *-*-* } 354 }
diff --git a/4.1.2/gentoo/34_all_arm-bigendian.patch b/4.1.2/gentoo/34_all_arm-bigendian.patch
new file mode 100644
index 0000000..d1a6d24
--- /dev/null
+++ b/4.1.2/gentoo/34_all_arm-bigendian.patch
@@ -0,0 +1,96 @@
+By Lennert Buytenhek <buytenh@wantstofly.org>
+Adds support for arm*b-linux* big-endian ARM targets
+
+See http://gcc.gnu.org/PR16350
+
+--- gcc-4.1.0/gcc/config/arm/linux-elf.h
++++ gcc-4.1.0/gcc/config/arm/linux-elf.h
+@@ -28,19 +28,33 @@
+ #undef TARGET_VERSION
+ #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
++#define TARGET_ENDIAN_OPTION "mbig-endian"
++#define TARGET_LINKER_EMULATION "armelfb_linux"
++#else
++#define TARGET_ENDIAN_DEFAULT 0
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#define TARGET_LINKER_EMULATION "armelf_linux"
++#endif
++
+ #undef TARGET_DEFAULT_FLOAT_ABI
+ #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
+
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (0)
++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
+
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
+
+ #undef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
+
+ /* Now we define the strings used to build the spec file. */
+ #undef LIB_SPEC
+@@ -61,7 +75,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
+ -X \
+- %{mbig-endian:-EB}" \
++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
+ SUBTARGET_EXTRA_LINK_SPEC
+
+ #undef LINK_SPEC
+--- gcc-4.1.0/gcc/config.gcc
++++ gcc-4.1.0/gcc/config.gcc
+@@ -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"
++ case $target in
++ arm*b-*)
++ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
++ ;;
++ esac
+ tmake_file="${tmake_file} t-linux arm/t-arm"
+ case ${target} in
+ arm*-*-linux-gnueabi)
+--- gcc-4.1.0/gcc/config/arm/linux-eabi.h
++++ gcc-4.1.0/gcc/config/arm/linux-eabi.h
+@@ -20,6 +20,17 @@
+ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#undef TARGET_LINKER_EMULATION
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_LINKER_EMULATION "armelfb_linux_eabi"
++#else
++#define TARGET_LINKER_EMULATION "armelf_linux_eabi"
++#endif
++
+ /* On EABI GNU/Linux, we want both the BPABI builtins and the
+ GNU/Linux builtins. */
+ #undef TARGET_OS_CPP_BUILTINS
+@@ -48,7 +59,7 @@
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
+
+ #undef SUBTARGET_EXTRA_LINK_SPEC
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
+
+ /* Use ld-linux.so.3 so that it will be possible to run "classic"
+ GNU/Linux binaries on an EABI system. */
diff --git a/4.1.2/gentoo/39_all_gcc-pr28516.patch b/4.1.2/gentoo/39_all_gcc-pr28516.patch
new file mode 100644
index 0000000..9b29ce2
--- /dev/null
+++ b/4.1.2/gentoo/39_all_gcc-pr28516.patch
@@ -0,0 +1,25 @@
+http://gcc.gnu.org/PR28516
+
+2006-09-19 Paul Brook <paul@codesourcery.com>
+
+ PR target/28516
+ * config/arm/arm.c (arm_unwind_emit_set): Handle reg = sp + const.
+
+--- trunk/gcc/config/arm/arm.c 2006/09/19 13:18:27 117055
++++ trunk/gcc/config/arm/arm.c 2006/09/19 13:19:24 117056
+@@ -15415,6 +15415,15 @@
+ /* Move from sp to reg. */
+ asm_fprintf (asm_out_file, "\t.movsp %r\n", REGNO (e0));
+ }
++ else if (GET_CODE (e1) == PLUS
++ && GET_CODE (XEXP (e1, 0)) == REG
++ && REGNO (XEXP (e1, 0)) == SP_REGNUM
++ && GET_CODE (XEXP (e1, 1)) == CONST_INT)
++ {
++ /* Set reg to offset from sp. */
++ asm_fprintf (asm_out_file, "\t.movsp %r, #%d\n",
++ REGNO (e0), (int)INTVAL(XEXP (e1, 1)));
++ }
+ else
+ abort ();
+ break;
diff --git a/4.1.2/gentoo/40_all_gcc4-debian-hppa-cbranch.patch b/4.1.2/gentoo/40_all_gcc4-debian-hppa-cbranch.patch
new file mode 100644
index 0000000..d5ff5f3
--- /dev/null
+++ b/4.1.2/gentoo/40_all_gcc4-debian-hppa-cbranch.patch
@@ -0,0 +1,1751 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: Fix for PR target/26743 (hppa)
+# DP: Backport from gcc trunk 2006-04-12 by tausq@debian.org
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+2006-04-09 John David Anglin <dave.anglin@nrc-crnc.gc.ca>
+ PR target/26743
+ PR target/11254
+ PR target/10274
+ * pa.md (cbranch patterns): Revise arguments used in calls to
+ output_cbranch, output_bb and output_bvd. Add long branch length
+ attributes.
+ (fbranch patterns): Handle long branches.
+ (jump): Revise length check. Revise arguments for output_lbranch call.
+ Add long branch length attributes.
+ (decrement_and_branch_until_zero): Add long branch length attributes.
+ (output_movb, output_parallel_addb and output_parallel_movb patterns):
+ Likewise. Revise arguments for output_parallel_addb and
+ output_parallel_movb calls.
+ * pa-protos.h (output_cbranch, output_lbranch, output_bb, output_bvb,
+ output_parallel_movb and output_parallel_addb): Update prototypes.
+ * pa.c (output_cbranch): Revise arguments. Correct handling of
+ nullification in long branches.
+ (output_lbranch): Add new argument to control extraction of delay
+ instruction.
+ (output_bb): Handle long branches.
+ (output_bvb, output_dbra, output_movb, output_parallel_movb,
+ output_parallel_addb): Likewise.
+
+
+--- gcc/config/pa/pa.c.orig 2006-02-07 23:11:30.000000000 +0100
++++ gcc/config/pa/pa.c 2006-04-19 11:31:02.331909272 +0200
+@@ -5934,11 +5934,13 @@
+ parameters. */
+
+ const char *
+-output_cbranch (rtx *operands, int nullify, int length, int negated, rtx insn)
++output_cbranch (rtx *operands, int negated, rtx insn)
+ {
+ static char buf[100];
+ int useskip = 0;
+- rtx xoperands[5];
++ int nullify = INSN_ANNULLED_BRANCH_P (insn);
++ int length = get_attr_length (insn);
++ int xdelay;
+
+ /* A conditional branch to the following instruction (e.g. the delay slot)
+ is asking for a disaster. This can happen when not optimizing and
+@@ -6008,7 +6010,7 @@
+ with an unfilled delay slot. */
+ case 8:
+ /* Handle weird backwards branch with a filled delay slot
+- with is nullified. */
++ which is nullified. */
+ if (dbr_sequence_length () != 0
+ && ! forward_branch_p (insn)
+ && nullify)
+@@ -6055,19 +6057,24 @@
+ }
+ break;
+
+- case 20:
+- case 28:
+- xoperands[0] = operands[0];
+- xoperands[1] = operands[1];
+- xoperands[2] = operands[2];
+- xoperands[3] = operands[3];
+-
++ default:
+ /* The reversed conditional branch must branch over one additional
+- instruction if the delay slot is filled. If the delay slot
+- is empty, the instruction after the reversed condition branch
+- must be nullified. */
+- nullify = dbr_sequence_length () == 0;
+- xoperands[4] = nullify ? GEN_INT (length) : GEN_INT (length + 4);
++ instruction if the delay slot is filled and needs to be extracted
++ by output_lbranch. If the delay slot is empty or this is a
++ nullified forward branch, the instruction after the reversed
++ condition branch must be nullified. */
++ if (dbr_sequence_length () == 0
++ || (nullify && forward_branch_p (insn)))
++ {
++ nullify = 1;
++ xdelay = 0;
++ operands[4] = GEN_INT (length);
++ }
++ else
++ {
++ xdelay = 1;
++ operands[4] = GEN_INT (length + 4);
++ }
+
+ /* Create a reversed conditional branch which branches around
+ the following insns. */
+@@ -6114,27 +6121,38 @@
+ }
+ }
+
+- output_asm_insn (buf, xoperands);
+- return output_lbranch (operands[0], insn);
+-
+- default:
+- gcc_unreachable ();
++ output_asm_insn (buf, operands);
++ return output_lbranch (operands[0], insn, xdelay);
+ }
+ return buf;
+ }
+
+-/* This routine handles long unconditional branches that exceed the
+- maximum range of a simple branch instruction. */
++/* This routine handles output of long unconditional branches that
++ exceed the maximum range of a simple branch instruction. Since
++ we don't have a register available for the branch, we save register
++ %r1 in the frame marker, load the branch destination DEST into %r1,
++ execute the branch, and restore %r1 in the delay slot of the branch.
++
++ Since long branches may have an insn in the delay slot and the
++ delay slot is used to restore %r1, we in general need to extract
++ this insn and execute it before the branch. However, to facilitate
++ use of this function by conditional branches, we also provide an
++ option to not extract the delay insn so that it will be emitted
++ after the long branch. So, if there is an insn in the delay slot,
++ it is extracted if XDELAY is nonzero.
++
++ The lengths of the various long-branch sequences are 20, 16 and 24
++ bytes for the portable runtime, non-PIC and PIC cases, respectively. */
+
+ const char *
+-output_lbranch (rtx dest, rtx insn)
++output_lbranch (rtx dest, rtx insn, int xdelay)
+ {
+ rtx xoperands[2];
+
+ xoperands[0] = dest;
+
+ /* First, free up the delay slot. */
+- if (dbr_sequence_length () != 0)
++ if (xdelay && dbr_sequence_length () != 0)
+ {
+ /* We can't handle a jump in the delay slot. */
+ gcc_assert (GET_CODE (NEXT_INSN (insn)) != JUMP_INSN);
+@@ -6244,11 +6262,13 @@
+ above. it returns the appropriate output template to emit the branch. */
+
+ const char *
+-output_bb (rtx *operands ATTRIBUTE_UNUSED, int nullify, int length,
+- int negated, rtx insn, int which)
++output_bb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
+ {
+ static char buf[100];
+ int useskip = 0;
++ int nullify = INSN_ANNULLED_BRANCH_P (insn);
++ int length = get_attr_length (insn);
++ int xdelay;
+
+ /* A conditional branch to the following instruction (e.g. the delay slot) is
+ asking for a disaster. I do not think this can happen as this pattern
+@@ -6315,7 +6335,7 @@
+ with an unfilled delay slot. */
+ case 8:
+ /* Handle weird backwards branch with a filled delay slot
+- with is nullified. */
++ which is nullified. */
+ if (dbr_sequence_length () != 0
+ && ! forward_branch_p (insn)
+ && nullify)
+@@ -6357,9 +6377,10 @@
+ }
+ else
+ {
+- strcpy (buf, "{extrs,|extrw,s,}");
+ if (GET_MODE (operands[0]) == DImode)
+ strcpy (buf, "extrd,s,*");
++ else
++ strcpy (buf, "{extrs,|extrw,s,}");
+ if ((which == 0 && negated)
+ || (which == 1 && ! negated))
+ strcat (buf, "<");
+@@ -6377,7 +6398,40 @@
+ break;
+
+ default:
+- gcc_unreachable ();
++ /* The reversed conditional branch must branch over one additional
++ instruction if the delay slot is filled and needs to be extracted
++ by output_lbranch. If the delay slot is empty or this is a
++ nullified forward branch, the instruction after the reversed
++ condition branch must be nullified. */
++ if (dbr_sequence_length () == 0
++ || (nullify && forward_branch_p (insn)))
++ {
++ nullify = 1;
++ xdelay = 0;
++ operands[4] = GEN_INT (length - 8);
++ }
++ else
++ {
++ xdelay = 1;
++ operands[4] = GEN_INT (length - 4);
++ }
++
++ if (GET_MODE (operands[0]) == DImode)
++ strcpy (buf, "extrd,s,*");
++ else
++ strcpy (buf, "{extrs,|extrw,s,}");
++ if ((which == 0 && negated)
++ || (which == 1 && !negated))
++ strcat (buf, ">= %0,%1,1,%%r0\n\t");
++ else
++ strcat (buf, "< %0,%1,1,%%r0\n\t");
++ if (nullify)
++ strcat (buf, "b,n .+%4");
++ else
++ strcat (buf, "b .+%4");
++ output_asm_insn (buf, operands);
++ return output_lbranch (negated ? operands[3] : operands[2],
++ insn, xdelay);
+ }
+ return buf;
+ }
+@@ -6389,11 +6443,13 @@
+ branch. */
+
+ const char *
+-output_bvb (rtx *operands ATTRIBUTE_UNUSED, int nullify, int length,
+- int negated, rtx insn, int which)
++output_bvb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
+ {
+ static char buf[100];
+ int useskip = 0;
++ int nullify = INSN_ANNULLED_BRANCH_P (insn);
++ int length = get_attr_length (insn);
++ int xdelay;
+
+ /* A conditional branch to the following instruction (e.g. the delay slot) is
+ asking for a disaster. I do not think this can happen as this pattern
+@@ -6460,7 +6516,7 @@
+ with an unfilled delay slot. */
+ case 8:
+ /* Handle weird backwards branch with a filled delay slot
+- with is nullified. */
++ which is nullified. */
+ if (dbr_sequence_length () != 0
+ && ! forward_branch_p (insn)
+ && nullify)
+@@ -6522,7 +6578,40 @@
+ break;
+
+ default:
+- gcc_unreachable ();
++ /* The reversed conditional branch must branch over one additional
++ instruction if the delay slot is filled and needs to be extracted
++ by output_lbranch. If the delay slot is empty or this is a
++ nullified forward branch, the instruction after the reversed
++ condition branch must be nullified. */
++ if (dbr_sequence_length () == 0
++ || (nullify && forward_branch_p (insn)))
++ {
++ nullify = 1;
++ xdelay = 0;
++ operands[4] = GEN_INT (length - 8);
++ }
++ else
++ {
++ xdelay = 1;
++ operands[4] = GEN_INT (length - 4);
++ }
++
++ if (GET_MODE (operands[0]) == DImode)
++ strcpy (buf, "extrd,s,*");
++ else
++ strcpy (buf, "{extrs,|extrw,s,}");
++ if ((which == 0 && negated)
++ || (which == 1 && !negated))
++ strcat (buf, ">= {%0,%1,1,%%r0|%0,%%sar,1,%%r0}\n\t");
++ else
++ strcat (buf, "< {%0,%1,1,%%r0|%0,%%sar,1,%%r0}\n\t");
++ if (nullify)
++ strcat (buf, "b,n .+%4");
++ else
++ strcat (buf, "b .+%4");
++ output_asm_insn (buf, operands);
++ return output_lbranch (negated ? operands[3] : operands[2],
++ insn, xdelay);
+ }
+ return buf;
+ }
+@@ -6534,6 +6623,7 @@
+ const char *
+ output_dbra (rtx *operands, rtx insn, int which_alternative)
+ {
++ int length = get_attr_length (insn);
+
+ /* A conditional branch to the following instruction (e.g. the delay slot) is
+ asking for a disaster. Be prepared! */
+@@ -6559,7 +6649,7 @@
+ if (which_alternative == 0)
+ {
+ int nullify = INSN_ANNULLED_BRANCH_P (insn);
+- int length = get_attr_length (insn);
++ int xdelay;
+
+ /* If this is a long branch with its delay slot unfilled, set `nullify'
+ as it can nullify the delay slot and save a nop. */
+@@ -6603,7 +6693,30 @@
+ return "addi,%N2 %1,%0,%0\n\tb %3";
+
+ default:
+- gcc_unreachable ();
++ /* The reversed conditional branch must branch over one additional
++ instruction if the delay slot is filled and needs to be extracted
++ by output_lbranch. If the delay slot is empty or this is a
++ nullified forward branch, the instruction after the reversed
++ condition branch must be nullified. */
++ if (dbr_sequence_length () == 0
++ || (nullify && forward_branch_p (insn)))
++ {
++ nullify = 1;
++ xdelay = 0;
++ operands[4] = GEN_INT (length);
++ }
++ else
++ {
++ xdelay = 1;
++ operands[4] = GEN_INT (length + 4);
++ }
++
++ if (nullify)
++ output_asm_insn ("addib,%N2,n %1,%0,.+%4", operands);
++ else
++ output_asm_insn ("addib,%N2 %1,%0,.+%4", operands);
++
++ return output_lbranch (operands[3], insn, xdelay);
+ }
+
+ }
+@@ -6616,10 +6729,17 @@
+ output_asm_insn ("{fstws|fstw} %0,-16(%%r30)\n\tldw -16(%%r30),%4",
+ operands);
+ output_asm_insn ("ldo %1(%4),%4\n\tstw %4,-16(%%r30)", operands);
+- if (get_attr_length (insn) == 24)
++ if (length == 24)
+ return "{comb|cmpb},%S2 %%r0,%4,%3\n\t{fldws|fldw} -16(%%r30),%0";
+- else
++ else if (length == 28)
+ return "{comclr|cmpclr},%B2 %%r0,%4,%%r0\n\tb %3\n\t{fldws|fldw} -16(%%r30),%0";
++ else
++ {
++ operands[4] = GEN_INT (length - 24);
++ output_asm_insn ("addib,%N2 %1,%0,.+%4", operands);
++ output_asm_insn ("{fldws|fldw} -16(%%r30),%0", operands);
++ return output_lbranch (operands[3], insn, 0);
++ }
+ }
+ /* Deal with gross reload from memory case. */
+ else
+@@ -6627,14 +6747,20 @@
+ /* Reload loop counter from memory, the store back to memory
+ happens in the branch's delay slot. */
+ output_asm_insn ("ldw %0,%4", operands);
+- if (get_attr_length (insn) == 12)
++ if (length == 12)
+ return "addib,%C2 %1,%4,%3\n\tstw %4,%0";
+- else
++ else if (length == 16)
+ return "addi,%N2 %1,%4,%4\n\tb %3\n\tstw %4,%0";
++ else
++ {
++ operands[5] = GEN_INT (length - 12);
++ output_asm_insn ("addib,%N2 %1,%0,.+%5\n\tstw %4,%0", operands);
++ return output_lbranch (operands[3], insn, 0);
++ }
+ }
+ }
+
+-/* Return the output template for emitting a dbra type insn.
++/* Return the output template for emitting a movb type insn.
+
+ Note it may perform some output operations on its own before
+ returning the final output string. */
+@@ -6642,6 +6768,7 @@
+ output_movb (rtx *operands, rtx insn, int which_alternative,
+ int reverse_comparison)
+ {
++ int length = get_attr_length (insn);
+
+ /* A conditional branch to the following instruction (e.g. the delay slot) is
+ asking for a disaster. Be prepared! */
+@@ -6668,7 +6795,7 @@
+ if (which_alternative == 0)
+ {
+ int nullify = INSN_ANNULLED_BRANCH_P (insn);
+- int length = get_attr_length (insn);
++ int xdelay;
+
+ /* If this is a long branch with its delay slot unfilled, set `nullify'
+ as it can nullify the delay slot and save a nop. */
+@@ -6712,38 +6839,80 @@
+ return "or,%N2 %1,%%r0,%0\n\tb %3";
+
+ default:
+- gcc_unreachable ();
++ /* The reversed conditional branch must branch over one additional
++ instruction if the delay slot is filled and needs to be extracted
++ by output_lbranch. If the delay slot is empty or this is a
++ nullified forward branch, the instruction after the reversed
++ condition branch must be nullified. */
++ if (dbr_sequence_length () == 0
++ || (nullify && forward_branch_p (insn)))
++ {
++ nullify = 1;
++ xdelay = 0;
++ operands[4] = GEN_INT (length);
++ }
++ else
++ {
++ xdelay = 1;
++ operands[4] = GEN_INT (length + 4);
++ }
++
++ if (nullify)
++ output_asm_insn ("movb,%N2,n %1,%0,.+%4", operands);
++ else
++ output_asm_insn ("movb,%N2 %1,%0,.+%4", operands);
++
++ return output_lbranch (operands[3], insn, xdelay);
+ }
+ }
+- /* Deal with gross reload from FP register case. */
++ /* Deal with gross reload for FP destination register case. */
+ else if (which_alternative == 1)
+ {
+- /* Move loop counter from FP register to MEM then into a GR,
+- increment the GR, store the GR into MEM, and finally reload
+- the FP register from MEM from within the branch's delay slot. */
++ /* Move source register to MEM, perform the branch test, then
++ finally load the FP register from MEM from within the branch's
++ delay slot. */
+ output_asm_insn ("stw %1,-16(%%r30)", operands);
+- if (get_attr_length (insn) == 12)
++ if (length == 12)
+ return "{comb|cmpb},%S2 %%r0,%1,%3\n\t{fldws|fldw} -16(%%r30),%0";
+- else
++ else if (length == 16)
+ return "{comclr|cmpclr},%B2 %%r0,%1,%%r0\n\tb %3\n\t{fldws|fldw} -16(%%r30),%0";
++ else
++ {
++ operands[4] = GEN_INT (length - 12);
++ output_asm_insn ("movb,%N2 %1,%0,.+%4", operands);
++ output_asm_insn ("{fldws|fldw} -16(%%r30),%0", operands);
++ return output_lbranch (operands[3], insn, 0);
++ }
+ }
+ /* Deal with gross reload from memory case. */
+ else if (which_alternative == 2)
+ {
+ /* Reload loop counter from memory, the store back to memory
+ happens in the branch's delay slot. */
+- if (get_attr_length (insn) == 8)
++ if (length == 8)
+ return "{comb|cmpb},%S2 %%r0,%1,%3\n\tstw %1,%0";
+- else
++ else if (length == 12)
+ return "{comclr|cmpclr},%B2 %%r0,%1,%%r0\n\tb %3\n\tstw %1,%0";
++ else
++ {
++ operands[4] = GEN_INT (length - 8);
++ output_asm_insn ("movb,%N2 %1,%0,.+%4\n\tstw %1,%0", operands);
++ return output_lbranch (operands[3], insn, 0);
++ }
+ }
+ /* Handle SAR as a destination. */
+ else
+ {
+- if (get_attr_length (insn) == 8)
++ if (length == 8)
+ return "{comb|cmpb},%S2 %%r0,%1,%3\n\tmtsar %r1";
+- else
++ else if (length == 12)
+ return "{comclr|cmpclr},%B2 %%r0,%1,%%r0\n\tb %3\n\tmtsar %r1";
++ else
++ {
++ operands[4] = GEN_INT (length - 8);
++ output_asm_insn ("movb,%N2 %1,%0,.+%4\n\tmtsar %r1", operands);
++ return output_lbranch (operands[3], insn, 0);
++ }
+ }
+ }
+
+@@ -8206,37 +8375,50 @@
+ /* Output an unconditional move and branch insn. */
+
+ const char *
+-output_parallel_movb (rtx *operands, int length)
++output_parallel_movb (rtx *operands, rtx insn)
+ {
++ int length = get_attr_length (insn);
++
+ /* These are the cases in which we win. */
+ if (length == 4)
+ return "mov%I1b,tr %1,%0,%2";
+
+- /* None of these cases wins, but they don't lose either. */
+- if (dbr_sequence_length () == 0)
++ /* None of the following cases win, but they don't lose either. */
++ if (length == 8)
+ {
+- /* Nothing in the delay slot, fake it by putting the combined
+- insn (the copy or add) in the delay slot of a bl. */
+- if (GET_CODE (operands[1]) == CONST_INT)
+- return "b %2\n\tldi %1,%0";
++ if (dbr_sequence_length () == 0)
++ {
++ /* Nothing in the delay slot, fake it by putting the combined
++ insn (the copy or add) in the delay slot of a bl. */
++ if (GET_CODE (operands[1]) == CONST_INT)
++ return "b %2\n\tldi %1,%0";
++ else
++ return "b %2\n\tcopy %1,%0";
++ }
+ else
+- return "b %2\n\tcopy %1,%0";
++ {
++ /* Something in the delay slot, but we've got a long branch. */
++ if (GET_CODE (operands[1]) == CONST_INT)
++ return "ldi %1,%0\n\tb %2";
++ else
++ return "copy %1,%0\n\tb %2";
++ }
+ }
++
++ if (GET_CODE (operands[1]) == CONST_INT)
++ output_asm_insn ("ldi %1,%0", operands);
+ else
+- {
+- /* Something in the delay slot, but we've got a long branch. */
+- if (GET_CODE (operands[1]) == CONST_INT)
+- return "ldi %1,%0\n\tb %2";
+- else
+- return "copy %1,%0\n\tb %2";
+- }
++ output_asm_insn ("copy %1,%0", operands);
++ return output_lbranch (operands[2], insn, 1);
+ }
+
+ /* Output an unconditional add and branch insn. */
+
+ const char *
+-output_parallel_addb (rtx *operands, int length)
++output_parallel_addb (rtx *operands, rtx insn)
+ {
++ int length = get_attr_length (insn);
++
+ /* To make life easy we want operand0 to be the shared input/output
+ operand and operand1 to be the readonly operand. */
+ if (operands[0] == operands[1])
+@@ -8246,18 +8428,20 @@
+ if (length == 4)
+ return "add%I1b,tr %1,%0,%3";
+
+- /* None of these cases win, but they don't lose either. */
+- if (dbr_sequence_length () == 0)
+- {
+- /* Nothing in the delay slot, fake it by putting the combined
+- insn (the copy or add) in the delay slot of a bl. */
+- return "b %3\n\tadd%I1 %1,%0,%0";
+- }
+- else
++ /* None of the following cases win, but they don't lose either. */
++ if (length == 8)
+ {
+- /* Something in the delay slot, but we've got a long branch. */
+- return "add%I1 %1,%0,%0\n\tb %3";
++ if (dbr_sequence_length () == 0)
++ /* Nothing in the delay slot, fake it by putting the combined
++ insn (the copy or add) in the delay slot of a bl. */
++ return "b %3\n\tadd%I1 %1,%0,%0";
++ else
++ /* Something in the delay slot, but we've got a long branch. */
++ return "add%I1 %1,%0,%0\n\tb %3";
+ }
++
++ output_asm_insn ("add%I1 %1,%0,%0", operands);
++ return output_lbranch (operands[3], insn, 1);
+ }
+
+ /* Return nonzero if INSN (a jump insn) immediately follows a call
+--- gcc/config/pa/pa.md.orig 2006-02-15 03:54:08.000000000 +0100
++++ gcc/config/pa/pa.md 2006-04-19 11:15:44.899380216 +0200
+@@ -139,7 +139,7 @@
+ (define_delay (eq_attr "type" "btable_branch,branch,parallel_branch")
+ [(eq_attr "in_branch_delay" "true") (nil) (nil)])
+
+-;; Floating point conditional branch delay slot description and
++;; Floating point conditional branch delay slot description.
+ (define_delay (eq_attr "type" "fbranch")
+ [(eq_attr "in_branch_delay" "true")
+ (eq_attr "in_nullified_branch_delay" "true")
+@@ -1708,8 +1708,7 @@
+ ""
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn);
++ return output_cbranch (operands, 0, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1719,6 +1718,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1736,8 +1737,7 @@
+ ""
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn);
++ return output_cbranch (operands, 1, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1747,6 +1747,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1762,8 +1764,7 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn);
++ return output_cbranch (operands, 0, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1773,6 +1774,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1790,8 +1793,7 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn);
++ return output_cbranch (operands, 1, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1801,6 +1803,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1815,8 +1819,7 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn);
++ return output_cbranch (operands, 0, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1826,6 +1829,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1843,8 +1848,7 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn);
++ return output_cbranch (operands, 1, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1854,6 +1858,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1871,15 +1877,21 @@
+ ""
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 0);
++ return output_bb (operands, 0, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -1893,15 +1905,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 0);
++ return output_bb (operands, 0, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -1915,15 +1933,21 @@
+ ""
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 0);
++ return output_bb (operands, 1, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -1937,15 +1961,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 0);
++ return output_bb (operands, 1, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -1959,15 +1989,21 @@
+ ""
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 1);
++ return output_bb (operands, 0, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -1981,15 +2017,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 1);
++ return output_bb (operands, 0, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2003,15 +2045,21 @@
+ ""
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 1);
++ return output_bb (operands, 1, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2025,15 +2073,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 1);
++ return output_bb (operands, 1, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ ;; Branch on Variable Bit patterns.
+ (define_insn ""
+@@ -2048,15 +2102,21 @@
+ ""
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 0);
++ return output_bvb (operands, 0, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2070,15 +2130,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 0);
++ return output_bvb (operands, 0, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2092,15 +2158,21 @@
+ ""
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 0);
++ return output_bvb (operands, 1, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2114,15 +2186,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 0);
++ return output_bvb (operands, 1, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2136,15 +2214,21 @@
+ ""
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 1);
++ return output_bvb (operands, 0, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2158,15 +2242,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 1);
++ return output_bvb (operands, 0, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2180,15 +2270,21 @@
+ ""
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 1);
++ return output_bvb (operands, 1, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2202,46 +2298,114 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 1);
++ return output_bvb (operands, 1, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ ;; Floating point branches
++
++;; ??? Nullification is handled differently from other branches.
++;; If nullification is specified, the delay slot is nullified on any
++;; taken branch regardless of branch direction.
+ (define_insn ""
+ [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "! TARGET_SOFT_FLOAT"
++ "!TARGET_SOFT_FLOAT"
+ "*
+ {
+- if (INSN_ANNULLED_BRANCH_P (insn))
+- return \"ftest\;b,n %0\";
++ int length = get_attr_length (insn);
++ rtx xoperands[1];
++ int nullify, xdelay;
++
++ if (length < 16)
++ return \"ftest\;b%* %l0\";
++
++ if (dbr_sequence_length () == 0 || INSN_ANNULLED_BRANCH_P (insn))
++ {
++ nullify = 1;
++ xdelay = 0;
++ xoperands[0] = GEN_INT (length - 8);
++ }
++ else
++ {
++ nullify = 0;
++ xdelay = 1;
++ xoperands[0] = GEN_INT (length - 4);
++ }
++
++ if (nullify)
++ output_asm_insn (\"ftest\;add,tr %%r0,%%r0,%%r0\;b,n .+%0\", xoperands);
+ else
+- return \"ftest\;b%* %0\";
++ output_asm_insn (\"ftest\;add,tr %%r0,%%r0,%%r0\;b .+%0\", xoperands);
++ return output_lbranch (operands[0], insn, xdelay);
+ }"
+- [(set_attr "type" "fbranch")
+- (set_attr "length" "8")])
++[(set_attr "type" "fbranch")
++ (set (attr "length")
++ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36)))])
+
+ (define_insn ""
+ [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
+ (pc)
+ (label_ref (match_operand 0 "" ""))))]
+- "! TARGET_SOFT_FLOAT"
++ "!TARGET_SOFT_FLOAT"
+ "*
+ {
+- if (INSN_ANNULLED_BRANCH_P (insn))
+- return \"ftest\;add,tr %%r0,%%r0,%%r0\;b,n %0\";
+- else
++ int length = get_attr_length (insn);
++ rtx xoperands[1];
++ int nullify, xdelay;
++
++ if (length < 16)
+ return \"ftest\;add,tr %%r0,%%r0,%%r0\;b%* %0\";
++
++ if (dbr_sequence_length () == 0 || INSN_ANNULLED_BRANCH_P (insn))
++ {
++ nullify = 1;
++ xdelay = 0;
++ xoperands[0] = GEN_INT (length - 4);
++ }
++ else
++ {
++ nullify = 0;
++ xdelay = 1;
++ xoperands[0] = GEN_INT (length);
++ }
++
++ if (nullify)
++ output_asm_insn (\"ftest\;b,n .+%0\", xoperands);
++ else
++ output_asm_insn (\"ftest\;b .+%0\", xoperands);
++ return output_lbranch (operands[0], insn, xdelay);
+ }"
+- [(set_attr "type" "fbranch")
+- (set_attr "length" "12")])
++[(set_attr "type" "fbranch")
++ (set (attr "length")
++ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 12)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ ;; Move instructions
+
+@@ -6967,11 +7131,10 @@
+ "*
+ {
+ /* An unconditional branch which can reach its target. */
+- if (get_attr_length (insn) != 24
+- && get_attr_length (insn) != 16)
++ if (get_attr_length (insn) < 16)
+ return \"b%* %l0\";
+
+- return output_lbranch (operands[0], insn);
++ return output_lbranch (operands[0], insn, 1);
+ }"
+ [(set_attr "type" "uncond_branch")
+ (set_attr "pa_combine_type" "uncond_branch")
+@@ -6980,14 +7143,16 @@
+ (if_then_else (lt (abs (minus (match_dup 0)
+ (plus (pc) (const_int 8))))
+ (const_int 8184))
+- (const_int 4)
+- (const_int 8))
+- (ge (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
++ (const_int 4)
++ (const_int 8))
++ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+- (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
+- (const_int 16)
+- (const_int 24))]
+- (const_int 4)))])
++ (const_int 4)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 20)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 16)]
++ (const_int 24)))])
+
+ ;;; Hope this is only within a function...
+ (define_insn "indirect_jump"
+@@ -8801,39 +8966,71 @@
+ (if_then_else (eq_attr "alternative" "0")
+ ;; Loop counter in register case
+ ;; Short branch has length of 4
+-;; Long branch has length of 8
+- (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8))
++;; Long branch has length of 8, 20, 24 or 28
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28))
+
+ ;; Loop counter in FP reg case.
+ ;; Extra goo to deal with additional reload insns.
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
+- (const_int 8184))
+- (const_int 24)
+- (const_int 28))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 24)
+- (const_int 28)))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
++ (const_int 8184))
++ (const_int 24)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
++ (const_int 262100))
++ (const_int 28)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 44)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 40)]
++ (const_int 48))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 24)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 28)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 44)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 40)]
++ (const_int 48)))
++
+ ;; Loop counter in memory case.
+ ;; Extra goo to deal with additional reload insns.
+ (if_then_else (lt (match_dup 3) (pc))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16))))))])
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36))))))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -8852,33 +9049,59 @@
+ (if_then_else (eq_attr "alternative" "0")
+ ;; Loop counter in register case
+ ;; Short branch has length of 4
+-;; Long branch has length of 8
+- (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8))
++;; Long branch has length of 8, 20, 24 or 28
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28))
+
+ ;; Loop counter in FP reg case.
+ ;; Extra goo to deal with additional reload insns.
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16)))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36)))
++
+ ;; Loop counter in memory or sar case.
+ ;; Extra goo to deal with additional reload insns.
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 8)
+- (const_int 12)))))])
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 8)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 12)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))))])
+
+ ;; Handle negated branch.
+ (define_insn ""
+@@ -8899,32 +9122,58 @@
+ ;; Loop counter in register case
+ ;; Short branch has length of 4
+ ;; Long branch has length of 8
+- (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28))
+
+ ;; Loop counter in FP reg case.
+ ;; Extra goo to deal with additional reload insns.
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16)))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36)))
++
+ ;; Loop counter in memory or SAR case.
+ ;; Extra goo to deal with additional reload insns.
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 8)
+- (const_int 12)))))])
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 8)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 12)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))))])
+
+ (define_insn ""
+ [(set (pc) (label_ref (match_operand 3 "" "" )))
+@@ -8934,14 +9183,21 @@
+ "(reload_completed && operands[0] == operands[1]) || operands[0] == operands[2]"
+ "*
+ {
+- return output_parallel_addb (operands, get_attr_length (insn));
++ return output_parallel_addb (operands, insn);
+ }"
+- [(set_attr "type" "parallel_branch")
+- (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++[(set_attr "type" "parallel_branch")
++ (set (attr "length")
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28)))])
+
+ (define_insn ""
+ [(set (pc) (label_ref (match_operand 2 "" "" )))
+@@ -8950,14 +9206,21 @@
+ "reload_completed"
+ "*
+ {
+- return output_parallel_movb (operands, get_attr_length (insn));
++ return output_parallel_movb (operands, insn);
+ }"
+- [(set_attr "type" "parallel_branch")
+- (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++[(set_attr "type" "parallel_branch")
++ (set (attr "length")
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28)))])
+
+ (define_insn ""
+ [(set (pc) (label_ref (match_operand 2 "" "" )))
+@@ -8966,14 +9229,21 @@
+ "reload_completed"
+ "*
+ {
+- return output_parallel_movb (operands, get_attr_length (insn));
++ return output_parallel_movb (operands, insn);
+ }"
+- [(set_attr "type" "parallel_branch")
+- (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++[(set_attr "type" "parallel_branch")
++ (set (attr "length")
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28)))])
+
+ (define_insn ""
+ [(set (pc) (label_ref (match_operand 2 "" "" )))
+@@ -8982,14 +9252,21 @@
+ "reload_completed"
+ "*
+ {
+- return output_parallel_movb (operands, get_attr_length (insn));
++ return output_parallel_movb (operands, insn);
+ }"
+- [(set_attr "type" "parallel_branch")
+- (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++[(set_attr "type" "parallel_branch")
++ (set (attr "length")
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28)))])
+
+ (define_insn ""
+ [(set (pc) (label_ref (match_operand 2 "" "" )))
+@@ -8998,14 +9275,21 @@
+ "reload_completed"
+ "*
+ {
+- return output_parallel_movb (operands, get_attr_length (insn));
++ return output_parallel_movb (operands, insn);
+ }"
+- [(set_attr "type" "parallel_branch")
+- (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++[(set_attr "type" "parallel_branch")
++ (set (attr "length")
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28)))])
+
+ (define_insn ""
+ [(set (match_operand 0 "register_operand" "=f")
+--- gcc/config/pa/pa-protos.h.orig 2005-10-24 04:38:25.000000000 +0200
++++ gcc/config/pa/pa-protos.h 2006-04-19 11:15:44.899380216 +0200
+@@ -42,14 +42,14 @@
+ extern const char *output_fp_move_double (rtx *);
+ extern const char *output_block_move (rtx *, int);
+ extern const char *output_block_clear (rtx *, int);
+-extern const char *output_cbranch (rtx *, int, int, int, rtx);
+-extern const char *output_lbranch (rtx, rtx);
+-extern const char *output_bb (rtx *, int, int, int, rtx, int);
+-extern const char *output_bvb (rtx *, int, int, int, rtx, int);
++extern const char *output_cbranch (rtx *, int, rtx);
++extern const char *output_lbranch (rtx, rtx, int);
++extern const char *output_bb (rtx *, int, rtx, int);
++extern const char *output_bvb (rtx *, int, rtx, int);
+ extern const char *output_dbra (rtx *, rtx, int);
+ extern const char *output_movb (rtx *, rtx, int, int);
+-extern const char *output_parallel_movb (rtx *, int);
+-extern const char *output_parallel_addb (rtx *, int);
++extern const char *output_parallel_movb (rtx *, rtx);
++extern const char *output_parallel_addb (rtx *, rtx);
+ extern const char *output_call (rtx, rtx, int);
+ extern const char *output_indirect_call (rtx, rtx);
+ extern const char *output_millicode_call (rtx, rtx);
diff --git a/4.1.2/gentoo/41_all_gcc4-debian-hppa-cbranch2.patch b/4.1.2/gentoo/41_all_gcc4-debian-hppa-cbranch2.patch
new file mode 100644
index 0000000..555aa57
--- /dev/null
+++ b/4.1.2/gentoo/41_all_gcc4-debian-hppa-cbranch2.patch
@@ -0,0 +1,626 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: Fix for PR target/26743 (hppa)
+# DP: Backport from gcc trunk 2006-04-12 by tausq@debian.org
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
+Sender: gcc-patches-owner@gcc.gnu.org
+To: gcc-patches@gcc.gnu.org
+Subject: [committed] Define symbolic constants for maximum branch offsets in pa.md
+Date: Tue, 11 Apr 2006 14:34:18 -0400 (EDT)
+
+The enclosed change is to facilitate changing the maximum branch
+offsets. There should be no change in functionality.
+
+Tested on hppa-unknown-linux-gnu. Applied to trunk.
+
+Dave
+
+2006-04-11 John David Anglin <dava.anglin@nrc-cnrc.gc.ca>
+
+ * pa.md (MAX_12BIT_OFFSET, MAX_17BIT_OFFSET): Define and use new
+ symbolic constants in branch patterns.
+
+--- gcc/config/pa/pa.md.orig 2006-04-19 11:33:06.396048656 +0200
++++ gcc/config/pa/pa.md 2006-04-19 11:35:52.790752816 +0200
+@@ -1,6 +1,6 @@
+ ;;- Machine description for HP PA-RISC architecture for GCC compiler
+ ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+-;; 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++;; 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ ;; Contributed by the Center for Software Science at the University
+ ;; of Utah.
+
+@@ -52,6 +52,16 @@
+ (UNSPECV_LONGJMP 5) ; builtin_longjmp
+ ])
+
++;; Maximum pc-relative branch offsets.
++
++;; These numbers are a bit smaller than the maximum allowable offsets
++;; so that a few instructions may be inserted before the actual branch.
++
++(define_constants
++ [(MAX_12BIT_OFFSET 8184) ; 12-bit branch
++ (MAX_17BIT_OFFSET 262100) ; 17-bit branch
++ ])
++
+ ;; Insn type. Used to default other attribute values.
+
+ ;; type "unary" insns have one input operand (1) and one output operand (0)
+@@ -1713,10 +1723,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1742,10 +1752,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1769,10 +1779,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1798,10 +1808,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1824,10 +1834,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1853,10 +1863,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1882,10 +1892,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -1910,10 +1920,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -1938,10 +1948,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -1966,10 +1976,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -1994,10 +2004,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2022,10 +2032,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2050,10 +2060,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2078,10 +2088,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2107,10 +2117,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2135,10 +2145,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2163,10 +2173,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2191,10 +2201,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2219,10 +2229,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2247,10 +2257,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2275,10 +2285,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2303,10 +2313,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2355,7 +2365,7 @@
+ [(set_attr "type" "fbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -2399,7 +2409,7 @@
+ [(set_attr "type" "fbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 12)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -7142,11 +7152,11 @@
+ (cond [(eq (symbol_ref "jump_in_call_delay (insn)") (const_int 1))
+ (if_then_else (lt (abs (minus (match_dup 0)
+ (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (const_int 8))
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 4)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 20)
+@@ -8968,10 +8978,10 @@
+ ;; Short branch has length of 4
+ ;; Long branch has length of 8, 20, 24 or 28
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -8984,10 +8994,10 @@
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 24)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 28)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 44)
+@@ -8995,10 +9005,10 @@
+ (const_int 40)]
+ (const_int 48))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 24)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 28)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 44)
+@@ -9010,10 +9020,10 @@
+ ;; Extra goo to deal with additional reload insns.
+ (if_then_else (lt (match_dup 3) (pc))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9021,10 +9031,10 @@
+ (const_int 28)]
+ (const_int 36))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9051,10 +9061,10 @@
+ ;; Short branch has length of 4
+ ;; Long branch has length of 8, 20, 24 or 28
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9067,10 +9077,10 @@
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9078,10 +9088,10 @@
+ (const_int 28)]
+ (const_int 36))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9092,10 +9102,10 @@
+ ;; Loop counter in memory or sar case.
+ ;; Extra goo to deal with additional reload insns.
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 8)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 12)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -9123,10 +9133,10 @@
+ ;; Short branch has length of 4
+ ;; Long branch has length of 8
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9139,10 +9149,10 @@
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9150,10 +9160,10 @@
+ (const_int 28)]
+ (const_int 36))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9164,10 +9174,10 @@
+ ;; Loop counter in memory or SAR case.
+ ;; Extra goo to deal with additional reload insns.
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 8)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 12)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -9188,10 +9198,10 @@
+ [(set_attr "type" "parallel_branch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9211,10 +9221,10 @@
+ [(set_attr "type" "parallel_branch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9234,10 +9244,10 @@
+ [(set_attr "type" "parallel_branch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9257,10 +9267,10 @@
+ [(set_attr "type" "parallel_branch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9280,10 +9290,10 @@
+ [(set_attr "type" "parallel_branch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
diff --git a/4.1.2/gentoo/42_all_gcc4-pr27627.patch b/4.1.2/gentoo/42_all_gcc4-pr27627.patch
new file mode 100644
index 0000000..969f521
--- /dev/null
+++ b/4.1.2/gentoo/42_all_gcc4-pr27627.patch
@@ -0,0 +1,34 @@
+http://bugs.gentoo.org/155368
+http://gcc.gnu.org/PR27627
+
+2006-06-24 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/27627
+ * pa/pa-modes.def: Use mips_single_format, mips_double_format and
+ mips_quad_format formats instead of ieee_single_format,
+ ieee_double_format and ieee_quad_format formats, respectively.
+
+--- trunk/gcc/config/pa/pa-modes.def 2006/05/24 23:19:36 114058
++++ trunk/gcc/config/pa/pa-modes.def 2006/05/24 23:23:10 114059
+@@ -1,5 +1,5 @@
+ /* Definitions of target machine for GNU compiler, for the HP Spectrum.
+- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++ Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
+ Contributed by Michael Tiemann (tiemann@cygnus.com) of Cygnus Support
+ and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for
+ Software Science at the University of Utah.
+@@ -21,8 +21,13 @@
+ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
++/* PA-RISC has the same reversed quiet bit as MIPS.
++ ??? Why is this called the MIPS format. */
++RESET_FLOAT_FORMAT (SF, mips_single_format);
++RESET_FLOAT_FORMAT (DF, mips_double_format);
++
+ /* TFmode: IEEE quad floating point (software). */
+-FLOAT_MODE (TF, 16, ieee_quad_format);
++FLOAT_MODE (TF, 16, mips_quad_format);
+
+ /* HPPA floating comparisons produce distinct condition codes. */
+ CC_MODE (CCFP);
diff --git a/4.1.2/gentoo/48_all_gcc4-hppa-mfctl.patch b/4.1.2/gentoo/48_all_gcc4-hppa-mfctl.patch
new file mode 100644
index 0000000..9dbf7da
--- /dev/null
+++ b/4.1.2/gentoo/48_all_gcc4-hppa-mfctl.patch
@@ -0,0 +1,17 @@
+http://lists.parisc-linux.org/pipermail/parisc-linux/2007-January/031157.html
+
+Do not use ,w completer for register != cr11.
+
+Signed-off-by: Guy Martin <gmsoft@tuxicoman.be>
+
+--- gcc-4.1.1/gcc/config/pa/pa.md
++++ gcc-4.1.1/gcc/config/pa/pa.md
+@@ -9854,7 +9854,7 @@
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(const_int 0)] UNSPEC_TP))]
+ ""
+- "{mfctl|mfctl,w} %%cr27,%0"
++ "mfctl %%cr27,%0"
+ [(set_attr "type" "multi")
+ (set_attr "length" "4")])
+
diff --git a/4.1.2/gentoo/49_all_gcc41-pr30473.patch b/4.1.2/gentoo/49_all_gcc41-pr30473.patch
new file mode 100644
index 0000000..f036b9c
--- /dev/null
+++ b/4.1.2/gentoo/49_all_gcc41-pr30473.patch
@@ -0,0 +1,44 @@
+http://gcc.gnu.org/PR30473
+http://bugs.gentoo.org/163623
+
+2007-02-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/30473
+ * builtins.c (fold_builtin_sprintf): Do not attempt to optimize
+ sprintf (str, "%s"). Do not optimize sprintf (str, "nopercent", p++).
+
+--- gcc/builtins.c.jj 2007-02-01 11:03:12.000000000 +0100
++++ gcc/builtins.c 2007-02-01 14:20:20.000000000 +0100
+@@ -10553,6 +10553,7 @@ fold_builtin_sprintf (tree arglist, int
+ /* Get the destination string and the format specifier. */
+ dest = TREE_VALUE (arglist);
+ fmt = TREE_VALUE (TREE_CHAIN (arglist));
++ arglist = TREE_CHAIN (TREE_CHAIN (arglist));
+
+ /* Check whether the format is a literal string constant. */
+ fmt_str = c_getstr (fmt);
+@@ -10573,6 +10574,10 @@ fold_builtin_sprintf (tree arglist, int
+ if (!fn)
+ return NULL_TREE;
+
++ /* Don't optimize sprintf (buf, "abc", ptr++). */
++ if (arglist)
++ return NULL_TREE;
++
+ /* Convert sprintf (str, fmt) into strcpy (str, fmt) when
+ 'format' is known to contain no % formats. */
+ arglist = build_tree_list (NULL_TREE, fmt);
+@@ -10591,8 +10596,12 @@ fold_builtin_sprintf (tree arglist, int
+ if (!fn)
+ return NULL_TREE;
+
++ /* Don't crash on sprintf (str1, "%s"). */
++ if (!arglist)
++ return NULL_TREE;
++
+ /* Convert sprintf (str1, "%s", str2) into strcpy (str1, str2). */
+- orig = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
++ orig = TREE_VALUE (arglist);
+ arglist = build_tree_list (NULL_TREE, orig);
+ arglist = tree_cons (NULL_TREE, dest, arglist);
+ if (!ignored)
diff --git a/4.1.2/gentoo/51_all_gcc-3.4-libiberty-pic.patch b/4.1.2/gentoo/51_all_gcc-3.4-libiberty-pic.patch
new file mode 100644
index 0000000..d9a95a2
--- /dev/null
+++ b/4.1.2/gentoo/51_all_gcc-3.4-libiberty-pic.patch
@@ -0,0 +1,10 @@
+--- gcc-4.1.0-orig/libiberty/Makefile.in 2006-03-01 15:49:14.000000000 -0500
++++ gcc-4.1.0/libiberty/Makefile.in 2006-03-01 18:10:46.000000000 -0500
+@@ -232,6 +232,7 @@
+ $(AR) $(AR_FLAGS) $(TARGETLIB) \
+ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
+ $(RANLIB) $(TARGETLIB); \
++ cp $(TARGETLIB) ../ ; \
+ cd ..; \
+ else true; fi
+
diff --git a/4.1.2/gentoo/53_all_gcc4-superh-default-multilib.patch b/4.1.2/gentoo/53_all_gcc4-superh-default-multilib.patch
new file mode 100644
index 0000000..0b9f0d8
--- /dev/null
+++ b/4.1.2/gentoo/53_all_gcc4-superh-default-multilib.patch
@@ -0,0 +1,23 @@
+The gcc-3.x toolchains would contain all the targets by default. With gcc-4,
+you have to actually list out the multilibs you want or you will end up with
+just one when using targets like 'sh4-linux-gnu'.
+
+The resulting toolchain can't even build a kernel as the kernel needs to build
+with the nofpu flag to be sure that no fpu ops are generated.
+
+Here we restore the gcc-3.x behavior; the additional overhead of building all
+of these multilibs by default is negligible.
+
+http://bugs.gentoo.org/140205
+
+--- gcc-4.1.1/gcc/config.gcc
++++ gcc-4.1.1/gcc/config.gcc
+@@ -1992,7 +1992,7 @@
+ sh_multilibs=${with_multilib_list}
+ if test x${sh_multilibs} = x ; then
+ case ${target} in
+- sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
++ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
+ sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
+ sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
+ sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;;
diff --git a/4.1.2/gentoo/54_all_300-libstdc++-pic.patch b/4.1.2/gentoo/54_all_300-libstdc++-pic.patch
new file mode 100644
index 0000000..886e864
--- /dev/null
+++ b/4.1.2/gentoo/54_all_300-libstdc++-pic.patch
@@ -0,0 +1,53 @@
+install libstdc++_pic.a if we have pic objs
+
+--- gcc/libstdc++-v3/src/Makefile.am
++++ gcc/libstdc++-v3/src/Makefile.am
+@@ -214,6 +214,13 @@
+ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
+
+
++install-exec-local:
++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
++ if [ x"$$pic_objs" != x ]; then \
++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
++ fi
++
+ # Added bits to build debug library.
+ if GLIBCXX_BUILD_DEBUG
+ all-local: build_debug
+--- gcc/libstdc++-v3/src/Makefile.in
++++ gcc/libstdc++-v3/src/Makefile.in
+@@ -625,7 +625,7 @@
+
+ install-data-am: install-data-local
+
+-install-exec-am: install-toolexeclibLTLIBRARIES
++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
+
+ install-info: install-info-am
+
+@@ -664,7 +664,7 @@
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am \
+- uninstall-toolexeclibLTLIBRARIES
++ uninstall-toolexeclibLTLIBRARIES install-exec-local
+
+ @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@libstdc++-symbol.ver: ${glibcxx_srcdir}/$(SYMVER_MAP)
+ @GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE@ cp ${glibcxx_srcdir}/$(SYMVER_MAP) ./libstdc++-symbol.ver
+@@ -743,6 +743,14 @@
+ install_debug:
+ (cd ${debugdir} && $(MAKE) \
+ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
++
++install-exec-local:
++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
++ if [ x"$$pic_objs" != x ]; then \
++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
++ fi
++
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
diff --git a/4.1.2/gentoo/61_all_gcc4-ia64-noteGNUstack.patch b/4.1.2/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
new file mode 100644
index 0000000..17cc7ef
--- /dev/null
+++ b/4.1.2/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
@@ -0,0 +1,88 @@
+2004-09-20 Jakub Jelinek <jakub@redhat.com>
+
+ * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
+ on ppc64-linux.
+
+ * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
+ ia64-linux.
+ * config/ia64/crtbegin.asm: Likewise.
+ * config/ia64/crtend.asm: Likewise.
+ * config/ia64/crti.asm: Likewise.
+ * config/ia64/crtn.asm: Likewise.
+
+2004-05-14 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
+
+--- gcc/config/ia64/linux.h.jj 2004-05-14 07:21:27.000000000 -0400
++++ gcc/config/ia64/linux.h 2004-05-14 09:21:09.000000000 -0400
+@@ -5,6 +5,8 @@
+
+ #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
+
++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
++
+ /* This is for -profile to use -lc_p instead of -lc. */
+ #undef CC1_SPEC
+ #define CC1_SPEC "%{profile:-p} %{G*}"
+--- gcc/config/rs6000/ppc-asm.h.jj 2003-06-04 18:40:59.000000000 +0200
++++ gcc/config/rs6000/ppc-asm.h 2004-09-20 14:17:47.259396058 +0200
+@@ -158,7 +158,7 @@ GLUE(.L,name): \
+ .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
+ #endif
+
+-#if defined __linux__ && !defined __powerpc64__
++#if defined __linux__
+ .section .note.GNU-stack
+ .previous
+ #endif
+--- gcc/config/ia64/lib1funcs.asm.jj 2003-10-27 11:45:17.000000000 +0100
++++ gcc/config/ia64/lib1funcs.asm 2004-09-20 14:26:28.094132706 +0200
+@@ -741,3 +741,7 @@ __floattitf:
+ .endp __floattitf
+
+ #endif
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- gcc/config/ia64/crtend.asm.jj 2004-05-20 14:36:14.000000000 +0200
++++ gcc/config/ia64/crtend.asm 2004-09-20 14:25:57.329580329 +0200
+@@ -113,3 +113,7 @@ __do_global_ctors_aux:
+
+ br.ret.sptk.many rp
+ .endp __do_global_ctors_aux
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- gcc/config/ia64/crti.asm.jj 2003-04-02 17:14:15.000000000 +0200
++++ gcc/config/ia64/crti.asm 2004-09-20 14:26:06.852894092 +0200
+@@ -64,3 +64,7 @@ _fini:
+ .body
+
+ # end of crti.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- gcc/config/ia64/crtbegin.asm.jj 2004-05-20 14:36:14.000000000 +0200
++++ gcc/config/ia64/crtbegin.asm 2004-09-20 14:25:47.105390566 +0200
+@@ -246,3 +246,7 @@ __do_jv_register_classes:
+ .weak __cxa_finalize
+ #endif
+ .weak _Jv_RegisterClasses
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- gcc/config/ia64/crtn.asm.jj 2003-04-02 17:14:15.000000000 +0200
++++ gcc/config/ia64/crtn.asm 2004-09-20 14:26:16.381206878 +0200
+@@ -54,3 +54,7 @@
+ br.ret.sptk.many b0
+
+ # end of crtn.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
diff --git a/4.1.2/gentoo/62_all_gcc4-noteGNUstack.patch b/4.1.2/gentoo/62_all_gcc4-noteGNUstack.patch
new file mode 100644
index 0000000..bbc38b9
--- /dev/null
+++ b/4.1.2/gentoo/62_all_gcc4-noteGNUstack.patch
@@ -0,0 +1,182 @@
+2005-02-08 Jakub Jelinek <jakub@redhat.com>
+
+ * src/alpha/osf.S: Add .note.GNU-stack on Linux.
+ * src/s390/sysv.S: Likewise.
+ * src/powerpc/linux64.S: Likewise.
+ * src/powerpc/linux64_closure.S: Likewise.
+ * src/powerpc/ppc_closure.S: Likewise.
+ * src/powerpc/sysv.S: Likewise.
+ * src/x86/unix64.S: Likewise.
+ * src/x86/sysv.S: Likewise.
+ * src/sparc/v8.S: Likewise.
+ * src/sparc/v9.S: Likewise.
+ * src/m68k/sysv.S: Likewise.
+ * src/ia64/unix.S: Likewise.
+ * src/arm/sysv.S: Likewise.
+
+ * ia64_save_regs_in_stack.s: Moved to...
+ * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack
+ on Linux.
+
+--- libffi/src/alpha/osf.S.jj 2003-10-23 09:55:21.000000000 +0200
++++ libffi/src/alpha/osf.S 2005-02-08 16:12:40.215425842 +0100
+@@ -352,4 +352,8 @@ $LASFDE3:
+ .byte 0x12 # uleb128 0x12
+ .align 3
+ $LEFDE3:
++
++#ifdef __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+ #endif
+--- libffi/src/s390/sysv.S.jj 2003-10-23 09:55:21.000000000 +0200
++++ libffi/src/s390/sysv.S 2005-02-08 16:22:30.810943388 +0100
+@@ -427,3 +427,6 @@ ffi_closure_SYSV:
+
+ #endif
+
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- libffi/src/powerpc/linux64.S.jj 2004-09-03 12:35:54.000000000 +0200
++++ libffi/src/powerpc/linux64.S 2005-02-08 16:18:41.998808639 +0100
+@@ -174,3 +174,7 @@ ffi_call_LINUX64:
+ .align 3
+ .LEFDE1:
+ #endif
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- libffi/src/powerpc/linux64_closure.S.jj 2004-09-03 12:35:54.000000000 +0200
++++ libffi/src/powerpc/linux64_closure.S 2005-02-08 16:18:53.821697060 +0100
+@@ -203,3 +203,7 @@ ffi_closure_LINUX64:
+ .align 3
+ .LEFDE1:
+ #endif
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- libffi/src/powerpc/ppc_closure.S.jj 2004-09-03 12:35:54.000000000 +0200
++++ libffi/src/powerpc/ppc_closure.S 2005-02-08 16:18:25.734713428 +0100
+@@ -248,3 +248,7 @@ END(ffi_closure_SYSV)
+ .LEFDE1:
+
+ #endif
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- libffi/src/powerpc/sysv.S.jj 2004-09-03 12:35:54.000000000 +0200
++++ libffi/src/powerpc/sysv.S 2005-02-08 16:18:13.673867518 +0100
+@@ -187,3 +187,7 @@ END(ffi_call_SYSV)
+ .align 2
+ .LEFDE1:
+ #endif
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- libffi/src/x86/unix64.S.jj 2004-12-27 13:01:37.000000000 +0100
++++ libffi/src/x86/unix64.S 2005-02-08 16:25:38.656395947 +0100
+@@ -373,3 +373,7 @@ ffi_closure_unix64:
+ .LEFDE3:
+
+ #endif /* __x86_64__ */
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- libffi/src/x86/sysv.S.jj 2003-10-23 09:55:21.000000000 +0200
++++ libffi/src/x86/sysv.S 2005-02-08 16:25:28.197263821 +0100
+@@ -182,3 +182,7 @@ epilogue:
+ .LEFDE1:
+
+ #endif /* ifndef __x86_64__ */
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- libffi/src/sparc/v8.S.jj 2004-11-24 22:02:00.000000000 +0100
++++ libffi/src/sparc/v8.S 2005-02-08 16:22:55.220583988 +0100
+@@ -265,3 +265,7 @@ done2:
+ .byte 0x1f ! uleb128 0x1f
+ .align WS
+ .LLEFDE2:
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- libffi/src/sparc/v9.S.jj 2004-01-26 11:34:57.000000000 +0100
++++ libffi/src/sparc/v9.S 2005-02-08 16:25:12.153129117 +0100
+@@ -300,3 +300,7 @@ longdouble1:
+ .align 8
+ .LLEFDE2:
+ #endif
++
++#ifdef __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- libffi/src/m68k/sysv.S.jj 2003-10-23 09:55:21.000000000 +0200
++++ libffi/src/m68k/sysv.S 2005-02-08 16:16:18.341466343 +0100
+@@ -95,3 +95,7 @@ epilogue:
+ unlk %a6
+ rts
+ .size ffi_call_SYSV,.-ffi_call_SYSV
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- libffi/src/ia64/unix.S.jj 2005-01-04 15:42:01.000000000 +0100
++++ libffi/src/ia64/unix.S 2005-02-08 16:16:01.253518356 +0100
+@@ -572,3 +572,7 @@ ffi_closure_unix:
+ data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
+ data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
+ data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE
++
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- libffi/src/arm/sysv.S.jj 2004-10-28 15:10:11.000000000 +0200
++++ libffi/src/arm/sysv.S 2005-02-08 16:14:02.282767581 +0100
+@@ -207,3 +207,6 @@ LSYM(Lepilogue):
+ .ffi_call_SYSV_end:
+ .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
+
++#if defined __ELF__ && defined __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- boehm-gc/ia64_save_regs_in_stack.S.jj 2005-02-08 16:32:57.368040486 +0100
++++ boehm-gc/ia64_save_regs_in_stack.S 2005-02-08 16:33:36.243096641 +0100
+@@ -0,0 +1,15 @@
++ .text
++ .align 16
++ .global GC_save_regs_in_stack
++ .proc GC_save_regs_in_stack
++GC_save_regs_in_stack:
++ .body
++ flushrs
++ ;;
++ mov r8=ar.bsp
++ br.ret.sptk.few rp
++ .endp GC_save_regs_in_stack
++
++#ifdef __linux__
++ .section .note.GNU-stack,"",@progbits
++#endif
+--- boehm-gc/ia64_save_regs_in_stack.s.jj 2004-06-30 09:32:52.000000000 +0200
++++ boehm-gc/ia64_save_regs_in_stack.s 2005-02-08 16:32:51.555078799 +0100
+@@ -1,12 +0,0 @@
+- .text
+- .align 16
+- .global GC_save_regs_in_stack
+- .proc GC_save_regs_in_stack
+-GC_save_regs_in_stack:
+- .body
+- flushrs
+- ;;
+- mov r8=ar.bsp
+- br.ret.sptk.few rp
+- .endp GC_save_regs_in_stack
+-
diff --git a/4.1.2/gentoo/74_all_sh-pr24836.patch b/4.1.2/gentoo/74_all_sh-pr24836.patch
new file mode 100644
index 0000000..7992282
--- /dev/null
+++ b/4.1.2/gentoo/74_all_sh-pr24836.patch
@@ -0,0 +1,25 @@
+http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
+
+--- gcc/gcc/configure.ac (revision 106699)
++++ gcc/gcc/configure.ac (working copy)
+@@ -2446,7 +2446,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
+--- gcc/gcc/configure
++++ gcc/gcc/configure
+@@ -14846,7 +14846,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
diff --git a/4.1.2/gentoo/85_all_gcc-ca-translation-typo.patch b/4.1.2/gentoo/85_all_gcc-ca-translation-typo.patch
new file mode 100644
index 0000000..e3f9f77
--- /dev/null
+++ b/4.1.2/gentoo/85_all_gcc-ca-translation-typo.patch
@@ -0,0 +1,17 @@
+http://bugs.gentoo.org/127190
+
+2006-03-28 Harald van Dijk <truedfx@gentoo.org>
+
+ * ca.po: Fix printf flag typo in negative value translation.
+
+--- gcc-4_1-branch/gcc/po/ca.po
++++ gcc-4_1-branch/gcc/po/ca.po
+@@ -31083,7 +31083,7 @@ msgstr "s'ignora l'atribut \"%s\""
+ #~ msgstr "passant el valor negatiu `%E' per a %s %P de \"%D\""
+
+ #~ msgid "%s of negative value `%E' to `%T'"
+-#~ msgstr "%s de valor negatiu `%I' a \"%T\""
++#~ msgstr "%s de valor negatiu `%E' a \"%T\""
+
+ #~ msgid "initializing array with parameter list"
+ #~ msgstr "inicialitzant una matriu amb una llista de paràmetres"
diff --git a/4.1.2/gentoo/89_all_gcc42-sparc64-ssp.patch b/4.1.2/gentoo/89_all_gcc42-sparc64-ssp.patch
new file mode 100644
index 0000000..fad5e44
--- /dev/null
+++ b/4.1.2/gentoo/89_all_gcc42-sparc64-ssp.patch
@@ -0,0 +1,23 @@
+http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00177.html
+
+2006-02-02 Jakub Jelinek <jakub@redhat.com>
+
+ * config/sparc/sparc.c (sparc_output_scratch_registers): Use
+ #ignore instead of #scratch for %g7 .register directive.
+
+Index: trunk/gcc/config/sparc/sparc.c
+===================================================================
+--- trunk/gcc/config/sparc/sparc.c (revision 110521)
++++ trunk/gcc/config/sparc/sparc.c (revision 110522)
+@@ -3693,7 +3693,10 @@ sparc_output_scratch_registers (FILE *fi
+ && ! sparc_hard_reg_printed [i])
+ {
+ sparc_hard_reg_printed [i] = 1;
+- fprintf (file, "\t.register\t%%g%d, #scratch\n", i);
++ /* %g7 is used as TLS base register, use #ignore
++ for it instead of #scratch. */
++ fprintf (file, "\t.register\t%%g%d, #%s\n", i,
++ i == 7 ? "ignore" : "scratch");
+ }
+ if (i == 3) i = 5;
+ }
diff --git a/4.1.2/gentoo/90_all_mips-add-march-r10k.patch b/4.1.2/gentoo/90_all_mips-add-march-r10k.patch
new file mode 100644
index 0000000..27e0c62
--- /dev/null
+++ b/4.1.2/gentoo/90_all_mips-add-march-r10k.patch
@@ -0,0 +1,394 @@
+diff -Naurp gcc-4.1.0/gcc/config/mips/10000.md gcc-4.1.0.r10k/gcc/config/mips/10000.md
+--- gcc-4.1.0/gcc/config/mips/10000.md 1970-01-01 00:00:00 +0000
++++ gcc-4.1.0.r10k/gcc/config/mips/10000.md 2006-05-17 17:08:45 +0000
+@@ -0,0 +1,248 @@
++;; VR1x000 pipeline description.
++;; Copyright (C) 2005, 2006 Free Software Foundation, Inc.
++;;
++;; This file is part of GCC.
++
++;; GCC 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.
++
++;; GCC 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 GCC; see the file COPYING. If not, write to the
++;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
++;; MA 02110-1301, USA.
++
++
++;; This file overrides parts of generic.md. It is derived from the
++;; old define_function_unit description.
++
++
++
++;; R12K/R14K/R16K are derivatives of R10K, thus copy its description
++;; until specific tuning for each is added
++
++
++;; R10000 has int queue, fp queue, address queue
++(define_automaton "r10k_int, r10k_fp, r10k_addr")
++
++;; R10000 has 2 integer ALUs, fp-adder and fp-multiplier, load/store
++(define_cpu_unit "r10k_alu1" "r10k_int")
++(define_cpu_unit "r10k_alu2" "r10k_int")
++(define_cpu_unit "r10k_fpadd" "r10k_fp")
++(define_cpu_unit "r10k_fpmpy" "r10k_fp")
++(define_cpu_unit "r10k_loadstore" "r10k_addr")
++
++;; R10000 has separate fp-div and fp-sqrt units as well and these can
++;; execute in parallel, however their issue & completion logic is shared
++;; by the fp-multiplier
++(define_cpu_unit "r10k_fpdiv" "r10k_fp")
++(define_cpu_unit "r10k_fpsqrt" "r10k_fp")
++
++
++
++
++;; loader
++(define_insn_reservation "r10k_load" 2
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (eq_attr "type" "load,prefetch,prefetchx"))
++ "r10k_loadstore")
++
++(define_insn_reservation "r10k_store" 0
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (eq_attr "type" "store,fpstore,fpidxstore"))
++ "r10k_loadstore")
++
++(define_insn_reservation "r10k_fpload" 3
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (eq_attr "type" "fpload,fpidxload"))
++ "r10k_loadstore")
++
++
++
++
++;; Integer add/sub + logic ops, and mf/mt hi/lo can be done by alu1 or alu2
++;; Miscellaneous arith goes here too (this is a guess)
++(define_insn_reservation "r10k_arith" 1
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (eq_attr "type" "arith,mfhilo,mthilo,slt,clz,const,nop,trap"))
++ "r10k_alu1 | r10k_alu2")
++
++
++
++
++;; ALU1 handles shifts, branch eval, and condmove
++;;
++;; Brancher is separate, but part of ALU1, but can only
++;; do one branch per cycle (needs implementing??)
++;;
++;; jump, call - unsure if brancher handles these too (added for now)
++(define_insn_reservation "r10k_shift" 1
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (eq_attr "type" "shift,branch,jump,call"))
++ "r10k_alu1")
++
++(define_insn_reservation "r10k_int_cmove" 1
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "condmove")
++ (eq_attr "mode" "SI,DI")))
++ "r10k_alu1")
++
++
++
++
++;; Coprocessor Moves
++;; mtc1/dmtc1 are handled by ALU1
++;; mfc1/dmfc1 are handled by the fp-multiplier
++(define_insn_reservation "r10k_mt_xfer" 3
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "xfer")
++ (not (match_operand 0 "fpr_operand"))))
++ "r10k_alu1")
++
++(define_insn_reservation "r10k_mf_xfer" 2
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "xfer")
++ (match_operand 0 "fpr_operand")))
++ "r10k_fpmpy")
++
++
++
++
++;; Only ALU2 does int multiplications and divisions
++;; R10K allows an int insn using register Lo to be issued
++;; one cycle earlier than an insn using register Hi for
++;; the insns below, however, we skip on doing this
++;; for now until correct usage of lo_operand() is figured
++;; out.
++;;
++;; Divides keep ALU2 busy, but this isn't expressed here (I think...?)
++(define_insn_reservation "r10k_imul_single" 6
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "imul,imul3,imadd")
++ (eq_attr "mode" "SI")))
++ "r10k_alu2 * 6")
++
++(define_insn_reservation "r10k_imul_double" 10
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "imul,imul3,imadd")
++ (eq_attr "mode" "DI")))
++ "r10k_alu2 * 10")
++
++(define_insn_reservation "r10k_idiv_single" 35
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "idiv")
++ (eq_attr "mode" "SI")))
++ "r10k_alu2 * 35")
++
++(define_insn_reservation "r10k_idiv_double" 67
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "idiv")
++ (eq_attr "mode" "DI")))
++ "r10k_alu2 * 67")
++
++
++
++
++;; FP add/sub, mul, abs value, neg, comp, & moves
++(define_insn_reservation "r10k_fp_miscadd" 2
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (eq_attr "type" "fadd,fabs,fneg,fcmp"))
++ "r10k_fpadd")
++
++(define_insn_reservation "r10k_fp_miscmul" 2
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (eq_attr "type" "fmul,fmove"))
++ "r10k_fpmpy")
++
++(define_insn_reservation "r10k_fp_cmove" 2
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "condmove")
++ (eq_attr "mode" "SF,DF")))
++ "r10k_fpmpy")
++
++
++
++
++;; fcvt.s.[wl] has latency 4, repeat 2
++;; All other fcvt have latency 2, repeat 1
++(define_insn_reservation "r10k_fcvt_single" 4
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "fcvt")
++ (eq_attr "cnv_mode" "I2S")))
++ "r10k_fpadd * 2")
++
++(define_insn_reservation "r10k_fcvt_other" 2
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "fcvt")
++ (eq_attr "cnv_mode" "!I2S")))
++ "r10k_fpadd")
++
++
++
++
++;; fmadd - Runs through fp-adder first, then fp-multiplier
++;;
++;; The latency for fmadd is 2 cycles if the result is used
++;; by another fmadd instruction
++(define_insn_reservation "r10k_fmadd" 4
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (eq_attr "type" "fmadd"))
++ "r10k_fpadd, r10k_fpmpy")
++
++(define_bypass 2 "r10k_fmadd" "r10k_fmadd")
++
++
++
++
++;; fp Divisions & square roots
++(define_insn_reservation "r10k_fdiv_single" 12
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "fdiv,frdiv")
++ (eq_attr "mode" "SF")))
++ "r10k_fpdiv * 14")
++
++(define_insn_reservation "r10k_fdiv_double" 19
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "fdiv,frdiv")
++ (eq_attr "mode" "DF")))
++ "r10k_fpdiv * 21")
++
++(define_insn_reservation "r10k_fsqrt_single" 18
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "fsqrt")
++ (eq_attr "mode" "SF")))
++ "r10k_fpsqrt * 20")
++
++(define_insn_reservation "r10k_fsqrt_double" 33
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "fsqrt")
++ (eq_attr "mode" "DF")))
++ "r10k_fpsqrt * 35")
++
++(define_insn_reservation "r10k_frsqrt_single" 30
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "frsqrt")
++ (eq_attr "mode" "SF")))
++ "r10k_fpsqrt * 20")
++
++(define_insn_reservation "r10k_frsqrt_double" 52
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (and (eq_attr "type" "frsqrt")
++ (eq_attr "mode" "DF")))
++ "r10k_fpsqrt * 35")
++
++
++
++
++;; Unknown/multi (this is a guess)
++(define_insn_reservation "r10k_unknown" 1
++ (and (eq_attr "cpu" "r10000,r12000,r14000,r16000")
++ (eq_attr "type" "unknown,multi"))
++ "r10k_alu1 + r10k_alu2")
++
+diff -Naurp gcc-4.1.0/gcc/config/mips/mips.c gcc-4.1.0.r10k/gcc/config/mips/mips.c
+--- gcc-4.1.0/gcc/config/mips/mips.c 2005-12-09 08:15:58 +0000
++++ gcc-4.1.0.r10k/gcc/config/mips/mips.c 2006-05-17 16:45:38 +0000
+@@ -736,6 +736,10 @@ const struct mips_cpu_info mips_cpu_info
+
+ /* MIPS IV */
+ { "r8000", PROCESSOR_R8000, 4 },
++ { "r10000", PROCESSOR_R10000, 4 },
++ { "r12000", PROCESSOR_R12000, 4 },
++ { "r14000", PROCESSOR_R14000, 4 },
++ { "r16000", PROCESSOR_R16000, 4 },
+ { "vr5000", PROCESSOR_R5000, 4 },
+ { "vr5400", PROCESSOR_R5400, 4 },
+ { "vr5500", PROCESSOR_R5500, 4 },
+@@ -1015,6 +1019,58 @@ static struct mips_rtx_cost_data const m
+ 1, /* branch_cost */
+ 4 /* memory_latency */
+ },
++ { /* R10000 */
++ COSTS_N_INSNS (2), /* fp_add */
++ COSTS_N_INSNS (2), /* fp_mult_sf */
++ COSTS_N_INSNS (2), /* fp_mult_df */
++ COSTS_N_INSNS (12), /* fp_div_sf */
++ COSTS_N_INSNS (19), /* fp_div_df */
++ COSTS_N_INSNS (6), /* int_mult_si */
++ COSTS_N_INSNS (10), /* int_mult_di */
++ COSTS_N_INSNS (35), /* int_div_si */
++ COSTS_N_INSNS (67), /* int_div_di */
++ 1, /* branch_cost */
++ 4 /* memory_latency */
++ },
++ { /* R12000 */
++ COSTS_N_INSNS (2), /* fp_add */
++ COSTS_N_INSNS (2), /* fp_mult_sf */
++ COSTS_N_INSNS (2), /* fp_mult_df */
++ COSTS_N_INSNS (12), /* fp_div_sf */
++ COSTS_N_INSNS (19), /* fp_div_df */
++ COSTS_N_INSNS (6), /* int_mult_si */
++ COSTS_N_INSNS (10), /* int_mult_di */
++ COSTS_N_INSNS (35), /* int_div_si */
++ COSTS_N_INSNS (67), /* int_div_di */
++ 1, /* branch_cost */
++ 4 /* memory_latency */
++ },
++ { /* R14000 */
++ COSTS_N_INSNS (2), /* fp_add */
++ COSTS_N_INSNS (2), /* fp_mult_sf */
++ COSTS_N_INSNS (2), /* fp_mult_df */
++ COSTS_N_INSNS (12), /* fp_div_sf */
++ COSTS_N_INSNS (19), /* fp_div_df */
++ COSTS_N_INSNS (6), /* int_mult_si */
++ COSTS_N_INSNS (10), /* int_mult_di */
++ COSTS_N_INSNS (35), /* int_div_si */
++ COSTS_N_INSNS (67), /* int_div_di */
++ 1, /* branch_cost */
++ 4 /* memory_latency */
++ },
++ { /* R16000 */
++ COSTS_N_INSNS (2), /* fp_add */
++ COSTS_N_INSNS (2), /* fp_mult_sf */
++ COSTS_N_INSNS (2), /* fp_mult_df */
++ COSTS_N_INSNS (12), /* fp_div_sf */
++ COSTS_N_INSNS (19), /* fp_div_df */
++ COSTS_N_INSNS (6), /* int_mult_si */
++ COSTS_N_INSNS (10), /* int_mult_di */
++ COSTS_N_INSNS (35), /* int_div_si */
++ COSTS_N_INSNS (67), /* int_div_di */
++ 1, /* branch_cost */
++ 4 /* memory_latency */
++ },
+ { /* SB1 */
+ COSTS_N_INSNS (4), /* fp_add */
+ COSTS_N_INSNS (4), /* fp_mult_sf */
+@@ -9871,6 +9927,12 @@ mips_issue_rate (void)
+ {
+ switch (mips_tune)
+ {
++ case PROCESSOR_R10000:
++ case PROCESSOR_R12000:
++ case PROCESSOR_R14000:
++ case PROCESSOR_R16000:
++ return 4;
++
+ case PROCESSOR_R4130:
+ case PROCESSOR_R5400:
+ case PROCESSOR_R5500:
+diff -Naurp gcc-4.1.0/gcc/config/mips/mips.h gcc-4.1.0.r10k/gcc/config/mips/mips.h
+--- gcc-4.1.0/gcc/config/mips/mips.h 2006-02-17 21:38:59 +0000
++++ gcc-4.1.0.r10k/gcc/config/mips/mips.h 2006-05-17 16:45:38 +0000
+@@ -57,6 +57,10 @@ enum processor_type {
+ PROCESSOR_R7000,
+ PROCESSOR_R8000,
+ PROCESSOR_R9000,
++ PROCESSOR_R10000,
++ PROCESSOR_R12000,
++ PROCESSOR_R14000,
++ PROCESSOR_R16000,
+ PROCESSOR_SB1,
+ PROCESSOR_SR71000,
+ PROCESSOR_MAX
+@@ -192,6 +196,10 @@ extern const struct mips_rtx_cost_data *
+ #define TARGET_MIPS5500 (mips_arch == PROCESSOR_R5500)
+ #define TARGET_MIPS7000 (mips_arch == PROCESSOR_R7000)
+ #define TARGET_MIPS9000 (mips_arch == PROCESSOR_R9000)
++#define TARGET_MIPS10000 (mips_arch == PROCESSOR_R10000)
++#define TARGET_MIPS12000 (mips_arch == PROCESSOR_R12000)
++#define TARGET_MIPS14000 (mips_arch == PROCESSOR_R14000)
++#define TARGET_MIPS16000 (mips_arch == PROCESSOR_R16000)
+ #define TARGET_SB1 (mips_arch == PROCESSOR_SB1)
+ #define TARGET_SR71K (mips_arch == PROCESSOR_SR71000)
+
+@@ -207,6 +215,10 @@ extern const struct mips_rtx_cost_data *
+ #define TUNE_MIPS6000 (mips_tune == PROCESSOR_R6000)
+ #define TUNE_MIPS7000 (mips_tune == PROCESSOR_R7000)
+ #define TUNE_MIPS9000 (mips_tune == PROCESSOR_R9000)
++#define TUNE_MIPS10000 (mips_tune == PROCESSOR_R10000)
++#define TUNE_MIPS12000 (mips_tune == PROCESSOR_R12000)
++#define TUNE_MIPS14000 (mips_tune == PROCESSOR_R14000)
++#define TUNE_MIPS16000 (mips_tune == PROCESSOR_R16000)
+ #define TUNE_SB1 (mips_tune == PROCESSOR_SB1)
+
+ /* True if the pre-reload scheduler should try to create chains of
+diff -Naurp gcc-4.1.0/gcc/config/mips/mips.md gcc-4.1.0.r10k/gcc/config/mips/mips.md
+--- gcc-4.1.0/gcc/config/mips/mips.md 2005-07-29 17:25:27 +0000
++++ gcc-4.1.0.r10k/gcc/config/mips/mips.md 2006-05-17 16:45:38 +0000
+@@ -336,7 +336,7 @@
+ ;; Attribute describing the processor. This attribute must match exactly
+ ;; with the processor_type enumeration in mips.h.
+ (define_attr "cpu"
+- "r3000,4kc,4kp,5kc,5kf,20kc,24k,24kx,m4k,r3900,r6000,r4000,r4100,r4111,r4120,r4130,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sr71000"
++ "r3000,4kc,4kp,5kc,5kf,20kc,24k,24kx,m4k,r3900,r6000,r4000,r4100,r4111,r4120,r4130,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,r10000,r12000,r14000,r16000,sb1,sr71000"
+ (const (symbol_ref "mips_tune")))
+
+ ;; The type of hardware hazard associated with this instruction.
+@@ -585,6 +585,7 @@
+ (include "6000.md")
+ (include "7000.md")
+ (include "9000.md")
++(include "10000.md")
+ (include "sb1.md")
+ (include "sr71k.md")
+ (include "generic.md")
diff --git a/4.1.2/gentoo/91_all_mips-ip28_cache_barriers-v4.patch b/4.1.2/gentoo/91_all_mips-ip28_cache_barriers-v4.patch
new file mode 100644
index 0000000..d892f9d
--- /dev/null
+++ b/4.1.2/gentoo/91_all_mips-ip28_cache_barriers-v4.patch
@@ -0,0 +1,359 @@
+diff -Naurp gcc-4.1.1.orig/gcc/config/mips/mips.c gcc-4.1.1/gcc/config/mips/mips.c
+--- gcc-4.1.1.orig/gcc/config/mips/mips.c 2006-06-14 13:36:35.000000000 -0400
++++ gcc-4.1.1/gcc/config/mips/mips.c 2006-06-14 14:06:08.000000000 -0400
+@@ -255,6 +255,9 @@ static const char *const mips_fp_conditi
+ MIPS_FP_CONDITIONS (STRINGIFY)
+ };
+
++/* R10K Cache Barrier Functions */
++#include "r10k-cacheb.c"
++
+ /* A function to save or store a register. The first argument is the
+ register and the second is the stack slot. */
+ typedef void (*mips_save_restore_fn) (rtx, rtx);
+@@ -408,6 +411,7 @@ static rtx mips_expand_builtin_compare (
+ static rtx mips_expand_builtin_bposge (enum mips_builtin_type, rtx);
+ static void mips_encode_section_info (tree, rtx, int);
+
++
+ /* Structure to be filled in by compute_frame_size with register
+ save masks, and offsets for the current function. */
+
+@@ -8959,7 +8963,6 @@ mips_avoid_hazards (void)
+ }
+ }
+
+-
+ /* Implement TARGET_MACHINE_DEPENDENT_REORG. */
+
+ static void
+@@ -8975,6 +8978,10 @@ mips_reorg (void)
+ if (TUNE_MIPS4130 && TARGET_VR4130_ALIGN)
+ vr4130_align_insns ();
+ }
++ if (TARGET_R10K_SPECEX)
++ {
++ r10k_insert_cache_barriers ();
++ }
+ }
+
+ /* This function does three things:
+diff -Naurp gcc-4.1.1.orig/gcc/config/mips/mips.opt gcc-4.1.1/gcc/config/mips/mips.opt
+--- gcc-4.1.1.orig/gcc/config/mips/mips.opt 2005-07-23 04:36:54.000000000 -0400
++++ gcc-4.1.1/gcc/config/mips/mips.opt 2006-06-14 14:02:34.000000000 -0400
+@@ -216,3 +216,13 @@ Perform VR4130-specific alignment optimi
+ mxgot
+ Target Report Var(TARGET_XGOT)
+ Lift restrictions on GOT size
++
++mr10k-cache-barrier=
++Target Report Joined UInteger Var(TARGET_R10K_SPECEX)
++-mr10k-cache-barrier[=1|2] Generate cache barriers for SGI Indigo2/O2 R10k
++
++mr10k-cache-barrier
++Target Undocumented Var(TARGET_R10K_SPECEX) VarExists
++
++mip28-cache-barrier
++Target Undocumented Var(TARGET_R10K_SPECEX) VarExists
+diff -Naurp gcc-4.1.1.orig/gcc/config/mips/r10k-cacheb.c gcc-4.1.1/gcc/config/mips/r10k-cacheb.c
+--- gcc-4.1.1.orig/gcc/config/mips/r10k-cacheb.c 1969-12-31 19:00:00.000000000 -0500
++++ gcc-4.1.1/gcc/config/mips/r10k-cacheb.c 2006-06-14 14:02:34.000000000 -0400
+@@ -0,0 +1,298 @@
++/* Subroutines used for MIPS code generation: generate cache-barriers
++ for SiliconGraphics IP28 and IP32/R10000 kernel-code.
++ Copyright (C) 2005,2006 peter fuerst, pf@net.alphadv.de.
++
++This file is intended to become part of GCC.
++
++This file 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 file 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 GCC; see the file COPYING. If not, write to the
++Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
++MA 02110-1301 USA. */
++
++
++#define ASM_R10K_CACHE_BARRIER "cache 0x14,0($sp)"
++
++static int is_stack_pointer (rtx *x, void *data);
++static int check_p_mem_expr (rtx *memx, void *data);
++static int check_p_pattern_for_store (rtx *body, void *data);
++static int strmatch (const char *txt, const char *match);
++static int check_insn_for_store (int state, rtx insn);
++static int bb_insert_store_cache_barrier (rtx head, rtx nxtb);
++static int scan_1_bb_for_store (rtx head, rtx end);
++static int r10k_insert_cache_barriers (void);
++
++
++/* Check, whether an instruction is a possibly harmful store instruction,
++ i.e. a store which might cause damage, if speculatively executed. */
++
++/* Return truth value whether the expression `*memx' instantiates
++ (mem:M (not (stackpointer_address or constant))). */
++
++static int
++is_stack_pointer (rtx *x, void *data)
++{
++ return (*x == stack_pointer_rtx);
++}
++
++static int
++check_p_mem_expr (rtx *memx, void *data)
++{
++ if (!MEM_P (*memx) || for_each_rtx (memx, is_stack_pointer, 0))
++ return 0;
++
++ /* Stores/Loads to/from constant addresses can be considered
++ harmless, since:
++ 1) the address is always valid, even when taken speculatively.
++ 2a) the location is (hopefully) never used as a dma-target, thus
++ there is no danger of cache-inconsistency.
++ 2b) uncached loads/stores are guaranteed to be non-speculative. */
++ if ( CONSTANT_P(XEXP (*memx, 0)) )
++ return 0;
++
++ return 1;
++}
++
++/* Return truth value whether we find (set (mem:M (non_stackpointer_address)
++ ...)) in instruction-pattern `body'.
++ Here we assume, that addressing with the stackpointer accesses neither
++ uncached-aliased nor invalid memory.
++ (May be, this applies to the global pointer and frame pointer also,
++ but its saver not to assume it. And probably it's not worthwile to
++ regard these registers)
++
++ Speculative loads from invalid addresses also cause bus errors...
++ So check for (set (reg:M ...) (mem:M (non_stackpointer_address)))
++ too, unless there is an enhanced bus-error handler. */
++
++static int
++check_p_pattern_for_store (rtx *body, void *data)
++{
++ if (*body && GET_CODE (*body) == SET)
++ {
++ /* Cache-barriers for SET_SRC may be requested as well. */
++ if (!(TARGET_R10K_SPECEX & 2))
++ body = &SET_DEST(*body);
++
++ if (for_each_rtx (body, check_p_mem_expr, 0))
++ return 1;
++
++ /* Don't traverse sub-expressions again. */
++ return -1;
++ }
++ return 0;
++}
++
++static int
++strmatch (const char *txt, const char *match)
++{
++ return !strncmp(txt, match, strlen (match));
++}
++
++/* Check for (ins (set (mem:M (dangerous_address)) ...)) or end of the
++ current basic block in instruction `insn'.
++ `state': (internal) recursion-counter and delayslot-flag
++ Criteria to recognize end-of/next basic-block are reduplicated here
++ from final_scan_insn.
++ return >0: `insn' is critical.
++ return <0: `insn' is at end of current basic-block.
++ return 0: `insn' can be ignored. */
++
++static int
++check_insn_for_store (int state, rtx insn)
++{
++ rtx body;
++
++ if (INSN_DELETED_P (insn))
++ return 0;
++
++ if (LABEL_P (insn))
++ return -1;
++
++ if (CALL_P (insn) || JUMP_P (insn) || NONJUMP_INSN_P (insn))
++ {
++ body = PATTERN (insn);
++ if (GET_CODE (body) == SEQUENCE)
++ {
++ /* A delayed-branch sequence. */
++ rtx insq;
++ FOR_EACH_SUBINSN(insq, insn)
++ if (! INSN_DELETED_P (insq))
++ {
++ /* |1: delay-slot completely contained in sequence. */
++ if (check_insn_for_store (8+state|1, insq) > 0)
++ return 1;
++ }
++ /* Following a (conditional) branch sequence, we have a new
++ basic block. */
++ if (JUMP_P (SEQ_BEGIN(insn)))
++ return -1;
++ /* Handle a call sequence like a conditional branch sequence. */
++ if (CALL_P (SEQ_BEGIN(insn)))
++ return -1;
++ }
++ if (GET_CODE (body) == PARALLEL)
++ if (for_each_rtx (&body, check_p_pattern_for_store, 0))
++ return 1;
++
++ /* Now, only a `simple' INSN or JUMP_INSN remains to be checked. */
++ if (NONJUMP_INSN_P (insn))
++ {
++ /* Since we don't know what's inside, we must take inline
++ assembly to be dangerous. */
++ if (GET_CODE (body) == ASM_INPUT)
++ {
++ const char *t = XSTR (body, 0);
++ if (t && !strmatch(t, ASM_R10K_CACHE_BARRIER))
++ return 1;
++ }
++
++ if (check_p_pattern_for_store (&body, 0) > 0)
++ return 1;
++ }
++ /* Handle a CALL_INSN instruction like a conditional branch. */
++ if (JUMP_P (insn) || CALL_P (insn))
++ {
++ /* Following a (conditional) branch, we have a new basic block. */
++ /* But check insn(s) in delay-slot first. If we could know in
++ advance that this jump is in `.reorder' mode, where gas will
++ insert a `nop' into the delay-slot, we could skip this test.
++ Since we don't know, always assume `.noreorder', sometimes
++ emitting a cache-barrier, that isn't needed. */
++ /* But if we are here recursively, already checking a (pseudo-)
++ delay-slot, we are done. */
++ if ( !(state & 1) )
++ for (insn = NEXT_INSN (insn); insn; insn = NEXT_INSN (insn))
++ {
++ if (LABEL_P (insn) || CALL_P (insn) || JUMP_P (insn))
++ /* Not in delay-slot at all. */
++ break;
++
++ if (NONJUMP_INSN_P (insn))
++ {
++ if (GET_CODE (PATTERN (insn)) == SEQUENCE)
++ /* Not in delay-slot at all. */
++ break;
++
++ if (check_insn_for_store (8+state|1, insn) > 0)
++ return 1;
++ /* We're done anyway. */
++ break;
++ }
++ /* skip NOTE,... */;
++ }
++ return -1;
++ }
++ }
++ return 0;
++}
++
++
++/* Scan a basic block, starting with `insn', for a possibly harmful store
++ instruction. If found, output a cache barrier at the start of this
++ block. */
++
++static int
++bb_insert_store_cache_barrier (rtx head, rtx nxtb)
++{
++ rtx insn = head;
++
++ if (!insn || insn == nxtb)
++ return 0;
++
++ while ((insn = NEXT_INSN (insn)) && insn != nxtb)
++ {
++ int found;
++
++ if (NOTE_INSN_BASIC_BLOCK_P(insn)) /* See scan_1_bb_for_store() */
++ break;
++
++ found = check_insn_for_store (0, insn);
++ if (found < 0)
++ break;
++ if (found > 0)
++ {
++ /* found critical store instruction */
++ insn = gen_rtx_ASM_INPUT (VOIDmode,
++ ASM_R10K_CACHE_BARRIER "\t"
++ ASM_COMMENT_START " Cache Barrier");
++ /* Here we rely on the assumption, that an explicit delay-slot
++ - if any - is already embedded (in a sequence) in 'head'! */
++ insn = emit_insn_after (insn, head);
++ return 1;
++ }
++ }
++ return 0;
++}
++
++
++/* Scan one basic block for a possibly harmful store instruction.
++ If found, insert a cache barrier at the start of this block,
++ return number of inserted cache_barriers. */
++
++static int
++scan_1_bb_for_store (rtx head, rtx end)
++{
++ rtx nxtb;
++ int count;
++ gcc_assert (head);
++ gcc_assert (end);
++
++ /* Note: 'end' is not necessarily reached from 'head' (hidden in
++ SEQUENCE, PARALLEL), but 'nxtb' is. */
++ nxtb = NEXT_INSN (end);
++
++ /* Each basic block starts with zero or more CODE_LABEL(s), followed
++ by one NOTE_INSN_BASIC_BLOCK.
++ Note: bb_head may equal next_insn(bb_end) already ! */
++ while (head && head != nxtb && LABEL_P (head))
++ head = NEXT_INSN (head);
++
++ if (!head || head == nxtb)
++ return 0;
++
++ /* Handle the basic block itself, at most up to next CALL_INSN. */
++ count = bb_insert_store_cache_barrier (head, nxtb);
++
++ /* 1) Handle any CALL_INSN instruction like a conditional branch.
++ 2) There may be "basic blocks" in the list, which are no basic blocks
++ at all. (containing CODE_LABELs in the body or gathering several
++ other basic blocks (e.g. bb5 containing bb6,bb7,bb8)). */
++
++ while ((head = NEXT_INSN (head)) && head != nxtb)
++ {
++ if (INSN_DELETED_P (head))
++ continue;
++
++ /* Later we'll be called again for this bb on its own. */
++ if (NOTE_INSN_BASIC_BLOCK_P(head))
++ break;
++
++ if (CALL_P (SEQ_BEGIN (head)) || LABEL_P (head))
++ count += bb_insert_store_cache_barrier (head, nxtb);
++ }
++ return count;
++}
++
++static int
++r10k_insert_cache_barriers (void)
++{
++ if (TARGET_R10K_SPECEX)
++ {
++ basic_block bb;
++
++ FOR_EACH_BB (bb)
++ if (0 <= bb->index)
++ scan_1_bb_for_store (BB_HEAD (bb), BB_END (bb));
++ }
++ return 0;
++}
diff --git a/4.1.2/gentoo/95_all_gcc-mips-dwarf-info.patch b/4.1.2/gentoo/95_all_gcc-mips-dwarf-info.patch
new file mode 100644
index 0000000..1129ba6
--- /dev/null
+++ b/4.1.2/gentoo/95_all_gcc-mips-dwarf-info.patch
@@ -0,0 +1,92 @@
+http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01152.html
+
+http://bugs.gentoo.org/145028
+
+2006-04-01 Joseph S. Myers <joseph@codesourcery.com>
+
+ * dwarf2.h (DW64_CIE_ID): Define.
+ * dwarf2out.c (DWARF_CIE_ID): Define.
+ (output_call_frame_info): Output 0xffffffff before standard 8-byte
+ length header. Use DWARF_CIE_ID.
+ (value_format): Use DW_FORM_data4 or DW_FORM_data8 for
+ dw_val_class_loc_list depending on DWARF_OFFSET_SIZE.
+
+Index: trunk/gcc/dwarf2out.c
+===================================================================
+--- trunk/gcc/dwarf2out.c (revision 112600)
++++ trunk/gcc/dwarf2out.c (revision 112601)
+@@ -288,6 +288,14 @@ dw_fde_node;
+ #endif
+ #endif
+
++/* CIE identifier. */
++#if HOST_BITS_PER_WIDE_INT >= 64
++#define DWARF_CIE_ID \
++ (unsigned HOST_WIDE_INT) (DWARF_OFFSET_SIZE == 4 ? DW_CIE_ID : DW64_CIE_ID)
++#else
++#define DWARF_CIE_ID DW_CIE_ID
++#endif
++
+ /* A pointer to the base of a table that contains frame description
+ information for each routine. */
+ static GTY((length ("fde_table_allocated"))) dw_fde_ref fde_table;
+@@ -2218,6 +2226,9 @@ output_call_frame_info (int for_eh)
+ /* Output the CIE. */
+ ASM_GENERATE_INTERNAL_LABEL (l1, CIE_AFTER_SIZE_LABEL, for_eh);
+ ASM_GENERATE_INTERNAL_LABEL (l2, CIE_END_LABEL, for_eh);
++ if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4 && !for_eh)
++ dw2_asm_output_data (4, 0xffffffff,
++ "Initial length escape value indicating 64-bit DWARF extension");
+ dw2_asm_output_delta (for_eh ? 4 : DWARF_OFFSET_SIZE, l2, l1,
+ "Length of Common Information Entry");
+ ASM_OUTPUT_LABEL (asm_out_file, l1);
+@@ -2225,7 +2236,7 @@ output_call_frame_info (int for_eh)
+ /* Now that the CIE pointer is PC-relative for EH,
+ use 0 to identify the CIE. */
+ dw2_asm_output_data ((for_eh ? 4 : DWARF_OFFSET_SIZE),
+- (for_eh ? 0 : DW_CIE_ID),
++ (for_eh ? 0 : DWARF_CIE_ID),
+ "CIE Identifier Tag");
+
+ dw2_asm_output_data (1, DW_CIE_VERSION, "CIE Version");
+@@ -2350,6 +2361,9 @@ output_call_frame_info (int for_eh)
+ targetm.asm_out.internal_label (asm_out_file, FDE_LABEL, for_eh + i * 2);
+ ASM_GENERATE_INTERNAL_LABEL (l1, FDE_AFTER_SIZE_LABEL, for_eh + i * 2);
+ ASM_GENERATE_INTERNAL_LABEL (l2, FDE_END_LABEL, for_eh + i * 2);
++ if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4 && !for_eh)
++ dw2_asm_output_data (4, 0xffffffff,
++ "Initial length escape value indicating 64-bit DWARF extension");
+ dw2_asm_output_delta (for_eh ? 4 : DWARF_OFFSET_SIZE, l2, l1,
+ "FDE Length");
+ ASM_OUTPUT_LABEL (asm_out_file, l1);
+@@ -6775,6 +6789,7 @@ value_format (dw_attr_ref a)
+ return DW_FORM_addr;
+ case dw_val_class_range_list:
+ case dw_val_class_offset:
++ case dw_val_class_loc_list:
+ switch (DWARF_OFFSET_SIZE)
+ {
+ case 4:
+@@ -6784,10 +6799,6 @@ value_format (dw_attr_ref a)
+ default:
+ gcc_unreachable ();
+ }
+- case dw_val_class_loc_list:
+- /* FIXME: Could be DW_FORM_data8, with a > 32 bit size
+- .debug_loc section */
+- return DW_FORM_data4;
+ case dw_val_class_loc:
+ switch (constant_size (size_of_locs (AT_loc (a))))
+ {
+Index: trunk/gcc/dwarf2.h
+===================================================================
+--- trunk/gcc/dwarf2.h (revision 112600)
++++ trunk/gcc/dwarf2.h (revision 112601)
+@@ -757,6 +757,7 @@ enum dwarf_call_frame_info
+ };
+
+ #define DW_CIE_ID 0xffffffff
++#define DW64_CIE_ID 0xffffffffffffffffULL
+ #define DW_CIE_VERSION 1
+
+ #define DW_CFA_extended 0
diff --git a/4.1.2/gentoo/95_all_gcc-mips-dwarf-old-info.patch b/4.1.2/gentoo/95_all_gcc-mips-dwarf-old-info.patch
new file mode 100644
index 0000000..a109da9
--- /dev/null
+++ b/4.1.2/gentoo/95_all_gcc-mips-dwarf-old-info.patch
@@ -0,0 +1,24 @@
+http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01152.html
+
+http://bugs.gentoo.org/145028
+
+2006-05-04 Joseph S. Myers <joseph@codesourcery.com>
+
+ * config/mips/linux64.h (DWARF_OFFSET_SIZE): Remove.
+
+Index: trunk/gcc/config/mips/linux64.h
+===================================================================
+--- trunk/gcc/config/mips/linux64.h (revision 113523)
++++ trunk/gcc/config/mips/linux64.h (revision 113524)
+@@ -65,11 +65,6 @@ Boston, MA 02110-1301, USA. */
+ #undef LOCAL_LABEL_PREFIX
+ #define LOCAL_LABEL_PREFIX (TARGET_OLDABI ? "$" : ".")
+
+-/* The size in bytes of a DWARF field indicating an offset or length
+- relative to a debug info section, specified to be 4 bytes in the DWARF-2
+- specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */
+-#define DWARF_OFFSET_SIZE PTR_SIZE
+-
+ /* GNU/Linux doesn't use the same floating-point format that IRIX uses
+ for long double. There's no need to override this here, since
+ ieee_quad_format is the default, but let's put this here to make
diff --git a/4.1.2/uclibc/90_all_100-uclibc-conf.patch b/4.1.2/uclibc/90_all_100-uclibc-conf.patch
new file mode 100644
index 0000000..49d576c
--- /dev/null
+++ b/4.1.2/uclibc/90_all_100-uclibc-conf.patch
@@ -0,0 +1,544 @@
+--- gcc-4.1.0/gcc/config/t-linux-uclibc
++++ gcc-4.1.0/gcc/config/t-linux-uclibc
+@@ -0,0 +1,5 @@
++# Remove glibc specific files added in t-linux
++SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
++
++# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc
++LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH))
+--- gcc-4.1.0/gcc/config.gcc
++++ gcc-4.1.0/gcc/config.gcc
+@@ -1887,7 +1887,7 @@ s390x-ibm-tpf*)
+ ;;
+ sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
+ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
+- sh-*-linux* | sh[346lbe]*-*-linux* | \
++ sh*-*-linux* | sh[346lbe]*-*-linux* | \
+ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+ sh64-*-netbsd* | sh64l*-*-netbsd*)
+ tmake_file="${tmake_file} sh/t-sh sh/t-elf"
+@@ -2341,6 +2341,12 @@ m32c-*-elf*)
+ ;;
+ esac
+
++# Rather than hook into each target, just do it after all the linux
++# targets have been processed
++case ${target} in
++*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc"
++esac
++
+ case ${target} in
+ i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1)
+ tmake_file="${tmake_file} i386/t-gmm_malloc"
+--- gcc-4.1.0/boehm-gc/configure
++++ gcc-4.1.0/boehm-gc/configure
+@@ -4320,6 +4320,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/configure
++++ gcc-4.1.0/configure
+@@ -1133,7 +1133,7 @@ no)
+ ;;
+ "")
+ case "${target}" in
+- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
++ *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
+ # Enable libmudflap by default in GNU and friends.
+ ;;
+ *-*-freebsd*)
+--- gcc-4.1.0/configure.in
++++ gcc-4.1.0/configure.in
+@@ -341,7 +341,7 @@ no)
+ ;;
+ "")
+ case "${target}" in
+- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
++ *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
+ # Enable libmudflap by default in GNU and friends.
+ ;;
+ *-*-freebsd*)
+--- gcc-4.1.0/contrib/regression/objs-gcc.sh
++++ gcc-4.1.0/contrib/regression/objs-gcc.sh
+@@ -105,6 +105,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+--- gcc-4.1.0/gcc/config/alpha/linux-elf.h
++++ gcc-4.1.0/gcc/config/alpha/linux-elf.h
+@@ -27,7 +27,11 @@ Boston, MA 02110-1301, USA. */
+ #define SUBTARGET_EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+
++#if defined USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
+ #define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#endif
+
+ #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
+ %{O*:-O3} %{!O*:-O1} \
+--- gcc-4.1.0/gcc/config/arm/linux-elf.h
++++ gcc-4.1.0/gcc/config/arm/linux-elf.h
+@@ -51,7 +51,11 @@
+
+ #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
+
++#ifdef USE_UCLIBC
++#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
++#else
+ #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
++#endif
+
+ #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \
+ %{b} \
+--- gcc-4.1.0/gcc/config/cris/linux.h
++++ gcc-4.1.0/gcc/config/cris/linux.h
+@@ -73,6 +73,25 @@ Boston, MA 02110-1301, USA. */
+ #undef CRIS_DEFAULT_CPU_VERSION
+ #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
+
++#ifdef USE_UCLIBC
++
++#undef CRIS_SUBTARGET_VERSION
++#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
++
++#undef CRIS_LINK_SUBTARGET_SPEC
++#define CRIS_LINK_SUBTARGET_SPEC \
++ "-mcrislinux\
++ -rpath-link include/asm/../..%s\
++ %{shared} %{static}\
++ %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
++ %{!shared: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
++ %{!r:%{O2|O3: --gc-sections}}"
++
++#else /* USE_UCLIBC */
++
+ #undef CRIS_SUBTARGET_VERSION
+ #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
+
+@@ -87,6 +106,8 @@ Boston, MA 02110-1301, USA. */
+ %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
+ %{!r:%{O2|O3: --gc-sections}}"
+
++#endif /* USE_UCLIBC */
++
+
+ /* Node: Run-time Target */
+
+--- gcc-4.1.0/gcc/config/i386/linux.h
++++ gcc-4.1.0/gcc/config/i386/linux.h
+@@ -107,6 +107,11 @@ Boston, MA 02110-1301, USA. */
+ #define LINK_EMULATION "elf_i386"
+ #define DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
++#if defined USE_UCLIBC
++#undef DYNAMIC_LINKER
++#define DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#endif
++
+ #undef SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS \
+ { "link_emulation", LINK_EMULATION },\
+--- gcc-4.1.0/gcc/config/i386/linux64.h
++++ gcc-4.1.0/gcc/config/i386/linux64.h
+@@ -54,14 +54,21 @@ Boston, MA 02110-1301, USA. */
+ When the -shared link option is used a final link is not being
+ done. */
+
++#ifdef USE_UCLIBC
++#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
++#else
++#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
+ %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+- %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
++ %{m32:%{!dynamic-linker:-dynamic-linker " ELF32_DYNAMIC_LINKER "}} \
++ %{!m32:%{!dynamic-linker:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}} \
+ %{static:-static}}"
+
+ /* Similar to standard Linux, but adding -ffast-math support. */
+--- gcc-4.1.0/gcc/config/ia64/linux.h
++++ gcc-4.1.0/gcc/config/ia64/linux.h
+@@ -37,13 +37,18 @@ do { \
+ /* Define this for shared library support because it isn't in the main
+ linux.h file. */
+
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+ %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static:-static}}"
+
+
+--- gcc-4.1.0/gcc/config/m68k/linux.h
++++ gcc-4.1.0/gcc/config/m68k/linux.h
+@@ -123,12 +123,17 @@ Boston, MA 02110-1301, USA. */
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m m68kelf %{shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
++ %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static}}"
+
+ /* For compatibility with linux/a.out */
+--- gcc-4.1.0/gcc/config/mips/linux.h
++++ gcc-4.1.0/gcc/config/mips/linux.h
+@@ -105,6 +105,11 @@ Boston, MA 02110-1301, USA. */
+
+ /* Borrowed from sparc/linux.h */
+ #undef LINK_SPEC
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
++#endif
+ #define LINK_SPEC \
+ "%(endian_spec) \
+ %{shared:-shared} \
+@@ -112,7 +117,7 @@ Boston, MA 02110-1301, USA. */
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static:-static}}}"
+
+ #undef SUBTARGET_ASM_SPEC
+--- gcc-4.1.0/gcc/config/pa/pa-linux.h
++++ gcc-4.1.0/gcc/config/pa/pa-linux.h
+@@ -49,13 +49,18 @@ Boston, MA 02110-1301, USA. */
+ /* Define this for shared library support because it isn't in the main
+ linux.h file. */
+
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+ %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static:-static}}"
+
+ /* glibc's profiling functions don't need gcc to allocate counters. */
+--- gcc-4.1.0/gcc/config/rs6000/linux.h
++++ gcc-4.1.0/gcc/config/rs6000/linux.h
+@@ -72,7 +72,11 @@
+ #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
+
+ #undef LINK_OS_DEFAULT_SPEC
++#ifdef USE_UCLIBC
++#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
++#else
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
++#endif
+
+ #define LINK_GCC_C_SEQUENCE_SPEC \
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+--- gcc-4.1.0/gcc/config/rs6000/sysv4.h
++++ gcc-4.1.0/gcc/config/rs6000/sysv4.h
+@@ -866,6 +866,7 @@ extern int fixuplabelno;
+ mcall-linux : %(link_os_linux) ; \
+ mcall-gnu : %(link_os_gnu) ; \
+ mcall-netbsd : %(link_os_netbsd) ; \
++ mcall-linux-uclibc : %(link_os_linux_uclibc); \
+ mcall-openbsd: %(link_os_openbsd) ; \
+ : %(link_os_default) }"
+
+@@ -1043,6 +1044,10 @@ extern int fixuplabelno;
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
+
++#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
++
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+ # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
+@@ -1209,6 +1214,7 @@ ncrtn.o%s"
+ { "link_os_sim", LINK_OS_SIM_SPEC }, \
+ { "link_os_freebsd", LINK_OS_FREEBSD_SPEC }, \
+ { "link_os_linux", LINK_OS_LINUX_SPEC }, \
++ { "link_os_linux_uclibc", LINK_OS_LINUX_UCLIBC_SPEC }, \
+ { "link_os_gnu", LINK_OS_GNU_SPEC }, \
+ { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
+--- gcc-4.1.0/gcc/config/s390/linux.h
++++ gcc-4.1.0/gcc/config/s390/linux.h
+@@ -77,6 +77,13 @@ Software Foundation, 51 Franklin Street,
+ #define MULTILIB_DEFAULTS { "m31" }
+ #endif
+
++#ifdef USE_UCLIBC
++#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
++#else
++#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1"
++#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
+@@ -86,8 +93,8 @@ Software Foundation, 51 Franklin Street,
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker: \
+- %{m31:-dynamic-linker /lib/ld.so.1} \
+- %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
++ %{m31:-dynamic-linker " ELF31_DYNAMIC_LINKER "} \
++ %{m64:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}}}"
+
+
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+--- gcc-4.1.0/gcc/config/sh/linux.h
++++ gcc-4.1.0/gcc/config/sh/linux.h
+@@ -56,12 +56,21 @@ Boston, MA 02110-1301, USA. */
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
+ #undef SUBTARGET_LINK_SPEC
++#ifdef USE_UCLIBC
++#define SUBTARGET_LINK_SPEC \
++ "%{shared:-shared} \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{static:-static}"
++#else
+ #define SUBTARGET_LINK_SPEC \
+ "%{shared:-shared} \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{static:-static}"
++#endif
+
+ /* Output assembler code to STREAM to call the profiler. */
+
+--- gcc-4.1.0/gcc/config/sparc/linux.h
++++ gcc-4.1.0/gcc/config/sparc/linux.h
+@@ -125,6 +125,11 @@ Boston, MA 02110-1301, USA. */
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#endif
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+ %{!mno-relax:%{!r:-relax}} \
+@@ -132,7 +137,7 @@ Boston, MA 02110-1301, USA. */
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static:-static}}}"
+
+ /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
+--- gcc-4.1.0/gcc/config/sparc/linux64.h
++++ gcc-4.1.0/gcc/config/sparc/linux64.h
+@@ -162,12 +162,17 @@ Boston, MA 02110-1301, USA. */
+ { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
+ { "link_arch", LINK_ARCH_SPEC },
+
++#ifdef USE_UCLIBC
++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#else
++#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#endif
+ #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
+ %{static:-static}}} \
+ "
+
+--- gcc-4.1.0/libffi/configure
++++ gcc-4.1.0/libffi/configure
+@@ -3457,6 +3457,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/libgfortran/configure
++++ gcc-4.1.0/libgfortran/configure
+@@ -3699,6 +3699,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/libjava/configure
++++ gcc-4.1.0/libjava/configure
+@@ -5137,6 +5137,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/libmudflap/configure
++++ gcc-4.1.0/libmudflap/configure
+@@ -5382,6 +5382,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/libobjc/configure
++++ gcc-4.1.0/libobjc/configure
+@@ -3312,6 +3312,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+--- gcc-4.1.0/libtool.m4
++++ gcc-4.1.0/libtool.m4
+@@ -743,6 +743,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
+--- gcc-4.1.0/ltconfig
++++ gcc-4.1.0/ltconfig
+@@ -603,6 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
++linux-uclibc*) ;;
+ linux-gnu*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+@@ -1274,6 +1275,23 @@ linux-gnu*)
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
++linux-uclibc*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # This implies no fast_install, which is unacceptable.
++ # Some rework will be needed to allow for fast_install
++ # before this can be enabled.
++ hardcode_into_libs=yes
++ # Assume using the uClibc dynamic linker.
++ dynamic_linker="uClibc ld.so"
++ ;;
++
+ netbsd*)
+ need_lib_prefix=no
+ need_version=no
+--- gcc-4.1.0/zlib/configure
++++ gcc-4.1.0/zlib/configure
+@@ -3426,6 +3426,11 @@ linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/4.1.2/uclibc/90_all_110-arm-eabi.patch b/4.1.2/uclibc/90_all_110-arm-eabi.patch
new file mode 100644
index 0000000..74e4a5a
--- /dev/null
+++ b/4.1.2/uclibc/90_all_110-arm-eabi.patch
@@ -0,0 +1,27 @@
+--- gcc-2005q3-1.orig/gcc/config.gcc 2005-10-31 19:02:54.000000000 +0300
++++ gcc-2005q3-1/gcc/config.gcc 2006-01-27 01:09:09.000000000 +0300
+@@ -674,7 +674,7 @@
+ tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
+ tmake_file="t-slibgcc-elf-ver t-linux arm/t-arm"
+ case ${target} in
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibceabi)
+ tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
+ tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
+ # The BPABI long long divmod functions return a 128-bit value in
+
+diff -urN gcc-2005q3-2/gcc/config/arm/linux-eabi.h gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h
+--- gcc-2005q3-2/gcc/config/arm/linux-eabi.h 2005-12-07 23:14:16.000000000 +0300
++++ gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h 2006-03-29 19:02:34.000000000 +0400
+@@ -53,7 +53,11 @@
+ /* Use ld-linux.so.3 so that it will be possible to run "classic"
+ GNU/Linux binaries on an EABI system. */
+ #undef LINUX_TARGET_INTERPRETER
++#ifdef USE_UCLIBC
++#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
++#else
+ #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.3"
++#endif
+
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
diff --git a/4.1.2/uclibc/90_all_200-uclibc-locale.patch b/4.1.2/uclibc/90_all_200-uclibc-locale.patch
new file mode 100644
index 0000000..e5d712e
--- /dev/null
+++ b/4.1.2/uclibc/90_all_200-uclibc-locale.patch
@@ -0,0 +1,3239 @@
+--- gcc-4.1.0-dist/libstdc++-v3/acinclude.m4
++++ gcc-4.1.0/libstdc++-v3/acinclude.m4
+@@ -1071,7 +1071,7 @@
+ AC_MSG_CHECKING([for C locale to use])
+ GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
+ [use MODEL for target locale package],
+- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
++ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
+
+ # If they didn't use this option switch, or if they specified --enable
+ # with no specific model, we'll have to look for one. If they
+@@ -1087,6 +1087,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ AC_EGREP_CPP([_GLIBCXX_ok], [
+ #include <features.h>
+@@ -1230,6 +1233,40 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ AC_MSG_RESULT(uclibc)
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++ AC_SUBST(glibcxx_MOFILES)
++ AC_SUBST(glibcxx_POFILES)
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <bits/c++config.h>
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
++extern "C" __typeof(strcoll_l) __strcoll_l;
++extern "C" __typeof(strftime_l) __strftime_l;
++extern "C" __typeof(strtod_l) __strtod_l;
++extern "C" __typeof(strtof_l) __strtof_l;
++extern "C" __typeof(strtold_l) __strtold_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_l;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++extern "C" __typeof(iswctype_l) __iswctype_l;
++extern "C" __typeof(towlower_l) __towlower_l;
++extern "C" __typeof(towupper_l) __towupper_l;
++extern "C" __typeof(wcscoll_l) __wcscoll_l;
++extern "C" __typeof(wcsftime_l) __wcsftime_l;
++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
++extern "C" __typeof(wctype_l) __wctype_l;
++#endif
++
++#endif // GLIBC 2.3 and later
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -0,0 +1,152 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <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)
++ {
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
++ }
++
++ void
++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
++ __c_locale __old)
++ {
++ __cloc = __newlocale(1 << LC_ALL, __s, __old);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ if (!__cloc)
++ {
++ // This named locale is not supported by the underlying OS.
++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
++ "name not valid"));
++ }
++#endif
++ }
++
++ void
++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++ {
++ if (__cloc && _S_get_c_locale() != __cloc)
++ __freelocale(__cloc);
++ }
++
++ __c_locale
++ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++ { return __duplocale(__cloc); }
++} // namespace std
++
++namespace __gnu_cxx
++{
++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
++ {
++ "LC_CTYPE",
++ "LC_NUMERIC",
++ "LC_TIME",
++ "LC_COLLATE",
++ "LC_MONETARY",
++ "LC_MESSAGES",
++#if _GLIBCXX_NUM_CATEGORIES != 0
++ "LC_PAPER",
++ "LC_NAME",
++ "LC_ADDRESS",
++ "LC_TELEPHONE",
++ "LC_MEASUREMENT",
++ "LC_IDENTIFICATION"
++#endif
++ };
++}
++
++namespace std
++{
++ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
++} // namespace std
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -0,0 +1,117 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <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 __attribute__ ((__unused__)),
++ const char* __fmt,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ _Tv __v, const __c_locale& __cloc, int __prec)
++ {
++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++ _Tv __v, const __c_locale&, int __prec)
++ {
++# ifdef __UCLIBC_HAS_LOCALE__
++ char* __old = std::setlocale(LC_ALL, NULL);
++ char* __sav = new char[std::strlen(__old) + 1];
++ std::strcpy(__sav, __old);
++ std::setlocale(LC_ALL, "C");
++# endif
++#endif
++
++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++ std::setlocale(LC_ALL, __sav);
++ delete [] __sav;
++#endif
++ return __ret;
++ }
++}
++
++#endif
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+@@ -0,0 +1,306 @@
++// std::codecvt implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <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
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -0,0 +1,80 @@
++// std::collate implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
++//
++
++// Written by Benjamin Kosnik <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
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -0,0 +1,314 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <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 = __wmask_type();
++ }
++ 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
++ {
++ // The case of __m == ctype_base::space is particularly important,
++ // due to its use in many istream functions. Therefore we deal with
++ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
++ // is the mask corresponding to ctype_base::space. NB: an encoding
++ // change would not affect correctness!
++ bool __ret = false;
++ if (__m == _M_bit[5])
++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
++ else
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur])
++ {
++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ else if (__m == _M_bit[__bitcur])
++ break;
++ }
++ }
++ return __ret;
++ }
++
++ const wchar_t*
++ ctype<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
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -0,0 +1,100 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
++//
++
++// Written by Benjamin Kosnik <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
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -0,0 +1,121 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages functions
++//
++
++// Written by Benjamin Kosnik <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(NULL), _M_name_messages(NULL)
++ {
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
++ _M_name_messages = __tmp;
++
++ // Last to avoid leaking memory if new throws.
++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
++ }
++
++ template<typename _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);
++ }
++ }
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -0,0 +1,692 @@
++// std::moneypunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <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:
++ __ret = pattern();
++ }
++ 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...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ void
++ moneypunct<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...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len;
++ __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ moneypunct<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
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -0,0 +1,173 @@
++// std::numpunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <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 = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = "false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ 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',';
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] =
++ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] =
++ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
++ }
++ else
++ {
++ // Named locale.
++ // NB: In the GNU model wchar_t is always 32 bit wide.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++
++ if (_M_data->_M_thousands_sep == L'\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = L"true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = L"false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<wchar_t>::~numpunct()
++ { delete _M_data; }
++ #endif
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -0,0 +1,406 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <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__
++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = strftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = '\0';
++ }
++
++ template<>
++ void
++ __timepunct<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);
++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = L'\0';
++ }
++
++ template<>
++ void
++ __timepunct<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);
++
++ union { char *__s; wchar_t *__w; } __u;
++
++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
++ _M_data->_M_date_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
++ _M_data->_M_date_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
++ _M_data->_M_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
++ _M_data->_M_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
++ _M_data->_M_am = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
++ _M_data->_M_pm = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
++ _M_data->_M_am_pm_format = __u.__w;
++
++ // Day names, starting with "C"'s Sunday.
++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
++ _M_data->_M_day1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
++ _M_data->_M_day2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
++ _M_data->_M_day3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
++ _M_data->_M_day4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
++ _M_data->_M_day5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
++ _M_data->_M_day6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
++ _M_data->_M_day7 = __u.__w;
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
++ _M_data->_M_aday1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
++ _M_data->_M_aday2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
++ _M_data->_M_aday3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
++ _M_data->_M_aday4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
++ _M_data->_M_aday5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
++ _M_data->_M_aday6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
++ _M_data->_M_aday7 = __u.__w;
++
++ // Month names, starting with "C"'s January.
++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
++ _M_data->_M_month01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
++ _M_data->_M_month02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
++ _M_data->_M_month03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
++ _M_data->_M_month04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
++ _M_data->_M_month05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
++ _M_data->_M_month06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
++ _M_data->_M_month07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
++ _M_data->_M_month08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
++ _M_data->_M_month09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
++ _M_data->_M_month10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
++ _M_data->_M_month11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
++ _M_data->_M_month12 = __u.__w;
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
++ _M_data->_M_amonth01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
++ _M_data->_M_amonth02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
++ _M_data->_M_amonth03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
++ _M_data->_M_amonth04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
++ _M_data->_M_amonth05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
++ _M_data->_M_amonth06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
++ _M_data->_M_amonth07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
++ _M_data->_M_amonth08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
++ _M_data->_M_amonth09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
++ _M_data->_M_amonth10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
++ _M_data->_M_amonth11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
++ _M_data->_M_amonth12 = __u.__w;
++ }
++#endif // 0
++ }
++#endif
++}
+--- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h
++++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -0,0 +1,76 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
++//
++
++// Written by Benjamin Kosnik <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(NULL)
++ {
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
++ _M_name_timepunct = __tmp;
++
++ try
++ { _M_initialize_timepunct(__cloc); }
++ catch(...)
++ {
++ delete [] _M_name_timepunct;
++ __throw_exception_again;
++ }
++ }
++
++ template<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);
++ }
+--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h
++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h
+@@ -0,0 +1,64 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++/** @file ctype_base.h
++ * This is an internal header file, included by other library headers.
++ * You should not attempt to use it directly.
++ */
++
++// Information as gleaned from /usr/include/ctype.h
++
++ /// @brief Base class for ctype.
++ struct ctype_base
++ {
++ // Note: In uClibc, the following two types depend on configuration.
++
++ // Non-standard typedefs.
++ typedef const __ctype_touplow_t* __to_type;
++
++ // NB: Offsets into ctype<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;
++ };
+--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h
++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
+@@ -0,0 +1,69 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
++// functions go in ctype.cc
++
++ bool
++ ctype<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;
++ }
+--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h
++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
+@@ -0,0 +1,92 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++// Information as gleaned from /usr/include/ctype.h
++
++ const ctype_base::mask*
++ ctype<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;
++ }
+--- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h
++++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h
+@@ -0,0 +1,44 @@
++// Specific definitions for GNU/Linux -*- C++ -*-
++
++// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++#ifndef _GLIBCXX_OS_DEFINES
++#define _GLIBCXX_OS_DEFINES 1
++
++// System-specific #define, typedefs, corrections, etc, go here. This
++// file will come before all others.
++
++// This keeps isanum, et al from being propagated as macros.
++#define __NO_CTYPE 1
++
++#include <features.h>
++
++// We must not see the optimized string functions GNU libc defines.
++#define __NO_STRING_INLINES
++
++#endif
+--- gcc-4.1.0-dist/libstdc++-v3/configure
++++ gcc-4.1.0/libstdc++-v3/configure
+@@ -4005,6 +4005,11 @@
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+@@ -5740,7 +5745,7 @@
+ enableval="$enable_clocale"
+
+ case "$enableval" in
+- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
++ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
+ echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
+ { (exit 1); exit 1; }; } ;;
+@@ -5765,6 +5770,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ linux-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -5995,6 +6003,76 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ echo "$as_me:$LINENO: result: uclibc" >&5
++echo "${ECHO_T}uclibc" >&6
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ # Extract the first word of "msgfmt", so it can be a program name with args.
++set dummy msgfmt; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$check_msgfmt"; then
++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_check_msgfmt="yes"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
++fi
++fi
++check_msgfmt=$ac_cv_prog_check_msgfmt
++if test -n "$check_msgfmt"; then
++ echo "$as_me:$LINENO: result: $check_msgfmt" >&5
++echo "${ECHO_T}$check_msgfmt" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++
++
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+--- gcc-4.1.0-dist/libstdc++-v3/configure.host
++++ gcc-4.1.0/libstdc++-v3/configure.host
+@@ -261,6 +261,12 @@
+ ;;
+ esac
+
++# Override for uClibc since linux-uclibc gets mishandled above.
++case "${host_os}" in
++ *-uclibc*)
++ os_include_dir="os/uclibc"
++ ;;
++esac
+
+ # Set any OS-dependent and CPU-dependent bits.
+ # THIS TABLE IS SORTED. KEEP IT THAT WAY.
+--- gcc-4.1.0-dist/libstdc++-v3/crossconfig.m4
++++ gcc-4.1.0/libstdc++-v3/crossconfig.m4
+@@ -143,6 +143,99 @@
+ ;;
+ esac
+ ;;
++ *-uclibc*)
++# Temporary hack until we implement the float versions of the libm funcs
++ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
++ machine/endian.h machine/param.h sys/machine.h sys/types.h \
++ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
++ SECTION_FLAGS='-ffunction-sections -fdata-sections'
++ AC_SUBST(SECTION_FLAGS)
++ GLIBCXX_CHECK_LINKER_FEATURES
++ GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
++ GLIBCXX_CHECK_WCHAR_T_SUPPORT
++
++ # For LFS.
++ AC_DEFINE(HAVE_INT64_T)
++ case "$target" in
++ *-uclinux*)
++ # Don't enable LFS with uClinux
++ ;;
++ *)
++ AC_DEFINE(_GLIBCXX_USE_LFS)
++ esac
++
++ # For showmanyc_helper().
++ AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
++ GLIBCXX_CHECK_POLL
++ GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
++
++ # For xsputn_2().
++ AC_CHECK_HEADERS(sys/uio.h)
++ GLIBCXX_CHECK_WRITEV
++
++# AC_DEFINE(HAVE_ACOSF)
++# AC_DEFINE(HAVE_ASINF)
++# AC_DEFINE(HAVE_ATANF)
++# AC_DEFINE(HAVE_ATAN2F)
++ AC_DEFINE(HAVE_CEILF)
++ AC_DEFINE(HAVE_COPYSIGN)
++# AC_DEFINE(HAVE_COPYSIGNF)
++# AC_DEFINE(HAVE_COSF)
++# AC_DEFINE(HAVE_COSHF)
++# AC_DEFINE(HAVE_EXPF)
++# AC_DEFINE(HAVE_FABSF)
++ AC_DEFINE(HAVE_FINITE)
++ AC_DEFINE(HAVE_FINITEF)
++ AC_DEFINE(HAVE_FLOORF)
++# AC_DEFINE(HAVE_FMODF)
++# AC_DEFINE(HAVE_FREXPF)
++ AC_DEFINE(HAVE_HYPOT)
++# AC_DEFINE(HAVE_HYPOTF)
++ AC_DEFINE(HAVE_ISINF)
++ AC_DEFINE(HAVE_ISINFF)
++ AC_DEFINE(HAVE_ISNAN)
++ AC_DEFINE(HAVE_ISNANF)
++# AC_DEFINE(HAVE_LOGF)
++# AC_DEFINE(HAVE_LOG10F)
++# AC_DEFINE(HAVE_MODFF)
++# AC_DEFINE(HAVE_SINF)
++# AC_DEFINE(HAVE_SINHF)
++# AC_DEFINE(HAVE_SINCOS)
++# AC_DEFINE(HAVE_SINCOSF)
++ AC_DEFINE(HAVE_SQRTF)
++# AC_DEFINE(HAVE_TANF)
++# AC_DEFINE(HAVE_TANHF)
++ if test x"long_double_math_on_this_cpu" = x"yes"; then
++ AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
++# AC_DEFINE(HAVE_ACOSL)
++# AC_DEFINE(HAVE_ASINL)
++# AC_DEFINE(HAVE_ATANL)
++# AC_DEFINE(HAVE_ATAN2L)
++# AC_DEFINE(HAVE_CEILL)
++# AC_DEFINE(HAVE_COPYSIGNL)
++# AC_DEFINE(HAVE_COSL)
++# AC_DEFINE(HAVE_COSHL)
++# AC_DEFINE(HAVE_EXPL)
++# AC_DEFINE(HAVE_FABSL)
++# AC_DEFINE(HAVE_FINITEL)
++# AC_DEFINE(HAVE_FLOORL)
++# AC_DEFINE(HAVE_FMODL)
++# AC_DEFINE(HAVE_FREXPL)
++# AC_DEFINE(HAVE_HYPOTL)
++# AC_DEFINE(HAVE_ISINFL)
++# AC_DEFINE(HAVE_ISNANL)
++# AC_DEFINE(HAVE_LOGL)
++# AC_DEFINE(HAVE_LOG10L)
++# AC_DEFINE(HAVE_MODFL)
++# AC_DEFINE(HAVE_POWL)
++# AC_DEFINE(HAVE_SINL)
++# AC_DEFINE(HAVE_SINHL)
++# AC_DEFINE(HAVE_SINCOSL)
++# AC_DEFINE(HAVE_SQRTL)
++# AC_DEFINE(HAVE_TANL)
++# AC_DEFINE(HAVE_TANHL)
++ fi
++ ;;
+ *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
+ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
+ machine/endian.h machine/param.h sys/machine.h sys/types.h \
+@@ -157,7 +250,7 @@
+ AC_DEFINE(HAVE_INT64_T)
+ case "$target" in
+ *-uclinux*)
+- # Don't enable LFS with uClibc
++ # Don't enable LFS with uClinux
+ ;;
+ *)
+ AC_DEFINE(_GLIBCXX_USE_LFS)
+--- gcc-4.1.0-dist/libstdc++-v3/include/c_compatibility/wchar.h
++++ gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -101,7 +101,9 @@
+ using std::wmemcpy;
+ using std::wmemmove;
+ using std::wmemset;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using std::wcsftime;
++#endif
+
+ #if _GLIBCXX_USE_C99
+ using std::wcstold;
+--- gcc-4.1.0-dist/libstdc++-v3/include/c_std/std_cwchar.h
++++ gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h
+@@ -180,7 +180,9 @@
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using ::wcsftime;
++#endif
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
diff --git a/4.1.2/uclibc/90_all_301-missing-execinfo_h.patch b/4.1.2/uclibc/90_all_301-missing-execinfo_h.patch
new file mode 100644
index 0000000..0e2092f
--- /dev/null
+++ b/4.1.2/uclibc/90_all_301-missing-execinfo_h.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500
++++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500
+@@ -500,7 +500,7 @@
+ #ifdef __linux__
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/4.1.2/uclibc/90_all_302-c99-snprintf.patch b/4.1.2/uclibc/90_all_302-c99-snprintf.patch
new file mode 100644
index 0000000..dfb22d6
--- /dev/null
+++ b/4.1.2/uclibc/90_all_302-c99-snprintf.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h-orig 2005-04-29 00:08:41.000000000 -0500
++++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h 2005-04-29 00:08:45.000000000 -0500
+@@ -142,7 +142,7 @@
+ using ::vsprintf;
+ }
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/4.1.2/uclibc/90_all_303-c99-complex-ugly-hack.patch b/4.1.2/uclibc/90_all_303-c99-complex-ugly-hack.patch
new file mode 100644
index 0000000..2ccc80d
--- /dev/null
+++ b/4.1.2/uclibc/90_all_303-c99-complex-ugly-hack.patch
@@ -0,0 +1,12 @@
+--- gcc-4.0.0/libstdc++-v3/configure-old 2005-04-30 22:04:48.061603912 -0500
++++ gcc-4.0.0/libstdc++-v3/configure 2005-04-30 22:06:13.678588152 -0500
+@@ -7194,6 +7194,9 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <complex.h>
++#ifdef __UCLIBC__
++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
++#endif
+ int
+ main ()
+ {