Fix libgcc symbols for sh4

kaz Kojima kkojima@rr.iij4u.or.jp
Fri Aug 22 00:10:00 GMT 2003


kaz Kojima <kkojima@rr.iij4u.or.jp> wrote:
> Dan Kegel <dank@kegel.com> wrote:
>> Uh-oh.  Then I guess I'm back to square one... Here's the original problem
>> that patch was supposed to fix:
>> 
>>> Building gcc-3.4-20030813 on x86 with target sh4-linux fails for me while
>>> linking libstdc++-v3/testsuite/abi_check.c. ...
>[snip]
>> Do you see this failure?
> 
> I see it when "make check" but not when building libstdc++-v3.

I'm using a ld script libgcc_s.so as a workaround. Attached is
the patch I use, though it could be wrong.

Regards,
	kaz
--
	* config/sh/t-linux (SHLIB_LINK): Override to use a linker script.
	(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 Aug 17 16:08:25 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)



More information about the Gcc-patches mailing list