This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] PR40134, use a linker script on arm-linux to link with -lgcc_s -lgcc
- From: Matthias Klose <doko at ubuntu dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Paolo Carlini <paolo dot carlini at oracle dot com>, GCJ-patches <java-patches at gcc dot gnu dot org>
- Date: Tue, 07 Jul 2009 11:03:24 +0200
- Subject: [patch] PR40134, use a linker script on arm-linux to link with -lgcc_s -lgcc
Use a linker script to link with -lgcc_s -lgcc on arm-linux, which allows the
arm-linux target to run the testsuite without regressions with the patch for the
exception propagation support [1] enabled.
The approach taken is the same as used on the sh-linux configuration.
Tested on the 4.4 branch without regressions (c, c++, fortran, objc, obj-c++),
the trunk currently fails to build for unrelated reasons [2]
Ok for the branch (and for the trunk after it bootstraps again)?
Matthias
[1] http://gcc.gnu.org/ml/gcc/2009-05/msg00035.html
[2] http://gcc.gnu.org/PR40651
2009-07-07 Matthias Klose <doko@ubuntu.com>
PR target/40134
* config/arm/t-linux: New.
* config.host (arm*-*-linux*): Add arm/t-linux to tmake_file.
Index: libgcc/config.host
===================================================================
--- libgcc/config.host (revision 149314)
+++ libgcc/config.host (working copy)
@@ -203,6 +203,7 @@
arm*-*-netbsd*)
;;
arm*-*-linux*) # ARM GNU/Linux with ELF
+ tmake_file="arm/t-linux"
;;
arm*-*-uclinux*) # ARM ucLinux
;;
Index: libgcc/config/arm/t-linux
===================================================================
--- libgcc/config/arm/t-linux (revision 0)
+++ libgcc/config/arm/t-linux (revision 0)
@@ -0,0 +1,26 @@
+# Override SHLIB_LINK and SHLIB_INSTALL to use linker script
+# libgcc_s.so.
+SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,--soname=@shlib_base_name@.so.1 \
+ -Wl,--version-script=@shlib_map_file@ \
+ -o @multilib_dir@/@shlib_base_name@.so.1.tmp @multilib_flags@ \
+ @shlib_objs@ -lc && \
+ rm -f @multilib_dir@/@shlib_base_name@.so && \
+ if [ -f @multilib_dir@/@shlib_base_name@.so.1 ]; then \
+ mv -f @multilib_dir@/@shlib_base_name@.so.1 \
+ @multilib_dir@/@shlib_base_name@.so.1.backup; \
+ else true; fi && \
+ mv @multilib_dir@/@shlib_base_name@.so.1.tmp \
+ @multilib_dir@/@shlib_base_name@.so.1 && \
+ (echo "/* GNU ld script"; \
+ echo " Use the shared library, but some functions are only in"; \
+ echo " the static library. */"; \
+ echo "GROUP ( @shlib_base_name@.so.1 libgcc.a )" \
+ ) > @multilib_dir@/@shlib_base_name@.so
+SHLIB_INSTALL = \
+ $(mkinstalldirs) $(DESTDIR)$(slibdir)@shlib_slibdir_qual@; \
+ $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.so.1 \
+ $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so.1; \
+ rm -f $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so; \
+ $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.so \
+ $(DESTDIR)$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so