--- gcc/libjava/configure.ac.org	2008-01-25 18:55:24.000000000 -0500
+++ gcc/libjava/configure.ac	2008-01-25 18:56:16.000000000 -0500
@@ -82,6 +82,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
 
--- gcc/libjava/configure.org	2008-01-25 18:56:41.000000000 -0500
+++ gcc/libjava/configure	2008-01-25 18:57:21.000000000 -0500
@@ -1018,6 +1018,8 @@
   --enable-gconf-peer     compile GConf native peers for util.preferences
   --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
@@ -1850,6 +1852,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.
 
 
--- gcc-4.4.6/libjava/configure.orig	2011-06-28 23:23:46.000000000 -0400
+++ gcc-4.4.6/libjava/configure	2011-06-28 23:48:05.000000000 -0400
@@ -19167,9 +19167,12 @@
         SYSTEMSPEC="-lunicows $SYSTEMSPEC"
       fi
     ;;
-    *-*-darwin[912]*)
+    *-*-darwin9*)
       SYSTEMSPEC="-allow_stack_execute"
     ;;
+    *-*-darwin[1][1-9]*)
+      SYSTEMSPEC="-no_pie -allow_stack_execute"
+    ;;
     *)
       SYSTEMSPEC=
     ;;
--- gcc-4.4.6/libjava/configure.ac.orig	2011-06-28 23:23:46.000000000 -0400
+++ gcc-4.4.6/libjava/configure.ac	2011-06-28 23:48:05.000000000 -0400
@@ -853,9 +853,12 @@
         SYSTEMSPEC="-lunicows $SYSTEMSPEC"
       fi
     ;;
-    *-*-darwin[[912]]*)
+    *-*-darwin9*)
       SYSTEMSPEC="-allow_stack_execute"
     ;;
+    *-*-darwin[[1]][[1-9]]*)
+      SYSTEMSPEC="-no_pie -allow_stack_execute"
+    ;;
     *)
       SYSTEMSPEC=
     ;;
--- gcc-4.4.6/libjava/libgcj.spec.in.orig	2007-09-04 14:00:31.000000000 -0400
+++ gcc-4.4.6/libjava/libgcj.spec.in	2011-06-28 23:48:05.000000000 -0400
@@ -7,6 +7,6 @@
 *startfile: @THREADSTARTFILESPEC@ %(startfileorig)
 
 %rename lib liborig
-*lib: @LD_START_STATIC_SPEC@ @LIBGCJ_SPEC@ @LD_FINISH_STATIC_SPEC@ -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) @LIBSTDCXXSPEC@ %(liborig)
+*lib: @LD_START_STATIC_SPEC@ @LIBGCJ_SPEC@ @LD_FINISH_STATIC_SPEC@ -lm @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) @LIBSTDCXXSPEC@ %(liborig)
 
 *jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ @BACKTRACESPEC@ @IEEESPEC@ -fkeep-inline-functions
--- gcc-4.4.6/libjava/Makefile.am.orig	2009-12-09 13:46:11.000000000 -0500
+++ gcc-4.4.6/libjava/Makefile.am	2011-06-28 23:48:05.000000000 -0400
@@ -279,7 +279,7 @@
 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) $(THREADLIBS) \
 	$(LIBLTDL) $(SYS_ZLIBS) \
 	-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBICONV)
 libgcj_la_LIBADD = \
 	classpath/native/fdlibm/libfdlibm.la \
 	java/lang/Object.lo \
--- gcc-4.4.6/libjava/Makefile.in.orig	2011-04-16 04:11:00.000000000 -0400
+++ gcc-4.4.6/libjava/Makefile.in	2011-06-28 23:48:05.000000000 -0400
@@ -921,7 +921,7 @@
 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) $(THREADLIBS) \
 	$(LIBLTDL) $(SYS_ZLIBS) \
 	-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
+	$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBICONV)
 
 libgcj_la_LIBADD = \
 	classpath/native/fdlibm/libfdlibm.la \
--- gcc-4.4.6/configure.orig	2010-10-02 07:40:32.000000000 -0400
+++ gcc-4.4.6/configure	2011-06-28 23:48:05.000000000 -0400
@@ -2882,6 +2882,9 @@
     tentative_cc="/usr/cygnus/progressive/bin/gcc"
     host_makefile_frag="config/mh-lynxrs6k"
     ;;
+  i[3456789]86-*-darwin* | x86_64-*-darwin*)
+    host_makefile_frag="config/mh-x86-darwin"
+    ;;
   powerpc-*-darwin*)
     host_makefile_frag="config/mh-ppc-darwin"
     ;;
--- gcc-4.4.6/configure.ac.orig	2010-10-02 07:40:32.000000000 -0400
+++ gcc-4.4.6/configure.ac	2011-06-28 23:48:05.000000000 -0400
@@ -1091,6 +1091,9 @@
     tentative_cc="/usr/cygnus/progressive/bin/gcc"
     host_makefile_frag="config/mh-lynxrs6k"
     ;;
+  i[[3456789]]86-*-darwin* | x86_64-*-darwin*)
+    host_makefile_frag="config/mh-x86-darwin"
+    ;;
   powerpc-*-darwin*)
     host_makefile_frag="config/mh-ppc-darwin"
     ;;
--- /dev/null	2011-06-28 23:50:27.000000000 -0400
+++ gcc-4.4.6/config/mh-x86-darwin	2011-06-28 23:48:05.000000000 -0400
@@ -0,0 +1,2 @@
+# Ensure we don't try and use -pie, as it is incompatible with pch.
+BOOT_LDFLAGS += `case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`
--- gcc-4.5.4/gcc/testsuite/lib/prune.exp.orig	2011-02-15 19:06:56.000000000 -0500
+++ gcc-4.5.4/gcc/testsuite/lib/prune.exp	2011-06-30 10:44:26.000000000 -0400
@@ -54,6 +54,9 @@
     # Ignore harmless warnings from Xcode 3.2.x.
     regsub -all "(^|\n)\[^\n\]*ld: warning: can't add line info to anonymous symbol\[^\n\]*" $text "" text
 
+    # Ignore harmless warnings from Xcode 4.0.
+    regsub -all "(^|\n)\[^\n\]*ld: warning: could not create compact unwind for\[^\n\]*" $text "" text
+
     #send_user "After:$text\n"
 
     return $text
--- gcc-4.5.4/libstdc++-v3/testsuite/lib/prune.exp.orig	2011-02-15 19:06:56.000000000 -0500
+++ gcc-4.5.4/libstdc++-v3/testsuite/lib/prune.exp	2011-06-30 10:46:54.000000000 -0400
@@ -30,5 +30,9 @@
     regsub -all "(^|\n)\[^\n\]*: Additional NOP may be necessary to workaround Itanium processor A/B step errata" $text "" text
     regsub -all "(^|\n)\[^\n*\]*: Assembler messages:\[^\n\]*" $text "" text
 
+    # Ignore harmless warnings from Xcode 4.0.
+    regsub -all "(^|\n)\[^\n\]*ld: warning: could not create compact unwind for\[^\n\]*" $text "" text
+
+
     return $text
 }
diff -uNr gcc-4.4.7/gcc/doc/c-tree.texi gcc-4.4.7.texinfo5/gcc/doc/c-tree.texi
--- gcc-4.4.7/gcc/doc/c-tree.texi	2009-02-20 10:20:38.000000000 -0500
+++ gcc-4.4.7.texinfo5/gcc/doc/c-tree.texi	2013-05-06 11:48:28.000000000 -0400
@@ -2338,13 +2338,13 @@
 not matter.  The type of the operands and that of the result are
 always of @code{BOOLEAN_TYPE} or @code{INTEGER_TYPE}.
 
-@itemx POINTER_PLUS_EXPR
+@item POINTER_PLUS_EXPR
 This node represents pointer arithmetic.  The first operand is always
 a pointer/reference type.  The second operand is always an unsigned
 integer type compatible with sizetype.  This is the only binary
 arithmetic operand that can operate on pointer types.
 
-@itemx PLUS_EXPR
+@item PLUS_EXPR
 @itemx MINUS_EXPR
 @itemx MULT_EXPR
 These nodes represent various binary arithmetic operations.
diff -uNr gcc-4.4.7/gcc/doc/cppopts.texi gcc-4.4.7.texinfo5/gcc/doc/cppopts.texi
--- gcc-4.4.7/gcc/doc/cppopts.texi	2008-06-15 05:42:13.000000000 -0400
+++ gcc-4.4.7.texinfo5/gcc/doc/cppopts.texi	2013-05-06 11:39:36.000000000 -0400
@@ -758,7 +758,7 @@
 Enable special code to work around file systems which only permit very
 short file names, such as MS-DOS@.
 
-@itemx --help
+@item --help
 @itemx --target-help
 @opindex help
 @opindex target-help
diff -uNr gcc-4.4.7/gcc/doc/invoke.texi gcc-4.4.7.texinfo5/gcc/doc/invoke.texi
--- gcc-4.4.7/gcc/doc/invoke.texi	2011-03-23 18:02:12.000000000 -0400
+++ gcc-4.4.7.texinfo5/gcc/doc/invoke.texi	2013-05-06 11:39:36.000000000 -0400
@@ -4645,11 +4645,11 @@
 @option{-fdump-rtl-ce3} enable dumping after the three
 if conversion passes. 
 
-@itemx -fdump-rtl-cprop_hardreg
+@item -fdump-rtl-cprop_hardreg
 @opindex fdump-rtl-cprop_hardreg
 Dump after hard register copy propagation.
 
-@itemx -fdump-rtl-csa
+@item -fdump-rtl-csa
 @opindex fdump-rtl-csa
 Dump after combining stack adjustments.
 
@@ -4660,11 +4660,11 @@
 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
 the two common sub-expression elimination passes.
 
-@itemx -fdump-rtl-dce
+@item -fdump-rtl-dce
 @opindex fdump-rtl-dce
 Dump after the standalone dead code elimination passes.
 
-@itemx -fdump-rtl-dbr
+@item -fdump-rtl-dbr
 @opindex fdump-rtl-dbr
 Dump after delayed branch scheduling.
 
@@ -4709,7 +4709,7 @@
 @opindex fdump-rtl-initvals
 Dump after the computation of the initial value sets.
 
-@itemx -fdump-rtl-into_cfglayout
+@item -fdump-rtl-into_cfglayout
 @opindex fdump-rtl-into_cfglayout
 Dump after converting to cfglayout mode.
 
@@ -4739,7 +4739,7 @@
 @opindex fdump-rtl-rnreg
 Dump after register renumbering.
 
-@itemx -fdump-rtl-outof_cfglayout
+@item -fdump-rtl-outof_cfglayout
 @opindex fdump-rtl-outof_cfglayout
 Dump after converting from cfglayout mode.
 
@@ -4751,7 +4751,7 @@
 @opindex fdump-rtl-postreload
 Dump after post-reload optimizations.
 
-@itemx -fdump-rtl-pro_and_epilogue
+@item -fdump-rtl-pro_and_epilogue
 @opindex fdump-rtl-pro_and_epilogue
 Dump after generating the function pro and epilogues.
 
