Index: /trunk/dports/lang/gcc47/Portfile
===================================================================
--- /trunk/dports/lang/gcc47/Portfile	(revision 98486)
+++ /trunk/dports/lang/gcc47/Portfile	(revision 98487)
@@ -52,7 +52,5 @@
 depends_skip_archcheck-append gcc_select ld64 cctools
 
-patchfiles          ppc_fde_encoding.diff
-patch.dir           ${workpath}/gcc-${version}
-
+patchfiles          ppc_fde_encoding.diff  gcc-PR-53453.patch
 patch.dir           ${workpath}/gcc-${version}
 
@@ -129,8 +127,8 @@
     conflicts       libstdcxx-devel
 
-    # We might want to consider adding this patch to the gcc subport as well
-    # since it removes stuff that doesn't really make sense in the context of
-    # MacPorts
-    patchfiles-append  no-runtime-stubs.patch
+    post-patch {
+        # Force linking against a static libgcc
+        reinplace "/DENABLE_SHARED_LIBGCC/d" ${patch.dir}/gcc/Makefile.in
+    }
 
     depends_run-delete path:lib/libstdc\\\\+\\\\+.6.dylib:libstdcxx
Index: /trunk/dports/lang/gcc47/files/gcc-PR-53453.patch
===================================================================
--- /trunk/dports/lang/gcc47/files/gcc-PR-53453.patch	(revision 98487)
+++ /trunk/dports/lang/gcc47/files/gcc-PR-53453.patch	(revision 98487)
@@ -0,0 +1,90 @@
+http://gcc.gnu.org/ml/gcc-patches/2012-06/msg01181.html
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53453
+
+diff -uNr gcc/config/darwin.h gcc/config/darwin.h
+--- gcc/config/darwin.h	2012-02-16 03:21:46.000000000 -0500
++++ gcc/config/darwin.h	2012-06-08 08:54:25.000000000 -0400
+@@ -356,7 +356,9 @@
+      %{!Zbundle:%{pg:%{static:-lgcrt0.o}				    \
+                      %{!static:%{object:-lgcrt0.o}			    \
+                                %{!object:%{preload:-lgcrt0.o}		    \
+-                                 %{!preload:-lgcrt1.o %(darwin_crt2)}}}}    \
++                                 %{!preload:-lgcrt1.o                       \
++                                 %:version-compare(>= 10.8 mmacosx-version-min= -no_new_main) \
++                                 %(darwin_crt2)}}}}    \
+                 %{!pg:%{static:-lcrt0.o}				    \
+                       %{!static:%{object:-lcrt0.o}			    \
+                                 %{!object:%{preload:-lcrt0.o}		    \
+@@ -379,7 +381,7 @@
+ #define DARWIN_CRT1_SPEC						\
+   "%:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o)		\
+    %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lcrt1.10.5.o)	\
+-   %:version-compare(>= 10.6 mmacosx-version-min= -lcrt1.10.6.o)	\
++   %:version-compare(>< 10.6 10.8 mmacosx-version-min= -lcrt1.10.6.o)	\
+    %{fgnu-tm: -lcrttms.o}"
+ 
+ /* Default Darwin ASM_SPEC, very simple.  */
+@@ -414,6 +416,8 @@
+ 
+ #define TARGET_WANT_DEBUG_PUB_SECTIONS true
+ 
++#define TARGET_FORCE_AT_COMP_DIR true
++
+ /* When generating stabs debugging, use N_BINCL entries.  */
+ 
+ #define DBX_USE_BINCL
+diff -uNr gcc/doc/tm.texi gcc/doc/tm.texi
+--- gcc/doc/tm.texi	2012-01-26 16:48:27.000000000 -0500
++++ gcc/doc/tm.texi	2012-06-08 08:54:25.000000000 -0400
+@@ -9487,6 +9487,10 @@
+ True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections should be emitted.  These sections are not used on most platforms, and in particular GDB does not use them.
+ @end deftypevr
+ 
++@deftypevr {Target Hook} bool TARGET_FORCE_AT_COMP_DIR
++True if the @code{DW_AT_comp_dir} attribute should be emitted for each  compilation unit.  This attribute is required for the darwin linker  to emit debug information.
++@end deftypevr
++
+ @deftypevr {Target Hook} bool TARGET_DELAY_SCHED2
+ True if sched2 is not to be run at its normal place.  This usually means it will be run as part of machine-specific reorg.
+ @end deftypevr
+diff -uNr gcc/doc/tm.texi.in gcc/doc/tm.texi.in
+--- gcc/doc/tm.texi.in	2012-01-26 16:48:27.000000000 -0500
++++ gcc/doc/tm.texi.in	2012-06-08 08:54:25.000000000 -0400
+@@ -9386,6 +9386,8 @@
+ 
+ @hook TARGET_WANT_DEBUG_PUB_SECTIONS
+ 
++@hook TARGET_FORCE_AT_COMP_DIR
++
+ @hook TARGET_DELAY_SCHED2
+ 
+ @hook TARGET_DELAY_VARTRACK
+diff -uNr gcc/dwarf2out.c gcc/dwarf2out.c
+--- gcc/dwarf2out.c	2012-06-04 09:24:24.000000000 -0400
++++ gcc/dwarf2out.c	2012-06-08 08:54:25.000000000 -0400
+@@ -22501,7 +22501,7 @@
+   /* Add the name for the main input file now.  We delayed this from
+      dwarf2out_init to avoid complications with PCH.  */
+   add_name_attribute (comp_unit_die (), remap_debug_filename (filename));
+-  if (!IS_ABSOLUTE_PATH (filename))
++  if (!IS_ABSOLUTE_PATH (filename) || targetm.force_at_comp_dir)
+     add_comp_dir_attribute (comp_unit_die ());
+   else if (get_AT (comp_unit_die (), DW_AT_comp_dir) == NULL)
+     {
+diff -uNr gcc/target.def gcc/target.def
+--- gcc/target.def	2012-01-26 16:48:27.000000000 -0500
++++ gcc/target.def	2012-06-08 08:54:25.000000000 -0400
+@@ -2748,6 +2748,13 @@
+  bool, false)
+ 
+ DEFHOOKPOD
++(force_at_comp_dir,
++ "True if the @code{DW_AT_comp_dir} attribute should be emitted for each \
++ compilation unit.  This attribute is required for the darwin linker \
++ to emit debug information.",
++ bool, false)
++
++DEFHOOKPOD
+ (delay_sched2, "True if sched2 is not to be run at its normal place.  \
+ This usually means it will be run as part of machine-specific reorg.",
+ bool, false)
Index: unk/dports/lang/gcc47/files/no-runtime-stubs.patch
===================================================================
--- /trunk/dports/lang/gcc47/files/no-runtime-stubs.patch	(revision 98486)
+++ 	(revision )
@@ -1,34 +1,0 @@
---- gcc/config/darwin.h.orig	2012-09-13 20:20:33.000000000 -0700
-+++ gcc/config/darwin.h	2012-09-13 20:23:03.000000000 -0700
-@@ -325,17 +325,8 @@ extern GTY(()) int darwin_ms_struct;
- #undef REAL_LIBGCC_SPEC
- #define REAL_LIBGCC_SPEC						   \
-    "%{static-libgcc|static: -lgcc_eh -lgcc;				   \
--      shared-libgcc|fexceptions|fgnu-runtime:				   \
--       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4)	   \
--       %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5)   \
--       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4)	   \
--       %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5)	   \
--       -lgcc ;								   \
--      :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
--       %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5)   \
--       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4)	   \
--       %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5)	   \
--       -lgcc }"
-+      shared-libgcc|fexceptions|fgnu-runtime: -lgcc;			   \
-+      : -lgcc }"
- 
- /* We specify crt0.o as -lcrt0.o so that ld will search the library path.
- 
---- libgcc/config/t-slibgcc-darwin.orig	2012-09-13 20:26:11.000000000 -0700
-+++ libgcc/config/t-slibgcc-darwin	2012-09-13 20:27:08.000000000 -0700
-@@ -39,7 +39,7 @@ endif
- 
- LGCC_FILES = libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)
- LGCC_FILES += $(LGCC_STUBS)
--LEXT_STUBS = libgcc_ext.10.4$(SHLIB_EXT) libgcc_ext.10.5$(SHLIB_EXT)
-+LEXT_STUBS =
- LGCC_FILES += $(LEXT_STUBS)
- INSTALL_FILES=$(LGCC_FILES)
- 
-
Index: /trunk/dports/lang/gcc48/Portfile
===================================================================
--- /trunk/dports/lang/gcc48/Portfile	(revision 98486)
+++ /trunk/dports/lang/gcc48/Portfile	(revision 98487)
@@ -8,4 +8,5 @@
 
 version             4.8-20120930
+# reset revision in libstdcxx-devel upon bump
 revision            1
 platforms           darwin
@@ -108,9 +109,12 @@
 if {${subport} == "libstdcxx-devel"} {
     conflicts       libstdcxx
+
+    # delete this revision as well when bumping base version
+    revision 2
     
-    # We might want to consider adding this patch to the gcc subport as well
-    # since it removes stuff that doesn't really make sense in the context of
-    # MacPorts
-    patchfiles-append  no-runtime-stubs.patch
+    post-patch {
+        # Force linking against a static libgcc
+        reinplace "/DENABLE_SHARED_LIBGCC/d" ${patch.dir}/gcc/Makefile.in
+    }
 
     depends_run-delete port:${subport}
Index: unk/dports/lang/gcc48/files/no-runtime-stubs.patch
===================================================================
--- /trunk/dports/lang/gcc48/files/no-runtime-stubs.patch	(revision 98486)
+++ 	(revision )
@@ -1,34 +1,0 @@
---- gcc/config/darwin.h.orig	2012-09-13 20:20:33.000000000 -0700
-+++ gcc/config/darwin.h	2012-09-13 20:23:03.000000000 -0700
-@@ -325,17 +325,8 @@ extern GTY(()) int darwin_ms_struct;
- #undef REAL_LIBGCC_SPEC
- #define REAL_LIBGCC_SPEC						   \
-    "%{static-libgcc|static: -lgcc_eh -lgcc;				   \
--      shared-libgcc|fexceptions|fgnu-runtime:				   \
--       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4)	   \
--       %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5)   \
--       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4)	   \
--       %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5)	   \
--       -lgcc ;								   \
--      :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
--       %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5)   \
--       %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4)	   \
--       %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5)	   \
--       -lgcc }"
-+      shared-libgcc|fexceptions|fgnu-runtime: -lgcc;			   \
-+      : -lgcc }"
- 
- /* We specify crt0.o as -lcrt0.o so that ld will search the library path.
- 
---- libgcc/config/t-slibgcc-darwin.orig	2012-09-13 20:26:11.000000000 -0700
-+++ libgcc/config/t-slibgcc-darwin	2012-09-13 20:27:08.000000000 -0700
-@@ -39,7 +39,7 @@ endif
- 
- LGCC_FILES = libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)
- LGCC_FILES += $(LGCC_STUBS)
--LEXT_STUBS = libgcc_ext.10.4$(SHLIB_EXT) libgcc_ext.10.5$(SHLIB_EXT)
-+LEXT_STUBS =
- LGCC_FILES += $(LEXT_STUBS)
- INSTALL_FILES=$(LGCC_FILES)
- 
-
