aboutsummaryrefslogtreecommitdiff
path: root/3.3.6
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-11-05 06:25:32 +0000
committerMike Frysinger <vapier@gentoo.org>2005-11-05 06:25:32 +0000
commit436ebbe6a1d6b12184cf23041ca4cedad8ed2b92 (patch)
tree4c2409bc9aeb59c93b8bab9cf97d3901d1ba63cc /3.3.6
parentfix for PR 14944 (diff)
downloadgcc-patches-436ebbe6a1d6b12184cf23041ca4cedad8ed2b92.tar.gz
gcc-patches-436ebbe6a1d6b12184cf23041ca4cedad8ed2b92.tar.bz2
gcc-patches-436ebbe6a1d6b12184cf23041ca4cedad8ed2b92.zip
grab some fixes from Debian
Diffstat (limited to '3.3.6')
-rw-r--r--3.3.6/gentoo/55_all_pr14925.patch1034
-rw-r--r--3.3.6/gentoo/55_all_pr17684.patch269
-rw-r--r--3.3.6/gentoo/56_all_pr18153.patch72
-rw-r--r--3.3.6/gentoo/57_all_pr18380.patch33
-rw-r--r--3.3.6/gentoo/58_all_pr18508.patch101
-rw-r--r--3.3.6/gentoo/59_all_pr23241.patch30
6 files changed, 1539 insertions, 0 deletions
diff --git a/3.3.6/gentoo/55_all_pr14925.patch b/3.3.6/gentoo/55_all_pr14925.patch
new file mode 100644
index 0000000..32f7554
--- /dev/null
+++ b/3.3.6/gentoo/55_all_pr14925.patch
@@ -0,0 +1,1034 @@
+[Snipped from Debian's gcc-3.3_3.3.6-10]
+
+# DP: Backport of PR14925 to the gcc-3.3 branch
+
+2004-09-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/14925:
+ Makefile.in (LIB2ADDEHSTATIC): New.
+ (LIB2ADDEHSHARED): New.
+ (LIBUNWIND): New.
+ (LIBUNWINDDEP): New.
+ (SHLIBUNWIND_LINK): New.
+ (SHLIBUNWIND_INSTALL): New.
+ (libgcc.mk): Pass LIB2ADDEHSTATIC, LIB2ADDEHSHARED, LIBUNWIND,
+ LIBUNWINDDEP, SHLIBUNWIND_LINK and SHLIBUNWIND_INSTALL.
+ (clean): Remove libunwind*
+ (stage1-start): Remove and copy stage1/libunwind*.
+ (stage2-start): Remove and copy stage2/libunwind*.
+ (stage3-start): Remove and copy stage3/libunwind*.
+ (stage4-start): Remove and copy stage4/libunwind*.
+ (stageprofile-start): Remove and copy stageprofile/libunwind*.
+ (stagefeedback-start): Remove and copy stagefeedback/libunwind*.
+
+ * config.gcc (ia64*-*-linux*): Always add t-libunwind to
+ tmake_file. Add t-libunwind-elf and ia64/t-glibc-libunwind to
+ tmake_file if --with-system-libunwind isn't used.
+
+ * config/ia64/t-glibc-libunwind: New file.
+ * config/t-libunwind-elf: Likewise.
+ * unwind-compat.c: Likewise.
+ * unwind-compat.h: Likewise.
+ * unwind-dw2-fde-compat.c: Likewise.
+
+ * config/ia64/t-glibc (LIB2ADDEH): Updated.
+ * config/ia64/t-hpux (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS.
+
+ * config/ia64/unwind-ia64.c: Include "unwind-compat.h". Define
+ aliases if needed.
+ * unwind-dw2-fde-glibc.c: Likewise.
+ * unwind-dw2.c: Likewise.
+
+ * config/t-libunwind (LIB2ADDEH): Updated.
+ (LIB2ADDEHSTATIC): New.
+ (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS.
+ (TARGET_LIBGCC2_CFLAGS): Set to -DUSE_GAS_SYMVER.
+
+ * configure.in: Change --enable-libunwind-exceptions to
+ --with-system-libunwind. Don't define USE_LIBUNWIND_EXCEPTIONS.
+ * configure: Regenerated.
+ * config.in: Updated.
+
+ * doc/install.texi (ia64-*-linux): Require libunwind 0.98 or
+ above and mention --with-system-libunwind.
+ (ia64-*-hpux*): Mention --enable-libunwind-exceptions is
+ removed in gcc 3.4.2 and later.
+
+ * gcc.c (init_spec): Add -lunwind to -lgcc_s if
+ USE_LIBUNWIND_EXCEPTIONS is defined.
+
+ * mklibgcc.in: Support libunwind.
+
+diff -urN src.old/gcc/Makefile.in src/gcc/Makefile.in
+--- src.old/gcc/Makefile.in 2004-04-01 18:55:23.000000000 +0200
++++ src/gcc/Makefile.in 2004-12-10 13:28:49.000000000 +0100
+@@ -408,8 +408,16 @@
+ # Additional sources to handle exceptions; overridden by targets as needed.
+ LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
++LIB2ADDEHSTATIC = $(LIB2ADDEH)
++LIB2ADDEHSHARED = $(LIB2ADDEH)
+ LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
+
++# Don't build libunwind by default.
++LIBUNWIND =
++LIBUNWINDDEP =
++SHLIBUNWIND_LINK =
++SHLIBUNWIND_INSTALL =
++
+ # nm flags to list global symbols in libgcc object files.
+ SHLIB_NM_FLAGS = -pg
+
+@@ -1034,7 +1042,13 @@
+ LIB2ADD='$(LIB2ADD)' \
+ LIB2ADD_ST='$(LIB2ADD_ST)' \
+ LIB2ADDEH='$(LIB2ADDEH)' \
++ LIB2ADDEHSTATIC='$(LIB2ADDEHSTATIC)' \
++ LIB2ADDEHSHARED='$(LIB2ADDEHSHARED)' \
+ LIB2ADDEHDEP='$(LIB2ADDEHDEP)' \
++ LIBUNWIND='$(LIBUNWIND)' \
++ LIBUNWINDDEP='$(LIBUNWINDDEP)' \
++ SHLIBUNWIND_LINK='$(SHLIBUNWIND_LINK)' \
++ SHLIBUNWIND_INSTALL='$(SHLIBUNWIND_INSTALL)' \
+ FPBIT='$(FPBIT)' \
+ FPBIT_FUNCS='$(FPBIT_FUNCS)' \
+ LIB2_DIVMOD_FUNCS='$(LIB2_DIVMOD_FUNCS)' \
+@@ -2665,6 +2679,7 @@
+ INTL_CLEAN = intl.clean
+ clean: mostlyclean $(INTL_CLEAN) lang.clean
+ -rm -f libgcc.a libgcc_eh.a libgcc_s$(SHLIB_EXT) libgcc_s$(SHLIB_EXT).1
++ -rm -f libunwind*
+ -rm -f config.h tconfig.h hconfig.h tm_p.h
+ -rm -f cs-*
+ -rm -rf libgcc
+@@ -3561,6 +3576,7 @@
+ -if [ -f ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
+ -if [ -f collect-ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
+ -rm -f stage1/libgcc.a stage1/libgcc_eh.a stage1/libgcc_s*$(SHLIB_EXT)
++ -rm -f stage1/libunwind*
+ -cp libgcc.a stage1
+ -if $(RANLIB_TEST_FOR_TARGET) ; then \
+ $(RANLIB_FOR_TARGET) stage1/libgcc.a; \
+@@ -3570,6 +3586,7 @@
+ $(RANLIB_FOR_TARGET) stage1/libgcc_eh.a; \
+ else true; fi; fi
+ -cp libgcc_s*$(SHLIB_EXT) stage1/
++ -cp libunwind* stage1/
+ -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
+ cp stage1/$${f} . ; \
+ else true; \
+@@ -3591,6 +3608,7 @@
+ -if [ -f ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
+ -if [ -f collect-ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
+ -rm -f stage2/libgcc.a stage2/libgcc_eh.a stage2/libgcc_s*$(SHLIB_EXT)
++ -rm -f stage2/libunwind*
+ -cp libgcc.a stage2
+ -if $(RANLIB_TEST_FOR_TARGET) ; then \
+ $(RANLIB_FOR_TARGET) stage2/libgcc.a; \
+@@ -3600,6 +3618,7 @@
+ $(RANLIB_FOR_TARGET) stage2/libgcc_eh.a; \
+ else true; fi; fi
+ -cp libgcc_s*$(SHLIB_EXT) stage2/
++ -cp libunwind* stage2/
+ -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
+ cp stage2/$${f} . ; \
+ else true; \
+@@ -3621,6 +3640,7 @@
+ -if [ -f ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
+ -if [ -f collect-ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
+ -rm -f stage3/libgcc.a stage3/libgcc_eh.a stage3/libgcc_s*$(SHLIB_EXT)
++ -rm -f stage3/libunwind*
+ -cp libgcc.a stage3
+ -if $(RANLIB_TEST_FOR_TARGET) ; then \
+ $(RANLIB_FOR_TARGET) stage3/libgcc.a; \
+@@ -3630,6 +3650,7 @@
+ $(RANLIB_FOR_TARGET) stage3/libgcc_eh.a; \
+ else true; fi; fi
+ -cp libgcc_s*$(SHLIB_EXT) stage3/
++ -cp libunwind* stage3/
+ -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
+ cp stage3/$${f} . ; \
+ else true; \
+@@ -3651,6 +3672,7 @@
+ -if [ -f ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
+ -if [ -f collect-ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
+ -rm -f stage4/libgcc.a stage4/libgcc_eh.a stage4/libgcc_s*$(SHLIB_EXT)
++ -rm -f stage4/libunwind*
+ -cp libgcc.a stage4
+ -if $(RANLIB_TEST_FOR_TARGET) ; then \
+ $(RANLIB_FOR_TARGET) stage4/libgcc.a; \
+@@ -3660,6 +3682,7 @@
+ $(RANLIB_FOR_TARGET) stage4/libgcc_eh.a; \
+ else true; fi; fi
+ -cp libgcc_s*$(SHLIB_EXT) stage4/
++ -cp libunwind* stage4/
+ -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
+ cp stage4/$${f} . ; \
+ else true; \
+diff -urN src.old/gcc/config/ia64/t-glibc src/gcc/config/ia64/t-glibc
+--- src.old/gcc/config/ia64/t-glibc 2001-05-12 08:03:20.000000000 +0200
++++ src/gcc/config/ia64/t-glibc 2004-12-10 13:17:36.000000000 +0100
+@@ -1 +1,3 @@
+-LIB2ADDEH += $(srcdir)/config/ia64/fde-glibc.c
++# Use system libunwind library on IA-64 GLIBC based system.
++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
++ $(srcdir)/unwind-compat.c
+diff -urN src.old/gcc/config/ia64/t-glibc-libunwind src/gcc/config/ia64/t-glibc-libunwind
+--- src.old/gcc/config/ia64/t-glibc-libunwind 1970-01-01 01:00:00.000000000 +0100
++++ src/gcc/config/ia64/t-glibc-libunwind 2004-12-10 13:17:36.000000000 +0100
+@@ -0,0 +1,4 @@
++# Build libunwind for IA-64 GLIBC based system.
++LIBUNWIND = $(srcdir)/config/ia64/fde-glibc.c \
++ $(srcdir)/config/ia64/unwind-ia64.c
++LIBUNWINDDEP = unwind.inc
+diff -urN src.old/gcc/config/ia64/t-hpux src/gcc/config/ia64/t-hpux
+--- src.old/gcc/config/ia64/t-hpux 2003-01-26 12:35:08.000000000 +0100
++++ src/gcc/config/ia64/t-hpux 2004-12-10 13:17:36.000000000 +0100
+@@ -30,6 +30,8 @@
+ # We do not want to include the EH stuff that linux uses, we want to use
+ # the HP-UX libunwind library.
+
++T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
++
+ LIB2ADDEH =
+
+ SHLIB_EXT = .so
+diff -urN src.old/gcc/config/ia64/unwind-ia64.c src/gcc/config/ia64/unwind-ia64.c
+--- src.old/gcc/config/ia64/unwind-ia64.c 2003-12-12 17:10:09.000000000 +0100
++++ src/gcc/config/ia64/unwind-ia64.c 2004-12-10 13:17:36.000000000 +0100
+@@ -35,6 +35,7 @@
+ #include "tsystem.h"
+ #include "unwind.h"
+ #include "unwind-ia64.h"
++#include "unwind-compat.h"
+ #include "ia64intrin.h"
+
+ /* This isn't thread safe, but nice for occasional tests. */
+@@ -2284,4 +2285,24 @@
+ }
+
+ #include "unwind.inc"
++
++#if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS)
++alias (_Unwind_Backtrace);
++alias (_Unwind_DeleteException);
++alias (_Unwind_FindEnclosingFunction);
++alias (_Unwind_FindTableEntry);
++alias (_Unwind_ForcedUnwind);
++alias (_Unwind_GetBSP);
++alias (_Unwind_GetCFA);
++alias (_Unwind_GetGR);
++alias (_Unwind_GetIP);
++alias (_Unwind_GetLanguageSpecificData);
++alias (_Unwind_GetRegionStart);
++alias (_Unwind_RaiseException);
++alias (_Unwind_Resume);
++alias (_Unwind_Resume_or_Rethrow);
++alias (_Unwind_SetGR);
++alias (_Unwind_SetIP);
++#endif
++
+ #endif
+diff -urN src.old/gcc/config/t-libunwind src/gcc/config/t-libunwind
+--- src.old/gcc/config/t-libunwind 2003-12-04 03:18:22.000000000 +0100
++++ src/gcc/config/t-libunwind 2004-12-10 13:45:23.000000000 +0100
+@@ -1,6 +1,14 @@
++# Use the system libunwind library.
++#
+ # Override the default value from t-slibgcc-elf-ver and mention -lunwind
+ # so that the resulting libgcc_s.so has the necessary DT_NEEDED entry for
+ # libunwind.
+ SHLIB_LC = -lunwind -lc
+ LIB2ADDEH = $(srcdir)/unwind-libunwind.c $(srcdir)/unwind-sjlj.c \
+ $(srcdir)/unwind-c.c
++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
++ $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
++LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
++
++T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
++TARGET_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
+diff -urN src.old/gcc/config/t-libunwind-elf src/gcc/config/t-libunwind-elf
+--- src.old/gcc/config/t-libunwind-elf 1970-01-01 01:00:00.000000000 +0100
++++ src/gcc/config/t-libunwind-elf 2004-12-10 13:17:36.000000000 +0100
+@@ -0,0 +1,26 @@
++# Build libunwind for ELF with the GNU linker.
++
++# Use unwind-dw2-fde-glibc
++LIBUNWIND = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c
++LIBUNWINDDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
++
++SHLIBUNWIND_SOVERSION = 7
++SHLIBUNWIND_SONAME = @shlib_so_name@.so.$(SHLIBUNWIND_SOVERSION)
++SHLIBUNWIND_NAME = @shlib_dir@@shlib_so_name@.so.$(SHLIBUNWIND_SOVERSION)
++
++SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared \
++ -nodefaultlibs -Wl,-h,$(SHLIBUNWIND_SONAME) \
++ -Wl,-z,text -Wl,-z,defs \
++ -o $(SHLIBUNWIND_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
++ rm -f $(SHLIB_SOLINK) && \
++ $(LN_S) $(SHLIBUNWIND_NAME) $(SHLIB_SOLINK)
++
++# $(slibdir) double quoted to protect it from expansion while building
++# libgcc.mk. We want this delayed until actual install time.
++SHLIBUNWIND_INSTALL = \
++ $$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
++ $(INSTALL_DATA) $(SHLIBUNWIND_NAME) \
++ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIBUNWIND_SONAME); \
++ rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
++ $(LN_S) $(SHLIBUNWIND_SONAME) \
++ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+diff -urN src.old/gcc/config.gcc src/gcc/config.gcc
+--- src.old/gcc/config.gcc 2004-04-29 06:42:47.000000000 +0200
++++ src/gcc/config.gcc 2004-12-10 13:36:11.000000000 +0100
+@@ -1475,12 +1475,12 @@
+ ;;
+ ia64*-*-linux*)
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h ia64/sysv4.h ia64/linux.h"
+- tmake_file="t-slibgcc-elf-ver t-linux ia64/t-ia64 ia64/t-glibc"
++ tmake_file="t-slibgcc-elf-ver t-linux ia64/t-ia64 t-libunwind ia64/t-glibc"
++ if test x$with_system_libunwind != xyes ; then
++ tmake_file="t-slibgcc-elf-ver t-linux ia64/t-ia64 t-libunwind-elf ia64/t-glibc-libunwind"
++ fi
+ target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
+- if test x"$use_libunwind_exceptions" = xyes; then
+- tmake_file="$tmake_file t-libunwind"
+- fi
+ ;;
+ ia64*-*-hpux*)
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h ia64/sysv4.h ia64/hpux.h ia64/hpux_longdouble.h"
+diff -urN src.old/gcc/config.in src/gcc/config.in
+--- src.old/gcc/config.in 2004-09-30 19:34:19.000000000 +0200
++++ src/gcc/config.in 2004-12-10 13:38:35.000000000 +0100
+@@ -507,9 +507,6 @@
+ /* Define 0/1 to force the choice for exception handling model. */
+ #undef CONFIG_SJLJ_EXCEPTIONS
+
+-/* Define if gcc should use -lunwind. */
+-#undef USE_LIBUNWIND_EXCEPTIONS
+-
+ /* Define to the name of a file containing a list of extra machine modes
+ for this architecture. */
+ #undef EXTRA_MODES_FILE
+diff -urN src.old/gcc/configure.in src/gcc/configure.in
+--- src.old/gcc/configure.in 2004-04-01 18:55:22.000000000 +0200
++++ src/gcc/configure.in 2004-12-10 13:48:59.000000000 +0100
+@@ -854,16 +854,10 @@
+ AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
+ [Define 0/1 to force the choice for exception handling model.])])
+
+-AC_CHECK_LIB(unwind, main, use_libunwind_default=yes, use_libunwind_default=no)
+-# Use libunwind based exception handling.
+-AC_ARG_ENABLE(libunwind-exceptions,
+-[ --enable-libunwind-exceptions force use libunwind for exceptions],
+-use_libunwind_exceptions=$enableval,
+-use_libunwind_exceptions=$use_libunwind_default)
+-if test x"$use_libunwind_exceptions" = xyes; then
+- AC_DEFINE(USE_LIBUNWIND_EXCEPTIONS, 1,
+- [Define if gcc should use -lunwind.])
+-fi
++# For platforms with the unwind ABI which includes an unwind library,
++# libunwind, we can choose to use the system libunwind.
++AC_ARG_WITH(system-libunwind,
++[ --with-system-libunwind use installed libunwind])
+
+ target_gtfiles=
+ build_xm_file=
+diff -urN src.old/gcc/doc/install.texi src/gcc/doc/install.texi
+--- src.old/gcc/doc/install.texi 2004-05-08 19:37:31.000000000 +0200
++++ src/gcc/doc/install.texi 2004-12-10 13:51:02.000000000 +0100
+@@ -2433,6 +2433,10 @@
+ IA-64 processor (also known as IPF, or Itanium Processor Family)
+ running GNU/Linux.
+
++If you are using the installed system libunwind library with
++@option{--with-system-libunwind}, then you must use libunwind 0.98 or
++later.
++
+ The toolchain is not completely finished, so requirements will continue
+ to change.
+ GCC 3.0.1 and later require glibc 2.2.4.
+@@ -2461,6 +2465,8 @@
+ The GCC libunwind library has not been ported to HPUX. This means that for
+ GCC versions 3.2.3 and earlier, @option{--enable-libunwind-exceptions}
+ is required to build GCC. For GCC 3.3 and later, this is the default.
++For gcc 3.4.3 and later, @option{--enable-libunwind-exceptions} is
++removed and the system libunwind library will always be used.
+
+ @html
+ <hr />
+diff -urN src.old/gcc/gcc.c src/gcc/gcc.c
+--- src.old/gcc/gcc.c 2004-04-01 18:55:17.000000000 +0200
++++ src/gcc/gcc.c 2004-12-10 13:17:41.000000000 +0100
+@@ -1577,6 +1577,9 @@
+ #else
+ "-lgcc_s%M"
+ #endif
++#ifdef USE_LIBUNWIND_EXCEPTIONS
++ " -lunwind"
++#endif
+ ,
+ "-lgcc",
+ "-lgcc_eh"
+diff -urN src.old/gcc/mklibgcc.in src/gcc/mklibgcc.in
+--- src.old/gcc/mklibgcc.in 2003-12-24 23:42:28.000000000 +0100
++++ src/gcc/mklibgcc.in 2004-12-10 14:19:28.000000000 +0100
+@@ -15,7 +15,13 @@
+ # LIB2ADD
+ # LIB2ADD_ST
+ # LIB2ADDEH
++# LIB2ADDEHSTATIC
++# LIB2ADDEHSHARED
+ # LIB2ADDEHDEP
++# LIBUNWIND
++# LIBUNWINDDEP
++# SHLIBUNWIND_LINK
++# SHLIBUNWIND_INSTALL
+ # FPBIT
+ # FPBIT_FUNCS
+ # LIB2_DIVMOD_FUNCS
+@@ -105,7 +111,8 @@
+
+ libgcc2_objs=""
+ libgcc2_st_objs=""
+-libgcc2_eh_objs=""
++libgcc2_eh_static_objs=""
++libgcc2_eh_shared_objs=""
+
+ for name in $LIB2FUNCS_1 $LIB2FUNCS_2; do
+ for ml in $MULTILIBS; do
+@@ -224,13 +231,27 @@
+ echo $out: stmp-dirs $file
+ echo " $gcc_compile" $flags -fexceptions -c $file -o $out
+ done
+- if [ "$SHLIB_LINK" ]; then
+- libgcc2_eh_objs="$libgcc2_eh_objs ${oname}${objext}"
+- else
++ if [ -z "$SHLIB_LINK" ]; then
+ libgcc2_objs="$libgcc2_objs ${oname}${objext}"
+ fi
+ done
+
++if [ "$SHLIB_LINK" ]; then
++ # Those should be in libgcc_eh.a.
++ for file in $LIB2ADDEHSTATIC; do
++ name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
++ oname=`echo $name | sed -e 's,.*/,,'`
++ libgcc2_eh_static_objs="$libgcc2_eh_static_objs ${oname}${objext}"
++ done
++
++ # Those should be in libgcc.so.
++ for file in $LIB2ADDEHSHARED; do
++ name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
++ oname=`echo $name | sed -e 's,.*/,,'`
++ libgcc2_eh_shared_objs="$libgcc2_eh_shared_objs ${oname}${objext}"
++ done
++fi
++
+ for file in $LIB2ADD_ST; do
+ name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
+ oname=`echo $name | sed -e 's,.*/,,'`
+@@ -249,6 +270,31 @@
+ libgcc2_st_objs="$libgcc2_st_objs ${oname}${objext}"
+ done
+
++if [ "$LIBUNWIND" ]; then
++ libunwind_static_objs=""
++ libunwind_shared_objs=""
++ for file in $LIBUNWIND; do
++ name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
++ oname=`echo $name | sed -e 's,.*/,,'`
++
++ for ml in $MULTILIBS; do
++ dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
++ flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
++ out="libgcc/${dir}/${oname}${objext}"
++ if [ ${name}.asm = ${file} ]; then
++ flags="$flags -xassembler-with-cpp"
++ fi
++
++ echo $out: stmp-dirs $file $LIBUNWINDDEP
++ echo " $gcc_compile" $flags -fexceptions -c $file -o $out
++ echo ${out}s: stmp-dirs $file $LIBUNWINDDEP
++ echo " $gcc_compile" $flags -fexceptions -DSHARED -c $file -o ${out}s
++ done
++ libunwind_static_objs="$libunwind_static_objs ${oname}${objext}"
++ libunwind_shared_objs="$libunwind_shared_objs ${oname}${objext}s"
++ done
++fi
++
+ # SHLIB_MKMAP
+ # SHLIB_MKMAP_OPTS
+ # SHLIB_MAPFILES
+@@ -257,17 +303,21 @@
+ flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
+
+ libgcc_objs=""
+- libgcc_eh_objs=""
++ libgcc_eh_static_objs=""
++ libgcc_eh_shared_objs=""
+ for o in $libgcc1_objs; do
+ libgcc_objs="$libgcc_objs libgcc/${dir}/$o"
+ done
+ for o in $libgcc2_objs; do
+ libgcc_objs="$libgcc_objs libgcc/${dir}/$o"
+ done
+- for o in $libgcc2_eh_objs; do
+- libgcc_eh_objs="$libgcc_eh_objs libgcc/${dir}/$o"
++ for o in $libgcc2_eh_static_objs; do
++ libgcc_eh_static_objs="$libgcc_eh_static_objs libgcc/${dir}/$o"
+ done
+- libgcc_sh_objs="$libgcc_objs $libgcc_eh_objs"
++ for o in $libgcc2_eh_shared_objs; do
++ libgcc_eh_shared_objs="$libgcc_eh_shared_objs libgcc/${dir}/$o"
++ done
++ libgcc_sh_objs="$libgcc_objs $libgcc_eh_shared_objs"
+ shlib_deps="$libgcc_sh_objs"
+
+ libgcc_st_objs=""
+@@ -275,6 +325,18 @@
+ libgcc_st_objs="$libgcc_st_objs libgcc/${dir}/$o"
+ done
+
++ if [ "$LIBUNWIND" ]; then
++ libunwind_a_objs=""
++ for o in $libunwind_static_objs; do
++ libunwind_a_objs="$libunwind_a_objs libgcc/${dir}/$o"
++ done
++ libunwind_sh_objs=""
++ for o in $libunwind_shared_objs; do
++ libunwind_sh_objs="$libunwind_sh_objs libgcc/${dir}/$o"
++ done
++ shlibunwind_deps="$libunwind_sh_objs"
++ fi
++
+ if [ "$SHLIB_LINK" -a "$SHLIB_MKMAP" ]; then
+ mapfile="libgcc/${dir}/libgcc.map"
+ tmpmapfile="libgcc/${dir}/tmp-libgcc.map"
+@@ -326,12 +388,22 @@
+ echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc.a ';' \\
+ echo ' else true; fi;'
+
++ if [ "$LIBUNWIND" ]; then
++ echo ""
++ echo "${dir}/libunwind.a: stmp-dirs $libunwind_a_objs"
++ echo " -rm -rf ${dir}/libunwind.a"
++ echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libunwind.a $libunwind_a_objs
++ echo ' $(RANLIB_FOR_TARGET)' ${dir}/libunwind.a
++ echo ""
++ echo "${dir}/libgcc.a: ${dir}/libunwind.a"
++ fi
++
+ if [ "$SHLIB_LINK" ]; then
+
+ echo ""
+- echo "${dir}/libgcc_eh.a: stmp-dirs $libgcc_eh_objs"
++ echo "${dir}/libgcc_eh.a: stmp-dirs $libgcc_eh_static_objs"
+ echo " -rm -rf ${dir}/libgcc_eh.a"
+- echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a $libgcc_eh_objs
++ echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a $libgcc_eh_static_objs
+ echo ' if $(RANLIB_TEST_FOR_TARGET) ; then' \\
+ echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a ';' \\
+ echo ' else true; fi;'
+@@ -339,10 +411,16 @@
+ if [ -z "$SHLIB_MULTILIB" ]; then
+ if [ "$dir" = . ]; then
+ shlib_base_name=libgcc_s
++ shlibunwind_base_name=libunwind
+ else
+ shlib_base_name=libgcc_s_`echo $dir | sed s,/,_,g`
++ shlibunwind_base_name=libunwind_`echo $dir | sed s,/,_,g`
+ fi
+ shlib_so_name="$shlib_base_name"
++ shlibunwind_so_name="$shlibunwind_base_name"
++ if [ "$LIBUNWIND" ]; then
++ shlib_deps="$shlib_deps ${dir}/${shlibunwind_base_name}${SHLIB_EXT}"
++ fi
+ shlib_dir=
+ if [ -n "$MULTILIB_OSDIRNAMES" ]; then
+ if [ "$dir" != . ]; then
+@@ -353,8 +431,10 @@
+ os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"`
+ if [ -z "$os_multilib_base" ]; then
+ shlib_so_name=libgcc_s
++ shlibunwind_so_name=libunwind
+ else
+ shlib_so_name=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g`
++ shlibunwind_so_name=libunwind_`echo $gcc_multilib_sup | sed s,/,_,g`
+ fi
+ fi
+ fi
+@@ -368,8 +448,21 @@
+ -e "s%@shlib_map_file@%$mapfile%g" \
+ -e "s%@shlib_so_name@%$shlib_so_name%g" \
+ -e "s%@shlib_dir@%$shlib_dir%g"
++ if [ "$LIBUNWIND" ]; then
++ echo ""
++ echo "${dir}/${shlibunwind_base_name}${SHLIB_EXT}: $shlibunwind_deps"
++ echo " $SHLIBUNWIND_LINK" \
++ | sed -e "s%@multilib_flags@%$flags%g" \
++ -e "s%@multilib_dir@%$dir%g" \
++ -e "s%@shlib_objs@%$libunwind_sh_objs%g" \
++ -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
++ -e "s%@shlib_so_name@%$shlibunwind_so_name%g" \
++ -e "s%@shlib_dir@%$shlib_dir%g" \
++ -e "s%@shlib_slibdir_qual@%%g"
++ fi
+ elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
+ shlib_base_name="libgcc_s";
++ shlibunwind_base_name="libunwind";
+ echo ""
+ echo "${shlib_base_name}${SHLIB_EXT}: $shlib_deps"
+ echo " $SHLIB_LINK" \
+@@ -380,6 +473,18 @@
+ -e "s%@shlib_map_file@%$mapfile%g" \
+ -e "s%@shlib_so_name@%$shlib_base_name%g" \
+ -e "s%@shlib_dir@%%g"
++ if [ "$LIBUNWIND" ]; then
++ echo ""
++ echo "${shlibunwind_base_name}${SHLIB_EXT}: $shlibunwind_deps"
++ echo " $SHLIBUNWIND_LINK" \
++ | sed -e "s%@multilib_flags@%$flags%g" \
++ -e "s%@multilib_dir@%$dir%g" \
++ -e "s%@shlib_objs@%$libgcc_sh_objs%g" \
++ -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
++ -e "s%@shlib_so_name@%$shlibunwind_base_name%g" \
++ -e "s%@shlib_dir@%%g" \
++ -e "s%@shlib_slibdir_qual@%%g"
++ fi
+ fi
+ fi
+ done
+@@ -411,6 +516,9 @@
+ dirs="$dirs ${dir} libgcc/${dir}"
+ fi
+ all="$all ${dir}/libgcc.a"
++ if [ "$LIBUNWIND" ]; then
++ all="$all ${dir}/libunwind.a"
++ fi
+ if [ "$SHLIB_LINK" ]; then
+ all="$all ${dir}/libgcc_eh.a"
+ if [ -z "$SHLIB_MULTILIB" ]; then
+@@ -420,8 +528,14 @@
+ suff=_`echo $dir | sed s,/,_,g`
+ fi
+ all="$all ${dir}/libgcc_s${suff}${SHLIB_EXT}"
++ if [ "$LIBUNWIND" ]; then
++ all="$all ${dir}/${dir}/libunwind${suff}${SHLIB_EXT}"
++ fi
+ elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
+ all="$all libgcc_s${SHLIB_EXT}"
++ if [ "$LIBUNWIND" ]; then
++ all="$all ${dir}/${dir}/libunwind${SHLIB_EXT}"
++ fi
+ fi
+ fi
+ done
+@@ -479,10 +593,13 @@
+ if [ -z "$SHLIB_MULTILIB" ]; then
+ if [ "$dir" = . ]; then
+ shlib_base_name=libgcc_s
++ shlibunwind_base_name=libunwind
+ else
+ shlib_base_name=libgcc_s_`echo $dir | sed s,/,_,g`
++ shlibunwind_base_name=libunwind_`echo $dir | sed s,/,_,g`
+ fi
+ shlib_so_name="$shlib_base_name"
++ shlibunwind_so_name="$shlibunwind_base_name"
+ shlib_dir=
+ shlib_slibdir_qual=
+ if [ -n "$MULTILIB_OSDIRNAMES" ]; then
+@@ -495,11 +612,13 @@
+ os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"`
+ if [ -z "$os_multilib_base" ]; then
+ shlib_so_name=libgcc_s
++ shlibunwind_so_name=libunwind
+ if [ "$os_multilib_dir" != "." ]; then
+ shlib_slibdir_qual="/$os_multilib_dir"
+ fi
+ else
+ shlib_so_name=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g`
++ shlibunwind_so_name=libunwind_`echo $gcc_multilib_sup | sed s,/,_,g`
+ shlib_slibdir_qual="/$os_multilib_base"
+ fi
+ fi
+@@ -508,6 +627,16 @@
+ -e "s%@shlib_so_name@%$shlib_so_name%g" \
+ -e "s%@shlib_dir@%$shlib_dir%g" \
+ -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
++ if [ "$LIBUNWIND" ]; then
++ echo " $SHLIBUNWIND_INSTALL" \
++ | sed -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
++ -e "s%@shlib_so_name@%$shlibunwind_so_name%g" \
++ -e "s%@shlib_dir@%$shlib_dir%g" \
++ -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
++ libunwinddir='$(DESTDIR)$(slibdir)$(shlib_slibdir_qual)/$(shlib_dir)'
++ echo ' $(INSTALL_DATA)' ${dir}/libunwind.a ${libunwinddir}/
++ echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a
++ fi
+ elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
+ shlib_base_name="libgcc_s";
+ echo " $SHLIB_INSTALL" \
+@@ -515,6 +644,16 @@
+ -e "s%@shlib_so_name@%$shlib_base_name%g" \
+ -e "s%@shlib_dir@%%g" \
+ -e "s%@shlib_slibdir_qual@%%g"
++ if [ "$LIBUNWIND" ]; then
++ echo " $SHLIBUNWIND_INSTALL" \
++ | sed -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
++ -e "s%@shlib_so_name@%$shlibunwind_base_name%g" \
++ -e "s%@shlib_dir@%%g" \
++ -e "s%@shlib_slibdir_qual@%%g"
++ libunwinddir='$(DESTDIR)$(slibdir)'
++ echo ' $(INSTALL_DATA)' ${dir}/libunwind.a ${libunwinddir}/
++ echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a
++ fi
+ fi
+ fi
+ done
+diff -urN src.old/gcc/unwind-compat.c src/gcc/unwind-compat.c
+--- src.old/gcc/unwind-compat.c 1970-01-01 01:00:00.000000000 +0100
++++ src/gcc/unwind-compat.c 2004-12-10 13:17:42.000000000 +0100
+@@ -0,0 +1,206 @@
++/* Backward compatibility unwind routines.
++ Copyright (C) 2004
++ 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.
++
++ In addition to the permissions in the GNU General Public License, the
++ Free Software Foundation gives you unlimited permission to link the
++ compiled version of this file into combinations with other programs,
++ and to distribute those combinations without any restriction coming
++ from the use of this file. (The General Public License restrictions
++ do apply in other respects; for example, they cover modification of
++ the file, and distribution when not linked into a combined
++ executable.)
++
++ 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, 59 Temple Place - Suite 330, Boston, MA
++ 02111-1307, USA. */
++
++#if defined (USE_GAS_SYMVER) && defined (USE_LIBUNWIND_EXCEPTIONS)
++#include "unwind.h"
++#include "unwind-dw2-fde.h"
++#include "unwind-compat.h"
++
++extern _Unwind_Reason_Code __libunwind_Unwind_Backtrace
++ (_Unwind_Trace_Fn, void *);
++
++_Unwind_Reason_Code
++_Unwind_Backtrace (_Unwind_Trace_Fn trace, void *trace_argument)
++{
++ return __libunwind_Unwind_Backtrace (trace, trace_argument);
++}
++symver (_Unwind_Backtrace, GCC_3.3);
++
++extern void __libunwind_Unwind_DeleteException
++ (struct _Unwind_Exception *);
++
++void
++_Unwind_DeleteException (struct _Unwind_Exception *exc)
++{
++ return __libunwind_Unwind_DeleteException (exc);
++}
++symver (_Unwind_DeleteException, GCC_3.0);
++
++extern void * __libunwind_Unwind_FindEnclosingFunction (void *);
++
++void *
++_Unwind_FindEnclosingFunction (void *pc)
++{
++ return __libunwind_Unwind_FindEnclosingFunction (pc);
++}
++symver (_Unwind_FindEnclosingFunction, GCC_3.3);
++
++extern _Unwind_Reason_Code __libunwind_Unwind_ForcedUnwind
++ (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
++
++_Unwind_Reason_Code
++_Unwind_ForcedUnwind (struct _Unwind_Exception *exc,
++ _Unwind_Stop_Fn stop, void * stop_argument)
++{
++ return __libunwind_Unwind_ForcedUnwind (exc, stop, stop_argument);
++}
++symver (_Unwind_ForcedUnwind, GCC_3.0);
++
++extern _Unwind_Word __libunwind_Unwind_GetCFA
++ (struct _Unwind_Context *);
++
++_Unwind_Word
++_Unwind_GetCFA (struct _Unwind_Context *context)
++{
++ return __libunwind_Unwind_GetCFA (context);
++}
++symver (_Unwind_GetCFA, GCC_3.3);
++
++#ifdef __ia64__
++extern _Unwind_Word __libunwind_Unwind_GetBSP
++ (struct _Unwind_Context *);
++
++_Unwind_Word
++_Unwind_GetBSP (struct _Unwind_Context * context)
++{
++ return __libunwind_Unwind_GetBSP (context);
++}
++symver (_Unwind_GetBSP, GCC_3.3.2);
++#else
++extern _Unwind_Ptr __libunwind_Unwind_GetDataRelBase
++ (struct _Unwind_Context *);
++
++_Unwind_Ptr
++_Unwind_GetDataRelBase (struct _Unwind_Context *context)
++{
++ return __libunwind_Unwind_GetDataRelBase (context);
++}
++symver (_Unwind_GetDataRelBase, GCC_3.0);
++
++extern _Unwind_Ptr __libunwind_Unwind_GetTextRelBase
++ (struct _Unwind_Context *);
++
++_Unwind_Ptr
++_Unwind_GetTextRelBase (struct _Unwind_Context *context)
++{
++ return __libunwind_Unwind_GetTextRelBase (context);
++}
++symver (_Unwind_GetTextRelBase, GCC_3.0);
++#endif
++
++extern _Unwind_Word __libunwind_Unwind_GetGR
++ (struct _Unwind_Context *, int );
++
++_Unwind_Word
++_Unwind_GetGR (struct _Unwind_Context *context, int index)
++{
++ return __libunwind_Unwind_GetGR (context, index);
++}
++symver (_Unwind_GetGR, GCC_3.0);
++
++extern _Unwind_Ptr __libunwind_Unwind_GetIP (struct _Unwind_Context *);
++
++_Unwind_Ptr
++_Unwind_GetIP (struct _Unwind_Context *context)
++{
++ return __libunwind_Unwind_GetIP (context);
++}
++symver (_Unwind_GetIP, GCC_3.0);
++
++extern void *__libunwind_Unwind_GetLanguageSpecificData
++ (struct _Unwind_Context *);
++
++void *
++_Unwind_GetLanguageSpecificData (struct _Unwind_Context *context)
++{
++ return __libunwind_Unwind_GetLanguageSpecificData (context);
++}
++symver (_Unwind_GetLanguageSpecificData, GCC_3.0);
++
++extern _Unwind_Ptr __libunwind_Unwind_GetRegionStart
++ (struct _Unwind_Context *);
++
++_Unwind_Ptr
++_Unwind_GetRegionStart (struct _Unwind_Context *context)
++{
++ return __libunwind_Unwind_GetRegionStart (context);
++}
++symver (_Unwind_GetRegionStart, GCC_3.0);
++
++extern _Unwind_Reason_Code __libunwind_Unwind_RaiseException
++ (struct _Unwind_Exception *);
++
++_Unwind_Reason_Code
++_Unwind_RaiseException(struct _Unwind_Exception *exc)
++{
++ return __libunwind_Unwind_RaiseException (exc);
++}
++symver (_Unwind_RaiseException, GCC_3.0);
++
++extern void __libunwind_Unwind_Resume (struct _Unwind_Exception *);
++
++void
++_Unwind_Resume (struct _Unwind_Exception *exc)
++{
++ __libunwind_Unwind_Resume (exc);
++}
++symver (_Unwind_Resume, GCC_3.0);
++
++extern _Unwind_Reason_Code __libunwind_Unwind_Resume_or_Rethrow
++ (struct _Unwind_Exception *);
++
++_Unwind_Reason_Code
++_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc)
++{
++ return __libunwind_Unwind_Resume_or_Rethrow (exc);
++}
++symver (_Unwind_Resume_or_Rethrow, GCC_3.3);
++
++extern void __libunwind_Unwind_SetGR
++ (struct _Unwind_Context *, int, _Unwind_Word);
++
++void
++_Unwind_SetGR (struct _Unwind_Context *context, int index,
++ _Unwind_Word val)
++{
++ __libunwind_Unwind_SetGR (context, index, val);
++}
++symver (_Unwind_SetGR, GCC_3.0);
++
++extern void __libunwind_Unwind_SetIP
++ (struct _Unwind_Context *, _Unwind_Ptr);
++
++void
++_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
++{
++ return __libunwind_Unwind_SetIP (context, val);
++}
++symver (_Unwind_SetIP, GCC_3.0);
++#endif
+diff -urN src.old/gcc/unwind-compat.h src/gcc/unwind-compat.h
+--- src.old/gcc/unwind-compat.h 1970-01-01 01:00:00.000000000 +0100
++++ src/gcc/unwind-compat.h 2004-12-10 13:17:42.000000000 +0100
+@@ -0,0 +1,35 @@
++/* Backward compatibility unwind routines.
++ Copyright (C) 2004
++ 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.
++
++ In addition to the permissions in the GNU General Public License, the
++ Free Software Foundation gives you unlimited permission to link the
++ compiled version of this file into combinations with other programs,
++ and to distribute those combinations without any restriction coming
++ from the use of this file. (The General Public License restrictions
++ do apply in other respects; for example, they cover modification of
++ the file, and distribution when not linked into a combined
++ executable.)
++
++ 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, 59 Temple Place - Suite 330, Boston, MA
++ 02111-1307, USA. */
++
++#define symver(name, version) \
++ __asm__ (".symver " #name"," #name "@" #version)
++
++#define alias(name) \
++ __typeof(name) __libunwind##name __attribute__ ((alias (#name)))
+diff -urN src.old/gcc/unwind-dw2-fde-compat.c src/gcc/unwind-dw2-fde-compat.c
+--- src.old/gcc/unwind-dw2-fde-compat.c 1970-01-01 01:00:00.000000000 +0100
++++ src/gcc/unwind-dw2-fde-compat.c 2004-12-10 13:17:42.000000000 +0100
+@@ -0,0 +1,46 @@
++/* Backward compatibility unwind routines.
++ Copyright (C) 2004
++ 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.
++
++ In addition to the permissions in the GNU General Public License, the
++ Free Software Foundation gives you unlimited permission to link the
++ compiled version of this file into combinations with other programs,
++ and to distribute those combinations without any restriction coming
++ from the use of this file. (The General Public License restrictions
++ do apply in other respects; for example, they cover modification of
++ the file, and distribution when not linked into a combined
++ executable.)
++
++ 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, 59 Temple Place - Suite 330, Boston, MA
++ 02111-1307, USA. */
++
++#if defined (USE_GAS_SYMVER) && defined (USE_LIBUNWIND_EXCEPTIONS)
++#include "unwind.h"
++#include "unwind-dw2-fde.h"
++#include "unwind-compat.h"
++
++extern const fde * __libunwind__Unwind_Find_FDE
++ (void *, struct dwarf_eh_bases *);
++
++const fde *
++_Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
++{
++ __libunwind__Unwind_Find_FDE (pc, bases);
++}
++
++symver (_Unwind_Find_FDE, GCC_3.0);
++#endif
+diff -urN src.old/gcc/unwind-dw2-fde-glibc.c src/gcc/unwind-dw2-fde-glibc.c
+--- src.old/gcc/unwind-dw2-fde-glibc.c 2002-11-07 07:00:04.000000000 +0100
++++ src/gcc/unwind-dw2-fde-glibc.c 2004-12-10 13:17:42.000000000 +0100
+@@ -46,6 +46,7 @@
+ #define NO_BASE_OF_ENCODED_VALUE
+ #include "unwind-pe.h"
+ #include "unwind-dw2-fde.h"
++#include "unwind-compat.h"
+ #include "gthr.h"
+
+ #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+@@ -297,3 +298,7 @@
+ #define _Unwind_Find_FDE _Unwind_Find_FDE
+ #include "unwind-dw2-fde.c"
+ #endif
++
++#if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS)
++alias (_Unwind_Find_FDE);
++#endif
+diff -urN src.old/gcc/unwind-dw2.c src/gcc/unwind-dw2.c
+--- src.old/gcc/unwind-dw2.c 2004-05-08 23:52:42.000000000 +0200
++++ src/gcc/unwind-dw2.c 2004-12-10 13:17:42.000000000 +0100
+@@ -1271,4 +1271,24 @@
+
+ #include "unwind.inc"
+
++#if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS)
++alias (_Unwind_Backtrace);
++alias (_Unwind_DeleteException);
++alias (_Unwind_FindEnclosingFunction);
++alias (_Unwind_FindTableEntry);
++alias (_Unwind_ForcedUnwind);
++alias (_Unwind_GetDataRelBase);
++alias (_Unwind_GetTextRelBase);
++alias (_Unwind_GetCFA);
++alias (_Unwind_GetGR);
++alias (_Unwind_GetIP);
++alias (_Unwind_GetLanguageSpecificData);
++alias (_Unwind_GetRegionStart);
++alias (_Unwind_RaiseException);
++alias (_Unwind_Resume);
++alias (_Unwind_Resume_or_Rethrow);
++alias (_Unwind_SetGR);
++alias (_Unwind_SetIP);
++#endif
++
+ #endif /* !USING_SJLJ_EXCEPTIONS */
diff --git a/3.3.6/gentoo/55_all_pr17684.patch b/3.3.6/gentoo/55_all_pr17684.patch
new file mode 100644
index 0000000..707681a
--- /dev/null
+++ b/3.3.6/gentoo/55_all_pr17684.patch
@@ -0,0 +1,269 @@
+[Snipped from Debian's gcc-3.3_3.3.6-10]
+
+# DP: Backport of PR17684 to the gcc-3.3 branch
+
+2004-09-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR bootstrap/17684
+ * Makefile.in (clean): Remove libgcc_s$(SHLIB_EXT).1.stage?.
+ (stage1-start): Remove and copy libunwind.a and
+ libunwind*$(SHLIB_EXT) instead of libunwind*.
+ (stage2-start): Likewise.
+ (stage3-start): Likewise.
+ (stage4-start): Likewise.
+ (stageprofile-start): Likewise.
+ (stagefeedback-start): Likewise.
+
+ * config/alpha/t-osf4 (SHLIB_LINK): Use a temporary file for
+ the shared library to be created and don't remove the existing
+ shared library.
+ * config/arm/t-netbsd (SHLIB_LINK): Likewise.
+ * config/mips/t-iris5-6 (SHLIB_LINK): Likewise.
+ * config/pa/t-hpux-shlib (SHLIB_LINK): Likewise.
+ * config/sh/t-linux (SHLIB_LINK): Likewise.
+ * config/t-libunwind-elf (SHLIBUNWIND_LINK): Likewise.
+ * config/t-slibgcc-darwin (SHLIB_LINK): Likewise.
+ * config/t-slibgcc-elf-ver (SHLIB_LINK): Likewise.
+ * config/t-slibgcc-sld (SHLIB_LINK): Likewise.
+
+ * mklibgcc.in (libgcc-stage-start): Also move "*${objext}s"
+ files.
+
+diff -urN gcc.old/Makefile.in gcc/Makefile.in
+--- gcc.old/Makefile.in 2004-12-10 13:28:49.000000000 +0100
++++ gcc/Makefile.in 2004-12-10 14:36:38.000000000 +0100
+@@ -2678,8 +2678,9 @@
+ # that don't exist in the distribution.
+ INTL_CLEAN = intl.clean
+ clean: mostlyclean $(INTL_CLEAN) lang.clean
+- -rm -f libgcc.a libgcc_eh.a libgcc_s$(SHLIB_EXT) libgcc_s$(SHLIB_EXT).1
++ -rm -f libgcc.a libgcc_eh.a
+ -rm -f libunwind*
++ -rm -f libgcc_s*
+ -rm -f config.h tconfig.h hconfig.h tm_p.h
+ -rm -f cs-*
+ -rm -rf libgcc
+@@ -3576,7 +3577,7 @@
+ -if [ -f ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
+ -if [ -f collect-ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
+ -rm -f stage1/libgcc.a stage1/libgcc_eh.a stage1/libgcc_s*$(SHLIB_EXT)
+- -rm -f stage1/libunwind*
++ -rm -f stage1/libunwind.a stage1/libunwind*$(SHLIB_EXT)
+ -cp libgcc.a stage1
+ -if $(RANLIB_TEST_FOR_TARGET) ; then \
+ $(RANLIB_FOR_TARGET) stage1/libgcc.a; \
+@@ -3586,7 +3587,7 @@
+ $(RANLIB_FOR_TARGET) stage1/libgcc_eh.a; \
+ else true; fi; fi
+ -cp libgcc_s*$(SHLIB_EXT) stage1/
+- -cp libunwind* stage1/
++ -cp libunwind.a libunwind*$(SHLIB_EXT) stage1
+ -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
+ cp stage1/$${f} . ; \
+ else true; \
+@@ -3608,7 +3609,7 @@
+ -if [ -f ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
+ -if [ -f collect-ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
+ -rm -f stage2/libgcc.a stage2/libgcc_eh.a stage2/libgcc_s*$(SHLIB_EXT)
+- -rm -f stage2/libunwind*
++ -rm -f stage2/libunwind.a stage2/libunwind*$(SHLIB_EXT)
+ -cp libgcc.a stage2
+ -if $(RANLIB_TEST_FOR_TARGET) ; then \
+ $(RANLIB_FOR_TARGET) stage2/libgcc.a; \
+@@ -3618,7 +3619,7 @@
+ $(RANLIB_FOR_TARGET) stage2/libgcc_eh.a; \
+ else true; fi; fi
+ -cp libgcc_s*$(SHLIB_EXT) stage2/
+- -cp libunwind* stage2/
++ -cp libunwind.a libunwind*$(SHLIB_EXT) stage2
+ -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
+ cp stage2/$${f} . ; \
+ else true; \
+@@ -3640,7 +3641,7 @@
+ -if [ -f ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
+ -if [ -f collect-ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
+ -rm -f stage3/libgcc.a stage3/libgcc_eh.a stage3/libgcc_s*$(SHLIB_EXT)
+- -rm -f stage3/libunwind*
++ -rm -f stage3/libunwind.a stage3/libunwind*$(SHLIB_EXT)
+ -cp libgcc.a stage3
+ -if $(RANLIB_TEST_FOR_TARGET) ; then \
+ $(RANLIB_FOR_TARGET) stage3/libgcc.a; \
+@@ -3650,7 +3651,7 @@
+ $(RANLIB_FOR_TARGET) stage3/libgcc_eh.a; \
+ else true; fi; fi
+ -cp libgcc_s*$(SHLIB_EXT) stage3/
+- -cp libunwind* stage3/
++ -cp libunwind.a libunwind*$(SHLIB_EXT) stage3
+ -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
+ cp stage3/$${f} . ; \
+ else true; \
+@@ -3672,7 +3673,7 @@
+ -if [ -f ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
+ -if [ -f collect-ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
+ -rm -f stage4/libgcc.a stage4/libgcc_eh.a stage4/libgcc_s*$(SHLIB_EXT)
+- -rm -f stage4/libunwind*
++ -rm -f stage4/libunwind.a stage4/libunwind*$(SHLIB_EXT)
+ -cp libgcc.a stage4
+ -if $(RANLIB_TEST_FOR_TARGET) ; then \
+ $(RANLIB_FOR_TARGET) stage4/libgcc.a; \
+@@ -3682,7 +3683,7 @@
+ $(RANLIB_FOR_TARGET) stage4/libgcc_eh.a; \
+ else true; fi; fi
+ -cp libgcc_s*$(SHLIB_EXT) stage4/
+- -cp libunwind* stage4/
++ -cp libunwind.a libunwind*$(SHLIB_EXT) stage4
+ -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
+ cp stage4/$${f} . ; \
+ else true; \
+diff -urN gcc.old/config/alpha/t-osf4 gcc/config/alpha/t-osf4
+--- gcc.old/config/alpha/t-osf4 2003-01-26 12:35:07.000000000 +0100
++++ gcc/config/alpha/t-osf4 2004-12-10 14:37:33.000000000 +0100
+@@ -11,9 +11,13 @@
+ SHLIB_OBJS = @shlib_objs@
+
+ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+- -Wl,-msym -Wl,-set_version,gcc.1 -Wl,-soname,$(SHLIB_SONAME) \
++ -Wl,-msym -Wl,-set_version,gcc.1 -Wl,-soname,$(SHLIB_SONAME).tmp \
+ -o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SONAME) && \
++ if [ -f $(SHLIB_NAME) ]; then \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ else true; fi && \
++ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
+ # $(slibdir) double quoted to protect it from expansion while building
+ # libgcc.mk. We want this delayed until actual install time.
+diff -urN gcc.old/config/arm/t-netbsd gcc/config/arm/t-netbsd
+--- gcc.old/config/arm/t-netbsd 2003-01-26 12:35:08.000000000 +0100
++++ gcc/config/arm/t-netbsd 2004-12-10 14:31:15.000000000 +0100
+@@ -11,8 +11,12 @@
+
+ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,-soname,$(SHLIB_SONAME) \
+- -o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
++ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SONAME) && \
++ if [ -f $(SHLIB_NAME) ]; then \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ else true; fi && \
++ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
+ # $(slibdir) double quoted to protect it from expansion while building
+ # libgcc.mk. We want this delayed until actual install time.
+diff -urN gcc.old/config/mips/t-iris5-6 gcc/config/mips/t-iris5-6
+--- gcc.old/config/mips/t-iris5-6 2003-01-26 12:35:08.000000000 +0100
++++ gcc/config/mips/t-iris5-6 2004-12-10 14:31:15.000000000 +0100
+@@ -9,8 +9,12 @@
+
+ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,-soname,$(SHLIB_SONAME) \
+- -o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
++ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SOLINK) && \
++ if [ -f $(SHLIB_NAME) ]; then \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ else true; fi && \
++ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
+ # ??? Irix 6.5 seems to eat the option fine (if we somehow remove the
+ # -hidden_symbol option, which is documented to be ignored in conjunction
+diff -urN gcc.old/config/pa/t-hpux-shlib gcc/config/pa/t-hpux-shlib
+--- gcc.old/config/pa/t-hpux-shlib 2003-01-26 12:35:08.000000000 +0100
++++ gcc/config/pa/t-hpux-shlib 2004-12-10 14:31:15.000000000 +0100
+@@ -5,8 +5,12 @@
+ SHLIB_OBJS = @shlib_objs@
+
+ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+- -o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
++ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SONAME) && \
++ if [ -f $(SHLIB_NAME) ]; then \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ else true; fi && \
++ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
+
+
+diff -urN gcc.old/config/sh/t-linux gcc/config/sh/t-linux
+--- gcc.old/config/sh/t-linux 2004-07-26 02:47:35.000000000 +0200
++++ gcc/config/sh/t-linux 2004-12-10 14:31:15.000000000 +0100
+@@ -25,8 +25,12 @@
+ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,--soname=$(SHLIB_SONAME) \
+ -Wl,--version-script=$(SHLIB_MAP) \
+- -o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
++ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_SOLINK) && \
++ if [ -f $(SHLIB_NAME) ]; then \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ else true; fi && \
++ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ (echo "/* GNU ld script"; \
+ echo " Use the shared library, but some functions are only in"; \
+ echo " the static library. */"; \
+diff -urN gcc.old/config/t-libunwind-elf gcc/config/t-libunwind-elf
+--- gcc.old/config/t-libunwind-elf 2004-12-10 13:17:36.000000000 +0100
++++ gcc/config/t-libunwind-elf 2004-12-10 14:31:15.000000000 +0100
+@@ -10,9 +10,14 @@
+
+ SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared \
+ -nodefaultlibs -Wl,-h,$(SHLIBUNWIND_SONAME) \
+- -Wl,-z,text -Wl,-z,defs \
+- -o $(SHLIBUNWIND_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
++ -Wl,-z,text -Wl,-z,defs -o $(SHLIBUNWIND_NAME).tmp \
++ @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SOLINK) && \
++ if [ -f $(SHLIBUNWIND_NAME) ]; then \
++ mv -f $(SHLIBUNWIND_NAME) \
++ $(SHLIBUNWIND_NAME).`basename $(STAGE_PREFIX)`; \
++ else true; fi && \
++ mv $(SHLIBUNWIND_NAME).tmp $(SHLIBUNWIND_NAME) && \
+ $(LN_S) $(SHLIBUNWIND_NAME) $(SHLIB_SOLINK)
+
+ # $(slibdir) double quoted to protect it from expansion while building
+diff -urN gcc.old/config/t-slibgcc-elf-ver gcc/config/t-slibgcc-elf-ver
+--- gcc.old/config/t-slibgcc-elf-ver 2003-01-26 12:35:07.000000000 +0100
++++ gcc/config/t-slibgcc-elf-ver 2004-12-10 14:31:18.000000000 +0100
+@@ -13,8 +13,12 @@
+ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,--soname=$(SHLIB_SONAME) \
+ -Wl,--version-script=$(SHLIB_MAP) \
+- -o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
++ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_SOLINK) && \
++ if [ -f $(SHLIB_NAME) ]; then \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ else true; fi && \
++ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
+ # $(slibdir) double quoted to protect it from expansion while building
+ # libgcc.mk. We want this delayed until actual install time.
+diff -urN gcc.old/config/t-slibgcc-sld gcc/config/t-slibgcc-sld
+--- gcc.old/config/t-slibgcc-sld 2003-01-26 12:35:07.000000000 +0100
++++ gcc/config/t-slibgcc-sld 2004-12-10 14:31:18.000000000 +0100
+@@ -10,9 +10,13 @@
+
+ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,-h,$(SHLIB_SONAME) -Wl,-z,text -Wl,-z,defs \
+- -Wl,-M,$(SHLIB_MAP) -o $(SHLIB_NAME) \
++ -Wl,-M,$(SHLIB_MAP) -o $(SHLIB_NAME).tmp \
+ @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SOLINK) && \
++ if [ -f $(SHLIB_NAME) ]; then \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ else true; fi && \
++ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
+ # $(slibdir) double quoted to protect it from expansion while building
+ # libgcc.mk. We want this delayed until actual install time.
+diff -urN gcc.old/mklibgcc.in gcc/mklibgcc.in
+--- gcc.old/mklibgcc.in 2004-12-10 14:19:28.000000000 +0100
++++ gcc/mklibgcc.in 2004-12-10 14:31:18.000000000 +0100
+@@ -503,6 +503,7 @@
+ echo ' done'
+ echo ' -for dir in '"${dirs}"'; do \'
+ echo ' mv $$dir/*'"${objext}"' $(stage)/$$dir; \'
++echo ' mv $$dir/*'"${objext}s"' $(stage)/$$dir || true; \'
+ echo ' test ! -f $$dir/stacknote.s || mv $$dir/stacknote.s $(stage)/$$dir; \'
+ echo ' done'
+
diff --git a/3.3.6/gentoo/56_all_pr18153.patch b/3.3.6/gentoo/56_all_pr18153.patch
new file mode 100644
index 0000000..f51e058
--- /dev/null
+++ b/3.3.6/gentoo/56_all_pr18153.patch
@@ -0,0 +1,72 @@
+[Snipped from Debian's gcc-3.3_3.3.6-10]
+
+# DP: Backport of PR18153 to the gcc-3.3 branch
+
+2004-10-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/18153
+ * configure.in: Define HAVE_LD_STATIC_DYNAMIC if linker supports
+ -Bstatic/-Bdynamic option.
+ * config.in: Regenerated.
+ * configure: Likewise.
+
+ * gcc.c (init_spec): Pass -Bstatic/-Bdynamic to ld for static
+ -lunwind if possible.
+
+diff -urN gcc.old/config.in gcc/config.in
+--- gcc.old/config.in 2004-12-10 13:38:35.000000000 +0100
++++ gcc/config.in 2004-12-10 14:46:47.000000000 +0100
+@@ -228,6 +228,9 @@
+ /* Define if you have the <langinfo.h> header file. */
+ #undef HAVE_LANGINFO_H
+
++/* Define if your linker supports -Bstatic/-Bdynamic option. */
++#undef HAVE_LD_STATIC_DYNAMIC
++
+ /* Define if you have the <limits.h> header file. */
+ #undef HAVE_LIMITS_H
+
+diff -urN gcc.old/configure.in gcc/configure.in
+--- gcc.old/configure.in 2004-12-10 13:48:59.000000000 +0100
++++ gcc/configure.in 2004-12-10 14:54:52.000000000 +0100
+@@ -2432,6 +2432,25 @@
+ fi
+ AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
+
++AC_MSG_CHECKING(linker -Bstatic/-Bdynamic option)
++gcc_cv_ld_static_dynamic=no
++if test $in_tree_ld = yes ; then
++ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10; then
++ gcc_cv_ld_static_dynamic=yes
++ fi
++elif test x$gcc_cv_ld != x; then
++ # Check if linker supports -Bstatic/-Bdynamic option
++ if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \
++ && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then
++ gcc_cv_ld_static_dynamic=yes
++ fi
++fi
++if test x"$gcc_cv_ld_static_dynamic" = xyes; then
++ AC_DEFINE(HAVE_LD_STATIC_DYNAMIC, 1,
++[Define if your linker supports -Bstatic/-Bdynamic option.])
++fi
++AC_MSG_RESULT($gcc_cv_ld_static_dynamic)
++
+ AC_MSG_CHECKING(linker --as-needed support)
+ gcc_cv_ld_as_needed=no
+ if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
+diff -urN gcc.old/gcc.c gcc/gcc.c
+--- gcc.old/gcc.c 2004-12-10 13:17:41.000000000 +0100
++++ gcc/gcc.c 2004-12-10 14:45:51.000000000 +0100
+@@ -1584,7 +1584,11 @@
+ "-lgcc",
+ "-lgcc_eh"
+ #ifdef USE_LIBUNWIND_EXCEPTIONS
++# ifdef HAVE_LD_STATIC_DYNAMIC
++ " %{!static:-Bstatic} -lunwind %{!static:-Bdynamic}"
++# else
+ " -lunwind"
++# endif
+ #endif
+ );
+
diff --git a/3.3.6/gentoo/57_all_pr18380.patch b/3.3.6/gentoo/57_all_pr18380.patch
new file mode 100644
index 0000000..1044874
--- /dev/null
+++ b/3.3.6/gentoo/57_all_pr18380.patch
@@ -0,0 +1,33 @@
+[Snipped from Debian's gcc-3.3_3.3.6-10]
+
+# DP: Backport of PR18380 to the gcc-3.3 branch
+
+2004-11-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/18380
+ * config/ia64/unwind-ia64.h (_Unwind_FindTableEntry): Mark it
+ hidden.
+
+ * unwind-dw2.c (_Unwind_FindTableEntry): Removed.
+
+diff -ur gcc.old/config/ia64/unwind-ia64.h gcc/config/ia64/unwind-ia64.h
+--- gcc.old/config/ia64/unwind-ia64.h 2001-05-12 08:03:20.000000000 +0200
++++ gcc/config/ia64/unwind-ia64.h 2004-12-10 14:58:10.000000000 +0100
+@@ -28,4 +28,5 @@
+
+ extern struct unw_table_entry *
+ _Unwind_FindTableEntry (void *pc, unsigned long *segment_base,
+- unsigned long *gp);
++ unsigned long *gp)
++ __attribute__ ((__visibility__ ("hidden")));
+diff -ur gcc.old/unwind-dw2.c gcc/unwind-dw2.c
+--- gcc.old/unwind-dw2.c 2004-12-10 13:17:42.000000000 +0100
++++ gcc/unwind-dw2.c 2004-12-10 14:58:10.000000000 +0100
+@@ -1275,7 +1275,6 @@
+ alias (_Unwind_Backtrace);
+ alias (_Unwind_DeleteException);
+ alias (_Unwind_FindEnclosingFunction);
+-alias (_Unwind_FindTableEntry);
+ alias (_Unwind_ForcedUnwind);
+ alias (_Unwind_GetDataRelBase);
+ alias (_Unwind_GetTextRelBase);
diff --git a/3.3.6/gentoo/58_all_pr18508.patch b/3.3.6/gentoo/58_all_pr18508.patch
new file mode 100644
index 0000000..99f6cb3
--- /dev/null
+++ b/3.3.6/gentoo/58_all_pr18508.patch
@@ -0,0 +1,101 @@
+[Snipped from Debian's gcc-3.3_3.3.6-10]
+
+# DP: Backport of PR18508 to the gcc-3.3 branch
+
+2004-11-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR other/18508
+ * config/alpha/t-osf4 (SHLIB_LINK): Use `.backup' as the suffix
+ to back up the existing shared library.
+ * config/arm/t-netbsd (SHLIB_LINK): Likewise.
+ * config/pa/t-hpux-shlib (SHLIB_LINK): Likewise.
+ * config/sh/t-linux (SHLIB_LINK): Likewise.
+ * config/t-libunwind-elf (SHLIBUNWIND_LINK): Likewise.
+ * config/t-slibgcc-elf-ver (SHLIB_LINK): Likewise.
+ * config/t-slibgcc-sld (SHLIB_LINK): Likewise.
+
+diff -urN gcc.old/config/alpha/t-osf4 gcc/config/alpha/t-osf4
+--- gcc.old/config/alpha/t-osf4 2004-12-10 14:37:33.000000000 +0100
++++ gcc/config/alpha/t-osf4 2004-12-10 15:02:55.000000000 +0100
+@@ -15,7 +15,7 @@
+ -o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SONAME) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
+diff -urN gcc.old/config/arm/t-netbsd gcc/config/arm/t-netbsd
+--- gcc.old/config/arm/t-netbsd 2004-12-10 14:31:15.000000000 +0100
++++ gcc/config/arm/t-netbsd 2004-12-10 15:02:55.000000000 +0100
+@@ -14,7 +14,7 @@
+ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SONAME) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
+diff -urN gcc.old/config/pa/t-hpux-shlib gcc/config/pa/t-hpux-shlib
+--- gcc.old/config/pa/t-hpux-shlib 2004-12-10 14:31:15.000000000 +0100
++++ gcc/config/pa/t-hpux-shlib 2004-12-10 15:03:51.000000000 +0100
+@@ -8,7 +8,7 @@
+ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SONAME) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
+diff -urN gcc.old/config/sh/t-linux gcc/config/sh/t-linux
+--- gcc.old/config/sh/t-linux 2004-12-10 14:31:15.000000000 +0100
++++ gcc/config/sh/t-linux 2004-12-10 15:03:51.000000000 +0100
+@@ -28,7 +28,7 @@
+ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ (echo "/* GNU ld script"; \
+diff -urN gcc.old/config/t-libunwind-elf gcc/config/t-libunwind-elf
+--- gcc.old/config/t-libunwind-elf 2004-12-10 14:31:15.000000000 +0100
++++ gcc/config/t-libunwind-elf 2004-12-10 15:03:51.000000000 +0100
+@@ -14,8 +14,7 @@
+ @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SOLINK) && \
+ if [ -f $(SHLIBUNWIND_NAME) ]; then \
+- mv -f $(SHLIBUNWIND_NAME) \
+- $(SHLIBUNWIND_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIBUNWIND_NAME) $(SHLIBUNWIND_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIBUNWIND_NAME).tmp $(SHLIBUNWIND_NAME) && \
+ $(LN_S) $(SHLIBUNWIND_NAME) $(SHLIB_SOLINK)
+diff -urN gcc.old/config/t-slibgcc-elf-ver gcc/config/t-slibgcc-elf-ver
+--- gcc.old/config/t-slibgcc-elf-ver 2004-12-10 14:31:18.000000000 +0100
++++ gcc/config/t-slibgcc-elf-ver 2004-12-10 15:03:54.000000000 +0100
+@@ -16,7 +16,7 @@
+ -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
+diff -urN gcc.old/config/t-slibgcc-sld gcc/config/t-slibgcc-sld
+--- gcc.old/config/t-slibgcc-sld 2004-12-10 14:31:18.000000000 +0100
++++ gcc/config/t-slibgcc-sld 2004-12-10 15:03:54.000000000 +0100
+@@ -14,7 +14,7 @@
+ @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_NAME) ]; then \
+- mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
++ mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ else true; fi && \
+ mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
diff --git a/3.3.6/gentoo/59_all_pr23241.patch b/3.3.6/gentoo/59_all_pr23241.patch
new file mode 100644
index 0000000..da98b22
--- /dev/null
+++ b/3.3.6/gentoo/59_all_pr23241.patch
@@ -0,0 +1,30 @@
+[Snipped from Debian's gcc-3.3_3.3.6-10]
+
+# DP: Fix PR rtl-optimization/23241
+
+http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00446.html
+
+Index: gcc/combine.c
+===================================================================
+RCS file: /cvsroot/gcc/gcc/gcc/combine.c,v
+retrieving revision 1.325.2.19
+diff -c -3 -p -r1.325.2.19 combine.c
+*** gcc/combine.c 18 Jan 2005 08:39:05 -0000 1.325.2.19
+--- gcc/combine.c 5 Aug 2005 18:50:13 -0000
+*************** simplify_comparison (code, pop0, pop1)
+*** 10863,10869 ****
+ /* (A - C1) always sign-extends, like C2. */
+ && num_sign_bit_copies (a, inner_mode)
+ > (unsigned int) (GET_MODE_BITSIZE (inner_mode)
+! - mode_width - 1)))
+ {
+ op0 = SUBREG_REG (op0);
+ continue;
+--- 10863,10869 ----
+ /* (A - C1) always sign-extends, like C2. */
+ && num_sign_bit_copies (a, inner_mode)
+ > (unsigned int) (GET_MODE_BITSIZE (inner_mode)
+! - (mode_width - 1))))
+ {
+ op0 = SUBREG_REG (op0);
+ continue;