[PATCH] Fix PR target/30572 libgcc_s install name

Etsushi Kato ek.kato@gmail.com
Tue Dec 18 02:28:00 GMT 2007


Hi,

Here is a patch to keep slibdir defined while making libgcc_s* to add
appropriate install names on darwin.  Without this, install name of
libgcc_s.1dylib becomes '/libgcc_s.1.dylib' and all binaries linked to
the library won't work.

I've tested this patch on Mac OS X 10.4.11 and Fedora 8.  Could
someone commit this for trunk?


2007-12-18  Etsushi Kato  <ek.kato@gmail.com>

	PR target/30572
	* libgcc/Makefile.in: Install libgcc_s.* with slibdir defined
	to keep install names correctly on darwin.
	

Index: libgcc/Makefile.in
===================================================================
--- libgcc/Makefile.in	(revision 131004)
+++ libgcc/Makefile.in	(working copy)
@@ -100,8 +100,17 @@
 	# in-tree libraries, and DejaGNU) know about the layout
 	# of the build tree, for now.
 	$(MAKE) install DESTDIR=$(gcc_objdir) \
-	  slibdir= libsubdir= MULTIOSDIR=$(MULTIDIR)
+	  slibdir=$(slibdir) libsubdir= MULTIOSDIR=$(MULTIDIR)

+	objdir="$(gcc_objdir)/$(slibdir)";		\
+	if test -d $$objdir; then			\
+	  for file in $$objdir/libgcc_s*; do		\
+	    if test -f $$file -o -L $$file; then	\
+	      mv -f $$file $(gcc_objdir)/;		\
+	    fi;						\
+	  done;						\
+	fi
+
 .PHONY: all-multi
 all-multi:
 	# If this is the top-level multilib, build all the other


-- 
Etsushi Kato
ek.kato@gmail.com



More information about the Gcc-patches mailing list