diff -uNr gcc-4.6-20100629/libjava/configure gcc-4.6-20100629.fink/libjava/configure
--- gcc-4.6-20100629/libjava/configure	2010-06-11 00:12:38.000000000 -0400
+++ gcc-4.6-20100629.fink/libjava/configure	2010-06-29 17:51:26.000000000 -0400
@@ -1610,6 +1610,8 @@
                           default=yes
   --enable-java-maintainer-mode
                           allow rebuilding of .class and .h files
+  --enable-libjava-multilib
+                          build libjava as multilib
   --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors
   --enable-maintainer-mode  enable make rules and dependencies not useful
@@ -3353,6 +3355,16 @@
 fi
 
 
+# Check whether --enable-libjava-multilib was given.
+if test "${enable_libjava_multilib+set}" = set; then
+  enableval=$enable_libjava_multilib;
+fi
+
+if test "$enable_libjava_multilib" = no; then
+  multilib=no
+  ac_configure_args="$ac_configure_args --disable-multilib"
+fi
+
 # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
 
 
diff -uNr gcc-4.6-20100629/libjava/configure.ac gcc-4.6-20100629.fink/libjava/configure.ac
--- gcc-4.6-20100629/libjava/configure.ac	2010-06-11 00:12:38.000000000 -0400
+++ gcc-4.6-20100629.fink/libjava/configure.ac	2010-06-29 17:51:26.000000000 -0400
@@ -139,6 +139,13 @@
 	[allow rebuilding of .class and .h files]))
 AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
 
+AC_ARG_ENABLE(libjava-multilib,
+	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
+if test "$enable_libjava_multilib" = no; then
+  multilib=no
+  ac_configure_args="$ac_configure_args --disable-multilib"
+fi
+
 # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
 GCC_NO_EXECUTABLES
 
diff -uNr gcc-4.7.1-RC-20120606/gcc/config/darwin.h gcc-4.7.1-RC-20120606.ml/gcc/config/darwin.h
--- gcc-4.7.1-RC-20120606/gcc/config/darwin.h	2012-02-16 03:21:46.000000000 -0500
+++ gcc-4.7.1-RC-20120606.ml/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-4.7.1-RC-20120606/gcc/doc/tm.texi gcc-4.7.1-RC-20120606.ml/gcc/doc/tm.texi
--- gcc-4.7.1-RC-20120606/gcc/doc/tm.texi	2012-01-26 16:48:27.000000000 -0500
+++ gcc-4.7.1-RC-20120606.ml/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-4.7.1-RC-20120606/gcc/doc/tm.texi.in gcc-4.7.1-RC-20120606.ml/gcc/doc/tm.texi.in
--- gcc-4.7.1-RC-20120606/gcc/doc/tm.texi.in	2012-01-26 16:48:27.000000000 -0500
+++ gcc-4.7.1-RC-20120606.ml/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-4.7.1-RC-20120606/gcc/dwarf2out.c gcc-4.7.1-RC-20120606.ml/gcc/dwarf2out.c
--- gcc-4.7.1-RC-20120606/gcc/dwarf2out.c	2012-06-04 09:24:24.000000000 -0400
+++ gcc-4.7.1-RC-20120606.ml/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-4.7.1-RC-20120606/gcc/target.def gcc-4.7.1-RC-20120606.ml/gcc/target.def
--- gcc-4.7.1-RC-20120606/gcc/target.def	2012-01-26 16:48:27.000000000 -0500
+++ gcc-4.7.1-RC-20120606.ml/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)
--- gcc-4.6.1/libquadmath/configure.orig	2011-07-29 21:31:51.000000000 -0400
+++ gcc-4.6.1/libquadmath/configure	2011-07-29 21:32:36.000000000 -0400
@@ -3395,7 +3395,7 @@
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
 $as_echo "$ac_try_echo"; } >&5
   (eval "$ac_try") 2>&5
-  ac_status=$?
+  ac_status=0
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then
     cross_compiling=no
--- gcc-4.7-20130406/libstdc++-v3/config/os/bsd/darwin/os_defines.h.orig	2013-04-09 17:42:03.000000000 -0400
+++ gcc-4.7-20130406/libstdc++-v3/config/os/bsd/darwin/os_defines.h	2013-04-09 17:42:21.000000000 -0400
@@ -42,4 +42,9 @@
 // Static initializer macro is buggy in darwin, see libstdc++/51906
 #define _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC
 
+// Configure checks for nanosleep fail on Darwin, but nanosleep and
+// sched_yield are always available, so use them.
+#define _GLIBCXX_USE_NANOSLEEP 1
+#define _GLIBCXX_USE_SCHED_YIELD 1
+
 #endif
--- gcc-4.7-20130406/libstdc++-v3/acinclude.m4.orig	2012-12-12 10:53:17.000000000 -0500
+++ gcc-4.7-20130406/libstdc++-v3/acinclude.m4	2013-04-09 17:43:44.000000000 -0400
@@ -1132,6 +1132,11 @@
 dnl --disable-libstdcxx-time
 dnl        disables the checks completely
 dnl
+dnl N.B. Darwin provides nanosleep but doesn't support the whole POSIX
+dnl Timers option, so doesn't define _POSIX_TIMERS. Because the test
+dnl below fails Darwin unconditionally defines _GLIBCXX_USE_NANOSLEEP in
+dnl os_defines.h and also defines _GLIBCXX_USE_SCHED_YIELD.
+dnl
 AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
 
   AC_MSG_CHECKING([for clock_gettime, nanosleep and sched_yield])
