--- a/gcc/ada/link.c 2004-09-13 12:18:40.000000000 +0200
+++ b/gcc/ada/link.c 2004-09-26 12:24:29.079704096 +0200
-@@ -164,9 +164,9 @@
+@@ -157,10 +157,10 @@
- #elif defined (linux)
- const char *__gnat_object_file_option = "";
+ #elif defined (linux) || defined(__GLIBC__)
+ const char *__gnat_object_file_option = "-Wl,@";
-const char *__gnat_run_path_option = "-Wl,-rpath,";
--char __gnat_shared_libgnat_default = STATIC;
--int __gnat_link_max = 8192;
+const char *__gnat_run_path_option = "";
-+char __gnat_shared_libgnat_default = SHARED;
+ char __gnat_shared_libgnat_default = STATIC;
+-char __gnat_shared_libgcc_default = STATIC;
+-int __gnat_link_max = 8192;
++char __gnat_shared_libgcc_default = SHARED;
+int __gnat_link_max = 131072;
unsigned char __gnat_objlist_file_supported = 1;
- unsigned char __gnat_using_gnu_linker = 1;
const char *__gnat_object_library_extension = ".a";
---- a/gcc/ada/Make-lang.in 2004-09-01 12:46:47.000000000 +0200
-+++ b/gcc/ada/Make-lang.in 2004-09-26 12:21:15.135188144 +0200
+ unsigned char __gnat_separate_run_path_options = 0;
+--- a/gcc/ada/gcc-interface/Make-lang.in 2004-09-01 12:46:47.000000000 +0200
++++ b/gcc/ada/gcc-interface/Make-lang.in 2004-09-26 12:21:15.135188144 +0200
@@ -378,7 +378,7 @@
ada/doctools/xgnatugn$(build_exeext): ada/xgnatugn.adb
-$(MKDIR) ada/doctools
$(CP) $^ ada/doctools
- cd ada/doctools && $(GNATMAKE) -q xgnatugn
-+ cd ada/doctools && $(GNATMAKE) -q xgnatugn -a0../rts
++ cd ada/doctools && $(GNATMAKE) -q xgnatugn -aO../rts
# Note that gnat_ugn_unw.texi does not depend on xgnatugn
# being built so we can distribute a pregenerated gnat_ugn_unw.info
---- a/gcc/ada/Makefile.in 2005-05-26 10:48:40.000000000 +0000
-+++ b/gcc/ada/Makefile.in 2005-05-26 10:59:25.000000000 +0000
-@@ -138,7 +138,7 @@
+--- a/gcc/ada/gcc-interface/Makefile.in 2005-05-26 10:48:40.000000000 +0000
++++ b/gcc/ada/gcc-interface/Makefile.in 2005-05-26 10:59:25.000000000 +0000
+@@ -126,7 +126,7 @@
objext = .o
exeext =
arext = .a
shext =
hyphen = -
-@@ -1669,7 +1669,7 @@
-
- LIBGNAT=../rts/libgnat.a
+@@ -193,7 +193,7 @@
+ # Link flags used to build gnat tools. By default we prefer to statically
+ # link with libgcc to avoid a dependency on shared libgcc (which is tricky
+ # to deal with as it may conflict with the libgcc provided by the system).
+-GCC_LINK_FLAGS=-static-libgcc
++GCC_LINK_FLAGS=
--GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES)
-+GCC_LINK=$(CC) $(ADA_INCLUDES)
+ # End of variables for you to override.
- # when compiling the tools, the runtime has to be first on the path so that
- # it hides the runtime files lying with the rest of the sources
-@@ -1948,7 +1948,8 @@
+@@ -2489,7 +2489,8 @@
-o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_TASKING_OBJS) \
$(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(THREADSLIB)
+ $(THREADSLIB) \
+ ./libgnat-$(LIBRARY_VERSION)$(soext)
- cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
libgnat$(soext)
- cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
-@@ -1995,7 +1996,7 @@
- THREAD_KIND="$(THREAD_KIND)" \
+ cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+--- a/gcc/ada/gcc-interface/Makefile.in~ 2011-03-27 13:01:06.697666231 +0200
++++ b/gcc/ada/gcc-interface/Makefile.in 2011-03-27 13:08:55.725801177 +0200
+@@ -2612,14 +2612,14 @@
gnatlib
- $(RM) rts/libgna*$(soext)
-- cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
-+ cd rts; ../../xgcc -B../../ -shared -shared-libgcc $(TARGET_LIBGCC2_CFLAGS) \
+ $(RM) $(RTSDIR)/libgna*$(soext)
+ cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
+- | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
++ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc $(GNATLIBCFLAGS) \
+ $(PICFLAG_FOR_TARGET) \
-o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
+ $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(MISCLIB) -lm
+ cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
+- | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
++ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc $(GNATLIBCFLAGS) \
+ $(PICFLAG_FOR_TARGET) \
+ -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_TASKING_OBJS) \
+