This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] sh-linux (Was: Fix libgcc symbols for sh4)
- From: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 06 Oct 2003 10:31:20 +0900 (JST)
- Subject: [PATCH] sh-linux (Was: Fix libgcc symbols for sh4)
Hi,
The appended patch is a workaround for the problem pointed out by
Dan Kegel:
<URL:http://gcc.gnu.org/ml/gcc-patches/2003-08/msg01255.html>.
I'd like to check it in to the mainline if there are no objections.
It's not the ideal solution but anyway works on sh-linux over a year.
Bootstrapped and regtested on sh4-unknown-linux-gnu.
Regards,
kaz
--
2003-10-05 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/t-linux (SHLIB_LINK): Override to use a linker script
libgcc_s.so.
(SHLIB_INSTALL): Likewise.
diff -u3prN ORIG/gcc/gcc/config/sh/t-linux LOCAL/gcc/gcc/config/sh/t-linux
--- ORIG/gcc/gcc/config/sh/t-linux Sun Dec 22 08:26:16 2002
+++ LOCAL/gcc/gcc/config/sh/t-linux Sun Sep 28 16:53:33 2003
@@ -13,3 +13,23 @@ EXTRA_MULTILIB_PARTS= crtbegin.o crtend.
# Override t-slibgcc-elf-ver to export some libgcc symbols with
# the symbol versions that glibc used.
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/sh/libgcc-glibc.ver
+
+# Override SHLIB_LINK and SHLIB_INSTALL to use linker script
+# libgcc_s.so.
+SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,--soname=$(SHLIB_SONAME) \
+ -Wl,--version-script=$(SHLIB_MAP) \
+ -o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_SOLINK) && \
+ (echo "/* GNU ld script"; \
+ echo " Use the shared library, but some functions are only in"; \
+ echo " the static library. */"; \
+ echo "GROUP ( $(SHLIB_SONAME) libgcc.a )" \
+ ) > $(SHLIB_SOLINK)
+SHLIB_INSTALL = \
+ $$(SHELL) $$(srcdir)/mkinstalldirs $$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
+ $(INSTALL_DATA) $(SHLIB_NAME) \
+ $$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
+ rm -f $$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
+ $(INSTALL_DATA) $(SHLIB_SOLINK) \
+ $$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)